UNPKG

webappengine

Version:

A web application platform that can host multiple web apps running with Node.js.

3 lines 114 kB
/* 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.onNext=b,this.onCompleted=c,this.joinObservers=new 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>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.onmessage=function(){a=!0},Ha.postMessage("","*"),Ha.onmessage=b,a}function 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.onmessage=c,$b=function(a){var b=f++;return g[b]=a,Ha.postMessage(k+currentId,"*"),b}}else if(Ha.MessageChannel){var l=new Ha.MessageChannel;l.port1.onmessage=function(b){a(b.data)},$b=function(a){var 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.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},Ha.document.documentElement.appendChild(c),d}:function(b){var 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.onNext=function(a){!this.isStopped&&this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return 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.onNext=function(a){this.checkAccess();var b=d(this._observer.onNext).call(this._observer,a);this._state=0,b===Ra&&e(b.e)},c.onError=function(a){this.checkAccess();var b=d(this._observer.onError).call(this._observer,a);this._state=2,b===Ra&&e(b.e)},c.onCompleted=function(){this.checkAccess();var 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.onError=function(b){f(b,a),d.call(c,b)},b.call(a,c)}}function 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.onNext=function(a){if(!this.isStopped){var 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.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},b}(vc),xc=Ia.internals.Enumerable=function(){},yc=function(a){function 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.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},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);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.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),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.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.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var 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