New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

most

Package Overview
Dependencies
Maintainers
5
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

most - npm Package Compare versions

Comparing version 1.7.2 to 1.7.3

2

dist/most.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.most={})}(this,function(t){"use strict";function e(t){this.source=t}function n(t,e){var n=e.length,i=new Array(n+1);i[0]=t;for(var r=0;r<n;++r)i[r+1]=e[r];return i}function i(t,e){for(var n=e.length,i=new Array(n+1),r=0;r<n;++r)i[r]=e[r];return i[n]=t,i}function r(t,e){if(t<0)throw new TypeError("n must be >= 0");var n=e.length;return 0===t||0===n?e:t>=n?[]:o(t,e,n-t)}function o(t,e,n){for(var i=new Array(n),r=0;r<n;++r)i[r]=e[t+r];return i}function s(t){return r(1,t)}function u(t,e){for(var n=e.length,i=new Array(n),r=0;r<n;++r)i[r]=t(e[r]);return i}function h(t,e,n){if(e<0)throw new TypeError("i must be >= 0");for(var i=n.length,r=new Array(i),o=0;o<i;++o)r[o]=e===o?t:n[o];return r}function p(t,e){if(t<0)throw new TypeError("i must be >= 0");var n=e.length;return 0===n||t>=n?e:1===n?[]:c(t,e,n-1)}function c(t,e,n){var i,r=new Array(n);for(i=0;i<t;++i)r[i]=e[i];for(i=t;i<n;++i)r[i]=e[i+1];return r}function f(t,e){for(var n=e.length,i=new Array(n),r=0,o=void 0,s=0;s<n;++s)t(o=e[s])||(i[r]=o,++r);return i.length=r,i}function a(t,e){for(var n=0,i=e.length;n<i;++n)if(t===e[n])return n;return-1}function d(t){return null!=t&&"number"==typeof t.length&&"function"!=typeof t}function l(t,e){this._dispose=t,this._data=e}function y(){this.disposable=void 0,this.disposed=!1,this._resolve=void 0;var t=this;this.result=new Promise(function(e){t._resolve=e})}function v(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}function w(t,e,n){var i=g(e);return v(i)?i.catch(function(e){n.error(t,e)}):i}function k(t,e){return E(new l(t,e))}function m(){return new l(Li,void 0)}function _(t){return k(b,t)}function b(t){return Promise.all(Wi(g,t))}function g(t){try{return t.dispose()}catch(t){return Promise.reject(t)}}function x(){return new y}function E(t){return new l(A,P(t))}function A(t){return t.disposed||(t.disposed=!0,t.value=g(t.disposable),t.disposable=void 0),t.value}function P(t){return{disposed:!1,disposable:t,value:void 0}}function T(t){setTimeout(function(){throw t},0)}function M(t,e,n){this._run=t,this.value=e,this.sink=n,this.active=!0}function R(t,e,n){n.error(t,e)}function I(t,e,n){n.event(t,e)}function W(t,e,n){n.end(t,e)}function L(t){return new e(new C(t))}function C(t){this.value=t}function N(t,e,n){n.event(t,e),n.end(t,void 0)}function S(){return Ci}function q(){}function B(t){return t.dispose()}function j(){}function D(t){return new e(new V(t))}function V(t){this.array=t}function U(t,e,n){for(var i=0,r=e.length;i<r&&this.active;++i)n.event(t,e[i]);this.active&&n.end(t)}function z(t){return"function"==typeof t[Si]}function O(t){return t[Si]()}function F(t){return new e(new G(t))}function G(t){this.iterable=t}function H(t,e,n){for(var i=e.next();!i.done&&this.active;)n.event(t,i.value),i=e.next();n.end(t,i.value)}function J(t){var e=null;if(t){var n=t[Bi];if("function"==typeof n&&(!(e=n.call(t))||"function"!=typeof e.subscribe))throw new TypeError("invalid observable "+e)}return e}function K(t,e,n){try{n.event(t,e)}catch(e){n.error(t,e)}}function Q(t,e,n){try{n.end(t,e)}catch(e){n.error(t,e)}}function X(t){return new e(new Y(t))}function Y(t){this.observable=t}function Z(t,e){this.sink=t,this.scheduler=e}function $(t){return t.unsubscribe()}function tt(t){if(t instanceof e)return t;var n=J(t);if(null!=n)return X(n);if(Array.isArray(t)||d(t))return D(t);if(z(t))return F(t);throw new TypeError("from(x) must be observable, iterable, or array-like: "+t)}function et(t,e){this.period=t,this.value=e}function nt(t,e,n,i){this.time=t,this.period=e,this.task=n,this.scheduler=i,this.active=!0}function it(t){return Promise.resolve(t).then(rt)}function rt(t){try{return t.run()}catch(e){return t.error(e)}}function ot(t,e){this.timer=t,this.timeline=e,this._timer=null,this._nextArrival=1/0;var n=this;this._runReadyTasksBound=function(){n._runReadyTasks(n.now())}}function st(){}function ut(t){this.f=t,this.active=!0}function ht(t){var e=new ut(t);return it(e),e}function pt(){this.tasks=[]}function ct(t,e,n){for(var i=e.events,r=0;r<i.length;++r){var o=i[r];o.active&&(t(o),o.period>=0&&o.active&&(o.time=o.time+o.period,ft(o,n)))}return n}function ft(t,e){var n=e.length;if(0!==n){var i=dt(t.time,e);i>=n?e.push(lt(t.time,[t])):t.time===e[i].time?e[i].events.push(t):e.splice(i,0,lt(t.time,[t]))}else e.push(lt(t.time,[t]))}function at(t,e){e.events=f(t,e.events)}function dt(t,e){for(var n,i,r=0,o=e.length;r<o;){if(n=Math.floor((r+o)/2),i=e[n],t===i.time)return n;t<i.time?o=n:r=n+1}return o}function lt(t,e){return{time:t,events:e}}function yt(t,e){if(Object(t)!==t)throw new TypeError("subscriber must be an object");var n=x(),i=new vt(T,t,n);return n.setDisposable(e.source.run(i,ji)),new wt(n)}function vt(t,e,n){this.fatalError=t,this.subscriber=e,this.disposable=n}function wt(t){this.disposable=t}function kt(t,e,n){if("function"==typeof e.error)try{e.error(t)}catch(t){n(t)}else n(t)}function mt(t,e){return t(e)}function _t(t,e,n){this.event=t,this.source=e,this.capture=n}function bt(t){var e=t.target;e.source.removeEventListener(e.event,t.addEvent,e.capture)}function gt(t){this.sink=t,this.events=[],this.active=!0}function xt(t,e,n){this.sink=t,this.events=n,this.time=e}function Et(t,e,n){this.time=t,this.value=e,this.sink=n}function At(t,e,n){this.time=t,this.value=e,this.sink=n}function Pt(t,e){this.event=t,this.source=e}function Tt(t){var e=t.target;e.source.removeListener(e.event,t.addEvent)}function Mt(t){return Rt(t,ji)}function Rt(t,e){return new Promise(function(n,i){It(t,e,n,i)})}function It(t,e,n,i){var r=x(),o=new Wt(n,i,r);r.setDisposable(t.run(o,e))}function Wt(t,e,n){this._end=t,this._error=e,this._disposable=n,this.active=!0}function Lt(t,e,n,i){Promise.resolve(n.dispose()).then(function(){t(i)},e)}function Ct(t){this.sink=t}function Nt(t,e){this.p=t,this.source=e}function St(t,e){this.p=t,this.sink=e}function qt(t,e){return function(n){return t(n)&&e(n)}}function Bt(t,e,n){this.p=t,this.f=e,this.source=n}function jt(t,e,n){this.p=t,this.f=e,this.sink=n}function Dt(t,e){this.f=t,this.source=e}function Vt(t,e){this.f=t,this.sink=e}function Ut(t,n){return new e(Dt.create(t,n.source))}function zt(t,e){return Ut(function(){return t},e)}function Ot(t,n){return new e(new Ft(t,n.source))}function Ft(t,e){this.source=e,this.f=t}function Gt(t,e){this.sink=e,this.f=t}function Ht(t,e){return Jt(Ot(t,e))}function Jt(t){return Mt(t.source)}function Kt(t,n,i){return new e(new Qt(t,n,i.source))}function Qt(t,e,n){this.step=t,this.seed=e,this.source=n}function Xt(t,e,n){this.step=t,this.seed=e,this.sink=n}function Yt(t,n,i){return new e(new Zt(t,n,i.source))}function Zt(t,e,n){this.source=n,this.f=t,this.value=e}function $t(t,e,n){this.f=t,this.value=e,this.sink=n}function te(t,e,n){return Mt(new ee(t,e,n.source))}function ee(t,e,n){this.source=n,this.f=t,this.value=e}function ne(t,e,n){this.f=t,this.value=e,this.sink=n}function ie(t,e){this.f=t,this.value=e}function re(t,e,n,i){this.f=t,this.sink=n,this.scheduler=i,this.active=!0;var r=this;Promise.resolve(this).then(function(t){return oe(t,e)}).catch(function(t){r.sink.error(r.scheduler.now(),t)})}function oe(t,e){var n=t.f;return Promise.resolve(n(e)).then(function(e){return se(t,e)})}function se(t,e){return e.done?(t.sink.end(t.scheduler.now(),e.value),e.value):(t.sink.event(t.scheduler.now(),e.value),t.active?oe(t,e.seed):e.value)}function ue(t,e){this.f=t,this.value=e}function he(t,e,n,i){this.f=t,this.sink=n,this.scheduler=i,this.active=!0;var r=e,o=this;Promise.resolve(this).then(function(t){return pe(t,r)}).catch(function(t){o.sink.error(o.scheduler.now(),t)})}function pe(t,e){if(t.sink.event(t.scheduler.now(),e),!t.active)return e;var n=t.f;return Promise.resolve(n(e)).then(function(e){return ce(t,e)})}function ce(t,e){return t.active?pe(t,e):t.value}function fe(t,e){this.f=t,this.args=e}function ae(t,e,n){this.iterator=t,this.sink=e,this.scheduler=n,this.active=!0;var i=this;Promise.resolve(this).then(de).catch(function(t){i.sink.error(i.scheduler.now(),t)})}function de(t,e){return t.active?le(t,t.iterator.next(e)):e}function le(t,e){return e.done?t.sink.end(t.scheduler.now(),e.value):Promise.resolve(e.value).then(function(e){return ye(t,e)},function(e){return ve(t,e)})}function ye(t,e){return t.sink.event(t.scheduler.now(),e),de(t,e)}function ve(t,e){return le(t,t.iterator.throw(e))}function we(t,n){return new e(new ke(t,n.source))}function ke(t,e){this.f=t,this.source=e}function me(t,e,n,i){this.f=t,this.sink=n,this.scheduler=i,this.active=!0,this.disposable=E(e.run(this,i))}function _e(t,e){return be(L(t),e)}function be(t,e){return we(function(){return e},t)}function ge(t,e){this.sink=e,this.index=t,this.active=!0,this.value=void 0}function xe(t,e){switch(e.length){case 0:return t();case 1:return t(e[0]);case 2:return t(e[0],e[1]);case 3:return t(e[0],e[1],e[2]);case 4:return t(e[0],e[1],e[2],e[3]);case 5:return t(e[0],e[1],e[2],e[3],e[4]);default:return t.apply(void 0,e)}}function Ee(t){return Ae(t,Vi(arguments))}function Ae(t,n){var i=n.length;return 0===i?S():1===i?Ut(t,n[0]):new e(Pe(t,n))}function Pe(t,e){return new Me(t,Di(Te,e))}function Te(t){return t.source}function Me(t,e){this.f=t,this.sources=e}function Re(t,e,n,i){var r=this;this.sink=n,this.disposables=t,this.sinks=e,this.f=i;var o=e.length;this.awaiting=o,this.values=new Array(o),this.hasValue=new Array(o);for(var s=0;s<o;++s)r.hasValue[s]=!1;this.activeCount=e.length}function Ie(t,e){return Ee(Ii,t,e)}function We(t,n){return new e(new Le(t,n.source))}function Le(t,e){this.transducer=t,this.source=e}function Ce(t,e){this.xf=t,this.sink=e}function Ne(t){this.time=-1/0,this.sink=t}function Se(t){return"function"==typeof t["@@transducer/step"]?new qe(t):new Be(t)}function qe(t){this.tx=t}function Be(t){this.tx=t}function je(){this.head=null,this.length=0}function De(t,e){return Ve(Mi,t,e)}function Ve(t,n,i){return new e(new Ue(t,n,i.source))}function Ue(t,e,n){this.f=t,this.concurrency=e,this.source=n}function ze(t,e,n,i,r){this.f=t,this.concurrency=e,this.sink=i,this.scheduler=r,this.pending=[],this.current=new je,this.disposable=E(n.run(this,r)),this.active=!0}function Oe(t,e,n,i){return t(e).source.run(n,i)}function Fe(t,e,n){this.prev=this.next=null,this.time=t,this.outer=e,this.sink=n,this.disposable=void 0}function Ge(t,e){return Ve(t,1/0,e)}function He(t){return De(1/0,t)}function Je(t,e){return Ve(t,1,e)}function Ke(t){var n=t.length;return 0===n?S():1===n?t[0]:new e(Qe(t))}function Qe(t){return new Ye(zi(Xe,[],t))}function Xe(t,e){var n=e.source;return n instanceof Ye?t.concat(n.sources):t.concat(n)}function Ye(t){this.sources=t}function Ze(t,e,n){this.sink=n,this.disposables=t,this.activeCount=e.length}function $e(t,n){return new e(new nn(Mi,t.source,[n.source]))}function tn(t,n,i){return new e(new nn(t,n.source,u(en,i)))}function en(t){return t.source}function nn(t,e,n){this.f=t,this.sampler=e,this.sources=n}function rn(t){this.sink=t,this.hasValue=!1}function on(t,e,n){this.f=t,this.sinks=e,this.sink=n,this.active=!1}function sn(t){return t.hasValue}function un(t){return t.value}function hn(t){this._capacity=t||32,this._length=0,this._head=0}function pn(t,e,n,i,r){for(var o=0;o<r;++o)n[o+i]=t[o+e],t[o+e]=void 0}function cn(t,n){return 0===n.length?S():1===n.length?Ut(t,n[0]):new e(new an(t,Oi(fn,n)))}function fn(t){return t.source}function an(t,e){this.f=t,this.sources=e}function dn(t,e,n,i){this.f=t,this.sinks=n,this.sink=i,this.buffers=e}function ln(t,e,n,i){i.event(e,xe(t,Oi(yn,n)))}function yn(t){return t.shift()}function vn(t,e){for(var n=0,i=t.length;n<i;++n)if(t[n].isEmpty()&&!e[n].active)return!0;return!1}function wn(t){for(var e=0,n=t.length;e<n;++e)if(t[e].isEmpty())return!1;return!0}function kn(t){return new e(new mn(t.source))}function mn(t){this.source=t}function _n(t,e){this.sink=t,this.scheduler=e,this.current=null,this.ended=!1}function bn(t,e,n,i){this.min=t,this.max=e,this.outer=n,this.sink=i,this.disposable=m()}function gn(t,n){return new e(Nt.create(t,n.source))}function xn(t){return En(Tn,t)}function En(t,n){return new e(new An(t,n.source))}function An(t,e){this.equals=t,this.source=e}function Pn(t,e){this.equals=t,this.sink=e,this.value=void 0,this.init=!0}function Tn(t,e){return t===e}function Mn(t,e){return In(0,t,e)}function Rn(t,e){return In(t,1/0,e)}function In(t,n,i){return n<=t?S():new e(Wn(t,n,i.source))}function Wn(t,e,n){return n instanceof Dt?Ln(t,e,n):n instanceof Nn?Cn(t,e,n):new Nn(t,e,n)}function Ln(t,e,n){return Dt.create(n.f,Wn(t,e,n.source))}function Cn(t,e,n){return t+=n.min,e=Math.min(e+n.min,n.max),new Nn(t,e,n.source)}function Nn(t,e,n){this.source=n,this.min=t,this.max=e}function Sn(t,e,n,i){this.sink=n,this.skip=t,this.take=e,this.disposable=i}function qn(t,n){return new e(new Bn(t,n.source))}function Bn(t,e){this.p=t,this.source=e}function jn(t,e,n){this.p=t,this.sink=e,this.active=!0,this.disposable=n}function Dn(t,n){return new e(new Vn(t,n.source))}function Vn(t,e){this.p=t,this.source=e}function Un(t,e){this.p=t,this.sink=e,this.skipping=!0}function zn(t,n){return new e(new On(t,n.source))}function On(t,e){this.p=t,this.source=e}function Fn(t,e){this.p=t,this.sink=e,this.skipping=!1}function Gn(t,n){return new e(new Kn(t.source,n.source))}function Hn(t,n){return new e(new Qn(t.source,n.source))}function Jn(t,e){return Gn(He(t),Hn(t,e))}function Kn(t,e){this.maxSignal=t,this.source=e}function Qn(t,e){this.minSignal=t,this.source=e}function Xn(t,e){this.value=t,this.sink=e}function Yn(t,e,n){this.min=t,this.max=e,this.sink=n}function Zn(t,e,n){this.value=1/0,this.sink=e,this.disposable=t.run(this,n)}function $n(t,e,n){this.value=1/0,this.sink=e,this.disposable=t.run(this,n)}function ti(){}function ei(t,n){return t<=0?n:new e(new ni(t,n.source))}function ni(t,e){this.dt=t,this.source=e}function ii(t,e,n){this.dt=t,this.sink=e,this.scheduler=n}function ri(t){return new e(new oi(t.source))}function oi(t){this.source=t}function si(t){this.sink=t}function ui(t,n){return new e(hi(t,n.source))}function hi(t,e){return e instanceof Dt?pi(t,e):e instanceof fi?ci(t,e):new fi(t,e)}function pi(t,e){return Dt.create(e.f,hi(t,e.source))}function ci(t,e){return new fi(Math.max(t,e.period),e.source)}function fi(t,e){this.period=t,this.source=e}function ai(t,e){this.time=0,this.period=t,this.sink=e}function di(t,n){return new e(new li(t,n.source))}function li(t,e){this.dt=t,this.source=e}function yi(t,e,n,i){this.dt=t,this.sink=n,this.scheduler=i,this.value=void 0,this.timer=null,this.disposable=e.run(this,i)}function vi(t){return new e(new wi(t.source))}function wi(t){this.source=t}function ki(t,e){this.sink=t,this.scheduler=e,this.queue=Promise.resolve();var n=this;this._eventBound=function(t){n.sink.event(n.scheduler.now(),t)},this._endBound=function(t){n.sink.end(n.scheduler.now(),t)},this._errorBound=function(t){n.sink.error(n.scheduler.now(),t)}}function mi(t){this.sink=t,this.active=!0}function _i(t,n){return new e(new xi(t,n.source))}function bi(t){this.value=t}function gi(t,e,n){n.error(t,e)}function xi(t,e){this.f=t,this.source=e}function Ei(t,e,n,i){this.f=t,this.sink=new mi(n),this.scheduler=i,this.disposable=e.run(this,i)}function Ai(t,e,n){try{n.event(t,e)}catch(e){n.error(t,e)}}function Pi(t,e,n){try{n.end(t,e)}catch(e){n.error(t,e)}}function Ti(t){var e=t.source;return e instanceof Qi?t:new t.constructor(new Qi(e))}e.prototype.run=function(t,e){return this.source.run(t,e)};var Mi=function(t){return t},Ri=function(t,e){return function(n){return t(e(n))}},Ii=function(t,e){return t(e)};l.prototype.dispose=function(){return this._dispose(this._data)},y.prototype.setDisposable=function(t){if(void 0!==this.disposable)throw new Error("setDisposable called more than once");this.disposable=t,this.disposed&&this._resolve(t.dispose())},y.prototype.dispose=function(){return this.disposed?this.result:(this.disposed=!0,void 0!==this.disposable&&(this.result=this.disposable.dispose()),this.result)};var Wi=u,Li=Mi;M.event=function(t,e){return new M(I,t,e)},M.end=function(t,e){return new M(W,t,e)},M.error=function(t,e){return new M(R,t,e)},M.prototype.dispose=function(){this.active=!1},M.prototype.run=function(t){this.active&&this._run(t,this.value,this.sink)},M.prototype.error=function(t,e){if(!this.active)return T(e);this.sink.error(t,e)},C.prototype.run=function(t,e){return e.asap(new M(N,this.value,t))},q.prototype.run=function(t,e){var n=M.end(void 0,t);return e.asap(n),k(B,n)};var Ci=new e(new q);j.prototype.run=function(){return m()};var Ni=new e(new j);V.prototype.run=function(t,e){return e.asap(new M(U,this.array,t))};var Si;Si="function"==typeof Set&&"function"==typeof(new Set)["@@iterator"]?"@@iterator":"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_",G.prototype.run=function(t,e){return e.asap(new M(H,O(this.iterable),t))};var qi,Bi=function(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}(qi="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());Y.prototype.run=function(t,e){var n=this.observable.subscribe(new Z(t,e));if("function"==typeof n)return k(n);if(n&&"function"==typeof n.unsubscribe)return k($,n);throw new TypeError("Observable returned invalid subscription "+String(n))},Z.prototype.next=function(t){K(this.scheduler.now(),t,this.sink)},Z.prototype.complete=function(t){Q(this.scheduler.now(),t,this.sink)},Z.prototype.error=function(t){this.sink.error(this.scheduler.now(),t)},et.prototype.run=function(t,e){return e.periodic(this.period,M.event(this.value,t))},nt.prototype.run=function(){return this.task.run(this.time)},nt.prototype.error=function(t){return this.task.error(this.time,t)},nt.prototype.dispose=function(){return this.scheduler.cancel(this),this.task.dispose()},ot.prototype.now=function(){return this.timer.now()},ot.prototype.asap=function(t){return this.schedule(0,-1,t)},ot.prototype.delay=function(t,e){return this.schedule(t,-1,e)},ot.prototype.periodic=function(t,e){return this.schedule(0,t,e)},ot.prototype.schedule=function(t,e,n){var i=this.now(),r=new nt(i+Math.max(0,t),e,n,this);return this.timeline.add(r),this._scheduleNextRun(i),r},ot.prototype.cancel=function(t){t.active=!1,this.timeline.remove(t)&&this._reschedule()},ot.prototype.cancelAll=function(t){this.timeline.removeAll(t),this._reschedule()},ot.prototype._reschedule=function(){this.timeline.isEmpty()?this._unschedule():this._scheduleNextRun(this.now())},ot.prototype._unschedule=function(){this.timer.clearTimer(this._timer),this._timer=null},ot.prototype._scheduleNextRun=function(t){if(!this.timeline.isEmpty()){var e=this.timeline.nextArrival();null===this._timer?this._scheduleNextArrival(e,t):e<this._nextArrival&&(this._unschedule(),this._scheduleNextArrival(e,t))}},ot.prototype._scheduleNextArrival=function(t,e){this._nextArrival=t;var n=Math.max(0,t-e);this._timer=this.timer.setTimer(this._runReadyTasksBound,n)},ot.prototype._runReadyTasks=function(t){this._timer=null,this.timeline.runTasks(t,rt),this._scheduleNextRun(this.now())},st.prototype.now=Date.now,st.prototype.setTimer=function(t,e){return e<=0?ht(t):setTimeout(t,e)},st.prototype.clearTimer=function(t){return t instanceof ut?t.cancel():clearTimeout(t)},ut.prototype.run=function(){return this.active&&this.f()},ut.prototype.error=function(t){throw t},ut.prototype.cancel=function(){this.active=!1},pt.prototype.nextArrival=function(){return this.isEmpty()?1/0:this.tasks[0].time},pt.prototype.isEmpty=function(){return 0===this.tasks.length},pt.prototype.add=function(t){ft(t,this.tasks)},pt.prototype.remove=function(t){var e=dt(t.time,this.tasks);if(e>=0&&e<this.tasks.length){var n=a(t,this.tasks[e].events);if(n>=0)return this.tasks[e].events.splice(n,1),!0}return!1},pt.prototype.removeAll=function(t){for(var e=this,n=0,i=this.tasks.length;n<i;++n)at(t,e.tasks[n])},pt.prototype.runTasks=function(t,e){for(var n=this,i=this.tasks,r=i.length,o=0;o<r&&i[o].time<=t;)++o;this.tasks=i.slice(o);for(var s=0;s<o;++s)n.tasks=ct(e,i[s],n.tasks)};var ji=new ot(new st,new pt);vt.prototype.event=function(t,e){this.disposable.disposed||"function"!=typeof this.subscriber.next||this.subscriber.next(e)},vt.prototype.end=function(t,e){if(!this.disposable.disposed){var n=this.subscriber,i=this.fatalError;Promise.resolve(this.disposable.dispose()).then(function(){"function"==typeof n.complete&&n.complete(e)}).catch(function(t){kt(t,n,i)})}},vt.prototype.error=function(t,e){var n=this.subscriber,i=this.fatalError;Promise.resolve(this.disposable.dispose()).then(function(){kt(e,n,i)})},wt.prototype.unsubscribe=function(){this.disposable.dispose()},_t.prototype.run=function(t,e){function n(n){K(e.now(),n,t)}return this.source.addEventListener(this.event,n,this.capture),k(bt,{target:this,addEvent:n})},gt.prototype.event=function(t,e){this.active&&(0===this.events.length&&it(new xt(this.sink,t,this.events)),this.events.push({time:t,value:e}))},gt.prototype.end=function(t,e){this.active&&this._end(new Et(t,e,this.sink))},gt.prototype.error=function(t,e){this._end(new At(t,e,this.sink))},gt.prototype._end=function(t){this.active=!1,it(t)},xt.prototype.run=function(){for(var t,e=this,n=this.events,i=this.sink,r=0,o=n.length;r<o;++r)t=n[r],e.time=t.time,i.event(t.time,t.value);n.length=0},xt.prototype.error=function(t){this.sink.error(this.time,t)},Et.prototype.run=function(){this.sink.end(this.time,this.value)},Et.prototype.error=function(t){this.sink.error(this.time,t)},At.prototype.run=function(){this.sink.error(this.time,this.value)},At.prototype.error=function(t){throw t},Pt.prototype.run=function(t,e){function n(t){var n=arguments,r=arguments.length;if(r>1){for(var o=new Array(r),s=0;s<r;++s)o[s]=n[s];K(e.now(),o,i)}else K(e.now(),t,i)}var i=new gt(t);return this.source.addListener(this.event,n),k(Tt,{target:this,addEvent:n})},Wt.prototype.event=function(t,e){},Wt.prototype.end=function(t,e){this.active&&(this.active=!1,Lt(this._end,this._error,this._disposable,e))},Wt.prototype.error=function(t,e){this.active=!1,Lt(this._error,this._error,this._disposable,e)},Ct.prototype.event=function(t,e){return this.sink.event(t,e)},Ct.prototype.end=function(t,e){return this.sink.end(t,e)},Ct.prototype.error=function(t,e){return this.sink.error(t,e)},Nt.create=function(t,e){return e instanceof Nt?new Nt(qt(e.p,t),e.source):new Nt(t,e)},Nt.prototype.run=function(t,e){return this.source.run(new St(this.p,t),e)},St.prototype.end=Ct.prototype.end,St.prototype.error=Ct.prototype.error,St.prototype.event=function(t,e){(0,this.p)(e)&&this.sink.event(t,e)},Bt.prototype.run=function(t,e){return this.source.run(new jt(this.p,this.f,t),e)},jt.prototype.event=function(t,e){var n=this.f;(0,this.p)(e)&&this.sink.event(t,n(e))},jt.prototype.end=Ct.prototype.end,jt.prototype.error=Ct.prototype.error,Dt.create=function(t,e){return e instanceof Dt?new Dt(Ri(t,e.f),e.source):e instanceof Nt?new Bt(e.p,t,e.source):new Dt(t,e)},Dt.prototype.run=function(t,e){return this.source.run(new Vt(this.f,t),e)},Vt.prototype.end=Ct.prototype.end,Vt.prototype.error=Ct.prototype.error,Vt.prototype.event=function(t,e){var n=this.f;this.sink.event(t,n(e))},Ft.prototype.run=function(t,e){return this.source.run(new Gt(this.f,t),e)},Gt.prototype.end=Ct.prototype.end,Gt.prototype.error=Ct.prototype.error,Gt.prototype.event=function(t,e){(0,this.f)(e),this.sink.event(t,e)},Qt.prototype.run=function(t,e){return this.source.run(new Xt(this.step,this.seed,t),e)},Xt.prototype.error=Ct.prototype.error,Xt.prototype.event=function(t,e){var n=this.step(this.seed,e);this.seed=n.seed,this.sink.event(t,n.value)},Xt.prototype.end=function(t){this.sink.end(t,this.seed)},Zt.prototype.run=function(t,e){return _([e.asap(M.event(this.value,t)),this.source.run(new $t(this.f,this.value,t),e)])},$t.prototype.event=function(t,e){var n=this.f;this.value=n(this.value,e),this.sink.event(t,this.value)},$t.prototype.error=Ct.prototype.error,$t.prototype.end=Ct.prototype.end,ee.prototype.run=function(t,e){return this.source.run(new ne(this.f,this.value,t),e)},ne.prototype.event=function(t,e){var n=this.f;this.value=n(this.value,e),this.sink.event(t,this.value)},ne.prototype.error=Ct.prototype.error,ne.prototype.end=function(t){this.sink.end(t,this.value)},ie.prototype.run=function(t,e){return new re(this.f,this.value,t,e)},re.prototype.dispose=function(){this.active=!1},ue.prototype.run=function(t,e){return new he(this.f,this.value,t,e)},he.prototype.dispose=function(){this.active=!1},fe.prototype.run=function(t,e){return new ae(this.f.apply(void 0,this.args),t,e)},ae.prototype.dispose=function(){this.active=!1},ke.prototype.run=function(t,e){return new me(this.f,this.source,t,e)},me.prototype.error=Ct.prototype.error,me.prototype.event=function(t,e){this.active&&this.sink.event(t,e)},me.prototype.end=function(t,e){this.active&&(w(t,this.disposable,this.sink),this._startNext(t,e,this.sink))},me.prototype._startNext=function(t,e,n){try{this.disposable=this._continue(this.f,e,n)}catch(e){n.error(t,e)}},me.prototype._continue=function(t,e,n){return t(e).source.run(n,this.scheduler)},me.prototype.dispose=function(){return this.active=!1,this.disposable.dispose()},ge.prototype.event=function(t,e){this.active&&(this.value=e,this.sink.event(t,this))},ge.prototype.end=function(t,e){this.active&&(this.active=!1,this.sink.end(t,{index:this.index,value:e}))},ge.prototype.error=Ct.prototype.error;var Di=u,Vi=s;Me.prototype.run=function(t,e){for(var n,i=this,r=this.sources.length,o=new Array(r),s=new Array(r),u=new Re(o,s,t,this.f),h=0;h<r;++h)n=s[h]=new ge(h,u),o[h]=i.sources[h].run(n,e);return _(o)},Re.prototype.error=Ct.prototype.error,Re.prototype.event=function(t,e){var n=e.index,i=this._updateReady(n);this.values[n]=e.value,0===i&&this.sink.event(t,xe(this.f,this.values))},Re.prototype._updateReady=function(t){return this.awaiting>0&&(this.hasValue[t]||(this.hasValue[t]=!0,this.awaiting-=1)),this.awaiting},Re.prototype.end=function(t,e){w(t,this.disposables[e.index],this.sink),0==--this.activeCount&&this.sink.end(t,e.value)},Le.prototype.run=function(t,e){var n=this.transducer(new Ne(t));return this.source.run(new Ce(Se(n),t),e)},Ce.prototype.event=function(t,e){var n=this.xf.step(t,e);return this.xf.isReduced(n)?this.sink.end(t,this.xf.getResult(n)):n},Ce.prototype.end=function(t,e){return this.xf.result(e)},Ce.prototype.error=function(t,e){return this.sink.error(t,e)},Ne.prototype["@@transducer/init"]=Ne.prototype.init=function(){},Ne.prototype["@@transducer/step"]=Ne.prototype.step=function(t,e){return isNaN(t)||(this.time=Math.max(t,this.time)),this.sink.event(this.time,e)},Ne.prototype["@@transducer/result"]=Ne.prototype.result=function(t){return this.sink.end(this.time,t)},qe.prototype.step=function(t,e){return this.tx["@@transducer/step"](t,e)},qe.prototype.result=function(t){return this.tx["@@transducer/result"](t)},qe.prototype.isReduced=function(t){return null!=t&&t["@@transducer/reduced"]},qe.prototype.getResult=function(t){return t["@@transducer/value"]},Be.prototype.step=function(t,e){return this.tx.step(t,e)},Be.prototype.result=function(t){return this.tx.result(t)},Be.prototype.isReduced=function(t){return null!=t&&t.__transducers_reduced__},Be.prototype.getResult=function(t){return t.value},je.prototype.add=function(t){null!==this.head&&(this.head.prev=t,t.next=this.head),this.head=t,++this.length},je.prototype.remove=function(t){--this.length,t===this.head&&(this.head=this.head.next),null!==t.next&&(t.next.prev=t.prev,t.next=null),null!==t.prev&&(t.prev.next=t.next,t.prev=null)},je.prototype.isEmpty=function(){return 0===this.length},je.prototype.dispose=function(){if(this.isEmpty())return Promise.resolve();var t=[],e=this.head;for(this.head=null,this.length=0;null!==e;)t.push(e.dispose()),e=e.next;return Promise.all(t)},Ue.prototype.run=function(t,e){return new ze(this.f,this.concurrency,this.source,t,e)},ze.prototype.event=function(t,e){this._addInner(t,e)},ze.prototype._addInner=function(t,e){this.current.length<this.concurrency?this._startInner(t,e):this.pending.push(e)},ze.prototype._startInner=function(t,e){try{this._initInner(t,e)}catch(e){this.error(t,e)}},ze.prototype._initInner=function(t,e){var n=new Fe(t,this,this.sink);n.disposable=Oe(this.f,e,n,this.scheduler),this.current.add(n)},ze.prototype.end=function(t,e){this.active=!1,w(t,this.disposable,this.sink),this._checkEnd(t,e)},ze.prototype.error=function(t,e){this.active=!1,this.sink.error(t,e)},ze.prototype.dispose=function(){return this.active=!1,this.pending.length=0,Promise.all([this.disposable.dispose(),this.current.dispose()])},ze.prototype._endInner=function(t,e,n){this.current.remove(n),w(t,n,this),0===this.pending.length?this._checkEnd(t,e):this._startInner(t,this.pending.shift())},ze.prototype._checkEnd=function(t,e){!this.active&&this.current.isEmpty()&&this.sink.end(t,e)},Fe.prototype.event=function(t,e){this.sink.event(Math.max(t,this.time),e)},Fe.prototype.end=function(t,e){this.outer._endInner(Math.max(t,this.time),e,this)},Fe.prototype.error=function(t,e){this.outer.error(Math.max(t,this.time),e)},Fe.prototype.dispose=function(){return this.disposable.dispose()};var Ui=function(t){for(var e=t.length,n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n},zi=function(t,e,n){for(var i=e,r=0,o=n.length;r<o;++r)i=t(i,n[r],r);return i};Ye.prototype.run=function(t,e){for(var n,i=this,r=this.sources.length,o=new Array(r),s=new Array(r),u=new Ze(o,s,t),h=0;h<r;++h)n=s[h]=new ge(h,u),o[h]=i.sources[h].run(n,e);return _(o)},Ze.prototype.error=Ct.prototype.error,Ze.prototype.event=function(t,e){this.sink.event(t,e.value)},Ze.prototype.end=function(t,e){w(t,this.disposables[e.index],this.sink),0==--this.activeCount&&this.sink.end(t,e.value)},nn.prototype.run=function(t,e){for(var n,i=this,r=this.sources.length,o=new Array(r+1),s=new Array(r),u=new on(this.f,s,t),h=0;h<r;++h)n=s[h]=new rn(u),o[h]=i.sources[h].run(n,e);return o[h]=this.sampler.run(u,e),_(o)},rn.prototype.event=function(t,e){this.value=e,this.hasValue=!0,this.sink._notify(this)},rn.prototype.end=function(){},rn.prototype.error=Ct.prototype.error,on.prototype._notify=function(){this.active||(this.active=this.sinks.every(sn))},on.prototype.event=function(t){this.active&&this.sink.event(t,xe(this.f,u(un,this.sinks)))},on.prototype.end=Ct.prototype.end,on.prototype.error=Ct.prototype.error,hn.prototype.push=function(t){var e=this._length;this._checkCapacity(e+1),this[this._head+e&this._capacity-1]=t,this._length=e+1},hn.prototype.shift=function(){var t=this._head,e=this[t];return this[t]=void 0,this._head=t+1&this._capacity-1,this._length--,e},hn.prototype.isEmpty=function(){return 0===this._length},hn.prototype.length=function(){return this._length},hn.prototype._checkCapacity=function(t){this._capacity<t&&this._ensureCapacity(this._capacity<<1)},hn.prototype._ensureCapacity=function(t){var e=this._capacity;this._capacity=t;var n=this._head+this._length;n>e&&pn(this,0,this,e,n&e-1)};var Oi=u,Fi=s;an.prototype.run=function(t,e){for(var n,i=this,r=this.sources.length,o=new Array(r),s=new Array(r),u=new Array(r),h=new dn(this.f,u,s,t),p=0;p<r;++p)u[p]=new hn,n=s[p]=new ge(p,h),o[p]=i.sources[p].run(n,e);return _(o)},dn.prototype.event=function(t,e){var n=this.buffers,i=n[e.index];if(i.push(e.value),1===i.length()){if(!wn(this.buffers))return;ln(this.f,t,n,this.sink),vn(this.buffers,this.sinks)&&this.sink.end(t,void 0)}},dn.prototype.end=function(t,e){this.buffers[e.index].isEmpty()&&this.sink.end(t,e.value)},dn.prototype.error=Ct.prototype.error,mn.prototype.run=function(t,e){var n=new _n(t,e);return _([n,this.source.run(n,e)])},_n.prototype.event=function(t,e){this._disposeCurrent(t),this.current=new bn(t,1/0,this,this.sink),this.current.disposable=e.source.run(this.current,this.scheduler)},_n.prototype.end=function(t,e){this.ended=!0,this._checkEnd(t,e)},_n.prototype.error=function(t,e){this.ended=!0,this.sink.error(t,e)},_n.prototype.dispose=function(){return this._disposeCurrent(this.scheduler.now())},_n.prototype._disposeCurrent=function(t){if(null!==this.current)return this.current._dispose(t)},_n.prototype._disposeInner=function(t,e){e._dispose(t),e===this.current&&(this.current=null)},_n.prototype._checkEnd=function(t,e){this.ended&&null===this.current&&this.sink.end(t,e)},_n.prototype._endInner=function(t,e,n){this._disposeInner(t,n),this._checkEnd(t,e)},_n.prototype._errorInner=function(t,e,n){this._disposeInner(t,n),this.sink.error(t,e)},bn.prototype.event=function(t,e){t<this.max&&this.sink.event(Math.max(t,this.min),e)},bn.prototype.end=function(t,e){this.outer._endInner(Math.max(t,this.min),e,this)},bn.prototype.error=function(t,e){this.outer._errorInner(Math.max(t,this.min),e,this)},bn.prototype._dispose=function(t){this.max=t,w(t,this.disposable,this.sink)},An.prototype.run=function(t,e){return this.source.run(new Pn(this.equals,t),e)},Pn.prototype.end=Ct.prototype.end,Pn.prototype.error=Ct.prototype.error,Pn.prototype.event=function(t,e){this.init?(this.init=!1,this.value=e,this.sink.event(t,e)):this.equals(this.value,e)||(this.value=e,this.sink.event(t,e))},Nn.prototype.run=function(t,e){var n=x(),i=new Sn(this.min,this.max-this.min,t,n);return n.setDisposable(this.source.run(i,e)),n},Sn.prototype.end=Ct.prototype.end,Sn.prototype.error=Ct.prototype.error,Sn.prototype.event=function(t,e){this.skip>0?this.skip-=1:0!==this.take&&(this.take-=1,this.sink.event(t,e),0===this.take&&(this.disposable.dispose(),this.sink.end(t,e)))},Bn.prototype.run=function(t,e){var n=x(),i=new jn(this.p,t,n);return n.setDisposable(this.source.run(i,e)),n},jn.prototype.end=Ct.prototype.end,jn.prototype.error=Ct.prototype.error,jn.prototype.event=function(t,e){if(this.active){var n=this.p;this.active=n(e),this.active?this.sink.event(t,e):(this.disposable.dispose(),this.sink.end(t,e))}},Vn.prototype.run=function(t,e){return this.source.run(new Un(this.p,t),e)},Un.prototype.end=Ct.prototype.end,Un.prototype.error=Ct.prototype.error,Un.prototype.event=function(t,e){if(this.skipping){var n=this.p;if(this.skipping=n(e),this.skipping)return}this.sink.event(t,e)},On.prototype.run=function(t,e){return this.source.run(new Fn(this.p,t),e)},Fn.prototype.event=function(t,e){if(!this.skipping){var n=this.p;this.skipping=n(e),this.sink.event(t,e),this.skipping&&this.sink.end(t,e)}},Fn.prototype.end=Ct.prototype.end,Fn.prototype.error=Ct.prototype.error,Kn.prototype.run=function(t,e){var n=new Xn(-1/0,t),i=new $n(this.maxSignal,t,e);return _([n,i,this.source.run(new Yn(n,i,t),e)])},Qn.prototype.run=function(t,e){var n=new Zn(this.minSignal,t,e),i=new Xn(1/0,t);return _([n,i,this.source.run(new Yn(n,i,t),e)])},Xn.prototype.error=Ct.prototype.error,Xn.prototype.event=ti,Xn.prototype.end=ti,Xn.prototype.dispose=ti,Yn.prototype.event=function(t,e){t>=this.min.value&&t<this.max.value&&this.sink.event(t,e)},Yn.prototype.error=Ct.prototype.error,Yn.prototype.end=Ct.prototype.end,Zn.prototype.event=function(t){t<this.value&&(this.value=t)},Zn.prototype.end=ti,Zn.prototype.error=Ct.prototype.error,Zn.prototype.dispose=function(){return this.disposable.dispose()},$n.prototype.event=function(t,e){t<this.value&&(this.value=t,this.sink.end(t,e))},$n.prototype.end=ti,$n.prototype.error=Ct.prototype.error,$n.prototype.dispose=function(){return this.disposable.dispose()},ni.prototype.run=function(t,e){var n=new ii(this.dt,t,e);return _([n,this.source.run(n,e)])},ii.prototype.dispose=function(){var t=this;this.scheduler.cancelAll(function(e){return e.task.sink===t.sink})},ii.prototype.event=function(t,e){this.scheduler.delay(this.dt,M.event(e,this.sink))},ii.prototype.end=function(t,e){this.scheduler.delay(this.dt,M.end(e,this.sink))},ii.prototype.error=Ct.prototype.error,oi.prototype.run=function(t,e){return this.source.run(new si(t),e)},si.prototype.end=Ct.prototype.end,si.prototype.error=Ct.prototype.error,si.prototype.event=function(t,e){this.sink.event(t,{time:t,value:e})},fi.prototype.run=function(t,e){return this.source.run(new ai(this.period,t),e)},ai.prototype.event=function(t,e){t>=this.time&&(this.time=t+this.period,this.sink.event(t,e))},ai.prototype.end=Ct.prototype.end,ai.prototype.error=Ct.prototype.error,li.prototype.run=function(t,e){return new yi(this.dt,this.source,t,e)},yi.prototype.event=function(t,e){this._clearTimer(),this.value=e,this.timer=this.scheduler.delay(this.dt,M.event(e,this.sink))},yi.prototype.end=function(t,e){this._clearTimer()&&(this.sink.event(t,this.value),this.value=void 0),this.sink.end(t,e)},yi.prototype.error=function(t,e){this._clearTimer(),this.sink.error(t,e)},yi.prototype.dispose=function(){return this._clearTimer(),this.disposable.dispose()},yi.prototype._clearTimer=function(){return null!==this.timer&&(this.timer.dispose(),this.timer=null,!0)},wi.prototype.run=function(t,e){return this.source.run(new ki(t,e),e)},ki.prototype.event=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._event(e)}).catch(this._errorBound)},ki.prototype.end=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._end(e)}).catch(this._errorBound)},ki.prototype.error=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._errorBound(e)}).catch(T)},ki.prototype._event=function(t){return t.then(this._eventBound)},ki.prototype._end=function(t){return Promise.resolve(t).then(this._endBound)},mi.prototype.event=function(t,e){this.active&&this.sink.event(t,e)},mi.prototype.end=function(t,e){this.active&&(this.disable(),this.sink.end(t,e))},mi.prototype.error=function(t,e){this.disable(),this.sink.error(t,e)},mi.prototype.disable=function(){return this.active=!1,this.sink};var Gi=_i;bi.prototype.run=function(t,e){return e.asap(new M(gi,this.value,t))},xi.prototype.run=function(t,e){return new Ei(this.f,this.source,t,e)},Ei.prototype.event=function(t,e){K(t,e,this.sink)},Ei.prototype.end=function(t,e){Q(t,e,this.sink)},Ei.prototype.error=function(t,e){var n=this.sink.disable();w(t,this.disposable,this.sink),this._startNext(t,e,n)},Ei.prototype._startNext=function(t,e,n){try{this.disposable=this._continue(this.f,e,n)}catch(e){n.error(t,e)}},Ei.prototype._continue=function(t,e,n){return t(e).source.run(n,this.scheduler)},Ei.prototype.dispose=function(){return this.disposable.dispose()};var Hi=function(t,e){this.source=t,this.sink=e,this.disposed=!1};Hi.prototype.dispose=function(){if(!this.disposed)return this.disposed=!0,0===this.source.remove(this.sink)&&this.source._dispose()};var Ji=function(t){return t.dispose()},Ki={dispose:function(){}},Qi=function(t){this.source=t,this.sinks=[],this._disposable=Ki};Qi.prototype.run=function(t,e){return 1===this.add(t)&&(this._disposable=this.source.run(this,e)),new Hi(this,t)},Qi.prototype._dispose=function(){var t=this._disposable;return this._disposable=Ki,Promise.resolve(t).then(Ji)},Qi.prototype.add=function(t){return this.sinks=i(t,this.sinks),this.sinks.length},Qi.prototype.remove=function(t){var e=a(t,this.sinks);return e>=0&&(this.sinks=p(e,this.sinks)),this.sinks.length},Qi.prototype.event=function(t,e){var n=this.sinks;if(1===n.length)return n[0].event(t,e);for(var i=0;i<n.length;++i)Ai(t,e,n[i])},Qi.prototype.end=function(t,e){for(var n=this.sinks,i=0;i<n.length;++i)Pi(t,e,n[i])},Qi.prototype.error=function(t,e){for(var n=this.sinks,i=0;i<n.length;++i)n[i].error(t,e)},e.of=L,e.empty=S,e.from=tt,e.prototype.subscribe=function(t){return yt(t,this)},e.prototype[Bi]=function(){return this},e.prototype.thru=function(t){return mt(t,this)},e.prototype.observe=e.prototype.forEach=function(t){return Ht(t,this)},e.prototype.drain=function(){return Jt(this)},e.prototype.loop=function(t,e){return Kt(t,e,this)},e.prototype.scan=function(t,e){return Yt(t,e,this)},e.prototype.reduce=function(t,e){return te(t,e,this)},e.prototype.concat=function(t){return be(this,t)},e.prototype.startWith=function(t){return _e(t,this)},e.prototype.map=function(t){return Ut(t,this)},e.prototype.ap=function(t){return Ie(this,t)},e.prototype.constant=function(t){return zt(t,this)},e.prototype.tap=function(t){return Ot(t,this)},e.prototype.transduce=function(t){return We(t,this)},e.prototype.chain=function(t){return Ge(t,this)},e.prototype.flatMap=e.prototype.chain,e.prototype.join=function(){return He(this)},e.prototype.continueWith=function(t){return we(t,this)},e.prototype.flatMapEnd=e.prototype.continueWith,e.prototype.concatMap=function(t){return Je(t,this)},e.prototype.mergeConcurrently=function(t){return De(t,this)},e.prototype.merge=function(){return Ke(n(this,arguments))},e.prototype.combine=function(t){return Ae(t,h(this,0,arguments))},e.prototype.sampleWith=function(t){return $e(t,this)},e.prototype.sample=function(t){return tn(t,this,s(arguments))},e.prototype.zip=function(t){return cn(t,h(this,0,arguments))},e.prototype.switchLatest=function(){return kn(this)},e.prototype.switch=e.prototype.switchLatest,e.prototype.filter=function(t){return gn(t,this)},e.prototype.skipRepeats=function(){return xn(this)},e.prototype.skipRepeatsWith=function(t){return En(t,this)},e.prototype.take=function(t){return Mn(t,this)},e.prototype.skip=function(t){return Rn(t,this)},e.prototype.slice=function(t,e){return In(t,e,this)},e.prototype.takeWhile=function(t){return qn(t,this)},e.prototype.skipWhile=function(t){return Dn(t,this)},e.prototype.skipAfter=function(t){return zn(t,this)},e.prototype.until=function(t){return Gn(t,this)},e.prototype.takeUntil=e.prototype.until,e.prototype.since=function(t){return Hn(t,this)},e.prototype.skipUntil=e.prototype.since,e.prototype.during=function(t){return Jn(t,this)},e.prototype.delay=function(t){return ei(t,this)},e.prototype.timestamp=function(){return ri(this)},e.prototype.throttle=function(t){return ui(t,this)},e.prototype.debounce=function(t){return di(t,this)},e.prototype.awaitPromises=function(){return vi(this)},e.prototype.await=e.prototype.awaitPromises,e.prototype.recoverWith=function(t){return Gi(t,this)},e.prototype.flatMapError=e.prototype.recoverWith,e.prototype.multicast=function(){return Ti(this)},t.Stream=e,t.of=L,t.just=L,t.empty=S,t.never=function(){return Ni},t.from=tt,t.periodic=function(t,n){return new e(new et(t,n))},t.observe=Ht,t.forEach=Ht,t.drain=Jt,t.loop=Kt,t.scan=Yt,t.reduce=te,t.concat=be,t.startWith=_e,t.map=Ut,t.constant=zt,t.tap=Ot,t.ap=Ie,t.transduce=We,t.flatMap=Ge,t.chain=Ge,t.join=He,t.continueWith=we,t.flatMapEnd=we,t.concatMap=Je,t.mergeConcurrently=De,t.merge=function(){return Ke(Ui(arguments))},t.mergeArray=Ke,t.combine=Ee,t.combineArray=Ae,t.sample=function(t,e){return tn(t,e,r(2,arguments))},t.sampleArray=tn,t.sampleWith=$e,t.zip=function(t){return cn(t,Fi(arguments))},t.zipArray=cn,t.switchLatest=kn,t.switch=kn,t.filter=gn,t.skipRepeats=xn,t.distinct=xn,t.skipRepeatsWith=En,t.distinctBy=En,t.take=Mn,t.skip=Rn,t.slice=In,t.takeWhile=qn,t.skipWhile=Dn,t.skipAfter=zn,t.takeUntil=Gn,t.until=Gn,t.skipUntil=Hn,t.since=Hn,t.during=Jn,t.delay=ei,t.timestamp=ri,t.throttle=ui,t.debounce=di,t.fromPromise=function(t){return vi(L(t))},t.awaitPromises=vi,t.await=vi,t.recoverWith=_i,t.flatMapError=Gi,t.throwError=function(t){return new e(new bi(t))},t.multicast=Ti,t.defaultScheduler=ji,t.PropagateTask=M,t.fromEvent=function(t,n,i){var r;if("function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener)arguments.length<3&&(i=!1),r=new _t(t,n,i);else{if("function"!=typeof n.addListener||"function"!=typeof n.removeListener)throw new Error("source must support addEventListener/removeEventListener or addListener/removeListener");r=new Pt(t,n)}return new e(r)},t.unfold=function(t,n){return new e(new ie(t,n))},t.iterate=function(t,n){return new e(new ue(t,n))},t.generate=function(t){return new e(new fe(t,s(arguments)))},Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.most={})}(this,function(t){"use strict";function e(t){this.source=t}function n(t,e){if(t<0)throw new TypeError("n must be >= 0");var n=e.length;return 0===t||0===n?e:t>=n?[]:function(t,e,n){for(var i=new Array(n),r=0;r<n;++r)i[r]=e[t+r];return i}(t,e,n-t)}function i(t){return n(1,t)}function r(t,e){for(var n=e.length,i=new Array(n),r=0;r<n;++r)i[r]=t(e[r]);return i}function o(t,e,n){if(e<0)throw new TypeError("i must be >= 0");for(var i=n.length,r=new Array(i),o=0;o<i;++o)r[o]=e===o?t:n[o];return r}function s(t,e){if(t<0)throw new TypeError("i must be >= 0");var n=e.length;return 0===n||t>=n?e:1===n?[]:function(t,e,n){var i,r=new Array(n);for(i=0;i<t;++i)r[i]=e[i];for(i=t;i<n;++i)r[i]=e[i+1];return r}(t,e,n-1)}function u(t,e){for(var n=0,i=e.length;n<i;++n)if(t===e[n])return n;return-1}function h(t,e){this._dispose=t,this._data=e}function p(){this.disposable=void 0,this.disposed=!1,this._resolve=void 0;var t=this;this.result=new Promise(function(e){t._resolve=e})}function c(t,e,n){var i=l(e);return function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}(i)?i.catch(function(e){n.error(t,e)}):i}function f(t,e){return w(new h(t,e))}function a(){return new h(Qn,void 0)}function d(t){return f(y,t)}function y(t){return Promise.all(Kn(l,t))}function l(t){try{return t.dispose()}catch(t){return Promise.reject(t)}}function v(){return new p}function w(t){return new h(k,function(t){return{disposed:!1,disposable:t,value:void 0}}(t))}function k(t){return t.disposed||(t.disposed=!0,t.value=l(t.disposable),t.disposable=void 0),t.value}function m(t){setTimeout(function(){throw t},0)}function _(t,e,n){this._run=t,this.value=e,this.sink=n,this.active=!0}function b(t,e,n){n.error(t,e)}function g(t,e,n){n.event(t,e)}function x(t,e,n){n.end(t,e)}function E(t){return new e(new A(t))}function A(t){this.value=t}function T(t,e,n){n.event(t,e),n.end(t,void 0)}function P(){return Xn}function M(){}function R(t){return t.dispose()}function I(){}function W(t){this.array=t}function L(t,e,n){for(var i=0,r=e.length;i<r&&this.active;++i)n.event(t,e[i]);this.active&&n.end(t)}function C(t){this.iterable=t}function N(t,e,n){for(var i=e.next();!i.done&&this.active;)n.event(t,i.value),i=e.next();n.end(t,i.value)}function S(t,e,n){try{n.event(t,e)}catch(e){n.error(t,e)}}function q(t,e,n){try{n.end(t,e)}catch(e){n.error(t,e)}}function B(t){this.observable=t}function j(t,e){this.sink=t,this.scheduler=e}function D(t){return t.unsubscribe()}function V(t){if(t instanceof e)return t;var n=function(t){var e=null;if(t){var n=t[ti];if("function"==typeof n&&(!(e=n.call(t))||"function"!=typeof e.subscribe))throw new TypeError("invalid observable "+e)}return e}(t);if(null!=n)return function(t){return new e(new B(t))}(n);if(Array.isArray(t)||function(t){return null!=t&&"number"==typeof t.length&&"function"!=typeof t}(t))return function(t){return new e(new W(t))}(t);if(function(t){return"function"==typeof t[Zn]}(t))return function(t){return new e(new C(t))}(t);throw new TypeError("from(x) must be observable, iterable, or array-like: "+t)}function U(t,e){this.period=t,this.value=e}function z(t,e,n,i){this.time=t,this.period=e,this.task=n,this.scheduler=i,this.active=!0}function O(t){return Promise.resolve(t).then(F)}function F(t){try{return t.run()}catch(e){return t.error(e)}}function G(t,e){this.timer=t,this.timeline=e,this._timer=null,this._nextArrival=1/0;var n=this;this._runReadyTasksBound=function(){n._runReadyTasks(n.now())}}function H(){}function J(t){this.f=t,this.active=!0}function K(){this.tasks=[]}function Q(t,e){var n=e.length;if(0!==n){var i=Y(t.time,e);i>=n?e.push(Z(t.time,[t])):t.time===e[i].time?e[i].events.push(t):e.splice(i,0,Z(t.time,[t]))}else e.push(Z(t.time,[t]))}function X(t,e){e.events=function(t,e){for(var n=e.length,i=new Array(n),r=0,o=void 0,s=0;s<n;++s)t(o=e[s])||(i[r]=o,++r);return i.length=r,i}(t,e.events)}function Y(t,e){for(var n,i,r=0,o=e.length;r<o;){if(n=Math.floor((r+o)/2),i=e[n],t===i.time)return n;t<i.time?o=n:r=n+1}return o}function Z(t,e){return{time:t,events:e}}function $(t,e,n){this.fatalError=t,this.subscriber=e,this.disposable=n}function tt(t){this.disposable=t}function et(t,e,n){if("function"==typeof e.error)try{e.error(t)}catch(t){n(t)}else n(t)}function nt(t,e,n){this.event=t,this.source=e,this.capture=n}function it(t){var e=t.target;e.source.removeEventListener(e.event,t.addEvent,e.capture)}function rt(t){this.sink=t,this.events=[],this.active=!0}function ot(t,e,n){this.sink=t,this.events=n,this.time=e}function st(t,e,n){this.time=t,this.value=e,this.sink=n}function ut(t,e,n){this.time=t,this.value=e,this.sink=n}function ht(t,e){this.event=t,this.source=e}function pt(t){var e=t.target;e.source.removeListener(e.event,t.addEvent)}function ct(t){return function(t,e){return new Promise(function(n,i){!function(t,e,n,i){var r=v(),o=new ft(n,i,r);r.setDisposable(t.run(o,e))}(t,e,n,i)})}(t,ei)}function ft(t,e,n){this._end=t,this._error=e,this._disposable=n,this.active=!0}function at(t,e,n,i){Promise.resolve(n.dispose()).then(function(){t(i)},e)}function dt(t){this.sink=t}function yt(t,e){this.p=t,this.source=e}function lt(t,e){this.p=t,this.sink=e}function vt(t,e,n){this.p=t,this.f=e,this.source=n}function wt(t,e,n){this.p=t,this.f=e,this.sink=n}function kt(t,e){this.f=t,this.source=e}function mt(t,e){this.f=t,this.sink=e}function _t(t,n){return new e(kt.create(t,n.source))}function bt(t,e){return _t(function(){return t},e)}function gt(t,n){return new e(new xt(t,n.source))}function xt(t,e){this.source=e,this.f=t}function Et(t,e){this.sink=e,this.f=t}function At(t,e){return Tt(gt(t,e))}function Tt(t){return ct(t.source)}function Pt(t,n,i){return new e(new Mt(t,n,i.source))}function Mt(t,e,n){this.step=t,this.seed=e,this.source=n}function Rt(t,e,n){this.step=t,this.seed=e,this.sink=n}function It(t,n,i){return new e(new Wt(t,n,i.source))}function Wt(t,e,n){this.source=n,this.f=t,this.value=e}function Lt(t,e,n){this.f=t,this.value=e,this.sink=n}function Ct(t,e,n){return ct(new Nt(t,e,n.source))}function Nt(t,e,n){this.source=n,this.f=t,this.value=e}function St(t,e,n){this.f=t,this.value=e,this.sink=n}function qt(t,e){this.f=t,this.value=e}function Bt(t,e,n,i){this.f=t,this.sink=n,this.scheduler=i,this.active=!0;var r=this;Promise.resolve(this).then(function(t){return jt(t,e)}).catch(function(t){r.sink.error(r.scheduler.now(),t)})}function jt(t,e){var n=t.f;return Promise.resolve(n(e)).then(function(e){return function(t,e){if(e.done)return t.sink.end(t.scheduler.now(),e.value),e.value;if(t.sink.event(t.scheduler.now(),e.value),!t.active)return e.value;return jt(t,e.seed)}(t,e)})}function Dt(t,e){this.f=t,this.value=e}function Vt(t,e,n,i){this.f=t,this.sink=n,this.scheduler=i,this.active=!0;var r=e,o=this;Promise.resolve(this).then(function(t){return Ut(t,r)}).catch(function(t){o.sink.error(o.scheduler.now(),t)})}function Ut(t,e){if(t.sink.event(t.scheduler.now(),e),!t.active)return e;var n=t.f;return Promise.resolve(n(e)).then(function(e){return function(t,e){return t.active?Ut(t,e):t.value}(t,e)})}function zt(t,e){this.f=t,this.args=e}function Ot(t,e,n){this.iterator=t,this.sink=e,this.scheduler=n,this.active=!0;var i=this;Promise.resolve(this).then(Ft).catch(function(t){i.sink.error(i.scheduler.now(),t)})}function Ft(t,e){return t.active?Gt(t,t.iterator.next(e)):e}function Gt(t,e){return e.done?t.sink.end(t.scheduler.now(),e.value):Promise.resolve(e.value).then(function(e){return function(t,e){return t.sink.event(t.scheduler.now(),e),Ft(t,e)}(t,e)},function(e){return function(t,e){return Gt(t,t.iterator.throw(e))}(t,e)})}function Ht(t,n){return new e(new Jt(t,n.source))}function Jt(t,e){this.f=t,this.source=e}function Kt(t,e,n,i){this.f=t,this.sink=n,this.scheduler=i,this.active=!0,this.disposable=w(e.run(this,i))}function Qt(t,e){return Xt(E(t),e)}function Xt(t,e){return Ht(function(){return e},t)}function Yt(t,e){this.sink=e,this.index=t,this.active=!0,this.value=void 0}function Zt(t,e){switch(e.length){case 0:return t();case 1:return t(e[0]);case 2:return t(e[0],e[1]);case 3:return t(e[0],e[1],e[2]);case 4:return t(e[0],e[1],e[2],e[3]);case 5:return t(e[0],e[1],e[2],e[3],e[4]);default:return t.apply(void 0,e)}}function $t(t){return te(t,ii(arguments))}function te(t,n){var i=n.length;return 0===i?P():1===i?_t(t,n[0]):new e(function(t,e){return new ne(t,ni(ee,e))}(t,n))}function ee(t){return t.source}function ne(t,e){this.f=t,this.sources=e}function ie(t,e,n,i){this.sink=n,this.disposables=t,this.sinks=e,this.f=i;var r=e.length;this.awaiting=r,this.values=new Array(r),this.hasValue=new Array(r);for(var o=0;o<r;++o)this.hasValue[o]=!1;this.activeCount=e.length}function re(t,e){return $t(Jn,t,e)}function oe(t,n){return new e(new se(t,n.source))}function se(t,e){this.transducer=t,this.source=e}function ue(t,e){this.xf=t,this.sink=e}function he(t){this.time=-1/0,this.sink=t}function pe(t){this.tx=t}function ce(t){this.tx=t}function fe(){this.head=null,this.length=0}function ae(t,e){return de(Hn,t,e)}function de(t,n,i){return new e(new ye(t,n,i.source))}function ye(t,e,n){this.f=t,this.concurrency=e,this.source=n}function le(t,e,n,i,r){this.f=t,this.concurrency=e,this.sink=i,this.scheduler=r,this.pending=[],this.current=new fe,this.disposable=w(n.run(this,r)),this.active=!0}function ve(t,e,n){this.prev=this.next=null,this.time=t,this.outer=e,this.sink=n,this.disposable=void 0}function we(t,e){return de(t,1/0,e)}function ke(t){return ae(1/0,t)}function me(t,e){return de(t,1,e)}function _e(t){var n=t.length;return 0===n?P():1===n?t[0]:new e(function(t){return new ge(oi(be,[],t))}(t))}function be(t,e){var n=e.source;return n instanceof ge?t.concat(n.sources):t.concat(n)}function ge(t){this.sources=t}function xe(t,e,n){this.sink=n,this.disposables=t,this.activeCount=e.length}function Ee(t,n){return new e(new Pe(Hn,t.source,[n.source]))}function Ae(t,n,i){return new e(new Pe(t,n.source,r(Te,i)))}function Te(t){return t.source}function Pe(t,e,n){this.f=t,this.sampler=e,this.sources=n}function Me(t){this.sink=t,this.hasValue=!1}function Re(t,e,n){this.f=t,this.sinks=e,this.sink=n,this.active=!1}function Ie(t){return t.hasValue}function We(t){return t.value}function Le(t){this._capacity=t||32,this._length=0,this._head=0}function Ce(t,n){return 0===n.length?P():1===n.length?_t(t,n[0]):new e(new Se(t,si(Ne,n)))}function Ne(t){return t.source}function Se(t,e){this.f=t,this.sources=e}function qe(t,e,n,i){this.f=t,this.sinks=n,this.sink=i,this.buffers=e}function Be(t){return t.shift()}function je(t){return new e(new De(t.source))}function De(t){this.source=t}function Ve(t,e){this.sink=t,this.scheduler=e,this.current=null,this.ended=!1}function Ue(t,e,n,i){this.min=t,this.max=e,this.outer=n,this.sink=i,this.disposable=a()}function ze(t,n){return new e(yt.create(t,n.source))}function Oe(t){return Fe(Je,t)}function Fe(t,n){return new e(new Ge(t,n.source))}function Ge(t,e){this.equals=t,this.source=e}function He(t,e){this.equals=t,this.sink=e,this.value=void 0,this.init=!0}function Je(t,e){return t===e}function Ke(t,e){return Xe(0,t,e)}function Qe(t,e){return Xe(t,1/0,e)}function Xe(t,n,i){return n<=t?P():new e(Ye(t,n,i.source))}function Ye(t,e,n){return n instanceof kt?function(t,e,n){return kt.create(n.f,Ye(t,e,n.source))}(t,e,n):n instanceof Ze?function(t,e,n){return t+=n.min,e=Math.min(e+n.min,n.max),new Ze(t,e,n.source)}(t,e,n):new Ze(t,e,n)}function Ze(t,e,n){this.source=n,this.min=t,this.max=e}function $e(t,e,n,i){this.sink=n,this.skip=t,this.take=e,this.disposable=i}function tn(t,n){return new e(new en(t,n.source))}function en(t,e){this.p=t,this.source=e}function nn(t,e,n){this.p=t,this.sink=e,this.active=!0,this.disposable=n}function rn(t,n){return new e(new on(t,n.source))}function on(t,e){this.p=t,this.source=e}function sn(t,e){this.p=t,this.sink=e,this.skipping=!0}function un(t,n){return new e(new hn(t,n.source))}function hn(t,e){this.p=t,this.source=e}function pn(t,e){this.p=t,this.sink=e,this.skipping=!1}function cn(t,n){return new e(new dn(t.source,n.source))}function fn(t,n){return new e(new yn(t.source,n.source))}function an(t,e){return cn(ke(t),fn(t,e))}function dn(t,e){this.maxSignal=t,this.source=e}function yn(t,e){this.minSignal=t,this.source=e}function ln(t,e){this.value=t,this.sink=e}function vn(t,e,n){this.min=t,this.max=e,this.sink=n}function wn(t,e,n){this.value=1/0,this.sink=e,this.disposable=t.run(this,n)}function kn(t,e,n){this.value=1/0,this.sink=e,this.disposable=t.run(this,n)}function mn(){}function _n(t,n){return t<=0?n:new e(new bn(t,n.source))}function bn(t,e){this.dt=t,this.source=e}function gn(t,e,n){this.dt=t,this.sink=e,this.scheduler=n}function xn(t){return new e(new En(t.source))}function En(t){this.source=t}function An(t){this.sink=t}function Tn(t,n){return new e(Pn(t,n.source))}function Pn(t,e){return e instanceof kt?function(t,e){return kt.create(e.f,Pn(t,e.source))}(t,e):e instanceof Mn?function(t,e){return new Mn(Math.max(t,e.period),e.source)}(t,e):new Mn(t,e)}function Mn(t,e){this.period=t,this.source=e}function Rn(t,e){this.time=0,this.period=t,this.sink=e}function In(t,n){return new e(new Wn(t,n.source))}function Wn(t,e){this.dt=t,this.source=e}function Ln(t,e,n,i){this.dt=t,this.sink=n,this.scheduler=i,this.value=void 0,this.timer=null,this.disposable=e.run(this,i)}function Cn(t,e){this.debounce=t,this.value=e}function Nn(t){return new e(new Sn(t.source))}function Sn(t){this.source=t}function qn(t,e){this.sink=t,this.scheduler=e,this.queue=Promise.resolve();var n=this;this._eventBound=function(t){n.sink.event(n.scheduler.now(),t)},this._endBound=function(t){n.sink.end(n.scheduler.now(),t)},this._errorBound=function(t){n.sink.error(n.scheduler.now(),t)}}function Bn(t){this.sink=t,this.active=!0}function jn(t,n){return new e(new Un(t,n.source))}function Dn(t){this.value=t}function Vn(t,e,n){n.error(t,e)}function Un(t,e){this.f=t,this.source=e}function zn(t,e,n,i){this.f=t,this.sink=new Bn(n),this.scheduler=i,this.disposable=e.run(this,i)}function On(t,e,n){try{n.event(t,e)}catch(e){n.error(t,e)}}function Fn(t,e,n){try{n.end(t,e)}catch(e){n.error(t,e)}}function Gn(t){var e=t.source;return e instanceof ai?t:new t.constructor(new ai(e))}e.prototype.run=function(t,e){return this.source.run(t,e)};var Hn=function(t){return t},Jn=function(t,e){return t(e)};h.prototype.dispose=function(){return this._dispose(this._data)},p.prototype.setDisposable=function(t){if(void 0!==this.disposable)throw new Error("setDisposable called more than once");this.disposable=t,this.disposed&&this._resolve(t.dispose())},p.prototype.dispose=function(){return this.disposed?this.result:(this.disposed=!0,void 0!==this.disposable&&(this.result=this.disposable.dispose()),this.result)};var Kn=r,Qn=Hn;_.event=function(t,e){return new _(g,t,e)},_.end=function(t,e){return new _(x,t,e)},_.error=function(t,e){return new _(b,t,e)},_.prototype.dispose=function(){this.active=!1},_.prototype.run=function(t){this.active&&this._run(t,this.value,this.sink)},_.prototype.error=function(t,e){if(!this.active)return m(e);this.sink.error(t,e)},A.prototype.run=function(t,e){return e.asap(new _(T,this.value,t))},M.prototype.run=function(t,e){var n=_.end(void 0,t);return e.asap(n),f(R,n)};var Xn=new e(new M);I.prototype.run=function(){return a()};var Yn=new e(new I);W.prototype.run=function(t,e){return e.asap(new _(L,this.array,t))};var Zn;Zn="function"==typeof Set&&"function"==typeof(new Set)["@@iterator"]?"@@iterator":"function"==typeof Symbol?Symbol.iterator:"_es6shim_iterator_",C.prototype.run=function(t,e){return e.asap(new _(N,function(t){return t[Zn]()}(this.iterable),t))};var $n,ti=function(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}($n="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());B.prototype.run=function(t,e){var n=this.observable.subscribe(new j(t,e));if("function"==typeof n)return f(n);if(n&&"function"==typeof n.unsubscribe)return f(D,n);throw new TypeError("Observable returned invalid subscription "+String(n))},j.prototype.next=function(t){S(this.scheduler.now(),t,this.sink)},j.prototype.complete=function(t){q(this.scheduler.now(),t,this.sink)},j.prototype.error=function(t){this.sink.error(this.scheduler.now(),t)},U.prototype.run=function(t,e){return e.periodic(this.period,_.event(this.value,t))},z.prototype.run=function(){return this.task.run(this.time)},z.prototype.error=function(t){return this.task.error(this.time,t)},z.prototype.dispose=function(){return this.scheduler.cancel(this),this.task.dispose()},G.prototype.now=function(){return this.timer.now()},G.prototype.asap=function(t){return this.schedule(0,-1,t)},G.prototype.delay=function(t,e){return this.schedule(t,-1,e)},G.prototype.periodic=function(t,e){return this.schedule(0,t,e)},G.prototype.schedule=function(t,e,n){var i=this.now(),r=new z(i+Math.max(0,t),e,n,this);return this.timeline.add(r),this._scheduleNextRun(i),r},G.prototype.cancel=function(t){t.active=!1,this.timeline.remove(t)&&this._reschedule()},G.prototype.cancelAll=function(t){this.timeline.removeAll(t),this._reschedule()},G.prototype._reschedule=function(){this.timeline.isEmpty()?this._unschedule():this._scheduleNextRun(this.now())},G.prototype._unschedule=function(){this.timer.clearTimer(this._timer),this._timer=null},G.prototype._scheduleNextRun=function(t){if(!this.timeline.isEmpty()){var e=this.timeline.nextArrival();null===this._timer?this._scheduleNextArrival(e,t):e<this._nextArrival&&(this._unschedule(),this._scheduleNextArrival(e,t))}},G.prototype._scheduleNextArrival=function(t,e){this._nextArrival=t;var n=Math.max(0,t-e);this._timer=this.timer.setTimer(this._runReadyTasksBound,n)},G.prototype._runReadyTasks=function(t){this._timer=null,this.timeline.runTasks(t,F),this._scheduleNextRun(this.now())},H.prototype.now=Date.now,H.prototype.setTimer=function(t,e){return e<=0?function(t){var e=new J(t);return O(e),e}(t):setTimeout(t,e)},H.prototype.clearTimer=function(t){return t instanceof J?t.cancel():clearTimeout(t)},J.prototype.run=function(){return this.active&&this.f()},J.prototype.error=function(t){throw t},J.prototype.cancel=function(){this.active=!1},K.prototype.nextArrival=function(){return this.isEmpty()?1/0:this.tasks[0].time},K.prototype.isEmpty=function(){return 0===this.tasks.length},K.prototype.add=function(t){Q(t,this.tasks)},K.prototype.remove=function(t){var e=Y(t.time,this.tasks);if(e>=0&&e<this.tasks.length){var n=u(t,this.tasks[e].events);if(n>=0)return this.tasks[e].events.splice(n,1),!0}return!1},K.prototype.removeAll=function(t){for(var e=0,n=this.tasks.length;e<n;++e)X(t,this.tasks[e])},K.prototype.runTasks=function(t,e){for(var n=this.tasks,i=n.length,r=0;r<i&&n[r].time<=t;)++r;this.tasks=n.slice(r);for(var o=0;o<r;++o)this.tasks=function(t,e,n){for(var i=e.events,r=0;r<i.length;++r){var o=i[r];o.active&&(t(o),o.period>=0&&o.active&&(o.time=o.time+o.period,Q(o,n)))}return n}(e,n[o],this.tasks)};var ei=new G(new H,new K);$.prototype.event=function(t,e){this.disposable.disposed||"function"!=typeof this.subscriber.next||this.subscriber.next(e)},$.prototype.end=function(t,e){if(!this.disposable.disposed){var n=this.subscriber,i=this.fatalError;Promise.resolve(this.disposable.dispose()).then(function(){"function"==typeof n.complete&&n.complete(e)}).catch(function(t){et(t,n,i)})}},$.prototype.error=function(t,e){var n=this.subscriber,i=this.fatalError;Promise.resolve(this.disposable.dispose()).then(function(){et(e,n,i)})},tt.prototype.unsubscribe=function(){this.disposable.dispose()},nt.prototype.run=function(t,e){function n(n){S(e.now(),n,t)}return this.source.addEventListener(this.event,n,this.capture),f(it,{target:this,addEvent:n})},rt.prototype.event=function(t,e){this.active&&(0===this.events.length&&O(new ot(this.sink,t,this.events)),this.events.push({time:t,value:e}))},rt.prototype.end=function(t,e){this.active&&this._end(new st(t,e,this.sink))},rt.prototype.error=function(t,e){this._end(new ut(t,e,this.sink))},rt.prototype._end=function(t){this.active=!1,O(t)},ot.prototype.run=function(){for(var t,e=this.events,n=this.sink,i=0,r=e.length;i<r;++i)t=e[i],this.time=t.time,n.event(t.time,t.value);e.length=0},ot.prototype.error=function(t){this.sink.error(this.time,t)},st.prototype.run=function(){this.sink.end(this.time,this.value)},st.prototype.error=function(t){this.sink.error(this.time,t)},ut.prototype.run=function(){this.sink.error(this.time,this.value)},ut.prototype.error=function(t){throw t},ht.prototype.run=function(t,e){function n(t){var n=arguments,r=arguments.length;if(r>1){for(var o=new Array(r),s=0;s<r;++s)o[s]=n[s];S(e.now(),o,i)}else S(e.now(),t,i)}var i=new rt(t);return this.source.addListener(this.event,n),f(pt,{target:this,addEvent:n})},ft.prototype.event=function(t,e){},ft.prototype.end=function(t,e){this.active&&(this.active=!1,at(this._end,this._error,this._disposable,e))},ft.prototype.error=function(t,e){this.active=!1,at(this._error,this._error,this._disposable,e)},dt.prototype.event=function(t,e){return this.sink.event(t,e)},dt.prototype.end=function(t,e){return this.sink.end(t,e)},dt.prototype.error=function(t,e){return this.sink.error(t,e)},yt.create=function(t,e){return e instanceof yt?new yt(function(t,e){return function(n){return t(n)&&e(n)}}(e.p,t),e.source):new yt(t,e)},yt.prototype.run=function(t,e){return this.source.run(new lt(this.p,t),e)},lt.prototype.end=dt.prototype.end,lt.prototype.error=dt.prototype.error,lt.prototype.event=function(t,e){(0,this.p)(e)&&this.sink.event(t,e)},vt.prototype.run=function(t,e){return this.source.run(new wt(this.p,this.f,t),e)},wt.prototype.event=function(t,e){var n=this.f;(0,this.p)(e)&&this.sink.event(t,n(e))},wt.prototype.end=dt.prototype.end,wt.prototype.error=dt.prototype.error,kt.create=function(t,e){return e instanceof kt?new kt(function(t,e){return function(n){return t(e(n))}}(t,e.f),e.source):e instanceof yt?new vt(e.p,t,e.source):new kt(t,e)},kt.prototype.run=function(t,e){return this.source.run(new mt(this.f,t),e)},mt.prototype.end=dt.prototype.end,mt.prototype.error=dt.prototype.error,mt.prototype.event=function(t,e){var n=this.f;this.sink.event(t,n(e))},xt.prototype.run=function(t,e){return this.source.run(new Et(this.f,t),e)},Et.prototype.end=dt.prototype.end,Et.prototype.error=dt.prototype.error,Et.prototype.event=function(t,e){(0,this.f)(e),this.sink.event(t,e)},Mt.prototype.run=function(t,e){return this.source.run(new Rt(this.step,this.seed,t),e)},Rt.prototype.error=dt.prototype.error,Rt.prototype.event=function(t,e){var n=this.step(this.seed,e);this.seed=n.seed,this.sink.event(t,n.value)},Rt.prototype.end=function(t){this.sink.end(t,this.seed)},Wt.prototype.run=function(t,e){return d([e.asap(_.event(this.value,t)),this.source.run(new Lt(this.f,this.value,t),e)])},Lt.prototype.event=function(t,e){var n=this.f;this.value=n(this.value,e),this.sink.event(t,this.value)},Lt.prototype.error=dt.prototype.error,Lt.prototype.end=dt.prototype.end,Nt.prototype.run=function(t,e){return this.source.run(new St(this.f,this.value,t),e)},St.prototype.event=function(t,e){var n=this.f;this.value=n(this.value,e),this.sink.event(t,this.value)},St.prototype.error=dt.prototype.error,St.prototype.end=function(t){this.sink.end(t,this.value)},qt.prototype.run=function(t,e){return new Bt(this.f,this.value,t,e)},Bt.prototype.dispose=function(){this.active=!1},Dt.prototype.run=function(t,e){return new Vt(this.f,this.value,t,e)},Vt.prototype.dispose=function(){this.active=!1},zt.prototype.run=function(t,e){return new Ot(this.f.apply(void 0,this.args),t,e)},Ot.prototype.dispose=function(){this.active=!1},Jt.prototype.run=function(t,e){return new Kt(this.f,this.source,t,e)},Kt.prototype.error=dt.prototype.error,Kt.prototype.event=function(t,e){this.active&&this.sink.event(t,e)},Kt.prototype.end=function(t,e){this.active&&(c(t,this.disposable,this.sink),this._startNext(t,e,this.sink))},Kt.prototype._startNext=function(t,e,n){try{this.disposable=this._continue(this.f,e,n)}catch(e){n.error(t,e)}},Kt.prototype._continue=function(t,e,n){return t(e).source.run(n,this.scheduler)},Kt.prototype.dispose=function(){return this.active=!1,this.disposable.dispose()},Yt.prototype.event=function(t,e){this.active&&(this.value=e,this.sink.event(t,this))},Yt.prototype.end=function(t,e){this.active&&(this.active=!1,this.sink.end(t,{index:this.index,value:e}))},Yt.prototype.error=dt.prototype.error;var ni=r,ii=i;ne.prototype.run=function(t,e){for(var n,i=this.sources.length,r=new Array(i),o=new Array(i),s=new ie(r,o,t,this.f),u=0;u<i;++u)n=o[u]=new Yt(u,s),r[u]=this.sources[u].run(n,e);return d(r)},ie.prototype.error=dt.prototype.error,ie.prototype.event=function(t,e){var n=e.index,i=this._updateReady(n);this.values[n]=e.value,0===i&&this.sink.event(t,Zt(this.f,this.values))},ie.prototype._updateReady=function(t){return this.awaiting>0&&(this.hasValue[t]||(this.hasValue[t]=!0,this.awaiting-=1)),this.awaiting},ie.prototype.end=function(t,e){c(t,this.disposables[e.index],this.sink),0==--this.activeCount&&this.sink.end(t,e.value)},se.prototype.run=function(t,e){var n=this.transducer(new he(t));return this.source.run(new ue(function(t){return"function"==typeof t["@@transducer/step"]?new pe(t):new ce(t)}(n),t),e)},ue.prototype.event=function(t,e){var n=this.xf.step(t,e);return this.xf.isReduced(n)?this.sink.end(t,this.xf.getResult(n)):n},ue.prototype.end=function(t,e){return this.xf.result(e)},ue.prototype.error=function(t,e){return this.sink.error(t,e)},he.prototype["@@transducer/init"]=he.prototype.init=function(){},he.prototype["@@transducer/step"]=he.prototype.step=function(t,e){return isNaN(t)||(this.time=Math.max(t,this.time)),this.sink.event(this.time,e)},he.prototype["@@transducer/result"]=he.prototype.result=function(t){return this.sink.end(this.time,t)},pe.prototype.step=function(t,e){return this.tx["@@transducer/step"](t,e)},pe.prototype.result=function(t){return this.tx["@@transducer/result"](t)},pe.prototype.isReduced=function(t){return null!=t&&t["@@transducer/reduced"]},pe.prototype.getResult=function(t){return t["@@transducer/value"]},ce.prototype.step=function(t,e){return this.tx.step(t,e)},ce.prototype.result=function(t){return this.tx.result(t)},ce.prototype.isReduced=function(t){return null!=t&&t.__transducers_reduced__},ce.prototype.getResult=function(t){return t.value},fe.prototype.add=function(t){null!==this.head&&(this.head.prev=t,t.next=this.head),this.head=t,++this.length},fe.prototype.remove=function(t){--this.length,t===this.head&&(this.head=this.head.next),null!==t.next&&(t.next.prev=t.prev,t.next=null),null!==t.prev&&(t.prev.next=t.next,t.prev=null)},fe.prototype.isEmpty=function(){return 0===this.length},fe.prototype.dispose=function(){if(this.isEmpty())return Promise.resolve();var t=[],e=this.head;for(this.head=null,this.length=0;null!==e;)t.push(e.dispose()),e=e.next;return Promise.all(t)},ye.prototype.run=function(t,e){return new le(this.f,this.concurrency,this.source,t,e)},le.prototype.event=function(t,e){this._addInner(t,e)},le.prototype._addInner=function(t,e){this.current.length<this.concurrency?this._startInner(t,e):this.pending.push(e)},le.prototype._startInner=function(t,e){try{this._initInner(t,e)}catch(e){this.error(t,e)}},le.prototype._initInner=function(t,e){var n=new ve(t,this,this.sink);n.disposable=function(t,e,n,i){return t(e).source.run(n,i)}(this.f,e,n,this.scheduler),this.current.add(n)},le.prototype.end=function(t,e){this.active=!1,c(t,this.disposable,this.sink),this._checkEnd(t,e)},le.prototype.error=function(t,e){this.active=!1,this.sink.error(t,e)},le.prototype.dispose=function(){return this.active=!1,this.pending.length=0,Promise.all([this.disposable.dispose(),this.current.dispose()])},le.prototype._endInner=function(t,e,n){this.current.remove(n),c(t,n,this),0===this.pending.length?this._checkEnd(t,e):this._startInner(t,this.pending.shift())},le.prototype._checkEnd=function(t,e){!this.active&&this.current.isEmpty()&&this.sink.end(t,e)},ve.prototype.event=function(t,e){this.sink.event(Math.max(t,this.time),e)},ve.prototype.end=function(t,e){this.outer._endInner(Math.max(t,this.time),e,this)},ve.prototype.error=function(t,e){this.outer.error(Math.max(t,this.time),e)},ve.prototype.dispose=function(){return this.disposable.dispose()};var ri=function(t){for(var e=t.length,n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n},oi=function(t,e,n){for(var i=e,r=0,o=n.length;r<o;++r)i=t(i,n[r],r);return i};ge.prototype.run=function(t,e){for(var n,i=this.sources.length,r=new Array(i),o=new Array(i),s=new xe(r,o,t),u=0;u<i;++u)n=o[u]=new Yt(u,s),r[u]=this.sources[u].run(n,e);return d(r)},xe.prototype.error=dt.prototype.error,xe.prototype.event=function(t,e){this.sink.event(t,e.value)},xe.prototype.end=function(t,e){c(t,this.disposables[e.index],this.sink),0==--this.activeCount&&this.sink.end(t,e.value)},Pe.prototype.run=function(t,e){for(var n,i=this.sources.length,r=new Array(i+1),o=new Array(i),s=new Re(this.f,o,t),u=0;u<i;++u)n=o[u]=new Me(s),r[u]=this.sources[u].run(n,e);return r[u]=this.sampler.run(s,e),d(r)},Me.prototype.event=function(t,e){this.value=e,this.hasValue=!0,this.sink._notify(this)},Me.prototype.end=function(){},Me.prototype.error=dt.prototype.error,Re.prototype._notify=function(){this.active||(this.active=this.sinks.every(Ie))},Re.prototype.event=function(t){this.active&&this.sink.event(t,Zt(this.f,r(We,this.sinks)))},Re.prototype.end=dt.prototype.end,Re.prototype.error=dt.prototype.error,Le.prototype.push=function(t){var e=this._length;this._checkCapacity(e+1);this[this._head+e&this._capacity-1]=t,this._length=e+1},Le.prototype.shift=function(){var t=this._head,e=this[t];return this[t]=void 0,this._head=t+1&this._capacity-1,this._length--,e},Le.prototype.isEmpty=function(){return 0===this._length},Le.prototype.length=function(){return this._length},Le.prototype._checkCapacity=function(t){this._capacity<t&&this._ensureCapacity(this._capacity<<1)},Le.prototype._ensureCapacity=function(t){var e=this._capacity;this._capacity=t;var n=this._head+this._length;n>e&&function(t,e,n,i,r){for(var o=0;o<r;++o)n[o+i]=t[o+e],t[o+e]=void 0}(this,0,this,e,n&e-1)};var si=r,ui=i;Se.prototype.run=function(t,e){for(var n,i=this.sources.length,r=new Array(i),o=new Array(i),s=new Array(i),u=new qe(this.f,s,o,t),h=0;h<i;++h)s[h]=new Le,n=o[h]=new Yt(h,u),r[h]=this.sources[h].run(n,e);return d(r)},qe.prototype.event=function(t,e){var n=this.buffers,i=n[e.index];if(i.push(e.value),1===i.length()){if(!function(t){for(var e=0,n=t.length;e<n;++e)if(t[e].isEmpty())return!1;return!0}(this.buffers))return;!function(t,e,n,i){i.event(e,Zt(t,si(Be,n)))}(this.f,t,n,this.sink),function(t,e){for(var n=0,i=t.length;n<i;++n)if(t[n].isEmpty()&&!e[n].active)return!0;return!1}(this.buffers,this.sinks)&&this.sink.end(t,void 0)}},qe.prototype.end=function(t,e){this.buffers[e.index].isEmpty()&&this.sink.end(t,e.value)},qe.prototype.error=dt.prototype.error,De.prototype.run=function(t,e){var n=new Ve(t,e);return d([n,this.source.run(n,e)])},Ve.prototype.event=function(t,e){this._disposeCurrent(t),this.current=new Ue(t,1/0,this,this.sink),this.current.disposable=e.source.run(this.current,this.scheduler)},Ve.prototype.end=function(t,e){this.ended=!0,this._checkEnd(t,e)},Ve.prototype.error=function(t,e){this.ended=!0,this.sink.error(t,e)},Ve.prototype.dispose=function(){return this._disposeCurrent(this.scheduler.now())},Ve.prototype._disposeCurrent=function(t){if(null!==this.current)return this.current._dispose(t)},Ve.prototype._disposeInner=function(t,e){e._dispose(t),e===this.current&&(this.current=null)},Ve.prototype._checkEnd=function(t,e){this.ended&&null===this.current&&this.sink.end(t,e)},Ve.prototype._endInner=function(t,e,n){this._disposeInner(t,n),this._checkEnd(t,e)},Ve.prototype._errorInner=function(t,e,n){this._disposeInner(t,n),this.sink.error(t,e)},Ue.prototype.event=function(t,e){t<this.max&&this.sink.event(Math.max(t,this.min),e)},Ue.prototype.end=function(t,e){this.outer._endInner(Math.max(t,this.min),e,this)},Ue.prototype.error=function(t,e){this.outer._errorInner(Math.max(t,this.min),e,this)},Ue.prototype._dispose=function(t){this.max=t,c(t,this.disposable,this.sink)},Ge.prototype.run=function(t,e){return this.source.run(new He(this.equals,t),e)},He.prototype.end=dt.prototype.end,He.prototype.error=dt.prototype.error,He.prototype.event=function(t,e){this.init?(this.init=!1,this.value=e,this.sink.event(t,e)):this.equals(this.value,e)||(this.value=e,this.sink.event(t,e))},Ze.prototype.run=function(t,e){var n=v(),i=new $e(this.min,this.max-this.min,t,n);return n.setDisposable(this.source.run(i,e)),n},$e.prototype.end=dt.prototype.end,$e.prototype.error=dt.prototype.error,$e.prototype.event=function(t,e){this.skip>0?this.skip-=1:0!==this.take&&(this.take-=1,this.sink.event(t,e),0===this.take&&(this.disposable.dispose(),this.sink.end(t,e)))},en.prototype.run=function(t,e){var n=v(),i=new nn(this.p,t,n);return n.setDisposable(this.source.run(i,e)),n},nn.prototype.end=dt.prototype.end,nn.prototype.error=dt.prototype.error,nn.prototype.event=function(t,e){if(this.active){var n=this.p;this.active=n(e),this.active?this.sink.event(t,e):(this.disposable.dispose(),this.sink.end(t,e))}},on.prototype.run=function(t,e){return this.source.run(new sn(this.p,t),e)},sn.prototype.end=dt.prototype.end,sn.prototype.error=dt.prototype.error,sn.prototype.event=function(t,e){if(this.skipping){var n=this.p;if(this.skipping=n(e),this.skipping)return}this.sink.event(t,e)},hn.prototype.run=function(t,e){return this.source.run(new pn(this.p,t),e)},pn.prototype.event=function(t,e){if(!this.skipping){var n=this.p;this.skipping=n(e),this.sink.event(t,e),this.skipping&&this.sink.end(t,e)}},pn.prototype.end=dt.prototype.end,pn.prototype.error=dt.prototype.error,dn.prototype.run=function(t,e){var n=new ln(-1/0,t),i=new kn(this.maxSignal,t,e);return d([n,i,this.source.run(new vn(n,i,t),e)])},yn.prototype.run=function(t,e){var n=new wn(this.minSignal,t,e),i=new ln(1/0,t);return d([n,i,this.source.run(new vn(n,i,t),e)])},ln.prototype.error=dt.prototype.error,ln.prototype.event=mn,ln.prototype.end=mn,ln.prototype.dispose=mn,vn.prototype.event=function(t,e){t>=this.min.value&&t<this.max.value&&this.sink.event(t,e)},vn.prototype.error=dt.prototype.error,vn.prototype.end=dt.prototype.end,wn.prototype.event=function(t){t<this.value&&(this.value=t)},wn.prototype.end=mn,wn.prototype.error=dt.prototype.error,wn.prototype.dispose=function(){return this.disposable.dispose()},kn.prototype.event=function(t,e){t<this.value&&(this.value=t,this.sink.end(t,e))},kn.prototype.end=mn,kn.prototype.error=dt.prototype.error,kn.prototype.dispose=function(){return this.disposable.dispose()},bn.prototype.run=function(t,e){var n=new gn(this.dt,t,e);return d([n,this.source.run(n,e)])},gn.prototype.dispose=function(){var t=this;this.scheduler.cancelAll(function(e){return e.task.sink===t.sink})},gn.prototype.event=function(t,e){this.scheduler.delay(this.dt,_.event(e,this.sink))},gn.prototype.end=function(t,e){this.scheduler.delay(this.dt,_.end(e,this.sink))},gn.prototype.error=dt.prototype.error,En.prototype.run=function(t,e){return this.source.run(new An(t),e)},An.prototype.end=dt.prototype.end,An.prototype.error=dt.prototype.error,An.prototype.event=function(t,e){this.sink.event(t,{time:t,value:e})},Mn.prototype.run=function(t,e){return this.source.run(new Rn(this.period,t),e)},Rn.prototype.event=function(t,e){t>=this.time&&(this.time=t+this.period,this.sink.event(t,e))},Rn.prototype.end=dt.prototype.end,Rn.prototype.error=dt.prototype.error,Wn.prototype.run=function(t,e){return new Ln(this.dt,this.source,t,e)},Ln.prototype.event=function(t,e){this._clearTimer(),this.value=e,this.timer=this.scheduler.delay(this.dt,new Cn(this,e))},Ln.prototype._event=function(t,e){this._clearTimer(),this.sink.event(t,e)},Ln.prototype.end=function(t,e){this._clearTimer()&&(this.sink.event(t,this.value),this.value=void 0),this.sink.end(t,e)},Ln.prototype.error=function(t,e){this._clearTimer(),this.sink.error(t,e)},Ln.prototype.dispose=function(){return this._clearTimer(),this.disposable.dispose()},Ln.prototype._clearTimer=function(){return null!==this.timer&&(this.timer.dispose(),this.timer=null,!0)},Cn.prototype.run=function(t){this.debounce._event(t,this.value)},Cn.prototype.error=function(t,e){this.debounce.error(t,e)},Cn.prototype.dispose=function(){},Sn.prototype.run=function(t,e){return this.source.run(new qn(t,e),e)},qn.prototype.event=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._event(e)}).catch(this._errorBound)},qn.prototype.end=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._end(e)}).catch(this._errorBound)},qn.prototype.error=function(t,e){var n=this;this.queue=this.queue.then(function(){return n._errorBound(e)}).catch(m)},qn.prototype._event=function(t){return t.then(this._eventBound)},qn.prototype._end=function(t){return Promise.resolve(t).then(this._endBound)},Bn.prototype.event=function(t,e){this.active&&this.sink.event(t,e)},Bn.prototype.end=function(t,e){this.active&&(this.disable(),this.sink.end(t,e))},Bn.prototype.error=function(t,e){this.disable(),this.sink.error(t,e)},Bn.prototype.disable=function(){return this.active=!1,this.sink};var hi=jn;Dn.prototype.run=function(t,e){return e.asap(new _(Vn,this.value,t))},Un.prototype.run=function(t,e){return new zn(this.f,this.source,t,e)},zn.prototype.event=function(t,e){S(t,e,this.sink)},zn.prototype.end=function(t,e){q(t,e,this.sink)},zn.prototype.error=function(t,e){var n=this.sink.disable();c(t,this.disposable,this.sink),this._startNext(t,e,n)},zn.prototype._startNext=function(t,e,n){try{this.disposable=this._continue(this.f,e,n)}catch(e){n.error(t,e)}},zn.prototype._continue=function(t,e,n){return t(e).source.run(n,this.scheduler)},zn.prototype.dispose=function(){return this.disposable.dispose()};var pi=function(t,e){this.source=t,this.sink=e,this.disposed=!1};pi.prototype.dispose=function(){if(!this.disposed){this.disposed=!0;return 0===this.source.remove(this.sink)&&this.source._dispose()}};var ci=function(t){return t.dispose()},fi={dispose:function(){}},ai=function(t){this.source=t,this.sinks=[],this._disposable=fi};ai.prototype.run=function(t,e){return 1===this.add(t)&&(this._disposable=this.source.run(this,e)),new pi(this,t)},ai.prototype._dispose=function(){var t=this._disposable;return this._disposable=fi,Promise.resolve(t).then(ci)},ai.prototype.add=function(t){return this.sinks=function(t,e){for(var n=e.length,i=new Array(n+1),r=0;r<n;++r)i[r]=e[r];return i[n]=t,i}(t,this.sinks),this.sinks.length},ai.prototype.remove=function(t){var e=u(t,this.sinks);return e>=0&&(this.sinks=s(e,this.sinks)),this.sinks.length},ai.prototype.event=function(t,e){var n=this.sinks;if(1===n.length)return n[0].event(t,e);for(var i=0;i<n.length;++i)On(t,e,n[i])},ai.prototype.end=function(t,e){for(var n=this.sinks,i=0;i<n.length;++i)Fn(t,e,n[i])},ai.prototype.error=function(t,e){for(var n=this.sinks,i=0;i<n.length;++i)n[i].error(t,e)},e.of=E,e.empty=P,e.from=V,e.prototype.subscribe=function(t){return function(t,e){if(Object(t)!==t)throw new TypeError("subscriber must be an object");var n=v(),i=new $(m,t,n);return n.setDisposable(e.source.run(i,ei)),new tt(n)}(t,this)},e.prototype[ti]=function(){return this},e.prototype.thru=function(t){return function(t,e){return t(e)}(t,this)},e.prototype.observe=e.prototype.forEach=function(t){return At(t,this)},e.prototype.drain=function(){return Tt(this)},e.prototype.loop=function(t,e){return Pt(t,e,this)},e.prototype.scan=function(t,e){return It(t,e,this)},e.prototype.reduce=function(t,e){return Ct(t,e,this)},e.prototype.concat=function(t){return Xt(this,t)},e.prototype.startWith=function(t){return Qt(t,this)},e.prototype.map=function(t){return _t(t,this)},e.prototype.ap=function(t){return re(this,t)},e.prototype.constant=function(t){return bt(t,this)},e.prototype.tap=function(t){return gt(t,this)},e.prototype.transduce=function(t){return oe(t,this)},e.prototype.chain=function(t){return we(t,this)},e.prototype.flatMap=e.prototype.chain,e.prototype.join=function(){return ke(this)},e.prototype.continueWith=function(t){return Ht(t,this)},e.prototype.flatMapEnd=e.prototype.continueWith,e.prototype.concatMap=function(t){return me(t,this)},e.prototype.mergeConcurrently=function(t){return ae(t,this)},e.prototype.merge=function(){return _e(function(t,e){var n=e.length,i=new Array(n+1);i[0]=t;for(var r=0;r<n;++r)i[r+1]=e[r];return i}(this,arguments))},e.prototype.combine=function(t){return te(t,o(this,0,arguments))},e.prototype.sampleWith=function(t){return Ee(t,this)},e.prototype.sample=function(t){return Ae(t,this,i(arguments))},e.prototype.zip=function(t){return Ce(t,o(this,0,arguments))},e.prototype.switchLatest=function(){return je(this)},e.prototype.switch=e.prototype.switchLatest,e.prototype.filter=function(t){return ze(t,this)},e.prototype.skipRepeats=function(){return Oe(this)},e.prototype.skipRepeatsWith=function(t){return Fe(t,this)},e.prototype.take=function(t){return Ke(t,this)},e.prototype.skip=function(t){return Qe(t,this)},e.prototype.slice=function(t,e){return Xe(t,e,this)},e.prototype.takeWhile=function(t){return tn(t,this)},e.prototype.skipWhile=function(t){return rn(t,this)},e.prototype.skipAfter=function(t){return un(t,this)},e.prototype.until=function(t){return cn(t,this)},e.prototype.takeUntil=e.prototype.until,e.prototype.since=function(t){return fn(t,this)},e.prototype.skipUntil=e.prototype.since,e.prototype.during=function(t){return an(t,this)},e.prototype.delay=function(t){return _n(t,this)},e.prototype.timestamp=function(){return xn(this)},e.prototype.throttle=function(t){return Tn(t,this)},e.prototype.debounce=function(t){return In(t,this)},e.prototype.awaitPromises=function(){return Nn(this)},e.prototype.await=e.prototype.awaitPromises,e.prototype.recoverWith=function(t){return hi(t,this)},e.prototype.flatMapError=e.prototype.recoverWith,e.prototype.multicast=function(){return Gn(this)},t.Stream=e,t.of=E,t.just=E,t.empty=P,t.never=function(){return Yn},t.from=V,t.periodic=function(t,n){return new e(new U(t,n))},t.observe=At,t.forEach=At,t.drain=Tt,t.loop=Pt,t.scan=It,t.reduce=Ct,t.concat=Xt,t.startWith=Qt,t.map=_t,t.constant=bt,t.tap=gt,t.ap=re,t.transduce=oe,t.flatMap=we,t.chain=we,t.join=ke,t.continueWith=Ht,t.flatMapEnd=Ht,t.concatMap=me,t.mergeConcurrently=ae,t.merge=function(){return _e(ri(arguments))},t.mergeArray=_e,t.combine=$t,t.combineArray=te,t.sample=function(t,e){return Ae(t,e,n(2,arguments))},t.sampleArray=Ae,t.sampleWith=Ee,t.zip=function(t){return Ce(t,ui(arguments))},t.zipArray=Ce,t.switchLatest=je,t.switch=je,t.filter=ze,t.skipRepeats=Oe,t.distinct=Oe,t.skipRepeatsWith=Fe,t.distinctBy=Fe,t.take=Ke,t.skip=Qe,t.slice=Xe,t.takeWhile=tn,t.skipWhile=rn,t.skipAfter=un,t.takeUntil=cn,t.until=cn,t.skipUntil=fn,t.since=fn,t.during=an,t.delay=_n,t.timestamp=xn,t.throttle=Tn,t.debounce=In,t.fromPromise=function(t){return Nn(E(t))},t.awaitPromises=Nn,t.await=Nn,t.recoverWith=jn,t.flatMapError=hi,t.throwError=function(t){return new e(new Dn(t))},t.multicast=Gn,t.defaultScheduler=ei,t.PropagateTask=_,t.fromEvent=function(t,n,i){var r;if("function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener)arguments.length<3&&(i=!1),r=new nt(t,n,i);else{if("function"!=typeof n.addListener||"function"!=typeof n.removeListener)throw new Error("source must support addEventListener/removeEventListener or addListener/removeListener");r=new ht(t,n)}return new e(r)},t.unfold=function(t,n){return new e(new qt(t,n))},t.iterate=function(t,n){return new e(new Dt(t,n))},t.generate=function(t){return new e(new zt(t,i(arguments)))},Object.defineProperty(t,"__esModule",{value:!0})});

