rxjs
Version:
Reactive Extensions for modern JavaScript
102 lines • 141 kB
JavaScript
/**
@license
Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt
**/
(function(t,k){"object"===typeof exports&&"undefined"!==typeof module?k(exports):"function"===typeof define&&define.amd?define(["exports"],k):k(t.Rx=t.Rx||{})})(this,function(t){function k(b,a){function c(){this.constructor=b}ob(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function N(b){return"function"===typeof b}function pb(){try{return la.apply(this,arguments)}catch(b){return m.e=b,m}}function r(b){la=b;return pb}function ma(b){return b.reduce(function(a,c){return a.concat(c instanceof
O?c.errors:c)},[])}function na(b){var a=b.subject;a.next(b.value);a.complete()}function qb(b){b.subject.error(b.err)}function rb(b){var a=this,c=b.source,e=b.subscriber;b=b.context;var d=c.callbackFunc,f=c.args,h=c.scheduler,g=c.subject;if(!g){var g=c.subject=new L,k=function sb(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=sb.source,b=e.selector,e=e.subject,d=c.shift();d?a.add(h.schedule(da,0,{err:d,subject:e})):b?(c=r(b).apply(this,c),c===m?a.add(h.schedule(da,0,{err:m.e,subject:e})):
a.add(h.schedule(oa,0,{value:c,subject:e}))):a.add(h.schedule(oa,0,{value:1>=c.length?c[0]:c,subject:e}))};k.source=c;r(d).apply(b,f.concat(k))===m&&a.add(h.schedule(da,0,{err:m.e,subject:g}))}a.add(g.subscribe(e))}function oa(b){var a=b.subject;a.next(b.value);a.complete()}function da(b){b.subject.error(b.err)}function z(b){return b&&"function"===typeof b.schedule}function pa(b){return b&&"function"!==typeof b.subscribe&&"function"===typeof b.then}function p(b,a,c,e){var d=new qa(b,c,e);if(d.closed)return null;
if(a instanceof g)if(a._isScalar)d.next(a.value),d.complete();else return a.subscribe(d);else if(a&&"number"===typeof a.length){b=0;for(c=a.length;b<c&&!d.closed;b++)d.next(a[b]);d.closed||d.complete()}else{if(pa(a))return a.then(function(c){d.closed||(d.next(c),d.complete())},function(c){return d.error(c)}).then(null,function(c){n.setTimeout(function(){throw c;})}),d;if(a&&"function"===typeof a[A]){a=a[A]();do{b=a.next();if(b.done){d.complete();break}d.next(b.value);if(d.closed)break}while(1)}else if(a&&
"function"===typeof a[I])if(a=a[I](),"function"!==typeof a.subscribe)d.error(new TypeError("Provided object does not correctly implement Symbol.observable"));else return a.subscribe(new qa(b,c,e));else d.error(new TypeError("You provided "+(null!=a&&"object"===typeof a?"an invalid object":"'"+a+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable."))}return null}function P(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=null;z(b[b.length-1])&&
(a=b.pop());return null===a&&1===b.length&&b[0]instanceof g?b[0]:(new E(b,a)).lift(new W(1))}function ra(b){var a=b.value;b=b.subscriber;b.closed||(b.next(a),b.complete())}function ub(b){var a=b.err;b=b.subscriber;b.closed||b.error(a)}function Q(b){return!D(b)&&0<=b-parseFloat(b)+1}function sa(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var a=Number.POSITIVE_INFINITY,c=null,e=b[b.length-1];z(e)?(c=b.pop(),1<b.length&&"number"===typeof b[b.length-1]&&(a=b.pop())):"number"===typeof e&&
(a=b.pop());return null===c&&1===b.length&&b[0]instanceof g?b[0]:(new E(b,c)).lift(new W(a))}function ta(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];if(1===b.length)if(D(b[0]))b=b[0];else return b[0];return(new E(b)).lift(new vb)}function wb(b){var a=b.obj,c=b.keys,e=b.index,d=b.subscriber;e===b.length?d.complete():(c=c[e],d.next([c,a[c]]),b.index=e+1,this.schedule(b))}function X(b){return b instanceof Date&&!isNaN(+b)}function ua(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=
arguments[a];a=b[b.length-1];"function"===typeof a&&b.pop();return(new E(b)).lift(new va(a))}function wa(b,a){if("function"!==typeof b)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new xa(b,a))}function xb(b,a){void 0===a&&(a=null);return new J({method:"GET",url:b,headers:a})}function yb(b,a,c){return new J({method:"POST",url:b,body:a,headers:c})}function zb(b,a){return new J({method:"DELETE",url:b,headers:a})}function Ab(b,a,c){return new J({method:"PUT",
url:b,body:a,headers:c})}function Bb(b,a,c){return new J({method:"PATCH",url:b,body:a,headers:c})}function Cb(b,a){return(new J({method:"GET",url:b,responseType:"json",headers:a})).lift(new xa(function(c,a){return c.response},null))}function Db(b){for(var a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];for(var c=a.length,e=0;e<c;e++){var d=a[e],f;for(f in d)d.hasOwnProperty(f)&&(b[f]=d[f])}return b}function ya(b){var a=b.subscriber,c=b.context;c&&a.closeContext(c);a.closed||(b.context=a.openContext(),
b.context.closeAction=this.schedule(b,b.bufferTimeSpan))}function Eb(b){var a=b.bufferCreationInterval,c=b.bufferTimeSpan,e=b.subscriber,d=b.scheduler,f=e.openContext();e.closed||(e.add(f.closeAction=d.schedule(za,c,{subscriber:e,context:f})),this.schedule(b,a))}function za(b){b.subscriber.closeContext(b.context)}function Aa(b){b=new Fb(b);var a=this.lift(b);return b.caught=a}function Ba(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);"number"===typeof a&&(c=a,a=null);return this.lift(new Ca(b,a,
c))}function Da(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);"number"===typeof a&&(c=a,a=null);return this.lift(new Ea(b,a,c))}function Gb(b){b.debouncedNext()}function Hb(){return function(){function b(){this._values=[]}b.prototype.add=function(a){this.has(a)||this._values.push(a)};b.prototype.has=function(a){return-1!==this._values.indexOf(a)};Object.defineProperty(b.prototype,"size",{get:function(){return this._values.length},enumerable:!0,configurable:!0});b.prototype.clear=function(){this._values.length=
0};return b}()}function Fa(b,a){return this.lift(new Ib(b,a))}function Ga(b,a,c){return this.lift(new Jb(b,a,c))}function ea(b,a){return this.lift(new Kb(b,a))}function Ha(b){return this.lift(new Lb(b))}function Mb(b){b.clearThrottle()}function Ia(b){return b(this)}function G(b,a){var c;c="function"===typeof b?b:function(){return b};if("function"===typeof a)return this.lift(new Nb(c,a));a=Object.create(this,Ob);a.source=this;a.subjectFactory=c;return a}function Pb(b,a){function c(){return!c.pred.apply(c.thisArg,
arguments)}c.pred=b;c.thisArg=a;return c}function Qb(b,a){return function(c){var e=c;for(c=0;c<a;c++)if(e=e[b[c]],"undefined"===typeof e)return;return e}}function Rb(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function Sb(){return new v}function Ja(){return this.lift(new Tb)}function Ub(b){b.subscriber.clearThrottle()}function Vb(b){var a=b.subscriber,c=b.windowTimeSpan,e=b.window;e&&a.closeWindow(e);b.window=a.openWindow();this.schedule(b,c)}function Wb(b){var a=b.windowTimeSpan,
c=b.subscriber,e=b.scheduler,d=b.windowCreationInterval,f=c.openWindow(),h={action:this,subscription:null};h.subscription=e.schedule(Ka,a,{subscriber:c,window:f,context:h});this.add(h.subscription);this.schedule(b,d)}function Ka(b){var a=b.subscriber,c=b.window;(b=b.context)&&b.action&&b.subscription&&b.action.remove(b.subscription);a.closeWindow(c)}function La(b,a){for(var c=0,e=a.length;c<e;c++)for(var d=a[c],f=Object.getOwnPropertyNames(d.prototype),h=0,g=f.length;h<g;h++){var k=f[h];b.prototype[k]=
d.prototype[k]}}var ob=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},Xb="undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Yb="undefined"!==typeof global&&global,n="undefined"!==typeof window&&window||Yb||Xb;if(!n)throw Error("RxJS could not find any global context (window, self, global)");var D=Array.isArray||function(b){return b&&"number"===
typeof b.length},m={e:{}},la,O=function(b){function a(c){b.call(this);this.errors=c;c=Error.call(this,c?c.length+" errors occurred during unsubscription:\n "+c.map(function(c,a){return a+1+") "+c.toString()}).join("\n "):"");this.name=c.name="UnsubscriptionError";this.stack=c.stack;this.message=c.message}k(a,b);return a}(Error),u=function(){function b(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}b.prototype.unsubscribe=function(){var a=!1,c;if(!this.closed){var b=
this._parent,d=this._parents,f=this._unsubscribe,h=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var g=-1,k=d?d.length:0;b;)b.remove(this),b=++g<k&&d[g]||null;N(f)&&(b=r(f).call(this),b===m&&(a=!0,c=c||(m.e instanceof O?ma(m.e.errors):[m.e])));if(D(h))for(g=-1,k=h.length;++g<k;)b=h[g],null!=b&&"object"===typeof b&&(b=r(b.unsubscribe).call(b),b===m&&(a=!0,c=c||[],b=m.e,b instanceof O?c=c.concat(ma(b.errors)):c.push(b)));if(a)throw new O(c);}};b.prototype.add=
function(a){if(!a||a===b.EMPTY)return b.EMPTY;if(a===this)return this;var c=a;switch(typeof a){case "function":c=new b(a);case "object":if(c.closed||"function"!==typeof c.unsubscribe)return c;if(this.closed)return c.unsubscribe(),c;"function"!==typeof c._addParent&&(a=c,c=new b,c._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}(this._subscriptions||(this._subscriptions=[])).push(c);c._addParent(this);return c};b.prototype.remove=function(a){var c=
this._subscriptions;c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))};b.prototype._addParent=function(a){var c=this._parent,b=this._parents;c&&c!==a?b?-1===b.indexOf(a)&&b.push(a):this._parents=[a]:this._parent=a};b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),Y={closed:!0,next:function(b){},error:function(b){throw b;},complete:function(){}},fa=n.Symbol,R="function"===typeof fa&&"function"===typeof fa.for?fa.for("rxSubscriber"):"@@rxSubscriber",l=function(b){function a(c,e,d){b.call(this);
this.syncErrorValue=null;this.isStopped=this.syncErrorThrowable=this.syncErrorThrown=!1;switch(arguments.length){case 0:this.destination=Y;break;case 1:if(!c){this.destination=Y;break}if("object"===typeof c){c instanceof a?(this.destination=c,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new Ma(this,c));break}default:this.syncErrorThrowable=!0,this.destination=new Ma(this,c,e,d)}}k(a,b);a.prototype[R]=function(){return this};a.create=function(c,b,d){c=new a(c,b,d);c.syncErrorThrowable=
!1;return c};a.prototype.next=function(c){this.isStopped||this._next(c)};a.prototype.error=function(c){this.isStopped||(this.isStopped=!0,this._error(c))};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,b.prototype.unsubscribe.call(this))};a.prototype._next=function(c){this.destination.next(c)};a.prototype._error=function(c){this.destination.error(c);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();
this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var c=this._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=c;this._parents=a;return this};return a}(u),Ma=function(b){function a(c,a,d,f){b.call(this);this._parentSubscriber=c;var e;c=this;N(a)?e=a:a&&(e=a.next,d=a.error,f=a.complete,a!==Y&&(c=Object.create(a),N(c.unsubscribe)&&this.add(c.unsubscribe.bind(c)),c.unsubscribe=this.unsubscribe.bind(this)));this._context=
c;this._next=e;this._error=d;this._complete=f}k(a,b);a.prototype.next=function(c){if(!this.isStopped&&this._next){var a=this._parentSubscriber;a.syncErrorThrowable?this.__tryOrSetError(a,this._next,c)&&this.unsubscribe():this.__tryOrUnsub(this._next,c)}};a.prototype.error=function(c){if(!this.isStopped){var a=this._parentSubscriber;if(this._error)a.syncErrorThrowable?this.__tryOrSetError(a,this._error,c):this.__tryOrUnsub(this._error,c),this.unsubscribe();else if(a.syncErrorThrowable)a.syncErrorValue=
c,a.syncErrorThrown=!0,this.unsubscribe();else throw this.unsubscribe(),c;}};a.prototype.complete=function(){var c=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var b=function(){return c._complete.call(c._context)};a.syncErrorThrowable?this.__tryOrSetError(a,b):this.__tryOrUnsub(b)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(c,a){try{c.call(this._context,a)}catch(d){throw this.unsubscribe(),d;}};a.prototype.__tryOrSetError=function(c,a,b){try{a.call(this._context,
b)}catch(f){return c.syncErrorValue=f,c.syncErrorThrown=!0}return!1};a.prototype._unsubscribe=function(){var c=this._parentSubscriber;this._parentSubscriber=this._context=null;c.unsubscribe()};return a}(l),I=function(b){var a=b.Symbol;"function"===typeof a?a.observable?b=a.observable:(b=a("observable"),a.observable=b):b="@@observable";return b}(n),g=function(){function b(a){this._isScalar=!1;a&&(this._subscribe=a)}b.prototype.lift=function(a){var c=new b;c.source=this;c.operator=a;return c};b.prototype.subscribe=
function(a,c,b){var e=this.operator;a:{if(a){if(a instanceof l)break a;if(a[R]){a=a[R]();break a}}a=a||c||b?new l(a,c,b):new l(Y)}e?e.call(a,this.source):a.add(this.source?this._subscribe(a):this._trySubscribe(a));if(a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};b.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(c){a.syncErrorThrown=!0,a.syncErrorValue=c,a.error(c)}};b.prototype.forEach=function(a,c){var b=this;c||(n.Rx&&
n.Rx.config&&n.Rx.config.Promise?c=n.Rx.config.Promise:n.Promise&&(c=n.Promise));if(!c)throw Error("no Promise impl found");return new c(function(c,e){var d;d=b.subscribe(function(c){if(d)try{a(c)}catch(C){e(C),d.unsubscribe()}else a(c)},e,c)})};b.prototype._subscribe=function(a){return this.source.subscribe(a)};b.prototype[I]=function(){return this};b.create=function(a){return new b(a)};return b}(),H=function(b){function a(){var c=b.call(this,"object unsubscribed");this.name=c.name="ObjectUnsubscribedError";
this.stack=c.stack;this.message=c.message}k(a,b);return a}(Error),Na=function(b){function a(c,a){b.call(this);this.subject=c;this.subscriber=a;this.closed=!1}k(a,b);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var c=this.subject,a=c.observers;this.subject=null;!a||0===a.length||c.isStopped||c.closed||(c=a.indexOf(this.subscriber),-1!==c&&a.splice(c,1))}};return a}(u),Oa=function(b){function a(c){b.call(this,c);this.destination=c}k(a,b);return a}(l),v=function(b){function a(){b.call(this);
this.observers=[];this.hasError=this.isStopped=this.closed=!1;this.thrownError=null}k(a,b);a.prototype[R]=function(){return new Oa(this)};a.prototype.lift=function(c){var a=new Z(this,this);a.operator=c;return a};a.prototype.next=function(c){if(this.closed)throw new H;if(!this.isStopped)for(var a=this.observers,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].next(c)};a.prototype.error=function(c){if(this.closed)throw new H;this.hasError=!0;this.thrownError=c;this.isStopped=!0;for(var a=this.observers,b=a.length,
a=a.slice(),f=0;f<b;f++)a[f].error(c);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new H;this.isStopped=!0;for(var c=this.observers,a=c.length,c=c.slice(),b=0;b<a;b++)c[b].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(c){if(this.closed)throw new H;return b.prototype._trySubscribe.call(this,c)};a.prototype._subscribe=function(c){if(this.closed)throw new H;
if(this.hasError)return c.error(this.thrownError),u.EMPTY;if(this.isStopped)return c.complete(),u.EMPTY;this.observers.push(c);return new Na(this,c)};a.prototype.asObservable=function(){var c=new g;c.source=this;return c};a.create=function(c,a){return new Z(c,a)};return a}(g),Z=function(b){function a(c,a){b.call(this);this.destination=c;this.source=a}k(a,b);a.prototype.next=function(c){var a=this.destination;a&&a.next&&a.next(c)};a.prototype.error=function(c){var a=this.destination;a&&a.error&&this.destination.error(c)};
a.prototype.complete=function(){var c=this.destination;c&&c.complete&&this.destination.complete()};a.prototype._subscribe=function(c){return this.source?this.source.subscribe(c):u.EMPTY};return a}(v),L=function(b){function a(){b.apply(this,arguments);this.value=null;this.hasCompleted=this.hasNext=!1}k(a,b);a.prototype._subscribe=function(c){return this.hasError?(c.error(this.thrownError),u.EMPTY):this.hasCompleted&&this.hasNext?(c.next(this.value),c.complete(),u.EMPTY):b.prototype._subscribe.call(this,
c)};a.prototype.next=function(c){this.hasCompleted||(this.value=c,this.hasNext=!0)};a.prototype.error=function(c){this.hasCompleted||b.prototype.error.call(this,c)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&b.prototype.next.call(this,this.value);b.prototype.complete.call(this)};return a}(v),Zb=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);
return function(){for(var e=[],h=0;h<arguments.length;h++)e[h-0]=arguments[h];return new a(c,b,e,this,d)}};a.prototype._subscribe=function(c){var b=this.callbackFunc,d=this.args,f=this.scheduler,h=this.subject;if(f)return f.schedule(a.dispatch,0,{source:this,subscriber:c,context:this.context});h||(h=this.subject=new L,f=function C(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=C.source,a=b.selector,b=b.subject;a?(c=r(a).apply(this,c),c===m?b.error(m.e):(b.next(c),b.complete())):
(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,r(b).apply(this.context,d.concat(f))===m&&h.error(m.e));return h.subscribe(c)};a.dispatch=function(c){var a=this,b=c.source,f=c.subscriber;c=c.context;var h=b.callbackFunc,g=b.args,k=b.scheduler,B=b.subject;if(!B){var B=b.subject=new L,l=function tb(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=tb.source,b=e.selector,e=e.subject;b?(c=r(b).apply(this,c),c===m?a.add(k.schedule(qb,0,{err:m.e,subject:e})):a.add(k.schedule(na,
0,{value:c,subject:e}))):a.add(k.schedule(na,0,{value:1>=c.length?c[0]:c,subject:e}))};l.source=b;r(h).apply(c,g.concat(l))===m&&B.error(m.e)}a.add(B.subscribe(f))};return a}(g).create;g.bindCallback=Zb;var $b=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var e=[],h=0;h<arguments.length;h++)e[h-0]=arguments[h];return new a(c,b,e,this,d)}};a.prototype._subscribe=
function(c){var a=this.callbackFunc,b=this.args,f=this.scheduler,h=this.subject;if(f)return f.schedule(rb,0,{source:this,subscriber:c,context:this.context});h||(h=this.subject=new L,f=function C(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=C.source,a=b.selector,b=b.subject,e=c.shift();e?b.error(e):a?(c=r(a).apply(this,c),c===m?b.error(m.e):(b.next(c),b.complete())):(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,r(a).apply(this.context,b.concat(f))===m&&h.error(m.e));
return h.subscribe(c)};return a}(g).create;g.bindNodeCallback=$b;var ga=function(b){function a(c,a){b.call(this);this.value=c;this.scheduler=a;this._isScalar=!0;a&&(this._isScalar=!1)}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.value,b=c.subscriber;c.done?b.complete():(b.next(a),b.closed||(c.done=!0,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.value,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{done:!1,value:b,subscriber:c});c.next(b);
c.closed||c.complete()};return a}(g),F=function(b){function a(c){b.call(this);this.scheduler=c}k(a,b);a.create=function(c){return new a(c)};a.dispatch=function(c){c.subscriber.complete()};a.prototype._subscribe=function(c){var b=this.scheduler;if(b)return b.schedule(a.dispatch,0,{subscriber:c});c.complete()};return a}(g),E=function(b){function a(c,a){b.call(this);this.array=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){return new a(c,b)};a.of=
function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];b=c[c.length-1];z(b)?c.pop():b=null;var d=c.length;return 1<d?new a(c,b):1===d?new ga(c[0],b):new F(b)};a.dispatch=function(c){var a=c.array,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a[b]),f.closed||(c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.array,d=b.length,f=this.scheduler;if(f)return f.schedule(a.dispatch,0,{array:b,index:0,count:d,subscriber:c});for(f=0;f<d&&!c.closed;f++)c.next(b[f]);
c.complete()};return a}(g),q=function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype.notifyNext=function(c,a,b,f,h){this.destination.next(a)};a.prototype.notifyError=function(c,a){this.destination.error(c)};a.prototype.notifyComplete=function(c){this.destination.complete()};return a}(l),A=function(b){var a=b.Symbol;if("function"===typeof a)return a.iterator||(a.iterator=a("iterator polyfill")),a.iterator;if((a=b.Set)&&"function"===typeof(new a)["@@iterator"])return"@@iterator";if(b=b.Map)for(var a=
Object.getOwnPropertyNames(b.prototype),c=0;c<a.length;++c){var e=a[c];if("entries"!==e&&"size"!==e&&b.prototype[e]===b.prototype.entries)return e}return"@@iterator"}(n),qa=function(b){function a(c,a,d){b.call(this);this.parent=c;this.outerValue=a;this.outerIndex=d;this.index=0}k(a,b);a.prototype._next=function(c){this.parent.notifyNext(this.outerValue,c,this.outerIndex,this.index++,this)};a.prototype._error=function(c){this.parent.notifyError(c,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);
this.unsubscribe()};return a}(l),Pa={},ha=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new ac(a,this.project))};return b}(),ac=function(b){function a(c,a){b.call(this,c);this.project=a;this.active=0;this.values=[];this.observables=[]}k(a,b);a.prototype._next=function(c){this.values.push(Pa);this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;
for(var b=0;b<a;b++){var f=c[b];this.add(p(this,f,f,b))}}};a.prototype.notifyComplete=function(c){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,h){c=this.values;f=c[b];f=this.toRespond?f===Pa?--this.toRespond:this.toRespond:0;c[b]=a;0===f&&(this.project?this._tryProject(c):this.destination.next(c.slice()))};a.prototype._tryProject=function(c){var a;try{a=this.project.apply(this,c)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(q);
g.combineLatest=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=a=null;z(b[b.length-1])&&(c=b.pop());"function"===typeof b[b.length-1]&&(a=b.pop());1===b.length&&D(b[0])&&(b=b[0]);return(new E(b,c)).lift(new ha(a))};var W=function(){function b(a){this.concurrent=a}b.prototype.call=function(a,c){return c.subscribe(new bc(a,this.concurrent))};return b}(),bc=function(b){function a(c,a){b.call(this,c);this.concurrent=a;this.hasCompleted=!1;this.buffer=[];this.active=0}k(a,
b);a.prototype._next=function(c){this.active<this.concurrent?(this.active++,this.add(p(this,c))):this.buffer.push(c)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyComplete=function(c){var a=this.buffer;this.remove(c);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q);g.concat=P;var dc=function(b){function a(c){b.call(this);this.observableFactory=
c}k(a,b);a.create=function(c){return new a(c)};a.prototype._subscribe=function(c){return new cc(c,this.observableFactory)};return a}(g),cc=function(b){function a(c,a){b.call(this,c);this.factory=a;this.tryDefer()}k(a,b);a.prototype.tryDefer=function(){try{this._callFactory()}catch(c){this._error(c)}};a.prototype._callFactory=function(){var c=this.factory();c&&this.add(p(this,c))};return a}(q);g.defer=dc.create;g.empty=F.create;var fc=function(b){function a(c,a){b.call(this);this.sources=c;this.resultSelector=
a}k(a,b);a.create=function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];if(null===c||0===arguments.length)return new F;b=null;"function"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&D(c[0])&&(c=c[0]);return 0===c.length?new F:new a(c,b)};a.prototype._subscribe=function(c){return new ec(c,this.sources,this.resultSelector)};return a}(g),ec=function(b){function a(c,a,d){b.call(this,c);this.sources=a;this.resultSelector=d;this.haveValues=this.completed=0;this.total=c=a.length;this.values=
Array(c);for(d=0;d<c;d++){var e=p(this,a[d],null,d);e&&(e.outerIndex=d,this.add(e))}}k(a,b);a.prototype.notifyNext=function(c,a,b,f,h){this.values[b]=a;h._hasValue||(h._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(c){var a=this.destination,b=this.haveValues,f=this.resultSelector,h=this.values,g=h.length;c._hasValue?(this.completed++,this.completed===g&&(b===g&&(c=f?f.apply(this,h):h,a.next(c)),a.complete())):a.complete()};return a}(q);g.forkJoin=fc.create;var Qa=function(b){function a(c,
a){b.call(this);this.promise=c;this.scheduler=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this,b=this.promise,f=this.scheduler;if(null==f)this._isScalar?c.closed||(c.next(this.value),c.complete()):b.then(function(b){a.value=b;a._isScalar=!0;c.closed||(c.next(b),c.complete())},function(a){c.closed||c.error(a)}).then(null,function(c){n.setTimeout(function(){throw c;})});else if(this._isScalar){if(!c.closed)return f.schedule(ra,0,{value:this.value,subscriber:c})}else b.then(function(b){a.value=
b;a._isScalar=!0;c.closed||c.add(f.schedule(ra,0,{value:b,subscriber:c}))},function(a){c.closed||c.add(f.schedule(ub,0,{err:a,subscriber:c}))}).then(null,function(c){n.setTimeout(function(){throw c;})})};return a}(g),ic=function(b){function a(c,a){b.call(this);this.scheduler=a;if(null==c)throw Error("iterator cannot be null.");if((a=c[A])||"string"!==typeof c)if(a||void 0===c.length){if(!a)throw new TypeError("object is not iterable");c=c[A]()}else c=new gc(c);else c=new hc(c);this.iterator=c}k(a,
b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.index,b=c.iterator,f=c.subscriber;if(c.hasError)f.error(c.error);else{var h=b.next();h.done?f.complete():(f.next(h.value),c.index=a+1,f.closed?"function"===typeof b.return&&b.return():this.schedule(c))}};a.prototype._subscribe=function(c){var b=this.iterator,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{index:0,iterator:b,subscriber:c});do{d=b.next();if(d.done){c.complete();break}else c.next(d.value);if(c.closed){"function"===
typeof b.return&&b.return();break}}while(1)};return a}(g),hc=function(){function b(a,c,b){void 0===c&&(c=0);void 0===b&&(b=a.length);this.str=a;this.idx=c;this.len=b}b.prototype[A]=function(){return this};b.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}};return b}(),gc=function(){function b(a,c,b){void 0===c&&(c=0);if(void 0===b)if(b=+a.length,isNaN(b))b=0;else if(0!==b&&"number"===typeof b&&n.isFinite(b)){var e;e=+b;e=0===e?e:
isNaN(e)?e:0>e?-1:1;b=e*Math.floor(Math.abs(b));b=0>=b?0:b>Ra?Ra:b}this.arr=a;this.idx=c;this.len=b}b.prototype[A]=function(){return this};b.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}};return b}(),Ra=Math.pow(2,53)-1,jc=function(b){function a(c,a){b.call(this);this.arrayLike=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){var e=c.length;return 0===e?new F:1===e?new ga(c[0],b):
new a(c,b)};a.dispatch=function(c){var a=c.arrayLike,b=c.index,f=c.subscriber;f.closed||(b>=c.length?f.complete():(f.next(a[b]),c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.arrayLike,d=this.scheduler,f=b.length;if(d)return d.schedule(a.dispatch,0,{arrayLike:b,index:0,length:f,subscriber:c});for(d=0;d<f&&!c.closed;d++)c.next(b[d]);c.complete()};return a}(g),w=function(){function b(a,c,b){this.kind=a;this.value=c;this.error=b;this.hasValue="N"===a}b.prototype.observe=
function(a){switch(this.kind){case "N":return a.next&&a.next(this.value);case "E":return a.error&&a.error(this.error);case "C":return a.complete&&a.complete()}};b.prototype.do=function(a,c,b){switch(this.kind){case "N":return a&&a(this.value);case "E":return c&&c(this.error);case "C":return b&&b()}};b.prototype.accept=function(a,c,b){return a&&"function"===typeof a.next?this.observe(a):this.do(a,c,b)};b.prototype.toObservable=function(){switch(this.kind){case "N":return g.of(this.value);case "E":return g.throw(this.error);
case "C":return g.empty()}throw Error("unexpected notification kind value");};b.createNext=function(a){return"undefined"!==typeof a?new b("N",a):b.undefinedValueNotification};b.createError=function(a){return new b("E",void 0,a)};b.createComplete=function(){return b.completeNotification};b.completeNotification=new b("C");b.undefinedValueNotification=new b("N",void 0);return b}(),kc=function(){function b(a,c){void 0===c&&(c=0);this.scheduler=a;this.delay=c}b.prototype.call=function(a,c){return c.subscribe(new ia(a,
this.scheduler,this.delay))};return b}(),ia=function(b){function a(c,a,d){void 0===d&&(d=0);b.call(this,c);this.scheduler=a;this.delay=d}k(a,b);a.dispatch=function(c){c.notification.observe(c.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(c){this.add(this.scheduler.schedule(a.dispatch,this.delay,new lc(c,this.destination)))};a.prototype._next=function(c){this.scheduleMessage(w.createNext(c))};a.prototype._error=function(c){this.scheduleMessage(w.createError(c))};a.prototype._complete=
function(){this.scheduleMessage(w.createComplete())};return a}(l),lc=function(){return function(b,a){this.notification=b;this.destination=a}}(),Sa=function(b){function a(c,a){b.call(this,null);this.ish=c;this.scheduler=a}k(a,b);a.create=function(c,b){if(null!=c){if("function"===typeof c[I])return c instanceof g&&!b?c:new a(c,b);if(D(c))return new E(c,b);if(pa(c))return new Qa(c,b);if("function"===typeof c[A]||"string"===typeof c)return new ic(c,b);if(c&&"number"===typeof c.length)return new jc(c,
b)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");};a.prototype._subscribe=function(c){var a=this.ish,b=this.scheduler;return null==b?a[I]().subscribe(c):a[I]().subscribe(new ia(c,b,0))};return a}(g);g.from=Sa.create;var Ta=Object.prototype.toString,mc=function(b){function a(c,a,d,f){b.call(this);this.sourceObj=c;this.eventName=a;this.selector=d;this.options=f}k(a,b);a.create=function(c,b,d,f){N(d)&&(f=d,d=void 0);return new a(c,b,f,d)};a.setupSubscription=function(c,b,d,f,h){var e;
if(c&&"[object NodeList]"===Ta.call(c)||c&&"[object HTMLCollection]"===Ta.call(c))for(var g=0,k=c.length;g<k;g++)a.setupSubscription(c[g],b,d,f,h);else if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(b,d,h),e=function(){return c.removeEventListener(b,d)};else if(c&&"function"===typeof c.on&&"function"===typeof c.off)c.on(b,d),e=function(){return c.off(b,d)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(b,
d),e=function(){return c.removeListener(b,d)};else throw new TypeError("Invalid event target");f.add(new u(e))};a.prototype._subscribe=function(c){var b=this.selector;a.setupSubscription(this.sourceObj,this.eventName,b?function(){for(var a=[],e=0;e<arguments.length;e++)a[e-0]=arguments[e];a=r(b).apply(void 0,a);a===m?c.error(m.e):c.next(a)}:function(a){return c.next(a)},c,this.options)};return a}(g).create;g.fromEvent=mc;var nc=function(b){function a(c,a,d){b.call(this);this.addHandler=c;this.removeHandler=
a;this.selector=d}k(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=function(c){var a=this,b=this.removeHandler,f=this.selector?function(){for(var b=[],e=0;e<arguments.length;e++)b[e-0]=arguments[e];a._callSelector(c,b)}:function(a){c.next(a)},h=this._callAddHandler(f,c);N(b)&&c.add(new u(function(){b(f,h)}))};a.prototype._callSelector=function(c,a){try{var b=this.selector.apply(this,a);c.next(b)}catch(f){c.error(f)}};a.prototype._callAddHandler=function(c,a){try{return this.addHandler(c)||
null}catch(d){a.error(d)}};return a}(g).create;g.fromEventPattern=nc;g.fromPromise=Qa.create;var Ua=function(b){return b},oc=function(b){function a(c,a,d,f,h){b.call(this);this.initialState=c;this.condition=a;this.iterate=d;this.resultSelector=f;this.scheduler=h}k(a,b);a.create=function(c,b,d,f,h){return 1==arguments.length?new a(c.initialState,c.condition,c.iterate,c.resultSelector||Ua,c.scheduler):void 0===f||z(f)?new a(c,b,d,Ua,f):new a(c,b,d,f,h)};a.prototype._subscribe=function(c){var b=this.initialState;
if(this.scheduler)return this.scheduler.schedule(a.dispatch,0,{subscriber:c,iterate:this.iterate,condition:this.condition,resultSelector:this.resultSelector,state:b});var d=this.condition,f=this.resultSelector,h=this.iterate;do{if(d){var g=void 0;try{g=d(b)}catch(C){c.error(C);break}if(!g){c.complete();break}}g=void 0;try{g=f(b)}catch(C){c.error(C);break}c.next(g);if(c.closed)break;try{b=h(b)}catch(C){c.error(C);break}}while(1)};a.dispatch=function(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=
c.iterate(c.state)}catch(y){a.error(y);return}else c.needIterate=!0;if(b){var f=void 0;try{f=b(c.state)}catch(y){a.error(y);return}if(!f){a.complete();return}if(a.closed)return}var h;try{h=c.resultSelector(c.state)}catch(y){a.error(y);return}if(!a.closed&&(a.next(h),!a.closed))return this.schedule(c)}};return a}(g);g.generate=oc.create;var qc=function(b){function a(c,a,d){b.call(this);this.condition=c;this.thenSource=a;this.elseSource=d}k(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=
function(c){return new pc(c,this.condition,this.thenSource,this.elseSource)};return a}(g),pc=function(b){function a(c,a,d,f){b.call(this,c);this.condition=a;this.thenSource=d;this.elseSource=f;this.tryIf()}k(a,b);a.prototype.tryIf=function(){var c=this.condition,a=this.thenSource,b=this.elseSource,f;try{(c=(f=c())?a:b)?this.add(p(this,c)):this._complete()}catch(h){this._error(h)}};return a}(q);g.if=qc.create;var S=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a;this.pending=
!1}k(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(this.closed)return this;this.state=c;this.pending=!0;c=this.id;var b=this.scheduler;null!=c&&(this.id=this.recycleAsyncId(b,c,a));this.delay=a;this.id=this.id||this.requestAsyncId(b,this.id,a);return this};a.prototype.requestAsyncId=function(c,a,b){void 0===b&&(b=0);return n.setInterval(c.flush.bind(c,this),b)};a.prototype.recycleAsyncId=function(c,a,b){void 0===b&&(b=0);return null!==b&&this.delay===b&&!1===this.pending?a:(n.clearInterval(a),
void 0)};a.prototype.execute=function(c,a){if(this.closed)return Error("executing a cancelled action");this.pending=!1;if(c=this._execute(c,a))return c;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(c,a){a=!1;var b=void 0;try{this.work(c)}catch(f){a=!0,b=!!f&&f||Error(f)}if(a)return this.unsubscribe(),b};a.prototype._unsubscribe=function(){var c=this.id,a=this.scheduler,b=a.actions,f=b.indexOf(this);this.state=this.work=
null;this.pending=!1;this.scheduler=null;-1!==f&&b.splice(f,1);null!=c&&(this.id=this.recycleAsyncId(a,c,null));this.delay=null};return a}(function(b){function a(c,a){b.call(this)}k(a,b);a.prototype.schedule=function(c,a){return this};return a}(u)),T=function(b){function a(){b.apply(this,arguments);this.actions=[];this.active=!1;this.scheduled=void 0}k(a,b);a.prototype.flush=function(c){var a=this.actions;if(this.active)a.push(c);else{var b;this.active=!0;do if(b=c.execute(c.state,c.delay))break;
while(c=a.shift());this.active=!1;if(b){for(;c=a.shift();)c.unsubscribe();throw b;}}};return a}(function(){function b(a,c){void 0===c&&(c=b.now);this.SchedulerAction=a;this.now=c}b.prototype.schedule=function(a,c,b){void 0===c&&(c=0);return(new this.SchedulerAction(this,a)).schedule(b,c)};b.now=Date.now?Date.now:function(){return+new Date};return b}()),x=new T(S),rc=function(b){function a(c,a){void 0===c&&(c=0);void 0===a&&(a=x);b.call(this);this.period=c;this.scheduler=a;if(!Q(c)||0>c)this.period=
0;a&&"function"===typeof a.schedule||(this.scheduler=x)}k(a,b);a.create=function(c,b){void 0===c&&(c=0);void 0===b&&(b=x);return new a(c,b)};a.dispatch=function(c){var a=c.subscriber,b=c.period;a.next(c.index);a.closed||(c.index+=1,this.schedule(c,b))};a.prototype._subscribe=function(c){var b=this.period;c.add(this.scheduler.schedule(a.dispatch,b,{index:0,subscriber:c,period:b}))};return a}(g).create;g.interval=rc;g.merge=sa;var vb=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new sc(a))};
return b}(),sc=function(b){function a(c){b.call(this,c);this.hasFirst=!1;this.observables=[];this.subscriptions=[]}k(a,b);a.prototype._next=function(c){this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{for(var b=0;b<a&&!this.hasFirst;b++){var f=c[b],f=p(this,f,f,b);this.subscriptions&&this.subscriptions.push(f);this.add(f)}this.observables=null}};a.prototype.notifyNext=function(c,a,b,f,h){if(!this.hasFirst){this.hasFirst=
!0;for(c=0;c<this.subscriptions.length;c++)c!==b&&(f=this.subscriptions[c],f.unsubscribe(),this.remove(f));this.subscriptions=null}this.destination.next(a)};return a}(q);g.race=ta;var tc=function(b){function a(){b.call(this)}k(a,b);a.create=function(){return new a};a.prototype._subscribe=function(c){};return a}(g).create;g.never=tc;g.of=E.of;var Va=function(){function b(a){this.nextSources=a}b.prototype.call=function(a,c){return c.subscribe(new uc(a,this.nextSources))};return b}(),uc=function(b){function a(c,
a){b.call(this,c);this.destination=c;this.nextSources=a}k(a,b);a.prototype.notifyError=function(c,a){this.subscribeToNextSource()};a.prototype.notifyComplete=function(c){this.subscribeToNextSource()};a.prototype._error=function(c){this.subscribeToNextSource()};a.prototype._complete=function(){this.subscribeToNextSource()};a.prototype.subscribeToNextSource=function(){var c=this.nextSources.shift();c?this.add(p(this,c)):this.destination.complete()};return a}(q);g.onErrorResumeNext=function(){for(var b=
[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&D(b[0])&&(b=b[0]);a=b.shift();return(new Sa(a,null)).lift(new Va(b))};var vc=function(b){function a(c,a){b.call(this);this.obj=c;this.scheduler=a;this.keys=Object.keys(c)}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.keys,b=this.scheduler,f=a.length;if(b)return b.schedule(wb,0,{obj:this.obj,keys:a,length:f,index:0,subscriber:c});for(b=0;b<f;b++){var h=a[b];c.next([h,this.obj[h]])}c.complete()};
return a}(g).create;g.pairs=vc;var wc=function(b){function a(c,a,d){b.call(this);this.start=c;this._count=a;this.scheduler=d}k(a,b);a.create=function(c,b,d){void 0===c&&(c=0);void 0===b&&(b=0);return new a(c,b,d)};a.dispatch=function(c){var a=c.start,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a),f.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=0,d=this.start,f=this._count,h=this.scheduler;if(h)return h.schedule(a.dispatch,0,{index:b,count:f,
start:d,subscriber:c});do{if(b++>=f){c.complete();break}c.next(d++);if(c.closed)break}while(1)};return a}(g).create;g.range=wc;var yc=function(b){function a(c,a){b.call(this);this.resourceFactory=c;this.observableFactory=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.resourceFactory,b=this.observableFactory,f;try{return f=a(),new xc(c,f,b)}catch(h){c.error(h)}};return a}(g),xc=function(b){function a(c,a,d){b.call(this,c);this.resource=a;this.observableFactory=
d;c.add(a);this.tryUse()}k(a,b);a.prototype.tryUse=function(){try{var c=this.observableFactory.call(this,this.resource);c&&this.add(p(this,c))}catch(e){this._error(e)}};return a}(q);g.using=yc.create;var zc=function(b){function a(c,a){b.call(this);this.error=c;this.scheduler=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){c.subscriber.error(c.error)};a.prototype._subscribe=function(c){var b=this.error,d=this.scheduler;c.syncErrorThrowable=!0;if(d)return d.schedule(a.dispatch,
0,{error:b,subscriber:c});c.error(b)};return a}(g).create;g.throw=zc;var Ac=function(b){function a(c,a,d){void 0===c&&(c=0);b.call(this);this.period=-1;this.dueTime=0;Q(a)?this.period=1>Number(a)&&1||Number(a):z(a)&&(d=a);z(d)||(d=x);this.scheduler=d;this.dueTime=X(c)?+c-this.scheduler.now():c}k(a,b);a.create=function(c,b,d){void 0===c&&(c=0);return new a(c,b,d)};a.dispatch=function(c){var a=c.index,b=c.period,f=c.subscriber;f.next(a);if(!f.closed){if(-1===b)return f.complete();c.index=a+1;this.schedule(c,
b)}};a.prototype._subscribe=function(c){return this.scheduler.schedule(a.dispatch,this.dueTime,{index:0,period:this.period,subscriber:c})};return a}(g).create;g.timer=Ac;var va=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new Bc(a,this.project))};return b}(),Bc=function(b){function a(c,a,d){void 0===d&&(d=Object.create(null));b.call(this,c);this.iterators=[];this.active=0;this.project="function"===typeof a?a:null;this.values=d}k(a,b);a.prototype._next=
function(c){var a=this.iterators;D(c)?a.push(new Cc(c)):"function"===typeof c[A]?a.push(new Dc(c[A]())):a.push(new Ec(this.destination,this,c))};a.prototype._complete=function(){var c=this.iterators,a=c.length;if(0===a)this.destination.complete();else{this.active=a;for(var b=0;b<a;b++){var f=c[b];f.stillUnsubscribed?this.add(f.subscribe(f,b)):this.active--}}};a.prototype.notifyInactive=function(){this.active--;0===this.active&&this.destination.complete()};a.prototype.checkIterators=function(){for(var c=
this.iterators,a=c.length,b=this.destination,f=0;f<a;f++){var h=c[f];if("function"===typeof h.hasValue&&!h.hasValue())return}for(var g=!1,k=[],f=0;f<a;f++){var h=c[f],l=h.next();h.hasCompleted()&&(g=!0);if(l.done){b.complete();return}k.push(l.value)}this.project?this._tryProject(k):b.next(k);g&&b.complete()};a.prototype._tryProject=function(c){var a;try{a=this.project.apply(this,c)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(l),Dc=function(){function b(a){this.iterator=
a;this.nextResult=a.next()}b.prototype.hasValue=function(){return!0};b.prototype.next=function(){var a=this.nextResult;this.nextResult=this.iterator.next();return a};b.prototype.hasCompleted=function(){var a=this.nextResult;return a&&a.done};return b}(),Cc=function(){function b(a){this.array=a;this.length=this.index=0;this.length=a.length}b.prototype[A]=function(){return this};b.prototype.next=function(a){a=this.index++;var c=this.array;return a<this.length?{value:c[a],done:!1}:{value:null,done:!0}};
b.prototype.hasValue=function(){return this.array.length>this.index};b.prototype.hasCompleted=function(){return this.array.length===this.index};return b}(),Ec=function(b){function a(c,a,d){b.call(this,c);this.parent=a;this.observable=d;this.stillUnsubscribed=!0;this.buffer=[];this.isComplete=!1}k(a,b);a.prototype[A]=function(){return this};a.prototype.next=function(){var c=this.buffer;return 0===c.length&&this.isComplete?{value:null,done:!0}:{value:c.shift(),done:!1}};a.prototype.hasValue=function(){return 0<
this.buffer.length};a.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete};a.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,h){this.buffer.push(a);this.parent.checkIterators()};a.prototype.subscribe=function(c,a){return p(this,this.observable,this,a)};return a}(q);g.zip=ua;var xa=function(){function b(a,c){this.project=a;this.thisArg=c}b.prototype.call=
function(a,c){return c.subscribe(new Fc(a,this.project,this.thisArg))};return b}(),Fc=function(b){function a(c,a,d){b.call(this,c);this.project=a;this.count=0;this.thisArg=d||this}k(a,b);a.prototype._next=function(c){var a;try{a=this.project.call(this.thisArg,c,this.count++)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(l),J=function(b){function a(c){b.call(this);var a={async:!0,createXHR:function(){var c;if(this.crossDomain)if(n.XMLHttpRequest)c=new n.XMLHttpRequest;
else if(n.XDomainRequest)c=new n.XDomainRequest;else throw Error("CORS is not supported by your browser");else if(n.XMLHttpRequest)c=new n.XMLHttpRequest;else{var a=void 0;try{for(var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=0;3>e;e++)try{a=b[e];new n.ActiveXObject(a);break}catch(B){}c=new n.ActiveXObject(a)}catch(B){throw Error("XMLHttpRequest is not supported by your browser");}}return c},crossDomain:!1,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};
if("string"===typeof c)a.url=c;else for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d]);this.request=a}k(a,b);a.prototype._subscribe=function(c){return new Gc(c,this.request)};a.create=function(){var c=function(c){return new a(c)};c.get=xb;c.post=yb;c.delete=zb;c.put=Ab;c.patch=Bb;c.getJSON=Cb;return c}();return a}(g),Gc=function(b){function a(c,a){b.call(this,c);this.request=a;this.done=!1;c=a.headers=a.headers||{};a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");"Content-Type"in
c||n.FormData&&a.body instanceof n.FormData||"undefined"===typeof a.body||(c["Content-Type"]="application/x-www-form-urlencoded; charset\x3dUTF-8");a.body=this.serializeBody(a.body,a.headers["Content-Type"]);this.send()}k(a,b);a.prototype.next=function(c){this.done=!0;var a=this.destination;c=new Wa(c,this.xhr,this.request);a.next(c)};a.prototype.send=function(){var c=this.request,a=this.request,b=a.user,f=a.method,h=a.url,g=a.async,k=a.password,l=a.headers,a=a.body,n=r(c.createXHR).call(c);if(n===
m)this.error(m.e);else{this.xhr=n;this.setupEvents(n,c);b=b?r(n.open).call(n,f,h,g,b,k):r(n.open).call(n,f,h,g);if(b===m)return this.error(m.e),null;g&&(n.timeout=c.timeout,n.responseType=c.responseType);"withCredentials"in n&&(n.withCredentials=!!c.withCredentials);this.setHeaders(n,l);b=a?r(n.send).call(n,a):r(n.send).call(n);if(b===m)return this.error(m.e),null}return n};a.prototype.serializeBody=function(c,a){if(!c||"string"===typeof c||n.FormData&&c instanceof n.FormData)return c;if(a){var b=
a.indexOf(";");-1!==b&&(a=a.substring(0,b))}switch(a){case "application/x-www-form-urlencoded":return Object.keys(c).map(function(a){return encodeURI(a)+"\x3d"+encodeURI(c[a])}).join("\x26");case "application/json":return JSON.stringify(c);default:return c}};a.prototype.setHeaders=function(c,a){for(var b in a)a.hasOwnProperty(b)&&c.setRequestHeader(b,a[b])};a.prototype.setupEvents=function(c,a){function b(c){var a=b.subscriber,e=b.progressSubscriber,d=b.request;e&&e.error(c);a.error(new Xa(this,d))}
function e(c){var a=e.subscriber,b=e.progressSubscriber,d=e.request;if(4===this.readyState){var f=1223===this.status?204:this.status,h="text"===this.responseType?this.response||this.responseText:this.response;0===f&&(f=h?200:0);200<=f&&300>f?(b&&b.complete(),a.next(c),a.complete()):(b&&b.error(c),a.error(new aa("ajax error "+f,this,d)))}}var h=a.progressSubscriber;c.ontimeout=b;b.request=a;b.subscriber=this;b.progressSubscriber=h;if(c.upload&&"withCredentials"in c){if(h){var g;g=function(c){g.progressSubscriber.next(c)};
n.XDomainRequest?c.onprogress=g:c.upload.onprogress=g;g.progressSubscriber=h}var k;k=function(c){var a=k.progressSubscriber,b=k.subscriber,e=k.request;a&&a.error(c);b.error(new aa("ajax error",this,e))};c.onerror=k;k.request=a;k.subscriber=this;k.progressSubscriber=h}c.onreadystatechange=e;e.subscriber=this;e.progressSubscriber=h;e.request=a};a.prototype.unsubscribe=function(){var c=this.xhr;!this.done&&c&&4!==c.readyState&&"function"===typeof c.abort&&c.abort();b.prototype.unsubscribe.call(this)};
return a}(l),Wa=function(){return function(b,a,c){this.originalEvent=b;this.xhr=a;this.request=c;this.status=a.status;this.responseType=a.responseType||c.responseType;switch(this.responseType){case "json":this.response="response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null");break;case "xml":this.response=a.responseXML;break;default:this.response="response"in a?a.response:a.responseText}}}(),aa=function(b){function a(c,a,d){b.call(this,
c);this.message=c;this.xhr=a;this.request=d;this.status=a.status}k(a,b);return a}(Error),Xa=function(b){function a(c,a){b.call(this,"ajax timeout",c,a)}k(a,b);return a}(aa);g.ajax=J.create;var Hc=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a}k(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(0<a)return b.prototype.schedule.call(this,c,a);this.delay=a;this.state=c;this.scheduler.flush(this);return this};a.prototype.execute=function(c,a){return 0<a||this.closed?
b.prototype.execute.call(this,c,a):this._execute(c,a)};a.prototype.requestAsyncId=function(c,a,d){void 0===d&&(d=0);return null!==d&&0<d||null===d&&0<this.delay?b.prototype.requestAsyncId.call(this,c,a,d):c.flush(this)};return a}(S),Ya=new (function(b){function a(){b.apply(this,arguments)}k(a,b);return a}(T))(Hc),K=function(b){function a(c,a,d){void 0===c&&(c=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);b.call(this);this.scheduler=d;this._events=[];this._bufferSize=1>c?1:c;this._windowTime=
1>a?1:a}k(a,b);a.prototype.next=function(c){var a=this._getNow();this._events.push(new Ic(a,c));this._trimBufferThenGetEvents();b.prototype.next.call(this,c)};a.prototype._subscribe=function(c){var a=this._trimBufferThenGetEvents(),b=this.scheduler,f;if(this.closed)throw ne