!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).mobx={})}(this,function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t2&&Z("box");var n=z(t);return new xe(e,K(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&Z("shallowBox"),Q.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&Z("array");var n=z(t);return new Ut(e,K(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&Z("shallowArray"),Q.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&Z("map");var n=z(t);return new Xt(e,K(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&Z("shallowMap"),Q.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&Z("set");var n=z(t);return new Zt(e,K(n),n.name)},object:function(e,t,n){return"string"==typeof arguments[1]&&Z("object"),lt({},e,t,z(n))},shallowObject:function(e,t){return"string"==typeof arguments[1]&&Z("shallowObject"),Q.object(e,{},{name:t,deep:!1})},ref:X,shallow:J,deep:W,struct:Y},Q=function(e,t,n){if("string"==typeof arguments[1])return W.apply(null,arguments);if(gt(e))return e;var r=b(e)?Q.object(e,t,n):Array.isArray(e)?Q.array(e,t):w(e)?Q.map(e,t):O(e)?Q.set(e,t):e;if(r!==e)return r;p(!1)};function Z(e){p("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(F).forEach(function(e){return Q[e]=F[e]});var ee,te,ne=$(!1,function(e,t,n,o,i){var a=n.get,s=n.set,u=i[0]||{};!function(e,t,n){var r=nn(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new De(n),Object.defineProperty(e,t,function(e){return an[e]||(an[e]={configurable:Ce.computedConfigurable,enumerable:!1,get:function(){return sn(this).read(this,e)},set:function(t){sn(this).write(this,e,t)}})}(t))}(e,t,r({get:a,set:s},u))}),re=ne({equals:N.structural}),oe=function(e,t,n){if("string"==typeof t)return ne.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return ne.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new De(r)};oe.struct=re,(ee=e.IDerivationState||(e.IDerivationState={}))[ee.NOT_TRACKING=-1]="NOT_TRACKING",ee[ee.UP_TO_DATE=0]="UP_TO_DATE",ee[ee.POSSIBLY_STALE=1]="POSSIBLY_STALE",ee[ee.STALE=2]="STALE",function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(te||(te={}));var ie=function(){return function(e){this.cause=e}}();function ae(e){return e instanceof ie}function se(t){switch(t.dependenciesState){case e.IDerivationState.UP_TO_DATE:return!1;case e.IDerivationState.NOT_TRACKING:case e.IDerivationState.STALE:return!0;case e.IDerivationState.POSSIBLY_STALE:for(var n=pe(),r=t.observing,o=r.length,i=0;i0;Ce.computationDepth>0&&t&&p(!1),Ce.allowStateChanges||!t&&"strict"!==Ce.enforceActions||p(!1)}function ce(t,n,r){var o=ve(!0);ye(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++Ce.runId;var i,a=Ce.trackingDerivation;if(Ce.trackingDerivation=t,!0===Ce.disableErrorBoundaries)i=n.call(r);else try{i=n.call(r)}catch(e){i=new ie(e)}return Ce.trackingDerivation=a,function(t){for(var n=t.observing,r=t.observing=t.newObserving,o=e.IDerivationState.UP_TO_DATE,i=0,a=t.unboundDepsCount,s=0;so&&(o=u.dependenciesState)}r.length=i,t.newObserving=null,a=n.length;for(;a--;){var u=n[a];0===u.diffValue&&Ne(u,t),u.diffValue=0}for(;i--;){var u=r[i];1===u.diffValue&&(u.diffValue=0,Ve(u,t))}o!==e.IDerivationState.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),t.observing.length,de(o),i}function le(t){var n=t.observing;t.observing=[];for(var r=n.length;r--;)Ne(n[r],t);t.dependenciesState=e.IDerivationState.NOT_TRACKING}function fe(e){var t=pe(),n=e();return he(t),n}function pe(){var e=Ce.trackingDerivation;return Ce.trackingDerivation=null,e}function he(e){Ce.trackingDerivation=e}function ve(e){var t=Ce.allowStateReads;return Ce.allowStateReads=e,t}function de(e){Ce.allowStateReads=e}function ye(t){if(t.dependenciesState!==e.IDerivationState.UP_TO_DATE){t.dependenciesState=e.IDerivationState.UP_TO_DATE;for(var n=t.observing,r=n.length;r--;)n[r].lowestObserverState=e.IDerivationState.UP_TO_DATE}}var be=0,me=1;function ge(e,t){var n=function(){return _e(e,t,this,arguments)};return n.isMobxAction=!0,n}function _e(e,t,n,r){var o=we(e,n,r);try{return t.apply(n,r)}catch(e){throw o.error=e,e}finally{Oe(o)}}function we(e,t,n){var r=Je()&&!!e,o=0;if(r){o=Date.now();var i=n&&n.length||0,a=new Array(i);if(i>0)for(var s=0;s0&&!e.__mobxGlobals&&(Re=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ie).version&&(Re=!1),Re?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ie):(setTimeout(function(){Te||p("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Ie)}();function Ve(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Ne(e,t){if(1===e.observers.length)e.observers.length=0,Pe(e);else{var n=e.observers,r=e.observersIndexes,o=n.pop();if(o!==t){var i=r[t.__mapid]||0;i?r[o.__mapid]=i:delete r[o.__mapid],n[i]=o}delete r[t.__mapid]}}function Pe(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ce.pendingUnobservations.push(e))}function Le(){Ce.inBatch++}function Be(){if(0==--Ce.inBatch){He();for(var e=Ce.pendingUnobservations,t=0;t0&&Pe(e),!1)}function Me(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===te.BREAK){var n=[];!function e(t,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+t.name);t.dependencies&&t.dependencies.forEach(function(t){return e(t,n,r+1)})}(ft(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof De?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}var Ue=function(){function t(t,n,r,o){void 0===t&&(t="Reaction@"+f()),void 0===o&&(o=!1),this.name=t,this.onInvalidate=n,this.errorHandler=r,this.requiresObservable=o,this.observing=[],this.newObserving=[],this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+f(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=te.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ce.pendingReactions.push(this),He())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Le(),this._isScheduled=!1,se(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Je()&&Xe({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Be()}},t.prototype.track=function(e){Le();var t,n=Je();n&&(t=Date.now(),Ye({name:this.name,type:"reaction"})),this._isRunning=!0;var r=ce(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&le(this),ae(r)&&this.reportExceptionInDerivation(r.cause),n&&Qe({time:Date.now()-t}),Be()},t.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ce.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ce.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Je()&&Xe({type:"error",name:this.name,message:n,error:""+e}),Ce.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Le(),le(this),Be()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){void 0===e&&(e=!1),At(this,e)},t}();var Ge=100,qe=function(e){return e()};function He(){Ce.inBatch>0||Ce.isRunningReactions||qe(ze)}function ze(){Ce.isRunningReactions=!0;for(var e=Ce.pendingReactions,t=0;e.length>0;){++t===Ge&&(console.error("Reaction doesn't converge to a stable state after "+Ge+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r",e):2===arguments.length&&"function"==typeof t?ge(e,t):1===arguments.length&&"string"==typeof e?tt(e):!0!==r?tt(t).apply(null,arguments):void(e[t]=ge(e.name||t,n.value))};function rt(e,t,n){m(e,t,ge(t,n.bind(e)))}function ot(e,t){void 0===t&&(t=u);var n,r=t&&t.name||e.name||"Autorun@"+f();if(!t.scheduler&&!t.delay)n=new Ue(r,function(){this.track(a)},t.onError,t.requiresObservable);else{var o=at(t),i=!1;n=new Ue(r,function(){i||(i=!0,o(function(){i=!1,n.isDisposed||n.track(a)}))},t.onError,t.requiresObservable)}function a(){e(n)}return n.schedule(),n.getDisposer()}nt.bound=function(e,t,n,r){return!0===r?(rt(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return rt(this,t,n.value||n.initializer.call(this)),this[t]},set:et}:{enumerable:!1,configurable:!0,set:function(e){rt(this,t,e)},get:function(){}}};var it=function(e){return e()};function at(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:it}function st(e,t,n){return ct("onBecomeObserved",e,t,n)}function ut(e,t,n){return ct("onBecomeUnobserved",e,t,n)}function ct(e,t,n,r){var o="function"==typeof r?ln(t,n):ln(t),i="function"==typeof r?r:n,a=o[e];return"function"!=typeof a?p(!1):(o[e]=function(){a.call(this),i.call(this)},function(){o[e]=a})}function lt(e,t,n,r){var o=(r=z(r)).defaultDecorator||(!1===r.deep?X:W);B(e),nn(e,r.name,o.enhancer),Le();try{for(var i in t){var a=Object.getOwnPropertyDescriptor(t,i),s=(n&&i in n?n[i]:a.get?ne:o)(e,i,a,!0);s&&Object.defineProperty(e,i,s)}}finally{Be()}return e}function ft(e,t){return pt(ln(e,t))}function pt(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n).map(pt)),r}function ht(e){var t,n={name:e.name};return(t=e).observers&&t.observers.length>0&&(n.observers=function(e){return e.observers}(e).map(ht)),n}var vt=0;function dt(){this.message="FLOW_CANCELLED"}function yt(e){"function"==typeof e.cancel&&e.cancel()}function bt(e,t){if(null==e)return!1;if(void 0!==t){if(!1===cn(e))return!1;if(!e.$mobx.values[t])return!1;var n=ln(e,t);return je(n)}return je(e)}function mt(e,t){if(null==e)return!1;if(void 0!==t){if(cn(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return cn(e)||!!e.$mobx||T(e)||Ke(e)||je(e)}function gt(e){return 1!==arguments.length&&p(!1),mt(e)}function _t(e){return cn(e)?e.$mobx.getKeys():Ft(e)?e._keys.slice():en(e)?S(e.keys()):Wt(e)?e.map(function(e,t){return t}):p(!1)}function wt(e,t){if(cn(e)){var n=fn(e);return n.getKeys(),!!n.values[t]}return Ft(e)?e.has(t):en(e)?e.has(t):Wt(e)?t>=0&&t0}function jt(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),v(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function kt(e,t){var n=pe();try{var r=e.interceptors;if(r)for(var o=0,i=r.length;o0}function Rt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),v(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Tt(e,t){var n=pe(),r=e.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return jt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Rt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r0&&e+t+1>Bt&&zt(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;ue(this.atom);var o=this.values.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===n&&(n=s),Dt(this)){var i=kt(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!i)return s;t=i.removedCount,n=i.added}var a=(n=0===n.length?n:n.map(function(e){return r.enhancer(e,void 0)})).length-t;this.updateArrayLength(o,a);var u=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,i([e,t],n));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var o=!this.owned&&Je(),i=It(this),a=i||o?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;o&&Ye(r(r({},a),{name:this.atom.name})),this.atom.reportChanged(),i&&Tt(this,a),o&&Qe()},e.prototype.notifyArraySplice=function(e,t,n){var o=!this.owned&&Je(),i=It(this),a=i||o?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;o&&Ye(r(r({},a),{name:this.atom.name})),this.atom.reportChanged(),i&&Tt(this,a),o&&Qe()},e}(),Ut=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableArray@"+f()),void 0===o&&(o=!1);var i=e.call(this)||this,a=new Mt(r,n,i,o);if(g(i,"$mobx",a),t&&t.length){var s=Se(!0);i.spliceWithArray(0,0,t),Ae(s)}return Lt&&Object.defineProperty(a.array,"0",Gt),i}return n(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,o=this.$mobx.values;r=e";return function(){var n,r=arguments,o=++vt,i=nt(t+" - runid: "+o+" - init",e).apply(this,r),a=void 0,s=new Promise(function(e,r){var s=0;function u(e){var n;a=void 0;try{n=nt(t+" - runid: "+o+" - yield "+s++,i.next).call(i,e)}catch(e){return r(e)}l(n)}function c(e){var n;a=void 0;try{n=nt(t+" - runid: "+o+" - yield "+s++,i.throw).call(i,e)}catch(e){return r(e)}l(n)}function l(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(a=Promise.resolve(t.value)).then(u,c);t.then(l,r)}n=r,u(void 0)});return s.cancel=nt(t+" - runid: "+o+" - cancel",function(){try{a&&yt(a);var e=i.return(),t=Promise.resolve(e.value);t.then(d,d),yt(t),n(new dt)}catch(e){n(e)}}),s}},e.get=function(e,t){if(wt(e,t))return cn(e)?e[t]:Ft(e)?e.get(t):Wt(e)?e[t]:p(!1)},e.getAtom=ln,e.getDebugName=pn,e.getDependencyTree=ft,e.getObserverTree=function(e,t){return ht(ln(e,t))},e.has=wt,e.intercept=function(e,t,n){return"function"==typeof n?function(e,t,n){return fn(e,t).intercept(n)}(e,t,n):function(e,t){return fn(e).intercept(t)}(e,t)},e.isAction=function(e){return"function"==typeof e&&!0===e.isMobxAction},e.isArrayLike=function(e){return Array.isArray(e)||Wt(e)},e.isBoxedObservable=Ee,e.isComputed=function(e){return arguments.length>1?p(!1):bt(e)},e.isComputedProp=function(e,t){return"string"!=typeof t?p(!1):bt(e,t)},e.isFlowCancellationError=function(e){return e instanceof dt},e.isObservable=gt,e.isObservableArray=Wt,e.isObservableMap=Ft,e.isObservableObject=cn,e.isObservableProp=function(e,t){return"string"!=typeof t?p(!1):mt(e,t)},e.isObservableSet=en,e.keys=_t,e.observable=Q,e.observe=function(e,t,n,r){return"function"==typeof n?function(e,t,n,r){return fn(e,t).observe(n,r)}(e,t,n,r):function(e,t,n){return fn(e).observe(t,n)}(e,t,n)},e.onBecomeObserved=st,e.onBecomeUnobserved=ut,e.onReactionError=function(e){return Ce.globalReactionErrorHandlers.push(e),function(){var t=Ce.globalReactionErrorHandlers.indexOf(e);t>=0&&Ce.globalReactionErrorHandlers.splice(t,1)}},e.reaction=function(e,t,n){void 0===n&&(n=u),"boolean"==typeof n&&(n={fireImmediately:n});var r,o,i,a=n.name||"Reaction@"+f(),s=nt(a,n.onError?(r=n.onError,o=t,function(){try{return o.apply(this,arguments)}catch(e){r.call(this,e)}}):t),c=!n.scheduler&&!n.delay,l=at(n),p=!0,h=!1,v=n.compareStructural?N.structural:n.equals||N.default,d=new Ue(a,function(){p||c?y():h||(h=!0,l(y))},n.onError,n.requiresObservable);function y(){if(h=!1,!d.isDisposed){var t=!1;d.track(function(){var n=e(d);t=p||!v(i,n),i=n}),p&&n.fireImmediately&&s(i,d),p||!0!==t||s(i,d),p&&(p=!1)}}return d.schedule(),d.getDisposer()},e.remove=function(e,t){if(cn(e))e.$mobx.remove(t);else if(Ft(e))e.delete(t);else if(en(e))e.delete(t);else{if(!Wt(e))return p(!1);"number"!=typeof t&&(t=parseInt(t,10)),h(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}},e.runInAction=function(e,t){return _e("string"==typeof e?e:e.name||"","function"==typeof e?e:t,this,void 0)},e.set=function e(t,n,r){if(2!==arguments.length||en(t))if(cn(t)){var o=t.$mobx;o.values[n]?o.write(t,n,r):rn(t,n,r,o.defaultEnhancer)}else if(Ft(t))t.set(n,r);else if(en(t))t.add(n);else{if(!Wt(t))return p(!1);"number"!=typeof n&&(n=parseInt(n,10)),h(n>=0,"Not a valid index: '"+n+"'"),Le(),n>=t.length&&(t.length=n+1),t[n]=r,Be()}else{Le();var i=n;try{for(var a in i)e(t,a,i[a])}finally{Be()}}},e.spy=Ze,e.toJS=function(e,t){var n;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=Ot),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(n=new Map),function e(t,n,r){if(!n.recurseEverything&&!gt(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Ee(t))return e(t.get(),n,r);if(gt(t)&&_t(t),!0===n.detectCycles&&null!==t&&r.has(t))return r.get(t);if(Wt(t)||Array.isArray(t)){var o=St(r,t,[],n),i=t.map(function(t){return e(t,n,r)});o.length=i.length;for(var a=0,s=i.length;a