UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

104 lines 139 kB
/** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ var __extends,__assign,__decorate,__param,__metadata,__awaiter; (function(k){function v(n,k){return function(v,t){return n[v]=k?k(v,t):t}}var t="object"===typeof global?global:"object"===typeof self?self:"object"===typeof this?this:{};"object"===typeof System&&"function"===typeof System.register?System.register("tslib",[],function(n){k(v(t,n));return{setters:[],execute:function(){}}}):"function"===typeof define&&define.amd?define("tslib",["exports"],function(n){k(v(t,v(n)))}):"object"===typeof module&&"object"===typeof module.exports?k(v(t,v(module.exports))): k(v(t))})(function(k){__extends=function(k,t){function n(){this.constructor=k}for(var v in t)t.hasOwnProperty(v)&&(k[v]=t[v]);k.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)};__assign=Object.assign||function(k){for(var t,n=1,v=arguments.length;n<v;n++){t=arguments[n];for(var R in t)Object.prototype.hasOwnProperty.call(t,R)&&(k[R]=t[R])}return k};__decorate=function(k,t,n,D){var v=arguments.length,B=3>v?t:null===D?D=Object.getOwnPropertyDescriptor(t,n):D,H;if("object"===typeof Reflect&& "function"===typeof Reflect.decorate)B=Reflect.decorate(k,t,n,D);else for(var K=k.length-1;0<=K;K--)if(H=k[K])B=(3>v?H(B):3<v?H(t,n,B):H(t,n))||B;return 3<v&&B&&Object.defineProperty(t,n,B),B};__param=function(k,t){return function(n,v){t(n,v,k)}};__metadata=function(k,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(k,t)};__awaiter=function(k,t,n,D){return new (n||(n=Promise))(function(v,B){function H(k){try{C(D.next(k))}catch(p){B(p)}}function K(k){try{C(D.throw(k))}catch(p){B(p)}} function C(k){k.done?v(k.value):(new n(function(n){n(k.value)})).then(H,K)}C((D=D.apply(k,t)).next())})};k("__extends",__extends);k("__assign",__assign);k("__decorate",__decorate);k("__param",__param);k("__metadata",__metadata);k("__awaiter",__awaiter)}); (function(k,v){"object"===typeof exports&&"undefined"!==typeof module?v(exports):"function"===typeof define&&define.amd?define(["exports"],v):v(k.Rx=k.Rx||{})})(this,function(k){function v(b){return"function"===typeof b}function t(){try{return qa.apply(this,arguments)}catch(b){return m.e=b,m}}function n(b){qa=b;return t}function D(b){var a=b.subject;a.next(b.value);a.complete()}function R(b){b.subject.error(b.err)}function B(b){var a=this,c=b.source;b=b.subscriber;var f=c.callbackFunc,d=c.args,e= c.scheduler,h=c.subject;if(!h){var h=c.subject=new O,g=function E(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var f=E.source,b=f.selector,f=f.subject,d=c.shift();d?f.error(d):b?(c=n(b).apply(this,c),c===m?a.add(e.schedule(K,0,{err:m.e,subject:f})):a.add(e.schedule(H,0,{value:c,subject:f}))):a.add(e.schedule(H,0,{value:1===c.length?c[0]:c,subject:f}))};g.source=c;n(f).apply(this,d.concat(g))===m&&h.error(m.e)}a.add(h.subscribe(b))}function H(b){var a=b.subject;a.next(b.value);a.complete()} function K(b){b.subject.error(b.err)}function C(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,f){var d=new ra(b,c,f);if(d.closed)return null;if(a instanceof g)return a._isScalar?(d.next(a.value),d.complete(),null):a.subscribe(d);if(F(a)){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){q.setTimeout(function(){throw c;})}),d;if("function"===typeof a[G]){a=a[G]();do{b=a.next();if(b.done){d.complete();break}d.next(b.value);if(d.closed)break}while(1)}else if("function"===typeof a[L])if(a=a[L](),"function"!==typeof a.subscribe)d.error(Error("invalid observable"));else return a.subscribe(new ra(b,c,f));else d.error(new TypeError("unknown type returned"))}return null}function S(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=null;C(b[b.length-1])&&(a=b.pop()); return null===a&&1===b.length?b[0]:(new I(b,a)).lift(new Z(1))}function sa(b){var a=b.value;b=b.subscriber;b.closed||(b.next(a),b.complete())}function nb(b){var a=b.err;b=b.subscriber;b.closed||b.error(a)}function fa(b){return!F(b)&&0<=b-parseFloat(b)+1}function ta(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var a=Number.POSITIVE_INFINITY,c=null,f=b[b.length-1];C(f)?(c=b.pop(),1<b.length&&"number"===typeof b[b.length-1]&&(a=b.pop())):"number"===typeof f&&(a=b.pop());return null=== c&&1===b.length?b[0]:(new I(b,c)).lift(new Z(a))}function ua(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];if(1===b.length)if(F(b[0]))b=b[0];else return b[0];return(new I(b)).lift(new ob)}function pb(b){var a=b.obj,c=b.keys,f=b.index,d=b.subscriber;f===b.length?d.complete():(c=c[f],d.next([c,a[c]]),b.index=f+1,this.schedule(b))}function aa(b){return b instanceof Date&&!isNaN(+b)}function va(){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 I(b)).lift(new wa(a))}function xa(b,a){if("function"!==typeof b)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new ya(b,a))}function qb(b,a){void 0===a&&(a=null);return new P({method:"GET",url:b,headers:a})}function rb(b,a,c){return new P({method:"POST",url:b,body:a,headers:c})}function sb(b,a){return new P({method:"DELETE",url:b,headers:a})}function tb(b,a,c){return new P({method:"PUT",url:b,body:a,headers:c})}function ub(b, a){return(new P({method:"GET",url:b,responseType:"json",headers:a})).lift(new ya(function(c,a){return c.response},null))}function vb(b){for(var a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];for(var c=a.length,f=0;f<c;f++){var d=a[f],e;for(e in d)d.hasOwnProperty(e)&&(b[e]=d[e])}return b}function za(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 wb(b){var a=b.bufferCreationInterval, c=b.bufferTimeSpan,f=b.subscriber,d=b.scheduler,e=f.openContext();f.closed||(f.add(e.closeAction=d.schedule(Aa,c,{subscriber:f,context:e})),this.schedule(b,a))}function Aa(b){b.subscriber.closeContext(b.context)}function Ba(b){b=new xb(b);var a=this.lift(b);return b.caught=a}function Ca(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);"number"===typeof a&&(c=a,a=null);return this.lift(new Da(b,a,c))}function Ea(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);"number"===typeof a&&(c=a,a=null);return this.lift(new Fa(b, a,c))}function yb(b){b.debouncedNext()}function zb(){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 Ga(b,a){return this.lift(new Ab(b,a))}function Ha(b,a,c){return this.lift(new Bb(b,a, c))}function ga(b,a){return this.lift(new Cb(b,a))}function Ia(b){return this.lift(new Db(b))}function Eb(b){b.clearThrottle()}function Ja(b){return b(this)}function M(b,a){var c;c="function"===typeof b?b:function(){return b};if("function"===typeof a)return this.lift(new Fb(c,a));a=Object.create(this,Gb);a.source=this;a.subjectFactory=c;return a}function Hb(b,a){function c(){return!c.pred.apply(c.thisArg,arguments)}c.pred=b;c.thisArg=a;return c}function Ib(b,a){return function(c){var f=c;for(c=0;c< a;c++)if(f=f[b[c]],"undefined"===typeof f)return;return f}}function Jb(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function Kb(){return new x}function Ka(){return this.lift(new Lb)}function Mb(b){b.subscriber.clearThrottle()}function Nb(b){var a=b.subscriber,c=b.windowTimeSpan,f=b.window;f&&f.complete();b.window=a.openWindow();this.schedule(b,c)}function Ob(b){var a=b.windowTimeSpan,c=b.subscriber,f=b.scheduler,d=b.windowCreationInterval,e=c.openWindow(),h={action:this,subscription:null}; h.subscription=f.schedule(La,a,{subscriber:c,window:e,context:h});this.add(h.subscription);this.schedule(b,d)}function La(b){var a=b.subscriber,c=b.window;(b=b.context)&&b.action&&b.subscription&&b.action.remove(b.subscription);a.closeWindow(c)}function Ma(b,a){for(var c=0,f=a.length;c<f;c++)for(var d=a[c],e=Object.getOwnPropertyNames(d.prototype),h=0,g=e.length;h<g;h++){var u=e[h];b.prototype[u]=d.prototype[u]}}var q="object"==typeof window&&window.window===window&&window||"object"==typeof self&& self.self===self&&self||"object"==typeof global&&global.global===global&&global;if(!q)throw Error("RxJS could not find any global context (window, self, global)");var F=Array.isArray||function(b){return b&&"number"===typeof b.length},m={e:{}},qa,ha=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}__extends(a,b);return a}(Error),w=function(){function b(a){this.closed=!1;a&&(this._unsubscribe=a)}b.prototype.unsubscribe=function(){var a=!1,c;if(!this.closed){this.closed=!0;var b=this._unsubscribe,d=this._subscriptions;this._subscriptions=null;if(v(b)){var e=n(b).call(this);e===m&&(a=!0,(c=c||[]).push(m.e))}if(F(d))for(var b=-1,h=d.length;++b<h;)e=d[b],null!=e&&"object"===typeof e&&(e=n(e.unsubscribe).call(e),e===m&&(a=!0,c=c||[],e=m.e,e instanceof ha?c=c.concat(e.errors): c.push(e)));if(a)throw new ha(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":c.closed||"function"!==typeof c.unsubscribe||(this.closed?c.unsubscribe():(this._subscriptions||(this._subscriptions=[])).push(c));break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}return c};b.prototype.remove=function(a){if(null!=a&&a!==this&&a!==b.EMPTY){var c=this._subscriptions; c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))}};b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),ia={closed:!0,next:function(b){},error:function(b){throw b;},complete:function(){}},ja=q.Symbol,T="function"===typeof ja&&"function"===typeof ja.for?ja.for("rxSubscriber"):"@@rxSubscriber",l=function(b){function a(c,f,d){b.call(this);this.syncErrorValue=null;this.isStopped=this.syncErrorThrowable=this.syncErrorThrown=!1;switch(arguments.length){case 0:this.destination=ia;break;case 1:if(!c){this.destination= ia;break}if("object"===typeof c){c instanceof a?(this.destination=c,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new Na(this,c));break}default:this.syncErrorThrowable=!0,this.destination=new Na(this,c,f,d)}}__extends(a,b);a.prototype[T]=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()};return a}(w),Na=function(b){function a(c,a,d,e){b.call(this);this._parent=c;var f;c=this;v(a)?f=a: a&&(c=a,f=a.next,d=a.error,e=a.complete,v(c.unsubscribe)&&this.add(c.unsubscribe.bind(c)),c.unsubscribe=this.unsubscribe.bind(this));this._context=c;this._next=f;this._error=d;this._complete=e}__extends(a,b);a.prototype.next=function(c){if(!this.isStopped&&this._next){var a=this._parent;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._parent;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(){if(!this.isStopped){var c=this._parent;this._complete&&(c.syncErrorThrowable?this.__tryOrSetError(c,this._complete):this.__tryOrUnsub(this._complete));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(e){return c.syncErrorValue=e,c.syncErrorThrown=!0}return!1};a.prototype._unsubscribe=function(){var c=this._parent;this._parent=this._context=null;c.unsubscribe()};return a}(l),L=function(b){var a=b.Symbol;"function"===typeof a?a.observable?b=a.observable:(b=a("observable"),a.observable=b):b="@@observable";return b}(q),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 f=this.operator;a:{if(a){if(a instanceof l)break a;if(a[T]){a=a[T]();break a}}a=a||c||b?new l(a,c,b):new l(ia)}f?f.call(a,this):a.add(this._subscribe(a));if(a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};b.prototype.forEach=function(a,c){var b=this;c||(q.Rx&&q.Rx.config&&q.Rx.config.Promise?c=q.Rx.config.Promise:q.Promise&&(c=q.Promise));if(!c)throw Error("no Promise impl found"); return new c(function(c,f){var d=b.subscribe(function(c){if(d)try{a(c)}catch(u){f(u),d.unsubscribe()}else a(c)},f,c)})};b.prototype._subscribe=function(a){return this.source.subscribe(a)};b.prototype[L]=function(){return this};b.create=function(a){return new b(a)};return b}(),N=function(b){function a(){var c=b.call(this,"object unsubscribed");this.name=c.name="ObjectUnsubscribedError";this.stack=c.stack;this.message=c.message}__extends(a,b);return a}(Error),Oa=function(b){function a(c,a){b.call(this); this.subject=c;this.subscriber=a;this.closed=!1}__extends(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}(w),Pa=function(b){function a(c){b.call(this,c);this.destination=c}__extends(a,b);return a}(l),x=function(b){function a(){b.call(this);this.observers=[];this.hasError=this.isStopped=this.closed=!1;this.thrownError=null} __extends(a,b);a.prototype[T]=function(){return new Pa(this)};a.prototype.lift=function(c){var a=new ba(this,this);a.operator=c;return a};a.prototype.next=function(c){if(this.closed)throw new N;if(!this.isStopped)for(var a=this.observers,b=a.length,a=a.slice(),e=0;e<b;e++)a[e].next(c)};a.prototype.error=function(c){if(this.closed)throw new N;this.hasError=!0;this.thrownError=c;this.isStopped=!0;for(var a=this.observers,b=a.length,a=a.slice(),e=0;e<b;e++)a[e].error(c);this.observers.length=0};a.prototype.complete= function(){if(this.closed)throw new N;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._subscribe=function(c){if(this.closed)throw new N;if(this.hasError)return c.error(this.thrownError),w.EMPTY;if(this.isStopped)return c.complete(),w.EMPTY;this.observers.push(c);return new Oa(this,c)};a.prototype.asObservable=function(){var c=new g; c.source=this;return c};a.create=function(c,a){return new ba(c,a)};return a}(g),ba=function(b){function a(c,a){b.call(this);this.destination=c;this.source=a}__extends(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): w.EMPTY};return a}(x),O=function(b){function a(){b.apply(this,arguments);this.value=null;this.hasCompleted=this.hasNext=!1}__extends(a,b);a.prototype._subscribe=function(c){return this.hasCompleted&&this.hasNext?(c.next(this.value),c.complete(),w.EMPTY):this.hasError?(c.error(this.thrownError),w.EMPTY):b.prototype._subscribe.call(this,c)};a.prototype.next=function(c){this.hasCompleted||(this.value=c,this.hasNext=!0)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&b.prototype.next.call(this, this.value);b.prototype.complete.call(this)};return a}(x),Pb=function(b){function a(c,a,d,e){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.scheduler=e}__extends(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var f=[],h=0;h<arguments.length;h++)f[h-0]=arguments[h];return new a(c,b,f,d)}};a.prototype._subscribe=function(c){var b=this.callbackFunc,d=this.args,e=this.scheduler,h=this.subject;if(e)return e.schedule(a.dispatch,0,{source:this,subscriber:c}); h||(h=this.subject=new O,e=function u(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=u.source,a=b.selector,b=b.subject;a?(c=n(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())},e.source=this,n(b).apply(this,d.concat(e))===m&&h.error(m.e));return h.subscribe(c)};a.dispatch=function(c){var a=this,b=c.source;c=c.subscriber;var e=b.callbackFunc,h=b.args,g=b.scheduler,u=b.subject;if(!u){var u=b.subject=new O,E=function mb(){for(var c= [],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var f=mb.source,b=f.selector,f=f.subject;b?(c=n(b).apply(this,c),c===m?a.add(g.schedule(R,0,{err:m.e,subject:f})):a.add(g.schedule(D,0,{value:c,subject:f}))):a.add(g.schedule(D,0,{value:1===c.length?c[0]:c,subject:f}))};E.source=b;n(e).apply(this,h.concat(E))===m&&u.error(m.e)}a.add(u.subscribe(c))};return a}(g).create;g.bindCallback=Pb;var Qb=function(b){function a(c,a,d,e){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.scheduler= e}__extends(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var f=[],h=0;h<arguments.length;h++)f[h-0]=arguments[h];return new a(c,b,f,d)}};a.prototype._subscribe=function(c){var a=this.callbackFunc,b=this.args,e=this.scheduler,h=this.subject;if(e)return e.schedule(B,0,{source:this,subscriber:c});h||(h=this.subject=new O,e=function u(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=u.source,a=b.selector,b=b.subject,f=c.shift();f?b.error(f):a?(c=n(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())},e.source=this,n(a).apply(this,b.concat(e))===m&&h.error(m.e));return h.subscribe(c)};return a}(g).create;g.bindNodeCallback=Qb;var ka=function(b){function a(c,a){b.call(this);this.value=c;this.scheduler=a;this._isScalar=!0;a&&(this._isScalar=!1)}__extends(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),J=function(b){function a(c){b.call(this);this.scheduler=c}__extends(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),I=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])}__extends(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];C(b)?c.pop():b=null;var d=c.length;return 1<d?new a(c,b):1===d?new ka(c[0],b):new J(b)};a.dispatch=function(c){var a=c.array,b=c.index,e=c.subscriber;b>=c.count?e.complete():(e.next(a[b]),e.closed||(c.index=b+1,this.schedule(c)))};a.prototype._subscribe= function(c){var b=this.array,d=b.length,e=this.scheduler;if(e)return e.schedule(a.dispatch,0,{array:b,index:0,count:d,subscriber:c});for(e=0;e<d&&!c.closed;e++)c.next(b[e]);c.complete()};return a}(g),r=function(b){function a(){b.apply(this,arguments)}__extends(a,b);a.prototype.notifyNext=function(c,a,b,e,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),G=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 f=a[c];if("entries"!==f&&"size"!==f&&b.prototype[f]===b.prototype.entries)return f}return"@@iterator"}(q),ra=function(b){function a(c,a,d){b.call(this);this.parent=c;this.outerValue=a;this.outerIndex=d;this.index=0}__extends(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),Qa={},la=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c._subscribe(new Rb(a,this.project))};return b}(),Rb=function(b){function a(c,a){b.call(this,c);this.project=a;this.active=0;this.values=[];this.observables= []}__extends(a,b);a.prototype._next=function(c){this.values.push(Qa);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 e=c[b];this.add(p(this,e,e,b))}}};a.prototype.notifyComplete=function(c){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(c,a,b,e,h){c=this.values;e=c[b];e=this.toRespond?e===Qa?--this.toRespond:this.toRespond:0; c[b]=a;0===e&&(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}(r);g.combineLatest=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=a=null;C(b[b.length-1])&&(c=b.pop());"function"===typeof b[b.length-1]&&(a=b.pop());1===b.length&&F(b[0])&&(b=b[0]);return(new I(b,c)).lift(new la(a))};var Z=function(){function b(a){this.concurrent= a}b.prototype.call=function(a,c){return c._subscribe(new Sb(a,this.concurrent))};return b}(),Sb=function(b){function a(c,a){b.call(this,c);this.concurrent=a;this.hasCompleted=!1;this.buffer=[];this.active=0}__extends(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}(r);g.concat=S;var Ub=function(b){function a(c){b.call(this);this.observableFactory=c}__extends(a,b);a.create=function(c){return new a(c)};a.prototype._subscribe=function(c){return new Tb(c,this.observableFactory)};return a}(g),Tb=function(b){function a(c,a){b.call(this,c);this.factory=a;this.tryDefer()}__extends(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}(r);g.defer=Ub.create;g.empty=J.create;var Wb=function(b){function a(c,a){b.call(this);this.sources=c;this.resultSelector=a}__extends(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 J;b=null;"function"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&F(c[0])&&(c=c[0]);return 0===c.length?new J:new a(c,b)};a.prototype._subscribe= function(c){return new Vb(c,this.sources,this.resultSelector)};return a}(g),Vb=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 f=p(this,a[d],null,d);f&&(f.outerIndex=d,this.add(f))}}__extends(a,b);a.prototype.notifyNext=function(c,a,b,e,h){this.values[b]=a;h._hasValue||(h._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(c){var a=this.destination,b= this.haveValues,e=this.resultSelector,h=this.values,g=h.length;c._hasValue?(this.completed++,this.completed===g&&(b===g&&(c=e?e.apply(this,h):h,a.next(c)),a.complete())):a.complete()};return a}(r);g.forkJoin=Wb.create;var Ra=function(b){function a(c,a){b.call(this);this.promise=c;this.scheduler=a}__extends(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this,b=this.promise,e=this.scheduler;if(null==e)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){q.setTimeout(function(){throw c;})});else if(this._isScalar){if(!c.closed)return e.schedule(sa,0,{value:this.value,subscriber:c})}else b.then(function(b){a.value=b;a._isScalar=!0;c.closed||c.add(e.schedule(sa,0,{value:b,subscriber:c}))},function(a){c.closed||c.add(e.schedule(nb,0,{err:a,subscriber:c}))}).then(null,function(c){q.setTimeout(function(){throw c;})})}; return a}(g),Zb=function(b){function a(c,a){b.call(this);this.scheduler=a;if(null==c)throw Error("iterator cannot be null.");if((a=c[G])||"string"!==typeof c)if(a||void 0===c.length){if(!a)throw new TypeError("object is not iterable");c=c[G]()}else c=new Xb(c);else c=new Yb(c);this.iterator=c}__extends(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.index,b=c.iterator,e=c.subscriber;if(c.hasError)e.error(c.error);else{var h=b.next();h.done?e.complete():(e.next(h.value), c.index=a+1,e.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),Yb=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[G]=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}(),Xb=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&&q.isFinite(b)){var f;f=+b;f=0===f?f:isNaN(f)?f:0>f?-1:1;b=f*Math.floor(Math.abs(b));b=0>=b?0:b>Sa?Sa:b}this.arr=a;this.idx=c;this.len=b}b.prototype[G]=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}(),Sa=Math.pow(2,53)-1,$b=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])}__extends(a,b);a.create=function(c,b){var f=c.length;return 0===f?new J:1===f?new ka(c[0],b):new a(c,b)};a.dispatch=function(c){var a=c.arrayLike,b=c.index,e=c.subscriber;e.closed||(b>=c.length?e.complete():(e.next(a[b]),c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.arrayLike,d=this.scheduler, e=b.length;if(d)return d.schedule(a.dispatch,0,{arrayLike:b,index:0,length:e,subscriber:c});for(d=0;d<e&&!c.closed;d++)c.next(b[d]);c.complete()};return a}(g),y=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):this.undefinedValueNotification};b.createError=function(a){return new b("E", void 0,a)};b.createComplete=function(){return this.completeNotification};b.completeNotification=new b("C");b.undefinedValueNotification=new b("N",void 0);return b}(),ac=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 ma(a,this.scheduler,this.delay))};return b}(),ma=function(b){function a(c,a,d){void 0===d&&(d=0);b.call(this,c);this.scheduler=a;this.delay=d}__extends(a,b);a.dispatch=function(c){c.notification.observe(c.destination)}; a.prototype.scheduleMessage=function(c){this.add(this.scheduler.schedule(a.dispatch,this.delay,new bc(c,this.destination)))};a.prototype._next=function(c){this.scheduleMessage(y.createNext(c))};a.prototype._error=function(c){this.scheduleMessage(y.createError(c))};a.prototype._complete=function(){this.scheduleMessage(y.createComplete())};return a}(l),bc=function(){return function(b,a){this.notification=b;this.destination=a}}(),Ta=function(b){function a(c,a){b.call(this,null);this.ish=c;this.scheduler= a}__extends(a,b);a.create=function(c,b){if(null!=c){if("function"===typeof c[L])return c instanceof g&&!b?c:new a(c,b);if(F(c))return new I(c,b);if(pa(c))return new Ra(c,b);if("function"===typeof c[G]||"string"===typeof c)return new Zb(c,b);if(c&&"number"===typeof c.length)return new $b(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[L]().subscribe(c):a[L]().subscribe(new ma(c,b,0))};return a}(g); g.from=Ta.create;var cc=function(b){function a(c,a,d,e){b.call(this);this.sourceObj=c;this.eventName=a;this.selector=d;this.options=e}__extends(a,b);a.create=function(c,b,d,e){v(d)&&(e=d,d=void 0);return new a(c,b,e,d)};a.setupSubscription=function(c,b,d,e,h){var f;if(c&&"[object NodeList]"===c.toString()||c&&"[object HTMLCollection]"===c.toString())for(var g=0,k=c.length;g<k;g++)a.setupSubscription(c[g],b,d,e,h);else if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(b, d,h),f=function(){return c.removeEventListener(b,d)};else if(c&&"function"===typeof c.on&&"function"===typeof c.off)c.on(b,d),f=function(){return c.off(b,d)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(b,d),f=function(){return c.removeListener(b,d)};else throw new TypeError("Invalid event target");e.add(new w(f))};a.prototype._subscribe=function(c){var b=this.selector;a.setupSubscription(this.sourceObj,this.eventName,b?function(){for(var a=[],f= 0;f<arguments.length;f++)a[f-0]=arguments[f];a=n(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=cc;var dc=function(b){function a(c,a,d){b.call(this);this.addHandler=c;this.removeHandler=a;this.selector=d}__extends(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,e=this.selector?function(){for(var b=[],f=0;f<arguments.length;f++)b[f-0]=arguments[f];a._callSelector(c, b)}:function(a){c.next(a)};this._callAddHandler(e,c);c.add(new w(function(){b(e)}))};a.prototype._callSelector=function(c,a){try{var b=this.selector.apply(this,a);c.next(b)}catch(e){c.error(e)}};a.prototype._callAddHandler=function(c,a){try{this.addHandler(c)}catch(d){a.error(d)}};return a}(g).create;g.fromEventPattern=dc;g.fromPromise=Ra.create;var Ua=function(b){return b},ec=function(b){function a(c,a,d,e,h){b.call(this);this.initialState=c;this.condition=a;this.iterate=d;this.resultSelector=e; this.scheduler=h}__extends(a,b);a.create=function(c,b,d,e,h){return 1==arguments.length?new a(c.initialState,c.condition,c.iterate,c.resultSelector||Ua,c.scheduler):void 0===e||C(e)?new a(c,b,d,Ua,e):new a(c,b,d,e,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,e=this.resultSelector,h=this.iterate; do{if(d){var g=void 0;try{g=d(b)}catch(u){c.error(u);break}if(!g){c.complete();break}}g=void 0;try{g=e(b)}catch(u){c.error(u);break}c.next(g);if(c.closed)break;try{b=h(b)}catch(u){c.error(u);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(A){a.error(A);return}else c.needIterate=!0;if(b){var e=void 0;try{e=b(c.state)}catch(A){a.error(A);return}if(!e){a.complete();return}if(a.closed)return}var h;try{h=c.resultSelector(c.state)}catch(A){a.error(A); return}if(!a.closed&&(a.next(h),!a.closed))return this.schedule(c)}};return a}(g);g.generate=ec.create;var gc=function(b){function a(c,a,d){b.call(this);this.condition=c;this.thenSource=a;this.elseSource=d}__extends(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=function(c){return new fc(c,this.condition,this.thenSource,this.elseSource)};return a}(g),fc=function(b){function a(c,a,d,e){b.call(this,c);this.condition=a;this.thenSource=d;this.elseSource=e;this.tryIf()}__extends(a, b);a.prototype.tryIf=function(){var c=this.condition,a=this.thenSource,b=this.elseSource,e;try{(c=(e=c())?a:b)?this.add(p(this,c)):this._complete()}catch(h){this._error(h)}};return a}(r);g.if=gc.create;var U=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a;this.pending=!1}__extends(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 q.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?a:(q.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(e){a=!0,b=!!e&&e||Error(e)}if(a)return this.unsubscribe(),b};a.prototype._unsubscribe=function(){var c=this.id,a=this.scheduler,b=a.actions,e=b.indexOf(this);this.state=this.delay=this.work=null;this.pending=!1;this.scheduler=null;-1!==e&&b.splice(e,1);null!=c&&(this.id=this.recycleAsyncId(a,c,null))};return a}(function(b){function a(c,a){b.call(this)}__extends(a,b);a.prototype.schedule=function(c,a){return this}; return a}(w)),V=function(b){function a(){b.apply(this,arguments);this.actions=[];this.active=!1;this.scheduled=void 0}__extends(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}()),z=new V(U),hc=function(b){function a(c,a){void 0===c&&(c=0);void 0===a&&(a=z);b.call(this);this.period=c;this.scheduler=a;if(!fa(c)||0>c)this.period=0;a&&"function"===typeof a.schedule||(this.scheduler=z)}__extends(a,b);a.create=function(c,b){void 0===c&&(c=0);void 0===b&&(b=z);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=hc;g.merge=ta;var ob=function(){function b(){}b.prototype.call=function(a,c){return c._subscribe(new ic(a))};return b}(),ic=function(b){function a(c){b.call(this,c);this.hasFirst=!1;this.observables=[];this.subscriptions=[]}__extends(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;b++){var e=c[b],e=p(this,e,e,b);this.subscriptions&&(this.subscriptions.push(e),this.add(e))}this.observables=null}};a.prototype.notifyNext=function(c,a,b,e,h){if(!this.hasFirst){this.hasFirst=!0;for(c=0;c<this.subscriptions.length;c++)c!==b&&(e=this.subscriptions[c],e.unsubscribe(),this.remove(e));this.subscriptions=null}this.destination.next(a)};return a}(r);g.race=ua;var jc=function(b){function a(){b.call(this)} __extends(a,b);a.create=function(){return new a};a.prototype._subscribe=function(c){};return a}(g).create;g.never=jc;g.of=I.of;var Va=function(){function b(a){this.nextSources=a}b.prototype.call=function(a,c){return c._subscribe(new kc(a,this.nextSources))};return b}(),kc=function(b){function a(c,a){b.call(this,c);this.destination=c;this.nextSources=a}__extends(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}(r);g.onErrorResumeNext=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&F(b[0])&&(b=b[0]);a=b.shift();return(new Ta(a,null)).lift(new Va(b))};var lc=function(b){function a(c,a){b.call(this);this.obj=c;this.scheduler= a;this.keys=Object.keys(c)}__extends(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.keys,b=this.scheduler,e=a.length;if(b)return b.schedule(pb,0,{obj:this.obj,keys:a,length:e,index:0,subscriber:c});for(b=0;b<e;b++){var h=a[b];c.next([h,this.obj[h]])}c.complete()};return a}(g).create;g.pairs=lc;var mc=function(b){function a(c,a,d){b.call(this);this.start=c;this._count=a;this.scheduler=d}__extends(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,e=c.subscriber;b>=c.count?e.complete():(e.next(a),e.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=0,d=this.start,e=this._count,h=this.scheduler;if(h)return h.schedule(a.dispatch,0,{index:b,count:e,start:d,subscriber:c});do{if(b++>=e){c.complete();break}c.next(d++);if(c.closed)break}while(1)};return a}(g).create;g.range=mc;var oc=function(b){function a(c,a){b.call(this);this.resourceFactory= c;this.observableFactory=a}__extends(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.resourceFactory,b=this.observableFactory,e;try{return e=a(),new nc(c,e,b)}catch(h){c.error(h)}};return a}(g),nc=function(b){function a(c,a,d){b.call(this,c);this.resource=a;this.observableFactory=d;c.add(a);this.tryUse()}__extends(a,b);a.prototype.tryUse=function(){try{var c=this.observableFactory.call(this,this.resource);c&&this.add(p(this,c))}catch(f){this._error(f)}}; return a}(r);g.using=oc.create;var pc=function(b){function a(c,a){b.call(this);this.error=c;this.scheduler=a}__extends(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;if(d)return d.schedule(a.dispatch,0,{error:b,subscriber:c});c.error(b)};return a}(g).create;g.throw=pc;var qc=function(b){function a(c,a,d){void 0===c&&(c=0);b.call(this);this.period=-1;this.dueTime=0;fa(a)?this.period= 1>Number(a)&&1||Number(a):C(a)&&(d=a);C(d)||(d=z);this.scheduler=d;this.dueTime=aa(c)?+c-this.scheduler.now():c}__extends(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,e=c.subscriber;e.next(a);if(!e.closed){if(-1===b)return e.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= qc;var wa=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c._subscribe(new rc(a,this.project))};return b}(),rc=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}__extends(a,b);a.prototype._next=function(c){var a=this.iterators;F(c)?a.push(new sc(c)):"function"===typeof c[G]?a.push(new tc(c[G]())):a.push(new uc(this.destination,this,c))};a.prototype._complete= function(){var c=this.iterators,a=c.length;this.active=a;for(var b=0;b<a;b++){var e=c[b];e.stillUnsubscribed?this.add(e.subscribe(e,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,e=0;e<a;e++){var h=c[e];if("function"===typeof h.hasValue&&!h.hasValue())return}for(var g=!1,u=[],e=0;e<a;e++){var h=c[e],k=h.next();h.hasCompleted()&&(g=!0); if(k.done){b.complete();return}u.push(k.value)}this.project?this._tryProject(u):b.next(u);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),tc=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}(),sc=function(){function b(a){this.array=a;this.length=this.index=0;this.length=a.length}b.prototype[G]=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}(),uc=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}__extends(a,b);a.prototype[G]=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,e,h){this.buffer.push(a);this.parent.checkIterators()};a.prototype.subscribe=function(c,a){return p(this,this.observable,this,a)};return a}(r);g.zip=va;var ya=function(){function b(a,c){this.project=a;this.thisArg=c}b.prototype.call=function(a,c){return c._subscribe(new vc(a,this.project,this.thisArg))};return b}(),vc=function(b){function a(c,a,d){b.call(this,c);this.project=a;this.count=0;this.thisArg= d||this}__extends(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),P=function(b){function a(c){b.call(this);var a={async:!0,createXHR:function(){var c;if(this.crossDomain)if(q.XMLHttpRequest)c=new q.XMLHttpRequest,"withCredentials"in c&&(c.withCredentials=!!this.withCredentials);else if(q.XDomainRequest)c=new q.XDomainRequest;else throw Error("CORS is not supported by your browser"); else if(q.XMLHttpRequest)c=new q.XMLHttpRequest;else{var a=void 0;try{for(var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],f=0;3>f;f++)try{a=b[f];new q.ActiveXObject(a);break}catch(E){}c=new q.ActiveXObject(a)}catch(E){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}__extends(a, b);a.prototype._subscribe=function(c){return new wc(c,this.request)};a.create=function(){var c=function(c){return new a(c)};c.get=qb;c.post=rb;c.delete=sb;c.put=tb;c.getJSON=ub;return c}();return a}(g),wc=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||q.FormData&&a.body instanceof q.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()}__extends(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,e=a.method,h=a.url,g=a.async,u=a.password,k=a.headers,a=a.body,l=n(c.createXHR).call(c);if(l===m)this.error(m.e);else{this.xhr=l;if((b?n(l.open).call(l,e,h,g,b,u):n(l.open).call(l,e,h,g))===m)return this.error(m.e),null;l.timeout=c.timeout; l.responseType=c.responseType;this.setHeaders(l,k);this.setupEvents(l,c);a?l.send(a):l.send()}return l};a.prototype.serializeBody=function(c,a){if(!c||"string"===typeof c||q.FormData&&c instanceof q.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,f=b.progressSubscriber,d=b.request;f&&f.error(c);a.error(new Xa(this,d))}function f(c){var a=f.subscriber,b=f.progressSubscriber,d=f.request;if(4===this.readyState){var e=1223===this.status?204:this.status,h="text"===this.responseType?this.response||this.responseText:this.response;0===e&&(e=h?200:0);200<=e&&300>e?(b&&b.complete(),a.next(c),a.complete()): (b&&b.error(c),a.error(new ca("ajax error "+e,this,d)))}}var h=a.progressSubscriber;c.ontimeout=b;b.request=a;b.subscriber=this;b.progressSubscriber=h;if(c.upload&&"withCredentials"in c&&q.XDomainRequest){if(h){var g;g=function(c){g.progressSubscriber.next(c)};c.onprogress=g;g.progressSubscriber=h}var u;u=function(c){var a=u.progressSubscriber,b=u.subscriber,f=u.request;a&&a.error(c);b.error(new ca("ajax error",this,f))};c.onerror=u;u.request=a;u.subscriber=this;u.progressSubscriber=h}c.onreadystatechange= f;f.subscriber=this;f.progressSubscriber=h;f.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}}}(),ca=function(b){function a(c,a,d){b.call(this,c);this.message=c;this.xhr=a;this.request=d;this.status=a.status}__extends(a,b);return a}(Error),Xa=function(b){function a(c,a){b.call(this,"ajax timeout",c,a)}__extends(a,b);return a}(ca);g.ajax=P.create;var xc=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a}__extends(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}(U),Ya=new (function(b){function a(){b.apply(this, arguments)}__extends(a,b);return a}(V))(xc),Q=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}__extends(a,b);a.prototype.next=function(c){var a=this._getNow();this._events.push(new yc(a,c));this._trimBufferThenGetEvents();b.prototype.next.call(this,c)};a.prototype._subscribe=function(c){var a=this._trimBufferThenGetEvents(),b=this.scheduler, e;if(thi