Socket
Socket
Sign inDemoInstall

mobx

Package Overview
Dependencies
Maintainers
1
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobx - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

29

CHANGELOG.md

@@ -0,1 +1,6 @@

# 2.0.6
* `resetGlobalState` is now part of the `mobx.extras` namespace, as it is useful for test setup, to restore inconsistent state after test failures.
* `resetGlobalState` now also resets the caches of `createTransformer`, see #163.
# 2.0.5

@@ -21,3 +26,3 @@

* `expr` no longer prints incorrect deprecated messages (see 143)
* Requires `mobx` twice no longer fails.
* Requires `mobx` twice no longer fails.

@@ -43,3 +48,3 @@ # 2.0.0

## `autorun`'s are now allowed to cause cycles!
`autorun` is now allowed to have cycles. In Mobservable 1 an exception was thrown as soon as an autorun modified a variable which it was reading as well.
`autorun` is now allowed to have cycles. In Mobservable 1 an exception was thrown as soon as an autorun modified a variable which it was reading as well.
In MobX 2 these situations are now allowed and the autorun will trigger itself to be fired again immediately after the current execution.

@@ -58,3 +63,3 @@ This is fine as long as the autorun terminates within a reasonable amount of iterations (100).

const temperature = observable(27);
temperature.set(15); // previously: temperature(15)
temperature.set(15); // previously: temperature(15)
temperature.get(); // previously: temperature()

