mobx 4.14.0 → 4.14.1
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/lib/core/globalstate.d.ts +0 -2
- package/lib/mobx.es6.js +25 -23
- package/lib/mobx.js +26 -23
- package/lib/mobx.min.js +1 -1
- package/lib/mobx.module.js +26 -23
- package/lib/mobx.umd.js +26 -23
- package/lib/mobx.umd.min.js +1 -1
- package/lib/utils/comparer.d.ts +2 -0
- package/lib/utils/eq.d.ts +1 -1
- package/package.json +1 -1
|
@@ -95,8 +95,6 @@ export declare class MobXGlobals {
|
|
|
95
95
|
computedConfigurable: boolean;
|
|
96
96
|
disableErrorBoundaries: boolean;
|
|
97
97
|
suppressReactionErrors: boolean;
|
|
98
|
-
currentActionId: number;
|
|
99
|
-
nextActionId: number;
|
|
100
98
|
}
|
|
101
99
|
export declare let globalState: MobXGlobals;
|
|
102
100
|
export declare function isolateGlobalState(): void;
|
package/lib/mobx.es6.js
CHANGED
|
@@ -235,13 +235,17 @@ function identityComparer(a, b) {
|
|
|
235
235
|
function structuralComparer(a, b) {
|
|
236
236
|
return deepEqual(a, b);
|
|
237
237
|
}
|
|
238
|
+
function shallowComparer(a, b) {
|
|
239
|
+
return deepEqual(a, b, 1);
|
|
240
|
+
}
|
|
238
241
|
function defaultComparer(a, b) {
|
|
239
242
|
return areBothNaN(a, b) || identityComparer(a, b);
|
|
240
243
|
}
|
|
241
244
|
const comparer = {
|
|
242
245
|
identity: identityComparer,
|
|
243
246
|
structural: structuralComparer,
|
|
244
|
-
default: defaultComparer
|
|
247
|
+
default: defaultComparer,
|
|
248
|
+
shallow: shallowComparer
|
|
245
249
|
};
|
|
246
250
|
|
|
247
251
|
const enumerableDescriptorCache = {};
|
|
@@ -826,6 +830,10 @@ function changeDependenciesStateTo0(derivation) {
|
|
|
826
830
|
obs[i].lowestObserverState = IDerivationState.UP_TO_DATE;
|
|
827
831
|
}
|
|
828
832
|
|
|
833
|
+
// we don't use globalState for these in order to avoid possible issues with multiple
|
|
834
|
+
// mobx versions
|
|
835
|
+
let currentActionId = 0;
|
|
836
|
+
let nextActionId = 1;
|
|
829
837
|
function createAction(actionName, fn) {
|
|
830
838
|
if (process.env.NODE_ENV !== "production") {
|
|
831
839
|
invariant(typeof fn === "function", "`action` can only be invoked on functions");
|
|
@@ -878,17 +886,17 @@ function _startAction(actionName, scope, args) {
|
|
|
878
886
|
prevAllowStateReads,
|
|
879
887
|
notifySpy,
|
|
880
888
|
startTime,
|
|
881
|
-
actionId:
|
|
882
|
-
parentActionId:
|
|
889
|
+
actionId: nextActionId++,
|
|
890
|
+
parentActionId: currentActionId
|
|
883
891
|
};
|
|
884
|
-
|
|
892
|
+
currentActionId = runInfo.actionId;
|
|
885
893
|
return runInfo;
|
|
886
894
|
}
|
|
887
895
|
function _endAction(runInfo) {
|
|
888
|
-
if (
|
|
896
|
+
if (currentActionId !== runInfo.actionId) {
|
|
889
897
|
fail("invalid action stack. did you forget to finish an action?");
|
|
890
898
|
}
|
|
891
|
-
|
|
899
|
+
currentActionId = runInfo.parentActionId;
|
|
892
900
|
if (runInfo.error !== undefined) {
|
|
893
901
|
globalState.suppressReactionErrors = true;
|
|
894
902
|
}
|
|
@@ -1358,14 +1366,6 @@ class MobXGlobals {
|
|
|
1358
1366
|
* they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836
|
|
1359
1367
|
*/
|
|
1360
1368
|
this.suppressReactionErrors = false;
|
|
1361
|
-
/*
|
|
1362
|
-
* Current action id.
|
|
1363
|
-
*/
|
|
1364
|
-
this.currentActionId = 0;
|
|
1365
|
-
/*
|
|
1366
|
-
* Next action id.
|
|
1367
|
-
*/
|
|
1368
|
-
this.nextActionId = 1;
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
1371
1371
|
let canMergeGlobalState = true;
|
|
@@ -4185,12 +4185,12 @@ function getDebugName(thing, property) {
|
|
|
4185
4185
|
}
|
|
4186
4186
|
|
|
4187
4187
|
const toString = Object.prototype.toString;
|
|
4188
|
-
function deepEqual(a, b) {
|
|
4189
|
-
return eq(a, b);
|
|
4188
|
+
function deepEqual(a, b, depth = -1) {
|
|
4189
|
+
return eq(a, b, depth);
|
|
4190
4190
|
}
|
|
4191
4191
|
// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
|
|
4192
4192
|
// Internal recursive comparison function for `isEqual`.
|
|
4193
|
-
function eq(a, b, aStack, bStack) {
|
|
4193
|
+
function eq(a, b, depth, aStack, bStack) {
|
|
4194
4194
|
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
|
4195
4195
|
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
|
4196
4196
|
if (a === b)
|
|
@@ -4205,10 +4205,6 @@ function eq(a, b, aStack, bStack) {
|
|
|
4205
4205
|
const type = typeof a;
|
|
4206
4206
|
if (type !== "function" && type !== "object" && typeof b != "object")
|
|
4207
4207
|
return false;
|
|
4208
|
-
return deepEq(a, b, aStack, bStack);
|
|
4209
|
-
}
|
|
4210
|
-
// Internal recursive comparison function for `isEqual`.
|
|
4211
|
-
function deepEq(a, b, aStack, bStack) {
|
|
4212
4208
|
// Unwrap any wrapped objects.
|
|
4213
4209
|
a = unwrap(a);
|
|
4214
4210
|
b = unwrap(b);
|
|
@@ -4258,6 +4254,12 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4258
4254
|
return false;
|
|
4259
4255
|
}
|
|
4260
4256
|
}
|
|
4257
|
+
if (depth === 0) {
|
|
4258
|
+
return false;
|
|
4259
|
+
}
|
|
4260
|
+
else if (depth < 0) {
|
|
4261
|
+
depth = -1;
|
|
4262
|
+
}
|
|
4261
4263
|
// Assume equality for cyclic structures. The algorithm for detecting cyclic
|
|
4262
4264
|
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
|
|
4263
4265
|
// Initializing stack of traversed objects.
|
|
@@ -4282,7 +4284,7 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4282
4284
|
return false;
|
|
4283
4285
|
// Deep compare the contents, ignoring non-numeric properties.
|
|
4284
4286
|
while (length--) {
|
|
4285
|
-
if (!eq(a[length], b[length], aStack, bStack))
|
|
4287
|
+
if (!eq(a[length], b[length], depth - 1, aStack, bStack))
|
|
4286
4288
|
return false;
|
|
4287
4289
|
}
|
|
4288
4290
|
}
|
|
@@ -4297,7 +4299,7 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4297
4299
|
while (length--) {
|
|
4298
4300
|
// Deep compare each member
|
|
4299
4301
|
key = keys[length];
|
|
4300
|
-
if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack)))
|
|
4302
|
+
if (!(has$1(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack)))
|
|
4301
4303
|
return false;
|
|
4302
4304
|
}
|
|
4303
4305
|
}
|
package/lib/mobx.js
CHANGED
|
@@ -306,13 +306,17 @@ function identityComparer(a, b) {
|
|
|
306
306
|
function structuralComparer(a, b) {
|
|
307
307
|
return deepEqual(a, b);
|
|
308
308
|
}
|
|
309
|
+
function shallowComparer(a, b) {
|
|
310
|
+
return deepEqual(a, b, 1);
|
|
311
|
+
}
|
|
309
312
|
function defaultComparer(a, b) {
|
|
310
313
|
return areBothNaN(a, b) || identityComparer(a, b);
|
|
311
314
|
}
|
|
312
315
|
var comparer = {
|
|
313
316
|
identity: identityComparer,
|
|
314
317
|
structural: structuralComparer,
|
|
315
|
-
default: defaultComparer
|
|
318
|
+
default: defaultComparer,
|
|
319
|
+
shallow: shallowComparer
|
|
316
320
|
};
|
|
317
321
|
|
|
318
322
|
var enumerableDescriptorCache = {};
|
|
@@ -897,6 +901,10 @@ function changeDependenciesStateTo0(derivation) {
|
|
|
897
901
|
obs[i].lowestObserverState = exports.IDerivationState.UP_TO_DATE;
|
|
898
902
|
}
|
|
899
903
|
|
|
904
|
+
// we don't use globalState for these in order to avoid possible issues with multiple
|
|
905
|
+
// mobx versions
|
|
906
|
+
var currentActionId = 0;
|
|
907
|
+
var nextActionId = 1;
|
|
900
908
|
function createAction(actionName, fn) {
|
|
901
909
|
if (process.env.NODE_ENV !== "production") {
|
|
902
910
|
invariant(typeof fn === "function", "`action` can only be invoked on functions");
|
|
@@ -949,17 +957,17 @@ function _startAction(actionName, scope, args) {
|
|
|
949
957
|
prevAllowStateReads: prevAllowStateReads,
|
|
950
958
|
notifySpy: notifySpy,
|
|
951
959
|
startTime: startTime,
|
|
952
|
-
actionId:
|
|
953
|
-
parentActionId:
|
|
960
|
+
actionId: nextActionId++,
|
|
961
|
+
parentActionId: currentActionId
|
|
954
962
|
};
|
|
955
|
-
|
|
963
|
+
currentActionId = runInfo.actionId;
|
|
956
964
|
return runInfo;
|
|
957
965
|
}
|
|
958
966
|
function _endAction(runInfo) {
|
|
959
|
-
if (
|
|
967
|
+
if (currentActionId !== runInfo.actionId) {
|
|
960
968
|
fail("invalid action stack. did you forget to finish an action?");
|
|
961
969
|
}
|
|
962
|
-
|
|
970
|
+
currentActionId = runInfo.parentActionId;
|
|
963
971
|
if (runInfo.error !== undefined) {
|
|
964
972
|
globalState.suppressReactionErrors = true;
|
|
965
973
|
}
|
|
@@ -1437,14 +1445,6 @@ var MobXGlobals = /** @class */ (function () {
|
|
|
1437
1445
|
* they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836
|
|
1438
1446
|
*/
|
|
1439
1447
|
this.suppressReactionErrors = false;
|
|
1440
|
-
/*
|
|
1441
|
-
* Current action id.
|
|
1442
|
-
*/
|
|
1443
|
-
this.currentActionId = 0;
|
|
1444
|
-
/*
|
|
1445
|
-
* Next action id.
|
|
1446
|
-
*/
|
|
1447
|
-
this.nextActionId = 1;
|
|
1448
1448
|
}
|
|
1449
1449
|
return MobXGlobals;
|
|
1450
1450
|
}());
|
|
@@ -4327,12 +4327,13 @@ function getDebugName(thing, property) {
|
|
|
4327
4327
|
}
|
|
4328
4328
|
|
|
4329
4329
|
var toString = Object.prototype.toString;
|
|
4330
|
-
function deepEqual(a, b) {
|
|
4331
|
-
|
|
4330
|
+
function deepEqual(a, b, depth) {
|
|
4331
|
+
if (depth === void 0) { depth = -1; }
|
|
4332
|
+
return eq(a, b, depth);
|
|
4332
4333
|
}
|
|
4333
4334
|
// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
|
|
4334
4335
|
// Internal recursive comparison function for `isEqual`.
|
|
4335
|
-
function eq(a, b, aStack, bStack) {
|
|
4336
|
+
function eq(a, b, depth, aStack, bStack) {
|
|
4336
4337
|
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
|
4337
4338
|
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
|
4338
4339
|
if (a === b)
|
|
@@ -4347,10 +4348,6 @@ function eq(a, b, aStack, bStack) {
|
|
|
4347
4348
|
var type = typeof a;
|
|
4348
4349
|
if (type !== "function" && type !== "object" && typeof b != "object")
|
|
4349
4350
|
return false;
|
|
4350
|
-
return deepEq(a, b, aStack, bStack);
|
|
4351
|
-
}
|
|
4352
|
-
// Internal recursive comparison function for `isEqual`.
|
|
4353
|
-
function deepEq(a, b, aStack, bStack) {
|
|
4354
4351
|
// Unwrap any wrapped objects.
|
|
4355
4352
|
a = unwrap(a);
|
|
4356
4353
|
b = unwrap(b);
|
|
@@ -4400,6 +4397,12 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4400
4397
|
return false;
|
|
4401
4398
|
}
|
|
4402
4399
|
}
|
|
4400
|
+
if (depth === 0) {
|
|
4401
|
+
return false;
|
|
4402
|
+
}
|
|
4403
|
+
else if (depth < 0) {
|
|
4404
|
+
depth = -1;
|
|
4405
|
+
}
|
|
4403
4406
|
// Assume equality for cyclic structures. The algorithm for detecting cyclic
|
|
4404
4407
|
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
|
|
4405
4408
|
// Initializing stack of traversed objects.
|
|
@@ -4424,7 +4427,7 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4424
4427
|
return false;
|
|
4425
4428
|
// Deep compare the contents, ignoring non-numeric properties.
|
|
4426
4429
|
while (length--) {
|
|
4427
|
-
if (!eq(a[length], b[length], aStack, bStack))
|
|
4430
|
+
if (!eq(a[length], b[length], depth - 1, aStack, bStack))
|
|
4428
4431
|
return false;
|
|
4429
4432
|
}
|
|
4430
4433
|
}
|
|
@@ -4439,7 +4442,7 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4439
4442
|
while (length--) {
|
|
4440
4443
|
// Deep compare each member
|
|
4441
4444
|
key = keys[length];
|
|
4442
|
-
if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack)))
|
|
4445
|
+
if (!(has$1(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack)))
|
|
4443
4446
|
return false;
|
|
4444
4447
|
}
|
|
4445
4448
|
}
|
package/lib/mobx.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function __extends(e,t){function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}var OBFUSCATED_ERROR="An invariant failed, however the error is obfuscated because this is an production build.",EMPTY_ARRAY=[];Object.freeze(EMPTY_ARRAY);var EMPTY_OBJECT={};Object.freeze(EMPTY_OBJECT);var mockGlobal={};function getGlobal(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:mockGlobal}function getNextId(){return++globalState.mobxGuid}function fail(e){throw invariant(!1,e),"X"}function invariant(e,t){if(!e)throw new Error("[mobx] "+(t||OBFUSCATED_ERROR))}var deprecatedMessages=[];function deprecated(e,t){return!1}function once(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var noop=function(){};function unique(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}function isObject(e){return null!==e&&"object"==typeof e}function isPlainObject(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function convertToMap(e){return isES6Map(e)||isObservableMap(e)?e:Array.isArray(e)?new Map(e):isPlainObject(e)?new Map(Object.entries(e)):fail("Cannot convert to map from '"+e+"'")}function makeNonEnumerable(e,t){for(var r=0;r<t.length;r++)addHiddenProp(e,t[r],e[t[r]])}function addHiddenProp(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function addHiddenFinalProp(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function createInstanceofPredicate(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(e){return isObject(e)&&!0===e[r]}}function areBothNaN(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function isArrayLike(e){return Array.isArray(e)||isObservableArray(e)}function isES6Map(e){return void 0!==getGlobal().Map&&e instanceof getGlobal().Map}function isES6Set(e){return e instanceof Set}function iteratorToArray(e){for(var t=[];;){var r=e.next();if(r.done)break;t.push(r.value)}return t}function primitiveSymbol(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function toPrimitive(e){return null===e?null:"object"==typeof e?""+e:e}function iteratorSymbol(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function declareIterator(e,t){addHiddenFinalProp(e,iteratorSymbol(),t)}function makeIterable(e){return e[iteratorSymbol()]=getSelf,e}function toStringTagSymbol(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function getSelf(){return this}var Atom=function(){function e(e){void 0===e&&(e="Atom@"+getNextId()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=exports.IDerivationState.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return reportObserved(this)},e.prototype.reportChanged=function(){startBatch(),propagateChanged(this),endBatch()},e.prototype.toString=function(){return this.name},e}(),isAtom=createInstanceofPredicate("Atom",Atom);function createAtom(e,t,r){void 0===t&&(t=noop),void 0===r&&(r=noop);var n=new Atom(e);return onBecomeObserved(n,t),onBecomeUnobserved(n,r),n}function identityComparer(e,t){return e===t}function structuralComparer(e,t){return deepEqual(e,t)}function defaultComparer(e,t){return areBothNaN(e,t)||identityComparer(e,t)}var comparer={identity:identityComparer,structural:structuralComparer,default:defaultComparer},enumerableDescriptorCache={},nonEnumerableDescriptorCache={};function createPropertyInitializerDescriptor(e,t){var r=t?enumerableDescriptorCache:nonEnumerableDescriptorCache;return r[e]||(r[e]={configurable:!0,enumerable:t,get:function(){return initializeInstance(this),this[e]},set:function(t){initializeInstance(this),this[e]=t}})}function initializeInstance(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var r in addHiddenProp(e,"__mobxDidRunLazyInitializers",!0),t){var n=t[r];n.propertyCreator(e,n.prop,n.descriptor,n.decoratorTarget,n.decoratorArguments)}}}function createPropDecorator(e,t){return function(){var r,n=function(n,o,a,i){if(!0===i)return t(n,o,a,n,r),null;if(!Object.prototype.hasOwnProperty.call(n,"__mobxDecorators")){var s=n.__mobxDecorators;addHiddenProp(n,"__mobxDecorators",__assign({},s))}return n.__mobxDecorators[o]={prop:o,propertyCreator:t,descriptor:a,decoratorTarget:n,decoratorArguments:r},createPropertyInitializerDescriptor(o,e)};return quacksLikeADecorator(arguments)?(r=EMPTY_ARRAY,n.apply(null,arguments)):(r=Array.prototype.slice.call(arguments),n)}}function quacksLikeADecorator(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]||4===e.length&&!0===e[3]}function deepEnhancer(e,t,r){return isObservable(e)?e:Array.isArray(e)?observable.array(e,{name:r}):isPlainObject(e)?observable.object(e,void 0,{name:r}):isES6Map(e)?observable.map(e,{name:r}):isES6Set(e)?observable.set(e,{name:r}):e}function shallowEnhancer(e,t,r){return null==e?e:isObservableObject(e)||isObservableArray(e)||isObservableMap(e)||isObservableSet(e)?e:Array.isArray(e)?observable.array(e,{name:r,deep:!1}):isPlainObject(e)?observable.object(e,void 0,{name:r,deep:!1}):isES6Map(e)?observable.map(e,{name:r,deep:!1}):isES6Set(e)?observable.set(e,{name:r,deep:!1}):fail(!1)}function referenceEnhancer(e){return e}function refStructEnhancer(e,t,r){return deepEqual(e,t)?t:e}function createDecoratorForEnhancer(e){var t=createPropDecorator(!0,function(t,r,n,o,a){defineObservableProperty(t,r,n?n.initializer?n.initializer.call(t):n.value:void 0,e)}),r=("undefined"!=typeof process&&process.env,t);return r.enhancer=e,r}var defaultCreateObservableOptions={deep:!0,name:void 0,defaultDecorator:void 0},shallowCreateObservableOptions={deep:!1,name:void 0,defaultDecorator:void 0};function asCreateObservableOptions(e){return null==e?defaultCreateObservableOptions:"string"==typeof e?{name:e,deep:!0}:e}function getEnhancerFromOptions(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?referenceEnhancer:deepEnhancer}Object.freeze(defaultCreateObservableOptions),Object.freeze(shallowCreateObservableOptions);var deepDecorator=createDecoratorForEnhancer(deepEnhancer),shallowDecorator=createDecoratorForEnhancer(shallowEnhancer),refDecorator=createDecoratorForEnhancer(referenceEnhancer),refStructDecorator=createDecoratorForEnhancer(refStructEnhancer);function createObservable(e,t,r){if("string"==typeof arguments[1])return deepDecorator.apply(null,arguments);if(isObservable(e))return e;var n=isPlainObject(e)?observable.object(e,t,r):Array.isArray(e)?observable.array(e,t):isES6Map(e)?observable.map(e,t):isES6Set(e)?observable.set(e,t):e;if(n!==e)return n;fail(!1)}var observableFactories={box:function(e,t){arguments.length>2&&incorrectlyUsedAsDecorator("box");var r=asCreateObservableOptions(t);return new ObservableValue(e,getEnhancerFromOptions(r),r.name,!0,r.equals)},shallowBox:function(e,t){return arguments.length>2&&incorrectlyUsedAsDecorator("shallowBox"),deprecated("observable.shallowBox","observable.box(value, { deep: false })"),observable.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&incorrectlyUsedAsDecorator("array");var r=asCreateObservableOptions(t);return new ObservableArray(e,getEnhancerFromOptions(r),r.name)},shallowArray:function(e,t){return arguments.length>2&&incorrectlyUsedAsDecorator("shallowArray"),deprecated("observable.shallowArray","observable.array(values, { deep: false })"),observable.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&incorrectlyUsedAsDecorator("map");var r=asCreateObservableOptions(t);return new ObservableMap(e,getEnhancerFromOptions(r),r.name)},shallowMap:function(e,t){return arguments.length>2&&incorrectlyUsedAsDecorator("shallowMap"),deprecated("observable.shallowMap","observable.map(values, { deep: false })"),observable.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&incorrectlyUsedAsDecorator("set");var r=asCreateObservableOptions(t);return new ObservableSet(e,getEnhancerFromOptions(r),r.name)},object:function(e,t,r){return"string"==typeof arguments[1]&&incorrectlyUsedAsDecorator("object"),extendObservable({},e,t,asCreateObservableOptions(r))},shallowObject:function(e,t){return"string"==typeof arguments[1]&&incorrectlyUsedAsDecorator("shallowObject"),deprecated("observable.shallowObject","observable.object(values, {}, { deep: false })"),observable.object(e,{},{name:t,deep:!1})},ref:refDecorator,shallow:shallowDecorator,deep:deepDecorator,struct:refStructDecorator},observable=createObservable;function incorrectlyUsedAsDecorator(e){fail("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(observableFactories).forEach(function(e){return observable[e]=observableFactories[e]});var TraceMode,computedDecorator=createPropDecorator(!1,function(e,t,r,n,o){var a=r.get,i=r.set,s=o[0]||{};defineComputedProperty(e,t,__assign({get:a,set:i},s))}),computedStructDecorator=computedDecorator({equals:comparer.structural}),computed=function(e,t,r){if("string"==typeof t)return computedDecorator.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return computedDecorator.apply(null,arguments);var n="object"==typeof t?t:{};return n.get=e,n.set="function"==typeof t?t:n.set,n.name=n.name||e.name||"",new ComputedValue(n)};computed.struct=computedStructDecorator,function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(exports.IDerivationState||(exports.IDerivationState={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(TraceMode||(TraceMode={}));var CaughtException=function(){return function(e){this.cause=e}}();function isCaughtException(e){return e instanceof CaughtException}function shouldCompute(e){switch(e.dependenciesState){case exports.IDerivationState.UP_TO_DATE:return!1;case exports.IDerivationState.NOT_TRACKING:case exports.IDerivationState.STALE:return!0;case exports.IDerivationState.POSSIBLY_STALE:for(var t=untrackedStart(),r=e.observing,n=r.length,o=0;o<n;o++){var a=r[o];if(isComputedValue(a)){if(globalState.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return untrackedEnd(t),!0}if(e.dependenciesState===exports.IDerivationState.STALE)return untrackedEnd(t),!0}}return changeDependenciesStateTo0(e),untrackedEnd(t),!1}}function isComputingDerivation(){return null!==globalState.trackingDerivation}function checkIfStateModificationsAreAllowed(e){var t=e.observers.length>0;globalState.computationDepth>0&&t&&fail(!1),globalState.allowStateChanges||!t&&"strict"!==globalState.enforceActions||fail(!1)}function trackDerivedFunction(e,t,r){var n=allowStateReadsStart(!0);changeDependenciesStateTo0(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++globalState.runId;var o,a=globalState.trackingDerivation;if(globalState.trackingDerivation=e,!0===globalState.disableErrorBoundaries)o=t.call(r);else try{o=t.call(r)}catch(e){o=new CaughtException(e)}return globalState.trackingDerivation=a,bindDependencies(e),0===e.observing.length&&warnAboutDerivationWithoutDependencies(e),allowStateReadsEnd(n),o}function warnAboutDerivationWithoutDependencies(e){}function bindDependencies(e){for(var t=e.observing,r=e.observing=e.newObserving,n=exports.IDerivationState.UP_TO_DATE,o=0,a=e.unboundDepsCount,i=0;i<a;i++){0===(s=r[i]).diffValue&&(s.diffValue=1,o!==i&&(r[o]=s),o++),s.dependenciesState>n&&(n=s.dependenciesState)}for(r.length=o,e.newObserving=null,a=t.length;a--;){0===(s=t[a]).diffValue&&removeObserver(s,e),s.diffValue=0}for(;o--;){var s;1===(s=r[o]).diffValue&&(s.diffValue=0,addObserver(s,e))}n!==exports.IDerivationState.UP_TO_DATE&&(e.dependenciesState=n,e.onBecomeStale())}function clearObserving(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)removeObserver(t[r],e);e.dependenciesState=exports.IDerivationState.NOT_TRACKING}function untracked(e){var t=untrackedStart(),r=e();return untrackedEnd(t),r}function untrackedStart(){var e=globalState.trackingDerivation;return globalState.trackingDerivation=null,e}function untrackedEnd(e){globalState.trackingDerivation=e}function allowStateReadsStart(e){var t=globalState.allowStateReads;return globalState.allowStateReads=e,t}function allowStateReadsEnd(e){globalState.allowStateReads=e}function changeDependenciesStateTo0(e){if(e.dependenciesState!==exports.IDerivationState.UP_TO_DATE){e.dependenciesState=exports.IDerivationState.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=exports.IDerivationState.UP_TO_DATE}}function createAction(e,t){var r=function(){return executeAction(e,t,this,arguments)};return r.isMobxAction=!0,r}function executeAction(e,t,r,n){var o=_startAction(e,r,n);try{return t.apply(r,n)}catch(e){throw o.error=e,e}finally{_endAction(o)}}function _startAction(e,t,r){var n=isSpyEnabled()&&!!e,o=0;if(n){o=Date.now();var a=r&&r.length||0,i=new Array(a);if(a>0)for(var s=0;s<a;s++)i[s]=r[s];spyReportStart({type:"action",name:e,object:t,arguments:i})}var c=untrackedStart();startBatch();var l={prevDerivation:c,prevAllowStateChanges:allowStateChangesStart(!0),prevAllowStateReads:allowStateReadsStart(!0),notifySpy:n,startTime:o,actionId:globalState.nextActionId++,parentActionId:globalState.currentActionId};return globalState.currentActionId=l.actionId,l}function _endAction(e){globalState.currentActionId!==e.actionId&&fail("invalid action stack. did you forget to finish an action?"),globalState.currentActionId=e.parentActionId,void 0!==e.error&&(globalState.suppressReactionErrors=!0),allowStateChangesEnd(e.prevAllowStateChanges),allowStateReadsEnd(e.prevAllowStateReads),endBatch(),untrackedEnd(e.prevDerivation),e.notifySpy&&spyReportEnd({time:Date.now()-e.startTime}),globalState.suppressReactionErrors=!1}function allowStateChanges(e,t){var r,n=allowStateChangesStart(e);try{r=t()}finally{allowStateChangesEnd(n)}return r}function allowStateChangesStart(e){var t=globalState.allowStateChanges;return globalState.allowStateChanges=e,t}function allowStateChangesEnd(e){globalState.allowStateChanges=e}function allowStateChangesInsideComputed(e){var t,r=globalState.computationDepth;globalState.computationDepth=0;try{t=e()}finally{globalState.computationDepth=r}return t}var ObservableValue=function(e){function t(t,r,n,o,a){void 0===n&&(n="ObservableValue@"+getNextId()),void 0===o&&(o=!0),void 0===a&&(a=comparer.default);var i=e.call(this,n)||this;return i.enhancer=r,i.name=n,i.equals=a,i.hasUnreportedChange=!1,i.value=r(t,void 0,n),o&&isSpyEnabled()&&spyReport({type:"create",name:i.name,newValue:""+i.value}),i}return __extends(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==globalState.UNCHANGED){var r=isSpyEnabled();r&&spyReportStart({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),r&&spyReportEnd()}},t.prototype.prepareNewValue=function(e){if(checkIfStateModificationsAreAllowed(this),hasInterceptors(this)){var t=interceptChange(this,{object:this,type:"update",newValue:e});if(!t)return globalState.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?globalState.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),hasListeners(this)&¬ifyListeners(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return registerInterceptor(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),registerListener(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return toPrimitive(this.get())},t}(Atom);ObservableValue.prototype[primitiveSymbol()]=ObservableValue.prototype.valueOf;var isObservableValue=createInstanceofPredicate("ObservableValue",ObservableValue),ComputedValue=function(){function e(e){this.dependenciesState=exports.IDerivationState.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=exports.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+getNextId(),this.value=new CaughtException(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=TraceMode.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+getNextId(),e.set&&(this.setter=createAction(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?comparer.structural:comparer.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){propagateMaybeChanged(this)},e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.get=function(){this.isComputing&&fail("Cycle detected in computation "+this.name+": "+this.derivation),0!==globalState.inBatch||0!==this.observers.length||this.keepAlive?(reportObserved(this),shouldCompute(this)&&this.trackAndCompute()&&propagateChangeConfirmed(this)):shouldCompute(this)&&(this.warnAboutUntrackedRead(),startBatch(),this.value=this.computeValue(!1),endBatch());var e=this.value;if(isCaughtException(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(isCaughtException(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){invariant(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else invariant(!1,!1)},e.prototype.trackAndCompute=function(){isSpyEnabled()&&spyReport({object:this.scope,type:"compute",name:this.name});var e=this.value,t=this.dependenciesState===exports.IDerivationState.NOT_TRACKING,r=this.computeValue(!0),n=t||isCaughtException(e)||isCaughtException(r)||!this.equals(e,r);return n&&(this.value=r),n},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,globalState.computationDepth++,e)t=trackDerivedFunction(this,this.derivation,this.scope);else if(!0===globalState.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new CaughtException(e)}return globalState.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(clearObserving(this),this.value=void 0)},e.prototype.observe=function(e,t){var r=this,n=!0,o=void 0;return autorun(function(){var a=r.get();if(!n||t){var i=untrackedStart();e({type:"update",object:r,newValue:a,oldValue:o}),untrackedEnd(i)}n=!1,o=a})},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return toPrimitive(this.get())},e}();ComputedValue.prototype[primitiveSymbol()]=ComputedValue.prototype.valueOf;var isComputedValue=createInstanceofPredicate("ComputedValue",ComputedValue),persistentKeys=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],MobXGlobals=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.currentActionId=0,this.nextActionId=1}}(),canMergeGlobalState=!0,isolateCalled=!1,globalState=function(){var e=getGlobal();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(canMergeGlobalState=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new MobXGlobals).version&&(canMergeGlobalState=!1),canMergeGlobalState?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new MobXGlobals):(setTimeout(function(){isolateCalled||fail("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new MobXGlobals)}();function isolateGlobalState(){(globalState.pendingReactions.length||globalState.inBatch||globalState.isRunningReactions)&&fail("isolateGlobalState should be called before MobX is running any reactions"),isolateCalled=!0,canMergeGlobalState&&(0==--getGlobal().__mobxInstanceCount&&(getGlobal().__mobxGlobals=void 0),globalState=new MobXGlobals)}function getGlobalState(){return globalState}function resetGlobalState(){var e=new MobXGlobals;for(var t in e)-1===persistentKeys.indexOf(t)&&(globalState[t]=e[t]);globalState.allowStateChanges=!globalState.enforceActions}function hasObservers(e){return e.observers&&e.observers.length>0}function getObservers(e){return e.observers}function addObserver(e,t){var r=e.observers.length;r&&(e.observersIndexes[t.__mapid]=r),e.observers[r]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function removeObserver(e,t){if(1===e.observers.length)e.observers.length=0,queueForUnobservation(e);else{var r=e.observers,n=e.observersIndexes,o=r.pop();if(o!==t){var a=n[t.__mapid]||0;a?n[o.__mapid]=a:delete n[o.__mapid],r[a]=o}delete n[t.__mapid]}}function queueForUnobservation(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,globalState.pendingUnobservations.push(e))}function startBatch(){globalState.inBatch++}function endBatch(){if(0==--globalState.inBatch){runReactions();for(var e=globalState.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,0===r.observers.length&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBecomeUnobserved()),r instanceof ComputedValue&&r.suspend())}globalState.pendingUnobservations=[]}}function reportObserved(e){var t=globalState.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&globalState.inBatch>0&&queueForUnobservation(e),!1)}function propagateChanged(e){if(e.lowestObserverState!==exports.IDerivationState.STALE){e.lowestObserverState=exports.IDerivationState.STALE;for(var t=e.observers,r=t.length;r--;){var n=t[r];n.dependenciesState===exports.IDerivationState.UP_TO_DATE&&(n.isTracing!==TraceMode.NONE&&logTraceInfo(n,e),n.onBecomeStale()),n.dependenciesState=exports.IDerivationState.STALE}}}function propagateChangeConfirmed(e){if(e.lowestObserverState!==exports.IDerivationState.STALE){e.lowestObserverState=exports.IDerivationState.STALE;for(var t=e.observers,r=t.length;r--;){var n=t[r];n.dependenciesState===exports.IDerivationState.POSSIBLY_STALE?n.dependenciesState=exports.IDerivationState.STALE:n.dependenciesState===exports.IDerivationState.UP_TO_DATE&&(e.lowestObserverState=exports.IDerivationState.UP_TO_DATE)}}}function propagateMaybeChanged(e){if(e.lowestObserverState===exports.IDerivationState.UP_TO_DATE){e.lowestObserverState=exports.IDerivationState.POSSIBLY_STALE;for(var t=e.observers,r=t.length;r--;){var n=t[r];n.dependenciesState===exports.IDerivationState.UP_TO_DATE&&(n.dependenciesState=exports.IDerivationState.POSSIBLY_STALE,n.isTracing!==TraceMode.NONE&&logTraceInfo(n,e),n.onBecomeStale())}}}function logTraceInfo(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===TraceMode.BREAK){var r=[];printDepTree(getDependencyTree(e),r,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof ComputedValue?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n ")()}}function printDepTree(e,t,r){t.length>=1e3?t.push("(and many more)"):(t.push(""+new Array(r).join("\t")+e.name),e.dependencies&&e.dependencies.forEach(function(e){return printDepTree(e,t,r+1)}))}var Reaction=function(){function e(e,t,r,n){void 0===e&&(e="Reaction@"+getNextId()),void 0===n&&(n=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=exports.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+getNextId(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=TraceMode.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,globalState.pendingReactions.push(this),runReactions())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(startBatch(),this._isScheduled=!1,shouldCompute(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&isSpyEnabled()&&spyReport({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}endBatch()}},e.prototype.track=function(e){startBatch();var t,r=isSpyEnabled();r&&(t=Date.now(),spyReportStart({name:this.name,type:"reaction"})),this._isRunning=!0;var n=trackDerivedFunction(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&clearObserving(this),isCaughtException(n)&&this.reportExceptionInDerivation(n.cause),r&&spyReportEnd({time:Date.now()-t}),endBatch()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(globalState.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";globalState.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),isSpyEnabled()&&spyReport({type:"error",name:this.name,message:r,error:""+e}),globalState.globalReactionErrorHandlers.forEach(function(r){return r(e,t)})}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(startBatch(),clearObserving(this),endBatch()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),trace(this,e)},e}();function onReactionError(e){return globalState.globalReactionErrorHandlers.push(e),function(){var t=globalState.globalReactionErrorHandlers.indexOf(e);t>=0&&globalState.globalReactionErrorHandlers.splice(t,1)}}var MAX_REACTION_ITERATIONS=100,reactionScheduler=function(e){return e()};function runReactions(){globalState.inBatch>0||globalState.isRunningReactions||reactionScheduler(runReactionsHelper)}function runReactionsHelper(){globalState.isRunningReactions=!0;for(var e=globalState.pendingReactions,t=0;e.length>0;){++t===MAX_REACTION_ITERATIONS&&(console.error("Reaction doesn't converge to a stable state after "+MAX_REACTION_ITERATIONS+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,o=r.length;n<o;n++)r[n].runReaction()}globalState.isRunningReactions=!1}var isReaction=createInstanceofPredicate("Reaction",Reaction);function setReactionScheduler(e){var t=reactionScheduler;reactionScheduler=function(r){return e(function(){return t(r)})}}function isSpyEnabled(){return!!globalState.spyListeners.length}function spyReport(e){if(globalState.spyListeners.length)for(var t=globalState.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function spyReportStart(e){spyReport(__assign({},e,{spyReportStart:!0}))}var END_EVENT={spyReportEnd:!0};function spyReportEnd(e){spyReport(e?__assign({},e,{spyReportEnd:!0}):END_EVENT)}function spy(e){return globalState.spyListeners.push(e),once(function(){globalState.spyListeners=globalState.spyListeners.filter(function(t){return t!==e})})}function dontReassignFields(){fail(!1)}function namedActionDecorator(e){return function(t,r,n){if(n){if(n.value)return{value:createAction(e,n.value),enumerable:!1,configurable:!0,writable:!0};var o=n.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return createAction(e,o.call(this))}}}return actionFieldDecorator(e).apply(this,arguments)}}function actionFieldDecorator(e){return function(t,r,n){Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get:function(){},set:function(t){addHiddenProp(this,r,action(e,t))}})}}function boundActionDecorator(e,t,r,n){return!0===n?(defineBoundAction(e,t,r.value),null):r?{configurable:!0,enumerable:!1,get:function(){return defineBoundAction(this,t,r.value||r.initializer.call(this)),this[t]},set:dontReassignFields}:{enumerable:!1,configurable:!0,set:function(e){defineBoundAction(this,t,e)},get:function(){}}}var action=function(e,t,r,n){return 1===arguments.length&&"function"==typeof e?createAction(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?createAction(e,t):1===arguments.length&&"string"==typeof e?namedActionDecorator(e):!0!==n?namedActionDecorator(t).apply(null,arguments):void(e[t]=createAction(e.name||t,r.value))};function runInAction(e,t){return executeAction("string"==typeof e?e:e.name||"<unnamed action>","function"==typeof e?e:t,this,void 0)}function isAction(e){return"function"==typeof e&&!0===e.isMobxAction}function defineBoundAction(e,t,r){addHiddenProp(e,t,createAction(t,r.bind(e)))}function autorun(e,t){void 0===t&&(t=EMPTY_OBJECT);var r,n=t&&t.name||e.name||"Autorun@"+getNextId();if(!t.scheduler&&!t.delay)r=new Reaction(n,function(){this.track(i)},t.onError,t.requiresObservable);else{var o=createSchedulerFromOptions(t),a=!1;r=new Reaction(n,function(){a||(a=!0,o(function(){a=!1,r.isDisposed||r.track(i)}))},t.onError,t.requiresObservable)}function i(){e(r)}return r.schedule(),r.getDisposer()}action.bound=boundActionDecorator;var run=function(e){return e()};function createSchedulerFromOptions(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:run}function reaction(e,t,r){void 0===r&&(r=EMPTY_OBJECT),"boolean"==typeof r&&(r={fireImmediately:r},deprecated("Using fireImmediately as argument is deprecated. Use '{ fireImmediately: true }' instead"));var n,o=r.name||"Reaction@"+getNextId(),a=action(o,r.onError?wrapErrorHandler(r.onError,t):t),i=!r.scheduler&&!r.delay,s=createSchedulerFromOptions(r),c=!0,l=!1,u=r.compareStructural?comparer.structural:r.equals||comparer.default,p=new Reaction(o,function(){c||i?b():l||(l=!0,s(b))},r.onError,r.requiresObservable);function b(){if(l=!1,!p.isDisposed){var t=!1;p.track(function(){var r=e(p);t=c||!u(n,r),n=r}),c&&r.fireImmediately&&a(n,p),c||!0!==t||a(n,p),c&&(c=!1)}}return p.schedule(),p.getDisposer()}function wrapErrorHandler(e,t){return function(){try{return t.apply(this,arguments)}catch(t){e.call(this,t)}}}function onBecomeObserved(e,t,r){return interceptHook("onBecomeObserved",e,t,r)}function onBecomeUnobserved(e,t,r){return interceptHook("onBecomeUnobserved",e,t,r)}function interceptHook(e,t,r,n){var o="function"==typeof n?getAtom(t,r):getAtom(t),a="function"==typeof n?n:r,i=o[e];return"function"!=typeof i?fail(!1):(o[e]=function(){i.call(this),a.call(this)},function(){o[e]=i})}function configure(e){var t=e.enforceActions,r=e.computedRequiresReaction,n=e.computedConfigurable,o=e.disableErrorBoundaries,a=e.arrayBuffer,i=e.reactionScheduler,s=e.reactionRequiresObservable,c=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&isolateGlobalState(),void 0!==t){"boolean"!=typeof t&&"strict"!==t||deprecated("Deprecated value for 'enforceActions', use 'false' => '\"never\"', 'true' => '\"observed\"', '\"strict\"' => \"'always'\" instead");var l=void 0;switch(t){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:fail("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}globalState.enforceActions=l,globalState.allowStateChanges=!0!==l&&"strict"!==l}void 0!==r&&(globalState.computedRequiresReaction=!!r),void 0!==s&&(globalState.reactionRequiresObservable=!!s),void 0!==c&&(globalState.observableRequiresReaction=!!c,globalState.allowStateReads=!globalState.observableRequiresReaction),void 0!==n&&(globalState.computedConfigurable=!!n),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors if this is on."),globalState.disableErrorBoundaries=!!o),"number"==typeof a&&reserveArrayBuffer(a),i&&setReactionScheduler(i)}function decorate(e,t){var r="function"==typeof e?e.prototype:e,n=function(e){var n=t[e];Array.isArray(n)||(n=[n]);var o=Object.getOwnPropertyDescriptor(r,e),a=n.reduce(function(t,n){return n(r,e,t)},o);a&&Object.defineProperty(r,e,a)};for(var o in t)n(o);return e}function extendShallowObservable(e,t,r){return deprecated("'extendShallowObservable' is deprecated, use 'extendObservable(target, props, { deep: false })' instead"),extendObservable(e,t,r,shallowCreateObservableOptions)}function extendObservable(e,t,r,n){var o=(n=asCreateObservableOptions(n)).defaultDecorator||(!1===n.deep?refDecorator:deepDecorator);initializeInstance(e),asObservableObject(e,n.name,o.enhancer),startBatch();try{for(var a in t){var i=Object.getOwnPropertyDescriptor(t,a),s=(r&&a in r?r[a]:i.get?computedDecorator:o)(e,a,i,!0);s&&Object.defineProperty(e,a,s)}}finally{endBatch()}return e}function getDependencyTree(e,t){return nodeToDependencyTree(getAtom(e,t))}function nodeToDependencyTree(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=unique(e.observing).map(nodeToDependencyTree)),t}function getObserverTree(e,t){return nodeToObserverTree(getAtom(e,t))}function nodeToObserverTree(e){var t={name:e.name};return hasObservers(e)&&(t.observers=getObservers(e).map(nodeToObserverTree)),t}var generatorId=0;function flow(e){1!==arguments.length&&fail("Flow expects one 1 argument and cannot be used as decorator");var t=e.name||"<unnamed flow>";return function(){var r,n=arguments,o=++generatorId,a=action(t+" - runid: "+o+" - init",e).apply(this,n),i=void 0,s=new Promise(function(e,n){var s=0;function c(e){var r;i=void 0;try{r=action(t+" - runid: "+o+" - yield "+s++,a.next).call(a,e)}catch(e){return n(e)}u(r)}function l(e){var r;i=void 0;try{r=action(t+" - runid: "+o+" - yield "+s++,a.throw).call(a,e)}catch(e){return n(e)}u(r)}function u(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(i=Promise.resolve(t.value)).then(c,l);t.then(u,n)}r=n,c(void 0)});return s.cancel=action(t+" - runid: "+o+" - cancel",function(){try{i&&cancelPromise(i);var e=a.return(),t=Promise.resolve(e.value);t.then(noop,noop),cancelPromise(t),r(new Error("FLOW_CANCELLED"))}catch(e){r(e)}}),s}}function cancelPromise(e){"function"==typeof e.cancel&&e.cancel()}function interceptReads(e,t,r){var n;if(isObservableMap(e)||isObservableArray(e)||isObservableValue(e))n=getAdministration(e);else{if(!isObservableObject(e))return fail(!1);if("string"!=typeof t)return fail(!1);n=getAdministration(e,t)}return void 0!==n.dehancer?fail(!1):(n.dehancer="function"==typeof t?t:r,function(){n.dehancer=void 0})}function intercept(e,t,r){return"function"==typeof r?interceptProperty(e,t,r):interceptInterceptable(e,t)}function interceptInterceptable(e,t){return getAdministration(e).intercept(t)}function interceptProperty(e,t,r){return getAdministration(e,t).intercept(r)}function _isComputed(e,t){if(null==e)return!1;if(void 0!==t){if(!1===isObservableObject(e))return!1;if(!e.$mobx.values[t])return!1;var r=getAtom(e,t);return isComputedValue(r)}return isComputedValue(e)}function isComputed(e){return arguments.length>1?fail(!1):_isComputed(e)}function isComputedProp(e,t){return"string"!=typeof t?fail(!1):_isComputed(e,t)}function _isObservable(e,t){if(null==e)return!1;if(void 0!==t){if(isObservableObject(e)){var r=e.$mobx;return r.values&&!!r.values[t]}return!1}return isObservableObject(e)||!!e.$mobx||isAtom(e)||isReaction(e)||isComputedValue(e)}function isObservable(e){return 1!==arguments.length&&fail(!1),_isObservable(e)}function isObservableProp(e,t){return"string"!=typeof t?fail(!1):_isObservable(e,t)}function keys(e){return isObservableObject(e)?e.$mobx.getKeys():isObservableMap(e)?e._keys.slice():isObservableSet(e)?iteratorToArray(e.keys()):isObservableArray(e)?e.map(function(e,t){return t}):fail(!1)}function values(e){return isObservableObject(e)?keys(e).map(function(t){return e[t]}):isObservableMap(e)?keys(e).map(function(t){return e.get(t)}):isObservableSet(e)?iteratorToArray(e.values()):isObservableArray(e)?e.slice():fail(!1)}function entries(e){return isObservableObject(e)?keys(e).map(function(t){return[t,e[t]]}):isObservableMap(e)?keys(e).map(function(t){return[t,e.get(t)]}):isObservableSet(e)?iteratorToArray(e.entries()):isObservableArray(e)?e.map(function(e,t){return[t,e]}):fail(!1)}function set(e,t,r){if(2!==arguments.length||isObservableSet(e))if(isObservableObject(e)){var n=e.$mobx;n.values[t]?n.write(e,t,r):defineObservableProperty(e,t,r,n.defaultEnhancer)}else if(isObservableMap(e))e.set(t,r);else if(isObservableSet(e))e.add(t);else{if(!isObservableArray(e))return fail(!1);"number"!=typeof t&&(t=parseInt(t,10)),invariant(t>=0,"Not a valid index: '"+t+"'"),startBatch(),t>=e.length&&(e.length=t+1),e[t]=r,endBatch()}else{startBatch();var o=t;try{for(var a in o)set(e,a,o[a])}finally{endBatch()}}}function remove(e,t){if(isObservableObject(e))e.$mobx.remove(t);else if(isObservableMap(e))e.delete(t);else if(isObservableSet(e))e.delete(t);else{if(!isObservableArray(e))return fail(!1);"number"!=typeof t&&(t=parseInt(t,10)),invariant(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}}function has(e,t){if(isObservableObject(e)){var r=getAdministration(e);return r.getKeys(),!!r.values[t]}return isObservableMap(e)?e.has(t):isObservableSet(e)?e.has(t):isObservableArray(e)?t>=0&&t<e.length:fail(!1)}function get(e,t){if(has(e,t))return isObservableObject(e)?e[t]:isObservableMap(e)?e.get(t):isObservableArray(e)?e[t]:fail(!1)}function observe(e,t,r,n){return"function"==typeof r?observeObservableProperty(e,t,r,n):observeObservable(e,t,r)}function observeObservable(e,t,r){return getAdministration(e).observe(t,r)}function observeObservableProperty(e,t,r,n){return getAdministration(e,t).observe(r,n)}var defaultOptions={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function cache(e,t,r,n){return n.detectCycles&&e.set(t,r),r}function toJSHelper(e,t,r){if(!t.recurseEverything&&!isObservable(e))return e;if("object"!=typeof e)return e;if(null===e)return null;if(e instanceof Date)return e;if(isObservableValue(e))return toJSHelper(e.get(),t,r);if(isObservable(e)&&keys(e),!0===t.detectCycles&&null!==e&&r.has(e))return r.get(e);if(isObservableArray(e)||Array.isArray(e)){var n=cache(r,e,[],t),o=e.map(function(e){return toJSHelper(e,t,r)});n.length=o.length;for(var a=0,i=o.length;a<i;a++)n[a]=o[a];return n}if(isObservableSet(e)||Object.getPrototypeOf(e)===Set.prototype){if(!1===t.exportMapsAsObjects){var s=cache(r,e,new Set,t);return e.forEach(function(e){s.add(toJSHelper(e,t,r))}),s}var c=cache(r,e,[],t);return e.forEach(function(e){c.push(toJSHelper(e,t,r))}),c}if(isObservableMap(e)||Object.getPrototypeOf(e)===Map.prototype){if(!1===t.exportMapsAsObjects){var l=cache(r,e,new Map,t);return e.forEach(function(e,n){l.set(n,toJSHelper(e,t,r))}),l}var u=cache(r,e,{},t);return e.forEach(function(e,n){u[n]=toJSHelper(e,t,r)}),u}var p=cache(r,e,{},t);for(var b in e)p[b]=toJSHelper(e[b],t,r);return p}function toJS(e,t){var r;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=defaultOptions),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(r=new Map),toJSHelper(e,t,r)}function trace(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=!1;"boolean"==typeof e[e.length-1]&&(r=e.pop());var n=getAtomFromArgs(e);if(!n)return fail(!1);n.isTracing===TraceMode.NONE&&console.log("[mobx.trace] '"+n.name+"' tracing enabled"),n.isTracing=r?TraceMode.BREAK:TraceMode.LOG}function getAtomFromArgs(e){switch(e.length){case 0:return globalState.trackingDerivation;case 1:return getAtom(e[0]);case 2:return getAtom(e[0],e[1])}}function transaction(e,t){void 0===t&&(t=void 0),startBatch();try{return e.apply(t)}finally{endBatch()}}function when(e,t,r){return 1===arguments.length||t&&"object"==typeof t?whenPromise(e,t):_when(e,t,r||{})}function _when(e,t,r){var n;"number"==typeof r.timeout&&(n=setTimeout(function(){if(!a.$mobx.isDisposed){a();var e=new Error("WHEN_TIMEOUT");if(!r.onError)throw e;r.onError(e)}},r.timeout)),r.name=r.name||"When@"+getNextId();var o=createAction(r.name+"-effect",t),a=autorun(function(t){e()&&(t.dispose(),n&&clearTimeout(n),o())},r);return a}function whenPromise(e,t){var r,n=new Promise(function(n,o){var a=_when(e,n,__assign({},t,{onError:o}));r=function(){a(),o("WHEN_CANCELLED")}});return n.cancel=r,n}function hasInterceptors(e){return void 0!==e.interceptors&&e.interceptors.length>0}function registerInterceptor(e,t){var r=e.interceptors||(e.interceptors=[]);return r.push(t),once(function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)})}function interceptChange(e,t){var r=untrackedStart();try{var n=e.interceptors;if(n)for(var o=0,a=n.length;o<a&&(invariant(!(t=n[o](t))||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{untrackedEnd(r)}}function hasListeners(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function registerListener(e,t){var r=e.changeListeners||(e.changeListeners=[]);return r.push(t),once(function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)})}function notifyListeners(e,t){var r=untrackedStart(),n=e.changeListeners;if(n){for(var o=0,a=(n=n.slice()).length;o<a;o++)n[o](t);untrackedEnd(r)}}var MAX_SPLICE_SIZE=1e4,safariPrototypeSetterInheritanceBug=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),OBSERVABLE_ARRAY_BUFFER_SIZE=0,StubArray=function(){return function(){}}();function inherit(e,t){void 0!==Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):void 0!==e.prototype.__proto__?e.prototype.__proto__=t:e.prototype=t}inherit(StubArray,Array.prototype),Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(StubArray.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var ObservableArrayAdministration=function(){function e(e,t,r,n){this.array=r,this.owned=n,this.values=[],this.lastKnownLength=0,this.atom=new Atom(e||"ObservableArray@"+getNextId()),this.enhancer=function(r,n){return t(r,n,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return registerInterceptor(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),registerListener(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n<e-t;n++)r[n]=void 0;this.spliceWithArray(t,0,r)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>OBSERVABLE_ARRAY_BUFFER_SIZE&&reserveArrayBuffer(e+t+1)},e.prototype.spliceWithArray=function(e,t,r){var n=this;checkIfStateModificationsAreAllowed(this.atom);var o=this.values.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===r&&(r=EMPTY_ARRAY),hasInterceptors(this)){var a=interceptChange(this,{object:this.array,type:"splice",index:e,removedCount:t,added:r});if(!a)return EMPTY_ARRAY;t=a.removedCount,r=a.added}var i=(r=0===r.length?r:r.map(function(e){return n.enhancer(e,void 0)})).length-t;this.updateArrayLength(o,i);var s=this.spliceItemsIntoValues(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice(e,r,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,r){var n;if(r.length<MAX_SPLICE_SIZE)return(n=this.values).splice.apply(n,__spread([e,t],r));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,r){var n=!this.owned&&isSpyEnabled(),o=hasListeners(this),a=o||n?{object:this.array,type:"update",index:e,newValue:t,oldValue:r}:null;n&&spyReportStart(__assign({},a,{name:this.atom.name})),this.atom.reportChanged(),o&¬ifyListeners(this,a),n&&spyReportEnd()},e.prototype.notifyArraySplice=function(e,t,r){var n=!this.owned&&isSpyEnabled(),o=hasListeners(this),a=o||n?{object:this.array,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;n&&spyReportStart(__assign({},a,{name:this.atom.name})),this.atom.reportChanged(),o&¬ifyListeners(this,a),n&&spyReportEnd()},e}(),ObservableArray=function(e){function t(t,r,n,o){void 0===n&&(n="ObservableArray@"+getNextId()),void 0===o&&(o=!1);var a=e.call(this)||this,i=new ObservableArrayAdministration(n,r,a,o);if(addHiddenFinalProp(a,"$mobx",i),t&&t.length){var s=allowStateChangesStart(!0);a.spliceWithArray(0,0,t),allowStateChangesEnd(s)}return safariPrototypeSetterInheritanceBug&&Object.defineProperty(i.array,"0",ENTRY_0),a}return __extends(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return isObservableArray(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,r){void 0===r&&(r=0),3===arguments.length&&deprecated("The array.find fromIndex argument to find will not be supported anymore in the next major");var n=this.findIndex.apply(this,arguments);return-1===n?void 0:this.get(n)},t.prototype.findIndex=function(e,t,r){void 0===r&&(r=0),3===arguments.length&&deprecated("The array.findIndex fromIndex argument to find will not be supported anymore in the next major");for(var n=this.peek(),o=n.length,a=r;a<o;a++)if(e.call(t,n[a],a,this))return a;return-1},t.prototype.splice=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,r)},t.prototype.spliceWithArray=function(e,t,r){return this.$mobx.spliceWithArray(e,t,r)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.$mobx;return r.spliceWithArray(r.values.length,0,e),r.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.$mobx;return r.spliceWithArray(0,0,e),r.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function r(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(deprecated("observableArray.move is deprecated, use .slice() & .replace() instead"),r.call(this,e),r.call(this,t),e!==t){var n,o=this.$mobx.values;n=e<t?__spread(o.slice(0,e),o.slice(e+1,t+1),[o[e]],o.slice(t+1)):__spread(o.slice(0,t),[o[e]],o.slice(t,e),o.slice(e+1)),this.replace(n)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var r=this.$mobx,n=r.values;if(e<n.length){checkIfStateModificationsAreAllowed(r.atom);var o=n[e];if(hasInterceptors(r)){var a=interceptChange(r,{type:"update",object:this,index:e,newValue:t});if(!a)return;t=a.newValue}(t=r.enhancer(t,o))!==o&&(n[e]=t,r.notifyArrayChildUpdate(e,t,o))}else{if(e!==n.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+n.length);r.spliceWithArray(e,0,[t])}},t}(StubArray);declareIterator(ObservableArray.prototype,function(){this.$mobx.atom.reportObserved();var e=this,t=0;return makeIterable({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})}),Object.defineProperty(ObservableArray.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),addHiddenProp(ObservableArray.prototype,toStringTagSymbol(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];invariant("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),addHiddenProp(ObservableArray.prototype,e,function(){return t.apply(this.peek(),arguments)})}),makeNonEnumerable(ObservableArray.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var ENTRY_0=createArrayEntryDescriptor(0);function createArrayEntryDescriptor(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function createArrayBufferItem(e){Object.defineProperty(ObservableArray.prototype,""+e,createArrayEntryDescriptor(e))}function reserveArrayBuffer(e){for(var t=OBSERVABLE_ARRAY_BUFFER_SIZE;t<e;t++)createArrayBufferItem(t);OBSERVABLE_ARRAY_BUFFER_SIZE=e}reserveArrayBuffer(1e3);var isObservableArrayAdministration=createInstanceofPredicate("ObservableArrayAdministration",ObservableArrayAdministration);function isObservableArray(e){return isObject(e)&&isObservableArrayAdministration(e.$mobx)}var ObservableMapMarker={},ObservableMap=function(){function e(e,t,r){if(void 0===t&&(t=deepEnhancer),void 0===r&&(r="ObservableMap@"+getNextId()),this.enhancer=t,this.name=r,this.$mobx=ObservableMapMarker,this._keys=new ObservableArray(void 0,referenceEnhancer,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!globalState.trackingDerivation)return this._has(e);var r=this._hasMap.get(e);if(!r){var n=r=new ObservableValue(this._has(e),referenceEnhancer,this.name+"."+stringifyKey(e)+"?",!1);this._hasMap.set(e,n),onBecomeUnobserved(n,function(){return t._hasMap.delete(e)})}return r.get()},e.prototype.set=function(e,t){var r=this._has(e);if(hasInterceptors(this)){var n=interceptChange(this,{type:r?"update":"add",object:this,newValue:t,name:e});if(!n)return this;t=n.newValue}return r?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(hasInterceptors(this)&&!(o=interceptChange(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var r=isSpyEnabled(),n=hasListeners(this),o=n||r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return r&&spyReportStart(__assign({},o,{name:this.name,key:e})),transaction(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)}),n&¬ifyListeners(this,o),r&&spyReportEnd(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var r=this._hasMap.get(e);r&&r.setNewValue(t)},e.prototype._updateValue=function(e,t){var r=this._data.get(e);if((t=r.prepareNewValue(t))!==globalState.UNCHANGED){var n=isSpyEnabled(),o=hasListeners(this),a=o||n?{type:"update",object:this,oldValue:r.value,name:e,newValue:t}:null;n&&spyReportStart(__assign({},a,{name:this.name,key:e})),r.setNewValue(t),o&¬ifyListeners(this,a),n&&spyReportEnd()}},e.prototype._addValue=function(e,t){var r=this;transaction(function(){var n=new ObservableValue(t,r.enhancer,r.name+"."+stringifyKey(e),!1);r._data.set(e,n),t=n.value,r._updateHasMapEntry(e,!0),r._keys.push(e)});var n=isSpyEnabled(),o=hasListeners(this),a=o||n?{type:"add",object:this,name:e,newValue:t}:null;n&&spyReportStart(__assign({},a,{name:this.name,key:e})),o&¬ifyListeners(this,a),n&&spyReportEnd()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[iteratorSymbol()]()},e.prototype.values=function(){var e=this,t=0;return makeIterable({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return makeIterable({next:function(){if(t<e._keys.length){var r=e._keys[t++];return{value:[r,e.get(r)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var r=this;this._keys.forEach(function(n){return e.call(t,r.get(n),n,r)})},e.prototype.merge=function(e){var t=this;return isObservableMap(e)&&(e=e.toJS()),transaction(function(){isPlainObject(e)?Object.keys(e).forEach(function(r){return t.set(r,e[r])}):Array.isArray(e)?e.forEach(function(e){var r=__read(e,2),n=r[0],o=r[1];return t.set(n,o)}):isES6Map(e)?e.constructor!==Map?fail("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(e,r){return t.set(r,e)}):null!=e&&fail("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;transaction(function(){untracked(function(){e._keys.slice().forEach(function(t){return e.delete(t)})})})},e.prototype.replace=function(e){var t=this;return transaction(function(){for(var r=convertToMap(e),n=t._keys,o=Array.from(r.keys()),a=!1,i=0;i<n.length;i++){var s=n[i];n.length===o.length&&s!==o[i]&&(a=!0),r.has(s)||(a=!0,t.delete(s))}r.forEach(function(e,r){t._data.has(r)||(a=!0),t.set(r,e)}),a&&t._keys.replace(o)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach(function(r){return t["symbol"==typeof r?r:stringifyKey(r)]=e.get(r)}),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach(function(r){return t.set(r,e.get(r))}),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(t){return stringifyKey(t)+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return registerListener(this,e)},e.prototype.intercept=function(e){return registerInterceptor(this,e)},e}();function stringifyKey(e){return e&&e.toString?e.toString():new String(e).toString()}declareIterator(ObservableMap.prototype,function(){return this.entries()}),addHiddenFinalProp(ObservableMap.prototype,toStringTagSymbol(),"Map");var isObservableMap=createInstanceofPredicate("ObservableMap",ObservableMap),ObservableSetMarker={},ObservableSet=function(){function e(e,t,r){if(void 0===t&&(t=deepEnhancer),void 0===r&&(r="ObservableSet@"+getNextId()),this.name=r,this.$mobx=ObservableSetMarker,this._data=new Set,this._atom=createAtom(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,n){return t(e,n,r)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;transaction(function(){untracked(function(){e._data.forEach(function(t){e.delete(t)})})})},e.prototype.forEach=function(e,t){var r=this;this._data.forEach(function(n){e.call(t,n,n,r)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if((checkIfStateModificationsAreAllowed(this._atom),hasInterceptors(this))&&!(o=interceptChange(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){transaction(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var r=isSpyEnabled(),n=hasListeners(this),o=n||r?{type:"add",object:this,newValue:e}:null;0,n&¬ifyListeners(this,o)}return this},e.prototype.delete=function(e){var t=this;if(hasInterceptors(this)&&!(o=interceptChange(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var r=isSpyEnabled(),n=hasListeners(this),o=n||r?{type:"delete",object:this,oldValue:e}:null;return transaction(function(){t._atom.reportChanged(),t._data.delete(e)}),n&¬ifyListeners(this,o),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=iteratorToArray(this.keys()),r=iteratorToArray(this.values());return makeIterable({next:function(){var n=e;return e+=1,n<r.length?{value:[t[n],r[n]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,r=0;return void 0!==this._data.values?e=iteratorToArray(this._data.values()):(e=[],this._data.forEach(function(t){return e.push(t)})),makeIterable({next:function(){return r<e.length?{value:t.dehanceValue(e[r++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return isObservableSet(e)&&(e=e.toJS()),transaction(function(){Array.isArray(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):isES6Set(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):null!=e&&fail("Cannot initialize set from "+e)}),this},e.prototype.observe=function(e,t){return registerListener(this,e)},e.prototype.intercept=function(e){return registerInterceptor(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+iteratorToArray(this.keys()).join(", ")+" ]"},e}();declareIterator(ObservableSet.prototype,function(){return this.values()}),addHiddenFinalProp(ObservableSet.prototype,toStringTagSymbol(),"Set");var isObservableSet=createInstanceofPredicate("ObservableSet",ObservableSet),ObservableObjectAdministration=function(){function e(e,t,r){this.target=e,this.name=t,this.defaultEnhancer=r,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,r){var n=this.target;n!==e&&this.illegalAccess(e,t);var o=this.values[t];if(o instanceof ComputedValue)o.set(r);else{if(hasInterceptors(this)){if(!(s=interceptChange(this,{type:"update",object:n,name:t,newValue:r})))return;r=s.newValue}if((r=o.prepareNewValue(r))!==globalState.UNCHANGED){var a=hasListeners(this),i=isSpyEnabled(),s=a||i?{type:"update",object:n,oldValue:o.value,name:t,newValue:r}:null;i&&spyReportStart(__assign({},s,{name:this.name,key:t})),o.setNewValue(r),a&¬ifyListeners(this,s),i&&spyReportEnd()}}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(hasInterceptors(this))if(!(a=interceptChange(this,{object:t,name:e,type:"remove"})))return;try{startBatch();var r=hasListeners(this),n=isSpyEnabled(),o=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var a=r||n?{type:"remove",object:t,oldValue:o,name:e}:null;n&&spyReportStart(__assign({},a,{name:this.name,key:e})),r&¬ifyListeners(this,a),n&&spyReportEnd()}finally{endBatch()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return registerListener(this,e)},e.prototype.intercept=function(e){return registerInterceptor(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new ObservableArray(Object.keys(this.values).filter(function(t){return e.values[t]instanceof ObservableValue}),referenceEnhancer,"keys("+this.name+")",!0)),this.keys.slice()},e}();function asObservableObject(e,t,r){void 0===t&&(t=""),void 0===r&&(r=deepEnhancer);var n=e.$mobx;return n||(isPlainObject(e)||(t=(e.constructor.name||"ObservableObject")+"@"+getNextId()),t||(t="ObservableObject@"+getNextId()),addHiddenFinalProp(e,"$mobx",n=new ObservableObjectAdministration(e,t,r)),n)}function defineObservableProperty(e,t,r,n){var o=asObservableObject(e);if(hasInterceptors(o)){var a=interceptChange(o,{object:e,name:t,type:"add",newValue:r});if(!a)return;r=a.newValue}r=(o.values[t]=new ObservableValue(r,n,o.name+"."+t,!1)).value,Object.defineProperty(e,t,generateObservablePropConfig(t)),o.keys&&o.keys.push(t),notifyPropertyAddition(o,e,t,r)}function defineComputedProperty(e,t,r){var n=asObservableObject(e);r.name=n.name+"."+t,r.context=e,n.values[t]=new ComputedValue(r),Object.defineProperty(e,t,generateComputedPropConfig(t))}var observablePropertyConfigs=Object.create(null),computedPropertyConfigs=Object.create(null);function generateObservablePropConfig(e){return observablePropertyConfigs[e]||(observablePropertyConfigs[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}function getAdministrationForComputedPropOwner(e){var t=e.$mobx;return t||(initializeInstance(e),e.$mobx)}function generateComputedPropConfig(e){return computedPropertyConfigs[e]||(computedPropertyConfigs[e]={configurable:globalState.computedConfigurable,enumerable:!1,get:function(){return getAdministrationForComputedPropOwner(this).read(this,e)},set:function(t){getAdministrationForComputedPropOwner(this).write(this,e,t)}})}function notifyPropertyAddition(e,t,r,n){var o=hasListeners(e),a=isSpyEnabled(),i=o||a?{type:"add",object:t,name:r,newValue:n}:null;a&&spyReportStart(__assign({},i,{name:e.name,key:r})),o&¬ifyListeners(e,i),a&&spyReportEnd()}var isObservableObjectAdministration=createInstanceofPredicate("ObservableObjectAdministration",ObservableObjectAdministration);function isObservableObject(e){return!!isObject(e)&&(initializeInstance(e),isObservableObjectAdministration(e.$mobx))}function getAtom(e,t){if("object"==typeof e&&null!==e){if(isObservableArray(e))return void 0!==t&&fail(!1),e.$mobx.atom;if(isObservableSet(e))return e.$mobx;if(isObservableMap(e)){var r=e;return void 0===t?getAtom(r._keys):((n=r._data.get(t)||r._hasMap.get(t))||fail(!1),n)}var n;if(initializeInstance(e),t&&!e.$mobx&&e[t],isObservableObject(e))return t?((n=e.$mobx.values[t])||fail(!1),n):fail(!1);if(isAtom(e)||isComputedValue(e)||isReaction(e))return e}else if("function"==typeof e&&isReaction(e.$mobx))return e.$mobx;return fail(!1)}function getAdministration(e,t){return e||fail("Expecting some object"),void 0!==t?getAdministration(getAtom(e,t)):isAtom(e)||isComputedValue(e)||isReaction(e)?e:isObservableMap(e)||isObservableSet(e)?e:(initializeInstance(e),e.$mobx?e.$mobx:void fail(!1))}function getDebugName(e,t){return(void 0!==t?getAtom(e,t):isObservableObject(e)||isObservableMap(e)||isObservableSet(e)?getAdministration(e):getAtom(e)).name}var g,toString=Object.prototype.toString;function deepEqual(e,t){return eq(e,t)}function eq(e,t,r,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&deepEq(e,t,r,n)}function deepEq(e,t,r,n){e=unwrap(e),t=unwrap(t);var o=toString.call(e);if(o!==toString.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var a="[object Array]"===o;if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var i=e.constructor,s=t.constructor;if(i!==s&&!("function"==typeof i&&i instanceof i&&"function"==typeof s&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[];for(var c=(r=r||[]).length;c--;)if(r[c]===e)return n[c]===t;if(r.push(e),n.push(t),a){if((c=e.length)!==t.length)return!1;for(;c--;)if(!eq(e[c],t[c],r,n))return!1}else{var l=Object.keys(e),u=void 0;if(c=l.length,Object.keys(t).length!==c)return!1;for(;c--;)if(!has$1(t,u=l[c])||!eq(e[u],t[u],r,n))return!1}return r.pop(),n.pop(),!0}function unwrap(e){return isObservableArray(e)?e.peek():isES6Map(e)||isObservableMap(e)?iteratorToArray(e.entries()):isES6Set(e)||isObservableSet(e)?iteratorToArray(e.entries()):e}function has$1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var $mobx="$mobx";"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:spy,extras:{getDebugName:getDebugName},$mobx:$mobx}),exports.$mobx=$mobx,exports.ObservableMap=ObservableMap,exports.ObservableSet=ObservableSet,exports.Reaction=Reaction,exports._allowStateChanges=allowStateChanges,exports._allowStateChangesInsideComputed=allowStateChangesInsideComputed,exports._endAction=_endAction,exports._getAdministration=getAdministration,exports._getGlobalState=getGlobalState,exports._interceptReads=interceptReads,exports._isComputingDerivation=isComputingDerivation,exports._resetGlobalState=resetGlobalState,exports._startAction=_startAction,exports.action=action,exports.autorun=autorun,exports.comparer=comparer,exports.computed=computed,exports.configure=configure,exports.createAtom=createAtom,exports.decorate=decorate,exports.entries=entries,exports.extendObservable=extendObservable,exports.extendShallowObservable=extendShallowObservable,exports.flow=flow,exports.get=get,exports.getAtom=getAtom,exports.getDebugName=getDebugName,exports.getDependencyTree=getDependencyTree,exports.getObserverTree=getObserverTree,exports.has=has,exports.intercept=intercept,exports.isAction=isAction,exports.isArrayLike=isArrayLike,exports.isBoxedObservable=isObservableValue,exports.isComputed=isComputed,exports.isComputedProp=isComputedProp,exports.isObservable=isObservable,exports.isObservableArray=isObservableArray,exports.isObservableMap=isObservableMap,exports.isObservableObject=isObservableObject,exports.isObservableProp=isObservableProp,exports.isObservableSet=isObservableSet,exports.keys=keys,exports.observable=observable,exports.observe=observe,exports.onBecomeObserved=onBecomeObserved,exports.onBecomeUnobserved=onBecomeUnobserved,exports.onReactionError=onReactionError,exports.reaction=reaction,exports.remove=remove,exports.runInAction=runInAction,exports.set=set,exports.spy=spy,exports.toJS=toJS,exports.trace=trace,exports.transaction=transaction,exports.untracked=untracked,exports.values=values,exports.when=when;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function __extends(e,t){function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}var OBFUSCATED_ERROR="An invariant failed, however the error is obfuscated because this is an production build.",EMPTY_ARRAY=[];Object.freeze(EMPTY_ARRAY);var EMPTY_OBJECT={};Object.freeze(EMPTY_OBJECT);var mockGlobal={};function getGlobal(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:mockGlobal}function getNextId(){return++globalState.mobxGuid}function fail(e){throw invariant(!1,e),"X"}function invariant(e,t){if(!e)throw new Error("[mobx] "+(t||OBFUSCATED_ERROR))}var deprecatedMessages=[];function deprecated(e,t){return!1}function once(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var noop=function(){};function unique(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}function isObject(e){return null!==e&&"object"==typeof e}function isPlainObject(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function convertToMap(e){return isES6Map(e)||isObservableMap(e)?e:Array.isArray(e)?new Map(e):isPlainObject(e)?new Map(Object.entries(e)):fail("Cannot convert to map from '"+e+"'")}function makeNonEnumerable(e,t){for(var r=0;r<t.length;r++)addHiddenProp(e,t[r],e[t[r]])}function addHiddenProp(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function addHiddenFinalProp(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function createInstanceofPredicate(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(e){return isObject(e)&&!0===e[r]}}function areBothNaN(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function isArrayLike(e){return Array.isArray(e)||isObservableArray(e)}function isES6Map(e){return void 0!==getGlobal().Map&&e instanceof getGlobal().Map}function isES6Set(e){return e instanceof Set}function iteratorToArray(e){for(var t=[];;){var r=e.next();if(r.done)break;t.push(r.value)}return t}function primitiveSymbol(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function toPrimitive(e){return null===e?null:"object"==typeof e?""+e:e}function iteratorSymbol(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function declareIterator(e,t){addHiddenFinalProp(e,iteratorSymbol(),t)}function makeIterable(e){return e[iteratorSymbol()]=getSelf,e}function toStringTagSymbol(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function getSelf(){return this}var Atom=function(){function e(e){void 0===e&&(e="Atom@"+getNextId()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=exports.IDerivationState.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return reportObserved(this)},e.prototype.reportChanged=function(){startBatch(),propagateChanged(this),endBatch()},e.prototype.toString=function(){return this.name},e}(),isAtom=createInstanceofPredicate("Atom",Atom);function createAtom(e,t,r){void 0===t&&(t=noop),void 0===r&&(r=noop);var n=new Atom(e);return onBecomeObserved(n,t),onBecomeUnobserved(n,r),n}function identityComparer(e,t){return e===t}function structuralComparer(e,t){return deepEqual(e,t)}function shallowComparer(e,t){return deepEqual(e,t,1)}function defaultComparer(e,t){return areBothNaN(e,t)||identityComparer(e,t)}var comparer={identity:identityComparer,structural:structuralComparer,default:defaultComparer,shallow:shallowComparer},enumerableDescriptorCache={},nonEnumerableDescriptorCache={};function createPropertyInitializerDescriptor(e,t){var r=t?enumerableDescriptorCache:nonEnumerableDescriptorCache;return r[e]||(r[e]={configurable:!0,enumerable:t,get:function(){return initializeInstance(this),this[e]},set:function(t){initializeInstance(this),this[e]=t}})}function initializeInstance(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var r in addHiddenProp(e,"__mobxDidRunLazyInitializers",!0),t){var n=t[r];n.propertyCreator(e,n.prop,n.descriptor,n.decoratorTarget,n.decoratorArguments)}}}function createPropDecorator(e,t){return function(){var r,n=function(n,o,a,i){if(!0===i)return t(n,o,a,n,r),null;if(!Object.prototype.hasOwnProperty.call(n,"__mobxDecorators")){var s=n.__mobxDecorators;addHiddenProp(n,"__mobxDecorators",__assign({},s))}return n.__mobxDecorators[o]={prop:o,propertyCreator:t,descriptor:a,decoratorTarget:n,decoratorArguments:r},createPropertyInitializerDescriptor(o,e)};return quacksLikeADecorator(arguments)?(r=EMPTY_ARRAY,n.apply(null,arguments)):(r=Array.prototype.slice.call(arguments),n)}}function quacksLikeADecorator(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]||4===e.length&&!0===e[3]}function deepEnhancer(e,t,r){return isObservable(e)?e:Array.isArray(e)?observable.array(e,{name:r}):isPlainObject(e)?observable.object(e,void 0,{name:r}):isES6Map(e)?observable.map(e,{name:r}):isES6Set(e)?observable.set(e,{name:r}):e}function shallowEnhancer(e,t,r){return null==e?e:isObservableObject(e)||isObservableArray(e)||isObservableMap(e)||isObservableSet(e)?e:Array.isArray(e)?observable.array(e,{name:r,deep:!1}):isPlainObject(e)?observable.object(e,void 0,{name:r,deep:!1}):isES6Map(e)?observable.map(e,{name:r,deep:!1}):isES6Set(e)?observable.set(e,{name:r,deep:!1}):fail(!1)}function referenceEnhancer(e){return e}function refStructEnhancer(e,t,r){return deepEqual(e,t)?t:e}function createDecoratorForEnhancer(e){var t=createPropDecorator(!0,function(t,r,n,o,a){defineObservableProperty(t,r,n?n.initializer?n.initializer.call(t):n.value:void 0,e)}),r=("undefined"!=typeof process&&process.env,t);return r.enhancer=e,r}var defaultCreateObservableOptions={deep:!0,name:void 0,defaultDecorator:void 0},shallowCreateObservableOptions={deep:!1,name:void 0,defaultDecorator:void 0};function asCreateObservableOptions(e){return null==e?defaultCreateObservableOptions:"string"==typeof e?{name:e,deep:!0}:e}function getEnhancerFromOptions(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?referenceEnhancer:deepEnhancer}Object.freeze(defaultCreateObservableOptions),Object.freeze(shallowCreateObservableOptions);var deepDecorator=createDecoratorForEnhancer(deepEnhancer),shallowDecorator=createDecoratorForEnhancer(shallowEnhancer),refDecorator=createDecoratorForEnhancer(referenceEnhancer),refStructDecorator=createDecoratorForEnhancer(refStructEnhancer);function createObservable(e,t,r){if("string"==typeof arguments[1])return deepDecorator.apply(null,arguments);if(isObservable(e))return e;var n=isPlainObject(e)?observable.object(e,t,r):Array.isArray(e)?observable.array(e,t):isES6Map(e)?observable.map(e,t):isES6Set(e)?observable.set(e,t):e;if(n!==e)return n;fail(!1)}var observableFactories={box:function(e,t){arguments.length>2&&incorrectlyUsedAsDecorator("box");var r=asCreateObservableOptions(t);return new ObservableValue(e,getEnhancerFromOptions(r),r.name,!0,r.equals)},shallowBox:function(e,t){return arguments.length>2&&incorrectlyUsedAsDecorator("shallowBox"),deprecated("observable.shallowBox","observable.box(value, { deep: false })"),observable.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&incorrectlyUsedAsDecorator("array");var r=asCreateObservableOptions(t);return new ObservableArray(e,getEnhancerFromOptions(r),r.name)},shallowArray:function(e,t){return arguments.length>2&&incorrectlyUsedAsDecorator("shallowArray"),deprecated("observable.shallowArray","observable.array(values, { deep: false })"),observable.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&incorrectlyUsedAsDecorator("map");var r=asCreateObservableOptions(t);return new ObservableMap(e,getEnhancerFromOptions(r),r.name)},shallowMap:function(e,t){return arguments.length>2&&incorrectlyUsedAsDecorator("shallowMap"),deprecated("observable.shallowMap","observable.map(values, { deep: false })"),observable.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&incorrectlyUsedAsDecorator("set");var r=asCreateObservableOptions(t);return new ObservableSet(e,getEnhancerFromOptions(r),r.name)},object:function(e,t,r){return"string"==typeof arguments[1]&&incorrectlyUsedAsDecorator("object"),extendObservable({},e,t,asCreateObservableOptions(r))},shallowObject:function(e,t){return"string"==typeof arguments[1]&&incorrectlyUsedAsDecorator("shallowObject"),deprecated("observable.shallowObject","observable.object(values, {}, { deep: false })"),observable.object(e,{},{name:t,deep:!1})},ref:refDecorator,shallow:shallowDecorator,deep:deepDecorator,struct:refStructDecorator},observable=createObservable;function incorrectlyUsedAsDecorator(e){fail("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(observableFactories).forEach(function(e){return observable[e]=observableFactories[e]});var TraceMode,computedDecorator=createPropDecorator(!1,function(e,t,r,n,o){var a=r.get,i=r.set,s=o[0]||{};defineComputedProperty(e,t,__assign({get:a,set:i},s))}),computedStructDecorator=computedDecorator({equals:comparer.structural}),computed=function(e,t,r){if("string"==typeof t)return computedDecorator.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return computedDecorator.apply(null,arguments);var n="object"==typeof t?t:{};return n.get=e,n.set="function"==typeof t?t:n.set,n.name=n.name||e.name||"",new ComputedValue(n)};computed.struct=computedStructDecorator,function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(exports.IDerivationState||(exports.IDerivationState={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(TraceMode||(TraceMode={}));var CaughtException=function(){return function(e){this.cause=e}}();function isCaughtException(e){return e instanceof CaughtException}function shouldCompute(e){switch(e.dependenciesState){case exports.IDerivationState.UP_TO_DATE:return!1;case exports.IDerivationState.NOT_TRACKING:case exports.IDerivationState.STALE:return!0;case exports.IDerivationState.POSSIBLY_STALE:for(var t=untrackedStart(),r=e.observing,n=r.length,o=0;o<n;o++){var a=r[o];if(isComputedValue(a)){if(globalState.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return untrackedEnd(t),!0}if(e.dependenciesState===exports.IDerivationState.STALE)return untrackedEnd(t),!0}}return changeDependenciesStateTo0(e),untrackedEnd(t),!1}}function isComputingDerivation(){return null!==globalState.trackingDerivation}function checkIfStateModificationsAreAllowed(e){var t=e.observers.length>0;globalState.computationDepth>0&&t&&fail(!1),globalState.allowStateChanges||!t&&"strict"!==globalState.enforceActions||fail(!1)}function trackDerivedFunction(e,t,r){var n=allowStateReadsStart(!0);changeDependenciesStateTo0(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++globalState.runId;var o,a=globalState.trackingDerivation;if(globalState.trackingDerivation=e,!0===globalState.disableErrorBoundaries)o=t.call(r);else try{o=t.call(r)}catch(e){o=new CaughtException(e)}return globalState.trackingDerivation=a,bindDependencies(e),0===e.observing.length&&warnAboutDerivationWithoutDependencies(e),allowStateReadsEnd(n),o}function warnAboutDerivationWithoutDependencies(e){}function bindDependencies(e){for(var t=e.observing,r=e.observing=e.newObserving,n=exports.IDerivationState.UP_TO_DATE,o=0,a=e.unboundDepsCount,i=0;i<a;i++){0===(s=r[i]).diffValue&&(s.diffValue=1,o!==i&&(r[o]=s),o++),s.dependenciesState>n&&(n=s.dependenciesState)}for(r.length=o,e.newObserving=null,a=t.length;a--;){0===(s=t[a]).diffValue&&removeObserver(s,e),s.diffValue=0}for(;o--;){var s;1===(s=r[o]).diffValue&&(s.diffValue=0,addObserver(s,e))}n!==exports.IDerivationState.UP_TO_DATE&&(e.dependenciesState=n,e.onBecomeStale())}function clearObserving(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)removeObserver(t[r],e);e.dependenciesState=exports.IDerivationState.NOT_TRACKING}function untracked(e){var t=untrackedStart(),r=e();return untrackedEnd(t),r}function untrackedStart(){var e=globalState.trackingDerivation;return globalState.trackingDerivation=null,e}function untrackedEnd(e){globalState.trackingDerivation=e}function allowStateReadsStart(e){var t=globalState.allowStateReads;return globalState.allowStateReads=e,t}function allowStateReadsEnd(e){globalState.allowStateReads=e}function changeDependenciesStateTo0(e){if(e.dependenciesState!==exports.IDerivationState.UP_TO_DATE){e.dependenciesState=exports.IDerivationState.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=exports.IDerivationState.UP_TO_DATE}}var currentActionId=0,nextActionId=1;function createAction(e,t){var r=function(){return executeAction(e,t,this,arguments)};return r.isMobxAction=!0,r}function executeAction(e,t,r,n){var o=_startAction(e,r,n);try{return t.apply(r,n)}catch(e){throw o.error=e,e}finally{_endAction(o)}}function _startAction(e,t,r){var n=isSpyEnabled()&&!!e,o=0;if(n){o=Date.now();var a=r&&r.length||0,i=new Array(a);if(a>0)for(var s=0;s<a;s++)i[s]=r[s];spyReportStart({type:"action",name:e,object:t,arguments:i})}var c=untrackedStart();startBatch();var l={prevDerivation:c,prevAllowStateChanges:allowStateChangesStart(!0),prevAllowStateReads:allowStateReadsStart(!0),notifySpy:n,startTime:o,actionId:nextActionId++,parentActionId:currentActionId};return currentActionId=l.actionId,l}function _endAction(e){currentActionId!==e.actionId&&fail("invalid action stack. did you forget to finish an action?"),currentActionId=e.parentActionId,void 0!==e.error&&(globalState.suppressReactionErrors=!0),allowStateChangesEnd(e.prevAllowStateChanges),allowStateReadsEnd(e.prevAllowStateReads),endBatch(),untrackedEnd(e.prevDerivation),e.notifySpy&&spyReportEnd({time:Date.now()-e.startTime}),globalState.suppressReactionErrors=!1}function allowStateChanges(e,t){var r,n=allowStateChangesStart(e);try{r=t()}finally{allowStateChangesEnd(n)}return r}function allowStateChangesStart(e){var t=globalState.allowStateChanges;return globalState.allowStateChanges=e,t}function allowStateChangesEnd(e){globalState.allowStateChanges=e}function allowStateChangesInsideComputed(e){var t,r=globalState.computationDepth;globalState.computationDepth=0;try{t=e()}finally{globalState.computationDepth=r}return t}var ObservableValue=function(e){function t(t,r,n,o,a){void 0===n&&(n="ObservableValue@"+getNextId()),void 0===o&&(o=!0),void 0===a&&(a=comparer.default);var i=e.call(this,n)||this;return i.enhancer=r,i.name=n,i.equals=a,i.hasUnreportedChange=!1,i.value=r(t,void 0,n),o&&isSpyEnabled()&&spyReport({type:"create",name:i.name,newValue:""+i.value}),i}return __extends(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==globalState.UNCHANGED){var r=isSpyEnabled();r&&spyReportStart({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),r&&spyReportEnd()}},t.prototype.prepareNewValue=function(e){if(checkIfStateModificationsAreAllowed(this),hasInterceptors(this)){var t=interceptChange(this,{object:this,type:"update",newValue:e});if(!t)return globalState.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?globalState.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),hasListeners(this)&¬ifyListeners(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return registerInterceptor(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),registerListener(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return toPrimitive(this.get())},t}(Atom);ObservableValue.prototype[primitiveSymbol()]=ObservableValue.prototype.valueOf;var isObservableValue=createInstanceofPredicate("ObservableValue",ObservableValue),ComputedValue=function(){function e(e){this.dependenciesState=exports.IDerivationState.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=exports.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+getNextId(),this.value=new CaughtException(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=TraceMode.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+getNextId(),e.set&&(this.setter=createAction(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?comparer.structural:comparer.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){propagateMaybeChanged(this)},e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.get=function(){this.isComputing&&fail("Cycle detected in computation "+this.name+": "+this.derivation),0!==globalState.inBatch||0!==this.observers.length||this.keepAlive?(reportObserved(this),shouldCompute(this)&&this.trackAndCompute()&&propagateChangeConfirmed(this)):shouldCompute(this)&&(this.warnAboutUntrackedRead(),startBatch(),this.value=this.computeValue(!1),endBatch());var e=this.value;if(isCaughtException(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(isCaughtException(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){invariant(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else invariant(!1,!1)},e.prototype.trackAndCompute=function(){isSpyEnabled()&&spyReport({object:this.scope,type:"compute",name:this.name});var e=this.value,t=this.dependenciesState===exports.IDerivationState.NOT_TRACKING,r=this.computeValue(!0),n=t||isCaughtException(e)||isCaughtException(r)||!this.equals(e,r);return n&&(this.value=r),n},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,globalState.computationDepth++,e)t=trackDerivedFunction(this,this.derivation,this.scope);else if(!0===globalState.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new CaughtException(e)}return globalState.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(clearObserving(this),this.value=void 0)},e.prototype.observe=function(e,t){var r=this,n=!0,o=void 0;return autorun(function(){var a=r.get();if(!n||t){var i=untrackedStart();e({type:"update",object:r,newValue:a,oldValue:o}),untrackedEnd(i)}n=!1,o=a})},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return toPrimitive(this.get())},e}();ComputedValue.prototype[primitiveSymbol()]=ComputedValue.prototype.valueOf;var isComputedValue=createInstanceofPredicate("ComputedValue",ComputedValue),persistentKeys=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],MobXGlobals=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}}(),canMergeGlobalState=!0,isolateCalled=!1,globalState=function(){var e=getGlobal();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(canMergeGlobalState=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new MobXGlobals).version&&(canMergeGlobalState=!1),canMergeGlobalState?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new MobXGlobals):(setTimeout(function(){isolateCalled||fail("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new MobXGlobals)}();function isolateGlobalState(){(globalState.pendingReactions.length||globalState.inBatch||globalState.isRunningReactions)&&fail("isolateGlobalState should be called before MobX is running any reactions"),isolateCalled=!0,canMergeGlobalState&&(0==--getGlobal().__mobxInstanceCount&&(getGlobal().__mobxGlobals=void 0),globalState=new MobXGlobals)}function getGlobalState(){return globalState}function resetGlobalState(){var e=new MobXGlobals;for(var t in e)-1===persistentKeys.indexOf(t)&&(globalState[t]=e[t]);globalState.allowStateChanges=!globalState.enforceActions}function hasObservers(e){return e.observers&&e.observers.length>0}function getObservers(e){return e.observers}function addObserver(e,t){var r=e.observers.length;r&&(e.observersIndexes[t.__mapid]=r),e.observers[r]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function removeObserver(e,t){if(1===e.observers.length)e.observers.length=0,queueForUnobservation(e);else{var r=e.observers,n=e.observersIndexes,o=r.pop();if(o!==t){var a=n[t.__mapid]||0;a?n[o.__mapid]=a:delete n[o.__mapid],r[a]=o}delete n[t.__mapid]}}function queueForUnobservation(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,globalState.pendingUnobservations.push(e))}function startBatch(){globalState.inBatch++}function endBatch(){if(0==--globalState.inBatch){runReactions();for(var e=globalState.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,0===r.observers.length&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBecomeUnobserved()),r instanceof ComputedValue&&r.suspend())}globalState.pendingUnobservations=[]}}function reportObserved(e){var t=globalState.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&globalState.inBatch>0&&queueForUnobservation(e),!1)}function propagateChanged(e){if(e.lowestObserverState!==exports.IDerivationState.STALE){e.lowestObserverState=exports.IDerivationState.STALE;for(var t=e.observers,r=t.length;r--;){var n=t[r];n.dependenciesState===exports.IDerivationState.UP_TO_DATE&&(n.isTracing!==TraceMode.NONE&&logTraceInfo(n,e),n.onBecomeStale()),n.dependenciesState=exports.IDerivationState.STALE}}}function propagateChangeConfirmed(e){if(e.lowestObserverState!==exports.IDerivationState.STALE){e.lowestObserverState=exports.IDerivationState.STALE;for(var t=e.observers,r=t.length;r--;){var n=t[r];n.dependenciesState===exports.IDerivationState.POSSIBLY_STALE?n.dependenciesState=exports.IDerivationState.STALE:n.dependenciesState===exports.IDerivationState.UP_TO_DATE&&(e.lowestObserverState=exports.IDerivationState.UP_TO_DATE)}}}function propagateMaybeChanged(e){if(e.lowestObserverState===exports.IDerivationState.UP_TO_DATE){e.lowestObserverState=exports.IDerivationState.POSSIBLY_STALE;for(var t=e.observers,r=t.length;r--;){var n=t[r];n.dependenciesState===exports.IDerivationState.UP_TO_DATE&&(n.dependenciesState=exports.IDerivationState.POSSIBLY_STALE,n.isTracing!==TraceMode.NONE&&logTraceInfo(n,e),n.onBecomeStale())}}}function logTraceInfo(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===TraceMode.BREAK){var r=[];printDepTree(getDependencyTree(e),r,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof ComputedValue?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n ")()}}function printDepTree(e,t,r){t.length>=1e3?t.push("(and many more)"):(t.push(""+new Array(r).join("\t")+e.name),e.dependencies&&e.dependencies.forEach(function(e){return printDepTree(e,t,r+1)}))}var Reaction=function(){function e(e,t,r,n){void 0===e&&(e="Reaction@"+getNextId()),void 0===n&&(n=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=exports.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+getNextId(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=TraceMode.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,globalState.pendingReactions.push(this),runReactions())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(startBatch(),this._isScheduled=!1,shouldCompute(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&isSpyEnabled()&&spyReport({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}endBatch()}},e.prototype.track=function(e){startBatch();var t,r=isSpyEnabled();r&&(t=Date.now(),spyReportStart({name:this.name,type:"reaction"})),this._isRunning=!0;var n=trackDerivedFunction(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&clearObserving(this),isCaughtException(n)&&this.reportExceptionInDerivation(n.cause),r&&spyReportEnd({time:Date.now()-t}),endBatch()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(globalState.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";globalState.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),isSpyEnabled()&&spyReport({type:"error",name:this.name,message:r,error:""+e}),globalState.globalReactionErrorHandlers.forEach(function(r){return r(e,t)})}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(startBatch(),clearObserving(this),endBatch()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),trace(this,e)},e}();function onReactionError(e){return globalState.globalReactionErrorHandlers.push(e),function(){var t=globalState.globalReactionErrorHandlers.indexOf(e);t>=0&&globalState.globalReactionErrorHandlers.splice(t,1)}}var MAX_REACTION_ITERATIONS=100,reactionScheduler=function(e){return e()};function runReactions(){globalState.inBatch>0||globalState.isRunningReactions||reactionScheduler(runReactionsHelper)}function runReactionsHelper(){globalState.isRunningReactions=!0;for(var e=globalState.pendingReactions,t=0;e.length>0;){++t===MAX_REACTION_ITERATIONS&&(console.error("Reaction doesn't converge to a stable state after "+MAX_REACTION_ITERATIONS+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,o=r.length;n<o;n++)r[n].runReaction()}globalState.isRunningReactions=!1}var isReaction=createInstanceofPredicate("Reaction",Reaction);function setReactionScheduler(e){var t=reactionScheduler;reactionScheduler=function(r){return e(function(){return t(r)})}}function isSpyEnabled(){return!!globalState.spyListeners.length}function spyReport(e){if(globalState.spyListeners.length)for(var t=globalState.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function spyReportStart(e){spyReport(__assign({},e,{spyReportStart:!0}))}var END_EVENT={spyReportEnd:!0};function spyReportEnd(e){spyReport(e?__assign({},e,{spyReportEnd:!0}):END_EVENT)}function spy(e){return globalState.spyListeners.push(e),once(function(){globalState.spyListeners=globalState.spyListeners.filter(function(t){return t!==e})})}function dontReassignFields(){fail(!1)}function namedActionDecorator(e){return function(t,r,n){if(n){if(n.value)return{value:createAction(e,n.value),enumerable:!1,configurable:!0,writable:!0};var o=n.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return createAction(e,o.call(this))}}}return actionFieldDecorator(e).apply(this,arguments)}}function actionFieldDecorator(e){return function(t,r,n){Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get:function(){},set:function(t){addHiddenProp(this,r,action(e,t))}})}}function boundActionDecorator(e,t,r,n){return!0===n?(defineBoundAction(e,t,r.value),null):r?{configurable:!0,enumerable:!1,get:function(){return defineBoundAction(this,t,r.value||r.initializer.call(this)),this[t]},set:dontReassignFields}:{enumerable:!1,configurable:!0,set:function(e){defineBoundAction(this,t,e)},get:function(){}}}var action=function(e,t,r,n){return 1===arguments.length&&"function"==typeof e?createAction(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?createAction(e,t):1===arguments.length&&"string"==typeof e?namedActionDecorator(e):!0!==n?namedActionDecorator(t).apply(null,arguments):void(e[t]=createAction(e.name||t,r.value))};function runInAction(e,t){return executeAction("string"==typeof e?e:e.name||"<unnamed action>","function"==typeof e?e:t,this,void 0)}function isAction(e){return"function"==typeof e&&!0===e.isMobxAction}function defineBoundAction(e,t,r){addHiddenProp(e,t,createAction(t,r.bind(e)))}function autorun(e,t){void 0===t&&(t=EMPTY_OBJECT);var r,n=t&&t.name||e.name||"Autorun@"+getNextId();if(!t.scheduler&&!t.delay)r=new Reaction(n,function(){this.track(i)},t.onError,t.requiresObservable);else{var o=createSchedulerFromOptions(t),a=!1;r=new Reaction(n,function(){a||(a=!0,o(function(){a=!1,r.isDisposed||r.track(i)}))},t.onError,t.requiresObservable)}function i(){e(r)}return r.schedule(),r.getDisposer()}action.bound=boundActionDecorator;var run=function(e){return e()};function createSchedulerFromOptions(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:run}function reaction(e,t,r){void 0===r&&(r=EMPTY_OBJECT),"boolean"==typeof r&&(r={fireImmediately:r},deprecated("Using fireImmediately as argument is deprecated. Use '{ fireImmediately: true }' instead"));var n,o=r.name||"Reaction@"+getNextId(),a=action(o,r.onError?wrapErrorHandler(r.onError,t):t),i=!r.scheduler&&!r.delay,s=createSchedulerFromOptions(r),c=!0,l=!1,u=r.compareStructural?comparer.structural:r.equals||comparer.default,p=new Reaction(o,function(){c||i?d():l||(l=!0,s(d))},r.onError,r.requiresObservable);function d(){if(l=!1,!p.isDisposed){var t=!1;p.track(function(){var r=e(p);t=c||!u(n,r),n=r}),c&&r.fireImmediately&&a(n,p),c||!0!==t||a(n,p),c&&(c=!1)}}return p.schedule(),p.getDisposer()}function wrapErrorHandler(e,t){return function(){try{return t.apply(this,arguments)}catch(t){e.call(this,t)}}}function onBecomeObserved(e,t,r){return interceptHook("onBecomeObserved",e,t,r)}function onBecomeUnobserved(e,t,r){return interceptHook("onBecomeUnobserved",e,t,r)}function interceptHook(e,t,r,n){var o="function"==typeof n?getAtom(t,r):getAtom(t),a="function"==typeof n?n:r,i=o[e];return"function"!=typeof i?fail(!1):(o[e]=function(){i.call(this),a.call(this)},function(){o[e]=i})}function configure(e){var t=e.enforceActions,r=e.computedRequiresReaction,n=e.computedConfigurable,o=e.disableErrorBoundaries,a=e.arrayBuffer,i=e.reactionScheduler,s=e.reactionRequiresObservable,c=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&isolateGlobalState(),void 0!==t){"boolean"!=typeof t&&"strict"!==t||deprecated("Deprecated value for 'enforceActions', use 'false' => '\"never\"', 'true' => '\"observed\"', '\"strict\"' => \"'always'\" instead");var l=void 0;switch(t){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:fail("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}globalState.enforceActions=l,globalState.allowStateChanges=!0!==l&&"strict"!==l}void 0!==r&&(globalState.computedRequiresReaction=!!r),void 0!==s&&(globalState.reactionRequiresObservable=!!s),void 0!==c&&(globalState.observableRequiresReaction=!!c,globalState.allowStateReads=!globalState.observableRequiresReaction),void 0!==n&&(globalState.computedConfigurable=!!n),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors if this is on."),globalState.disableErrorBoundaries=!!o),"number"==typeof a&&reserveArrayBuffer(a),i&&setReactionScheduler(i)}function decorate(e,t){var r="function"==typeof e?e.prototype:e,n=function(e){var n=t[e];Array.isArray(n)||(n=[n]);var o=Object.getOwnPropertyDescriptor(r,e),a=n.reduce(function(t,n){return n(r,e,t)},o);a&&Object.defineProperty(r,e,a)};for(var o in t)n(o);return e}function extendShallowObservable(e,t,r){return deprecated("'extendShallowObservable' is deprecated, use 'extendObservable(target, props, { deep: false })' instead"),extendObservable(e,t,r,shallowCreateObservableOptions)}function extendObservable(e,t,r,n){var o=(n=asCreateObservableOptions(n)).defaultDecorator||(!1===n.deep?refDecorator:deepDecorator);initializeInstance(e),asObservableObject(e,n.name,o.enhancer),startBatch();try{for(var a in t){var i=Object.getOwnPropertyDescriptor(t,a),s=(r&&a in r?r[a]:i.get?computedDecorator:o)(e,a,i,!0);s&&Object.defineProperty(e,a,s)}}finally{endBatch()}return e}function getDependencyTree(e,t){return nodeToDependencyTree(getAtom(e,t))}function nodeToDependencyTree(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=unique(e.observing).map(nodeToDependencyTree)),t}function getObserverTree(e,t){return nodeToObserverTree(getAtom(e,t))}function nodeToObserverTree(e){var t={name:e.name};return hasObservers(e)&&(t.observers=getObservers(e).map(nodeToObserverTree)),t}var generatorId=0;function flow(e){1!==arguments.length&&fail("Flow expects one 1 argument and cannot be used as decorator");var t=e.name||"<unnamed flow>";return function(){var r,n=arguments,o=++generatorId,a=action(t+" - runid: "+o+" - init",e).apply(this,n),i=void 0,s=new Promise(function(e,n){var s=0;function c(e){var r;i=void 0;try{r=action(t+" - runid: "+o+" - yield "+s++,a.next).call(a,e)}catch(e){return n(e)}u(r)}function l(e){var r;i=void 0;try{r=action(t+" - runid: "+o+" - yield "+s++,a.throw).call(a,e)}catch(e){return n(e)}u(r)}function u(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(i=Promise.resolve(t.value)).then(c,l);t.then(u,n)}r=n,c(void 0)});return s.cancel=action(t+" - runid: "+o+" - cancel",function(){try{i&&cancelPromise(i);var e=a.return(),t=Promise.resolve(e.value);t.then(noop,noop),cancelPromise(t),r(new Error("FLOW_CANCELLED"))}catch(e){r(e)}}),s}}function cancelPromise(e){"function"==typeof e.cancel&&e.cancel()}function interceptReads(e,t,r){var n;if(isObservableMap(e)||isObservableArray(e)||isObservableValue(e))n=getAdministration(e);else{if(!isObservableObject(e))return fail(!1);if("string"!=typeof t)return fail(!1);n=getAdministration(e,t)}return void 0!==n.dehancer?fail(!1):(n.dehancer="function"==typeof t?t:r,function(){n.dehancer=void 0})}function intercept(e,t,r){return"function"==typeof r?interceptProperty(e,t,r):interceptInterceptable(e,t)}function interceptInterceptable(e,t){return getAdministration(e).intercept(t)}function interceptProperty(e,t,r){return getAdministration(e,t).intercept(r)}function _isComputed(e,t){if(null==e)return!1;if(void 0!==t){if(!1===isObservableObject(e))return!1;if(!e.$mobx.values[t])return!1;var r=getAtom(e,t);return isComputedValue(r)}return isComputedValue(e)}function isComputed(e){return arguments.length>1?fail(!1):_isComputed(e)}function isComputedProp(e,t){return"string"!=typeof t?fail(!1):_isComputed(e,t)}function _isObservable(e,t){if(null==e)return!1;if(void 0!==t){if(isObservableObject(e)){var r=e.$mobx;return r.values&&!!r.values[t]}return!1}return isObservableObject(e)||!!e.$mobx||isAtom(e)||isReaction(e)||isComputedValue(e)}function isObservable(e){return 1!==arguments.length&&fail(!1),_isObservable(e)}function isObservableProp(e,t){return"string"!=typeof t?fail(!1):_isObservable(e,t)}function keys(e){return isObservableObject(e)?e.$mobx.getKeys():isObservableMap(e)?e._keys.slice():isObservableSet(e)?iteratorToArray(e.keys()):isObservableArray(e)?e.map(function(e,t){return t}):fail(!1)}function values(e){return isObservableObject(e)?keys(e).map(function(t){return e[t]}):isObservableMap(e)?keys(e).map(function(t){return e.get(t)}):isObservableSet(e)?iteratorToArray(e.values()):isObservableArray(e)?e.slice():fail(!1)}function entries(e){return isObservableObject(e)?keys(e).map(function(t){return[t,e[t]]}):isObservableMap(e)?keys(e).map(function(t){return[t,e.get(t)]}):isObservableSet(e)?iteratorToArray(e.entries()):isObservableArray(e)?e.map(function(e,t){return[t,e]}):fail(!1)}function set(e,t,r){if(2!==arguments.length||isObservableSet(e))if(isObservableObject(e)){var n=e.$mobx;n.values[t]?n.write(e,t,r):defineObservableProperty(e,t,r,n.defaultEnhancer)}else if(isObservableMap(e))e.set(t,r);else if(isObservableSet(e))e.add(t);else{if(!isObservableArray(e))return fail(!1);"number"!=typeof t&&(t=parseInt(t,10)),invariant(t>=0,"Not a valid index: '"+t+"'"),startBatch(),t>=e.length&&(e.length=t+1),e[t]=r,endBatch()}else{startBatch();var o=t;try{for(var a in o)set(e,a,o[a])}finally{endBatch()}}}function remove(e,t){if(isObservableObject(e))e.$mobx.remove(t);else if(isObservableMap(e))e.delete(t);else if(isObservableSet(e))e.delete(t);else{if(!isObservableArray(e))return fail(!1);"number"!=typeof t&&(t=parseInt(t,10)),invariant(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}}function has(e,t){if(isObservableObject(e)){var r=getAdministration(e);return r.getKeys(),!!r.values[t]}return isObservableMap(e)?e.has(t):isObservableSet(e)?e.has(t):isObservableArray(e)?t>=0&&t<e.length:fail(!1)}function get(e,t){if(has(e,t))return isObservableObject(e)?e[t]:isObservableMap(e)?e.get(t):isObservableArray(e)?e[t]:fail(!1)}function observe(e,t,r,n){return"function"==typeof r?observeObservableProperty(e,t,r,n):observeObservable(e,t,r)}function observeObservable(e,t,r){return getAdministration(e).observe(t,r)}function observeObservableProperty(e,t,r,n){return getAdministration(e,t).observe(r,n)}var defaultOptions={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function cache(e,t,r,n){return n.detectCycles&&e.set(t,r),r}function toJSHelper(e,t,r){if(!t.recurseEverything&&!isObservable(e))return e;if("object"!=typeof e)return e;if(null===e)return null;if(e instanceof Date)return e;if(isObservableValue(e))return toJSHelper(e.get(),t,r);if(isObservable(e)&&keys(e),!0===t.detectCycles&&null!==e&&r.has(e))return r.get(e);if(isObservableArray(e)||Array.isArray(e)){var n=cache(r,e,[],t),o=e.map(function(e){return toJSHelper(e,t,r)});n.length=o.length;for(var a=0,i=o.length;a<i;a++)n[a]=o[a];return n}if(isObservableSet(e)||Object.getPrototypeOf(e)===Set.prototype){if(!1===t.exportMapsAsObjects){var s=cache(r,e,new Set,t);return e.forEach(function(e){s.add(toJSHelper(e,t,r))}),s}var c=cache(r,e,[],t);return e.forEach(function(e){c.push(toJSHelper(e,t,r))}),c}if(isObservableMap(e)||Object.getPrototypeOf(e)===Map.prototype){if(!1===t.exportMapsAsObjects){var l=cache(r,e,new Map,t);return e.forEach(function(e,n){l.set(n,toJSHelper(e,t,r))}),l}var u=cache(r,e,{},t);return e.forEach(function(e,n){u[n]=toJSHelper(e,t,r)}),u}var p=cache(r,e,{},t);for(var d in e)p[d]=toJSHelper(e[d],t,r);return p}function toJS(e,t){var r;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=defaultOptions),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(r=new Map),toJSHelper(e,t,r)}function trace(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=!1;"boolean"==typeof e[e.length-1]&&(r=e.pop());var n=getAtomFromArgs(e);if(!n)return fail(!1);n.isTracing===TraceMode.NONE&&console.log("[mobx.trace] '"+n.name+"' tracing enabled"),n.isTracing=r?TraceMode.BREAK:TraceMode.LOG}function getAtomFromArgs(e){switch(e.length){case 0:return globalState.trackingDerivation;case 1:return getAtom(e[0]);case 2:return getAtom(e[0],e[1])}}function transaction(e,t){void 0===t&&(t=void 0),startBatch();try{return e.apply(t)}finally{endBatch()}}function when(e,t,r){return 1===arguments.length||t&&"object"==typeof t?whenPromise(e,t):_when(e,t,r||{})}function _when(e,t,r){var n;"number"==typeof r.timeout&&(n=setTimeout(function(){if(!a.$mobx.isDisposed){a();var e=new Error("WHEN_TIMEOUT");if(!r.onError)throw e;r.onError(e)}},r.timeout)),r.name=r.name||"When@"+getNextId();var o=createAction(r.name+"-effect",t),a=autorun(function(t){e()&&(t.dispose(),n&&clearTimeout(n),o())},r);return a}function whenPromise(e,t){var r,n=new Promise(function(n,o){var a=_when(e,n,__assign({},t,{onError:o}));r=function(){a(),o("WHEN_CANCELLED")}});return n.cancel=r,n}function hasInterceptors(e){return void 0!==e.interceptors&&e.interceptors.length>0}function registerInterceptor(e,t){var r=e.interceptors||(e.interceptors=[]);return r.push(t),once(function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)})}function interceptChange(e,t){var r=untrackedStart();try{var n=e.interceptors;if(n)for(var o=0,a=n.length;o<a&&(invariant(!(t=n[o](t))||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{untrackedEnd(r)}}function hasListeners(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function registerListener(e,t){var r=e.changeListeners||(e.changeListeners=[]);return r.push(t),once(function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)})}function notifyListeners(e,t){var r=untrackedStart(),n=e.changeListeners;if(n){for(var o=0,a=(n=n.slice()).length;o<a;o++)n[o](t);untrackedEnd(r)}}var MAX_SPLICE_SIZE=1e4,safariPrototypeSetterInheritanceBug=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),OBSERVABLE_ARRAY_BUFFER_SIZE=0,StubArray=function(){return function(){}}();function inherit(e,t){void 0!==Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):void 0!==e.prototype.__proto__?e.prototype.__proto__=t:e.prototype=t}inherit(StubArray,Array.prototype),Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(StubArray.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var ObservableArrayAdministration=function(){function e(e,t,r,n){this.array=r,this.owned=n,this.values=[],this.lastKnownLength=0,this.atom=new Atom(e||"ObservableArray@"+getNextId()),this.enhancer=function(r,n){return t(r,n,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return registerInterceptor(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),registerListener(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n<e-t;n++)r[n]=void 0;this.spliceWithArray(t,0,r)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>OBSERVABLE_ARRAY_BUFFER_SIZE&&reserveArrayBuffer(e+t+1)},e.prototype.spliceWithArray=function(e,t,r){var n=this;checkIfStateModificationsAreAllowed(this.atom);var o=this.values.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===r&&(r=EMPTY_ARRAY),hasInterceptors(this)){var a=interceptChange(this,{object:this.array,type:"splice",index:e,removedCount:t,added:r});if(!a)return EMPTY_ARRAY;t=a.removedCount,r=a.added}var i=(r=0===r.length?r:r.map(function(e){return n.enhancer(e,void 0)})).length-t;this.updateArrayLength(o,i);var s=this.spliceItemsIntoValues(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice(e,r,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,r){var n;if(r.length<MAX_SPLICE_SIZE)return(n=this.values).splice.apply(n,__spread([e,t],r));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,r){var n=!this.owned&&isSpyEnabled(),o=hasListeners(this),a=o||n?{object:this.array,type:"update",index:e,newValue:t,oldValue:r}:null;n&&spyReportStart(__assign({},a,{name:this.atom.name})),this.atom.reportChanged(),o&¬ifyListeners(this,a),n&&spyReportEnd()},e.prototype.notifyArraySplice=function(e,t,r){var n=!this.owned&&isSpyEnabled(),o=hasListeners(this),a=o||n?{object:this.array,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;n&&spyReportStart(__assign({},a,{name:this.atom.name})),this.atom.reportChanged(),o&¬ifyListeners(this,a),n&&spyReportEnd()},e}(),ObservableArray=function(e){function t(t,r,n,o){void 0===n&&(n="ObservableArray@"+getNextId()),void 0===o&&(o=!1);var a=e.call(this)||this,i=new ObservableArrayAdministration(n,r,a,o);if(addHiddenFinalProp(a,"$mobx",i),t&&t.length){var s=allowStateChangesStart(!0);a.spliceWithArray(0,0,t),allowStateChangesEnd(s)}return safariPrototypeSetterInheritanceBug&&Object.defineProperty(i.array,"0",ENTRY_0),a}return __extends(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return isObservableArray(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,r){void 0===r&&(r=0),3===arguments.length&&deprecated("The array.find fromIndex argument to find will not be supported anymore in the next major");var n=this.findIndex.apply(this,arguments);return-1===n?void 0:this.get(n)},t.prototype.findIndex=function(e,t,r){void 0===r&&(r=0),3===arguments.length&&deprecated("The array.findIndex fromIndex argument to find will not be supported anymore in the next major");for(var n=this.peek(),o=n.length,a=r;a<o;a++)if(e.call(t,n[a],a,this))return a;return-1},t.prototype.splice=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,r)},t.prototype.spliceWithArray=function(e,t,r){return this.$mobx.spliceWithArray(e,t,r)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.$mobx;return r.spliceWithArray(r.values.length,0,e),r.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.$mobx;return r.spliceWithArray(0,0,e),r.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function r(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(deprecated("observableArray.move is deprecated, use .slice() & .replace() instead"),r.call(this,e),r.call(this,t),e!==t){var n,o=this.$mobx.values;n=e<t?__spread(o.slice(0,e),o.slice(e+1,t+1),[o[e]],o.slice(t+1)):__spread(o.slice(0,t),[o[e]],o.slice(t,e),o.slice(e+1)),this.replace(n)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var r=this.$mobx,n=r.values;if(e<n.length){checkIfStateModificationsAreAllowed(r.atom);var o=n[e];if(hasInterceptors(r)){var a=interceptChange(r,{type:"update",object:this,index:e,newValue:t});if(!a)return;t=a.newValue}(t=r.enhancer(t,o))!==o&&(n[e]=t,r.notifyArrayChildUpdate(e,t,o))}else{if(e!==n.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+n.length);r.spliceWithArray(e,0,[t])}},t}(StubArray);declareIterator(ObservableArray.prototype,function(){this.$mobx.atom.reportObserved();var e=this,t=0;return makeIterable({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})}),Object.defineProperty(ObservableArray.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),addHiddenProp(ObservableArray.prototype,toStringTagSymbol(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];invariant("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),addHiddenProp(ObservableArray.prototype,e,function(){return t.apply(this.peek(),arguments)})}),makeNonEnumerable(ObservableArray.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var ENTRY_0=createArrayEntryDescriptor(0);function createArrayEntryDescriptor(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function createArrayBufferItem(e){Object.defineProperty(ObservableArray.prototype,""+e,createArrayEntryDescriptor(e))}function reserveArrayBuffer(e){for(var t=OBSERVABLE_ARRAY_BUFFER_SIZE;t<e;t++)createArrayBufferItem(t);OBSERVABLE_ARRAY_BUFFER_SIZE=e}reserveArrayBuffer(1e3);var isObservableArrayAdministration=createInstanceofPredicate("ObservableArrayAdministration",ObservableArrayAdministration);function isObservableArray(e){return isObject(e)&&isObservableArrayAdministration(e.$mobx)}var ObservableMapMarker={},ObservableMap=function(){function e(e,t,r){if(void 0===t&&(t=deepEnhancer),void 0===r&&(r="ObservableMap@"+getNextId()),this.enhancer=t,this.name=r,this.$mobx=ObservableMapMarker,this._keys=new ObservableArray(void 0,referenceEnhancer,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!globalState.trackingDerivation)return this._has(e);var r=this._hasMap.get(e);if(!r){var n=r=new ObservableValue(this._has(e),referenceEnhancer,this.name+"."+stringifyKey(e)+"?",!1);this._hasMap.set(e,n),onBecomeUnobserved(n,function(){return t._hasMap.delete(e)})}return r.get()},e.prototype.set=function(e,t){var r=this._has(e);if(hasInterceptors(this)){var n=interceptChange(this,{type:r?"update":"add",object:this,newValue:t,name:e});if(!n)return this;t=n.newValue}return r?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(hasInterceptors(this)&&!(o=interceptChange(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var r=isSpyEnabled(),n=hasListeners(this),o=n||r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return r&&spyReportStart(__assign({},o,{name:this.name,key:e})),transaction(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)}),n&¬ifyListeners(this,o),r&&spyReportEnd(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var r=this._hasMap.get(e);r&&r.setNewValue(t)},e.prototype._updateValue=function(e,t){var r=this._data.get(e);if((t=r.prepareNewValue(t))!==globalState.UNCHANGED){var n=isSpyEnabled(),o=hasListeners(this),a=o||n?{type:"update",object:this,oldValue:r.value,name:e,newValue:t}:null;n&&spyReportStart(__assign({},a,{name:this.name,key:e})),r.setNewValue(t),o&¬ifyListeners(this,a),n&&spyReportEnd()}},e.prototype._addValue=function(e,t){var r=this;transaction(function(){var n=new ObservableValue(t,r.enhancer,r.name+"."+stringifyKey(e),!1);r._data.set(e,n),t=n.value,r._updateHasMapEntry(e,!0),r._keys.push(e)});var n=isSpyEnabled(),o=hasListeners(this),a=o||n?{type:"add",object:this,name:e,newValue:t}:null;n&&spyReportStart(__assign({},a,{name:this.name,key:e})),o&¬ifyListeners(this,a),n&&spyReportEnd()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[iteratorSymbol()]()},e.prototype.values=function(){var e=this,t=0;return makeIterable({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return makeIterable({next:function(){if(t<e._keys.length){var r=e._keys[t++];return{value:[r,e.get(r)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var r=this;this._keys.forEach(function(n){return e.call(t,r.get(n),n,r)})},e.prototype.merge=function(e){var t=this;return isObservableMap(e)&&(e=e.toJS()),transaction(function(){isPlainObject(e)?Object.keys(e).forEach(function(r){return t.set(r,e[r])}):Array.isArray(e)?e.forEach(function(e){var r=__read(e,2),n=r[0],o=r[1];return t.set(n,o)}):isES6Map(e)?e.constructor!==Map?fail("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(e,r){return t.set(r,e)}):null!=e&&fail("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;transaction(function(){untracked(function(){e._keys.slice().forEach(function(t){return e.delete(t)})})})},e.prototype.replace=function(e){var t=this;return transaction(function(){for(var r=convertToMap(e),n=t._keys,o=Array.from(r.keys()),a=!1,i=0;i<n.length;i++){var s=n[i];n.length===o.length&&s!==o[i]&&(a=!0),r.has(s)||(a=!0,t.delete(s))}r.forEach(function(e,r){t._data.has(r)||(a=!0),t.set(r,e)}),a&&t._keys.replace(o)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach(function(r){return t["symbol"==typeof r?r:stringifyKey(r)]=e.get(r)}),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach(function(r){return t.set(r,e.get(r))}),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(t){return stringifyKey(t)+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return registerListener(this,e)},e.prototype.intercept=function(e){return registerInterceptor(this,e)},e}();function stringifyKey(e){return e&&e.toString?e.toString():new String(e).toString()}declareIterator(ObservableMap.prototype,function(){return this.entries()}),addHiddenFinalProp(ObservableMap.prototype,toStringTagSymbol(),"Map");var isObservableMap=createInstanceofPredicate("ObservableMap",ObservableMap),ObservableSetMarker={},ObservableSet=function(){function e(e,t,r){if(void 0===t&&(t=deepEnhancer),void 0===r&&(r="ObservableSet@"+getNextId()),this.name=r,this.$mobx=ObservableSetMarker,this._data=new Set,this._atom=createAtom(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,n){return t(e,n,r)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;transaction(function(){untracked(function(){e._data.forEach(function(t){e.delete(t)})})})},e.prototype.forEach=function(e,t){var r=this;this._data.forEach(function(n){e.call(t,n,n,r)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if((checkIfStateModificationsAreAllowed(this._atom),hasInterceptors(this))&&!(o=interceptChange(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){transaction(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var r=isSpyEnabled(),n=hasListeners(this),o=n||r?{type:"add",object:this,newValue:e}:null;0,n&¬ifyListeners(this,o)}return this},e.prototype.delete=function(e){var t=this;if(hasInterceptors(this)&&!(o=interceptChange(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var r=isSpyEnabled(),n=hasListeners(this),o=n||r?{type:"delete",object:this,oldValue:e}:null;return transaction(function(){t._atom.reportChanged(),t._data.delete(e)}),n&¬ifyListeners(this,o),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=iteratorToArray(this.keys()),r=iteratorToArray(this.values());return makeIterable({next:function(){var n=e;return e+=1,n<r.length?{value:[t[n],r[n]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,r=0;return void 0!==this._data.values?e=iteratorToArray(this._data.values()):(e=[],this._data.forEach(function(t){return e.push(t)})),makeIterable({next:function(){return r<e.length?{value:t.dehanceValue(e[r++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return isObservableSet(e)&&(e=e.toJS()),transaction(function(){Array.isArray(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):isES6Set(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):null!=e&&fail("Cannot initialize set from "+e)}),this},e.prototype.observe=function(e,t){return registerListener(this,e)},e.prototype.intercept=function(e){return registerInterceptor(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+iteratorToArray(this.keys()).join(", ")+" ]"},e}();declareIterator(ObservableSet.prototype,function(){return this.values()}),addHiddenFinalProp(ObservableSet.prototype,toStringTagSymbol(),"Set");var isObservableSet=createInstanceofPredicate("ObservableSet",ObservableSet),ObservableObjectAdministration=function(){function e(e,t,r){this.target=e,this.name=t,this.defaultEnhancer=r,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,r){var n=this.target;n!==e&&this.illegalAccess(e,t);var o=this.values[t];if(o instanceof ComputedValue)o.set(r);else{if(hasInterceptors(this)){if(!(s=interceptChange(this,{type:"update",object:n,name:t,newValue:r})))return;r=s.newValue}if((r=o.prepareNewValue(r))!==globalState.UNCHANGED){var a=hasListeners(this),i=isSpyEnabled(),s=a||i?{type:"update",object:n,oldValue:o.value,name:t,newValue:r}:null;i&&spyReportStart(__assign({},s,{name:this.name,key:t})),o.setNewValue(r),a&¬ifyListeners(this,s),i&&spyReportEnd()}}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(hasInterceptors(this))if(!(a=interceptChange(this,{object:t,name:e,type:"remove"})))return;try{startBatch();var r=hasListeners(this),n=isSpyEnabled(),o=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var a=r||n?{type:"remove",object:t,oldValue:o,name:e}:null;n&&spyReportStart(__assign({},a,{name:this.name,key:e})),r&¬ifyListeners(this,a),n&&spyReportEnd()}finally{endBatch()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return registerListener(this,e)},e.prototype.intercept=function(e){return registerInterceptor(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new ObservableArray(Object.keys(this.values).filter(function(t){return e.values[t]instanceof ObservableValue}),referenceEnhancer,"keys("+this.name+")",!0)),this.keys.slice()},e}();function asObservableObject(e,t,r){void 0===t&&(t=""),void 0===r&&(r=deepEnhancer);var n=e.$mobx;return n||(isPlainObject(e)||(t=(e.constructor.name||"ObservableObject")+"@"+getNextId()),t||(t="ObservableObject@"+getNextId()),addHiddenFinalProp(e,"$mobx",n=new ObservableObjectAdministration(e,t,r)),n)}function defineObservableProperty(e,t,r,n){var o=asObservableObject(e);if(hasInterceptors(o)){var a=interceptChange(o,{object:e,name:t,type:"add",newValue:r});if(!a)return;r=a.newValue}r=(o.values[t]=new ObservableValue(r,n,o.name+"."+t,!1)).value,Object.defineProperty(e,t,generateObservablePropConfig(t)),o.keys&&o.keys.push(t),notifyPropertyAddition(o,e,t,r)}function defineComputedProperty(e,t,r){var n=asObservableObject(e);r.name=n.name+"."+t,r.context=e,n.values[t]=new ComputedValue(r),Object.defineProperty(e,t,generateComputedPropConfig(t))}var observablePropertyConfigs=Object.create(null),computedPropertyConfigs=Object.create(null);function generateObservablePropConfig(e){return observablePropertyConfigs[e]||(observablePropertyConfigs[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}function getAdministrationForComputedPropOwner(e){var t=e.$mobx;return t||(initializeInstance(e),e.$mobx)}function generateComputedPropConfig(e){return computedPropertyConfigs[e]||(computedPropertyConfigs[e]={configurable:globalState.computedConfigurable,enumerable:!1,get:function(){return getAdministrationForComputedPropOwner(this).read(this,e)},set:function(t){getAdministrationForComputedPropOwner(this).write(this,e,t)}})}function notifyPropertyAddition(e,t,r,n){var o=hasListeners(e),a=isSpyEnabled(),i=o||a?{type:"add",object:t,name:r,newValue:n}:null;a&&spyReportStart(__assign({},i,{name:e.name,key:r})),o&¬ifyListeners(e,i),a&&spyReportEnd()}var isObservableObjectAdministration=createInstanceofPredicate("ObservableObjectAdministration",ObservableObjectAdministration);function isObservableObject(e){return!!isObject(e)&&(initializeInstance(e),isObservableObjectAdministration(e.$mobx))}function getAtom(e,t){if("object"==typeof e&&null!==e){if(isObservableArray(e))return void 0!==t&&fail(!1),e.$mobx.atom;if(isObservableSet(e))return e.$mobx;if(isObservableMap(e)){var r=e;return void 0===t?getAtom(r._keys):((n=r._data.get(t)||r._hasMap.get(t))||fail(!1),n)}var n;if(initializeInstance(e),t&&!e.$mobx&&e[t],isObservableObject(e))return t?((n=e.$mobx.values[t])||fail(!1),n):fail(!1);if(isAtom(e)||isComputedValue(e)||isReaction(e))return e}else if("function"==typeof e&&isReaction(e.$mobx))return e.$mobx;return fail(!1)}function getAdministration(e,t){return e||fail("Expecting some object"),void 0!==t?getAdministration(getAtom(e,t)):isAtom(e)||isComputedValue(e)||isReaction(e)?e:isObservableMap(e)||isObservableSet(e)?e:(initializeInstance(e),e.$mobx?e.$mobx:void fail(!1))}function getDebugName(e,t){return(void 0!==t?getAtom(e,t):isObservableObject(e)||isObservableMap(e)||isObservableSet(e)?getAdministration(e):getAtom(e)).name}var g,toString=Object.prototype.toString;function deepEqual(e,t,r){return void 0===r&&(r=-1),eq(e,t,r)}function eq(e,t,r,n,o){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var a=typeof e;if("function"!==a&&"object"!==a&&"object"!=typeof t)return!1;e=unwrap(e),t=unwrap(t);var i=toString.call(e);if(i!==toString.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var s="[object Array]"===i;if(!s){if("object"!=typeof e||"object"!=typeof t)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!("function"==typeof c&&c instanceof c&&"function"==typeof l&&l instanceof l)&&"constructor"in e&&"constructor"in t)return!1}if(0===r)return!1;r<0&&(r=-1),o=o||[];for(var u=(n=n||[]).length;u--;)if(n[u]===e)return o[u]===t;if(n.push(e),o.push(t),s){if((u=e.length)!==t.length)return!1;for(;u--;)if(!eq(e[u],t[u],r-1,n,o))return!1}else{var p=Object.keys(e),d=void 0;if(u=p.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!has$1(t,d=p[u])||!eq(e[d],t[d],r-1,n,o))return!1}return n.pop(),o.pop(),!0}function unwrap(e){return isObservableArray(e)?e.peek():isES6Map(e)||isObservableMap(e)?iteratorToArray(e.entries()):isES6Set(e)||isObservableSet(e)?iteratorToArray(e.entries()):e}function has$1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var $mobx="$mobx";"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:spy,extras:{getDebugName:getDebugName},$mobx:$mobx}),exports.$mobx=$mobx,exports.ObservableMap=ObservableMap,exports.ObservableSet=ObservableSet,exports.Reaction=Reaction,exports._allowStateChanges=allowStateChanges,exports._allowStateChangesInsideComputed=allowStateChangesInsideComputed,exports._endAction=_endAction,exports._getAdministration=getAdministration,exports._getGlobalState=getGlobalState,exports._interceptReads=interceptReads,exports._isComputingDerivation=isComputingDerivation,exports._resetGlobalState=resetGlobalState,exports._startAction=_startAction,exports.action=action,exports.autorun=autorun,exports.comparer=comparer,exports.computed=computed,exports.configure=configure,exports.createAtom=createAtom,exports.decorate=decorate,exports.entries=entries,exports.extendObservable=extendObservable,exports.extendShallowObservable=extendShallowObservable,exports.flow=flow,exports.get=get,exports.getAtom=getAtom,exports.getDebugName=getDebugName,exports.getDependencyTree=getDependencyTree,exports.getObserverTree=getObserverTree,exports.has=has,exports.intercept=intercept,exports.isAction=isAction,exports.isArrayLike=isArrayLike,exports.isBoxedObservable=isObservableValue,exports.isComputed=isComputed,exports.isComputedProp=isComputedProp,exports.isObservable=isObservable,exports.isObservableArray=isObservableArray,exports.isObservableMap=isObservableMap,exports.isObservableObject=isObservableObject,exports.isObservableProp=isObservableProp,exports.isObservableSet=isObservableSet,exports.keys=keys,exports.observable=observable,exports.observe=observe,exports.onBecomeObserved=onBecomeObserved,exports.onBecomeUnobserved=onBecomeUnobserved,exports.onReactionError=onReactionError,exports.reaction=reaction,exports.remove=remove,exports.runInAction=runInAction,exports.set=set,exports.spy=spy,exports.toJS=toJS,exports.trace=trace,exports.transaction=transaction,exports.untracked=untracked,exports.values=values,exports.when=when;
|
package/lib/mobx.module.js
CHANGED
|
@@ -302,13 +302,17 @@ function identityComparer(a, b) {
|
|
|
302
302
|
function structuralComparer(a, b) {
|
|
303
303
|
return deepEqual(a, b);
|
|
304
304
|
}
|
|
305
|
+
function shallowComparer(a, b) {
|
|
306
|
+
return deepEqual(a, b, 1);
|
|
307
|
+
}
|
|
305
308
|
function defaultComparer(a, b) {
|
|
306
309
|
return areBothNaN(a, b) || identityComparer(a, b);
|
|
307
310
|
}
|
|
308
311
|
var comparer = {
|
|
309
312
|
identity: identityComparer,
|
|
310
313
|
structural: structuralComparer,
|
|
311
|
-
default: defaultComparer
|
|
314
|
+
default: defaultComparer,
|
|
315
|
+
shallow: shallowComparer
|
|
312
316
|
};
|
|
313
317
|
|
|
314
318
|
var enumerableDescriptorCache = {};
|
|
@@ -894,6 +898,10 @@ function changeDependenciesStateTo0(derivation) {
|
|
|
894
898
|
obs[i].lowestObserverState = IDerivationState.UP_TO_DATE;
|
|
895
899
|
}
|
|
896
900
|
|
|
901
|
+
// we don't use globalState for these in order to avoid possible issues with multiple
|
|
902
|
+
// mobx versions
|
|
903
|
+
var currentActionId = 0;
|
|
904
|
+
var nextActionId = 1;
|
|
897
905
|
function createAction(actionName, fn) {
|
|
898
906
|
if (process.env.NODE_ENV !== "production") {
|
|
899
907
|
invariant(typeof fn === "function", "`action` can only be invoked on functions");
|
|
@@ -946,17 +954,17 @@ function _startAction(actionName, scope, args) {
|
|
|
946
954
|
prevAllowStateReads: prevAllowStateReads,
|
|
947
955
|
notifySpy: notifySpy,
|
|
948
956
|
startTime: startTime,
|
|
949
|
-
actionId:
|
|
950
|
-
parentActionId:
|
|
957
|
+
actionId: nextActionId++,
|
|
958
|
+
parentActionId: currentActionId
|
|
951
959
|
};
|
|
952
|
-
|
|
960
|
+
currentActionId = runInfo.actionId;
|
|
953
961
|
return runInfo;
|
|
954
962
|
}
|
|
955
963
|
function _endAction(runInfo) {
|
|
956
|
-
if (
|
|
964
|
+
if (currentActionId !== runInfo.actionId) {
|
|
957
965
|
fail("invalid action stack. did you forget to finish an action?");
|
|
958
966
|
}
|
|
959
|
-
|
|
967
|
+
currentActionId = runInfo.parentActionId;
|
|
960
968
|
if (runInfo.error !== undefined) {
|
|
961
969
|
globalState.suppressReactionErrors = true;
|
|
962
970
|
}
|
|
@@ -1434,14 +1442,6 @@ var MobXGlobals = /** @class */ (function () {
|
|
|
1434
1442
|
* they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836
|
|
1435
1443
|
*/
|
|
1436
1444
|
this.suppressReactionErrors = false;
|
|
1437
|
-
/*
|
|
1438
|
-
* Current action id.
|
|
1439
|
-
*/
|
|
1440
|
-
this.currentActionId = 0;
|
|
1441
|
-
/*
|
|
1442
|
-
* Next action id.
|
|
1443
|
-
*/
|
|
1444
|
-
this.nextActionId = 1;
|
|
1445
1445
|
}
|
|
1446
1446
|
return MobXGlobals;
|
|
1447
1447
|
}());
|
|
@@ -4324,12 +4324,13 @@ function getDebugName(thing, property) {
|
|
|
4324
4324
|
}
|
|
4325
4325
|
|
|
4326
4326
|
var toString = Object.prototype.toString;
|
|
4327
|
-
function deepEqual(a, b) {
|
|
4328
|
-
|
|
4327
|
+
function deepEqual(a, b, depth) {
|
|
4328
|
+
if (depth === void 0) { depth = -1; }
|
|
4329
|
+
return eq(a, b, depth);
|
|
4329
4330
|
}
|
|
4330
4331
|
// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
|
|
4331
4332
|
// Internal recursive comparison function for `isEqual`.
|
|
4332
|
-
function eq(a, b, aStack, bStack) {
|
|
4333
|
+
function eq(a, b, depth, aStack, bStack) {
|
|
4333
4334
|
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
|
4334
4335
|
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
|
4335
4336
|
if (a === b)
|
|
@@ -4344,10 +4345,6 @@ function eq(a, b, aStack, bStack) {
|
|
|
4344
4345
|
var type = typeof a;
|
|
4345
4346
|
if (type !== "function" && type !== "object" && typeof b != "object")
|
|
4346
4347
|
return false;
|
|
4347
|
-
return deepEq(a, b, aStack, bStack);
|
|
4348
|
-
}
|
|
4349
|
-
// Internal recursive comparison function for `isEqual`.
|
|
4350
|
-
function deepEq(a, b, aStack, bStack) {
|
|
4351
4348
|
// Unwrap any wrapped objects.
|
|
4352
4349
|
a = unwrap(a);
|
|
4353
4350
|
b = unwrap(b);
|
|
@@ -4397,6 +4394,12 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4397
4394
|
return false;
|
|
4398
4395
|
}
|
|
4399
4396
|
}
|
|
4397
|
+
if (depth === 0) {
|
|
4398
|
+
return false;
|
|
4399
|
+
}
|
|
4400
|
+
else if (depth < 0) {
|
|
4401
|
+
depth = -1;
|
|
4402
|
+
}
|
|
4400
4403
|
// Assume equality for cyclic structures. The algorithm for detecting cyclic
|
|
4401
4404
|
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
|
|
4402
4405
|
// Initializing stack of traversed objects.
|
|
@@ -4421,7 +4424,7 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4421
4424
|
return false;
|
|
4422
4425
|
// Deep compare the contents, ignoring non-numeric properties.
|
|
4423
4426
|
while (length--) {
|
|
4424
|
-
if (!eq(a[length], b[length], aStack, bStack))
|
|
4427
|
+
if (!eq(a[length], b[length], depth - 1, aStack, bStack))
|
|
4425
4428
|
return false;
|
|
4426
4429
|
}
|
|
4427
4430
|
}
|
|
@@ -4436,7 +4439,7 @@ function deepEq(a, b, aStack, bStack) {
|
|
|
4436
4439
|
while (length--) {
|
|
4437
4440
|
// Deep compare each member
|
|
4438
4441
|
key = keys[length];
|
|
4439
|
-
if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack)))
|
|
4442
|
+
if (!(has$1(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack)))
|
|
4440
4443
|
return false;
|
|
4441
4444
|
}
|
|
4442
4445
|
}
|
package/lib/mobx.umd.js
CHANGED
|
@@ -308,13 +308,17 @@
|
|
|
308
308
|
function structuralComparer(a, b) {
|
|
309
309
|
return deepEqual(a, b);
|
|
310
310
|
}
|
|
311
|
+
function shallowComparer(a, b) {
|
|
312
|
+
return deepEqual(a, b, 1);
|
|
313
|
+
}
|
|
311
314
|
function defaultComparer(a, b) {
|
|
312
315
|
return areBothNaN(a, b) || identityComparer(a, b);
|
|
313
316
|
}
|
|
314
317
|
var comparer = {
|
|
315
318
|
identity: identityComparer,
|
|
316
319
|
structural: structuralComparer,
|
|
317
|
-
default: defaultComparer
|
|
320
|
+
default: defaultComparer,
|
|
321
|
+
shallow: shallowComparer
|
|
318
322
|
};
|
|
319
323
|
|
|
320
324
|
var enumerableDescriptorCache = {};
|
|
@@ -899,6 +903,10 @@
|
|
|
899
903
|
obs[i].lowestObserverState = exports.IDerivationState.UP_TO_DATE;
|
|
900
904
|
}
|
|
901
905
|
|
|
906
|
+
// we don't use globalState for these in order to avoid possible issues with multiple
|
|
907
|
+
// mobx versions
|
|
908
|
+
var currentActionId = 0;
|
|
909
|
+
var nextActionId = 1;
|
|
902
910
|
function createAction(actionName, fn) {
|
|
903
911
|
if (process.env.NODE_ENV !== "production") {
|
|
904
912
|
invariant(typeof fn === "function", "`action` can only be invoked on functions");
|
|
@@ -951,17 +959,17 @@
|
|
|
951
959
|
prevAllowStateReads: prevAllowStateReads,
|
|
952
960
|
notifySpy: notifySpy,
|
|
953
961
|
startTime: startTime,
|
|
954
|
-
actionId:
|
|
955
|
-
parentActionId:
|
|
962
|
+
actionId: nextActionId++,
|
|
963
|
+
parentActionId: currentActionId
|
|
956
964
|
};
|
|
957
|
-
|
|
965
|
+
currentActionId = runInfo.actionId;
|
|
958
966
|
return runInfo;
|
|
959
967
|
}
|
|
960
968
|
function _endAction(runInfo) {
|
|
961
|
-
if (
|
|
969
|
+
if (currentActionId !== runInfo.actionId) {
|
|
962
970
|
fail("invalid action stack. did you forget to finish an action?");
|
|
963
971
|
}
|
|
964
|
-
|
|
972
|
+
currentActionId = runInfo.parentActionId;
|
|
965
973
|
if (runInfo.error !== undefined) {
|
|
966
974
|
globalState.suppressReactionErrors = true;
|
|
967
975
|
}
|
|
@@ -1439,14 +1447,6 @@
|
|
|
1439
1447
|
* they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836
|
|
1440
1448
|
*/
|
|
1441
1449
|
this.suppressReactionErrors = false;
|
|
1442
|
-
/*
|
|
1443
|
-
* Current action id.
|
|
1444
|
-
*/
|
|
1445
|
-
this.currentActionId = 0;
|
|
1446
|
-
/*
|
|
1447
|
-
* Next action id.
|
|
1448
|
-
*/
|
|
1449
|
-
this.nextActionId = 1;
|
|
1450
1450
|
}
|
|
1451
1451
|
return MobXGlobals;
|
|
1452
1452
|
}());
|
|
@@ -4329,12 +4329,13 @@
|
|
|
4329
4329
|
}
|
|
4330
4330
|
|
|
4331
4331
|
var toString = Object.prototype.toString;
|
|
4332
|
-
function deepEqual(a, b) {
|
|
4333
|
-
|
|
4332
|
+
function deepEqual(a, b, depth) {
|
|
4333
|
+
if (depth === void 0) { depth = -1; }
|
|
4334
|
+
return eq(a, b, depth);
|
|
4334
4335
|
}
|
|
4335
4336
|
// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
|
|
4336
4337
|
// Internal recursive comparison function for `isEqual`.
|
|
4337
|
-
function eq(a, b, aStack, bStack) {
|
|
4338
|
+
function eq(a, b, depth, aStack, bStack) {
|
|
4338
4339
|
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
|
4339
4340
|
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
|
4340
4341
|
if (a === b)
|
|
@@ -4349,10 +4350,6 @@
|
|
|
4349
4350
|
var type = typeof a;
|
|
4350
4351
|
if (type !== "function" && type !== "object" && typeof b != "object")
|
|
4351
4352
|
return false;
|
|
4352
|
-
return deepEq(a, b, aStack, bStack);
|
|
4353
|
-
}
|
|
4354
|
-
// Internal recursive comparison function for `isEqual`.
|
|
4355
|
-
function deepEq(a, b, aStack, bStack) {
|
|
4356
4353
|
// Unwrap any wrapped objects.
|
|
4357
4354
|
a = unwrap(a);
|
|
4358
4355
|
b = unwrap(b);
|
|
@@ -4402,6 +4399,12 @@
|
|
|
4402
4399
|
return false;
|
|
4403
4400
|
}
|
|
4404
4401
|
}
|
|
4402
|
+
if (depth === 0) {
|
|
4403
|
+
return false;
|
|
4404
|
+
}
|
|
4405
|
+
else if (depth < 0) {
|
|
4406
|
+
depth = -1;
|
|
4407
|
+
}
|
|
4405
4408
|
// Assume equality for cyclic structures. The algorithm for detecting cyclic
|
|
4406
4409
|
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
|
|
4407
4410
|
// Initializing stack of traversed objects.
|
|
@@ -4426,7 +4429,7 @@
|
|
|
4426
4429
|
return false;
|
|
4427
4430
|
// Deep compare the contents, ignoring non-numeric properties.
|
|
4428
4431
|
while (length--) {
|
|
4429
|
-
if (!eq(a[length], b[length], aStack, bStack))
|
|
4432
|
+
if (!eq(a[length], b[length], depth - 1, aStack, bStack))
|
|
4430
4433
|
return false;
|
|
4431
4434
|
}
|
|
4432
4435
|
}
|
|
@@ -4441,7 +4444,7 @@
|
|
|
4441
4444
|
while (length--) {
|
|
4442
4445
|
// Deep compare each member
|
|
4443
4446
|
key = keys[length];
|
|
4444
|
-
if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack)))
|
|
4447
|
+
if (!(has$1(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack)))
|
|
4445
4448
|
return false;
|
|
4446
4449
|
}
|
|
4447
4450
|
}
|
package/lib/mobx.umd.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).mobx={})}(this,function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}var a="An invariant failed, however the error is obfuscated because this is an production build.",s=[];Object.freeze(s);var u={};Object.freeze(u);var c={};function l(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:c}function f(){return++Re.mobxGuid}function p(e){throw h(!1,e),"X"}function h(e,t){if(!e)throw new Error("[mobx] "+(t||a))}function v(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var d=function(){};function y(e){return null!==e&&"object"==typeof e}function b(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function m(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function _(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return y(e)&&!0===e[n]}}function O(e){return void 0!==l().Map&&e instanceof l().Map}function w(e){return e instanceof Set}function S(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function A(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function x(e){return null===e?null:"object"==typeof e?""+e:e}function E(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function D(e,t){g(e,E(),t)}function j(e){return e[E()]=k,e}function I(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function k(){return this}var R=function(){function t(t){void 0===t&&(t="Atom@"+f()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=e.IDerivationState.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.reportObserved=function(){return Le(this)},t.prototype.reportChanged=function(){Ne(),function(t){if(t.lowestObserverState===e.IDerivationState.STALE)return;t.lowestObserverState=e.IDerivationState.STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(o.isTracing!==te.NONE&&Be(o,t),o.onBecomeStale()),o.dependenciesState=e.IDerivationState.STALE}}(this),Pe()},t.prototype.toString=function(){return this.name},t}(),T=_("Atom",R);function C(e,t,n){void 0===t&&(t=d),void 0===n&&(n=d);var r=new R(e);return it(r,t),at(r,n),r}function V(e,t){return e===t}var N={identity:V,structural:function(e,t){return fn(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||V(e,t)}},P={},L={};function B(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var n in m(e,"__mobxDidRunLazyInitializers",!0),t){var r=t[n];r.propertyCreator(e,r.prop,r.descriptor,r.decoratorTarget,r.decoratorArguments)}}}function $(e,t){return function(){var n,o,i=function(o,i,a,s){if(!0===s)return t(o,i,a,o,n),null;if(!Object.prototype.hasOwnProperty.call(o,"__mobxDecorators")){var u=o.__mobxDecorators;m(o,"__mobxDecorators",r({},u))}return o.__mobxDecorators[i]={prop:i,propertyCreator:t,descriptor:a,decoratorTarget:o,decoratorArguments:n},function(e,t){var n=t?P:L;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return B(this),this[e]},set:function(t){B(this),this[e]=t}})}(i,e)};return(2===(o=arguments).length||3===o.length)&&"string"==typeof o[1]||4===o.length&&!0===o[3]?(n=s,i.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),i)}}function M(e,t,n){return yt(e)?e:Array.isArray(e)?Q.array(e,{name:n}):b(e)?Q.object(e,void 0,{name:n}):O(e)?Q.map(e,{name:n}):w(e)?Q.set(e,{name:n}):e}function U(e){return e}function G(e){var t=$(!0,function(t,n,r,o,i){en(t,n,r?r.initializer?r.initializer.call(t):r.value:void 0,e)}),n=("undefined"!=typeof process&&process.env,t);return n.enhancer=e,n}var q={deep:!0,name:void 0,defaultDecorator:void 0},H={deep:!1,name:void 0,defaultDecorator:void 0};function z(e){return null==e?q:"string"==typeof e?{name:e,deep:!0}:e}function K(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?U:M}Object.freeze(q),Object.freeze(H);var W=G(M),J=G(function(e,t,n){return null==e?e:an(e)||Ht(e)||Jt(e)||Ft(e)?e:Array.isArray(e)?Q.array(e,{name:n,deep:!1}):b(e)?Q.object(e,void 0,{name:n,deep:!1}):O(e)?Q.map(e,{name:n,deep:!1}):w(e)?Q.set(e,{name:n,deep:!1}):p(!1)}),X=G(U),Y=G(function(e,t,n){return fn(e,t)?t:e});var F={box:function(e,t){arguments.length>2&&Z("box");var n=z(t);return new Se(e,K(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&Z("shallowBox"),Q.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&Z("array");var n=z(t);return new Bt(e,K(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&Z("shallowArray"),Q.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&Z("map");var n=z(t);return new Kt(e,K(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&Z("shallowMap"),Q.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&Z("set");var n=z(t);return new Yt(e,K(n),n.name)},object:function(e,t,n){return"string"==typeof arguments[1]&&Z("object"),ut({},e,t,z(n))},shallowObject:function(e,t){return"string"==typeof arguments[1]&&Z("shallowObject"),Q.object(e,{},{name:t,deep:!1})},ref:X,shallow:J,deep:W,struct:Y},Q=function(e,t,n){if("string"==typeof arguments[1])return W.apply(null,arguments);if(yt(e))return e;var r=b(e)?Q.object(e,t,n):Array.isArray(e)?Q.array(e,t):O(e)?Q.map(e,t):w(e)?Q.set(e,t):e;if(r!==e)return r;p(!1)};function Z(e){p("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(F).forEach(function(e){return Q[e]=F[e]});var ee,te,ne=$(!1,function(e,t,n,o,i){var a=n.get,s=n.set,u=i[0]||{};!function(e,t,n){var r=Zt(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new xe(n),Object.defineProperty(e,t,function(e){return nn[e]||(nn[e]={configurable:Re.computedConfigurable,enumerable:!1,get:function(){return rn(this).read(this,e)},set:function(t){rn(this).write(this,e,t)}})}(t))}(e,t,r({get:a,set:s},u))}),re=ne({equals:N.structural}),oe=function(e,t,n){if("string"==typeof t)return ne.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return ne.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new xe(r)};oe.struct=re,(ee=e.IDerivationState||(e.IDerivationState={}))[ee.NOT_TRACKING=-1]="NOT_TRACKING",ee[ee.UP_TO_DATE=0]="UP_TO_DATE",ee[ee.POSSIBLY_STALE=1]="POSSIBLY_STALE",ee[ee.STALE=2]="STALE",function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(te||(te={}));var ie=function(){return function(e){this.cause=e}}();function ae(e){return e instanceof ie}function se(t){switch(t.dependenciesState){case e.IDerivationState.UP_TO_DATE:return!1;case e.IDerivationState.NOT_TRACKING:case e.IDerivationState.STALE:return!0;case e.IDerivationState.POSSIBLY_STALE:for(var n=pe(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Ee(a)){if(Re.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return he(n),!0}if(t.dependenciesState===e.IDerivationState.STALE)return he(n),!0}}return ye(t),he(n),!1}}function ue(e){var t=e.observers.length>0;Re.computationDepth>0&&t&&p(!1),Re.allowStateChanges||!t&&"strict"!==Re.enforceActions||p(!1)}function ce(t,n,r){var o=ve(!0);ye(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++Re.runId;var i,a=Re.trackingDerivation;if(Re.trackingDerivation=t,!0===Re.disableErrorBoundaries)i=n.call(r);else try{i=n.call(r)}catch(e){i=new ie(e)}return Re.trackingDerivation=a,function(t){for(var n=t.observing,r=t.observing=t.newObserving,o=e.IDerivationState.UP_TO_DATE,i=0,a=t.unboundDepsCount,s=0;s<a;s++){var u=r[s];0===u.diffValue&&(u.diffValue=1,i!==s&&(r[i]=u),i++),u.dependenciesState>o&&(o=u.dependenciesState)}r.length=i,t.newObserving=null,a=n.length;for(;a--;){var u=n[a];0===u.diffValue&&Ce(u,t),u.diffValue=0}for(;i--;){var u=r[i];1===u.diffValue&&(u.diffValue=0,Te(u,t))}o!==e.IDerivationState.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),t.observing.length,de(o),i}function le(t){var n=t.observing;t.observing=[];for(var r=n.length;r--;)Ce(n[r],t);t.dependenciesState=e.IDerivationState.NOT_TRACKING}function fe(e){var t=pe(),n=e();return he(t),n}function pe(){var e=Re.trackingDerivation;return Re.trackingDerivation=null,e}function he(e){Re.trackingDerivation=e}function ve(e){var t=Re.allowStateReads;return Re.allowStateReads=e,t}function de(e){Re.allowStateReads=e}function ye(t){if(t.dependenciesState!==e.IDerivationState.UP_TO_DATE){t.dependenciesState=e.IDerivationState.UP_TO_DATE;for(var n=t.observing,r=n.length;r--;)n[r].lowestObserverState=e.IDerivationState.UP_TO_DATE}}function be(e,t){var n=function(){return me(e,t,this,arguments)};return n.isMobxAction=!0,n}function me(e,t,n,r){var o=ge(e,n,r);try{return t.apply(n,r)}catch(e){throw o.error=e,e}finally{_e(o)}}function ge(e,t,n){var r=Ke()&&!!e,o=0;if(r){o=Date.now();var i=n&&n.length||0,a=new Array(i);if(i>0)for(var s=0;s<i;s++)a[s]=n[s];Je({type:"action",name:e,object:t,arguments:a})}var u=pe();Ne();var c={prevDerivation:u,prevAllowStateChanges:Oe(!0),prevAllowStateReads:ve(!0),notifySpy:r,startTime:o,actionId:Re.nextActionId++,parentActionId:Re.currentActionId};return Re.currentActionId=c.actionId,c}function _e(e){Re.currentActionId!==e.actionId&&p("invalid action stack. did you forget to finish an action?"),Re.currentActionId=e.parentActionId,void 0!==e.error&&(Re.suppressReactionErrors=!0),we(e.prevAllowStateChanges),de(e.prevAllowStateReads),Pe(),he(e.prevDerivation),e.notifySpy&&Ye({time:Date.now()-e.startTime}),Re.suppressReactionErrors=!1}function Oe(e){var t=Re.allowStateChanges;return Re.allowStateChanges=e,t}function we(e){Re.allowStateChanges=e}var Se=function(e){function t(t,n,r,o,i){void 0===r&&(r="ObservableValue@"+f()),void 0===o&&(o=!0),void 0===i&&(i=N.default);var a=e.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(t,void 0,r),o&&Ke()&&We({type:"create",name:a.name,newValue:""+a.value}),a}return n(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==Re.UNCHANGED){var n=Ke();n&&Je({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),n&&Ye()}},t.prototype.prepareNewValue=function(e){if(ue(this),At(this)){var t=Et(this,{object:this,type:"update",newValue:e});if(!t)return Re.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Re.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),Dt(this)&&It(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return xt(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),jt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return x(this.get())},t}(R);Se.prototype[A()]=Se.prototype.valueOf;var Ae=_("ObservableValue",Se),xe=function(){function t(t){this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=e.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+f(),this.value=new ie(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=te.NONE,this.derivation=t.get,this.name=t.name||"ComputedValue@"+f(),t.set&&(this.setter=be(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?N.structural:N.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==e.IDerivationState.UP_TO_DATE)return;t.lowestObserverState=e.IDerivationState.POSSIBLY_STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(o.dependenciesState=e.IDerivationState.POSSIBLY_STALE,o.isTracing!==te.NONE&&Be(o,t),o.onBecomeStale())}}(this)},t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.get=function(){this.isComputing&&p("Cycle detected in computation "+this.name+": "+this.derivation),0!==Re.inBatch||0!==this.observers.length||this.keepAlive?(Le(this),se(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===e.IDerivationState.STALE)return;t.lowestObserverState=e.IDerivationState.STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.POSSIBLY_STALE?o.dependenciesState=e.IDerivationState.STALE:o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(t.lowestObserverState=e.IDerivationState.UP_TO_DATE)}}(this)):se(this)&&(this.warnAboutUntrackedRead(),Ne(),this.value=this.computeValue(!1),Pe());var t=this.value;if(ae(t))throw t.cause;return t},t.prototype.peek=function(){var e=this.computeValue(!1);if(ae(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){h(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else h(!1,!1)},t.prototype.trackAndCompute=function(){Ke()&&We({object:this.scope,type:"compute",name:this.name});var t=this.value,n=this.dependenciesState===e.IDerivationState.NOT_TRACKING,r=this.computeValue(!0),o=n||ae(t)||ae(r)||!this.equals(t,r);return o&&(this.value=r),o},t.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Re.computationDepth++,e)t=ce(this,this.derivation,this.scope);else if(!0===Re.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ie(e)}return Re.computationDepth--,this.isComputing=!1,t},t.prototype.suspend=function(){this.keepAlive||(le(this),this.value=void 0)},t.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return nt(function(){var i=n.get();if(!r||t){var a=pe();e({type:"update",object:n,newValue:i,oldValue:o}),he(a)}r=!1,o=i})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return x(this.get())},t}();xe.prototype[A()]=xe.prototype.valueOf;var Ee=_("ComputedValue",xe),De=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],je=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.currentActionId=0,this.nextActionId=1}}(),Ie=!0,ke=!1,Re=function(){var e=l();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ie=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new je).version&&(Ie=!1),Ie?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new je):(setTimeout(function(){ke||p("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new je)}();function Te(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Ce(e,t){if(1===e.observers.length)e.observers.length=0,Ve(e);else{var n=e.observers,r=e.observersIndexes,o=n.pop();if(o!==t){var i=r[t.__mapid]||0;i?r[o.__mapid]=i:delete r[o.__mapid],n[i]=o}delete r[t.__mapid]}}function Ve(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Re.pendingUnobservations.push(e))}function Ne(){Re.inBatch++}function Pe(){if(0==--Re.inBatch){Ge();for(var e=Re.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof xe&&n.suspend())}Re.pendingUnobservations=[]}}function Le(e){var t=Re.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&Re.inBatch>0&&Ve(e),!1)}function Be(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===te.BREAK){var n=[];!function e(t,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+t.name);t.dependencies&&t.dependencies.forEach(function(t){return e(t,n,r+1)})}(ct(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof xe?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}var $e=function(){function t(t,n,r,o){void 0===t&&(t="Reaction@"+f()),void 0===o&&(o=!1),this.name=t,this.onInvalidate=n,this.errorHandler=r,this.requiresObservable=o,this.observing=[],this.newObserving=[],this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+f(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=te.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Re.pendingReactions.push(this),Ge())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Ne(),this._isScheduled=!1,se(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ke()&&We({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Pe()}},t.prototype.track=function(e){Ne();var t,n=Ke();n&&(t=Date.now(),Je({name:this.name,type:"reaction"})),this._isRunning=!0;var r=ce(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&le(this),ae(r)&&this.reportExceptionInDerivation(r.cause),n&&Ye({time:Date.now()-t}),Pe()},t.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Re.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Re.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ke()&&We({type:"error",name:this.name,message:n,error:""+e}),Re.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ne(),le(this),Pe()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){void 0===e&&(e=!1),Ot(this,e)},t}();var Me=100,Ue=function(e){return e()};function Ge(){Re.inBatch>0||Re.isRunningReactions||Ue(qe)}function qe(){Re.isRunningReactions=!0;for(var e=Re.pendingReactions,t=0;e.length>0;){++t===Me&&(console.error("Reaction doesn't converge to a stable state after "+Me+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}Re.isRunningReactions=!1}var He=_("Reaction",$e);function ze(e){var t=Ue;Ue=function(n){return e(function(){return t(n)})}}function Ke(){return!!Re.spyListeners.length}function We(e){if(Re.spyListeners.length)for(var t=Re.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function Je(e){We(r({},e,{spyReportStart:!0}))}var Xe={spyReportEnd:!0};function Ye(e){We(e?r({},e,{spyReportEnd:!0}):Xe)}function Fe(e){return Re.spyListeners.push(e),v(function(){Re.spyListeners=Re.spyListeners.filter(function(t){return t!==e})})}function Qe(){p(!1)}function Ze(e){return function(t,n,r){if(r){if(r.value)return{value:be(e,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return be(e,o.call(this))}}}return function(e){return function(t,n,r){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){m(this,n,et(e,t))}})}}(e).apply(this,arguments)}}var et=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?be(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?be(e,t):1===arguments.length&&"string"==typeof e?Ze(e):!0!==r?Ze(t).apply(null,arguments):void(e[t]=be(e.name||t,n.value))};function tt(e,t,n){m(e,t,be(t,n.bind(e)))}function nt(e,t){void 0===t&&(t=u);var n,r=t&&t.name||e.name||"Autorun@"+f();if(!t.scheduler&&!t.delay)n=new $e(r,function(){this.track(a)},t.onError,t.requiresObservable);else{var o=ot(t),i=!1;n=new $e(r,function(){i||(i=!0,o(function(){i=!1,n.isDisposed||n.track(a)}))},t.onError,t.requiresObservable)}function a(){e(n)}return n.schedule(),n.getDisposer()}et.bound=function(e,t,n,r){return!0===r?(tt(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return tt(this,t,n.value||n.initializer.call(this)),this[t]},set:Qe}:{enumerable:!1,configurable:!0,set:function(e){tt(this,t,e)},get:function(){}}};var rt=function(e){return e()};function ot(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:rt}function it(e,t,n){return st("onBecomeObserved",e,t,n)}function at(e,t,n){return st("onBecomeUnobserved",e,t,n)}function st(e,t,n,r){var o="function"==typeof r?sn(t,n):sn(t),i="function"==typeof r?r:n,a=o[e];return"function"!=typeof a?p(!1):(o[e]=function(){a.call(this),i.call(this)},function(){o[e]=a})}function ut(e,t,n,r){var o=(r=z(r)).defaultDecorator||(!1===r.deep?X:W);B(e),Zt(e,r.name,o.enhancer),Ne();try{for(var i in t){var a=Object.getOwnPropertyDescriptor(t,i),s=(n&&i in n?n[i]:a.get?ne:o)(e,i,a,!0);s&&Object.defineProperty(e,i,s)}}finally{Pe()}return e}function ct(e,t){return lt(sn(e,t))}function lt(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n).map(lt)),r}function ft(e){var t,n={name:e.name};return(t=e).observers&&t.observers.length>0&&(n.observers=function(e){return e.observers}(e).map(ft)),n}var pt=0;function ht(e){"function"==typeof e.cancel&&e.cancel()}function vt(e,t){if(null==e)return!1;if(void 0!==t){if(!1===an(e))return!1;if(!e.$mobx.values[t])return!1;var n=sn(e,t);return Ee(n)}return Ee(e)}function dt(e,t){if(null==e)return!1;if(void 0!==t){if(an(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return an(e)||!!e.$mobx||T(e)||He(e)||Ee(e)}function yt(e){return 1!==arguments.length&&p(!1),dt(e)}function bt(e){return an(e)?e.$mobx.getKeys():Jt(e)?e._keys.slice():Ft(e)?S(e.keys()):Ht(e)?e.map(function(e,t){return t}):p(!1)}function mt(e,t){if(an(e)){var n=un(e);return n.getKeys(),!!n.values[t]}return Jt(e)?e.has(t):Ft(e)?e.has(t):Ht(e)?t>=0&&t<e.length:p(!1)}var gt={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function _t(e,t,n,r){return r.detectCycles&&e.set(t,n),n}function Ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;"boolean"==typeof e[e.length-1]&&(n=e.pop());var r=function(e){switch(e.length){case 0:return Re.trackingDerivation;case 1:return sn(e[0]);case 2:return sn(e[0],e[1])}}(e);if(!r)return p(!1);r.isTracing===te.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?te.BREAK:te.LOG}function wt(e,t){void 0===t&&(t=void 0),Ne();try{return e.apply(t)}finally{Pe()}}function St(e,t,n){var r;"number"==typeof n.timeout&&(r=setTimeout(function(){if(!i.$mobx.isDisposed){i();var e=new Error("WHEN_TIMEOUT");if(!n.onError)throw e;n.onError(e)}},n.timeout)),n.name=n.name||"When@"+f();var o=be(n.name+"-effect",t),i=nt(function(t){e()&&(t.dispose(),r&&clearTimeout(r),o())},n);return i}function At(e){return void 0!==e.interceptors&&e.interceptors.length>0}function xt(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),v(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Et(e,t){var n=pe();try{var r=e.interceptors;if(r)for(var o=0,i=r.length;o<i&&(h(!(t=r[o](t))||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{he(n)}}function Dt(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function jt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),v(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function It(e,t){var n=pe(),r=e.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](t);he(n)}}var kt,Rt,Tt,Ct,Vt=(kt=!1,Rt={},Object.defineProperty(Rt,"0",{set:function(){kt=!0}}),Object.create(Rt)[0]=1,!1===kt),Nt=0,Pt=function(){return function(){}}();Tt=Pt,Ct=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(Tt.prototype,Ct):void 0!==Tt.prototype.__proto__?Tt.prototype.__proto__=Ct:Tt.prototype=Ct,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(Pt.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var Lt=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.atom=new R(e||"ObservableArray@"+f()),this.enhancer=function(n,r){return t(n,r,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return xt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),jt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray(t,0,n)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>Nt&&Gt(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;ue(this.atom);var o=this.values.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===n&&(n=s),At(this)){var i=Et(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!i)return s;t=i.removedCount,n=i.added}var a=(n=0===n.length?n:n.map(function(e){return r.enhancer(e,void 0)})).length-t;this.updateArrayLength(o,a);var u=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,i([e,t],n));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var o=!this.owned&&Ke(),i=Dt(this),a=i||o?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;o&&Je(r({},a,{name:this.atom.name})),this.atom.reportChanged(),i&&It(this,a),o&&Ye()},e.prototype.notifyArraySplice=function(e,t,n){var o=!this.owned&&Ke(),i=Dt(this),a=i||o?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;o&&Je(r({},a,{name:this.atom.name})),this.atom.reportChanged(),i&&It(this,a),o&&Ye()},e}(),Bt=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableArray@"+f()),void 0===o&&(o=!1);var i=e.call(this)||this,a=new Lt(r,n,i,o);if(g(i,"$mobx",a),t&&t.length){var s=Oe(!0);i.spliceWithArray(0,0,t),we(s)}return Vt&&Object.defineProperty(a.array,"0",$t),i}return n(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return Ht(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,n){void 0===n&&(n=0),arguments.length;var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},t.prototype.findIndex=function(e,t,n){void 0===n&&(n=0),arguments.length;for(var r=this.peek(),o=r.length,i=n;i<o;i++)if(e.call(t,r[i],i,this))return i;return-1},t.prototype.splice=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,n)},t.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,e),n.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,o=this.$mobx.values;r=e<t?i(o.slice(0,e),o.slice(e+1,t+1),[o[e]],o.slice(t+1)):i(o.slice(0,t),[o[e]],o.slice(t,e),o.slice(e+1)),this.replace(r)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var n=this.$mobx,r=n.values;if(e<r.length){ue(n.atom);var o=r[e];if(At(n)){var i=Et(n,{type:"update",object:this,index:e,newValue:t});if(!i)return;t=i.newValue}(t=n.enhancer(t,o))!==o&&(r[e]=t,n.notifyArrayChildUpdate(e,t,o))}else{if(e!==r.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+r.length);n.spliceWithArray(e,0,[t])}},t}(Pt);D(Bt.prototype,function(){this.$mobx.atom.reportObserved();var e=this,t=0;return j({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})}),Object.defineProperty(Bt.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),m(Bt.prototype,I(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];h("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),m(Bt.prototype,e,function(){return t.apply(this.peek(),arguments)})}),function(e,t){for(var n=0;n<t.length;n++)m(e,t[n],e[t[n]])}(Bt.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var $t=Mt(0);function Mt(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function Ut(e){Object.defineProperty(Bt.prototype,""+e,Mt(e))}function Gt(e){for(var t=Nt;t<e;t++)Ut(t);Nt=e}Gt(1e3);var qt=_("ObservableArrayAdministration",Lt);function Ht(e){return y(e)&&qt(e.$mobx)}var zt={},Kt=function(){function e(e,t,n){if(void 0===t&&(t=M),void 0===n&&(n="ObservableMap@"+f()),this.enhancer=t,this.name=n,this.$mobx=zt,this._keys=new Bt(void 0,U,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!Re.trackingDerivation)return this._has(e);var n=this._hasMap.get(e);if(!n){var r=n=new Se(this._has(e),U,this.name+"."+Wt(e)+"?",!1);this._hasMap.set(e,r),at(r,function(){return t._hasMap.delete(e)})}return n.get()},e.prototype.set=function(e,t){var n=this._has(e);if(At(this)){var r=Et(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(At(this)&&!(i=Et(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var n=Ke(),o=Dt(this),i=o||n?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return n&&Je(r({},i,{name:this.name,key:e})),wt(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)}),o&&It(this,i),n&&Ye(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap.get(e);n&&n.setNewValue(t)},e.prototype._updateValue=function(e,t){var n=this._data.get(e);if((t=n.prepareNewValue(t))!==Re.UNCHANGED){var o=Ke(),i=Dt(this),a=i||o?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;o&&Je(r({},a,{name:this.name,key:e})),n.setNewValue(t),i&&It(this,a),o&&Ye()}},e.prototype._addValue=function(e,t){var n=this;wt(function(){var r=new Se(t,n.enhancer,n.name+"."+Wt(e),!1);n._data.set(e,r),t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var o=Ke(),i=Dt(this),a=i||o?{type:"add",object:this,name:e,newValue:t}:null;o&&Je(r({},a,{name:this.name,key:e})),i&&It(this,a),o&&Ye()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[E()]()},e.prototype.values=function(){var e=this,t=0;return j({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return j({next:function(){if(t<e._keys.length){var n=e._keys[t++];return{value:[n,e.get(n)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var n=this;this._keys.forEach(function(r){return e.call(t,n.get(r),r,n)})},e.prototype.merge=function(e){var t=this;return Jt(e)&&(e=e.toJS()),wt(function(){b(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=o(e,2),r=n[0],i=n[1];return t.set(r,i)}):O(e)?e.constructor!==Map?p("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(e,n){return t.set(n,e)}):null!=e&&p("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;wt(function(){fe(function(){e._keys.slice().forEach(function(t){return e.delete(t)})})})},e.prototype.replace=function(e){var t=this;return wt(function(){for(var n,r=O(n=e)||Jt(n)?n:Array.isArray(n)?new Map(n):b(n)?new Map(Object.entries(n)):p("Cannot convert to map from '"+n+"'"),o=t._keys,i=Array.from(r.keys()),a=!1,s=0;s<o.length;s++){var u=o[s];o.length===i.length&&u!==i[s]&&(a=!0),r.has(u)||(a=!0,t.delete(u))}r.forEach(function(e,n){t._data.has(n)||(a=!0),t.set(n,e)}),a&&t._keys.replace(i)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach(function(n){return t["symbol"==typeof n?n:Wt(n)]=e.get(n)}),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach(function(n){return t.set(n,e.get(n))}),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(t){return Wt(t)+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return jt(this,e)},e.prototype.intercept=function(e){return xt(this,e)},e}();function Wt(e){return e&&e.toString?e.toString():new String(e).toString()}D(Kt.prototype,function(){return this.entries()}),g(Kt.prototype,I(),"Map");var Jt=_("ObservableMap",Kt),Xt={},Yt=function(){function e(e,t,n){if(void 0===t&&(t=M),void 0===n&&(n="ObservableSet@"+f()),this.name=n,this.$mobx=Xt,this._data=new Set,this._atom=C(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,r){return t(e,r,n)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;wt(function(){fe(function(){e._data.forEach(function(t){e.delete(t)})})})},e.prototype.forEach=function(e,t){var n=this;this._data.forEach(function(r){e.call(t,r,r,n)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if((ue(this._atom),At(this))&&!(o=Et(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){wt(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var n=Ke(),r=Dt(this),o=r||n?{type:"add",object:this,newValue:e}:null;0,r&&It(this,o)}return this},e.prototype.delete=function(e){var t=this;if(At(this)&&!(o=Et(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var n=Ke(),r=Dt(this),o=r||n?{type:"delete",object:this,oldValue:e}:null;return wt(function(){t._atom.reportChanged(),t._data.delete(e)}),r&&It(this,o),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=S(this.keys()),n=S(this.values());return j({next:function(){var r=e;return e+=1,r<n.length?{value:[t[r],n[r]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,n=0;return void 0!==this._data.values?e=S(this._data.values()):(e=[],this._data.forEach(function(t){return e.push(t)})),j({next:function(){return n<e.length?{value:t.dehanceValue(e[n++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return Ft(e)&&(e=e.toJS()),wt(function(){Array.isArray(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):w(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):null!=e&&p("Cannot initialize set from "+e)}),this},e.prototype.observe=function(e,t){return jt(this,e)},e.prototype.intercept=function(e){return xt(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+S(this.keys()).join(", ")+" ]"},e}();D(Yt.prototype,function(){return this.values()}),g(Yt.prototype,I(),"Set");var Ft=_("ObservableSet",Yt),Qt=function(){function e(e,t,n){this.target=e,this.name=t,this.defaultEnhancer=n,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,n){var o=this.target;o!==e&&this.illegalAccess(e,t);var i=this.values[t];if(i instanceof xe)i.set(n);else{if(At(this)){if(!(u=Et(this,{type:"update",object:o,name:t,newValue:n})))return;n=u.newValue}if((n=i.prepareNewValue(n))!==Re.UNCHANGED){var a=Dt(this),s=Ke(),u=a||s?{type:"update",object:o,oldValue:i.value,name:t,newValue:n}:null;s&&Je(r({},u,{name:this.name,key:t})),i.setNewValue(n),a&&It(this,u),s&&Ye()}}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(At(this))if(!(a=Et(this,{object:t,name:e,type:"remove"})))return;try{Ne();var n=Dt(this),o=Ke(),i=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var a=n||o?{type:"remove",object:t,oldValue:i,name:e}:null;o&&Je(r({},a,{name:this.name,key:e})),n&&It(this,a),o&&Ye()}finally{Pe()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return jt(this,e)},e.prototype.intercept=function(e){return xt(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new Bt(Object.keys(this.values).filter(function(t){return e.values[t]instanceof Se}),U,"keys("+this.name+")",!0)),this.keys.slice()},e}();function Zt(e,t,n){void 0===t&&(t=""),void 0===n&&(n=M);var r=e.$mobx;return r||(b(e)||(t=(e.constructor.name||"ObservableObject")+"@"+f()),t||(t="ObservableObject@"+f()),g(e,"$mobx",r=new Qt(e,t,n)),r)}function en(e,t,n,o){var i=Zt(e);if(At(i)){var a=Et(i,{object:e,name:t,type:"add",newValue:n});if(!a)return;n=a.newValue}n=(i.values[t]=new Se(n,o,i.name+"."+t,!1)).value,Object.defineProperty(e,t,function(e){return tn[e]||(tn[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}(t)),i.keys&&i.keys.push(t),function(e,t,n,o){var i=Dt(e),a=Ke(),s=i||a?{type:"add",object:t,name:n,newValue:o}:null;a&&Je(r({},s,{name:e.name,key:n}));i&&It(e,s);a&&Ye()}(i,e,t,n)}var tn=Object.create(null),nn=Object.create(null);function rn(e){var t=e.$mobx;return t||(B(e),e.$mobx)}var on=_("ObservableObjectAdministration",Qt);function an(e){return!!y(e)&&(B(e),on(e.$mobx))}function sn(e,t){if("object"==typeof e&&null!==e){if(Ht(e))return void 0!==t&&p(!1),e.$mobx.atom;if(Ft(e))return e.$mobx;if(Jt(e)){var n=e;return void 0===t?sn(n._keys):((r=n._data.get(t)||n._hasMap.get(t))||p(!1),r)}var r;if(B(e),t&&!e.$mobx&&e[t],an(e))return t?((r=e.$mobx.values[t])||p(!1),r):p(!1);if(T(e)||Ee(e)||He(e))return e}else if("function"==typeof e&&He(e.$mobx))return e.$mobx;return p(!1)}function un(e,t){return e||p("Expecting some object"),void 0!==t?un(sn(e,t)):T(e)||Ee(e)||He(e)?e:Jt(e)||Ft(e)?e:(B(e),e.$mobx?e.$mobx:void p(!1))}function cn(e,t){return(void 0!==t?sn(e,t):an(e)||Jt(e)||Ft(e)?un(e):sn(e)).name}var ln=Object.prototype.toString;function fn(e,t){return pn(e,t)}function pn(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&function(e,t,n,r){e=hn(e),t=hn(t);var o=ln.call(e);if(o!==ln.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var i="[object Array]"===o;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}r=r||[];var u=(n=n||[]).length;for(;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),i){if((u=e.length)!==t.length)return!1;for(;u--;)if(!pn(e[u],t[u],n,r))return!1}else{var c=Object.keys(e),l=void 0;if(u=c.length,Object.keys(t).length!==u)return!1;for(;u--;)if(l=c[u],!vn(t,l)||!pn(e[l],t[l],n,r))return!1}return n.pop(),r.pop(),!0}(e,t,n,r)}function hn(e){return Ht(e)?e.peek():O(e)||Jt(e)?S(e.entries()):w(e)||Ft(e)?S(e.entries()):e}function vn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Fe,extras:{getDebugName:cn},$mobx:"$mobx"}),e.$mobx="$mobx",e.ObservableMap=Kt,e.ObservableSet=Yt,e.Reaction=$e,e._allowStateChanges=function(e,t){var n,r=Oe(e);try{n=t()}finally{we(r)}return n},e._allowStateChangesInsideComputed=function(e){var t,n=Re.computationDepth;Re.computationDepth=0;try{t=e()}finally{Re.computationDepth=n}return t},e._endAction=_e,e._getAdministration=un,e._getGlobalState=function(){return Re},e._interceptReads=function(e,t,n){var r;if(Jt(e)||Ht(e)||Ae(e))r=un(e);else{if(!an(e))return p(!1);if("string"!=typeof t)return p(!1);r=un(e,t)}return void 0!==r.dehancer?p(!1):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})},e._isComputingDerivation=function(){return null!==Re.trackingDerivation},e._resetGlobalState=function(){var e=new je;for(var t in e)-1===De.indexOf(t)&&(Re[t]=e[t]);Re.allowStateChanges=!Re.enforceActions},e._startAction=ge,e.action=et,e.autorun=nt,e.comparer=N,e.computed=oe,e.configure=function(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.computedConfigurable,o=e.disableErrorBoundaries,i=e.arrayBuffer,a=e.reactionScheduler,s=e.reactionRequiresObservable,u=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((Re.pendingReactions.length||Re.inBatch||Re.isRunningReactions)&&p("isolateGlobalState should be called before MobX is running any reactions"),ke=!0,Ie&&(0==--l().__mobxInstanceCount&&(l().__mobxGlobals=void 0),Re=new je)),void 0!==t){var c=void 0;switch(t){case!0:case"observed":c=!0;break;case!1:case"never":c=!1;break;case"strict":case"always":c="strict";break;default:p("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}Re.enforceActions=c,Re.allowStateChanges=!0!==c&&"strict"!==c}void 0!==n&&(Re.computedRequiresReaction=!!n),void 0!==s&&(Re.reactionRequiresObservable=!!s),void 0!==u&&(Re.observableRequiresReaction=!!u,Re.allowStateReads=!Re.observableRequiresReaction),void 0!==r&&(Re.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors if this is on."),Re.disableErrorBoundaries=!!o),"number"==typeof i&&Gt(i),a&&ze(a)},e.createAtom=C,e.decorate=function(e,t){var n="function"==typeof e?e.prototype:e,r=function(e){var r=t[e];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,e),i=r.reduce(function(t,r){return r(n,e,t)},o);i&&Object.defineProperty(n,e,i)};for(var o in t)r(o);return e},e.entries=function(e){return an(e)?bt(e).map(function(t){return[t,e[t]]}):Jt(e)?bt(e).map(function(t){return[t,e.get(t)]}):Ft(e)?S(e.entries()):Ht(e)?e.map(function(e,t){return[t,e]}):p(!1)},e.extendObservable=ut,e.extendShallowObservable=function(e,t,n){return ut(e,t,n,H)},e.flow=function(e){1!==arguments.length&&p("Flow expects one 1 argument and cannot be used as decorator");var t=e.name||"<unnamed flow>";return function(){var n,r=arguments,o=++pt,i=et(t+" - runid: "+o+" - init",e).apply(this,r),a=void 0,s=new Promise(function(e,r){var s=0;function u(e){var n;a=void 0;try{n=et(t+" - runid: "+o+" - yield "+s++,i.next).call(i,e)}catch(e){return r(e)}l(n)}function c(e){var n;a=void 0;try{n=et(t+" - runid: "+o+" - yield "+s++,i.throw).call(i,e)}catch(e){return r(e)}l(n)}function l(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(a=Promise.resolve(t.value)).then(u,c);t.then(l,r)}n=r,u(void 0)});return s.cancel=et(t+" - runid: "+o+" - cancel",function(){try{a&&ht(a);var e=i.return(),t=Promise.resolve(e.value);t.then(d,d),ht(t),n(new Error("FLOW_CANCELLED"))}catch(e){n(e)}}),s}},e.get=function(e,t){if(mt(e,t))return an(e)?e[t]:Jt(e)?e.get(t):Ht(e)?e[t]:p(!1)},e.getAtom=sn,e.getDebugName=cn,e.getDependencyTree=ct,e.getObserverTree=function(e,t){return ft(sn(e,t))},e.has=mt,e.intercept=function(e,t,n){return"function"==typeof n?function(e,t,n){return un(e,t).intercept(n)}(e,t,n):function(e,t){return un(e).intercept(t)}(e,t)},e.isAction=function(e){return"function"==typeof e&&!0===e.isMobxAction},e.isArrayLike=function(e){return Array.isArray(e)||Ht(e)},e.isBoxedObservable=Ae,e.isComputed=function(e){return arguments.length>1?p(!1):vt(e)},e.isComputedProp=function(e,t){return"string"!=typeof t?p(!1):vt(e,t)},e.isObservable=yt,e.isObservableArray=Ht,e.isObservableMap=Jt,e.isObservableObject=an,e.isObservableProp=function(e,t){return"string"!=typeof t?p(!1):dt(e,t)},e.isObservableSet=Ft,e.keys=bt,e.observable=Q,e.observe=function(e,t,n,r){return"function"==typeof n?function(e,t,n,r){return un(e,t).observe(n,r)}(e,t,n,r):function(e,t,n){return un(e).observe(t,n)}(e,t,n)},e.onBecomeObserved=it,e.onBecomeUnobserved=at,e.onReactionError=function(e){return Re.globalReactionErrorHandlers.push(e),function(){var t=Re.globalReactionErrorHandlers.indexOf(e);t>=0&&Re.globalReactionErrorHandlers.splice(t,1)}},e.reaction=function(e,t,n){void 0===n&&(n=u),"boolean"==typeof n&&(n={fireImmediately:n});var r,o,i,a=n.name||"Reaction@"+f(),s=et(a,n.onError?(r=n.onError,o=t,function(){try{return o.apply(this,arguments)}catch(e){r.call(this,e)}}):t),c=!n.scheduler&&!n.delay,l=ot(n),p=!0,h=!1,v=n.compareStructural?N.structural:n.equals||N.default,d=new $e(a,function(){p||c?y():h||(h=!0,l(y))},n.onError,n.requiresObservable);function y(){if(h=!1,!d.isDisposed){var t=!1;d.track(function(){var n=e(d);t=p||!v(i,n),i=n}),p&&n.fireImmediately&&s(i,d),p||!0!==t||s(i,d),p&&(p=!1)}}return d.schedule(),d.getDisposer()},e.remove=function(e,t){if(an(e))e.$mobx.remove(t);else if(Jt(e))e.delete(t);else if(Ft(e))e.delete(t);else{if(!Ht(e))return p(!1);"number"!=typeof t&&(t=parseInt(t,10)),h(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}},e.runInAction=function(e,t){return me("string"==typeof e?e:e.name||"<unnamed action>","function"==typeof e?e:t,this,void 0)},e.set=function e(t,n,r){if(2!==arguments.length||Ft(t))if(an(t)){var o=t.$mobx;o.values[n]?o.write(t,n,r):en(t,n,r,o.defaultEnhancer)}else if(Jt(t))t.set(n,r);else if(Ft(t))t.add(n);else{if(!Ht(t))return p(!1);"number"!=typeof n&&(n=parseInt(n,10)),h(n>=0,"Not a valid index: '"+n+"'"),Ne(),n>=t.length&&(t.length=n+1),t[n]=r,Pe()}else{Ne();var i=n;try{for(var a in i)e(t,a,i[a])}finally{Pe()}}},e.spy=Fe,e.toJS=function(e,t){var n;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=gt),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(n=new Map),function e(t,n,r){if(!n.recurseEverything&&!yt(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Ae(t))return e(t.get(),n,r);if(yt(t)&&bt(t),!0===n.detectCycles&&null!==t&&r.has(t))return r.get(t);if(Ht(t)||Array.isArray(t)){var o=_t(r,t,[],n),i=t.map(function(t){return e(t,n,r)});o.length=i.length;for(var a=0,s=i.length;a<s;a++)o[a]=i[a];return o}if(Ft(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===n.exportMapsAsObjects){var u=_t(r,t,new Set,n);return t.forEach(function(t){u.add(e(t,n,r))}),u}var c=_t(r,t,[],n);return t.forEach(function(t){c.push(e(t,n,r))}),c}if(Jt(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===n.exportMapsAsObjects){var l=_t(r,t,new Map,n);return t.forEach(function(t,o){l.set(o,e(t,n,r))}),l}var f=_t(r,t,{},n);return t.forEach(function(t,o){f[o]=e(t,n,r)}),f}var p=_t(r,t,{},n);for(var h in t)p[h]=e(t[h],n,r);return p}(e,t,n)},e.trace=Ot,e.transaction=wt,e.untracked=fe,e.values=function(e){return an(e)?bt(e).map(function(t){return e[t]}):Jt(e)?bt(e).map(function(t){return e.get(t)}):Ft(e)?S(e.values()):Ht(e)?e.slice():p(!1)},e.when=function(e,t,n){return 1===arguments.length||t&&"object"==typeof t?function(e,t){var n,o=new Promise(function(o,i){var a=St(e,o,r({},t,{onError:i}));n=function(){a(),i("WHEN_CANCELLED")}});return o.cancel=n,o}(e,t):St(e,t,n||{})},Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).mobx={})}(this,function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}var a="An invariant failed, however the error is obfuscated because this is an production build.",s=[];Object.freeze(s);var u={};Object.freeze(u);var c={};function l(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:c}function f(){return++Ce.mobxGuid}function p(e){throw h(!1,e),"X"}function h(e,t){if(!e)throw new Error("[mobx] "+(t||a))}function v(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var d=function(){};function y(e){return null!==e&&"object"==typeof e}function b(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function m(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function _(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return y(e)&&!0===e[n]}}function O(e){return void 0!==l().Map&&e instanceof l().Map}function w(e){return e instanceof Set}function S(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function A(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function x(e){return null===e?null:"object"==typeof e?""+e:e}function E(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function D(e,t){g(e,E(),t)}function j(e){return e[E()]=I,e}function k(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function I(){return this}var R=function(){function t(t){void 0===t&&(t="Atom@"+f()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=e.IDerivationState.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.reportObserved=function(){return $e(this)},t.prototype.reportChanged=function(){Le(),function(t){if(t.lowestObserverState===e.IDerivationState.STALE)return;t.lowestObserverState=e.IDerivationState.STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(o.isTracing!==te.NONE&&Me(o,t),o.onBecomeStale()),o.dependenciesState=e.IDerivationState.STALE}}(this),Be()},t.prototype.toString=function(){return this.name},t}(),T=_("Atom",R);function C(e,t,n){void 0===t&&(t=d),void 0===n&&(n=d);var r=new R(e);return st(r,t),ut(r,n),r}function V(e,t){return e===t}var N={identity:V,structural:function(e,t){return hn(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||V(e,t)},shallow:function(e,t){return hn(e,t,1)}},P={},L={};function B(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var n in m(e,"__mobxDidRunLazyInitializers",!0),t){var r=t[n];r.propertyCreator(e,r.prop,r.descriptor,r.decoratorTarget,r.decoratorArguments)}}}function $(e,t){return function(){var n,o,i=function(o,i,a,s){if(!0===s)return t(o,i,a,o,n),null;if(!Object.prototype.hasOwnProperty.call(o,"__mobxDecorators")){var u=o.__mobxDecorators;m(o,"__mobxDecorators",r({},u))}return o.__mobxDecorators[i]={prop:i,propertyCreator:t,descriptor:a,decoratorTarget:o,decoratorArguments:n},function(e,t){var n=t?P:L;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return B(this),this[e]},set:function(t){B(this),this[e]=t}})}(i,e)};return(2===(o=arguments).length||3===o.length)&&"string"==typeof o[1]||4===o.length&&!0===o[3]?(n=s,i.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),i)}}function M(e,t,n){return mt(e)?e:Array.isArray(e)?Q.array(e,{name:n}):b(e)?Q.object(e,void 0,{name:n}):O(e)?Q.map(e,{name:n}):w(e)?Q.set(e,{name:n}):e}function U(e){return e}function G(e){var t=$(!0,function(t,n,r,o,i){nn(t,n,r?r.initializer?r.initializer.call(t):r.value:void 0,e)}),n=("undefined"!=typeof process&&process.env,t);return n.enhancer=e,n}var q={deep:!0,name:void 0,defaultDecorator:void 0},H={deep:!1,name:void 0,defaultDecorator:void 0};function z(e){return null==e?q:"string"==typeof e?{name:e,deep:!0}:e}function K(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?U:M}Object.freeze(q),Object.freeze(H);var W=G(M),J=G(function(e,t,n){return null==e?e:un(e)||Kt(e)||Yt(e)||Zt(e)?e:Array.isArray(e)?Q.array(e,{name:n,deep:!1}):b(e)?Q.object(e,void 0,{name:n,deep:!1}):O(e)?Q.map(e,{name:n,deep:!1}):w(e)?Q.set(e,{name:n,deep:!1}):p(!1)}),X=G(U),Y=G(function(e,t,n){return hn(e,t)?t:e});var F={box:function(e,t){arguments.length>2&&Z("box");var n=z(t);return new xe(e,K(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&Z("shallowBox"),Q.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&Z("array");var n=z(t);return new Mt(e,K(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&Z("shallowArray"),Q.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&Z("map");var n=z(t);return new Jt(e,K(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&Z("shallowMap"),Q.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&Z("set");var n=z(t);return new Qt(e,K(n),n.name)},object:function(e,t,n){return"string"==typeof arguments[1]&&Z("object"),lt({},e,t,z(n))},shallowObject:function(e,t){return"string"==typeof arguments[1]&&Z("shallowObject"),Q.object(e,{},{name:t,deep:!1})},ref:X,shallow:J,deep:W,struct:Y},Q=function(e,t,n){if("string"==typeof arguments[1])return W.apply(null,arguments);if(mt(e))return e;var r=b(e)?Q.object(e,t,n):Array.isArray(e)?Q.array(e,t):O(e)?Q.map(e,t):w(e)?Q.set(e,t):e;if(r!==e)return r;p(!1)};function Z(e){p("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(F).forEach(function(e){return Q[e]=F[e]});var ee,te,ne=$(!1,function(e,t,n,o,i){var a=n.get,s=n.set,u=i[0]||{};!function(e,t,n){var r=tn(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new De(n),Object.defineProperty(e,t,function(e){return on[e]||(on[e]={configurable:Ce.computedConfigurable,enumerable:!1,get:function(){return an(this).read(this,e)},set:function(t){an(this).write(this,e,t)}})}(t))}(e,t,r({get:a,set:s},u))}),re=ne({equals:N.structural}),oe=function(e,t,n){if("string"==typeof t)return ne.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return ne.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new De(r)};oe.struct=re,(ee=e.IDerivationState||(e.IDerivationState={}))[ee.NOT_TRACKING=-1]="NOT_TRACKING",ee[ee.UP_TO_DATE=0]="UP_TO_DATE",ee[ee.POSSIBLY_STALE=1]="POSSIBLY_STALE",ee[ee.STALE=2]="STALE",function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(te||(te={}));var ie=function(){return function(e){this.cause=e}}();function ae(e){return e instanceof ie}function se(t){switch(t.dependenciesState){case e.IDerivationState.UP_TO_DATE:return!1;case e.IDerivationState.NOT_TRACKING:case e.IDerivationState.STALE:return!0;case e.IDerivationState.POSSIBLY_STALE:for(var n=pe(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(je(a)){if(Ce.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return he(n),!0}if(t.dependenciesState===e.IDerivationState.STALE)return he(n),!0}}return ye(t),he(n),!1}}function ue(e){var t=e.observers.length>0;Ce.computationDepth>0&&t&&p(!1),Ce.allowStateChanges||!t&&"strict"!==Ce.enforceActions||p(!1)}function ce(t,n,r){var o=ve(!0);ye(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++Ce.runId;var i,a=Ce.trackingDerivation;if(Ce.trackingDerivation=t,!0===Ce.disableErrorBoundaries)i=n.call(r);else try{i=n.call(r)}catch(e){i=new ie(e)}return Ce.trackingDerivation=a,function(t){for(var n=t.observing,r=t.observing=t.newObserving,o=e.IDerivationState.UP_TO_DATE,i=0,a=t.unboundDepsCount,s=0;s<a;s++){var u=r[s];0===u.diffValue&&(u.diffValue=1,i!==s&&(r[i]=u),i++),u.dependenciesState>o&&(o=u.dependenciesState)}r.length=i,t.newObserving=null,a=n.length;for(;a--;){var u=n[a];0===u.diffValue&&Ne(u,t),u.diffValue=0}for(;i--;){var u=r[i];1===u.diffValue&&(u.diffValue=0,Ve(u,t))}o!==e.IDerivationState.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),t.observing.length,de(o),i}function le(t){var n=t.observing;t.observing=[];for(var r=n.length;r--;)Ne(n[r],t);t.dependenciesState=e.IDerivationState.NOT_TRACKING}function fe(e){var t=pe(),n=e();return he(t),n}function pe(){var e=Ce.trackingDerivation;return Ce.trackingDerivation=null,e}function he(e){Ce.trackingDerivation=e}function ve(e){var t=Ce.allowStateReads;return Ce.allowStateReads=e,t}function de(e){Ce.allowStateReads=e}function ye(t){if(t.dependenciesState!==e.IDerivationState.UP_TO_DATE){t.dependenciesState=e.IDerivationState.UP_TO_DATE;for(var n=t.observing,r=n.length;r--;)n[r].lowestObserverState=e.IDerivationState.UP_TO_DATE}}var be=0,me=1;function ge(e,t){var n=function(){return _e(e,t,this,arguments)};return n.isMobxAction=!0,n}function _e(e,t,n,r){var o=Oe(e,n,r);try{return t.apply(n,r)}catch(e){throw o.error=e,e}finally{we(o)}}function Oe(e,t,n){var r=Je()&&!!e,o=0;if(r){o=Date.now();var i=n&&n.length||0,a=new Array(i);if(i>0)for(var s=0;s<i;s++)a[s]=n[s];Ye({type:"action",name:e,object:t,arguments:a})}var u=pe();Le();var c={prevDerivation:u,prevAllowStateChanges:Se(!0),prevAllowStateReads:ve(!0),notifySpy:r,startTime:o,actionId:me++,parentActionId:be};return be=c.actionId,c}function we(e){be!==e.actionId&&p("invalid action stack. did you forget to finish an action?"),be=e.parentActionId,void 0!==e.error&&(Ce.suppressReactionErrors=!0),Ae(e.prevAllowStateChanges),de(e.prevAllowStateReads),Be(),he(e.prevDerivation),e.notifySpy&&Qe({time:Date.now()-e.startTime}),Ce.suppressReactionErrors=!1}function Se(e){var t=Ce.allowStateChanges;return Ce.allowStateChanges=e,t}function Ae(e){Ce.allowStateChanges=e}var xe=function(e){function t(t,n,r,o,i){void 0===r&&(r="ObservableValue@"+f()),void 0===o&&(o=!0),void 0===i&&(i=N.default);var a=e.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(t,void 0,r),o&&Je()&&Xe({type:"create",name:a.name,newValue:""+a.value}),a}return n(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==Ce.UNCHANGED){var n=Je();n&&Ye({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),n&&Qe()}},t.prototype.prepareNewValue=function(e){if(ue(this),Et(this)){var t=jt(this,{object:this,type:"update",newValue:e});if(!t)return Ce.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Ce.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),kt(this)&&Rt(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return Dt(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),It(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return x(this.get())},t}(R);xe.prototype[A()]=xe.prototype.valueOf;var Ee=_("ObservableValue",xe),De=function(){function t(t){this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=e.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+f(),this.value=new ie(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=te.NONE,this.derivation=t.get,this.name=t.name||"ComputedValue@"+f(),t.set&&(this.setter=ge(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?N.structural:N.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==e.IDerivationState.UP_TO_DATE)return;t.lowestObserverState=e.IDerivationState.POSSIBLY_STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(o.dependenciesState=e.IDerivationState.POSSIBLY_STALE,o.isTracing!==te.NONE&&Me(o,t),o.onBecomeStale())}}(this)},t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.get=function(){this.isComputing&&p("Cycle detected in computation "+this.name+": "+this.derivation),0!==Ce.inBatch||0!==this.observers.length||this.keepAlive?($e(this),se(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===e.IDerivationState.STALE)return;t.lowestObserverState=e.IDerivationState.STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.POSSIBLY_STALE?o.dependenciesState=e.IDerivationState.STALE:o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(t.lowestObserverState=e.IDerivationState.UP_TO_DATE)}}(this)):se(this)&&(this.warnAboutUntrackedRead(),Le(),this.value=this.computeValue(!1),Be());var t=this.value;if(ae(t))throw t.cause;return t},t.prototype.peek=function(){var e=this.computeValue(!1);if(ae(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){h(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else h(!1,!1)},t.prototype.trackAndCompute=function(){Je()&&Xe({object:this.scope,type:"compute",name:this.name});var t=this.value,n=this.dependenciesState===e.IDerivationState.NOT_TRACKING,r=this.computeValue(!0),o=n||ae(t)||ae(r)||!this.equals(t,r);return o&&(this.value=r),o},t.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Ce.computationDepth++,e)t=ce(this,this.derivation,this.scope);else if(!0===Ce.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ie(e)}return Ce.computationDepth--,this.isComputing=!1,t},t.prototype.suspend=function(){this.keepAlive||(le(this),this.value=void 0)},t.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return ot(function(){var i=n.get();if(!r||t){var a=pe();e({type:"update",object:n,newValue:i,oldValue:o}),he(a)}r=!1,o=i})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return x(this.get())},t}();De.prototype[A()]=De.prototype.valueOf;var je=_("ComputedValue",De),ke=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],Ie=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}}(),Re=!0,Te=!1,Ce=function(){var e=l();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Re=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ie).version&&(Re=!1),Re?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ie):(setTimeout(function(){Te||p("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Ie)}();function Ve(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Ne(e,t){if(1===e.observers.length)e.observers.length=0,Pe(e);else{var n=e.observers,r=e.observersIndexes,o=n.pop();if(o!==t){var i=r[t.__mapid]||0;i?r[o.__mapid]=i:delete r[o.__mapid],n[i]=o}delete r[t.__mapid]}}function Pe(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ce.pendingUnobservations.push(e))}function Le(){Ce.inBatch++}function Be(){if(0==--Ce.inBatch){He();for(var e=Ce.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof De&&n.suspend())}Ce.pendingUnobservations=[]}}function $e(e){var t=Ce.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&Ce.inBatch>0&&Pe(e),!1)}function Me(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===te.BREAK){var n=[];!function e(t,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+t.name);t.dependencies&&t.dependencies.forEach(function(t){return e(t,n,r+1)})}(ft(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof De?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}var Ue=function(){function t(t,n,r,o){void 0===t&&(t="Reaction@"+f()),void 0===o&&(o=!1),this.name=t,this.onInvalidate=n,this.errorHandler=r,this.requiresObservable=o,this.observing=[],this.newObserving=[],this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+f(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=te.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ce.pendingReactions.push(this),He())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Le(),this._isScheduled=!1,se(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Je()&&Xe({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Be()}},t.prototype.track=function(e){Le();var t,n=Je();n&&(t=Date.now(),Ye({name:this.name,type:"reaction"})),this._isRunning=!0;var r=ce(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&le(this),ae(r)&&this.reportExceptionInDerivation(r.cause),n&&Qe({time:Date.now()-t}),Be()},t.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ce.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ce.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Je()&&Xe({type:"error",name:this.name,message:n,error:""+e}),Ce.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Le(),le(this),Be()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){void 0===e&&(e=!1),St(this,e)},t}();var Ge=100,qe=function(e){return e()};function He(){Ce.inBatch>0||Ce.isRunningReactions||qe(ze)}function ze(){Ce.isRunningReactions=!0;for(var e=Ce.pendingReactions,t=0;e.length>0;){++t===Ge&&(console.error("Reaction doesn't converge to a stable state after "+Ge+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}Ce.isRunningReactions=!1}var Ke=_("Reaction",Ue);function We(e){var t=qe;qe=function(n){return e(function(){return t(n)})}}function Je(){return!!Ce.spyListeners.length}function Xe(e){if(Ce.spyListeners.length)for(var t=Ce.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function Ye(e){Xe(r({},e,{spyReportStart:!0}))}var Fe={spyReportEnd:!0};function Qe(e){Xe(e?r({},e,{spyReportEnd:!0}):Fe)}function Ze(e){return Ce.spyListeners.push(e),v(function(){Ce.spyListeners=Ce.spyListeners.filter(function(t){return t!==e})})}function et(){p(!1)}function tt(e){return function(t,n,r){if(r){if(r.value)return{value:ge(e,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return ge(e,o.call(this))}}}return function(e){return function(t,n,r){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){m(this,n,nt(e,t))}})}}(e).apply(this,arguments)}}var nt=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?ge(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?ge(e,t):1===arguments.length&&"string"==typeof e?tt(e):!0!==r?tt(t).apply(null,arguments):void(e[t]=ge(e.name||t,n.value))};function rt(e,t,n){m(e,t,ge(t,n.bind(e)))}function ot(e,t){void 0===t&&(t=u);var n,r=t&&t.name||e.name||"Autorun@"+f();if(!t.scheduler&&!t.delay)n=new Ue(r,function(){this.track(a)},t.onError,t.requiresObservable);else{var o=at(t),i=!1;n=new Ue(r,function(){i||(i=!0,o(function(){i=!1,n.isDisposed||n.track(a)}))},t.onError,t.requiresObservable)}function a(){e(n)}return n.schedule(),n.getDisposer()}nt.bound=function(e,t,n,r){return!0===r?(rt(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return rt(this,t,n.value||n.initializer.call(this)),this[t]},set:et}:{enumerable:!1,configurable:!0,set:function(e){rt(this,t,e)},get:function(){}}};var it=function(e){return e()};function at(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:it}function st(e,t,n){return ct("onBecomeObserved",e,t,n)}function ut(e,t,n){return ct("onBecomeUnobserved",e,t,n)}function ct(e,t,n,r){var o="function"==typeof r?cn(t,n):cn(t),i="function"==typeof r?r:n,a=o[e];return"function"!=typeof a?p(!1):(o[e]=function(){a.call(this),i.call(this)},function(){o[e]=a})}function lt(e,t,n,r){var o=(r=z(r)).defaultDecorator||(!1===r.deep?X:W);B(e),tn(e,r.name,o.enhancer),Le();try{for(var i in t){var a=Object.getOwnPropertyDescriptor(t,i),s=(n&&i in n?n[i]:a.get?ne:o)(e,i,a,!0);s&&Object.defineProperty(e,i,s)}}finally{Be()}return e}function ft(e,t){return pt(cn(e,t))}function pt(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n).map(pt)),r}function ht(e){var t,n={name:e.name};return(t=e).observers&&t.observers.length>0&&(n.observers=function(e){return e.observers}(e).map(ht)),n}var vt=0;function dt(e){"function"==typeof e.cancel&&e.cancel()}function yt(e,t){if(null==e)return!1;if(void 0!==t){if(!1===un(e))return!1;if(!e.$mobx.values[t])return!1;var n=cn(e,t);return je(n)}return je(e)}function bt(e,t){if(null==e)return!1;if(void 0!==t){if(un(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return un(e)||!!e.$mobx||T(e)||Ke(e)||je(e)}function mt(e){return 1!==arguments.length&&p(!1),bt(e)}function gt(e){return un(e)?e.$mobx.getKeys():Yt(e)?e._keys.slice():Zt(e)?S(e.keys()):Kt(e)?e.map(function(e,t){return t}):p(!1)}function _t(e,t){if(un(e)){var n=ln(e);return n.getKeys(),!!n.values[t]}return Yt(e)?e.has(t):Zt(e)?e.has(t):Kt(e)?t>=0&&t<e.length:p(!1)}var Ot={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function wt(e,t,n,r){return r.detectCycles&&e.set(t,n),n}function St(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;"boolean"==typeof e[e.length-1]&&(n=e.pop());var r=function(e){switch(e.length){case 0:return Ce.trackingDerivation;case 1:return cn(e[0]);case 2:return cn(e[0],e[1])}}(e);if(!r)return p(!1);r.isTracing===te.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?te.BREAK:te.LOG}function At(e,t){void 0===t&&(t=void 0),Le();try{return e.apply(t)}finally{Be()}}function xt(e,t,n){var r;"number"==typeof n.timeout&&(r=setTimeout(function(){if(!i.$mobx.isDisposed){i();var e=new Error("WHEN_TIMEOUT");if(!n.onError)throw e;n.onError(e)}},n.timeout)),n.name=n.name||"When@"+f();var o=ge(n.name+"-effect",t),i=ot(function(t){e()&&(t.dispose(),r&&clearTimeout(r),o())},n);return i}function Et(e){return void 0!==e.interceptors&&e.interceptors.length>0}function Dt(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),v(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function jt(e,t){var n=pe();try{var r=e.interceptors;if(r)for(var o=0,i=r.length;o<i&&(h(!(t=r[o](t))||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{he(n)}}function kt(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function It(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),v(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Rt(e,t){var n=pe(),r=e.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](t);he(n)}}var Tt,Ct,Vt,Nt,Pt=(Tt=!1,Ct={},Object.defineProperty(Ct,"0",{set:function(){Tt=!0}}),Object.create(Ct)[0]=1,!1===Tt),Lt=0,Bt=function(){return function(){}}();Vt=Bt,Nt=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(Vt.prototype,Nt):void 0!==Vt.prototype.__proto__?Vt.prototype.__proto__=Nt:Vt.prototype=Nt,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(Bt.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var $t=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.atom=new R(e||"ObservableArray@"+f()),this.enhancer=function(n,r){return t(n,r,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return Dt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),It(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray(t,0,n)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>Lt&&Ht(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;ue(this.atom);var o=this.values.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===n&&(n=s),Et(this)){var i=jt(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!i)return s;t=i.removedCount,n=i.added}var a=(n=0===n.length?n:n.map(function(e){return r.enhancer(e,void 0)})).length-t;this.updateArrayLength(o,a);var u=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,i([e,t],n));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var o=!this.owned&&Je(),i=kt(this),a=i||o?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;o&&Ye(r({},a,{name:this.atom.name})),this.atom.reportChanged(),i&&Rt(this,a),o&&Qe()},e.prototype.notifyArraySplice=function(e,t,n){var o=!this.owned&&Je(),i=kt(this),a=i||o?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;o&&Ye(r({},a,{name:this.atom.name})),this.atom.reportChanged(),i&&Rt(this,a),o&&Qe()},e}(),Mt=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableArray@"+f()),void 0===o&&(o=!1);var i=e.call(this)||this,a=new $t(r,n,i,o);if(g(i,"$mobx",a),t&&t.length){var s=Se(!0);i.spliceWithArray(0,0,t),Ae(s)}return Pt&&Object.defineProperty(a.array,"0",Ut),i}return n(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return Kt(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,n){void 0===n&&(n=0),arguments.length;var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},t.prototype.findIndex=function(e,t,n){void 0===n&&(n=0),arguments.length;for(var r=this.peek(),o=r.length,i=n;i<o;i++)if(e.call(t,r[i],i,this))return i;return-1},t.prototype.splice=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,n)},t.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,e),n.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,o=this.$mobx.values;r=e<t?i(o.slice(0,e),o.slice(e+1,t+1),[o[e]],o.slice(t+1)):i(o.slice(0,t),[o[e]],o.slice(t,e),o.slice(e+1)),this.replace(r)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var n=this.$mobx,r=n.values;if(e<r.length){ue(n.atom);var o=r[e];if(Et(n)){var i=jt(n,{type:"update",object:this,index:e,newValue:t});if(!i)return;t=i.newValue}(t=n.enhancer(t,o))!==o&&(r[e]=t,n.notifyArrayChildUpdate(e,t,o))}else{if(e!==r.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+r.length);n.spliceWithArray(e,0,[t])}},t}(Bt);D(Mt.prototype,function(){this.$mobx.atom.reportObserved();var e=this,t=0;return j({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})}),Object.defineProperty(Mt.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),m(Mt.prototype,k(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];h("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),m(Mt.prototype,e,function(){return t.apply(this.peek(),arguments)})}),function(e,t){for(var n=0;n<t.length;n++)m(e,t[n],e[t[n]])}(Mt.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var Ut=Gt(0);function Gt(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function qt(e){Object.defineProperty(Mt.prototype,""+e,Gt(e))}function Ht(e){for(var t=Lt;t<e;t++)qt(t);Lt=e}Ht(1e3);var zt=_("ObservableArrayAdministration",$t);function Kt(e){return y(e)&&zt(e.$mobx)}var Wt={},Jt=function(){function e(e,t,n){if(void 0===t&&(t=M),void 0===n&&(n="ObservableMap@"+f()),this.enhancer=t,this.name=n,this.$mobx=Wt,this._keys=new Mt(void 0,U,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!Ce.trackingDerivation)return this._has(e);var n=this._hasMap.get(e);if(!n){var r=n=new xe(this._has(e),U,this.name+"."+Xt(e)+"?",!1);this._hasMap.set(e,r),ut(r,function(){return t._hasMap.delete(e)})}return n.get()},e.prototype.set=function(e,t){var n=this._has(e);if(Et(this)){var r=jt(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(Et(this)&&!(i=jt(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var n=Je(),o=kt(this),i=o||n?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return n&&Ye(r({},i,{name:this.name,key:e})),At(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)}),o&&Rt(this,i),n&&Qe(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap.get(e);n&&n.setNewValue(t)},e.prototype._updateValue=function(e,t){var n=this._data.get(e);if((t=n.prepareNewValue(t))!==Ce.UNCHANGED){var o=Je(),i=kt(this),a=i||o?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;o&&Ye(r({},a,{name:this.name,key:e})),n.setNewValue(t),i&&Rt(this,a),o&&Qe()}},e.prototype._addValue=function(e,t){var n=this;At(function(){var r=new xe(t,n.enhancer,n.name+"."+Xt(e),!1);n._data.set(e,r),t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var o=Je(),i=kt(this),a=i||o?{type:"add",object:this,name:e,newValue:t}:null;o&&Ye(r({},a,{name:this.name,key:e})),i&&Rt(this,a),o&&Qe()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[E()]()},e.prototype.values=function(){var e=this,t=0;return j({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return j({next:function(){if(t<e._keys.length){var n=e._keys[t++];return{value:[n,e.get(n)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var n=this;this._keys.forEach(function(r){return e.call(t,n.get(r),r,n)})},e.prototype.merge=function(e){var t=this;return Yt(e)&&(e=e.toJS()),At(function(){b(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=o(e,2),r=n[0],i=n[1];return t.set(r,i)}):O(e)?e.constructor!==Map?p("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(e,n){return t.set(n,e)}):null!=e&&p("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;At(function(){fe(function(){e._keys.slice().forEach(function(t){return e.delete(t)})})})},e.prototype.replace=function(e){var t=this;return At(function(){for(var n,r=O(n=e)||Yt(n)?n:Array.isArray(n)?new Map(n):b(n)?new Map(Object.entries(n)):p("Cannot convert to map from '"+n+"'"),o=t._keys,i=Array.from(r.keys()),a=!1,s=0;s<o.length;s++){var u=o[s];o.length===i.length&&u!==i[s]&&(a=!0),r.has(u)||(a=!0,t.delete(u))}r.forEach(function(e,n){t._data.has(n)||(a=!0),t.set(n,e)}),a&&t._keys.replace(i)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach(function(n){return t["symbol"==typeof n?n:Xt(n)]=e.get(n)}),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach(function(n){return t.set(n,e.get(n))}),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(t){return Xt(t)+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return It(this,e)},e.prototype.intercept=function(e){return Dt(this,e)},e}();function Xt(e){return e&&e.toString?e.toString():new String(e).toString()}D(Jt.prototype,function(){return this.entries()}),g(Jt.prototype,k(),"Map");var Yt=_("ObservableMap",Jt),Ft={},Qt=function(){function e(e,t,n){if(void 0===t&&(t=M),void 0===n&&(n="ObservableSet@"+f()),this.name=n,this.$mobx=Ft,this._data=new Set,this._atom=C(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,r){return t(e,r,n)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;At(function(){fe(function(){e._data.forEach(function(t){e.delete(t)})})})},e.prototype.forEach=function(e,t){var n=this;this._data.forEach(function(r){e.call(t,r,r,n)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if((ue(this._atom),Et(this))&&!(o=jt(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){At(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var n=Je(),r=kt(this),o=r||n?{type:"add",object:this,newValue:e}:null;0,r&&Rt(this,o)}return this},e.prototype.delete=function(e){var t=this;if(Et(this)&&!(o=jt(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var n=Je(),r=kt(this),o=r||n?{type:"delete",object:this,oldValue:e}:null;return At(function(){t._atom.reportChanged(),t._data.delete(e)}),r&&Rt(this,o),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=S(this.keys()),n=S(this.values());return j({next:function(){var r=e;return e+=1,r<n.length?{value:[t[r],n[r]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,n=0;return void 0!==this._data.values?e=S(this._data.values()):(e=[],this._data.forEach(function(t){return e.push(t)})),j({next:function(){return n<e.length?{value:t.dehanceValue(e[n++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return Zt(e)&&(e=e.toJS()),At(function(){Array.isArray(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):w(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):null!=e&&p("Cannot initialize set from "+e)}),this},e.prototype.observe=function(e,t){return It(this,e)},e.prototype.intercept=function(e){return Dt(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+S(this.keys()).join(", ")+" ]"},e}();D(Qt.prototype,function(){return this.values()}),g(Qt.prototype,k(),"Set");var Zt=_("ObservableSet",Qt),en=function(){function e(e,t,n){this.target=e,this.name=t,this.defaultEnhancer=n,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,n){var o=this.target;o!==e&&this.illegalAccess(e,t);var i=this.values[t];if(i instanceof De)i.set(n);else{if(Et(this)){if(!(u=jt(this,{type:"update",object:o,name:t,newValue:n})))return;n=u.newValue}if((n=i.prepareNewValue(n))!==Ce.UNCHANGED){var a=kt(this),s=Je(),u=a||s?{type:"update",object:o,oldValue:i.value,name:t,newValue:n}:null;s&&Ye(r({},u,{name:this.name,key:t})),i.setNewValue(n),a&&Rt(this,u),s&&Qe()}}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(Et(this))if(!(a=jt(this,{object:t,name:e,type:"remove"})))return;try{Le();var n=kt(this),o=Je(),i=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var a=n||o?{type:"remove",object:t,oldValue:i,name:e}:null;o&&Ye(r({},a,{name:this.name,key:e})),n&&Rt(this,a),o&&Qe()}finally{Be()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return It(this,e)},e.prototype.intercept=function(e){return Dt(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new Mt(Object.keys(this.values).filter(function(t){return e.values[t]instanceof xe}),U,"keys("+this.name+")",!0)),this.keys.slice()},e}();function tn(e,t,n){void 0===t&&(t=""),void 0===n&&(n=M);var r=e.$mobx;return r||(b(e)||(t=(e.constructor.name||"ObservableObject")+"@"+f()),t||(t="ObservableObject@"+f()),g(e,"$mobx",r=new en(e,t,n)),r)}function nn(e,t,n,o){var i=tn(e);if(Et(i)){var a=jt(i,{object:e,name:t,type:"add",newValue:n});if(!a)return;n=a.newValue}n=(i.values[t]=new xe(n,o,i.name+"."+t,!1)).value,Object.defineProperty(e,t,function(e){return rn[e]||(rn[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}(t)),i.keys&&i.keys.push(t),function(e,t,n,o){var i=kt(e),a=Je(),s=i||a?{type:"add",object:t,name:n,newValue:o}:null;a&&Ye(r({},s,{name:e.name,key:n}));i&&Rt(e,s);a&&Qe()}(i,e,t,n)}var rn=Object.create(null),on=Object.create(null);function an(e){var t=e.$mobx;return t||(B(e),e.$mobx)}var sn=_("ObservableObjectAdministration",en);function un(e){return!!y(e)&&(B(e),sn(e.$mobx))}function cn(e,t){if("object"==typeof e&&null!==e){if(Kt(e))return void 0!==t&&p(!1),e.$mobx.atom;if(Zt(e))return e.$mobx;if(Yt(e)){var n=e;return void 0===t?cn(n._keys):((r=n._data.get(t)||n._hasMap.get(t))||p(!1),r)}var r;if(B(e),t&&!e.$mobx&&e[t],un(e))return t?((r=e.$mobx.values[t])||p(!1),r):p(!1);if(T(e)||je(e)||Ke(e))return e}else if("function"==typeof e&&Ke(e.$mobx))return e.$mobx;return p(!1)}function ln(e,t){return e||p("Expecting some object"),void 0!==t?ln(cn(e,t)):T(e)||je(e)||Ke(e)?e:Yt(e)||Zt(e)?e:(B(e),e.$mobx?e.$mobx:void p(!1))}function fn(e,t){return(void 0!==t?cn(e,t):un(e)||Yt(e)||Zt(e)?ln(e):cn(e)).name}var pn=Object.prototype.toString;function hn(e,t,n){return void 0===n&&(n=-1),function e(t,n,r,o,i){if(t===n)return 0!==t||1/t==1/n;if(null==t||null==n)return!1;if(t!=t)return n!=n;var a=typeof t;if("function"!==a&&"object"!==a&&"object"!=typeof n)return!1;t=vn(t);n=vn(n);var s=pn.call(t);if(s!==pn.call(n))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!=+t?+n!=+n:0==+t?1/+t==1/n:+t==+n;case"[object Date]":case"[object Boolean]":return+t==+n;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(n)}var u="[object Array]"===s;if(!u){if("object"!=typeof t||"object"!=typeof n)return!1;var c=t.constructor,l=n.constructor;if(c!==l&&!("function"==typeof c&&c instanceof c&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in n)return!1}if(0===r)return!1;r<0&&(r=-1);o=o||[];i=i||[];var f=o.length;for(;f--;)if(o[f]===t)return i[f]===n;o.push(t);i.push(n);if(u){if((f=t.length)!==n.length)return!1;for(;f--;)if(!e(t[f],n[f],r-1,o,i))return!1}else{var p=Object.keys(t),h=void 0;if(f=p.length,Object.keys(n).length!==f)return!1;for(;f--;)if(h=p[f],!dn(n,h)||!e(t[h],n[h],r-1,o,i))return!1}o.pop();i.pop();return!0}(e,t,n)}function vn(e){return Kt(e)?e.peek():O(e)||Yt(e)?S(e.entries()):w(e)||Zt(e)?S(e.entries()):e}function dn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Ze,extras:{getDebugName:fn},$mobx:"$mobx"}),e.$mobx="$mobx",e.ObservableMap=Jt,e.ObservableSet=Qt,e.Reaction=Ue,e._allowStateChanges=function(e,t){var n,r=Se(e);try{n=t()}finally{Ae(r)}return n},e._allowStateChangesInsideComputed=function(e){var t,n=Ce.computationDepth;Ce.computationDepth=0;try{t=e()}finally{Ce.computationDepth=n}return t},e._endAction=we,e._getAdministration=ln,e._getGlobalState=function(){return Ce},e._interceptReads=function(e,t,n){var r;if(Yt(e)||Kt(e)||Ee(e))r=ln(e);else{if(!un(e))return p(!1);if("string"!=typeof t)return p(!1);r=ln(e,t)}return void 0!==r.dehancer?p(!1):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})},e._isComputingDerivation=function(){return null!==Ce.trackingDerivation},e._resetGlobalState=function(){var e=new Ie;for(var t in e)-1===ke.indexOf(t)&&(Ce[t]=e[t]);Ce.allowStateChanges=!Ce.enforceActions},e._startAction=Oe,e.action=nt,e.autorun=ot,e.comparer=N,e.computed=oe,e.configure=function(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.computedConfigurable,o=e.disableErrorBoundaries,i=e.arrayBuffer,a=e.reactionScheduler,s=e.reactionRequiresObservable,u=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((Ce.pendingReactions.length||Ce.inBatch||Ce.isRunningReactions)&&p("isolateGlobalState should be called before MobX is running any reactions"),Te=!0,Re&&(0==--l().__mobxInstanceCount&&(l().__mobxGlobals=void 0),Ce=new Ie)),void 0!==t){var c=void 0;switch(t){case!0:case"observed":c=!0;break;case!1:case"never":c=!1;break;case"strict":case"always":c="strict";break;default:p("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}Ce.enforceActions=c,Ce.allowStateChanges=!0!==c&&"strict"!==c}void 0!==n&&(Ce.computedRequiresReaction=!!n),void 0!==s&&(Ce.reactionRequiresObservable=!!s),void 0!==u&&(Ce.observableRequiresReaction=!!u,Ce.allowStateReads=!Ce.observableRequiresReaction),void 0!==r&&(Ce.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors if this is on."),Ce.disableErrorBoundaries=!!o),"number"==typeof i&&Ht(i),a&&We(a)},e.createAtom=C,e.decorate=function(e,t){var n="function"==typeof e?e.prototype:e,r=function(e){var r=t[e];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,e),i=r.reduce(function(t,r){return r(n,e,t)},o);i&&Object.defineProperty(n,e,i)};for(var o in t)r(o);return e},e.entries=function(e){return un(e)?gt(e).map(function(t){return[t,e[t]]}):Yt(e)?gt(e).map(function(t){return[t,e.get(t)]}):Zt(e)?S(e.entries()):Kt(e)?e.map(function(e,t){return[t,e]}):p(!1)},e.extendObservable=lt,e.extendShallowObservable=function(e,t,n){return lt(e,t,n,H)},e.flow=function(e){1!==arguments.length&&p("Flow expects one 1 argument and cannot be used as decorator");var t=e.name||"<unnamed flow>";return function(){var n,r=arguments,o=++vt,i=nt(t+" - runid: "+o+" - init",e).apply(this,r),a=void 0,s=new Promise(function(e,r){var s=0;function u(e){var n;a=void 0;try{n=nt(t+" - runid: "+o+" - yield "+s++,i.next).call(i,e)}catch(e){return r(e)}l(n)}function c(e){var n;a=void 0;try{n=nt(t+" - runid: "+o+" - yield "+s++,i.throw).call(i,e)}catch(e){return r(e)}l(n)}function l(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(a=Promise.resolve(t.value)).then(u,c);t.then(l,r)}n=r,u(void 0)});return s.cancel=nt(t+" - runid: "+o+" - cancel",function(){try{a&&dt(a);var e=i.return(),t=Promise.resolve(e.value);t.then(d,d),dt(t),n(new Error("FLOW_CANCELLED"))}catch(e){n(e)}}),s}},e.get=function(e,t){if(_t(e,t))return un(e)?e[t]:Yt(e)?e.get(t):Kt(e)?e[t]:p(!1)},e.getAtom=cn,e.getDebugName=fn,e.getDependencyTree=ft,e.getObserverTree=function(e,t){return ht(cn(e,t))},e.has=_t,e.intercept=function(e,t,n){return"function"==typeof n?function(e,t,n){return ln(e,t).intercept(n)}(e,t,n):function(e,t){return ln(e).intercept(t)}(e,t)},e.isAction=function(e){return"function"==typeof e&&!0===e.isMobxAction},e.isArrayLike=function(e){return Array.isArray(e)||Kt(e)},e.isBoxedObservable=Ee,e.isComputed=function(e){return arguments.length>1?p(!1):yt(e)},e.isComputedProp=function(e,t){return"string"!=typeof t?p(!1):yt(e,t)},e.isObservable=mt,e.isObservableArray=Kt,e.isObservableMap=Yt,e.isObservableObject=un,e.isObservableProp=function(e,t){return"string"!=typeof t?p(!1):bt(e,t)},e.isObservableSet=Zt,e.keys=gt,e.observable=Q,e.observe=function(e,t,n,r){return"function"==typeof n?function(e,t,n,r){return ln(e,t).observe(n,r)}(e,t,n,r):function(e,t,n){return ln(e).observe(t,n)}(e,t,n)},e.onBecomeObserved=st,e.onBecomeUnobserved=ut,e.onReactionError=function(e){return Ce.globalReactionErrorHandlers.push(e),function(){var t=Ce.globalReactionErrorHandlers.indexOf(e);t>=0&&Ce.globalReactionErrorHandlers.splice(t,1)}},e.reaction=function(e,t,n){void 0===n&&(n=u),"boolean"==typeof n&&(n={fireImmediately:n});var r,o,i,a=n.name||"Reaction@"+f(),s=nt(a,n.onError?(r=n.onError,o=t,function(){try{return o.apply(this,arguments)}catch(e){r.call(this,e)}}):t),c=!n.scheduler&&!n.delay,l=at(n),p=!0,h=!1,v=n.compareStructural?N.structural:n.equals||N.default,d=new Ue(a,function(){p||c?y():h||(h=!0,l(y))},n.onError,n.requiresObservable);function y(){if(h=!1,!d.isDisposed){var t=!1;d.track(function(){var n=e(d);t=p||!v(i,n),i=n}),p&&n.fireImmediately&&s(i,d),p||!0!==t||s(i,d),p&&(p=!1)}}return d.schedule(),d.getDisposer()},e.remove=function(e,t){if(un(e))e.$mobx.remove(t);else if(Yt(e))e.delete(t);else if(Zt(e))e.delete(t);else{if(!Kt(e))return p(!1);"number"!=typeof t&&(t=parseInt(t,10)),h(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}},e.runInAction=function(e,t){return _e("string"==typeof e?e:e.name||"<unnamed action>","function"==typeof e?e:t,this,void 0)},e.set=function e(t,n,r){if(2!==arguments.length||Zt(t))if(un(t)){var o=t.$mobx;o.values[n]?o.write(t,n,r):nn(t,n,r,o.defaultEnhancer)}else if(Yt(t))t.set(n,r);else if(Zt(t))t.add(n);else{if(!Kt(t))return p(!1);"number"!=typeof n&&(n=parseInt(n,10)),h(n>=0,"Not a valid index: '"+n+"'"),Le(),n>=t.length&&(t.length=n+1),t[n]=r,Be()}else{Le();var i=n;try{for(var a in i)e(t,a,i[a])}finally{Be()}}},e.spy=Ze,e.toJS=function(e,t){var n;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=Ot),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(n=new Map),function e(t,n,r){if(!n.recurseEverything&&!mt(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Ee(t))return e(t.get(),n,r);if(mt(t)&>(t),!0===n.detectCycles&&null!==t&&r.has(t))return r.get(t);if(Kt(t)||Array.isArray(t)){var o=wt(r,t,[],n),i=t.map(function(t){return e(t,n,r)});o.length=i.length;for(var a=0,s=i.length;a<s;a++)o[a]=i[a];return o}if(Zt(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===n.exportMapsAsObjects){var u=wt(r,t,new Set,n);return t.forEach(function(t){u.add(e(t,n,r))}),u}var c=wt(r,t,[],n);return t.forEach(function(t){c.push(e(t,n,r))}),c}if(Yt(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===n.exportMapsAsObjects){var l=wt(r,t,new Map,n);return t.forEach(function(t,o){l.set(o,e(t,n,r))}),l}var f=wt(r,t,{},n);return t.forEach(function(t,o){f[o]=e(t,n,r)}),f}var p=wt(r,t,{},n);for(var h in t)p[h]=e(t[h],n,r);return p}(e,t,n)},e.trace=St,e.transaction=At,e.untracked=fe,e.values=function(e){return un(e)?gt(e).map(function(t){return e[t]}):Yt(e)?gt(e).map(function(t){return e.get(t)}):Zt(e)?S(e.values()):Kt(e)?e.slice():p(!1)},e.when=function(e,t,n){return 1===arguments.length||t&&"object"==typeof t?function(e,t){var n,o=new Promise(function(o,i){var a=xt(e,o,r({},t,{onError:i}));n=function(){a(),i("WHEN_CANCELLED")}});return o.cancel=n,o}(e,t):xt(e,t,n||{})},Object.defineProperty(e,"__esModule",{value:!0})});
|
package/lib/utils/comparer.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ export interface IEqualsComparer<T> {
|
|
|
3
3
|
}
|
|
4
4
|
declare function identityComparer(a: any, b: any): boolean;
|
|
5
5
|
declare function structuralComparer(a: any, b: any): boolean;
|
|
6
|
+
declare function shallowComparer(a: any, b: any): boolean;
|
|
6
7
|
declare function defaultComparer(a: any, b: any): boolean;
|
|
7
8
|
export declare const comparer: {
|
|
8
9
|
identity: typeof identityComparer;
|
|
9
10
|
structural: typeof structuralComparer;
|
|
10
11
|
default: typeof defaultComparer;
|
|
12
|
+
shallow: typeof shallowComparer;
|
|
11
13
|
};
|
|
12
14
|
export {};
|
package/lib/utils/eq.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function deepEqual(a: any, b: any): boolean;
|
|
1
|
+
export declare function deepEqual(a: any, b: any, depth?: number): boolean;
|