text: /* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
  (function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(a,b){if(ea&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ia)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+ia+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===ga&&d>=ha&&Ec>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ea)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ga=d[0],d[1]}}function h(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 i(a){var b=[];if(!Ra(a))return b;Qa.nonEnumArgs&&a.length&&Sa(a)&&(a=Va.call(a));var c=Qa.enumPrototypes&&"function"==typeof a,d=Qa.enumErrorProps&&(a===La||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Qa.nonEnumShadows&&a!==Ma){var f=a.constructor,g=-1,h=xa;if(a===(f&&f.prototype))var i=a===Na?Ha:a===La?Ca:Ia.call(a),j=Pa[i];for(;++g<h;)e=wa[g],j&&j[e]||!Ja.call(a,e)||b.push(e)}return b}function j(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 k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(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=Ia.call(a),h=Ia.call(b);if(g==ya&&(g=Fa),h==ya&&(h=Fa),g!=h)return!1;switch(g){case Aa:case Ba:return+a==+b;case Ea:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ga:case Ha:return a==String(b)}var i=g==za;if(!i){if(g!=Fa||!Qa.nodeClass&&(l(a)||l(b)))return!1;var j=!Qa.argsObject&&Sa(a)?Object:a.constructor,n=!Qa.argsObject&&Sa(b)?Object:b.constructor;if(!(j==n||Ja.call(a,"constructor")&&Ja.call(b,"constructor")||da(j)&&j instanceof j&&da(n)&&n instanceof n||!("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=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Ja.call(f,e)?(p++,q=Ja.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Ja.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Ta.apply(this,arguments)}catch(a){return Za.e=a,Za}}function p(a){if(!da(a))throw new TypeError("fn must be a function");return Ta=a,o}function q(a){throw a}function r(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function s(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function t(a){this._s=a}function u(a){this._s=a,this._l=a.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&W.isFinite(a)}function y(b){var c,d=b[qa];if(!d&&"string"==typeof b)return c=new t(b),c[qa]();if(!d&&b.length!==a)return c=new v(b),c[qa]();if(!d)throw new TypeError("Object is not iterable");return b[qa]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>Wb?Wb:b):b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return lb(a)||(a=pb),new Yb(b,a)}function D(a,b){this.observer=a,this.parent=b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return new zc(function(c){var d=new fb,e=new gb;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)}ca(d)&&(d=Qb(d));var g=new fb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function G(){return!1}function H(a,b){var c=this;return new zc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g=a[e++],h=p(b)(c,g);if(h===Za)return d.onError(h.e);d.onNext(h)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function G(){return!1}function I(){return[]}function G(){return!1}function J(){return[]}function K(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function L(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Qb(e)),(ta(e)||sa(e))&&(e=Xb(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){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Qb(e)),(ta(e)||sa(e))&&(e=Xb(e)),e}).mergeAll()}var P={"function":!0,object:!0},Q=P[typeof exports]&&exports&&!exports.nodeType&&exports,R=P[typeof self]&&self.Object&&self,S=P[typeof window]&&window&&window.Object&&window,T=P[typeof module]&&module&&!module.nodeType&&module,U=T&&T.exports===Q&&Q,V=Q&&T&&"object"==typeof global&&global&&global.Object&&global,W=W=V||S!==(this&&this.window)&&S||R||this,X={internals:{},config:{Promise:W.Promise},helpers:{}},Y=X.helpers.noop=function(){},Z=(X.helpers.notDefined=function(a){return"undefined"==typeof a},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=Date.now),_=X.helpers.defaultComparer=function(a,b){return Ua(a,b)},aa=X.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ba=(X.helpers.defaultKeySerializer=function(a){return a.toString()},X.helpers.defaultError=function(a){throw a}),ca=X.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},da=(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]"==Ia.call(a)}),a}());X.config.longStackSupport=!1;var ea=!1;try{throw new Error}catch(fa){ea=!!fa.stack}var ga,ha=g(),ia="From previous event:",ja=X.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ja.prototype=Error.prototype;var ka=X.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};ka.prototype=Error.prototype;var la=X.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};la.prototype=Error.prototype;var ma=X.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ma.prototype=Error.prototype;var na=X.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};na.prototype=Error.prototype;var oa=X.helpers.notImplemented=function(){throw new na},pa=X.helpers.notSupported=function(){throw new ma},qa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";W.Set&&"function"==typeof(new W.Set)["@@iterator"]&&(qa="@@iterator");var ra=X.doneEnumerator={done:!0,value:a},sa=X.helpers.isIterable=function(b){return b[qa]!==a},ta=X.helpers.isArrayLike=function(b){return b&&b.length!==a};X.helpers.iterator=qa;var ua,va=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)}},wa=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xa=wa.length,ya="[object Arguments]",za="[object Array]",Aa="[object Boolean]",Ba="[object Date]",Ca="[object Error]",Da="[object Function]",Ea="[object Number]",Fa="[object Object]",Ga="[object RegExp]",Ha="[object String]",Ia=Object.prototype.toString,Ja=Object.prototype.hasOwnProperty,Ka=Ia.call(arguments)==ya,La=Error.prototype,Ma=Object.prototype,Na=String.prototype,Oa=Ma.propertyIsEnumerable;try{ua=!(Ia.call(document)==Fa&&!({toString:0}+""))}catch(fa){ua=!0}var Pa={};Pa[za]=Pa[Ba]=Pa[Ea]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Pa[Aa]=Pa[Ha]={constructor:!0,toString:!0,valueOf:!0},Pa[Ca]=Pa[Da]=Pa[Ga]={constructor:!0,toString:!0},Pa[Fa]={constructor:!0};var Qa={};!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);Qa.enumErrorProps=Oa.call(La,"message")||Oa.call(La,"name"),Qa.enumPrototypes=Oa.call(a,"prototype"),Qa.nonEnumArgs=0!=c,Qa.nonEnumShadows=!/valueOf/.test(b)}(1);var Ra=X.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Sa=function(a){return a&&"object"==typeof a?Ia.call(a)==ya:!1};Ka||(Sa=function(a){return a&&"object"==typeof a?Ja.call(a,"callee"):!1});var Ta,Ua=X.internals.isEqual=function(a,b){return m(a,b,[],[])},Va=({}.hasOwnProperty,Array.prototype.slice),Wa=this.inherits=X.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Xa=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]}},Ya=X.internals.addRef=function(a,b){return new zc(function(c){return new $a(b.getDisposable(),a.subscribe(c))})},Za={e:{}},$a=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(!db(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},_a=$a.prototype;_a.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},_a.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},_a.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 ab=X.Disposable=function(a){this.isDisposed=!1,this.action=a||Y};ab.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var bb=ab.create=function(a){return new ab(a)},cb=ab.empty={dispose:Y},db=ab.isDisposable=function(a){return a&&da(a.dispose)},eb=ab.checkDisposed=function(a){if(a.isDisposed)throw new ka},fb=X.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};fb.prototype.getDisposable=function(){return this.current},fb.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()},fb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var gb=X.SerialDisposable=function(){this.isDisposed=!1,this.current=null};gb.prototype.getDisposable=function(){return this.current},gb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},gb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var hb=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?cb:new a(this)},b}();r.prototype.dispose=function(){this.scheduler.scheduleWithState(this,s)};var ib=X.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||aa,this.disposable=new fb};ib.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ib.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},ib.prototype.isCancelled=function(){return this.disposable.isDisposed},ib.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var jb=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(),cb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=$,a.normalize=function(a){return 0>a&&(a=0),a},a}(),kb=jb.normalize,lb=jb.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),cb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new $a;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),cb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new $a;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,d)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,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([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(jb.prototype),function(a){jb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},jb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof W.setInterval)throw new ma;b=kb(b);var d=a,e=W.setInterval(function(){d=c(d)},b);return bb(function(){W.clearInterval(e)})}}(jb.prototype),function(a){a.catchError=a["catch"]=function(a){return new tb(this,a)}}(jb.prototype);var mb,nb,ob=(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 fb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),jb.immediate=function(){function a(a,b){return b(this,a)}return new jb($,a,pa,pa)}()),pb=jb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new ib(this,b,d,this.now());if(c)c.push(e);else{c=[e];var f=p(a)();if(c=null,f===Za)return q(f.e)}return e.disposable}var c,d=new jb($,b,pa,pa);return d.scheduleRequired=function(){return!c},d}(),qb=function(){var a,b=Y;if(W.setTimeout)a=W.setTimeout,b=W.clearTimeout;else{if(!W.WScript)throw new ma;a=function(a,b){W.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),rb=qb.setTimeout,sb=qb.clearTimeout;!function(){function a(b){if(f)rb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(nb(b),f=!1,d===Za)return q(d.e)}}}function b(){if(!W.postMessage||W.importScripts)return!1;var a=!1,b=W.onmessage;return W.onmessage=function(){a=!0},W.postMessage("","*"),W.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;nb=function(a){delete e[a]};var g=RegExp("^"+String(Ia).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=V&&U&&V.setImmediate)&&!g.test(h)&&h;if(da(h))mb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))mb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();W.addEventListener?W.addEventListener("message",c,!1):W.attachEvent?W.attachEvent("onmessage",c):W.onmessage=c,mb=function(a){var b=d++;return e[b]=a,W.postMessage(i+currentId,"*"),b}}else if(W.MessageChannel){var j=new W.MessageChannel;j.port1.onmessage=function(b){a(b.data)},mb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else mb="document"in W&&"onreadystatechange"in W.document.createElement("script")?function(b){var c=W.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},W.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,rb(function(){a(c)},0),c}}();var tb=(jb.timeout=jb["default"]=function(){function a(a,b){var c=this,d=new fb,e=mb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new $a(d,bb(function(){nb(e)}))}function b(a,b,c){var d=this,e=jb.normalize(b),f=new fb;if(0===e)return d.scheduleWithState(a,c);var g=rb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new $a(f,bb(function(){sb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new jb($,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 Wa(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 cb}}},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 fb;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}(jb)),ub=X.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return lb(a)||(a=ob),new zc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),vb=ub.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new ub("N",d,null,a,b,c)}}(),wb=ub.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new ub("E",null,d,a,b,c)}}(),xb=ub.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new ub("C",null,null,a,b,c)}}(),yb=X.Observer=function(){};yb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},yb.prototype.asObserver=function(){var a=this;return new Cb(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},yb.prototype.checked=function(){return new Db(this)};var zb=yb.create=function(a,b,c){return a||(a=Y),b||(b=ba),c||(c=Y),new Cb(a,b,c)};yb.fromNotifier=function(a,b){var c=va(a,b,1);return new Cb(function(a){return c(vb(a))},function(a){return c(wb(a))},function(){return c(xb())})},yb.prototype.notifyOn=function(a){return new Fb(a,this)},yb.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Ab,Bb=X.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Wa(b,a),b.prototype.next=oa,b.prototype.error=oa,b.prototype.completed=oa,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}(yb),Cb=X.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Wa(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}(Bb),Db=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Wa(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Za&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Za&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Za&&q(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}(yb),Eb=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 gb}return Wa(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}(Bb),Fb=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Wa(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}(Eb),Gb=X.Observable=function(){function a(a){if(X.config.longStackSupport&&ea){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Ab=a.prototype,Ab.isObservable=function(a){return a&&da(a.subscribe)},Ab.subscribe=Ab.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:zb(a,b,c))},Ab.subscribeOnNext=function(a,b){return this._subscribe(zb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Ab.subscribeOnError=function(a,b){return this._subscribe(zb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Ab.subscribeOnCompleted=function(a,b){return this._subscribe(zb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Hb=X.ObservableBase=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?bb(a):cb}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(a){var b=new Ac(a),d=[b,this];return pb.scheduleRequired()?pb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Wa(e,a),e.prototype.subscribeCore=oa,e}(Gb),Ib=X.internals.Enumerable=function(){},Jb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b,d=new gb,e=ob.scheduleRecursiveWithState(this.sources[qa](),function(e,f){if(!b){var g=p(e.next).call(e);if(g===Za)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;ca(h)&&(h=Qb(h));var i=new fb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new $a(d,e,bb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Hb);Ib.prototype.concat=function(){return new Jb(this)};var Kb=function(a){function b(b){this.sources=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[qa](),d=new gb,e=ob.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=p(c.next).call(c);if(g===Za)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;ca(h)&&(h=Qb(h));var i=new fb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new $a(d,e,bb(function(){b=!0}))},b}(Hb);Ib.prototype.catchError=function(){return new Kb(this)},Ib.prototype.catchErrorWhen=function(a){var b=this;return new zc(function(c){var d,e,f=new Cc,g=new Cc,h=a(f),i=h.subscribe(g),j=b[qa](),k=new gb,l=ob.scheduleRecursive(function(a){if(!d){var b=p(j.next).call(j);if(b===Za)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;ca(h)&&(h=Qb(h));var i=new fb,l=new fb;k.setDisposable(new $a(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new $a(i,k,l,bb(function(){d=!0}))})};var Lb=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 Wa(b,a),b.prototype[qa]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?ra:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Ib),Mb=Ib.repeat=function(a,b){return new Lb(a,b)},Nb=function(a){function b(a,b,c){this.s=a,this.fn=b?va(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Wa(b,a),b.prototype[qa]=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]}:ra},b}(Ib),Ob=Ib.of=function(a,b,c){return new Nb(a,b,c)};Ab.observeOn=function(a){var b=this;return new zc(function(c){return b.subscribe(new Fb(a,c))},b)},Ab.subscribeOn=function(a){var b=this;return new zc(function(c){var d=new fb,e=new gb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new r(a,b.subscribe(c)))})),e},b)};var Pb=function(a){function b(b){this.p=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),cb},b}(Hb),Qb=Gb.fromPromise=function(a){return new Pb(a)};Ab.toPromise=function(a){if(a||(a=X.config.Promise),!a)throw new ma("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 Rb=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Hb);Ab.toArray=function(){return new Rb(this)},Gb.create=Gb.createWithDisposable=function(a,b){return new zc(a,b)};var Sb=(Gb.defer=function(a){return new zc(function(b){var c;try{c=a()}catch(d){return gc(d).subscribe(b)}return ca(c)&&(c=Qb(c)),c.subscribe(b)})},function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(Hb)),Tb=Gb.empty=function(a){return lb(a)||(a=ob),new Sb(a)},Ub=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new Vb(a,this);return b.run()},b}(Hb),Vb=function(){function a(a,b){this.o=a,this.parent=b}return a.prototype.run=function(){function a(a,b){var f=p(c.next).call(c);if(f===Za)return d.onError(f.e);if(f.done)return d.onCompleted();var g=f.value;return da(e)&&(g=p(e)(g,a),g===Za)?d.onError(g.e):(d.onNext(g),void b(a+1))}var b=Object(this.parent.iterable),c=y(b),d=this.o,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Wb=Math.pow(2,53)-1;t.prototype[qa]=function(){return new u(this._s)},u.prototype[qa]=function(){return this},u.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ra},v.prototype[qa]=function(){return new w(this._a)},w.prototype[qa]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ra};var Xb=Gb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!da(b))throw new Error("mapFn when provided must be a function");if(b)var e=va(b,c,2);return lb(d)||(d=pb),new Ub(a,e,d)},Yb=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Hb);B.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 Zb=Gb.fromArray=function(a,b){return lb(b)||(b=pb),new Yb(a,b)};Gb.generate=function(a,b,c,d,e){return lb(e)||(e=pb),new zc(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var $b=function(a){function b(){a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return cb},b}(Hb),_b=Gb.never=function(){return new $b};Gb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Yb(b,pb)},Gb.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 Yb(c,a)};var ac=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Hb);D.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Gb.pairs=function(a,b){return b||(b=pb),new ac(a,b)};var bc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new cc(a,this);return b.run()},b}(Hb),cc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Gb.range=function(a,b,c){return lb(c)||(c=pb),new bc(a,b,c)};var dc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Hb);E.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Gb.repeat=function(a,b,c){return lb(c)||(c=pb),new dc(a,b,c)};var ec=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(Hb),fc=(Gb["return"]=Gb.just=function(a,b){return lb(b)||(b=ob),new ec(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Hb)),gc=Gb["throw"]=Gb.throwError=function(a,b){return lb(b)||(b=ob),new fc(a,b)};Gb.using=function(a,b){return new zc(function(c){var d,e,f=cb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new $a(gc(g).subscribe(c),f)}return new $a(e.subscribe(c),f)})},Ab.amb=function(a){var b=this;return new zc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new fb,j=new fb;return ca(a)&&(a=Qb(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 $a(i,j)})},Gb.amb=function(){function a(a,b){return a.amb(b)}var b=_b(),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},Ab["catch"]=Ab.catchError=function(a){return"function"==typeof a?F(this,a):hc([this,a])};var hc=Gb.catchError=Gb["catch"]=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 Ob(a).catchError()};Ab.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),ic.apply(this,b)};var ic=Gb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new zc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Z))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Z)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new fb;ca(f)&&(f=Qb(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new $a(l)},this)};Ab.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),kc.apply(null,a)};var jc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new gb,c=this.sources,d=c.length,e=this.o,f=ob.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ca(h)&&(h=Qb(h));var i=new fb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new $a(b,f,bb(function(){a=!0}))},b}(Hb),kc=Gb.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 jc(a)};Ab.concatAll=Ab.concatObservable=function(){return this.merge(1)};var lc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new $a;return b.add(this.source.subscribe(new mc(a,this.maxConcurrent,b))),b},b}(Hb),mc=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 fb;this.g.add(c),ca(a)&&(a=Qb(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Ab.merge=function(a){return"number"!=typeof a?nc(this,a):new lc(this,a)};var nc=Gb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(lb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=ob,b=0;d>b;b++)c.push(arguments[b]);else for(a=ob,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),C(a,c).mergeAll()},oc=X.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};oc.prototype=Error.prototype,Gb.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=C(null,a);return new zc(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new oc(g))}var c=new $a,e=new fb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new fb;c.add(e),ca(d)&&(d=Qb(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})};var pc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new $a,d=new fb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new fb;this.g.add(b),ca(a)&&(a=Qb(a)),b.setDisposable(a.subscribe(new d(this,this.g,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Hb);Ab.mergeAll=Ab.mergeObservable=function(){return new pc(this)},Ab.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return qc([this,a])};var qc=Gb.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new zc(function(b){var c=0,d=new gb,e=ob.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ca(f)&&(f=Qb(f)),g=new fb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new $a(d,e)})};Ab.skipUntil=function(a){var b=this;return new zc(function(c){var d=!1,e=new $a(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ca(a)&&(a=Qb(a));var f=new fb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var rc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new gb,d=this.source.subscribe(new c(a,b));return new $a(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new fb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ca(a)&&(a=Qb(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Hb);Ab["switch"]=Ab.switchLatest=function(){return new rc(this)};var sc=function(a){function b(b,c){this.source=b,this.other=ca(c)?Qb(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return new $a(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Hb);Ab.takeUntil=function(a){return new sc(this,a)},Ab.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new zc(function(a){for(var c=b.length,f=n(c,G),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new fb;ca(d)&&(d=Qb(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(Z)},function(b){a.onError(b)},Y)),i[c]=e}(j);var k=new fb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=p(d).apply(null,c);return e===Za?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new $a(i)},this)},Ab.zip=function(){if(Array.isArray(arguments[0]))return H.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 zc(function(a){for(var c=b.length,f=n(c,I),g=n(c,G),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new fb;ca(i)&&(i=Qb(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=p(e).apply(d,h);if(i===Za)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(Z)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(Z)&&a.onCompleted()})),h[c]=j}(i);return new $a(h)},d)},Gb.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)},Gb.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 zc(function(b){for(var c=a.length,d=n(c,J),e=n(c,G),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new fb,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(Z))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(Z)&&b.onCompleted()}))}(g);return new $a(f)})},Ab.asObservable=function(){var a=this;return new zc(function(b){return a.subscribe(b)},a)},Ab.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})},Ab.dematerialize=function(){var a=this;return new zc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Ab.distinctUntilChanged=function(a,b){var c=this;return b||(b=_),new zc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a&&(g=p(a)(c),g===Za))return d.onError(g.e);if(f){var h=p(b)(e,g);if(h===Za)return d.onError(h.e)}f&&h||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var tc=function(a){function b(b,c,d,e){this.source=b,this.t=!c||da(c)?zb(c||Y,d||Y,e||Y):c,a.call(this)}function c(a,b){this.o=a,this.t=b,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.t))},c.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.t.onNext).call(this.t,a);b===Za&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=p(this.t.onError).call(this.t,a);if(b===Za)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=p(this.t.onCompleted).call(this.t);if(a===Za)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Hb);Ab["do"]=Ab.tap=Ab.doAction=function(a,b,c){return new tc(this,a,b,c)},Ab.doOnNext=Ab.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Ab.doOnError=Ab.tapOnError=function(a,b){return this.tap(Y,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Ab.doOnCompleted=Ab.tapOnCompleted=function(a,b){return this.tap(Y,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Ab["finally"]=Ab.ensure=function(a){var b=this;return new zc(function(c){var d=p(b.subscribe).call(b,c);return d===Za?(a(),q(d.e)):bb(function(){var b=p(d.dispose).call(d);a(),b===Za&&q(b.e)})},this)};var uc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Y,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}(Hb);Ab.ignoreElements=function(){return new uc(this)},Ab.materialize=function(){var a=this;return new zc(function(b){return a.subscribe(function(a){b.onNext(vb(a))},function(a){b.onNext(wb(a)),b.onCompleted()},function(){b.onNext(xb()),b.onCompleted()})},a)},Ab.repeat=function(a){return Mb(this,a).concat()},Ab.retry=function(a){return Mb(this,a).catchError()},Ab.retryWhen=function(a){return Mb(this).catchErrorWhen(a)};var vc=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new K(a,this))},b}(Hb);K.prototype={onNext:function(a){return this.isStopped?void 0:(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.accumulation=p(this.accumulator)(this.accumulation,a):(this.accumulation=this.hasSeed?p(this.accumulator)(this.seed,a):a,this.hasAccumulation=!0),this.accumulation===Za?this.o.onError(this.accumulation.e):void this.o.onNext(this.accumulation))},onError:function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},onCompleted:function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)}},Ab.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new vc(this,c,b,a)},Ab.skipLast=function(a){if(0>a)throw new la;var b=this;return new zc(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)},Ab.startWith=function(){var a,b=0;arguments.length&&lb(arguments[0])?(a=arguments[0],b=1):a=ob;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Ob([Zb(c,a),this]).concat()},Ab.takeLast=function(a){if(0>a)throw new la;var b=this;return new zc(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)},Ab.takeLastBuffer=function(a){var b=this;return new zc(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)},Ab.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new la;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new la;return new zc(function(d){function e(){var a=new Cc;i.push(a),d.onNext(Ya(a,g))}var f=new fb,g=new hb(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)},Ab.selectConcat=Ab.concatMap=function(a,b,c){return da(a)&&da(b)?this.concatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Qb(e)),(ta(e)||sa(e))&&(e=Xb(e)),e.map(function(a,e){return b(c,a,d,e)})}):da(a)?L(this,a,c):L(this,function(){return a})},Ab.concatMapObserver=Ab.selectConcatObserver=function(a,b,c,d){var e=this,f=va(a,d,2),g=va(b,d,1),h=va(c,d,0);return new zc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ca(d)&&(d=Qb(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ca(c)&&(c=Qb(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ca(b)&&(b=Qb(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Ab.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new zc(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},Ab.distinct=function(a,b){var c=this;return b||(b=_),new zc(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 wc=function(a){function b(b,c,d){this.source=b,this.selector=va(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,this.isStopped=!1}return Wa(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))},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector)(a,this.i++,this.source);return b===Za?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Hb);Ab.map=Ab.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof wc?this.internalMap(c,b):new wc(this,c,b)},Ab.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})},Ab.flatMapObserver=Ab.selectManyObserver=function(a,b,c,d){var e=this;return new zc(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)}ca(c)&&(c=Qb(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ca(c)&&(c=Qb(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ca(a)&&(a=Qb(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Ab.selectMany=Ab.flatMap=function(a,b,c){return da(a)&&da(b)?this.flatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Qb(e)),(ta(e)||sa(e))&&(e=Xb(e)),e.map(function(a,e){return b(c,a,d,e)})},c):da(a)?O(this,a,c):O(this,function(){return a})},Ab.selectSwitch=Ab.flatMapLatest=Ab.switchMap=function(a,b){return this.select(a,b).switchLatest()};var xc=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},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.o.onError(a),!0)},b}(Hb);Ab.skip=function(a){if(0>a)throw new la;return new xc(this,a)},Ab.skipWhile=function(a,b){var c=this,d=va(a,b,3);return new zc(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)},Ab.take=function(a,b){if(0>a)throw new la;if(0===a)return Tb(b);var c=this;return new zc(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)},Ab.takeWhile=function(a,b){var c=this,d=va(a,b,3);return new zc(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 yc=function(a){function b(b,c,d){this.source=b,this.predicate=va(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,this.isStopped=!1}return Wa(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)},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate)(a,this.i++,this.source);return b===Za?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Hb);Ab.filter=Ab.where=function(a,b){return this instanceof yc?this.internalFilter(a,b):new yc(this,a,b)},Ab.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new zc(function(d){var e=a(b(d));return c.subscribe(function(a){var b=p(e["@@transducer/step"]).call(e,d,a);b===Za&&d.onError(b.e)},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var zc=X.AnonymousObservable=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?bb(a):cb}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(b,d){function e(a){var d=new Ac(a),e=[d,b];return pb.scheduleRequired()?pb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Wa(d,a),d}(Gb),Ac=function(a){function b(b){a.call(this),this.observer=b,this.m=new fb}Wa(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===Za&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Za&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Za&&q(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}(Bb),Bc=function(a,b){this.subject=a,this.observer=b};Bc.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 Cc=X.Subject=function(a){function c(a){return eb(this),this.isStopped?this.hasError?(a.onError(this.error),cb):(a.onCompleted(),cb):(this.observers.push(a),new Bc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,yb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(eb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(eb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(eb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Dc(a,b)},d}(Gb),Dc=(X.AsyncSubject=function(a){function c(a){return eb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),cb):(this.observers.push(a),new Bc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,yb,{hasObservers:function(){return eb(this),this.observers.length>0},onCompleted:function(){var a,c;if(eb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(eb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){eb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Gb),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 Wa(c,a),Xa(c.prototype,yb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Gb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(W.Rx=X,define(function(){return X})):Q&&T?U?(T.exports=X).Rx=X:Q.Rx=X:W.Rx=X;var Ec=g()}).call(this);
  //# sourceMappingURL=rx.map