/** @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. *****************************************************************************/ (function(k,h){"object"===typeof exports&&"undefined"!==typeof module?h(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],h):h(k.rxjs={})})(this,function(k){function h(c,a){function b(){this.constructor=c}Pb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function Qb(c,a){var b={},d;for(d in c)Object.prototype.hasOwnProperty.call(c,d)&&0>a.indexOf(d)&&(b[d]=c[d]);if(null!=c&&"function"===typeof Object.getOwnPropertySymbols){var e=0;for(d=Object.getOwnPropertySymbols(c);e< d.length;e++)0>a.indexOf(d[e])&&(b[d[e]]=c[d[e]])}return b}function R(c){return"function"===typeof c}function S(c){setTimeout(function(){throw c;},0)}function ua(c){return null!==c&&"object"===typeof c}function Oa(c){return c.reduce(function(a,b){return a.concat(b instanceof aa?b.errors:b)},[])}function va(c){for(;c;){var a=c.destination,b=c.isStopped;if(c.closed||b)return!1;c=a&&a instanceof m?a:null}return!0}function I(c){return c}function wa(){for(var c=[],a=0;a=b.length?b[0]:b);g.complete()}]))}catch(L){va(g)?g.error(L):console.warn(L)}}return g.subscribe(d)})}}function Vb(c){var a=this,b=c.args,d=c.subscriber;c=c.params;var e=c.callbackFunc,f=c.context,g=c.scheduler,l=c.subject;if(!l){l=c.subject=new V;try{e.apply(f, b.concat([function(){for(var b=[],c=0;c=b.length?b[0]:b,subject:l}))}]))}catch(t){l.error(t)}}this.add(l.subscribe(d))}function Wb(c){var a=c.subject;a.next(c.value);a.complete()}function Ua(c,a,b){if(a)if(B(a))b=a;else return function(){for(var d=[],e=0;e=b.length?b[0]:b),g.complete())}]))}catch(L){va(g)?g.error(L):console.warn(L)}}return g.subscribe(d)})}}function Xb(c){var a=this,b=c.params,d=c.subscriber; c=c.context;var e=b.callbackFunc,f=b.args,g=b.scheduler,l=b.subject;if(!l){l=b.subject=new V;try{e.apply(c,f.concat([function(){for(var b=[],c=0;c=b.length?b[0]:b,subject:l}))}]))}catch(t){this.add(g.schedule(Va,0,{err:t,subject:l}))}}this.add(l.subscribe(d))}function Yb(c){var a=c.subject;a.next(c.value);a.complete()}function Va(c){c.subject.error(c.err)}function Wa(c){return!!c&& "function"!==typeof c.subscribe&&"function"===typeof c.then}function G(c,a,b,d,e){void 0===e&&(e=new Zb(c,b,d));if(!e.closed)return a instanceof n?a.subscribe(e):ca(a)(e)}function $b(c,a){return new n(function(b){var d=new p;d.add(a.schedule(function(){var e=c[W]();d.add(e.subscribe({next:function(c){d.add(a.schedule(function(){return b.next(c)}))},error:function(c){d.add(a.schedule(function(){return b.error(c)}))},complete:function(){d.add(a.schedule(function(){return b.complete()}))}}))}));return d})} function ac(c,a){return new n(function(b){var d=new p;d.add(a.schedule(function(){return c.then(function(c){d.add(a.schedule(function(){b.next(c);d.add(a.schedule(function(){return b.complete()}))}))},function(c){d.add(a.schedule(function(){return b.error(c)}))})}));return d})}function bc(c,a){if(!c)throw Error("Iterable cannot be null");return new n(function(b){var d=new p,e;d.add(function(){e&&"function"===typeof e.return&&e.return()});d.add(a.schedule(function(){e=c[H]();d.add(a.schedule(function(){if(!b.closed){var a, c;try{var d=e.next();a=d.value;c=d.done}catch(t){b.error(t);return}c?b.complete():(b.next(a),this.schedule())}}))}));return d})}function Xa(c,a){if(null!=c){if(c&&"function"===typeof c[W])return $b(c,a);if(Wa(c))return ac(c,a);if(Ya(c))return ya(c,a);if(c&&"function"===typeof c[H]||"string"===typeof c)return bc(c,a)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");}function F(c,a){return a?Xa(c,a):c instanceof n?c:new n(ca(c))}function v(c,a){if(!a.closed){if(c instanceof n)return c.subscribe(a); var b;try{b=ca(c)(a)}catch(d){a.error(d)}return b}}function M(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(d){return d.pipe(M(function(b,d){return F(c(b,d)).pipe(C(function(c,e){return a(b,c,d,e)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new cc(c,b))}}function Ba(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return M(I,c)}function Za(){return Ba(1)}function da(){for(var c=[],a=0;a=c.count?d.complete():(d.next(a),d.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))}function fb(c,a,b){void 0===c&&(c=0);var d=-1;X(a)?d= 1>Number(a)&&1||Number(a):B(a)&&(b=a);B(b)||(b=z);return new n(function(a){var e=X(c)?c:+c-b.now();return b.schedule(mc,e,{index:0,period:d,subscriber:a})})}function mc(c){var a=c.index,b=c.period,d=c.subscriber;d.next(a);if(!d.closed){if(-1===b)return d.complete();c.index=a+1;this.schedule(c,b)}}function gb(){for(var c=[],a=0;a=a?this.connection=null:(b._refCount= a-1,1=a?this.connection=null:(b._refCount=a-1,1b?1:b;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,c);a.prototype.nextInfiniteTimeWindow= function(b){if(!this.isStopped){var a=this._events;a.push(b);a.length>this._bufferSize&&a.shift()}c.prototype.next.call(this,b)};a.prototype.nextTimeWindow=function(b){this.isStopped||(this._events.push(new $c(this._getNow(),b)),this._trimBufferThenGetEvents());c.prototype.next.call(this,b)};a.prototype._subscribe=function(b){var a=this._infiniteTimeWindow,c=a?this._events:this._trimBufferThenGetEvents(),f=this.scheduler,g=c.length,l;if(this.closed)throw new K;this.isStopped||this.hasError?l=p.EMPTY: (this.observers.push(b),l=new ub(this,b));f&&b.add(b=new yb(b,f));if(a)for(a=0;aa&&(l=Math.max(l,g-a));0< l&&f.splice(0,l);return f};return a}(w),$c=function(){return function(c,a){this.time=c;this.value=a}}(),V=function(c){function a(){var b=null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}h(a,c);a.prototype._subscribe=function(b){return this.hasError?(b.error(this.thrownError),p.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),p.EMPTY):c.prototype._subscribe.call(this,b)};a.prototype.next=function(b){this.hasCompleted||(this.value=b, this.hasNext=!0)};a.prototype.error=function(b){this.hasCompleted||c.prototype.error.call(this,b)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&c.prototype.next.call(this,this.value);c.prototype.complete.call(this)};return a}(w),ad=1,bd=Promise.resolve(),Aa={},zb={setImmediate:function(c){var a=ad++;Aa[a]=!0;bd.then(function(){return Sa(a)&&c()});return a},clearImmediate:function(c){Sa(c)}},cd=function(c){function a(b,a){var d=c.call(this,b,a)||this;d.scheduler=b;d.work=a;return d} h(a,c);a.prototype.requestAsyncId=function(b,a,e){void 0===e&&(e=0);if(null!==e&&0a.index?1:-1:b.delay>a.delay?1:-1};return a}(ha),Z=function(){function c(){Error.call(this); this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}c.prototype=Object.create(Error.prototype);return c}(),fa=function(){function c(){Error.call(this);this.message="no elements in sequence";this.name="EmptyError";return this}c.prototype=Object.create(Error.prototype);return c}(),Db=function(){function c(){Error.call(this);this.message="Timeout has occurred";this.name="TimeoutError";return this}c.prototype=Object.create(Error.prototype);return c}(),Ub=function(){function c(a, b){this.project=a;this.thisArg=b}c.prototype.call=function(a,b){return b.subscribe(new ed(a,this.project,this.thisArg))};return c}(),ed=function(c){function a(b,a,e){b=c.call(this,b)||this;b.project=a;b.count=0;b.thisArg=e||b;return b}h(a,c);a.prototype._next=function(b){var a;try{a=this.project.call(this.thisArg,b,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(a)};return a}(m),Q=function(c){function a(){return null!==c&&c.apply(this,arguments)||this}h(a,c);a.prototype.notifyNext= function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyError=function(b,a){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.complete()};return a}(m),Zb=function(c){function a(b,a,e){var d=c.call(this)||this;d.parent=b;d.outerValue=a;d.outerIndex=e;d.index=0;return d}h(a,c);a.prototype._next=function(b){this.parent.notifyNext(this.outerValue,b,this.outerIndex,this.index++,this)};a.prototype._error=function(b){this.parent.notifyError(b,this);this.unsubscribe()}; a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(m),fd=function(c){return function(a){c.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,S);return a}},H;H="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var gd=function(c){return function(a){var b=c[H]();do{var d=void 0;try{d=b.next()}catch(e){return a.error(e),a}if(d.done){a.complete();break}a.next(d.value);if(a.closed)break}while(1); "function"===typeof b.return&&a.add(function(){b.return&&b.return()});return a}},hd=function(c){return function(a){var b=c[W]();if("function"!==typeof b.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return b.subscribe(a)}},Ya=function(c){return c&&"number"===typeof c.length&&"function"!==typeof c},ca=function(c){if(c&&"function"===typeof c[W])return hd(c);if(Ya(c))return Ra(c);if(Wa(c))return fd(c);if(c&&"function"===typeof c[H])return gd(c);c=ua(c)? "an invalid object":"'"+c+"'";throw new TypeError("You provided "+c+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.");},Eb={},La=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new id(a,this.resultSelector))};return c}(),id=function(c){function a(b,a){b=c.call(this,b)||this;b.resultSelector=a;b.active=0;b.values=[];b.observables=[];return b}h(a,c);a.prototype._next=function(b){this.values.push(Eb);this.observables.push(b)}; a.prototype._complete=function(){var b=this.observables,a=b.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var c=0;cthis.index};c.prototype.hasCompleted=function(){return this.array.length===this.index};return c}(),pd=function(c){function a(b,a,e){b=c.call(this,b)||this;b.parent=a;b.observable=e;b.stillUnsubscribed=!0;b.buffer=[];b.isComplete=!1;return b}h(a,c);a.prototype[H]=function(){return this};a.prototype.next=function(){var b= this.buffer;return 0===b.length&&this.isComplete?{value:null,done:!0}:{value:b.shift(),done:!1}};a.prototype.hasValue=function(){return 0e;if(b.timespanOnly)b.add(f.closeAction=g.schedule(jb,a,{subscriber:b,context:f,bufferTimeSpan:a})); else{var d={bufferTimeSpan:a,bufferCreationInterval:e,subscriber:b,scheduler:g};b.add(f.closeAction=g.schedule(kb,a,{subscriber:b,context:f}));b.add(g.schedule(oc,e,d))}return b}h(a,c);a.prototype._next=function(b){for(var a=this.contexts,c=a.length,f,g=0;g=c[0].time-f.now();)c.shift().notification.observe(g);0this.total)throw new Z;}c.prototype.call=function(a,b){return b.subscribe(new Yd(a,this.total))};return c}(),Yd=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.count=0;return b}h(a,c);a.prototype._next=function(b){var a= this.total,c=++this.count;c<=a&&(this.destination.next(b),c===a&&(this.destination.complete(),this.unsubscribe()))};return a}(m),$d=function(){function c(a,b,c){this.predicate=a;this.thisArg=b;this.source=c}c.prototype.call=function(a,b){return b.subscribe(new Zd(a,this.predicate,this.thisArg,this.source))};return c}(),Zd=function(c){function a(b,a,e,f){b=c.call(this,b)||this;b.predicate=a;b.thisArg=e;b.source=f;b.index=0;b.thisArg=e||b;return b}h(a,c);a.prototype.notifyComplete=function(b){this.destination.next(b); this.destination.complete()};a.prototype._next=function(b){var a=!1;try{a=this.predicate.call(this.thisArg,b,this.index++,this.source)}catch(e){this.destination.error(e);return}a||this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(m),be=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new ae(a))};return c}(),ae=function(c){function a(b){b=c.call(this,b)||this;b.hasCompleted=!1;b.hasSubscription=!1;return b}h(a,c);a.prototype._next= function(b){this.hasSubscription||(this.hasSubscription=!0,this.add(v(b,new u(this))))};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyComplete=function(){this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(r),vc=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new ce(a,this.project))};return c}(),ce=function(c){function a(b,a){b=c.call(this,b)||this;b.project= a;b.hasSubscription=!1;b.hasCompleted=!1;b.index=0;return b}h(a,c);a.prototype._next=function(b){this.hasSubscription||this.tryNext(b)};a.prototype.tryNext=function(b){var a,c=this.index++;try{a=this.project(b,c)}catch(f){this.destination.error(f);return}this.hasSubscription=!0;this._innerSub(a)};a.prototype._innerSub=function(b){var a=new u(this),c=this.destination;c.add(a);b=v(b,a);b!==a&&c.add(b)};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete(); this.unsubscribe()};a.prototype.notifyNext=function(b){this.destination.next(b)};a.prototype.notifyError=function(b){this.destination.error(b)};a.prototype.notifyComplete=function(){this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(r),ee=function(){function c(a,b,c){this.project=a;this.concurrent=b;this.scheduler=c}c.prototype.call=function(a,b){return b.subscribe(new de(a,this.project,this.concurrent,this.scheduler))};return c}(),de=function(c){function a(b,a,e,f){b= c.call(this,b)||this;b.project=a;b.concurrent=e;b.scheduler=f;b.index=0;b.active=0;b.hasCompleted=!1;ethis.total)throw new Z;}c.prototype.call=function(a,b){return b.subscribe(new me(a,this.total))};return c}(),me=function(c){function a(b,a){b=c.call(this,b)||this;b.total=a;b.ring=[];b.count=0;return b}h(a,c);a.prototype._next=function(b){var a=this.ring,c=this.total,f=this.count++;a.length=this.total?this.total:this.count,f=this.ring,g=0;gthis.total&&this.destination.next(b)};return a}(m),Re=function(){function c(a){this._skipCount=a;if(0>this._skipCount)throw new Z;}c.prototype.call=function(a, b){return 0===this._skipCount?b.subscribe(new m(a)):b.subscribe(new Qe(a,this._skipCount))};return c}(),Qe=function(c){function a(b,a){b=c.call(this,b)||this;b._skipCount=a;b._count=0;b._ring=Array(a);return b}h(a,c);a.prototype._next=function(b){var a=this._skipCount,c=this._count++;if(cd)b.delayTime=0;e&&"function"===typeof e.schedule||(b.scheduler=ia);return b}h(a,c);a.create=function(b,c,e){void 0===c&&(c=0);void 0===e&&(e=ia);return new a(b,c,e)};a.dispatch=function(a){return this.add(a.source.subscribe(a.subscriber))};a.prototype._subscribe=function(b){return this.scheduler.schedule(a.dispatch,this.delayTime,{source:this.source,subscriber:b})};return a}(n),Xe=function(){function c(a,b){this.scheduler=a;this.delay= b}c.prototype.call=function(a,b){return(new We(b,this.delay,this.scheduler)).subscribe(a)};return c}(),Ec=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Ye(a,this.project))};return c}(),Ye=function(c){function a(a,d){a=c.call(this,a)||this;a.project=d;a.index=0;return a}h(a,c);a.prototype._next=function(a){var b,c=this.index++;try{b=this.project(a,c)}catch(f){this.destination.error(f);return}this._innerSub(b)};a.prototype._innerSub=function(a){var b= this.innerSubscription;b&&b.unsubscribe();var b=new u(this),c=this.destination;c.add(b);this.innerSubscription=v(a,b);this.innerSubscription!==b&&c.add(this.innerSubscription)};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||c.prototype._complete.call(this);this.unsubscribe()};a.prototype._unsubscribe=function(){this.innerSubscription=void 0};a.prototype.notifyComplete=function(){this.innerSubscription=void 0;this.isStopped&&c.prototype._complete.call(this)};a.prototype.notifyNext= function(a){this.destination.next(a)};return a}(r),$e=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){a=new Ze(a);var c=v(this.notifier,new u(a));return c&&!a.seenValue?(a.add(c),b.subscribe(a)):a};return c}(),Ze=function(c){function a(a){a=c.call(this,a)||this;a.seenValue=!1;return a}h(a,c);a.prototype.notifyNext=function(){this.seenValue=!0;this.complete()};a.prototype.notifyComplete=function(){};return a}(r),bf=function(){function c(a,b){this.predicate=a;this.inclusive= b}c.prototype.call=function(a,b){return b.subscribe(new af(a,this.predicate,this.inclusive))};return c}(),af=function(c){function a(a,d,e){a=c.call(this,a)||this;a.predicate=d;a.inclusive=e;a.index=0;return a}h(a,c);a.prototype._next=function(a){var b=this.destination,c;try{c=this.predicate(a,this.index++)}catch(f){b.error(f);return}this.nextOrComplete(a,c)};a.prototype.nextOrComplete=function(a,c){var b=this.destination;c?b.next(a):(this.inclusive&&b.next(a),b.complete())};return a}(m),df=function(){function c(a, b,c){this.nextOrObserver=a;this.error=b;this.complete=c}c.prototype.call=function(a,b){return b.subscribe(new cf(a,this.nextOrObserver,this.error,this.complete))};return c}(),cf=function(c){function a(a,d,e,f){a=c.call(this,a)||this;a._tapNext=E;a._tapError=E;a._tapComplete=E;a._tapError=e||E;a._tapComplete=f||E;R(d)?(a._context=a,a._tapNext=d):d&&(a._context=d,a._tapNext=d.next||E,a._tapError=d.error||E,a._tapComplete=d.complete||E);return a}h(a,c);a.prototype._next=function(a){try{this._tapNext.call(this._context, a)}catch(d){this.destination.error(d);return}this.destination.next(a)};a.prototype._error=function(a){try{this._tapError.call(this._context,a)}catch(d){this.destination.error(d);return}this.destination.error(a)};a.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(b){this.destination.error(b);return}return this.destination.complete()};return a}(m),Jb={leading:!0,trailing:!1},ff=function(){function c(a,b,c){this.durationSelector=a;this.leading=b;this.trailing=c}c.prototype.call= function(a,b){return b.subscribe(new ef(a,this.durationSelector,this.leading,this.trailing))};return c}(),ef=function(c){function a(a,d,e,f){var b=c.call(this,a)||this;b.destination=a;b.durationSelector=d;b._leading=e;b._trailing=f;b._hasValue=!1;return b}h(a,c);a.prototype._next=function(a){this._hasValue=!0;this._sendValue=a;this._throttled||(this._leading?this.send():this.throttle(a))};a.prototype.send=function(){var a=this._sendValue;this._hasValue&&(this.destination.next(a),this.throttle(a)); this._hasValue=!1;this._sendValue=void 0};a.prototype.throttle=function(a){(a=this.tryDurationSelector(a))&&this.add(this._throttled=v(a,new u(this)))};a.prototype.tryDurationSelector=function(a){try{return this.durationSelector(a)}catch(d){return this.destination.error(d),null}};a.prototype.throttlingDone=function(){var a=this._throttled,c=this._trailing;a&&a.unsubscribe();this._throttled=void 0;c&&this.send()};a.prototype.notifyNext=function(){this.throttlingDone()};a.prototype.notifyComplete=function(){this.throttlingDone()}; return a}(r),hf=function(){function c(a,b,c,e){this.duration=a;this.scheduler=b;this.leading=c;this.trailing=e}c.prototype.call=function(a,b){return b.subscribe(new gf(a,this.duration,this.scheduler,this.leading,this.trailing))};return c}(),gf=function(c){function a(a,d,e,f,g){a=c.call(this,a)||this;a.duration=d;a.scheduler=e;a.leading=f;a.trailing=g;a._hasTrailingValue=!1;a._trailingValue=null;return a}h(a,c);a.prototype._next=function(a){this.throttled?this.trailing&&(this._trailingValue=a,this._hasTrailingValue= !0):(this.add(this.throttled=this.scheduler.schedule(Fc,this.duration,{subscriber:this})),this.leading?this.destination.next(a):this.trailing&&(this._trailingValue=a,this._hasTrailingValue=!0))};a.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue);this.destination.complete()};a.prototype.clearThrottle=function(){var a=this.throttled;a&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue= !1),a.unsubscribe(),this.remove(a),this.throttled=null)};return a}(m),jf=function(){return function(c,a){this.value=c;this.interval=a}}(),Gc=function(){function c(a,b,c,e){this.waitFor=a;this.absoluteTimeout=b;this.withObservable=c;this.scheduler=e}c.prototype.call=function(a,b){return b.subscribe(new kf(a,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))};return c}(),kf=function(c){function a(a,d,e,f,g){a=c.call(this,a)||this;a.absoluteTimeout=d;a.waitFor=e;a.withObservable= f;a.scheduler=g;a.scheduleTimeout();return a}h(a,c);a.dispatchTimeout=function(a){var b=a.withObservable;a._unsubscribeAndRecycle();a.add(v(b,new u(a)))};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=b.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();c.prototype._next.call(this,a)};a.prototype._unsubscribe=function(){this.action=void 0; this.withObservable=this.scheduler=null};return a}(r),lf=function(){return function(c,a){this.value=c;this.timestamp=a}}(),nf=function(){function c(a){this.windowBoundaries=a}c.prototype.call=function(a,b){a=new mf(a);b=b.subscribe(a);b.closed||a.add(v(this.windowBoundaries,new u(a)));return b};return c}(),mf=function(c){function a(a){var b=c.call(this,a)||this;b.window=new w;a.next(b.window);return b}h(a,c);a.prototype.notifyNext=function(){this.openWindow()};a.prototype.notifyError=function(a){this._error(a)}; a.prototype.notifyComplete=function(){this._complete()};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a)};a.prototype._complete=function(){this.window.complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.window=null};a.prototype.openWindow=function(){var a=this.window;a&&a.complete();var a=this.destination,c=this.window=new w;a.next(c)};return a}(r),pf=function(){function c(a,b){this.windowSize= a;this.startWindowEvery=b}c.prototype.call=function(a,b){return b.subscribe(new of(a,this.windowSize,this.startWindowEvery))};return c}(),of=function(c){function a(a,d,e){var b=c.call(this,a)||this;b.destination=a;b.windowSize=d;b.startWindowEvery=e;b.windows=[new w];b.count=0;a.next(b.windows[0]);return b}h(a,c);a.prototype._next=function(a){for(var b=0=this.maxWindowSize&&this.closeWindow(g))}};a.prototype._error=function(a){for(var b=this.windows;0c)throw new Z;var b=2<=arguments.length;return function(d){return d.pipe(J(function(a,b){return b===c}),Ea(1),b?ea(a):na(function(){return new Z}))}}, endWith:function(){for(var c=[],a=0;a(a||0)?Number.POSITIVE_INFINITY:a;return function(d){return d.lift(new ee(c,a,b))}},filter:J,finalize:function(c){return function(a){return a.lift(new ge(c))}}, find:function(c,a){if("function"!==typeof c)throw new TypeError("predicate is not a function");return function(b){return b.lift(new Hb(c,b,!1,a))}},findIndex:function(c,a){return function(b){return b.lift(new Hb(c,b,!0,a))}},first:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?J(function(a,b){return c(a,b,d)}):I,Ea(1),b?ea(a):na(function(){return new fa}))}},groupBy:function(c,a,b,d){return function(e){return e.lift(new Uc(c,a,b,d))}},ignoreElements:function(){return function(c){return c.lift(new je)}}, isEmpty:function(){return function(c){return c.lift(new le)}},last:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?J(function(a,b){return c(a,b,d)}):I,oa(1),b?ea(a):na(function(){return new fa}))}},map:C,mapTo:function(c){return function(a){return a.lift(new oe(c))}},materialize:function(){return function(c){return c.lift(new qe)}},max:function(c){return qa("function"===typeof c?function(a,b){return 0b?a:b})},merge:function(){for(var c= [],a=0;ac(a,b)?a:b}:function(a,b){return ac?a.lift(new Ib(-1,a)):a.lift(new Ib(c-1,a))}},repeatWhen:function(c){return function(a){return a.lift(new Ae(c))}},retry:function(c){void 0===c&&(c=-1);return function(a){return a.lift(new Ce(c,a))}},retryWhen:function(c){return function(a){return a.lift(new Ee(c, a))}},refCount:xa,sample:function(c){return function(a){return a.lift(new Ge(c))}},sampleTime:function(c,a){void 0===a&&(a=z);return function(b){return b.lift(new Ie(c,a))}},scan:pa,sequenceEqual:function(c,a){return function(b){return b.lift(new Ke(c,a))}},share:function(){return function(c){return xa()(N(Cc)(c))}},shareReplay:function(c,a,b){var d;d=c&&"object"===typeof c?c:{bufferSize:c,windowTime:a,refCount:!1,scheduler:b};return function(a){return a.lift(Dc(d))}},single:function(c){return function(a){return a.lift(new Ne(c, a))}},skip:function(c){return function(a){return a.lift(new Pe(c))}},skipLast:function(c){return function(a){return a.lift(new Re(c))}},skipUntil:function(c){return function(a){return a.lift(new Te(c))}},skipWhile:function(c){return function(a){return a.lift(new Ve(c))}},startWith:function(){for(var c=[],a=0;ak?new ja(h):new ja(h,k)};a.parseMarbles=function(a, c,e,f,g){var b=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 "!"');for(var d=a.length,h=[],k=g?a.replace(/^[ ]+/,"").indexOf("^"):a.indexOf("^"),m=-1===k?0:k*-this.frameTimeFactor,n="object"!==typeof c?function(a){return a}:function(a){return f&&c[a]instanceof Ma?c[a].messages:c[a]},p=-1,k=function(c){var d=m,f=function(a){d+=a*b.frameTimeFactor},l=void 0,k=a[c];switch(k){case " ":g||f(1);break;case "-":f(1); break;case "(":p=m;f(1);break;case ")":p=-1;f(1);break;case "|":l=x.createComplete();f(1);break;case "^":f(1);break;case "#":l=x.createError(e||"error");f(1);break;default:if(g&&k.match(/^[0-9]$/)&&(0===c||" "===a[c-1])){var t=a.slice(c).match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(t){c+=t[0].length-1;var k=parseFloat(t[1]),q=void 0;switch(t[2]){case "ms":q=k;break;case "s":q=1E3*k;break;case "m":q=6E4*k}f(q/v.frameTimeFactor);break}}l=x.createNext(n(k));f(1)}l&&h.push({frame:-1d;d++)try{b=c[d];new A.ActiveXObject(b);break}catch(q){}a=new A.ActiveXObject(b)}catch(q){throw Error("XMLHttpRequest is not supported by your browser");}}return a},crossDomain:!0,withCredentials:!1, headers:{},method:"GET",responseType:"json",timeout:0};if("string"===typeof a)e.url=a;else for(var f in a)a.hasOwnProperty(f)&&(e[f]=a[f]);b.request=e;return b}h(a,c);a.prototype._subscribe=function(a){return new Ff(a,this.request)};a.create=function(){var b=function(b){return new a(b)};b.get=Kc;b.post=Lc;b.delete=Mc;b.put=Nc;b.patch=Oc;b.getJSON=Pc;return b}();return a}(n),Ff=function(c){function a(a,d){a=c.call(this,a)||this;a.request=d;a.done=!1;var b=d.headers=d.headers||{};d.crossDomain||a.getHeader(b, "X-Requested-With")||(b["X-Requested-With"]="XMLHttpRequest");a.getHeader(b,"Content-Type")||A.FormData&&d.body instanceof A.FormData||"undefined"===typeof d.body||(b["Content-Type"]="application/x-www-form-urlencoded; charset\x3dUTF-8");d.body=a.serializeBody(d.body,a.getHeader(d.headers,"Content-Type"));a.send();return a}h(a,c);a.prototype.next=function(a){this.done=!0;var b=this.xhr,c=this.request,f=this.destination,g;try{g=new Mb(a,b,c)}catch(l){return f.error(l)}f.next(g)};a.prototype.send=function(){var a= this.request,c=this.request,e=c.user,f=c.method,g=c.url,h=c.async,k=c.password,m=c.headers,c=c.body;try{var q=this.xhr=a.createXHR();this.setupEvents(q,a);e?q.open(f,g,h,e,k):q.open(f,g,h);h&&(q.timeout=a.timeout,q.responseType=a.responseType);"withCredentials"in q&&(q.withCredentials=!!a.withCredentials);this.setHeaders(q,m);c?q.send(c):q.send()}catch(dc){this.error(dc)}};a.prototype.serializeBody=function(a,c){if(!a||"string"===typeof a||A.FormData&&a instanceof A.FormData)return a;if(c){var b= c.indexOf(";");-1!==b&&(c=c.substring(0,b))}switch(c){case "application/x-www-form-urlencoded":return Object.keys(a).map(function(b){return encodeURIComponent(b)+"\x3d"+encodeURIComponent(a[b])}).join("\x26");case "application/json":return JSON.stringify(a);default:return a}};a.prototype.setHeaders=function(a,c){for(var b in c)c.hasOwnProperty(b)&&a.setRequestHeader(b,c[b])};a.prototype.getHeader=function(a,c){for(var b in a)if(b.toLowerCase()===c.toLowerCase())return a[b]};a.prototype.setupEvents= function(a,c){function b(a){var c=b.subscriber,d=b.progressSubscriber,e=b.request;d&&d.error(a);var f;try{f=new Nb(this,e)}catch(Na){f=Na}c.error(f)}function d(a){}function g(a){var b=g.subscriber,c=g.progressSubscriber,d=g.request;if(4===this.readyState){var e=1223===this.status?204:this.status,f="text"===this.responseType?this.response||this.responseText:this.response;0===e&&(e=f?200:0);if(400>e)c&&c.complete(),b.next(a),b.complete();else{c&&c.error(a);a=void 0;try{a=new ta("ajax error "+e,this, d)}catch(Af){a=Af}b.error(a)}}}var h=c.progressSubscriber;a.ontimeout=b;b.request=c;b.subscriber=this;b.progressSubscriber=h;if(a.upload&&"withCredentials"in a){if(h){var k;k=function(a){k.progressSubscriber.next(a)};A.XDomainRequest?a.onprogress=k:a.upload.onprogress=k;k.progressSubscriber=h}var m;m=function(a){var b=m.progressSubscriber,c=m.subscriber,d=m.request;b&&b.error(a);var e;try{e=new ta("ajax error",this,d)}catch(Na){e=Na}c.error(e)};a.onerror=m;m.request=c;m.subscriber=this;m.progressSubscriber= h}a.onreadystatechange=d;d.subscriber=this;d.progressSubscriber=h;d.request=c;a.onload=g;g.subscriber=this;g.progressSubscriber=h;g.request=c};a.prototype.unsubscribe=function(){var a=this.xhr;!this.done&&a&&4!==a.readyState&&"function"===typeof a.abort&&a.abort();c.prototype.unsubscribe.call(this)};return a}(m),Mb=function(){return function(c,a,b){this.originalEvent=c;this.xhr=a;this.request=b;this.status=a.status;this.responseType=a.responseType||b.responseType;this.response=rb(this.responseType, a)}}(),ta=function(){function c(a,b,c){Error.call(this);this.message=a;this.name="AjaxError";this.xhr=b;this.request=c;this.status=b.status;this.responseType=b.responseType||c.responseType;this.response=rb(this.responseType,b);return this}c.prototype=Object.create(Error.prototype);return c}(),Nb=function(c,a){ta.call(this,"ajax timeout",c,a);this.name="AjaxTimeoutError";return this},Gf=Object.freeze({ajax:O.create,AjaxResponse:Mb,AjaxError:ta,AjaxTimeoutError:Nb}),Hf={url:"",deserializer:function(c){return JSON.parse(c.data)}, serializer:function(c){return JSON.stringify(c)}},Ob=function(c){function a(a,d){var b=c.call(this)||this;if(a instanceof n)b.destination=d,b.source=a;else{d=b._config=sb({},Hf);b._output=new w;if("string"===typeof a)d.url=a;else for(var f in a)a.hasOwnProperty(f)&&(d[f]=a[f]);if(!d.WebSocketCtor&&WebSocket)d.WebSocketCtor=WebSocket;else if(!d.WebSocketCtor)throw Error("no WebSocket constructor can be found");b.destination=new Y}return b}h(a,c);a.prototype.lift=function(b){var c=new a(this._config, this.destination);c.operator=b;c.source=this;return c};a.prototype._resetState=function(){this._socket=null;this.source||(this.destination=new Y);this._output=new w};a.prototype.multiplex=function(a,c,e){var b=this;return new n(function(d){try{b.next(a())}catch(t){d.error(t)}var f=b.subscribe(function(a){try{e(a)&&d.next(a)}catch(L){d.error(L)}},function(a){return d.error(a)},function(){return d.complete()});return function(){try{b.next(c())}catch(t){d.error(t)}f.unsubscribe()}})};a.prototype._connectSocket= function(){var a=this,c=this._config,e=c.WebSocketCtor,f=c.protocol,g=c.url,c=c.binaryType,h=this._output,k=null;try{this._socket=k=f?new e(g,f):new e(g),c&&(this._socket.binaryType=c)}catch(q){h.error(q);return}var n=new p(function(){a._socket=null;k&&1===k.readyState&&k.close()});k.onopen=function(b){if(a._socket){var c=a._config.openObserver;c&&c.next(b);b=a.destination;a.destination=m.create(function(b){if(1===k.readyState)try{var c=a._config.serializer;k.send(c(b))}catch(fc){a.destination.error(fc)}}, function(b){var c=a._config.closingObserver;c&&c.next(void 0);b&&b.code?k.close(b.code,b.reason):h.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }"));a._resetState()},function(){var b=a._config.closingObserver;b&&b.next(void 0);k.close();a._resetState()});b&&b instanceof Y&&n.add(b.subscribe(a.destination))}else k.close(),a._resetState()};k.onerror=function(b){a._resetState();h.error(b)};k.onclose= function(b){a._resetState();var c=a._config.closeObserver;c&&c.next(b);b.wasClean?h.complete():h.error(b)};k.onmessage=function(b){try{var c=a._config.deserializer;h.next(c(b))}catch(ec){h.error(ec)}}};a.prototype._subscribe=function(a){var b=this,c=this.source;if(c)return c.subscribe(a);this._socket||this._connectSocket();this._output.subscribe(a);a.add(function(){var a=b._socket;0===b._output.observers.length&&(a&&1===a.readyState&&a.close(),b._resetState())});return a};a.prototype.unsubscribe= function(){var a=this._socket;a&&1===a.readyState&&a.close();this._resetState();c.prototype.unsubscribe.call(this)};return a}(Ga),If=Object.freeze({webSocket:function(c){return new Ob(c)},WebSocketSubject:Ob}),Jf=Object.freeze({fromFetch:function(c,a){void 0===a&&(a={});var b=a.selector,d=Qb(a,["selector"]);return new n(function(a){var e=new AbortController,g=e.signal,h=!0,k=!1,m=new p;m.add(function(){k=!0;h&&e.abort()});var n;if(d){if(d.signal)if(d.signal.aborted)e.abort();else{var r=d.signal,u= function(){g.aborted||e.abort()};r.addEventListener("abort",u);m.add(function(){return r.removeEventListener("abort",u)})}n=sb({},d,{signal:g})}else n={signal:g};fetch(c,n).then(function(c){b?m.add(F(b(c)).subscribe(function(b){return a.next(b)},function(b){h=!1;k||a.error(b)},function(){h=!1;a.complete()})):(h=!1,a.next(c),a.complete())}).catch(function(b){h=!1;k||a.error(b)});return m})}});k.operators=zf;k.testing=Cf;k.ajax=Gf;k.webSocket=If;k.fetch=Jf;k.Observable=n;k.ConnectableObservable=wb; k.GroupedObservable=Ha;k.observable=W;k.Subject=w;k.BehaviorSubject=xb;k.ReplaySubject=Y;k.AsyncSubject=V;k.asap=ia;k.asapScheduler=ia;k.async=z;k.asyncScheduler=Ab;k.queue=Ja;k.queueScheduler=Ja;k.animationFrame=Bb;k.animationFrameScheduler=Bb;k.VirtualTimeScheduler=Cb;k.VirtualAction=Ka;k.Scheduler=Ia;k.Subscription=p;k.Subscriber=m;k.Notification=x;k.pipe=wa;k.noop=E;k.identity=I;k.isObservable=function(c){return!!c&&(c instanceof n||"function"===typeof c.lift&&"function"===typeof c.subscribe)}; k.ArgumentOutOfRangeError=Z;k.EmptyError=fa;k.ObjectUnsubscribedError=K;k.UnsubscriptionError=aa;k.TimeoutError=Db;k.bindCallback=Ta;k.bindNodeCallback=Ua;k.combineLatest=function(){for(var c=[],a=0;ac)c=0;a&&"function"===typeof a.schedule||(a=z);return new n(function(b){b.add(a.schedule(hc,c,{subscriber:b,counter:0,period:c}));return b})};k.merge=cb;k.never=function(){return Fb};k.of=ka;k.onErrorResumeNext=Da;k.pairs=function(c,a){return a?new n(function(b){var d=Object.keys(c),e=new p;e.add(a.schedule(ic,0,{keys:d,index:0,subscriber:b,subscription:e,obj:c}));return e}):new n(function(a){for(var b=Object.keys(c),e=0;e=a){d.complete();break}d.next(f++);if(d.closed)break}while(1)})};k.throwError=za;k.timer=fb;k.using=function(c,a){return new n(function(b){var d;try{d=c()}catch(g){b.error(g); return}var e;try{e=a(d)}catch(g){b.error(g);return}var f=(e?F(e):U).subscribe(b);return function(){f.unsubscribe();d&&d.unsubscribe()}})};k.zip=gb;k.scheduled=Xa;k.EMPTY=U;k.NEVER=Fb;k.config=D;Object.defineProperty(k,"__esModule",{value:!0})}); //# sourceMappingURL=rxjs.umd.min.js.map