/* ***************************************************************************** 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}sd(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function P(b){return"function"===typeof b}function Q(b){setTimeout(function(){throw b;},0)}function wa(b){return null!==b&&"object"===typeof b}function Sa(b){return b.reduce(function(a,c){return a.concat(c instanceof ca?c.errors:c)},[])}function xa(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 D(){}function ya(){for(var b=[],a=0;a=c.length?c[0]:c);k.complete()}]))}catch(L){xa(k)?k.error(L):console.warn(L)}}return k.subscribe(d)})}}function zd(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 T;try{e.apply(f,c.concat([function(){for(var c=[],b=0;b=c.length?c[0]:c,subject:g}))}]))}catch(z){g.error(z)}}this.add(g.subscribe(d))} function Ad(b){var a=b.subject;a.next(b.value);a.complete()}function $a(b,a,c){if(a)if(w(a))c=a;else return function(){for(var d=[],e=0;e=c.length?c[0]:c),k.complete())}]))}catch(L){xa(k)?k.error(L):console.warn(L)}}return k.subscribe(d)})}}function Bd(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 T;try{e.apply(b,f.concat([function(){for(var c=[],b=0;b=c.length?c[0]:c,subject:g}))}]))}catch(z){this.add(k.schedule(ab,0,{err:z,subject:g}))}}this.add(g.subscribe(d))}function Cd(b){var a=b.subject;a.next(b.value);a.complete()}function ab(b){b.subject.error(b.err)}function bb(b){return!!b&&"function"!==typeof b.subscribe&&"function"===typeof b.then}function n(b,a,c,d,e){void 0===e&&(e=new G(b,c,d));if(!e.closed)return a instanceof g?a.subscribe(e):cb(a)(e)} function Dd(b,a){return new g(function(c){var d=new r;d.add(a.schedule(function(){var e=b[U]();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 Ed(b,a){return new g(function(c){var d=new r;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 Fd(b,a){if(!b)throw Error("Iterable cannot be null");return new g(function(c){var d=new r,e;d.add(function(){e&&"function"===typeof e.return&&e.return()});d.add(a.schedule(function(){e=b[E]();d.add(a.schedule(function(){if(!c.closed){var a,b;try{var d=e.next();a=d.value;b=d.done}catch(z){c.error(z);return}b?c.complete():(c.next(a),this.schedule())}}))}));return d})}function Gd(b,a){if(null!=b){if(b&&"function"=== typeof b[U])return Dd(b,a);if(bb(b))return Ed(b,a);if(db(b))return Aa(b,a);if(b&&"function"===typeof b[E]||"string"===typeof b)return Fd(b,a)}throw new TypeError((null!==b&&typeof b||b)+" is not observable");}function F(b,a){return a?Gd(b,a):b instanceof g?b:new g(cb(b))}function H(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(d){return d.pipe(H(function(c,d){return F(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 Hd(b, c))}}function na(b){void 0===b&&(b=Number.POSITIVE_INFINITY);return H(S,b)}function Ca(){return na(1)}function V(){for(var b=[],a=0;a=b.count?d.complete():(d.next(a),d.closed||(b.index=c+1,b.start=a+1,this.schedule(b)))}function ib(b,a,c){void 0===b&&(b=0);var d=-1;I(a)?d=1>Number(a)&&1||Number(a):w(a)&&(c=a);w(c)||(c=q);return new g(function(a){var e=I(b)?b:+b-c.now();return c.schedule(Sd,e,{index:0,period:d,subscriber:a})})}function Sd(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 Ga(){for(var b= [],a=0;ab)throw new Y;var c=2<=arguments.length;return function(d){return d.pipe(M(function(c,a){return a===b}),sa(1),c?X(a):ra(function(){return new Y}))}}function Ob(b,a){return function(c){return c.lift(new we(b,a,c))}}function Pb(){return function(b){return b.lift(new xe)}} function Ka(b,a){return a?function(c){return c.pipe(Ka(function(c,e){return F(b(c,e)).pipe(A(function(b,d){return a(c,b,e,d)}))}))}:function(c){return c.lift(new ye(b))}}function Qb(b,a,c){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===c&&(c=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return function(d){return d.lift(new ze(b,a,c))}}function Rb(b){return function(a){return a.lift(new Ae(b))}}function Sb(b,a){if("function"!==typeof b)throw new TypeError("predicate is not a function");return function(c){return c.lift(new Tb(b, c,!1,a))}}function Ub(b,a){return function(c){return c.lift(new Tb(b,c,!0,a))}}function Vb(b,a){var c=2<=arguments.length;return function(d){return d.pipe(b?M(function(c,a){return b(c,a,d)}):S,sa(1),c?X(a):ra(function(){return new ga}))}}function Wb(){return function(b){return b.lift(new Be)}}function Xb(){return function(b){return b.lift(new Ce)}}function ha(b){return function(a){return 0===b?R():a.lift(new De(b))}}function Yb(b,a){var c=2<=arguments.length;return function(d){return d.pipe(b?M(function(c, a){return b(c,a,d)}):S,ha(1),c?X(a):ra(function(){return new ga}))}}function Zb(b){return function(a){return a.lift(new Ee(b))}}function $b(){return function(b){return b.lift(new Fe)}}function Z(b,a){return 2<=arguments.length?function(c){return ya(W(b,a),ha(1),X(a))(c)}:function(c){return ya(W(function(c,a,f){return b(c,a,f+1)}),ha(1))(c)}}function ac(b){return Z("function"===typeof b?function(a,c){return 0c?a:c})}function bc(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY); if("function"===typeof a)return H(function(){return b},a,c);"number"===typeof a&&(c=a);return H(function(){return b},c)}function cc(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return function(d){return d.lift(new Ge(b,a,c))}}function dc(b){return Z("function"===typeof b?function(a,c){return 0>b(a,c)?a:c}:function(a,c){return ab?a.lift(new pc(-1,a)):a.lift(new pc(b-1,a))}}function qc(b){return function(a){return a.lift(new Me(b))}}function rc(b){void 0===b&&(b=-1);return function(a){return a.lift(new Ne(b,a))}}function sc(b){return function(a){return a.lift(new Oe(b,a))}}function tc(b){return function(a){return a.lift(new Pe(b))}}function uc(b, a){void 0===a&&(a=q);return function(c){return c.lift(new Qe(b,a))}}function Re(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function vc(b,a){return function(c){return c.lift(new Se(b,a))}}function Te(){return new u}function wc(){return function(b){return za()(J(Te)(b))}}function La(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(Ue(d))}}function Ue(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,t=!1;return function(a){g++;if(!k||l)l=!1,k=new aa(c,d,f),h=a.subscribe({next:function(c){k.next(c)},error:function(c){l=!0;k.error(c)},complete:function(){t=!0;h=void 0;k.complete()}});var b=k.subscribe(this);this.add(function(){g--;b.unsubscribe();h&&!t&&e&&0===g&&(h.unsubscribe(),k=h=void 0)})}}function xc(b){return function(a){return a.lift(new Ve(b,a))}}function yc(b){return function(a){return a.lift(new We(b))}} function zc(b){return function(a){return a.lift(new Xe(b))}}function Ac(b){return function(a){return a.lift(new Ye(b))}}function Bc(b){return function(a){return a.lift(new Ze(b))}}function Cc(){for(var b=[],a=0;a=a?this.connection=null:(c._refCount=a-1,1= a?this.connection=null:(c._refCount=a-1,1c?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){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._events.push(new zf(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 K;this.isStopped||this.hasError?g=r.EMPTY:(this.observers.push(c),g=new cd(this,c));f&&c.add(c=new jd(c,f));if(a)for(a=0;aa&&(g=Math.max(g,k-a));0a.index?1:-1:c.delay>a.delay?1:-1};return a}(ja),Y=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}(),ga=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}(),Lc=function(){function b(){Error.call(this); this.message="Timeout has occurred";this.name="TimeoutError";return this}b.prototype=Object.create(Error.prototype);return b}(),yd=function(){function b(a,c){this.project=a;this.thisArg=c}b.prototype.call=function(a,c){return c.subscribe(new Ff(a,this.project,this.thisArg))};return b}(),Ff=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),p=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),G=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.prototype._next=function(c){this.parent.notifyNext(this.outerValue, c,this.outerIndex,this.index++,this)};a.prototype._error=function(c){this.parent.notifyError(c,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);this.unsubscribe()};return a}(l),Gf=function(b){return function(a){b.then(function(c){a.closed||(a.next(c),a.complete())},function(c){return a.error(c)}).then(null,Q);return a}},E;E="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";var Hf=function(b){return function(a){var c=b[E]();do{var d= c.next();if(d.done){a.complete();break}a.next(d.value);if(a.closed)break}while(1);"function"===typeof c.return&&a.add(function(){c.return&&c.return()});return a}},If=function(b){return function(a){var c=b[U]();if("function"!==typeof c.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return c.subscribe(a)}},db=function(b){return b&&"number"===typeof b.length&&"function"!==typeof b},cb=function(b){if(b&&"function"===typeof b[U])return If(b);if(db(b))return Wa(b); if(bb(b))return Gf(b);if(b&&"function"===typeof b[E])return Hf(b);b=wa(b)?"an invalid object":"'"+b+"'";throw new TypeError("You provided "+b+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.");},nd={},qa=function(){function b(a){this.resultSelector=a}b.prototype.call=function(a,c){return c.subscribe(new Jf(a,this.resultSelector))};return b}(),Jf=function(b){function a(c,a){c=b.call(this,c)||this;c.resultSelector=a;c.active=0;c.values=[];c.observables=[];return c} h(a,b);a.prototype._next=function(c){this.values.push(nd);this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;for(var b=0;bthis.index};b.prototype.hasCompleted=function(){return this.array.length===this.index};return b}(),Rf=function(b){function a(c,a,e){c=b.call(this,c)||this;c.parent=a;c.observable=e;c.stillUnsubscribed=!0;c.buffer=[];c.isComplete=!1;return c}h(a,b);a.prototype[E]=function(){return this};a.prototype.next=function(){var c=this.buffer;return 0===c.length&&this.isComplete?{value:null,done:!0}:{value:c.shift(),done:!1}};a.prototype.hasValue=function(){return 0< this.buffer.length};a.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete};a.prototype.notifyComplete=function(){0d;d++)try{a=b[d];new B.ActiveXObject(a);break}catch(t){}c=new B.ActiveXObject(a)}catch(t){throw Error("XMLHttpRequest is not supported by your browser");}}return c},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"===typeof c)e.url=c;else for(var f in c)c.hasOwnProperty(f)&&(e[f]=c[f]);a.request=e;return a}h(a,b);a.prototype._subscribe= function(c){return new Uf(c,this.request)};a.create=function(){var c=function(c){return new a(c)};c.get=Td;c.post=Ud;c.delete=Vd;c.put=Wd;c.patch=Xd;c.getJSON=Yd;return c}();return a}(g),Uf=function(b){function a(c,a){c=b.call(this,c)||this;c.request=a;c.done=!1;var d=a.headers=a.headers||{};a.crossDomain||c.getHeader(d,"X-Requested-With")||(d["X-Requested-With"]="XMLHttpRequest");c.getHeader(d,"Content-Type")||B.FormData&&a.body instanceof B.FormData||"undefined"===typeof a.body||(d["Content-Type"]= "application/x-www-form-urlencoded; charset\x3dUTF-8");a.body=c.serializeBody(a.body,c.getHeader(a.headers,"Content-Type"));c.send();return c}h(a,b);a.prototype.next=function(c){this.done=!0;var a=this.xhr,b=this.request,f=this.destination,k;try{k=new Oa(c,a,b)}catch(y){return f.error(y)}f.next(k)};a.prototype.send=function(){var c=this.request,a=this.request,b=a.user,f=a.method,k=a.url,g=a.async,h=a.password,l=a.headers,a=a.body;try{var t=this.xhr=c.createXHR();this.setupEvents(t,c);b?t.open(f,k, g,b,h):t.open(f,k,g);g&&(t.timeout=c.timeout,t.responseType=c.responseType);"withCredentials"in t&&(t.withCredentials=!!c.withCredentials);this.setHeaders(t,l);a?t.send(a):t.send()}catch(Id){this.error(Id)}};a.prototype.serializeBody=function(c,a){if(!c||"string"===typeof c||B.FormData&&c instanceof B.FormData)return c;if(a){var b=a.indexOf(";");-1!==b&&(a=a.substring(0,b))}switch(a){case "application/x-www-form-urlencoded":return Object.keys(c).map(function(a){return encodeURIComponent(a)+"\x3d"+ encodeURIComponent(c[a])}).join("\x26");case "application/json":return JSON.stringify(c);default:return c}};a.prototype.setHeaders=function(c,a){for(var b in a)a.hasOwnProperty(b)&&c.setRequestHeader(b,a[b])};a.prototype.getHeader=function(c,a){for(var b in c)if(b.toLowerCase()===a.toLowerCase())return c[b]};a.prototype.setupEvents=function(c,a){function b(c){var a=b.subscriber,d=b.progressSubscriber,e=b.request;d&&d.error(c);var f;try{f=new Pa(this,e)}catch(Qa){f=Qa}a.error(f)}function d(c){}function k(c){var a= k.subscriber,b=k.progressSubscriber,d=k.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)b&&b.complete(),a.next(c),a.complete();else{b&&b.error(c);c=void 0;try{c=new ka("ajax error "+e,this,d)}catch(Vf){c=Vf}a.error(c)}}}var g=a.progressSubscriber;c.ontimeout=b;b.request=a;b.subscriber=this;b.progressSubscriber=g;if(c.upload&&"withCredentials"in c){if(g){var h;h=function(c){h.progressSubscriber.next(c)}; B.XDomainRequest?c.onprogress=h:c.upload.onprogress=h;h.progressSubscriber=g}var l;l=function(c){var a=l.progressSubscriber,b=l.subscriber,d=l.request;a&&a.error(c);var e;try{e=new ka("ajax error",this,d)}catch(Qa){e=Qa}b.error(e)};c.onerror=l;l.request=a;l.subscriber=this;l.progressSubscriber=g}c.onreadystatechange=d;d.subscriber=this;d.progressSubscriber=g;d.request=a;c.onload=k;k.subscriber=this;k.progressSubscriber=g;k.request=a};a.prototype.unsubscribe=function(){var c=this.xhr;!this.done&&c&& 4!==c.readyState&&"function"===typeof c.abort&&c.abort();b.prototype.unsubscribe.call(this)};return a}(l),Oa=function(){return function(b,a,c){this.originalEvent=b;this.xhr=a;this.request=c;this.status=a.status;this.responseType=a.responseType||c.responseType;this.response=kb(this.responseType,a)}}(),ka=function(){function b(a,c,b){Error.call(this);this.message=a;this.name="AjaxError";this.xhr=c;this.request=b;this.status=c.status;this.responseType=c.responseType||b.responseType;this.response=kb(this.responseType, c);return this}b.prototype=Object.create(Error.prototype);return b}(),Pa=function(b,a){ka.call(this,"ajax timeout",b,a);this.name="AjaxTimeoutError";return this},od=N.create,Wf={url:"",deserializer:function(b){return JSON.parse(b.data)},serializer:function(b){return JSON.stringify(b)}},mb=function(b){function a(c,a){var d=b.call(this)||this;if(c instanceof g)d.destination=a,d.source=c;else{a=d._config=rf({},Wf);d._output=new u;if("string"===typeof c)a.url=c;else for(var f in c)c.hasOwnProperty(f)&& (a[f]=c[f]);if(!a.WebSocketCtor&&WebSocket)a.WebSocketCtor=WebSocket;else if(!a.WebSocketCtor)throw Error("no WebSocket constructor can be found");d.destination=new aa}return d}h(a,b);a.prototype.lift=function(c){var b=new a(this._config,this.destination);b.operator=c;b.source=this;return b};a.prototype._resetState=function(){this._socket=null;this.source||(this.destination=new aa);this._output=new u};a.prototype.multiplex=function(c,a,b){var d=this;return new g(function(e){try{d.next(c())}catch(z){e.error(z)}var f= d.subscribe(function(c){try{b(c)&&e.next(c)}catch(L){e.error(L)}},function(c){return e.error(c)},function(){return e.complete()});return function(){try{d.next(a())}catch(z){e.error(z)}f.unsubscribe()}})};a.prototype._connectSocket=function(){var c=this,a=this._config,b=a.WebSocketCtor,f=a.protocol,k=a.url,a=a.binaryType,g=this._output,h=null;try{this._socket=h=f?new b(k,f):new b(k),a&&(this._socket.binaryType=a)}catch(t){g.error(t);return}var m=new r(function(){c._socket=null;h&&1===h.readyState&& h.close()});h.onopen=function(a){if(c._socket){var b=c._config.openObserver;b&&b.next(a);a=c.destination;c.destination=l.create(function(a){if(1===h.readyState)try{var b=c._config.serializer;h.send(b(a))}catch(Kd){c.destination.error(Kd)}},function(a){var b=c._config.closingObserver;b&&b.next(void 0);a&&a.code?h.close(a.code,a.reason):g.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }"));c._resetState()}, function(){var a=c._config.closingObserver;a&&a.next(void 0);h.close();c._resetState()});a&&a instanceof aa&&m.add(a.subscribe(c.destination))}else h.close(),c._resetState()};h.onerror=function(a){c._resetState();g.error(a)};h.onclose=function(a){c._resetState();var b=c._config.closeObserver;b&&b.next(a);a.wasClean?g.complete():g.error(a)};h.onmessage=function(a){try{var b=c._config.deserializer;g.next(b(a))}catch(Jd){g.error(Jd)}}};a.prototype._subscribe=function(c){var a=this,b=this.source;if(b)return b.subscribe(c); this._socket||this._connectSocket();this._output.subscribe(c);c.add(function(){var c=a._socket;0===a._output.observers.length&&(c&&1===c.readyState&&c.close(),a._resetState())});return c};a.prototype.unsubscribe=function(){var c=this._socket;c&&1===c.readyState&&c.close();this._resetState();b.prototype.unsubscribe.call(this)};return a}(ua),Xf=function(b){function a(c,a,e){void 0===a&&(a=0);void 0===e&&(e=va);var d=b.call(this)||this;d.source=c;d.delayTime=a;d.scheduler=e;if(!I(a)||0>a)d.delayTime= 0;e&&"function"===typeof e.schedule||(d.scheduler=va);return d}h(a,b);a.create=function(c,b,e){void 0===b&&(b=0);void 0===e&&(e=va);return new a(c,b,e)};a.dispatch=function(c){return this.add(c.source.subscribe(c.subscriber))};a.prototype._subscribe=function(c){return this.scheduler.schedule(a.dispatch,this.delayTime,{source:this.source,subscriber:c})};return a}(g),ob=function(){return function(b,a){this.value=b;this.timestamp=a}}(),$d=function(){function b(a,c,b){void 0===b&&(b=!1);this.accumulator= a;this.seed=c;this.hasSeed=b}b.prototype.call=function(a,c){return c.subscribe(new Yf(a,this.accumulator,this.seed,this.hasSeed))};return b}(),Yf=function(b){function a(c,a,e,f){c=b.call(this,c)||this;c.accumulator=a;c._seed=e;c.hasSeed=f;c.index=0;return c}h(a,b);Object.defineProperty(a.prototype,"seed",{get:function(){return this._seed},set:function(c){this.hasSeed=!0;this._seed=c},enumerable:!0,configurable:!0});a.prototype._next=function(c){if(this.hasSeed)return this._tryNext(c);this.seed=c; this.destination.next(c)};a.prototype._tryNext=function(c){var a=this.index++,b;try{b=this.accumulator(this.seed,c,a)}catch(f){this.destination.error(f)}this.seed=b;this.destination.next(b)};return a}(l),qb=function(){return function(b,a){this.value=b;this.interval=a}}(),pa={leading:!0,trailing:!1},ae=function(){function b(a,c,b){this.durationSelector=a;this.leading=c;this.trailing=b}b.prototype.call=function(a,c){return c.subscribe(new Zf(a,this.durationSelector,this.leading,this.trailing))};return b}(), Zf=function(b){function a(c,a,e,f){var d=b.call(this,c)||this;d.destination=c;d.durationSelector=a;d._leading=e;d._trailing=f;d._hasValue=!1;return d}h(a,b);a.prototype._next=function(c){this._hasValue=!0;this._sendValue=c;this._throttled||(this._leading?this.send():this.throttle(c))};a.prototype.send=function(){var c=this._sendValue;this._hasValue&&(this.destination.next(c),this.throttle(c));this._hasValue=!1;this._sendValue=null};a.prototype.throttle=function(c){(c=this.tryDurationSelector(c))&& this.add(this._throttled=n(this,c))};a.prototype.tryDurationSelector=function(c){try{return this.durationSelector(c)}catch(d){return this.destination.error(d),null}};a.prototype.throttlingDone=function(){var c=this._throttled,a=this._trailing;c&&c.unsubscribe();this._throttled=null;a&&this.send()};a.prototype.notifyNext=function(c,a,b,f,g){this.throttlingDone()};a.prototype.notifyComplete=function(){this.throttlingDone()};return a}(p);g.bindCallback=Za;g.bindNodeCallback=$a;g.combineLatest=function(){for(var b= [],a=0;ab)b=0;a&&"function"===typeof a.schedule||(a=q);return new g(function(c){c.add(a.schedule(Md,b,{subscriber:c,counter:0,period:b}));return c})}; g.merge=Ea;g.race=hb;g.never=function(){return Lf};g.of=fa;g.onErrorResumeNext=Fa;g.pairs=function(b,a){return a?new g(function(c){var d=Object.keys(b),e=new r;e.add(a.schedule(Nd,0,{keys:d,index:0,subscriber:c,subscription:e,obj:b}));return e}):new g(function(c){for(var a=Object.keys(b),e=0;e=a){d.complete();break}d.next(f++);if(d.closed)break}while(1)})};g.using=function(b,a){return new g(function(c){var d;try{d=b()}catch(k){c.error(k);return}var e;try{e=a(d)}catch(k){c.error(k);return}var f=(e?F(e):da).subscribe(c);return function(){f.unsubscribe();d&&d.unsubscribe()}})};g.throw=ma;g.throwError=ma;g.timer=ib;g.zip=Ga;var $f=Object.freeze({ajax:od,AjaxResponse:Oa,AjaxError:ka,AjaxTimeoutError:Pa});g.ajax=od;var ag=Object.freeze({webSocket:lb, WebSocketSubject:mb});g.webSocket=lb;var be=function(){function b(a){this.durationSelector=a}b.prototype.call=function(a,c){return c.subscribe(new bg(a,this.durationSelector))};return b}(),bg=function(b){function a(c,a){c=b.call(this,c)||this;c.durationSelector=a;c.hasValue=!1;return c}h(a,b);a.prototype._next=function(c){this.value=c;this.hasValue=!0;if(!this.throttled){var a=void 0;try{var b=this.durationSelector,a=b(c)}catch(f){return this.destination.error(f)}c=n(this,a);!c||c.closed?this.clearThrottle(): this.add(this.throttled=c)}};a.prototype.clearThrottle=function(){var c=this.value,a=this.hasValue,b=this.throttled;b&&(this.remove(b),this.throttled=null,b.unsubscribe());a&&(this.value=null,this.hasValue=!1,this.destination.next(c))};a.prototype.notifyNext=function(c,a,b,f){this.clearThrottle()};a.prototype.notifyComplete=function(){this.clearThrottle()};return a}(p),ce=function(){function b(a){this.closingNotifier=a}b.prototype.call=function(a,c){return c.subscribe(new cg(a,this.closingNotifier))}; return b}(),cg=function(b){function a(c,a){c=b.call(this,c)||this;c.buffer=[];c.add(n(c,a));return c}h(a,b);a.prototype._next=function(c){this.buffer.push(c)};a.prototype.notifyNext=function(c,a,b,f,g){c=this.buffer;this.buffer=[];this.destination.next(c)};return a}(p),de=function(){function b(a,c){this.bufferSize=a;this.subscriberClass=(this.startBufferEvery=c)&&a!==c?dg:eg}b.prototype.call=function(a,c){return c.subscribe(new this.subscriberClass(a,this.bufferSize,this.startBufferEvery))};return b}(), eg=function(b){function a(c,a){c=b.call(this,c)||this;c.bufferSize=a;c.buffer=[];return c}h(a,b);a.prototype._next=function(c){var a=this.buffer;a.push(c);a.length==this.bufferSize&&(this.destination.next(a),this.buffer=[])};a.prototype._complete=function(){var c=this.buffer;0e;if(c.timespanOnly)c.add(f.closeAction=g.schedule(xb,a,{subscriber:c,context:f,bufferTimeSpan:a})); else{var d={bufferTimeSpan:a,bufferCreationInterval:e,subscriber:c,scheduler:g};c.add(f.closeAction=g.schedule(yb,a,{subscriber:c,context:f}));c.add(g.schedule(fe,e,d))}return c}h(a,b);a.prototype._next=function(c){for(var a=this.contexts,b=a.length,f,g=0;g=b[0].time-f.now();)b.shift().notification.observe(g);0this.total)throw new Y;}b.prototype.call=function(a,c){return c.subscribe(new wg(a,this.total))};return b}(),wg=function(b){function a(a,d){a=b.call(this,a)||this;a.total=d; a.count=0;return a}h(a,b);a.prototype._next=function(a){var c=this.total,b=++this.count;b<=c&&(this.destination.next(a),b===c&&(this.destination.complete(),this.unsubscribe()))};return a}(l),we=function(){function b(a,c,b){this.predicate=a;this.thisArg=c;this.source=b}b.prototype.call=function(a,c){return c.subscribe(new xg(a,this.predicate,this.thisArg,this.source))};return b}(),xg=function(b){function a(a,d,e,f){a=b.call(this,a)||this;a.predicate=d;a.thisArg=e;a.source=f;a.index=0;a.thisArg=e|| a;return a}h(a,b);a.prototype.notifyComplete=function(a){this.destination.next(a);this.destination.complete()};a.prototype._next=function(a){var c=!1;try{c=this.predicate.call(this.thisArg,a,this.index++,this.source)}catch(e){this.destination.error(e);return}c||this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(l),xe=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new yg(a))};return b}(),yg=function(b){function a(a){a=b.call(this, a)||this;a.hasCompleted=!1;a.hasSubscription=!1;return a}h(a,b);a.prototype._next=function(a){this.hasSubscription||(this.hasSubscription=!0,this.add(n(this,a)))};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyComplete=function(a){this.remove(a);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(p),ye=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new zg(a, this.project))};return b}(),zg=function(b){function a(a,d){a=b.call(this,a)||this;a.project=d;a.hasSubscription=!1;a.hasCompleted=!1;a.index=0;return a}h(a,b);a.prototype._next=function(a){this.hasSubscription||this.tryNext(a)};a.prototype.tryNext=function(a){var c,b=this.index++;try{c=this.project(a,b)}catch(f){this.destination.error(f);return}this.hasSubscription=!0;this._innerSub(c,a,b)};a.prototype._innerSub=function(a,b,e){b=new G(this,b,e);e=this.destination;e.add(b);a=n(this,a,void 0,void 0, b);a!==b&&e.add(a)};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete();this.unsubscribe()};a.prototype.notifyNext=function(a,b,e,f,g){this.destination.next(b)};a.prototype.notifyError=function(a){this.destination.error(a)};a.prototype.notifyComplete=function(a){this.destination.remove(a);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(p),ze=function(){function b(a,c,b){this.project=a;this.concurrent=c;this.scheduler= b}b.prototype.call=function(a,c){return c.subscribe(new Ag(a,this.project,this.concurrent,this.scheduler))};return b}(),Ag=function(b){function a(a,d,e,f){a=b.call(this,a)||this;a.project=d;a.concurrent=e;a.scheduler=f;a.index=0;a.active=0;a.hasCompleted=!1;ethis.total)throw new Y;}b.prototype.call=function(a,c){return c.subscribe(new Fg(a,this.total))};return b}(),Fg=function(b){function a(a, d){a=b.call(this,a)||this;a.total=d;a.ring=[];a.count=0;return a}h(a,b);a.prototype._next=function(a){var c=this.ring,b=this.total,f=this.count++;c.length=this.total?this.total:this.count,f=this.ring,g=0;gthis.total&&this.destination.next(a)};return a}(l),Xe=function(){function b(a){this._skipCount=a;if(0>this._skipCount)throw new Y;}b.prototype.call=function(a, c){return 0===this._skipCount?c.subscribe(new l(a)):c.subscribe(new Vg(a,this._skipCount))};return b}(),Vg=function(b){function a(a,d){a=b.call(this,a)||this;a._skipCount=d;a._count=0;a._ring=Array(d);return a}h(a,b);a.prototype._next=function(a){var c=this._skipCount,b=this._count++;if(b=this.maxWindowSize&& this.closeWindow(g))}};a.prototype._error=function(a){for(var b=this.windows;0(a||0)?Number.POSITIVE_INFINITY:a;return Qb(b,a,c)(this)};g.prototype.elementAt=function(b,a){return Nb.apply(void 0,arguments)(this)};g.prototype.filter=function(b,a){return M(b,a)(this)};g.prototype.finally=Xc;g.prototype._finally=Xc;g.prototype.find=function(b,a){return Sb(b,a)(this)};g.prototype.findIndex=function(b, a){return Ub(b,a)(this)};g.prototype.first=function(){for(var b=[],a=0;al?new la(h):new la(h,l)};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 "!"');for(var d=a.length,h=[],k=g?a.replace(/^[ ]+/,"").indexOf("^"):a.indexOf("^"),l=-1===k?0:k*-this.frameTimeFactor,m="object"!==typeof b?function(a){return a}:function(a){return f&&b[a]instanceof Ra?b[a].messages:b[a]},n=-1,k=function(b){var d=l,f=function(a){d+=a*c.frameTimeFactor},k=void 0,p=a[b];switch(p){case " ":g||f(1);break;case "-":f(1); break;case "(":n=l;f(1);break;case ")":n=-1;f(1);break;case "|":k=v.createComplete();f(1);break;case "^":f(1);break;case "#":k=v.createError(e||"error");f(1);break;default:if(g&&p.match(/^[0-9]$/)&&(0===b||" "===a[b-1])){var t=a.slice(b).match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(t){b+=t[0].length-1;var p=parseFloat(t[1]),u=void 0;switch(t[2]){case "ms":u=p;break;case "s":u=1E3*p;break;case "m":u=6E4*p}f(u/q.frameTimeFactor);break}}k=v.createNext(m(p));f(1)}k&&h.push({frame:-1