From 73771aef429b5e0f7b7e7b21a3161631a8031d3c Mon Sep 17 00:00:00 2001 From: jordangarcia Date: Fri, 3 Jul 2015 17:29:40 -0700 Subject: [PATCH] Rebuild for 1.1.0-rc2 --- dist/nuclear.js | 150 ++++++++++++++++++++++++++++++-------------- dist/nuclear.min.js | 6 +- 2 files changed, 105 insertions(+), 51 deletions(-) diff --git a/dist/nuclear.js b/dist/nuclear.js index 6875f5f..e74fcb1 100644 --- a/dist/nuclear.js +++ b/dist/nuclear.js @@ -5295,9 +5295,9 @@ return /******/ (function(modules) { // webpackBootstrap /** * The state for the whole cluster */ - this.__state = Immutable.Map({}) + this.state = Immutable.Map({}) /** - * Holds a map of id => reactor instance + * Holds a map of id => store instance */ this.__stores = Immutable.Map({}) @@ -5306,7 +5306,10 @@ return /******/ (function(modules) { // webpackBootstrap * Change observer interface to observe certain keypaths * Created after __initialize so it starts with initialState */ - this.__changeObserver = new ChangeObserver(this.__state, this.__evaluator) + this.__changeObserver = new ChangeObserver(this.state, this.__evaluator) + + this.__isBatching = false; + this.__batchDispatchCount = 0; } /** @@ -5315,7 +5318,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {*} */ Object.defineProperty(Reactor.prototype,"evaluate",{writable:true,configurable:true,value:function(keyPathOrGetter) {"use strict"; - return this.__evaluator.evaluate(this.__state, keyPathOrGetter) + return this.__evaluator.evaluate(this.state, keyPathOrGetter) }}); /** @@ -5360,43 +5363,26 @@ return /******/ (function(modules) { // webpackBootstrap * @param {object|undefined} payload */ Object.defineProperty(Reactor.prototype,"dispatch",{writable:true,configurable:true,value:function(actionType, payload) {"use strict"; - var debug = this.debug - var prevState = this.__state - - this.__state = this.__state.withMutations(function(state) { - if (this.debug) { - logging.dispatchStart(actionType, payload) - } - - // let each core handle the message - this.__stores.forEach(function(store, id) { - var currState = state.get(id) - var newState = store.handle(currState, actionType, payload) + var prevState = this.state + this.state = this.__handleAction(prevState, actionType, payload) - if (debug && newState === undefined) { - var error = 'Store handler must return a value, did you forget a return statement' - logging.dispatchError(error) - throw new Error(error) - } - - state.set(id, newState) - - if (this.debug) { - logging.storeHandled(id, currState, newState) - } - }.bind(this)) - - if (this.debug) { - logging.dispatchEnd(state) - } - }.bind(this)) - - // write the new state to the output stream if changed - if (this.__state !== prevState) { - this.__changeObserver.notifyObservers(this.__state) + if (this.__isBatching) { + this.__batchDispatchCount++ + } else if (this.state !== prevState) { + this.__notify() } }}); + /** + * Allows batching of dispatches before notifying change observers + * @param {Function} fn + */ + Object.defineProperty(Reactor.prototype,"batch",{writable:true,configurable:true,value:function(fn) {"use strict"; + this.__batchStart() + fn() + this.__batchEnd() + }}); + /** * @deprecated * @param {String} id @@ -5429,10 +5415,10 @@ return /******/ (function(modules) { // webpackBootstrap } this.__stores = this.__stores.set(id, store) - this.__state = this.__state.set(id, initialState) + this.state = this.state.set(id, initialState) }.bind(this)) - this.__changeObserver.notifyObservers(this.__state) + this.__notify() }}); /** @@ -5442,7 +5428,7 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(Reactor.prototype,"serialize",{writable:true,configurable:true,value:function() {"use strict"; var serialized = {} this.__stores.forEach(function(store, id) { - var storeState = this.__state.get(id) + var storeState = this.state.get(id) serialized[id] = store.serialize(storeState) }.bind(this)) return serialized @@ -5461,8 +5447,8 @@ return /******/ (function(modules) { // webpackBootstrap }.bind(this)) }.bind(this)) - this.__state = this.__state.merge(stateToLoad) - this.__changeObserver.notifyObservers(this.__state) + this.state = this.state.merge(stateToLoad) + this.__notify() }}); /** @@ -5470,9 +5456,9 @@ return /******/ (function(modules) { // webpackBootstrap */ Object.defineProperty(Reactor.prototype,"reset",{writable:true,configurable:true,value:function() {"use strict"; var debug = this.debug - var prevState = this.__state + var prevState = this.state - this.__state = Immutable.Map().withMutations(function(state) { + this.state = Immutable.Map().withMutations(function(state) { this.__stores.forEach(function(store, id) { var storeState = prevState.get(id) var resetStoreState = store.handleReset(storeState) @@ -5487,7 +5473,70 @@ return /******/ (function(modules) { // webpackBootstrap }.bind(this)) this.__evaluator.reset() - this.__changeObserver.reset(this.__state) + this.__changeObserver.reset(this.state) + }}); + + /** + * Notifies all change observers with the current state + * @private + */ + Object.defineProperty(Reactor.prototype,"__notify",{writable:true,configurable:true,value:function() {"use strict"; + this.__changeObserver.notifyObservers(this.state) + }}); + + + /** + * Reduces the current state to the new state given actionType / message + * @param {string} actionType + * @param {object|undefined} payload + * @return {Immutable.Map} + */ + Object.defineProperty(Reactor.prototype,"__handleAction",{writable:true,configurable:true,value:function(state, actionType, payload) {"use strict"; + return state.withMutations(function(state) { + if (this.debug) { + logging.dispatchStart(actionType, payload) + } + + // let each core handle the message + this.__stores.forEach(function(store, id) { + var currState = state.get(id) + var newState = store.handle(currState, actionType, payload) + + if (this.debug && newState === undefined) { + var error = 'Store handler must return a value, did you forget a return statement' + logging.dispatchError(error) + throw new Error(error) + } + + state.set(id, newState) + + if (this.debug) { + logging.storeHandled(id, currState, newState) + } + }.bind(this)) + + if (this.debug) { + logging.dispatchEnd(state) + } + }.bind(this)) + }}); + + Object.defineProperty(Reactor.prototype,"__batchStart",{writable:true,configurable:true,value:function() {"use strict"; + if (this.__isBatching) { + throw new Error('Reactor already in batch mode') + } + this.__isBatching = true + }}); + + Object.defineProperty(Reactor.prototype,"__batchEnd",{writable:true,configurable:true,value:function() {"use strict"; + if (!this.__isBatching) { + throw new Error('Reactor is not in batch mode') + } + + if (this.__batchDispatchCount > 0) { + this.__notify() + this.__batchDispatchCount = 0 + } }}); @@ -5521,7 +5570,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.storeHandled = function(id, before, after) { if (console.group) { if (before !== after) { - console.debug('Core changed: ' + id) + console.debug('Store ' + id + ' handled action') } } } @@ -5852,8 +5901,13 @@ return /******/ (function(modules) { // webpackBootstrap } __applyingComputeFn = true - var evaluatedValue = getComputeFn(keyPathOrGetter).apply(null, args) - __applyingComputeFn = false + try { + var evaluatedValue = getComputeFn(keyPathOrGetter).apply(null, args) + __applyingComputeFn = false + } catch (e) { + __applyingComputeFn = false + throw e + } this.__cacheValue(state, keyPathOrGetter, args, evaluatedValue) diff --git a/dist/nuclear.min.js b/dist/nuclear.min.js index 682e085..4aa5689 100644 --- a/dist/nuclear.min.js +++ b/dist/nuclear.min.js @@ -1,3 +1,3 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.Nuclear=e():t.Nuclear=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var n=r(1);e.Reactor=r(4),e.Store=r(13),e.Immutable=r(2),e.isKeyPath=r(10).isKeyPath,e.isGetter=r(9).isGetter,e.toJS=n.toJS,e.toImmutable=n.toImmutable,e.isImmutable=n.isImmutable,e.createReactMixin=r(12)},function(t,e,r){function n(t){return s.Iterable.isIterable(t)}function i(t){return n(t)||!a(t)}function o(t){return n(t)?t.toJS():t}function u(t){return n(t)?t:s.fromJS(t)}var s=r(2),a=r(3).isObject;e.toJS=o,e.toImmutable=u,e.isImmutable=n,e.isImmutableValue=i},function(t,e,r){!function(e,r){t.exports=r()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function r(t){t&&(t.value=!0)}function n(){}function i(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function o(t){return void 0===t.size&&(t.size=t.__iterate(s)),t.size}function u(t,e){return e>=0?+e:o(t)+ +e}function s(){return!0}function a(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function c(t,e){return f(t,e,0)}function h(t,e){return f(t,e,e)}function f(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function _(t){return y(t)?t:D(t)}function p(t){return d(t)?t:q(t)}function l(t){return g(t)?t:j(t)}function v(t){return y(t)&&!m(t)?t:A(t)}function y(t){return!(!t||!t[lr])}function d(t){return!(!t||!t[vr])}function g(t){return!(!t||!t[yr])}function m(t){return d(t)||g(t)}function b(t){return!(!t||!t[dr])}function w(t){this.next=t}function S(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function z(t){return!!M(t)}function O(t){return t&&"function"==typeof t.next}function E(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(wr&&t[wr]||t[Sr]);return"function"==typeof e?e:void 0}function x(t){return t&&"number"==typeof t.length}function D(t){return null===t||void 0===t?C():y(t)?t.toSeq():B(t)}function q(t){return null===t||void 0===t?C().toKeyedSeq():y(t)?d(t)?t.toSeq():t.fromEntrySeq():L(t)}function j(t){return null===t||void 0===t?C():y(t)?d(t)?t.entrySeq():t.toIndexedSeq():T(t)}function A(t){return(null===t||void 0===t?C():y(t)?d(t)?t.entrySeq():t:T(t)).toSetSeq()}function k(t){this._array=t,this.size=t.length}function P(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function K(t){this._iterable=t,this.size=t.length||t.size}function R(t){this._iterator=t,this._iteratorCache=[]}function U(t){return!(!t||!t[zr])}function C(){return Or||(Or=new k([]))}function L(t){var e=Array.isArray(t)?new k(t).fromEntrySeq():O(t)?new R(t).fromEntrySeq():z(t)?new K(t).fromEntrySeq():"object"==typeof t?new P(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function T(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function B(t){var e=J(t)||"object"==typeof t&&new P(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return x(t)?new k(t):O(t)?new R(t):z(t)?new K(t):void 0}function W(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var s=i[r?o-u:u];if(e(s[1],n?s[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,r)}function V(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new w(function(){var t=i[r?o-u:u];return u++>o?I():S(e,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,r)}function G(){throw TypeError("Abstract")}function H(){}function F(){}function N(){}function X(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return"function"==typeof t.equals&&"function"==typeof e.equals&&t.equals(e)?!0:!1}function Y(t,e){return e?Q(e,t,"",{"":t}):Z(t)}function Q(t,e,r,n){return Array.isArray(e)?t.call(n,r,j(e).map(function(r,n){return Q(t,r,n,e)})):$(e)?t.call(n,r,q(e).map(function(r,n){return Q(t,r,n,e)})):e}function Z(t){return Array.isArray(t)?j(t).map(Z).toList():$(t)?q(t).map(Z).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return tt(r)}return"string"===e?t.length>kr?rt(t):nt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function rt(t){var e=Rr[t];return void 0===e&&(e=nt(t),Kr===Pr&&(Kr=0,Rr={}),Kr++,Rr[t]=e),e}function nt(t){for(var e=0,r=0;r0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ut(t,e){if(!t)throw new Error(e)}function st(t){ut(t!==1/0,"Cannot perform this action with an infinite size.")}function at(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ct(t){this._iter=t,this.size=t.size}function ht(t){this._iter=t,this.size=t.size}function ft(t){this._iter=t,this.size=t.size}function _t(t){var e=kt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Pt,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===br){var n=t.__iterator(e,r);return new w(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===mr?gr:mr,r)},e}function pt(t,e,r){var n=kt(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,fr);return o===fr?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(br,i);return new w(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return S(n,s,e.call(r,u[1],s,t),i)})},n}function lt(t,e){var r=kt(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=_t(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Pt,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function vt(t,e,r,n){var i=kt(t);return n&&(i.has=function(n){var i=t.get(n,fr);return i!==fr&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,fr);return o!==fr&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){return e.call(r,t,o,a)?(s++,i(t,n?o:s-1,u)):void 0},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(br,o),s=0;return new w(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,c=a[0],h=a[1];if(e.call(r,h,c,t))return S(i,n?c:s++,h,o)}})},i}function yt(t,e,r){var n=Ut().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function dt(t,e,r){var n=d(t),i=(b(t)?Ie():Ut()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=At(t);return i.map(function(e){return Dt(t,o(e))})}function gt(t,e,r,n){var i=t.size;if(a(e,r,i))return t;var o=c(e,i),s=h(r,i);if(o!==o||s!==s)return gt(t.toSeq().cacheResult(),e,r,n);var f,_=s-o;_===_&&(f=0>_?0:_);var p=kt(t);return p.size=f,!n&&U(t)&&f>=0&&(p.get=function(e,r){return e=u(this,e),e>=0&&f>e?t.get(e+o,r):r}),p.__iterateUncached=function(e,r){var i=this;if(0===f)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,s=!0,a=0;return t.__iterate(function(t,r){return s&&(s=u++f)return I();var t=i.next();return n||e===mr?t:e===gr?S(e,s-1,void 0,t):S(e,s-1,t.value[1],t)})},p}function mt(t,e,r){var n=kt(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(br,i),s=!0;return new w(function(){if(!s)return I();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===br?t:S(n,a,c,t):(s=!1,I())})},n}function bt(t,e,r,n){var i=kt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,c){return s&&(s=e.call(r,t,o,c))?void 0:(a++,i(t,n?o:a-1,u))}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(br,o),a=!0,c=0;return new w(function(){var t,o,h;do{if(t=s.next(),t.done)return n||i===mr?t:i===gr?S(i,c++,void 0,t):S(i,c++,t.value[1],t);var f=t.value;o=f[0],h=f[1],a&&(a=e.call(r,h,o,u))}while(a);return i===br?t:S(i,o,h,t)})},i}function wt(t,e){var r=d(t),n=[t].concat(e).map(function(t){return y(t)?r&&(t=p(t)):t=r?L(t):T(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&d(i)||g(t)&&g(i))return i}var o=new k(n);return r?o=o.toKeyedSeq():g(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),o}function St(t,e,r){var n=kt(t);return n.__iterateUncached=function(n,i){function o(t,a){var c=this;t.__iterate(function(t,i){return(!e||e>a)&&y(t)?o(t,a+1):n(t,r?i:u++,c)===!1&&(s=!0),!s},i)}var u=0,s=!1;return o(t,0),u},n.__iteratorUncached=function(n,i){var o=t.__iterator(n,i),u=[],s=0;return new w(function(){for(;o;){var t=o.next();if(t.done===!1){var a=t.value;if(n===br&&(a=a[1]),e&&!(u.length0}function xt(t,e,r){var n=kt(t);return n.size=new k(r).map(function(t){return t.size}).min(),n.__iterate=function(t,e){for(var r,n=this.__iterator(mr,e),i=0;!(r=n.next()).done&&t(r.value,i++,this)!==!1;);return i},n.__iteratorUncached=function(t,n){var i=r.map(function(t){return t=_(t),E(n?t.reverse():t)}),o=0,u=!1;return new w(function(){var r;return u||(r=i.map(function(t){return t.next()}),u=r.some(function(t){return t.done})),u?I():S(t,o++,e.apply(null,r.map(function(t){return t.value})))})},n}function Dt(t,e){return U(t)?e:t.constructor(e)}function qt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function jt(t){return st(t.size),o(t)}function At(t){return d(t)?p:g(t)?l:v}function kt(t){return Object.create((d(t)?q:g(t)?j:A).prototype)}function Pt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):D.prototype.cacheResult.call(this)}function Kt(t,e){return t>e?1:e>t?-1:0}function Rt(t){var e=E(t);if(!e){if(!x(t))throw new TypeError("Expected iterable or array-like: "+t);e=E(_(t))}return e}function Ut(t){return null===t||void 0===t?Nt():Ct(t)?t:Nt().withMutations(function(e){var r=p(t);st(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function Ct(t){return!(!t||!t[Ur])}function Lt(t,e){this.ownerID=t,this.entries=e}function Tt(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function Bt(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function Jt(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function Wt(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function Vt(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Ht(t._root)}function Gt(t,e){return S(t,e[0],e[1])}function Ht(t,e){return{node:t,index:0,__prev:e}}function Ft(t,e,r,n){var i=Object.create(Cr);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Nt(){return Lr||(Lr=Ft(0))}function Xt(t,r,n){var i,o;if(t._root){var u=e(_r),s=e(pr);if(i=Yt(t._root,t.__ownerID,0,void 0,r,n,u,s),!s.value)return t;o=t.size+(u.value?n===fr?-1:1:0)}else{if(n===fr)return t;o=1,i=new Lt(t.__ownerID,[[r,n]])}return t.__ownerID?(t.size=o,t._root=i,t.__hash=void 0,t.__altered=!0,t):i?Ft(o,i):Nt()}function Yt(t,e,n,i,o,u,s,a){return t?t.update(e,n,i,o,u,s,a):u===fr?t:(r(a),r(s),new Wt(e,i,[o,u]))}function Qt(t){return t.constructor===Wt||t.constructor===Jt}function Zt(t,e,r,n,i){if(t.keyHash===n)return new Jt(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&hr,s=(0===r?n:n>>>r)&hr,a=u===s?[Zt(t,e,r+ar,n,i)]:(o=new Wt(e,n,i),s>u?[t,o]:[o,t]);return new Tt(e,1<s;s++,a<<=1){var h=e[s];void 0!==h&&s!==n&&(i|=a,u[o++]=h)}return new Tt(t,i,u)}function ee(t,e,r,n,i){for(var o=0,u=new Array(cr),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Bt(t,o+1,u)}function re(t,e,r){for(var n=[],i=0;i>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function se(t,e,r,n){var o=n?t:i(t);return o[e]=r,o}function ae(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),u=0,s=0;i>s;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}function ce(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;n>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function he(t){var e=ve();if(null===t||void 0===t)return e;if(fe(t))return t;var r=l(t),n=r.size;return 0===n?e:(st(n),n>0&&cr>n?le(0,n,ar,null,new _e(r.toArray())):e.withMutations(function(t){t.setSize(n),r.forEach(function(e,r){return t.set(r,e)})}))}function fe(t){return!(!t||!t[Wr])}function _e(t,e){this.array=t,this.ownerID=e}function pe(t,e){function r(t,e,r){return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===s?a&&a.array:t&&t.array,i=r>o?0:o-r,c=u-r;return c>cr&&(c=cr),function(){if(i===c)return Hr;var t=e?--c:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,c=i>o?0:o-i>>n,h=(u-i>>n)+1;return h>cr&&(h=cr),function(){for(;;){if(s){var t=s();if(t!==Hr)return t;s=null}if(c===h)return Hr;var o=e?--h:c++;s=r(a&&a[o],n-ar,i+(o<=t.size||0>r)return t.withMutations(function(t){0>r?be(t,r).set(0,n):be(t,0,r+1).set(r,n)});r+=t._origin;var i=t._tail,o=t._root,s=e(pr);return r>=Se(t._capacity)?i=de(i,t.__ownerID,0,r,n,s):o=de(o,t.__ownerID,t._level,r,n,s),s.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):le(t._origin,t._capacity,t._level,o,i):t}function de(t,e,n,i,o,u){var s=i>>>n&hr,a=t&&s0){var h=t&&t.array[s],f=de(h,e,n-ar,i,o,u);return f===h?t:(c=ge(t,e),c.array[s]=f,c)}return a&&t.array[s]===o?t:(r(u),c=ge(t,e),void 0===o&&s===c.array.length-1?c.array.pop():c.array[s]=o,c)}function ge(t,e){return e&&t&&e===t.ownerID?t:new _e(t?t.array.slice():[],e)}function me(t,e){if(e>=Se(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&hr],n-=ar;return r}}function be(t,e,r){var i=t.__ownerID||new n,o=t._origin,u=t._capacity,s=o+e,a=void 0===r?u:0>r?u+r:o+r;if(s===o&&a===u)return t;if(s>=a)return t.clear();for(var c=t._level,h=t._root,f=0;0>s+f;)h=new _e(h&&h.array.length?[void 0,h]:[],i),c+=ar,f+=1<=1<p?me(t,a-1):p>_?new _e([],i):l;if(l&&p>_&&u>s&&l.array.length){h=ge(h,i);for(var y=h,d=c;d>ar;d-=ar){var g=_>>>d&hr;y=y.array[g]=ge(y.array[g],i)}y.array[_>>>ar&hr]=l}if(u>a&&(v=v&&v.removeAfter(i,0,a)),s>=p)s-=p,a-=p,c=ar,h=null,v=v&&v.removeBefore(i,0,s);else if(s>o||_>p){for(f=0;h;){var m=s>>>c&hr;if(m!==p>>>c&hr)break;m&&(f+=(1<o&&(h=h.removeBefore(i,c,s-f)),h&&_>p&&(h=h.removeAfter(i,c,p-f)),f&&(s-=f,a-=f)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=c,t._root=h,t._tail=v,t.__hash=void 0,t.__altered=!0,t):le(s,a,c,h,v)}function we(t,e,r){for(var n=[],i=0,o=0;oi&&(i=s.size),y(u)||(s=s.map(function(t){return Y(t)})),n.push(s)}return i>t.size&&(t=t.setSize(i)),ie(t,e,n)}function Se(t){return cr>t?0:t-1>>>ar<=cr&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):Oe(n,i)}function xe(t){return null===t||void 0===t?je():De(t)?t:je().unshiftAll(t)}function De(t){return!(!t||!t[Nr])}function qe(t,e,r,n){var i=Object.create(Xr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function je(){return Yr||(Yr=qe(0))}function Ae(t){return null===t||void 0===t?Re():ke(t)?t:Re().withMutations(function(e){var r=v(t);st(r.size),r.forEach(function(t){return e.add(t)})})}function ke(t){return!(!t||!t[Qr])}function Pe(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Ke(t,e){var r=Object.create(Zr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Re(){return $r||($r=Ke(Nt()))}function Ue(t){return null===t||void 0===t?Te():Ce(t)?t:Te().withMutations(function(e){var r=v(t);st(r.size),r.forEach(function(t){return e.add(t)})})}function Ce(t){return ke(t)&&b(t)}function Le(t,e){var r=Object.create(tn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Te(){return en||(en=Le(Ee()))}function Be(t,e){var r,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var u=Object.keys(t);Ve(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Ut(o)},i=n.prototype=Object.create(rn);return i.constructor=n,n}function Je(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function We(t){return t._name||t.constructor.name||"Record"}function Ve(t,e){try{e.forEach(Ge.bind(void 0,t))}catch(r){}}function Ge(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){ut(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function He(t,e){if(t===e)return!0;if(!y(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||d(t)!==d(e)||g(t)!==g(e)||b(t)!==b(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!m(t);if(b(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&X(i[1],t)&&(r||X(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,s=e.__iterate(function(e,n){return(r?t.has(e):i?X(e,t.get(n,fr)):X(t.get(n,fr),e))?void 0:(u=!1,!1)});return u&&t.size===s}function Fe(t,e,r){if(!(this instanceof Fe))return new Fe(t,e,r);if(ut(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(nn)return nn;nn=this}}function Ne(t,e){if(!(this instanceof Ne))return new Ne(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(on)return on;on=this}}function Xe(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Ye(t,e){return e}function Qe(t,e){return[e,t]}function Ze(t){return function(){return!t.apply(this,arguments)}}function $e(t){return function(){return-t.apply(this,arguments)}}function tr(t){return"string"==typeof t?JSON.stringify(t):t}function er(){return i(arguments)}function rr(t,e){return e>t?1:t>e?-1:0}function nr(t){if(t.size===1/0)return 0;var e=b(t),r=d(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+or(et(t),et(e))|0}:function(t,e){n=n+or(et(t),et(e))|0}:e?function(t){n=31*n+et(t)|0}:function(t){n=n+et(t)|0});return ir(i,n)}function ir(t,e){return e=Mr(e,3432918353),e=Mr(e<<15|e>>>-15,461845907),e=Mr(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Mr(e^e>>>16,2246822507),e=Mr(e^e>>>13,3266489909),e=tt(e^e>>>16)}function or(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var ur=Array.prototype.slice,sr="delete",ar=5,cr=1<=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},k.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new w(function(){return i>n?I():S(t,i,r[e?n-i++:i++])})},t(P,q),P.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},P.prototype.has=function(t){return this._object.hasOwnProperty(t)},P.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;i>=o;o++){var u=n[e?i-o:o];if(t(r[u],u,this)===!1)return o+1}return o},P.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new w(function(){var u=n[e?i-o:o];return o++>i?I():S(t,u,r[u])})},P.prototype[dr]=!0,t(K,j),K.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=E(r),i=0;if(O(n))for(var o;!(o=n.next()).done&&t(o.value,i++,this)!==!1;);return i},K.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=E(r);if(!O(n))return new w(I);var i=0;return new w(function(){var e=n.next();return e.done?e:S(t,i++,e.value)})},t(R,j),R.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;i=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return S(t,i,n[i++])})};var Or;t(G,_),t(H,G),t(F,G),t(N,G),G.Keyed=H,G.Indexed=F,G.Set=N;var Er,Mr="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},xr=Object.isExtensible,Dr=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),qr="function"==typeof WeakMap;qr&&(Er=new WeakMap);var jr=0,Ar="__immutablehash__";"function"==typeof Symbol&&(Ar=Symbol(Ar));var kr=16,Pr=255,Kr=0,Rr={};t(at,q),at.prototype.get=function(t,e){return this._iter.get(t,e)},at.prototype.has=function(t){return this._iter.has(t)},at.prototype.valueSeq=function(){return this._iter.valueSeq()},at.prototype.reverse=function(){var t=this,e=lt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},at.prototype.map=function(t,e){var r=this,n=pt(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},at.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?jt(this):0,function(i){return t(i,e?--r:r++,n)}),e)},at.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(mr,e),n=e?jt(this):0;return new w(function(){var i=r.next();return i.done?i:S(t,e?--n:n++,i.value,i)})},at.prototype[dr]=!0,t(ct,j),ct.prototype.includes=function(t){return this._iter.includes(t)},ct.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},ct.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mr,e),n=0;return new w(function(){var e=r.next();return e.done?e:S(t,n++,e.value,e)})},t(ht,A),ht.prototype.has=function(t){return this._iter.includes(t)},ht.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},ht.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mr,e);return new w(function(){var e=r.next();return e.done?e:S(t,e.value,e.value,e)})},t(ft,q),ft.prototype.entrySeq=function(){return this._iter.toSeq()},ft.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){qt(e);var n=y(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},ft.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mr,e);return new w(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){qt(n);var i=y(n);return S(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}})},ct.prototype.cacheResult=at.prototype.cacheResult=ht.prototype.cacheResult=ft.prototype.cacheResult=Pt,t(Ut,H),Ut.prototype.toString=function(){return this.__toString("Map {","}")},Ut.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Ut.prototype.set=function(t,e){return Xt(this,t,e)},Ut.prototype.setIn=function(t,e){return this.updateIn(t,fr,function(){return e})},Ut.prototype.remove=function(t){return Xt(this,t,fr)},Ut.prototype.deleteIn=function(t){return this.updateIn(t,function(){return fr})},Ut.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},Ut.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=oe(this,Rt(t),e,r);return n===fr?void 0:n},Ut.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Nt()},Ut.prototype.merge=function(){return re(this,void 0,arguments)},Ut.prototype.mergeWith=function(t){var e=ur.call(arguments,1);return re(this,t,e)},Ut.prototype.mergeIn=function(t){var e=ur.call(arguments,1);return this.updateIn(t,Nt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},Ut.prototype.mergeDeep=function(){return re(this,ne(void 0),arguments)},Ut.prototype.mergeDeepWith=function(t){var e=ur.call(arguments,1);return re(this,ne(t),e)},Ut.prototype.mergeDeepIn=function(t){ -var e=ur.call(arguments,1);return this.updateIn(t,Nt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},Ut.prototype.sort=function(t){return Ie(Ot(this,t))},Ut.prototype.sortBy=function(t,e){return Ie(Ot(this,e,t))},Ut.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Ut.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new n)},Ut.prototype.asImmutable=function(){return this.__ensureOwner()},Ut.prototype.wasAltered=function(){return this.__altered},Ut.prototype.__iterator=function(t,e){return new Vt(this,t,e)},Ut.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},Ut.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ft(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ut.isMap=Ct;var Ur="@@__IMMUTABLE_MAP__@@",Cr=Ut.prototype;Cr[Ur]=!0,Cr[sr]=Cr.remove,Cr.removeIn=Cr.deleteIn,Lt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Lt.prototype.update=function(t,e,n,o,u,s,a){for(var c=u===fr,h=this.entries,f=0,_=h.length;_>f&&!X(o,h[f][0]);f++);var p=_>f;if(p?h[f][1]===u:c)return this;if(r(a),(c||!p)&&r(s),!c||1!==h.length){if(!p&&!c&&h.length>=Tr)return $t(t,h,o,u);var l=t&&t===this.ownerID,v=l?h:i(h);return p?c?f===_-1?v.pop():v[f]=v.pop():v[f]=[o,u]:v.push([o,u]),l?(this.entries=v,this):new Lt(t,v)}},Tt.prototype.get=function(t,e,r,n){void 0===e&&(e=et(r));var i=1<<((0===t?e:e>>>t)&hr),o=this.bitmap;return 0===(o&i)?n:this.nodes[ue(o&i-1)].get(t+ar,e,r,n)},Tt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=et(n));var s=(0===e?r:r>>>e)&hr,a=1<=Br)return ee(t,_,c,s,l);if(h&&!l&&2===_.length&&Qt(_[1^f]))return _[1^f];if(h&&l&&1===_.length&&Qt(l))return l;var v=t&&t===this.ownerID,y=h?l?c:c^a:c|a,d=h?l?se(_,f,l,v):ce(_,f,v):ae(_,f,l,v);return v?(this.bitmap=y,this.nodes=d,this):new Tt(t,y,d)},Bt.prototype.get=function(t,e,r,n){void 0===e&&(e=et(r));var i=(0===t?e:e>>>t)&hr,o=this.nodes[i];return o?o.get(t+ar,e,r,n):n},Bt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=et(n));var s=(0===e?r:r>>>e)&hr,a=i===fr,c=this.nodes,h=c[s];if(a&&!h)return this;var f=Yt(h,t,e+ar,r,n,i,o,u);if(f===h)return this;var _=this.count;if(h){if(!f&&(_--,Jr>_))return te(t,c,_,s)}else _++;var p=t&&t===this.ownerID,l=se(c,s,f,p);return p?(this.count=_,this.nodes=l,this):new Bt(t,_,l)},Jt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Jt.prototype.update=function(t,e,n,o,u,s,a){void 0===n&&(n=et(o));var c=u===fr;if(n!==this.keyHash)return c?this:(r(a),r(s),Zt(this,t,e,n,[o,u]));for(var h=this.entries,f=0,_=h.length;_>f&&!X(o,h[f][0]);f++);var p=_>f;if(p?h[f][1]===u:c)return this;if(r(a),(c||!p)&&r(s),c&&2===_)return new Wt(t,this.keyHash,h[1^f]);var l=t&&t===this.ownerID,v=l?h:i(h);return p?c?f===_-1?v.pop():v[f]=v.pop():v[f]=[o,u]:v.push([o,u]),l?(this.entries=v,this):new Jt(t,this.keyHash,v)},Wt.prototype.get=function(t,e,r,n){return X(r,this.entry[0])?this.entry[1]:n},Wt.prototype.update=function(t,e,n,i,o,u,s){var a=o===fr,c=X(i,this.entry[0]);return(c?o===this.entry[1]:a)?this:(r(s),a?void r(u):c?t&&t===this.ownerID?(this.entry[1]=o,this):new Wt(t,this.keyHash,[i,o]):(r(u),Zt(this,t,e,et(i),[i,o])))},Lt.prototype.iterate=Jt.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},Tt.prototype.iterate=Bt.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var o=r[e?i-n:n];if(o&&o.iterate(t,e)===!1)return!1}},Wt.prototype.iterate=function(t,e){return t(this.entry)},t(Vt,w),Vt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return Gt(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return Gt(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return Gt(t,o.entry);e=this._stack=Ht(o,e)}continue}e=this._stack=this._stack.__prev}return I()};var Lr,Tr=cr/4,Br=cr/2,Jr=cr/4;t(he,F),he.of=function(){return this(arguments)},he.prototype.toString=function(){return this.__toString("List [","]")},he.prototype.get=function(t,e){if(t=u(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=me(this,t);return r&&r.array[t&hr]},he.prototype.set=function(t,e){return ye(this,t,e)},he.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},he.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=ar,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ve()},he.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(r){be(r,0,e+t.length);for(var n=0;n>>e&hr;if(n>=this.array.length)return new _e([],t);var i,o=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-ar,r),i===u&&o)return this}if(o&&!i)return this;var s=ge(this,t);if(!o)for(var a=0;n>a;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},_e.prototype.removeAfter=function(t,e,r){if(r===e?1<>>e&hr;if(n>=this.array.length)return this;var i,o=n===this.array.length-1;if(e>0){var u=this.array[n];if(i=u&&u.removeAfter(t,e-ar,r),i===u&&o)return this}if(o&&!i)return this;var s=ge(this,t);return o||s.array.pop(),i&&(s.array[n]=i),s};var Gr,Hr={};t(Ie,Ut),Ie.of=function(){return this(arguments)},Ie.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ie.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Ee()},Ie.prototype.set=function(t,e){return Me(this,t,e)},Ie.prototype.remove=function(t){return Me(this,t,fr)},Ie.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ie.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Ie.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ie.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Oe(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Ie.isOrderedMap=ze,Ie.prototype[dr]=!0,Ie.prototype[sr]=Ie.prototype.remove;var Fr;t(xe,F),xe.of=function(){return this(arguments)},xe.prototype.toString=function(){return this.__toString("Stack [","]")},xe.prototype.get=function(t,e){var r=this._head;for(t=u(this,t);r&&t--;)r=r.next;return r?r.value:e},xe.prototype.peek=function(){return this._head&&this._head.value},xe.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):qe(t,e)},xe.prototype.pushAll=function(t){if(t=l(t),0===t.size)return this;st(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):qe(e,r)},xe.prototype.pop=function(){return this.slice(1)},xe.prototype.unshift=function(){return this.push.apply(this,arguments)},xe.prototype.unshiftAll=function(t){return this.pushAll(t)},xe.prototype.shift=function(){return this.pop.apply(this,arguments)},xe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):je()},xe.prototype.slice=function(t,e){if(a(t,e,this.size))return this;var r=c(t,this.size),n=h(e,this.size);if(n!==this.size)return F.prototype.slice.call(this,t,e);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):qe(i,o)},xe.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?qe(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},xe.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},xe.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var r=0,n=this._head;return new w(function(){if(n){var e=n.value;return n=n.next,S(t,r++,e)}return I()})},xe.isStack=De;var Nr="@@__IMMUTABLE_STACK__@@",Xr=xe.prototype;Xr[Nr]=!0,Xr.withMutations=Cr.withMutations,Xr.asMutable=Cr.asMutable,Xr.asImmutable=Cr.asImmutable,Xr.wasAltered=Cr.wasAltered;var Yr;t(Ae,N),Ae.of=function(){return this(arguments)},Ae.fromKeys=function(t){return this(p(t).keySeq())},Ae.prototype.toString=function(){return this.__toString("Set {","}")},Ae.prototype.has=function(t){return this._map.has(t)},Ae.prototype.add=function(t){return Pe(this,this._map.set(t,!0))},Ae.prototype.remove=function(t){return Pe(this,this._map.remove(t))},Ae.prototype.clear=function(){return Pe(this,this._map.clear())},Ae.prototype.union=function(){var t=ur.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var r=0;r1?" by "+this._step:"")+" ]"},Fe.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Fe.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e=e?new Fe(0,0):new Fe(this.get(t,this._end),this.get(e,this._end),this._step))},Fe.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&r=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-n:n}return o},Fe.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new w(function(){var u=i;return i+=e?-n:n,o>r?I():S(t,o++,u)})},Fe.prototype.equals=function(t){return t instanceof Fe?this._start===t._start&&this._end===t._end&&this._step===t._step:He(this,t)};var nn;t(Ne,j),Ne.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Ne.prototype.get=function(t,e){return this.has(t)?this._value:e},Ne.prototype.includes=function(t){return X(this._value,t)},Ne.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:new Ne(this._value,h(e,r)-c(t,r))},Ne.prototype.reverse=function(){return this},Ne.prototype.indexOf=function(t){return X(this._value,t)?0:-1},Ne.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},Ne.prototype.__iterate=function(t,e){for(var r=0;rt||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?this.size===1/0||t-1&&t%1===0&&t<=Number.MAX_VALUE}e.isString=function(t){return"string"==typeof t||"[object String]"===r(t)},e.isArray=Array.isArray||function(t){return"[object Array]"===r(t)},"function"!=typeof/./&&"object"!=typeof Int8Array?e.isFunction=function(t){return"function"==typeof t||!1}:e.isFunction=function(t){return"[object Function]"===toString.call(t)},e.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},e.extend=function(t){var e=arguments.length;if(!t||2>e)return t||{};for(var r=1;e>r;r++)for(var n=arguments[r],i=Object.keys(n),o=i.length,u=0;o>u;u++){var s=i[u];t[s]=n[s]}return t},e.clone=function(t){return e.isObject(t)?e.isArray(t)?t.slice():e.extend({},t):t},e.each=function(t,e,r){var i,o,u=t?t.length:0,s=-1;if(r&&(o=e,e=function(t,e,n){return o.call(r,t,e,n)}),n(u))for(;++s0){var e=i.Map();this.__observers.forEach(function(r){var n,i=r.getter,s=o(i),a=this.__prevState;this.__prevValues.has(s)?n=this.__prevValues.get(s):(n=this.__evaluator.evaluate(a,i),this.__prevValues=this.__prevValues.set(s,n));var c=this.__evaluator.evaluate(t,i);u(n,c)||(r.handler.call(null,c),e=e.set(s,c))}.bind(this)),this.__prevValues=e}this.__prevState=t}}),Object.defineProperty(n.prototype,"onChange",{writable:!0,configurable:!0,value:function(t,e){"use strict";var r={getter:t,handler:e};return this.__observers.push(r),function(){var t=this.__observers.indexOf(r);t>-1&&this.__observers.splice(t,1)}.bind(this)}}),Object.defineProperty(n.prototype,"reset",{writable:!0,configurable:!0,value:function(t){"use strict";this.__prevState=t,this.__prevValues=i.Map(),this.__observers=[]}}),t.exports=n},function(t,e,r){var n=r(2);t.exports=function(t,e){if(t.hasOwnProperty("__hashCode"))return t.__hashCode;var r=n.fromJS(t).hashCode();return e||(Object.defineProperty(t,"__hashCode",{enumerable:!1,configurable:!1,writable:!1,value:r}),Object.freeze(t)),r}},function(t,e,r){var n=r(2);t.exports=function(t,e){return n.is(t,e)}},function(t,e,r){function n(t){return a(t)&&s(t[t.length-1])}function i(t){return t[t.length-1]}function o(t){return t.slice(0,t.length-1)}function u(t){if(!c(t))throw new Error("Cannot create Getter from KeyPath: "+t);return[t,h]}var s=r(3).isFunction,a=r(3).isArray,c=r(10).isKeyPath,h=function(t){return t};t.exports={isGetter:n,getComputeFn:i,getDeps:o,fromKeyPath:u}},function(t,e,r){var n=r(3).isArray,i=r(3).isFunction; -e.isKeyPath=function(t){return n(t)&&!i(t[t.length-1])}},function(t,e,r){function n(){"use strict";this.__cachedGetters=i.Map({})}var i=r(2),o=r(1).toImmutable,u=r(7),s=r(8),a=r(9).getComputeFn,c=r(9).getDeps,h=r(10).isKeyPath,f=r(9).isGetter,_=!1;Object.defineProperty(n.prototype,"evaluate",{writable:!0,configurable:!0,value:function(t,e){"use strict";if(h(e))return t.getIn(e);if(!f(e))throw new Error("evaluate must be passed a keyPath or Getter");var r=u(e);if(this.__isCached(t,e))return this.__cachedGetters.getIn([r,"value"]);var n=c(e).map(function(e){return this.evaluate(t,e)}.bind(this));if(this.__hasStaleValue(t,e)){var i=this.__cachedGetters.getIn([r,"args"]);if(s(i,o(n))){var p=this.__cachedGetters.getIn([r,"value"]);return this.__cacheValue(t,e,i,p),p}}if(_===!0)throw _=!1,new Error("Evaluate may not be called within a Getters computeFn");_=!0;var l=a(e).apply(null,n);return _=!1,this.__cacheValue(t,e,n,l),l}}),Object.defineProperty(n.prototype,"__hasStaleValue",{writable:!0,configurable:!0,value:function(t,e){"use strict";var r=u(e),n=this.__cachedGetters;return n.has(r)&&n.getIn([r,"stateHashCode"])!==t.hashCode()}}),Object.defineProperty(n.prototype,"__cacheValue",{writable:!0,configurable:!0,value:function(t,e,r,n){"use strict";var s=u(e);this.__cachedGetters=this.__cachedGetters.set(s,i.Map({value:n,args:o(r),stateHashCode:t.hashCode()}))}}),Object.defineProperty(n.prototype,"__isCached",{writable:!0,configurable:!0,value:function(t,e){"use strict";var r=u(e);return this.__cachedGetters.hasIn([r,"value"])&&this.__cachedGetters.getIn([r,"stateHashCode"])===t.hashCode()}}),Object.defineProperty(n.prototype,"untrack",{writable:!0,configurable:!0,value:function(t){"use strict"}}),Object.defineProperty(n.prototype,"reset",{writable:!0,configurable:!0,value:function(){"use strict";this.__cachedGetters=i.Map({})}}),t.exports=n},function(t,e,r){function n(t,e){var r={};return i(e,function(e,n){r[n]=t.evaluate(e)}),r}var i=r(3).each;t.exports=function(t){return{getInitialState:function(){return n(t,this.getDataBindings())},componentDidMount:function(){var e=this;e.__unwatchFns=[],i(this.getDataBindings(),function(r,n){var i=t.observe(r,function(t){var r={};r[n]=t,e.setState(r)});e.__unwatchFns.push(i)})},componentWillUnmount:function(){for(;this.__unwatchFns.length;)this.__unwatchFns.shift()()}}}},function(t,e,r){function n(t){"use strict";return this instanceof n?(this.__handlers=o({}),t&&u(this,t),void this.initialize()):new n(t)}function i(t){return t instanceof n}var o=r(2).Map,u=r(3).extend,s=r(1).toJS,a=r(1).toImmutable;Object.defineProperty(n.prototype,"initialize",{writable:!0,configurable:!0,value:function(){"use strict"}}),Object.defineProperty(n.prototype,"getInitialState",{writable:!0,configurable:!0,value:function(){"use strict";return o()}}),Object.defineProperty(n.prototype,"handle",{writable:!0,configurable:!0,value:function(t,e,r){"use strict";var n=this.__handlers.get(e);return"function"==typeof n?n.call(this,t,r,e):t}}),Object.defineProperty(n.prototype,"handleReset",{writable:!0,configurable:!0,value:function(t){"use strict";return this.getInitialState()}}),Object.defineProperty(n.prototype,"on",{writable:!0,configurable:!0,value:function(t,e){"use strict";this.__handlers=this.__handlers.set(t,e)}}),Object.defineProperty(n.prototype,"serialize",{writable:!0,configurable:!0,value:function(t){"use strict";return s(t)}}),Object.defineProperty(n.prototype,"deserialize",{writable:!0,configurable:!0,value:function(t){"use strict";return a(t)}}),t.exports=n,t.exports.isStore=i}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.Nuclear=e():t.Nuclear=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var n=r(1);e.Reactor=r(4),e.Store=r(13),e.Immutable=r(2),e.isKeyPath=r(10).isKeyPath,e.isGetter=r(9).isGetter,e.toJS=n.toJS,e.toImmutable=n.toImmutable,e.isImmutable=n.isImmutable,e.createReactMixin=r(12)},function(t,e,r){function n(t){return s.Iterable.isIterable(t)}function i(t){return n(t)||!a(t)}function o(t){return n(t)?t.toJS():t}function u(t){return n(t)?t:s.fromJS(t)}var s=r(2),a=r(3).isObject;e.toJS=o,e.toImmutable=u,e.isImmutable=n,e.isImmutableValue=i},function(t,e,r){!function(e,r){t.exports=r()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function r(t){t&&(t.value=!0)}function n(){}function i(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function o(t){return void 0===t.size&&(t.size=t.__iterate(s)),t.size}function u(t,e){return e>=0?+e:o(t)+ +e}function s(){return!0}function a(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function c(t,e){return f(t,e,0)}function h(t,e){return f(t,e,e)}function f(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function _(t){return y(t)?t:x(t)}function p(t){return d(t)?t:q(t)}function l(t){return g(t)?t:j(t)}function v(t){return y(t)&&!m(t)?t:A(t)}function y(t){return!(!t||!t[lr])}function d(t){return!(!t||!t[vr])}function g(t){return!(!t||!t[yr])}function m(t){return d(t)||g(t)}function b(t){return!(!t||!t[dr])}function w(t){this.next=t}function S(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function z(t){return!!M(t)}function O(t){return t&&"function"==typeof t.next}function E(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(wr&&t[wr]||t[Sr]);return"function"==typeof e?e:void 0}function D(t){return t&&"number"==typeof t.length}function x(t){return null===t||void 0===t?C():y(t)?t.toSeq():T(t)}function q(t){return null===t||void 0===t?C().toKeyedSeq():y(t)?d(t)?t.toSeq():t.fromEntrySeq():B(t)}function j(t){return null===t||void 0===t?C():y(t)?d(t)?t.entrySeq():t.toIndexedSeq():L(t)}function A(t){return(null===t||void 0===t?C():y(t)?d(t)?t.entrySeq():t:L(t)).toSetSeq()}function k(t){this._array=t,this.size=t.length}function P(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function K(t){this._iterable=t,this.size=t.length||t.size}function R(t){this._iterator=t,this._iteratorCache=[]}function U(t){return!(!t||!t[zr])}function C(){return Or||(Or=new k([]))}function B(t){var e=Array.isArray(t)?new k(t).fromEntrySeq():O(t)?new R(t).fromEntrySeq():z(t)?new K(t).fromEntrySeq():"object"==typeof t?new P(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function L(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function T(t){var e=J(t)||"object"==typeof t&&new P(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return D(t)?new k(t):O(t)?new R(t):z(t)?new K(t):void 0}function W(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var s=i[r?o-u:u];if(e(s[1],n?s[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,r)}function V(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new w(function(){var t=i[r?o-u:u];return u++>o?I():S(e,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,r)}function G(){throw TypeError("Abstract")}function H(){}function F(){}function N(){}function X(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return"function"==typeof t.equals&&"function"==typeof e.equals&&t.equals(e)?!0:!1}function Y(t,e){return e?Q(e,t,"",{"":t}):Z(t)}function Q(t,e,r,n){return Array.isArray(e)?t.call(n,r,j(e).map(function(r,n){return Q(t,r,n,e)})):$(e)?t.call(n,r,q(e).map(function(r,n){return Q(t,r,n,e)})):e}function Z(t){return Array.isArray(t)?j(t).map(Z).toList():$(t)?q(t).map(Z).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return tt(r)}return"string"===e?t.length>kr?rt(t):nt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function rt(t){var e=Rr[t];return void 0===e&&(e=nt(t),Kr===Pr&&(Kr=0,Rr={}),Kr++,Rr[t]=e),e}function nt(t){for(var e=0,r=0;r0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ut(t,e){if(!t)throw new Error(e)}function st(t){ut(t!==1/0,"Cannot perform this action with an infinite size.")}function at(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ct(t){this._iter=t,this.size=t.size}function ht(t){this._iter=t,this.size=t.size}function ft(t){this._iter=t,this.size=t.size}function _t(t){var e=kt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Pt,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===br){var n=t.__iterator(e,r);return new w(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===mr?gr:mr,r)},e}function pt(t,e,r){var n=kt(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,fr);return o===fr?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(br,i);return new w(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return S(n,s,e.call(r,u[1],s,t),i)})},n}function lt(t,e){var r=kt(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=_t(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Pt,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function vt(t,e,r,n){var i=kt(t);return n&&(i.has=function(n){var i=t.get(n,fr);return i!==fr&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,fr);return o!==fr&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){return e.call(r,t,o,a)?(s++,i(t,n?o:s-1,u)):void 0},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(br,o),s=0;return new w(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,c=a[0],h=a[1];if(e.call(r,h,c,t))return S(i,n?c:s++,h,o)}})},i}function yt(t,e,r){var n=Ut().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function dt(t,e,r){var n=d(t),i=(b(t)?Ie():Ut()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=At(t);return i.map(function(e){return xt(t,o(e))})}function gt(t,e,r,n){var i=t.size;if(a(e,r,i))return t;var o=c(e,i),s=h(r,i);if(o!==o||s!==s)return gt(t.toSeq().cacheResult(),e,r,n);var f,_=s-o;_===_&&(f=0>_?0:_);var p=kt(t);return p.size=f,!n&&U(t)&&f>=0&&(p.get=function(e,r){return e=u(this,e),e>=0&&f>e?t.get(e+o,r):r}),p.__iterateUncached=function(e,r){var i=this;if(0===f)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,s=!0,a=0;return t.__iterate(function(t,r){return s&&(s=u++f)return I();var t=i.next();return n||e===mr?t:e===gr?S(e,s-1,void 0,t):S(e,s-1,t.value[1],t)})},p}function mt(t,e,r){var n=kt(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(br,i),s=!0;return new w(function(){if(!s)return I();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===br?t:S(n,a,c,t):(s=!1,I())})},n}function bt(t,e,r,n){var i=kt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,c){return s&&(s=e.call(r,t,o,c))?void 0:(a++,i(t,n?o:a-1,u))}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(br,o),a=!0,c=0;return new w(function(){var t,o,h;do{if(t=s.next(),t.done)return n||i===mr?t:i===gr?S(i,c++,void 0,t):S(i,c++,t.value[1],t);var f=t.value;o=f[0],h=f[1],a&&(a=e.call(r,h,o,u))}while(a);return i===br?t:S(i,o,h,t)})},i}function wt(t,e){var r=d(t),n=[t].concat(e).map(function(t){return y(t)?r&&(t=p(t)):t=r?B(t):L(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&d(i)||g(t)&&g(i))return i}var o=new k(n);return r?o=o.toKeyedSeq():g(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),o}function St(t,e,r){var n=kt(t);return n.__iterateUncached=function(n,i){function o(t,a){var c=this;t.__iterate(function(t,i){return(!e||e>a)&&y(t)?o(t,a+1):n(t,r?i:u++,c)===!1&&(s=!0),!s},i)}var u=0,s=!1;return o(t,0),u},n.__iteratorUncached=function(n,i){var o=t.__iterator(n,i),u=[],s=0;return new w(function(){for(;o;){var t=o.next();if(t.done===!1){var a=t.value;if(n===br&&(a=a[1]),e&&!(u.length0}function Dt(t,e,r){var n=kt(t);return n.size=new k(r).map(function(t){return t.size}).min(),n.__iterate=function(t,e){for(var r,n=this.__iterator(mr,e),i=0;!(r=n.next()).done&&t(r.value,i++,this)!==!1;);return i},n.__iteratorUncached=function(t,n){var i=r.map(function(t){return t=_(t),E(n?t.reverse():t)}),o=0,u=!1;return new w(function(){var r;return u||(r=i.map(function(t){return t.next()}),u=r.some(function(t){return t.done})),u?I():S(t,o++,e.apply(null,r.map(function(t){return t.value})))})},n}function xt(t,e){return U(t)?e:t.constructor(e)}function qt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function jt(t){return st(t.size),o(t)}function At(t){return d(t)?p:g(t)?l:v}function kt(t){return Object.create((d(t)?q:g(t)?j:A).prototype)}function Pt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):x.prototype.cacheResult.call(this)}function Kt(t,e){return t>e?1:e>t?-1:0}function Rt(t){var e=E(t);if(!e){if(!D(t))throw new TypeError("Expected iterable or array-like: "+t);e=E(_(t))}return e}function Ut(t){return null===t||void 0===t?Nt():Ct(t)?t:Nt().withMutations(function(e){var r=p(t);st(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function Ct(t){return!(!t||!t[Ur])}function Bt(t,e){this.ownerID=t,this.entries=e}function Lt(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function Tt(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function Jt(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function Wt(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function Vt(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Ht(t._root)}function Gt(t,e){return S(t,e[0],e[1])}function Ht(t,e){return{node:t,index:0,__prev:e}}function Ft(t,e,r,n){var i=Object.create(Cr);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Nt(){return Br||(Br=Ft(0))}function Xt(t,r,n){var i,o;if(t._root){var u=e(_r),s=e(pr);if(i=Yt(t._root,t.__ownerID,0,void 0,r,n,u,s),!s.value)return t;o=t.size+(u.value?n===fr?-1:1:0)}else{if(n===fr)return t;o=1,i=new Bt(t.__ownerID,[[r,n]])}return t.__ownerID?(t.size=o,t._root=i,t.__hash=void 0,t.__altered=!0,t):i?Ft(o,i):Nt()}function Yt(t,e,n,i,o,u,s,a){return t?t.update(e,n,i,o,u,s,a):u===fr?t:(r(a),r(s),new Wt(e,i,[o,u]))}function Qt(t){return t.constructor===Wt||t.constructor===Jt}function Zt(t,e,r,n,i){if(t.keyHash===n)return new Jt(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&hr,s=(0===r?n:n>>>r)&hr,a=u===s?[Zt(t,e,r+ar,n,i)]:(o=new Wt(e,n,i),s>u?[t,o]:[o,t]);return new Lt(e,1<s;s++,a<<=1){var h=e[s];void 0!==h&&s!==n&&(i|=a,u[o++]=h)}return new Lt(t,i,u)}function ee(t,e,r,n,i){for(var o=0,u=new Array(cr),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Tt(t,o+1,u)}function re(t,e,r){for(var n=[],i=0;i>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function se(t,e,r,n){var o=n?t:i(t);return o[e]=r,o}function ae(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),u=0,s=0;i>s;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}function ce(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;n>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function he(t){var e=ve();if(null===t||void 0===t)return e;if(fe(t))return t;var r=l(t),n=r.size;return 0===n?e:(st(n),n>0&&cr>n?le(0,n,ar,null,new _e(r.toArray())):e.withMutations(function(t){t.setSize(n),r.forEach(function(e,r){return t.set(r,e)})}))}function fe(t){return!(!t||!t[Wr])}function _e(t,e){this.array=t,this.ownerID=e}function pe(t,e){function r(t,e,r){return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===s?a&&a.array:t&&t.array,i=r>o?0:o-r,c=u-r;return c>cr&&(c=cr),function(){if(i===c)return Hr;var t=e?--c:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,c=i>o?0:o-i>>n,h=(u-i>>n)+1;return h>cr&&(h=cr),function(){for(;;){if(s){var t=s();if(t!==Hr)return t;s=null}if(c===h)return Hr;var o=e?--h:c++;s=r(a&&a[o],n-ar,i+(o<=t.size||0>r)return t.withMutations(function(t){0>r?be(t,r).set(0,n):be(t,0,r+1).set(r,n)});r+=t._origin;var i=t._tail,o=t._root,s=e(pr);return r>=Se(t._capacity)?i=de(i,t.__ownerID,0,r,n,s):o=de(o,t.__ownerID,t._level,r,n,s),s.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):le(t._origin,t._capacity,t._level,o,i):t}function de(t,e,n,i,o,u){var s=i>>>n&hr,a=t&&s0){var h=t&&t.array[s],f=de(h,e,n-ar,i,o,u);return f===h?t:(c=ge(t,e),c.array[s]=f,c)}return a&&t.array[s]===o?t:(r(u),c=ge(t,e),void 0===o&&s===c.array.length-1?c.array.pop():c.array[s]=o,c)}function ge(t,e){return e&&t&&e===t.ownerID?t:new _e(t?t.array.slice():[],e)}function me(t,e){if(e>=Se(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&hr],n-=ar;return r}}function be(t,e,r){var i=t.__ownerID||new n,o=t._origin,u=t._capacity,s=o+e,a=void 0===r?u:0>r?u+r:o+r;if(s===o&&a===u)return t;if(s>=a)return t.clear();for(var c=t._level,h=t._root,f=0;0>s+f;)h=new _e(h&&h.array.length?[void 0,h]:[],i),c+=ar,f+=1<=1<p?me(t,a-1):p>_?new _e([],i):l;if(l&&p>_&&u>s&&l.array.length){h=ge(h,i);for(var y=h,d=c;d>ar;d-=ar){var g=_>>>d&hr;y=y.array[g]=ge(y.array[g],i)}y.array[_>>>ar&hr]=l}if(u>a&&(v=v&&v.removeAfter(i,0,a)),s>=p)s-=p,a-=p,c=ar,h=null,v=v&&v.removeBefore(i,0,s);else if(s>o||_>p){for(f=0;h;){var m=s>>>c&hr;if(m!==p>>>c&hr)break;m&&(f+=(1<o&&(h=h.removeBefore(i,c,s-f)),h&&_>p&&(h=h.removeAfter(i,c,p-f)),f&&(s-=f,a-=f)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=c,t._root=h,t._tail=v,t.__hash=void 0,t.__altered=!0,t):le(s,a,c,h,v)}function we(t,e,r){for(var n=[],i=0,o=0;oi&&(i=s.size),y(u)||(s=s.map(function(t){return Y(t)})),n.push(s)}return i>t.size&&(t=t.setSize(i)),ie(t,e,n)}function Se(t){return cr>t?0:t-1>>>ar<=cr&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):Oe(n,i)}function De(t){return null===t||void 0===t?je():xe(t)?t:je().unshiftAll(t)}function xe(t){return!(!t||!t[Nr])}function qe(t,e,r,n){var i=Object.create(Xr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function je(){return Yr||(Yr=qe(0))}function Ae(t){return null===t||void 0===t?Re():ke(t)?t:Re().withMutations(function(e){var r=v(t);st(r.size),r.forEach(function(t){return e.add(t)})})}function ke(t){return!(!t||!t[Qr])}function Pe(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Ke(t,e){var r=Object.create(Zr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Re(){return $r||($r=Ke(Nt()))}function Ue(t){return null===t||void 0===t?Le():Ce(t)?t:Le().withMutations(function(e){var r=v(t);st(r.size),r.forEach(function(t){return e.add(t)})})}function Ce(t){return ke(t)&&b(t)}function Be(t,e){var r=Object.create(tn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Le(){return en||(en=Be(Ee()))}function Te(t,e){var r,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var u=Object.keys(t);Ve(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Ut(o)},i=n.prototype=Object.create(rn);return i.constructor=n,n}function Je(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function We(t){return t._name||t.constructor.name||"Record"}function Ve(t,e){try{e.forEach(Ge.bind(void 0,t))}catch(r){}}function Ge(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){ut(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function He(t,e){if(t===e)return!0;if(!y(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||d(t)!==d(e)||g(t)!==g(e)||b(t)!==b(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!m(t);if(b(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&X(i[1],t)&&(r||X(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,s=e.__iterate(function(e,n){return(r?t.has(e):i?X(e,t.get(n,fr)):X(t.get(n,fr),e))?void 0:(u=!1,!1)});return u&&t.size===s}function Fe(t,e,r){if(!(this instanceof Fe))return new Fe(t,e,r);if(ut(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(nn)return nn;nn=this}}function Ne(t,e){if(!(this instanceof Ne))return new Ne(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(on)return on;on=this}}function Xe(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Ye(t,e){return e}function Qe(t,e){return[e,t]}function Ze(t){return function(){return!t.apply(this,arguments)}}function $e(t){return function(){return-t.apply(this,arguments)}}function tr(t){return"string"==typeof t?JSON.stringify(t):t}function er(){return i(arguments)}function rr(t,e){return e>t?1:t>e?-1:0}function nr(t){if(t.size===1/0)return 0;var e=b(t),r=d(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+or(et(t),et(e))|0}:function(t,e){n=n+or(et(t),et(e))|0}:e?function(t){n=31*n+et(t)|0}:function(t){n=n+et(t)|0});return ir(i,n)}function ir(t,e){return e=Mr(e,3432918353),e=Mr(e<<15|e>>>-15,461845907),e=Mr(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Mr(e^e>>>16,2246822507),e=Mr(e^e>>>13,3266489909),e=tt(e^e>>>16)}function or(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var ur=Array.prototype.slice,sr="delete",ar=5,cr=1<=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},k.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new w(function(){return i>n?I():S(t,i,r[e?n-i++:i++])})},t(P,q),P.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},P.prototype.has=function(t){return this._object.hasOwnProperty(t)},P.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;i>=o;o++){var u=n[e?i-o:o];if(t(r[u],u,this)===!1)return o+1}return o},P.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new w(function(){var u=n[e?i-o:o];return o++>i?I():S(t,u,r[u])})},P.prototype[dr]=!0,t(K,j),K.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=E(r),i=0;if(O(n))for(var o;!(o=n.next()).done&&t(o.value,i++,this)!==!1;);return i},K.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=E(r);if(!O(n))return new w(I);var i=0;return new w(function(){var e=n.next();return e.done?e:S(t,i++,e.value)})},t(R,j),R.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;i=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return S(t,i,n[i++])})};var Or;t(G,_),t(H,G),t(F,G),t(N,G),G.Keyed=H,G.Indexed=F,G.Set=N;var Er,Mr="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},Dr=Object.isExtensible,xr=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),qr="function"==typeof WeakMap;qr&&(Er=new WeakMap);var jr=0,Ar="__immutablehash__";"function"==typeof Symbol&&(Ar=Symbol(Ar));var kr=16,Pr=255,Kr=0,Rr={};t(at,q),at.prototype.get=function(t,e){return this._iter.get(t,e)},at.prototype.has=function(t){return this._iter.has(t)},at.prototype.valueSeq=function(){return this._iter.valueSeq()},at.prototype.reverse=function(){var t=this,e=lt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},at.prototype.map=function(t,e){var r=this,n=pt(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},at.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?jt(this):0,function(i){return t(i,e?--r:r++,n)}),e)},at.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(mr,e),n=e?jt(this):0;return new w(function(){var i=r.next();return i.done?i:S(t,e?--n:n++,i.value,i)})},at.prototype[dr]=!0,t(ct,j),ct.prototype.includes=function(t){return this._iter.includes(t)},ct.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},ct.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mr,e),n=0;return new w(function(){var e=r.next();return e.done?e:S(t,n++,e.value,e)})},t(ht,A),ht.prototype.has=function(t){return this._iter.includes(t)},ht.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},ht.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mr,e);return new w(function(){var e=r.next();return e.done?e:S(t,e.value,e.value,e)})},t(ft,q),ft.prototype.entrySeq=function(){return this._iter.toSeq()},ft.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){qt(e);var n=y(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},ft.prototype.__iterator=function(t,e){var r=this._iter.__iterator(mr,e);return new w(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){qt(n);var i=y(n);return S(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}})},ct.prototype.cacheResult=at.prototype.cacheResult=ht.prototype.cacheResult=ft.prototype.cacheResult=Pt,t(Ut,H),Ut.prototype.toString=function(){return this.__toString("Map {","}")},Ut.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Ut.prototype.set=function(t,e){return Xt(this,t,e)},Ut.prototype.setIn=function(t,e){return this.updateIn(t,fr,function(){return e})},Ut.prototype.remove=function(t){return Xt(this,t,fr)},Ut.prototype.deleteIn=function(t){return this.updateIn(t,function(){return fr})},Ut.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},Ut.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=oe(this,Rt(t),e,r);return n===fr?void 0:n},Ut.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Nt()},Ut.prototype.merge=function(){return re(this,void 0,arguments)},Ut.prototype.mergeWith=function(t){var e=ur.call(arguments,1);return re(this,t,e)},Ut.prototype.mergeIn=function(t){var e=ur.call(arguments,1);return this.updateIn(t,Nt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},Ut.prototype.mergeDeep=function(){return re(this,ne(void 0),arguments)},Ut.prototype.mergeDeepWith=function(t){var e=ur.call(arguments,1);return re(this,ne(t),e)},Ut.prototype.mergeDeepIn=function(t){ +var e=ur.call(arguments,1);return this.updateIn(t,Nt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},Ut.prototype.sort=function(t){return Ie(Ot(this,t))},Ut.prototype.sortBy=function(t,e){return Ie(Ot(this,e,t))},Ut.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Ut.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new n)},Ut.prototype.asImmutable=function(){return this.__ensureOwner()},Ut.prototype.wasAltered=function(){return this.__altered},Ut.prototype.__iterator=function(t,e){return new Vt(this,t,e)},Ut.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},Ut.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ft(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ut.isMap=Ct;var Ur="@@__IMMUTABLE_MAP__@@",Cr=Ut.prototype;Cr[Ur]=!0,Cr[sr]=Cr.remove,Cr.removeIn=Cr.deleteIn,Bt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Bt.prototype.update=function(t,e,n,o,u,s,a){for(var c=u===fr,h=this.entries,f=0,_=h.length;_>f&&!X(o,h[f][0]);f++);var p=_>f;if(p?h[f][1]===u:c)return this;if(r(a),(c||!p)&&r(s),!c||1!==h.length){if(!p&&!c&&h.length>=Lr)return $t(t,h,o,u);var l=t&&t===this.ownerID,v=l?h:i(h);return p?c?f===_-1?v.pop():v[f]=v.pop():v[f]=[o,u]:v.push([o,u]),l?(this.entries=v,this):new Bt(t,v)}},Lt.prototype.get=function(t,e,r,n){void 0===e&&(e=et(r));var i=1<<((0===t?e:e>>>t)&hr),o=this.bitmap;return 0===(o&i)?n:this.nodes[ue(o&i-1)].get(t+ar,e,r,n)},Lt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=et(n));var s=(0===e?r:r>>>e)&hr,a=1<=Tr)return ee(t,_,c,s,l);if(h&&!l&&2===_.length&&Qt(_[1^f]))return _[1^f];if(h&&l&&1===_.length&&Qt(l))return l;var v=t&&t===this.ownerID,y=h?l?c:c^a:c|a,d=h?l?se(_,f,l,v):ce(_,f,v):ae(_,f,l,v);return v?(this.bitmap=y,this.nodes=d,this):new Lt(t,y,d)},Tt.prototype.get=function(t,e,r,n){void 0===e&&(e=et(r));var i=(0===t?e:e>>>t)&hr,o=this.nodes[i];return o?o.get(t+ar,e,r,n):n},Tt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=et(n));var s=(0===e?r:r>>>e)&hr,a=i===fr,c=this.nodes,h=c[s];if(a&&!h)return this;var f=Yt(h,t,e+ar,r,n,i,o,u);if(f===h)return this;var _=this.count;if(h){if(!f&&(_--,Jr>_))return te(t,c,_,s)}else _++;var p=t&&t===this.ownerID,l=se(c,s,f,p);return p?(this.count=_,this.nodes=l,this):new Tt(t,_,l)},Jt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Jt.prototype.update=function(t,e,n,o,u,s,a){void 0===n&&(n=et(o));var c=u===fr;if(n!==this.keyHash)return c?this:(r(a),r(s),Zt(this,t,e,n,[o,u]));for(var h=this.entries,f=0,_=h.length;_>f&&!X(o,h[f][0]);f++);var p=_>f;if(p?h[f][1]===u:c)return this;if(r(a),(c||!p)&&r(s),c&&2===_)return new Wt(t,this.keyHash,h[1^f]);var l=t&&t===this.ownerID,v=l?h:i(h);return p?c?f===_-1?v.pop():v[f]=v.pop():v[f]=[o,u]:v.push([o,u]),l?(this.entries=v,this):new Jt(t,this.keyHash,v)},Wt.prototype.get=function(t,e,r,n){return X(r,this.entry[0])?this.entry[1]:n},Wt.prototype.update=function(t,e,n,i,o,u,s){var a=o===fr,c=X(i,this.entry[0]);return(c?o===this.entry[1]:a)?this:(r(s),a?void r(u):c?t&&t===this.ownerID?(this.entry[1]=o,this):new Wt(t,this.keyHash,[i,o]):(r(u),Zt(this,t,e,et(i),[i,o])))},Bt.prototype.iterate=Jt.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},Lt.prototype.iterate=Tt.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var o=r[e?i-n:n];if(o&&o.iterate(t,e)===!1)return!1}},Wt.prototype.iterate=function(t,e){return t(this.entry)},t(Vt,w),Vt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return Gt(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return Gt(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return Gt(t,o.entry);e=this._stack=Ht(o,e)}continue}e=this._stack=this._stack.__prev}return I()};var Br,Lr=cr/4,Tr=cr/2,Jr=cr/4;t(he,F),he.of=function(){return this(arguments)},he.prototype.toString=function(){return this.__toString("List [","]")},he.prototype.get=function(t,e){if(t=u(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=me(this,t);return r&&r.array[t&hr]},he.prototype.set=function(t,e){return ye(this,t,e)},he.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},he.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=ar,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ve()},he.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(r){be(r,0,e+t.length);for(var n=0;n>>e&hr;if(n>=this.array.length)return new _e([],t);var i,o=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-ar,r),i===u&&o)return this}if(o&&!i)return this;var s=ge(this,t);if(!o)for(var a=0;n>a;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},_e.prototype.removeAfter=function(t,e,r){if(r===e?1<>>e&hr;if(n>=this.array.length)return this;var i,o=n===this.array.length-1;if(e>0){var u=this.array[n];if(i=u&&u.removeAfter(t,e-ar,r),i===u&&o)return this}if(o&&!i)return this;var s=ge(this,t);return o||s.array.pop(),i&&(s.array[n]=i),s};var Gr,Hr={};t(Ie,Ut),Ie.of=function(){return this(arguments)},Ie.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ie.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Ee()},Ie.prototype.set=function(t,e){return Me(this,t,e)},Ie.prototype.remove=function(t){return Me(this,t,fr)},Ie.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ie.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Ie.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ie.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Oe(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Ie.isOrderedMap=ze,Ie.prototype[dr]=!0,Ie.prototype[sr]=Ie.prototype.remove;var Fr;t(De,F),De.of=function(){return this(arguments)},De.prototype.toString=function(){return this.__toString("Stack [","]")},De.prototype.get=function(t,e){var r=this._head;for(t=u(this,t);r&&t--;)r=r.next;return r?r.value:e},De.prototype.peek=function(){return this._head&&this._head.value},De.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):qe(t,e)},De.prototype.pushAll=function(t){if(t=l(t),0===t.size)return this;st(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):qe(e,r)},De.prototype.pop=function(){return this.slice(1)},De.prototype.unshift=function(){return this.push.apply(this,arguments)},De.prototype.unshiftAll=function(t){return this.pushAll(t)},De.prototype.shift=function(){return this.pop.apply(this,arguments)},De.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):je()},De.prototype.slice=function(t,e){if(a(t,e,this.size))return this;var r=c(t,this.size),n=h(e,this.size);if(n!==this.size)return F.prototype.slice.call(this,t,e);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):qe(i,o)},De.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?qe(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},De.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},De.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var r=0,n=this._head;return new w(function(){if(n){var e=n.value;return n=n.next,S(t,r++,e)}return I()})},De.isStack=xe;var Nr="@@__IMMUTABLE_STACK__@@",Xr=De.prototype;Xr[Nr]=!0,Xr.withMutations=Cr.withMutations,Xr.asMutable=Cr.asMutable,Xr.asImmutable=Cr.asImmutable,Xr.wasAltered=Cr.wasAltered;var Yr;t(Ae,N),Ae.of=function(){return this(arguments)},Ae.fromKeys=function(t){return this(p(t).keySeq())},Ae.prototype.toString=function(){return this.__toString("Set {","}")},Ae.prototype.has=function(t){return this._map.has(t)},Ae.prototype.add=function(t){return Pe(this,this._map.set(t,!0))},Ae.prototype.remove=function(t){return Pe(this,this._map.remove(t))},Ae.prototype.clear=function(){return Pe(this,this._map.clear())},Ae.prototype.union=function(){var t=ur.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var r=0;r1?" by "+this._step:"")+" ]"},Fe.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Fe.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e=e?new Fe(0,0):new Fe(this.get(t,this._end),this.get(e,this._end),this._step))},Fe.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&r=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-n:n}return o},Fe.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new w(function(){var u=i;return i+=e?-n:n,o>r?I():S(t,o++,u)})},Fe.prototype.equals=function(t){return t instanceof Fe?this._start===t._start&&this._end===t._end&&this._step===t._step:He(this,t)};var nn;t(Ne,j),Ne.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Ne.prototype.get=function(t,e){return this.has(t)?this._value:e},Ne.prototype.includes=function(t){return X(this._value,t)},Ne.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:new Ne(this._value,h(e,r)-c(t,r))},Ne.prototype.reverse=function(){return this},Ne.prototype.indexOf=function(t){return X(this._value,t)?0:-1},Ne.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},Ne.prototype.__iterate=function(t,e){for(var r=0;rt||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?this.size===1/0||t-1&&t%1===0&&t<=Number.MAX_VALUE}e.isString=function(t){return"string"==typeof t||"[object String]"===r(t)},e.isArray=Array.isArray||function(t){return"[object Array]"===r(t)},"function"!=typeof/./&&"object"!=typeof Int8Array?e.isFunction=function(t){return"function"==typeof t||!1}:e.isFunction=function(t){return"[object Function]"===toString.call(t)},e.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},e.extend=function(t){var e=arguments.length;if(!t||2>e)return t||{};for(var r=1;e>r;r++)for(var n=arguments[r],i=Object.keys(n),o=i.length,u=0;o>u;u++){var s=i[u];t[s]=n[s]}return t},e.clone=function(t){return e.isObject(t)?e.isArray(t)?t.slice():e.extend({},t):t},e.each=function(t,e,r){var i,o,u=t?t.length:0,s=-1;if(r&&(o=e,e=function(t,e,n){return o.call(r,t,e,n)}),n(u))for(;++s0&&(this.__notify(),this.__batchDispatchCount=0)}}),t.exports=n},function(t,e){e.dispatchStart=function(t,e){console.group&&(console.groupCollapsed("Dispatch: %s",t),console.group("payload"),console.debug(e),console.groupEnd())},e.dispatchError=function(t){console.group&&(console.debug("Dispatch error: "+t),console.groupEnd())},e.storeHandled=function(t,e,r){console.group&&e!==r&&console.debug("Store "+t+" handled action")},e.dispatchEnd=function(t){console.group&&(console.debug("Dispatch done, new state: ",t.toJS()),console.groupEnd())}},function(t,e,r){function n(t,e){"use strict";this.__prevState=t,this.__evaluator=e,this.__prevValues=i.Map(),this.__observers=[]}var i=r(2),o=r(7),u=r(8);Object.defineProperty(n.prototype,"notifyObservers",{writable:!0,configurable:!0,value:function(t){"use strict";if(this.__observers.length>0){var e=i.Map();this.__observers.forEach(function(r){var n,i=r.getter,s=o(i),a=this.__prevState;this.__prevValues.has(s)?n=this.__prevValues.get(s):(n=this.__evaluator.evaluate(a,i),this.__prevValues=this.__prevValues.set(s,n));var c=this.__evaluator.evaluate(t,i);u(n,c)||(r.handler.call(null,c),e=e.set(s,c))}.bind(this)),this.__prevValues=e}this.__prevState=t}}),Object.defineProperty(n.prototype,"onChange",{writable:!0,configurable:!0,value:function(t,e){"use strict";var r={getter:t,handler:e};return this.__observers.push(r),function(){var t=this.__observers.indexOf(r);t>-1&&this.__observers.splice(t,1)}.bind(this)}}),Object.defineProperty(n.prototype,"reset",{writable:!0,configurable:!0, +value:function(t){"use strict";this.__prevState=t,this.__prevValues=i.Map(),this.__observers=[]}}),t.exports=n},function(t,e,r){var n=r(2);t.exports=function(t,e){if(t.hasOwnProperty("__hashCode"))return t.__hashCode;var r=n.fromJS(t).hashCode();return e||(Object.defineProperty(t,"__hashCode",{enumerable:!1,configurable:!1,writable:!1,value:r}),Object.freeze(t)),r}},function(t,e,r){var n=r(2);t.exports=function(t,e){return n.is(t,e)}},function(t,e,r){function n(t){return a(t)&&s(t[t.length-1])}function i(t){return t[t.length-1]}function o(t){return t.slice(0,t.length-1)}function u(t){if(!c(t))throw new Error("Cannot create Getter from KeyPath: "+t);return[t,h]}var s=r(3).isFunction,a=r(3).isArray,c=r(10).isKeyPath,h=function(t){return t};t.exports={isGetter:n,getComputeFn:i,getDeps:o,fromKeyPath:u}},function(t,e,r){var n=r(3).isArray,i=r(3).isFunction;e.isKeyPath=function(t){return n(t)&&!i(t[t.length-1])}},function(t,e,r){function n(){"use strict";this.__cachedGetters=i.Map({})}var i=r(2),o=r(1).toImmutable,u=r(7),s=r(8),a=r(9).getComputeFn,c=r(9).getDeps,h=r(10).isKeyPath,f=r(9).isGetter,_=!1;Object.defineProperty(n.prototype,"evaluate",{writable:!0,configurable:!0,value:function(t,e){"use strict";if(h(e))return t.getIn(e);if(!f(e))throw new Error("evaluate must be passed a keyPath or Getter");var r=u(e);if(this.__isCached(t,e))return this.__cachedGetters.getIn([r,"value"]);var n=c(e).map(function(e){return this.evaluate(t,e)}.bind(this));if(this.__hasStaleValue(t,e)){var i=this.__cachedGetters.getIn([r,"args"]);if(s(i,o(n))){var p=this.__cachedGetters.getIn([r,"value"]);return this.__cacheValue(t,e,i,p),p}}if(_===!0)throw _=!1,new Error("Evaluate may not be called within a Getters computeFn");_=!0;try{var l=a(e).apply(null,n);_=!1}catch(v){throw _=!1,v}return this.__cacheValue(t,e,n,l),l}}),Object.defineProperty(n.prototype,"__hasStaleValue",{writable:!0,configurable:!0,value:function(t,e){"use strict";var r=u(e),n=this.__cachedGetters;return n.has(r)&&n.getIn([r,"stateHashCode"])!==t.hashCode()}}),Object.defineProperty(n.prototype,"__cacheValue",{writable:!0,configurable:!0,value:function(t,e,r,n){"use strict";var s=u(e);this.__cachedGetters=this.__cachedGetters.set(s,i.Map({value:n,args:o(r),stateHashCode:t.hashCode()}))}}),Object.defineProperty(n.prototype,"__isCached",{writable:!0,configurable:!0,value:function(t,e){"use strict";var r=u(e);return this.__cachedGetters.hasIn([r,"value"])&&this.__cachedGetters.getIn([r,"stateHashCode"])===t.hashCode()}}),Object.defineProperty(n.prototype,"untrack",{writable:!0,configurable:!0,value:function(t){"use strict"}}),Object.defineProperty(n.prototype,"reset",{writable:!0,configurable:!0,value:function(){"use strict";this.__cachedGetters=i.Map({})}}),t.exports=n},function(t,e,r){function n(t,e){var r={};return i(e,function(e,n){r[n]=t.evaluate(e)}),r}var i=r(3).each;t.exports=function(t){return{getInitialState:function(){return n(t,this.getDataBindings())},componentDidMount:function(){var e=this;e.__unwatchFns=[],i(this.getDataBindings(),function(r,n){var i=t.observe(r,function(t){var r={};r[n]=t,e.setState(r)});e.__unwatchFns.push(i)})},componentWillUnmount:function(){for(;this.__unwatchFns.length;)this.__unwatchFns.shift()()}}}},function(t,e,r){function n(t){"use strict";return this instanceof n?(this.__handlers=o({}),t&&u(this,t),void this.initialize()):new n(t)}function i(t){return t instanceof n}var o=r(2).Map,u=r(3).extend,s=r(1).toJS,a=r(1).toImmutable;Object.defineProperty(n.prototype,"initialize",{writable:!0,configurable:!0,value:function(){"use strict"}}),Object.defineProperty(n.prototype,"getInitialState",{writable:!0,configurable:!0,value:function(){"use strict";return o()}}),Object.defineProperty(n.prototype,"handle",{writable:!0,configurable:!0,value:function(t,e,r){"use strict";var n=this.__handlers.get(e);return"function"==typeof n?n.call(this,t,r,e):t}}),Object.defineProperty(n.prototype,"handleReset",{writable:!0,configurable:!0,value:function(t){"use strict";return this.getInitialState()}}),Object.defineProperty(n.prototype,"on",{writable:!0,configurable:!0,value:function(t,e){"use strict";this.__handlers=this.__handlers.set(t,e)}}),Object.defineProperty(n.prototype,"serialize",{writable:!0,configurable:!0,value:function(t){"use strict";return s(t)}}),Object.defineProperty(n.prototype,"deserialize",{writable:!0,configurable:!0,value:function(t){"use strict";return a(t)}}),t.exports=n,t.exports.isStore=i}])}); \ No newline at end of file