@@ -17,6 +17,2 @@ 'use strict';

var _PropagateTask = require('../scheduler/PropagateTask');
var _PropagateTask2 = _interopRequireDefault(_PropagateTask);
var _Map = require('../fusion/Map');

@@ -34,10 +30,8 @@

*/
/** @license MIT License (c) copyright 2010-2016 original author or authors */
function throttle(period, stream) {
return new _Stream2.default(throttleSource(period, stream.source));
} /** @license MIT License (c) copyright 2010-2016 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
function throttle(period, stream) {
return new _Stream2.default(throttleSource(period, stream.source));
}
function throttleSource(period, source) {

@@ -113,5 +107,10 @@ return source instanceof _Map2.default ? commuteMapThrottle(period, source) : source instanceof Throttle ? fuseThrottle(period, source) : new Throttle(period, source);

this.value = x;
this.timer = this.scheduler.delay(this.dt, _PropagateTask2.default.event(x, this.sink));
this.timer = this.scheduler.delay(this.dt, new DebounceTask(this, x));
};
DebounceSink.prototype._event = function (t, x) {
this._clearTimer();
this.sink.event(t, x);
};
DebounceSink.prototype.end = function (t, x) {

@@ -142,2 +141,17 @@ if (this._clearTimer()) {

return true;
};
};
function DebounceTask(debounce, value) {
this.debounce = debounce;
this.value = value;
}
DebounceTask.prototype.run = function (t) {
this.debounce._event(t, this.value);
};
DebounceTask.prototype.error = function (t, e) {
this.debounce.error(t, e);
};
DebounceTask.prototype.dispose = function () {};

@@ -47,3 +47,3 @@ 'use strict';

*/
function merge() /* ...streams*/{
function merge() /* ...streams */{
return mergeArray(copy(arguments));

@@ -50,0 +50,0 @@ }

@@ -138,2 +138,4 @@ 'use strict';

/* eslint import/first: 0 */
exports.Stream = _Stream2.default;

@@ -446,3 +448,3 @@

_Stream2.default.prototype.merge = function () /* ...streams*/{
_Stream2.default.prototype.merge = function () /* ...streams */{
return (0, _merge.mergeArray)(base.cons(this, arguments));

@@ -464,3 +466,3 @@ };

_Stream2.default.prototype.combine = function (f /*, ...streams*/) {
_Stream2.default.prototype.combine = function (f /*, ...streams */) {
return (0, _combine.combineArray)(f, base.replace(this, 0, arguments));

@@ -511,3 +513,3 @@ };

_Stream2.default.prototype.zip = function (f /*, ...streams*/) {
_Stream2.default.prototype.zip = function (f /*, ...streams */) {
return (0, _zip.zipArray)(f, base.replace(this, 0, arguments));

@@ -514,0 +516,0 @@ };

@@ -12,3 +12,3 @@ "use strict";

function invoke(f, args) {
/*eslint complexity: [2,7]*/
/* eslint complexity: [2,7] */
switch (args.length) {

@@ -15,0 +15,0 @@ case 0:

@@ -13,3 +13,3 @@ 'use strict';

/*global Set, Symbol*/
/* global Set, Symbol */
var iteratorSymbol;

@@ -21,3 +21,3 @@ // Firefox ships a partial implementation using the name @@iterator.

} else {
iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator || '_es6shim_iterator_';
iteratorSymbol = typeof Symbol === 'function' ? Symbol.iterator : '_es6shim_iterator_';
}

@@ -24,0 +24,0 @@

@@ -10,3 +10,3 @@ 'use strict';

/*global setTimeout, clearTimeout*/
/* global setTimeout, clearTimeout */

@@ -13,0 +13,0 @@ function ClockTimer() {} /** @license MIT License (c) copyright 2010-2016 original author or authors */

{
"name": "most",
"version": "1.7.2",
"version": "1.7.3",
"description": "Monadic streams",

@@ -17,5 +17,6 @@ "typings": "type-definitions/most.d.ts",

"test:unit": "buster-test",
"test": "eslint test/flow src test && flow check && npm run test:unit && npm run doctest",
"test": "npm run lint && flow check && npm run test:unit && npm run doctest",
"lint": "standard --fix --verbose 'src/**/*.js' 'test/**/*.js' | snazzy",
"build": "npm run build:dist && npm run build:min && npm run build:flow",
"build:dist": "rimraf lib dist && buba src -o lib && rollup -c",
"build:dist": "buba src -o lib && rollup -c",
"build:min": "uglifyjs dist/most.js -c \"warnings=false\" -m > dist/most.min.js",

@@ -51,4 +52,4 @@ "build:flow": "cpy src/index.js.flow lib",

"devDependencies": {
"@most/eslint-config-most": "^1.0.3",
"@most/hold": "^2.0.0",
"babel-eslint": "^8.0.2",
"babel-polyfill": "^6.20.0",

@@ -58,9 +59,10 @@ "buba": "^4.0.1",

"cpy-cli": "^1.0.1",
"eslint": "^3.12.1",
"flow-bin": "^0.54.1",
"eslint-plugin-flowtype": "^2.39.1",
"flow-bin": "^0.59.0",
"markdown-doctest": "^0.9.1",
"rimraf": "^2.5.4",
"rollup": "^0.45.2",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-buble": "^0.18.0",
"rollup-plugin-node-resolve": "^3.0.0",
"snazzy": "^7.0.0",
"standard": "^10.0.3",
"transducers-js": "^0.4.174",

@@ -73,3 +75,12 @@ "uglify-js": "^3.0.11"

"symbol-observable": "^1.0.2"
},
"standard": {
"parser": "babel-eslint",
"plugins": [
"flowtype"
],
"ignore": [
"test/perf/"
]
}
}

@@ -7,3 +7,2 @@ /** @license MIT License (c) copyright 2010-2016 original author or authors */

import Pipe from '../sink/Pipe'
import PropagateTask from '../scheduler/PropagateTask'
import Map from '../fusion/Map'

@@ -93,5 +92,10 @@

this.value = x
this.timer = this.scheduler.delay(this.dt, PropagateTask.event(x, this.sink))
this.timer = this.scheduler.delay(this.dt, new DebounceTask(this, x))
}
DebounceSink.prototype._event = function (t, x) {
this._clearTimer()
this.sink.event(t, x)
}
DebounceSink.prototype.end = function (t, x) {

@@ -123,1 +127,16 @@ if (this._clearTimer()) {

}
function DebounceTask (debounce, value) {
this.debounce = debounce
this.value = value
}
DebounceTask.prototype.run = function (t) {
this.debounce._event(t, this.value)
}
DebounceTask.prototype.error = function (t, e) {
this.debounce.error(t, e)
}
DebounceTask.prototype.dispose = function () {}

@@ -20,3 +20,3 @@ /** @license MIT License (c) copyright 2010-2016 original author or authors */

*/
export function merge (/* ...streams*/) {
export function merge (/* ...streams */) {
return mergeArray(copy(arguments))

@@ -23,0 +23,0 @@ }

@@ -45,3 +45,3 @@ /** @license MIT License (c) copyright 2010-2016 original author or authors */

// Pre-create closures, to avoid creating them per event
// Pre-create closures, to avoid creating them per event
this._eventBound = function (x) {

@@ -48,0 +48,0 @@ self.sink.event(self.scheduler.now(), x)

@@ -5,2 +5,4 @@ /** @license MIT License (c) copyright 2010-2016 original author or authors */

/* eslint import/first: 0 */
import Stream from './Stream'

@@ -326,3 +328,3 @@ import * as base from '@most/prelude'

*/
Stream.prototype.merge = function (/* ...streams*/) {
Stream.prototype.merge = function (/* ...streams */) {
return mergeArray(base.cons(this, arguments))

@@ -344,3 +346,3 @@ }

*/
Stream.prototype.combine = function (f /*, ...streams*/) {
Stream.prototype.combine = function (f /*, ...streams */) {
return combineArray(f, base.replace(this, 0, arguments))

@@ -390,3 +392,3 @@ }

*/
Stream.prototype.zip = function (f /*, ...streams*/) {
Stream.prototype.zip = function (f /*, ...streams */) {
return zipArray(f, base.replace(this, 0, arguments))

@@ -393,0 +395,0 @@ }

@@ -6,3 +6,3 @@ /** @license MIT License (c) copyright 2010-2016 original author or authors */

export default function invoke (f, args) {
/*eslint complexity: [2,7]*/
/* eslint complexity: [2,7] */
switch (args.length) {

@@ -9,0 +9,0 @@ case 0: return f()

@@ -5,3 +5,3 @@ /** @license MIT License (c) copyright 2010-2016 original author or authors */

/*global Set, Symbol*/
/* global Set, Symbol */
var iteratorSymbol

@@ -13,4 +13,4 @@ // Firefox ships a partial implementation using the name @@iterator.

} else {
iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator ||
'_es6shim_iterator_'
iteratorSymbol = typeof Symbol === 'function' ? Symbol.iterator
: '_es6shim_iterator_'
}

@@ -17,0 +17,0 @@

@@ -7,3 +7,3 @@ /** @license MIT License (c) copyright 2010-2016 original author or authors */

/*global setTimeout, clearTimeout*/
/* global setTimeout, clearTimeout */

@@ -10,0 +10,0 @@ export default function ClockTimer () {}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc