/** @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. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *****************************************************************************/ (function(g,w){"object"===typeof exports&&"undefined"!==typeof module?w(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],w):w(g.rxjs={})})(this,function(g){function w(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");Ra(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function Xd(b,a){var c={},d;for(d in b)Object.prototype.hasOwnProperty.call(b, d)&&0>a.indexOf(d)&&(c[d]=b[d]);if(null!=b&&"function"===typeof Object.getOwnPropertySymbols){var e=0;for(d=Object.getOwnPropertySymbols(b);ea.indexOf(d[e])&&Object.prototype.propertyIsEnumerable.call(b,d[e])&&(c[d[e]]=b[d[e]])}return c}function Yd(b,a,c,d){function e(a){return a instanceof c?a:new c(function(b){b(a)})}return new (c||(c=Promise))(function(c,h){function f(a){try{v(d.next(a))}catch(y){h(y)}}function k(a){try{v(d["throw"](a))}catch(y){h(y)}}function v(a){a.done?c(a.value): e(a.value).then(f,k)}v((d=d.apply(b,a||[])).next())})}function Sa(b,a){function c(a){return function(b){return d([a,b])}}function d(c){if(f)throw new TypeError("Generator is already executing.");for(;e;)try{if(f=1,h&&(l=c[0]&2?h["return"]:c[0]?h["throw"]||((l=h["return"])&&l.call(h),0):h.next)&&!(l=l.call(h,c[1])).done)return l;if(h=0,l)c=[c[0]&2,l.value];switch(c[0]){case 0:case 1:l=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++;h=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop(); continue;default:if(!(l=e.trys,l=0l[0]&&c[1]=b.length&&(b=void 0);return{value:b&&b[d++],done:!b}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.");}function z(b,a){var c="function"===typeof Symbol&&b[Symbol.iterator];if(!c)return b;b= c.call(b);var d,e=[],f;try{for(;(void 0===a||0=b._refCount||0<--b._refCount)c=null;else{var d=b._connection,f=c;c=null;!d||f&&d!==f||d.unsubscribe();a.unsubscribe()}});b.subscribe(d);d.closed||(c=b.connect())})}function Lb(b){var a=U.schedule;return new q(function(c){var d=new D,e=b||Da,f=e.now(),h=function(l){var k=e.now();c.next({timestamp:b?k:l,elapsed:k-f});c.closed|| d.add(a(h))};d.add(a(h));return d})}function Mb(b){return b in Xa?(delete Xa[b],!0):!1}function be(b){return new q(function(a){return b.schedule(function(){return a.complete()})})}function Ea(b){return b&&p(b.schedule)}function na(b){return p(b[b.length-1])?b.pop():void 0}function Q(b){return Ea(b[b.length-1])?b.pop():void 0}function Nb(b){return Symbol.asyncIterator&&p(null===b||void 0===b?void 0:b[Symbol.asyncIterator])}function Ob(b){return new TypeError("You provided "+(null!==b&&"object"===typeof b? "an invalid object":"'"+b+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Pb(b){return p(null===b||void 0===b?void 0:b[Ya])}function Qb(b){return Zd(this,arguments,function(){var a,c,d,e;return Sa(this,function(f){switch(f.label){case 0:a=b.getReader(),f.label=1;case 1:f.trys.push([1,,9,10]),f.label=2;case 2:return[4,da(a.read())];case 3:return c=f.sent(),d=c.value,(e=c.done)?[4,da(void 0)]:[3,5];case 4:return[2, f.sent()];case 5:return[4,da(d)];case 6:return[4,f.sent()];case 7:return f.sent(),[3,2];case 8:return[3,10];case 9:return a.releaseLock(),[7];case 10:return[2]}})})}function u(b){if(b instanceof q)return b;if(null!=b){if(p(b[oa]))return ce(b);if(Za(b))return de(b);if(p(null===b||void 0===b?void 0:b.then))return ee(b);if(Nb(b))return Rb(b);if(Pb(b))return fe(b);if(p(null===b||void 0===b?void 0:b.getReader))return Rb(Qb(b))}throw Ob(b);}function ce(b){return new q(function(a){var c=b[oa]();if(p(c.subscribe))return c.subscribe(a); throw new TypeError("Provided object does not correctly implement Symbol.observable");})}function de(b){return new q(function(a){for(var c=0;ce&&(e=0);var h=0;return c.schedule(function(){a.closed||(a.next(h++),0<=d?this.schedule(void 0,d):a.complete())},e)})}function dc(b,a){void 0===b&&(b=0);void 0===a&&(a=I);0>b&&(b=0);return Y(b,b,a)}function Z(b){return 1=== b.length&&ve(b[0])?b[0]:b}function ec(){for(var b=[],a=0;a=b?function(){return M}:n(function(a,c){var d=0;a.subscribe(new m(c,function(a){++d<=b&&(c.next(a),b<=d&&c.complete())}))})}function lb(){return n(function(b,a){b.subscribe(new m(a,B))})}function mb(b){return N(function(){return b})} function La(b,a){return a?function(c){return sa(a.pipe(aa(1),lb()),c.pipe(La(b)))}:H(function(a,d){return b(a,d).pipe(aa(1),mb(a))})}function wc(b,a){void 0===a&&(a=I);var c=Y(b,a);return La(function(){return c})}function xc(){return n(function(b,a){b.subscribe(new m(a,function(b){return Fa(b,a)}))})}function yc(b,a){return n(function(c,d){var e=new Set;c.subscribe(new m(d,function(a){var c=b?b(a):a;e.has(c)||(e.add(c),d.next(a))}));null===a||void 0===a?void 0:a.subscribe(new m(d,function(){return e.clear()}, B))})}function nb(b,a){void 0===a&&(a=E);b=null!==b&&void 0!==b?b:Be;return n(function(c,d){var e,f=!0;c.subscribe(new m(d,function(c){var h=a(c);if(f||!b(e,h))f=!1,e=h,d.next(c)}))})}function Be(b,a){return b===a}function zc(b,a){return nb(function(c,d){return a?a(c[b],d[b]):c[b]===d[b]})}function va(b){void 0===b&&(b=Ce);return n(function(a,c){var d=!1;a.subscribe(new m(c,function(a){d=!0;c.next(a)},function(){return d?c.complete():c.error(b())}))})}function Ce(){return new ba}function Ac(b,a){if(0> b)throw new ob;var c=2<=arguments.length;return function(d){return d.pipe(O(function(a,c){return c===b}),aa(1),c?ua(a):va(function(){return new ob}))}}function Bc(){for(var b=[],a=0;a(a||0)?Infinity:a;return n(function(d,e){return db(d,e,b,a,void 0,!0,c)})}function Ec(b){return n(function(a,c){try{a.subscribe(c)}finally{c.add(b)}})}function Fc(b,a){return n(Gc(b,a,"value"))}function Gc(b,a,c){var d="index"===c;return function(c,f){var e=0;c.subscribe(new m(f,function(h){var l=e++;b.call(a,h,l,c)&&(f.next(d?l:h),f.complete())},function(){f.next(d?-1:void 0);f.complete()}))}}function Hc(b,a){return n(Gc(b,a,"index"))}function Ic(b,a){var c=2<=arguments.length;return function(d){return d.pipe(b? O(function(a,c){return b(a,c,d)}):E,aa(1),c?ua(a):va(function(){return new ba}))}}function Jc(b,a,c,d){return n(function(e,f){function h(a,b){var c=new q(function(a){y.activeGroups++;var c=b.subscribe(a);return function(){c.unsubscribe();0===--y.activeGroups&&y.teardownAttempted&&y.unsubscribe()}});c.key=a;return c}var l;a&&"function"!==typeof a?(c=a.duration,l=a.element,d=a.connector):l=a;var k=new Map,g=function(a){k.forEach(a);a(f)},r=function(a){return g(function(b){return b.error(a)})},y=new De(f, function(a){try{var e=b(a),g=k.get(e);if(!g){k.set(e,g=d?d():new C);var v=h(e,g);f.next(v);if(c){var x=new m(g,function(){g.complete();null===x||void 0===x?void 0:x.unsubscribe()},void 0,void 0,function(){return k.delete(e)});y.add(u(c(v)).subscribe(x))}}g.next(l?l(a):a)}catch(J){r(J)}},function(){return g(function(a){return a.complete()})},r,function(){return k.clear()});e.subscribe(y)})}function Kc(){return n(function(b,a){b.subscribe(new m(a,function(){a.next(!1);a.complete()},function(){a.next(!0); a.complete()}))})}function qb(b){return 0>=b?function(){return M}:n(function(a,c){var d=[];a.subscribe(new m(c,function(a){d.push(a);bb?a:b})}function Oc(b,a,c){void 0===c&&(c=Infinity);if(p(a))return H(function(){return b},a,c);"number"===typeof a&&(c=a);return H(function(){return b},c)}function Pc(b, a,c){void 0===c&&(c=Infinity);return n(function(d,e){var f=a;return db(d,e,function(a,c){return b(f,a,c)},c,function(a){f=a},!1,void 0,function(){return f=null})})}function Qc(){for(var b=[],a=0;ab(a,c)?a:c}:function(a,b){return a=c?function(){return M}:n(function(a,b){var e=0,f,k=function(){null===f||void 0===f?void 0:f.unsubscribe();f=null;if(null!=d){var a="number"===typeof d?Y(d):u(d(e)),c=new m(b,function(){c.unsubscribe();g()});a.subscribe(c)}else g()},g=function(){var d=!1;f=a.subscribe(new m(b,void 0,function(){++e=c?E:n(function(a,b){var f=0,h,g=function(){var l=!1;h=a.subscribe(new m(b,function(a){e&&(f=0);b.next(a)},void 0,function(a){if(f++=b?E:n(function(a, c){var d=Array(b),e=0;a.subscribe(new m(c,function(a){var f=e++;if(fe){null===(c=null===q||void 0===q?void 0:q.complete)||void 0===c?void 0:c.call(q);c=void 0;try{c=new xb(b,t,p,Md+"_"+b.type)}catch(we){a.error(we); return}a.next(c);a.complete()}else null===(d=null===q||void 0===q?void 0:q.error)||void 0===d?void 0:d.call(q,b),J(e)});e=p.user;d=p.method;h=p.async;e?t.open(d,k,h,e,p.password):t.open(d,k,h);h&&(t.timeout=p.timeout,t.responseType=p.responseType);"withCredentials"in t&&(t.withCredentials=p.withCredentials);for(r in f)f.hasOwnProperty(r)&&t.setRequestHeader(r,f[r]);c?t.send(c):t.send();return function(){t&&4!==t.readyState&&t.abort()}})}function Ne(b,a){var c;if(!b||"string"===typeof b||"undefined"!== typeof FormData&&b instanceof FormData||"undefined"!==typeof URLSearchParams&&b instanceof URLSearchParams||Ab(b,"ArrayBuffer")||Ab(b,"File")||Ab(b,"Blob")||"undefined"!==typeof ReadableStream&&b instanceof ReadableStream)return b;if("undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView(b))return b.buffer;if("object"===typeof b)return a["content-type"]=null!==(c=a["content-type"])&&void 0!==c?c:"application/json;charset\x3dutf-8",JSON.stringify(b);throw new TypeError("Unknown body type");}function Ab(b, a){return Pe.call(b)==="[object "+a+"]"}var Ra=function(b,a){Ra=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return Ra(b,a)},V=function(){V=Object.assign||function(b){for(var a,c=1,d=arguments.length;ca&&hb.index?1:-1:a.delay>b.delay?1:-1};return a}(za),M=new q(function(b){return b.complete()}),Za=function(b){return b&&"number"===typeof b.length&&"function"!==typeof b},Ya;Ya="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";(function(b){b.NEXT="N";b.ERROR="E";b.COMPLETE="C"})(g.NotificationKind||(g.NotificationKind={}));var Na=function(){function b(a, b,d){this.kind=a;this.value=b;this.error=d;this.hasValue="N"===a}b.prototype.observe=function(a){return Fa(this,a)};b.prototype.do=function(a,b,d){var c=this.kind,f=this.value,h=this.error;return"N"===c?null===a||void 0===a?void 0:a(f):"E"===c?null===b||void 0===b?void 0:b(h):null===d||void 0===d?void 0:d()};b.prototype.accept=function(a,b,d){return p(null===a||void 0===a?void 0:a.next)?this.observe(a):this.do(a,b,d)};b.prototype.toObservable=function(){var a=this.kind,b=this.value,d=this.error,b= "N"===a?$a(b):"E"===a?Vb(function(){return d}):"C"===a?M:0;if(!b)throw new TypeError("Unexpected notification kind "+a);return b};b.createNext=function(a){return new b("N",a)};b.createError=function(a){return new b("E",void 0,a)};b.createComplete=function(){return b.completeNotification};b.completeNotification=new b("C");return b}(),ba=S(function(b){return function(){b(this);this.name="EmptyError";this.message="no elements in sequence"}}),ob=S(function(b){return function(){b(this);this.name="ArgumentOutOfRangeError"; this.message="argument out of range"}}),id=S(function(b){return function(a){b(this);this.name="NotFoundError";this.message=a}}),hd=S(function(b){return function(a){b(this);this.name="SequenceError";this.message=a}}),Wb=S(function(b){return function(a){void 0===a&&(a=null);b(this);this.message="Timeout has occurred";this.name="TimeoutError";this.info=a}}),ke=Array.isArray,le=Array.isArray,me=Object.getPrototypeOf,ne=Object.prototype,oe=Object.keys,Ye={connector:function(){return new C},resetOnDisconnect:!0}, se=["addListener","removeListener"],qe=["addEventListener","removeEventListener"],ue=["on","off"],Td=new q(B),ve=Array.isArray,ye=function(b,a){return b.push(a),b},Ae={connector:function(){return new C}},De=function(b){function a(){var a=null!==b&&b.apply(this,arguments)||this;a.activeGroups=0;a.teardownAttempted=!1;return a}w(a,b);a.prototype.unsubscribe=function(){this.teardownAttempted=!0;0===this.activeGroups&&b.prototype.unsubscribe.call(this)};return a}(m),ud={leading:!0,trailing:!1},Ee=function(){return function(b, a){this.value=b;this.interval=a}}(),Ze=Object.freeze({audit:hb,auditTime:hc,buffer:ic,bufferCount:jc,bufferTime:kc,bufferToggle:lc,bufferWhen:mc,catchError:ib,combineAll:Ia,combineLatestAll:Ia,combineLatest:kb,combineLatestWith:pc,concat:rc,concatAll:Ha,concatMap:Ja,concatMapTo:qc,concatWith:sc,connect:Ka,count:tc,debounce:uc,debounceTime:vc,defaultIfEmpty:ua,delay:wc,delayWhen:La,dematerialize:xc,distinct:yc,distinctUntilChanged:nb,distinctUntilKeyChanged:zc,elementAt:Ac,endWith:Bc,every:Cc,exhaust:Ma, exhaustAll:Ma,exhaustMap:pb,expand:Dc,filter:O,finalize:Ec,find:Fc,findIndex:Hc,first:Ic,groupBy:Jc,ignoreElements:lb,isEmpty:Kc,last:Lc,map:N,mapTo:mb,materialize:Mc,max:Nc,merge:Qc,mergeAll:ra,flatMap:H,mergeMap:H,mergeMapTo:Oc,mergeScan:Pc,mergeWith:Rc,min:Sc,multicast:Oa,observeOn:pa,onErrorResumeNext:ec,pairwise:Tc,partition:function(b,a){return function(c){return[O(b,a)(c),O(fc(b,a))(c)]}},pluck:Uc,publish:Vc,publishBehavior:Wc,publishLast:Yc,publishReplay:Zc,race:function(){for(var b=[],a= 0;ak?new Ba(l):new Ba(l,k)};a.parseMarbles=function(a, b,e,f,g){var c=this;void 0===f&&(f=!1);void 0===g&&(g=!1);if(-1!==a.indexOf("!"))throw Error('conventional marble diagrams cannot have the unsubscription marker "!"');var d=A([],z(a)),h=d.length,m=[];a=g?a.replace(/^[ ]+/,"").indexOf("^"):a.indexOf("^");var n=-1===a?0:a*-this.frameTimeFactor,p="object"!==typeof b?function(a){return a}:function(a){return f&&b[a]instanceof Fb?b[a].messages:b[a]},q=-1;a=function(a){var b=n,f=function(a){b+=a*c.frameTimeFactor},h=void 0,k=d[a];switch(k){case " ":g||f(1); break;case "-":f(1);break;case "(":q=n;f(1);break;case ")":q=-1;f(1);break;case "|":h=ya;f(1);break;case "^":f(1);break;case "#":h=K("E",void 0,e||"error");f(1);break;default:if(g&&k.match(/^[0-9]$/)&&(0===a||" "===d[a-1])){var l=d.slice(a).join("").match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(l){a+=l[0].length-1;var k=parseFloat(l[1]),r=void 0;switch(l[2]){case "ms":r=k;break;case "s":r=1E3*k;break;case "m":r=6E4*k}f(r/t.frameTimeFactor);break}}h=K("N",p(k),void 0);f(1)}h&&m.push({frame:-1=a)return M; var d=a+b;return new q(c?function(a){var e=b;return c.schedule(function(){e