/** @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}Mb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function Q(c){return"function"===typeof c}function R(c){setTimeout(function(){throw c;},0)}function sa(c){return null!==c&&"object"===typeof c}function Ma(c){Error.call(this);this.message=c?c.length+ " errors occurred during unsubscription:\n"+c.map(function(a,b){return b+1+") "+a.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors=c;return this}function Na(c){return c.reduce(function(a,b){return a.concat(b instanceof Y?b.errors:b)},[])}function ta(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 D(){}function ua(){for(var c=[],a=0;a=b.length?b[0]:b);g.complete()}]))}catch(L){ta(g)?g.error(L):console.warn(L)}}return g.subscribe(d)})}}function Rb(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 U;try{e.apply(f,b.concat([function(){for(var b=[],c=0;c=b.length?b[0]:b,subject:l}))}]))}catch(u){l.error(u)}}this.add(l.subscribe(d))} function Sb(c){var a=c.subject;a.next(c.value);a.complete()}function Ta(c,a,b){if(a)if(A(a))b=a;else return function(){for(var d=[],e=0;e=b.length?b[0]:b),g.complete())}]))}catch(L){ta(g)?g.error(L):console.warn(L)}}return g.subscribe(d)})}}function Tb(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 U;try{e.apply(c,f.concat([function(){for(var b=[],c=0;c=b.length?b[0]:b,subject:l}))}]))}catch(u){this.add(g.schedule(Ua,0,{err:u,subject:l}))}}this.add(l.subscribe(d))}function Ub(c){var a=c.subject;a.next(c.value);a.complete()}function Ua(c){c.subject.error(c.err)}function Va(c){return!!c&&"function"!==typeof c.subscribe&&"function"===typeof c.then}function p(c,a,b,d,e){void 0===e&&(e=new H(c,b,d));if(!e.closed)return a instanceof n?a.subscribe(e):ia(a)(e)} function Vb(c,a){return new n(function(b){var d=new t;d.add(a.schedule(function(){var e=c[V]();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 Wb(c,a){return new n(function(b){var d=new t;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 Xb(c,a){if(!c)throw Error("Iterable cannot be null");return new n(function(b){var d=new t,e;d.add(function(){e&&"function"===typeof e.return&&e.return()});d.add(a.schedule(function(){e=c[F]();d.add(a.schedule(function(){if(!b.closed){var a,c;try{var d=e.next();a=d.value;c=d.done}catch(u){b.error(u);return}c?b.complete():(b.next(a),this.schedule())}}))}));return d})}function Wa(c,a){if(null!=c){if(c&&"function"=== typeof c[V])return Vb(c,a);if(Va(c))return Wb(c,a);if(Xa(c))return wa(c,a);if(c&&"function"===typeof c[F]||"string"===typeof c)return Xb(c,a)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");}function G(c,a){return a?Wa(c,a):c instanceof n?c:new n(ia(c))}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 G(c(b,d)).pipe(B(function(c,e){return a(b,c,d,e)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new Yb(c, b))}}function za(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return M(J,c)}function Ya(){return za(1)}function aa(){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 eb(c,a,b){void 0===c&&(c=0);var d=-1;W(a)?d=1>Number(a)&&1||Number(a):A(a)&&(b=a);A(b)||(b=y);return new n(function(a){var e=W(c)?c:+c-b.now();return b.schedule(hc,e,{index:0,period:d,subscriber:a})})}function hc(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 fb(){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){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._events.push(new Wc(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 E;this.isStopped||this.hasError?l=t.EMPTY:(this.observers.push(b),l=new tb(this,b));f&&b.add(b=new yb(b,f));if(a)for(a=0;aa&&(l=Math.max(l,g-a));0a.index?1:-1:b.delay>a.delay?1:-1};return a}(fa);K.prototype=Object.create(Error.prototype);Ra.prototype=Object.create(Error.prototype);var ca=Ra;ya.prototype=Object.create(Error.prototype);var Qb=function(){function c(a,b){this.project=a;this.thisArg=b}c.prototype.call=function(a, b){return b.subscribe(new ad(a,this.project,this.thisArg))};return c}(),ad=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),H=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),bd=function(c){return function(a){c.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,R);return a}},F;F="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var cd=function(c){return function(a){var b=c[F]();do{var d=b.next();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}},dd=function(c){return function(a){var b= c[V]();if("function"!==typeof b.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return b.subscribe(a)}},Xa=function(c){return c&&"number"===typeof c.length&&"function"!==typeof c},ia=function(c){if(c&&"function"===typeof c[V])return dd(c);if(Xa(c))return Qa(c);if(Va(c))return bd(c);if(c&&"function"===typeof c[F])return cd(c);c=sa(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."); },Bb={},Ja=function(){function c(a){this.resultSelector=a}c.prototype.call=function(a,b){return b.subscribe(new ed(a,this.resultSelector))};return c}(),ed=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(Bb);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}(),ld=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[F]=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(ib,a,{subscriber:b,context:f,bufferTimeSpan:a}));else{var d={bufferTimeSpan:a,bufferCreationInterval:e,subscriber:b,scheduler:g};b.add(f.closeAction=g.schedule(jb,a,{subscriber:b,context:f}));b.add(g.schedule(jc,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 K; }c.prototype.call=function(a,b){return b.subscribe(new Ud(a,this.total))};return c}(),Ud=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),Wd=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 Vd(a,this.predicate,this.thisArg, this.source))};return c}(),Vd=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), Yd=function(){function c(){}c.prototype.call=function(a,b){return b.subscribe(new Xd(a))};return c}(),Xd=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(p(this,b)))};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyComplete=function(b){this.remove(b);this.hasSubscription=!1;this.hasCompleted&& this.destination.complete()};return a}(q),qc=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Zd(a,this.project))};return c}(),Zd=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,b,c)};a.prototype._innerSub=function(b,a,c){var d=new H(this,void 0,void 0);this.destination.add(d);p(this,b,a,c,d)};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(b,a,c,f,g){this.destination.next(a)};a.prototype.notifyError=function(b){this.destination.error(b)};a.prototype.notifyComplete=function(b){this.destination.remove(b);this.hasSubscription=!1;this.hasCompleted&& this.destination.complete()};return a}(q),ae=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 $d(a,this.project,this.concurrent,this.scheduler))};return c}(),$d=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 K; }c.prototype.call=function(a,b){return b.subscribe(new ie(a,this.total))};return c}(),ie=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),Ne=function(){function c(a){this._skipCount=a;if(0>this._skipCount)throw new K;}c.prototype.call=function(a,b){return 0===this._skipCount?b.subscribe(new m(a)):b.subscribe(new Me(a,this._skipCount))};return c}(),Me=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=qa);return b}h(a,c);a.create=function(b,c,e){void 0=== c&&(c=0);void 0===e&&(e=qa);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),Te=function(){function c(a,b){this.scheduler=a;this.delay=b}c.prototype.call=function(a,b){return(new Se(b,this.delay,this.scheduler)).subscribe(a)};return c}(),zc=function(){function c(a){this.project=a}c.prototype.call=function(a,b){return b.subscribe(new Ue(a, this.project))};return c}(),Ue=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,c)};a.prototype._innerSub=function(a,c,e){var b=this.innerSubscription;b&&b.unsubscribe();b=new H(this,void 0,void 0);this.destination.add(b);this.innerSubscription=p(this,a,c,e,b)};a.prototype._complete=function(){var a=this.innerSubscription;a&& !a.closed||c.prototype._complete.call(this);this.unsubscribe()};a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.destination.remove(a);this.innerSubscription=null;this.isStopped&&c.prototype._complete.call(this)};a.prototype.notifyNext=function(a,c,e,f,g){this.destination.next(c)};return a}(q),We=function(){function c(a){this.notifier=a}c.prototype.call=function(a,b){a=new Ve(a);var c=p(a,this.notifier);return c&&!a.seenValue?(a.add(c),b.subscribe(a)): a};return c}(),Ve=function(c){function a(a){a=c.call(this,a)||this;a.seenValue=!1;return a}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.seenValue=!0;this.complete()};a.prototype.notifyComplete=function(){};return a}(q),Ye=function(){function c(a,b){this.predicate=a;this.inclusive=b}c.prototype.call=function(a,b){return b.subscribe(new Xe(a,this.predicate,this.inclusive))};return c}(),Xe=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),$e=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 Ze(a,this.nextOrObserver,this.error,this.complete))};return c}(),Ze=function(c){function a(a, d,e,f){a=c.call(this,a)||this;a._tapNext=D;a._tapError=D;a._tapComplete=D;a._tapError=e||D;a._tapComplete=f||D;Q(d)?(a._context=a,a._tapNext=d):d&&(a._context=d,a._tapNext=d.next||D,a._tapError=d.error||D,a._tapComplete=d.complete||D);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),Gb={leading:!0,trailing:!1},bf=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 af(a,this.durationSelector,this.leading,this.trailing))};return c}(),af=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=null};a.prototype.throttle=function(a){(a=this.tryDurationSelector(a))&&this.add(this._throttled=p(this,a))};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=null;c&&this.send()};a.prototype.notifyNext=function(a,c,e,f,g){this.throttlingDone()};a.prototype.notifyComplete=function(){this.throttlingDone()};return a}(q),df=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 cf(a,this.duration,this.scheduler,this.leading,this.trailing))};return c}(), cf=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(Ac,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),ef=function(){return function(c,a){this.value=c;this.interval=a}}(),Bc=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 ff(a,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))};return c}(),ff=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.action=null;a.scheduleTimeout();return a}h(a,c);a.dispatchTimeout=function(a){var b=a.withObservable;a._unsubscribeAndRecycle();a.add(p(a,b))};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.withObservable=this.scheduler=this.action=null};return a}(q),gf=function(){return function(c,a){this.value=c;this.timestamp=a}}(),jf=function(){function c(a){this.windowBoundaries=a}c.prototype.call=function(a,b){a=new hf(a);b=b.subscribe(a);b.closed||a.add(p(a, this.windowBoundaries));return b};return c}(),hf=function(c){function a(a){var b=c.call(this,a)||this;b.window=new v;a.next(b.window);return b}h(a,c);a.prototype.notifyNext=function(a,c,e,f,g){this.openWindow()};a.prototype.notifyError=function(a,c){this._error(a)};a.prototype.notifyComplete=function(a){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 v;a.next(c)};return a}(q),lf=function(){function c(a,b){this.windowSize=a;this.startWindowEvery=b}c.prototype.call=function(a,b){return b.subscribe(new kf(a,this.windowSize,this.startWindowEvery))};return c}(),kf=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 v];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 K;var b=2<=arguments.length;return function(d){return d.pipe(I(function(a,b){return b===c}),Ca(1),b?ba(a):ka(function(){return new K}))}},endWith:function(){for(var c=[],a=0;a(a||0)?Number.POSITIVE_INFINITY:a;return function(d){return d.lift(new ae(c,a,b))}},filter:I,finalize:function(c){return function(a){return a.lift(new ce(c))}},find:function(c,a){if("function"!==typeof c)throw new TypeError("predicate is not a function");return function(b){return b.lift(new Eb(c,b,!1,a))}},findIndex:function(c, a){return function(b){return b.lift(new Eb(c,b,!0,a))}},first:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c?I(function(a,b){return c(a,b,d)}):J,Ca(1),b?ba(a):ka(function(){return new ca}))}},groupBy:function(c,a,b,d){return function(e){return e.lift(new Qc(c,a,b,d))}},ignoreElements:function(){return function(c){return c.lift(new fe)}},isEmpty:function(){return function(c){return c.lift(new he)}},last:function(c,a){var b=2<=arguments.length;return function(d){return d.pipe(c? I(function(a,b){return c(a,b,d)}):J,la(1),b?ba(a):ka(function(){return new ca}))}},map:B,mapTo:function(c){return function(a){return a.lift(new ke(c))}},materialize:function(){return function(c){return c.lift(new me)}},max:function(c){return na("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 Fb(-1,a)):a.lift(new Fb(c-1,a))}},repeatWhen:function(c){return function(a){return a.lift(new we(c))}},retry:function(c){void 0===c&&(c=-1);return function(a){return a.lift(new ye(c,a))}},retryWhen:function(c){return function(a){return a.lift(new Ae(c,a))}},refCount:va,sample:function(c){return function(a){return a.lift(new Ce(c))}},sampleTime:function(c, a){void 0===a&&(a=y);return function(b){return b.lift(new Ee(c,a))}},scan:ma,sequenceEqual:function(c,a){return function(b){return b.lift(new Ge(c,a))}},share:function(){return function(c){return va()(N(xc)(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(yc(d))}},single:function(c){return function(a){return a.lift(new Je(c,a))}},skip:function(c){return function(a){return a.lift(new Le(c))}},skipLast:function(c){return function(a){return a.lift(new Ne(c))}}, skipUntil:function(c){return function(a){return a.lift(new Pe(c))}},skipWhile:function(c){return function(a){return a.lift(new Re(c))}},startWith:function(){for(var c=[],a=0;ak?new ga(h):new ga(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 Ka?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=w.createComplete();f(1);break;case "^":f(1);break;case "#":l=w.createError(e||"error");f(1);break;default:if(g&&k.match(/^[0-9]$/)&&(0===c||" "===a[c-1])){var u=a.slice(c).match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(u){c+=u[0].length-1;var k=parseFloat(u[1]),r=void 0;switch(u[2]){case "ms":r=k;break;case "s":r=1E3*k;break;case "m":r= 6E4*k}f(r/q.frameTimeFactor);break}}l=w.createNext(n(k));f(1)}l&&h.push({frame:-1d;d++)try{b=c[d];new z.ActiveXObject(b);break}catch(r){}a=new z.ActiveXObject(b)}catch(r){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 Bf(a,this.request)};a.create=function(){var b=function(b){return new a(b)};b.get=Fc;b.post=Gc;b.delete=Hc;b.put=Ic;b.patch=Jc;b.getJSON=Kc;return b}();return a}(n),Bf=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")||z.FormData&&d.body instanceof z.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 Jb(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 r=this.xhr=a.createXHR();this.setupEvents(r,a);e?r.open(f,g,h,e,k):r.open(f,g,h);h&&(r.timeout=a.timeout,r.responseType=a.responseType);"withCredentials"in r&&(r.withCredentials=!!a.withCredentials);this.setHeaders(r,m);c?r.send(c):r.send()}catch(Zb){this.error(Zb)}};a.prototype.serializeBody=function(a,c){if(!a||"string"===typeof a||z.FormData&&a instanceof z.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 Kb(this,e)}catch(La){f=La}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 ra("ajax error "+ e,this,d)}catch(wf){a=wf}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)};z.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 ra("ajax error",this,d)}catch(La){e=La}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),Jb=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)}}();qb.prototype=Object.create(Error.prototype);var ra=qb,Kb=function(c,a){ra.call(this,"ajax timeout",c,a);this.name="AjaxTimeoutError";return this},Cf=Object.freeze({ajax:O.create,AjaxResponse:Jb,AjaxError:ra,AjaxTimeoutError:Kb}),Df={url:"",deserializer:function(c){return JSON.parse(c.data)},serializer:function(c){return JSON.stringify(c)}},Lb=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=Mc({},Df);b._output=new v;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 X}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 X);this._output=new v};a.prototype.multiplex=function(a,c,e){var b= this;return new n(function(d){try{b.next(a())}catch(u){d.error(u)}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(u){d.error(u)}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(r){h.error(r); return}var n=new t(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(ac){a.destination.error(ac)}},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 X&&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($b){h.error($b)}}};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}(Ea),Ef=Object.freeze({webSocket:function(c){return new Lb(c)},WebSocketSubject:Lb}),Ff=Object.freeze({fromFetch:function(c,a){return new n(function(b){var d= new AbortController,e=d.signal,f=!0,g=!1;a?(a.signal&&a.signal.addEventListener("abort",function(){e.aborted||d.abort()}),a.signal=e):a={signal:e};fetch(c,a).then(function(a){f=!1;b.next(a);b.complete()}).catch(function(a){f=!1;g||b.error(a)});return function(){g=!0;f&&d.abort()}})}});k.operators=vf;k.testing=yf;k.ajax=Cf;k.webSocket=Ef;k.fetch=Ff;k.Observable=n;k.ConnectableObservable=vb;k.GroupedObservable=Fa;k.observable=V;k.Subject=v;k.BehaviorSubject=wb;k.ReplaySubject=X;k.AsyncSubject=U;k.asapScheduler= qa;k.asyncScheduler=y;k.queueScheduler=xb;k.animationFrameScheduler=$c;k.VirtualTimeScheduler=Ab;k.VirtualAction=Ia;k.Scheduler=Ga;k.Subscription=t;k.Subscriber=m;k.Notification=w;k.pipe=ua;k.noop=D;k.identity=J;k.isObservable=function(c){return!!c&&(c instanceof n||"function"===typeof c.lift&&"function"===typeof c.subscribe)};k.ArgumentOutOfRangeError=K;k.EmptyError=ca;k.ObjectUnsubscribedError=E;k.UnsubscriptionError=Y;k.TimeoutError=ya;k.bindCallback=Sa;k.bindNodeCallback=Ta;k.combineLatest=function(){for(var c= [],a=0;ac)c=0;a&&"function"===typeof a.schedule||(a=y);return new n(function(b){b.add(a.schedule(cc,c,{subscriber:b,counter:0,period:c}));return b})};k.merge= bb;k.never=function(){return Cb};k.of=ha;k.onErrorResumeNext=Ba;k.pairs=function(c,a){return a?new n(function(b){var d=Object.keys(c),e=new t;e.add(a.schedule(dc,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=xa;k.timer=eb;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?G(e):T).subscribe(b);return function(){f.unsubscribe();d&&d.unsubscribe()}})};k.zip=fb;k.scheduled=Wa;k.EMPTY=T;k.NEVER=Cb;k.config= C;Object.defineProperty(k,"__esModule",{value:!0})}); //# sourceMappingURL=rxjs.umd.min.js.map