mobx-state-tree
Advanced tools
Comparing version 3.7.1 to 3.8.0
@@ -1,3 +0,3 @@ | ||
import { ExtractS, ExtractT, IAnyStateTreeNode, ExtractC, IType, IAnyModelType, IStateTreeNode, IJsonPatch, IDisposer, IAnyType, ExtractIStateTreeNode } from "../internal"; | ||
export declare type TypeOrStateTreeNodeToStateTreeNode<T extends IAnyType | IAnyStateTreeNode> = T extends IAnyStateTreeNode ? T : T extends IType<infer TC, infer TS, infer TT> ? ExtractIStateTreeNode<TC, TS, TT> : never; | ||
import { ExtractT, IAnyStateTreeNode, IType, IAnyModelType, IStateTreeNode, IJsonPatch, IDisposer, IAnyType, ModelPrimitive, ExtractNodeC } from "../internal"; | ||
export declare type TypeOrStateTreeNodeToStateTreeNode<T extends IAnyType | IAnyStateTreeNode> = T extends IType<any, any, infer TT> ? TT : T; | ||
/** | ||
@@ -190,3 +190,3 @@ * Returns the _actual_ type of the given tree node. (Or throws) | ||
*/ | ||
export declare function getParentOfType<IT extends IAnyType>(target: IAnyStateTreeNode, type: IT): ExtractIStateTreeNode<ExtractC<IT>, ExtractS<IT>, ExtractT<IT>>; | ||
export declare function getParentOfType<IT extends IAnyType>(target: IAnyStateTreeNode, type: IT): ExtractT<IT>; | ||
/** | ||
@@ -247,3 +247,3 @@ * Given an object in a model tree, returns the root object of that tree | ||
*/ | ||
export declare function resolveIdentifier<IT extends IAnyType>(type: IT, target: IAnyStateTreeNode, identifier: string | number): ExtractIStateTreeNode<ExtractC<IT>, ExtractS<IT>, ExtractT<IT>> | undefined; | ||
export declare function resolveIdentifier<IT extends IAnyType>(type: IT, target: IAnyStateTreeNode, identifier: string | number): ExtractT<IT> | undefined; | ||
/** | ||
@@ -314,2 +314,4 @@ * Returns the identifier of the target node. | ||
* | ||
* This methods returns the same disposer that was passed as argument. | ||
* | ||
* @example | ||
@@ -333,4 +335,5 @@ * const Todo = types.model({ | ||
* @param {() => void} disposer | ||
* @returns {() => void} the same disposer that was passed as argument | ||
*/ | ||
export declare function addDisposer(target: IAnyStateTreeNode, disposer: () => void): void; | ||
export declare function addDisposer(target: IAnyStateTreeNode, disposer: () => void): (() => void); | ||
/** | ||
@@ -381,9 +384,9 @@ * Returns the environment of the current state tree. For more info on environments, | ||
export declare function getMembers(target: IAnyStateTreeNode): IModelReflectionData; | ||
export declare type CastedType<T> = T extends IStateTreeNode<infer C> ? C | T : T; | ||
export declare function cast<O extends ModelPrimitive = never>(snapshotOrInstance: O): O; | ||
export declare function cast<I extends ExtractNodeC<O>, O = never>(snapshotOrInstance: I): O; | ||
export declare function cast<I extends ExtractNodeC<O>, O = never>(snapshotOrInstance: I | O): O; | ||
/** | ||
* Casts a node snapshot or instance type to an instance type so it can be assigned to a type instance. | ||
* Alternatively also casts a node snapshot or instance to an snapshot type so it can be assigned to a type snapshot. | ||
* Note that this is just a cast for the type system, this is, it won't actually convert a snapshot to an instance | ||
* (or vice-versa), but just fool typescript into thinking so. | ||
* Either way, casting when outside an assignation operation will only yield an unusable type (never). | ||
* Casts a node instance type to an snapshot type so it can be assigned to a type snapshot (e.g. to be used inside a create call). | ||
* Note that this is just a cast for the type system, this is, it won't actually convert an instance to a snapshot, | ||
* but just fool typescript into thinking so. | ||
* | ||
@@ -401,13 +404,40 @@ * @example | ||
* innerModel: ModelA | ||
* }) | ||
* | ||
* const a = ModelA.create({ n: 5 }); | ||
* // this will allow the compiler to use a model as if it were a snapshot | ||
* const b = ModelB.create({ innerModel: castToSnapshot(a)}) | ||
* | ||
* @export | ||
* @param snapshotOrInstance Snapshot or instance | ||
* @returns The same object casted as an input (creation) snapshot | ||
*/ | ||
export declare function castToSnapshot<I>(snapshotOrInstance: I): Extract<I, IAnyStateTreeNode> extends never ? I : ExtractNodeC<I>; | ||
/** | ||
* Casts a node instance type to a reference snapshot type so it can be assigned to a refernence snapshot (e.g. to be used inside a create call). | ||
* Note that this is just a cast for the type system, this is, it won't actually convert an instance to a refererence snapshot, | ||
* but just fool typescript into thinking so. | ||
* | ||
* @example | ||
* const ModelA = types.model({ | ||
* id: types.identifier, | ||
* n: types.number | ||
* }).actions(self => ({ | ||
* someAction() { | ||
* // this will allow the compiler to assign an snapshot to the property | ||
* self.innerModel = cast({ a: 5 }) | ||
* setN(aNumber: number) { | ||
* self.n = aNumber | ||
* } | ||
* })) | ||
* | ||
* const ModelB = types.model({ | ||
* refA: types.reference(ModelA) | ||
* }) | ||
* | ||
* const a = ModelA.create({ id: 'someId', n: 5 }); | ||
* // this will allow the compiler to use a model as if it were a reference snapshot | ||
* const b = ModelB.create({ refA: castToReference(a)}) | ||
* | ||
* @export | ||
* @param {CastedType<T>} snapshotOrInstance | ||
* @returns {T} | ||
* @param snapshotOrInstance Instance | ||
* @returns The same object casted as an reference snapshot (string or number) | ||
*/ | ||
export declare function cast<T = never, C = CastedType<T>>(snapshotOrInstance: C): T; | ||
export declare function castToReferenceSnapshot<I>(instance: I): Extract<I, IAnyStateTreeNode> extends never ? I : string | number; |
@@ -5,2 +5,6 @@ export interface IStateTreeNode<C = any, S = any> { | ||
} | ||
declare type Omit<T, K> = Pick<T, Exclude<keyof T, K>>; | ||
export declare type RedefineIStateTreeNode<T, STN extends IAnyStateTreeNode> = T extends IAnyStateTreeNode ? Omit<T, "!!types"> & STN : T; | ||
export declare type ExtractNodeC<T> = T extends IStateTreeNode<infer C, any> ? C : never; | ||
export declare type ExtractNodeS<T> = T extends IStateTreeNode<any, infer S> ? S : never; | ||
export interface IAnyStateTreeNode extends IStateTreeNode<any, any> { | ||
@@ -18,1 +22,2 @@ } | ||
export declare function isStateTreeNode<C = any, S = any>(value: any): value is IStateTreeNode<C, S>; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { IContext, IValidationResult, IStateTreeNode, ModelPrimitive } from "../../internal"; | ||
import { IContext, IValidationResult, IStateTreeNode, ModelPrimitive, IAnyStateTreeNode } from "../../internal"; | ||
export interface IType<C, S, T> { | ||
@@ -17,11 +17,4 @@ name: string; | ||
export declare type Primitives = ModelPrimitive | null | undefined; | ||
export declare type TAndInterface<T, I> = (Exclude<T, Primitives> & I) | Extract<T, Primitives>; | ||
export interface IComplexType<C, S, T> extends IType<C, S, T> { | ||
readonly "!!complexType": undefined; | ||
create(snapshot?: C, environment?: any): TAndInterface<T, { | ||
toJSON?(): S; | ||
} & IStateTreeNode<C, S>>; | ||
export interface IAnyComplexType extends IType<any, any, IAnyStateTreeNode> { | ||
} | ||
export interface IAnyComplexType extends IComplexType<any, any, any> { | ||
} | ||
export declare type ExtractC<T extends IAnyType> = T extends IType<infer C, any, any> ? C : never; | ||
@@ -31,3 +24,2 @@ export declare type ExtractS<T extends IAnyType> = T extends IType<any, infer S, any> ? S : never; | ||
export declare type ExtractCST<IT extends IAnyType> = IT extends IType<infer C, infer S, infer T> ? C | S | T : never; | ||
export declare type ExtractIStateTreeNode<C, S, T> = T extends ModelPrimitive ? T : TAndInterface<T, IStateTreeNode<C, S>>; | ||
export declare type Instance<T> = T extends IStateTreeNode ? T : T extends IType<any, any, infer TT> ? TT : T; | ||
@@ -34,0 +26,0 @@ export declare type SnapshotIn<T> = T extends IStateTreeNode<infer STNC, any> ? STNC : T extends IType<infer TC, any, any> ? TC : T; |
@@ -29,3 +29,3 @@ import "./internal"; | ||
}; | ||
import { IModelType, IAnyModelType, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ISimpleType, IComplexType, IAnyComplexType, IReferenceType, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IMiddlewareHandler, IMiddlewareEventType, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, _CustomCSProcessor, _CustomOrOther, _CustomJoin, _NotCustomized, flow, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, setLivelynessChecking, LivelynessMode, ModelSnapshotType, ModelCreationType, ModelSnapshotType2, ModelCreationType2, ModelInstanceType, ModelInstanceTypeProps, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, OptionalProperty, ModelActions, ModelUnion, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, IMaybeIComplexType, IMaybeIType, IOptionalIComplexType, IOptionalIType, OptionalDefaultValueOrFunction, getMembers, getPropertyMembers, CastedType, cast, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType, ExtractIStateTreeNode } from "./internal"; | ||
export { IModelType, IAnyModelType, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ISimpleType, IComplexType, IAnyComplexType, IReferenceType, _CustomCSProcessor, _CustomOrOther, _CustomJoin, _NotCustomized, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IMiddlewareHandler, IMiddlewareEventType, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, flow, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, setLivelynessChecking, LivelynessMode, ModelSnapshotType, ModelCreationType, ModelSnapshotType2, ModelCreationType2, ModelInstanceType, ModelInstanceTypeProps, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, OptionalProperty, ModelActions, ModelUnion, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, IMaybeIComplexType, IMaybeIType, IOptionalIComplexType, IOptionalIType, OptionalDefaultValueOrFunction, getMembers, getPropertyMembers, CastedType, cast, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType, ExtractIStateTreeNode }; | ||
import { IModelType, IAnyModelType, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ISimpleType, IAnyComplexType, IReferenceType, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IMiddlewareHandler, IMiddlewareEventType, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, _CustomCSProcessor, _CustomOrOther, _CustomJoin, _NotCustomized, flow, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, setLivelynessChecking, LivelynessMode, ModelSnapshotType, ModelCreationType, ModelSnapshotType2, ModelCreationType2, ModelInstanceType, ModelInstanceTypeProps, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, OptionalProperty, ModelActions, ITypeUnion, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, IMaybeIType, IMaybe, IMaybeNull, IOptionalIType, OptionalDefaultValueOrFunction, getMembers, getPropertyMembers, ExtractNodeC, ExtractNodeS, cast, castToSnapshot, castToReferenceSnapshot, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType } from "./internal"; | ||
export { IModelType, IAnyModelType, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ISimpleType, IAnyComplexType, IReferenceType, _CustomCSProcessor, _CustomOrOther, _CustomJoin, _NotCustomized, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IMiddlewareHandler, IMiddlewareEventType, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, flow, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, setLivelynessChecking, LivelynessMode, ModelSnapshotType, ModelCreationType, ModelSnapshotType2, ModelCreationType2, ModelInstanceType, ModelInstanceTypeProps, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, OptionalProperty, ModelActions, ITypeUnion, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, IMaybeIType, IMaybe, IMaybeNull, IOptionalIType, OptionalDefaultValueOrFunction, getMembers, getPropertyMembers, ExtractNodeC, ExtractNodeS, cast, castToSnapshot, castToReferenceSnapshot, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType }; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("mobx")):"function"==typeof define&&define.amd?define(["exports","mobx"],e):e(t.mobxStateTree={},t.mobx)}(this,function(t,l){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function a(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function n(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(a=(o<3?i(a):3<o?i(e,n,a):i(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}function u(t){return Z(t).type}function i(t,e){return Z(t).onPatch(e)}function s(t,e){Z(t).applyPatches(st(e))}function p(t,e){return Z(t).applySnapshot(e)}function c(t){return Z(t).root.storedValue}function h(t,e){var n=q(Z(t),e,!1);if(void 0!==n)try{return n.value}catch(t){return}}function f(t,e){var n=Z(t);n.getChildren().forEach(function(t){Y(t.storedValue)&&f(t.storedValue,e)}),e(n.storedValue)}function e(t){var e;return{name:(e=Y(t)?u(t):t).name,properties:o({},e.properties)}}var d=function(){function t(t,e,n,r,i){this.parent=null,this.subpath="",this.state=U.INITIALIZING,this._environment=void 0,this._initialSnapshot=i,this.type=t,this.parent=e,this.subpath=n;var o=!0;try{this.storedValue=t.createNewInstance(this,{},i),this.state=U.CREATED,o=!1}finally{o&&(this.state=U.DEAD)}}return Object.defineProperty(t.prototype,"path",{get:function(){return this.parent?this.parent.path+"/"+bt(this.subpath):""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.parent?this.parent.root:rt("This scalar node is not part of a tree")},enumerable:!0,configurable:!0}),t.prototype.setParent=function(t,e){if(void 0===e&&(e=null),this.parent!==t||this.subpath!==e)if(this.parent&&!t)this.die();else{var n=null===e?"":e;this.subpath!==n&&(this.subpath=n),t&&t!==this.parent&&(this.parent=t)}},Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return lt(this.getSnapshot())},enumerable:!0,configurable:!0}),t.prototype.getSnapshot=function(){return this.type.getSnapshot(this)},Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==U.DEAD},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.type.name+"@"+(this.path||"<root>")+(this.isAlive?"":"[dead]")},t.prototype.die=function(){this.state=U.DEAD},t}(),y=1,v="warn";var b,g,m={onError:function(t){throw t}},S=function(){function r(t,e,n,r,i){if(this.nodeId=++y,this.subpathAtom=l.createAtom("path"),this.subpath="",this.parent=null,this.state=U.INITIALIZING,this.isProtectionEnabled=!0,this.middlewares=null,this._autoUnbox=!0,this._environment=void 0,this._isRunningAction=!1,this._hasSnapshotReaction=!1,this._disposers=null,this._patchSubscribers=null,this._snapshotSubscribers=null,this._observableInstanceCreated=!1,this._cachedInitialSnapshot=null,this._environment=r,this._initialSnapshot=lt(i),this.type=t,this.parent=e,this.subpath=n,this.escapedSubpath=bt(this.subpath),this.identifierAttribute=t.identifierAttribute,e||(this.identifierCache=new W),this._childNodes=t.initializeChildNodes(this,this._initialSnapshot),this.identifier=null,this.unnormalizedIdentifier=null,this.identifierAttribute&&this._initialSnapshot){var o=this._initialSnapshot[this.identifierAttribute];if(void 0===o){var a=this._childNodes[this.identifierAttribute];a&&(o=a.value)}"string"!=typeof o&&"number"!=typeof o&&rt("Instance identifier '"+this.identifierAttribute+"' for type '"+this.type.name+"' must be a string or a number"),this.identifier=""+o,this.unnormalizedIdentifier=o}e?e.root.identifierCache.addNodeToCache(this):this.identifierCache.addNodeToCache(this)}return r.prototype.applyPatches=function(t){this._observableInstanceCreated||this._createObservableInstance(),this.applyPatches(t)},r.prototype.applySnapshot=function(t){this._observableInstanceCreated||this._createObservableInstance(),this.applySnapshot(t)},r.prototype._createObservableInstance=function(){var t=this.type;this.storedValue=t.createNewInstance(this,this._childNodes,this._initialSnapshot),this.preboot();var e,n,r=!0;this._observableInstanceCreated=!0;try{this._isRunningAction=!0,t.finalizeNewInstance(this,this.storedValue),this._isRunningAction=!1,this.fireHook("afterCreate"),this.state=U.CREATED,r=!1}finally{r&&(this.state=U.DEAD)}e=this,n="snapshot",l.getAtom(e,n).trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this.finalizeCreation(),this._childNodes=et},Object.defineProperty(r.prototype,"path",{get:function(){return this.subpathAtom.reportObserved(),this.parent?this.parent.path+"/"+this.escapedSubpath:""},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),r.prototype.setParent=function(t,e){if(void 0===e&&(e=null),this.parent!==t||this.subpath!==e)if(this.parent&&!t)this.die();else{var n=null===e?"":e;this.subpath!==n&&(this.subpath=n,this.escapedSubpath=bt(this.subpath),this.subpathAtom.reportChanged()),t&&t!==this.parent&&(t.root.identifierCache.mergeCache(this),this.parent=t,this.subpathAtom.reportChanged(),this.fireHook("afterAttach"))}},r.prototype.fireHook=function(t){var e=this,n=this.storedValue&&"object"==typeof this.storedValue&&this.storedValue[t];"function"==typeof n&&(l._allowStateChangesInsideComputed?l._allowStateChangesInsideComputed(function(){n.apply(e.storedValue)}):n.apply(this.storedValue))},r.prototype.createObservableInstanceIfNeeded=function(){this._observableInstanceCreated||this._createObservableInstance()},Object.defineProperty(r.prototype,"isObservableInstanceCreated",{get:function(){return this._observableInstanceCreated},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){if(this.createObservableInstanceIfNeeded(),this.isAlive)return this.type.getValue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"snapshot",{get:function(){if(this.isAlive)return lt(this.getSnapshot())},enumerable:!0,configurable:!0}),r.prototype.getSnapshot=function(){if(this.isAlive)return this._observableInstanceCreated?this._getActualSnapshot():this._getInitialSnapshot()},r.prototype._getActualSnapshot=function(){return this.type.getSnapshot(this)},r.prototype._getInitialSnapshot=function(){if(this.isAlive){if(!this._initialSnapshot)return this._initialSnapshot;if(this._cachedInitialSnapshot)return this._cachedInitialSnapshot;var t=this.type,e=this._childNodes,n=this._initialSnapshot;return this._cachedInitialSnapshot=t.processInitialSnapshot(e,n),this._cachedInitialSnapshot}},r.prototype.isRunningAction=function(){return!!this._isRunningAction||!this.isRoot&&this.parent.isRunningAction()},Object.defineProperty(r.prototype,"isAlive",{get:function(){return this.state!==U.DEAD},enumerable:!0,configurable:!0}),r.prototype.assertAlive=function(){if(!this.isAlive){var t="[mobx-state-tree][error] You are trying to read or write to an object that is no longer part of a state tree. (Object type was '"+this.type.name+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.";switch(v){case"error":throw new Error(t);case"warn":console.warn(t+' Use setLivelynessChecking("error") to simplify debugging this error.')}}},r.prototype.getChildNode=function(t){this.assertAlive(),this._autoUnbox=!1;try{return this._observableInstanceCreated?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}},r.prototype.getChildren=function(){this.assertAlive(),this._autoUnbox=!1;try{return this._observableInstanceCreated?this.type.getChildren(this):X(this._childNodes)}finally{this._autoUnbox=!0}},r.prototype.getChildType=function(t){return this.type.getChildType(t)},Object.defineProperty(r.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!0,configurable:!0}),r.prototype.assertWritable=function(){this.assertAlive(),!this.isRunningAction()&&this.isProtected&&rt("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")},r.prototype.removeChild=function(t){this.type.removeChild(this,t)},r.prototype.unbox=function(t){return t&&t.parent&&t.parent.assertAlive(),t&&t.parent&&t.parent._autoUnbox?t.value:t},r.prototype.toString=function(){var t=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+(this.path||"<root>")+t+(this.isAlive?"":"[dead]")},r.prototype.finalizeCreation=function(){if(this.state===U.CREATED){if(this.parent){if(this.parent.state!==U.FINALIZED)return;this.fireHook("afterAttach")}this.state=U.FINALIZED;for(var t=0,e=this.getChildren();t<e.length;t++){var n=e[t];n instanceof r&&n.finalizeCreation()}}},r.prototype.detach=function(){this.isAlive||rt("Error while detaching, node is not alive."),this.isRoot||(this.fireHook("beforeDetach"),this._environment=this.root._environment,this.state=U.DETACHING,this.identifierCache=this.root.identifierCache.splitCache(this),this.parent.removeChild(this.subpath),this.parent=null,this.subpath=this.escapedSubpath="",this.subpathAtom.reportChanged(),this.state=U.FINALIZED)},r.prototype.preboot=function(){var n=this;this.applyPatches=E(this.storedValue,"@APPLY_PATCHES",function(t){t.forEach(function(t){var e=St(t.path);Q(n,e.slice(0,-1)).applyPatchLocally(e[e.length-1],t)})}),this.applySnapshot=E(this.storedValue,"@APPLY_SNAPSHOT",function(t){if(t!==n.snapshot)return n.type.applySnapshot(n,t)}),ht(this.storedValue,"$treenode",this),ht(this.storedValue,"toJSON",G)},r.prototype.die=function(){this.state!==U.DETACHING&&Y(this.storedValue)&&(f(this.storedValue,function(t){var e=Z(t);e instanceof r&&e.aboutToDie()}),f(this.storedValue,function(t){var e=Z(t);e instanceof r&&e.finalizeDeath()}))},r.prototype.aboutToDie=function(){this._disposers&&(this._disposers.forEach(function(t){return t()}),this._disposers=null),this.fireHook("beforeDestroy")},r.prototype.finalizeDeath=function(){var t,e,n;this.root.identifierCache.notifyDied(this),e="snapshot",n=(t=this).snapshot,Object.defineProperty(t,e,{enumerable:!0,writable:!1,configurable:!0,value:n}),this._patchSubscribers&&(this._patchSubscribers=null),this._snapshotSubscribers&&(this._snapshotSubscribers=null),this.state=U.DEAD,this.subpath=this.escapedSubpath="",this.parent=null,this.subpathAtom.reportChanged()},r.prototype.onSnapshot=function(t){return this._addSnapshotReaction(),this._snapshotSubscribers||(this._snapshotSubscribers=[]),ft(this._snapshotSubscribers,t)},r.prototype.emitSnapshot=function(e){this._snapshotSubscribers&&this._snapshotSubscribers.forEach(function(t){return t(e)})},r.prototype.onPatch=function(t){return this._patchSubscribers||(this._patchSubscribers=[]),ft(this._patchSubscribers,t)},r.prototype.emitPatch=function(t,e){var n=this._patchSubscribers;if(n&&n.length){var r=function(t){"oldValue"in t||rt("Patches without `oldValue` field cannot be inversed");return[function(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}(t),function(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}(t)]}(function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var i=e[r];for(var o in i)t[o]=i[o]}return t}({},t,{path:e.path.substr(this.path.length)+"/"+t.path})),i=r[0],o=r[1];n.forEach(function(t){return t(i,o)})}this.parent&&this.parent.emitPatch(t,e)},r.prototype.addDisposer=function(t){this._disposers?this._disposers.unshift(t):this._disposers=[t]},r.prototype.removeMiddleware=function(e){this.middlewares&&(this.middlewares=this.middlewares.filter(function(t){return t.handler!==e}))},r.prototype.addMiddleWare=function(t,e){var n=this;return void 0===e&&(e=!0),this.middlewares?this.middlewares.push({handler:t,includeHooks:e}):this.middlewares=[{handler:t,includeHooks:e}],function(){n.removeMiddleware(t)}},r.prototype.applyPatchLocally=function(t,e){this.assertWritable(),this._observableInstanceCreated||this._createObservableInstance(),this.type.applyPatchLocally(this,t,e)},r.prototype._addSnapshotReaction=function(){var e=this;if(!this._hasSnapshotReaction){var t=l.reaction(function(){return e.snapshot},function(t){return e.emitSnapshot(t)},m);this.addDisposer(t),this._hasSnapshotReaction=!0}},n([l.action],r.prototype,"_createObservableInstance",null),n([l.computed],r.prototype,"snapshot",null),n([l.action],r.prototype,"detach",null),n([l.action],r.prototype,"die",null),r}();(g=b||(b={}))[g.String=1]="String",g[g.Number=2]="Number",g[g.Boolean=4]="Boolean",g[g.Date=8]="Date",g[g.Literal=16]="Literal",g[g.Array=32]="Array",g[g.Map=64]="Map",g[g.Object=128]="Object",g[g.Frozen=256]="Frozen",g[g.Optional=512]="Optional",g[g.Reference=1024]="Reference",g[g.Identifier=2048]="Identifier",g[g.Late=4096]="Late",g[g.Refinement=8192]="Refinement",g[g.Union=16384]="Union",g[g.Null=32768]="Null",g[g.Undefined=65536]="Undefined",g[g.Integer=131072]="Integer";var w=function(){function t(t){this["!!complexType"]=void 0,this.isType=!0,this.name=t}return t.prototype.create=function(t,e){return void 0===t&&(t=this.getDefaultSnapshot()),this.instantiate(null,"",e,t).value},t.prototype.initializeChildNodes=function(t,e){return et},t.prototype.createNewInstance=function(t,e,n){return n},t.prototype.finalizeNewInstance=function(t,e){},t.prototype.processInitialSnapshot=function(t,e){return e},t.prototype.isAssignableFrom=function(t){return t===this},t.prototype.validate=function(t,e){return Y(t)?u(t)===this||this.isAssignableFrom(u(t))?z():k(e,t):this.isValidSnapshot(t,e)},t.prototype.is=function(t){return 0===this.validate(t,[{path:"",type:this}]).length},t.prototype.reconcile=function(t,e){if(t.snapshot===e)return t;if(Y(e)&&Z(e)===t)return t;if(t.type===this&&pt(e)&&!Y(e)&&(!t.identifierAttribute||t.identifier===""+e[t.identifierAttribute]))return t.applySnapshot(e),t;var n=t.parent,r=t.subpath;if(t.die(),Y(e)&&this.isAssignableFrom(u(e))){var i=Z(e);return i.setParent(n,r),i}return this.instantiate(n,r,t._environment,e)},Object.defineProperty(t.prototype,"Type",{get:function(){return rt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SnapshotType",{get:function(){return rt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CreationType",{get:function(){return rt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!0,configurable:!0}),n([l.action],t.prototype,"create",null),t}(),A=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.getDefaultSnapshot=function(){},t.prototype.applySnapshot=function(t,e){rt("Immutable types do not support applying snapshots")},t.prototype.applyPatchLocally=function(t,e,n){rt("Immutable types do not support applying patches")},t.prototype.getChildren=function(t){return tt},t.prototype.getChildNode=function(t,e){return rt("No child '"+e+"' available in type: "+this.name)},t.prototype.getChildType=function(t){return rt("No child '"+t+"' available in type: "+this.name)},t.prototype.reconcile=function(t,e){if(t.type===this&&t.storedValue===e)return t;var n=this.instantiate(t.parent,t.subpath,t._environment,e);return t.die(),n},t.prototype.removeChild=function(t,e){return rt("No child '"+e+"' available in type: "+this.name)},t}(w);function P(t){return"object"==typeof t&&t&&!0===t.isType}var I=new Map;function _(t){return{$MST_UNSERIALIZABLE:!0,type:t}}function V(e,t){l.runInAction(function(){st(t).forEach(function(t){return function(t,e){var n=h(t,e.path||"");if(!n)return rt("Invalid action path: "+(e.path||""));var r=Z(n);if("@APPLY_PATCHES"===e.name)return s.call(null,n,e.args[0]);if("@APPLY_SNAPSHOT"===e.name)return p.call(null,n,e.args[0]);"function"!=typeof n[e.name]&&rt("Action '"+e.name+"' does not exist in '"+r.path+"'");return n[e.name].apply(n,e.args?e.args.map(function(t){return(e=t)&&"object"==typeof e&&"$MST_DATE"in e?new Date(e.$MST_DATE):e;var e}):[])}(e,t)})})}function C(o,a,s){return void 0===s&&(s=!1),D(o,function(n,t){if("action"!==n.type||n.id!==n.rootId)return t(n);var e=Z(n.context),r={name:n.name,path:K(Z(o),e),args:n.args.map(function(t,e){return function(t,e,n,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if(ct(r))return r;if(Y(r))return _("[MSTNode: "+u(r).name+"]");if("function"==typeof r)return _("[function]");if("object"==typeof r&&!ut(r)&&!at(r))return _("[object "+(r&&r.constructor&&r.constructor.name||"Complex Object")+"]");try{return JSON.stringify(r),r}catch(t){return _(""+t)}}(0,n.name,0,t)})};if(s){var i=t(n);return a(r),i}return a(r),t(n)})}var T=1,N=null;function O(){return T++}function j(t,e){var n=Z(t.context),r=n._isRunningAction,i=N;"action"===t.type&&n.assertAlive(),n._isRunningAction=!0,N=t;try{return function(t,e,s){var u=function(t,e,n){var r=n.$mst_middleware||tt,i=t;for(;i;)i.middlewares&&(r=r.concat(i.middlewares)),i=i.parent;return r}(t,0,s);if(!u.length)return l.action(s).apply(null,e.args);var p=0,c=null;return function n(t){var e=u[p++];var r=e&&e.handler;function i(t,e){c=e?e(n(t)||c):n(t)}function o(t){c=t}var a=function(){return r(t,i,o),c};return r&&e.includeHooks?a():r&&!e.includeHooks?Ot[t.name]?n(t):a():l.action(s).apply(null,t.args)}(e)}(n,t,e)}finally{N=i,n._isRunningAction=r}}function E(e,n,r){var t=function(){var t=O();return j({type:"action",name:n,id:t,args:dt(arguments),context:e,tree:c(e),rootId:N?N.rootId:t,parentId:N?N.id:0,allParentIds:N?N.allParentIds.concat([N.id]):[]},r)};return t._isMSTAction=!0,t}function D(t,e,n){return void 0===n&&(n=!0),Z(t).addMiddleWare(e,n)}function x(t){return"function"==typeof t?"<function"+(t.name?" "+t.name:"")+">":Y(t)?"<"+t+">":"`"+function(t){try{return JSON.stringify(t)}catch(t){return"<Unserializable: "+t+">"}}(t)+"`"}function R(t){var e=t.value,n=t.context[t.context.length-1].type,r=t.context.map(function(t){return t.path}).filter(function(t){return 0<t.length}).join("/"),i=0<r.length?'at path "/'+r+'" ':"",o=Y(e)?"value of type "+Z(e).type.name+":":ct(e)?"value":"snapshot",a=n&&Y(e)&&n.is(Z(e).snapshot);return""+i+o+" "+x(e)+" is not assignable "+(n?"to type: `"+n.name+"`":"")+(t.message?" ("+t.message+")":"")+(n?Zt(n)||ct(e)?".":", expected an instance of `"+n.name+"` or a snapshot like `"+n.describe()+"` instead."+(a?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function M(t,e,n){return t.concat([{path:e,type:n}])}function z(){return tt}function k(t,e,n){return[{context:t,value:e,message:n}]}function L(t){return t.reduce(function(t,e){return t.concat(e)},[])}function F(t,e){var n,r=t.validate(e,[{path:"",type:t}]);0<r.length&&rt("Error while converting "+((n=x(e)).length<280?n:n.substring(0,272)+"......"+n.substring(n.length-8))+" to `"+t.name+"`:\n\n "+r.map(R).join("\n "))}var U,H,$=0,W=function(){function e(){this.cacheId=$++,this.cache=l.observable.map(),this.lastCacheModificationPerId=l.observable.map()}return e.prototype.updateLastCacheModificationPerId=function(t){var e=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,void 0===e?1:e+1)},e.prototype.getLastCacheModificationPerId=function(t){var e=this.lastCacheModificationPerId.get(t)||0;return this.cacheId+"-"+e},e.prototype.addNodeToCache=function(t,e){if(void 0===e&&(e=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,l.observable.array([],nt));var r=this.cache.get(n);-1!==r.indexOf(t)&&rt("Already registered"),r.push(t),e&&this.updateLastCacheModificationPerId(n)}},e.prototype.mergeCache=function(t){var e=this;l.values(t.identifierCache.cache).forEach(function(t){return t.forEach(function(t){e.addNodeToCache(t)})})},e.prototype.notifyDied=function(t){if(t.identifierAttribute){var e=t.identifier,n=this.cache.get(e);n&&(n.remove(t),n.length||this.cache.delete(e),this.updateLastCacheModificationPerId(t.identifier))}},e.prototype.splitCache=function(t){var o=this,a=new e,s=t.path;return l.entries(this.cache).forEach(function(t){for(var e=t[0],n=t[1],r=!1,i=n.length-1;0<=i;i--)0===n[i].path.indexOf(s)&&(a.addNodeToCache(n[i],!1),n.splice(i,1),r=!0);r&&o.updateLastCacheModificationPerId(e)}),a},e.prototype.resolve=function(e,t){var n=this.cache.get(""+t);if(!n)return null;var r=n.filter(function(t){return e.isAssignableFrom(t.type)});switch(r.length){case 0:return null;case 1:var i=r[0];if(i){for(var o=[],a=i.parent;a&&!a.isObservableInstanceCreated;)o.unshift(a),a=a.parent;for(var s=0,u=o;s<u.length;s++){u[s].createObservableInstanceIfNeeded()}}return i;default:return rt("Cannot resolve a reference to type '"+e.name+"' with id: '"+t+"' unambigously, there are multiple candidates: "+r.map(function(t){return t.path}).join(", "))}},e}();function J(t,e,n,r,i){var o,a=(o=i)&&o.$treenode||null;if(a){if(a.isRoot)return a.setParent(e,n),a;rt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+(e?e.path:"")+"/"+n+"', but it lives already at '"+a.path+"'")}return new(t.shouldAttachNode?S:d)(t,e,n,r,i)}function Y(t){return!(!t||!t.$treenode)}function Z(t){return Y(t)?t.$treenode:rt("Value "+t+" is no MST Node")}function G(){return Z(this).snapshot}(H=U||(U={}))[H.INITIALIZING=0]="INITIALIZING",H[H.CREATED=1]="CREATED",H[H.FINALIZED=2]="FINALIZED",H[H.DETACHING=3]="DETACHING",H[H.DEAD=4]="DEAD";var B=function(t){return".."};function K(t,e){t.root!==e.root&&rt("Cannot calculate relative path: objects '"+t+"' and '"+e+"' are not part of the same object tree");for(var n=St(t.path),r=St(e.path),i=0;i<n.length&&n[i]===r[i];i++);return n.slice(i).map(B).join("/")+mt(r.slice(i))}function q(t,e,n){return void 0===n&&(n=!0),Q(t,St(e),n)}function Q(t,e,n){void 0===n&&(n=!0);for(var r=t,i=0;i<e.length;i++){var o=e[i];if(""!==o){if(".."===o){if(r=r.parent)continue}else{if("."===o||""===o)continue;if(r){if(r instanceof d)try{var a=r.value;Y(a)&&(r=Z(a))}catch(t){if(!n)return;throw t}if(r instanceof S)if(r.getChildType(o)&&(r=r.getChildNode(o)))continue}}return n?rt("Could not resolve '"+o+"' in path '"+(mt(e.slice(0,i))||"/")+"' while resolving '"+mt(e)+"'"):void 0}r=r.root}return r}function X(n){if(!n)return tt;var t=Object.keys(n);if(!t.length)return tt;var r=new Array(t.length);return t.forEach(function(t,e){r[e]=n[t]}),r}var tt=Object.freeze([]),et=Object.freeze({}),nt="string"==typeof l.$mobx?{deep:!1}:{deep:!1,proxy:!1};function rt(t){throw void 0===t&&(t="Illegal state"),new Error("[mobx-state-tree] "+t)}function it(t){return t}Object.freeze(nt);var ot=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function at(t){return!(!Array.isArray(t)&&!l.isObservableArray(t))}function st(t){return t?at(t)?t:[t]:tt}function ut(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function pt(t){return!(null===t||"object"!=typeof t||t instanceof Date||t instanceof RegExp)}function ct(t){return null==t||("string"==typeof t||"number"==typeof t||"boolean"==typeof t||t instanceof Date)}function lt(t){return t}function ht(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function ft(r,i){return r.push(i),function(){var t,e,n;e=i,-1!==(n=(t=r).indexOf(e))&&t.splice(n,1)}}function dt(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t[n];return e}var yt=function(t,e){};function vt(t){return l=t.name,h=t,f=function(){var s=O(),u=N||rt("Not running an action!"),p=arguments;function c(t,e,n){t.$mst_middleware=f.$mst_middleware,j({name:l,type:e,id:s,args:[n],tree:u.tree,context:u.context,parentId:u.id,allParentIds:u.allParentIds.concat([u.id]),rootId:u.rootId},t)}return new Promise(function(e,n){var r,t=function(){r=h.apply(null,arguments),i(void 0)};function i(t){var e;try{c(function(t){e=r.next(t)},"flow_resume",t)}catch(e){return void setImmediate(function(){c(function(t){n(e)},"flow_throw",e)})}a(e)}function o(t){var e;try{c(function(t){e=r.throw(t)},"flow_resume_error",t)}catch(e){return void setImmediate(function(){c(function(t){n(e)},"flow_throw",e)})}a(e)}function a(t){if(!t.done)return t.value&&"function"==typeof t.value.then||rt("Only promises can be yielded to `async`, got: "+t),t.value.then(i,o);setImmediate(function(){c(function(t){e(t)},"flow_return",t.value)})}t.$mst_middleware=f.$mst_middleware,j({name:l,type:"flow_spawn",id:s,args:dt(p),tree:u.tree,context:u.context,parentId:u.id,allParentIds:u.allParentIds.concat([u.id]),rootId:u.rootId},t)})};var l,h,f}function bt(t){return!0==("number"==typeof t)?""+t:t.replace(/~/g,"~1").replace(/\//g,"~0")}function gt(t){return t.replace(/~0/g,"/").replace(/~1/g,"~")}function mt(t){return 0===t.length?"":"/"+t.map(bt).join("/")}function St(t){var e=t.split("/").map(gt);return""===e[0]?e.slice(1):e}yt.ids={};var wt,At,Pt="Map.put can only be used to store complex values that have an identifier type attribute";(At=wt||(wt={}))[At.UNKNOWN=0]="UNKNOWN",At[At.YES=1]="YES",At[At.NO=2]="NO";var It=function(n){function t(t){return n.call(this,t,l.observable.ref.enhancer)||this}return a(t,n),t.prototype.get=function(t){return n.prototype.get.call(this,""+t)},t.prototype.has=function(t){return n.prototype.has.call(this,""+t)},t.prototype.delete=function(t){return n.prototype.delete.call(this,""+t)},t.prototype.set=function(t,e){return n.prototype.set.call(this,""+t,e)},t.prototype.put=function(t){if(t||rt("Map.put cannot be used to set empty values"),Y(t)){var e=Z(t),n=e.identifier;return this.set(n,e.value),e.value}if(pt(t)){n=void 0;var r=Z(this).type;return r.identifierMode===wt.NO?rt(Pt):r.identifierMode===wt.YES?(n=""+t[r.mapIdentifierAttribute],this.set(n,t),this.get(n)):rt(Pt)}return rt("Map.put can only be used to store complex values")},t}(l.ObservableMap),_t=function(r){function t(t,e){var n=r.call(this,t)||this;return n.shouldAttachNode=!0,n.identifierMode=wt.UNKNOWN,n.mapIdentifierAttribute=void 0,n.flags=b.Map,n.subType=e,n._determineIdentifierMode(),n}return a(t,r),t.prototype.instantiate=function(t,e,n,r){return this.identifierMode===wt.UNKNOWN&&this._determineIdentifierMode(),J(this,t,e,n,r)},t.prototype._determineIdentifierMode=function(){var t=[];if(function t(e,n){if(e instanceof zt)n.push(e);else if(e instanceof Xt){if(!t(e.type,n))return!1}else if(e instanceof qt){for(var r=0;r<e.types.length;r++)if(!t(e.types[r],n))return!1}else if(e instanceof re){var i=e.getSubType(!1);if(!i)return!1;t(i,n)}return!0}(this.subType,t)){var e=void 0;t.forEach(function(t){t.identifierAttribute&&(e&&e!==t.identifierAttribute&&rt("The objects in a map should all have the same identifier attribute, expected '"+e+"', but child of type '"+t.name+"' declared attribute '"+t.identifierAttribute+"' as identifier"),e=t.identifierAttribute)}),e?(this.identifierMode=wt.YES,this.mapIdentifierAttribute=e):this.identifierMode=wt.NO}},t.prototype.initializeChildNodes=function(e,n){void 0===n&&(n={});var r=e.type.subType,i=e._environment,o={};return Object.keys(n).forEach(function(t){o[t]=r.instantiate(e,t,i,n[t])}),o},t.prototype.createNewInstance=function(t,e,n){return new It(e)},t.prototype.finalizeNewInstance=function(t,e){l._interceptReads(e,t.unbox),l.intercept(e,this.willChange),l.observe(e,this.didChange)},t.prototype.describe=function(){return"Map<string, "+this.subType.describe()+">"},t.prototype.getChildren=function(t){return l.values(t.storedValue)},t.prototype.getChildNode=function(t,e){var n=t.storedValue.get(""+e);return n||rt("Not a child "+e),n},t.prototype.willChange=function(t){var e=Z(t.object),n=t.name;e.assertWritable();var r=e.type,i=r.subType;switch(t.type){case"update":var o=t.newValue;if(o===t.object.get(n))return null;t.newValue=i.reconcile(e.getChildNode(n),t.newValue),r.processIdentifier(n,t.newValue);break;case"add":t.newValue,t.newValue=i.instantiate(e,n,void 0,t.newValue),r.processIdentifier(n,t.newValue)}return t},t.prototype.processIdentifier=function(t,e){if(this.identifierMode===wt.YES&&e instanceof S){var n=e.identifier;n!==t&&rt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+n+"', but expected: '"+t+"'")}},t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){var e={};return t.getChildren().forEach(function(t){e[t.subpath]=t.snapshot}),e},t.prototype.processInitialSnapshot=function(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t].getSnapshot()}),n},t.prototype.didChange=function(t){var e=Z(t.object);switch(t.type){case"update":return void e.emitPatch({op:"replace",path:bt(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},e);case"add":return void e.emitPatch({op:"add",path:bt(t.name),value:t.newValue.snapshot,oldValue:void 0},e);case"delete":var n=t.oldValue.snapshot;return t.oldValue.die(),void e.emitPatch({op:"remove",path:bt(t.name),oldValue:n},e)}},t.prototype.applyPatchLocally=function(t,e,n){var r=t.storedValue;switch(n.op){case"add":case"replace":r.set(e,n.value);break;case"remove":r.delete(e)}},t.prototype.applySnapshot=function(t,e){var n=t.storedValue,r={};for(var i in Array.from(n.keys()).forEach(function(t){r[t]=!1}),e)n.set(i,e[i]),r[""+i]=!0;Object.keys(r).forEach(function(t){!1===r[t]&&n.delete(t)})},t.prototype.getChildType=function(t){return this.subType},t.prototype.isValidSnapshot=function(e,n){var r=this;return ut(e)?L(Object.keys(e).map(function(t){return r.subType.validate(e[t],M(n,t,r.subType))})):k(n,e,"Value is not a plain object")},t.prototype.getDefaultSnapshot=function(){return et},t.prototype.removeChild=function(t,e){t.storedValue.delete(e)},n([l.action],t.prototype,"applySnapshot",null),t}(w);var Vt=function(r){function t(t,e){var n=r.call(this,t)||this;return n.shouldAttachNode=!0,n.flags=b.Array,n.subType=e,n}return a(t,r),t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,r)},t.prototype.initializeChildNodes=function(r,t){void 0===t&&(t=[]);var i=r.type.subType,o=r._environment,a={};return t.forEach(function(t,e){var n=""+e;a[n]=i.instantiate(r,n,o,t)}),a},t.prototype.createNewInstance=function(t,e,n){return l.observable.array(X(e),nt)},t.prototype.finalizeNewInstance=function(t,e){l._getAdministration(e).dehancer=t.unbox,l.intercept(e,this.willChange),l.observe(e,this.didChange)},t.prototype.describe=function(){return this.subType.describe()+"[]"},t.prototype.getChildren=function(t){return t.storedValue.slice()},t.prototype.getChildNode=function(t,e){var n=parseInt(e,10);return n<t.storedValue.length?t.storedValue[n]:rt("Not a child: "+e)},t.prototype.willChange=function(t){var e=Z(t.object);e.assertWritable();var n=e.type.subType,r=e.getChildren(),i=null;switch(t.type){case"update":if(t.newValue===t.object[t.index])return null;if(!(i=Ct(e,n,[r[t.index]],[t.newValue],[t.index])))return null;t.newValue=i[0];break;case"splice":var o=t.index,a=t.removedCount,s=t.added;if(!(i=Ct(e,n,r.slice(o,o+a),s,s.map(function(t,e){return o+e}))))return null;t.added=i;for(var u=o+a;u<r.length;u++)r[u].setParent(e,""+(u+s.length-a))}return t},t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){return t.getChildren().map(function(t){return t.snapshot})},t.prototype.processInitialSnapshot=function(e,t){var n=[];return Object.keys(e).forEach(function(t){n.push(e[t].getSnapshot())}),n},t.prototype.didChange=function(t){var e=Z(t.object);switch(t.type){case"update":return void e.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},e);case"splice":for(var n=t.removedCount-1;0<=n;n--)e.emitPatch({op:"remove",path:""+(t.index+n),oldValue:t.removed[n].snapshot},e);for(n=0;n<t.addedCount;n++)e.emitPatch({op:"add",path:""+(t.index+n),value:e.getChildNode(""+(t.index+n)).snapshot,oldValue:void 0},e);return}},t.prototype.applyPatchLocally=function(t,e,n){var r=t.storedValue,i="-"===e?r.length:parseInt(e);switch(n.op){case"replace":r[i]=n.value;break;case"add":r.splice(i,0,n.value);break;case"remove":r.splice(i,1)}},t.prototype.applySnapshot=function(t,e){t.storedValue.replace(e)},t.prototype.getChildType=function(t){return this.subType},t.prototype.isValidSnapshot=function(t,n){var r=this;return at(t)?L(t.map(function(t,e){return r.subType.validate(t,M(n,""+e,r.subType))})):k(n,t,"Value is not an array")},t.prototype.getDefaultSnapshot=function(){return tt},t.prototype.removeChild=function(t,e){t.storedValue.splice(parseInt(e,10),1)},n([l.action],t.prototype,"applySnapshot",null),t}(w);function Ct(t,e,n,r,i){for(var o,a,s,u=!1,p=void 0,c=!0,l=0;u=l<=r.length-1,o=n[l],a=u?r[l]:void 0,((s=a)instanceof d||s instanceof S)&&(a=a.storedValue),o||u;l++)if(u)if(o)if(Nt(o,a))n[l]=Tt(e,t,""+i[l],a,o);else{p=void 0;for(var h=l;h<n.length;h++)if(Nt(n[h],a)){p=n.splice(h,1)[0];break}n.splice(l,0,Tt(e,t,""+i[l],a,p)),c=!1}else Y(a)&&Z(a).parent===t&&rt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+t.path+"/"+i[l]+"', but it lives already at '"+Z(a).path+"'"),n.splice(l,0,Tt(e,t,""+i[l],a)),c=!1;else o.die(),n.splice(l,1),l--,c=!1;return c?null:n}function Tt(t,e,n,r,i){var o;if(Y(r)&&((o=Z(r)).assertAlive(),null!==o.parent&&o.parent===e))return o.setParent(e,n),i&&i!==o&&i.die(),o;return i?((o=t.reconcile(i,r)).setParent(e,n),o):t.instantiate(e,n,e._environment,r)}function Nt(t,e){return Y(e)?Z(e)===t:t.snapshot===e||!!(t instanceof S&&null!==t.identifier&&t.identifierAttribute&&ut(e)&&t.identifier===""+e[t.identifierAttribute]&&t.type.is(e))}var Ot,jt,Et="preProcessSnapshot",Dt="postProcessSnapshot";function xt(){return Z(this).toString()}(jt=Ot||(Ot={})).afterCreate="afterCreate",jt.afterAttach="afterAttach",jt.beforeDetach="beforeDetach",jt.beforeDestroy="beforeDestroy";var Rt={name:"AnonymousModel",properties:{},initializers:tt};function Mt(t){return Object.keys(t).reduce(function(t,e){var n,r,i;if(e in Ot)return rt("Hook '"+e+"' was defined as property. Hooks should be defined as part of the actions");var o=Object.getOwnPropertyDescriptor(t,e);"get"in o&&rt("Getters are not supported as properties. Please use views instead");var a=o.value;if(null==a)rt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");else{if(ct(a))return Object.assign({},t,((n={})[e]=te(function(t){switch(typeof t){case"string":return Ft;case"number":return Ut;case"boolean":return $t;case"object":if(t instanceof Date)return Yt}return rt("Cannot determine primitive type from value "+t)}(a),a),n));if(a instanceof _t)return Object.assign({},t,((r={})[e]=te(a,{}),r));if(a instanceof Vt)return Object.assign({},t,((i={})[e]=te(a,[]),i));if(P(a))return t;rt("Invalid type definition for property '"+e+"', cannot infer a type from a value like '"+a+"' ("+typeof a+")")}},t)}var zt=function(r){function e(t){var e=r.call(this,t.name||Rt.name)||this;e.flags=b.Object,e.shouldAttachNode=!0;var n=t.name||Rt.name;return/^\w[\w\d_]*$/.test(n)||rt("Typename should be a valid identifier: "+n),Object.assign(e,Rt,t),e.properties=Mt(e.properties),lt(e.properties),e.propertyNames=Object.keys(e.properties),e.identifierAttribute=e._getIdentifierAttribute(),e}return a(e,r),e.prototype._getIdentifierAttribute=function(){var n=void 0;return this.forAllProps(function(t,e){e.flags&b.Identifier&&(n&&rt("Cannot define property '"+t+"' as object identifier, property '"+n+"' is already defined as identifier property"),n=t)}),n},e.prototype.cloneAndEnhance=function(t){return new e({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})},e.prototype.actions=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateActions(t,e(t)),t}]})},e.prototype.instantiateActions=function(s,u){ut(u)||rt("actions initializer should return a plain object containing actions"),Object.keys(u).forEach(function(t){t===Et&&rt("Cannot define action '"+Et+"', it should be defined using 'type.preProcessSnapshot(fn)' instead"),t===Dt&&rt("Cannot define action '"+Dt+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var e=u[t],n=s[t];if(t in Ot&&n){var r=e;e=function(){n.apply(null,arguments),r.apply(null,arguments)}}var i=e.$mst_middleware,o=e.bind(u);o.$mst_middleware=i;var a=E(s,t,o);u[t]=a,ht(s,t,a)})},e.prototype.named=function(t){return this.cloneAndEnhance({name:t})},e.prototype.props=function(t){return this.cloneAndEnhance({properties:t})},e.prototype.volatile=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateVolatileState(t,e(t)),t}]})},e.prototype.instantiateVolatileState=function(t,e){ut(e)||rt("volatile state initializer should return a plain object containing state"),l.set(t,e)},e.prototype.extend=function(s){var u=this;return this.cloneAndEnhance({initializers:[function(t){var e=s(t),n=e.actions,r=e.views,i=e.state,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}(e,["actions","views","state"]);for(var a in o)rt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+a+"'");return i&&u.instantiateVolatileState(t,i),r&&u.instantiateViews(t,r),n&&u.instantiateActions(t,n),t}]})},e.prototype.views=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateViews(t,e(t)),t}]})},e.prototype.instantiateViews=function(i,o){ut(o)||rt("views initializer should return a plain object containing views"),Object.keys(o).forEach(function(t){var e=Object.getOwnPropertyDescriptor(o,t),n=e.value;if("get"in e)if(l.isComputedProp(i,t)){var r=l._getAdministration(i,t);r.derivation=e.get,r.scope=i,e.set&&(r.setter=l.action(r.name+"-setter",e.set))}else l.computed(i,t,e,!0);else"function"==typeof n?ht(i,t,n):rt("A view member should either be a function or getter based property")})},e.prototype.preProcessSnapshot=function(e){var n=this.preProcessor;return n?this.cloneAndEnhance({preProcessor:function(t){return n(e(t))}}):this.cloneAndEnhance({preProcessor:e})},e.prototype.postProcessSnapshot=function(e){var n=this.postProcessor;return n?this.cloneAndEnhance({postProcessor:function(t){return e(n(t))}}):this.cloneAndEnhance({postProcessor:e})},e.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,Y(r)?r:this.applySnapshotPreProcessor(r))},e.prototype.initializeChildNodes=function(n,r){void 0===r&&(r={});var t=n.type,i={};return t.forAllProps(function(t,e){i[t]=e.instantiate(n,t,n._environment,r[t])}),i},e.prototype.createNewInstance=function(t,e,n){return l.observable.object(e,et,nt)},e.prototype.finalizeNewInstance=function(e,n){ht(n,"toString",xt),this.forAllProps(function(t){l._interceptReads(n,t,e.unbox)}),this.initializers.reduce(function(t,e){return e(t)},n),l.intercept(n,this.willChange),l.observe(n,this.didChange)},e.prototype.willChange=function(t){var e=Z(t.object);e.assertWritable();var n=e.type.properties[t.name];return n&&(t.newValue,t.newValue=n.reconcile(e.getChildNode(t.name),t.newValue)),t},e.prototype.didChange=function(t){var e=Z(t.object);if(e.type.properties[t.name]){var n=t.oldValue?t.oldValue.snapshot:void 0;e.emitPatch({op:"replace",path:bt(t.name),value:t.newValue.snapshot,oldValue:n},e)}},e.prototype.getChildren=function(n){var r=this,i=[];return this.forAllProps(function(t,e){i.push(r.getChildNode(n,t))}),i},e.prototype.getChildNode=function(t,e){if(!(e in this.properties))return rt("Not a value property: "+e);var n=l._getAdministration(t.storedValue,e).value;return n||rt("Node not available for property "+e)},e.prototype.getValue=function(t){return t.storedValue},e.prototype.getSnapshot=function(n,t){var r=this;void 0===t&&(t=!0);var i={};return this.forAllProps(function(t,e){l.getAtom(n.storedValue,t).reportObserved(),i[t]=r.getChildNode(n,t).snapshot}),t?this.applySnapshotPostProcessor(i):i},e.prototype.processInitialSnapshot=function(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t].getSnapshot()}),this.applySnapshotPostProcessor(this.applyOptionalValuesToSnapshot(n))},e.prototype.applyPatchLocally=function(t,e,n){"replace"!==n.op&&"add"!==n.op&&rt("object does not support operation "+n.op),t.storedValue[e]=n.value},e.prototype.applySnapshot=function(n,t){var r=this.applySnapshotPreProcessor(t);this.forAllProps(function(t,e){n.storedValue[t]=r[t]})},e.prototype.applySnapshotPreProcessor=function(t){var e=this.preProcessor;return e?e.call(null,t):t},e.prototype.applyOptionalValuesToSnapshot=function(r){return r&&(r=Object.assign({},r),this.forAllProps(function(t,e){if(!(t in r)){var n=kt(e);n&&(r[t]=n.getDefaultValueSnapshot())}})),r},e.prototype.applySnapshotPostProcessor=function(t){var e=this.postProcessor;return e?e.call(null,t):t},e.prototype.getChildType=function(t){return this.properties[t]},e.prototype.isValidSnapshot=function(t,e){var n=this,r=this.applySnapshotPreProcessor(t);return ut(r)?L(this.propertyNames.map(function(t){return n.properties[t].validate(r[t],M(e,t,n.properties[t]))})):k(e,r,"Value is not a plain object")},e.prototype.forAllProps=function(e){var n=this;this.propertyNames.forEach(function(t){return e(t,n.properties[t])})},e.prototype.describe=function(){var e=this;return"{ "+this.propertyNames.map(function(t){return t+": "+e.properties[t].describe()}).join("; ")+" }"},e.prototype.getDefaultSnapshot=function(){return et},e.prototype.removeChild=function(t,e){t.storedValue[e]=void 0},n([l.action],e.prototype,"applySnapshot",null),e}(w);function kt(t){if(t)return t.flags&b.Union&&t.types?t.types.find(kt):t.flags&b.Late&&t.getSubType&&t.getSubType(!1)?kt(t.subType):t.flags&b.Optional?t:void 0}var Lt=function(o){function t(t,e,n,r){void 0===r&&(r=it);var i=o.call(this,t)||this;return i.shouldAttachNode=!1,i.flags=e,i.checker=n,i.initializer=r,i}return a(t,o),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,r)},t.prototype.createNewInstance=function(t,e,n){return this.initializer(n)},t.prototype.isValidSnapshot=function(t,e){return ct(t)&&this.checker(t)?z():k(e,t,"Value is not a "+("Date"===this.name?"Date or a unix milliseconds timestamp":this.name))},t}(A),Ft=new Lt("string",b.String,function(t){return"string"==typeof t}),Ut=new Lt("number",b.Number,function(t){return"number"==typeof t}),Ht=new Lt("integer",b.Integer,function(t){return ot(t)}),$t=new Lt("boolean",b.Boolean,function(t){return"boolean"==typeof t}),Wt=new Lt("null",b.Null,function(t){return null===t}),Jt=new Lt("undefined",b.Undefined,function(t){return void 0===t}),Yt=new Lt("Date",b.Date,function(t){return"number"==typeof t||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});function Zt(t){return P(t)&&0<(t.flags&(b.String|b.Number|b.Integer|b.Boolean|b.Date))}Yt.getSnapshot=function(t){return t.storedValue.getTime()};var Gt=function(n){function t(t){var e=n.call(this,JSON.stringify(t))||this;return e.shouldAttachNode=!1,e.flags=b.Literal,e.value=t,e}return a(t,n),t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,r)},t.prototype.describe=function(){return JSON.stringify(this.value)},t.prototype.isValidSnapshot=function(t,e){return ct(t)&&t===this.value?z():k(e,t,"Value is not a literal "+JSON.stringify(this.value))},t}(A);function Bt(t){return new Gt(t)}var Kt=function(o){function t(t,e,n,r){var i=o.call(this,t)||this;return i.type=e,i.predicate=n,i.message=r,i}return a(t,o),Object.defineProperty(t.prototype,"flags",{get:function(){return this.type.flags|b.Refinement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.type.shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(t,e,n,r){return this.type.instantiate(t,e,n,r)},t.prototype.isAssignableFrom=function(t){return this.type.isAssignableFrom(t)},t.prototype.isValidSnapshot=function(t,e){var n=this.type.validate(t,e);if(0<n.length)return n;var r=Y(t)?Z(t).snapshot:t;return this.predicate(r)?z():k(e,t,this.message(t))},t}(A);var qt=function(i){function t(t,e,n){var r=i.call(this,t)||this;return r.eager=!0,n=o({eager:!0,dispatcher:void 0},n),r.dispatcher=n.dispatcher,n.eager||(r.eager=!1),r.types=e,r}return a(t,i),Object.defineProperty(t.prototype,"flags",{get:function(){var e=b.Union;return this.types.forEach(function(t){e|=t.flags}),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.types.some(function(t){return t.shouldAttachNode})},enumerable:!0,configurable:!0}),t.prototype.isAssignableFrom=function(e){return this.types.some(function(t){return t.isAssignableFrom(e)})},t.prototype.describe=function(){return"("+this.types.map(function(t){return t.describe()}).join(" | ")+")"},t.prototype.instantiate=function(t,e,n,r){var i=this.determineType(r,void 0);return i?i.instantiate(t,e,n,r):rt("No matching type for union "+this.describe())},t.prototype.reconcile=function(t,e){var n=this.determineType(e,t.type);return n?n.reconcile(t,e):rt("No matching type for union "+this.describe())},t.prototype.determineType=function(e,n){return this.dispatcher?this.dispatcher(e):n?n.is(e)?n:this.types.filter(function(t){return t!==n}).find(function(t){return t.is(e)}):this.types.find(function(t){return t.is(e)})},t.prototype.isValidSnapshot=function(t,e){if(this.dispatcher)return this.dispatcher(t).validate(t,e);for(var n=[],r=0,i=0;i<this.types.length;i++){var o=this.types[i].validate(t,e);if(0===o.length){if(this.eager)return z();r++}else n.push(o)}return 1===r?z():k(e,t,"No type is applicable for the union").concat(L(n))},t}(A);function Qt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=P(t)?void 0:t,i=P(t)?[t].concat(e):e,o="("+i.map(function(t){return t.name}).join(" | ")+")";return new qt(o,i,r)}var Xt=function(r){function t(t,e){var n=r.call(this,t.name)||this;return n.type=t,n.defaultValue=e,n}return a(t,r),Object.defineProperty(t.prototype,"flags",{get:function(){return this.type.flags|b.Optional},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.type.shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.describe=function(){return this.type.describe()+"?"},t.prototype.instantiate=function(t,e,n,r){if(void 0!==r)return this.type.instantiate(t,e,n,r);var i=this.getDefaultInstanceOrSnapshot();return this.type.instantiate(t,e,n,i)},t.prototype.reconcile=function(t,e){return this.type.reconcile(t,this.type.is(e)&&void 0!==e?e:this.getDefaultInstanceOrSnapshot())},t.prototype.getDefaultInstanceOrSnapshot=function(){var t="function"==typeof this.defaultValue?this.defaultValue():this.defaultValue;return this.defaultValue,t},t.prototype.getDefaultValueSnapshot=function(){var t=this.getDefaultInstanceOrSnapshot();return Y(t)?Z(t).snapshot:t},t.prototype.isValidSnapshot=function(t,e){return void 0===t?z():this.type.validate(t,e)},t.prototype.isAssignableFrom=function(t){return this.type.isAssignableFrom(t)},t}(A);function te(t,e){return"function"!=typeof e&&Y(e)&&rt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead"),new Xt(t,e)}var ee=te(Jt,void 0),ne=te(Wt,null);var re=function(r){function t(t,e){var n=r.call(this,t)||this;return n._subType=null,n.definition=e,n}return a(t,r),Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|b.Late},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.getSubType(!0).shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.getSubType=function(t){if(null===this._subType){var e=void 0;try{e=this.definition()}catch(t){if(!(t instanceof ReferenceError))throw t;e=void 0}if(t&&void 0===e&&rt("Late type seems to be used too early, the definition (still) returns undefined"),e)return this._subType=e}return this._subType},t.prototype.instantiate=function(t,e,n,r){return this.getSubType(!0).instantiate(t,e,n,r)},t.prototype.reconcile=function(t,e){return this.getSubType(!0).reconcile(t,e)},t.prototype.describe=function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"},t.prototype.isValidSnapshot=function(t,e){var n=this.getSubType(!1);return n?n.validate(t,e):z()},t.prototype.isAssignableFrom=function(t){var e=this.getSubType(!1);return!!e&&e.isAssignableFrom(t)},t}(A);var ie=function(n){function t(t){var e=n.call(this,t?"frozen("+t.name+")":"frozen")||this;return e.subType=t,e.shouldAttachNode=!1,e.flags=b.Frozen,e}return a(t,n),t.prototype.describe=function(){return"<any immutable value>"},t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,r)},t.prototype.isValidSnapshot=function(t,e){return"function"==typeof t?k(e,t,"Value is not serializable and cannot be frozen"):this.subType?this.subType.validate(t,e):z()},t}(A),oe=new ie;var ae=function(){function t(t,e){if(this.targetType=e,"string"==typeof t||"number"==typeof t)this.identifier=t;else{if(!Y(t))return rt("Can only store references to tree nodes or identifiers, got: '"+t+"'");var n=Z(t);if(!n.identifierAttribute)return rt("Can only store references with a defined identifier attribute.");var r=n.unnormalizedIdentifier;if(null==r)return rt("Can only store references to tree nodes with a defined identifier.");this.identifier=r}}return t.prototype.updateResolvedReference=function(){var t=""+this.identifier,e=this.node,n=e.root.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==n){var r=this.targetType,i=e.root.identifierCache.resolve(r,t);i||rt("Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+e.path+")"),this.resolvedReference={node:i,lastCacheModification:n}}},Object.defineProperty(t.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(),this.resolvedReference.node.value},enumerable:!0,configurable:!0}),t}(),se=function(n){function t(t){var e=n.call(this,"reference("+t.name+")")||this;return e.targetType=t,e.shouldAttachNode=!1,e.flags=b.Reference,e}return a(t,n),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(t){return this.targetType.isAssignableFrom(t)},t.prototype.isValidSnapshot=function(t,e){return"string"==typeof t||"number"==typeof t?z():k(e,t,"Value is not a valid identifier, which is a string or a number")},t}(A),ue=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.getValue=function(t){if(t.isAlive)return t.storedValue.resolvedValue},t.prototype.getSnapshot=function(t){return t.storedValue.identifier},t.prototype.instantiate=function(t,e,n,r){var i,o=J(this,t,e,n,i=new ae(r,this.targetType));return i.node=o},t.prototype.reconcile=function(t,e){if(t.type===this){var n=Y(e),r=t.storedValue;if(!n&&r.identifier===e)return t;if(n&&r.resolvedValue===e)return t}var i=this.instantiate(t.parent,t.subpath,t._environment,e);return t.die(),i},t}(se),pe=function(r){function t(t,e){var n=r.call(this,t)||this;return n.options=e,n}return a(t,r),t.prototype.getValue=function(t){if(t.isAlive)return this.options.get(t.storedValue,t.parent?t.parent.storedValue:null)},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,Y(r)?this.options.set(r,t?t.storedValue:null):r)},t.prototype.reconcile=function(t,e){var n=Y(e)?this.options.set(e,t?t.storedValue:null):e;if(t.type===this&&t.storedValue===n)return t;var r=this.instantiate(t.parent,t.subpath,t._environment,n);return t.die(),r},t}(se);var ce=function(e){function t(){var t=e.call(this,"identifier")||this;return t.shouldAttachNode=!1,t.flags=b.Identifier,t}return a(t,e),t.prototype.instantiate=function(t,e,n,r){return t&&t.type instanceof zt||rt("Identifier types can only be instantiated as direct child of a model type"),J(this,t,e,n,r)},t.prototype.reconcile=function(t,e){return t.storedValue!==e?rt("Tried to change identifier from '"+t.storedValue+"' to '"+e+"'. Changing identifiers is not allowed."):t},t.prototype.describe=function(){return"identifier"},t.prototype.isValidSnapshot=function(t,e){return"string"!=typeof t?k(e,t,"Value is not a valid identifier, expected a string"):z()},t}(A),le=function(i){function t(){var t=i.call(this)||this;return t.name="identifierNumber",t}return a(t,i),t.prototype.instantiate=function(t,e,n,r){return i.prototype.instantiate.call(this,t,e,n,r)},t.prototype.isValidSnapshot=function(t,e){return"number"==typeof t?z():k(e,t,"Value is not a valid identifierNumber, expected a number")},t.prototype.reconcile=function(t,e){return i.prototype.reconcile.call(this,t,e)},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.describe=function(){return"identifierNumber"},t}(ce),he=new ce,fe=new le;var de=function(n){function t(t){var e=n.call(this,t.name)||this;return e.options=t,e.flags=b.Reference,e.shouldAttachNode=!1,e}return a(t,n),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(t){return t===this},t.prototype.isValidSnapshot=function(t,e){if(this.options.isTargetType(t))return z();var n=this.options.getValidationMessage(t);return n?k(e,t,"Invalid value for type '"+this.name+"': "+n):z()},t.prototype.getValue=function(t){if(t.isAlive)return t.storedValue},t.prototype.getSnapshot=function(t){return this.options.toSnapshot(t.storedValue)},t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,this.options.isTargetType(r)?r:this.options.fromSnapshot(r))},t.prototype.reconcile=function(t,e){var n=!this.options.isTargetType(e);if(t.type===this&&(n?e===t.snapshot:e===t.storedValue))return t;var r=n?this.options.fromSnapshot(e):e,i=this.instantiate(t.parent,t.subpath,t._environment,r);return t.die(),i},t}(A),ye={enumeration:function(t,e){var n=Qt.apply(void 0,("string"==typeof t?e:t).map(function(t){return Bt(""+t)}));return"string"==typeof t&&(n.name=t),n},model:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():"AnonymousModel",r=t.shift()||{};return new zt({name:n,properties:r})},compose:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():"AnonymousModel";return t.reduce(function(e,n){return e.cloneAndEnhance({name:e.name+"_"+n.name,properties:n.properties,initializers:n.initializers,preProcessor:function(t){return n.applySnapshotPreProcessor(e.applySnapshotPreProcessor(t))},postProcessor:function(t){return n.applySnapshotPostProcessor(e.applySnapshotPostProcessor(t))}})}).named(n)},custom:function(t){return new de(t)},reference:function(t,e){return e?new pe(t,e):new ue(t)},union:Qt,optional:te,literal:Bt,maybe:function(t){return Qt(t,ee)},maybeNull:function(t){return Qt(t,ne)},refinement:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():P(t[0])?t[0].name:null,r=t[0],i=t[1],o=t[2]?t[2]:function(t){return"Value does not respect the refinement predicate"};return new Kt(n,r,i,o)},string:Ft,boolean:$t,number:Ut,integer:Ht,Date:Yt,map:function(t){return new _t("map<string, "+t.name+">",t)},array:function(t){return new Vt(t.name+"[]",t)},frozen:function(t){return 0===arguments.length?oe:P(t)?new ie(t):te(oe,t)},identifier:he,identifierNumber:fe,late:function(t,e){var n="string"==typeof t?t:"late("+t.toString()+")";return new re(n,"string"==typeof t?e:t)},undefined:Jt,null:Wt};t.types=ye,t.typecheck=F,t.escapeJsonPath=bt,t.unescapeJsonPath=gt,t.joinJsonPath=mt,t.splitJsonPath=St,t.decorate=function(t,e){var n={handler:t,includeHooks:!0};return e.$mst_middleware&&e.$mst_middleware.push(n),e.$mst_middleware=[n],e},t.addMiddleware=D,t.process=function(t){return yt("process","`process()` has been renamed to `flow()`. See https://github.com/mobxjs/mobx-state-tree/issues/399 for more information. Note that the middleware event types starting with `process` now start with `flow`."),vt(t)},t.isStateTreeNode=Y,t.flow=vt,t.applyAction=V,t.onAction=C,t.recordActions=function(t){var e={actions:[],stop:function(){return n()},replay:function(t){V(t,e.actions)}},n=C(t,e.actions.push.bind(e.actions));return e},t.createActionTrackingMiddleware=function(a){return function(e,t,n){switch(e.type){case"action":if(a.filter&&!0!==a.filter(e))return t(e);var r=a.onStart(e);a.onResume(e,r),I.set(e.id,{call:e,context:r,async:!1});try{var i=t(e);return a.onSuspend(e,r),!1===I.get(e.id).async&&(I.delete(e.id),a.onSuccess(e,r,i)),i}catch(t){throw I.delete(e.id),a.onFail(e,r,t),t}case"flow_spawn":return(o=I.get(e.rootId)).async=!0,t(e);case"flow_resume":case"flow_resume_error":var o=I.get(e.rootId);a.onResume(e,o.context);try{return t(e)}finally{a.onSuspend(e,o.context)}case"flow_throw":return o=I.get(e.rootId),I.delete(e.id),a.onFail(e,o.context,e.args[0]),t(e);case"flow_return":return o=I.get(e.rootId),I.delete(e.id),a.onSuccess(e,o.context,e.args[0]),t(e)}}},t.setLivelynessChecking=function(t){v=t},t.getType=u,t.getChildType=function(t,e){return Z(t).getChildType(e)},t.onPatch=i,t.onSnapshot=function(t,e){return Z(t).onSnapshot(e)},t.applyPatch=s,t.recordPatches=function(e){var t=null;function n(){t||(t=i(e,function(t,e){r.rawPatches.push([t,e])}))}var r={rawPatches:[],get patches(){return this.rawPatches.map(function(t){return t[0]})},get inversePatches(){return this.rawPatches.map(function(t){return t[0],t[1]})},stop:function(){t&&t(),t=null},resume:n,replay:function(t){s(t||e,r.patches)},undo:function(t){s(t||e,r.inversePatches.slice().reverse())}};return n(),r},t.protect=function(t){var e=Z(t);e.isRoot||rt("`protect` can only be invoked on root nodes"),e.isProtectionEnabled=!0},t.unprotect=function(t){var e=Z(t);e.isRoot||rt("`unprotect` can only be invoked on root nodes"),e.isProtectionEnabled=!1},t.isProtected=function(t){return Z(t).isProtected},t.applySnapshot=p,t.getSnapshot=function(t,e){void 0===e&&(e=!0);var n=Z(t);return e?n.snapshot:lt(n.type.getSnapshot(n,!1))},t.hasParent=function(t,e){void 0===e&&(e=1);for(var n=Z(t).parent;n;){if(0==--e)return!0;n=n.parent}return!1},t.getParent=function(t,e){void 0===e&&(e=1);for(var n=e,r=Z(t).parent;r;){if(0==--n)return r.storedValue;r=r.parent}return rt("Failed to find the parent of "+Z(t)+" at depth "+e)},t.hasParentOfType=function(t,e){for(var n=Z(t).parent;n;){if(e.is(n.storedValue))return!0;n=n.parent}return!1},t.getParentOfType=function(t,e){for(var n=Z(t).parent;n;){if(e.is(n.storedValue))return n.storedValue;n=n.parent}return rt("Failed to find the parent of "+Z(t)+" of a given type")},t.getRoot=c,t.getPath=function(t){return Z(t).path},t.getPathParts=function(t){return St(Z(t).path)},t.isRoot=function(t){return Z(t).isRoot},t.resolvePath=function(t,e){var n=q(Z(t),e);return n?n.value:void 0},t.resolveIdentifier=function(t,e,n){var r=Z(e).root.identifierCache.resolve(t,""+n);return r?r.value:void 0},t.getIdentifier=function(t){return Z(t).identifier},t.tryResolve=h,t.getRelativePath=function(t,e){return K(Z(t),Z(e))},t.clone=function(t,e){void 0===e&&(e=!0);var n=Z(t);return n.type.create(n.snapshot,!0===e?n.root._environment:!1===e?void 0:e)},t.detach=function(t){return Z(t).detach(),t},t.destroy=function(t){var e=Z(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)},t.isAlive=function(t){return Z(t).isAlive},t.addDisposer=function(t,e){Z(t).addDisposer(e)},t.getEnv=function(t){var e=Z(t).root._environment;return e||et},t.walk=f,t.getMembers=function(n){var t=Z(n).type,r=o({},e(t),{actions:[],volatile:[],views:[]});return Object.getOwnPropertyNames(n).forEach(function(t){if(!(t in r.properties)){var e=Object.getOwnPropertyDescriptor(n,t);e.get?l.isComputedProp(n,t)?r.views.push(t):r.volatile.push(t):!0===e.value._isMSTAction?r.actions.push(t):l.isObservableProp(n,t)?r.volatile.push(t):r.views.push(t)}}),r},t.getPropertyMembers=e,t.cast=function(t){return t},t.isType=P,t.isArrayType=function(t){return P(t)&&0<(t.flags&b.Array)},t.isFrozenType=function(t){return P(t)&&0<(t.flags&b.Frozen)},t.isIdentifierType=function(t){return P(t)&&0<(t.flags&b.Identifier)},t.isLateType=function(t){return P(t)&&0<(t.flags&b.Late)},t.isLiteralType=function(t){return P(t)&&0<(t.flags&b.Literal)},t.isMapType=function(t){return P(t)&&0<(t.flags&b.Map)},t.isModelType=function(t){return P(t)&&0<(t.flags&b.Object)},t.isOptionalType=function(t){return P(t)&&0<(t.flags&b.Optional)},t.isPrimitiveType=Zt,t.isReferenceType=function(t){return 0<(t.flags&b.Reference)},t.isRefinementType=function(t){return 0<(t.flags&b.Refinement)},t.isUnionType=function(t){return 0<(t.flags&b.Union)},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("mobx")):"function"==typeof define&&define.amd?define(["exports","mobx"],e):e(t.mobxStateTree={},t.mobx)}(this,function(t,l){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function a(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function n(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(a=(o<3?i(a):3<o?i(e,n,a):i(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}function u(t){return Z(t).type}function i(t,e){return Z(t).onPatch(e)}function s(t,e){Z(t).applyPatches(st(e))}function p(t,e){return Z(t).applySnapshot(e)}function c(t){return Z(t).root.storedValue}function h(t,e){var n=q(Z(t),e,!1);if(void 0!==n)try{return n.value}catch(t){return}}function f(t,e){var n=Z(t);n.getChildren().forEach(function(t){Y(t.storedValue)&&f(t.storedValue,e)}),e(n.storedValue)}function e(t){var e;return{name:(e=Y(t)?u(t):t).name,properties:o({},e.properties)}}var d=function(){function t(t,e,n,r,i){this.parent=null,this.subpath="",this.state=U.INITIALIZING,this._environment=void 0,this._initialSnapshot=i,this.type=t,this.parent=e,this.subpath=n;var o=!0;try{this.storedValue=t.createNewInstance(this,{},i),this.state=U.CREATED,o=!1}finally{o&&(this.state=U.DEAD)}}return Object.defineProperty(t.prototype,"path",{get:function(){return this.parent?this.parent.path+"/"+bt(this.subpath):""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.parent?this.parent.root:rt("This scalar node is not part of a tree")},enumerable:!0,configurable:!0}),t.prototype.setParent=function(t,e){if(void 0===e&&(e=null),this.parent!==t||this.subpath!==e)if(this.parent&&!t)this.die();else{var n=null===e?"":e;this.subpath!==n&&(this.subpath=n),t&&t!==this.parent&&(this.parent=t)}},Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return lt(this.getSnapshot())},enumerable:!0,configurable:!0}),t.prototype.getSnapshot=function(){return this.type.getSnapshot(this)},Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==U.DEAD},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.type.name+"@"+(this.path||"<root>")+(this.isAlive?"":"[dead]")},t.prototype.die=function(){this.state=U.DEAD},t}(),y=1,v="warn";var b,g,m={onError:function(t){throw t}},S=function(){function r(t,e,n,r,i){if(this.nodeId=++y,this.subpathAtom=l.createAtom("path"),this.subpath="",this.parent=null,this.state=U.INITIALIZING,this.isProtectionEnabled=!0,this.middlewares=null,this._autoUnbox=!0,this._environment=void 0,this._isRunningAction=!1,this._hasSnapshotReaction=!1,this._disposers=null,this._patchSubscribers=null,this._snapshotSubscribers=null,this._observableInstanceCreated=!1,this._cachedInitialSnapshot=null,this._environment=r,this._initialSnapshot=lt(i),this.type=t,this.parent=e,this.subpath=n,this.escapedSubpath=bt(this.subpath),this.identifierAttribute=t.identifierAttribute,e||(this.identifierCache=new W),this._childNodes=t.initializeChildNodes(this,this._initialSnapshot),this.identifier=null,this.unnormalizedIdentifier=null,this.identifierAttribute&&this._initialSnapshot){var o=this._initialSnapshot[this.identifierAttribute];if(void 0===o){var a=this._childNodes[this.identifierAttribute];a&&(o=a.value)}"string"!=typeof o&&"number"!=typeof o&&rt("Instance identifier '"+this.identifierAttribute+"' for type '"+this.type.name+"' must be a string or a number"),this.identifier=""+o,this.unnormalizedIdentifier=o}e?e.root.identifierCache.addNodeToCache(this):this.identifierCache.addNodeToCache(this)}return r.prototype.applyPatches=function(t){this._observableInstanceCreated||this._createObservableInstance(),this.applyPatches(t)},r.prototype.applySnapshot=function(t){this._observableInstanceCreated||this._createObservableInstance(),this.applySnapshot(t)},r.prototype._createObservableInstance=function(){var t=this.type;this.storedValue=t.createNewInstance(this,this._childNodes,this._initialSnapshot),this.preboot();var e,n,r=!0;this._observableInstanceCreated=!0;try{this._isRunningAction=!0,t.finalizeNewInstance(this,this.storedValue),this._isRunningAction=!1,this.fireHook("afterCreate"),this.state=U.CREATED,r=!1}finally{r&&(this.state=U.DEAD)}e=this,n="snapshot",l.getAtom(e,n).trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this.finalizeCreation(),this._childNodes=et},Object.defineProperty(r.prototype,"path",{get:function(){return this.subpathAtom.reportObserved(),this.parent?this.parent.path+"/"+this.escapedSubpath:""},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),r.prototype.setParent=function(t,e){if(void 0===e&&(e=null),this.parent!==t||this.subpath!==e)if(this.parent&&!t)this.die();else{var n=null===e?"":e;this.subpath!==n&&(this.subpath=n,this.escapedSubpath=bt(this.subpath),this.subpathAtom.reportChanged()),t&&t!==this.parent&&(t.root.identifierCache.mergeCache(this),this.parent=t,this.subpathAtom.reportChanged(),this.fireHook("afterAttach"))}},r.prototype.fireHook=function(t){var e=this,n=this.storedValue&&"object"==typeof this.storedValue&&this.storedValue[t];"function"==typeof n&&(l._allowStateChangesInsideComputed?l._allowStateChangesInsideComputed(function(){n.apply(e.storedValue)}):n.apply(this.storedValue))},r.prototype.createObservableInstanceIfNeeded=function(){this._observableInstanceCreated||this._createObservableInstance()},Object.defineProperty(r.prototype,"isObservableInstanceCreated",{get:function(){return this._observableInstanceCreated},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){if(this.createObservableInstanceIfNeeded(),this.isAlive)return this.type.getValue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"snapshot",{get:function(){if(this.isAlive)return lt(this.getSnapshot())},enumerable:!0,configurable:!0}),r.prototype.getSnapshot=function(){if(this.isAlive)return this._observableInstanceCreated?this._getActualSnapshot():this._getInitialSnapshot()},r.prototype._getActualSnapshot=function(){return this.type.getSnapshot(this)},r.prototype._getInitialSnapshot=function(){if(this.isAlive){if(!this._initialSnapshot)return this._initialSnapshot;if(this._cachedInitialSnapshot)return this._cachedInitialSnapshot;var t=this.type,e=this._childNodes,n=this._initialSnapshot;return this._cachedInitialSnapshot=t.processInitialSnapshot(e,n),this._cachedInitialSnapshot}},r.prototype.isRunningAction=function(){return!!this._isRunningAction||!this.isRoot&&this.parent.isRunningAction()},Object.defineProperty(r.prototype,"isAlive",{get:function(){return this.state!==U.DEAD},enumerable:!0,configurable:!0}),r.prototype.assertAlive=function(){if(!this.isAlive){var t="[mobx-state-tree][error] You are trying to read or write to an object that is no longer part of a state tree. (Object type was '"+this.type.name+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.";switch(v){case"error":throw new Error(t);case"warn":console.warn(t+' Use setLivelynessChecking("error") to simplify debugging this error.')}}},r.prototype.getChildNode=function(t){this.assertAlive(),this._autoUnbox=!1;try{return this._observableInstanceCreated?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}},r.prototype.getChildren=function(){this.assertAlive(),this._autoUnbox=!1;try{return this._observableInstanceCreated?this.type.getChildren(this):X(this._childNodes)}finally{this._autoUnbox=!0}},r.prototype.getChildType=function(t){return this.type.getChildType(t)},Object.defineProperty(r.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!0,configurable:!0}),r.prototype.assertWritable=function(){this.assertAlive(),!this.isRunningAction()&&this.isProtected&&rt("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")},r.prototype.removeChild=function(t){this.type.removeChild(this,t)},r.prototype.unbox=function(t){return t&&t.parent&&t.parent.assertAlive(),t&&t.parent&&t.parent._autoUnbox?t.value:t},r.prototype.toString=function(){var t=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+(this.path||"<root>")+t+(this.isAlive?"":"[dead]")},r.prototype.finalizeCreation=function(){if(this.state===U.CREATED){if(this.parent){if(this.parent.state!==U.FINALIZED)return;this.fireHook("afterAttach")}this.state=U.FINALIZED;for(var t=0,e=this.getChildren();t<e.length;t++){var n=e[t];n instanceof r&&n.finalizeCreation()}}},r.prototype.detach=function(){this.isAlive||rt("Error while detaching, node is not alive."),this.isRoot||(this.fireHook("beforeDetach"),this._environment=this.root._environment,this.state=U.DETACHING,this.identifierCache=this.root.identifierCache.splitCache(this),this.parent.removeChild(this.subpath),this.parent=null,this.subpath=this.escapedSubpath="",this.subpathAtom.reportChanged(),this.state=U.FINALIZED)},r.prototype.preboot=function(){var n=this;this.applyPatches=E(this.storedValue,"@APPLY_PATCHES",function(t){t.forEach(function(t){var e=St(t.path);Q(n,e.slice(0,-1)).applyPatchLocally(e[e.length-1],t)})}),this.applySnapshot=E(this.storedValue,"@APPLY_SNAPSHOT",function(t){if(t!==n.snapshot)return n.type.applySnapshot(n,t)}),ht(this.storedValue,"$treenode",this),ht(this.storedValue,"toJSON",G)},r.prototype.die=function(){this.state!==U.DETACHING&&Y(this.storedValue)&&(f(this.storedValue,function(t){var e=Z(t);e instanceof r&&e.aboutToDie()}),f(this.storedValue,function(t){var e=Z(t);e instanceof r&&e.finalizeDeath()}))},r.prototype.aboutToDie=function(){this.fireHook("beforeDestroy"),this._disposers&&(this._disposers.forEach(function(t){return t()}),this._disposers=null)},r.prototype.finalizeDeath=function(){var t,e,n;this.root.identifierCache.notifyDied(this),e="snapshot",n=(t=this).snapshot,Object.defineProperty(t,e,{enumerable:!0,writable:!1,configurable:!0,value:n}),this._patchSubscribers&&(this._patchSubscribers=null),this._snapshotSubscribers&&(this._snapshotSubscribers=null),this.state=U.DEAD,this.subpath=this.escapedSubpath="",this.parent=null,this.subpathAtom.reportChanged()},r.prototype.onSnapshot=function(t){return this._addSnapshotReaction(),this._snapshotSubscribers||(this._snapshotSubscribers=[]),ft(this._snapshotSubscribers,t)},r.prototype.emitSnapshot=function(e){this._snapshotSubscribers&&this._snapshotSubscribers.forEach(function(t){return t(e)})},r.prototype.onPatch=function(t){return this._patchSubscribers||(this._patchSubscribers=[]),ft(this._patchSubscribers,t)},r.prototype.emitPatch=function(t,e){var n=this._patchSubscribers;if(n&&n.length){var r=function(t){"oldValue"in t||rt("Patches without `oldValue` field cannot be inversed");return[function(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}(t),function(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}(t)]}(function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var i=e[r];for(var o in i)t[o]=i[o]}return t}({},t,{path:e.path.substr(this.path.length)+"/"+t.path})),i=r[0],o=r[1];n.forEach(function(t){return t(i,o)})}this.parent&&this.parent.emitPatch(t,e)},r.prototype.hasDisposer=function(t){return!!this._disposers&&0<=this._disposers.indexOf(t)},r.prototype.addDisposer=function(t){this._disposers?this.hasDisposer(t)?rt("cannot add a disposer when it is already registered for execution"):this._disposers.unshift(t):this._disposers=[t]},r.prototype.removeDisposer=function(t){var e="cannot remove a disposer which was never registered for execution";if(!this._disposers)return rt(e);var n=this._disposers.indexOf(t);if(n<0)return rt(e);this._disposers.splice(n,1)},r.prototype.removeMiddleware=function(e){this.middlewares&&(this.middlewares=this.middlewares.filter(function(t){return t.handler!==e}))},r.prototype.addMiddleWare=function(t,e){var n=this;return void 0===e&&(e=!0),this.middlewares?this.middlewares.push({handler:t,includeHooks:e}):this.middlewares=[{handler:t,includeHooks:e}],function(){n.removeMiddleware(t)}},r.prototype.applyPatchLocally=function(t,e){this.assertWritable(),this._observableInstanceCreated||this._createObservableInstance(),this.type.applyPatchLocally(this,t,e)},r.prototype._addSnapshotReaction=function(){var e=this;if(!this._hasSnapshotReaction){var t=l.reaction(function(){return e.snapshot},function(t){return e.emitSnapshot(t)},m);this.addDisposer(t),this._hasSnapshotReaction=!0}},n([l.action],r.prototype,"_createObservableInstance",null),n([l.computed],r.prototype,"snapshot",null),n([l.action],r.prototype,"detach",null),n([l.action],r.prototype,"die",null),r}();(g=b||(b={}))[g.String=1]="String",g[g.Number=2]="Number",g[g.Boolean=4]="Boolean",g[g.Date=8]="Date",g[g.Literal=16]="Literal",g[g.Array=32]="Array",g[g.Map=64]="Map",g[g.Object=128]="Object",g[g.Frozen=256]="Frozen",g[g.Optional=512]="Optional",g[g.Reference=1024]="Reference",g[g.Identifier=2048]="Identifier",g[g.Late=4096]="Late",g[g.Refinement=8192]="Refinement",g[g.Union=16384]="Union",g[g.Null=32768]="Null",g[g.Undefined=65536]="Undefined",g[g.Integer=131072]="Integer";var w=function(){function t(t){this.isType=!0,this.name=t}return t.prototype.create=function(t,e){return void 0===t&&(t=this.getDefaultSnapshot()),this.instantiate(null,"",e,t).value},t.prototype.initializeChildNodes=function(t,e){return et},t.prototype.createNewInstance=function(t,e,n){return n},t.prototype.finalizeNewInstance=function(t,e){},t.prototype.processInitialSnapshot=function(t,e){return e},t.prototype.isAssignableFrom=function(t){return t===this},t.prototype.validate=function(t,e){return Y(t)?u(t)===this||this.isAssignableFrom(u(t))?z():k(e,t):this.isValidSnapshot(t,e)},t.prototype.is=function(t){return 0===this.validate(t,[{path:"",type:this}]).length},t.prototype.reconcile=function(t,e){if(t.snapshot===e)return t;if(Y(e)&&Z(e)===t)return t;if(t.type===this&&pt(e)&&!Y(e)&&(!t.identifierAttribute||t.identifier===""+e[t.identifierAttribute]))return t.applySnapshot(e),t;var n=t.parent,r=t.subpath;if(t.die(),Y(e)&&this.isAssignableFrom(u(e))){var i=Z(e);return i.setParent(n,r),i}return this.instantiate(n,r,t._environment,e)},Object.defineProperty(t.prototype,"Type",{get:function(){return rt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SnapshotType",{get:function(){return rt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CreationType",{get:function(){return rt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!0,configurable:!0}),n([l.action],t.prototype,"create",null),t}(),A=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.getDefaultSnapshot=function(){},t.prototype.applySnapshot=function(t,e){rt("Immutable types do not support applying snapshots")},t.prototype.applyPatchLocally=function(t,e,n){rt("Immutable types do not support applying patches")},t.prototype.getChildren=function(t){return tt},t.prototype.getChildNode=function(t,e){return rt("No child '"+e+"' available in type: "+this.name)},t.prototype.getChildType=function(t){return rt("No child '"+t+"' available in type: "+this.name)},t.prototype.reconcile=function(t,e){if(t.type===this&&t.storedValue===e)return t;var n=this.instantiate(t.parent,t.subpath,t._environment,e);return t.die(),n},t.prototype.removeChild=function(t,e){return rt("No child '"+e+"' available in type: "+this.name)},t}(w);function P(t){return"object"==typeof t&&t&&!0===t.isType}var I=new Map;function _(t){return{$MST_UNSERIALIZABLE:!0,type:t}}function V(e,t){l.runInAction(function(){st(t).forEach(function(t){return function(t,e){var n=h(t,e.path||"");if(!n)return rt("Invalid action path: "+(e.path||""));var r=Z(n);if("@APPLY_PATCHES"===e.name)return s.call(null,n,e.args[0]);if("@APPLY_SNAPSHOT"===e.name)return p.call(null,n,e.args[0]);"function"!=typeof n[e.name]&&rt("Action '"+e.name+"' does not exist in '"+r.path+"'");return n[e.name].apply(n,e.args?e.args.map(function(t){return(e=t)&&"object"==typeof e&&"$MST_DATE"in e?new Date(e.$MST_DATE):e;var e}):[])}(e,t)})})}function C(o,a,s){return void 0===s&&(s=!1),D(o,function(n,t){if("action"!==n.type||n.id!==n.rootId)return t(n);var e=Z(n.context),r={name:n.name,path:K(Z(o),e),args:n.args.map(function(t,e){return function(t,e,n,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if(ct(r))return r;if(Y(r))return _("[MSTNode: "+u(r).name+"]");if("function"==typeof r)return _("[function]");if("object"==typeof r&&!ut(r)&&!at(r))return _("[object "+(r&&r.constructor&&r.constructor.name||"Complex Object")+"]");try{return JSON.stringify(r),r}catch(t){return _(""+t)}}(0,n.name,0,t)})};if(s){var i=t(n);return a(r),i}return a(r),t(n)})}var T=1,N=null;function O(){return T++}function j(t,e){var n=Z(t.context),r=n._isRunningAction,i=N;"action"===t.type&&n.assertAlive(),n._isRunningAction=!0,N=t;try{return function(t,e,s){var u=function(t,e,n){var r=n.$mst_middleware||tt,i=t;for(;i;)i.middlewares&&(r=r.concat(i.middlewares)),i=i.parent;return r}(t,0,s);if(!u.length)return l.action(s).apply(null,e.args);var p=0,c=null;return function n(t){var e=u[p++];var r=e&&e.handler;function i(t,e){c=e?e(n(t)||c):n(t)}function o(t){c=t}var a=function(){return r(t,i,o),c};return r&&e.includeHooks?a():r&&!e.includeHooks?Ot[t.name]?n(t):a():l.action(s).apply(null,t.args)}(e)}(n,t,e)}finally{N=i,n._isRunningAction=r}}function E(e,n,r){var t=function(){var t=O();return j({type:"action",name:n,id:t,args:dt(arguments),context:e,tree:c(e),rootId:N?N.rootId:t,parentId:N?N.id:0,allParentIds:N?N.allParentIds.concat([N.id]):[]},r)};return t._isMSTAction=!0,t}function D(t,e,n){return void 0===n&&(n=!0),Z(t).addMiddleWare(e,n)}function x(t){return"function"==typeof t?"<function"+(t.name?" "+t.name:"")+">":Y(t)?"<"+t+">":"`"+function(t){try{return JSON.stringify(t)}catch(t){return"<Unserializable: "+t+">"}}(t)+"`"}function R(t){var e=t.value,n=t.context[t.context.length-1].type,r=t.context.map(function(t){return t.path}).filter(function(t){return 0<t.length}).join("/"),i=0<r.length?'at path "/'+r+'" ':"",o=Y(e)?"value of type "+Z(e).type.name+":":ct(e)?"value":"snapshot",a=n&&Y(e)&&n.is(Z(e).snapshot);return""+i+o+" "+x(e)+" is not assignable "+(n?"to type: `"+n.name+"`":"")+(t.message?" ("+t.message+")":"")+(n?Zt(n)||ct(e)?".":", expected an instance of `"+n.name+"` or a snapshot like `"+n.describe()+"` instead."+(a?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function M(t,e,n){return t.concat([{path:e,type:n}])}function z(){return tt}function k(t,e,n){return[{context:t,value:e,message:n}]}function L(t){return t.reduce(function(t,e){return t.concat(e)},[])}function F(t,e){var n,r=t.validate(e,[{path:"",type:t}]);0<r.length&&rt("Error while converting "+((n=x(e)).length<280?n:n.substring(0,272)+"......"+n.substring(n.length-8))+" to `"+t.name+"`:\n\n "+r.map(R).join("\n "))}var U,H,$=0,W=function(){function e(){this.cacheId=$++,this.cache=l.observable.map(),this.lastCacheModificationPerId=l.observable.map()}return e.prototype.updateLastCacheModificationPerId=function(t){var e=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,void 0===e?1:e+1)},e.prototype.getLastCacheModificationPerId=function(t){var e=this.lastCacheModificationPerId.get(t)||0;return this.cacheId+"-"+e},e.prototype.addNodeToCache=function(t,e){if(void 0===e&&(e=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,l.observable.array([],nt));var r=this.cache.get(n);-1!==r.indexOf(t)&&rt("Already registered"),r.push(t),e&&this.updateLastCacheModificationPerId(n)}},e.prototype.mergeCache=function(t){var e=this;l.values(t.identifierCache.cache).forEach(function(t){return t.forEach(function(t){e.addNodeToCache(t)})})},e.prototype.notifyDied=function(t){if(t.identifierAttribute){var e=t.identifier,n=this.cache.get(e);n&&(n.remove(t),n.length||this.cache.delete(e),this.updateLastCacheModificationPerId(t.identifier))}},e.prototype.splitCache=function(t){var o=this,a=new e,s=t.path;return l.entries(this.cache).forEach(function(t){for(var e=t[0],n=t[1],r=!1,i=n.length-1;0<=i;i--)0===n[i].path.indexOf(s)&&(a.addNodeToCache(n[i],!1),n.splice(i,1),r=!0);r&&o.updateLastCacheModificationPerId(e)}),a},e.prototype.resolve=function(e,t){var n=this.cache.get(""+t);if(!n)return null;var r=n.filter(function(t){return e.isAssignableFrom(t.type)});switch(r.length){case 0:return null;case 1:var i=r[0];if(i){for(var o=[],a=i.parent;a&&!a.isObservableInstanceCreated;)o.unshift(a),a=a.parent;for(var s=0,u=o;s<u.length;s++){u[s].createObservableInstanceIfNeeded()}}return i;default:return rt("Cannot resolve a reference to type '"+e.name+"' with id: '"+t+"' unambigously, there are multiple candidates: "+r.map(function(t){return t.path}).join(", "))}},e}();function J(t,e,n,r,i){var o,a=(o=i)&&o.$treenode||null;if(a){if(a.isRoot)return a.setParent(e,n),a;rt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+(e?e.path:"")+"/"+n+"', but it lives already at '"+a.path+"'")}return new(t.shouldAttachNode?S:d)(t,e,n,r,i)}function Y(t){return!(!t||!t.$treenode)}function Z(t){return Y(t)?t.$treenode:rt("Value "+t+" is no MST Node")}function G(){return Z(this).snapshot}(H=U||(U={}))[H.INITIALIZING=0]="INITIALIZING",H[H.CREATED=1]="CREATED",H[H.FINALIZED=2]="FINALIZED",H[H.DETACHING=3]="DETACHING",H[H.DEAD=4]="DEAD";var B=function(t){return".."};function K(t,e){t.root!==e.root&&rt("Cannot calculate relative path: objects '"+t+"' and '"+e+"' are not part of the same object tree");for(var n=St(t.path),r=St(e.path),i=0;i<n.length&&n[i]===r[i];i++);return n.slice(i).map(B).join("/")+mt(r.slice(i))}function q(t,e,n){return void 0===n&&(n=!0),Q(t,St(e),n)}function Q(t,e,n){void 0===n&&(n=!0);for(var r=t,i=0;i<e.length;i++){var o=e[i];if(""!==o){if(".."===o){if(r=r.parent)continue}else{if("."===o||""===o)continue;if(r){if(r instanceof d)try{var a=r.value;Y(a)&&(r=Z(a))}catch(t){if(!n)return;throw t}if(r instanceof S)if(r.getChildType(o)&&(r=r.getChildNode(o)))continue}}return n?rt("Could not resolve '"+o+"' in path '"+(mt(e.slice(0,i))||"/")+"' while resolving '"+mt(e)+"'"):void 0}r=r.root}return r}function X(n){if(!n)return tt;var t=Object.keys(n);if(!t.length)return tt;var r=new Array(t.length);return t.forEach(function(t,e){r[e]=n[t]}),r}var tt=Object.freeze([]),et=Object.freeze({}),nt="string"==typeof l.$mobx?{deep:!1}:{deep:!1,proxy:!1};function rt(t){throw void 0===t&&(t="Illegal state"),new Error("[mobx-state-tree] "+t)}function it(t){return t}Object.freeze(nt);var ot=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function at(t){return!(!Array.isArray(t)&&!l.isObservableArray(t))}function st(t){return t?at(t)?t:[t]:tt}function ut(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function pt(t){return!(null===t||"object"!=typeof t||t instanceof Date||t instanceof RegExp)}function ct(t){return null==t||("string"==typeof t||"number"==typeof t||"boolean"==typeof t||t instanceof Date)}function lt(t){return t}function ht(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function ft(r,i){return r.push(i),function(){var t,e,n;e=i,-1!==(n=(t=r).indexOf(e))&&t.splice(n,1)}}function dt(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t[n];return e}var yt=function(t,e){};function vt(t){return l=t.name,h=t,f=function(){var s=O(),u=N||rt("Not running an action!"),p=arguments;function c(t,e,n){t.$mst_middleware=f.$mst_middleware,j({name:l,type:e,id:s,args:[n],tree:u.tree,context:u.context,parentId:u.id,allParentIds:u.allParentIds.concat([u.id]),rootId:u.rootId},t)}return new Promise(function(e,n){var r,t=function(){r=h.apply(null,arguments),i(void 0)};function i(t){var e;try{c(function(t){e=r.next(t)},"flow_resume",t)}catch(e){return void setImmediate(function(){c(function(t){n(e)},"flow_throw",e)})}a(e)}function o(t){var e;try{c(function(t){e=r.throw(t)},"flow_resume_error",t)}catch(e){return void setImmediate(function(){c(function(t){n(e)},"flow_throw",e)})}a(e)}function a(t){if(!t.done)return t.value&&"function"==typeof t.value.then||rt("Only promises can be yielded to `async`, got: "+t),t.value.then(i,o);setImmediate(function(){c(function(t){e(t)},"flow_return",t.value)})}t.$mst_middleware=f.$mst_middleware,j({name:l,type:"flow_spawn",id:s,args:dt(p),tree:u.tree,context:u.context,parentId:u.id,allParentIds:u.allParentIds.concat([u.id]),rootId:u.rootId},t)})};var l,h,f}function bt(t){return!0==("number"==typeof t)?""+t:t.replace(/~/g,"~1").replace(/\//g,"~0")}function gt(t){return t.replace(/~0/g,"/").replace(/~1/g,"~")}function mt(t){return 0===t.length?"":"/"+t.map(bt).join("/")}function St(t){var e=t.split("/").map(gt);return""===e[0]?e.slice(1):e}yt.ids={};var wt,At,Pt="Map.put can only be used to store complex values that have an identifier type attribute";(At=wt||(wt={}))[At.UNKNOWN=0]="UNKNOWN",At[At.YES=1]="YES",At[At.NO=2]="NO";var It=function(n){function t(t){return n.call(this,t,l.observable.ref.enhancer)||this}return a(t,n),t.prototype.get=function(t){return n.prototype.get.call(this,""+t)},t.prototype.has=function(t){return n.prototype.has.call(this,""+t)},t.prototype.delete=function(t){return n.prototype.delete.call(this,""+t)},t.prototype.set=function(t,e){return n.prototype.set.call(this,""+t,e)},t.prototype.put=function(t){if(t||rt("Map.put cannot be used to set empty values"),Y(t)){var e=Z(t),n=e.identifier;return this.set(n,e.value),e.value}if(pt(t)){n=void 0;var r=Z(this).type;return r.identifierMode===wt.NO?rt(Pt):r.identifierMode===wt.YES?(n=""+t[r.mapIdentifierAttribute],this.set(n,t),this.get(n)):rt(Pt)}return rt("Map.put can only be used to store complex values")},t}(l.ObservableMap),_t=function(r){function t(t,e){var n=r.call(this,t)||this;return n.shouldAttachNode=!0,n.identifierMode=wt.UNKNOWN,n.mapIdentifierAttribute=void 0,n.flags=b.Map,n.subType=e,n._determineIdentifierMode(),n}return a(t,r),t.prototype.instantiate=function(t,e,n,r){return this.identifierMode===wt.UNKNOWN&&this._determineIdentifierMode(),J(this,t,e,n,r)},t.prototype._determineIdentifierMode=function(){var t=[];if(function t(e,n){if(e instanceof zt)n.push(e);else if(e instanceof Xt){if(!t(e.type,n))return!1}else if(e instanceof qt){for(var r=0;r<e.types.length;r++)if(!t(e.types[r],n))return!1}else if(e instanceof re){var i=e.getSubType(!1);if(!i)return!1;t(i,n)}return!0}(this.subType,t)){var e=void 0;t.forEach(function(t){t.identifierAttribute&&(e&&e!==t.identifierAttribute&&rt("The objects in a map should all have the same identifier attribute, expected '"+e+"', but child of type '"+t.name+"' declared attribute '"+t.identifierAttribute+"' as identifier"),e=t.identifierAttribute)}),e?(this.identifierMode=wt.YES,this.mapIdentifierAttribute=e):this.identifierMode=wt.NO}},t.prototype.initializeChildNodes=function(e,n){void 0===n&&(n={});var r=e.type.subType,i=e._environment,o={};return Object.keys(n).forEach(function(t){o[t]=r.instantiate(e,t,i,n[t])}),o},t.prototype.createNewInstance=function(t,e,n){return new It(e)},t.prototype.finalizeNewInstance=function(t,e){l._interceptReads(e,t.unbox),l.intercept(e,this.willChange),l.observe(e,this.didChange)},t.prototype.describe=function(){return"Map<string, "+this.subType.describe()+">"},t.prototype.getChildren=function(t){return l.values(t.storedValue)},t.prototype.getChildNode=function(t,e){var n=t.storedValue.get(""+e);return n||rt("Not a child "+e),n},t.prototype.willChange=function(t){var e=Z(t.object),n=t.name;e.assertWritable();var r=e.type,i=r.subType;switch(t.type){case"update":var o=t.newValue;if(o===t.object.get(n))return null;t.newValue=i.reconcile(e.getChildNode(n),t.newValue),r.processIdentifier(n,t.newValue);break;case"add":t.newValue,t.newValue=i.instantiate(e,n,void 0,t.newValue),r.processIdentifier(n,t.newValue)}return t},t.prototype.processIdentifier=function(t,e){if(this.identifierMode===wt.YES&&e instanceof S){var n=e.identifier;n!==t&&rt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+n+"', but expected: '"+t+"'")}},t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){var e={};return t.getChildren().forEach(function(t){e[t.subpath]=t.snapshot}),e},t.prototype.processInitialSnapshot=function(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t].getSnapshot()}),n},t.prototype.didChange=function(t){var e=Z(t.object);switch(t.type){case"update":return void e.emitPatch({op:"replace",path:bt(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},e);case"add":return void e.emitPatch({op:"add",path:bt(t.name),value:t.newValue.snapshot,oldValue:void 0},e);case"delete":var n=t.oldValue.snapshot;return t.oldValue.die(),void e.emitPatch({op:"remove",path:bt(t.name),oldValue:n},e)}},t.prototype.applyPatchLocally=function(t,e,n){var r=t.storedValue;switch(n.op){case"add":case"replace":r.set(e,n.value);break;case"remove":r.delete(e)}},t.prototype.applySnapshot=function(t,e){var n=t.storedValue,r={};for(var i in Array.from(n.keys()).forEach(function(t){r[t]=!1}),e)n.set(i,e[i]),r[""+i]=!0;Object.keys(r).forEach(function(t){!1===r[t]&&n.delete(t)})},t.prototype.getChildType=function(t){return this.subType},t.prototype.isValidSnapshot=function(e,n){var r=this;return ut(e)?L(Object.keys(e).map(function(t){return r.subType.validate(e[t],M(n,t,r.subType))})):k(n,e,"Value is not a plain object")},t.prototype.getDefaultSnapshot=function(){return et},t.prototype.removeChild=function(t,e){t.storedValue.delete(e)},n([l.action],t.prototype,"applySnapshot",null),t}(w);var Vt=function(r){function t(t,e){var n=r.call(this,t)||this;return n.shouldAttachNode=!0,n.flags=b.Array,n.subType=e,n}return a(t,r),t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,r)},t.prototype.initializeChildNodes=function(r,t){void 0===t&&(t=[]);var i=r.type.subType,o=r._environment,a={};return t.forEach(function(t,e){var n=""+e;a[n]=i.instantiate(r,n,o,t)}),a},t.prototype.createNewInstance=function(t,e,n){return l.observable.array(X(e),nt)},t.prototype.finalizeNewInstance=function(t,e){l._getAdministration(e).dehancer=t.unbox,l.intercept(e,this.willChange),l.observe(e,this.didChange)},t.prototype.describe=function(){return this.subType.describe()+"[]"},t.prototype.getChildren=function(t){return t.storedValue.slice()},t.prototype.getChildNode=function(t,e){var n=parseInt(e,10);return n<t.storedValue.length?t.storedValue[n]:rt("Not a child: "+e)},t.prototype.willChange=function(t){var e=Z(t.object);e.assertWritable();var n=e.type.subType,r=e.getChildren(),i=null;switch(t.type){case"update":if(t.newValue===t.object[t.index])return null;if(!(i=Ct(e,n,[r[t.index]],[t.newValue],[t.index])))return null;t.newValue=i[0];break;case"splice":var o=t.index,a=t.removedCount,s=t.added;if(!(i=Ct(e,n,r.slice(o,o+a),s,s.map(function(t,e){return o+e}))))return null;t.added=i;for(var u=o+a;u<r.length;u++)r[u].setParent(e,""+(u+s.length-a))}return t},t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){return t.getChildren().map(function(t){return t.snapshot})},t.prototype.processInitialSnapshot=function(e,t){var n=[];return Object.keys(e).forEach(function(t){n.push(e[t].getSnapshot())}),n},t.prototype.didChange=function(t){var e=Z(t.object);switch(t.type){case"update":return void e.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},e);case"splice":for(var n=t.removedCount-1;0<=n;n--)e.emitPatch({op:"remove",path:""+(t.index+n),oldValue:t.removed[n].snapshot},e);for(n=0;n<t.addedCount;n++)e.emitPatch({op:"add",path:""+(t.index+n),value:e.getChildNode(""+(t.index+n)).snapshot,oldValue:void 0},e);return}},t.prototype.applyPatchLocally=function(t,e,n){var r=t.storedValue,i="-"===e?r.length:parseInt(e);switch(n.op){case"replace":r[i]=n.value;break;case"add":r.splice(i,0,n.value);break;case"remove":r.splice(i,1)}},t.prototype.applySnapshot=function(t,e){t.storedValue.replace(e)},t.prototype.getChildType=function(t){return this.subType},t.prototype.isValidSnapshot=function(t,n){var r=this;return at(t)?L(t.map(function(t,e){return r.subType.validate(t,M(n,""+e,r.subType))})):k(n,t,"Value is not an array")},t.prototype.getDefaultSnapshot=function(){return tt},t.prototype.removeChild=function(t,e){t.storedValue.splice(parseInt(e,10),1)},n([l.action],t.prototype,"applySnapshot",null),t}(w);function Ct(t,e,n,r,i){for(var o,a,s,u=!1,p=void 0,c=!0,l=0;u=l<=r.length-1,o=n[l],a=u?r[l]:void 0,((s=a)instanceof d||s instanceof S)&&(a=a.storedValue),o||u;l++)if(u)if(o)if(Nt(o,a))n[l]=Tt(e,t,""+i[l],a,o);else{p=void 0;for(var h=l;h<n.length;h++)if(Nt(n[h],a)){p=n.splice(h,1)[0];break}n.splice(l,0,Tt(e,t,""+i[l],a,p)),c=!1}else Y(a)&&Z(a).parent===t&&rt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+t.path+"/"+i[l]+"', but it lives already at '"+Z(a).path+"'"),n.splice(l,0,Tt(e,t,""+i[l],a)),c=!1;else o.die(),n.splice(l,1),l--,c=!1;return c?null:n}function Tt(t,e,n,r,i){var o;if(Y(r)&&((o=Z(r)).assertAlive(),null!==o.parent&&o.parent===e))return o.setParent(e,n),i&&i!==o&&i.die(),o;return i?((o=t.reconcile(i,r)).setParent(e,n),o):t.instantiate(e,n,e._environment,r)}function Nt(t,e){return Y(e)?Z(e)===t:t.snapshot===e||!!(t instanceof S&&null!==t.identifier&&t.identifierAttribute&&ut(e)&&t.identifier===""+e[t.identifierAttribute]&&t.type.is(e))}var Ot,jt,Et="preProcessSnapshot",Dt="postProcessSnapshot";function xt(){return Z(this).toString()}(jt=Ot||(Ot={})).afterCreate="afterCreate",jt.afterAttach="afterAttach",jt.beforeDetach="beforeDetach",jt.beforeDestroy="beforeDestroy";var Rt={name:"AnonymousModel",properties:{},initializers:tt};function Mt(t){return Object.keys(t).reduce(function(t,e){var n,r,i;if(e in Ot)return rt("Hook '"+e+"' was defined as property. Hooks should be defined as part of the actions");var o=Object.getOwnPropertyDescriptor(t,e);"get"in o&&rt("Getters are not supported as properties. Please use views instead");var a=o.value;if(null==a)rt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");else{if(ct(a))return Object.assign({},t,((n={})[e]=te(function(t){switch(typeof t){case"string":return Ft;case"number":return Ut;case"boolean":return $t;case"object":if(t instanceof Date)return Yt}return rt("Cannot determine primitive type from value "+t)}(a),a),n));if(a instanceof _t)return Object.assign({},t,((r={})[e]=te(a,{}),r));if(a instanceof Vt)return Object.assign({},t,((i={})[e]=te(a,[]),i));if(P(a))return t;rt("Invalid type definition for property '"+e+"', cannot infer a type from a value like '"+a+"' ("+typeof a+")")}},t)}var zt=function(r){function e(t){var e=r.call(this,t.name||Rt.name)||this;e.flags=b.Object,e.shouldAttachNode=!0;var n=t.name||Rt.name;return/^\w[\w\d_]*$/.test(n)||rt("Typename should be a valid identifier: "+n),Object.assign(e,Rt,t),e.properties=Mt(e.properties),lt(e.properties),e.propertyNames=Object.keys(e.properties),e.identifierAttribute=e._getIdentifierAttribute(),e}return a(e,r),e.prototype._getIdentifierAttribute=function(){var n=void 0;return this.forAllProps(function(t,e){e.flags&b.Identifier&&(n&&rt("Cannot define property '"+t+"' as object identifier, property '"+n+"' is already defined as identifier property"),n=t)}),n},e.prototype.cloneAndEnhance=function(t){return new e({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})},e.prototype.actions=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateActions(t,e(t)),t}]})},e.prototype.instantiateActions=function(s,u){ut(u)||rt("actions initializer should return a plain object containing actions"),Object.keys(u).forEach(function(t){t===Et&&rt("Cannot define action '"+Et+"', it should be defined using 'type.preProcessSnapshot(fn)' instead"),t===Dt&&rt("Cannot define action '"+Dt+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var e=u[t],n=s[t];if(t in Ot&&n){var r=e;e=function(){n.apply(null,arguments),r.apply(null,arguments)}}var i=e.$mst_middleware,o=e.bind(u);o.$mst_middleware=i;var a=E(s,t,o);u[t]=a,ht(s,t,a)})},e.prototype.named=function(t){return this.cloneAndEnhance({name:t})},e.prototype.props=function(t){return this.cloneAndEnhance({properties:t})},e.prototype.volatile=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateVolatileState(t,e(t)),t}]})},e.prototype.instantiateVolatileState=function(t,e){ut(e)||rt("volatile state initializer should return a plain object containing state"),l.set(t,e)},e.prototype.extend=function(s){var u=this;return this.cloneAndEnhance({initializers:[function(t){var e=s(t),n=e.actions,r=e.views,i=e.state,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}(e,["actions","views","state"]);for(var a in o)rt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+a+"'");return i&&u.instantiateVolatileState(t,i),r&&u.instantiateViews(t,r),n&&u.instantiateActions(t,n),t}]})},e.prototype.views=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateViews(t,e(t)),t}]})},e.prototype.instantiateViews=function(i,o){ut(o)||rt("views initializer should return a plain object containing views"),Object.keys(o).forEach(function(t){var e=Object.getOwnPropertyDescriptor(o,t),n=e.value;if("get"in e)if(l.isComputedProp(i,t)){var r=l._getAdministration(i,t);r.derivation=e.get,r.scope=i,e.set&&(r.setter=l.action(r.name+"-setter",e.set))}else l.computed(i,t,e,!0);else"function"==typeof n?ht(i,t,n):rt("A view member should either be a function or getter based property")})},e.prototype.preProcessSnapshot=function(e){var n=this.preProcessor;return n?this.cloneAndEnhance({preProcessor:function(t){return n(e(t))}}):this.cloneAndEnhance({preProcessor:e})},e.prototype.postProcessSnapshot=function(e){var n=this.postProcessor;return n?this.cloneAndEnhance({postProcessor:function(t){return e(n(t))}}):this.cloneAndEnhance({postProcessor:e})},e.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,Y(r)?r:this.applySnapshotPreProcessor(r))},e.prototype.initializeChildNodes=function(n,r){void 0===r&&(r={});var t=n.type,i={};return t.forAllProps(function(t,e){i[t]=e.instantiate(n,t,n._environment,r[t])}),i},e.prototype.createNewInstance=function(t,e,n){return l.observable.object(e,et,nt)},e.prototype.finalizeNewInstance=function(e,n){ht(n,"toString",xt),this.forAllProps(function(t){l._interceptReads(n,t,e.unbox)}),this.initializers.reduce(function(t,e){return e(t)},n),l.intercept(n,this.willChange),l.observe(n,this.didChange)},e.prototype.willChange=function(t){var e=Z(t.object);e.assertWritable();var n=e.type.properties[t.name];return n&&(t.newValue,t.newValue=n.reconcile(e.getChildNode(t.name),t.newValue)),t},e.prototype.didChange=function(t){var e=Z(t.object);if(e.type.properties[t.name]){var n=t.oldValue?t.oldValue.snapshot:void 0;e.emitPatch({op:"replace",path:bt(t.name),value:t.newValue.snapshot,oldValue:n},e)}},e.prototype.getChildren=function(n){var r=this,i=[];return this.forAllProps(function(t,e){i.push(r.getChildNode(n,t))}),i},e.prototype.getChildNode=function(t,e){if(!(e in this.properties))return rt("Not a value property: "+e);var n=l._getAdministration(t.storedValue,e).value;return n||rt("Node not available for property "+e)},e.prototype.getValue=function(t){return t.storedValue},e.prototype.getSnapshot=function(n,t){var r=this;void 0===t&&(t=!0);var i={};return this.forAllProps(function(t,e){l.getAtom(n.storedValue,t).reportObserved(),i[t]=r.getChildNode(n,t).snapshot}),t?this.applySnapshotPostProcessor(i):i},e.prototype.processInitialSnapshot=function(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t].getSnapshot()}),this.applySnapshotPostProcessor(this.applyOptionalValuesToSnapshot(n))},e.prototype.applyPatchLocally=function(t,e,n){"replace"!==n.op&&"add"!==n.op&&rt("object does not support operation "+n.op),t.storedValue[e]=n.value},e.prototype.applySnapshot=function(n,t){var r=this.applySnapshotPreProcessor(t);this.forAllProps(function(t,e){n.storedValue[t]=r[t]})},e.prototype.applySnapshotPreProcessor=function(t){var e=this.preProcessor;return e?e.call(null,t):t},e.prototype.applyOptionalValuesToSnapshot=function(r){return r&&(r=Object.assign({},r),this.forAllProps(function(t,e){if(!(t in r)){var n=kt(e);n&&(r[t]=n.getDefaultValueSnapshot())}})),r},e.prototype.applySnapshotPostProcessor=function(t){var e=this.postProcessor;return e?e.call(null,t):t},e.prototype.getChildType=function(t){return this.properties[t]},e.prototype.isValidSnapshot=function(t,e){var n=this,r=this.applySnapshotPreProcessor(t);return ut(r)?L(this.propertyNames.map(function(t){return n.properties[t].validate(r[t],M(e,t,n.properties[t]))})):k(e,r,"Value is not a plain object")},e.prototype.forAllProps=function(e){var n=this;this.propertyNames.forEach(function(t){return e(t,n.properties[t])})},e.prototype.describe=function(){var e=this;return"{ "+this.propertyNames.map(function(t){return t+": "+e.properties[t].describe()}).join("; ")+" }"},e.prototype.getDefaultSnapshot=function(){return et},e.prototype.removeChild=function(t,e){t.storedValue[e]=void 0},n([l.action],e.prototype,"applySnapshot",null),e}(w);function kt(t){if(t)return t.flags&b.Union&&t.types?t.types.find(kt):t.flags&b.Late&&t.getSubType&&t.getSubType(!1)?kt(t.subType):t.flags&b.Optional?t:void 0}var Lt=function(o){function t(t,e,n,r){void 0===r&&(r=it);var i=o.call(this,t)||this;return i.shouldAttachNode=!1,i.flags=e,i.checker=n,i.initializer=r,i}return a(t,o),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,r)},t.prototype.createNewInstance=function(t,e,n){return this.initializer(n)},t.prototype.isValidSnapshot=function(t,e){return ct(t)&&this.checker(t)?z():k(e,t,"Value is not a "+("Date"===this.name?"Date or a unix milliseconds timestamp":this.name))},t}(A),Ft=new Lt("string",b.String,function(t){return"string"==typeof t}),Ut=new Lt("number",b.Number,function(t){return"number"==typeof t}),Ht=new Lt("integer",b.Integer,function(t){return ot(t)}),$t=new Lt("boolean",b.Boolean,function(t){return"boolean"==typeof t}),Wt=new Lt("null",b.Null,function(t){return null===t}),Jt=new Lt("undefined",b.Undefined,function(t){return void 0===t}),Yt=new Lt("Date",b.Date,function(t){return"number"==typeof t||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});function Zt(t){return P(t)&&0<(t.flags&(b.String|b.Number|b.Integer|b.Boolean|b.Date))}Yt.getSnapshot=function(t){return t.storedValue.getTime()};var Gt=function(n){function t(t){var e=n.call(this,JSON.stringify(t))||this;return e.shouldAttachNode=!1,e.flags=b.Literal,e.value=t,e}return a(t,n),t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,r)},t.prototype.describe=function(){return JSON.stringify(this.value)},t.prototype.isValidSnapshot=function(t,e){return ct(t)&&t===this.value?z():k(e,t,"Value is not a literal "+JSON.stringify(this.value))},t}(A);function Bt(t){return new Gt(t)}var Kt=function(o){function t(t,e,n,r){var i=o.call(this,t)||this;return i.type=e,i.predicate=n,i.message=r,i}return a(t,o),Object.defineProperty(t.prototype,"flags",{get:function(){return this.type.flags|b.Refinement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.type.shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(t,e,n,r){return this.type.instantiate(t,e,n,r)},t.prototype.isAssignableFrom=function(t){return this.type.isAssignableFrom(t)},t.prototype.isValidSnapshot=function(t,e){var n=this.type.validate(t,e);if(0<n.length)return n;var r=Y(t)?Z(t).snapshot:t;return this.predicate(r)?z():k(e,t,this.message(t))},t}(A);var qt=function(i){function t(t,e,n){var r=i.call(this,t)||this;return r.eager=!0,n=o({eager:!0,dispatcher:void 0},n),r.dispatcher=n.dispatcher,n.eager||(r.eager=!1),r.types=e,r}return a(t,i),Object.defineProperty(t.prototype,"flags",{get:function(){var e=b.Union;return this.types.forEach(function(t){e|=t.flags}),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.types.some(function(t){return t.shouldAttachNode})},enumerable:!0,configurable:!0}),t.prototype.isAssignableFrom=function(e){return this.types.some(function(t){return t.isAssignableFrom(e)})},t.prototype.describe=function(){return"("+this.types.map(function(t){return t.describe()}).join(" | ")+")"},t.prototype.instantiate=function(t,e,n,r){var i=this.determineType(r,void 0);return i?i.instantiate(t,e,n,r):rt("No matching type for union "+this.describe())},t.prototype.reconcile=function(t,e){var n=this.determineType(e,t.type);return n?n.reconcile(t,e):rt("No matching type for union "+this.describe())},t.prototype.determineType=function(e,n){return this.dispatcher?this.dispatcher(e):n?n.is(e)?n:this.types.filter(function(t){return t!==n}).find(function(t){return t.is(e)}):this.types.find(function(t){return t.is(e)})},t.prototype.isValidSnapshot=function(t,e){if(this.dispatcher)return this.dispatcher(t).validate(t,e);for(var n=[],r=0,i=0;i<this.types.length;i++){var o=this.types[i].validate(t,e);if(0===o.length){if(this.eager)return z();r++}else n.push(o)}return 1===r?z():k(e,t,"No type is applicable for the union").concat(L(n))},t}(A);function Qt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=P(t)?void 0:t,i=P(t)?[t].concat(e):e,o="("+i.map(function(t){return t.name}).join(" | ")+")";return new qt(o,i,r)}var Xt=function(r){function t(t,e){var n=r.call(this,t.name)||this;return n.type=t,n.defaultValue=e,n}return a(t,r),Object.defineProperty(t.prototype,"flags",{get:function(){return this.type.flags|b.Optional},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.type.shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.describe=function(){return this.type.describe()+"?"},t.prototype.instantiate=function(t,e,n,r){if(void 0!==r)return this.type.instantiate(t,e,n,r);var i=this.getDefaultInstanceOrSnapshot();return this.type.instantiate(t,e,n,i)},t.prototype.reconcile=function(t,e){return this.type.reconcile(t,this.type.is(e)&&void 0!==e?e:this.getDefaultInstanceOrSnapshot())},t.prototype.getDefaultInstanceOrSnapshot=function(){var t="function"==typeof this.defaultValue?this.defaultValue():this.defaultValue;return this.defaultValue,t},t.prototype.getDefaultValueSnapshot=function(){var t=this.getDefaultInstanceOrSnapshot();return Y(t)?Z(t).snapshot:t},t.prototype.isValidSnapshot=function(t,e){return void 0===t?z():this.type.validate(t,e)},t.prototype.isAssignableFrom=function(t){return this.type.isAssignableFrom(t)},t}(A);function te(t,e){return"function"!=typeof e&&Y(e)&&rt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead"),new Xt(t,e)}var ee=te(Jt,void 0),ne=te(Wt,null);var re=function(r){function t(t,e){var n=r.call(this,t)||this;return n._subType=null,n.definition=e,n}return a(t,r),Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|b.Late},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.getSubType(!0).shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.getSubType=function(t){if(null===this._subType){var e=void 0;try{e=this.definition()}catch(t){if(!(t instanceof ReferenceError))throw t;e=void 0}if(t&&void 0===e&&rt("Late type seems to be used too early, the definition (still) returns undefined"),e)return this._subType=e}return this._subType},t.prototype.instantiate=function(t,e,n,r){return this.getSubType(!0).instantiate(t,e,n,r)},t.prototype.reconcile=function(t,e){return this.getSubType(!0).reconcile(t,e)},t.prototype.describe=function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"},t.prototype.isValidSnapshot=function(t,e){var n=this.getSubType(!1);return n?n.validate(t,e):z()},t.prototype.isAssignableFrom=function(t){var e=this.getSubType(!1);return!!e&&e.isAssignableFrom(t)},t}(A);var ie=function(n){function t(t){var e=n.call(this,t?"frozen("+t.name+")":"frozen")||this;return e.subType=t,e.shouldAttachNode=!1,e.flags=b.Frozen,e}return a(t,n),t.prototype.describe=function(){return"<any immutable value>"},t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,r)},t.prototype.isValidSnapshot=function(t,e){return"function"==typeof t?k(e,t,"Value is not serializable and cannot be frozen"):this.subType?this.subType.validate(t,e):z()},t}(A),oe=new ie;var ae=function(){function t(t,e){if(this.targetType=e,"string"==typeof t||"number"==typeof t)this.identifier=t;else{if(!Y(t))return rt("Can only store references to tree nodes or identifiers, got: '"+t+"'");var n=Z(t);if(!n.identifierAttribute)return rt("Can only store references with a defined identifier attribute.");var r=n.unnormalizedIdentifier;if(null==r)return rt("Can only store references to tree nodes with a defined identifier.");this.identifier=r}}return t.prototype.updateResolvedReference=function(){var t=""+this.identifier,e=this.node,n=e.root.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==n){var r=this.targetType,i=e.root.identifierCache.resolve(r,t);i||rt("Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+e.path+")"),this.resolvedReference={node:i,lastCacheModification:n}}},Object.defineProperty(t.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(),this.resolvedReference.node.value},enumerable:!0,configurable:!0}),t}(),se=function(n){function t(t){var e=n.call(this,"reference("+t.name+")")||this;return e.targetType=t,e.shouldAttachNode=!1,e.flags=b.Reference,e}return a(t,n),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(t){return this.targetType.isAssignableFrom(t)},t.prototype.isValidSnapshot=function(t,e){return"string"==typeof t||"number"==typeof t?z():k(e,t,"Value is not a valid identifier, which is a string or a number")},t}(A),ue=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.getValue=function(t){if(t.isAlive)return t.storedValue.resolvedValue},t.prototype.getSnapshot=function(t){return t.storedValue.identifier},t.prototype.instantiate=function(t,e,n,r){var i,o=J(this,t,e,n,i=new ae(r,this.targetType));return i.node=o},t.prototype.reconcile=function(t,e){if(t.type===this){var n=Y(e),r=t.storedValue;if(!n&&r.identifier===e)return t;if(n&&r.resolvedValue===e)return t}var i=this.instantiate(t.parent,t.subpath,t._environment,e);return t.die(),i},t}(se),pe=function(r){function t(t,e){var n=r.call(this,t)||this;return n.options=e,n}return a(t,r),t.prototype.getValue=function(t){if(t.isAlive)return this.options.get(t.storedValue,t.parent?t.parent.storedValue:null)},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,Y(r)?this.options.set(r,t?t.storedValue:null):r)},t.prototype.reconcile=function(t,e){var n=Y(e)?this.options.set(e,t?t.storedValue:null):e;if(t.type===this&&t.storedValue===n)return t;var r=this.instantiate(t.parent,t.subpath,t._environment,n);return t.die(),r},t}(se);var ce=function(e){function t(){var t=e.call(this,"identifier")||this;return t.shouldAttachNode=!1,t.flags=b.Identifier,t}return a(t,e),t.prototype.instantiate=function(t,e,n,r){return t&&t.type instanceof zt||rt("Identifier types can only be instantiated as direct child of a model type"),J(this,t,e,n,r)},t.prototype.reconcile=function(t,e){return t.storedValue!==e?rt("Tried to change identifier from '"+t.storedValue+"' to '"+e+"'. Changing identifiers is not allowed."):t},t.prototype.describe=function(){return"identifier"},t.prototype.isValidSnapshot=function(t,e){return"string"!=typeof t?k(e,t,"Value is not a valid identifier, expected a string"):z()},t}(A),le=function(i){function t(){var t=i.call(this)||this;return t.name="identifierNumber",t}return a(t,i),t.prototype.instantiate=function(t,e,n,r){return i.prototype.instantiate.call(this,t,e,n,r)},t.prototype.isValidSnapshot=function(t,e){return"number"==typeof t?z():k(e,t,"Value is not a valid identifierNumber, expected a number")},t.prototype.reconcile=function(t,e){return i.prototype.reconcile.call(this,t,e)},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.describe=function(){return"identifierNumber"},t}(ce),he=new ce,fe=new le;var de=function(n){function t(t){var e=n.call(this,t.name)||this;return e.options=t,e.flags=b.Reference,e.shouldAttachNode=!1,e}return a(t,n),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(t){return t===this},t.prototype.isValidSnapshot=function(t,e){if(this.options.isTargetType(t))return z();var n=this.options.getValidationMessage(t);return n?k(e,t,"Invalid value for type '"+this.name+"': "+n):z()},t.prototype.getValue=function(t){if(t.isAlive)return t.storedValue},t.prototype.getSnapshot=function(t){return this.options.toSnapshot(t.storedValue)},t.prototype.instantiate=function(t,e,n,r){return J(this,t,e,n,this.options.isTargetType(r)?r:this.options.fromSnapshot(r))},t.prototype.reconcile=function(t,e){var n=!this.options.isTargetType(e);if(t.type===this&&(n?e===t.snapshot:e===t.storedValue))return t;var r=n?this.options.fromSnapshot(e):e,i=this.instantiate(t.parent,t.subpath,t._environment,r);return t.die(),i},t}(A),ye={enumeration:function(t,e){var n=Qt.apply(void 0,("string"==typeof t?e:t).map(function(t){return Bt(""+t)}));return"string"==typeof t&&(n.name=t),n},model:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():"AnonymousModel",r=t.shift()||{};return new zt({name:n,properties:r})},compose:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():"AnonymousModel";return t.reduce(function(e,n){return e.cloneAndEnhance({name:e.name+"_"+n.name,properties:n.properties,initializers:n.initializers,preProcessor:function(t){return n.applySnapshotPreProcessor(e.applySnapshotPreProcessor(t))},postProcessor:function(t){return n.applySnapshotPostProcessor(e.applySnapshotPostProcessor(t))}})}).named(n)},custom:function(t){return new de(t)},reference:function(t,e){return e?new pe(t,e):new ue(t)},union:Qt,optional:te,literal:Bt,maybe:function(t){return Qt(t,ee)},maybeNull:function(t){return Qt(t,ne)},refinement:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():P(t[0])?t[0].name:null,r=t[0],i=t[1],o=t[2]?t[2]:function(t){return"Value does not respect the refinement predicate"};return new Kt(n,r,i,o)},string:Ft,boolean:$t,number:Ut,integer:Ht,Date:Yt,map:function(t){return new _t("map<string, "+t.name+">",t)},array:function(t){return new Vt(t.name+"[]",t)},frozen:function(t){return 0===arguments.length?oe:P(t)?new ie(t):te(oe,t)},identifier:he,identifierNumber:fe,late:function(t,e){var n="string"==typeof t?t:"late("+t.toString()+")";return new re(n,"string"==typeof t?e:t)},undefined:Jt,null:Wt};t.types=ye,t.typecheck=F,t.escapeJsonPath=bt,t.unescapeJsonPath=gt,t.joinJsonPath=mt,t.splitJsonPath=St,t.decorate=function(t,e){var n={handler:t,includeHooks:!0};return e.$mst_middleware&&e.$mst_middleware.push(n),e.$mst_middleware=[n],e},t.addMiddleware=D,t.process=function(t){return yt("process","`process()` has been renamed to `flow()`. See https://github.com/mobxjs/mobx-state-tree/issues/399 for more information. Note that the middleware event types starting with `process` now start with `flow`."),vt(t)},t.isStateTreeNode=Y,t.flow=vt,t.applyAction=V,t.onAction=C,t.recordActions=function(t){var e={actions:[],stop:function(){return n()},replay:function(t){V(t,e.actions)}},n=C(t,e.actions.push.bind(e.actions));return e},t.createActionTrackingMiddleware=function(a){return function(e,t,n){switch(e.type){case"action":if(a.filter&&!0!==a.filter(e))return t(e);var r=a.onStart(e);a.onResume(e,r),I.set(e.id,{call:e,context:r,async:!1});try{var i=t(e);return a.onSuspend(e,r),!1===I.get(e.id).async&&(I.delete(e.id),a.onSuccess(e,r,i)),i}catch(t){throw I.delete(e.id),a.onFail(e,r,t),t}case"flow_spawn":return(o=I.get(e.rootId)).async=!0,t(e);case"flow_resume":case"flow_resume_error":var o=I.get(e.rootId);a.onResume(e,o.context);try{return t(e)}finally{a.onSuspend(e,o.context)}case"flow_throw":return o=I.get(e.rootId),I.delete(e.id),a.onFail(e,o.context,e.args[0]),t(e);case"flow_return":return o=I.get(e.rootId),I.delete(e.id),a.onSuccess(e,o.context,e.args[0]),t(e)}}},t.setLivelynessChecking=function(t){v=t},t.getType=u,t.getChildType=function(t,e){return Z(t).getChildType(e)},t.onPatch=i,t.onSnapshot=function(t,e){return Z(t).onSnapshot(e)},t.applyPatch=s,t.recordPatches=function(e){var t=null;function n(){t||(t=i(e,function(t,e){r.rawPatches.push([t,e])}))}var r={rawPatches:[],get patches(){return this.rawPatches.map(function(t){return t[0]})},get inversePatches(){return this.rawPatches.map(function(t){return t[0],t[1]})},stop:function(){t&&t(),t=null},resume:n,replay:function(t){s(t||e,r.patches)},undo:function(t){s(t||e,r.inversePatches.slice().reverse())}};return n(),r},t.protect=function(t){var e=Z(t);e.isRoot||rt("`protect` can only be invoked on root nodes"),e.isProtectionEnabled=!0},t.unprotect=function(t){var e=Z(t);e.isRoot||rt("`unprotect` can only be invoked on root nodes"),e.isProtectionEnabled=!1},t.isProtected=function(t){return Z(t).isProtected},t.applySnapshot=p,t.getSnapshot=function(t,e){void 0===e&&(e=!0);var n=Z(t);return e?n.snapshot:lt(n.type.getSnapshot(n,!1))},t.hasParent=function(t,e){void 0===e&&(e=1);for(var n=Z(t).parent;n;){if(0==--e)return!0;n=n.parent}return!1},t.getParent=function(t,e){void 0===e&&(e=1);for(var n=e,r=Z(t).parent;r;){if(0==--n)return r.storedValue;r=r.parent}return rt("Failed to find the parent of "+Z(t)+" at depth "+e)},t.hasParentOfType=function(t,e){for(var n=Z(t).parent;n;){if(e.is(n.storedValue))return!0;n=n.parent}return!1},t.getParentOfType=function(t,e){for(var n=Z(t).parent;n;){if(e.is(n.storedValue))return n.storedValue;n=n.parent}return rt("Failed to find the parent of "+Z(t)+" of a given type")},t.getRoot=c,t.getPath=function(t){return Z(t).path},t.getPathParts=function(t){return St(Z(t).path)},t.isRoot=function(t){return Z(t).isRoot},t.resolvePath=function(t,e){var n=q(Z(t),e);return n?n.value:void 0},t.resolveIdentifier=function(t,e,n){var r=Z(e).root.identifierCache.resolve(t,""+n);return r?r.value:void 0},t.getIdentifier=function(t){return Z(t).identifier},t.tryResolve=h,t.getRelativePath=function(t,e){return K(Z(t),Z(e))},t.clone=function(t,e){void 0===e&&(e=!0);var n=Z(t);return n.type.create(n.snapshot,!0===e?n.root._environment:!1===e?void 0:e)},t.detach=function(t){return Z(t).detach(),t},t.destroy=function(t){var e=Z(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)},t.isAlive=function(t){return Z(t).isAlive},t.addDisposer=function(t,e){return Z(t).addDisposer(e),e},t.getEnv=function(t){var e=Z(t).root._environment;return e||et},t.walk=f,t.getMembers=function(n){var t=Z(n).type,r=o({},e(t),{actions:[],volatile:[],views:[]});return Object.getOwnPropertyNames(n).forEach(function(t){if(!(t in r.properties)){var e=Object.getOwnPropertyDescriptor(n,t);e.get?l.isComputedProp(n,t)?r.views.push(t):r.volatile.push(t):!0===e.value._isMSTAction?r.actions.push(t):l.isObservableProp(n,t)?r.volatile.push(t):r.views.push(t)}}),r},t.getPropertyMembers=e,t.cast=function(t){return t},t.castToSnapshot=function(t){return t},t.castToReferenceSnapshot=function(t){return t},t.isType=P,t.isArrayType=function(t){return P(t)&&0<(t.flags&b.Array)},t.isFrozenType=function(t){return P(t)&&0<(t.flags&b.Frozen)},t.isIdentifierType=function(t){return P(t)&&0<(t.flags&b.Identifier)},t.isLateType=function(t){return P(t)&&0<(t.flags&b.Late)},t.isLiteralType=function(t){return P(t)&&0<(t.flags&b.Literal)},t.isMapType=function(t){return P(t)&&0<(t.flags&b.Map)},t.isModelType=function(t){return P(t)&&0<(t.flags&b.Object)},t.isOptionalType=function(t){return P(t)&&0<(t.flags&b.Optional)},t.isPrimitiveType=Zt,t.isReferenceType=function(t){return 0<(t.flags&b.Reference)},t.isRefinementType=function(t){return 0<(t.flags&b.Refinement)},t.isUnionType=function(t){return 0<(t.flags&b.Union)},Object.defineProperty(t,"__esModule",{value:!0})}); |
import { IObservableArray } from "mobx"; | ||
import { IAnyType, IComplexType, OptionalProperty, ExtractS, ExtractC, ExtractT } from "../../internal"; | ||
export interface IMSTArray<T> extends IObservableArray<T> { | ||
import { IAnyType, IStateTreeNode, IType, OptionalProperty, ExtractS, ExtractC, ExtractT, ExtractCST } from "../../internal"; | ||
export interface IMSTArray<IT extends IAnyType> extends IObservableArray<ExtractT<IT>>, IStateTreeNode<ExtractC<IT>[] | undefined, ExtractS<IT>[]> { | ||
push(...items: ExtractT<IT>[]): number; | ||
push(...items: ExtractCST<IT>[]): number; | ||
concat(...items: ConcatArray<ExtractT<IT>>[]): ExtractT<IT>[]; | ||
concat(...items: ConcatArray<ExtractCST<IT>>[]): ExtractT<IT>[]; | ||
concat(...items: (ExtractT<IT> | ConcatArray<ExtractT<IT>>)[]): ExtractT<IT>[]; | ||
concat(...items: (ExtractCST<IT> | ConcatArray<ExtractCST<IT>>)[]): ExtractT<IT>[]; | ||
splice(start: number, deleteCount?: number): ExtractT<IT>[]; | ||
splice(start: number, deleteCount: number, ...items: ExtractT<IT>[]): ExtractT<IT>[]; | ||
splice(start: number, deleteCount: number, ...items: ExtractCST<IT>[]): ExtractT<IT>[]; | ||
unshift(...items: ExtractT<IT>[]): number; | ||
unshift(...items: ExtractCST<IT>[]): number; | ||
} | ||
export interface IArrayType<IT extends IAnyType> extends IComplexType<ExtractC<IT>[] | undefined, ExtractS<IT>[], IMSTArray<ExtractT<IT>>>, OptionalProperty { | ||
export interface IArrayType<IT extends IAnyType> extends IType<ExtractC<IT>[] | undefined, ExtractS<IT>[], IMSTArray<IT>>, OptionalProperty { | ||
} | ||
@@ -29,3 +40,3 @@ /** | ||
* @param {IType<S, T>} subtype | ||
* @returns {IComplexType<S[], IObservableArray<T>>} | ||
* @returns {IArrayType<IT>} | ||
*/ | ||
@@ -32,0 +43,0 @@ export declare function array<IT extends IAnyType>(subtype: IT): IArrayType<IT>; |
import { IInterceptor, IKeyValueMap, IMapDidChange, IMapWillChange, Lambda } from "mobx"; | ||
import { IAnyType, IComplexType, IType, OptionalProperty, ExtractC, ExtractS, ExtractT, ExtractCST } from "../../internal"; | ||
export interface IMapType<IT extends IAnyType> extends IComplexType<IKeyValueMap<ExtractC<IT>> | undefined, IKeyValueMap<ExtractS<IT>>, IMSTMap<IT>>, OptionalProperty { | ||
import { IAnyType, IType, OptionalProperty, ExtractC, ExtractS, ExtractT, ExtractCST, IStateTreeNode } from "../../internal"; | ||
export interface IMapType<IT extends IAnyType> extends IType<IKeyValueMap<ExtractC<IT>> | undefined, IKeyValueMap<ExtractS<IT>>, IMSTMap<IT>>, OptionalProperty { | ||
} | ||
export interface IMSTMap<IT extends IAnyType> { | ||
export interface IMSTMap<IT extends IAnyType> extends IStateTreeNode<IKeyValueMap<ExtractC<IT>> | undefined, IKeyValueMap<ExtractS<IT>>> { | ||
clear(): void; | ||
@@ -26,3 +26,4 @@ delete(key: string): boolean; | ||
*/ | ||
toPOJO(): IKeyValueMap<ExtractT<IT>>; | ||
toPOJO(): IKeyValueMap<ExtractS<IT>>; | ||
toJSON(): IKeyValueMap<ExtractS<IT>>; | ||
/** | ||
@@ -33,3 +34,2 @@ * Returns a shallow non observable object clone of this map. | ||
toJS(): Map<string, ExtractT<IT>>; | ||
toJSON(): IKeyValueMap<ExtractT<IT>>; | ||
toString(): string; | ||
@@ -70,3 +70,3 @@ [Symbol.toStringTag]: "Map"; | ||
* @param {IType<S, T>} subtype | ||
* @returns {IComplexType<S[], IObservableArray<T>>} | ||
* @returns {IMapType<IT>} | ||
*/ | ||
@@ -73,0 +73,0 @@ export declare function map<IT extends IAnyType>(subtype: IT): IMapType<IT>; |
@@ -1,2 +0,2 @@ | ||
import { ExtractIStateTreeNode, IAnyType, IComplexType, IStateTreeNode, IType, ExtractC, ExtractS, ExtractT } from "../../internal"; | ||
import { IAnyType, IStateTreeNode, IType, ExtractC, ExtractS, ExtractT } from "../../internal"; | ||
export interface ModelProperties { | ||
@@ -18,10 +18,2 @@ [key: string]: IAnyType; | ||
} | ||
export declare type RequiredPropNames<T> = { | ||
[K in keyof T]: T[K] extends OptionalProperty ? never : K; | ||
}[keyof T]; | ||
export declare type OptionalPropNames<T> = { | ||
[K in keyof T]: T[K] extends OptionalProperty ? K : never; | ||
}[keyof T]; | ||
export declare type RequiredProps<T> = Pick<T, RequiredPropNames<T>>; | ||
export declare type OptionalProps<T> = Pick<T, OptionalPropNames<T>>; | ||
export interface _NotCustomized { | ||
@@ -34,14 +26,27 @@ readonly "!!mstNotCustomized": undefined; | ||
*/ | ||
export declare type ModelCreationType<T extends ModelProperties> = { | ||
[K in keyof RequiredProps<T>]: ExtractC<T[K]>; | ||
} & { | ||
[K in keyof OptionalProps<T>]?: ExtractC<T[K]>; | ||
export declare type RequiredPropNames<T> = { | ||
[K in keyof T]: T[K] extends OptionalProperty ? never : K; | ||
}[keyof T]; | ||
export declare type RequiredProps<T> = Pick<T, RequiredPropNames<T>>; | ||
export declare type RequiredPropsObject<P extends ModelProperties> = { | ||
[K in keyof RequiredProps<P>]: P[K]; | ||
}; | ||
export declare type ModelCreationType2<T extends ModelProperties, CustomC> = _CustomOrOther<CustomC, ModelCreationType<T>>; | ||
export declare type ModelSnapshotType<T extends ModelProperties> = { | ||
[K in keyof T]: ExtractS<T[K]>; | ||
export declare type OptionalPropNames<T> = { | ||
[K in keyof T]: T[K] extends OptionalProperty ? K : never; | ||
}[keyof T]; | ||
export declare type OptionalProps<T> = Pick<T, OptionalPropNames<T>>; | ||
export declare type OptionalPropsObject<P extends ModelProperties> = { | ||
[K in keyof OptionalProps<P>]?: P[K]; | ||
}; | ||
export declare type ModelSnapshotType2<T extends ModelProperties, CustomS> = _CustomOrOther<CustomS, ModelSnapshotType<T>>; | ||
export declare type ExtractCFromProps<P extends ModelProperties> = { | ||
[k in keyof P]: ExtractC<P[k]>; | ||
}; | ||
export declare type ModelCreationType<P extends ModelProperties> = ExtractCFromProps<RequiredPropsObject<P> & OptionalPropsObject<P>>; | ||
export declare type ModelCreationType2<P extends ModelProperties, CustomC> = _CustomOrOther<CustomC, ModelCreationType<P>>; | ||
export declare type ModelSnapshotType<P extends ModelProperties> = { | ||
[K in keyof P]: ExtractS<P[K]>; | ||
}; | ||
export declare type ModelSnapshotType2<P extends ModelProperties, CustomS> = _CustomOrOther<CustomS, ModelSnapshotType<P>>; | ||
export declare type ModelInstanceTypeProps<P extends ModelProperties> = { | ||
[K in keyof P]: ExtractIStateTreeNode<ExtractC<P[K]>, ExtractS<P[K]>, ExtractT<P[K]>>; | ||
[K in keyof P]: ExtractT<P[K]>; | ||
}; | ||
@@ -52,3 +57,3 @@ export declare type ModelInstanceType<P extends ModelProperties, O, CustomC, CustomS> = ModelInstanceTypeProps<P> & O & IStateTreeNode<ModelCreationType2<P, CustomC>, ModelSnapshotType2<P, CustomS>>; | ||
} | ||
export interface IModelType<PROPS extends ModelProperties, OTHERS, CustomC = _NotCustomized, CustomS = _NotCustomized> extends IComplexType<ModelCreationType2<PROPS, CustomC>, ModelSnapshotType2<PROPS, CustomS>, ModelInstanceType<PROPS, OTHERS, CustomC, CustomS>> { | ||
export interface IModelType<PROPS extends ModelProperties, OTHERS, CustomC = _NotCustomized, CustomS = _NotCustomized> extends IType<ModelCreationType2<PROPS, CustomC>, ModelSnapshotType2<PROPS, CustomS>, ModelInstanceType<PROPS, OTHERS, CustomC, CustomS>> { | ||
readonly properties: PROPS; | ||
@@ -68,7 +73,8 @@ named(newName: string): this; | ||
} | ||
export declare type IAnyModelType = IModelType<any, any, any, any>; | ||
export interface IAnyModelType extends IModelType<any, any, any, any> { | ||
} | ||
export declare type ExtractProps<T extends IAnyModelType> = T extends IModelType<infer P, any, any, any> ? P : never; | ||
export declare type ExtractOthers<T extends IAnyModelType> = T extends IModelType<any, infer O, any, any> ? O : never; | ||
export declare function model<T extends ModelPropertiesDeclaration = {}>(name: string, properties?: T): IModelType<ModelPropertiesDeclarationToProperties<T>, {}>; | ||
export declare function model<T extends ModelPropertiesDeclaration = {}>(properties?: T): IModelType<ModelPropertiesDeclarationToProperties<T>, {}>; | ||
export declare function model<P extends ModelPropertiesDeclaration = {}>(name: string, properties?: P): IModelType<ModelPropertiesDeclarationToProperties<P>, {}>; | ||
export declare function model<P extends ModelPropertiesDeclaration = {}>(properties?: P): IModelType<ModelPropertiesDeclarationToProperties<P>, {}>; | ||
export declare type _CustomJoin<A, B> = A extends _NotCustomized ? B : A & B; | ||
@@ -75,0 +81,0 @@ export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): IModelType<PA & PB, OA & OB, _CustomJoin<FCA, FCB>, _CustomJoin<FSA, FSB>>; |
@@ -1,9 +0,29 @@ | ||
import { IType, IComplexType, IAnyType, ExtractC, ExtractS, ExtractT, IAnyComplexType, OptionalProperty } from "../../internal"; | ||
export interface IMaybeIComplexType<IT extends IAnyComplexType, C, O> extends IComplexType<ExtractC<IT> | C, ExtractS<IT> | O, ExtractT<IT> | O>, OptionalProperty { | ||
import { IType, IAnyType, ExtractC, ExtractS, ExtractT, OptionalProperty, IStateTreeNode, RedefineIStateTreeNode } from "../../internal"; | ||
export interface IMaybeIType<IT extends IAnyType, C, O> extends IType<ExtractC<IT> | C, ExtractS<IT> | O, RedefineIStateTreeNode<ExtractT<IT>, IStateTreeNode<ExtractC<IT> | C, ExtractS<IT> | O>> | O>, OptionalProperty { | ||
} | ||
export interface IMaybeIType<IT extends IAnyType, C, O> extends IType<ExtractC<IT> | C, ExtractS<IT> | O, ExtractT<IT> | O>, OptionalProperty { | ||
export interface IMaybe<IT extends IAnyType> extends IMaybeIType<IT, undefined, undefined> { | ||
} | ||
export declare function maybe<IT extends IAnyComplexType>(type: IT): IMaybeIComplexType<IT, undefined, undefined>; | ||
export declare function maybe<IT extends IAnyType>(type: IT): IMaybeIType<IT, undefined, undefined>; | ||
export declare function maybeNull<IT extends IAnyComplexType>(type: IT): IMaybeIComplexType<IT, null | undefined, null>; | ||
export declare function maybeNull<IT extends IAnyType>(type: IT): IMaybeIType<IT, null | undefined, null>; | ||
export interface IMaybeNull<IT extends IAnyType> extends IMaybeIType<IT, null | undefined, null> { | ||
} | ||
/** | ||
* Maybe will make a type nullable, and also optional. | ||
* The value `undefined` will be used to represent nullability. | ||
* | ||
* @export | ||
* @alias types.maybe | ||
* @template IT | ||
* @param {IT} type | ||
* @returns {IMaybe<IT>} | ||
*/ | ||
export declare function maybe<IT extends IAnyType>(type: IT): IMaybe<IT>; | ||
/** | ||
* Maybe will make a type nullable, and also optional. | ||
* The value `null` will be used to represent no value. | ||
* | ||
* @export | ||
* @alias types.maybeNull | ||
* @template IT | ||
* @param {IT} type | ||
* @returns {IMaybeNull<IT>} | ||
*/ | ||
export declare function maybeNull<IT extends IAnyType>(type: IT): IMaybeNull<IT>; |
@@ -1,10 +0,30 @@ | ||
import { IType, IAnyType, IComplexType, OptionalProperty, ExtractT, ExtractS, ExtractC, ExtractCST, IAnyComplexType } from "../../internal"; | ||
import { IType, IAnyType, OptionalProperty, ExtractT, ExtractS, ExtractC, ExtractCST, RedefineIStateTreeNode, IStateTreeNode } from "../../internal"; | ||
export declare type OptionalDefaultValueOrFunction<IT extends IAnyType> = ExtractC<IT> | ExtractS<IT> | (() => ExtractCST<IT>); | ||
export interface IOptionalIComplexType<IT extends IAnyComplexType> extends IComplexType<ExtractC<IT> | undefined, ExtractS<IT>, ExtractT<IT>>, OptionalProperty { | ||
export interface IOptionalIType<IT extends IAnyType> extends IType<ExtractC<IT> | undefined, ExtractS<IT>, RedefineIStateTreeNode<ExtractT<IT>, IStateTreeNode<ExtractC<IT> | undefined, ExtractS<IT>>>>, OptionalProperty { | ||
} | ||
export interface IOptionalIType<IT extends IAnyType> extends IType<ExtractC<IT> | undefined, ExtractS<IT>, ExtractT<IT>>, OptionalProperty { | ||
} | ||
export declare function optional<IT extends IAnyComplexType>(type: IT, defaultValueOrFunction: OptionalDefaultValueOrFunction<IT>): IOptionalIComplexType<IT>; | ||
export declare function optional<IT extends IAnyType>(type: IT, defaultValueOrFunction: OptionalDefaultValueOrFunction<IT>): IOptionalIType<IT>; | ||
/** | ||
* `types.optional` can be used to create a property with a default value. | ||
* If the given value is not provided in the snapshot, it will default to the provided `defaultValue`. | ||
* If `defaultValue` is a function, the function will be invoked for every new instance. | ||
* Applying a snapshot in which the optional value is _not_ present, causes the value to be reset | ||
* | ||
* @example | ||
* const Todo = types.model({ | ||
* title: types.optional(types.string, "Test"), | ||
* done: types.optional(types.boolean, false), | ||
* created: types.optional(types.Date, () => new Date()) | ||
* }) | ||
* | ||
* // it is now okay to omit 'created' and 'done'. created will get a freshly generated timestamp | ||
* const todo = Todo.create({ title: "Get coffee "}) | ||
* | ||
* @export | ||
* @alias types.optional | ||
* @template IT | ||
* @param {IT} type | ||
* @param {OptionalDefaultValueOrFunction<IT>} defaultValueOrFunction | ||
* @returns {IT extends OptionalProperty ? IT : IOptionalIType<IT>} | ||
*/ | ||
export declare function optional<IT extends IAnyType>(type: IT, defaultValueOrFunction: OptionalDefaultValueOrFunction<IT>): IT extends OptionalProperty ? IT : IOptionalIType<IT>; | ||
/** | ||
* Returns if a value represents an optional type. | ||
@@ -11,0 +31,0 @@ * |
@@ -1,7 +0,7 @@ | ||
import { ExtractT, IComplexType, IAnyStateTreeNode, IAnyComplexType } from "../../internal"; | ||
export interface ReferenceOptions<T> { | ||
get(identifier: string | number, parent: IAnyStateTreeNode | null): T; | ||
set(value: T, parent: IAnyStateTreeNode | null): string | number; | ||
import { IType, ExtractT, IAnyStateTreeNode, IAnyComplexType, IStateTreeNode, RedefineIStateTreeNode } from "../../internal"; | ||
export interface ReferenceOptions<IT extends IAnyComplexType> { | ||
get(identifier: string | number, parent: IAnyStateTreeNode | null): ExtractT<IT>; | ||
set(value: ExtractT<IT>, parent: IAnyStateTreeNode | null): string | number; | ||
} | ||
export interface IReferenceType<IR extends IAnyComplexType> extends IComplexType<string | number | ExtractT<IR>, string | number, ExtractT<IR>> { | ||
export interface IReferenceType<IT extends IAnyComplexType> extends IType<string | number, string | number, RedefineIStateTreeNode<ExtractT<IT>, IStateTreeNode<string | number, string | number>>> { | ||
} | ||
@@ -15,3 +15,3 @@ /** | ||
*/ | ||
export declare function reference<IT extends IAnyComplexType>(subType: IT, options?: ReferenceOptions<ExtractT<IT>>): IReferenceType<IT>; | ||
export declare function reference<IT extends IAnyComplexType>(subType: IT, options?: ReferenceOptions<IT>): IReferenceType<IT>; | ||
/** | ||
@@ -18,0 +18,0 @@ * Returns if a given value represents a reference type. |
@@ -1,2 +0,2 @@ | ||
import { IType, IAnyType, IComplexType, IModelType, ModelProperties, ModelInstanceType, ModelSnapshotType2, ModelCreationType2, _NotCustomized } from "../../internal"; | ||
import { IType, IAnyType, IModelType, ModelProperties, ModelInstanceType, ModelSnapshotType2, ModelCreationType2, _NotCustomized, RedefineIStateTreeNode, IStateTreeNode } from "../../internal"; | ||
export declare type ITypeDispatcher = (snapshot: any) => IAnyType; | ||
@@ -8,52 +8,36 @@ export interface UnionOptions { | ||
export declare type _CustomCSProcessor<T> = Exclude<T, _NotCustomized> extends never ? _NotCustomized : Exclude<T, _NotCustomized>; | ||
export interface ModelUnion<C, S, T> extends IComplexType<_CustomCSProcessor<C>, _CustomCSProcessor<S>, T> { | ||
export interface ITypeUnion<C, S, T> extends IType<_CustomCSProcessor<C>, _CustomCSProcessor<S>, RedefineIStateTreeNode<T, IStateTreeNode<_CustomCSProcessor<C>, _CustomCSProcessor<S>>>> { | ||
} | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH, PI extends ModelProperties, OI, FCI, FSI>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>, I: IModelType<PI, OI, FCI, FSI>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH> | ModelCreationType2<PI, FCI>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH> | ModelSnapshotType2<PI, FSI>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH> | ModelInstanceType<PI, OI, FCI, FSI>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH, PI extends ModelProperties, OI, FCI, FSI>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>, I: IModelType<PI, OI, FCI, FSI>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH> | ModelCreationType2<PI, FCI>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH> | ModelSnapshotType2<PI, FSI>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH> | ModelInstanceType<PI, OI, FCI, FSI>>; | ||
export declare function union<CA, SA, TA, CB, SB, TB>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>): IComplexType<CA | CB, SA | SB, TA | TB>; | ||
export declare function union<CA, SA, TA, CB, SB, TB>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>): IComplexType<CA | CB, SA | SB, TA | TB>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>): IComplexType<CA | CB | CC, SA | SB | SC, TA | TB | TC>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>): IComplexType<CA | CB | CC, SA | SB | SC, TA | TB | TC>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>): IComplexType<CA | CB | CC | CD, SA | SB | SC | SD, TA | TB | TC | TD>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>): IComplexType<CA | CB | CC | CD, SA | SB | SC | SD, TA | TB | TC | TD>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>): IComplexType<CA | CB | CC | CD | CE, SA | SB | SC | SD | SE, TA | TB | TC | TD | TE>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>): IComplexType<CA | CB | CC | CD | CE, SA | SB | SC | SD | SE, TA | TB | TC | TD | TE>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>, F: IComplexType<CF, SF, TF>): IComplexType<CA | CB | CC | CD | CE | CF, SA | SB | SC | SD | SE | SF, TA | TB | TC | TD | TE | TF>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>, F: IComplexType<CF, SF, TF>): IComplexType<CA | CB | CC | CD | CE | CF, SA | SB | SC | SD | SE | SF, TA | TB | TC | TD | TE | TF>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>, F: IComplexType<CF, SF, TF>, G: IComplexType<CG, SG, TG>): IComplexType<CA | CB | CC | CD | CE | CF | CG, SA | SB | SC | SD | SE | SF | SG, TA | TB | TC | TD | TE | TF | TG>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>, F: IComplexType<CF, SF, TF>, G: IComplexType<CG, SG, TG>): IComplexType<CA | CB | CC | CD | CE | CF | CG, SA | SB | SC | SD | SE | SF | SG, TA | TB | TC | TD | TE | TF | TG>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>, F: IComplexType<CF, SF, TF>, G: IComplexType<CG, SG, TG>, H: IComplexType<CH, SH, TH>): IComplexType<CA | CB | CC | CD | CE | CF | CG | CH, SA | SB | SC | SD | SE | SF | SG | SH, TA | TB | TC | TD | TE | TF | TG | TH>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>, F: IComplexType<CF, SF, TF>, G: IComplexType<CG, SG, TG>, H: IComplexType<CH, SH, TH>): IComplexType<CA | CB | CC | CD | CE | CF | CG | CH, SA | SB | SC | SD | SE | SF | SG | SH, TA | TB | TC | TD | TE | TF | TG | TH>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH, CI, SI, TI>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>, F: IComplexType<CF, SF, TF>, G: IComplexType<CG, SG, TG>, H: IComplexType<CH, SH, TH>, I: IComplexType<CI, SI, TI>): IComplexType<CA | CB | CC | CD | CE | CF | CG | CH | CI, SA | SB | SC | SD | SE | SF | SG | SH | SI, TA | TB | TC | TD | TE | TF | TG | TH | TI>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH, CI, SI, TI>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>, C: IComplexType<CC, SC, TC>, D: IComplexType<CD, SD, TD>, E: IComplexType<CE, SE, TE>, F: IComplexType<CF, SF, TF>, G: IComplexType<CG, SG, TG>, H: IComplexType<CH, SH, TH>, I: IComplexType<CI, SI, TI>): IComplexType<CA | CB | CC | CD | CE | CF | CG | CH | CI, SA | SB | SC | SD | SE | SF | SG | SH | SI, TA | TB | TC | TD | TE | TF | TG | TH | TI>; | ||
export declare function union<CA, SA, TA, CB, SB, TB>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>): IType<CA | CB, SA | SB, TA | TB>; | ||
export declare function union<CA, SA, TA, CB, SB, TB>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>): IType<CA | CB, SA | SB, TA | TB>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>): IType<CA | CB | CC, SA | SB | SC, TA | TB | TC>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>): IType<CA | CB | CC, SA | SB | SC, TA | TB | TC>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>): IType<CA | CB | CC | CD, SA | SB | SC | SD, TA | TB | TC | TD>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>): IType<CA | CB | CC | CD, SA | SB | SC | SD, TA | TB | TC | TD>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>): IType<CA | CB | CC | CD | CE, SA | SB | SC | SD | SE, TA | TB | TC | TD | TE>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>): IType<CA | CB | CC | CD | CE, SA | SB | SC | SD | SE, TA | TB | TC | TD | TE>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>): IType<CA | CB | CC | CD | CE | CF, SA | SB | SC | SD | SE | SF, TA | TB | TC | TD | TE | TF>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>): IType<CA | CB | CC | CD | CE | CF, SA | SB | SC | SD | SE | SF, TA | TB | TC | TD | TE | TF>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>): IType<CA | CB | CC | CD | CE | CF | CG, SA | SB | SC | SD | SE | SF | SG, TA | TB | TC | TD | TE | TF | TG>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>): IType<CA | CB | CC | CD | CE | CF | CG, SA | SB | SC | SD | SE | SF | SG, TA | TB | TC | TD | TE | TF | TG>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>, H: IType<CH, SH, TH>): IType<CA | CB | CC | CD | CE | CF | CG | CH, SA | SB | SC | SD | SE | SF | SG | SH, TA | TB | TC | TD | TE | TF | TG | TH>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>, H: IType<CH, SH, TH>): IType<CA | CB | CC | CD | CE | CF | CG | CH, SA | SB | SC | SD | SE | SF | SG | SH, TA | TB | TC | TD | TE | TF | TG | TH>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH, CI, SI, TI>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>, H: IType<CH, SH, TH>, I: IType<CI, SI, TI>): IType<CA | CB | CC | CD | CE | CF | CG | CH | CI, SA | SB | SC | SD | SE | SF | SG | SH | SI, TA | TB | TC | TD | TE | TF | TG | TH | TI>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH, CI, SI, TI>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>, H: IType<CH, SH, TH>, I: IType<CI, SI, TI>): IType<CA | CB | CC | CD | CE | CF | CG | CH | CI, SA | SB | SC | SD | SE | SF | SG | SH | SI, TA | TB | TC | TD | TE | TF | TG | TH | TI>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH, PI extends ModelProperties, OI, FCI, FSI>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>, I: IModelType<PI, OI, FCI, FSI>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH> | ModelCreationType2<PI, FCI>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH> | ModelSnapshotType2<PI, FSI>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH> | ModelInstanceType<PI, OI, FCI, FSI>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH, PI extends ModelProperties, OI, FCI, FSI>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>, I: IModelType<PI, OI, FCI, FSI>): ITypeUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH> | ModelCreationType2<PI, FCI>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH> | ModelSnapshotType2<PI, FSI>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH> | ModelInstanceType<PI, OI, FCI, FSI>>; | ||
export declare function union<CA, SA, TA, CB, SB, TB>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>): ITypeUnion<CA | CB, SA | SB, TA | TB>; | ||
export declare function union<CA, SA, TA, CB, SB, TB>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>): ITypeUnion<CA | CB, SA | SB, TA | TB>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>): ITypeUnion<CA | CB | CC, SA | SB | SC, TA | TB | TC>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>): ITypeUnion<CA | CB | CC, SA | SB | SC, TA | TB | TC>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>): ITypeUnion<CA | CB | CC | CD, SA | SB | SC | SD, TA | TB | TC | TD>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>): ITypeUnion<CA | CB | CC | CD, SA | SB | SC | SD, TA | TB | TC | TD>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>): ITypeUnion<CA | CB | CC | CD | CE, SA | SB | SC | SD | SE, TA | TB | TC | TD | TE>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>): ITypeUnion<CA | CB | CC | CD | CE, SA | SB | SC | SD | SE, TA | TB | TC | TD | TE>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>): ITypeUnion<CA | CB | CC | CD | CE | CF, SA | SB | SC | SD | SE | SF, TA | TB | TC | TD | TE | TF>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>): ITypeUnion<CA | CB | CC | CD | CE | CF, SA | SB | SC | SD | SE | SF, TA | TB | TC | TD | TE | TF>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>): ITypeUnion<CA | CB | CC | CD | CE | CF | CG, SA | SB | SC | SD | SE | SF | SG, TA | TB | TC | TD | TE | TF | TG>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>): ITypeUnion<CA | CB | CC | CD | CE | CF | CG, SA | SB | SC | SD | SE | SF | SG, TA | TB | TC | TD | TE | TF | TG>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>, H: IType<CH, SH, TH>): ITypeUnion<CA | CB | CC | CD | CE | CF | CG | CH, SA | SB | SC | SD | SE | SF | SG | SH, TA | TB | TC | TD | TE | TF | TG | TH>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>, H: IType<CH, SH, TH>): ITypeUnion<CA | CB | CC | CD | CE | CF | CG | CH, SA | SB | SC | SD | SE | SF | SG | SH, TA | TB | TC | TD | TE | TF | TG | TH>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH, CI, SI, TI>(A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>, H: IType<CH, SH, TH>, I: IType<CI, SI, TI>): ITypeUnion<CA | CB | CC | CD | CE | CF | CG | CH | CI, SA | SB | SC | SD | SE | SF | SG | SH | SI, TA | TB | TC | TD | TE | TF | TG | TH | TI>; | ||
export declare function union<CA, SA, TA, CB, SB, TB, CC, SC, TC, CD, SD, TD, CE, SE, TE, CF, SF, TF, CG, SG, TG, CH, SH, TH, CI, SI, TI>(options: UnionOptions, A: IType<CA, SA, TA>, B: IType<CB, SB, TB>, C: IType<CC, SC, TC>, D: IType<CD, SD, TD>, E: IType<CE, SE, TE>, F: IType<CF, SF, TF>, G: IType<CG, SG, TG>, H: IType<CH, SH, TH>, I: IType<CI, SI, TI>): ITypeUnion<CA | CB | CC | CD | CE | CF | CG | CH | CI, SA | SB | SC | SD | SE | SF | SG | SH | SI, TA | TB | TC | TD | TE | TF | TG | TH | TI>; | ||
export declare function union(...types: IAnyType[]): IAnyType; | ||
@@ -60,0 +44,0 @@ export declare function union(dispatchOrType: UnionOptions | IAnyType, ...otherTypes: IAnyType[]): IAnyType; |
{ | ||
"name": "mobx-state-tree", | ||
"version": "3.7.1", | ||
"version": "3.8.0", | ||
"description": "Opinionated, transactional, MobX powered state container", | ||
@@ -5,0 +5,0 @@ "main": "dist/mobx-state-tree.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
672328
39
12662
1562