UNPKG

@acutmore/rxjs

Version:

Reactive Extensions for modern JavaScript

114 lines (112 loc) 157 kB
/* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. *****************************************************************************/ var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(k,g,u){if(u.get||u.set)throw new TypeError("ES3 does not support getters and setters.");k!=Array.prototype&&k!=Object.prototype&&(k[g]=u.value)};$jscomp.getGlobal=function(k){return"undefined"!=typeof window&&window===k?k:"undefined"!=typeof global&&null!=global?global:k};$jscomp.global=$jscomp.getGlobal(this); $jscomp.polyfill=function(k,g,u,n){if(g){u=$jscomp.global;k=k.split(".");for(n=0;n<k.length-1;n++){var q=k[n];q in u||(u[q]={});u=u[q]}k=k[k.length-1];n=u[k];g=g(n);g!=n&&null!=g&&$jscomp.defineProperty(u,k,{configurable:!0,writable:!0,value:g})}};$jscomp.polyfill("Object.setPrototypeOf",function(k){return k?k:"object"!=typeof"".__proto__?null:function(g,k){g.__proto__=k;if(g.__proto__!==k)throw new TypeError(g+" is not extensible");return g}},"es6","es5");$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(k){return $jscomp.SYMBOL_PREFIX+(k||"")+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var k=$jscomp.global.Symbol.iterator;k||(k=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[k]&&$jscomp.defineProperty(Array.prototype,k,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(k){var g=0;return $jscomp.iteratorPrototype(function(){return g<k.length?{done:!1,value:k[g++]}:{done:!0}})}; $jscomp.iteratorPrototype=function(k){$jscomp.initSymbolIterator();k={next:k};k[$jscomp.global.Symbol.iterator]=function(){return this};return k};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(k,g){$jscomp.initSymbolIterator();k instanceof String&&(k+="");var u=0,n={next:function(){if(u<k.length){var q=u++;return{value:g(q,k[q]),done:!1}}n.next=function(){return{done:!0,value:void 0}};return n.next()}};n[Symbol.iterator]=function(){return n};return n}; $jscomp.polyfill("Array.prototype.values",function(k){return k?k:function(){return $jscomp.iteratorFromArray(this,function(g,k){return k})}},"es6","es3");$jscomp.polyfill("Array.prototype.keys",function(k){return k?k:function(){return $jscomp.iteratorFromArray(this,function(g){return g})}},"es6-impl","es3");$jscomp.makeIterator=function(k){$jscomp.initSymbolIterator();var g=k[Symbol.iterator];return g?g.call(k):$jscomp.arrayIterator(k)};$jscomp.EXPOSE_ASYNC_EXECUTOR=!0; $jscomp.FORCE_POLYFILL_PROMISE=!1; $jscomp.polyfill("Promise",function(k){function g(){this.batch_=null}if(k&&!$jscomp.FORCE_POLYFILL_PROMISE)return k;g.prototype.asyncExecute=function(g){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(g);return this};g.prototype.asyncExecuteBatch_=function(){var g=this;this.asyncExecuteFunction(function(){g.executeBatch_()})};var u=$jscomp.global.setTimeout;g.prototype.asyncExecuteFunction=function(g){u(g,0)};g.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var g= this.batch_;this.batch_=[];for(var k=0;k<g.length;++k){var n=g[k];delete g[k];try{n()}catch(R){this.asyncThrow_(R)}}}this.batch_=null};g.prototype.asyncThrow_=function(g){this.asyncExecuteFunction(function(){throw g;})};var n=function(g){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var k=this.createResolveAndReject_();try{g(k.resolve,k.reject)}catch(E){k.reject(E)}};n.prototype.createResolveAndReject_=function(){function g(g){return function(H){n||(n=!0,g.call(k,H))}}var k=this,n= !1;return{resolve:g(this.resolveTo_),reject:g(this.reject_)}};n.prototype.resolveTo_=function(g){if(g===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof n)this.settleSameAsPromise_(g);else{var k;a:switch(typeof g){case "object":k=null!=g;break a;case "function":k=!0;break a;default:k=!1}k?this.resolveToNonPromiseObj_(g):this.fulfill_(g)}};n.prototype.resolveToNonPromiseObj_=function(g){var k=void 0;try{k=g.then}catch(E){this.reject_(E);return}"function"== typeof k?this.settleSameAsThenable_(k,g):this.fulfill_(g)};n.prototype.reject_=function(g){this.settle_(2,g)};n.prototype.fulfill_=function(g){this.settle_(1,g)};n.prototype.settle_=function(g,k){if(0!=this.state_)throw Error("Cannot settle("+g+", "+k|"): Promise already settled in state"+this.state_);this.state_=g;this.result_=k;this.executeOnSettledCallbacks_()};n.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var g=this.onSettledCallbacks_,k=0;k<g.length;++k)g[k].call(), g[k]=null;this.onSettledCallbacks_=null}};var q=new g;n.prototype.settleSameAsPromise_=function(g){var k=this.createResolveAndReject_();g.callWhenSettled_(k.resolve,k.reject)};n.prototype.settleSameAsThenable_=function(g,k){var n=this.createResolveAndReject_();try{g.call(k,n.resolve,n.reject)}catch(R){n.reject(R)}};n.prototype.then=function(g,k){function q(g,k){return"function"==typeof g?function(k){try{u(g(k))}catch(B){z(B)}}:k}var u,z,H=new n(function(g,k){u=g;z=k});this.callWhenSettled_(q(g,u), q(k,z));return H};n.prototype.catch=function(g){return this.then(void 0,g)};n.prototype.callWhenSettled_=function(g,k){function n(){switch(u.state_){case 1:g(u.result_);break;case 2:k(u.result_);break;default:throw Error("Unexpected state: "+u.state_);}}var u=this;null==this.onSettledCallbacks_?q.asyncExecute(n):this.onSettledCallbacks_.push(function(){q.asyncExecute(n)})};n.resolve=function(g){return g instanceof n?g:new n(function(k,n){k(g)})};n.reject=function(g){return new n(function(k,n){n(g)})}; n.race=function(g){return new n(function(k,q){for(var u=$jscomp.makeIterator(g),z=u.next();!z.done;z=u.next())n.resolve(z.value).callWhenSettled_(k,q)})};n.all=function(g){var k=$jscomp.makeIterator(g),q=k.next();return q.done?n.resolve([]):new n(function(g,u){function z(k){return function(n){E[k]=n;H--;0==H&&g(E)}}var E=[],H=0;do E.push(void 0),H++,n.resolve(q.value).callWhenSettled_(z(E.length-1),u),q=k.next();while(!q.done)})};$jscomp.EXPOSE_ASYNC_EXECUTOR&&(n.$jscomp$new$AsyncExecutor=function(){return new g}); return n},"es6-impl","es3"); (function(k,g){"object"===typeof exports&&"undefined"!==typeof module?g(exports):"function"===typeof define&&define.amd?define(["exports"],g):g(k.Rx=k.Rx||{})})(this,function(k){function g(c,a){function b(){this.constructor=c}Gd(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function u(c){return"function"===typeof c}function n(){try{return Ra.apply(this,arguments)}catch(c){return p.e=c,p}}function q(c){Ra=c;return n}function H(c){return c.reduce(function(a,b){return a.concat(b instanceof W?b.errors:b)},[])}function z(){}function E(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return R(c)}function R(c){return c?1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}:z}function Pa(c){var a=c.subject;a.next(c.value);a.complete()}function Fd(c){c.subject.error(c.err)}function Ed(c){var a=this,b=c.source,d=c.subscriber;c=c.context;var e=b.callbackFunc,f=b.args,l=b.scheduler,g=b.subject;if(!g){var g=b.subject=new S,h=function ua(){for(var b=[],c=0;c<arguments.length;c++)b[c]= arguments[c];var d=ua.source,c=d.selector,d=d.subject,e=b.shift();e?a.add(l.schedule(ta,0,{err:e,subject:d})):c?(b=q(c).apply(this,b),b===p?a.add(l.schedule(ta,0,{err:p.e,subject:d})):a.add(l.schedule(Qa,0,{value:b,subject:d}))):a.add(l.schedule(Qa,0,{value:1>=b.length?b[0]:b,subject:d}))};h.source=b;q(e).apply(c,f.concat(h))===p&&a.add(l.schedule(ta,0,{err:p.e,subject:g}))}a.add(g.subscribe(d))}function Qa(c){var a=c.subject;a.next(c.value);a.complete()}function ta(c){c.subject.error(c.err)}function B(c){return c&& "function"===typeof c.schedule}function Sa(c){return c&&"function"!==typeof c.subscribe&&"function"===typeof c.then}function r(c,a,b,d){var e=new Ta(c,b,d);if(e.closed)return null;if(a instanceof h)if(a._isScalar)e.next(a.value),e.complete();else return a.subscribe(e);else if(a&&"number"===typeof a.length){c=0;for(b=a.length;c<b&&!e.closed;c++)e.next(a[c]);e.closed||e.complete()}else{if(Sa(a))return a.then(function(b){e.closed||(e.next(b),e.complete())},function(b){return e.error(b)}).then(null,function(b){t.setTimeout(function(){throw b; })}),e;if(a&&"function"===typeof a[D]){a=a[D]();do{c=a.next();if(c.done){e.complete();break}e.next(c.value);if(e.closed)break}while(1)}else if(a&&"function"===typeof a[M])if(a=a[M](),"function"!==typeof a.subscribe)e.error(new TypeError("Provided object does not correctly implement Symbol.observable"));else return a.subscribe(new Ta(c,b,d));else e.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 Ua(c){var a=c.value;c=c.subscriber;c.closed||(c.next(a),c.complete())}function Va(c){var a=c.err;c=c.subscriber;c.closed||c.error(a)}function Wa(c,a){void 0===a&&(a=0);return function(b){return b.lift(new Id(c,a))}}function X(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);return function(d){"number"===typeof a&&(b=a,a=null);return d.lift(new Jd(c,a,b))}}function Xa(c){return c}function ga(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return X(Xa,null,c)}function va(){return ga(1)}function Y(){for(var c= [],a=0;a<arguments.length;a++)c[a]=arguments[a];return 1===c.length||2===c.length&&B(c[1])?wa(c[0]):va()(ha.apply(void 0,c))}function N(c){return!G(c)&&0<=c-parseFloat(c)+1}function Ya(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var a=Number.POSITIVE_INFINITY,b=null,d=c[c.length-1];B(d)?(b=c.pop(),1<c.length&&"number"===typeof c[c.length-1]&&(a=c.pop())):"number"===typeof d&&(a=c.pop());return null===b&&1===c.length&&c[0]instanceof h?c[0]:ga(a)(new J(c,b))}function xa(){for(var c= [],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(G(c[0]))c=c[0];else return c[0];return(new J(c)).lift(new Kd)}function Ld(c){var a=c.obj,b=c.keys,d=c.index,e=c.subscriber;d===c.length?e.complete():(b=b[d],e.next([b,a[b]]),c.index=d+1,this.schedule(c))}function ia(c){return c instanceof Date&&!isNaN(+c)}function Za(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];"function"===typeof a&&c.pop();return(new J(c)).lift(new $a(a))}function Z(c,a){return function(b){if("function"!== typeof c)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return b.lift(new Md(c,a))}}function Nd(c,a){void 0===a&&(a=null);return new O({method:"GET",url:c,headers:a})}function Od(c,a,b){return new O({method:"POST",url:c,body:a,headers:b})}function Pd(c,a){return new O({method:"DELETE",url:c,headers:a})}function Qd(c,a,b){return new O({method:"PUT",url:c,body:a,headers:b})}function Rd(c,a,b){return new O({method:"PATCH",url:c,body:a,headers:b})}function Sd(c,a){return Td(new O({method:"GET", url:c,responseType:"json",headers:a}))}function ab(c,a){switch(c){case "json":return"response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null");case "xml":return a.responseXML;default:return"response"in a?a.response:a.responseText}}function Ud(c){for(var a=[],b=1;b<arguments.length;b++)a[b-1]=arguments[b];for(var b=a.length,d=0;d<b;d++){var e=a[d],f;for(f in e)e.hasOwnProperty(f)&&(c[f]=e[f])}return c}function bb(c){return function(a){return a.lift(new Vd(c))}} function cb(c,a){void 0===a&&(a=null);return function(b){return b.lift(new Wd(c,a))}}function db(c,a){void 0===a&&(a=null);return cb(c,a)(this)}function eb(c){var a=arguments.length,b=x;B(arguments[arguments.length-1])&&(b=arguments[arguments.length-1],a--);var d=null;2<=a&&(d=arguments[1]);var e=Number.POSITIVE_INFINITY;3<=a&&(e=arguments[2]);return function(a){return a.lift(new Xd(c,d,e,b))}}function fb(c){var a=c.subscriber,b=c.context;b&&a.closeContext(b);a.closed||(c.context=a.openContext(), c.context.closeAction=this.schedule(c,c.bufferTimeSpan))}function Yd(c){var a=c.bufferCreationInterval,b=c.bufferTimeSpan,d=c.subscriber,e=c.scheduler,f=d.openContext();d.closed||(d.add(f.closeAction=e.schedule(gb,b,{subscriber:d,context:f})),this.schedule(c,a))}function gb(c){c.subscriber.closeContext(c.context)}function hb(c){var a=arguments.length,b=x;B(arguments[arguments.length-1])&&(b=arguments[arguments.length-1],a--);var d=null;2<=a&&(d=arguments[1]);var e=Number.POSITIVE_INFINITY;3<=a&&(e= arguments[2]);return eb(c,d,e,b)(this)}function ib(c,a){return function(b){return b.lift(new Zd(c,a))}}function jb(c){return function(a){return a.lift(new $d(c))}}function kb(c){return function(a){var b=new ae(c);a=a.lift(b);return b.caught=a}}function lb(c){return kb(c)(this)}function mb(c){return function(a){return a.lift(new ya(c))}}function za(c,a){return X(c,a,1)}function nb(c,a){return za(function(){return c},a)}function ob(c){return function(a){return a.lift(new be(c,a))}}function pb(){return function(c){return c.lift(new ce)}} function qb(c){return function(a){return a.lift(new de(c))}}function rb(c,a){void 0===a&&(a=x);return function(b){return b.lift(new ee(c,a))}}function fe(c){c.debouncedNext()}function sb(c,a){void 0===a&&(a=x);return rb(c,a)(this)}function Aa(c){void 0===c&&(c=null);return function(a){return a.lift(new ge(c))}}function tb(c,a){void 0===a&&(a=x);var b=ia(c)?+c-a.now():Math.abs(c);return function(c){return c.lift(new he(b,a))}}function ub(c,a){return a?function(b){return(new ie(b,a)).lift(new vb(c))}: function(b){return b.lift(new vb(c))}}function Ba(c,a){return function(b){return b.lift(new je(c,a))}}function wb(c,a){return Ba(function(b,d){return a?a(b[c],d[c]):b[c]===d[c]})}function xb(c,a,b){return function(d){return d.lift(new ke(c,a,b))}}function Ca(c,a,b){return xb(c,a,b)(this)}function yb(){return function(c){return c.lift(new le)}}function zb(){return yb()(this)}function Ab(c,a){return function(b){return b.lift(new me(c,a))}}function Bb(c,a){return Ab(c,a)(this)}function Cb(c,a,b){void 0=== a&&(a=Number.POSITIVE_INFINITY);void 0===b&&(b=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return function(d){return d.lift(new ne(c,a,b))}}function Db(c,a){return function(b){return b.lift(new oe(c,a))}}function ja(c,a){return function(b){return b.lift(new pe(c,a))}}function Eb(c){return function(a){return a.lift(new qe(c))}}function Fb(c){return Eb(c)(this)}function Gb(c,a){if("function"!==typeof c)throw new TypeError("predicate is not a function");return function(b){return b.lift(new Hb(c,b, !1,a))}}function Ib(c,a){return function(b){return b.lift(new Hb(c,b,!0,a))}}function Jb(c,a,b){return function(d){return d.lift(new re(c,a,b,d))}}function Kb(){return function(c){return c.lift(new se)}}function Lb(){return function(c){return c.lift(new te)}}function Da(c){return function(a){return a.lift(new ue(c))}}function Mb(c,a){void 0===a&&(a=x);return Da(function(){return Nb(c,a)})}function Ob(c,a,b){return function(d){return d.lift(new ve(c,a,b,d))}}function Pb(c){return c(this)}function Qb(c, a){return function(b){return b.lift(new we(c,a,b))}}function Rb(c){return function(a){return a.lift(new xe(c))}}function Sb(){return function(c){return c.lift(new ye)}}function aa(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(d){return d.lift(new ze(c,a,b))}}function ka(c){return function(a){return 0===c?new I:a.lift(new Ae(c))}}function T(c,a){return 2<=arguments.length?function(b){return E(aa(c,a),ka(1),Aa(a))(b)}:function(b){return E(aa(function(b,a,f){return c(b,a,f+1)}),ka(1))(b)}} function Tb(c){return T("function"===typeof c?function(a,b){return 0<c(a,b)?a:b}:function(a,b){return a>b?a:b})}function Ub(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);return X(c,a,b)(this)}function Vb(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);"number"===typeof a&&(b=a,a=null);return function(d){return d.lift(new Be(c,a,b))}}function Wb(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);return Vb(c,a,b)(this)}function Xb(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);return function(d){return d.lift(new Ce(c, a,b))}}function Yb(c){return T("function"===typeof c?function(a,b){return 0>c(a,b)?a:b}:function(a,b){return a<b?a:b})}function Ea(){return function(c){return c.lift(new De(c))}}function K(c,a){return function(b){var d;d="function"===typeof c?c:function(){return c};if("function"===typeof a)return b.lift(new Ee(d,a));var e=Object.create(b,Fe);e.source=b;e.subjectFactory=d;return e}}function Zb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];1===c.length&&G(c[0])&&(c=c[0]);return function(b){return b.lift(new Ge(c))}} function $b(){return function(c){return c.lift(new He)}}function Ie(c,a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function ac(c,a){return function(b){return[ja(c,a)(b),ja(Ie(c,a))(b)]}}function bc(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=c.length;if(0===b)throw Error("list of properties cannot be empty.");return function(a){return Z(Je(c,b))(a)}}function Je(c,a){return function(b){var d=b;for(b=0;b<a;b++)if(d=d[c[b]],"undefined"=== typeof d)return;return d}}function cc(c){return c?K(function(){return new A},c):K(new A)}function dc(c){return function(a){return K(new ec(c))(a)}}function fc(c,a,b,d){b&&"function"!==typeof b&&(d=b);var e="function"===typeof b?b:void 0,f=new P(c,a,d);return function(b){return K(function(){return f},e)(b)}}function gc(){return function(c){return K(new S)(c)}}function hc(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(b){1===c.length&&G(c[0])&&(c=c[0]);return b.lift.call(xa.apply(void 0, [b].concat(c)))}}function ic(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return hc.apply(void 0,c)(this)}function jc(c){void 0===c&&(c=-1);return function(a){return 0===c?new I:0>c?a.lift(new kc(-1,a)):a.lift(new kc(c-1,a))}}function lc(c){return function(a){return a.lift(new Ke(c))}}function mc(c){void 0===c&&(c=-1);return function(a){return a.lift(new Le(c,a))}}function nc(c){return function(a){return a.lift(new Me(c,a))}}function oc(c){return function(a){return a.lift(new Ne(c))}} function pc(c,a){void 0===a&&(a=x);return function(b){return b.lift(new Oe(c,a))}}function Pe(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function qc(c,a){return function(b){return b.lift(new Qe(c,a))}}function Re(){return new A}function rc(){return function(c){return Ea()(K(Re)(c))}}function sc(c,a,b){return function(d){return d.lift(Se(c,a,b))}}function Se(c,a,b){var d,e=0,f,l=!1,g=!1;return function(h){e++;if(!d||l)l=!1,d=new P(c,a,b),f=h.subscribe({next:function(b){d.next(b)}, error:function(b){l=!0;d.error(b)},complete:function(){g=!0;d.complete()}});var C=d.subscribe(this);return function(){e--;C.unsubscribe();f&&0===e&&g&&f.unsubscribe()}}}function tc(c){return function(a){return a.lift(new Te(c,a))}}function uc(c){return function(a){return a.lift(new Ue(c))}}function vc(c){return function(a){return a.lift(new Ve(c))}}function wc(c){return function(a){return a.lift(new We(c))}}function xc(c){return function(a){return a.lift(new Xe(c))}}function yc(){for(var c=[],a=0;a< arguments.length;a++)c[a]=arguments[a];return function(b){var a=c[c.length-1];B(a)?c.pop():a=null;var e=c.length;return 1===e?Y(new Fa(c[0],a),b):1<e?Y(new J(c,a),b):Y(new I(a),b)}}function Ye(c,a){void 0===a&&(a=0);return function(b){return b.lift(new Ze(c,a))}}function Ga(c,a){return function(b){return b.lift(new $e(c,a))}}function zc(){return Ga(Xa)}function Ha(){return zc()(this)}function Ac(c,a){return Ga(c,a)(this)}function Bc(c,a){return function(b){return b.lift(new af(c,a))}}function Cc(c){return function(a){return 0=== c?new I:a.lift(new bf(c))}}function Dc(c){return function(a){return a.lift(new cf(c))}}function Ec(c){return function(a){return a.lift(new df(c))}}function Fc(c,a){void 0===a&&(a=la);return function(b){return b.lift(new ef(c,a.leading,a.trailing))}}function Gc(c,a,b){void 0===a&&(a=x);void 0===b&&(b=la);return function(d){return d.lift(new ff(c,a,b.leading,b.trailing))}}function gf(c){c.subscriber.clearThrottle()}function Hc(c,a,b){void 0===a&&(a=x);void 0===b&&(b=la);return Gc(c,a,b)(this)}function Ic(c){void 0=== c&&(c=x);return function(a){return a.lift(new hf(c))}}function Jc(c,a){void 0===a&&(a=x);var b=ia(c),d=b?+c-a.now():Math.abs(c);return function(c){return c.lift(new jf(d,b,a,new Kc))}}function Lc(c,a,b){void 0===b&&(b=x);return function(d){var e=ia(c),f=e?+c-b.now():Math.abs(c);return d.lift(new kf(f,e,a,b))}}function Mc(c){void 0===c&&(c=x);return Z(function(a){return new Nc(a,c.now())})}function lf(c,a,b){if(0===b)return[a];c.push(a);return c}function Oc(){return T(lf,[])}function Pc(c){return function(a){return a.lift(new mf(c))}} function Qc(c){return function(a){return a.lift(new nf(c))}}function Rc(c){return Qc(c)(this)}function Sc(c,a){void 0===a&&(a=0);return function(b){return b.lift(new of(c,a))}}function Tc(c,a){void 0===a&&(a=0);return Sc(c,a)(this)}function Uc(c,a,b,d){var e=x,f=null,l=Number.POSITIVE_INFINITY;B(d)&&(e=d);B(b)?e=b:N(b)&&(l=b);B(a)?e=a:N(a)&&(f=a);return function(b){return b.lift(new pf(c,f,l,e))}}function qf(c){var a=c.subscriber,b=c.windowTimeSpan,d=c.window;d&&a.closeWindow(d);c.window=a.openWindow(); this.schedule(c,b)}function rf(c){var a=c.windowTimeSpan,b=c.subscriber,d=c.scheduler,e=c.windowCreationInterval,f=b.openWindow(),l={action:this,subscription:null};l.subscription=d.schedule(Vc,a,{subscriber:b,window:f,context:l});this.add(l.subscription);this.schedule(c,e)}function Vc(c){var a=c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function Wc(c,a,b,d){var e=x,f=null,l=Number.POSITIVE_INFINITY;B(d)&&(e=d);B(b)?e=b:N(b)&&(l= b);B(a)?e=a:N(a)&&(f=a);return Uc(c,f,l,e)(this)}function Xc(c,a){return function(b){return b.lift(new sf(c,a))}}function Yc(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return function(b){var a;"function"===typeof c[c.length-1]&&(a=c.pop());return b.lift(new tf(c,a))}}function Zc(c){return function(a){return a.lift(new $a(c))}}function uf(c){return function(a){return a.lift(new vf(c))}}function $c(c,a){for(var b=0,d=a.length;b<d;b++)for(var e=a[b],f=Object.getOwnPropertyNames(e.prototype), l=0,g=f.length;l<g;l++){var h=f[l];c.prototype[h]=e.prototype[h]}}var Gd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},wf="undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,xf="undefined"!==typeof global&&global,t="undefined"!==typeof window&&window||xf||wf;if(!t)throw Error("RxJS could not find any global context (window, self, global)");var yf= function(c){throw c;},ad;(function(c){c[c.IDLE=0]="IDLE";c[c.BUSY=1]="BUSY";c[c.DONE=2]="DONE"})(ad||(ad={}));var Q=function(){function c(a,b,c){this.n=a;this.e=b;this.c=c}c.prototype.next=function(a){this.closed||this.n(a)};c.prototype.error=function(a){this.closed||(this.closed=!0,this.e(a))};c.prototype.complete=function(){this.closed||(this.closed=!0,this.c())};c.prototype.asObserver=function(){var a=new c(function(b){this.__srcObserver.next(b)},function(b){this.__srcObserver.error(b)},function(){this.__srcObserver.complete()}); a.__srcObserver=this;return a};return c}();Q.prototype.onNext=Q.prototype.next;Q.prototype.onError=Q.prototype.error;Q.prototype.onCompleted=Q.prototype.complete;var Ia=function(){function c(){return c.create()}c.create=function(a,b,c){return new Q(void 0===a||null===a?Function.prototype:a,void 0===b||null===b?yf:b,void 0===c||null===c?Function.prototype:c)};return c}(),ma={closed:!0,next:function(c){},error:function(c){throw c;},complete:function(){},onNext:function(c){},onError:function(c){throw c; },onCompleted:function(){}},G=Array.isArray||function(c){return c&&"number"===typeof c.length},p={e:{}},Ra,W=function(c){function a(b){var d=c.call(this,b?b.length+" errors occurred during unsubscription:\n "+b.map(function(b,a){return a+1+") "+b.toString()}).join("\n "):"")||this;d.errors=b;d.name="UnsubscriptionError";Object.setPrototypeOf(d,a.prototype);return d}g(a,c);return a}(Error),y=function(){function c(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe= a)}c.prototype.unsubscribe=function(){var a=!1,b;if(!this.closed){var c=this._parent,e=this._parents,f=this._unsubscribe,l=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var g=-1,h=e?e.length:0;c;)c.remove(this),c=++g<h&&e[g]||null;u(f)&&(c=q(f).call(this),c===p&&(a=!0,b=b||(p.e instanceof W?H(p.e.errors):[p.e])));if(G(l))for(g=-1,h=l.length;++g<h;)c=l[g],null!=c&&"object"===typeof c&&(c=q(c.unsubscribe).call(c),c===p&&(a=!0,b=b||[],c=p.e,c instanceof W? b=b.concat(H(c.errors)):b.push(c)));if(a)throw new W(b);}};c.prototype.add=function(a){if(!a||a===c.EMPTY)return c.EMPTY;if(a===this)return this;var b=a;switch(typeof a){case "function":b=new c(a);case "object":if(b.closed||"function"!==typeof b.unsubscribe)return b;if(this.closed)return b.unsubscribe(),b;"function"!==typeof b._addParent&&(a=b,b=new c,b._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}(this._subscriptions||(this._subscriptions=[])).push(b); b._addParent(this);return b};c.prototype.remove=function(a){var b=this._subscriptions;b&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))};c.prototype._addParent=function(a){var b=this._parent,c=this._parents;b&&b!==a?c?-1===c.indexOf(a)&&c.push(a):this._parents=[a]:this._parent=a};c.prototype.dispose=function(){this.unsubscribe()};Object.defineProperty(c.prototype,"isDisposed",{get:function(){return this.closed},enumerable:!0,configurable:!0});c.EMPTY=function(a){a.closed=!0;return a}(new c);return c}(),Ja= t.Symbol,ca="function"===typeof Ja&&"function"===typeof Ja.for?Ja.for("rxSubscriber"):"@@rxSubscriber",m=function(c){function a(b,d,e){var f=c.call(this)||this;f.isStopped=!1;switch(arguments.length){case 0:f.destination=ma;break;case 1:if(!b){f.destination=ma;break}if("object"===typeof b){b instanceof a?(f.destination=b,f.destination.add(f)):f.destination=new bd(b);break}default:f.destination=new bd(b,d,e)}return f}g(a,c);a.prototype[ca]=function(){return this};a.create=function(b,c,e){return new a(b, c,e)};a.prototype.next=function(b){this.isStopped||this._next(b)};a.prototype.error=function(b){this.isStopped||(this.isStopped=!0,this._error(b))};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,c.prototype.unsubscribe.call(this))};a.prototype._next=function(b){this.destination.next(b)};a.prototype._error=function(b){this.destination.error(b);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete(); this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var b=this._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=b;this._parents=a;return this};return a}(y);m.prototype.onNext=function(c){this.next(c)};m.prototype.onError=function(c){this.error(c)};m.prototype.onCompleted=function(){this.complete()};var bd=function(c){function a(b,a,e){var d=c.call(this)||this,l,g=d;u(b)?l=b:b&&(l=b.next,a=b.error,e=b.complete,b!==ma&& (g=Object.create(b),u(g.unsubscribe)&&d.add(g.unsubscribe.bind(g)),g.unsubscribe=d.unsubscribe.bind(d)));d._context=g;d._next=l;d._error=a;d._complete=e;return d}g(a,c);a.prototype.next=function(b){if(!this.isStopped&&this._next)try{this._next.call(this._context,b)}catch(d){this._hostReportError(d),this.unsubscribe()}};a.prototype.error=function(b){if(!this.isStopped){if(this._error)try{this._error.call(this._context,b)}catch(d){this._hostReportError(d)}else this._hostReportError(b);this.unsubscribe()}}; a.prototype.complete=function(){if(!this.isStopped){if(this._complete)try{this._complete.call(this._context)}catch(b){this._hostReportError(b)}this.unsubscribe()}};a.prototype._unsubscribe=function(){this._context=null};a.prototype._hostReportError=function(b){setTimeout(function(){throw b;})};return a}(m),M=function(c){var a=c.Symbol;"function"===typeof a?a.observable?c=a.observable:(c=a("observable"),a.observable=c):c="@@observable";return c}(t),h=function(){function c(a){this._isScalar=!1;a&&(this._subscribe= a)}c.prototype.lift=function(a){var b=new c;b.source=this;b.operator=a;return b};c.prototype.subscribe=function(a,b,c){var d=this.operator;a:{if(a){if(a instanceof m)break a;if(a[ca]){a=a[ca]();break a}}a=a||b||c?new m(a,b,c):new m(ma)}d?d.call(a,this.source):a.add(this.source?this._subscribe(a):this._trySubscribe(a));return a};c.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(b){a.error(b)}};c.prototype.forEach=function(a,b){var c=this;b||(t.Rx&&t.Rx.config&&t.Rx.config.Promise? b=t.Rx.config.Promise:t.Promise&&(b=t.Promise));if(!b)throw Error("no Promise impl found");return new b(function(b,d){var e;e=c.subscribe(function(b){try{a(b)}catch(F){d(F),e&&e.unsubscribe()}},d,b)})};c.prototype._subscribe=function(a){return this.source.subscribe(a)};c.prototype[M]=function(){return this};c.prototype.pipe=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return 0===a.length?this:R(a)(this)};c.prototype.toPromise=function(a){var b=this;a||(t.Rx&&t.Rx.config&&t.Rx.config.Promise? a=t.Rx.config.Promise:t.Promise&&(a=t.Promise));if(!a)throw Error("no Promise impl found");return new a(function(a,c){var d;b.subscribe(function(b){return d=b},function(b){return c(b)},function(){return a(d)})})};c.prototype.asObservable=function(){return this};c.prototype.subscribeOnNext=function(a){return this.subscribe(a)};c.prototype.subscribeOnError=function(a){return this.subscribe(void 0,a)};c.prototype.subscribeOnCompleted=function(a){return this.subscribe(void 0,void 0,a)};c.create=function(a){return new c(a)}; return c}(),L=function(c){function a(){var b=c.call(this,"object unsubscribed")||this;b.name="ObjectUnsubscribedError";Object.setPrototypeOf(b,a.prototype);return b}g(a,c);return a}(Error),cd=function(c){function a(b,a){var d=c.call(this)||this;d.subject=b;d.subscriber=a;d.closed=!1;return d}g(a,c);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var b=this.subject,a=b.observers;this.subject=null;!a||0===a.length||b.isStopped||b.closed||(b=a.indexOf(this.subscriber),-1!==b&&a.splice(b, 1))}};return a}(y),dd=function(c){function a(b){var a=c.call(this,b)||this;a.destination=b;return a}g(a,c);return a}(m),A=function(c){function a(){var b=c.call(this)||this;b.observers=[];b.closed=!1;b.isStopped=!1;b.hasError=!1;b.thrownError=null;return b}g(a,c);a.prototype[ca]=function(){return new dd(this)};a.prototype.lift=function(b){var a=new na(this,this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new L;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(), f=0;f<c;f++)a[f].next(b)};a.prototype.error=function(b){if(this.closed)throw new L;this.hasError=!0;this.thrownError=b;this.isStopped=!0;for(var a=this.observers,c=a.length,a=a.slice(),f=0;f<c;f++)a[f].error(b);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new L;this.isStopped=!0;for(var b=this.observers,a=b.length,b=b.slice(),c=0;c<a;c++)b[c].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe= function(b){if(this.closed)throw new L;return c.prototype._trySubscribe.call(this,b)};a.prototype._subscribe=function(b){if(this.closed)throw new L;if(this.hasError)return b.error(this.thrownError),y.EMPTY;if(this.isStopped)return b.complete(),y.EMPTY;this.observers.push(b);return new cd(this,b)};a.prototype.asObservable=function(){var b=new h;b.source=this;return b};a.prototype.dispose=function(){return this.unsubscribe()};a.prototype.onNext=function(b){return this.next(b)};a.prototype.onError=function(b){return this.error(b)}; a.prototype.onCompleted=function(){return this.complete()};Object.defineProperty(a.prototype,"isDisposed",{get:function(){return this.isStopped},enumerable:!0,configurable:!0});a.create=function(b,a){return new na(b,a)};return a}(h),na=function(c){function a(b,a){var d=c.call(this)||this;d.destination=b;d.source=a;return d}g(a,c);a.prototype.next=function(b){var a=this.destination;a&&a.next&&a.next(b)};a.prototype.error=function(b){var a=this.destination;a&&a.error&&this.destination.error(b)};a.prototype.complete= function(){var b=this.destination;b&&b.complete&&this.destination.complete()};a.prototype._subscribe=function(b){return this.source?this.source.subscribe(b):y.EMPTY};return a}(A),S=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}g(a,c);a.prototype._subscribe=function(b){return this.hasError?(b.error(this.thrownError),y.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),y.EMPTY):c.prototype._subscribe.call(this, b)};a.prototype.next=function(b){this.hasCompleted||(this.value=b,this.hasNext=!0)};a.prototype.error=function(b){this.hasCompleted||c.prototype.error.call(this,b)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&c.prototype.next.call(this,this.value);c.prototype.complete.call(this)};return a}(A),zf=function(c){function a(b,a,e,f,l){var d=c.call(this)||this;d.callbackFunc=b;d.selector=a;d.args=e;d.context=f;d.scheduler=l;return d}g(a,c);a.prototype._subscribe=function(b){var c= this.callbackFunc,e=this.args,f=this.scheduler,l=this.subject;if(f)return f.schedule(a.dispatch,0,{source:this,subscriber:b,context:this.context});l||(l=this.subject=new S,f=function F(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];var c=F.source,a=c.selector,c=c.subject;a?(b=q(a).apply(this,b),b===p?c.error(p.e):(c.next(b),c.complete())):(c.next(1>=b.length?b[0]:b),c.complete())},f.source=this,q(c).apply(this.context,e.concat(f))===p&&l.error(p.e));return l.subscribe(b)};a.dispatch= function(b){var a=this,c=b.source,f=b.subscriber;b=b.context;var l=c.callbackFunc,g=c.args,h=c.scheduler,k=c.subject;if(!k){var k=c.subject=new S,n=function Hd(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];var d=Hd.source,c=d.selector,d=d.subject;c?(b=q(c).apply(this,b),b===p?a.add(h.schedule(Fd,0,{err:p.e,subject:d})):a.add(h.schedule(Pa,0,{value:b,subject:d}))):a.add(h.schedule(Pa,0,{value:1>=b.length?b[0]:b,subject:d}))};n.source=c;q(l).apply(b,g.concat(n))===p&&k.error(p.e)}a.add(k.subscribe(f))}; a.create=function(b,c,e){void 0===c&&(c=void 0);return function(){for(var d=[],l=0;l<arguments.length;l++)d[l]=arguments[l];return new a(b,c,d,this,e)}};return a}(h).create;h.bindCallback=zf;var Af=function(c){function a(b,a,e,f,l){var d=c.call(this)||this;d.callbackFunc=b;d.selector=a;d.args=e;d.context=f;d.scheduler=l;return d}g(a,c);a.prototype._subscribe=function(b){var a=this.callbackFunc,c=this.args,f=this.scheduler,l=this.subject;if(f)return f.schedule(Ed,0,{source:this,subscriber:b,context:this.context}); l||(l=this.subject=new S,f=function F(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];var c=F.source,a=c.selector,c=c.subject,d=b.shift();d?c.error(d):a?(b=q(a).apply(this,b),b===p?c.error(p.e):(c.next(b),c.complete())):(c.next(1>=b.length?b[0]:b),c.complete())},f.source=this,q(a).apply(this.context,c.concat(f))===p&&l.error(p.e));return l.subscribe(b)};a.create=function(b,c,e){void 0===c&&(c=void 0);return function(){for(var d=[],l=0;l<arguments.length;l++)d[l]=arguments[l];return new a(b, c,d,this,e)}};return a}(h).create;h.bindNodeCallback=Af;var Fa=function(c){function a(b,a){var d=c.call(this)||this;d.value=b;d.scheduler=a;d._isScalar=!0;a&&(d._isScalar=!1);return d}g(a,c);a.create=function(b,c){return new a(b,c)};a.dispatch=function(b){var a=b.value,c=b.subscriber;b.done?c.complete():(c.next(a),c.closed||(b.done=!0,this.schedule(b)))};a.prototype._subscribe=function(b){var c=this.value,e=this.scheduler;if(e)return e.schedule(a.dispatch,0,{done:!1,value:c,subscriber:b});b.next(c); b.closed||b.complete()};return a}(h),I=function(c){function a(b){var a=c.call(this)||this;a.scheduler=b;return a}g(a,c);a.create=function(b){return void 0===b?a.EMPTY:new a(b)};a.dispatch=function(b){b.subscriber.complete()};a.prototype._subscribe=function(b){var c=this.scheduler;if(c)return c.schedule(a.dispatch,0,{subscriber:b});b.complete()};a.EMPTY=new a;return a}(h),J=function(c){function a(b,a){var d=c.call(this)||this;d.array=b;d.scheduler=a;a||1!==b.length||(d._isScalar=!0,d.value=b[0]);return d} g(a,c);a.create=function(b,c){return new a(b,c)};a.of=function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];c=b[b.length-1];B(c)?b.pop():c=null;var e=b.length;return 1<e?new a(b,c):1===e?new Fa(b[0],c):new I(c)};a.dispatch=function(b){var a=b.array,c=b.index,f=b.subscriber;c>=b.count?f.complete():(f.next(a[c]),f.closed||(b.index=c+1,this.schedule(b)))};a.prototype._subscribe=function(b){var c=this.array,e=c.length,f=this.scheduler;if(f)return f.schedule(a.dispatch,0,{array:c,index:0, count:e,subscriber:b});for(f=0;f<e&&!b.closed;f++)b.next(c[f]);b.complete()};return a}(h),v=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}g(a,c);a.prototype.notifyNext=function(b,a,c,f,l){this.destination.next(a)};a.prototype.notifyError=function(b,a){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.complete()};return a}(m),D=function(c){var a=c.Symbol;if("function"===typeof a)return a.iterator||(a.iterator=a("iterator polyfill")),a.iterator; if((a=c.Set)&&"function"===typeof(new a)["@@iterator"])return"@@iterator";if(c=c.Map)for(var a=Object.getOwnPropertyNames(c.prototype),b=0;b<a.length;++b){var d=a[b];if("entries"!==d&&"size"!==d&&c.prototype[d]===c.prototype.entries)return d}return"@@iterator"}(t),Ta=function(c){function a(b,a,e){var d=c.call(this)||this;d.parent=b;d.outerValue=a;d.outerIndex=e;d.index=0;return d}g(a,c);a.prototype._next=function(b){this.parent.notifyNext(this.outerValue,b,this.outerIndex,this.index++,this)};a.prototype._error= function(b){this.parent.notifyError(b,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(m),ed={},ya=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Bf(a,this.project))};return c}(),Bf=function(c){function a(b,a){b=c.call(this,b)||this;b.project=a;b.active=0;b.values=[];b.observables=[];return b}g(a,c);a.prototype._next=function(b){this.values.push(ed);this.observables.push(b)};a.prototype._complete= function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var c=0;c<a;c++){var f=b[c];this.add(r(this,f,f,c))}}};a.prototype.notifyComplete=function(b){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,l){b=this.values;f=b[c];f=this.toRespond?f===ed?--this.toRespond:this.toRespond:0;b[c]=a;0===f&&(this.project?this._tryProject(b):this.destination.next(b.slice()))};a.prototype._tryProject=function(b){var a; try{a=this.project.apply(this,b)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(v);h.combineLatest=function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b=a=null;B(c[c.length-1])&&(b=c.pop());"function"===typeof c[c.length-1]&&(a=c.pop());1===c.length&&G(c[0])&&(c=c[0]);return(new J(c,b)).lift(new ya(a))};var ha=J.of,fd=function(c){function a(b,a){var d=c.call(this)||this;d.promise=b;d.scheduler=a;d.__isError=!1;return d}g(a,c);a.create=function(b, c){return new a(b,c)};a.prototype._subscribe=function(b){var a=this,c=this.promise,f=this.scheduler;if(null==f)this._isScalar?b.closed||(b.next(this.value),b.complete()):this.__isError?b.closed||b.error(this.__error):(c.then(function(c){a.promise=null;a.value=c;a._isScalar=!0;b.closed||(b.next(c),b.complete())},function(c){a.promise=null;a.__isError=!0;a.__error=c;b.closed||b.error(c)}).then(null,function(b){t.setTimeout(function(){throw b;})}),c=null);else if(this._isScalar){if(!b.closed)return f.schedule(Ua, 0,{value:this.value,subscriber:b})}else if(this.__isError){if(!b.closed)return f.schedule(Va,0,{err:this.__error,subscriber:b})}else c.then(function(c){a.promise=null;a.value=c;a._isScalar=!0;b.closed||b.add(f.schedule(Ua,0,{value:c,subscriber:b}))},function(c){a.promise=null;a.__isError=!0;a.__error=c;b.closed||b.add(f.schedule(Va,0,{err:c,subscriber:b}))}).then(null,function(b){t.setTimeout(function(){throw b;})}),c=null};return a}(h),Ef=function(c){function a(b,a){var d=c.call(this)||this;d.iteratorObject= b;d.scheduler=a;if(null==b)throw Error("iterator cannot be null.");if(!b[D])throw new TypeError("object is not iterable");return d}g(a,c);a.create=function(b,c){return new a(b,c)};a.dispatch=function(b){var a=b.index,c=b.iterator,f=b.subscriber;if(b.hasError)f.error(b.error);else{var l=c.next();l.done?f.complete():(f.next(l.value),b.index=a+1,f.closed?"function"===typeof c.return&&c.return():this.schedule(b))}};a.prototype._subscribe=function(b){var c=this.scheduler,e;e=this.iteratorObject;var f= e[D];if(f||"string"!==typeof e)if(f||void 0===e.length){if(!f)throw new TypeError("object is not iterable");e=e[D]()}else e=new Cf(e);else e=new Df(e);if(c)return c.schedule(a.dispatch,0,{index:0,iterator:e,subscriber:b});do{c=e.next();if(c.done){b.complete();break}else b.next(c.value);if(b.closed){"function"===typeof e.return&&e.return();break}}while(1)};return a}(h),Df=function(){function c(a,b,c){void 0===b&&(b=0);void 0===c&&(c=a.length);this.str=a;this.idx=b;this.len=c}c.prototype[D]=function(){return this}; c.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}};return c}(),Cf=function(){function c(a,b,c){void 0===b&&(b=0);if(void 0===c)if(c=+a.length,isNaN(c))c=0;else if(0!==c&&"number"===typeof c&&t.isFinite(c)){var d;d=+c;d=0===d?d:isNaN(d)?d:0>d?-1:1;c=d*Math.floor(Math.abs(c));c=0>=c?0:c>gd?gd:c}this.arr=a;this.idx=b;this.len=c}c.prototype[D]=function(){return this};c.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}: {done:!0,value:void 0}};return c}(),gd=Math.pow(2,53)-1,Ff=function(c){function a(b,a){var d=c.call(this)||this;d.arrayLike=b;d.scheduler=a;a||1!==b.length||(d._isScalar=!0,d.value=b[0]);return d}g(a,c);a.dispatch=function(b){var a=b.arrayLike,c=b.index,f=b.subscriber;f.closed||(c>=b.length?f.complete():(f.next(a[c]),b.index=c+1,this.schedule(b)))};a.prototype._subscribe=function(b){var c=this.arrayLike,e=this.scheduler,f=c.length;if(e)return e.schedule(a.dispatch,0,{arrayLike:c,index:0,length:f, subscriber:b});for(e=0;e<f&&!b.closed;e++)b.next(c[e]);b.complete()};a.create=function(b,c){var d=b.length;return 0===d?new I:1===d?new Fa(b[0],c):new a(b,c)};return a}(h),hd=I.create,id=function(c){function a(b,a){var d=c.call(this)||this;d.error=b;d.scheduler=a;return d}g(a,c);a.create=function(b,c){return new a(b,c)};a.dispatch=function(b){b.subscriber.error(b.error)};a.prototype._subscribe=function(b){var c=this.error,e=this.scheduler;if(e)return e.schedule(a.dispatch,0,{error:c,subscriber:b}); b.error(c)};return a}(h).create,w=function(){function c(a,b,c){this.kind=a;this.value=b;this.error=c;this.hasValue="N"===a}c.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()}};c.prototype.do=function(a,b,c){switch(this.kind){case "N":return a&&a(this.value);case "E":return b&&b(this.error);case "C":return c&&c()}};c.prototype.accept=function(a,b,c){return a&&"function"=== typeof a.next?this.observe(a):this.do(a,b,c)};c.prototype.toObservable=function(){switch(this.kind){case "N":return ha(this.value);case "E":return id(this.error);case "C":return hd()}throw Error("unexpected notification kind value");};c.createNext=function(a){return"undefined"!==typeof a?new c("N",a):c.undefinedValueNotification};c.createError=function(a){return new c("E",void 0,a)};c.createComplete=function(){return c.completeNotification};c.completeNotification=new c("C");c.undefinedValueNotification= new c("N",void 0);return c}();w.createOnNext=w.createNext;w.createOnError=w.createError;w.createOnCompleted=w.createComplete;var Id=function(){function c(a,b){void 0===b&&(b=0);this.scheduler=a;this.delay=b}c.prototype.call=function(a,b){return b.subscribe(new Ka(a,this.scheduler,this.delay))};return c}(),Ka=function(c){function a(b,a,e){void 0===e&&(e=0);b=c.call(this,b)||this;b.scheduler=a;b.delay=e;return b}g(a,c);a.dispatch=function(b){b.notification.observe(b.destination);this.unsubscribe()}; a.prototype.scheduleMessage=function(b){this.add(this.scheduler.schedule(a.dispatch,this.delay,new Gf(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(w.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(w.createError(b))};a.prototype._complete=function(){this.scheduleMessage(w.createComplete())};return a}(m),Gf=function(){return function(c,a){this.notification=c;this.destination=a}}(),jd=function(c){function a(b,a){var d=c.call(this,null)||this;d.ish=b;d.scheduler= a;return d}g(a,c);a.create=function(b,c){if(null!=b){if("function"===typeof b[M])return b instanceof h&&!c?b:new a(b,c);if(G(b))return new J(b,c);if(Sa(b))return new fd(b,c);if("function"===typeof b[D]||"string"===typeof b)return new Ef(b,c);if(b&&"number"===typeof b.length)return new Ff(b,c)}throw new TypeError((null!==b&&typeof b||b)+" is not observable");};a.prototype._subscribe=function(b){var a=this.ish,c=this.scheduler;return null==c?a[M]().subscribe(b):a[M]().subscribe(new Ka(b,c,0))};return a}(h), wa=jd.create,Jd=function(){function c(a,b,c){void 0===c&&(c=Number.POSITIVE_INFINITY);this.project=a;this.resultSelector=b;this.concurrent=c}c.prototype.call=function(a,b){return b.subscribe(new Hf(a,this.project,this.resultSelector,this.concurrent))};return c}(),Hf=function(c){function a(b,a,e,f){void 0===f&&(f=Number.POSITIVE_INFINITY);b=c.call(this,b)||this;b.project=a;b.resultSelector=e;b.concurrent=f;b.hasCompleted=!1;b.buffer=[];b.active=0;b.index=0;return b}g(a,c);a.prototype._next=function(b){this.active< this.concurrent?this._tryNext(b):this.buffer.push(b)};a.prototype._tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(a,b,c)};a.prototype._innerSub=function(b,a,c){this.add(r(this,b,a,c))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyNext=function(b,a,c,f,l){this.resultSelector?this._notifyResultSelector(b,a,c,f):this.destination.next(a)}; a.prototype._notifyResultSelector=function(b,a,c,f){var d;try{d=this.resultSelector(b,a,c,f)}catch(C){this.destination.error(C);return}this.destination.next(d)};a.prototype.notifyComplete=function(b){var a=this.buffer;this.remove(b);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(v);h.concat=Y;var Jf=function(c){function a(b){var a=c.call(this)||this;a.observableFactory=b;return a}g(a,c);a.create=function(b){return new a(b)}; a.prototype._subscribe=function(b){return new If(b,this.observableFactory)};return a}(h),If=function(c){function a(b,a){b=c.call(this,b)||this;b.factory=a;b.tryDefer();return b}g(a,c);a.prototype.tryDefer=function(){try{this._callFactory()}catch(b){this._error(b)}};a.prototype._callFactory=function(){var b=this.factory();b&&this.add(r(this,b))};return a}(v);h.defer=Jf.create;h.empty=hd;var Lf=function(c){function a(b,a){var d=c.call(this)||this;d.sources=b;d.resultSelector=a;return d}g(a,c);a.create= function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];if(null===b||0===arguments.length)return new I;c=null;"function"===typeof b[b.length-1]&&(c=b.pop());1===b.length&&G(b[0])&&(b=b[0]);return 0===b.length?new I:new a(b,c)};a.prototype._subscribe=function(b){return new Kf(b,this.sources,this.resultSelector)};return a}(h),Kf=function(c){function a(b,a,e){b=c.call(this,b)||this;b.sources=a;b.resultSelector=e;b.completed=0;b.haveValues=0;e=a.length;b.total=e;b.values=Array(e);for(var d= 0;d<e;d++){var l=r(b,a[d],null,d);l&&(l.outerIndex=d,b.add(l))}return b}g(a,c);a.prototype.notifyNext=function(b,a,c,f,l){this.values[c]=a;l._hasValue||(l._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(b){var a=this.destination,c=this.haveValues,f=this.resultSelector,l=this.values,g=l.length;b._hasValue?(this.completed++,this.completed===g&&(c===g&&(b=f?f.apply(this,l):l,a.next(b)),a.complete())):a.complete()};return a}(v);h.forkJoin=Lf.create;h.from=wa;var kd=Object.prototype.toString, Mf=function(c){function a(b,a,e,f){var d=c.call(this)||this;d.sourceObj=b;d.eventName=a;d.selector=e;d.options=f;return d}g(a,c);a.create=function(b,c,e,f){u(e)&&(f=e,e=void 0);return new