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