@@ -86,3 +91,3 @@ ```

This was confusing and not all derivations were able to recover from these exceptions.
In MobX 2 it is no longer allowed for a computed function or `autorun` to throw an exception.
In MobX 2 it is no longer allowed for a computed function or `autorun` to throw an exception.

@@ -168,3 +173,3 @@ ## Improved build

* `toJSON` now serializes object trees with cycles as well. If you know the object tree is acyclic, pass in `false` as second parameter for a performance gain.
* `toJSON` now serializes object trees with cycles as well. If you know the object tree is acyclic, pass in `false` as second parameter for a performance gain.

@@ -217,3 +222,3 @@ # 1.1.0

* `observeUntil` -> `autorunUntil`
* `observeAsync` -> `autorunAsync`
* `observeAsync` -> `autorunAsync`
* `reactiveComponent` -> `observer` (in `mobservable-react` package)

@@ -223,3 +228,3 @@

* dropped the `strict` and `logLevel` settings of mobservable. View functions are by default run in `strict` mode, `autorun` (formerly: `observe`) functions in `non-strict` mode (strict indicates that it is allowed to change other observable values during the computation of a view funtion).
* dropped the `strict` and `logLevel` settings of mobservable. View functions are by default run in `strict` mode, `autorun` (formerly: `observe`) functions in `non-strict` mode (strict indicates that it is allowed to change other observable values during the computation of a view funtion).
Use `extras.withStrict(boolean, block)` if you want to deviate from the default behavior.

@@ -237,3 +242,3 @@ * `observable` (formerly `makeReactive`) no longer accepts an options object. The modifiers `asReference`, `asStructure` and `asFlat` can be used instead.

* `@observable` now works correct on classes that are transpiled by either TypeScript or Babel (Not all constructions where supported in Babel earlier)
* Simplified error handling, mobservable will no longer catch errors in views, which makes the stack traces easier to debug.
* Simplified error handling, mobservable will no longer catch errors in views, which makes the stack traces easier to debug.
* Removed the initial 'welcom to mobservable' logline that was printed during start-up.

@@ -243,3 +248,3 @@

* Backported Babel support for the @observable decorator from the 1.0 branch. The decorator should now behave the same when compiled with either Typescript or Babeljs.
* Backported Babel support for the @observable decorator from the 1.0 branch. The decorator should now behave the same when compiled with either Typescript or Babeljs.

@@ -254,3 +259,3 @@ # 0.7.0

* Improved typings.
* Introduces `asStructure` (see [#8]()) and `asFlat`.
* Introduces `asStructure` (see [#8]()) and `asFlat`.
* Assigning a plain object to a reactive structure no longer clones the object, instead, the original object is decorated. (Arrays are still cloned due to Javascript limitations to extend arrays).

@@ -262,3 +267,3 @@ * Reintroduced `expr(func)` as shorthand for `makeReactive(func)()`, which is useful to create temporarily views inside views

* A name (for debugging) can be passed as second or third param
* The `as` modifier is no longer needed, use `asReference` (instead of `as:'reference'`) or `asFlat` (instead of `recurse:false`).
* The `as` modifier is no longer needed, use `asReference` (instead of `as:'reference'`) or `asFlat` (instead of `recurse:false`).

@@ -293,3 +298,3 @@ # 0.6.10

# 0.6.4:
# 0.6.4:

@@ -296,0 +301,0 @@ * 2nd argument of sideEffect is now the scope, instead of an options object which hadn't any useful properties

@@ -27,7 +27,8 @@ export { Lambda };

export declare const extras: {
allowStateChanges: <T>(allowStateChanges: boolean, func: () => T) => T;
getDependencyTree: (thing: any) => IDependencyTree;
getObserverTree: (thing: any) => IObserverTree;
isComputingDerivation: () => boolean;
resetGlobalState: () => void;
trackTransitions: (extensive?: boolean, onReport?: (lines: ITransitionEvent) => void) => Lambda;
isComputingDerivation: () => boolean;
allowStateChanges: <T>(allowStateChanges: boolean, func: () => T) => T;
};

@@ -34,0 +35,0 @@ declare function autorun(view: Lambda, scope?: any): Lambda & {

@@ -12,7 +12,8 @@ var __extends = (this && this.__extends) || function (d, b) {

exports.extras = {
allowStateChanges: allowStateChanges,
getDependencyTree: getDependencyTree,
getObserverTree: getObserverTree,
trackTransitions: trackTransitions,
isComputingDerivation: isComputingDerivation,
allowStateChanges: allowStateChanges
resetGlobalState: resetGlobalState,
trackTransitions: trackTransitions
};

@@ -118,2 +119,3 @@ function autorun(view, scope) {

var objectCache = {};
var resetId = globalState.resetId;
var Transformer = (function (_super) {

@@ -136,2 +138,6 @@ __extends(Transformer, _super);

return function (object) {
if (resetId !== globalState.resetId) {
objectCache = {};
resetId = globalState.resetId;
}
var identifier = getMemoizationId(object);

@@ -649,2 +655,3 @@ var reactiveTransformer = objectCache[identifier];

this.allowStateChanges = true;
this.resetId = 0;
}

@@ -669,5 +676,7 @@ return MobXGlobals;

function resetGlobalState() {
var resetId = globalState.resetId;
var defaultGlobals = new MobXGlobals();
for (var key in defaultGlobals)
globalState[key] = defaultGlobals[key];
globalState.resetId = resetId + 1;
}

@@ -674,0 +683,0 @@ function addObserver(observable, node) {

/** MobX - (c) Michel Weststrate 2015, 2016 - MIT Licensed */
function U(e,i){o(e,"autorun methods cannot have modifiers"),n("function"==typeof e,"autorun expects a function"),n(0===e.length,"autorun expects a function without arguments"),i&&(e=e.bind(i));var r=new S(e.name||"Autorun",function(){this.track(e)});return O()||t.inTransaction>0?t.pendingReactions.push(r):r.runReaction(),r.getDisposer()}function ee(r,o,t){var n=!1,e=U(function(){r.call(t)&&(e?e():n=!0,o.call(t))});return n&&e(),e}function Xe(e,t,n){return m("`autorunUntil` is deprecated, please use `when`."),ee.apply(null,arguments)}function We(e,n,o){void 0===n&&(n=1),o&&(e=e.bind(o));var r=!1,t=new S(e.name||"AutorunAsync",function(){r||(r=!0,setTimeout(function(){r=!1,t.isDisposed||t.track(e)},n))});return t.runReaction(),t.getDisposer()}function _(e,t,n,r){return arguments.length<3&&"function"==typeof e?Qe(e,t):X.apply(null,arguments)}function Qe(r,o){var t=$(r,e.Recursive),i=t[0],n=t[1];return new h(n,o,i===e.Structure,n.name||"ComputedValue")}function X(i,t,o,a){if(1===arguments.length){var u=i;return function(e,t,n){return X.call(null,e,t,n,u)}}n(o&&o.hasOwnProperty("get"),"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'"),D(i,t);var r={},s=o.get;return n("object"==typeof i,"The @observable decorator can only be used on objects",t),n("function"==typeof s,"@observable expects a getter function if used on a property.",t),n(!o.set,"@observable properties cannot have a setter.",t),n(0===s.length,"@observable getter functions should not take arguments.",t),r.configurable=!0,r.enumerable=!1,r.get=function(){return C(R(this,void 0,e.Recursive),t,a&&a.asStructure===!0?G(s):s),this[t]},r.set=Z,o?r:void Object.defineProperty(i,t,r)}function Z(){throw new Error("[ComputedValue] It is not allowed to assign new values to computed properties.")}function He(e,r){n("function"==typeof e&&1===e.length,"createTransformer expects a function that accepts one argument");var t={},o=function(n){function o(t,r){n.call(this,function(){return e(r)},null,!1,"Transformer-"+e.name+"-"+t),this.sourceIdentifier=t,this.sourceObject=r}return L(o,n),o.prototype.onBecomeUnobserved=function(){var e=this.value;n.prototype.onBecomeUnobserved.call(this),delete t[this.sourceIdentifier],r&&r(e,this.sourceObject)},o}(h);return function(r){var n=Ke(r),e=t[n];return e?e.get():(e=t[n]=new o(n,r),e.get())}}function Ke(e){if(null===e||"object"!=typeof e)throw new Error("[mobx] transform expected some kind of object, got: "+e);var t=e.$transformId;return void 0===t&&(t=c(),Object.defineProperty(e,"$transformId",{configurable:!0,writable:!0,enumerable:!1,value:t})),t}function ze(e,t){return O()||console.warn("[mobx.expr] 'expr' should only be used inside other reactive functions."),_(e,t).get()}function ne(t){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return n(arguments.length>=2,"extendObservable expected 2 or more arguments"),n("object"==typeof t,"extendObservable expects an object as first argument"),n(!(t instanceof f),"extendObservable should not be used on maps, use map.merge instead"),o.forEach(function(r){n("object"==typeof r,"all arguments of extendObservable should be objects"),oe(t,r,e.Recursive,null)}),t}function oe(e,t,r,o){var i=R(e,o,r);for(var n in t)if(t.hasOwnProperty(n)){if(e===t&&!ve(e,n))continue;C(i,n,t[n])}return e}function ie(e,n){var r=t.allowStateChanges;t.allowStateChanges=e;var o=n();return t.allowStateChanges=r,o}function a(e,n,t){void 0===t&&(t=!1),u&&u.emit({id:e.id,name:e.name+"@"+e.id,node:e,state:n,changed:t})}function et(e){return se(e)}function se(e){var t={id:e.id,name:e.name+"@"+e.id};return e.observing&&e.observing.length&&(t.dependencies=H(e.observing).map(se)),t}function Fe(e){return ue(e)}function ue(e){var t={id:e.id,name:e.name+"@"+e.id};return e.observers&&e.observers.length&&(t.observers=H(e.observers).map(ue)),t}function De(n){var e=[],t=!1;return function(r){(n||r.changed)&&e.push(r),t||(t=!0,setTimeout(function(){console[console.table?"table":"dir"](e),e=[],t=!1},1))}}function Pe(e,t){void 0===e&&(e=!1),u||(u=new l);var n=t?function(n){(e||n.changed)&&t(n)}:De(e),r=u.on(n);return ge(function(){r(),0===u.listeners.length&&(u=null)})}function y(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(e instanceof f||e instanceof i)throw new Error("[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.");if(g(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return!!e.$mobx||e instanceof w||e instanceof S||e instanceof h}function Ae(s,r,t){if(n(arguments.length>=2&&arguments.length<=3,"Illegal decorator config",r),D(s,r),t&&t.hasOwnProperty("get"))return m("Using @observable on computed values is deprecated. Use @computed instead."),_.apply(null,arguments);var o={},i=void 0;return t&&(t.hasOwnProperty("value")?i=t.value:t.initializer&&(i=t.initializer(),"function"==typeof i&&(i=A(i)))),n("object"==typeof s,"The @observable decorator can only be used on objects",r),o.configurable=!0,o.enumerable=!0,o.get=function(){var t=this;return ie(!0,function(){C(R(t,void 0,e.Recursive),r,i)}),this[r]},o.set=function(t){C(R(this,void 0,e.Recursive),r,"function"==typeof t?A(t):t)},t?o:void Object.defineProperty(s,r,o)}function pe(t,a){if("string"==typeof arguments[1])return Ae.apply(null,arguments);if(n(1===arguments.length||2===arguments.length,"observable expects one or two arguments"),y(t))return t;var s=$(t,e.Recursive),o=s[0],i=s[1],u=o===e.Reference?r.Reference:_e(i);switch(u){case r.Array:case r.PlainObject:return E(i,o);case r.Reference:case r.ComplexObject:return new p(i,o);case r.ComplexFunction:throw new Error("[mobx.observable] To be able to make a function reactive it should not have arguments. If you need an observable reference to a function, use `observable(asReference(f))`");case r.ViewFunction:return m("Use `computed(expr)` instead of `observable(expr)`"),_(t,a)}n(!1,"Illegal State")}function _e(e){return null===e||void 0===e?r.Reference:"function"==typeof e?e.length?r.ComplexFunction:r.ViewFunction:Array.isArray(e)||e instanceof i?r.Array:"object"==typeof e?v(e)?r.PlainObject:r.ComplexObject:r.Reference}function M(t,n,e,r){return"function"==typeof e?ye(t,n,e,r):me(t,n,e)}function me(e,t,r){return P(e)?e.observe(t):F(e)?e.observe(t):g(e)?Te(e,t,r):e instanceof p||e instanceof h?e.observe(t,r):v(e)?me(pe(e),t,r):void n(!1,"first argument of observe should be some observable value or plain object")}function ye(e,t,r,o){var i="[mobx.observe] the provided observable map has no key with name: "+t;if(F(e)){if(!e._has(t))throw new Error(i);return M(e._data[t],r)}if(g(e)){if(!y(e,t))throw new Error(i);return M(e.$mobx.values[t],r,o)}return v(e)?(ne(e,{property:e[t]}),ye(e,t,r,o)):void n(!1,"first argument of observe should be an (observable)object or observableMap if a property name is given")}function b(e,n,t){function s(r){return n&&t.push([e,r]),r}if(void 0===n&&(n=!0),void 0===t&&(t=null),n&&null===t&&(t=[]),n&&null!==e&&"object"==typeof e)for(var o=0,u=t.length;u>o;o++)if(t[o][0]===e)return t[o][1];if(!e)return e;if(Array.isArray(e)||e instanceof i){var r=s([]);return r.push.apply(r,e.map(function(e){return b(e,n,t)})),r}if(e instanceof f){var r=s({});return e.forEach(function(e,o){return r[o]=b(e,n,t)}),r}if("object"==typeof e&&v(e)){var r=s({});for(var a in e)e.hasOwnProperty(a)&&(r[a]=b(e[a],n,t));return r}return y(e)&&e.$mobx instanceof p?b(e(),n,t):e}function xe(e){n(e.isDirty,"atom not dirty"),e.isDirty=!1,a(e,"READY",!0),K(e,!0)}function O(){return t.derivationStack.length>0}function z(){n(t.allowStateChanges,"It is not allowed to change the state when a computed value is being evaluated. Use 'autorun' to create reactive functions with side-effects. Or use 'extras.allowStateChanges(true, block)' to supress this message.")}function Oe(e){1===++e.dependencyStaleCount&&(a(e,"STALE"),Y(e))}function Re(e,t){if(n(e.dependencyStaleCount>0,"unexpected ready notification"),t&&(e.dependencyChangeCount+=1),0===--e.dependencyStaleCount)if(e.dependencyChangeCount>0){e.dependencyChangeCount=0,a(e,"PENDING");var r=e.onDependenciesReady();K(e,r)}else a(e,"READY",!1),K(e,!1)}function de(e,n){var r=e.observing;e.observing=[],t.derivationStack.push(e);var o=n();return ke(e,r),o}function ke(r,u){t.derivationStack.length-=1;for(var i=fe(r.observing,u),o=i[0],s=i[1],e=0,a=o.length;a>e;e++){var c=o[e];n(!he(r,c),"Cycle detected",r),Ze(o[e],r)}for(var e=0,a=s.length;a>e;e++)B(s[e],r)}function he(r,n){var e=n.observing;if(void 0===e)return!1;if(-1!==e.indexOf(n))return!0;for(var o=e.length,t=0;o>t;t++)if(he(r,e[t]))return!0;return!1}function c(){return++t.mobxGuid}function Be(){}function Ye(){var e=new ae;for(var n in e)t[n]=e[n]}function Ze(e,r){var t=e.observers,n=t.length;t[n]=r,0===n&&e.onBecomeObserved()}function B(t,r){var e=t.observers,n=e.indexOf(r);-1!==n&&e.splice(n,1),0===e.length&&t.onBecomeUnobserved()}function q(n){if(!(t.inUntracked>0)){var o=t.derivationStack,i=o.length;if(i>0){var e=o[i-1].observing,r=e.length;e[r-1]!==n&&e[r-2]!==n&&(e[r]=n)}}}function Y(e){var t=e.observers.slice();t.forEach(Oe),e.staleObservers=e.staleObservers.concat(t)}function K(e,t){e.staleObservers.splice(0).forEach(function(e){return Re(e,t)})}function Se(e){m("This feature is experimental and might be removed in a future minor release. Please report if you use this feature in production: https://github.com/mobxjs/mobx/issues/49"),t.inUntracked++;var n=e();return t.inUntracked--,n}function J(){if(!t.isRunningReactions){t.isRunningReactions=!0;for(var e=t.pendingReactions,o=0;e.length;){if(++o===Ue)throw new Error("Reaction doesn't converge to a stable state. Probably there is a cycle in the reactive function: "+e[0].toString());for(var r=e.splice(0),n=0,i=r.length;i>n;n++)r[n].runReaction()}t.isRunningReactions=!1}}function d(r,o){t.inTransaction+=1;var i=r.call(o);if(0===--t.inTransaction){for(var n=t.changedAtoms.splice(0),e=0,s=n.length;s>e;e++)xe(n[e]);J()}return i}function A(e){return new N(e)}function G(e){return new k(e)}function Q(e){return new T(e)}function $(t,n){return t instanceof N?[e.Reference,t.value]:t instanceof k?[e.Structure,t.value]:t instanceof T?[e.Flat,t.value]:[n,t]}function qe(t){return t===A?e.Reference:t===G?e.Structure:t===Q?e.Flat:(n(void 0===t,"Cannot determine value mode from function. Please pass in one of these: mobx.asReference, mobx.asStructure or mobx.asFlat, got: "+t),e.Recursive)}function E(t,a,s){var r;if(y(t))return t;switch(a){case e.Reference:return t;case e.Flat:o(t,"Items inside 'asFlat' canont have modifiers"),r=e.Reference;break;case e.Structure:o(t,"Items inside 'asStructure' canont have modifiers"),r=e.Structure;break;case e.Recursive:i=$(t,e.Recursive),r=i[0],t=i[1];break;default:n(!1,"Illegal State")}return Array.isArray(t)&&Object.isExtensible(t)?le(t,r,s):v(t)&&Object.isExtensible(t)?oe(t,t,r,s):t;var i}function o(e,t){if(e instanceof N||e instanceof k||e instanceof T)throw new Error("[mobx] asStructure / asReference / asFlat cannot be used here. "+t)}function Ne(e){return e.atom.reportObserved(),e.values.length}function Ge(n,e){if("number"!=typeof e||0>e)throw new Error("[mobx.array] Out of range: "+e);var t=n.values.length;e!==t&&(e>t?s(n,t,0,new Array(e-t)):s(n,e,t-e))}function re(n,t,e){if(t!==n.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");z(),n.lastKnownLength+=e,e>0&&t+e>I&&ce(t+e)}function s(o,e,n,t){var r=o.values.length;if(!(void 0!==t&&0!==t.length||0!==n&&0!==r))return[];void 0===e?e=0:e>r?e=r:0>e&&(e=Math.max(0,r+e)),n=2===arguments.length?r-e:void 0===n||null===n?0:Math.max(0,Math.min(n,r-e)),t=void 0===t?j:t.map(o.makeChildReactive);var a=t.length-n;re(o,r,a);var i=(s=o.values).splice.apply(s,[e,n].concat(t));return Ve(o,e,i,t),i;var s}function Le(t){return o(t,"Array values cannot have modifiers"),this.mode===e.Flat||this.mode===e.Reference?t:E(t,this.mode,this.atom.name+"@"+this.atom.id+" / ArrayEntry")}function Ie(e,t,n){e.atom.reportChanged(),e.changeEvent&&e.changeEvent.emit({object:e.array,type:"update",index:t,oldValue:n})}function Ve(e,r,t,n){(0!==t.length||0!==n.length)&&(e.atom.reportChanged(),e.changeEvent&&e.changeEvent.emit({object:e.array,type:"splice",index:r,addedCount:n.length,removed:t}))}function Me(t){Object.defineProperty(i.prototype,""+t,{enumerable:!1,configurable:!1,set:function(n){var r=this.$mobx,i=r.values;if(o(n,"Modifiers cannot be used on array values. For non-reactive array values use makeReactive(asFlat(array))."),t<i.length){z();var a=i[t],u=r.mode===e.Structure?!x(a,n):a!==n;u&&(i[t]=r.makeChildReactive(n),Ie(r,t,a))}else{if(t!==i.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+i.length);s(r,t,0,[n])}},get:function(){var e=this.$mobx;return e&&t<e.values.length?(e.atom.reportObserved(),e.values[t]):void 0}})}function ce(t){for(var e=I;t>e;e++)Me(e);I=t}function le(e,t,n){return new i(e,t,n)}function $e(t){return m("fastArray is deprecated. Please use `observable(asFlat([]))`"),le(t,e.Flat,null)}function P(e){return e instanceof i}function Ee(e,t){return new f(e,t)}function F(e){return e instanceof f}function R(t,n,r){if(void 0===n&&(n="ObservableObject"),void 0===r&&(r=e.Recursive),t.$mobx){if(t.$mobx.type!==V)throw new Error("The given object is observable but not an observable object");return t.$mobx}var o={type:V,values:{},events:void 0,id:c(),target:t,name:n,mode:r};return Object.defineProperty(t,"$mobx",{enumerable:!1,configurable:!1,writable:!1,value:o}),o}function C(e,t,n){e.values[t]?e.target[t]=n:Ce(e,t,n)}function Ce(e,r,t){D(e.target,r);var n,o=e.name+"@"+e.id+' / Prop "'+r+'"',i=!0;"function"==typeof t&&0===t.length?n=new h(t,e.target,!1,o):t instanceof k&&"function"==typeof t.value&&0===t.value.length?n=new h(t.value,e.target,!0,o):(i=!1,n=new p(t,e.mode,o)),e.values[r]=n,Object.defineProperty(e.target,r,{configurable:!0,enumerable:!i,get:function(){return n.get()},set:i?Z:function(t){var o=n.value;n.set(t)&&void 0!==e.events&&e.events.emit({type:"update",object:this,name:r,oldValue:o})}}),void 0!==e.events&&e.events.emit({type:"add",object:e.target,name:r})}function Te(e,r,o){n(g(e),"Expected observable object"),n(o!==!0,"`observe` doesn't support the fire immediately property for observable objects.");var t=e.$mobx;return void 0===t.events&&(t.events=new l),e.$mobx.events.on(r)}function g(e){return e&&e.$mobx&&e.$mobx.type===V}function n(t,n,e){if(!t)throw new Error("[mobx] Invariant failed: "+n+(e?" in '"+e+"'":""))}function m(e){-1===W.indexOf(e)&&(W.push(e),console.error("[mobx] Deprecated: "+e))}function ge(t){var e=!1;return function(){return e?void 0:(e=!0,t.apply(this,arguments))}}function H(t){var e=[];return t.forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),e}function v(e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}function be(n,e,t){return n?!x(e,t):e!==t}function je(n,t){for(var e=0;e<t.length;e++)Object.defineProperty(n,t[e],{configurable:!0,writable:!0,enumerable:!1,value:n[t[e]]})}function ve(t,n){var e=Object.getOwnPropertyDescriptor(t,n);return!e||e.configurable!==!1&&e.writable!==!1}function D(t,e){n(ve(t,e),"Cannot make property '"+e+"' observable, it is not configurable and writable in the target object")}function x(e,t){if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;var o=Array.isArray(e)||P(e);if(o!==(Array.isArray(t)||P(t)))return!1;if(o){if(e.length!==t.length)return!1;for(var n=e.length;n>=0;n--)if(!x(e[n],t[n]))return!1;return!0}if("object"==typeof e&&"object"==typeof t){if(null===e||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e){if(!t.hasOwnProperty(r))return!1;if(!x(e[r],t[r]))return!1}return!0}return e===t}function fe(n,r){if(!r||!r.length)return[n,[]];if(!n||!n.length)return[[],r];for(var o=[],i=[],e=0,s=0,h=n.length,c=!1,t=0,a=0,l=r.length,u=!1,f=!1;!f&&!c;){if(!u){if(h>e&&l>t&&n[e]===r[t]){if(e++,t++,e===h&&t===l)return[o,i];continue}s=e,a=t,u=!0}a+=1,s+=1,a>=l&&(f=!0),s>=h&&(c=!0),c||n[s]!==r[t]?f||r[a]!==n[e]||(i.push.apply(i,r.slice(t,a)),t=a+1,e++,u=!1):(o.push.apply(o,n.slice(e,s)),e=s+1,t++,u=!1)}return o.push.apply(o,n.slice(e)),i.push.apply(i,r.slice(t)),[o,i]}var L=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};Be(),exports._={quickDiff:fe,resetGlobalState:Ye},exports.extras={getDependencyTree:et,getObserverTree:Fe,trackTransitions:Pe,isComputingDerivation:O,allowStateChanges:ie},exports.autorun=U,exports.when=ee,exports.autorunUntil=Xe,exports.autorunAsync=We,exports.computed=_,exports.createTransformer=He,exports.expr=ze,exports.extendObservable=ne;var u=null;exports.isObservable=y,exports.observable=pe;var r;!function(e){e[e.Reference=0]="Reference",e[e.PlainObject=1]="PlainObject",e[e.ComplexObject=2]="ComplexObject",e[e.Array=3]="Array",e[e.ViewFunction=4]="ViewFunction",e[e.ComplexFunction=5]="ComplexFunction"}(r||(r={})),exports.observe=M,exports.toJSON=b;var w=function(){function e(e,t,n){void 0===e&&(e="Atom"),void 0===t&&(t=we),void 0===n&&(n=we),this.name=e,this.onBecomeObserved=t,this.onBecomeUnobserved=n,this.id=c(),this.isDirty=!1,this.staleObservers=[],this.observers=[]}return e.prototype.reportObserved=function(){q(this)},e.prototype.reportChanged=function(){this.isDirty||(this.reportStale(),this.reportReady())},e.prototype.reportStale=function(){this.isDirty||(this.isDirty=!0,a(this,"STALE"),Y(this))},e.prototype.reportReady=function(){n(this.isDirty,"atom not dirty"),t.inTransaction>0?t.changedAtoms.push(this):(xe(this),J())},e.prototype.toString=function(){return this.name+"@"+this.id},e}();exports.Atom=w;var h=function(){function e(n,r,i,e){var o=this;void 0===e&&(e="ComputedValue"),this.derivation=n,this.scope=r,this.compareStructural=i,this.name=e,this.id=c(),this.isLazy=!0,this.isComputing=!1,this.staleObservers=[],this.observers=[],this.observing=[],this.dependencyChangeCount=0,this.dependencyStaleCount=0,this.value=void 0,this.peek=function(){o.isComputing=!0,t.isComputingComputedValue++;var e=t.allowStateChanges;t.allowStateChanges=!1;var i=n.call(r);return t.allowStateChanges=e,t.isComputingComputedValue--,o.isComputing=!1,i}}return e.prototype.onBecomeObserved=function(){},e.prototype.onBecomeUnobserved=function(){for(var e=0,t=this.observing.length;t>e;e++)B(this.observing[e],this);this.observing=[],this.isLazy=!0,this.value=void 0},e.prototype.onDependenciesReady=function(){var e=this.trackAndCompute();return a(this,"READY",e),e},e.prototype.get=function(){if(n(!this.isComputing,"Cycle detected",this.derivation),q(this),this.dependencyStaleCount>0)return this.peek();if(this.isLazy){if(!O())return this.peek();this.isLazy=!1,this.trackAndCompute()}return this.value},e.prototype.set=function(e){throw new Error("[ComputedValue '"+name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){var e=this.value;return this.value=de(this,this.peek),be(this.compareStructural,this.value,e)},e.prototype.observe=function(n,r){var o=this,e=!0,t=void 0;return U(function(){var i=o.get();(!e||r)&&n(i,t),e=!1,t=i})},e.prototype.toString=function(){return this.name+"@"+this.id+"["+this.derivation.toString()+"]"},e}(),ae=function(){function e(){this.version=1,this.derivationStack=[],this.mobxGuid=0,this.inTransaction=0,this.inUntracked=0,this.isRunningReactions=!1,this.isComputingComputedValue=0,this.changedAtoms=[],this.pendingReactions=[],this.allowStateChanges=!0}return e}(),t=function(){var e=new ae;if(global.__mobservableTrackingStack||global.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(global.__mobxGlobal&&global.__mobxGlobal.version!==e.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");return global.__mobxGlobal?global.__mobxGlobal:global.__mobxGlobal=e}();exports.untracked=Se;var S=function(){function e(e,t){void 0===e&&(e="Reaction"),this.name=e,this.onInvalidate=t,this.id=c(),this.staleObservers=j,this.observers=j,this.observing=[],this.dependencyChangeCount=0,this.dependencyStaleCount=0,this.isDisposed=!1,this._isScheduled=!1}return e.prototype.onBecomeObserved=function(){},e.prototype.onBecomeUnobserved=function(){},e.prototype.onDependenciesReady=function(){return this._isScheduled||(this._isScheduled=!0,t.pendingReactions.push(this)),!1},e.prototype.isScheduled=function(){return this.dependencyStaleCount>0||this._isScheduled},e.prototype.runReaction=function(){this.isDisposed||(this._isScheduled=!1,this.onInvalidate(),a(this,"READY",!0))},e.prototype.track=function(e){de(this,e)},e.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var t=this.observing.splice(0),e=0,n=t.length;n>e;e++)B(t[e],this)}},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e}();exports.Reaction=S;var Ue=100;exports.transaction=d;var e;!function(e){e[e.Recursive=0]="Recursive",e[e.Reference=1]="Reference",e[e.Structure=2]="Structure",e[e.Flat=3]="Flat"}(e||(e={})),exports.asReference=A,exports.asStructure=G,exports.asFlat=Q;var N=function(){function e(e){this.value=e,o(e,"Modifiers are not allowed to be nested")}return e}(),k=function(){function e(e){this.value=e,o(e,"Modifiers are not allowed to be nested")}return e}(),T=function(){function e(e){this.value=e,o(e,"Modifiers are not allowed to be nested")}return e}(),I=0,te=function(){function e(){}return e}();te.prototype=[];var i=function(t){function e(n,r,o){t.call(this);var e=this.$mobx={atom:new w(o||"ObservableArray"),values:void 0,changeEvent:void 0,lastKnownLength:0,mode:r,array:this,makeChildReactive:function(t){return Le.call(e,t)}};Object.defineProperty(this,"$mobx",{enumerable:!1,configurable:!1,writable:!1}),n&&n.length?(re(e,0,n.length),e.values=n.map(e.makeChildReactive)):e.values=[]}return L(e,t),e.prototype.observe=function(t,e){return void 0===e&&(e=!1),void 0===this.$mobx.changeEvent&&(this.$mobx.changeEvent=new l),e&&t({object:this,type:"splice",index:0,addedCount:this.$mobx.values.length,removed:[]}),this.$mobx.changeEvent.on(t)},e.prototype.clear=function(){return this.splice(0)},e.prototype.replace=function(e){return s(this.$mobx,0,this.$mobx.values.length,e)},e.prototype.toJSON=function(){return this.$mobx.atom.reportObserved(),this.$mobx.values.slice()},e.prototype.peek=function(){return this.$mobx.values},e.prototype.find=function(r,o,t){void 0===t&&(t=0),this.$mobx.atom.reportObserved();for(var n=this.$mobx.values,i=n.length,e=t;i>e;e++)if(r.call(o,n[e],e,this))return n[e];return null},e.prototype.splice=function(t,n){for(var r=[],e=2;e<arguments.length;e++)r[e-2]=arguments[e];switch(arguments.length){case 0:return[];case 1:return s(this.$mobx,t);case 2:return s(this.$mobx,t,n)}return s(this.$mobx,t,n,r)},e.prototype.push=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return s(this.$mobx,this.$mobx.values.length,0,t),this.$mobx.values.length},e.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},e.prototype.shift=function(){return this.splice(0,1)[0]},e.prototype.unshift=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return s(this.$mobx,0,0,t),this.$mobx.values.length},e.prototype.reverse=function(){this.$mobx.atom.reportObserved();var e=this.slice();return e.reverse.apply(e,arguments)},e.prototype.sort=function(t){this.$mobx.atom.reportObserved();var e=this.slice();return e.sort.apply(e,arguments)},e.prototype.remove=function(t){var e=this.$mobx.values.indexOf(t);return e>-1?(this.splice(e,1),!0):!1},e.prototype.toString=function(){return"[mobx.array] "+Array.prototype.toString.apply(this.$mobx.values,arguments)},e.prototype.toLocaleString=function(){return"[mobx.array] "+Array.prototype.toLocaleString.apply(this.$mobx.values,arguments)},e}(te);je(i.prototype,["constructor","clear","find","observe","pop","peek","push","remove","replace","reverse","shift","sort","splice","split","toJSON","toLocaleString","toString","unshift"]),Object.defineProperty(i.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return Ne(this.$mobx)},set:function(e){Ge(this.$mobx,e)}}),["concat","every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some"].forEach(function(e){var t=Array.prototype[e];Object.defineProperty(i.prototype,e,{configurable:!1,writable:!0,enumerable:!1,value:function(){return this.$mobx.atom.reportObserved(),t.apply(this.$mobx.values,arguments)}})}),ce(1e3),exports.fastArray=$e,exports.isObservableArray=P;var Je={},f=function(){function t(t,n){var r=this;this.$mobx=Je,this._data={},this._hasMap={},this._events=void 0,this.name="ObservableMap",this.id=c(),this._keys=new i(null,e.Reference,this.name+"@"+this.id+" / keys()"),this._valueMode=qe(n),v(t)?this.merge(t):Array.isArray(t)&&t.forEach(function(e){var t=e[0],n=e[1];return r.set(t,n)})}return t.prototype._has=function(e){return"undefined"!=typeof this._data[e]},t.prototype.has=function(e){return this.isValidKey(e)?this._hasMap[e]?this._hasMap[e].get():this._updateHasMapEntry(e,!1).get():!1},t.prototype.set=function(e,n){var t=this;if(this.assertValidKey(e),o(n,"[mobx.map.set] Expected unwrapped value to be inserted to key '"+e+"'. If you need to use modifiers pass them as second argument to the constructor"),this._has(e)){var r=this._data[e].value,i=this._data[e].set(n);i&&this._events&&this._events.emit({type:"update",object:this,name:e,oldValue:r})}else d(function(){t._data[e]=new p(n,t._valueMode,t.name+"@"+t.id+' / Entry "'+e+'"'),t._updateHasMapEntry(e,!0),t._keys.push(e)}),this._events&&this._events.emit({type:"add",object:this,name:e})},t.prototype.delete=function(e){var t=this;if(this._has(e)){var n=this._data[e].value;d(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1);var n=t._data[e];n.set(void 0),t._data[e]=void 0}),this._events&&this._events.emit({type:"delete",object:this,name:e,oldValue:n})}},t.prototype._updateHasMapEntry=function(n,r){var t=this._hasMap[n];return t?t.set(r):t=this._hasMap[n]=new p(r,e.Reference,this.name+"@"+this.id+' / Contains "'+n+'"'),t},t.prototype.get=function(e){return this.has(e)?this._data[e].get():void 0},t.prototype.keys=function(){return this._keys.slice()},t.prototype.values=function(){return this.keys().map(this.get,this)},t.prototype.entries=function(){var e=this;return this.keys().map(function(t){return[t,e.get(t)]})},t.prototype.forEach=function(e,t){var n=this;this.keys().forEach(function(r){return e.call(t,n.get(r),r)})},t.prototype.merge=function(e){var n=this;return d(function(){e instanceof t?e.keys().forEach(function(t){return n.set(t,e.get(t))}):Object.keys(e).forEach(function(t){return n.set(t,e[t])})}),this},t.prototype.clear=function(){var e=this;d(function(){e.keys().forEach(e.delete,e)})},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.toJs=function(){var t=this,e={};return this.keys().forEach(function(n){return e[n]=t.get(n)}),e},t.prototype.isValidKey=function(e){return null===e||void 0===e?!1:"string"!=typeof e&&"number"!=typeof e?!1:!0},t.prototype.assertValidKey=function(e){if(!this.isValidKey(e))throw new Error("[mobx.map] Invalid key: '"+e+"'")},t.prototype.toString=function(){var e=this;return"[mobx.map { "+this.keys().map(function(t){return t+": "+e.get(t)}).join(", ")+" }]"},t.prototype.observe=function(e){return this._events||(this._events=new l),this._events.on(e)},t}();exports.ObservableMap=f,exports.map=Ee,exports.isObservableMap=F;var V={};exports.isObservableObject=g;var p=function(n){function t(o,i,t){void 0===t&&(t="ObservableValue"),n.call(this,t),this.mode=i,this.hasUnreportedChange=!1,this.events=null,this.value=void 0;var r=$(o,e.Recursive),s=r[0],a=r[1];this.mode===e.Recursive&&(this.mode=s),this.value=E(a,this.mode,this.name)}return L(t,n),t.prototype.set=function(t){o(t,"Modifiers cannot be used on non-initial values."),z();var n=this.value,r=be(this.mode===e.Structure,n,t);return r&&(this.value=E(t,this.mode,this.name),this.reportChanged(),this.events&&this.events.emit(t,n)),r},t.prototype.get=function(){return this.reportObserved(),this.value},t.prototype.observe=function(e,t){return this.events||(this.events=new l),t&&e(this.value,void 0),this.events.on(e)},t.prototype.toString=function(){return this.name+"@"+this.id+"["+this.value+"]"},t}(w),l=function(){function e(){this.listeners=[]}return e.prototype.emit=function(){for(var t=this.listeners.slice(),e=0,n=t.length;n>e;e++)t[e].apply(null,arguments)},e.prototype.on=function(e){var t=this;return this.listeners.push(e),ge(function(){var n=t.listeners.indexOf(e);-1!==n&&t.listeners.splice(n,1)})},e.prototype.once=function(t){var e=this.on(function(){e(),t.apply(this,arguments)});return e},e}();exports.SimpleEventEmitter=l;var j=[];Object.freeze(j);var W=[],we=function(){};
function U(t,i){o(t,"autorun methods cannot have modifiers"),n("function"==typeof t,"autorun expects a function"),n(0===t.length,"autorun expects a function without arguments"),i&&(t=t.bind(i));var r=new S(t.name||"Autorun",function(){this.track(t)});return O()||e.inTransaction>0?e.pendingReactions.push(r):r.runReaction(),r.getDisposer()}function ee(r,o,t){var n=!1,e=U(function(){r.call(t)&&(e?e():n=!0,o.call(t))});return n&&e(),e}function Xe(e,t,n){return m("`autorunUntil` is deprecated, please use `when`."),ee.apply(null,arguments)}function We(e,n,o){void 0===n&&(n=1),o&&(e=e.bind(o));var r=!1,t=new S(e.name||"AutorunAsync",function(){r||(r=!0,setTimeout(function(){r=!1,t.isDisposed||t.track(e)},n))});return t.runReaction(),t.getDisposer()}function _(e,t,n,r){return arguments.length<3&&"function"==typeof e?Qe(e,t):X.apply(null,arguments)}function Qe(r,o){var e=$(r,t.Recursive),i=e[0],n=e[1];return new h(n,o,i===t.Structure,n.name||"ComputedValue")}function X(i,e,o,a){if(1===arguments.length){var u=i;return function(e,t,n){return X.call(null,e,t,n,u)}}n(o&&o.hasOwnProperty("get"),"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'"),D(i,e);var r={},s=o.get;return n("object"==typeof i,"The @observable decorator can only be used on objects",e),n("function"==typeof s,"@observable expects a getter function if used on a property.",e),n(!o.set,"@observable properties cannot have a setter.",e),n(0===s.length,"@observable getter functions should not take arguments.",e),r.configurable=!0,r.enumerable=!1,r.get=function(){return C(R(this,void 0,t.Recursive),e,a&&a.asStructure===!0?G(s):s),this[e]},r.set=te,o?r:void Object.defineProperty(i,e,r)}function te(){throw new Error("[ComputedValue] It is not allowed to assign new values to computed properties.")}function He(t,o){n("function"==typeof t&&1===t.length,"createTransformer expects a function that accepts one argument");var r={},i=e.resetId,s=function(e){function n(n,r){e.call(this,function(){return t(r)},null,!1,"Transformer-"+t.name+"-"+n),this.sourceIdentifier=n,this.sourceObject=r}return L(n,e),n.prototype.onBecomeUnobserved=function(){var t=this.value;e.prototype.onBecomeUnobserved.call(this),delete r[this.sourceIdentifier],o&&o(t,this.sourceObject)},n}(h);return function(o){i!==e.resetId&&(r={},i=e.resetId);var n=Ke(o),t=r[n];return t?t.get():(t=r[n]=new s(n,o),t.get())}}function Ke(e){if(null===e||"object"!=typeof e)throw new Error("[mobx] transform expected some kind of object, got: "+e);var t=e.$transformId;return void 0===t&&(t=c(),Object.defineProperty(e,"$transformId",{configurable:!0,writable:!0,enumerable:!1,value:t})),t}function ze(e,t){return O()||console.warn("[mobx.expr] 'expr' should only be used inside other reactive functions."),_(e,t).get()}function oe(e){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return n(arguments.length>=2,"extendObservable expected 2 or more arguments"),n("object"==typeof e,"extendObservable expects an object as first argument"),n(!(e instanceof f),"extendObservable should not be used on maps, use map.merge instead"),o.forEach(function(r){n("object"==typeof r,"all arguments of extendObservable should be objects"),ie(e,r,t.Recursive,null)}),e}function ie(e,t,r,o){var i=R(e,o,r);for(var n in t)if(t.hasOwnProperty(n)){if(e===t&&!be(e,n))continue;C(i,n,t[n])}return e}function se(t,n){var r=e.allowStateChanges;e.allowStateChanges=t;var o=n();return e.allowStateChanges=r,o}function a(e,n,t){void 0===t&&(t=!1),u&&u.emit({id:e.id,name:e.name+"@"+e.id,node:e,state:n,changed:t})}function et(e){return ae(e)}function ae(e){var t={id:e.id,name:e.name+"@"+e.id};return e.observing&&e.observing.length&&(t.dependencies=H(e.observing).map(ae)),t}function Me(e){return fe(e)}function fe(e){var t={id:e.id,name:e.name+"@"+e.id};return e.observers&&e.observers.length&&(t.observers=H(e.observers).map(fe)),t}function De(n){var e=[],t=!1;return function(r){(n||r.changed)&&e.push(r),t||(t=!0,setTimeout(function(){console[console.table?"table":"dir"](e),e=[],t=!1},1))}}function Pe(e,t){void 0===e&&(e=!1),u||(u=new l);var n=t?function(n){(e||n.changed)&&t(n)}:De(e),r=u.on(n);return ye(function(){r(),0===u.listeners.length&&(u=null)})}function y(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(e instanceof f||e instanceof i)throw new Error("[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.");if(g(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return!!e.$mobx||e instanceof w||e instanceof S||e instanceof h}function Ae(s,r,e){if(n(arguments.length>=2&&arguments.length<=3,"Illegal decorator config",r),D(s,r),e&&e.hasOwnProperty("get"))return m("Using @observable on computed values is deprecated. Use @computed instead."),_.apply(null,arguments);var o={},i=void 0;return e&&(e.hasOwnProperty("value")?i=e.value:e.initializer&&(i=e.initializer(),"function"==typeof i&&(i=A(i)))),n("object"==typeof s,"The @observable decorator can only be used on objects",r),o.configurable=!0,o.enumerable=!0,o.get=function(){var e=this;return se(!0,function(){C(R(e,void 0,t.Recursive),r,i)}),this[r]},o.set=function(e){C(R(this,void 0,t.Recursive),r,"function"==typeof e?A(e):e)},e?o:void Object.defineProperty(s,r,o)}function ve(e,a){if("string"==typeof arguments[1])return Ae.apply(null,arguments);if(n(1===arguments.length||2===arguments.length,"observable expects one or two arguments"),y(e))return e;var s=$(e,t.Recursive),o=s[0],i=s[1],u=o===t.Reference?r.Reference:_e(i);switch(u){case r.Array:case r.PlainObject:return E(i,o);case r.Reference:case r.ComplexObject:return new p(i,o);case r.ComplexFunction:throw new Error("[mobx.observable] To be able to make a function reactive it should not have arguments. If you need an observable reference to a function, use `observable(asReference(f))`");case r.ViewFunction:return m("Use `computed(expr)` instead of `observable(expr)`"),_(e,a)}n(!1,"Illegal State")}function _e(e){return null===e||void 0===e?r.Reference:"function"==typeof e?e.length?r.ComplexFunction:r.ViewFunction:Array.isArray(e)||e instanceof i?r.Array:"object"==typeof e?v(e)?r.PlainObject:r.ComplexObject:r.Reference}function I(t,n,e,r){return"function"==typeof e?we(t,n,e,r):ge(t,n,e)}function ge(e,t,r){return P(e)?e.observe(t):M(e)?e.observe(t):g(e)?Ce(e,t,r):e instanceof p||e instanceof h?e.observe(t,r):v(e)?ge(ve(e),t,r):void n(!1,"first argument of observe should be some observable value or plain object")}function we(e,t,r,o){var i="[mobx.observe] the provided observable map has no key with name: "+t;if(M(e)){if(!e._has(t))throw new Error(i);return I(e._data[t],r)}if(g(e)){if(!y(e,t))throw new Error(i);return I(e.$mobx.values[t],r,o)}return v(e)?(oe(e,{property:e[t]}),we(e,t,r,o)):void n(!1,"first argument of observe should be an (observable)object or observableMap if a property name is given")}function b(e,n,t){function s(r){return n&&t.push([e,r]),r}if(void 0===n&&(n=!0),void 0===t&&(t=null),n&&null===t&&(t=[]),n&&null!==e&&"object"==typeof e)for(var o=0,u=t.length;u>o;o++)if(t[o][0]===e)return t[o][1];if(!e)return e;if(Array.isArray(e)||e instanceof i){var r=s([]);return r.push.apply(r,e.map(function(e){return b(e,n,t)})),r}if(e instanceof f){var r=s({});return e.forEach(function(e,o){return r[o]=b(e,n,t)}),r}if("object"==typeof e&&v(e)){var r=s({});for(var a in e)e.hasOwnProperty(a)&&(r[a]=b(e[a],n,t));return r}return y(e)&&e.$mobx instanceof p?b(e(),n,t):e}function xe(e){n(e.isDirty,"atom not dirty"),e.isDirty=!1,a(e,"READY",!0),K(e,!0)}function O(){return e.derivationStack.length>0}function z(){n(e.allowStateChanges,"It is not allowed to change the state when a computed value is being evaluated. Use 'autorun' to create reactive functions with side-effects. Or use 'extras.allowStateChanges(true, block)' to supress this message.")}function Se(e){1===++e.dependencyStaleCount&&(a(e,"STALE"),Y(e))}function ke(e,t){if(n(e.dependencyStaleCount>0,"unexpected ready notification"),t&&(e.dependencyChangeCount+=1),0===--e.dependencyStaleCount)if(e.dependencyChangeCount>0){e.dependencyChangeCount=0,a(e,"PENDING");var r=e.onDependenciesReady();K(e,r)}else a(e,"READY",!1),K(e,!1)}function de(t,n){var r=t.observing;t.observing=[],e.derivationStack.push(t);var o=n();return Ee(t,r),o}function Ee(r,u){e.derivationStack.length-=1;for(var i=pe(r.observing,u),o=i[0],s=i[1],t=0,a=o.length;a>t;t++){var c=o[t];n(!he(r,c),"Cycle detected",r),Ze(o[t],r)}for(var t=0,a=s.length;a>t;t++)B(s[t],r)}function he(r,n){var e=n.observing;if(void 0===e)return!1;if(-1!==e.indexOf(n))return!0;for(var o=e.length,t=0;o>t;t++)if(he(r,e[t]))return!0;return!1}function c(){return++e.mobxGuid}function Ge(){}function Z(){var r=e.resetId,t=new ue;for(var n in t)e[n]=t[n];e.resetId=r+1}function Ze(e,r){var t=e.observers,n=t.length;t[n]=r,0===n&&e.onBecomeObserved()}function B(t,r){var e=t.observers,n=e.indexOf(r);-1!==n&&e.splice(n,1),0===e.length&&t.onBecomeUnobserved()}function q(n){if(!(e.inUntracked>0)){var o=e.derivationStack,i=o.length;if(i>0){var t=o[i-1].observing,r=t.length;t[r-1]!==n&&t[r-2]!==n&&(t[r]=n)}}}function Y(e){var t=e.observers.slice();t.forEach(Se),e.staleObservers=e.staleObservers.concat(t)}function K(e,t){e.staleObservers.splice(0).forEach(function(e){return ke(e,t)})}function Te(t){m("This feature is experimental and might be removed in a future minor release. Please report if you use this feature in production: https://github.com/mobxjs/mobx/issues/49"),e.inUntracked++;var n=t();return e.inUntracked--,n}function J(){if(!e.isRunningReactions){e.isRunningReactions=!0;for(var t=e.pendingReactions,o=0;t.length;){if(++o===Ue)throw new Error("Reaction doesn't converge to a stable state. Probably there is a cycle in the reactive function: "+t[0].toString());for(var r=t.splice(0),n=0,i=r.length;i>n;n++)r[n].runReaction()}e.isRunningReactions=!1}}function d(r,o){e.inTransaction+=1;var i=r.call(o);if(0===--e.inTransaction){for(var n=e.changedAtoms.splice(0),t=0,s=n.length;s>t;t++)xe(n[t]);J()}return i}function A(e){return new N(e)}function G(e){return new k(e)}function Q(e){return new T(e)}function $(e,n){return e instanceof N?[t.Reference,e.value]:e instanceof k?[t.Structure,e.value]:e instanceof T?[t.Flat,e.value]:[n,e]}function qe(e){return e===A?t.Reference:e===G?t.Structure:e===Q?t.Flat:(n(void 0===e,"Cannot determine value mode from function. Please pass in one of these: mobx.asReference, mobx.asStructure or mobx.asFlat, got: "+e),t.Recursive)}function E(e,a,s){var r;if(y(e))return e;switch(a){case t.Reference:return e;case t.Flat:o(e,"Items inside 'asFlat' canont have modifiers"),r=t.Reference;break;case t.Structure:o(e,"Items inside 'asStructure' canont have modifiers"),r=t.Structure;break;case t.Recursive:i=$(e,t.Recursive),r=i[0],e=i[1];break;default:n(!1,"Illegal State")}return Array.isArray(e)&&Object.isExtensible(e)?le(e,r,s):v(e)&&Object.isExtensible(e)?ie(e,e,r,s):e;var i}function o(e,t){if(e instanceof N||e instanceof k||e instanceof T)throw new Error("[mobx] asStructure / asReference / asFlat cannot be used here. "+t)}function Ye(e){return e.atom.reportObserved(),e.values.length}function Ne(n,e){if("number"!=typeof e||0>e)throw new Error("[mobx.array] Out of range: "+e);var t=n.values.length;e!==t&&(e>t?s(n,t,0,new Array(e-t)):s(n,e,t-e))}function re(n,t,e){if(t!==n.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");z(),n.lastKnownLength+=e,e>0&&t+e>V&&ce(t+e)}function s(o,e,n,t){var r=o.values.length;if(!(void 0!==t&&0!==t.length||0!==n&&0!==r))return[];void 0===e?e=0:e>r?e=r:0>e&&(e=Math.max(0,r+e)),n=2===arguments.length?r-e:void 0===n||null===n?0:Math.max(0,Math.min(n,r-e)),t=void 0===t?j:t.map(o.makeChildReactive);var a=t.length-n;re(o,r,a);var i=(s=o.values).splice.apply(s,[e,n].concat(t));return Ve(o,e,i,t),i;var s}function Be(e){return o(e,"Array values cannot have modifiers"),this.mode===t.Flat||this.mode===t.Reference?e:E(e,this.mode,this.atom.name+"@"+this.atom.id+" / ArrayEntry")}function Le(e,t,n){e.atom.reportChanged(),e.changeEvent&&e.changeEvent.emit({object:e.array,type:"update",index:t,oldValue:n})}function Ve(e,r,t,n){(0!==t.length||0!==n.length)&&(e.atom.reportChanged(),e.changeEvent&&e.changeEvent.emit({object:e.array,type:"splice",index:r,addedCount:n.length,removed:t}))}function Fe(e){Object.defineProperty(i.prototype,""+e,{enumerable:!1,configurable:!1,set:function(n){var r=this.$mobx,i=r.values;if(o(n,"Modifiers cannot be used on array values. For non-reactive array values use makeReactive(asFlat(array))."),e<i.length){z();var a=i[e],u=r.mode===t.Structure?!x(a,n):a!==n;u&&(i[e]=r.makeChildReactive(n),Le(r,e,a))}else{if(e!==i.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+i.length);s(r,e,0,[n])}},get:function(){var t=this.$mobx;return t&&e<t.values.length?(t.atom.reportObserved(),t.values[e]):void 0}})}function ce(t){for(var e=V;t>e;e++)Fe(e);V=t}function le(e,t,n){return new i(e,t,n)}function Ie(e){return m("fastArray is deprecated. Please use `observable(asFlat([]))`"),le(e,t.Flat,null)}function P(e){return e instanceof i}function $e(e,t){return new f(e,t)}function M(e){return e instanceof f}function R(e,n,r){if(void 0===n&&(n="ObservableObject"),void 0===r&&(r=t.Recursive),e.$mobx){if(e.$mobx.type!==F)throw new Error("The given object is observable but not an observable object");return e.$mobx}var o={type:F,values:{},events:void 0,id:c(),target:e,name:n,mode:r};return Object.defineProperty(e,"$mobx",{enumerable:!1,configurable:!1,writable:!1,value:o}),o}function C(e,t,n){e.values[t]?e.target[t]=n:Re(e,t,n)}function Re(e,r,t){D(e.target,r);var n,o=e.name+"@"+e.id+' / Prop "'+r+'"',i=!0;"function"==typeof t&&0===t.length?n=new h(t,e.target,!1,o):t instanceof k&&"function"==typeof t.value&&0===t.value.length?n=new h(t.value,e.target,!0,o):(i=!1,n=new p(t,e.mode,o)),e.values[r]=n,Object.defineProperty(e.target,r,{configurable:!0,enumerable:!i,get:function(){return n.get()},set:i?te:function(t){var o=n.value;n.set(t)&&void 0!==e.events&&e.events.emit({type:"update",object:this,name:r,oldValue:o})}}),void 0!==e.events&&e.events.emit({type:"add",object:e.target,name:r})}function Ce(e,r,o){n(g(e),"Expected observable object"),n(o!==!0,"`observe` doesn't support the fire immediately property for observable objects.");var t=e.$mobx;return void 0===t.events&&(t.events=new l),e.$mobx.events.on(r)}function g(e){return e&&e.$mobx&&e.$mobx.type===F}function n(t,n,e){if(!t)throw new Error("[mobx] Invariant failed: "+n+(e?" in '"+e+"'":""))}function m(e){-1===W.indexOf(e)&&(W.push(e),console.error("[mobx] Deprecated: "+e))}function ye(t){var e=!1;return function(){return e?void 0:(e=!0,t.apply(this,arguments))}}function H(t){var e=[];return t.forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),e}function v(e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}function me(n,e,t){return n?!x(e,t):e!==t}function je(n,t){for(var e=0;e<t.length;e++)Object.defineProperty(n,t[e],{configurable:!0,writable:!0,enumerable:!1,value:n[t[e]]})}function be(t,n){var e=Object.getOwnPropertyDescriptor(t,n);return!e||e.configurable!==!1&&e.writable!==!1}function D(t,e){n(be(t,e),"Cannot make property '"+e+"' observable, it is not configurable and writable in the target object")}function x(e,t){if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;var o=Array.isArray(e)||P(e);if(o!==(Array.isArray(t)||P(t)))return!1;if(o){if(e.length!==t.length)return!1;for(var n=e.length;n>=0;n--)if(!x(e[n],t[n]))return!1;return!0}if("object"==typeof e&&"object"==typeof t){if(null===e||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e){if(!t.hasOwnProperty(r))return!1;if(!x(e[r],t[r]))return!1}return!0}return e===t}function pe(n,r){if(!r||!r.length)return[n,[]];if(!n||!n.length)return[[],r];for(var o=[],i=[],e=0,s=0,h=n.length,c=!1,t=0,a=0,l=r.length,u=!1,f=!1;!f&&!c;){if(!u){if(h>e&&l>t&&n[e]===r[t]){if(e++,t++,e===h&&t===l)return[o,i];continue}s=e,a=t,u=!0}a+=1,s+=1,a>=l&&(f=!0),s>=h&&(c=!0),c||n[s]!==r[t]?f||r[a]!==n[e]||(i.push.apply(i,r.slice(t,a)),t=a+1,e++,u=!1):(o.push.apply(o,n.slice(e,s)),e=s+1,t++,u=!1)}return o.push.apply(o,n.slice(e)),i.push.apply(i,r.slice(t)),[o,i]}var L=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};Ge(),exports._={quickDiff:pe,resetGlobalState:Z},exports.extras={allowStateChanges:se,getDependencyTree:et,getObserverTree:Me,isComputingDerivation:O,resetGlobalState:Z,trackTransitions:Pe},exports.autorun=U,exports.when=ee,exports.autorunUntil=Xe,exports.autorunAsync=We,exports.computed=_,exports.createTransformer=He,exports.expr=ze,exports.extendObservable=oe;var u=null;exports.isObservable=y,exports.observable=ve;var r;!function(e){e[e.Reference=0]="Reference",e[e.PlainObject=1]="PlainObject",e[e.ComplexObject=2]="ComplexObject",e[e.Array=3]="Array",e[e.ViewFunction=4]="ViewFunction",e[e.ComplexFunction=5]="ComplexFunction"}(r||(r={})),exports.observe=I,exports.toJSON=b;var w=function(){function t(e,t,n){void 0===e&&(e="Atom"),void 0===t&&(t=Oe),void 0===n&&(n=Oe),this.name=e,this.onBecomeObserved=t,this.onBecomeUnobserved=n,this.id=c(),this.isDirty=!1,this.staleObservers=[],this.observers=[]}return t.prototype.reportObserved=function(){q(this)},t.prototype.reportChanged=function(){this.isDirty||(this.reportStale(),this.reportReady())},t.prototype.reportStale=function(){this.isDirty||(this.isDirty=!0,a(this,"STALE"),Y(this))},t.prototype.reportReady=function(){n(this.isDirty,"atom not dirty"),e.inTransaction>0?e.changedAtoms.push(this):(xe(this),J())},t.prototype.toString=function(){return this.name+"@"+this.id},t}();exports.Atom=w;var h=function(){function t(n,r,i,t){var o=this;void 0===t&&(t="ComputedValue"),this.derivation=n,this.scope=r,this.compareStructural=i,this.name=t,this.id=c(),this.isLazy=!0,this.isComputing=!1,this.staleObservers=[],this.observers=[],this.observing=[],this.dependencyChangeCount=0,this.dependencyStaleCount=0,this.value=void 0,this.peek=function(){o.isComputing=!0,e.isComputingComputedValue++;var t=e.allowStateChanges;e.allowStateChanges=!1;var i=n.call(r);return e.allowStateChanges=t,e.isComputingComputedValue--,o.isComputing=!1,i}}return t.prototype.onBecomeObserved=function(){},t.prototype.onBecomeUnobserved=function(){for(var e=0,t=this.observing.length;t>e;e++)B(this.observing[e],this);this.observing=[],this.isLazy=!0,this.value=void 0},t.prototype.onDependenciesReady=function(){var e=this.trackAndCompute();return a(this,"READY",e),e},t.prototype.get=function(){if(n(!this.isComputing,"Cycle detected",this.derivation),q(this),this.dependencyStaleCount>0)return this.peek();if(this.isLazy){if(!O())return this.peek();this.isLazy=!1,this.trackAndCompute()}return this.value},t.prototype.set=function(e){throw new Error("[ComputedValue '"+name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){var e=this.value;return this.value=de(this,this.peek),me(this.compareStructural,this.value,e)},t.prototype.observe=function(n,r){var o=this,e=!0,t=void 0;return U(function(){var i=o.get();(!e||r)&&n(i,t),e=!1,t=i})},t.prototype.toString=function(){return this.name+"@"+this.id+"["+this.derivation.toString()+"]"},t}(),ue=function(){function e(){this.version=1,this.derivationStack=[],this.mobxGuid=0,this.inTransaction=0,this.inUntracked=0,this.isRunningReactions=!1,this.isComputingComputedValue=0,this.changedAtoms=[],this.pendingReactions=[],this.allowStateChanges=!0,this.resetId=0}return e}(),e=function(){var e=new ue;if(global.__mobservableTrackingStack||global.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(global.__mobxGlobal&&global.__mobxGlobal.version!==e.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");return global.__mobxGlobal?global.__mobxGlobal:global.__mobxGlobal=e}();exports.untracked=Te;var S=function(){function t(e,t){void 0===e&&(e="Reaction"),this.name=e,this.onInvalidate=t,this.id=c(),this.staleObservers=j,this.observers=j,this.observing=[],this.dependencyChangeCount=0,this.dependencyStaleCount=0,this.isDisposed=!1,this._isScheduled=!1}return t.prototype.onBecomeObserved=function(){},t.prototype.onBecomeUnobserved=function(){},t.prototype.onDependenciesReady=function(){return this._isScheduled||(this._isScheduled=!0,e.pendingReactions.push(this)),!1},t.prototype.isScheduled=function(){return this.dependencyStaleCount>0||this._isScheduled},t.prototype.runReaction=function(){this.isDisposed||(this._isScheduled=!1,this.onInvalidate(),a(this,"READY",!0))},t.prototype.track=function(e){de(this,e)},t.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var t=this.observing.splice(0),e=0,n=t.length;n>e;e++)B(t[e],this)}},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t}();exports.Reaction=S;var Ue=100;exports.transaction=d;var t;!function(e){e[e.Recursive=0]="Recursive",e[e.Reference=1]="Reference",e[e.Structure=2]="Structure",e[e.Flat=3]="Flat"}(t||(t={})),exports.asReference=A,exports.asStructure=G,exports.asFlat=Q;var N=function(){function e(e){this.value=e,o(e,"Modifiers are not allowed to be nested")}return e}(),k=function(){function e(e){this.value=e,o(e,"Modifiers are not allowed to be nested")}return e}(),T=function(){function e(e){this.value=e,o(e,"Modifiers are not allowed to be nested")}return e}(),V=0,ne=function(){function e(){}return e}();ne.prototype=[];var i=function(t){function e(n,r,o){t.call(this);var e=this.$mobx={atom:new w(o||"ObservableArray"),values:void 0,changeEvent:void 0,lastKnownLength:0,mode:r,array:this,makeChildReactive:function(t){return Be.call(e,t)}};Object.defineProperty(this,"$mobx",{enumerable:!1,configurable:!1,writable:!1}),n&&n.length?(re(e,0,n.length),e.values=n.map(e.makeChildReactive)):e.values=[]}return L(e,t),e.prototype.observe=function(t,e){return void 0===e&&(e=!1),void 0===this.$mobx.changeEvent&&(this.$mobx.changeEvent=new l),e&&t({object:this,type:"splice",index:0,addedCount:this.$mobx.values.length,removed:[]}),this.$mobx.changeEvent.on(t)},e.prototype.clear=function(){return this.splice(0)},e.prototype.replace=function(e){return s(this.$mobx,0,this.$mobx.values.length,e)},e.prototype.toJSON=function(){return this.$mobx.atom.reportObserved(),this.$mobx.values.slice()},e.prototype.peek=function(){return this.$mobx.values},e.prototype.find=function(r,o,t){void 0===t&&(t=0),this.$mobx.atom.reportObserved();for(var n=this.$mobx.values,i=n.length,e=t;i>e;e++)if(r.call(o,n[e],e,this))return n[e];return null},e.prototype.splice=function(t,n){for(var r=[],e=2;e<arguments.length;e++)r[e-2]=arguments[e];switch(arguments.length){case 0:return[];case 1:return s(this.$mobx,t);case 2:return s(this.$mobx,t,n)}return s(this.$mobx,t,n,r)},e.prototype.push=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return s(this.$mobx,this.$mobx.values.length,0,t),this.$mobx.values.length},e.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},e.prototype.shift=function(){return this.splice(0,1)[0]},e.prototype.unshift=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return s(this.$mobx,0,0,t),this.$mobx.values.length},e.prototype.reverse=function(){this.$mobx.atom.reportObserved();var e=this.slice();return e.reverse.apply(e,arguments)},e.prototype.sort=function(t){this.$mobx.atom.reportObserved();var e=this.slice();return e.sort.apply(e,arguments)},e.prototype.remove=function(t){var e=this.$mobx.values.indexOf(t);return e>-1?(this.splice(e,1),!0):!1},e.prototype.toString=function(){return"[mobx.array] "+Array.prototype.toString.apply(this.$mobx.values,arguments)},e.prototype.toLocaleString=function(){return"[mobx.array] "+Array.prototype.toLocaleString.apply(this.$mobx.values,arguments)},e}(ne);je(i.prototype,["constructor","clear","find","observe","pop","peek","push","remove","replace","reverse","shift","sort","splice","split","toJSON","toLocaleString","toString","unshift"]),Object.defineProperty(i.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return Ye(this.$mobx)},set:function(e){Ne(this.$mobx,e)}}),["concat","every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some"].forEach(function(e){var t=Array.prototype[e];Object.defineProperty(i.prototype,e,{configurable:!1,writable:!0,enumerable:!1,value:function(){return this.$mobx.atom.reportObserved(),t.apply(this.$mobx.values,arguments)}})}),ce(1e3),exports.fastArray=Ie,exports.isObservableArray=P;var Je={},f=function(){function e(e,n){var r=this;this.$mobx=Je,this._data={},this._hasMap={},this._events=void 0,this.name="ObservableMap",this.id=c(),this._keys=new i(null,t.Reference,this.name+"@"+this.id+" / keys()"),this._valueMode=qe(n),v(e)?this.merge(e):Array.isArray(e)&&e.forEach(function(e){var t=e[0],n=e[1];return r.set(t,n)})}return e.prototype._has=function(e){return"undefined"!=typeof this._data[e]},e.prototype.has=function(e){return this.isValidKey(e)?this._hasMap[e]?this._hasMap[e].get():this._updateHasMapEntry(e,!1).get():!1},e.prototype.set=function(e,n){var t=this;if(this.assertValidKey(e),o(n,"[mobx.map.set] Expected unwrapped value to be inserted to key '"+e+"'. If you need to use modifiers pass them as second argument to the constructor"),this._has(e)){var r=this._data[e].value,i=this._data[e].set(n);i&&this._events&&this._events.emit({type:"update",object:this,name:e,oldValue:r})}else d(function(){t._data[e]=new p(n,t._valueMode,t.name+"@"+t.id+' / Entry "'+e+'"'),t._updateHasMapEntry(e,!0),t._keys.push(e)}),this._events&&this._events.emit({type:"add",object:this,name:e})},e.prototype.delete=function(e){var t=this;if(this._has(e)){var n=this._data[e].value;d(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1);var n=t._data[e];n.set(void 0),t._data[e]=void 0}),this._events&&this._events.emit({type:"delete",object:this,name:e,oldValue:n})}},e.prototype._updateHasMapEntry=function(n,r){var e=this._hasMap[n];return e?e.set(r):e=this._hasMap[n]=new p(r,t.Reference,this.name+"@"+this.id+' / Contains "'+n+'"'),e},e.prototype.get=function(e){return this.has(e)?this._data[e].get():void 0},e.prototype.keys=function(){return this._keys.slice()},e.prototype.values=function(){return this.keys().map(this.get,this)},e.prototype.entries=function(){var e=this;return this.keys().map(function(t){return[t,e.get(t)]})},e.prototype.forEach=function(e,t){var n=this;this.keys().forEach(function(r){return e.call(t,n.get(r),r)})},e.prototype.merge=function(t){var n=this;return d(function(){t instanceof e?t.keys().forEach(function(e){return n.set(e,t.get(e))}):Object.keys(t).forEach(function(e){return n.set(e,t[e])})}),this},e.prototype.clear=function(){var e=this;d(function(){e.keys().forEach(e.delete,e)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toJs=function(){var t=this,e={};return this.keys().forEach(function(n){return e[n]=t.get(n)}),e},e.prototype.isValidKey=function(e){return null===e||void 0===e?!1:"string"!=typeof e&&"number"!=typeof e?!1:!0},e.prototype.assertValidKey=function(e){if(!this.isValidKey(e))throw new Error("[mobx.map] Invalid key: '"+e+"'")},e.prototype.toString=function(){var e=this;return"[mobx.map { "+this.keys().map(function(t){return t+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e){return this._events||(this._events=new l),this._events.on(e)},e}();exports.ObservableMap=f,exports.map=$e,exports.isObservableMap=M;var F={};exports.isObservableObject=g;var p=function(n){function e(o,i,e){void 0===e&&(e="ObservableValue"),n.call(this,e),this.mode=i,this.hasUnreportedChange=!1,this.events=null,this.value=void 0;var r=$(o,t.Recursive),s=r[0],a=r[1];this.mode===t.Recursive&&(this.mode=s),this.value=E(a,this.mode,this.name)}return L(e,n),e.prototype.set=function(e){o(e,"Modifiers cannot be used on non-initial values."),z();var n=this.value,r=me(this.mode===t.Structure,n,e);return r&&(this.value=E(e,this.mode,this.name),this.reportChanged(),this.events&&this.events.emit(e,n)),r},e.prototype.get=function(){return this.reportObserved(),this.value},e.prototype.observe=function(e,t){return this.events||(this.events=new l),t&&e(this.value,void 0),this.events.on(e)},e.prototype.toString=function(){return this.name+"@"+this.id+"["+this.value+"]"},e}(w),l=function(){function e(){this.listeners=[]}return e.prototype.emit=function(){for(var t=this.listeners.slice(),e=0,n=t.length;n>e;e++)t[e].apply(null,arguments)},e.prototype.on=function(e){var t=this;return this.listeners.push(e),ye(function(){var n=t.listeners.indexOf(e);-1!==n&&t.listeners.splice(n,1)})},e.prototype.once=function(t){var e=this.on(function(){e(),t.apply(this,arguments)});return e},e}();exports.SimpleEventEmitter=l;var j=[];Object.freeze(j);var W=[],Oe=function(){};
//# sourceMappingURL=lib/mobx.min.js.map

@@ -14,7 +14,8 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mobx = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

exports.extras = {
allowStateChanges: allowStateChanges,
getDependencyTree: getDependencyTree,
getObserverTree: getObserverTree,
trackTransitions: trackTransitions,
isComputingDerivation: isComputingDerivation,
allowStateChanges: allowStateChanges
resetGlobalState: resetGlobalState,
trackTransitions: trackTransitions
};

@@ -120,2 +121,3 @@ function autorun(view, scope) {

var objectCache = {};
var resetId = globalState.resetId;
var Transformer = (function (_super) {

@@ -138,2 +140,6 @@ __extends(Transformer, _super);

return function (object) {
if (resetId !== globalState.resetId) {
objectCache = {};
resetId = globalState.resetId;
}
var identifier = getMemoizationId(object);

@@ -651,2 +657,3 @@ var reactiveTransformer = objectCache[identifier];

this.allowStateChanges = true;
this.resetId = 0;
}

@@ -671,5 +678,7 @@ return MobXGlobals;

function resetGlobalState() {
var resetId = globalState.resetId;
var defaultGlobals = new MobXGlobals();
for (var key in defaultGlobals)
globalState[key] = defaultGlobals[key];
globalState.resetId = resetId + 1;
}

@@ -676,0 +685,0 @@ function addObserver(observable, node) {

{
"name": "mobx",
"version": "2.0.5",
"version": "2.0.6",
"description": "Simple, scalable state management.",

@@ -5,0 +5,0 @@ "main": "lib/mobx.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc