Repository navigation
Expand file tree
/
Copy pathrx.compat.min.js
More file actions
4 lines (4 loc) · 58.3 KB
/
Copy pathrx.compat.min.js
File metadata and controls
4 lines (4 loc) · 58.3 KB
1
2
3
4
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){if(a.isDisposed)throw new Error(gb)}function c(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function d(a,b){if(hb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(lb)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var f=c.join("\n"+lb+"\n");a.stack=e(f)}}function e(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var h=b[d];f(h)||g(h)||!h||c.push(h)}return c.join("\n")}function f(a){var b=i(a);if(!b)return!1;var c=b[0],d=b[1];return c===jb&&d>=kb&&nd>=d}function g(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function h(){if(hb)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=i(c);if(!d)return;return jb=d[0],d[1]}}function i(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 j(a){var b=[];if(!Nb(a))return b;Mb.nonEnumArgs&&a.length&&Ob(a)&&(a=Rb.call(a));var c=Mb.enumPrototypes&&"function"==typeof a,d=Mb.enumErrorProps&&(a===Hb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Mb.nonEnumShadows&&a!==Ib){var f=a.constructor,g=-1,h=tb;if(a===(f&&f.prototype))var i=a===Jb?Db:a===Hb?yb:Eb.call(a),j=Lb[i];for(;++g<h;)e=sb[g],j&&j[e]||!Fb.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(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=Eb.call(a),h=Eb.call(b);if(g==ub&&(g=Bb),h==ub&&(h=Bb),g!=h)return!1;switch(g){case wb:case xb:return+a==+b;case Ab:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Cb:case Db:return a==String(b)}var i=g==vb;if(!i){if(g!=Bb||!Mb.nodeClass&&(m(a)||m(b)))return!1;var j=!Mb.argsObject&&Ob(a)?Object:a.constructor,k=!Mb.argsObject&&Ob(b)?Object:b.constructor;if(!(j==k||Fb.call(a,"constructor")&&Fb.call(b,"constructor")||eb(j)&&j instanceof j&&eb(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=n(a[p],r,c,d)))break}}else l(b,function(b,e,f){return Fb.call(f,e)?(p++,q=Fb.call(a,e)&&n(a[e],b,c,d)):void 0}),q&&l(a,function(a,b,c){return Fb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(){try{return Pb.apply(this,arguments)}catch(a){return Vb.e=a,Vb}}function q(a){if(!eb(a))throw new TypeError("fn must be a function");return Pb=a,p}function r(a){throw a}function t(a,b){this.id=a,this.value=b}function u(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function v(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function w(a){this.observer=a,this.a=[],this.isStopped=!1}function x(){this._s=s}function y(){this._s=s,this._l=s.length,this._i=0}function z(a){this._a=a}function A(a){this._a=a,this._l=E(a),this._i=0}function B(a){return"number"==typeof a&&S.isFinite(a)}function C(b){var c,d=b[mb];if(!d&&"string"==typeof b)return c=new x(b),c[mb]();if(!d&&b.length!==a)return c=new z(b),c[mb]();if(!d)throw new TypeError("Object is not iterable");return b[mb]()}function D(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function E(a){var b=+a.length;return isNaN(b)?0:0!==b&&B(b)?(b=D(b)*Math.floor(Math.ab
8000
s(b)),0>=b?0:b>Pc?Pc:b):b}function F(a,b){this.observer=a,this.parent=b}function G(a,b){return new Rc(b,a)}function H(a,b){return new id(function(c){var d=new ec,e=new fc;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}db(d)&&(d=Jc(d));var g=new ec;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function I(a,b){var c=this;return new id(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function J(){return!1}function K(){return[]}function L(a,b,c){var d=rb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return db(e)&&(e=Jc(e)),(pb(e)||ob(e))&&(e=Qc(e)),e}).concatAll()}function M(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function N(a){this.comparer=a,this.set=[]}function O(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function P(a,b,c){var d=rb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return db(e)&&(e=Jc(e)),(pb(e)||ob(e))&&(e=Qc(e)),e}).mergeAll()}function Q(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}var R={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},S=R[typeof window]&&window||this,T=R[typeof exports]&&exports&&!exports.nodeType&&exports,U=R[typeof module]&&module&&!module.nodeType&&module,V=U&&U.exports===T&&T,W=R[typeof global]&&global;!W||W.global!==W&&W.window!==W||(S=W);var X={internals:{},config:{Promise:S.Promise},helpers:{}},Y=X.helpers.noop=function(){},Z=(X.helpers.notDefined=function(a){return"undefined"==typeof a},X.helpers.isScheduler=function(a){return a instanceof X.Scheduler}),$=X.helpers.identity=function(a){return a},_=(X.helpers.pluck=function(a){return function(b){return b[a]}},X.helpers.just=function(a){return function(){return a}},X.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),ab=X.helpers.defaultComparer=function(a,b){return Qb(a,b)},bb=X.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},cb=(X.helpers.defaultKeySerializer=function(a){return a.toString()},X.helpers.defaultError=function(a){throw a}),db=X.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},eb=(X.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},X.helpers.not=function(a){return!a},X.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Eb.call(a)}),a}()),fb="Argument out of range",gb="Object has been disposed";X.config.longStackSupport=!1;var hb=!1;try{throw new Error}catch(ib){hb=!!ib.stack}var jb,kb=h(),lb="From previous event:",mb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";S.Set&&"function"==typeof(new S.Set)["@@iterator"]&&(mb="@@iterator");var nb=X.doneEnumerator={done:!0,value:a},ob=X.helpers.isIterable=function(b){return b[mb]!==a},pb=X.helpers.isArrayLike=function(b){return b&&b.length!==a};X.helpers.iterator=mb;var qb,rb=X.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)}},sb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],tb=sb.length,ub="[object Arguments]",vb="[object Array]",wb="[object Boolean]",xb="[object Date]",yb="[object Error]",zb="[object Function]",Ab="[object Number]",Bb="[object Object]",Cb="[object RegExp]",Db="[object String]",Eb=Object.prototype.toString,Fb=Object.prototype.hasOwnProperty,Gb=Eb.call(arguments)==ub,Hb=Error.prototype,Ib=Object.prototype,Jb=String.prototype,Kb=Ib.propertyIsEnumerable;try{qb=!(Eb.call(document)==Bb&&!({toString:0}+""))}catch(ib){qb=!0}var Lb={};Lb[vb]=Lb[xb]=Lb[Ab]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Lb[wb]=Lb[Db]={constructor:!0,toString:!0,valueOf:!0},Lb[yb]=Lb[zb]=Lb[Cb]={constructor:!0,toString:!0},Lb[Bb]={constructor:!0};var Mb={};!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);Mb.enumErrorProps=Kb.call(Hb,"message")||Kb.call(Hb,"name"),Mb.enumPrototypes=Kb.call(a,"prototype"),Mb.nonEnumArgs=0!=c,Mb.nonEnumShadows=!/valueOf/.test(b)}(1);var Nb=X.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Ob=function(a){return a&&"object"==typeof a?Eb.call(a)==ub:!1};Gb||(Ob=function(a){return a&&"object"==typeof a?Fb.call(a,"callee"):!1});var Pb,Qb=X.internals.isEqual=function(a,b){return n(a,b,[],[])},Rb=({}.hasOwnProperty,Array.prototype.slice),Sb=this.inherits=X.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Tb=X.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]}},Ub=X.internals.addRef=function(a,b){return new id(function(c){return new $b(b.getDisposable(),a.subscribe(c))})},Vb={e:{}};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Rb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Rb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Rb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Wb=Object("a"),Xb="a"!=Wb[0]||!(0 in Wb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Xb&&{}.toString.call(this)==Db?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=zb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Xb&&{}.toString.call(this)==Db?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=zb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==vb}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;tb>e;e++)a.call(c,sb[e])&&f.push(sb[e]);return f}}()),t.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Yb=X.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Zb=Yb.prototype;Zb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Zb.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)}}},Zb.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)}}},Zb.peek=function(){return this.items[0].value},Zb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Zb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Zb.enqueue=function(a){var b=this.length++;this.items[b]=new t(Yb.count++,a),this.percolate(b)},Zb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Yb.count=0;var $b=X.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(!dc(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},_b=$b.prototype;_b.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},_b.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},_b.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 ac=X.Disposable=function(a){this.isDisposed=!1,this.action=a||Y};ac.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var bc=ac.create=function(a){return new ac(a)},cc=ac.empty={dispose:Y},dc=ac.isDisposable=function(a){return a&&eb(a.dispose)},ec=X.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},b.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()},a}(),fc=X.SerialDisposable=ec,gc=X.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?cc:new a(this)},b}();u.prototype.dispose=function(){this.scheduler.scheduleWithState(this,v)};var hc=X.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||bb,this.disposable=new ec};hc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},hc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},hc.prototype.isCancelled=function(){return this.disposable.isDisposed},hc.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};{var ic=X.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(),cc}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=_,a.normalize=function(a){return 0>a&&(a=0),a},a}();ic.normalize}!function(a){function b(a,b){var c=b.first,d=b.second,e=new $b,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),cc});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new $b,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c](b,d,function(a,b){return e?f.remove(i):h=!0,g(b),cc});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(ic.prototype),function(){ic.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},ic.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof S.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=S.setInterval(function(){d=c(d)},b);return bc(function(){S.clearInterval(e)})}}(ic.prototype),function(a){a.catchError=a["catch"]=function(a){return new qc(this,a)}}(ic.prototype);var jc,kc=(X.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 ec;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),ic.immediate=function(){function a(a,b){return b(this,a)}function b(){throw new Error("Not supported")}return new ic(_,a,b,b)}()),lc=ic.currentThread=function(){function a(){for(;d.length>0;){var a=d.dequeue();a.isCancelled()||!a.isCancelled()&&a.invoke()}}function b(b,c){var e=new hc(this,b,c,this.now());if(d)d.enqueue(e);else{d=new Yb(4),d.enqueue(e);var f=q(a)();if(d=null,f===Vb)return r(f.e)}return e.disposable}function c(){throw new Error("Not supported")}var d,e=new ic(_,b,c,c);return e.scheduleRequired=function(){return!d},e.ensureTrampoline=function(a){d?a():this.schedule(a)},e}(),mc=Y,nc=function(){var a,b=Y;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!S.setTimeout)throw new Error("No concurrency detected!");a=S.setTimeout,b=S.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),oc=nc.setTimeout,pc=nc.clearTimeout;!function(){function a(){if(!S.postMessage||S.importScripts)return!1;var a=!1,b=S.onmessage;return S. b=RegExp("^"+String(Eb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=W&&V&&W.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=W&&V&&W.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)jc=c,mc=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))jc=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};S.addEventListener?S.addEventListener("message",h,!1):S.attachEvent("onmessage",h,!1),jc=function(a){var b=g++;f[b]=a,S.postMessage(e+b,"*")}}else if(S.MessageChannel){var i=new S.MessageChannel,j={},k=0;i.port1. b=a.data,c=j[b];c(),delete j[b]},jc=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in S&&"onreadystatechange"in S.document.createElement("script")?jc=function(a){var b=S.document.createElement("script");b. oc(a,0)},mc=pc)}();var qc=(ic.timeout=function(){function a(a,b){var c=this,d=new ec,e=jc(function(){d.isDisposed||d.setDisposable(b(c,a))});return new $b(d,bc(function(){mc(e)}))}function b(a,b,c){var d=this,e=ic.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new ec,g=oc(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new $b(f,bc(function(){pc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new ic(_,a,b,c)}(),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 Sb(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 cc}}},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 ec;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}(ic)),rc=X.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}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 Z(a)||(a=kc),new id(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),sc=rc.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){var e=new rc("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),tc=rc.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){var e=new rc("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),uc=rc.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new rc("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),vc=X.internals.Enumerator=function(a){this._next=a};vc.prototype.next=function(){return this._next()},vc.prototype[mb]=function(){return this};var wc=X.internals.Enumerable=function(a){this._iterator=a};wc.prototype[mb]=function(){return this._iterator()},wc.prototype.concat=function(){var a=this;return new id(function(b){var c,d=a[mb](),e=new fc,f=kc.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;db(h)&&(h=Jc(h));var i=new ec;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new $b(e,f,bc(function(){c=!0}))})},wc.prototype.catchError=function(){var a=this;return new id(function(b){var c,d=a[mb](),e=new fc,f=kc.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;db(i)&&(i=Jc(i));var j=new ec;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new $b(e,f,bc(function(){c=!0}))})},wc.prototype.catchErrorWhen=function(a){var b=this;return new id(function(c){var d,e,f=new ld,g=new ld,h=a(f),i=h.subscribe(g),j=b[mb](),k=new fc,l=kc.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;db(i)&&(i=Jc(i));var l=new ec,m=new ec;k.setDisposable(new $b(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new $b(i,k,l,bc(function(){d=!0}))})};var xc=wc.repeat=function(a,b){return null==b&&(b=-1),new wc(function(){var c=b;return new vc(function(){return 0===c?nb:(c>0&&c--,{done:!1,value:a})})})},yc=wc.of=function(a,b,c){if(b)var d=rb(b,c,3);return new wc(function(){var c=-1;return new vc(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:nb})})},zc=X.Observer=function(){};zc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},zc.prototype.asObserver=function(){return new Dc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},zc.prototype.checked=function(){return new Ec(this)};var Ac=zc.create=function(a,b,c){return a||(a=Y),b||(b=cb),c||(c=Y),new Dc(a,b,c)};zc.fromNotifier=function(a,b){return new Dc(function(c){return a.call(b,sc(c))},function(c){return a.call(b,tc(c))},function(){return a.call(b,uc())})},zc.prototype.notifyOn=function(a){return new Gc(a,this)},zc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Bc,Cc=X.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}function c(){throw new Error("Method not implemented")}return Sb(b,a),b.prototype.next=c,b.prototype.error=c,b.prototype.completed=c,b.prototype. this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(zc),Dc=X.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Sb(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}(Cc),Ec=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Sb(b,a);var c=b.prototype;return c. b}finally{this._state=0}},c. b}finally{this._state=2}},c. a}finally{this._state=2}},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}(zc),Fc=X.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 fc}return Sb(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,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Cc),Gc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Sb(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}(Fc),Hc=X.Observable=function(){function a(a){if(X.config.longStackSupport&&hb){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var c=this;this._subscribe=function(b){var e=b.onError.bind(b);return b. this._subscribe=a}return Bc=a.prototype,Bc.subscribe=Bc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Ac(a,b,c))},Bc.subscribeOnNext=function(a,b){return this._subscribe(Ac("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Bc.subscribeOnError=function(a,b){return this._subscribe(Ac(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Bc.subscribeOnCompleted=function(a,b){return this._subscribe(Ac(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Ic=X.ObservableBase=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?bc(a):cc}function c(a,c){var d=c[0],e=c[1],f=q(e.subscribeCore).call(e,d);return f!==Vb||d.fail(Vb.e)?void d.setDisposable(b(f)):r(Vb.e)}function d(a){var b=new jd(a),d=[b,this];return lc.scheduleRequired()?lc.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Sb(e,a),e.prototype.subscribeCore=function(){throw new Error("Not implemeneted")},e}(Hc);Bc.observeOn=function(a){var b=this;return new id(function(c){return b.subscribe(new Gc(a,c))},b)},Bc.subscribeOn=function(a){var b=this;return new id(function(c){var d=new ec,e=new fc;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new u(a,b.subscribe(c)))})),e},b)};var Jc=Hc.fromPromise=function(a){return Lc(function(){var b=new X.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};Bc.toPromise=function(a){if(a||(a=X.config.Promise),!a)throw new TypeError("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 Kc=function(a){function b(b){this.source=b,a.call(this)}return Sb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new w(a))},b}(Ic);w.prototype. this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Bc.toArray=function(){return new Kc(this)},Hc.create=Hc.createWithDisposable=function(a,b){return new id(a,b)};var Lc=Hc.defer=function(a){return new id(function(b){var c;try{c=a()}catch(d){return Xc(d).subscribe(b)}return db(c)&&(c=Jc(c)),c.subscribe(b)})},Mc=Hc.empty=function(a){return Z(a)||(a=kc),new id(function(b){return a.schedule(function(){b.onCompleted()})})},Nc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)
}return Sb(b,a),b.prototype.subscribeCore=function(a){var b=new Oc(a,this);return b.run()},b}(Ic),Oc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=C(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Pc=Math.pow(2,53)-1;x.prototype[mb]=function(){return new y(this._s)},y.prototype[mb]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:nb},z.prototype[mb]=function(){return new A(this._a)},A.prototype[mb]=function(){return this},A.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:nb};var Qc=Hc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!eb(b))throw new Error("mapFn when provided must be a function");if(b)var e=rb(b,c,2);return Z(d)||(d=lc),new Nc(a,e,d)},Rc=function(a){function b(b,c){this.args=b,this.scheduler=c||lc,a.call(this)}return Sb(b,a),b.prototype.subscribeCore=function(a){var b=new F(a,this);return b.run()},b}(Ic);F.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 Sc=Hc.fromArray=function(a,b){return new Rc(a,b)};Hc.generate=function(a,b,c,d,e){return Z(e)||(e=lc),new id(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var Tc=Hc.never=function(){return new id(function(){return cc})};Hc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Rc(b)},Hc.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 Rc(c,a)},Hc.pairs=function(a,b){return b||(b=X.Scheduler.currentThread),new id(function(c){var d=Object.keys(a),e=d.length;return b.scheduleRecursiveWithState(0,function(b,f){if(e>b){var g=d[b
95BB
];c.onNext([g,a[g]]),f(b+1)}else c.onCompleted()})})};var Uc=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Sb(b,a),b.prototype.subscribeCore=function(a){var b=new Vc(a,this);return b.run()},b}(Ic),Vc=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.count,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Hc.range=function(a,b,c){return Z(c)||(c=lc),new Uc(a,b,c)},Hc.repeat=function(a,b,c){return Z(c)||(c=lc),Wc(a,c).repeat(null==b?-1:b)};var Wc=Hc["return"]=Hc.just=function(a,b){return Z(b)||(b=kc),new id(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};Hc.returnValue=function(){return Wc.apply(null,arguments)};var Xc=Hc["throw"]=Hc.throwError=function(a,b){return Z(b)||(b=kc),new id(function(c){return b.schedule(function(){c.onError(a)})})};Hc.throwException=function(){return Hc.throwError.apply(null,arguments)},Hc.using=function(a,b){return new id(function(c){var d,e,f=cc;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new $b(Xc(g).subscribe(c),f)}return new $b(e.subscribe(c),f)})},Bc.amb=function(a){var b=this;return new id(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new ec,j=new ec;return db(a)&&(a=Jc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new $b(i,j)})},Hc.amb=function(){function a(a,b){return a.amb(b)}var b=Tc(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Bc["catch"]=Bc.catchError=Bc.catchException=function(a){return"function"==typeof a?H(this,a):Yc([this,a])};var Yc=Hc.catchError=Hc["catch"]=Hc.catchException=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 yc(a).catchError()};Bc.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),Zc.apply(this,b)};var Zc=Hc.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 a--,Array.isArray(b[0])&&(b=b[0]),new id(function(c){function e(a){if(h[a]=!0,i||(i=h.every($))){try{var b=d.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(b)}else j.filter(function(b,c){return c!==a}).every($)&&c.onCompleted()}function f(a){j[a]=!0,j.every($)&&c.onCompleted()}for(var g=function(){return!1},h=o(a,g),i=!1,j=o(a,g),k=new Array(a),l=new Array(a),m=0;a>m;m++)!function(a){var d=b[a],g=new ec;db(d)&&(d=Jc(d)),g.setDisposable(d.subscribe(function(b){k[a]=b,e(a)},function(a){c.onError(a)},function(){f(a)})),l[a]=g}(m);return new $b(l)},this)};Bc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),$c.apply(null,a)};var $c=Hc.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 yc(a).concat()};Bc.concatAll=Bc.concatObservable=function(){return this.merge(1)};var _c=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Sb(b,a),b.prototype.subscribeCore=function(a){var b=new $b;return b.add(this.source.subscribe(new ad(a,this.maxConcurrent,b))),b},b}(Ic),ad=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 ec;this.g.add(c),db(a)&&(a=Jc(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}();Bc.merge=function(a){return"number"!=typeof a?bd(this,a):new _c(this,a)};var bd=Hc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Z(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=kc,b=0;d>b;b++)c.push(arguments[b]);else for(a=kc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),G(a,c).mergeAll()},cd=function(a){function b(b){this.source=b,a.call(this)}return Sb(b,a),b.prototype.subscribeCore=function(a){var b=new $b,c=new ec;return b.add(c),c.setDisposable(this.source.subscribe(new dd(a,b))),b},b}(Ic),dd=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype. c=new ec;this.g.add(c),db(a)&&(a=Jc(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype. this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype. a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&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}();Bc.mergeAll=Bc.mergeObservable=function(){return new cd(this)};var ed=X.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};ed.prototype=Error.prototype,Hc.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=G(null,a);return new id(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new ed(g))}var c=new $b,e=new ec,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new ec;c.add(e),db(d)&&(d=Jc(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})},Bc. new Error("Second observable is required");return fd([this,a])};var fd=Hc. 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 id(function(b){var c=0,d=new fc,e=kc.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],db(f)&&(f=Jc(f)),g=new ec,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new $b(d,e)})};Bc.skipUntil=function(a){var b=this;return new id(function(c){var d=!1,e=new $b(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));db(a)&&(a=Jc(a));var f=new ec;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},Bc["switch"]=Bc.switchLatest=function(){var a=this;return new id(function(b){var c=!1,d=new fc,e=!1,f=0,g=a.subscribe(function(a){var g=new ec,h=++f;c=!0,d.setDisposable(g),db(a)&&(a=Jc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new $b(g,d)},a)},Bc.takeUntil=function(a){var b=this;return new id(function(c){return db(a)&&(a=Jc(a)),new $b(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},Y))},b)},Bc.withLatestFrom=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);var d=a.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(a[0])&&(a=a[0]),new id(function(b){for(var c=function(){return!1},f=a.length,g=o(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=a[c],e=new ec;db(d)&&(d=Jc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every($)},b.onError.bind(b),function(){})),j[c]=e}(k);var l=new ec;return l.setDisposable(e.subscribe(function(a){var c,e=[a].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void b.onError(f)}b.onNext(c)}},b.onError.bind(b),function(){b.onCompleted()})),j[f]=l,new $b(j)},this)},Bc.zip=function(){if(Array.isArray(arguments[0]))return I.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new id(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every($)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=o(g,K),i=o(g,J),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new ec;db(e)&&(e=Jc(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new $b(j)},d)},Hc.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)},Hc.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 id(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every($))return void b.onCompleted()}function d(a){return g[a]=!0,g.every($)?void b.onCompleted():void 0}for(var e=a.length,f=o(e,function(){return[]}),g=o(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new ec,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},function(a){b.onError(a)},function(){d(e)}))}(i);return new $b(h)})},Bc.asObservable=function(){var a=this;return new id(function(b){return a.subscribe(b)},this)},Bc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Bc.dematerialize=function(){var a=this;return new id(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Bc.distinctUntilChanged=function(a,b){var c=this;return b||(b=ab),new id(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},Bc["do"]=Bc.tap=Bc.doAction=function(a,b,c){var d=this,e="function"==typeof a||"undefined"==typeof a?Ac(a||Y,b||Y,c||Y):a;return new id(function(a){return d.subscribe(function(b){try{e.onNext(b)}catch(c){a.onError(c)}a.onNext(b)},function(b){try{e.onError(b)}catch(c){a.onError(c)}a.onError(b)},function(){try{e.onCompleted()}catch(b){a.onError(b)}a.onCompleted()})},this)},Bc.doOnNext=Bc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Bc.doOnError=Bc.tapOnError=function(a,b){return this.tap(Y,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Bc.doOnCompleted=Bc.tapOnCompleted=function(a,b){return this.tap(Y,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Bc["finally"]=Bc.ensure=function(a){var b=this;return new id(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return bc(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Bc.finallyAction=function(a){return this.ensure(a)},Bc.ignoreElements=function(){var a=this;return new id(function(b){return a.subscribe(Y,function(a){b.onError(a)},function(){b.onCompleted()})},a)},Bc.materialize=function(){var a=this;return new id(function(b){return a.subscribe(function(a){b.onNext(sc(a))},function(a){b.onNext(tc(a)),b.onCompleted()},function(){b.onNext(uc()),b.onCompleted()})},a)},Bc.repeat=function(a){return xc(this,a).concat()},Bc.retry=function(a){return xc(this,a).catchError()},Bc.retryWhen=function(a){return xc(this).catchErrorWhen(a)},Bc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new id(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},Bc.skipLast=function(a){var b=this;return new id(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)},Bc.startWith=function(){var a,b=0;arguments.length&&Z(arguments[0])?(a=arguments[0],b=1):a=kc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return yc([Sc(c,a),this]).concat()},Bc.takeLast=function(a){var b=this;return new id(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)},Bc.takeLastBuffer=function(a){var b=this;return new id(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)},Bc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(fb);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(fb);return new id(function(d){function e(){var a=new ld;i.push(a),d.onNext(Ub(a,g))}var f=new ec,g=new gc(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)},Bc.selectConcat=Bc.concatMap=function(a,b,c){return eb(a)&&eb(b)?this.concatMap(function(c,d){var e=a(c,d);return db(e)&&(e=Jc(e)),(pb(e)||ob(e))&&(e=Qc(e)),e.map(function(a,e){return b(c,a,d,e)})}):eb(a)?L(this,a,c):L(this,function(){return a})},Bc.concatMapObserver=Bc.selectConcatObserver=function(a,b,c,d){var e=this,f=rb(a,d,2),g=rb(b,d,1),h=rb(c,d,0);return new id(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}db(d)&&(d=Jc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}db(c)&&(c=Jc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}db(b)&&(b=Jc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Bc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new id(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)},N.prototype.push=function(a){var b=-1===M(this.set,a,this.comparer);return b&&this.set.push(a),b},Bc.distinct=function(a,b){var c=this;return b||(b=ab),new id(function(d){var e=new N(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)};var gd=function(a){function b(b,c,d){this.source=b,this.selector=rb(c,d,3),a.call(this)}return Sb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a(d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new O(a,this.selector,this))},b}(Ic);O.prototype. b=q(this.selector).call(this,a,this.i++,this.source);return b===Vb?this.observer.onError(b.e):void this.observer.onNext(b)}},O.prototype. this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Bc.map=Bc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof gd?this.internalMap(c,b):new gd(this,c,b)},Bc.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(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})},Bc.selectMany=Bc.flatMap=function(a,b,c){return eb(a)&&eb(b)?this.flatMap(function(c,d){var e=a(c,d);return db(e)&&(e=Jc(e)),(pb(e)||ob(e))&&(e=Qc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):eb(a)?P(this,a,c):P(this,function(){return a})},Bc.flatMapObserver=Bc.selectManyObserver=function(a,b,c,d){var e=this;return new id(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)}db(c)&&(c=Jc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}db(c)&&(c=Jc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}db(a)&&(a=Jc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Bc.selectSwitch=Bc.flatMapLatest=Bc.switchMap=function(a,b){return this.select(a,b).switchLatest()},Bc.skip=function(a){if(0>a)throw new Error(fb);var b=this;return new id(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Bc.skipWhile=function(a,b){var c=this,d=rb(a,b,3);return new id(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)},Bc.take=function(a,b){if(0>a)throw new RangeError(fb);if(0===a)return Mc(b);var c=this;return new id(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)},Bc.takeWhile=function(a,b){var c=this,d=rb(a,b,3);return new id(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 hd=function(a){function b(b,c,d){this.source=b,this.predicate=rb(c,d,3),a.call(this)}return Sb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Q(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a(b,c,e)},c)},b}(Ic);Q.prototype. b=q(this.predicate).call(this,a,this.i++,this.source);return b===Vb?this.observer.onError(b.e):void(b&&this.observer.onNext(a))}},Q.prototype. this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Bc.filter=Bc.where=function(a,b){return this instanceof hd?this.internalFilter(a,b):new hd(this,a,b)},Bc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new id(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})},c)};var id=X.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?bc(a):cc}function c(a,c){var d=c[0],e=c[1];try{d.setDisposable(b(e(d)))}catch(f){if(!d.fail(f))throw f}}function d(b,d){function e(a){var d=new jd(a),e=[d,b];return lc.scheduleRequired()?lc.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Sb(d,a),d}(Hc),jd=function(a){function b(b){a.call(this),this.observer=b,this.m=new ec}Sb(b,a);var c=b.prototype;return c.next=function(a){var b=q(this.observer.onNext).call(this.observer,a);return b===Vb?(this.dispose(),r(b.e)):void 0},c.error=function(a){var b=q(this.observer.onError).call(this.observer,a);return this.dispose(),b===Vb?r(b.e):void 0},c.completed=function(){var a=q(this.observer.onCompleted).call(this.observer);return this.dispose(),a===Vb?r(a.e):void 0},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}(Cc),kd=function(a,b){this.subject=a,this.observer=b};kd.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 ld=X.Subject=function(a){function d(a){return b(this),this.isStopped?this.hasError?(a.onError(this.error),cc):(a.onCompleted(),cc):(this.observers.push(a),new kd(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Sb(e,a),Tb(e.prototype,zc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b(this),!this.isStopped){this.isStopped=!0;for(var a=0,d=c(this.observers),e=d.length;e>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){if(b(this),!this.isStopped)for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),e.create=function(a,b){return new md(a,b)},e}(Hc),md=(X.AsyncSubject=function(a){function d(a){return b(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),cc):(this.observers.push(a),new kd(this,a))}function e(){a.call(this,d),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Sb(e,a),Tb(e.prototype,zc,{hasObservers:function(){return b(this),this.observers.length>0},onCompleted:function(){var a,d;if(b(this),!this.isStopped){this.isStopped=!0;var e=c(this.observers),d=e.length;if(this.hasValue)for(a=0;d>a;a++){var f=e[a];f.onNext(this.value),f.onCompleted()}else for(a=0;d>a;a++)e[a].onCompleted();this.observers.length=0}},onError:function(a){if(b(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var d=0,e=c(this.observers),f=e.length;f>d;d++)e[d].onError(a);this.observers.length=0}},onNext:function(a){b(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),e}(Hc),X.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 Sb(c,a),Tb(c.prototype,zc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Hc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(S.Rx=X,define(function(){return X})):T&&U?V?(U.exports=X).Rx=X:T.Rx=X:S.Rx=X;var nd=h()}).call(this);
//# sourceMappingURL=rx.compat.map