UNPKG

rxjs

Version:

Reactive Extensions for modern JavaScript

119 lines (117 loc) 148 kB
/** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /* ***************************************************************************** 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(l,h,x){if(x.get||x.set)throw new TypeError("ES3 does not support getters and setters.");l!=Array.prototype&&l!=Object.prototype&&(l[h]=x.value)};$jscomp.getGlobal=function(l){return"undefined"!=typeof window&&window===l?l:"undefined"!=typeof global&&null!=global?global:l};$jscomp.global=$jscomp.getGlobal(this); $jscomp.polyfill=function(l,h,x,A){if(h){x=$jscomp.global;l=l.split(".");for(A=0;A<l.length-1;A++){var q=l[A];q in x||(x[q]={});x=x[q]}l=l[l.length-1];A=x[l];h=h(A);h!=A&&null!=h&&$jscomp.defineProperty(x,l,{configurable:!0,writable:!0,value:h})}};$jscomp.polyfill("Object.setPrototypeOf",function(l){return l?l:"object"!=typeof"".__proto__?null:function(h,l){h.__proto__=l;if(h.__proto__!==l)throw new TypeError(h+" is not extensible");return h}},"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(l){return $jscomp.SYMBOL_PREFIX+(l||"")+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var l=$jscomp.global.Symbol.iterator;l||(l=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[l]&&$jscomp.defineProperty(Array.prototype,l,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(l){var h=0;return $jscomp.iteratorPrototype(function(){return h<l.length?{done:!1,value:l[h++]}:{done:!0}})}; $jscomp.iteratorPrototype=function(l){$jscomp.initSymbolIterator();l={next:l};l[$jscomp.global.Symbol.iterator]=function(){return this};return l};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(l,h){$jscomp.initSymbolIterator();l instanceof String&&(l+="");var x=0,A={next:function(){if(x<l.length){var q=x++;return{value:h(q,l[q]),done:!1}}A.next=function(){return{done:!0,value:void 0}};return A.next()}};A[Symbol.iterator]=function(){return A};return A}; $jscomp.polyfill("Array.prototype.values",function(l){return l?l:function(){return $jscomp.iteratorFromArray(this,function(h,l){return l})}},"es6","es3");$jscomp.polyfill("Array.prototype.keys",function(l){return l?l:function(){return $jscomp.iteratorFromArray(this,function(h){return h})}},"es6-impl","es3"); (function(l,h){"object"===typeof exports&&"undefined"!==typeof module?h(exports):"function"===typeof define&&define.amd?define(["exports"],h):h(l.Rx=l.Rx||{})})(this,function(l){function h(b,a){function c(){this.constructor=b}Cb(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function x(b){return"function"===typeof b}function A(){try{return sa.apply(this,arguments)}catch(b){return n.e=b,n}}function q(b){sa=b;return A}function ta(b){return b.reduce(function(a,c){return a.concat(c instanceof Q?c.errors:c)},[])}function Db(){}function ha(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return ua(b)}function ua(b){return b?1===b.length?b[0]:function(a){return b.reduce(function(c,a){return a(c)},a)}:Db}function va(b){var a=b.subject;a.next(b.value);a.complete()}function Eb(b){b.subject.error(b.err)}function Fb(b){var a=this,c=b.source,e=b.subscriber;b=b.context;var d=c.callbackFunc,f=c.args,k=c.scheduler,g=c.subject;if(!g){var g=c.subject=new O,h=function Gb(){for(var c=[], b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=Gb.source,b=e.selector,e=e.subject,d=c.shift();d?a.add(k.schedule(ia,0,{err:d,subject:e})):b?(c=q(b).apply(this,c),c===n?a.add(k.schedule(ia,0,{err:n.e,subject:e})):a.add(k.schedule(wa,0,{value:c,subject:e}))):a.add(k.schedule(wa,0,{value:1>=c.length?c[0]:c,subject:e}))};h.source=c;q(d).apply(b,f.concat(h))===n&&a.add(k.schedule(ia,0,{err:n.e,subject:g}))}a.add(g.subscribe(e))}function wa(b){var a=b.subject;a.next(b.value);a.complete()}function ia(b){b.subject.error(b.err)} function z(b){return b&&"function"===typeof b.schedule}function xa(b){return b&&"function"!==typeof b.subscribe&&"function"===typeof b.then}function r(b,a,c,e){var d=new ya(b,c,e);if(d.closed)return null;if(a instanceof g)if(a._isScalar)d.next(a.value),d.complete();else return d.syncErrorThrowable=!0,a.subscribe(d);else if(a&&"number"===typeof a.length){b=0;for(c=a.length;b<c&&!d.closed;b++)d.next(a[b]);d.closed||d.complete()}else{if(xa(a))return a.then(function(c){d.closed||(d.next(c),d.complete())}, function(c){return d.error(c)}).then(null,function(c){p.setTimeout(function(){throw c;})}),d;if(a&&"function"===typeof a[C]){a=a[C]();do{b=a.next();if(b.done){d.complete();break}d.next(b.value);if(d.closed)break}while(1)}else if(a&&"function"===typeof a[J])if(a=a[J](),"function"!==typeof a.subscribe)d.error(new TypeError("Provided object does not correctly implement Symbol.observable"));else return a.subscribe(new ya(b,c,e));else d.error(new TypeError("You provided "+(null!=a&&"object"===typeof a? "an invalid object":"'"+a+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable."))}return null}function Ib(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=null;"function"===typeof b[b.length-1]&&(c=b.pop());1===b.length&&E(b[0])&&(b=b[0].slice());return function(a){return a.lift.call(new G([a].concat(b)),new ja(c))}}function za(b){var a=b.value;b=b.subscriber;b.closed||(b.next(a),b.complete())}function Jb(b){var a=b.err;b=b.subscriber; b.closed||b.error(a)}function Kb(b,a){void 0===a&&(a=0);return function(c){return c.lift(new Lb(b,a))}}function ka(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return function(e){"number"===typeof a&&(c=a,a=null);return e.lift(new Mb(b,a,c))}}function Aa(b){return b}function Ba(b){void 0===b&&(b=Number.POSITIVE_INFINITY);return ka(Aa,null,b)}function R(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return 1===b.length||2===b.length&&z(b[1])?Ca(b[0]):Ba(1)(Da.apply(void 0,b))}function K(b){return!E(b)&& 0<=b-parseFloat(b)+1}function Ea(b){return function(a){return a.lift(new Nb(b))}}function Y(b){return b instanceof Date&&!isNaN(+b)}function Ob(b,a){void 0===a&&(a=u);return Ea(function(){return Fa(b,a)})}function Pb(b){return function(a){return a.lift(new Qb(b))}}function Rb(b,a){void 0===a&&(a=null);return function(c){return c.lift(new Sb(b,a))}}function Tb(b){var a=arguments.length,c=u;z(arguments[arguments.length-1])&&(c=arguments[arguments.length-1],a--);var e=null;2<=a&&(e=arguments[1]);var d= Number.POSITIVE_INFINITY;3<=a&&(d=arguments[2]);return function(a){return a.lift(new Ub(b,e,d,c))}}function Ga(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 Vb(b){var a=b.bufferCreationInterval,c=b.bufferTimeSpan,e=b.subscriber,d=b.scheduler,f=e.openContext();e.closed||(e.add(f.closeAction=d.schedule(Ha,c,{subscriber:e,context:f})),this.schedule(b,a))}function Ha(b){b.subscriber.closeContext(b.context)} function Wb(b,a){return function(c){return c.lift(new Xb(b,a))}}function Yb(b){return function(a){return a.lift(new Zb(b))}}function $b(b){return function(a){var c=new ac(b);a=a.lift(c);return c.caught=a}}function bc(b){return function(a){return a.lift(new ja(b))}}function cc(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){return c.lift.call(R.apply(void 0,[c].concat(b)))}}function Ia(b,a){return ka(b,a,1)}function dc(b,a){return Ia(function(){return b},a)}function ec(b){return function(a){return a.lift(new fc(b, a))}}function gc(b){return function(a){return a.lift(new hc(b))}}function ic(b,a){void 0===a&&(a=u);return function(c){return c.lift(new jc(b,a))}}function kc(b){b.debouncedNext()}function Ja(b){void 0===b&&(b=null);return function(a){return a.lift(new lc(b))}}function mc(b,a){void 0===a&&(a=u);var c=Y(b)?+b-a.now():Math.abs(b);return function(b){return b.lift(new nc(c,a))}}function oc(b,a){return a?function(c){return(new pc(c,a)).lift(new Ka(b))}:function(c){return c.lift(new Ka(b))}}function qc(){return function(b){return b.lift(new rc)}} function sc(){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 tc(b,a){return function(c){return c.lift(new uc(b,a))}}function La(b,a){return function(c){return c.lift(new vc(b,a))}}function wc(b, a){return La(function(c,e){return a?a(c[b],e[b]):c[b]===e[b]})}function xc(b,a){return function(c){return c.lift(new yc(b,a))}}function zc(b,a){return function(c){return c.lift(new Ac(b,a,c))}}function Bc(){return function(b){return b.lift(new Cc)}}function Dc(b,a){return function(c){return c.lift(new Ec(b,a))}}function Fc(b,a,c){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===c&&(c=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return function(e){return e.lift(new Gc(b,a,c))}}function la(b,a){return function(c){return c.lift(new Hc(b, a))}}function Ic(b){return function(a){return a.lift(new Jc(b))}}function Kc(b,a){if("function"!==typeof b)throw new TypeError("predicate is not a function");return function(c){return c.lift(new Ma(b,c,!1,a))}}function Lc(b,a){return function(c){return c.lift(new Ma(b,c,!0,a))}}function Mc(b,a,c){return function(e){return e.lift(new Nc(b,a,c,e))}}function Oc(b,a,c,e){return function(d){return d.lift(new Pc(b,a,c,e))}}function Qc(){return function(b){return b.lift(new Rc)}}function Sc(){return function(b){return b.lift(new Tc)}} function Uc(b,a,c){return function(e){return e.lift(new Vc(b,a,c,e))}}function Z(b,a){return function(c){if("function"!==typeof b)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return c.lift(new Wc(b,a))}}function Xc(b){return function(a){return a.lift(new Yc(b))}}function Zc(){return function(b){return b.lift(new $c)}}function aa(b,a){var c=!1;2<=arguments.length&&(c=!0);return function(e){return e.lift(new ad(b,a,c))}}function ma(b){return function(a){return 0=== b?new F:a.lift(new bd(b))}}function S(b,a){return 2<=arguments.length?function(c){return ha(aa(b,a),ma(1),Ja(a))(c)}:function(c){return ha(aa(function(c,a,f){return b(c,a,f+1)}),ma(1))(c)}}function cd(b){return S("function"===typeof b?function(a,c){return 0<b(a,c)?a:c}:function(a,c){return a>c?a:c})}function dd(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){return c.lift.call(Na.apply(void 0,[c].concat(b)))}}function Na(){for(var b=[],a=0;a<arguments.length;a++)b[a- 0]=arguments[a];var a=Number.POSITIVE_INFINITY,c=null,e=b[b.length-1];z(e)?(c=b.pop(),1<b.length&&"number"===typeof b[b.length-1]&&(a=b.pop())):"number"===typeof e&&(a=b.pop());return null===c&&1===b.length&&b[0]instanceof g?b[0]:Ba(a)(new G(b,c))}function ed(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);"number"===typeof a&&(c=a,a=null);return function(e){return e.lift(new fd(b,a,c))}}function gd(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return function(e){return e.lift(new hd(b,a,c))}}function id(b){return S("function"=== typeof b?function(a,c){return 0>b(a,c)?a:c}:function(a,c){return a<c?a:c})}function na(){return function(b){return b.lift(new jd(b))}}function H(b,a){return function(c){var e;e="function"===typeof b?b:function(){return b};if("function"===typeof a)return c.lift(new kd(e,a));var d=Object.create(c,ld);d.source=c;d.subjectFactory=e;return d}}function md(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&E(b[0])&&(b=b[0]);return function(c){return c.lift(new Oa(b))}}function nd(){return function(b){return b.lift(new od)}} function pd(b,a){function c(){return!c.pred.apply(c.thisArg,arguments)}c.pred=b;c.thisArg=a;return c}function qd(b,a){return function(c){return[la(b,a)(c),la(pd(b,a))(c)]}}function rd(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=b.length;if(0===c)throw Error("list of properties cannot be empty.");return function(a){return Z(sd(b,c))(a)}}function sd(b,a){return function(c){var e=c;for(c=0;c<a;c++)if(e=e[b[c]],"undefined"===typeof e)return;return e}}function td(b){return b?H(function(){return new w}, b):H(new w)}function ud(b){return function(a){return H(new Pa(b))(a)}}function vd(){return function(b){return H(new O)(b)}}function wd(b,a,c){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);return function(e){return H(new L(b,a,c))(e)}}function Qa(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];if(1===b.length)if(E(b[0]))b=b[0];else return b[0];return(new G(b)).lift(new xd)}function yd(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){1=== b.length&&E(b[0])&&(b=b[0]);return c.lift.call(Qa.apply(void 0,[c].concat(b)))}}function zd(b){void 0===b&&(b=-1);return function(a){return 0===b?new F:0>b?a.lift(new Ra(-1,a)):a.lift(new Ra(b-1,a))}}function Ad(b){return function(a){return a.lift(new Bd(b))}}function Cd(b){void 0===b&&(b=-1);return function(a){return a.lift(new Dd(b,a))}}function Ed(b){return function(a){return a.lift(new Fd(b,a))}}function Gd(b){return function(a){return a.lift(new Hd(b))}}function Id(b,a){void 0===a&&(a=u);return function(c){return c.lift(new Jd(b, a))}}function Kd(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function Ld(b,a){return function(c){return c.lift(new Md(b,a))}}function Nd(){return new w}function Od(){return function(b){return na()(H(Nd)(b))}}function Pd(b,a,c){var e,d=H(function(){return this._isComplete?e:e=new L(b,a,c)});return function(c){return na()(d(c))}}function Qd(b){return function(a){return a.lift(new Rd(b,a))}}function Sd(b){return function(a){return a.lift(new Td(b))}}function Ud(b){return function(a){return a.lift(new Vd(b))}} function Wd(b){return function(a){return a.lift(new Xd(b))}}function Yd(b){return function(a){return a.lift(new Zd(b))}}function $d(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){var a=b[b.length-1];z(a)?b.pop():a=null;var d=b.length;return 1===d?R(new oa(b[0],a),c):1<d?R(new G(b,a),c):R(new F(a),c)}}function ae(b,a){void 0===a&&(a=0);return function(c){return c.lift(new be(b,a))}}function Sa(b,a){return function(c){return c.lift(new ce(b,a))}}function de(b,a){return function(c){return c.lift(new ee(b, a))}}function fe(b){return function(a){return 0===b?new F:a.lift(new ge(b))}}function he(b){return function(a){return a.lift(new ie(b))}}function je(b){return function(a){return a.lift(new ke(b))}}function le(b,a,c){return function(e){return e.lift(new me(b,a,c))}}function ne(b,a){void 0===a&&(a=ba);return function(c){return c.lift(new oe(b,a.leading,a.trailing))}}function pe(b,a,c){void 0===a&&(a=u);void 0===c&&(c=ba);return function(e){return e.lift(new qe(b,a,c.leading,c.trailing))}}function re(b){b.subscriber.clearThrottle()} function se(b){void 0===b&&(b=u);return function(a){return a.lift(new te(b))}}function ue(b,a){void 0===a&&(a=u);var c=Y(b),e=c?+b-a.now():Math.abs(b);return function(b){return b.lift(new ve(e,c,a,new Ta))}}function we(b,a,c){void 0===c&&(c=u);return function(e){var d=Y(b),f=d?+b-c.now():Math.abs(b);return e.lift(new xe(f,d,a,c))}}function ye(b){void 0===b&&(b=u);return Z(function(a){return new Ua(a,b.now())})}function ze(b,a,c){b.push(a);return b}function Ae(b){return function(a){b||(p.Rx&&p.Rx.config&& p.Rx.config.Promise?b=p.Rx.config.Promise:p.Promise&&(b=p.Promise));if(!b)throw Error("no Promise impl found");return new b(function(c,b){var e;a.subscribe(function(c){return e=c},function(c){return b(c)},function(){return c(e)})})}}function Be(b){return function(a){return a.lift(new Ce(b))}}function De(b,a){void 0===a&&(a=0);return function(c){return c.lift(new Ee(b,a))}}function Fe(b,a,c,e){var d=u,f=null,k=Number.POSITIVE_INFINITY;z(e)&&(d=e);z(c)?d=c:K(c)&&(k=c);z(a)?d=a:K(a)&&(f=a);return function(c){return c.lift(new Ge(b, f,k,d))}}function He(b){var a=b.subscriber,c=b.windowTimeSpan,e=b.window;e&&a.closeWindow(e);b.window=a.openWindow();this.schedule(b,c)}function Ie(b){var a=b.windowTimeSpan,c=b.subscriber,e=b.scheduler,d=b.windowCreationInterval,f=c.openWindow(),k={action:this,subscription:null};k.subscription=e.schedule(Va,a,{subscriber:c,window:f,context:k});this.add(k.subscription);this.schedule(b,d)}function Va(b){var a=b.subscriber,c=b.window;(b=b.context)&&b.action&&b.subscription&&b.action.remove(b.subscription); a.closeWindow(c)}function Je(b,a){return function(c){return c.lift(new Ke(b,a))}}function Le(b){return function(a){return a.lift(new Me(b))}}function Ne(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){var a;"function"===typeof b[b.length-1]&&(a=b.pop());return c.lift(new Oe(b,a))}}function Pe(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return function(c){return c.lift.call(Wa.apply(void 0,[c].concat(b)))}}function Wa(){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 G(b)).lift(new Xa(a))}function Qe(b){return function(a){return a.lift(new Xa(b))}}function Re(b){var a=b.obj,c=b.keys,e=b.index,d=b.subscriber;e===b.length?d.complete():(c=c[e],d.next([c,a[c]]),b.index=e+1,this.schedule(b))}function Se(b,a){void 0===a&&(a=null);return new M({method:"GET",url:b,headers:a})}function Te(b,a,c){return new M({method:"POST",url:b,body:a,headers:c})}function Ue(b,a){return new M({method:"DELETE",url:b, headers:a})}function Ve(b,a,c){return new M({method:"PUT",url:b,body:a,headers:c})}function We(b,a,c){return new M({method:"PATCH",url:b,body:a,headers:c})}function Xe(b,a){return Ye(new M({method:"GET",url:b,responseType:"json",headers:a}))}function Ya(b,a){switch(b){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 Ze(b){for(var a= [],c=1;c<arguments.length;c++)a[c-1]=arguments[c];for(var c=a.length,e=0;e<c;e++){var d=a[e],f;for(f in d)d.hasOwnProperty(f)&&(b[f]=d[f])}return b}function Za(b){return $b(b)(this)}function $a(b,a,c){return le(b,a,c)(this)}function ab(b){return Ic(b)(this)}function bb(b){return b(this)}function cb(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return ka(b,a,c)(this)}function db(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return ed(b,a,c)(this)}function eb(){return Sa(Aa)(this)}function fb(b, a){for(var c=0,e=a.length;c<e;c++)for(var d=a[c],f=Object.getOwnPropertyNames(d.prototype),k=0,g=f.length;k<g;k++){var h=f[k];b.prototype[h]=d.prototype[h]}}var Cb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},$e="undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,af="undefined"!==typeof global&&global,p="undefined"!==typeof window&&window||af|| $e;if(!p)throw Error("RxJS could not find any global context (window, self, global)");var E=Array.isArray||function(b){return b&&"number"===typeof b.length},n={e:{}},sa,Q=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}h(a,b);return a}(Error),v=function(){function b(a){this.closed= !1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}b.prototype.unsubscribe=function(){var a=!1,c;if(!this.closed){var b=this._parent,d=this._parents,f=this._unsubscribe,k=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var g=-1,h=d?d.length:0;b;)b.remove(this),b=++g<h&&d[g]||null;x(f)&&(b=q(f).call(this),b===n&&(a=!0,c=c||(n.e instanceof Q?ta(n.e.errors):[n.e])));if(E(k))for(g=-1,h=k.length;++g<h;)b=k[g],null!=b&&"object"===typeof b&& (b=q(b.unsubscribe).call(b),b===n&&(a=!0,c=c||[],b=n.e,b instanceof Q?c=c.concat(ta(b.errors)):c.push(b)));if(a)throw new Q(c);}};b.prototype.add=function(a){if(!a||a===b.EMPTY)return b.EMPTY;if(a===this)return this;var c=a;switch(typeof a){case "function":c=new b(a);case "object":if(c.closed||"function"!==typeof c.unsubscribe)return c;if(this.closed)return c.unsubscribe(),c;"function"!==typeof c._addParent&&(a=c,c=new b,c._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription."); }(this._subscriptions||(this._subscriptions=[])).push(c);c._addParent(this);return c};b.prototype.remove=function(a){var c=this._subscriptions;c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))};b.prototype._addParent=function(a){var c=this._parent,b=this._parents;c&&c!==a?b?-1===b.indexOf(a)&&b.push(a):this._parents=[a]:this._parent=a};b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),ca={closed:!0,next:function(b){},error:function(b){throw b;},complete:function(){}},pa=p.Symbol,T="function"=== typeof pa&&"function"===typeof pa.for?pa.for("rxSubscriber"):"@@rxSubscriber",m=function(b){function a(c,e,d){b.call(this);this.syncErrorValue=null;this.isStopped=this.syncErrorThrowable=this.syncErrorThrown=!1;switch(arguments.length){case 0:this.destination=ca;break;case 1:if(!c){this.destination=ca;break}if("object"===typeof c){c instanceof a?(this.destination=c,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new gb(this,c));break}default:this.syncErrorThrowable=!0,this.destination= new gb(this,c,e,d)}}h(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()};a.prototype._unsubscribeAndRecycle=function(){var c=this._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=c;this._parents=a;return this};return a}(v),gb=function(b){function a(c,a,d,f){b.call(this);this._parentSubscriber=c;var e;c=this;x(a)?e=a:a&&(e=a.next,d=a.error,f=a.complete, a!==ca&&(c=Object.create(a),x(c.unsubscribe)&&this.add(c.unsubscribe.bind(c)),c.unsubscribe=this.unsubscribe.bind(this)));this._context=c;this._next=e;this._error=d;this._complete=f}h(a,b);a.prototype.next=function(c){if(!this.isStopped&&this._next){var a=this._parentSubscriber;a.syncErrorThrowable?this.__tryOrSetError(a,this._next,c)&&this.unsubscribe():this.__tryOrUnsub(this._next,c)}};a.prototype.error=function(c){if(!this.isStopped){var a=this._parentSubscriber;if(this._error)a.syncErrorThrowable? this.__tryOrSetError(a,this._error,c):this.__tryOrUnsub(this._error,c),this.unsubscribe();else if(a.syncErrorThrowable)a.syncErrorValue=c,a.syncErrorThrown=!0,this.unsubscribe();else throw this.unsubscribe(),c;}};a.prototype.complete=function(){var c=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var b=function(){return c._complete.call(c._context)};a.syncErrorThrowable?this.__tryOrSetError(a,b):this.__tryOrUnsub(b)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(c, a){try{c.call(this._context,a)}catch(d){throw this.unsubscribe(),d;}};a.prototype.__tryOrSetError=function(c,a,b){try{a.call(this._context,b)}catch(f){return c.syncErrorValue=f,c.syncErrorThrown=!0}return!1};a.prototype._unsubscribe=function(){var c=this._parentSubscriber;this._parentSubscriber=this._context=null;c.unsubscribe()};return a}(m),J=function(b){var a=b.Symbol;"function"===typeof a?a.observable?b=a.observable:(b=a("observable"),a.observable=b):b="@@observable";return b}(p),g=function(){function b(a){this._isScalar= !1;a&&(this._subscribe=a)}b.prototype.lift=function(a){var c=new b;c.source=this;c.operator=a;return c};b.prototype.subscribe=function(a,c,b){var e=this.operator;a:{if(a){if(a instanceof m)break a;if(a[T]){a=a[T]();break a}}a=a||c||b?new m(a,c,b):new m(ca)}e?e.call(a,this.source):a.add(this.source?this._subscribe(a):this._trySubscribe(a));if(a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};b.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(c){a.syncErrorThrown= !0,a.syncErrorValue=c,a.error(c)}};b.prototype.forEach=function(a,c){var b=this;c||(p.Rx&&p.Rx.config&&p.Rx.config.Promise?c=p.Rx.config.Promise:p.Promise&&(c=p.Promise));if(!c)throw Error("no Promise impl found");return new c(function(c,e){var d;d=b.subscribe(function(c){if(d)try{a(c)}catch(D){e(D),d.unsubscribe()}else a(c)},e,c)})};b.prototype._subscribe=function(a){return this.source.subscribe(a)};b.prototype[J]=function(){return this};b.prototype.pipe=function(){for(var a=[],c=0;c<arguments.length;c++)a[c- 0]=arguments[c];return 0===a.length?this:ua(a)(this)};b.create=function(a){return new b(a)};return b}(),I=function(b){function a(){var c=b.call(this,"object unsubscribed");this.name=c.name="ObjectUnsubscribedError";this.stack=c.stack;this.message=c.message}h(a,b);return a}(Error),hb=function(b){function a(c,a){b.call(this);this.subject=c;this.subscriber=a;this.closed=!1}h(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}(v),ib=function(b){function a(c){b.call(this,c);this.destination=c}h(a,b);return a}(m),w=function(b){function a(){b.call(this);this.observers=[];this.hasError=this.isStopped=this.closed=!1;this.thrownError=null}h(a,b);a.prototype[T]=function(){return new ib(this)};a.prototype.lift=function(c){var a=new da(this,this);a.operator=c;return a};a.prototype.next=function(c){if(this.closed)throw new I;if(!this.isStopped)for(var a= this.observers,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].next(c)};a.prototype.error=function(c){if(this.closed)throw new I;this.hasError=!0;this.thrownError=c;this.isStopped=!0;for(var a=this.observers,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].error(c);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new I;this.isStopped=!0;for(var c=this.observers,a=c.length,c=c.slice(),b=0;b<a;b++)c[b].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped= !0;this.observers=null};a.prototype._trySubscribe=function(c){if(this.closed)throw new I;return b.prototype._trySubscribe.call(this,c)};a.prototype._subscribe=function(c){if(this.closed)throw new I;if(this.hasError)return c.error(this.thrownError),v.EMPTY;if(this.isStopped)return c.complete(),v.EMPTY;this.observers.push(c);return new hb(this,c)};a.prototype.asObservable=function(){var c=new g;c.source=this;return c};a.create=function(c,a){return new da(c,a)};return a}(g),da=function(b){function a(c, a){b.call(this);this.destination=c;this.source=a}h(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):v.EMPTY};return a}(w),O=function(b){function a(){b.apply(this,arguments);this.value=null;this.hasCompleted= this.hasNext=!1}h(a,b);a.prototype._subscribe=function(c){return this.hasError?(c.error(this.thrownError),v.EMPTY):this.hasCompleted&&this.hasNext?(c.next(this.value),c.complete(),v.EMPTY):b.prototype._subscribe.call(this,c)};a.prototype.next=function(c){this.hasCompleted||(this.value=c,this.hasNext=!0)};a.prototype.error=function(c){this.hasCompleted||b.prototype.error.call(this,c)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&b.prototype.next.call(this,this.value);b.prototype.complete.call(this)}; return a}(w),bf=function(b){function a(c,a,d,f,k){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=k}h(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var e=[],k=0;k<arguments.length;k++)e[k-0]=arguments[k];return new a(c,b,e,this,d)}};a.prototype._subscribe=function(c){var b=this.callbackFunc,d=this.args,f=this.scheduler,k=this.subject;if(f)return f.schedule(a.dispatch,0,{source:this,subscriber:c,context:this.context});k||(k=this.subject= new O,f=function D(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=D.source,a=b.selector,b=b.subject;a?(c=q(a).apply(this,c),c===n?b.error(n.e):(b.next(c),b.complete())):(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,q(b).apply(this.context,d.concat(f))===n&&k.error(n.e));return k.subscribe(c)};a.dispatch=function(c){var a=this,b=c.source,f=c.subscriber;c=c.context;var k=b.callbackFunc,g=b.args,h=b.scheduler,l=b.subject;if(!l){var l=b.subject=new O,m=function Hb(){for(var c= [],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=Hb.source,b=e.selector,e=e.subject;b?(c=q(b).apply(this,c),c===n?a.add(h.schedule(Eb,0,{err:n.e,subject:e})):a.add(h.schedule(va,0,{value:c,subject:e}))):a.add(h.schedule(va,0,{value:1>=c.length?c[0]:c,subject:e}))};m.source=b;q(k).apply(c,g.concat(m))===n&&l.error(n.e)}a.add(l.subscribe(f))};return a}(g).create;g.bindCallback=bf;var cf=function(b){function a(c,a,d,f,k){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context= f;this.scheduler=k}h(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var e=[],k=0;k<arguments.length;k++)e[k-0]=arguments[k];return new a(c,b,e,this,d)}};a.prototype._subscribe=function(c){var a=this.callbackFunc,b=this.args,f=this.scheduler,k=this.subject;if(f)return f.schedule(Fb,0,{source:this,subscriber:c,context:this.context});k||(k=this.subject=new O,f=function D(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=D.source,a=b.selector,b=b.subject, e=c.shift();e?b.error(e):a?(c=q(a).apply(this,c),c===n?b.error(n.e):(b.next(c),b.complete())):(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,q(a).apply(this.context,b.concat(f))===n&&k.error(n.e));return k.subscribe(c)};return a}(g).create;g.bindNodeCallback=cf;var oa=function(b){function a(c,a){b.call(this);this.value=c;this.scheduler=a;this._isScalar=!0;a&&(this._isScalar=!1)}h(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.value,b=c.subscriber;c.done?b.complete(): (b.next(a),b.closed||(c.done=!0,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.value,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{done:!1,value:b,subscriber:c});c.next(b);c.closed||c.complete()};return a}(g),F=function(b){function a(c){b.call(this);this.scheduler=c}h(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),G=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])}h(a,b);a.create=function(c,b){return new a(c,b)};a.of=function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];b=c[c.length-1];z(b)?c.pop():b=null;var d=c.length;return 1<d?new a(c,b):1===d?new oa(c[0],b):new F(b)};a.dispatch=function(c){var a=c.array,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a[b]),f.closed||(c.index=b+1,this.schedule(c)))}; a.prototype._subscribe=function(c){var b=this.array,d=b.length,f=this.scheduler;if(f)return f.schedule(a.dispatch,0,{array:b,index:0,count:d,subscriber:c});for(f=0;f<d&&!c.closed;f++)c.next(b[f]);c.complete()};return a}(g),t=function(b){function a(){b.apply(this,arguments)}h(a,b);a.prototype.notifyNext=function(c,a,b,f,k){this.destination.next(a)};a.prototype.notifyError=function(c,a){this.destination.error(c)};a.prototype.notifyComplete=function(c){this.destination.complete()};return a}(m),C=function(b){var a= b.Symbol;if("function"===typeof a)return a.iterator||(a.iterator=a("iterator polyfill")),a.iterator;if((a=b.Set)&&"function"===typeof(new a)["@@iterator"])return"@@iterator";if(b=b.Map)for(var a=Object.getOwnPropertyNames(b.prototype),c=0;c<a.length;++c){var e=a[c];if("entries"!==e&&"size"!==e&&b.prototype[e]===b.prototype.entries)return e}return"@@iterator"}(p),ya=function(b){function a(c,a,d){b.call(this);this.parent=c;this.outerValue=a;this.outerIndex=d;this.index=0}h(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}(m),jb={},ja=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new df(a,this.project))};return b}(),df=function(b){function a(c,a){b.call(this,c);this.project=a;this.active=0;this.values=[];this.observables=[]}h(a,b);a.prototype._next=function(c){this.values.push(jb); this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var b=0;b<a;b++){var f=c[b];this.add(r(this,f,f,b))}}};a.prototype.notifyComplete=function(c){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,k){c=this.values;f=c[b];f=this.toRespond?f===jb?--this.toRespond:this.toRespond:0;c[b]=a;0===f&&(this.project?this._tryProject(c):this.destination.next(c.slice()))}; a.prototype._tryProject=function(c){var a;try{a=this.project.apply(this,c)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(t);g.combineLatest=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=a=null;z(b[b.length-1])&&(c=b.pop());"function"===typeof b[b.length-1]&&(a=b.pop());1===b.length&&E(b[0])&&(b=b[0]);return(new G(b,c)).lift(new ja(a))};var Da=G.of,kb=function(b){function a(c,a){b.call(this);this.promise=c;this.scheduler=a}h(a,b);a.create= function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this,b=this.promise,f=this.scheduler;if(null==f)this._isScalar?c.closed||(c.next(this.value),c.complete()):b.then(function(b){a.value=b;a._isScalar=!0;c.closed||(c.next(b),c.complete())},function(a){c.closed||c.error(a)}).then(null,function(c){p.setTimeout(function(){throw c;})});else if(this._isScalar){if(!c.closed)return f.schedule(za,0,{value:this.value,subscriber:c})}else b.then(function(b){a.value=b;a._isScalar=!0;c.closed|| c.add(f.schedule(za,0,{value:b,subscriber:c}))},function(a){c.closed||c.add(f.schedule(Jb,0,{err:a,subscriber:c}))}).then(null,function(c){p.setTimeout(function(){throw c;})})};return a}(g),gf=function(b){function a(c,a){b.call(this);this.scheduler=a;if(null==c)throw Error("iterator cannot be null.");if((a=c[C])||"string"!==typeof c)if(a||void 0===c.length){if(!a)throw new TypeError("object is not iterable");c=c[C]()}else c=new ef(c);else c=new ff(c);this.iterator=c}h(a,b);a.create=function(c,b){return new a(c, b)};a.dispatch=function(c){var a=c.index,b=c.iterator,f=c.subscriber;if(c.hasError)f.error(c.error);else{var k=b.next();k.done?f.complete():(f.next(k.value),c.index=a+1,f.closed?"function"===typeof b.return&&b.return():this.schedule(c))}};a.prototype._subscribe=function(c){var b=this.iterator,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{index:0,iterator:b,subscriber:c});do{d=b.next();if(d.done){c.complete();break}else c.next(d.value);if(c.closed){"function"===typeof b.return&&b.return(); break}}while(1)};return a}(g),ff=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[C]=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}(),ef=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&&p.isFinite(b)){var e;e=+b;e=0===e?e:isNaN(e)?e:0>e?-1:1;b=e*Math.floor(Math.abs(b)); b=0>=b?0:b>lb?lb:b}this.arr=a;this.idx=c;this.len=b}b.prototype[C]=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}(),lb=Math.pow(2,53)-1,hf=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])}h(a,b);a.create=function(c,b){var e=c.length;return 0===e?new F:1===e?new oa(c[0],b):new a(c,b)};a.dispatch=function(c){var a=c.arrayLike, b=c.index,f=c.subscriber;f.closed||(b>=c.length?f.complete():(f.next(a[b]),c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.arrayLike,d=this.scheduler,f=b.length;if(d)return d.schedule(a.dispatch,0,{arrayLike:b,index:0,length:f,subscriber:c});for(d=0;d<f&&!c.closed;d++)c.next(b[d]);c.complete()};return a}(g),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):b.undefinedValueNotification};b.createError=function(a){return new b("E",void 0,a)};b.createComplete=function(){return b.completeNotification};b.completeNotification=new b("C");b.undefinedValueNotification=new b("N",void 0);return b}(),Lb=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 qa(a,this.scheduler,this.delay))};return b}(),qa=function(b){function a(c, a,d){void 0===d&&(d=0);b.call(this,c);this.scheduler=a;this.delay=d}h(a,b);a.dispatch=function(c){c.notification.observe(c.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(c){this.add(this.scheduler.schedule(a.dispatch,this.delay,new jf(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}(m), jf=function(){return function(b,a){this.notification=b;this.destination=a}}(),mb=function(b){function a(c,a){b.call(this,null);this.ish=c;this.scheduler=a}h(a,b);a.create=function(c,b){if(null!=c){if("function"===typeof c[J])return c instanceof g&&!b?c:new a(c,b);if(E(c))return new G(c,b);if(xa(c))return new kb(c,b);if("function"===typeof c[C]||"string"===typeof c)return new gf(c,b);if(c&&"number"===typeof c.length)return new hf(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[J]().subscribe(c):a[J]().subscribe(new qa(c,b,0))};return a}(g),Ca=mb.create,Mb=function(){function b(a,c,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=a;this.resultSelector=c;this.concurrent=b}b.prototype.call=function(a,c){return c.subscribe(new kf(a,this.project,this.resultSelector,this.concurrent))};return b}(),kf=function(b){function a(c,a,d,f){void 0===f&&(f=Number.POSITIVE_INFINITY);b.call(this, c);this.project=a;this.resultSelector=d;this.concurrent=f;this.hasCompleted=!1;this.buffer=[];this.index=this.active=0}h(a,b);a.prototype._next=function(c){this.active<this.concurrent?this._tryNext(c):this.buffer.push(c)};a.prototype._tryNext=function(c){var a,b=this.index++;try{a=this.project(c,b)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(a,c,b)};a.prototype._innerSub=function(c,a,b){this.add(r(this,c,a,b))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&& 0===this.buffer.length&&this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,k){this.resultSelector?this._notifyResultSelector(c,a,b,f):this.destination.next(a)};a.prototype._notifyResultSelector=function(c,a,b,f){var e;try{e=this.resultSelector(c,a,b,f)}catch(B){this.destination.error(B);return}this.destination.next(e)};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}(t);g.concat=R;var mf=function(b){function a(c){b.call(this);this.observableFactory=c}h(a,b);a.create=function(c){return new a(c)};a.prototype._subscribe=function(c){return new lf(c,this.observableFactory)};return a}(g),lf=function(b){function a(c,a){b.call(this,c);this.factory=a;this.tryDefer()}h(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(r(this,c))};return a}(t);g.defer=mf.create; g.empty=F.create;var of=function(b){function a(c,a){b.call(this);this.sources=c;this.resultSelector=a}h(a,b);a.create=function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];if(null===c||0===arguments.length)return new F;b=null;"function"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&E(c[0])&&(c=c[0]);return 0===c.length?new F:new a(c,b)};a.prototype._subscribe=function(c){return new nf(c,this.sources,this.resultSelector)};return a}(g),nf=function(b){function a(c,a,d){b.call(this, c);this.sources=a;this.resultSelector=d;this.haveValues=this.completed=0;this.total=c=a.length;this.values=Array(c);for(d=0;d<c;d++){var e=r(this,a[d],null,d);e&&(e.outerIndex=d,this.add(e))}}h(a,b);a.prototype.notifyNext=function(c,a,b,f,k){this.values[b]=a;k._hasValue||(k._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(c){var a=this.destination,b=this.haveValues,f=this.resultSelector,k=this.values,g=k.length;c._hasValue?(this.completed++,this.completed===g&&(b===g&&(c=f?f.apply(this, k):k,a.next(c)),a.complete())):a.complete()};return a}(t);g.forkJoin=of.create;g.from=Ca;var nb=Object.prototype.toString,pf=function(b){function a(c,a,d,f){b.call(this);this.sourceObj=c;this.eventName=a;this.selector=d;this.options=f}h(a,b);a.create=function(c,b,d,f){x(d)&&(f=d,d=void 0);return new a(c,b,f,d)};a.setupSubscription=function(c,b,d,f,k){var e;if(c&&"[object NodeList]"===nb.call(c)||c&&"[object HTMLCollection]"===nb.call(c))for(var g=0,h=c.length;g<h;g++)a.setupSubscription(c[g],b,d, f,k);else if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(b,d,k),e=function(){return c.removeEventListener(b,d)};else if(c&&"function"===typeof c.on&&"function"===typeof c.off)c.on(b,d),e=function(){return c.off(b,d)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(b,d),e=function(){return c.removeListener(b,d)};else throw new TypeError("Invalid event target");f.add(new v(e))};a.prototype._subscribe= function(c){var b=this.selector;a.setupSubscription(this.sourceObj,this.eventName,b?function(){for(var a=[],e=0;e<arguments.length;e++)a[e-0]=arguments[e];a=q(b).apply(void 0,a);a===n?c.error(n.e):c.next(a)}:function(a){return c.next(a)},c,this.options)};return a}(g).create;g.fromEvent=pf;var qf=function(b){function a(c,a,d){b.call(this);this.addHandler=c;this.removeHandler=a;this.selector=d}h(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=function(c){var a=this,b=this.removeHandler, f=this.selector?function(){for(var b=[],e=0;e<arguments.length;e++)b[e-0]=arguments[e];a._callSelector(c,b)}:function(a){c.next(a)},k=this._callAddHandler(f,c);x(b)&&c.add(new v(function(){b(f,k)}))};a.prototype._callSelector=function(c,a){try{var b=this.selector.apply(this,a);c.next(b)}catch(f){c.error(f)}};a.prototype._callAddHandler=function(c,a){try{return this.addHandler(c)||null}catch(d){a.error(d)}};return a}(g).create;g.fromEventPattern=qf;g.fromPromise=kb.create;var ob=function(b){return b}, rf=function(b){function a(c,a,d,f,k){b.call(this);this.initialState=c;this.condition=a;this.iterate=d;this.resultSelector=f;this.scheduler=k}h(a,b);a.create=function(c,b,d,f,k){return 1==arguments.length?new a(c.initialState,c.condition,c.iterate,c.resultSelector||ob,c.scheduler):void 0===f||z(f)?new a(c,b,d,ob,f):new a(c,b,d,f,k)};a.prototype._subscribe=function(c){var b=this.initialState;if(this.scheduler)return this.scheduler.schedule(a.dispatch,0,{subscriber:c,iterate:this.iterate,condition:this.condition, resultSelector:this.resultSelector,state:b});var d=this.condition,f=this.resultSelector,k=this.iterate;do{if(d){var g=void 0;try{g=d(b)}catch(D){c.error(D);break}if(!g){c.complete();break}}g=void 0;try{g=f(b)}catch(D){c.error(D);break}c.next(g);if(c.closed)break;try{b=k(b)}catch(D){c.error(D);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(B){a.error(B);return}else c.needIterate=!0;if(b){var f=void 0;try{f= b(c.state)}catch(B){a.error(B);return}if(!f){a.complete();return}if(a.closed)return}var k;try{k=c.resultSelector(c.state)}catch(B){a.error(B);return}if(!a.closed&&(a.next(k),!a.closed))return this.schedule(c)}};return a}(g).create;g.generate=rf;var tf=function(b){function a(c,a,d){b.call(this);this.condition=c;this.thenSource=a;this.elseSource=d}h(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=function(c){return new sf(c,this.condition,this.thenSource,this.elseSource)}; return a}(g),sf=function(b){function a(c,a,d,f){b.call(this,c);this.condition=a;this.thenSource=d;this.elseSource=f;this.tryIf()}h(a,b);a.prototype.tryIf=function(){var c=this.condition,a=this.thenSource,b=this.elseSource,f;try{(c=(f=c())?a:b)?this.add(r(this,c)):this._complete()}catch(k){this._error(k)}};return a}(t);g.if=tf.create;var U=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a;this.pending=!1}h(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 p.setInterval(c.flush.bind(c,this),b)};a.prototype.recycleAsyncId=function(c,a,b){void 0===b&&(b=0);return null!==b&&this.delay===b&&!1===this.pending?a:(p.clearInterval(a),void 0)};a.prototype.execute=function(c,a){if(this.closed)return Error("executing a cancelled action"); this.pending=!1;if(c=this._execute(c,a))return c;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(c,a){a=!1;var b=void 0;try{this.work(c)}catch(f){a=!0,b=!!f&&f||Error(f)}if(a)return this.unsubscribe(),b};a.prototype._unsubscribe=function(){var c=this.id,a=this.scheduler,b=a.actions,f=b.indexOf(this);this.state=this.work=null;this.pending=!1;this.scheduler=null;-1!==f&&b.splice(f,1);null!=c&&(this.id=this.recycleAsyncId(a, c,null));this.delay=null};return a}(function(b){function a(c,a){b.call(this)}h(a,b);a.prototype.schedule=function(c,a){return this};return a}(v)),V=function(b){function a(){b.apply(this,arguments);this.actions=[];this.active=!1;this.scheduled=void 0}h(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}()),u=new V(U),uf=function(b){function a(c,a){void 0===c&&(c=0);void 0===a&&(a=u);b.call(this);this.period=c;this.scheduler=a;if(!K(c)||0>c)this.period=0;a&&"function"===typeof a.schedule||(this.scheduler=u)}h(a,b);a.create=function(c,b){void 0===c&&(c=0);void 0===b&&(