diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc52b7..f7559ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.2 (October 5, 2015) + +- **[FIXED]** Fix for observer iteration when removed during notify. [Issue #151](https://github.com/optimizely/nuclear-js/issues/151) + ## 1.1.1 (July 26, 2015) - **[ADDED]** Bowser support via bower.json diff --git a/bower.json b/bower.json index 137687d..fdc378c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "nuclear-js", - "version": "1.1.1", + "version": "1.1.2", "homepage": "https://github.com/optimizely/nuclear-js", "authors": [ "Jordan Garcia" diff --git a/dist/nuclear.js b/dist/nuclear.js index d2d51f8..d0d9c35 100644 --- a/dist/nuclear.js +++ b/dist/nuclear.js @@ -2,7 +2,7 @@ if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) - define(factory); + define([], factory); else if(typeof exports === 'object') exports["Nuclear"] = factory(); else @@ -220,7 +220,21 @@ return /******/ (function(modules) { // webpackBootstrap } function wrapIndex(iter, index) { - return index >= 0 ? (+index) : ensureSize(iter) + (+index); + // This implements "is array index" which the ECMAString spec defines as: + // A String property name P is an array index if and only if + // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal + // to 2^32−1. + // However note that we're currently calling ToNumber() instead of ToUint32() + // which should be improved in the future, as floating point numbers should + // not be accepted as an array index. + if (typeof index !== 'number') { + var numIndex = +index; + if ('' + numIndex !== index) { + return NaN; + } + index = numIndex; + } + return index < 0 ? ensureSize(iter) + index : index; } function returnTrue() { @@ -890,7 +904,7 @@ return /******/ (function(modules) { // webpackBootstrap var src_Math__imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : - function src_Math__imul(a, b) { + function imul(a, b) { a = a | 0; // int b = b | 0; // int var c = a & 0xffff; @@ -1441,6 +1455,15 @@ return /******/ (function(modules) { // webpackBootstrap function sliceFactory(iterable, begin, end, useKeys) { var originalSize = iterable.size; + // Sanitize begin & end using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + if (begin !== undefined) { + begin = begin | 0; + } + if (end !== undefined) { + end = end | 0; + } + if (wholeSlice(begin, end, originalSize)) { return iterable; } @@ -1467,7 +1490,9 @@ return /******/ (function(modules) { // webpackBootstrap var sliceSeq = makeSequence(iterable); - sliceSeq.size = sliceSize; + // If iterable.size is undefined, the size of the realized sliceSeq is + // unknown at this point unless the number of items to slice is 0 + sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined; if (!useKeys && isSeq(iterable) && sliceSize >= 0) { sliceSeq.get = function (index, notSetValue) { @@ -1916,7 +1941,7 @@ return /******/ (function(modules) { // webpackBootstrap function src_Map__Map(value) { return value === null || value === undefined ? emptyMap() : - isMap(value) ? value : + isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function(map ) { var iter = KeyedIterable(value); assertNotInfinite(iter.size); @@ -2763,12 +2788,12 @@ return /******/ (function(modules) { // webpackBootstrap List.prototype.get = function(index, notSetValue) { index = wrapIndex(this, index); - if (index < 0 || index >= this.size) { - return notSetValue; + if (index >= 0 && index < this.size) { + index += this._origin; + var node = listNodeFor(this, index); + return node && node.array[index & MASK]; } - index += this._origin; - var node = listNodeFor(this, index); - return node && node.array[index & MASK]; + return notSetValue; }; // @pragma Modification @@ -2964,29 +2989,25 @@ return /******/ (function(modules) { // webpackBootstrap }; VNode.prototype.removeAfter = function(ownerID, level, index) { - if (index === level ? 1 << level : 0 || this.array.length === 0) { + if (index === (level ? 1 << level : 0) || this.array.length === 0) { return this; } var sizeIndex = ((index - 1) >>> level) & MASK; if (sizeIndex >= this.array.length) { return this; } - var removingLast = sizeIndex === this.array.length - 1; + var newChild; if (level > 0) { var oldChild = this.array[sizeIndex]; newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); - if (newChild === oldChild && removingLast) { + if (newChild === oldChild && sizeIndex === this.array.length - 1) { return this; } } - if (removingLast && !newChild) { - return this; - } + var editable = editableVNode(this, ownerID); - if (!removingLast) { - editable.array.pop(); - } + editable.array.splice(sizeIndex + 1); if (newChild) { editable.array[sizeIndex] = newChild; } @@ -3078,6 +3099,10 @@ return /******/ (function(modules) { // webpackBootstrap function updateList(list, index, value) { index = wrapIndex(list, index); + if (index !== index) { + return list; + } + if (index >= list.size || index < 0) { return list.withMutations(function(list ) { index < 0 ? @@ -3169,6 +3194,14 @@ return /******/ (function(modules) { // webpackBootstrap } function setListBounds(list, begin, end) { + // Sanitize begin & end using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + if (begin !== undefined) { + begin = begin | 0; + } + if (end !== undefined) { + end = end | 0; + } var owner = list.__ownerID || new OwnerID(); var oldOrigin = list._origin; var oldCapacity = list._capacity; @@ -3681,7 +3714,7 @@ return /******/ (function(modules) { // webpackBootstrap function src_Set__Set(value) { return value === null || value === undefined ? emptySet() : - isSet(value) ? value : + isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function(set ) { var iter = SetIterable(value); assertNotInfinite(iter.size); @@ -4426,10 +4459,6 @@ return /******/ (function(modules) { // webpackBootstrap return reify(this, concatFactory(this, values)); }, - contains: function(searchValue) { - return this.includes(searchValue); - }, - includes: function(searchValue) { return this.some(function(value ) {return is(value, searchValue)}); }, @@ -4719,7 +4748,7 @@ return /******/ (function(modules) { // webpackBootstrap hashCode: function() { return this.__hash || (this.__hash = hashIterable(this)); - }, + } // ### Internal @@ -4742,6 +4771,7 @@ return /******/ (function(modules) { // webpackBootstrap IterablePrototype.inspect = IterablePrototype.toSource = function() { return this.toString(); }; IterablePrototype.chain = IterablePrototype.flatMap; + IterablePrototype.contains = IterablePrototype.includes; // Temporary warning about using length (function () { @@ -4812,7 +4842,7 @@ return /******/ (function(modules) { // webpackBootstrap function(k, v) {return mapper.call(context, k, v, this$0)} ).flip() ); - }, + } }); @@ -4867,7 +4897,10 @@ return /******/ (function(modules) { // webpackBootstrap if (numArgs === 0 || (numArgs === 2 && !removeNum)) { return this; } - index = resolveBegin(index, this.size); + // If index is negative, it should resolve relative to the size of the + // collection. However size may be expensive to compute if not cached, so + // only call count() if the number is in fact negative. + index = resolveBegin(index, index < 0 ? this.count() : this.size); var spliced = this.slice(0, index); return reify( this, @@ -4940,7 +4973,7 @@ return /******/ (function(modules) { // webpackBootstrap var iterables = arrCopy(arguments); iterables[0] = this; return reify(this, zipWithFactory(this, zipper, iterables)); - }, + } }); @@ -4966,7 +4999,7 @@ return /******/ (function(modules) { // webpackBootstrap keySeq: function() { return this.valueSeq(); - }, + } }); @@ -5070,7 +5103,7 @@ return /******/ (function(modules) { // webpackBootstrap Repeat: Repeat, is: is, - fromJS: fromJS, + fromJS: fromJS }; diff --git a/dist/nuclear.min.js b/dist/nuclear.min.js index 2f5c884..53830b4 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: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!!E(t)}function O(t){return t&&"function"==typeof t.next}function D(t){var e=E(t);return e&&e.call(t)}function E(t){var e=t&&(wr&&t[wr]||t[Sr]);return"function"==typeof e?e:void 0}function M(t){return t&&"number"==typeof t.length}function x(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 M(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?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 Mt(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),D(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=D(t);if(!e){if(!M(t))throw new TypeError("Expected iterable or array-like: "+t);e=D(_(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 Me(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?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(De()))}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=Er(e,3432918353),e=Er(e<<15|e>>>-15,461845907),e=Er(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Er(e^e>>>16,2246822507),e=Er(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=D(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=D(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 Dr,Er="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},Mr=Object.isExtensible,xr=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),qr="function"==typeof WeakMap;qr&&(Dr=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):De()},Ie.prototype.set=function(t,e){return Ee(this,t,e)},Ie.prototype.remove=function(t){return Ee(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(Me,F),Me.of=function(){return this(arguments)},Me.prototype.toString=function(){return this.__toString("Stack [","]")},Me.prototype.get=function(t,e){var r=this._head;for(t=u(this,t);r&&t--;)r=r.next;return r?r.value:e},Me.prototype.peek=function(){return this._head&&this._head.value},Me.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)},Me.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)},Me.prototype.pop=function(){return this.slice(1)},Me.prototype.unshift=function(){return this.push.apply(this,arguments)},Me.prototype.unshiftAll=function(t){return this.pushAll(t)},Me.prototype.shift=function(){return this.pop.apply(this,arguments)},Me.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()},Me.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)},Me.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)},Me.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},Me.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()})},Me.isStack=xe;var Nr="@@__IMMUTABLE_STACK__@@",Xr=Me.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.__batchDispatchCount++;else{if(this.state!==r)try{this.__notify()}catch(n){throw this.__isDispatching=!1,n}this.__isDispatching=!1}}}),Object.defineProperty(n.prototype,"batch",{writable:!0,configurable:!0,value:function(t){"use strict";this.__batchStart(),t(),this.__batchEnd()}}),Object.defineProperty(n.prototype,"registerStore",{writable:!0,configurable:!0,value:function(t,e){"use strict";console.warn("Deprecation warning: `registerStore` will no longer be supported in 1.1, use `registerStores` instead");var r={};r[t]=e,this.registerStores(r)}}),Object.defineProperty(n.prototype,"registerStores",{writable:!0,configurable:!0,value:function(t){"use strict";l(t,function(t,e){this.__stores.get(e)&&console.warn("Store already defined for id = "+e);var r=t.getInitialState();if(this.debug&&!p(r))throw new Error("Store getInitialState() must return an immutable value, did you forget to call toImmutable");this.__stores=this.__stores.set(e,t),this.state=this.state.set(e,r)}.bind(this)),this.__notify()}}),Object.defineProperty(n.prototype,"serialize",{writable:!0,configurable:!0,value:function(){"use strict";var t={};return this.__stores.forEach(function(e,r){var n=this.state.get(r),i=e.serialize(n);void 0!==i&&(t[r]=i)}.bind(this)),t}}),Object.defineProperty(n.prototype,"loadState",{writable:!0,configurable:!0,value:function(t){"use strict";var e=_({}).withMutations(function(e){l(t,function(t,r){var n=this.__stores.get(r);if(n){var i=n.deserialize(t);void 0!==i&&e.set(r,i)}}.bind(this))}.bind(this));this.state=this.state.merge(e),this.__notify()}}),Object.defineProperty(n.prototype,"reset",{writable:!0,configurable:!0,value:function(){"use strict";var t=this.debug,e=this.state;this.state=i.Map().withMutations(function(r){this.__stores.forEach(function(n,i){var o=e.get(i),u=n.handleReset(o);if(t&&void 0===u)throw new Error("Store handleReset() must return a value, did you forget a return statement");if(t&&!p(u))throw new Error("Store reset state must be an immutable value, did you forget to call toImmutable");r.set(i,u)})}.bind(this)),this.__evaluator.reset(),this.__changeObserver.reset(this.state)}}),Object.defineProperty(n.prototype,"__notify",{writable:!0,configurable:!0,value:function(){"use strict";this.__changeObserver.notifyObservers(this.state)}}),Object.defineProperty(n.prototype,"__handleAction",{writable:!0,configurable:!0,value:function(t,e,r){"use strict";return t.withMutations(function(t){this.debug&&o.dispatchStart(e,r),this.__stores.forEach(function(n,i){var u,s=t.get(i);try{u=n.handle(s,e,r)}catch(a){throw o.dispatchError(a.message),a}if(this.debug&&void 0===u){var c="Store handler must return a value, did you forget a return statement";throw o.dispatchError(c),new Error(c)}t.set(i,u),this.debug&&o.storeHandled(i,s,u)}.bind(this)),this.debug&&o.dispatchEnd(t)}.bind(this))}}),Object.defineProperty(n.prototype,"__batchStart",{writable:!0,configurable:!0,value:function(){"use strict";this.__batchDepth++}}),Object.defineProperty(n.prototype,"__batchEnd",{writable:!0,configurable:!0,value:function(){"use strict";if(this.__batchDepth--,this.__batchDepth<=0){if(this.__batchDispatchCount>0){this.__isDispatching=!0;try{this.__notify()}catch(t){throw this.__isDispatching=!1,t}this.__isDispatching=!1}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");var l;_=!0;try{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 +!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){if("number"!=typeof e){var r=+e;if(""+r!==e)return NaN;e=r}return 0>e?o(t)+e: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!!E(t)}function O(t){return t&&"function"==typeof t.next}function D(t){var e=E(t);return e&&e.call(t)}function E(t){var e=t&&(wr&&t[wr]||t[Sr]);return"function"==typeof e?e:void 0}function M(t){return t&&"number"==typeof t.length}function x(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 M(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 N(){}function F(){}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(void 0!==e&&(e=0|e),void 0!==r&&(r=0|r),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=0===f?f:t.size&&f||void 0,!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 Mt(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),D(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=D(t);if(!e){if(!M(t))throw new TypeError("Expected iterable or array-like: "+t);e=D(_(t))}return e}function Ut(t){return null===t||void 0===t?Ft():Ct(t)&&!b(t)?t:Ft().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 Nt(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 Ft(){return Lr||(Lr=Nt(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?Nt(o,i):Ft()}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){void 0!==e&&(e=0|e),void 0!==r&&(r=0|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 Me(t){return null===t||void 0===t?je():xe(t)?t:je().unshiftAll(t)}function xe(t){return!(!t||!t[Fr])}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)&&!b(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(Ft()))}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(De()))}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 Ne(t,e,r){if(!(this instanceof Ne))return new Ne(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 Fe(t,e){if(!(this instanceof Fe))return new Fe(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=Er(e,3432918353),e=Er(e<<15|e>>>-15,461845907),e=Er(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Er(e^e>>>16,2246822507),e=Er(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=D(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=D(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(N,G),t(F,G),G.Keyed=H,G.Indexed=N,G.Set=F;var Dr,Er="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},Mr=Object.isExtensible,xr=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),qr="function"==typeof WeakMap;qr&&(Dr=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):Ft()},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,Ft(),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,Ft(),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?Nt(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,N),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),t>=0&&t>>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;if(e>0){var o=this.array[n];if(i=o&&o.removeAfter(t,e-ar,r),i===o&&n===this.array.length-1)return this}var u=ge(this,t);return u.array.splice(n+1),i&&(u.array[n]=i),u};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):De()},Ie.prototype.set=function(t,e){return Ee(this,t,e)},Ie.prototype.remove=function(t){return Ee(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 Nr;t(Me,N),Me.of=function(){return this(arguments)},Me.prototype.toString=function(){return this.__toString("Stack [","]")},Me.prototype.get=function(t,e){var r=this._head;for(t=u(this,t);r&&t--;)r=r.next;return r?r.value:e},Me.prototype.peek=function(){return this._head&&this._head.value},Me.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)},Me.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)},Me.prototype.pop=function(){return this.slice(1)},Me.prototype.unshift=function(){return this.push.apply(this,arguments)},Me.prototype.unshiftAll=function(t){return this.pushAll(t)},Me.prototype.shift=function(){return this.pop.apply(this,arguments)},Me.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()},Me.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 N.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)},Me.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)},Me.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},Me.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()})},Me.isStack=xe;var Fr="@@__IMMUTABLE_STACK__@@",Xr=Me.prototype;Xr[Fr]=!0,Xr.withMutations=Cr.withMutations,Xr.asMutable=Cr.asMutable,Xr.asImmutable=Cr.asImmutable,Xr.wasAltered=Cr.wasAltered;var Yr;t(Ae,F),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:"")+" ]"},Ne.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Ne.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e=e?new Ne(0,0):new Ne(this.get(t,this._end),this.get(e,this._end),this._step))},Ne.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},Ne.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)})},Ne.prototype.equals=function(t){return t instanceof Ne?this._start===t._start&&this._end===t._end&&this._step===t._step:He(this,t)};var nn;t(Fe,j),Fe.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Fe.prototype.get=function(t,e){return this.has(t)?this._value:e},Fe.prototype.includes=function(t){return X(this._value,t)},Fe.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:new Fe(this._value,h(e,r)-c(t,r))},Fe.prototype.reverse=function(){return this},Fe.prototype.indexOf=function(t){return X(this._value,t)?0:-1},Fe.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},Fe.prototype.__iterate=function(t,e){for(var r=0;rt?this.count():this.size);var n=this.slice(0,t);return xt(this,1===r?n:n.concat(i(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return xt(this,St(this,t,!1))},get:function(t,e){return t=u(this,t),0>t||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.__batchDispatchCount++;else{if(this.state!==r)try{this.__notify()}catch(n){throw this.__isDispatching=!1,n}this.__isDispatching=!1}}}),Object.defineProperty(n.prototype,"batch",{writable:!0,configurable:!0,value:function(t){"use strict";this.__batchStart(),t(),this.__batchEnd()}}),Object.defineProperty(n.prototype,"registerStore",{writable:!0,configurable:!0,value:function(t,e){"use strict";console.warn("Deprecation warning: `registerStore` will no longer be supported in 1.1, use `registerStores` instead");var r={};r[t]=e,this.registerStores(r)}}),Object.defineProperty(n.prototype,"registerStores",{writable:!0,configurable:!0,value:function(t){"use strict";l(t,function(t,e){this.__stores.get(e)&&console.warn("Store already defined for id = "+e);var r=t.getInitialState();if(this.debug&&!p(r))throw new Error("Store getInitialState() must return an immutable value, did you forget to call toImmutable");this.__stores=this.__stores.set(e,t),this.state=this.state.set(e,r)}.bind(this)),this.__notify()}}),Object.defineProperty(n.prototype,"serialize",{writable:!0,configurable:!0,value:function(){"use strict";var t={};return this.__stores.forEach(function(e,r){var n=this.state.get(r),i=e.serialize(n);void 0!==i&&(t[r]=i)}.bind(this)),t}}),Object.defineProperty(n.prototype,"loadState",{writable:!0,configurable:!0,value:function(t){"use strict";var e=_({}).withMutations(function(e){l(t,function(t,r){var n=this.__stores.get(r);if(n){var i=n.deserialize(t);void 0!==i&&e.set(r,i)}}.bind(this))}.bind(this));this.state=this.state.merge(e),this.__notify()}}),Object.defineProperty(n.prototype,"reset",{writable:!0,configurable:!0,value:function(){"use strict";var t=this.debug,e=this.state;this.state=i.Map().withMutations(function(r){this.__stores.forEach(function(n,i){var o=e.get(i),u=n.handleReset(o);if(t&&void 0===u)throw new Error("Store handleReset() must return a value, did you forget a return statement");if(t&&!p(u))throw new Error("Store reset state must be an immutable value, did you forget to call toImmutable");r.set(i,u)})}.bind(this)),this.__evaluator.reset(),this.__changeObserver.reset(this.state)}}),Object.defineProperty(n.prototype,"__notify",{writable:!0,configurable:!0,value:function(){"use strict";this.__changeObserver.notifyObservers(this.state)}}),Object.defineProperty(n.prototype,"__handleAction",{writable:!0,configurable:!0,value:function(t,e,r){"use strict";return t.withMutations(function(t){this.debug&&o.dispatchStart(e,r),this.__stores.forEach(function(n,i){var u,s=t.get(i);try{u=n.handle(s,e,r)}catch(a){throw o.dispatchError(a.message),a}if(this.debug&&void 0===u){var c="Store handler must return a value, did you forget a return statement";throw o.dispatchError(c),new Error(c)}t.set(i,u),this.debug&&o.storeHandled(i,s,u)}.bind(this)),this.debug&&o.dispatchEnd(t)}.bind(this))}}),Object.defineProperty(n.prototype,"__batchStart",{writable:!0,configurable:!0,value:function(){"use strict";this.__batchDepth++}}),Object.defineProperty(n.prototype,"__batchEnd",{writable:!0,configurable:!0,value:function(){"use strict";if(this.__batchDepth--,this.__batchDepth<=0){if(this.__batchDispatchCount>0){this.__isDispatching=!0;try{this.__notify()}catch(t){throw this.__isDispatching=!1,t}this.__isDispatching=!1}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");var l;_=!0;try{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 diff --git a/package.json b/package.json index 4929398..e80e372 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuclear-js", - "version": "1.1.1", + "version": "1.1.2", "description": "Immutable, reactive Flux architecture. UI Agnostic.", "main": "dist/nuclear.js", "scripts": {