@blackglory/structures 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var hf=function(t,e){return(hf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function vf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}hf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function pf(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function mf(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function bf(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function gf(t){return"function"==typeof t}function wf(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Af=wf((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function If(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Sf=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var a=pf(i),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else i.remove(this);var c=this.initialTeardown;if(gf(c))try{c()}catch(t){o=t instanceof Af?t.errors:[t]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=pf(u),f=l.next();!f.done;f=l.next()){var d=f.value;try{xf(d)}catch(t){o=null!=o?o:[],t instanceof Af?o=bf(bf([],mf(o)),mf(t.errors)):o.push(t)}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(o)throw new Af(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)xf(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&If(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&If(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),_f=Sf.EMPTY;function Tf(t){return t instanceof Sf||t&&"closed"in t&&gf(t.remove)&&gf(t.add)&&gf(t.unsubscribe)}function xf(t){gf(t)?t():t.unsubscribe()}var Ef={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Of=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,bf([t,e],mf(n)))};function jf(){}function kf(t){t()}var Nf=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Tf(e)&&e.add(n)):n.destination=zf,n}return vf(e,t),e.create=function(t,e,n){return new Cf(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Sf),Bf=Function.prototype.bind;function Pf(t,e){return Bf.call(t,e)}var qf=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Mf(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Mf(t)}else Mf(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Mf(t)}},t}(),Cf=function(t){function e(e,n,r){var o,i,a=t.call(this)||this;gf(e)||!e?o={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:a&&Ef.useDeprecatedNextContext?((i=Object.create(e)).unsubscribe=function(){return a.unsubscribe()},o={next:e.next&&Pf(e.next,i),error:e.error&&Pf(e.error,i),complete:e.complete&&Pf(e.complete,i)}):o=e;return a.destination=new qf(o),a}return vf(e,t),e}(Nf);function Mf(t){var e;e=t,Of((function(){throw e}))}var zf={closed:!0,next:jf,error:function(t){throw t},complete:jf},Rf="function"==typeof Symbol&&Symbol.observable||"@@observable";function Uf(t){return t}function Df(t){return 0===t.length?Uf:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Ff=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,o=this,i=(r=t)&&r instanceof Nf||function(t){return t&&gf(t.next)&&gf(t.error)&&gf(t.complete)}(r)&&Tf(r)?t:new Cf(t,e,n);return kf((function(){var t=o,e=t.operator,n=t.source;i.add(e?e.call(i,n):n?o._subscribe(i):o._trySubscribe(i))})),i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=Jf(e))((function(e,r){var o=new Cf({next:function(e){try{t(e)}catch(t){r(t),o.unsubscribe()}},error:r,complete:e});n.subscribe(o)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Rf]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Df(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Jf(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function Jf(t){var e;return null!==(e=null!=t?t:Ef.Promise)&&void 0!==e?e:Promise}function Vf(t){return gf(null==t?void 0:t.lift)}function Lf(t,e,n,r,o){return new Wf(t,e,n,r,o)}var Wf=function(t){function e(e,n,r,o,i,a){var s=t.call(this,e)||this;return s.onFinalize=i,s.shouldUnsubscribe=a,s._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,s._error=o?function(t){try{o(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,s}return vf(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(Nf);function Kf(){return t=function(t,e){var n=null;t._refCount++;var r=Lf(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,o=n;n=null,!r||o&&r!==o||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())},function(e){if(Vf(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")};var t}!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Vf(e)&&(r.lift=e.lift),r}vf(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new Sf;var n=this.getSubject();e.add(this.source.subscribe(Lf(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=Sf.EMPTY)}return e},e.prototype.refCount=function(){return Kf()(this)}}(Ff);var Yf,Hf,$f={now:function(){return($f.delegate||performance).now()},delegate:void 0},Qf={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new Sf((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qf.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,bf([],mf(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,bf([],mf(t)))},delegate:void 0};Hf=Qf.schedule,new Ff((function(t){var e=new Sf,n=Yf||$f,r=n.now(),o=function(i){var a=n.now();t.next({timestamp:Yf?a:i,elapsed:a-r}),t.closed||e.add(Hf(o))};return e.add(Hf(o)),e}));var Xf=wf((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Gf=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return vf(e,t),e.prototype.lift=function(t){var e=new Zf(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Xf},e.prototype.next=function(t){var e=this;kf((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var o=pf(e.currentObservers),i=o.next();!i.done;i=o.next()){i.value.next(t)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;kf((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;kf((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,o=n.isStopped,i=n.observers;return r||o?_f:(this.currentObservers=null,i.push(t),new Sf((function(){e.currentObservers=null,If(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,o=e.isStopped;n?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new Ff;return t.source=this,t},e.create=function(t,e){return new Zf(t,e)},e}(Ff),Zf=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return vf(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:_f},e}(Gf);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}vf(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(Gf);var td={now:function(){return(td.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=td);var o=t.call(this)||this;return o._bufferSize=e,o._windowTime=n,o._timestampProvider=r,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,e),o._windowTime=Math.max(1,n),o}vf(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,o=n._buffer,i=n._infiniteTimeWindow,a=n._timestampProvider,s=n._windowTime;r||(o.push(e),!i&&o.push(a.now()+s)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),o=0;o<r.length&&!t.closed;o+=n?1:2)t.next(r[o]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,o=t._infiniteTimeWindow,i=(o?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!o){for(var a=n.now(),s=0,c=1;c<r.length&&r[c]<=a;c+=2)s=c;s&&r.splice(0,s+1)}}}(Gf),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}vf(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,o=e._value,i=e.thrownError,a=e.isStopped,s=e._isComplete;n?t.error(i):(a||s)&&(r&&t.next(o),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(Gf);var ed,nd=function(t){function e(e,n){return t.call(this)||this}return vf(e,t),e.prototype.schedule=function(t,e){return this},e}(Sf),rd=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,bf([t,e],mf(n)))},od=function(t){return clearInterval(t)},id=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return vf(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),rd(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;od(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,If(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(nd),ad=1,sd={};function cd(t){return t in sd&&(delete sd[t],!0)}var ud=function(t){var e=ad++;return sd[e]=!0,ed||(ed=Promise.resolve()),ed.then((function(){return cd(e)&&t()})),e},ld=function(t){cd(t)},fd={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=fd.delegate;return((null==n?void 0:n.setImmediate)||ud).apply(void 0,bf([],mf(t)))},clearImmediate:function(t){return ld(t)},delegate:void 0},dd=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return vf(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=fd.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(fd.clearImmediate(n),e._scheduled=void 0)},e}(id),yd=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=td.now,t}(),hd=function(t){function e(e,n){void 0===n&&(n=yd.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return vf(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(yd);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vf(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(hd))(dd),new hd(id);var vd=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return vf(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(id);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vf(e,t),e}(hd))(vd);var pd=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return vf(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Qf.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(Qf.cancelAnimationFrame(n),e._scheduled=void 0)},e}(id);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vf(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(hd))(pd),function(t){function e(e,n){void 0===e&&(e=bd),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}vf(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(hd);var md,bd=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var o=t.call(this,e,n)||this;return o.scheduler=e,o.work=n,o.index=r,o.active=!0,o.index=e.index=r,o}return vf(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var o=new e(this.scheduler,this.work);return this.add(o),o.schedule(n,r)}return Sf.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var o=t.actions;return o.push(this),o.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(id);new Ff((function(t){return t.complete()})),function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(md||(md={})),wf((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),wf((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),wf((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),wf((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}})),wf((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}})),new Ff(jf);class gd{constructor(){this.values=[],this.valueToValueIndex=[]}*[Symbol.iterator](){for(const t of this.values)yield t}has(t){return void 0!==this.valueToValueIndex[t]}add(t){if(!this.has(t)){const e=this.values.length;this.values.push(t),this.valueToValueIndex[t]=e}}remove(t){if(this.has(t)){const e=this.values.pop();if(t!==e){const n=this.valueToValueIndex[t];this.values[n]=e,this.valueToValueIndex[e]=n,this.valueToValueIndex[t]=void 0}}}}t.BadEventError=yf,t.Box=class{constructor(t){this.value=t}set(t){this.value=t}get(){return this.value}},t.Emitter=e,t.ExpirableMap=cf,t.FiniteStateMachine=df,t.HashMap=n,t.HashSet=r,t.LRUMap=Vl,t.ObservableFiniteStateMachine=class extends df{constructor(){super(...arguments),this.stateChanges=new Gf}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const n=this.state;this.stateChanges.next({event:t,oldState:e,newState:n}),La.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}},t.Queue=o,t.SparseSet=gd,t.TLRUMap=uf,t.TrieMap=ff,t.convertArrayToCons=function t([e,...n]){return[e,n.length?t(n):null]},t.convertConsToArray=function t([e,n]){return null===n?[e]:[e,...t(n)]},Object.defineProperty(t,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */var hf=function(t,e){return(hf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function vf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}hf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function pf(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function mf(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function bf(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function gf(t){return"function"==typeof t}function wf(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Af=wf((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function If(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Sf=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var a=pf(i),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else i.remove(this);var c=this.initialTeardown;if(gf(c))try{c()}catch(t){o=t instanceof Af?t.errors:[t]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=pf(u),f=l.next();!f.done;f=l.next()){var d=f.value;try{xf(d)}catch(t){o=null!=o?o:[],t instanceof Af?o=bf(bf([],mf(o)),mf(t.errors)):o.push(t)}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(o)throw new Af(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)xf(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&If(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&If(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),_f=Sf.EMPTY;function Tf(t){return t instanceof Sf||t&&"closed"in t&&gf(t.remove)&&gf(t.add)&&gf(t.unsubscribe)}function xf(t){gf(t)?t():t.unsubscribe()}var Ef={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Of=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,bf([t,e],mf(n)))};function jf(){}function kf(t){t()}var Nf=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Tf(e)&&e.add(n)):n.destination=zf,n}return vf(e,t),e.create=function(t,e,n){return new Cf(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Sf),Bf=Function.prototype.bind;function Pf(t,e){return Bf.call(t,e)}var qf=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Mf(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Mf(t)}else Mf(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Mf(t)}},t}(),Cf=function(t){function e(e,n,r){var o,i,a=t.call(this)||this;gf(e)||!e?o={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:a&&Ef.useDeprecatedNextContext?((i=Object.create(e)).unsubscribe=function(){return a.unsubscribe()},o={next:e.next&&Pf(e.next,i),error:e.error&&Pf(e.error,i),complete:e.complete&&Pf(e.complete,i)}):o=e;return a.destination=new qf(o),a}return vf(e,t),e}(Nf);function Mf(t){var e;e=t,Of((function(){throw e}))}var zf={closed:!0,next:jf,error:function(t){throw t},complete:jf},Rf="function"==typeof Symbol&&Symbol.observable||"@@observable";function Uf(t){return t}function Df(t){return 0===t.length?Uf:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Ff=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,o=this,i=(r=t)&&r instanceof Nf||function(t){return t&&gf(t.next)&&gf(t.error)&&gf(t.complete)}(r)&&Tf(r)?t:new Cf(t,e,n);return kf((function(){var t=o,e=t.operator,n=t.source;i.add(e?e.call(i,n):n?o._subscribe(i):o._trySubscribe(i))})),i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=Jf(e))((function(e,r){var o=new Cf({next:function(e){try{t(e)}catch(t){r(t),o.unsubscribe()}},error:r,complete:e});n.subscribe(o)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Rf]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Df(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Jf(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function Jf(t){var e;return null!==(e=null!=t?t:Ef.Promise)&&void 0!==e?e:Promise}function Vf(t){return gf(null==t?void 0:t.lift)}function Lf(t,e,n,r,o){return new Wf(t,e,n,r,o)}var Wf=function(t){function e(e,n,r,o,i,a){var s=t.call(this,e)||this;return s.onFinalize=i,s.shouldUnsubscribe=a,s._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,s._error=o?function(t){try{o(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,s}return vf(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(Nf);function Kf(){return t=function(t,e){var n=null;t._refCount++;var r=Lf(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,o=n;n=null,!r||o&&r!==o||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())},function(e){if(Vf(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")};var t}!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Vf(e)&&(r.lift=e.lift),r}vf(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new Sf;var n=this.getSubject();e.add(this.source.subscribe(Lf(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=Sf.EMPTY)}return e},e.prototype.refCount=function(){return Kf()(this)}}(Ff);var Yf,Hf,$f={now:function(){return($f.delegate||performance).now()},delegate:void 0},Qf={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new Sf((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Qf.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,bf([],mf(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,bf([],mf(t)))},delegate:void 0};Hf=Qf.schedule,new Ff((function(t){var e=new Sf,n=Yf||$f,r=n.now(),o=function(i){var a=n.now();t.next({timestamp:Yf?a:i,elapsed:a-r}),t.closed||e.add(Hf(o))};return e.add(Hf(o)),e}));var Xf=wf((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Gf=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return vf(e,t),e.prototype.lift=function(t){var e=new Zf(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Xf},e.prototype.next=function(t){var e=this;kf((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var o=pf(e.currentObservers),i=o.next();!i.done;i=o.next()){i.value.next(t)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;kf((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;kf((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,o=n.isStopped,i=n.observers;return r||o?_f:(this.currentObservers=null,i.push(t),new Sf((function(){e.currentObservers=null,If(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,o=e.isStopped;n?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new Ff;return t.source=this,t},e.create=function(t,e){return new Zf(t,e)},e}(Ff),Zf=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return vf(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:_f},e}(Gf);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}vf(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(Gf);var td={now:function(){return(td.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=td);var o=t.call(this)||this;return o._bufferSize=e,o._windowTime=n,o._timestampProvider=r,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,e),o._windowTime=Math.max(1,n),o}vf(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,o=n._buffer,i=n._infiniteTimeWindow,a=n._timestampProvider,s=n._windowTime;r||(o.push(e),!i&&o.push(a.now()+s)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),o=0;o<r.length&&!t.closed;o+=n?1:2)t.next(r[o]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,o=t._infiniteTimeWindow,i=(o?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!o){for(var a=n.now(),s=0,c=1;c<r.length&&r[c]<=a;c+=2)s=c;s&&r.splice(0,s+1)}}}(Gf),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}vf(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,o=e._value,i=e.thrownError,a=e.isStopped,s=e._isComplete;n?t.error(i):(a||s)&&(r&&t.next(o),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(Gf);var ed,nd=function(t){function e(e,n){return t.call(this)||this}return vf(e,t),e.prototype.schedule=function(t,e){return this},e}(Sf),rd=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,bf([t,e],mf(n)))},od=function(t){return clearInterval(t)},id=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return vf(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),rd(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;od(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,If(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(nd),ad=1,sd={};function cd(t){return t in sd&&(delete sd[t],!0)}var ud=function(t){var e=ad++;return sd[e]=!0,ed||(ed=Promise.resolve()),ed.then((function(){return cd(e)&&t()})),e},ld=function(t){cd(t)},fd={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=fd.delegate;return((null==n?void 0:n.setImmediate)||ud).apply(void 0,bf([],mf(t)))},clearImmediate:function(t){return ld(t)},delegate:void 0},dd=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return vf(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=fd.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(fd.clearImmediate(n),e._scheduled=void 0)},e}(id),yd=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=td.now,t}(),hd=function(t){function e(e,n){void 0===n&&(n=yd.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return vf(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(yd);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vf(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(hd))(dd),new hd(id);var vd=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return vf(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(id);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vf(e,t),e}(hd))(vd);var pd=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return vf(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Qf.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(Qf.cancelAnimationFrame(n),e._scheduled=void 0)},e}(id);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vf(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(hd))(pd),function(t){function e(e,n){void 0===e&&(e=bd),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}vf(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(hd);var md,bd=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var o=t.call(this,e,n)||this;return o.scheduler=e,o.work=n,o.index=r,o.active=!0,o.index=e.index=r,o}return vf(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var o=new e(this.scheduler,this.work);return this.add(o),o.schedule(n,r)}return Sf.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var o=t.actions;return o.push(this),o.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(id);new Ff((function(t){return t.complete()})),function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(md||(md={})),wf((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),wf((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),wf((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),wf((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}})),wf((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}})),new Ff(jf);class gd{constructor(){this.values=[],this.valueToValueIndex=[]}*[Symbol.iterator](){for(const t of this.values)yield t}has(t){return La.isntUndefined(this.valueToValueIndex[t])}add(t){if(!this.has(t)){const e=this.values.length;this.values.push(t),this.valueToValueIndex[t]=e}}remove(t){if(this.has(t)){const e=this.values.pop();if(t!==e){const n=this.valueToValueIndex[t];this.values[n]=e,this.valueToValueIndex[e]=n,this.valueToValueIndex[t]=void 0}}}}t.BadEventError=yf,t.Box=class{constructor(t){this.value=t}set(t){this.value=t}get(){return this.value}},t.Emitter=e,t.ExpirableMap=cf,t.FiniteStateMachine=df,t.HashMap=n,t.HashSet=r,t.LRUMap=Vl,t.ObservableFiniteStateMachine=class extends df{constructor(){super(...arguments),this.stateChanges=new Gf}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const n=this.state;this.stateChanges.next({event:t,oldState:e,newState:n}),La.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}},t.Queue=o,t.SparseSet=gd,t.TLRUMap=uf,t.TrieMap=ff,t.convertArrayToCons=function t([e,...n]){return[e,n.length?t(n):null]},t.convertConsToArray=function t([e,n]){return null===n?[e]:[e,...t(n)]},Object.defineProperty(t,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=index.umd.min.js.map