UNPKG

rxjs-compat

Version:

[![CircleCI](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x.svg?style=svg)](https://circleci.com/gh/ReactiveX/rxjs/tree/6.x) [![npm version](https://badge.fury.io/js/%40reactivex%2Frxjs.svg)](http://badge.fury.io/js/%40reactivex%2Frxjs) [![Join the chat

111 lines (109 loc) 135 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. *****************************************************************************/ (function(m,h){"object"===typeof exports&&"undefined"!==typeof module?h(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],h):h(m.rxjs={})})(this,function(m){function h(b,a){function c(){this.constructor=b}vd(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function T(b){return"function"===typeof b}function U(b){setTimeout(function(){throw b;},0)}function za(b){return null!==b&&"object"===typeof b}function Wa(b){return b.reduce(function(a,c){return a.concat(c instanceof fa?c.errors:c)},[])}function Aa(b){for(;b;){var a=b.destination,c=b.isStopped;if(b.closed||c)return!1;b=a&&a instanceof l?a:null}return!0}function N(b){return b}function Ba(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return Xa(b)}function Xa(b){return 0===b.length?N:1===b.length?b[0]:function(a){return b.reduce(function(c,a){return a(c)},a)}}function Ya(b){b||(b=E.Promise||Promise);if(!b)throw Error("no Promise impl found");return b}function Ca(){return function(b){return b.lift(new wd(b))}} function Za(b,a,c,d){return function(e){return e.lift(new xd(b,a,c,d))}}function V(b){return b?yd(b):ga}function yd(b){return new g(function(a){return b.schedule(function(){return a.complete()})})}function y(b){return b&&"function"===typeof b.schedule}function Da(b,a){return new g(function(c){var d=new q,e=0;d.add(a.schedule(function(){e===b.length?c.complete():(c.next(b[e++]),c.closed||d.add(this.schedule()))}));return d})}function ha(b,a){return a?Da(b,a):new g($a(b))}function ia(){for(var b=[], a=0;a<arguments.length;a++)b[a]=arguments[a];a=b[b.length-1];return y(a)?(b.pop(),Da(b,a)):ha(b)}function pa(b,a){return a?new g(function(c){return a.schedule(zd,0,{error:b,subscriber:c})}):new g(function(c){return c.error(b)})}function zd(b){b.subscriber.error(b.error)}function ab(b,a){void 0===a&&(a=0);return function(c){return c.lift(new Ad(b,a))}}function bb(b){return b in Ea?(delete Ea[b],!0):!1}function H(){}function A(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 Bd(b,a))}}function cb(b,a,c){if(a)if(y(a))c=a;else return function(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];return cb(b,c).apply(void 0,d).pipe(A(function(c){return z(c)?a.apply(void 0,c):a(c)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var f=this,k,v={context:f,subject:k,callbackFunc:b,scheduler:c};return new g(function(d){if(c)return c.schedule(Cd,0,{args:a,subscriber:d,params:v});if(!k){k=new W;try{b.apply(f,a.concat([function(){for(var c= [],a=0;a<arguments.length;a++)c[a]=arguments[a];k.next(1>=c.length?c[0]:c);k.complete()}]))}catch(O){Aa(k)?k.error(O):console.warn(O)}}return k.subscribe(d)})}}function Cd(b){var a=this,c=b.args,d=b.subscriber;b=b.params;var e=b.callbackFunc,f=b.context,k=b.scheduler,g=b.subject;if(!g){g=b.subject=new W;try{e.apply(f,c.concat([function(){for(var c=[],b=0;b<arguments.length;b++)c[b]=arguments[b];a.add(k.schedule(Dd,0,{value:1>=c.length?c[0]:c,subject:g}))}]))}catch(n){g.error(n)}}this.add(g.subscribe(d))} function Dd(b){var a=b.subject;a.next(b.value);a.complete()}function db(b,a,c){if(a)if(y(a))c=a;else return function(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];return db(b,c).apply(void 0,d).pipe(A(function(c){return z(c)?a.apply(void 0,c):a(c)}))};return function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var f={subject:void 0,args:a,callbackFunc:b,scheduler:c,context:this};return new g(function(d){var e=f.context,k=f.subject;if(c)return c.schedule(Ed,0,{params:f, subscriber:d,context:e});if(!k){k=f.subject=new W;try{b.apply(e,a.concat([function(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];(a=c.shift())?k.error(a):(k.next(1>=c.length?c[0]:c),k.complete())}]))}catch(O){Aa(k)?k.error(O):console.warn(O)}}return k.subscribe(d)})}}function Ed(b){var a=this,c=b.params,d=b.subscriber;b=b.context;var e=c.callbackFunc,f=c.args,k=c.scheduler,g=c.subject;if(!g){g=c.subject=new W;try{e.apply(b,f.concat([function(){for(var c=[],b=0;b<arguments.length;b++)c[b]= arguments[b];(b=c.shift())?a.add(k.schedule(eb,0,{err:b,subject:g})):a.add(k.schedule(Fd,0,{value:1>=c.length?c[0]:c,subject:g}))}]))}catch(n){this.add(k.schedule(eb,0,{err:n,subject:g}))}}this.add(g.subscribe(d))}function Fd(b){var a=b.subject;a.next(b.value);a.complete()}function eb(b){b.subject.error(b.err)}function fb(b){return!!b&&"function"!==typeof b.subscribe&&"function"===typeof b.then}function I(b,a,c,d,e){void 0===e&&(e=new Gd(b,c,d));if(!e.closed)return a instanceof g?a.subscribe(e):Fa(a)(e)} function Hd(b,a){return new g(function(c){var d=new q;d.add(a.schedule(function(){var e=b[X]();d.add(e.subscribe({next:function(b){d.add(a.schedule(function(){return c.next(b)}))},error:function(b){d.add(a.schedule(function(){return c.error(b)}))},complete:function(){d.add(a.schedule(function(){return c.complete()}))}}))}));return d})}function Id(b,a){return new g(function(c){var d=new q;d.add(a.schedule(function(){return b.then(function(b){d.add(a.schedule(function(){c.next(b);d.add(a.schedule(function(){return c.complete()}))}))}, function(b){d.add(a.schedule(function(){return c.error(b)}))})}));return d})}function Jd(b,a){if(!b)throw Error("Iterable cannot be null");return new g(function(c){var d=new q,e;d.add(function(){e&&"function"===typeof e.return&&e.return()});d.add(a.schedule(function(){e=b[F]();d.add(a.schedule(function(){if(!c.closed){var a,b;try{var d=e.next();a=d.value;b=d.done}catch(n){c.error(n);return}b?c.complete():(c.next(a),this.schedule())}}))}));return d})}function Kd(b,a){if(null!=b){if(b&&"function"=== typeof b[X])return Hd(b,a);if(fb(b))return Id(b,a);if(gb(b))return Da(b,a);if(b&&"function"===typeof b[F]||"string"===typeof b)return Jd(b,a)}throw new TypeError((null!==b&&typeof b||b)+" is not observable");}function G(b,a){return a?Kd(b,a):b instanceof g?b:new g(Fa(b))}function u(b,a){if(!a.closed){if(b instanceof g)return b.subscribe(a);var c;try{c=Fa(b)(a)}catch(d){a.error(d)}return c}}function J(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(d){return d.pipe(J(function(c, d){return G(b(c,d)).pipe(A(function(b,e){return a(c,b,d,e)}))},c))};"number"===typeof a&&(c=a);return function(a){return a.lift(new Ld(b,c))}}function qa(b){void 0===b&&(b=Number.POSITIVE_INFINITY);return J(N,b)}function Ga(){return qa(1)}function Y(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return Ga()(ia.apply(void 0,b))}function Ha(b){return new g(function(a){var c;try{c=b()}catch(d){a.error(d);return}return(c?G(c):V()).subscribe(a)})}function ra(b,a){return new g(function(c){var d= b.length;if(0===d)c.complete();else for(var e=Array(d),f=0,k=0,g=function(g){var v=G(b[g]),h=!1;c.add(v.subscribe({next:function(c){h||(h=!0,k++);e[g]=c},error:function(a){return c.error(a)},complete:function(){f++;f!==d&&h||(k===d&&c.next(a?a.reduce(function(c,a,b){return c[a]=e[b],c},{}):e),c.complete())}}))},h=0;h<d;h++)g(h)})}function hb(b,a,c,d){T(c)&&(d=c,c=void 0);return d?hb(b,a,c).pipe(A(function(c){return z(c)?d.apply(void 0,c):d(c)})):new g(function(d){ib(b,a,function(c){1<arguments.length? d.next(Array.prototype.slice.call(arguments)):d.next(c)},d,c)})}function ib(b,a,c,d,e){var f;if(b&&"function"===typeof b.addEventListener&&"function"===typeof b.removeEventListener)b.addEventListener(a,c,e),f=function(){return b.removeEventListener(a,c,e)};else if(b&&"function"===typeof b.on&&"function"===typeof b.off)b.on(a,c),f=function(){return b.off(a,c)};else if(b&&"function"===typeof b.addListener&&"function"===typeof b.removeListener)b.addListener(a,c),f=function(){return b.removeListener(a, c)};else if(b&&b.length)for(var k=0,g=b.length;k<g;k++)ib(b[k],a,c,d,e);else throw new TypeError("Invalid event target");d.add(f)}function jb(b,a,c){return c?jb(b,a).pipe(A(function(a){return z(a)?c.apply(void 0,a):c(a)})):new g(function(c){var d=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return c.next(1===a.length?a[0]:a)},f;try{f=b(d)}catch(k){c.error(k);return}if(T(a))return function(){return a(d,f)}})}function Pd(b){var a=b.subscriber,c=b.condition;if(!a.closed){if(b.needIterate)try{b.state= b.iterate(b.state)}catch(f){a.error(f);return}else b.needIterate=!0;if(c){var d=void 0;try{d=c(b.state)}catch(f){a.error(f);return}if(!d){a.complete();return}if(a.closed)return}var e;try{e=b.resultSelector(b.state)}catch(f){a.error(f);return}if(!a.closed&&(a.next(e),!a.closed))return this.schedule(b)}}function K(b){return!z(b)&&0<=b-parseFloat(b)+1}function Qd(b){var a=b.subscriber,c=b.counter;b=b.period;a.next(c);this.schedule({subscriber:a,counter:c+1,period:b},b)}function Ia(){for(var b=[],a=0;a< arguments.length;a++)b[a]=arguments[a];var a=Number.POSITIVE_INFINITY,c=null,d=b[b.length-1];y(d)?(c=b.pop(),1<b.length&&"number"===typeof b[b.length-1]&&(a=b.pop())):"number"===typeof d&&(a=b.pop());return null===c&&1===b.length&&b[0]instanceof g?b[0]:qa(a)(ha(b,c))}function Ja(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];if(0===b.length)return ga;var c=b[0],d=b.slice(1);return 1===b.length&&z(c)?Ja.apply(void 0,c):new g(function(a){var b=function(){return a.add(Ja.apply(void 0,d).subscribe(a))}; return G(c).subscribe({next:function(c){a.next(c)},error:b,complete:b})})}function Rd(b){var a=b.keys,c=b.index,d=b.subscriber,e=b.subscription;b=b.obj;if(!d.closed)if(c<a.length){var f=a[c];d.next([f,b[f]]);e.add(this.schedule({keys:a,index:c+1,subscriber:d,subscription:e,obj:b}))}else d.complete()}function Sd(b,a){function c(){return!c.pred.apply(c.thisArg,arguments)}c.pred=b;c.thisArg=a;return c}function P(b,a){return function(c){return c.lift(new Td(b,a))}}function kb(){for(var b=[],a=0;a<arguments.length;a++)b[a]= arguments[a];if(1===b.length)if(z(b[0]))b=b[0];else return b[0];return ha(b,void 0).lift(new Ud)}function Vd(b){var a=b.start,c=b.index,d=b.subscriber;c>=b.count?d.complete():(d.next(a),d.closed||(b.index=c+1,b.start=a+1,this.schedule(b)))}function lb(b,a,c){void 0===b&&(b=0);var d=-1;K(a)?d=1>Number(a)&&1||Number(a):y(a)&&(c=a);y(c)||(c=B);return new g(function(a){var e=K(b)?b:+b-c.now();return c.schedule(Wd,e,{index:0,period:d,subscriber:a})})}function Wd(b){var a=b.index,c=b.period,d=b.subscriber; d.next(a);if(!d.closed){if(-1===c)return d.complete();b.index=a+1;this.schedule(b,c)}}function Ka(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];a=b[b.length-1];"function"===typeof a&&b.pop();return ha(b,void 0).lift(new mb(a))}function Xd(b,a){void 0===a&&(a=null);return new Q({method:"GET",url:b,headers:a})}function Yd(b,a,c){return new Q({method:"POST",url:b,body:a,headers:c})}function Zd(b,a){return new Q({method:"DELETE",url:b,headers:a})}function $d(b,a,c){return new Q({method:"PUT", url:b,body:a,headers:c})}function ae(b,a,c){return new Q({method:"PATCH",url:b,body:a,headers:c})}function be(b,a){return ce(new Q({method:"GET",url:b,responseType:"json",headers:a}))}function nb(b,a){switch(b){case "json":return b="response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null"),b;case "xml":return a.responseXML;default:return"response"in a?a.response:a.responseText}}function ob(b){return new pb(b)}function qb(b){void 0=== b&&(b=B);return A(function(a){return new rb(a,b.now())})}function Z(b,a){var c=!1;2<=arguments.length&&(c=!0);return function(d){return d.lift(new de(b,a,c))}}function sb(b){void 0===b&&(b=B);return function(a){return Ha(function(){return a.pipe(Z(function(c,a){c=c.current;return{value:a,current:b.now(),last:c}},{current:b.now(),value:void 0,last:void 0}),A(function(c){return new tb(c.value,c.current-c.last)}))})}}function ub(b,a){void 0===a&&(a=sa);return function(c){return c.lift(new ee(b,!!a.leading, !!a.trailing))}}function vb(b,a){for(var c=0,d=a.length;c<d;c++)for(var e=a[c],f=Object.getOwnPropertyNames(e.prototype),k=0,g=f.length;k<g;k++){var h=f[k];b.prototype[h]=e.prototype[h]}}function La(b){return function(a){return a.lift(new fe(b))}}function wb(b,a){void 0===a&&(a=B);return La(function(){return lb(b,a)})}function xb(b){return function(a){return a.lift(new ge(b))}}function yb(b,a){void 0===a&&(a=null);return function(c){return c.lift(new he(b,a))}}function zb(b){var a=arguments.length, c=B;y(arguments[arguments.length-1])&&(c=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 ie(b,d,e,c))}}function Ab(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 je(b){var a=b.bufferCreationInterval,c=b.bufferTimeSpan,d=b.subscriber,e=b.scheduler,f=d.openContext();d.closed||(d.add(f.closeAction= e.schedule(Bb,c,{subscriber:d,context:f})),this.schedule(b,a))}function Bb(b){b.subscriber.closeContext(b.context)}function Cb(b,a){return function(c){return c.lift(new ke(b,a))}}function Db(b){return function(a){return a.lift(new le(b))}}function Eb(b){return function(a){var c=new me(b);a=a.lift(c);return c.caught=a}}function Fb(b){return function(a){return a.lift(new ta(b))}}function Ma(b,a){return J(b,a,1)}function Gb(b,a){return Ma(function(){return b},a)}function Hb(b){return function(a){return a.lift(new ne(b, a))}}function Ib(b){return function(a){return a.lift(new oe(b))}}function Jb(b,a){void 0===a&&(a=B);return function(c){return c.lift(new pe(b,a))}}function qe(b){b.debouncedNext()}function aa(b){void 0===b&&(b=null);return function(a){return a.lift(new re(b))}}function Kb(b,a){void 0===a&&(a=B);var c=b instanceof Date&&!isNaN(+b)?+b-a.now():Math.abs(b);return function(b){return b.lift(new se(c,a))}}function Lb(b,a){return a?function(c){return(new te(c,a)).lift(new Mb(b))}:function(c){return c.lift(new Mb(b))}} function Nb(){return function(b){return b.lift(new ue)}}function Ob(b,a){return function(c){return c.lift(new ve(b,a))}}function Na(b,a){return function(c){return c.lift(new we(b,a))}}function Pb(b,a){return Na(function(c,d){return a?a(c[b],d[b]):c[b]===d[b]})}function ua(b){void 0===b&&(b=xe);return function(a){return a.lift(new ye(b))}}function xe(){return new ja}function va(b){return function(a){return 0===b?V():a.lift(new ze(b))}}function Qb(b,a){if(0>b)throw new ba;var c=2<=arguments.length; return function(d){return d.pipe(P(function(c,a){return a===b}),va(1),c?aa(a):ua(function(){return new ba}))}}function Rb(b,a){return function(c){return c.lift(new Ae(b,a,c))}}function Sb(){return function(b){return b.lift(new Be)}}function Oa(b,a){return a?function(c){return c.pipe(Oa(function(c,e){return G(b(c,e)).pipe(A(function(b,d){return a(c,b,e,d)}))}))}:function(c){return c.lift(new Ce(b))}}function Tb(b,a,c){void 0===a&&(a=Number.POSITIVE_INFINITY);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return function(d){return d.lift(new De(b, a,c))}}function Ub(b){return function(a){return a.lift(new Ee(b))}}function Vb(b,a){if("function"!==typeof b)throw new TypeError("predicate is not a function");return function(c){return c.lift(new Wb(b,c,!1,a))}}function Xb(b,a){return function(c){return c.lift(new Wb(b,c,!0,a))}}function Yb(b,a){var c=2<=arguments.length;return function(d){return d.pipe(b?P(function(c,a){return b(c,a,d)}):N,va(1),c?aa(a):ua(function(){return new ja}))}}function Zb(){return function(b){return b.lift(new Fe)}}function $b(){return function(b){return b.lift(new Ge)}} function ka(b){return function(a){return 0===b?V():a.lift(new He(b))}}function ac(b,a){var c=2<=arguments.length;return function(d){return d.pipe(b?P(function(c,a){return b(c,a,d)}):N,ka(1),c?aa(a):ua(function(){return new ja}))}}function bc(b){return function(a){return a.lift(new Ie(b))}}function cc(){return function(b){return b.lift(new Je)}}function ca(b,a){return 2<=arguments.length?function(c){return Ba(Z(b,a),ka(1),aa(a))(c)}:function(c){return Ba(Z(function(c,a,f){return b(c,a,f+1)}),ka(1))(c)}} function dc(b){return ca("function"===typeof b?function(a,c){return 0<b(a,c)?a:c}:function(a,c){return a>c?a:c})}function ec(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);if("function"===typeof a)return J(function(){return b},a,c);"number"===typeof a&&(c=a);return J(function(){return b},c)}function fc(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return function(d){return d.lift(new Ke(b,a,c))}}function gc(b){return ca("function"===typeof b?function(a,c){return 0>b(a,c)?a:c}:function(a,c){return a< c?a:c})}function L(b,a){return function(c){var d;d="function"===typeof b?b:function(){return b};if("function"===typeof a)return c.lift(new Le(d,a));var e=Object.create(c,Me);e.source=c;e.subjectFactory=d;return e}}function hc(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];1===b.length&&z(b[0])&&(b=b[0]);return function(c){return c.lift(new Ne(b))}}function ic(){return function(b){return b.lift(new Oe)}}function jc(b,a){return function(c){return[P(b,a)(c),P(Sd(b,a))(c)]}}function kc(){for(var b= [],a=0;a<arguments.length;a++)b[a]=arguments[a];var c=b.length;if(0===c)throw Error("list of properties cannot be empty.");return function(a){return A(Pe(b,c))(a)}}function Pe(b,a){return function(c){var d=c;for(c=0;c<a;c++)if(d=null!=d?d[b[c]]:void 0,void 0===d)return;return d}}function lc(b){return b?L(function(){return new w},b):L(new w)}function mc(b){return function(a){return L(new nc(b))(a)}}function oc(){return function(b){return L(new W)(b)}}function pc(b,a,c,d){c&&"function"!==typeof c&& (d=c);var e="function"===typeof c?c:void 0,f=new da(b,a,d);return function(c){return L(function(){return f},e)(c)}}function qc(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return function(c){1===b.length&&z(b[0])&&(b=b[0]);return c.lift.call(kb.apply(void 0,[c].concat(b)))}}function rc(b){void 0===b&&(b=-1);return function(a){return 0===b?V():0>b?a.lift(new sc(-1,a)):a.lift(new sc(b-1,a))}}function tc(b){return function(a){return a.lift(new Qe(b))}}function uc(b){void 0===b&&(b=-1); return function(a){return a.lift(new Re(b,a))}}function vc(b){return function(a){return a.lift(new Se(b,a))}}function wc(b){return function(a){return a.lift(new Te(b))}}function xc(b,a){void 0===a&&(a=B);return function(c){return c.lift(new Ue(b,a))}}function Ve(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function yc(b,a){return function(c){return c.lift(new We(b,a))}}function Xe(){return new w}function zc(){return function(b){return Ca()(L(Xe)(b))}}function Pa(b,a,c){var d;d=b&& "object"===typeof b?b:{bufferSize:b,windowTime:a,refCount:!1,scheduler:c};return function(c){return c.lift(Ye(d))}}function Ye(b){var a=b.bufferSize,c=void 0===a?Number.POSITIVE_INFINITY:a,a=b.windowTime,d=void 0===a?Number.POSITIVE_INFINITY:a,e=b.refCount,f=b.scheduler,k,g=0,h,l=!1,p=!1;return function(a){g++;var b;!k||l?(l=!1,k=new da(c,d,f),b=k.subscribe(this),h=a.subscribe({next:function(c){k.next(c)},error:function(c){l=!0;k.error(c)},complete:function(){p=!0;h=void 0;k.complete()}}),p&&(h=void 0)): b=k.subscribe(this);this.add(function(){g--;b.unsubscribe();b=void 0;h&&!p&&e&&0===g&&(h.unsubscribe(),k=h=void 0)})}}function Ac(b){return function(a){return a.lift(new Ze(b,a))}}function Bc(b){return function(a){return a.lift(new $e(b))}}function Cc(b){return function(a){return a.lift(new af(b))}}function Dc(b){return function(a){return a.lift(new bf(b))}}function Ec(b){return function(a){return a.lift(new cf(b))}}function Fc(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];var c=b[b.length- 1];return y(c)?(b.pop(),function(a){return Y(b,a,c)}):function(c){return Y(b,c)}}function Gc(b,a){void 0===a&&(a=0);return function(c){return c.lift(new df(b,a))}}function ea(b,a){return"function"===typeof a?function(c){return c.pipe(ea(function(c,e){return G(b(c,e)).pipe(A(function(b,d){return a(c,b,e,d)}))}))}:function(c){return c.lift(new ef(b))}}function Hc(){return ea(N)}function Ic(b,a){return a?ea(function(){return b},a):ea(function(){return b})}function Jc(b){return function(a){return a.lift(new ff(b))}} function Kc(b,a){void 0===a&&(a=!1);return function(c){return c.lift(new gf(b,a))}}function Lc(b,a,c){return function(d){return d.lift(new hf(b,a,c))}}function Mc(b,a,c){void 0===a&&(a=B);void 0===c&&(c=sa);return function(d){return d.lift(new jf(b,a,c.leading,c.trailing))}}function kf(b){b.subscriber.clearThrottle()}function Qa(b,a,c){void 0===c&&(c=B);return function(d){var e=b instanceof Date&&!isNaN(+b),f=e?+b-c.now():Math.abs(b);return d.lift(new lf(f,e,a,c))}}function Nc(b,a){void 0===a&&(a= B);return Qa(b,pa(new Oc),a)}function mf(b,a,c){if(0===c)return[a];b.push(a);return b}function Pc(){return ca(mf,[])}function Qc(b){return function(a){return a.lift(new nf(b))}}function Rc(b,a){void 0===a&&(a=0);return function(c){return c.lift(new of(b,a))}}function Sc(b,a,c,d){var e=B,f=null,k=Number.POSITIVE_INFINITY;y(d)&&(e=d);y(c)?e=c:K(c)&&(k=Number(c));y(a)?e=a:K(a)&&(f=Number(a));return function(c){return c.lift(new pf(b,f,k,e))}}function qf(b){var a=b.subscriber,c=b.windowTimeSpan,d=b.window; d&&a.closeWindow(d);b.window=a.openWindow();this.schedule(b,c)}function rf(b){var a=b.windowTimeSpan,c=b.subscriber,d=b.scheduler,e=b.windowCreationInterval,f=c.openWindow(),k={action:this,subscription:null};k.subscription=d.schedule(Tc,a,{subscriber:c,window:f,context:k});this.add(k.subscription);this.schedule(b,e)}function Tc(b){var a=b.subscriber,c=b.window;(b=b.context)&&b.action&&b.subscription&&b.action.remove(b.subscription);a.closeWindow(c)}function Uc(b,a){return function(c){return c.lift(new sf(b, a))}}function Vc(b){return function(a){return a.lift(new tf(b))}}function Wc(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return function(c){var a;"function"===typeof b[b.length-1]&&(a=b.pop());return c.lift(new uf(b,a))}}function Xc(b){return function(a){return a.lift(new mb(b))}}function Yc(b){return Eb(b)(this)}function Zc(b,a,c){return Lc(b,a,c)(this)}function $c(b){return Ub(b)(this)}function ad(b){return b(this)}function bd(b,a){void 0===a&&(a=Number.POSITIVE_INFINITY);return J(b, a)(this)}function cd(b,a){void 0===a&&(a=Number.POSITIVE_INFINITY);return ec(b,a)(this)}function dd(){return Hc()(this)}var vd=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])},vf=Object.assign||function(b){for(var a,c=1,d=arguments.length;c<d;c++){a=arguments[c];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(b[e]=a[e])}return b},Ra=!1,E={Promise:void 0,set useDeprecatedSynchronousErrorHandling(b){b? console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):Ra&&console.log("RxJS: Back to a better error behavior. Thank you. \x3c3");Ra=b},get useDeprecatedSynchronousErrorHandling(){return Ra}},wa={closed:!0,next:function(b){},error:function(b){if(E.useDeprecatedSynchronousErrorHandling)throw b;U(b)},complete:function(){}},z=function(){return Array.isArray||function(b){return b&&"number"===typeof b.length}}(),fa=function(){function b(a){Error.call(this); this.message=a?a.length+" errors occurred during unsubscription:\n"+a.map(function(c,a){return a+1+") "+c.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors=a;return this}b.prototype=Object.create(Error.prototype);return b}(),q=function(){function b(a){this.closed=!1;this._subscriptions=this._parentOrParents=null;a&&(this._ctorUnsubscribe=!0,this._unsubscribe=a)}b.prototype.unsubscribe=function(){var a;if(!this.closed){var c=this._parentOrParents,d=this._ctorUnsubscribe,e=this._unsubscribe, f=this._subscriptions;this.closed=!0;this._subscriptions=this._parentOrParents=null;if(c instanceof b)c.remove(this);else if(null!==c)for(var k=0;k<c.length;++k)c[k].remove(this);if(T(e)){d&&(this._unsubscribe=void 0);try{e.call(this)}catch(v){a=v instanceof fa?Wa(v.errors):[v]}}if(z(f))for(k=-1,c=f.length;++k<c;)if(d=f[k],za(d))try{d.unsubscribe()}catch(v){a=a||[],v instanceof fa?a=a.concat(Wa(v.errors)):a.push(v)}if(a)throw new fa(a);}};b.prototype.add=function(a){var c=a;if(!a)return b.EMPTY;switch(typeof a){case "function":c= new b(a);case "object":if(c===this||c.closed||"function"!==typeof c.unsubscribe)return c;if(this.closed)return c.unsubscribe(),c;c instanceof b||(a=c,c=new b,c._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}a=c._parentOrParents;if(null===a)c._parentOrParents=this;else if(a instanceof b){if(a===this)return c;c._parentOrParents=[a,this]}else if(-1===a.indexOf(this))a.push(this);else return c;a=this._subscriptions;null===a?this._subscriptions=[c]: a.push(c);return c};b.prototype.remove=function(a){var c=this._subscriptions;c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))};b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),la="function"===typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),l=function(b){function a(c,d,e){var f=b.call(this)||this;f.syncErrorValue=null;f.syncErrorThrown=!1;f.syncErrorThrowable=!1;f.isStopped=!1;switch(arguments.length){case 0:f.destination=wa;break;case 1:if(!c){f.destination=wa;break}if("object"=== typeof c){c instanceof a?(f.syncErrorThrowable=c.syncErrorThrowable,f.destination=c,c.add(f)):(f.syncErrorThrowable=!0,f.destination=new ed(f,c));break}default:f.syncErrorThrowable=!0,f.destination=new ed(f,c,d,e)}return f}h(a,b);a.prototype[la]=function(){return this};a.create=function(c,b,e){c=new a(c,b,e);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._parentOrParents;this._parentOrParents=null;this.unsubscribe(); this.isStopped=this.closed=!1;this._parentOrParents=c;return this};return a}(q),ed=function(b){function a(c,a,e,f){var d=b.call(this)||this;d._parentSubscriber=c;var g;c=d;T(a)?g=a:a&&(g=a.next,e=a.error,f=a.complete,a!==wa&&(c=Object.create(a),T(c.unsubscribe)&&d.add(c.unsubscribe.bind(c)),c.unsubscribe=d.unsubscribe.bind(d)));d._context=c;d._next=g;d._error=e;d._complete=f;return d}h(a,b);a.prototype.next=function(c){if(!this.isStopped&&this._next){var a=this._parentSubscriber;E.useDeprecatedSynchronousErrorHandling&& 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,b=E.useDeprecatedSynchronousErrorHandling;if(this._error)b&&a.syncErrorThrowable?this.__tryOrSetError(a,this._error,c):this.__tryOrUnsub(this._error,c),this.unsubscribe();else if(a.syncErrorThrowable)b?(a.syncErrorValue=c,a.syncErrorThrown=!0):U(c),this.unsubscribe();else{this.unsubscribe();if(b)throw c;U(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)};E.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,b):this.__tryOrUnsub(b)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(c,a){try{c.call(this._context,a)}catch(e){this.unsubscribe();if(E.useDeprecatedSynchronousErrorHandling)throw e;U(e)}};a.prototype.__tryOrSetError=function(c,a,b){if(!E.useDeprecatedSynchronousErrorHandling)throw Error("bad call"); try{a.call(this._context,b)}catch(f){return E.useDeprecatedSynchronousErrorHandling?(c.syncErrorValue=f,c.syncErrorThrown=!0):U(f),!0}return!1};a.prototype._unsubscribe=function(){var c=this._parentSubscriber;this._parentSubscriber=this._context=null;c.unsubscribe()};return a}(l),X="function"===typeof Symbol&&Symbol.observable||"@@observable",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 d=this.operator;a:{if(a){if(a instanceof l)break a;if(a[la]){a=a[la]();break a}}a=a||c||b?new l(a,c,b):new l(wa)}d?a.add(d.call(a,this.source)):a.add(this.source||E.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a));if(E.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};b.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(c){E.useDeprecatedSynchronousErrorHandling&& (a.syncErrorThrown=!0,a.syncErrorValue=c),Aa(a)?a.error(c):console.warn(c)}};b.prototype.forEach=function(a,c){var b=this;c=Ya(c);return new c(function(c,d){var e;e=b.subscribe(function(c){try{a(c)}catch(n){d(n),e&&e.unsubscribe()}},d,c)})};b.prototype._subscribe=function(a){var c=this.source;return c&&c.subscribe(a)};b.prototype[X]=function(){return this};b.prototype.pipe=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return 0===a.length?this:Xa(a)(this)};b.prototype.toPromise= function(a){var c=this;a=Ya(a);return new a(function(a,b){var d;c.subscribe(function(c){return d=c},function(c){return b(c)},function(){return a(d)})})};b.create=function(a){return new b(a)};return b}(),M=function(){function b(){Error.call(this);this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}b.prototype=Object.create(Error.prototype);return b}(),fd=function(b){function a(c,a){var d=b.call(this)||this;d.subject=c;d.subscriber=a;d.closed=!1;return d}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}(q),gd=function(b){function a(c){var a=b.call(this,c)||this;a.destination=c;return a}h(a,b);return a}(l),w=function(b){function a(){var c=b.call(this)||this;c.observers=[];c.closed=!1;c.isStopped=!1;c.hasError=!1;c.thrownError=null;return c}h(a,b);a.prototype[la]=function(){return new gd(this)};a.prototype.lift= function(c){var a=new xa(this,this);a.operator=c;return a};a.prototype.next=function(c){if(this.closed)throw new M;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 M;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 M;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 M;return b.prototype._trySubscribe.call(this,c)};a.prototype._subscribe=function(c){if(this.closed)throw new M;if(this.hasError)return c.error(this.thrownError),q.EMPTY;if(this.isStopped)return c.complete(),q.EMPTY;this.observers.push(c);return new fd(this,c)}; a.prototype.asObservable=function(){var c=new g;c.source=this;return c};a.create=function(c,a){return new xa(c,a)};return a}(g),xa=function(b){function a(c,a){var d=b.call(this)||this;d.destination=c;d.source=a;return d}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):q.EMPTY};return a}(w),wd=function(){function b(a){this.connectable=a}b.prototype.call=function(a,c){var b=this.connectable;b._refCount++;a=new wf(a,b);c=c.subscribe(a);a.closed||(a.connection=b.connect());return c};return b}(),wf=function(b){function a(c,a){c=b.call(this,c)||this;c.connectable=a;return c}h(a,b);a.prototype._unsubscribe=function(){var c=this.connectable;if(c){this.connectable=null;var a=c._refCount;0>=a?this.connection=null:(c._refCount= a-1,1<a?this.connection=null:(a=this.connection,c=c._connection,this.connection=null,!c||a&&c!==a||c.unsubscribe()))}else this.connection=null};return a}(l),hd=function(b){function a(c,a){var d=b.call(this)||this;d.source=c;d.subjectFactory=a;d._refCount=0;d._isComplete=!1;return d}h(a,b);a.prototype._subscribe=function(c){return this.getSubject().subscribe(c)};a.prototype.getSubject=function(){var c=this._subject;if(!c||c.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect= function(){var c=this._connection;c||(this._isComplete=!1,c=this._connection=new q,c.add(this.source.subscribe(new xf(this.getSubject(),this))),c.closed&&(this._connection=null,c=q.EMPTY));return c};a.prototype.refCount=function(){return Ca()(this)};return a}(g),Me=function(){var b=hd.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:b._subscribe},_isComplete:{value:b._isComplete,writable:!0}, getSubject:{value:b.getSubject},connect:{value:b.connect},refCount:{value:b.refCount}}}(),xf=function(b){function a(c,a){c=b.call(this,c)||this;c.connectable=a;return c}h(a,b);a.prototype._error=function(c){this._unsubscribe();b.prototype._error.call(this,c)};a.prototype._complete=function(){this.connectable._isComplete=!0;this._unsubscribe();b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var c=this.connectable;if(c){this.connectable=null;var a=c._connection;c._refCount=0;c._subject= null;c._connection=null;a&&a.unsubscribe()}};return a}(gd);(function(b){function a(c,a){c=b.call(this,c)||this;c.connectable=a;return c}h(a,b);a.prototype._unsubscribe=function(){var c=this.connectable;if(c){this.connectable=null;var a=c._refCount;0>=a?this.connection=null:(c._refCount=a-1,1<a?this.connection=null:(a=this.connection,c=c._connection,this.connection=null,!c||a&&c!==a||c.unsubscribe()))}else this.connection=null};return a})(l);var xd=function(){function b(a,c,b,e){this.keySelector=a; this.elementSelector=c;this.durationSelector=b;this.subjectSelector=e}b.prototype.call=function(a,c){return c.subscribe(new yf(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return b}(),yf=function(b){function a(c,a,e,f,k){c=b.call(this,c)||this;c.keySelector=a;c.elementSelector=e;c.durationSelector=f;c.subjectSelector=k;c.groups=null;c.attemptedToUnsubscribe=!1;c.count=0;return c}h(a,b);a.prototype._next=function(c){var a;try{a=this.keySelector(c)}catch(e){this.error(e); return}this._group(c,a)};a.prototype._group=function(c,a){var b=this.groups;b||(b=this.groups=new Map);var d=b.get(a),k;if(this.elementSelector)try{k=this.elementSelector(c)}catch(v){this.error(v)}else k=c;if(!d&&(d=this.subjectSelector?this.subjectSelector():new w,b.set(a,d),c=new id(a,d,this),this.destination.next(c),this.durationSelector)){c=void 0;try{c=this.durationSelector(new id(a,d))}catch(v){this.error(v);return}this.add(c.subscribe(new zf(a,d,this)))}d.closed||d.next(k)};a.prototype._error= function(c){var a=this.groups;a&&(a.forEach(function(a,b){a.error(c)}),a.clear());this.destination.error(c)};a.prototype._complete=function(){var c=this.groups;c&&(c.forEach(function(c,a){c.complete()}),c.clear());this.destination.complete()};a.prototype.removeGroup=function(c){this.groups.delete(c)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&b.prototype.unsubscribe.call(this))};return a}(l),zf=function(b){function a(c,a,e){var d=b.call(this,a)|| this;d.key=c;d.group=a;d.parent=e;return d}h(a,b);a.prototype._next=function(c){this.complete()};a.prototype._unsubscribe=function(){var c=this.parent,a=this.key;this.key=this.parent=null;c&&c.removeGroup(a)};return a}(l),id=function(b){function a(c,a,e){var d=b.call(this)||this;d.key=c;d.groupSubject=a;d.refCountSubscription=e;return d}h(a,b);a.prototype._subscribe=function(c){var a=new q,b=this.refCountSubscription,f=this.groupSubject;b&&!b.closed&&a.add(new Af(b));a.add(f.subscribe(c));return a}; return a}(g),Af=function(b){function a(c){var a=b.call(this)||this;a.parent=c;c.count++;return a}h(a,b);a.prototype.unsubscribe=function(){var c=this.parent;c.closed||this.closed||(b.prototype.unsubscribe.call(this),--c.count,0===c.count&&c.attemptedToUnsubscribe&&c.unsubscribe())};return a}(q),nc=function(b){function a(c){var a=b.call(this)||this;a._value=c;return a}h(a,b);Object.defineProperty(a.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe= function(c){var a=b.prototype._subscribe.call(this,c);a&&!a.closed&&c.next(this._value);return a};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new M;return this._value};a.prototype.next=function(c){b.prototype.next.call(this,this._value=c)};return a}(w),ma=function(b){function a(c,a){var d=b.call(this,c,a)||this;d.scheduler=c;d.work=a;d.pending=!1;return d}h(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(this.closed)return this;this.state= c;c=this.id;var b=this.scheduler;null!=c&&(this.id=this.recycleAsyncId(b,c,a));this.pending=!0;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 setInterval(c.flush.bind(c,this),b)};a.prototype.recycleAsyncId=function(c,a,b){void 0===b&&(b=0);if(null!==b&&this.delay===b&&!1===this.pending)return a;clearInterval(a)};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){return b.call(this)||this}h(a,b);a.prototype.schedule=function(c,a){return this};return a}(q)),Bf=function(b){function a(c,a){var d=b.call(this,c,a)||this;d.scheduler=c;d.work=a;return d}h(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(0<a)return b.prototype.schedule.call(this,c,a);this.delay=a;this.state=c;this.scheduler.flush(this);return this};a.prototype.execute=function(c,a){return 0<a||this.closed?b.prototype.execute.call(this, c,a):this._execute(c,a)};a.prototype.requestAsyncId=function(c,a,e){void 0===e&&(e=0);return null!==e&&0<e||null===e&&0<this.delay?b.prototype.requestAsyncId.call(this,c,a,e):c.flush(this)};return a}(ma),jd=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=function(){return Date.now()};return b}(),R=function(b){function a(c,d){void 0===d&&(d=jd.now); var e=b.call(this,c,function(){return a.delegate&&a.delegate!==e?a.delegate.now():d()})||this;e.actions=[];e.active=!1;e.scheduled=void 0;return e}h(a,b);a.prototype.schedule=function(c,d,e){void 0===d&&(d=0);return a.delegate&&a.delegate!==this?a.delegate.schedule(c,d,e):b.prototype.schedule.call(this,c,d,e)};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}(jd),kd=new (function(b){function a(){return null!==b&&b.apply(this,arguments)||this}h(a,b);return a}(R))(Bf),ga=new g(function(b){return b.complete()}),$a=function(b){return function(a){for(var c=0,d=b.length;c<d&&!a.closed;c++)a.next(b[c]);a.complete()}},ld;(function(b){b.NEXT="N";b.ERROR="E";b.COMPLETE="C"})(ld||(ld={}));var x=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 ia(this.value);case "E":return pa(this.error);case "C":return V()}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}(),Ad=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 md(a,this.scheduler,this.delay))};return b}(),md=function(b){function a(c, a,e){void 0===e&&(e=0);c=b.call(this,c)||this;c.scheduler=a;c.delay=e;return c}h(a,b);a.dispatch=function(c){c.notification.observe(c.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(c){this.destination.add(this.scheduler.schedule(a.dispatch,this.delay,new Cf(c,this.destination)))};a.prototype._next=function(c){this.scheduleMessage(x.createNext(c))};a.prototype._error=function(c){this.scheduleMessage(x.createError(c));this.unsubscribe()};a.prototype._complete=function(){this.scheduleMessage(x.createComplete()); this.unsubscribe()};return a}(l),Cf=function(){return function(b,a){this.notification=b;this.destination=a}}(),da=function(b){function a(c,a,e){void 0===c&&(c=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);var d=b.call(this)||this;d.scheduler=e;d._events=[];d._infiniteTimeWindow=!1;d._bufferSize=1>c?1:c;d._windowTime=1>a?1:a;a===Number.POSITIVE_INFINITY?(d._infiniteTimeWindow=!0,d.next=d.nextInfiniteTimeWindow):d.next=d.nextTimeWindow;return d}h(a,b);a.prototype.nextInfiniteTimeWindow= function(c){if(!this.isStopped){var a=this._events;a.push(c);a.length>this._bufferSize&&a.shift()}b.prototype.next.call(this,c)};a.prototype.nextTimeWindow=function(c){this.isStopped||(this._events.push(new Df(this._getNow(),c)),this._trimBufferThenGetEvents());b.prototype.next.call(this,c)};a.prototype._subscribe=function(c){var a=this._infiniteTimeWindow,b=a?this._events:this._trimBufferThenGetEvents(),f=this.scheduler,k=b.length,g;if(this.closed)throw new M;this.isStopped||this.hasError?g=q.EMPTY: (this.observers.push(c),g=new fd(this,c));f&&c.add(c=new md(c,f));if(a)for(a=0;a<k&&!c.closed;a++)c.next(b[a]);else for(a=0;a<k&&!c.closed;a++)c.next(b[a].value);this.hasError?c.error(this.thrownError):this.isStopped&&c.complete();return g};a.prototype._getNow=function(){return(this.scheduler||kd).now()};a.prototype._trimBufferThenGetEvents=function(){for(var c=this._getNow(),a=this._bufferSize,b=this._windowTime,f=this._events,k=f.length,g=0;g<k&&!(c-f[g].time<b);)g++;k>a&&(g=Math.max(g,k-a));0< g&&f.splice(0,g);return f};return a}(w),Df=function(){return function(b,a){this.time=b;this.value=a}}(),W=function(b){function a(){var c=null!==b&&b.apply(this,arguments)||this;c.value=null;c.hasNext=!1;c.hasCompleted=!1;return c}h(a,b);a.prototype._subscribe=function(c){return this.hasError?(c.error(this.thrownError),q.EMPTY):this.hasCompleted&&this.hasNext?(c.next(this.value),c.complete(),q.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),Ef=1,Ff=Promise.resolve(),Ea={},nd={setImmediate:function(b){var a=Ef++;Ea[a]=!0;Ff.then(function(){return bb(a)&&b()});return a},clearImmediate:function(b){bb(b)}},Gf=function(b){function a(c,a){var d=b.call(this,c,a)||this;d.scheduler=c;d.work=a;return d} h(a,b);a.prototype.requestAsyncId=function(c,a,e){void 0===e&&(e=0);if(null!==e&&0<e)return b.prototype.requestAsyncId.call(this,c,a,e);c.actions.push(this);return c.scheduled||(c.scheduled=nd.setImmediate(c.flush.bind(c,null)))};a.prototype.recycleAsyncId=function(c,a,e){void 0===e&&(e=0);if(null!==e&&0<e||null===e&&0<this.delay)return b.prototype.recycleAsyncId.call(this,c,a,e);0===c.actions.length&&(nd.clearImmediate(a),c.scheduled=void 0)};return a}(ma),ya=new (function(b){function a(){return null!== b&&b.apply(this,arguments)||this}h(a,b);a.prototype.flush=function(c){this.active=!0;this.scheduled=void 0;var a=this.actions,b,f=-1,k=a.length;c=c||a.shift();do if(b=c.execute(c.state,c.delay))break;while(++f<k&&(c=a.shift()));this.active=!1;if(b){for(;++f<k&&(c=a.shift());)c.unsubscribe();throw b;}};return a}(R))(Gf),D=new R(ma),B=D,Hf=function(b){function a(c,a){var d=b.call(this,c,a)||this;d.scheduler=c;d.work=a;return d}h(a,b);a.prototype.requestAsyncId=function(c,a,e){void 0===e&&(e=0);if(null!== e&&0<e)return b.prototype.requestAsyncId.call(this,c,a,e);c.actions.push(this);return c.scheduled||(c.scheduled=requestAnimationFrame(function(){return c.flush(null)}))};a.prototype.recycleAsyncId=function(c,a,e){void 0===e&&(e=0);if(null!==e&&0<e||null===e&&0<this.delay)return b.prototype.recycleAsyncId.call(this,c,a,e);0===c.actions.length&&(cancelAnimationFrame(a),c.scheduled=void 0)};return a}(ma),If=new (function(b){function a(){return null!==b&&b.apply(this,arguments)||this}h(a,b);a.prototype.flush= function(c){this.active=!0;this.scheduled=void 0;var a=this.actions,b,f=-1,k=a.length;c=c||a.shift();do if(b=c.execute(c.state,c.delay))break;while(++f<k&&(c=a.shift()));this.active=!1;if(b){for(;++f<k&&(c=a.shift());)c.unsubscribe();throw b;}};return a}(R))(Hf),pd=function(b){function a(c,a){void 0===c&&(c=od);void 0===a&&(a=Number.POSITIVE_INFINITY);var d=b.call(this,c,function(){return d.frame})||this;d.maxFrames=a;d.frame=0;d.index=-1;return d}h(a,b);a.prototype.flush=function(){for(var c=this.actions, a=this.maxFrames,b,f;(f=c[0])&&f.delay<=a&&!(c.shift(),this.frame=f.delay,b=f.execute(f.state,f.delay)););if(b){for(;f=c.shift();)f.unsubscribe();throw b;}};a.frameTimeFactor=10;return a}(R),od=function(b){function a(c,a,e){void 0===e&&(e=c.index+=1);var d=b.call(this,c,a)||this;d.scheduler=c;d.work=a;d.index=e;d.active=!0;d.index=c.index=e;return d}h(a,b);a.prototype.schedule=function(c,d){void 0===d&&(d=0);if(!this.id)return b.prototype.schedule.call(this,c,d);this.active=!1;var e=new a(this.scheduler, this.work);this.add(e);return e.schedule(c,d)};a.prototype.requestAsyncId=function(c,b,e){void 0===e&&(e=0);this.delay=c.frame+e;c=c.actions;c.push(this);c.sort(a.sortActions);return!0};a.prototype.recycleAsyncId=function(c,a,b){};a.prototype._execute=function(c,a){if(!0===this.active)return b.prototype._execute.call(this,c,a)};a.sortActions=function(c,a){return c.delay===a.delay?c.index===a.index?0:c.index>a.index?1:-1:c.delay>a.delay?1:-1};return a}(ma),ba=function(){function b(){Error.call(this); this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}b.prototype=Object.create(Error.prototype);return b}(),ja=function(){function b(){Error.call(this);this.message="no elements in sequence";this.name="EmptyError";return this}b.prototype=Object.create(Error.prototype);return b}(),Oc=function(){function b(){Error.call(this);this.message="Timeout has occurred";this.name="TimeoutError";return this}b.prototype=Object.create(Error.prototype);return b}(),Bd=function(){function b(a, c){this.project=a;this.thisArg=c}b.prototype.call=function(a,c){return c.subscribe(new Jf(a,this.project,this.thisArg))};return b}(),Jf=function(b){function a(c,a,e){c=b.call(this,c)||this;c.project=a;c.count=0;c.thisArg=e||c;return c}h(a,b);a.prototype._next=function(c){var a;try{a=this.project.call(this.thisArg,c,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(l),S=function(b){function a(){return null!==b&&b.apply(this,arguments)||this}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}(l),Gd=function(b){function a(c,a,e){var d=b.call(this)||this;d.parent=c;d.outerValue=a;d.outerIndex=e;d.index=0;return d}h(a,b);a.proto