Repository navigation
Expand file tree
/
Copy pathrx.all.min.js
More file actions
6 lines (6 loc) · 112 KB
/
Copy pathrx.all.min.js
File metadata and controls
6 lines (6 loc) · 112 KB
1
2
3
4
5
6
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(){try{return za.apply(this,arguments)}catch(a){return Ra.e=a,Ra}}function d(a){if(!Qa(a))throw new TypeError("fn must be a function");return za=a,c}function e(a){throw a}function f(a,b){if(Sa&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Wa)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+Wa+"\n");a.stack=g(e)}}function g(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];h(f)||i(f)||!f||c.push(f)}return c.join("\n")}function h(a){var b=k(a);if(!b)return!1;var c=b[0],d=b[1];return c===Ua&&d>=Va&&Wd>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if(Sa)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=k(c);if(!d)return;return Ua=d[0],d[1]}}function k(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function l(a){var b=[];if(!ca(a))return b;Db.nonEnumArgs&&a.length&&Eb(a)&&(a=Gb.call(a));var c=Db.enumPrototypes&&"function"==typeof a,d=Db.enumErrorProps&&(a===xb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Db.nonEnumShadows&&a!==yb){var f=a.constructor,g=-1,h=jb;if(a===(f&&f.prototype))var i=a===zb?tb:a===xb?ob:ub.call(a),j=Cb[i];for(;++g<h;)e=ib[g],j&&j[e]||!vb.call(a,e)||b.push(e)}return b}function m(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function n(a,b){return m(a,b,l)}function o(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function p(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=ub.call(a),h=ub.call(b);if(g==kb&&(g=rb),h==kb&&(h=rb),g!=h)return!1;switch(g){case mb:case nb:return+a==+b;case qb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case sb:case tb:return a==String(b)}var i=g==lb;if(!i){if(g!=rb||!Db.nodeClass&&(o(a)||o(b)))return!1;var j=!Db.argsObject&&Eb(a)?Object:a.constructor,k=!Db.argsObject&&Eb(b)?Object:b.constructor;if(!(j==k||vb.call(a,"constructor")&&vb.call(b,"constructor")||Qa(j)&&j instanceof j&&Qa(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var m=0,q=!0;if(c.push(a),d.push(b),i){if(l=a.length,m=b.length,q=m==l)for(;m--;){var r=b[m];if(!(q=p(a[m],r,c,d)))break}}else n(b,function(b,e,f){return vb.call(f,e)?(m++,q=vb.call(a,e)&&p(a[e],b,c,d)):void 0}),q&&n(a,function(a,b,c){return vb.call(c,b)?q=--m>-1:void 0});return c.pop(),d.pop(),q}function q(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function r(a,b){this.id=a,this.value=b}function s(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function t(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function u(a){this._s=a}function v(a){this._s=a,this._l=a.length,this._i=0}function w(a){this._a=a}function x(a){this._a=a,this._l=B(a),this._i=0}function y(a){return"number"==typeof a&&Ha.isFinite(a)}function z(b){var c,d=b[cb];if(!d&&"string"==typeof b)return c=new u(b),c[cb]();if(!d&&b.length!==a)return c=new w(b),c[cb]();if(!d)throw new TypeError("Object is not iterable");return b[cb]()}function A(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function B(a){var b=+a.length;return isNaN(b)?0:0!==b&&y(b)?(b=A(b)*Math.floor(Math.abs(b)),0>=b?0:b>Mc?Mc:b):b}function C(a,b){this.observer=a,this.parent=b}function D(a,b){return Zb(a)||(a=cc),new Oc(b,a)}function E(a,b){this.observer=a,this.parent=b}function F(a,b){this.observer=a,this.parent=b}function G(a,b){return a.amb(b)}function H(a,b){return new Qd(function(c){var d=new Tb,e=new Ub;return e.setDisposable(d),d.setDisposable(a.subscribe(new Zc(c,e,b))),e},a)}function I(){return!1}function J(a,b){var c=this;return new Qd(function(e){var f=0,g=a.length;return c.subscribe(function(c){if(g>f){var h=a[f++],i=d(b)(c,h);if(i===Ra)return e.onError(i.e);e.onNext(i)}else e.onCompleted()},function(a){e.onError(a)},function(){e.onCompleted()})},c)}function I(){return!1}function K(){return[]}function I(){return!1}function L(){return[]}function M(a){return function(b){return a.subscribe(b)}}function N(a){return a.toArray()}function O(a){return a.length>0}function P(a,b,c){this.o=a,this.keyFn=b,this.comparer=c,this.hasCurrentKey=!1,this.currentKey=null,this.isStopped=!1}function Q(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function R(a,b,c){var d=hb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Pa(e)&&(e=Fc(e)),(fb(e)||eb(e))&&(e=Nc(e)),e}).concatAll()}function S(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function T(a){this.comparer=a,this.set=[]}function U(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}function V(a,b,c){return new Qd(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},function(a){d.onError(a)},function(){d.onNext(g),d.onCompleted()})},a)}function W(a){if(0===a.length)throw new Xa;return a[0]}function X(b,c,d,e){var f=hb(c,d,3);return new Qd(function(c){var d=0;return b.subscribe(function(a){var g;try{g=f(a,d,b)}catch(h){return void c.onError(h)}g?(c.onNext(e?d:a),c.onCompleted()):d++},function(a){c.onError(a)},function(){c.onNext(e?-1:a),c.onCompleted()})},b)}function Y(a){return a?uc.isObservable(a)?a:Pa(a)?uc.fromPromise(a):ba(a)||aa(a)?xd.call(this,a):Qa(a)?_.call(this,a):fb(a)||eb(a)?Z.call(this,a):ca(a)?$.call(this,a):a:a}function Z(a){return uc.from(a).map(Y,this).toArray()}function $(b){function c(b,c){d[c]=a,f.push(new Qd(function(a){return b.subscribe(function(b){d[c]=b,a.onCompleted()})}))}for(var d=new b.constructor,e=Object.keys(b),f=[],g=0,h=e.length;h>g;g++){var i=e[g],j=Y.call(this,b[i]);j&&uc.isObservable(j)?c(j,i):d[i]=b[i]}return uc.concat(f).startWith(d)}function _(a){var b=this;return new Qd(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function aa(a){return Qa(a.next)&&Qa(a["throw"])}function ba(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:aa(b.prototype):!1}function ca(a){return Object==a.constructor}function da(a,b,c,d){var e=new Ud;return d.push(ea(e,b,c)),a.apply(b,d),e.asObservable()}function ea(a,b,c){return function(){for(var e=arguments.length,f=new Array(e),g=0;e>g;g++)f[g]=arguments[g];if(Qa(c)){if(f=d(c).apply(b,f),f===Ra)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function fa(a,b,c,d){var e=new Ud;return d.push(ga(e,b,c)),a.apply(b,d),e.asObservable()}function ga(a,b,c){return function(){var e=arguments[0];if(e)return a.onError(e);for(var f=arguments.length,g=[],h=1;f>h;h++)g[h-1]=arguments[h];if(Qa(c)){var g=d(c).apply(b,g);if(g===Ra)return a.onError(g.e);a.onNext(g)}else g.length<=1?a.onNext(g[0]):a.onNext(g);a.onCompleted()}}function ha(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function ia(a,b,c){var d=new Mb,e=Object.prototype.toString;if("[object NodeList]"===e.call(a)||"[object HTMLCollection]"===e.call(a))for(var f=0,g=a.length;g>f;f++)d.add(ia(a.item(f),b,c));else a&&d.add(new ha(a,b,c));return d}function ja(a,b,c){return new Qd(function(e){function f(a,b){if(k[b]=a,h[b]=!0,i||(i=h.every(Ka))){if(g)return e.onError(g);var f=d(c).apply(null,k);if(f===Ra)return e.onError(f.e);e.onNext(f)}j&&k[1]&&e.onCompleted()}var g,h=[!1,!1],i=!1,j=!1,k=new Array(2);return new Mb(a.subscribe(function(a){f(a,0)},function(a){k[1]?e.onError(a):g=a},function(){j=!0,k[1]&&e.onCompleted()}),b.subscribe(function(a){f(a,1)},function(a){e.onError(a)},function(){j=!0,f(!0,1)}))},a)}function N(a){return a.toArray()}function ka(a,b){return a.groupJoin(this,b,Jc,function(a,b){return b})}function la(a){var b=this;return new Qd(function(c){var d=new Td,e=new Mb,f=new Vb(e);return c.onNext(Jb(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Pa(a)&&(a=Fc(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new Td,c.onNext(Jb(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ma(a){var b=this;return new Qd(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Pa(b)&&(b=Fc(b));var i=new Tb;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Ja,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Td,c.onNext(Jb(h,g)),d()}))}var e=new Ub,f=new Mb(e),g=new Vb(f),h=new Td;return c.onNext(Jb(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function na(a,b){return new Kd(a,b)}function oa(a){this.patterns=a}function pa(a,b){this.expression=a,this.selector=b}function qa(a,b,c){var d=a.get(b);if(!d){var e=new Od(b,c);return a.set(b,e),e}return d}function ra(a,b,c){this.joinObserverArray=a,this. Nd;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function sa(a,b){return new Qd(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function ta(a,b,c){return new Qd(function(d){var e=a,f=Yb(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function ua(a,b){return new Qd(function(c){return b.scheduleWithRelative(Yb(a),function(){c.onNext(0),c.onCompleted()})})}function va(a,b,c){return a===b?new Qd(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Hc(function(){return ta(c.now()+a,b,c)})}function wa(a,b,c){return new Qd(function(d){var e,f=!1,g=new Ub,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Tb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length&
10000
gt;0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Mb(e,g)},a)}function xa(a,b,c){return Hc(function(){return wa(a,b-c.now(),c)})}function N(a){return a.toArray()}function N(a){return a.toArray()}function ya(a,b){return new Qd(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new Tb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new Mb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}var za,Aa={"function":!0,object:!0},Ba=Aa[typeof exports]&&exports&&!exports.nodeType&&exports,Ca=Aa[typeof self]&&self.Object&&self,Da=Aa[typeof window]&&window&&window.Object&&window,Ea=Aa[typeof module]&&module&&!module.nodeType&&module,Fa=Ea&&Ea.exports===Ba&&Ba,Ga=Ba&&Ea&&"object"==typeof global&&global&&global.Object&&global,Ha=Ha=Ga||Da!==(this&&this.window)&&Da||Ca||this,Ia={internals:{},config:{Promise:Ha.Promise},helpers:{}},Ja=Ia.helpers.noop=function(){},Ka=Ia.helpers.identity=function(a){return a},La=Ia.helpers.defaultNow=Date.now,Ma=Ia.helpers.defaultComparer=function(a,b){return Fb(a,b)},Na=Ia.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Oa=(Ia.helpers.defaultKeySerializer=function(a){return a.toString()},Ia.helpers.defaultError=function(a){throw a}),Pa=Ia.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Qa=Ia.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==ub.call(a)}),a}(),Ra={e:{}};Ia.config.longStackSupport=!1;var Sa=!1,Ta=d(function(){throw new Error})();Sa=!!Ta.e&&!!Ta.e.stack;var Ua,Va=j(),Wa="From previous event:",Xa=Ia.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};Xa.prototype=Error.prototype;var Ya=Ia.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};Ya.prototype=Error.prototype;var Za=Ia.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};Za.prototype=Error.prototype;var $a=Ia.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};$a.prototype=Error.prototype;var _a=Ia.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};_a.prototype=Error.prototype;var ab=Ia.helpers.notImplemented=function(){throw new _a},bb=Ia.helpers.notSupported=function(){throw new $a},cb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Ha.Set&&"function"==typeof(new Ha.Set)["@@iterator"]&&(cb="@@iterator");var db=Ia.doneEnumerator={done:!0,value:a},eb=Ia.helpers.isIterable=function(b){return b[cb]!==a},fb=Ia.helpers.isArrayLike=function(b){return b&&b.length!==a};Ia.helpers.iterator=cb;var gb,hb=Ia.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},ib=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],jb=ib.length,kb="[object Arguments]",lb="[object Array]",mb="[object Boolean]",nb="[object Date]",ob="[object Error]",pb="[object Function]",qb="[object Number]",rb="[object Object]",sb="[object RegExp]",tb="[object String]",ub=Object.prototype.toString,vb=Object.prototype.hasOwnProperty,wb=ub.call(arguments)==kb,xb=Error.prototype,yb=Object.prototype,zb=String.prototype,Ab=yb.propertyIsEnumerable;try{gb=!(ub.call(document)==rb&&!({toString:0}+""))}catch(Bb){gb=!0}var Cb={};Cb[lb]=Cb[nb]=Cb[qb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Cb[mb]=Cb[tb]={constructor:!0,toString:!0,valueOf:!0},Cb[ob]=Cb[pb]=Cb[sb]={constructor:!0,toString:!0},Cb[rb]={constructor:!0};var Db={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Db.enumErrorProps=Ab.call(xb,"message")||Ab.call(xb,"name"),Db.enumPrototypes=Ab.call(a,"prototype"),Db.nonEnumArgs=0!=c,Db.nonEnumShadows=!/valueOf/.test(b)}(1);var ca=Ia.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Eb=function(a){return a&&"object"==typeof a?ub.call(a)==kb:!1};wb||(Eb=function(a){return a&&"object"==typeof a?vb.call(a,"callee"):!1});var Fb=Ia.internals.isEqual=function(a,b){return p(a,b,[],[])},Gb=({}.hasOwnProperty,Array.prototype.slice),Hb=this.inherits=Ia.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Ib=Ia.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Jb=Ia.internals.addRef=function(a,b){return new Qd(function(c){return new Mb(b.getDisposable(),a.subscribe(c))})};r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Kb=Ia.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Lb=Kb.prototype;Lb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Lb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Lb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Lb.peek=function(){return this.items[0].value},Lb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Lb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Lb.enqueue=function(a){var b=this.length++;this.items[b]=new r(Kb.count++,a),this.percolate(b)},Lb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Kb.count=0;var Mb=Ia.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!Rb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},Nb=Mb.prototype;Nb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Nb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Nb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var Ob=Ia.Disposable=function(a){this.isDisposed=!1,this.action=a||Ja};Ob.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Pb=Ob.create=function(a){return new Ob(a)},Qb=Ob.empty={dispose:Ja},Rb=Ob.isDisposable=function(a){return a&&Qa(a.dispose)},Sb=Ob.checkDisposed=function(a){if(a.isDisposed)throw new Ya},Tb=Ia.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};Tb.prototype.getDisposable=function(){return this.current},Tb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},Tb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Ub=Ia.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Ub.prototype.getDisposable=function(){return this.current},Ub.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Ub.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Vb=Ia.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Qb:new a(this)},b}();s.prototype.dispose=function(){this.scheduler.scheduleWithState(this,t)};var Wb=Ia.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Na,this.disposable=new Tb};Wb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Wb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Wb.prototype.isCancelled=function(){return this.disposable.isDisposed},Wb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Xb=Ia.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Qb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=La,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Yb=Xb.normalize,Zb=Xb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),Qb}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new Mb;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),Qb}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new Mb;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}(Xb.prototype),function(a){Xb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Xb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Ha.setInterval)throw new $a;b=Yb(b);var d=a,e=Ha.setInterval(function(){d=c(d)},b);return Pb(function(){Ha.clearInterval(e)})}}(Xb.prototype),function(a){a.catchError=a["catch"]=function(a){return new hc(this,a)}}(Xb.prototype);var $b,_b,ac=Ia.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Tb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),bc=Xb.immediate=function(){function a(a,b){return b(this,a)}return new Xb(La,a,bb,bb)}(),cc=Xb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,f){var g=new Wb(this,b,f,this.now());if(c)c.push(g);else{c=[g];var h=d(a)();if(c=null,h===Ra)return e(h.e)}return g.disposable}var c,f=new Xb(La,b,bb,bb);return f.scheduleRequired=function(){return!c},f}(),dc=function(){var a,b=Ja;if(Ha.setTimeout)a=Ha.setTimeout,b=Ha.clearTimeout;else{if(!Ha.WScript)throw new $a;a=function(a,b){Ha.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),ec=dc.setTimeout,fc=dc.clearTimeout;!function(){function a(b){if(h)ec(function(){a(b)},0);else{var c=g[b];if(c){h=!0;var f=d(c)();if(_b(b),h=!1,f===Ra)return e(f.e)}}}function b(){if(!Ha.postMessage||Ha.importScripts)return!1;var a=!1,b=Ha.onmessage;return Ha. c(b){"string"==typeof b.data&&b.data.substring(0,k.length)===k&&a(b.data.substring(k.length))}var f=1,g={},h=!1;_b=function(a){delete g[a]};var i=RegExp("^"+String(ub).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),j="function"==typeof(j=Ga&&Fa&&Ga.setImmediate)&&!i.test(j)&&j;if(Qa(j))$b=function(b){var c=f++;return g[c]=b,j(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))$b=function(b){var c=f++;return g[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var k="ms.rx.schedule"+Math.random();Ha.addEventListener?Ha.addEventListener("message",c,!1):Ha.attachEvent?Ha.attachEvent("onmessage",c):Ha. b=f++;return g[b]=a,Ha.postMessage(k+currentId,"*"),b}}else if(Ha.MessageChannel){var l=new Ha.MessageChannel;l.port1. b=f++;return g[b]=a,l.port2.postMessage(b),b}}else $b="document"in Ha&&"onreadystatechange"in Ha.document.createElement("script")?function(b){var c=Ha.document.createElement("script"),d=f++;return g[d]=b,c. c=f++;return g[c]=b,ec(function(){a(c)},0),c}}();var gc=Xb.timeout=Xb["default"]=function(){function a(a,b){var c=this,d=new Tb,e=$b(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new Mb(d,Pb(function(){_b(e)}))}function b(a,b,c){var d=this,e=Xb.normalize(b),f=new Tb;if(0===e)return d.scheduleWithState(a,c);var g=ec(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new Mb(f,Pb(function(){fc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Xb(La,a,b,c)}(),hc=function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Hb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Qb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Tb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Xb),ic=Ia.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return Zb(a)||(a=bc),new Qd(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),jc=ic.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new ic("N",d,null,a,b,c)}}(),kc=ic.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new ic("E",null,d,a,b,c)}}(),lc=ic.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new ic("C",null,null,a,b,c)}}(),mc=Ia.Observer=function(){};mc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},mc.prototype.asObserver=function(){var a=this;return new qc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},mc.prototype.checked=function(){return new rc(this)};var nc=mc.create=function(a,b,c){return a||(a=Ja),b||(b=Oa),c||(c=Ja),new qc(a,b,c)};mc.fromNotifier=function(a,b){var c=hb(a,b,1);return new qc(function(a){return c(jc(a))},function(a){return c(kc(a))},function(){return c(lc())})},mc.prototype.notifyOn=function(a){return new tc(a,this)},mc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var oc,pc=Ia.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return Hb(b,a),b.prototype.next=ab,b.prototype.error=ab,b.prototype.completed=ab,b.prototype. this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(mc),qc=Ia.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Hb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(pc),rc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Hb(b,a);var c=b.prototype;return c. b=d(this._observer.onNext).call(this._observer,a);this._state=0,b===Ra&&e(b.e)},c. b=d(this._observer.onError).call(this._observer,a);this._state=2,b===Ra&&e(b.e)},c. a=d(this._observer.onCompleted).call(this._observer);this._state=2,a===Ra&&e(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(mc),sc=Ia.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Ub}return Hb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var f=d(c)();return f===Ra?(a.queue=[],a.hasFaulted=!0,e(f.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(pc),tc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Hb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(sc),uc=Ia.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c. b(b){if(Ia.config.longStackSupport&&Sa){
var c=d(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return oc=b.prototype,b.isObservable=function(a){return a&&Qa(a.subscribe)},oc.subscribe=oc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:nc(a,b,c))},oc.subscribeOnNext=function(a,b){return this._subscribe(nc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},oc.subscribeOnError=function(a,b){return this._subscribe(nc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},oc.subscribeOnCompleted=function(a,b){return this._subscribe(nc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),vc=Ia.ObservableBase=function(a){function b(a){return a&&Qa(a.dispose)?a:Qa(a)?Pb(a):Qb}function c(a,c){var f=c[0],g=c[1],h=d(g.subscribeCore).call(g,f);return h!==Ra||f.fail(Ra.e)?void f.setDisposable(b(h)):e(Ra.e)}function f(a){var b=new Rd(a),d=[b,this];return cc.scheduleRequired()?cc.scheduleWithState(d,c):c(null,d),b}function g(){a.call(this,f)}return Hb(g,a),g.prototype.subscribeCore=ab,g}(uc),wc=function(a){function b(b,c,d,e){this.resultSelector=Ia.helpers.isFunction(d)?d:null,this.selector=Ia.internals.bindCallback(Ia.helpers.isFunction(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.isStopped=!1,this.o=a}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype. b=this.i++,c=d(this.selector)(a,b,this.source);if(c===Ra)return this.o.onError(c.e);Ia.helpers.isPromise(c)&&(c=Ia.Observable.fromPromise(c)),(Ia.helpers.isArrayLike(c)||Ia.helpers.isIterable(c))&&(c=Ia.Observable.from(c)),this.o.onNext(this._wrapResult(c,a,b))}},c.prototype. b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){var b,e=new Ub,f=bc.scheduleRecursiveWithState(this.sources[cb](),function(f,g){if(!b){var h=d(f.next).call(f);if(h===Ra)return a.onError(h.e);if(h.done)return a.onCompleted();var i=h.value;Pa(i)&&(i=Fc(i));var j=new Tb;e.setDisposable(j),j.setDisposable(i.subscribe(new c(a,g,f)))}});return new Mb(e,f,Pb(function(){b=!0}))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);xc.prototype.concat=function(){return new yc(this)};var zc=function(a){function b(b){this.sources=b,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[cb](),e=new Ub,f=bc.scheduleRecursiveWithState(null,function(f,g){if(!b){var h=d(c.next).call(c);if(h===Ra)return a.onError(h.e);if(h.done)return null!==f?a.onError(f):a.onCompleted();var i=h.value;Pa(i)&&(i=Fc(i));var j=new Tb;e.setDisposable(j),j.setDisposable(i.subscribe(function(b){a.onNext(b)},g,function(){a.onCompleted()}))}});return new Mb(e,f,Pb(function(){b=!0}))},b}(vc);xc.prototype.catchError=function(){return new zc(this)},xc.prototype.catchErrorWhen=function(a){var b=this;return new Qd(function(c){var e,f,g=new Td,h=new Td,i=a(g),j=i.subscribe(h),k=b[cb](),l=new Ub,m=bc.scheduleRecursive(function(a){if(!e){var b=d(k.next).call(k);if(b===Ra)return c.onError(b.e);if(b.done)return void(f?c.onError(f):c.onCompleted());var i=b.value;Pa(i)&&(i=Fc(i));var j=new Tb,m=new Tb;l.setDisposable(new Mb(m,j)),j.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(h.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),g.onNext(b)},function(){c.onCompleted()}))}});return new Mb(j,l,m,Pb(function(){e=!0}))})};var Ac=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return Hb(b,a),b.prototype[cb]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?db:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(xc),Bc=xc.repeat=function(a,b){return new Ac(a,b)},Cc=function(a){function b(a,b,c){this.s=a,this.fn=b?hb(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Hb(b,a),b.prototype[cb]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:db},b}(xc),Dc=xc.of=function(a,b,c){return new Cc(a,b,c)};oc.observeOn=function(a){var b=this;return new Qd(function(c){return b.subscribe(new tc(a,c))},b)},oc.subscribeOn=function(a){var b=this;return new Qd(function(c){var d=new Tb,e=new Ub;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new s(a,b.subscribe(c)))})),e},b)};var Ec=function(a){function b(b){this.p=b,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),Qb},b}(vc),Fc=uc.fromPromise=function(a){return new Ec(a)};oc.toPromise=function(a){if(a||(a=Ia.config.Promise),!a)throw new $a("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Gc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.toArray=function(){return new Gc(this)},uc.create=function(a,b){return new Qd(a,b)};var Hc=uc.defer=function(a){return new Qd(function(b){var c;try{c=a()}catch(d){return Yc(d).subscribe(b)}return Pa(c)&&(c=Fc(c)),c.subscribe(b)})},Ic=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(vc),Jc=uc.empty=function(a){return Zb(a)||(a=bc),new Ic(a)},Kc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new Lc(a,this);return b.run()},b}(vc),Lc=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var g=d(c.next).call(c);if(g===Ra)return e.onError(g.e);if(g.done)return e.onCompleted();var h=g.value;return Qa(f)&&(h=d(f)(h,a),h===Ra)?e.onError(h.e):(e.onNext(h),void b(a+1))}var b=Object(this.parent.iterable),c=z(b),e=this.o,f=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Mc=Math.pow(2,53)-1;u.prototype[cb]=function(){return new v(this._s)},v.prototype[cb]=function(){return this},v.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:db},w.prototype[cb]=function(){return new x(this._a)},x.prototype[cb]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:db};var Nc=uc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Qa(b))throw new Error("mapFn when provided must be a function");if(b)var e=hb(b,c,2);return Zb(d)||(d=cc),new Kc(a,e,d)},Oc=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new C(a,this);return b.run()},b}(vc);C.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Pc=uc.fromArray=function(a,b){return Zb(b)||(b=cc),new Oc(a,b)};uc.generate=function(a,b,c,d,e){return Zb(e)||(e=cc),new Qd(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},uc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Oc(b,cc)},uc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Oc(c,a)},uc.ofArrayChanges=function(a){if(!Array.isArray(a))throw new TypeError("Array.observe only accepts arrays.");if("function"!=typeof Array.observe&&"function"!=typeof Array.unobserve)throw new TypeError("Array.observe is not supported on your platform");return new Qd(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Array.observe(a,c),function(){Array.unobserve(a,c)}})},uc.ofObjectChanges=function(a){if(null==a)throw new TypeError("object must not be null or undefined.");if("function"!=typeof Object.observe&&"function"!=typeof Object.unobserve)throw new TypeError("Object.observe is not supported on your platform");return new Qd(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Object.observe(a,c),function(){Object.unobserve(a,c)}})};var Qc=function(a){function b(){a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){return Qb},b}(vc),Rc=uc.never=function(){return new Qc},Sc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(vc);E.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},uc.pairs=function(a,b){return b||(b=cc),new Sc(a,b)};var Tc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new Uc(a,this);return b.run()},b}(vc),Uc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();uc.range=function(a,b,c){return Zb(c)||(c=cc),new Tc(a,b,c)};var Vc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new F(a,this);return b.run()},b}(vc);F.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},uc.repeat=function(a,b,c){return Zb(c)||(c=cc),new Vc(a,b,c)};var Wc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(vc),Xc=(uc["return"]=uc.just=function(a,b){return Zb(b)||(b=bc),new Wc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(vc)),Yc=uc["throw"]=function(a,b){return Zb(b)||(b=bc),new Xc(a,b)};uc.using=function(a,b){return new Qd(function(c){var e=Qb,f=d(a)();if(f===Ra)return new Mb(Yc(f.e).subscribe(c),e);f&&(e=f);var g=d(b)(f);return g===Ra?new Mb(Yc(g.e).subscribe(c),e):new Mb(g.subscribe(c),e)})},oc.amb=function(a){var b=this;return new Qd(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Tb,j=new Tb;Pa(a)&&(a=Fc(a));var k=nc(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=nc(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new Mb(i,j)})},uc.amb=function(){var a,b=Rc();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=G(b,a[d]);return b};var Zc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return Hb(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=d(this._fn)(a);if(b===Ra)return this._o.onError(b.e);Pa(b)&&(b=Fc(b));var c=new Tb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(pc);oc["catch"]=function(a){return Qa(a)?H(this,a):$c([this,a])};var $c=uc["catch"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return Dc(a).catchError()};oc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),_c.apply(this,b)};var _c=uc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Qd(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Ka))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Ka)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Ka)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=q(f,g),i=!1,j=q(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new Tb;Pa(f)&&(f=Fc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new Mb(l)},this)};oc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),bd.apply(null,a)};var ad=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new Ub,c=this.sources,d=c.length,e=this.o,f=bc.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];Pa(h)&&(h=Fc(h));var i=new Tb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new Mb(b,f,Pb(function(){a=!0}))},b}(vc),bd=uc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new ad(a)};oc.concatAll=function(){return this.merge(1)};var cd=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new Mb;return b.add(this.source.subscribe(new dd(a,this.maxConcurrent,b))),b},b}(vc),dd=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new Tb;this.g.add(c),Pa(a)&&(a=Fc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype. a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();oc.merge=function(a){return"number"!=typeof a?ed(this,a):new cd(this,a)};var ed=uc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Zb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=bc,b=0;d>b;b++)c.push(arguments[b]);else for(a=bc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),D(a,c).mergeAll()},fd=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new Mb,d=new Tb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype. b=new Tb;this.g.add(b),Pa(a)&&(a=Fc(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype. a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(vc);oc.mergeAll=function(){return new fd(this)};var gd=Ia.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};gd.prototype=Error.prototype,uc.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=D(null,a);return new Qd(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new gd(g))}var c=new Mb,e=new Tb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new Tb;c.add(e),Pa(d)&&(d=Fc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},oc. new Error("Second observable is required");return hd([this,a])};var hd=uc. a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Qd(function(b){var c=0,d=new Ub,e=bc.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Pa(f)&&(f=Fc(f)),g=new Tb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Mb(d,e)})};oc.skipUntil=function(a){var b=this;return new Qd(function(c){var d=!1,e=new Mb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));Pa(a)&&(a=Fc(a));var f=new Tb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var id=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){var b=new Ub,d=this.source.subscribe(new c(a,b));return new Mb(d,b)},c.prototype. b=new Tb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),Pa(a)&&(a=Fc(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype. this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(vc);oc["switch"]=oc.switchLatest=function(){return new id(this)};var jd=function(a){function b(b,c){this.source=b,this.other=Pa(c)?Fc(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){return new Mb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.takeUntil=function(a){return new jd(this,a)},oc.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=b.pop(),f=this;return Array.isArray(b[0])&&(b=b[0]),new Qd(function(a){for(var c=b.length,g=q(c,I),h=!1,i=new Array(c),j=new Array(c+1),k=0;c>k;k++)!function(c){var d=b[c],e=new Tb;Pa(d)&&(d=Fc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Ka)},function(b){a.onError(b)},Ja)),j[c]=e}(k);var l=new Tb;return l.setDisposable(f.subscribe(function(b){var c=[b].concat(i);if(h){var f=d(e).apply(null,c);return f===Ra?a.onError(f.e):void a.onNext(f)}},function(b){a.onError(b)},function(){a.onCompleted()})),j[c]=l,new Mb(j)},this)},oc.zip=function(){if(Array.isArray(arguments[0]))return J.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var e=this,f=b.pop();return b.unshift(e),new Qd(function(a){for(var c=b.length,g=q(c,K),h=q(c,I),i=new Array(c),j=0;c>j;j++)!function(c){var j=b[c],k=new Tb;Pa(j)&&(j=Fc(j)),k.setDisposable(j.subscribe(function(b){if(g[c].push(b),g.every(function(a){return a.length>0})){var i=g.map(function(a){return a.shift()}),j=d(f).apply(e,i);if(j===Ra)return a.onError(j.e);a.onNext(j)}else h.filter(function(a,b){return b!==c}).every(Ka)&&a.onCompleted()},function(b){a.onError(b)},function(){h[c]=!0,h.every(Ka)&&a.onCompleted()})),i[c]=k}(j);return new Mb(i)},e)},uc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},uc.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Qd(function(b){for(var c=a.length,d=q(c,L),e=q(c,I),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new Tb,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(Ka))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(Ka)&&b.onCompleted()}))}(g);return new Mb(f)})},oc.asObservable=function(){return new Qd(M(this),this)},oc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(N).filter(O)},oc.dematerialize=function(){var a=this;return new Qd(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var kd=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new P(a,this.keyFn,this.comparer))},b}(vc);P.prototype. b=a;return Qa(this.keyFn)&&(b=d(this.keyFn)(a),b===Ra)?this.o.onError(b.e):this.hasCurrentKey&&(comparerEquals=d(this.comparer)(this.currentKey,b),comparerEquals===Ra)?this.o.onError(comparerEquals.e):void(this.hasCurrentKey&&comparerEquals||(this.hasCurrentKey=!0,this.currentKey=b,this.o.onNext(a)))}},P.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},oc.distinctUntilChanged=function(a,b){return b||(b=Ma),new kd(this,a,b)};var ld=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||Qa(b._oN)?nc(b._oN||Ja,b._oE||Ja,b._oC||Ja):b._oN,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype. b=d(this.t.onNext).call(this.t,a);b===Ra&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype. b=d(this.t.onError).call(this.t,a);if(b===Ra)return this.o.onError(b.e);this.o.onError(a)}},c.prototype. a=d(this.t.onCompleted).call(this.t);if(a===Ra)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc["do"]=oc.tap=oc.doAction=function(a,b,c){return new ld(this,a,b,c)},oc.doOnNext=oc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},oc.doOnError=oc.tapOnError=function(a,b){return this.tap(Ja,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},oc.doOnCompleted=oc.tapOnCompleted=function(a,b){return this.tap(Ja,null,"undefined"!=typeof b?function(){a.call(b)}:a)},oc["finally"]=oc.ensure=function(a){var b=this;return new Qd(function(c){var f=d(b.subscribe).call(b,c);return f===Ra?(a(),e(f.e)):Pb(function(){var b=d(f.dispose).call(f);a(),b===Ra&&e(b.e)})},this)};var md=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(vc);oc.ignoreElements=function(){return new md(this)},oc.materialize=function(){var a=this;return new Qd(function(b){return a.subscribe(function(a){b.onNext(jc(a))},function(a){b.onNext(kc(a)),b.onCompleted()},function(){b.onNext(lc()),b.onCompleted()})},a)},oc.repeat=function(a){return Bc(this,a).concat()},oc.retry=function(a){return Bc(this,a).catchError()},oc.retryWhen=function(a){return Bc(this).catchErrorWhen(a)};var nd=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Q(a,this))},b}(vc);Q.prototype={onNext:function(a){return this.isStopped?void 0:(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.accumulation=d(this.accumulator)(this.accumulation,a):(this.accumulation=this.hasSeed?d(this.accumulator)(this.seed,a):a,this.hasAccumulation=!0),this.accumulation===Ra?this.o.onError(this.accumulation.e):void this.o.onNext(this.accumulation))},onError:function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},onCompleted:function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)}},oc.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new nd(this,c,b,a)},oc.skipLast=function(a){if(0>a)throw new Za;var b=this;return new Qd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},oc.startWith=function(){var a,b=0;arguments.length&&Zb(arguments[0])?(a=arguments[0],b=1):a=bc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Dc([Pc(c,a),this]).concat()},oc.takeLast=function(a){if(0>a)throw new Za;var b=this;return new Qd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},oc.takeLastBuffer=function(a){var b=this;return new Qd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},oc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new Za;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new Za;return new Qd(function(d){function e(){var a=new Td;i.push(a),d.onNext(Jb(a,g))}var f=new Tb,g=new Vb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},oc.selectConcat=oc.concatMap=function(a,b,c){return Qa(a)&&Qa(b)?this.concatMap(function(c,d){var e=a(c,d);return Pa(e)&&(e=Fc(e)),(fb(e)||eb(e))&&(e=Nc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Qa(a)?R(this,a,c):R(this,function(){return a})},oc.concatMapObserver=oc.selectConcatObserver=function(a,b,c,d){var e=this,f=hb(a,d,2),g=hb(b,d,1),h=hb(c,d,0);return new Qd(function(a){var b=0;
return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Pa(d)&&(d=Fc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Pa(c)&&(c=Fc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Pa(b)&&(b=Fc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},oc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Qd(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},T.prototype.push=function(a){var b=-1===S(this.set,a,this.comparer);return b&&this.set.push(a),b},oc.distinct=function(a,b){var c=this;return b||(b=Ma),new Qd(function(d){var e=new T(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},oc.groupBy=function(a,b){return this.groupByUntil(a,b,Rc)},oc.groupByUntil=function(b,c,e){var f=this;return new Qd(function(g){var h=new Nd,i=new Mb,j=new Vb(i),k=function(a){return function(b){b.onError(a)}};return i.add(f.subscribe(function(f){var l=d(b)(f);if(l===Ra)return h.forEach(k(l.e)),g.onError(l.e);var m=!1,n=h.get(l);if(n===a&&(n=new Td,h.set(l,n),m=!0),m){var o=new Sd(l,n,j),p=new Sd(l,n),q=d(e)(p);if(q===Ra)return h.forEach(k(q.e)),g.onError(q.e);g.onNext(o);var r=new Tb;i.add(r),r.setDisposable(q.take(1).subscribe(Ja,function(a){h.forEach(k(a)),g.onError(a)},function(){h["delete"](l)&&n.onCompleted(),i.remove(r)}))}var s=f;return Qa(c)&&(s=d(c)(f),s===Ra)?(h.forEach(k(s.e)),g.onError(s.e)):void n.onNext(s)},function(a){h.forEach(k(a)),g.onError(a)},function(){h.forEach(function(a){a.onCompleted()}),g.onCompleted()})),j},f)};var od=function(a){function b(b,c,d){this.source=b,this.selector=hb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function e(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return Hb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new e(a,this.selector,this))},e.prototype. b=d(this.selector)(a,this.i++,this.source);return b===Ra?this.o.onError(b.e):void this.o.onNext(b)}},e.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.map=oc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof od?this.internalMap(c,b):new od(this,c,b)},oc.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error("List of properties cannot be empty.");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(U(b,a))},oc.flatMap=oc.selectMany=function(a,b,c){return new wc(this,a,b,c).mergeAll()},oc.flatMapObserver=oc.selectManyObserver=function(a,b,c,d){var e=this;return new Qd(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Pa(c)&&(c=Fc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Pa(c)&&(c=Fc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Pa(a)&&(a=Fc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Ia.Observable.prototype.flatMapLatest=function(a,b,c){return new wc(this,a,b,c).switchLatest()};var pd=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.skip=function(a){if(0>a)throw new Za;return new pd(this,a)},oc.skipWhile=function(a,b){var c=this,d=hb(a,b,3);return new Qd(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},oc.take=function(a,b){if(0>a)throw new Za;if(0===a)return Jc(b);var c=this;return new Qd(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},oc.takeWhile=function(a,b){var c=this,d=hb(a,b,3);return new Qd(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var qd=function(a){function b(b,c,d){this.source=b,this.predicate=hb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function e(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new e(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},e.prototype. b=d(this.predicate)(a,this.i++,this.source);return b===Ra?this.o.onError(b.e):void(b&&this.o.onNext(a))}},e.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.filter=oc.where=function(a,b){return this instanceof qd?this.internalFilter(a,b):new qd(this,a,b)};var rd=function(a){function b(b,c,d,e){this.source=b,this.acc=c,this.hasSeed=d,this.seed=e,a.call(this)}function c(a,b){this.o=a,this.acc=b.acc,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.result=null,this.hasValue=!1,this.isStopped=!1}return Hb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype. Xa),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.reduce=function(a){var b=!1;if(2===arguments.length){b=!0;var c=arguments[1]}return new rd(this,a,b,c)};var sd=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Hb(b,a),b.prototype.next=function(a){var b=d(this._fn)(a,this._i++,this._s);return b===Ra?this._o.onError(b.e):void(Boolean(b)&&(this._o.onNext(!0),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(pc);oc.some=function(a,b){var c=this,d=hb(a,b,3);return new Qd(function(a){return c.subscribe(new sd(a,d,c))})};var td=function(a){function b(b){this._o=b,a.call(this)}return Hb(b,a),b.prototype.next=function(){this._o.onNext(!1),this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(pc);oc.isEmpty=function(){var a=this;return new Qd(function(b){return a.subscribe(new td(b))},a)};var ud=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Hb(b,a),b.prototype.next=function(a){var b=d(this._fn)(a,this._i++,this._s);return b===Ra?this._o.onError(b.e):void(Boolean(b)||(this._o.onNext(!1),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(pc);oc.every=function(a,b){var c=this,d=hb(a,b,3);return new Qd(function(a){return c.subscribe(new ud(a,d,c))},this)},oc.includes=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)
D830
&&isNaN(b)}var d=this;return new Qd(function(e){var f=0,g=+b||0;return Math.abs(g)===1/0&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),Qb):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},function(a){e.onError(a)},function(){e.onNext(!1),e.onCompleted()})},this)},oc.contains=function(a,b){oc.includes(a,b)},oc.count=function(a,b){return a?this.filter(a,b).count():this.reduce(function(a){return a+1},0)},oc.indexOf=function(a,b){var c=this;return new Qd(function(d){var e=0,f=+b||0;return Math.abs(f)===1/0&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),Qb):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},function(a){d.onError(a)},function(){d.onNext(-1),d.onCompleted()})},c)},oc.sum=function(a,b){return a&&Qa(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},oc.minBy=function(a,b){return b||(b=Na),V(this,a,function(a,c){return-1*b(a,c)})},oc.min=function(a){return this.minBy(Ka,a).map(function(a){return W(a)})},oc.maxBy=function(a,b){return b||(b=Na),V(this,a,b)},oc.max=function(a){return this.maxBy(Ka,a).map(function(a){return W(a)})};var vd=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._c=0,this._t=0,a.call(this)}return Hb(b,a),b.prototype.next=function(a){if(this._fn){var b=d(this._fn)(a,this._c++,this._s);if(b===Ra)return this._o.onError(b.e);this._t+=b}else this._c++,this._t+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){return 0===this._c?this._o.onError(new Xa):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(pc);oc.average=function(a,b){var c,d=this;return Qa(a)&&(c=hb(a,b,3)),new Qd(function(a){return d.subscribe(new vd(a,c,d))},d)},oc.sequenceEqual=function(a,b){var c=this;return b||(b=Ma),new Qd(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(fb(a)||eb(a))&&(a=Nc(a)),Pa(a)&&(a=Fc(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new Mb(i,j)},c)},oc.elementAt=function(b,c){if(0>b)throw new Za;var d=this;return new Qd(function(e){var f=b;return d.subscribe(function(a){0===f--&&(e.onNext(a),e.onCompleted())},function(a){e.onError(a)},function(){c===a?e.onError(new Za):(e.onNext(c),e.onCompleted())})},d)},oc.single=function(a,b){if(Qa(a))return this.filter(a,b).single();var c=this;return new Qd(function(a){var b,d=!1;return c.subscribe(function(c){d?a.onError(new Error("Sequence contains more than one element")):(b=c,d=!0)},function(b){a.onError(b)},function(){a.onNext(b),a.onCompleted()})},c)};var wd=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,b.call(this)}return Hb(c,b),c.prototype.next=function(a){if(this._obj.predicate){var b=d(this._obj.predicate)(a,this._i++,this._s);if(b===Ra)return this._o.onError(b.e);Boolean(b)&&(this._o.onNext(a),this._o.onCompleted())}else this._obj.predicate||(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._obj.defaultValue===a?this._o.onError(new Xa):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(pc);oc.first=function(){var a={},b=this;if(a="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Qa(a.predicate)){var c=a.predicate;a.predicate=hb(c,a.thisArg,3)}return new Qd(function(c){return b.subscribe(new wd(c,a,b))},b)},oc.last=function(){var b={},c=this;if(b="object"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Qa(b.predicate)){var e=b.predicate;b.predicate=hb(e,b.thisArg,3)}return new Qd(function(e){var f,g=!1,h=0;return c.subscribe(function(a){if(b.predicate){var i=d(b.predicate)(a,h++,c);if(i===Ra)return e.onError(i.e);i&&(g=!0,f=a)}else b.predicate||(g=!0,f=a)},function(a){e.onError(a)},function(){g?(e.onNext(f),e.onCompleted()):b.defaultValue===a?e.onError(new Xa):(e.onNext(b.defaultValue),e.onCompleted())})},c)},oc.find=function(a,b){return X(this,a,b,!1)},oc.findIndex=function(a,b){return X(this,a,b,!0)},oc.toSet=function(){if("undefined"==typeof Ha.Set)throw new TypeError;var a=this;return new Qd(function(b){var c=new Ha.Set;return a.subscribe(function(a){c.add(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},oc.toMap=function(a,b){if("undefined"==typeof Ha.Map)throw new TypeError;var c=this;return new Qd(function(d){var e=new Ha.Map;return c.subscribe(function(c){var f;try{f=a(c)}catch(g){return void d.onError(g)}var h=c;if(b)try{h=b(c)}catch(g){return void d.onError(g)}e.set(f,h)},function(a){d.onError(a)},function(){d.onNext(e),d.onCompleted()})},c)};var xd=uc.spawn=function(){for(var a=arguments[0],b=this,c=[],e=1,f=arguments.length;f>e;e++)c.push(arguments[e]);return new Qd(function(e){function f(b){var c=d(a.next).call(a,b);return c===Ra?e.onError(c.e):void h(c)}function g(b){var c=d(a.next).call(a,b);return c===Ra?e.onError(c.e):void h(c)}function h(a){a.done&&(e.onNext(a.value),e.onCompleted());var c=Y.call(b,a.value);uc.isObservable(c)?i.add(c.subscribe(f,g)):g(new TypeError("type not supported"))}var i=new Mb;return Qa(a)&&(a=a.apply(b,c)),a&&Qa(a.next)?(f(),i):(e.onNext(a),e.onCompleted())})};uc.start=function(a,b,c){return yd(a,b,c)()};var yd=uc.toAsync=function(a,b,c){return Zb(c)||(c=gc),function(){var d=arguments,e=new Ud;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};uc.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return da(a,b,c,e)}},uc.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return fa(a,b,c,e)}},ha.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},Ia.config.useNativeEvents=!1,uc.fromEvent=function(a,b,c){function e(a){return function(){var b=arguments[0];return Qa(c)&&(b=d(c).apply(null,arguments),b===Ra)?a.onError(b.e):void a.onNext(b)}}return a.addListener?zd(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Ia.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Qd(function(c){return ia(a,b,e(c))}).publish().refCount():zd(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var zd=uc.fromEventPattern=function(a,b,c){return new Qd(function(e){function f(){var a=arguments[0];return Qa(c)&&(a=d(c).apply(null,arguments),a===Ra)?e.onError(a.e):void e.onNext(a)}var g=a(f);return Pb(function(){Qa(b)&&b(f,g)})}).publish().refCount()};uc.startAsync=function(a){var b;try{b=a()}catch(c){return Yc(c)}return Fc(b)};var Ad=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Qb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Qb)});return new Mb(c,d,e)}function c(c,d){this.source=c,this.controller=new Td,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return Hb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(uc);oc.pausable=function(a){return new Ad(this,a)};var Bd=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=ja(this.source,this.pauser.startWith(!1).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!=d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f}function d(a,d){this.source=a,this.controller=new Td,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return Hb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(uc);oc.pausableBuffered=function(a){return new Bd(this,a)};var Cd=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new Dd(d,e),this.source=c.multicast(this.subject).refCount()}return Hb(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(uc),Dd=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new Td,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||cc}return Hb(c,a),Ib(c.prototype,mc,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(ic.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(ic.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(ic.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||"N"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,Pb(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),c}(uc);oc.controlled=function(a,b){return a&&Zb(a)&&(b=a,a=!0),null==a&&(a=!0),new Cd(this,a,b)};var Ed=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return gc.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}Hb(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}Hb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;gc.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(pc);return c}(uc);Cd.prototype.stopAndWait=function(){return new Ed(this)};var Fd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return gc.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}Hb(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}Hb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;gc.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(pc);return c}(uc);Cd.prototype.windowed=function(a){return new Fd(this,a)},oc.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},oc.multicast=function(a,b){var c=this;return"function"==typeof a?new Qd(function(d){var e=c.multicast(a());return new Mb(b(e).subscribe(d),e.connect())},c):new Jd(c,a)},oc.publish=function(a){return a&&Qa(a)?this.multicast(function(){return new Td},a):this.multicast(new Td)},oc.share=function(){return this.publish().refCount()},oc.publishLast=function(a){return a&&Qa(a)?this.multicast(function(){return new Ud},a):this.multicast(new Ud)},oc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Hd(b)},a):this.multicast(new Hd(a))},oc.shareValue=function(a){return this.publishValue(a).refCount()},oc.replay=function(a,b,c,d){return a&&Qa(a)?this.multicast(function(){return new Id(b,c,d)},a):this.multicast(new Id(b,c,d))},oc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Gd=function(a,b){this.subject=a,this.observer=b};Gd.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Hd=Ia.BehaviorSubject=function(a){function c(a){return Sb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Qb):(this.observers.push(a),a.onNext(this.value),new Gd(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Hb(d,a),Ib(d.prototype,mc,{getValue:function(){if(Sb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Sb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Sb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(uc),Id=Ia.ReplaySubject=function(a){function c(a,b){return Pb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new sc(this.scheduler,a),d=c(this,b);Sb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||cc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return Hb(e,a),Ib(e.prototype,mc.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(Sb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(Sb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(Sb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(uc),Jd=Ia.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Mb(f.subscribe(c),Pb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return Hb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Qd(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(uc);oc.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new Qd(function(b){return a().subscribe(b)})},oc.join=function(a,b,c,e){var f=this;return new Qd(function(g){var h=new Mb,i=!1,j=!1,k=0,l=0,m=new Nd,n=new Nd,o=function(a){g.onError(a)};return h.add(f.subscribe(function(a){var c=k++,f=new Tb;m.set(c,a),h.add(f);var j=d(b)(a);return j===Ra?g.onError(j.e):(f.setDisposable(j.take(1).subscribe(Ja,o,function(){m["delete"](c)&&0===m.size&&i&&g.onCompleted(),h.remove(f)})),void n.forEach(function(b){var c=d(e)(a,b);return c===Ra?g.onError(c.e):void g.onNext(c)}))},o,function(){i=!0,(j||0===m.size)&&g.onCompleted()})),h.add(a.subscribe(function(a){var b=l++,f=new Tb;n.set(b,a),h.add(f);var i=d(c)(a);return i===Ra?g.onError(i.e):(f.setDisposable(i.take(1).subscribe(Ja,o,function(){n["delete"](b)&&0===n.size&&j&&g.onCompleted(),h.remove(f)})),void m.forEach(function(b){var c=d(e)(b,a);return c===Ra?g.onError(c.e):void g.onNext(c)}))},o,function(){j=!0,(i||0===n.size)&&g.onCompleted()})),h},f)},oc.groupJoin=function(a,b,c,e){var f=this;return new Qd(function(g){function h(a){}var i=new Mb,j=new Vb(i),k=new Nd,l=new Nd,m=0,n=0,h=function(a){return function(b){b.onError(a)}};return i.add(f.subscribe(function(a){var c=new Td,f=m++;k.set(f,c);var n=d(e)(a,Jb(c,j));if(n===Ra)return k.forEach(h(n.e)),g.onError(n.e);g.onNext(n),l.forEach(function(a){c.onNext(a)});var o=new Tb;i.add(o);var p=d(b)(a);return p===Ra?(k.forEach(h(p.e)),g.onError(p.e)):void o.setDisposable(p.take(1).subscribe(Ja,function(a){k.forEach(h(a)),g.onError(a)},function(){k["delete"](f)&&c.onCompleted(),i.remove(o)}))},function(a){k.forEach(h(a)),g.onError(a)},function(){g.onCompleted()})),i.add(a.subscribe(function(a){var b=n++;l.set(b,a);var e=new Tb;i.add(e);var f=d(c)(a);return f===Ra?(k.forEach(h(f.e)),g.onError(f.e)):(e.setDisposable(f.take(1).subscribe(Ja,function(a){k.forEach(h(a)),g.onError(a)},function(){l["delete"](b),i.remove(e)})),void k.forEach(function(b){b.onNext(a)}))},function(a){k.forEach(h(a)),g.onError(a)})),j},f)},oc.buffer=function(){return this.window.apply(this,arguments).flatMap(N)},oc.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?la.call(this,a):"function"==typeof a?ma.call(this,a):ka.call(this,a,b)},oc.pairwise=function(){var a=this;return new Qd(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},oc.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]};var Kd=function(a){function b(a,b){this.c=a,this.s=b}return Hb(b,a),b.prototype[cb]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(xc);oc.letBind=oc.let=function(a){return a(this)},uc["if"]=function(a,b,c){return Hc(function(){return c||(c=Jc()),Pa(b)&&(b=Fc(b)),Pa(c)&&(c=Fc(c)),"function"==typeof c.now&&(c=Jc(c)),a()?b:c})},uc["for"]=uc.forIn=function(a,b,c){return Dc(a,b,c).concat()};var Ld=uc["while"]=uc.whileDo=function(a,b){return Pa(b)&&(b=Fc(b)),na(a,b).concat()};oc.doWhile=function(a){return bd([this,Ld(a,this)])},uc["case"]=function(a,b,c){return Hc(function(){Pa(c)&&(c=Fc(c)),c||(c=Jc()),Zb(c)&&(c=Jc(c));var d=b[a()];return Pa(d)&&(d=Fc(d)),d||c})},oc.expand=function(a,b){Zb(b)||(b=bc);var c=this;return new Qd(function(d){var e=[],f=new Ub,g=new Mb(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new Tb;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},uc.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Qd(function(b){var c=a.length;if(0===c)return b.onCompleted(),Qb;for(var d=new Mb,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];Pa(j)&&(j=Fc(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},oc.forkJoin=function(a,b){var c=this;return new Qd(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new Tb,l=new Tb;return Pa(a)&&(a=Fc(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new Mb(k,l)},c)},oc.manySelect=oc.extend=function(a,b){Zb(b)||(b=bc);var c=this;return Hc(function(){var d;return c.map(function(a){var b=new Md(a);return d&&d.onNext(a),d=b,b}).tap(Ja,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var Md=function(a){function b(a){var b=this,c=new Mb;return c.add(cc.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new Ud}return Hb(c,a),Ib(c.prototype,mc,{onCompleted:function(){this.onNext(uc.empty())},onError:function(a){this.onNext(uc["throw"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(uc),Nd=Ha.Map||function(){function b(){this.size=0,this._values=[],this._keys=[]}return b.prototype["delete"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},b.prototype.get=function(b){var c=this._keys.indexOf(b);return-1===c?a:this._values[c]},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},b.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},b}();
oa.prototype.and=function(a){return new oa(this.patterns.concat(a))},oa.prototype.thenDo=function(a){return new pa(this,a)},pa.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,g=this.expression.patterns.length;g>f;f++)e.push(qa(a,this.expression.patterns[f],b.onError.bind(b)));var h=new ra(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(h);c(h)});for(f=0,g=e.length;g>f;f++)e[f].addActivePlan(h);return h},ra.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},ra.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var Od=function(a){function b(b,c){a.call(this),this.source=b,this. Tb,this.isDisposed=!1}Hb(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Ja,c.completed=Ja,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(pc);oc.and=function(a){return new oa([this,a])},oc.thenDo=function(a){return new oa([this]).thenDo(a)},uc.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Qd(function(b){var c=[],d=new Nd,e=nc(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){Yc(h).subscribe(b)}var i=new Mb;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};var Pd=uc.interval=function(a,b){return va(a,a,Zb(b)?b:gc)};uc.timer=function(b,c,d){var e;return Zb(d)||(d=gc),null!=c&&"number"==typeof c?e=c:Zb(c)&&(d=c),b instanceof Date&&e===a?sa(b.getTime(),d):b instanceof Date&&e!==a?ta(b.getTime(),c,d):e===a?ua(b,d):va(b,e,d)};oc.delay=function(a,b){return Zb(b)||(b=gc),a instanceof Date?xa(this,a.getTime(),b):wa(this,a,b)},oc.debounce=function(a,b){Zb(b)||(b=gc);var c=this;return new Qd(function(d){var e,f=new Ub,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Tb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Mb(i,f)},this)},oc.throttle=function(a,b){return this.debounce(a,b)},oc.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),Zb(c)||(c=gc),"number"==typeof b?d=b:Zb(b)&&(d=a,c=b),new Qd(function(b){function f(){var a=new Tb,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleWithRelative(o,function(){if(g){var a=new Td;k.push(a),b.onNext(Jb(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new Ub,m=0;return g=new Mb(l),h=new Vb(g),k.push(new Td),b.onNext(Jb(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},oc.windowWithTimeOrCount=function(a,b,c){var d=this;return Zb(c)||(c=gc),new Qd(function(e){function f(b){var d=new Tb;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new Td,e.onNext(Jb(l,i)),f(a)}}))}var g=new Ub,h=new Mb(g),i=new Vb(h),j=0,k=0,l=new Td;return e.onNext(Jb(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new Td,e.onNext(Jb(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},oc.bufferWithTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(N)},oc.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(N)},oc.timeInterval=function(a){var b=this;return Zb(a)||(a=gc),Hc(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},oc.timestamp=function(a){return Zb(a)||(a=gc),this.map(function(b){return{value:b,timestamp:a.now()}})},oc.sample=oc.throttleLatest=function(a,b){return Zb(b)||(b=gc),"number"==typeof a?ya(this,Pd(a,b)):ya(this,a)},oc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Yc(new Error(b||"Timeout"))),Zb(c)||(c=gc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Qd(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Pa(b)&&(b=Fc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Tb,j=new Ub,k=!1,l=new Ub;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Mb(j,l)},d)},uc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return Zb(f)||(f=gc),new Qd(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithAbsoluteAndState(a,f.now(),function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},uc.generateWithRelativeTime=function(a,b,c,d,e,f){return Zb(f)||(f=gc),new Qd(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithRelativeAndState(a,0,function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},oc.delaySubscription=function(a,b){var c=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative",d=this;return Zb(b)||(b=gc),new Qd(function(e){var f=new Ub;return f.setDisposable(b[c](a,function(){f.setDisposable(d.subscribe(e))})),f},this)},oc.delayWithSelector=function(a,b){var c,e,f=this;return Qa(a)?e=a:(c=a,e=b),new Qd(function(a){function b(){j.setDisposable(f.subscribe(function(b){var c=d(e)(b);if(c===Ra)return a.onError(c.e);var f=new Tb;h.add(f),f.setDisposable(c.subscribe(function(){a.onNext(b),h.remove(f),g()},function(b){a.onError(b)},function(){a.onNext(b),h.remove(f),g()}))},function(b){a.onError(b)},function(){i=!0,j.dispose(),g()}))}function g(){i&&0===h.length&&a.onCompleted()}var h=new Mb,i=!1,j=new Ub;return c?j.setDisposable(c.subscribe(b,function(b){a.onError(b)},b)):b(),new Mb(j,h)},this)},oc.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=Rc()),c||(c=Yc(new Error("Timeout")));var d=this;return new Qd(function(e){function f(a){function b(){return k===d}var d=k,f=new Tb;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(c.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(c.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new Ub,i=new Ub,j=new Tb;h.setDisposable(j);var k=0,l=!1;return f(a),j.setDisposable(d.subscribe(function(a){if(g()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}f(Pa(c)?Fc(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new Mb(h,i)},d)},oc.debounceWithSelector=function(a){var b=this;return new Qd(function(c){var e,f=!1,g=new Ub,h=0,i=b.subscribe(function(b){var i=d(a)(b);if(i===Ra)return c.onError(i.e);Pa(i)&&(i=Fc(i)),f=!0,e=b,h++;var j=h,k=new Tb;g.setDisposable(k),k.setDisposable(i.subscribe(function(){f&&h===j&&c.onNext(e),f=!1,k.dispose()},function(a){c.onError(a)},function(){f&&h===j&&c.onNext(e),f=!1,k.dispose()}))},function(a){g.dispose(),c.onError(a),f=!1,h++},function(){g.dispose(),f&&c.onNext(e),c.onCompleted(),f=!1,h++});return new Mb(i,g)},b)},oc.skipLastWithTime=function(a,b){Zb(b)||(b=gc);var c=this;return new Qd(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},oc.takeLastWithTime=function(a,b){var c=this;return Zb(b)||(b=gc),new Qd(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},oc.takeLastBufferWithTime=function(a,b){var c=this;return Zb(b)||(b=gc),new Qd(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)},oc.takeWithTime=function(a,b){var c=this;return Zb(b)||(b=gc),new Qd(function(d){return new Mb(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},oc.skipWithTime=function(a,b){var c=this;return Zb(b)||(b=gc),new Qd(function(d){var e=!1;return new Mb(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},oc.skipUntilWithTime=function(a,b){Zb(b)||(b=gc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Qd(function(e){var f=!1;return new Mb(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},oc.takeUntilWithTime=function(a,b){Zb(b)||(b=gc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Qd(function(e){return new Mb(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},oc.throttleFirst=function(a,b){Zb(b)||(b=gc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Qd(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)},oc.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Qd(function(e){var f=a(b(e));return c.subscribe(function(a){var b=d(f["@@transducer/step"]).call(f,e,a);b===Ra&&e.onError(b.e)},function(a){e.onError(a)},function(){f["@@transducer/result"](e)})},c)},oc.switchFirst=function(){var a=this;return new Qd(function(b){var c=!1,d=!1,e=new Tb,f=new Mb;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,Pa(a)&&(a=Fc(a));var e=new Tb;f.add(e),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},function(a){b.onError(a)},function(){d=!0,!c&&1===f.length&&b.onCompleted()})),f},this)},oc.flatMapFirst=oc.selectManyFirst=function(a,b,c){return new wc(this,a,b,c).switchFirst()},Ia.Observable.prototype.flatMapWithMaxConcurrent=function(a,b,c,d){return new wc(this,b,c,d).merge(a)};Ia.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function f(a,b){return b(),Qb}function g(f,g){this.clock=f,this.comparer=g,this.isEnabled=!1,this.queue=new Kb(1024),a.call(this,b,c,d,e)}Hb(g,a);var h=g.prototype;return h.add=ab,h.toDateTimeOffset=ab,h.toRelative=ab,h.schedulePeriodicWithState=function(a,b,c){var d=new ac(this,a,b,c);return d.start()},h.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},h.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,f)},h.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},h.stop=function(){this.isEnabled=!1},h.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new Za;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},h.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new Za;0!==c&&this.advanceTo(b)},h.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new Za;this.clock=b},h.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},h.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,f)},h.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new Wb(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},g}(Xb);Ia.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Na;a.call(this,d,e)}Hb(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toDateTimeOffset=function(a){return new Date(a).getTime()},c.toRelative=function(a){return a},b}(Ia.VirtualTimeScheduler);var Qd=Ia.AnonymousObservable=function(a){function b(a){return a&&Qa(a.dispose)?a:Qa(a)?Pb(a):Qb}function c(a,c){var f=c[0],g=c[1],h=d(g.__subscribe).call(g,f);return h!==Ra||f.fail(Ra.e)?void f.setDisposable(b(h)):e(Ra.e)}function f(a){var b=new Rd(a),d=[b,this];return cc.scheduleRequired()?cc.scheduleWithState(d,c):c(null,d),b}function g(b,c){this.source=c,this.__subscribe=b,a.call(this,f)}return Hb(g,a),g}(uc),Rd=function(a){function b(b){a.call(this),this.observer=b,this.m=new Tb}Hb(b,a);var c=b.prototype;return c.next=function(a){var b=d(this.observer.onNext).call(this.observer,a);b===Ra&&(this.dispose(),e(b.e))},c.error=function(a){var b=d(this.observer.onError).call(this.observer,a);this.dispose(),b===Ra&&e(b.e)},c.completed=function(){var a=d(this.observer.onCompleted).call(this.observer);this.dispose(),a===Ra&&e(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(pc),Sd=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Qd(function(a){return new Mb(e.getDisposable(),d.subscribe(a))}):d}return Hb(c,a),c}(uc),Td=Ia.Subject=function(a){function c(a){return Sb(this),this.isStopped?this.hasError?(a.onError(this.error),Qb):(a.onCompleted(),Qb):(this.observers.push(a),new Gd(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Hb(d,a),Ib(d.prototype,mc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Sb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Sb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Vd(a,b)},d}(uc),Ud=Ia.AsyncSubject=function(a){function c(a){return Sb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Qb):(this.observers.push(a),new Gd(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Hb(d,a),Ib(d.prototype,mc,{hasObservers:function(){return Sb(this),this.observers.length>0},onCompleted:function(){var a,c;if(Sb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){Sb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(uc),Vd=Ia.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Hb(c,a),Ib(c.prototype,mc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(uc);Ia.Pauser=function(a){function b(){a.call(this)}return Hb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Td),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ha.Rx=Ia,define(function(){return Ia})):Ba&&Ea?Fa?(Ea.exports=Ia).Rx=Ia:Ba.Rx=Ia:Ha.Rx=Ia;var Wd=j()}).call(this);
//# sourceMappingURL=rx.all.map