UNPKG

77.4 kBJavaScriptView Raw
1/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
2(function(a){function b(a){return a&&a.Object===Object?a:null}function c(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function d(a){return function(){try{return a.apply(this,arguments)}catch(b){return ka.e=b,ka}}}function e(a){throw a}function f(a,b){if(ma&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(qa)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+qa+"\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===oa&&d>=pa&&_d>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if(ma)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 oa=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(b,c,d,e,f,g){var h=hb(b),i=h.length,j=hb(c),k=j.length;if(i!==k&&!e)return!1;for(var l,m=i;m--;)if(l=h[m],!(e?l in c:eb.call(c,l)))return!1;for(var n=e;++m<i;){l=h[m];var o,p=b[l],q=c[l];if(!(o===a?d(p,q,e,f,g):o))return!1;n||(n="constructor"===l)}if(!n){var r=b.constructor,s=c.constructor;if(r!==s&&"constructor"in b&&"constructor"in c&&!("function"==typeof r&&r instanceof r&&"function"==typeof s&&s instanceof s))return!1}return!0}function m(a,b,c){switch(c){case Ja:case Ka:return+a===+b;case La:return a.name===b.name&&a.message===b.message;case Oa:return a!==+a?b!==+b:a===+b;case Qa:case Sa:return a===b+""}return!1}function n(a){return!!a&&"object"==typeof a}function o(a){return"number"==typeof a&&a>-1&&a%1===0&&gb>=a}function p(a){return n(a)&&o(a.length)&&!!cb[fb.call(a)]}function q(a,b){for(var c=-1,d=a.length;++c<d;)if(b(a[c],c,a))return!0;return!1}function r(b,c,d,e,f,g){var h=-1,i=b.length,j=c.length;if(i!==j&&!(e&&j>i))return!1;for(;++h<i;){var k,l=b[h],m=c[h];if(k!==a){if(k)continue;return!1}if(e){if(!q(c,function(a){return l===a||d(l,a,e,f,g)}))return!1}else if(l!==m&&!d(l,m,e,f,g))return!1}return!0}function s(a,b,c,d,e,f){var g=kb(a),h=kb(b),i=Ia,j=Ia;g||(i=fb.call(a),i===Ha?i=Pa:i!==Pa&&(g=p(a))),h||(j=fb.call(b),j===Ha&&(j=Pa));var k=i===Pa&&!jb(a),n=j===Pa&&!jb(b),o=i===j;if(o&&!g&&!k)return m(a,b,i);if(!d){var q=k&&eb.call(a,"__wrapped__"),s=n&&eb.call(b,"__wrapped__");if(q||s)return c(q?a.value():a,s?b.value():b,d,e,f)}if(!o)return!1;e||(e=[]),f||(f=[]);for(var t=e.length;t--;)if(e[t]===a)return f[t]===b;e.push(a),f.push(b);var u=(g?r:l)(a,b,c,d,e,f);return e.pop(),f.pop(),u}function t(a,b,c,d,e){return a===b?!0:null==a||null==b||!ib(a)&&!n(b)?a!==a&&b!==b:s(a,b,t,c,d,e)}function u(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function v(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function w(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function x(a,b){this.id=a,this.value=b}function y(a){this._s=a,this.isDisposed=!1}function z(a){this._s=a}function A(a){this._s=a,this._l=a.length,this._i=0}function B(a){this._a=a}function C(a){this._a=a,this._l=G(a),this._i=0}function D(a){return"number"==typeof a&&aa.isFinite(a)}function E(b){var c,d=b[Aa];if(!d&&"string"==typeof b)return c=new z(b),c[Aa]();if(!d&&b.length!==a)return c=new B(b),c[Aa]();if(!d)throw new TypeError("Object is not iterable");return b[Aa]()}function F(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function G(a){var b=+a.length;return isNaN(b)?0:0!==b&&D(b)?(b=F(b)*Math.floor(Math.abs(b)),0>=b?0:b>Bc?Bc:b):b}function H(a,b){return Fb(a)||(a=Lb),new Dc(b,a)}function I(a,b){this.observer=a,this.parent=b}function J(a,b){return a.amb(b)}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function M(){return[]}function K(){return!1}function M(){return[]}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function N(a){return function(b){return a.subscribe(b)}}function O(a){return a.toArray()}function P(a){return a.length>0}function Q(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function R(a){this.comparer=a,this.set=[]}function S(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 T(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var U={"function":!0,object:!0},V=U[typeof exports]&&exports&&!exports.nodeType?exports:null,W=U[typeof module]&&module&&!module.nodeType?module:null,X=b(V&&W&&"object"==typeof global&&global),Y=b(U[typeof self]&&self),Z=b(U[typeof window]&&window),$=W&&W.exports===V?V:null,_=b(U[typeof this]&&this),aa=X||Z!==(_&&_.window)&&Z||Y||_||Function("return this")(),ba={internals:{},config:{Promise:aa.Promise},helpers:{}},ca=ba.helpers.noop=function(){},da=ba.helpers.identity=function(a){return a},ea=ba.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}(),fa=ba.helpers.defaultComparer=function(a,b){return lb(a,b)},ga=ba.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ha=(ba.helpers.defaultKeySerializer=function(a){return a.toString()},ba.helpers.defaultError=function(a){throw a}),ia=ba.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},ja=ba.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==ra.call(a)}),a}(),ka={e:{}},la=ba.internals.tryCatch=function(a){if(!ja(a))throw new TypeError("fn must be a function");return d(a)};ba.config.longStackSupport=!1;var ma=!1,na=la(function(){throw new Error})();ma=!!na.e&&!!na.e.stack;var oa,pa=j(),qa="From previous event:",ra=Object.prototype.toString;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 sa=Object("a"),ta="a"!==sa[0]||!(0 in sa);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=ta&&ra.call(this)===stringClass?this.split(""):b,d=c.length>>>0,e=arguments[1];if(ra.call(a)!==funcClass)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=ta&&ra.call(this)===stringClass?this.split(""):b,d=c.length>>>0,e=new Array(d),f=arguments[1];if(ra.call(a)!==funcClass)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 ra.call(a)===arrayClass}),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&&d!==1/0&&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;Ga>e;e++)a.call(c,Fa[e])&&f.push(Fa[e]);return f}}()),"function"!=typeof Object.create&&(Object.create=function(){function a(){}var b=Object.prototype.hasOwnProperty;return function(c){if("object"!=typeof c)throw new TypeError("Object prototype may only be an Object or null");a.prototype=c;var d=new a;if(a.prototype=null,arguments.length>1){var e=Object(arguments[1]);for(var f in e)b.call(e,f)&&(d[f]=e[f])}return d}}()),aa.Element&&aa.Element.prototype.attachEvent&&!aa.Element.prototype.addEventListener&&function(){function a(a,b){Window.prototype[a]=HTMLDocument.prototype[a]=Element.prototype[a]=b}function b(){b.interval&&document.body&&(b.interval=clearInterval(b.interval),document.dispatchEvent(new CustomEvent("DOMContentLoaded")))}a("addEventListener",function(a,b){var c=this,d=c._c1_listeners=c._c1_listeners||{},e=d[a]=d[a]||[];c.attachEvent("on"+a,e.event=function(a){a||(a=aa.event);var b=c.document&&c.document.documentElement||c.documentElement||{scrollLeft:0,scrollTop:0};switch(a.currentTarget=c,a.pageX=a.clientX+b.scrollLeft,a.pageY=a.clientY+b.scrollTop,a.preventDefault=function(){if(a.bubbledKeyCode=a.keyCode,a.ctrlKey)try{a.keyCode=0}catch(a){}a.defaultPrevented=!0,a.returnValue=!1,a.modified=!0,a.returnValue=!1},a.stopImmediatePropagation=function(){k=!1,a.cancelBubble=!0},a.stopPropagation=function(){a.cancelBubble=!0},a.relatedTarget=a.fromElement||null,a.target=a.srcElement||c,a.timeStamp=+new Date,a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10===d?(d=0,a.keyCode=13):13===d||27===d?d=0:3===d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}var f={};for(var g in a)f[g]=a[g];for(var h,i=0,j=[].concat(e),k=!0;k&&(h=j[i]);++i)for(var l,m=0;l=e[m];++m)if(l===h){l.call(c,f);break}}),e.push(b)}),a("removeEventListener",function(a,b){for(var c,d=this,e=d._c1_listeners=d._c1_listeners||{},f=e[a]=e[a]||[],g=f.length-1;c=f[g];--g)if(c===b){f.splice(g,1);break}!f.length&&f.event&&d.detachEvent("on"+a,f.event)}),a("dispatchEvent",function(a){var b=this,c=a.type,d=b._c1_listeners=b._c1_listeners||{},e=d[c]=d[c]||[];try{return b.fireEvent("on"+c,a)}catch(f){return e.event&&e.event(a)}}),b.interval=setInterval(b,1),aa.addEventListener("load",b)}(),(!aa.CustomEvent||"object"==typeof aa.CustomEvent)&&function(){function b(b,c){var d;c=c||{bubbles:!1,cancelable:!1,detail:a};try{document.createEvent?(d=document.createEvent("CustomEvent"),d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail)):document.createEventObject&&(d=document.createEventObject())}catch(e){d=document.createEvent("Event"),d.initEvent(b,c.bubbles,c.cancelable),d.detail=c.detail}return d}aa.CustomEvent&&(b.prototype=aa.CustomEvent.prototype),aa.CustomEvent=b}();var ua=ba.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ua.prototype=Object.create(Error.prototype),ua.prototype.name="EmptyError";var va=ba.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};va.prototype=Object.create(Error.prototype),va.prototype.name="ObjectDisposedError";var wa=ba.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};wa.prototype=Object.create(Error.prototype),wa.prototype.name="ArgumentOutOfRangeError";var xa=ba.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};xa.prototype=Object.create(Error.prototype),xa.prototype.name="NotSupportedError";var ya=ba.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};ya.prototype=Object.create(Error.prototype),ya.prototype.name="NotImplementedError";var za=ba.helpers.notImplemented=function(){throw new ya},Aa=(ba.helpers.notSupported=function(){throw new xa},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");aa.Set&&"function"==typeof(new aa.Set)["@@iterator"]&&(Aa="@@iterator");var Ba=ba.doneEnumerator={done:!0,value:a},Ca=ba.helpers.isIterable=function(b){return b&&b[Aa]!==a},Da=ba.helpers.isArrayLike=function(b){return b&&b.length!==a};ba.helpers.iterator=Aa;var Ea=ba.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)}},Fa=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ga=Fa.length,Ha="[object Arguments]",Ia="[object Array]",Ja="[object Boolean]",Ka="[object Date]",La="[object Error]",Ma="[object Function]",Na="[object Map]",Oa="[object Number]",Pa="[object Object]",Qa="[object RegExp]",Ra="[object Set]",Sa="[object String]",Ta="[object WeakMap]",Ua="[object ArrayBuffer]",Va="[object Float32Array]",Wa="[object Float64Array]",Xa="[object Int8Array]",Ya="[object Int16Array]",Za="[object Int32Array]",$a="[object Uint8Array]",_a="[object Uint8ClampedArray]",ab="[object Uint16Array]",bb="[object Uint32Array]",cb={};cb[Va]=cb[Wa]=cb[Xa]=cb[Ya]=cb[Za]=cb[$a]=cb[_a]=cb[ab]=cb[bb]=!0,cb[Ha]=cb[Ia]=cb[Ua]=cb[Ja]=cb[Ka]=cb[La]=cb[Ma]=cb[Na]=cb[Oa]=cb[Pa]=cb[Qa]=cb[Ra]=cb[Sa]=cb[Ta]=!1;var db=Object.prototype,eb=db.hasOwnProperty,fb=db.toString,gb=Math.pow(2,53)-1,hb=Object.keys||function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}(),ib=ba.internals.isObject=function(a){var b=typeof a;return!!a&&("object"===b||"function"===b)},jb=function(){try{Object({toString:0}+"")}catch(a){return function(){return!1}}return function(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}}(),kb=Array.isArray||function(a){return n(a)&&o(a.length)&&fb.call(a)===Ia},lb=ba.internals.isEqual=function(a,b){return t(a,b)},mb=({}.hasOwnProperty,Array.prototype.slice,ba.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),nb=ba.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]}},ob=ba.internals.addRef=function(a,b){return new Wd(function(c){return new zb(b.getDisposable(),a.subscribe(c))})},pb=ba.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];this.disposables=c,this.isDisposed=!1,this.length=c.length},qb=pb.prototype;qb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},qb.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},qb.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 rb=ba.Disposable=function(a){this.isDisposed=!1,this.action=a||ca};rb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var sb=rb.create=function(a){return new rb(a)},tb=rb.empty={dispose:ca},ub=rb.isDisposable=function(a){return a&&ja(a.dispose)},vb=rb.checkDisposed=function(a){if(a.isDisposed)throw new va},wb=rb._fixup=function(a){return ub(a)?a:tb},xb=ba.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};xb.prototype.getDisposable=function(){return this.current},xb.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()},xb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var yb=ba.SerialDisposable=function(){this.isDisposed=!1,this.current=null};yb.prototype.getDisposable=function(){return this.current},yb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},yb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var zb=ba.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};zb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this._first;this._first=null,a&&a.dispose();var b=this._second;this._second=null,b&&b.dispose()}};var Ab=ba.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};Ab.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=0,b=this._disposables.length;b>a;a++)this._disposables[a].dispose();this._disposables.length=0}};var Bb=ba.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?tb:new a(this)},b}();v.prototype.dispose=function(){this.scheduler.schedule(this,w)};var Cb=ba.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ga,this.disposable=new xb};Cb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Cb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Cb.prototype.isCancelled=function(){return this.disposable.isDisposed},Cb.prototype.invokeCore=function(){return wb(this.action(this.scheduler,this.state))};var Db=ba.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new ya},b.scheduleFuture=function(b,c,d){var e=c;return e instanceof Date&&(e-=this.now()),e=a.normalize(e),0===e?this.schedule(b,d):this._scheduleFuture(b,e,d)},b._scheduleFuture=function(a,b,c){throw new ya},a.now=ea,a.prototype.now=ea,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Eb=Db.normalize,Fb=Db.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),tb}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new pb;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),tb}var h=!1,i=!1,j=a.scheduleFuture(b,d,g);i||(f.add(j),h=!0)}var d=b[0],e=b[1],f=new pb;return e(d,c),f}a.scheduleRecursive=function(a,c){return this.schedule([a,c],b)},a.scheduleRecursiveFuture=function(a,b,d){return this.scheduleFuture([a,d],b,c)}}(Db.prototype),function(a){a.schedulePeriodic=function(a,b,c){if("undefined"==typeof aa.setInterval)throw new xa;b=Eb(b);var d=a,e=aa.setInterval(function(){d=c(d)},b);return sb(function(){aa.clearInterval(e)})}}(Db.prototype),function(a){a.catchError=a["catch"]=function(a){return new Rb(this,a)}}(Db.prototype);var Gb,Hb,Ib=(ba.internals.SchedulePeriodicRecursive=function(){function a(a){return function(b,c){c(0,a._period);var d=la(a._action)(a._state);d===ka&&(a._cancel.dispose(),e(d.e)),a._state=d}}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 xb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a(this))),b},b}(),function(a){function b(){a.call(this)}return mb(b,a),b.prototype.schedule=function(a,b){return wb(b(this,a))},b}(Db)),Jb=Db.immediate=new Ib,Kb=function(a){function b(){for(;d.length>0;){var a=d.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var d;return mb(c,a),c.prototype.schedule=function(a,c){var f=new Cb(this,a,c,this.now());if(d)d.enqueue(f);else{d=new Sb(4),d.enqueue(f);var g=la(b)();d=null,g===ka&&e(g.e)}return f.disposable},c.prototype.scheduleRequired=function(){return!d},c}(Db),Lb=Db.currentThread=new Kb,Mb=function(){var a,b=ca;if(aa.setTimeout)a=aa.setTimeout,b=aa.clearTimeout;else{if(!aa.WScript)throw new xa;a=function(a,b){aa.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),Nb=Mb.setTimeout,Ob=Mb.clearTimeout;!function(){function a(b){if(f)Nb(function(){a(b)},0);else{var c=d[b];if(c){f=!0;var g=la(c)();Hb(b),f=!1,g===ka&&e(g.e)}}}function b(){if(!aa.postMessage||aa.importScripts)return!1;var a=!1,b=aa.onmessage;return aa.onmessage=function(){a=!0},aa.postMessage("","*"),aa.onmessage=b,a}var c=1,d={},f=!1;Hb=function(a){delete d[a]};var g=new RegExp("^"+String(ra).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=X&&$&&X.setImmediate)&&!g.test(h)&&h;if(ja(h))Gb=function(b){var e=c++;return d[e]=b,h(function(){a(e)}),e};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Gb=function(b){var e=c++;return d[e]=b,process.nextTick(function(){a(e)}),e};else if(b()){var i="ms.rx.schedule"+Math.random(),j=function(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))};aa.addEventListener("message",j,!1),Gb=function(a){var b=c++;return d[b]=a,aa.postMessage(i+currentId,"*"),b}}else if(aa.MessageChannel){var k=new aa.MessageChannel;k.port1.onmessage=function(b){a(b.data)},Gb=function(a){var b=c++;return d[b]=a,k.port2.postMessage(b),b}}else Gb="document"in aa&&"onreadystatechange"in aa.document.createElement("script")?function(b){var e=aa.document.createElement("script"),f=c++;return d[f]=b,e.onreadystatechange=function(){a(f),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},aa.document.documentElement.appendChild(e),f}:function(b){var e=c++;return d[e]=b,Nb(function(){a(e)},0),e}}();var Pb=function(a){function b(){a.call(this)}function c(a,b,c,d){return function(){a.setDisposable(rb._fixup(b(c,d)))}}function d(a){this._id=a,this.isDisposed=!1}function e(a){this._id=a,this.isDisposed=!1}return mb(b,a),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,Hb(this._id))},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,Ob(this._id))},b.prototype.schedule=function(a,b){var e=new xb,f=Gb(c(e,b,this,a));return new zb(e,new d(f))},b.prototype._scheduleFuture=function(a,b,d){if(0===b)return this.schedule(a,d);var f=new xb,g=Nb(c(f,d,this,a),b);return new zb(f,new e(g))},b}(Db),Qb=Db["default"]=Db.async=new Pb,Rb=function(a){function b(b,c){this._scheduler=b,this._handler=c,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this)}return mb(b,a),b.prototype.schedule=function(a,b){return this._scheduler.schedule(a,this._wrap(b))},b.prototype._scheduleFuture=function(a,b,c){return this._scheduler.schedule(a,b,this._wrap(c))},b.prototype.now=function(){return this._scheduler.now()},b.prototype._clone=function(a){return new b(a,this._handler)},b.prototype._wrap=function(a){var b=this;return function(c,d){var f=la(a)(b._getRecursiveWrapper(c),d);return f===ka?(b._handler(f.e)||e(f.e),tb):wb(f)}},b.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},b.prototype.schedulePeriodic=function(a,b,c){var d=this,f=!1,g=new xb;return g.setDisposable(this._scheduler.schedulePeriodic(a,b,function(a){if(f)return null;var b=la(c)(a);return b===ka?(f=!0,d._handler(b.e)||e(b.e),g.dispose(),null):b})),g},b}(Db);x.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Sb=ba.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Tb=Sb.prototype;Tb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Tb.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)}}},Tb.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)}}},Tb.peek=function(){return this.items[0].value},Tb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Tb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Tb.enqueue=function(a){var b=this.length++;this.items[b]=new x(Sb.count++,a),this.percolate(b)},Tb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Sb.count=0;var Ub=ba.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new ya},a.prototype._acceptObserver=function(a,b,c){throw new ya},a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObserver(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return Fb(a)||(a=Jb),new Wd(function(c){return a.schedule(b,function(a,b){b._acceptObserver(c),"N"===b.kind&&c.onCompleted()})})},a}(),Vb=function(a){function b(a){this.value=a,this.kind="N"}return mb(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObserver=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return"OnNext("+this.value+")"},b}(Ub),Wb=function(a){function b(a){this.error=a,this.kind="E"}return mb(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObserver=function(a){return a.onError(this.error)},b.prototype.toString=function(){return"OnError("+this.error+")"},b}(Ub),Xb=function(a){function b(){this.kind="C"}return mb(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObserver=function(a){return a.onCompleted()},b.prototype.toString=function(){return"OnCompleted()"},b}(Ub),Yb=Ub.createOnNext=function(a){return new Vb(a)},Zb=Ub.createOnError=function(a){return new Wb(a)},$b=Ub.createOnCompleted=function(){return new Xb},_b=ba.Observer=function(){};_b.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},_b.prototype.asObserver=function(){var a=this;return new dc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},_b.prototype.checked=function(){return new ec(this)};var ac=_b.create=function(a,b,c){return a||(a=ca),b||(b=ha),c||(c=ca),new dc(a,b,c)};_b.fromNotifier=function(a,b){var c=Ea(a,b,1);return new dc(function(a){return c(Yb(a))},function(a){return c(Zb(a))},function(){return c($b())})},_b.prototype.notifyOn=function(a){return new gc(a,this)},_b.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var bc,cc=ba.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return mb(b,a),b.prototype.next=za,b.prototype.error=za,b.prototype.completed=za,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}(_b),dc=ba.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return mb(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}mb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=la(this._observer.onNext).call(this._observer,a);this._state=0,b===ka&&e(b.e)},c.onError=function(a){this.checkAccess();var b=la(this._observer.onError).call(this._observer,a);this._state=2,b===ka&&e(b.e)},c.onCompleted=function(){this.checkAccess();var a=la(this._observer.onCompleted).call(this._observer);this._state=2,a===ka&&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}(_b),fc=ba.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 yb}function c(a,b){return function(){a.onNext(b)}}function d(a,b){return function(){a.onError(b)}}function f(a){return function(){a.onCompleted()}}function g(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var d=la(c)();return d===ka?(a.queue=[],a.hasFaulted=!0,e(d.e)):void b(a)}return mb(b,a),b.prototype.next=function(a){this.queue.push(c(this.observer,a))},b.prototype.error=function(a){this.queue.push(d(this.observer,a))},b.prototype.completed=function(){this.queue.push(f(this.observer))},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.scheduleRecursive(this,g))},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 mb(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=ba.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(){if(ba.config.longStackSupport&&ma){var b=this._subscribe,c=la(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}}return bc=b.prototype,b.isObservable=function(a){return a&&ja(a.subscribe)},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))},b}(),ic=ba.ObservableBase=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?sb(a):tb}function c(a,c){var d=c[0],f=c[1],g=la(f.subscribeCore).call(f,d);g!==ka||d.fail(ka.e)||e(ka.e),d.setDisposable(b(g))}function d(){a.call(this)}return mb(d,a),d.prototype._subscribe=function(a){var b=new Xd(a),d=[b,this];return Lb.scheduleRequired()?Lb.schedule(d,c):c(null,d),b},d.prototype.subscribeCore=za,d}(hc),jc=ba.FlatMapObservable=function(a){function b(b,c,d,e){this.resultSelector=ja(d)?d:null,
3this.selector=Ea(ja(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.o=a,cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},mb(c,cc),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.next=function(a){var b=this.i++,c=la(this.selector)(a,b,this.source);return c===ka?this.o.onError(c.e):(ia(c)&&(c=uc(c)),(Da(c)||Ca(c))&&(c=hc.from(c)),void this.o.onNext(this._wrapResult(c,a,b)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onCompleted()},b}(ic),kc=ba.internals.Enumerable=function(){};y.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var lc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=la(a.e.next).call(a.e);if(c===ka)return a.o.onError(c.e);if(c.done)return a.o.onCompleted();var e=c.value;ia(e)&&(e=uc(e));var f=new xb;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new yb,d={isDisposed:!1,o:a,subscription:b,e:this.sources[Aa]()},e=Lb.scheduleRecursive(d,c);return new Ab([b,e,new y(d)])},mb(d,cc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.o.onError(a)},d.prototype.completed=function(){this._recurse(this._state)},b}(ic);kc.prototype.concat=function(){return new lc(this)};var mc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=la(a.e.next).call(a.e);if(c===ka)return a.o.onError(c.e);if(c.done)return null!==a.lastError?a.o.onError(a.lastError):a.o.onCompleted();var e=c.value;ia(e)&&(e=uc(e));var f=new xb;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new yb,d={isDisposed:!1,e:this.sources[Aa](),subscription:b,lastError:null,o:a},e=Lb.scheduleRecursive(d,c);return new Ab([b,e,new y(d)])},mb(d,cc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.lastError=a,this._recurse(this._state)},d.prototype.completed=function(){this._state.o.onCompleted()},b}(ic);kc.prototype.catchError=function(){return new mc(this)},kc.prototype.catchErrorWhen=function(a){var b=this;return new Wd(function(c){var d,e=new Zd,f=new Zd,g=a(e),h=g.subscribe(f),i=b[Aa](),j={isDisposed:!1},k=new yb,l=Lb.scheduleRecursive(null,function(a,b){if(!j.isDisposed){var g=la(i.next).call(i);if(g===ka)return c.onError(g.e);if(g.done)return void(d?c.onError(d):c.onCompleted());var h=g.value;ia(h)&&(h=uc(h));var l=new xb,m=new xb;k.setDisposable(new zb(m,l)),l.setDisposable(h.subscribe(function(a){c.onNext(a)},function(a){m.setDisposable(f.subscribe(b,function(a){c.onError(a)},function(){c.onCompleted()})),e.onNext(a)},function(){c.onCompleted()}))}});return new Ab([h,k,l,new y(j)])})};var nc=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 mb(b,a),b.prototype[Aa]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?Ba:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(kc),oc=kc.repeat=function(a,b){return new nc(a,b)},pc=function(a){function b(a,b,c){this.s=a,this.fn=b?Ea(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return mb(b,a),b.prototype[Aa]=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]}:Ba},b}(kc),qc=kc.of=function(a,b,c){return new pc(a,b,c)},rc=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new gc(this._s,a))},b}(ic);bc.observeOn=function(a){return new rc(this,a)};var sc=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new v(a,c.subscribe(e)))}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new xb,d=new yb;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(ic);bc.subscribeOn=function(a){return new sc(this,a)};var tc=function(a){function b(b,c){this._p=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];c.onNext(d),c.onCompleted()}function d(a,b){var c=b[0],d=b[1];c.onError(d)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new xb,e=this;return this._p.then(function(d){b.setDisposable(e._s.schedule([a,d],c))},function(c){b.setDisposable(e._s.schedule([a,c],d))}),b},b}(ic),uc=hc.fromPromise=function(a,b){return b||(b=Qb),new tc(a,b)};bc.toPromise=function(a){if(a||(a=ba.config.Promise),!a)throw new xa("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d;b.subscribe(function(a){d=a},c,function(){a(d)})})};var vc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},mb(c,cc),c.prototype.next=function(a){this.a.push(a)},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onNext(this.a),this.o.onCompleted()},b}(ic);bc.toArray=function(){return new vc(this)},hc.create=function(a,b){return new Wd(a,b)};var wc=function(a){function b(b){this._f=b,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=la(this._f)();return b===ka?Oc(b.e).subscribe(a):(ia(b)&&(b=uc(b)),b.subscribe(a))},b}(ic),xc=(hc.defer=function(a){return new wc(a)},function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.scheduler=b}function d(a,b){return b.onCompleted(),tb}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){var a=this.observer;return this.scheduler===Jb?d(null,a):this.scheduler.schedule(a,d)},b}(ic)),yc=new xc(Jb),zc=hc.empty=function(a){return Fb(a)||(a=Jb),a===Jb?yc:new xc(a)},Ac=function(a){function b(b,c,d){this._iterable=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){var f=la(b.next).call(b);if(f===ka)return a.onError(f.e);if(f.done)return a.onCompleted();var g=f.value;return ja(c)&&(g=la(c)(g,d),g===ka)?a.onError(g.e):(a.onNext(g),void e(d+1))}}return mb(b,a),b.prototype.subscribeCore=function(a){var b=Object(this._iterable),d=E(b);return this._scheduler.scheduleRecursive(0,c(a,d,this._fn))},b}(ic),Bc=Math.pow(2,53)-1;z.prototype[Aa]=function(){return new A(this._s)},A.prototype[Aa]=function(){return this},A.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:Ba},B.prototype[Aa]=function(){return new C(this._a)},C.prototype[Aa]=function(){return this},C.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:Ba};var Cc=hc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ja(b))throw new Error("mapFn when provided must be a function");if(b)var e=Ea(b,c,2);return Fb(d)||(d=Lb),new Ac(a,e,d)},Dc=function(a){function b(b,c){this._args=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b.length;return function(d,e){c>d?(a.onNext(b[d]),e(d+1)):a.onCompleted()}}return mb(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._args))},b}(ic),Ec=hc.fromArray=function(a,b){return Fb(b)||(b=Lb),new Dc(a,b)},Fc=function(a){function b(b,c,d,e,f){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,this._first=!0,a.call(this)}function c(a,b){if(a._first)a._first=!1;else if(a._state=la(a._itrFn)(a._state),a._state===ka)return a._o.onError(a._state.e);var c=la(a._cndFn)(a._state);if(c===ka)return a._o.onError(c.e);if(c){var d=la(a._resFn)(a._state);if(d===ka)return a._o.onError(d.e);a._o.onNext(d),b(a)}else a._o.onCompleted()}return mb(b,a),b.prototype.subscribeCore=function(a){return this._o=a,this._s.scheduleRecursive(this,c)},b}(ic);hc.generate=function(a,b,c,d,e){return Fb(e)||(e=Lb),new Fc(a,b,c,d,e)};var Gc=function(a){function b(){a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return tb},b}(ic),Hc=new Gc,Ic=hc.never=function(){return Hc};hc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Dc(b,Lb)},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 Dc(c,a)};var Jc=function(a){function b(b,c){this._o=b,this._keys=Object.keys(b),this._scheduler=c,a.call(this)}function c(a,b,c){return function(d,e){if(d<c.length){var f=c[d];a.onNext([f,b[f]]),e(d+1)}else a.onCompleted()}}return mb(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._o,this._keys))},b}(ic);hc.pairs=function(a,b){return b||(b=Lb),new Jc(a,b)};var Kc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){b>d?(c.onNext(a+d),e(d+1)):c.onCompleted()}}return mb(b,a),b.prototype.subscribeCore=function(a){return this.scheduler.scheduleRecursive(0,c(this.start,this.rangeCount,a))},b}(ic);hc.range=function(a,b,c){return Fb(c)||(c=Lb),new Kc(a,b,c)};var Lc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new I(a,this);return b.run()},b}(ic);I.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.scheduleRecursive(this.parent.repeatCount,a)},hc.repeat=function(a,b,c){return Fb(c)||(c=Lb),new Lc(a,b,c)};var Mc=function(a){function b(b,c){this._value=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),tb}return mb(b,a),b.prototype.subscribeCore=function(a){var b=[this._value,a];return this._scheduler===Jb?c(null,b):this._scheduler.schedule(b,c)},b}(ic),Nc=(hc["return"]=hc.just=function(a,b){return Fb(b)||(b=Jb),new Mc(a,b)},function(a){function b(b,c){this._error=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onError(c),tb}return mb(b,a),b.prototype.subscribeCore=function(a){var b=[this._error,a];return this._scheduler===Jb?c(null,b):this._scheduler.schedule(b,c)},b}(ic)),Oc=hc["throw"]=function(a,b){return Fb(b)||(b=Jb),new Nc(a,b)},Pc=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=tb,c=la(this._resFn)();if(c===ka)return new zb(Oc(c.e).subscribe(a),b);c&&(b=c);var d=la(this._obsFn)(c);return d===ka?new zb(Oc(d.e).subscribe(a),b):new zb(d.subscribe(a),b)},b}(ic);hc.using=function(a,b){return new Pc(a,b)},bc.amb=function(a){var b=this;return new Wd(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new xb,j=new xb;ia(a)&&(a=uc(a));var k=ac(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=ac(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 zb(i,j)})},hc.amb=function(){var a,b=Ic();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=J(b,a[d]);return b};var Qc=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new xb,c=new yb;return c.setDisposable(b),b.setDisposable(this.source.subscribe(new Rc(a,c,this._fn))),c},b}(ic),Rc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return mb(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=la(this._fn)(a);if(b===ka)return this._o.onError(b.e);ia(b)&&(b=uc(b));var c=new xb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(cc);bc["catch"]=function(a){return ja(a)?new Qc(this,a):Sc([this,a])};var Sc=hc["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 qc(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),Vc.apply(this,b)};var Tc=function(a){function b(b,c){this._params=b,this._cb=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._params.length,c=new Array(b),d={hasValue:u(b,K),hasValueAll:!1,isDone:u(b,K),values:new Array(b)},e=0;b>e;e++){var f=this._params[e],g=new xb;c[e]=g,ia(f)&&(f=uc(f)),g.setDisposable(f.subscribe(new Uc(a,e,this._cb,d)))}return new Ab(c)},b}(ic),Uc=function(a){function b(b,c,d,e){this._o=b,this._i=c,this._cb=d,this._state=e,a.call(this)}function c(a){return function(b,c){return c!==a}}return mb(b,a),b.prototype.next=function(a){if(this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll||(this._state.hasValueAll=this._state.hasValue.every(da))){var b=la(this._cb).apply(null,this._state.values);if(b===ka)return this._o.onError(b.e);this._o.onNext(b)}else this._state.isDone.filter(c(this._i)).every(da)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._state.isDone[this._i]=!0,this._state.isDone.every(da)&&this._o.onCompleted()},b}(cc),Vc=hc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ja(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new Tc(b,d)};bc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Yc.apply(null,a)};var Wc=function(a){function b(b,c){this._s=b,this._fn=c,a.call(this)}return mb(b,a),b.prototype.next=function(a){this._s.o.onNext(a)},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.i++,this._fn(this._s)},b}(cc),Xc=function(a){function b(b){this._sources=b,a.call(this)}function c(a,b){if(!a.disposable.isDisposed){if(a.i===a.sources.length)return a.o.onCompleted();var c=a.sources[a.i];ia(c)&&(c=uc(c));var d=new xb;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new Wc(a,b)))}}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new yb,d=sb(ca),e={o:a,i:0,subscription:b,disposable:d,sources:this._sources},f=Jb.scheduleRecursive(e,c);return new Ab([b,d,f])},b}(ic),Yc=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 new Xc(a)};bc.concatAll=function(){return this.merge(1)};var Zc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new pb;return b.add(this.source.subscribe(new $c(a,this.maxConcurrent,b))),b},b}(ic),$c=function(a){function b(b,c,d){this.o=b,this.max=c,this.g=d,this.done=!1,this.q=[],this.activeCount=0,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return mb(b,a),b.prototype.handleSubscribe=function(a){var b=new xb;this.g.add(b),ia(a)&&(a=uc(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.next=function(a){this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a)},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,0===this.activeCount&&this.o.onCompleted()},mb(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.q.length>0?this.parent.handleSubscribe(this.parent.q.shift()):(this.parent.activeCount--,this.parent.done&&0===this.parent.activeCount&&this.parent.o.onCompleted())},b}(cc);bc.merge=function(a){return"number"!=typeof a?_c(this,a):new Zc(this,a)};var _c=hc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Fb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=Jb,b=0;d>b;b++)c.push(arguments[b]);else for(a=Jb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),H(a,c).mergeAll()},ad=function(a){function b(b){this.source=b,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new pb,c=new xb;return b.add(c),c.setDisposable(this.source.subscribe(new bd(a,b))),b},b}(ic),bd=function(a){function b(b,c){this.o=b,this.g=c,this.done=!1,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return mb(b,a),b.prototype.next=function(a){var b=new xb;this.g.add(b),ia(a)&&(a=uc(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,1===this.g.length&&this.o.onCompleted()},mb(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.done&&1===this.parent.g.length&&this.parent.o.onCompleted()},b}(cc);bc.mergeAll=function(){return new ad(this)};var cd=ba.CompositeError=function(a){this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};cd.prototype=Object.create(Error.prototype),cd.prototype.name="CompositeError";var dd=function(a){function b(b){this.source=b,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new pb,c=new xb,d={isStopped:!1,errors:[],o:a};return b.add(c),c.setDisposable(this.source.subscribe(new ed(b,d))),b},b}(ic),ed=function(a){function b(b,c){this._group=b,this._state=c,a.call(this)}function c(a,b){0===b.length?a.onCompleted():1===b.length?a.onError(b[0]):a.onError(new cd(b))}function d(b,c,d){this._inner=b,this._group=c,this._state=d,a.call(this)}return mb(b,a),b.prototype.next=function(a){var b=new xb;this._group.add(b),ia(a)&&(a=uc(a)),b.setDisposable(a.subscribe(new d(b,this._group,this._state)))},b.prototype.error=function(a){this._state.errors.push(a),this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},b.prototype.completed=function(){this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},mb(d,a),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.errors.push(a),this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},d.prototype.completed=function(){this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},b}(cc);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=H(null,a);return new dd(d)},bc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return hd([this,a])};var fd=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(a.pos<a.sources.length){var c=a.sources[a.pos++];ia(c)&&(c=uc(c));var d=new xb;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new gd(a,b)))}else a.o.onCompleted()}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new yb,d={pos:0,subscription:b,o:a,sources:this.sources},e=Jb.scheduleRecursive(d,c);return new zb(b,e)},b}(ic),gd=function(a){function b(b,c){this._state=b,this._recurse=c,a.call(this)}return mb(b,a),b.prototype.next=function(a){this._state.o.onNext(a)},b.prototype.error=function(){this._recurse(this._state)},b.prototype.completed=function(){this._recurse(this._state)},b}(cc),hd=hc.onErrorResumeNext=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 fd(a)},id=function(a){function b(b,c){this._s=b,this._o=ia(c)?uc(c):c,this._open=!1,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new xb;b.setDisposable(this._s.subscribe(new jd(a,this))),ia(this._o)&&(this._o=uc(this._o));var c=new xb;return c.setDisposable(this._o.subscribe(new kd(a,this,c))),new zb(b,c)},b}(ic),jd=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return mb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._p._open&&this._o.onCompleted()},b}(cc),kd=function(a){function b(b,c,d){this._o=b,this._p=c,this._r=d,a.call(this)}return mb(b,a),b.prototype.next=function(){this._p._open=!0,this._r.dispose()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._r.dispose()},b}(cc);bc.skipUntil=function(a){return new id(this,a)};var ld=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,cc.call(this)}function d(a,b){this.parent=a,this.id=b,cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){var b=new yb,d=this.source.subscribe(new c(a,b));return new zb(d,b)},mb(c,cc),c.prototype.next=function(a){var b=new xb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ia(a)&&(a=uc(a)),b.setDisposable(a.subscribe(new d(this,c)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.stopped=!0,!this.hasLatest&&this.o.onCompleted()},mb(d,cc),d.prototype.next=function(a){this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.error=function(a){this.parent.latest===this.id&&this.parent.o.onError(a)},d.prototype.completed=function(){this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.stopped&&this.parent.o.onCompleted())},b}(ic);bc["switch"]=bc.switchLatest=function(){return new ld(this)};var md=function(a){function b(b,c){this.source=b,this.other=ia(c)?uc(c):c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return new zb(this.source.subscribe(a),this.other.subscribe(new nd(a)))},b}(ic),nd=function(a){function b(b){this._o=b,a.call(this)}return mb(b,a),b.prototype.next=function(){this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=ca,b}(cc);bc.takeUntil=function(a){return new md(this,a)};var od=function(a){function b(b,c,d){this._s=b,this._ss=c,this._cb=d,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._ss.length,c={hasValue:u(b,K),hasValueAll:!1,values:new Array(b)},d=this._ss.length,e=new Array(d+1),f=0;d>f;f++){var g=this._ss[f],h=new xb;ia(g)&&(g=uc(g)),h.setDisposable(g.subscribe(new pd(a,f,c))),e[f]=h}var i=new xb;return i.setDisposable(this._s.subscribe(new qd(a,this._cb,c))),e[d]=i,new Ab(e)},b}(ic),pd=function(a){function b(b,c,d){this._o=b,this._i=c,this._state=d,a.call(this)}return mb(b,a),b.prototype.next=function(a){this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll=this._state.hasValue.every(da)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=ca,b}(cc),qd=function(a){function b(b,c,d){this._o=b,this._cb=c,this._state=d,a.call(this)}return mb(b,a),b.prototype.next=function(a){var b=[a].concat(this._state.values);if(this._state.hasValueAll){var c=la(this._cb).apply(null,b);return c===ka?this._o.onError(c.e):void this._o.onNext(c)}},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(cc);bc.withLatestFrom=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ja(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new od(this,b,d)};var rd=function(a){function b(b,c){this._s=b,this._cb=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._s.length,c=new Array(b),d=u(b,K),e=u(b,M),f=0;b>f;f++){var g=this._s[f],h=new xb;c[f]=h,ia(g)&&(g=uc(g)),h.setDisposable(g.subscribe(new sd(a,f,this,e,d)))}return new Ab(c)},b}(ic),sd=function(a){function b(b,c,d,e,f){this._o=b,this._i=c,this._p=d,this._q=e,this._d=f,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return mb(b,a),b.prototype.next=function(a){if(this._q[this._i].push(a),this._q.every(c)){var b=this._q.map(d),f=la(this._p._cb).apply(null,b);if(f===ka)return this._o.onError(f.e);this._o.onNext(f)}else this._d.filter(e(this._i)).every(da)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._d[this._i]=!0,this._d.every(da)&&this._o.onCompleted()},b}(cc);bc.zip=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ja(b[a-1])?b.pop():L;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new rd(b,d)},hc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];Array.isArray(b[0])&&(b=ja(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)};var td=function(a){function b(b,c){this.sources=b,this._cb=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){for(var b=this.sources,c=b.length,d=new Array(c),e={q:u(c,M),done:u(c,K),cb:this._cb,o:a},f=0;c>f;f++)!function(a){var c=b[a],f=new xb;(Da(c)||Ca(c))&&(c=Cc(c)),d[a]=f,f.setDisposable(c.subscribe(new ud(e,a)))}(f);return new Ab(d)},b}(ic),ud=function(a){function b(b,c){this._s=b,this._i=c,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return mb(b,a),b.prototype.next=function(a){if(this._s.q[this._i].push(a),this._s.q.every(c)){var b=this._s.q.map(d),f=la(this._s.cb).apply(null,b);if(f===ka)return this._s.o.onError(f.e);this._s.o.onNext(f)}else this._s.done.filter(e(this._i)).every(da)&&this._s.o.onCompleted()},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.done[this._i]=!0,this._s.done.every(da)&&this._s.o.onCompleted()},b}(cc);bc.zipIterable=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ja(b[a-1])?b.pop():L,e=this;return b.unshift(e),new td(b,d)},bc.asObservable=function(){return new Wd(N(this),this)},bc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(O).filter(P)};var vd=function(a){function b(b){this.source=b,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new wd(a))},b}(ic),wd=function(a){function b(b){this._o=b,a.call(this)}return mb(b,a),b.prototype.next=function(a){a.accept(this._o)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(cc);bc.dematerialize=function(){return new vd(this)};var xd=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new yd(a,this.keyFn,this.comparer))},b}(ic),yd=function(a){function b(b,c,d){this.o=b,this.keyFn=c,this.comparer=d,this.hasCurrentKey=!1,this.currentKey=null,a.call(this)}return mb(b,a),b.prototype.next=function(a){var b,c=a;return ja(this.keyFn)&&(c=la(this.keyFn)(a),c===ka)?this.o.onError(c.e):this.hasCurrentKey&&(b=la(this.comparer)(this.currentKey,c),b===ka)?this.o.onError(b.e):void(this.hasCurrentKey&&b||(this.hasCurrentKey=!0,this.currentKey=c,this.o.onNext(a)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.o.onCompleted()},b}(cc);bc.distinctUntilChanged=function(a,b){return b||(b=fa),new xd(this,a,b)};var zd=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||ja(b._oN)?ac(b._oN||ca,b._oE||ca,b._oC||ca):b._oN,this.isStopped=!1,cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},mb(c,cc),c.prototype.next=function(a){var b=la(this.t.onNext).call(this.t,a);b===ka&&this.o.onError(b.e),this.o.onNext(a)},c.prototype.error=function(a){var b=la(this.t.onError).call(this.t,a);return b===ka?this.o.onError(b.e):void this.o.onError(a)},c.prototype.completed=function(){var a=la(this.t.onCompleted).call(this.t);return a===ka?this.o.onError(a.e):void this.o.onCompleted()},b}(ic);bc["do"]=bc.tap=bc.doAction=function(a,b,c){return new zd(this,a,b,c)},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(ca,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},bc.doOnCompleted=bc.tapOnCompleted=function(a,b){return this.tap(ca,null,"undefined"!=typeof b?function(){a.call(b)}:a)};var Ad=function(a){function b(b,c,d){this.source=b,this._fn=Ea(c,d,0),a.call(this)}function c(a,b){this.isDisposed=!1,this._s=a,this._fn=b}return mb(b,a),b.prototype.subscribeCore=function(a){var b=la(this.source.subscribe).call(this.source,a);return b===ka&&(this._fn(),e(b.e)),new c(b,this._fn)},c.prototype.dispose=function(){if(!this.isDisposed){var a=la(this._s.dispose).call(this._s);this._fn(),a===ka&&e(a.e)}},b}(ic);bc["finally"]=function(a,b){return new Ad(this,a,b)};var Bd=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=ca,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())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(ic);bc.ignoreElements=function(){return new Bd(this)};var Cd=function(a){function b(b,c){this.source=b,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Dd(a))},b}(ic),Dd=function(a){function b(b){this._o=b,a.call(this)}return mb(b,a),b.prototype.next=function(a){this._o.onNext(Yb(a))},b.prototype.error=function(a){this._o.onNext(Zb(a)),this._o.onCompleted()},b.prototype.completed=function(){this._o.onNext($b()),this._o.onCompleted()},b}(cc);bc.materialize=function(){return new Cd(this)},bc.repeat=function(a){return oc(this,a).concat()},bc.retry=function(a){return oc(this,a).catchError()},bc.retryWhen=function(a){return oc(this).catchErrorWhen(a)};var Ed=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Fd(a,this))},b}(ic),Fd=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return mb(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=la(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?la(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===ka?this._o.onError(this._a.e):(this._o.onNext(this._a),void this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._hv&&this._hs&&this._o.onNext(this._s),
4this._o.onCompleted()},b}(cc);bc.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Ed(this,c,b,a)};var Gd=function(a){function b(b,c){this.source=b,this._c=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Hd(a,this._c))},b}(ic),Hd=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return mb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._o.onNext(this._q.shift())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(cc);bc.skipLast=function(a){if(0>a)throw new wa;return new Gd(this,a)},bc.startWith=function(){var a,b=0;arguments.length&&Fb(arguments[0])?(a=arguments[0],b=1):a=Jb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return qc([Ec(c,a),this]).concat()};var Id=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return mb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(;this._q.length>0;)this._o.onNext(this._q.shift());this._o.onCompleted()},b}(cc);bc.takeLast=function(a){if(0>a)throw new wa;var b=this;return new Wd(function(c){return b.subscribe(new Id(c,a))},b)};var Jd=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return mb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(cc);bc.takeLastBuffer=function(a){if(0>a)throw new wa;var b=this;return new Wd(function(c){return b.subscribe(new Jd(c,a))},b)},bc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new wa;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new wa;return new Wd(function(d){function e(){var a=new Zd;i.push(a),d.onNext(ob(a,g))}var f=new xb,g=new Bb(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.flatMapConcat=bc.concatMap=function(a,b,c){return new jc(this,a,b,c).merge(1)},bc.concatMapObserver=bc.selectConcatObserver=function(a,b,c,d){var e=this,f=Ea(a,d,2),g=Ea(b,d,1),h=Ea(c,d,0);return new Wd(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ia(d)&&(d=uc(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ia(c)&&(c=uc(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ia(b)&&(b=uc(b)),a.onNext(b),a.onCompleted()})},this).concatAll()};var Kd=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return mb(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(this._d),this._o.onCompleted()},b}(cc);bc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Wd(function(a){return c.subscribe(new Kd(a,b))},c)},R.prototype.push=function(a){var b=-1===Q(this.set,a,this.comparer);return b&&this.set.push(a),b};var Ld=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Md(a,this._keyFn,this._cmpFn))},b}(ic),Md=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new R(d),a.call(this)}return mb(b,a),b.prototype.next=function(a){var b=a;return ja(this._keyFn)&&(b=la(this._keyFn)(a),b===ka)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(cc);bc.distinct=function(a,b){return b||(b=fa),new Ld(this,a,b)};var Nd=function(a){function b(b,c,d){this.source=b,this.selector=Ea(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,cc.call(this)}return mb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},mb(d,cc),d.prototype.next=function(a){var b=la(this.selector)(a,this.i++,this.source);return b===ka?this.o.onError(b.e):void this.o.onNext(b)},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(ic);bc.map=bc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Nd?this.internalMap(c,b):new Nd(this,c,b)},bc.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error("List of properties cannot be empty.");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(S(b,a))},bc.flatMap=bc.selectMany=function(a,b,c){return new jc(this,a,b,c).mergeAll()},bc.flatMapObserver=bc.selectManyObserver=function(a,b,c,d){var e=this;return new Wd(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)}ia(c)&&(c=uc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ia(c)&&(c=uc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ia(a)&&(a=uc(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},ba.Observable.prototype.flatMapLatest=function(a,b,c){return new jc(this,a,b,c).switchLatest()};var Od=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._r=b,cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},mb(c,cc),c.prototype.next=function(a){this._r<=0?this._o.onNext(a):this._r--},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(ic);bc.skip=function(a){if(0>a)throw new wa;return new Od(this,a)};var Pd=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Qd(a,this))},b}(ic),Qd=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!1,a.call(this)}return mb(b,a),b.prototype.next=function(a){if(!this._r){var b=la(this._p._fn)(a,this._i++,this._p);if(b===ka)return this._o.onError(b.e);this._r=!b}this._r&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(cc);bc.skipWhile=function(a,b){var c=Ea(a,b,3);return new Pd(this,c)};var Rd=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._c=b,this._r=b,cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},mb(c,cc),c.prototype.next=function(a){this._r-->0&&(this._o.onNext(a),this._r<=0&&this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(ic);bc.take=function(a,b){if(0>a)throw new wa;return 0===a?zc(b):new Rd(this,a)};var Sd=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Td(a,this))},b}(ic),Td=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!0,a.call(this)}return mb(b,a),b.prototype.next=function(a){return this._r&&(this._r=la(this._p._fn)(a,this._i++,this._p),this._r===ka)?this._o.onError(this._r.e):void(this._r?this._o.onNext(a):this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(cc);bc.takeWhile=function(a,b){var c=Ea(a,b,3);return new Sd(this,c)};var Ud=function(a){function b(b,c,d){this.source=b,this.predicate=Ea(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,cc.call(this)}return mb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},mb(d,cc),d.prototype.next=function(a){var b=la(this.predicate)(a,this.i++,this.source);return b===ka?this.o.onError(b.e):void(b&&this.o.onNext(a))},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(ic);bc.filter=bc.where=function(a,b){return this instanceof Ud?this.internalFilter(a,b):new Ud(this,a,b)};var Vd=function(a){function b(b,c){this._o=b,this._xform=c,a.call(this)}return mb(b,a),b.prototype.next=function(a){var b=la(this._xform["@@transducer/step"]).call(this._xform,this._o,a);b===ka&&this._o.onError(b.e)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._xform["@@transducer/result"](this._o)},b}(cc);bc.transduce=function(a){var b=this;return new Wd(function(c){var d=a(T(c));return b.subscribe(new Vd(c,d))},b)};var Wd=ba.AnonymousObservable=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?sb(a):tb}function c(a,c){var d=c[0],f=c[1],g=la(f.__subscribe).call(f,d);g!==ka||d.fail(ka.e)||e(ka.e),d.setDisposable(b(g))}function d(b,c){this.source=c,this.__subscribe=b,a.call(this)}return mb(d,a),d.prototype._subscribe=function(a){var b=new Xd(a),d=[b,this];return Lb.scheduleRequired()?Lb.schedule(d,c):c(null,d),b},d}(hc),Xd=function(a){function b(b){a.call(this),this.observer=b,this.m=new xb}mb(b,a);var c=b.prototype;return c.next=function(a){var b=la(this.observer.onNext).call(this.observer,a);b===ka&&(this.dispose(),e(b.e))},c.error=function(a){var b=la(this.observer.onError).call(this.observer,a);this.dispose(),b===ka&&e(b.e)},c.completed=function(){var a=la(this.observer.onCompleted).call(this.observer);this.dispose(),a===ka&&e(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(cc),Yd=function(a,b){this._s=a,this._o=b};Yd.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var Zd=ba.Subject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return mb(b,a),nb(b.prototype,_b.prototype,{_subscribe:function(a){return vb(this),this.isStopped?this.hasError?(a.onError(this.error),tb):(a.onCompleted(),tb):(this.observers.push(a),new Yd(this,a))},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(vb(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=c(this.observers),d=b.length;d>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(vb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){if(vb(this),!this.isStopped)for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),b.create=function(a,b){return new $d(a,b)},b}(hc),$d=(ba.AsyncSubject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return mb(b,a),nb(b.prototype,_b.prototype,{_subscribe:function(a){return vb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),tb):(this.observers.push(a),new Yd(this,a))},hasObservers:function(){return vb(this),this.observers.length>0},onCompleted:function(){var a,b;if(vb(this),!this.isStopped){this.isStopped=!0;var d=c(this.observers),b=d.length;if(this.hasValue)for(a=0;b>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;b>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(vb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){vb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),b}(hc),ba.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return mb(b,a),nb(b.prototype,_b.prototype,{_subscribe:function(a){return this.observable.subscribe(a)},onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(hc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(aa.Rx=ba,define(function(){return ba})):V&&W?$?(W.exports=ba).Rx=ba:V.Rx=ba:aa.Rx=ba;var _d=j()}).call(this);
5//# sourceMappingURL=rx.compat.map
\No newline at end of file