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IAAI,EAAS,WAET,IAAI,EAAQ,EAAgB,MAAM,GAElC,EAAK,aAAY,WAAc,OAAO,EAAgB,OAAO,EAAI,IAEjE,EAAM,QAAQ,EAClB,EACA,OAAI,EAAW,EACJ,EAAK,QAAQ,EAAQ,CAAE,MAAO,IAE9B,EAAK,QAAQ,EAC5B,EAw4BA,EAAQ,SAzwCR,SAAkB,EAAY,GAC1B,IAAI,OACoB,IAApB,IAA8B,GAAkB,GACpD,IAAI,EAAgB,EAAK,SAAS,GAClC,OAAO,EAAK,CACJ,UAAW,SAAU,GACjB,MAAI,mBAAsB,EACf,CACH,YAAa,EAAK,QAAQ,GAAe,SAAU,GAC/C,IAAI,EAAW,EAAG,SAClB,OAAO,EAAS,EACpB,GAAG,IAGP,GAAY,iBAAoB,GAAY,EAAS,KAC9C,CACH,YAAa,EAAK,QAAQ,GAAe,SAAU,GAC/C,IAAI,EAAW,EAAG,SAClB,OAAO,EAAS,KAAK,EACzB,GAAG,IAGJ,CACH,YAAa,WAAc,EAEnC,IAlDkB,mBAAX,QAAyB,OAAO,YAAe,gBAoDjC,WACrB,OAAO,IACX,EACA,CACR,EA4uCA,OAAO,eAAe,EAAS,aAAc,CAAE,OAAO,GAEzD","file":"/npm/@iamjulianacosta/mobx-utils@6.0.4/mobx-utils.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@iamjulianacosta/mobx-utils@6.0.4/mobx-utils.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('mobx')) :\n    typeof define === 'function' && define.amd ? define(['exports', 'mobx'], factory) :\n    (global = global || self, factory(global.mobxUtils = {}, global.mobx));\n}(this, (function (exports, mobx) { 'use strict';\n\n    var NOOP = function () { };\n    var IDENTITY = function (_) { return _; };\n    function fail(message) {\n        throw new Error(\"[mobx-utils] \" + message);\n    }\n    function invariant(cond, message) {\n        if (message === void 0) { message = \"Illegal state\"; }\n        if (!cond)\n            fail(message);\n    }\n    function addHiddenProp(object, propName, value) {\n        Object.defineProperty(object, propName, {\n            enumerable: false,\n            writable: true,\n            configurable: true,\n            value: value,\n        });\n    }\n    var deepFields = function (x) {\n        return (x &&\n            x !== Object.prototype &&\n            Object.getOwnPropertyNames(x).concat(deepFields(Object.getPrototypeOf(x)) || []));\n    };\n    var distinctDeepFields = function (x) {\n        var deepFieldsIndistinct = deepFields(x);\n        var deepFieldsDistinct = deepFieldsIndistinct.filter(function (item, index) { return deepFieldsIndistinct.indexOf(item) === index; });\n        return deepFieldsDistinct;\n    };\n    var getAllMethodsAndProperties = function (x) {\n        return distinctDeepFields(x).filter(function (name) { return name !== \"constructor\" && !~name.indexOf(\"__\"); });\n    };\n\n    var PENDING = \"pending\";\n    var FULFILLED = \"fulfilled\";\n    var REJECTED = \"rejected\";\n    function caseImpl(handlers) {\n        switch (this.state) {\n            case PENDING:\n                return handlers.pending && handlers.pending(this.value);\n            case REJECTED:\n                return handlers.rejected && handlers.rejected(this.value);\n            case FULFILLED:\n                return handlers.fulfilled ? handlers.fulfilled(this.value) : this.value;\n        }\n    }\n    /**\n     * `fromPromise` takes a Promise, extends it with 2 observable properties that track\n     * the status of the promise and returns it. The returned object has the following observable properties:\n     *  - `value`: either the initial value, the value the Promise resolved to, or the value the Promise was rejected with. use `.state` if you need to be able to tell the difference.\n     *  - `state`: one of `\"pending\"`, `\"fulfilled\"` or `\"rejected\"`\n     *\n     * And the following methods:\n     * - `case({fulfilled, rejected, pending})`: maps over the result using the provided handlers, or returns `undefined` if a handler isn't available for the current promise state.\n     * - `then((value: TValue) => TResult1 | PromiseLike<TResult1>, [(rejectReason: any) => any])`: chains additional handlers to the provided promise.\n     *\n     * The returned object implements `PromiseLike<TValue>`, so you can chain additional `Promise` handlers using `then`. You may also use it with `await` in `async` functions.\n     *\n     * Note that the status strings are available as constants:\n     * `mobxUtils.PENDING`, `mobxUtils.REJECTED`, `mobxUtil.FULFILLED`\n     *\n     * fromPromise takes an optional second argument, a previously created `fromPromise` based observable.\n     * This is useful to replace one promise based observable with another, without going back to an intermediate\n     * \"pending\" promise state while fetching data. For example:\n     *\n     * @example\n     * \\@observer\n     * class SearchResults extends React.Component {\n     *   \\@observable.ref searchResults\n     *\n     *   componentDidUpdate(nextProps) {\n     *     if (nextProps.query !== this.props.query)\n     *       this.searchResults = fromPromise(\n     *         window.fetch(\"/search?q=\" + nextProps.query),\n     *         // by passing, we won't render a pending state if we had a successful search query before\n     *         // rather, we will keep showing the previous search results, until the new promise resolves (or rejects)\n     *         this.searchResults\n     *       )\n     *   }\n     *\n     *   render() {\n     *     return this.searchResults.case({\n     *        pending: (staleValue) => {\n     *          return staleValue || \"searching\" // <- value might set to previous results while the promise is still pending\n     *        },\n     *        fulfilled: (value) => {\n     *          return value // the fresh results\n     *        },\n     *        rejected: (error) => {\n     *          return \"Oops: \" + error\n     *        }\n     *     })\n     *   }\n     * }\n     *\n     * Observable promises can be created immediately in a certain state using\n     * `fromPromise.reject(reason)` or `fromPromise.resolve(value?)`.\n     * The main advantage of `fromPromise.resolve(value)` over `fromPromise(Promise.resolve(value))` is that the first _synchronously_ starts in the desired state.\n     *\n     * It is possible to directly create a promise using a resolve, reject function:\n     * `fromPromise((resolve, reject) => setTimeout(() => resolve(true), 1000))`\n     *\n     * @example\n     * const fetchResult = fromPromise(fetch(\"http://someurl\"))\n     *\n     * // combine with when..\n     * when(\n     *   () => fetchResult.state !== \"pending\",\n     *   () => {\n     *     console.log(\"Got \", fetchResult.value)\n     *   }\n     * )\n     *\n     * // or a mobx-react component..\n     * const myComponent = observer(({ fetchResult }) => {\n     *   switch(fetchResult.state) {\n     *      case \"pending\": return <div>Loading...</div>\n     *      case \"rejected\": return <div>Ooops... {fetchResult.value}</div>\n     *      case \"fulfilled\": return <div>Gotcha: {fetchResult.value}</div>\n     *   }\n     * })\n     *\n     * // or using the case method instead of switch:\n     *\n     * const myComponent = observer(({ fetchResult }) =>\n     *   fetchResult.case({\n     *     pending:   () => <div>Loading...</div>,\n     *     rejected:  error => <div>Ooops.. {error}</div>,\n     *     fulfilled: value => <div>Gotcha: {value}</div>,\n     *   }))\n     *\n     * // chain additional handler(s) to the resolve/reject:\n     *\n     * fetchResult.then(\n     *   (result) =>  doSomeTransformation(result),\n     *   (rejectReason) => console.error('fetchResult was rejected, reason: ' + rejectReason)\n     * ).then(\n     *   (transformedResult) => console.log('transformed fetchResult: ' + transformedResult)\n     * )\n     *\n     * @param {IThenable<T>} promise The promise which will be observed\n     * @param {IThenable<T>} oldPromise? The previously observed promise\n     * @returns {IPromiseBasedObservable<T>}\n     */\n    function fromPromise(origPromise, oldPromise) {\n        invariant(arguments.length <= 2, \"fromPromise expects up to two arguments\");\n        invariant(typeof origPromise === \"function\" ||\n            (typeof origPromise === \"object\" &&\n                origPromise &&\n                typeof origPromise.then === \"function\"), \"Please pass a promise or function to fromPromise\");\n        if (origPromise.isPromiseBasedObservable === true)\n            return origPromise;\n        if (typeof origPromise === \"function\") {\n            // If it is a (reject, resolve function, wrap it)\n            origPromise = new Promise(origPromise);\n        }\n        var promise = origPromise;\n        origPromise.then(mobx.action(\"observableFromPromise-resolve\", function (value) {\n            promise.value = value;\n            promise.state = FULFILLED;\n        }), mobx.action(\"observableFromPromise-reject\", function (reason) {\n            promise.value = reason;\n            promise.state = REJECTED;\n        }));\n        promise.isPromiseBasedObservable = true;\n        promise.case = caseImpl;\n        var oldData = oldPromise && oldPromise.state === FULFILLED\n            ? oldPromise.value\n            : undefined;\n        mobx.extendObservable(promise, {\n            value: oldData,\n            state: PENDING,\n        }, {}, { deep: false });\n        return promise;\n    }\n    (function (fromPromise) {\n        fromPromise.reject = mobx.action(\"fromPromise.reject\", function (reason) {\n            var p = fromPromise(Promise.reject(reason));\n            p.state = REJECTED;\n            p.value = reason;\n            return p;\n        });\n        function resolveBase(value) {\n            if (value === void 0) { value = undefined; }\n            var p = fromPromise(Promise.resolve(value));\n            p.state = FULFILLED;\n            p.value = value;\n            return p;\n        }\n        fromPromise.resolve = mobx.action(\"fromPromise.resolve\", resolveBase);\n    })(fromPromise || (fromPromise = {}));\n    /**\n     * Returns true if the provided value is a promise-based observable.\n     * @param value any\n     * @returns {boolean}\n     */\n    function isPromiseBasedObservable(value) {\n        return value && value.isPromiseBasedObservable === true;\n    }\n\n    var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n                r[k] = a[j];\n        return r;\n    };\n    /**\n     * Moves an item from one position to another, checking that the indexes given are within bounds.\n     *\n     * @example\n     * const source = observable([1, 2, 3])\n     * moveItem(source, 0, 1)\n     * console.log(source.map(x => x)) // [2, 1, 3]\n     *\n     * @export\n     * @param {ObservableArray<T>} target\n     * @param {number} fromIndex\n     * @param {number} toIndex\n     * @returns {ObservableArray<T>}\n     */\n    function moveItem(target, fromIndex, toIndex) {\n        checkIndex(target, fromIndex);\n        checkIndex(target, toIndex);\n        if (fromIndex === toIndex) {\n            return;\n        }\n        var oldItems = target.slice();\n        var newItems;\n        if (fromIndex < toIndex) {\n            newItems = __spreadArrays(oldItems.slice(0, fromIndex), oldItems.slice(fromIndex + 1, toIndex + 1), [\n                oldItems[fromIndex]\n            ], oldItems.slice(toIndex + 1));\n        }\n        else {\n            // toIndex < fromIndex\n            newItems = __spreadArrays(oldItems.slice(0, toIndex), [\n                oldItems[fromIndex]\n            ], oldItems.slice(toIndex, fromIndex), oldItems.slice(fromIndex + 1));\n        }\n        target.replace(newItems);\n        return target;\n    }\n    /**\n     * Checks whether the specified index is within bounds. Throws if not.\n     *\n     * @private\n     * @param {ObservableArray<any>} target\n     * @param {number }index\n     */\n    function checkIndex(target, index) {\n        if (index < 0) {\n            throw new Error(\"[mobx.array] Index out of bounds: \" + index + \" is negative\");\n        }\n        var length = target.length;\n        if (index >= length) {\n            throw new Error(\"[mobx.array] Index out of bounds: \" + index + \" is not smaller than \" + length);\n        }\n    }\n\n    /**\n     * `lazyObservable` creates an observable around a `fetch` method that will not be invoked\n     * until the observable is needed the first time.\n     * The fetch method receives a `sink` callback which can be used to replace the\n     * current value of the lazyObservable. It is allowed to call `sink` multiple times\n     * to keep the lazyObservable up to date with some external resource.\n     *\n     * Note that it is the `current()` call itself which is being tracked by MobX,\n     * so make sure that you don't dereference to early.\n     *\n     * @example\n     * const userProfile = lazyObservable(\n     *   sink => fetch(\"/myprofile\").then(profile => sink(profile))\n     * )\n     *\n     * // use the userProfile in a React component:\n     * const Profile = observer(({ userProfile }) =>\n     *   userProfile.current() === undefined\n     *   ? <div>Loading user profile...</div>\n     *   : <div>{userProfile.current().displayName}</div>\n     * )\n     *\n     * // triggers refresh the userProfile\n     * userProfile.refresh()\n     *\n     * @param {(sink: (newValue: T) => void) => void} fetch method that will be called the first time the value of this observable is accessed. The provided sink can be used to produce a new value, synchronously or asynchronously\n     * @param {T} [initialValue=undefined] optional initialValue that will be returned from `current` as long as the `sink` has not been called at least once\n     * @returns {{\n     *     current(): T,\n     *     refresh(): T,\n     *     reset(): T\n     *     pending: boolean\n     * }}\n     */\n    function lazyObservable(fetch, initialValue) {\n        if (initialValue === void 0) { initialValue = undefined; }\n        var started = false;\n        var value = mobx.observable.box(initialValue, { deep: false });\n        var pending = mobx.observable.box(false);\n        var currentFnc = function () {\n            if (!started) {\n                started = true;\n                mobx._allowStateChanges(true, function () {\n                    pending.set(true);\n                });\n                fetch(function (newValue) {\n                    mobx._allowStateChanges(true, function () {\n                        value.set(newValue);\n                        pending.set(false);\n                    });\n                });\n            }\n            return value.get();\n        };\n        var resetFnc = mobx.action(\"lazyObservable-reset\", function () {\n            started = false;\n            value.set(initialValue);\n            return value.get();\n        });\n        return {\n            current: currentFnc,\n            refresh: function () {\n                if (started) {\n                    started = false;\n                    return currentFnc();\n                }\n                else {\n                    return value.get();\n                }\n            },\n            reset: function () {\n                return resetFnc();\n            },\n            get pending() {\n                return pending.get();\n            },\n        };\n    }\n\n    /**\n     * `fromResource` creates an observable whose current state can be inspected using `.current()`,\n     * and which can be kept in sync with some external datasource that can be subscribed to.\n     *\n     * The created observable will only subscribe to the datasource if it is in use somewhere,\n     * (un)subscribing when needed. To enable `fromResource` to do that two callbacks need to be provided,\n     * one to subscribe, and one to unsubscribe. The subscribe callback itself will receive a `sink` callback, which can be used\n     * to update the current state of the observable, allowing observes to react.\n     *\n     * Whatever is passed to `sink` will be returned by `current()`. The values passed to the sink will not be converted to\n     * observables automatically, but feel free to do so.\n     * It is the `current()` call itself which is being tracked,\n     * so make sure that you don't dereference to early.\n     *\n     * For inspiration, an example integration with the apollo-client on [github](https://github.com/apollostack/apollo-client/issues/503#issuecomment-241101379),\n     * or the [implementation](https://github.com/mobxjs/mobx-utils/blob/1d17cf7f7f5200937f68cc0b5e7ec7f3f71dccba/src/now.ts#L43-L57) of `mobxUtils.now`\n     *\n     * The following example code creates an observable that connects to a `dbUserRecord`,\n     * which comes from an imaginary database and notifies when it has changed.\n     *\n     * @example\n     * function createObservableUser(dbUserRecord) {\n     *   let currentSubscription;\n     *   return fromResource(\n     *     (sink) => {\n     *       // sink the current state\n     *       sink(dbUserRecord.fields)\n     *       // subscribe to the record, invoke the sink callback whenever new data arrives\n     *       currentSubscription = dbUserRecord.onUpdated(() => {\n     *         sink(dbUserRecord.fields)\n     *       })\n     *     },\n     *     () => {\n     *       // the user observable is not in use at the moment, unsubscribe (for now)\n     *       dbUserRecord.unsubscribe(currentSubscription)\n     *     }\n     *   )\n     * }\n     *\n     * // usage:\n     * const myUserObservable = createObservableUser(myDatabaseConnector.query(\"name = 'Michel'\"))\n     *\n     * // use the observable in autorun\n     * autorun(() => {\n     *   // printed everytime the database updates its records\n     *   console.log(myUserObservable.current().displayName)\n     * })\n     *\n     * // ... or a component\n     * const userComponent = observer(({ user }) =>\n     *   <div>{user.current().displayName}</div>\n     * )\n     *\n     * @export\n     * @template T\n     * @param {(sink: (newValue: T) => void) => void} subscriber\n     * @param {IDisposer} [unsubscriber=NOOP]\n     * @param {T} [initialValue=undefined] the data that will be returned by `get()` until the `sink` has emitted its first data\n     * @returns {{\n     *     current(): T;\n     *     dispose(): void;\n     *     isAlive(): boolean;\n     * }}\n     */\n    function fromResource(subscriber, unsubscriber, initialValue) {\n        if (unsubscriber === void 0) { unsubscriber = NOOP; }\n        if (initialValue === void 0) { initialValue = undefined; }\n        var isActive = false;\n        var isDisposed = false;\n        var value = initialValue;\n        var suspender = function () {\n            if (isActive) {\n                isActive = false;\n                unsubscriber();\n            }\n        };\n        var atom = mobx.createAtom(\"ResourceBasedObservable\", function () {\n            invariant(!isActive && !isDisposed);\n            isActive = true;\n            subscriber(function (newValue) {\n                mobx._allowStateChanges(true, function () {\n                    value = newValue;\n                    atom.reportChanged();\n                });\n            });\n        }, suspender);\n        return {\n            current: function () {\n                invariant(!isDisposed, \"subscribingObservable has already been disposed\");\n                var isBeingTracked = atom.reportObserved();\n                if (!isBeingTracked && !isActive)\n                    console.warn(\"Called `get` of a subscribingObservable outside a reaction. Current value will be returned but no new subscription has started\");\n                return value;\n            },\n            dispose: function () {\n                isDisposed = true;\n                suspender();\n            },\n            isAlive: function () { return isActive; },\n        };\n    }\n\n    var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\n    };\n    function observableSymbol() {\n        return (typeof Symbol === \"function\" && Symbol.observable) || \"@@observable\";\n    }\n    /**\n     * Converts an expression to an observable stream (a.k.a. TC 39 Observable / RxJS observable).\n     * The provided expression is tracked by mobx as long as there are subscribers, automatically\n     * emitting when new values become available. The expressions respect (trans)actions.\n     *\n     * @example\n     *\n     * const user = observable({\n     *   firstName: \"C.S\",\n     *   lastName: \"Lewis\"\n     * })\n     *\n     * Rx.Observable\n     *   .from(mobxUtils.toStream(() => user.firstname + user.lastName))\n     *   .scan(nameChanges => nameChanges + 1, 0)\n     *   .subscribe(nameChanges => console.log(\"Changed name \", nameChanges, \"times\"))\n     *\n     * @export\n     * @template T\n     * @param {() => T} expression\n     * @param {boolean} fireImmediately (by default false)\n     * @returns {IObservableStream<T>}\n     */\n    function toStream(expression, fireImmediately) {\n        var _a;\n        if (fireImmediately === void 0) { fireImmediately = false; }\n        var computedValue = mobx.computed(expression);\n        return _a = {\n                subscribe: function (observer) {\n                    if (\"function\" === typeof observer) {\n                        return {\n                            unsubscribe: mobx.observe(computedValue, function (_a) {\n                                var newValue = _a.newValue;\n                                return observer(newValue);\n                            }, fireImmediately),\n                        };\n                    }\n                    if (observer && \"object\" === typeof observer && observer.next) {\n                        return {\n                            unsubscribe: mobx.observe(computedValue, function (_a) {\n                                var newValue = _a.newValue;\n                                return observer.next(newValue);\n                            }, fireImmediately),\n                        };\n                    }\n                    return {\n                        unsubscribe: function () { },\n                    };\n                }\n            },\n            _a[observableSymbol()] = function () {\n                return this;\n            },\n            _a;\n    }\n    var StreamListener = /** @class */ (function () {\n        function StreamListener(observable, initialValue) {\n            var _this = this;\n            Object.defineProperty(this, \"current\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            Object.defineProperty(this, \"subscription\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            mobx.makeObservable(this);\n            mobx.runInAction(function () {\n                _this.current = initialValue;\n                _this.subscription = observable.subscribe(_this);\n            });\n        }\n        Object.defineProperty(StreamListener.prototype, \"dispose\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                if (this.subscription) {\n                    this.subscription.unsubscribe();\n                }\n            }\n        });\n        Object.defineProperty(StreamListener.prototype, \"next\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (value) {\n                this.current = value;\n            }\n        });\n        Object.defineProperty(StreamListener.prototype, \"complete\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                this.dispose();\n            }\n        });\n        Object.defineProperty(StreamListener.prototype, \"error\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (value) {\n                this.current = value;\n                this.dispose();\n            }\n        });\n        __decorate([\n            mobx.observable.ref\n        ], StreamListener.prototype, \"current\", void 0);\n        __decorate([\n            mobx.action.bound\n        ], StreamListener.prototype, \"next\", null);\n        __decorate([\n            mobx.action.bound\n        ], StreamListener.prototype, \"complete\", null);\n        __decorate([\n            mobx.action.bound\n        ], StreamListener.prototype, \"error\", null);\n        return StreamListener;\n    }());\n    function fromStream(observable, initialValue) {\n        if (initialValue === void 0) { initialValue = undefined; }\n        return new StreamListener(observable, initialValue);\n    }\n\n    var __assign = (undefined && undefined.__assign) || function () {\n        __assign = Object.assign || function(t) {\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\n                s = arguments[i];\n                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n                    t[p] = s[p];\n            }\n            return t;\n        };\n        return __assign.apply(this, arguments);\n    };\n    var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\n    };\n    var RESERVED_NAMES = [\"model\", \"reset\", \"submit\", \"isDirty\", \"isPropertyDirty\", \"resetProperty\"];\n    var ViewModel = /** @class */ (function () {\n        function ViewModel(model) {\n            var _this = this;\n            Object.defineProperty(this, \"model\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: model\n            });\n            Object.defineProperty(this, \"localValues\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: mobx.observable.map({})\n            });\n            Object.defineProperty(this, \"localComputedValues\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: mobx.observable.map({})\n            });\n            Object.defineProperty(this, \"isPropertyDirty\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: function (key) {\n                    return _this.localValues.has(key);\n                }\n            });\n            mobx.makeObservable(this);\n            invariant(mobx.isObservableObject(model), \"createViewModel expects an observable object\");\n            var ownMethodsAndProperties = getAllMethodsAndProperties(this);\n            // use this helper as Object.getOwnPropertyNames doesn't return getters\n            getAllMethodsAndProperties(model).forEach(function (key) {\n                var _a;\n                if (ownMethodsAndProperties.includes(key)) {\n                    return;\n                }\n                if (key === mobx.$mobx || key === \"__mobxDidRunLazyInitializers\") {\n                    return;\n                }\n                invariant(RESERVED_NAMES.indexOf(key) === -1, \"The propertyname \" + key + \" is reserved and cannot be used with viewModels\");\n                if (mobx.isComputedProp(model, key)) {\n                    var computedBox = mobx._getAdministration(model, key); // Fixme: there is no clear api to get the derivation\n                    var get = computedBox.derivation.bind(_this);\n                    var set = (_a = computedBox.setter_) === null || _a === void 0 ? void 0 : _a.bind(_this);\n                    _this.localComputedValues.set(key, mobx.computed(get, { set: set }));\n                }\n                var descriptor = Object.getOwnPropertyDescriptor(model, key);\n                var additionalDescriptor = descriptor ? { enumerable: descriptor.enumerable } : {};\n                Object.defineProperty(_this, key, __assign(__assign({}, additionalDescriptor), { configurable: true, get: function () {\n                        if (mobx.isComputedProp(model, key))\n                            return _this.localComputedValues.get(key).get();\n                        if (_this.isPropertyDirty(key))\n                            return _this.localValues.get(key);\n                        else\n                            return _this.model[key];\n                    }, set: mobx.action(function (value) {\n                        if (mobx.isComputedProp(model, key)) {\n                            _this.localComputedValues.get(key).set(value);\n                        }\n                        else if (value !== _this.model[key]) {\n                            _this.localValues.set(key, value);\n                        }\n                        else {\n                            _this.localValues.delete(key);\n                        }\n                    }) }));\n            });\n        }\n        Object.defineProperty(ViewModel.prototype, \"isDirty\", {\n            get: function () {\n                return this.localValues.size > 0;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewModel.prototype, \"changedValues\", {\n            get: function () {\n                return new Map(this.localValues);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        Object.defineProperty(ViewModel.prototype, \"submit\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                var _this = this;\n                mobx.keys(this.localValues).forEach(function (key) {\n                    var source = _this.localValues.get(key);\n                    var destination = _this.model[key];\n                    if (mobx.isObservableArray(destination)) {\n                        destination.replace(source);\n                    }\n                    else if (mobx.isObservableMap(destination)) {\n                        destination.clear();\n                        destination.merge(source);\n                    }\n                    else if (!mobx.isComputed(source)) {\n                        _this.model[key] = source;\n                    }\n                });\n                this.localValues.clear();\n            }\n        });\n        Object.defineProperty(ViewModel.prototype, \"reset\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                this.localValues.clear();\n            }\n        });\n        Object.defineProperty(ViewModel.prototype, \"resetProperty\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (key) {\n                this.localValues.delete(key);\n            }\n        });\n        __decorate$1([\n            mobx.computed\n        ], ViewModel.prototype, \"isDirty\", null);\n        __decorate$1([\n            mobx.computed\n        ], ViewModel.prototype, \"changedValues\", null);\n        __decorate$1([\n            mobx.action.bound\n        ], ViewModel.prototype, \"submit\", null);\n        __decorate$1([\n            mobx.action.bound\n        ], ViewModel.prototype, \"reset\", null);\n        __decorate$1([\n            mobx.action.bound\n        ], ViewModel.prototype, \"resetProperty\", null);\n        return ViewModel;\n    }());\n    /**\n     * `createViewModel` takes an object with observable properties (model)\n     * and wraps a viewmodel around it. The viewmodel proxies all enumerable properties of the original model with the following behavior:\n     *  - as long as no new value has been assigned to the viewmodel property, the original property will be returned.\n     *  - any future change in the model will be visible in the viewmodel as well unless the viewmodel property was dirty at the time of the attempted change.\n     *  - once a new value has been assigned to a property of the viewmodel, that value will be returned during a read of that property in the future. However, the original model remain untouched until `submit()` is called.\n     *\n     * The viewmodel exposes the following additional methods, besides all the enumerable properties of the model:\n     * - `submit()`: copies all the values of the viewmodel to the model and resets the state\n     * - `reset()`: resets the state of the viewmodel, abandoning all local modifications\n     * - `resetProperty(propName)`: resets the specified property of the viewmodel\n     * - `isDirty`: observable property indicating if the viewModel contains any modifications\n     * - `isPropertyDirty(propName)`: returns true if the specified property is dirty\n     * - `changedValues`: returns a key / value map with the properties that have been changed in the model so far\n     * - `model`: The original model object for which this viewModel was created\n     *\n     * You may use observable arrays, maps and objects with `createViewModel` but keep in mind to assign fresh instances of those to the viewmodel's properties, otherwise you would end up modifying the properties of the original model.\n     * Note that if you read a non-dirty property, viewmodel only proxies the read to the model. You therefore need to assign a fresh instance not only the first time you make the assignment but also after calling `reset()` or `submit()`.\n     *\n     * @example\n     * class Todo {\n     *   \\@observable title = \"Test\"\n     * }\n     *\n     * const model = new Todo()\n     * const viewModel = createViewModel(model);\n     *\n     * autorun(() => console.log(viewModel.model.title, \",\", viewModel.title))\n     * // prints \"Test, Test\"\n     * model.title = \"Get coffee\"\n     * // prints \"Get coffee, Get coffee\", viewModel just proxies to model\n     * viewModel.title = \"Get tea\"\n     * // prints \"Get coffee, Get tea\", viewModel's title is now dirty, and the local value will be printed\n     * viewModel.submit()\n     * // prints \"Get tea, Get tea\", changes submitted from the viewModel to the model, viewModel is proxying again\n     * viewModel.title = \"Get cookie\"\n     * // prints \"Get tea, Get cookie\" // viewModel has diverged again\n     * viewModel.reset()\n     * // prints \"Get tea, Get tea\", changes of the viewModel have been abandoned\n     *\n     * @param {T} model\n     * @returns {(T & IViewModel<T>)}\n     * ```\n     */\n    function createViewModel(model) {\n        return new ViewModel(model);\n    }\n\n    /**\n     * MobX normally suspends any computed value that is not in use by any reaction,\n     * and lazily re-evaluates the expression if needed outside a reaction while not in use.\n     * `keepAlive` marks a computed value as always in use, meaning that it will always fresh, but never disposed automatically.\n     *\n     * @example\n     * const obj = observable({\n     *   number: 3,\n     *   doubler: function() { return this.number * 2 }\n     * })\n     * const stop = keepAlive(obj, \"doubler\")\n     *\n     * @param {Object} target an object that has a computed property, created by `@computed` or `extendObservable`\n     * @param {string} property the name of the property to keep alive\n     * @returns {IDisposer} stops this keep alive so that the computed value goes back to normal behavior\n     */\n    /**\n     * @example\n     * const number = observable(3)\n     * const doubler = computed(() => number.get() * 2)\n     * const stop = keepAlive(doubler)\n     * // doubler will now stay in sync reactively even when there are no further observers\n     * stop()\n     * // normal behavior, doubler results will be recomputed if not observed but needed, but lazily\n     *\n     * @param {IComputedValue<any>} computedValue created using the `computed` function\n     * @returns {IDisposer} stops this keep alive so that the computed value goes back to normal behavior\n     */\n    function keepAlive(_1, _2) {\n        var computed = mobx.getAtom(_1, _2);\n        if (!computed)\n            throw new Error(\"No computed provided, please provide an object created with `computed(() => expr)` or an object + property name\");\n        return mobx.observe(computed, function () { });\n    }\n\n    /**\n     * `queueProcessor` takes an observable array, observes it and calls `processor`\n     * once for each item added to the observable array, optionally debouncing the action\n     *\n     * @example\n     * const pendingNotifications = observable([])\n     * const stop = queueProcessor(pendingNotifications, msg => {\n     *   // show Desktop notification\n     *   new Notification(msg);\n     * })\n     *\n     * // usage:\n     * pendingNotifications.push(\"test!\")\n     *\n     * @param {T[]} observableArray observable array instance to track\n     * @param {(item: T) => void} processor action to call per item\n     * @param {number} [debounce=0] optional debounce time in ms. With debounce 0 the processor will run synchronously\n     * @returns {IDisposer} stops the processor\n     */\n    function queueProcessor(observableArray, processor, debounce) {\n        if (debounce === void 0) { debounce = 0; }\n        if (!mobx.isObservableArray(observableArray))\n            throw new Error(\"Expected observable array as first argument\");\n        if (!mobx.isAction(processor))\n            processor = mobx.action(\"queueProcessor\", processor);\n        var runner = function () {\n            // construct a final set\n            var items = observableArray.slice(0);\n            // clear the queue for next iteration\n            mobx.runInAction(function () { return observableArray.splice(0); });\n            // fire processor\n            items.forEach(processor);\n        };\n        if (debounce > 0)\n            return mobx.autorun(runner, { delay: debounce });\n        else\n            return mobx.autorun(runner);\n    }\n\n    /**\n     * `chunkProcessor` takes an observable array, observes it and calls `processor`\n     * once for a chunk of items added to the observable array, optionally deboucing the action.\n     * The maximum chunk size can be limited by number.\n     * This allows both, splitting larger into smaller chunks or (when debounced) combining smaller\n     * chunks and/or single items into reasonable chunks of work.\n     *\n     * @example\n     * const trackedActions = observable([])\n     * const stop = chunkProcessor(trackedActions, chunkOfMax10Items => {\n     *   sendTrackedActionsToServer(chunkOfMax10Items);\n     * }, 100, 10)\n     *\n     * // usage:\n     * trackedActions.push(\"scrolled\")\n     * trackedActions.push(\"hoveredButton\")\n     * // when both pushes happen within 100ms, there will be only one call to server\n     *\n     * @param {T[]} observableArray observable array instance to track\n     * @param {(item: T[]) => void} processor action to call per item\n     * @param {number} [debounce=0] optional debounce time in ms. With debounce 0 the processor will run synchronously\n     * @param {number} [maxChunkSize=0] optionally do not call on full array but smaller chunks. With 0 it will process the full array.\n     * @returns {IDisposer} stops the processor\n     */\n    function chunkProcessor(observableArray, processor, debounce, maxChunkSize) {\n        if (debounce === void 0) { debounce = 0; }\n        if (maxChunkSize === void 0) { maxChunkSize = 0; }\n        if (!mobx.isObservableArray(observableArray))\n            throw new Error(\"Expected observable array as first argument\");\n        if (!mobx.isAction(processor))\n            processor = mobx.action(\"chunkProcessor\", processor);\n        var runner = function () {\n            var _loop_1 = function () {\n                var chunkSize = maxChunkSize === 0\n                    ? observableArray.length\n                    : Math.min(observableArray.length, maxChunkSize);\n                // construct a final set\n                var items = observableArray.slice(0, chunkSize);\n                // clear the slice for next iteration\n                mobx.runInAction(function () { return observableArray.splice(0, chunkSize); });\n                // fire processor\n                processor(items);\n            };\n            while (observableArray.length > 0) {\n                _loop_1();\n            }\n        };\n        if (debounce > 0)\n            return mobx.autorun(runner, { delay: debounce });\n        else\n            return mobx.autorun(runner);\n    }\n\n    var tickers = {};\n    /**\n     * Returns the current date time as epoch number.\n     * The date time is read from an observable which is updated automatically after the given interval.\n     * So basically it treats time as an observable.\n     *\n     * The function takes an interval as parameter, which indicates how often `now()` will return a new value.\n     * If no interval is given, it will update each second. If \"frame\" is specified, it will update each time a\n     * `requestAnimationFrame` is available.\n     *\n     * Multiple clocks with the same interval will automatically be synchronized.\n     *\n     * Countdown example: https://jsfiddle.net/mweststrate/na0qdmkw/\n     *\n     * @example\n     *\n     * const start = Date.now()\n     *\n     * autorun(() => {\n     *   console.log(\"Seconds elapsed: \", (mobxUtils.now() - start) / 1000)\n     * })\n     *\n     *\n     * @export\n     * @param {(number | \"frame\")} [interval=1000] interval in milliseconds about how often the interval should update\n     * @returns\n     */\n    function now(interval) {\n        if (interval === void 0) { interval = 1000; }\n        if (!mobx._isComputingDerivation()) {\n            // See #40\n            return Date.now();\n        }\n        if (!tickers[interval]) {\n            if (typeof interval === \"number\")\n                tickers[interval] = createIntervalTicker(interval);\n            else\n                tickers[interval] = createAnimationFrameTicker();\n        }\n        return tickers[interval].current();\n    }\n    function createIntervalTicker(interval) {\n        var subscriptionHandle;\n        return fromResource(function (sink) {\n            sink(Date.now());\n            subscriptionHandle = setInterval(function () { return sink(Date.now()); }, interval);\n        }, function () {\n            clearInterval(subscriptionHandle);\n        }, Date.now());\n    }\n    function createAnimationFrameTicker() {\n        var frameBasedTicker = fromResource(function (sink) {\n            sink(Date.now());\n            function scheduleTick() {\n                window.requestAnimationFrame(function () {\n                    sink(Date.now());\n                    if (frameBasedTicker.isAlive())\n                        scheduleTick();\n                });\n            }\n            scheduleTick();\n        }, function () { }, Date.now());\n        return frameBasedTicker;\n    }\n\n    /**\n     *`expr` can be used to create temporary computed values inside computed values.\n     * Nesting computed values is useful to create cheap computations in order to prevent expensive computations from needing to run.\n     * In the following example the expression prevents that a component is rerender _each time_ the selection changes;\n     * instead it will only rerenders when the current todo is (de)selected.\n     *\n     * `expr(func)` is an alias for `computed(func).get()`.\n     * Please note that the function given to `expr` is evaluated _twice_ in the scenario that the overall expression value changes.\n     * It is evaluated the first time when any observables it depends on change.\n     * It is evaluated a second time when a change in its value triggers the outer computed or reaction to evaluate, which recreates and reevaluates the expression.\n     *\n     * In the following example, the expression prevents the `TodoView` component from being re-rendered if the selection changes elsewhere.\n     * Instead, the component will only re-render when the relevant todo is (de)selected, which happens much less frequently.\n     *\n     * @example\n     * const Todo = observer((props) => {\n     *     const todo = props.todo\n     *     const isSelected = mobxUtils.expr(() => props.viewState.selection === todo)\n     * const TodoView = observer(({ todo, editorState }) => {\n     *     const isSelected = mobxUtils.expr(() => editorState.selection === todo)\n     *     return <div className={isSelected ? \"todo todo-selected\" : \"todo\"}>{todo.title}</div>\n     * })\n     */\n    function expr(expr) {\n        if (!mobx._isComputingDerivation())\n            console.warn(\"'expr' should only be used inside other reactive functions.\");\n        // optimization: would be more efficient if the expr itself wouldn't be evaluated first on the next change, but just a 'changed' signal would be fired\n        return mobx.computed(expr).get();\n    }\n\n    var __assign$1 = (undefined && undefined.__assign) || function () {\n        __assign$1 = Object.assign || function(t) {\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\n                s = arguments[i];\n                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n                    t[p] = s[p];\n            }\n            return t;\n        };\n        return __assign$1.apply(this, arguments);\n    };\n    var memoizationId = 0;\n    /**\n     * Creates a function that maps an object to a view.\n     * The mapping is memoized.\n     *\n     * See the [transformer](#createtransformer-in-detail) section for more details.\n     *\n     * @param transformer\n     * @param onCleanup\n     */\n    function createTransformer(transformer, arg2) {\n        invariant(typeof transformer === \"function\" && transformer.length < 2, \"createTransformer expects a function that accepts one argument\");\n        // Memoizes: object id -> reactive view that applies transformer to the object\n        var views = {};\n        var onCleanup = undefined;\n        var keepAlive = false;\n        var debugNameGenerator = undefined;\n        if (typeof arg2 === \"object\") {\n            onCleanup = arg2.onCleanup;\n            keepAlive = arg2.keepAlive !== undefined ? arg2.keepAlive : false;\n            debugNameGenerator = arg2.debugNameGenerator;\n        }\n        else if (typeof arg2 === \"function\") {\n            onCleanup = arg2;\n        }\n        function createView(sourceIdentifier, sourceObject) {\n            var latestValue;\n            var computedValueOptions = {};\n            if (typeof arg2 === \"object\") {\n                onCleanup = arg2.onCleanup;\n                debugNameGenerator = arg2.debugNameGenerator;\n                computedValueOptions = arg2;\n            }\n            else if (typeof arg2 === \"function\") {\n                onCleanup = arg2;\n            }\n            else {\n                onCleanup = undefined;\n                debugNameGenerator = undefined;\n            }\n            var prettifiedName = debugNameGenerator\n                ? debugNameGenerator(sourceObject)\n                : \"Transformer-\" + transformer.name + \"-\" + sourceIdentifier;\n            var expr = mobx.computed(function () {\n                return (latestValue = transformer(sourceObject));\n            }, __assign$1(__assign$1({}, computedValueOptions), { name: prettifiedName }));\n            if (!keepAlive) {\n                var disposer_1 = mobx.onBecomeUnobserved(expr, function () {\n                    delete views[sourceIdentifier];\n                    disposer_1();\n                    if (onCleanup)\n                        onCleanup(latestValue, sourceObject);\n                });\n            }\n            return expr;\n        }\n        var memoWarned = false;\n        return function (object) {\n            var identifier = getMemoizationId(object);\n            var reactiveView = views[identifier];\n            if (reactiveView)\n                return reactiveView.get();\n            if (!keepAlive && !mobx._isComputingDerivation()) {\n                if (!memoWarned) {\n                    console.warn(\"invoking a transformer from outside a reactive context won't memorized \" +\n                        \"and is cleaned up immediately, unless keepAlive is set\");\n                    memoWarned = true;\n                }\n                var value = transformer(object);\n                if (onCleanup)\n                    onCleanup(value, object);\n                return value;\n            }\n            // Not in cache; create a reactive view\n            reactiveView = views[identifier] = createView(identifier, object);\n            return reactiveView.get();\n        };\n    }\n    function getMemoizationId(object) {\n        var objectType = typeof object;\n        if (objectType === \"string\")\n            return \"string:\" + object;\n        if (objectType === \"number\")\n            return \"number:\" + object;\n        if (object === null || (objectType !== \"object\" && objectType !== \"function\"))\n            throw new Error(\"[mobx-utils] transform expected an object, function, string or number, got: \" + String(object));\n        var tid = object.$transformId;\n        if (tid === undefined) {\n            tid = \"memoizationId:\" + ++memoizationId;\n            addHiddenProp(object, \"$transformId\", tid);\n        }\n        return tid;\n    }\n\n    function buildPath(entry) {\n        if (!entry)\n            return \"ROOT\";\n        var res = [];\n        while (entry.parent) {\n            res.push(entry.path);\n            entry = entry.parent;\n        }\n        return res.reverse().join(\"/\");\n    }\n    function isRecursivelyObservable(thing) {\n        return mobx.isObservableObject(thing) || mobx.isObservableArray(thing) || mobx.isObservableMap(thing);\n    }\n    /**\n     * Given an object, deeply observes the given object.\n     * It is like `observe` from mobx, but applied recursively, including all future children.\n     *\n     * Note that the given object cannot ever contain cycles and should be a tree.\n     *\n     * As benefit: path and root will be provided in the callback, so the signature of the listener is\n     * (change, path, root) => void\n     *\n     * The returned disposer can be invoked to clean up the listener\n     *\n     * deepObserve cannot be used on computed values.\n     *\n     * @example\n     * const disposer = deepObserve(target, (change, path) => {\n     *    console.dir(change)\n     * })\n     */\n    function deepObserve(target, listener) {\n        var entrySet = new WeakMap();\n        function genericListener(change) {\n            var entry = entrySet.get(change.object);\n            processChange(change, entry);\n            listener(change, buildPath(entry), target);\n        }\n        function processChange(change, parent) {\n            switch (change.type) {\n                // Object changes\n                case \"add\": // also for map\n                    observeRecursively(change.newValue, parent, change.name);\n                    break;\n                case \"update\": // also for array and map\n                    unobserveRecursively(change.oldValue);\n                    observeRecursively(change.newValue, parent, change.name || \"\" + change.index);\n                    break;\n                case \"remove\": // object\n                case \"delete\": // map\n                    unobserveRecursively(change.oldValue);\n                    break;\n                // Array changes\n                case \"splice\":\n                    change.removed.map(unobserveRecursively);\n                    change.added.forEach(function (value, idx) {\n                        return observeRecursively(value, parent, \"\" + (change.index + idx));\n                    });\n                    // update paths\n                    for (var i = change.index + change.addedCount; i < change.object.length; i++) {\n                        if (isRecursivelyObservable(change.object[i])) {\n                            var entry = entrySet.get(change.object[i]);\n                            if (entry)\n                                entry.path = \"\" + i;\n                        }\n                    }\n                    break;\n            }\n        }\n        function observeRecursively(thing, parent, path) {\n            if (isRecursivelyObservable(thing)) {\n                var entry = entrySet.get(thing);\n                if (entry) {\n                    if (entry.parent !== parent || entry.path !== path)\n                        // MWE: this constraint is artificial, and this tool could be made to work with cycles,\n                        // but it increases administration complexity, has tricky edge cases and the meaning of 'path'\n                        // would become less clear. So doesn't seem to be needed for now\n                        throw new Error(\"The same observable object cannot appear twice in the same tree,\" +\n                            (\" trying to assign it to '\" + buildPath(parent) + \"/\" + path + \"',\") +\n                            (\" but it already exists at '\" + buildPath(entry.parent) + \"/\" + entry.path + \"'\"));\n                }\n                else {\n                    var entry_1 = {\n                        parent: parent,\n                        path: path,\n                        dispose: mobx.observe(thing, genericListener),\n                    };\n                    entrySet.set(thing, entry_1);\n                    mobx.entries(thing).forEach(function (_a) {\n                        var key = _a[0], value = _a[1];\n                        return observeRecursively(value, entry_1, key);\n                    });\n                }\n            }\n        }\n        function unobserveRecursively(thing) {\n            if (isRecursivelyObservable(thing)) {\n                var entry = entrySet.get(thing);\n                if (!entry)\n                    return;\n                entrySet.delete(thing);\n                entry.dispose();\n                mobx.values(thing).forEach(unobserveRecursively);\n            }\n        }\n        observeRecursively(target, undefined, \"\");\n        return function () {\n            unobserveRecursively(target);\n        };\n    }\n\n    var __extends = (undefined && undefined.__extends) || (function () {\n        var extendStatics = function (d, b) {\n            extendStatics = Object.setPrototypeOf ||\n                ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n                function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n            return extendStatics(d, b);\n        };\n        return function (d, b) {\n            extendStatics(d, b);\n            function __() { this.constructor = d; }\n            d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n        };\n    })();\n    /**\n     * Reactively sorts a base observable array into multiple observable arrays based on the value of a\n     * `groupBy: (item: T) => G` function.\n     *\n     * This observes the individual computed groupBy values and only updates the source and dest arrays\n     * when there is an actual change, so this is far more efficient than, for example\n     * `base.filter(i => groupBy(i) === 'we')`. Call #dispose() to stop tracking.\n     *\n     * No guarantees are made about the order of items in the grouped arrays.\n     *\n     * The resulting map of arrays is read-only. clear(), set(), delete() are not supported and\n     * modifying the group arrays will lead to undefined behavior.\n     *\n     * NB: ObservableGroupMap relies on `Symbol`s. If you are targeting a platform which doesn't\n     * support these natively, you will need to provide a polyfill.\n     *\n     * @param {array} base The array to sort into groups.\n     * @param {function} groupBy The function used for grouping.\n     * @param options Object with properties:\n     *  `name`: Debug name of this ObservableGroupMap.\n     *  `keyToName`: Function to create the debug names of the observable group arrays.\n     *\n     * @example\n     * const slices = observable([\n     *     { day: \"mo\", hours: 12 },\n     *     { day: \"tu\", hours: 2 },\n     * ])\n     * const slicesByDay = new ObservableGroupMap(slices, (slice) => slice.day)\n     * autorun(() => console.log(\n     *     slicesByDay.get(\"mo\")?.length ?? 0,\n     *     slicesByDay.get(\"we\"))) // outputs 1, undefined\n     * slices[0].day = \"we\" // outputs 0, [{ day: \"we\", hours: 12 }]\n     */\n    var ObservableGroupMap = /** @class */ (function (_super) {\n        __extends(ObservableGroupMap, _super);\n        function ObservableGroupMap(base, groupBy, _a) {\n            var _b = _a === void 0 ? {} : _a, _c = _b.name, name = _c === void 0 ? \"ogm\" + ((Math.random() * 1000) | 0) : _c, _d = _b.keyToName, keyToName = _d === void 0 ? function (x) { return \"\" + x; } : _d;\n            var _this = _super.call(this) || this;\n            /**\n             * Base observable array which is being sorted into groups.\n             */\n            Object.defineProperty(_this, \"_base\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            /**\n             * The ObservableGroupMap needs to track some state per-item. This is the name/symbol of the\n             * property used to attach the state.\n             */\n            Object.defineProperty(_this, \"_ogmInfoKey\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            /**\n             * The function used to group the items.\n             */\n            Object.defineProperty(_this, \"_groupBy\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            /**\n             * This function is used to generate the mobx debug names of the observable group arrays.\n             */\n            Object.defineProperty(_this, \"_keyToName\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            Object.defineProperty(_this, \"_disposeBaseObserver\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            _this._keyToName = keyToName;\n            _this._groupBy = groupBy;\n            _this._ogmInfoKey = Symbol(\"ogmInfo\" + name);\n            _this._base = base;\n            for (var i = 0; i < base.length; i++) {\n                _this._addItem(base[i]);\n            }\n            _this._disposeBaseObserver = mobx.observe(_this._base, function (change) {\n                if (\"splice\" === change.type) {\n                    mobx.transaction(function () {\n                        for (var _i = 0, _a = change.removed; _i < _a.length; _i++) {\n                            var removed = _a[_i];\n                            _this._removeItem(removed);\n                        }\n                        for (var _b = 0, _c = change.added; _b < _c.length; _b++) {\n                            var added = _c[_b];\n                            _this._addItem(added);\n                        }\n                    });\n                }\n                else if (\"update\" === change.type) {\n                    mobx.transaction(function () {\n                        _this._removeItem(change.oldValue);\n                        _this._addItem(change.newValue);\n                    });\n                }\n                else {\n                    throw new Error(\"illegal state\");\n                }\n            });\n            return _this;\n        }\n        Object.defineProperty(ObservableGroupMap.prototype, \"clear\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                throw new Error(\"not supported\");\n            }\n        });\n        Object.defineProperty(ObservableGroupMap.prototype, \"delete\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (_key) {\n                throw new Error(\"not supported\");\n            }\n        });\n        Object.defineProperty(ObservableGroupMap.prototype, \"set\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (_key, _value) {\n                throw new Error(\"not supported\");\n            }\n        });\n        /**\n         * Disposes all observers created during construction and removes state added to base array\n         * items.\n         */\n        Object.defineProperty(ObservableGroupMap.prototype, \"dispose\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                this._disposeBaseObserver();\n                for (var i = 0; i < this._base.length; i++) {\n                    var item = this._base[i];\n                    var grouperItemInfo = item[this._ogmInfoKey];\n                    grouperItemInfo.reaction();\n                    delete item[this._ogmInfoKey];\n                }\n            }\n        });\n        Object.defineProperty(ObservableGroupMap.prototype, \"_getGroupArr\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (key) {\n                var result = _super.prototype.get.call(this, key);\n                if (undefined === result) {\n                    result = mobx.observable([], { name: \"GroupArray[\" + this._keyToName(key) + \"]\", deep: false });\n                    _super.prototype.set.call(this, key, result);\n                }\n                return result;\n            }\n        });\n        Object.defineProperty(ObservableGroupMap.prototype, \"_removeFromGroupArr\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (key, itemIndex) {\n                var arr = _super.prototype.get.call(this, key);\n                if (1 === arr.length) {\n                    _super.prototype.delete.call(this, key);\n                }\n                else if (itemIndex === arr.length - 1) {\n                    // last position in array\n                    arr.length--;\n                }\n                else {\n                    arr[itemIndex] = arr[arr.length - 1];\n                    arr[itemIndex][this._ogmInfoKey].groupArrIndex = itemIndex;\n                    arr.length--;\n                }\n            }\n        });\n        Object.defineProperty(ObservableGroupMap.prototype, \"_addItem\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (item) {\n                var _this = this;\n                var groupByValue = this._groupBy(item);\n                var groupArr = this._getGroupArr(groupByValue);\n                var value = {\n                    groupByValue: groupByValue,\n                    groupArrIndex: groupArr.length,\n                    reaction: mobx.reaction(function () { return _this._groupBy(item); }, function (newGroupByValue, _r) {\n                        var grouperItemInfo = item[_this._ogmInfoKey];\n                        _this._removeFromGroupArr(grouperItemInfo.groupByValue, grouperItemInfo.groupArrIndex);\n                        var newGroupArr = _this._getGroupArr(newGroupByValue);\n                        var newGroupArrIndex = newGroupArr.length;\n                        newGroupArr.push(item);\n                        grouperItemInfo.groupByValue = newGroupByValue;\n                        grouperItemInfo.groupArrIndex = newGroupArrIndex;\n                    }),\n                };\n                Object.defineProperty(item, this._ogmInfoKey, {\n                    configurable: true,\n                    enumerable: false,\n                    value: value,\n                });\n                groupArr.push(item);\n            }\n        });\n        Object.defineProperty(ObservableGroupMap.prototype, \"_removeItem\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (item) {\n                var grouperItemInfo = item[this._ogmInfoKey];\n                this._removeFromGroupArr(grouperItemInfo.groupByValue, grouperItemInfo.groupArrIndex);\n                grouperItemInfo.reaction();\n                delete item[this._ogmInfoKey];\n            }\n        });\n        return ObservableGroupMap;\n    }(mobx.ObservableMap));\n\n    /**\n     * @private\n     */\n    var DeepMapEntry = /** @class */ (function () {\n        function DeepMapEntry(base, args) {\n            Object.defineProperty(this, \"base\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: base\n            });\n            Object.defineProperty(this, \"args\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: args\n            });\n            Object.defineProperty(this, \"root\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            Object.defineProperty(this, \"closest\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n            Object.defineProperty(this, \"closestIdx\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: 0\n            });\n            Object.defineProperty(this, \"isDisposed\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: false\n            });\n            var current = (this.closest = this.root = base);\n            var i = 0;\n            for (; i < this.args.length - 1; i++) {\n                current = current.get(args[i]);\n                if (current)\n                    this.closest = current;\n                else\n                    break;\n            }\n            this.closestIdx = i;\n        }\n        Object.defineProperty(DeepMapEntry.prototype, \"exists\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                this.assertNotDisposed();\n                var l = this.args.length;\n                return this.closestIdx >= l - 1 && this.closest.has(this.args[l - 1]);\n            }\n        });\n        Object.defineProperty(DeepMapEntry.prototype, \"get\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                this.assertNotDisposed();\n                if (!this.exists())\n                    throw new Error(\"Entry doesn't exist\");\n                return this.closest.get(this.args[this.args.length - 1]);\n            }\n        });\n        Object.defineProperty(DeepMapEntry.prototype, \"set\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (value) {\n                this.assertNotDisposed();\n                var l = this.args.length;\n                var current = this.closest;\n                // create remaining maps\n                for (var i = this.closestIdx; i < l - 1; i++) {\n                    var m = new Map();\n                    current.set(this.args[i], m);\n                    current = m;\n                }\n                this.closestIdx = l - 1;\n                this.closest = current;\n                current.set(this.args[l - 1], value);\n            }\n        });\n        Object.defineProperty(DeepMapEntry.prototype, \"delete\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                this.assertNotDisposed();\n                if (!this.exists())\n                    throw new Error(\"Entry doesn't exist\");\n                var l = this.args.length;\n                this.closest.delete(this.args[l - 1]);\n                // clean up remaining maps if needed (reconstruct stack first)\n                var c = this.root;\n                var maps = [c];\n                for (var i = 0; i < l - 1; i++) {\n                    c = c.get(this.args[i]);\n                    maps.push(c);\n                }\n                for (var i = maps.length - 1; i > 0; i--) {\n                    if (maps[i].size === 0)\n                        maps[i - 1].delete(this.args[i - 1]);\n                }\n                this.isDisposed = true;\n            }\n        });\n        Object.defineProperty(DeepMapEntry.prototype, \"assertNotDisposed\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function () {\n                // TODO: once this becomes annoying, we should introduce a reset method to re-run the constructor logic\n                if (this.isDisposed)\n                    throw new Error(\"Concurrent modification exception\");\n            }\n        });\n        return DeepMapEntry;\n    }());\n    /**\n     * @private\n     */\n    var DeepMap = /** @class */ (function () {\n        function DeepMap() {\n            Object.defineProperty(this, \"store\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: new Map()\n            });\n            Object.defineProperty(this, \"argsLength\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: -1\n            });\n            Object.defineProperty(this, \"last\", {\n                enumerable: true,\n                configurable: true,\n                writable: true,\n                value: void 0\n            });\n        }\n        Object.defineProperty(DeepMap.prototype, \"entry\", {\n            enumerable: false,\n            configurable: true,\n            writable: true,\n            value: function (args) {\n                if (this.argsLength === -1)\n                    this.argsLength = args.length;\n                else if (this.argsLength !== args.length)\n                    throw new Error(\"DeepMap should be used with functions with a consistent length, expected: \" + this.argsLength + \", got: \" + args.length);\n                if (this.last)\n                    this.last.isDisposed = true;\n                return (this.last = new DeepMapEntry(this.store, args));\n            }\n        });\n        return DeepMap;\n    }());\n\n    var __assign$2 = (undefined && undefined.__assign) || function () {\n        __assign$2 = Object.assign || function(t) {\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\n                s = arguments[i];\n                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n                    t[p] = s[p];\n            }\n            return t;\n        };\n        return __assign$2.apply(this, arguments);\n    };\n    var __spreadArrays$1 = (undefined && undefined.__spreadArrays) || function () {\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n                r[k] = a[j];\n        return r;\n    };\n    /**\n     * computedFn takes a function with an arbitrary amount of arguments,\n     * and memoizes the output of the function based on the arguments passed in.\n     *\n     * computedFn(fn) returns a function with the very same signature. There is no limit on the amount of arguments\n     * that is accepted. However, the amount of arguments must be constant and default arguments are not supported.\n     *\n     * By default the output of a function call will only be memoized as long as the\n     * output is being observed.\n     *\n     * The function passes into `computedFn` should be pure, not be an action and only be relying on\n     * observables.\n     *\n     * Setting `keepAlive` to `true` will cause the output to be forcefully cached forever.\n     * Note that this might introduce memory leaks!\n     *\n     * @example\n     * const store = observable({\n        a: 1,\n        b: 2,\n        c: 3,\n        m: computedFn(function(x) {\n          return this.a * this.b * x\n        })\n      })\n\n      const d = autorun(() => {\n        // store.m(3) will be cached as long as this autorun is running\n        console.log(store.m(3) * store.c)\n      })\n     *\n     * @param fn\n     * @param keepAliveOrOptions\n     */\n    function computedFn(fn, keepAliveOrOptions) {\n        if (keepAliveOrOptions === void 0) { keepAliveOrOptions = false; }\n        if (mobx.isAction(fn))\n            throw new Error(\"computedFn shouldn't be used on actions\");\n        var memoWarned = false;\n        var i = 0;\n        var opts = typeof keepAliveOrOptions === \"boolean\"\n            ? { keepAlive: keepAliveOrOptions }\n            : keepAliveOrOptions;\n        var d = new DeepMap();\n        return function () {\n            var _this = this;\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            var entry = d.entry(args);\n            // cache hit, return\n            if (entry.exists())\n                return entry.get().get();\n            // if function is invoked, and its a cache miss without reactive, there is no point in caching...\n            if (!opts.keepAlive && !mobx._isComputingDerivation()) {\n                if (!memoWarned) {\n                    console.warn(\"invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set\");\n                    memoWarned = true;\n                }\n                return fn.apply(this, args);\n            }\n            // create new entry\n            var latestValue;\n            var c = mobx.computed(function () {\n                return (latestValue = fn.apply(_this, args));\n            }, __assign$2(__assign$2({}, opts), { name: \"computedFn(\" + (opts.name || fn.name) + \"#\" + ++i + \")\" }));\n            entry.set(c);\n            // clean up if no longer observed\n            if (!opts.keepAlive)\n                mobx.onBecomeUnobserved(c, function () {\n                    d.entry(args).delete();\n                    if (opts.onCleanup)\n                        opts.onCleanup.apply(opts, __spreadArrays$1([latestValue], args));\n                    latestValue = undefined;\n                });\n            // return current val\n            return c.get();\n        };\n    }\n\n    exports.FULFILLED = FULFILLED;\n    exports.IDENTITY = IDENTITY;\n    exports.NOOP = NOOP;\n    exports.ObservableGroupMap = ObservableGroupMap;\n    exports.PENDING = PENDING;\n    exports.REJECTED = REJECTED;\n    exports.ViewModel = ViewModel;\n    exports.addHiddenProp = addHiddenProp;\n    exports.chunkProcessor = chunkProcessor;\n    exports.computedFn = computedFn;\n    exports.createTransformer = createTransformer;\n    exports.createViewModel = createViewModel;\n    exports.deepObserve = deepObserve;\n    exports.expr = expr;\n    exports.fail = fail;\n    exports.fromPromise = fromPromise;\n    exports.fromResource = fromResource;\n    exports.fromStream = fromStream;\n    exports.getAllMethodsAndProperties = getAllMethodsAndProperties;\n    exports.invariant = invariant;\n    exports.isPromiseBasedObservable = isPromiseBasedObservable;\n    exports.keepAlive = keepAlive;\n    exports.lazyObservable = lazyObservable;\n    exports.moveItem = moveItem;\n    exports.now = now;\n    exports.queueProcessor = queueProcessor;\n    exports.toStream = toStream;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n"]}