5 lines
66 KiB
JavaScript
5 lines
66 KiB
JavaScript
/* 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=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}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&&Ic>=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.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this._s=s}function w(a){this._s=s,this._l=s.length,this._i=0}function x(a){this._a=a}function y(a){this._a=a,this._l=C(a),this._i=0}function z(a){return"number"==typeof a&&S.isFinite(a)}function A(b){var c,d=b[qa];if(!d&&"string"==typeof b)return c=new v(b),c[qa]();if(!d&&b.length!==a)return c=new x(b),c[qa]();if(!d)throw new TypeError("Object is not iterable");return b[qa]()}function B(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function C(a){var b=+a.length;return isNaN(b)?0:0!==b&&z(b)?(b=B(b)*Math.floor(Math.abs(b)),0>=b?0:b>$b?$b:b):b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return pb(a)||(a=tb),new ac(b,a)}function F(a,b){this.observer=a,this.parent=b}function G(a,b){this.observer=a,this.parent=b}function H(a,b){return new Dc(function(c){var d=new jb,e=new kb;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=Ub(d));var g=new jb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function I(){return!1}function J(a,b){var c=this;return new Dc(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 I(){return!1}function K(){return[]}function I(){return!1}function L(){return[]}function M(a,b){this.observer=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 N(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=Ub(e)),(ta(e)||sa(e))&&(e=_b(e)),e}).concatAll()}function O(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function P(a){this.comparer=a,this.set=[]}function Q(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=Ub(e)),(ta(e)||sa(e))&&(e=_b(e)),e}).mergeAll()}var R={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},S=R[typeof window]&&window||this,T=R[typeof exports]&&exports&&!exports.nodeType&&exports,U=R[typeof module]&&module&&!module.nodeType&&module,V=U&&U.exports===T&&T,W=R[typeof global]&&global;!W||W.global!==W&&W.window!==W||(S=W);var X={internals:{},config:{Promise:S.Promise},helpers:{}},Y=X.helpers.noop=function(){},Z=(X.helpers.notDefined=function(a){return"undefined"==typeof a},X.helpers.identity=function(a){return a}),$=(X.helpers.pluck=function(a){return function(b){return b[a]}},X.helpers.just=function(a){return function(){return a}},X.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),_=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_";S.Set&&"function"==typeof(new S.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 Dc(function(c){return new cb(b.getDisposable(),a.subscribe(c))})},Za={e:{}};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Va.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Va.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Va.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var $a=Object("a"),_a="a"!=$a[0]||!(0 in $a);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=_a&&{}.toString.call(this)==Ha?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Da)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=_a&&{}.toString.call(this)==Ha?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Da)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==za}),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;xa>e;e++)a.call(c,wa[e])&&f.push(wa[e]);return f}}()),r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var ab=X.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},bb=ab.prototype;bb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},bb.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)}}},bb.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)}}},bb.peek=function(){return this.items[0].value},bb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},bb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},bb.enqueue=function(a){var b=this.length++;this.items[b]=new r(ab.count++,a),this.percolate(b)},bb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},ab.count=0;var cb=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(!hb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},db=cb.prototype;db.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},db.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},db.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 eb=X.Disposable=function(a){this.isDisposed=!1,this.action=a||Y};eb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var fb=eb.create=function(a){return new eb(a)},gb=eb.empty={dispose:Y},hb=eb.isDisposable=function(a){return a&&da(a.dispose)},ib=eb.checkDisposed=function(a){if(a.isDisposed)throw new ka},jb=X.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};jb.prototype.getDisposable=function(){return this.current},jb.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()},jb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var kb=X.SerialDisposable=function(){this.isDisposed=!1,this.current=null};kb.prototype.getDisposable=function(){return this.current},kb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},kb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var lb=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?gb:new a(this)},b}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var mb=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 jb};mb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},mb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},mb.prototype.isCancelled=function(){return this.disposable.isDisposed},mb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var nb=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(),gb}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}(),ob=nb.normalize,pb=nb.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),gb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new cb;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),gb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new cb;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")})}}(nb.prototype),function(a){nb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},nb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof S.setInterval)throw new ma;b=ob(b);var d=a,e=S.setInterval(function(){d=c(d)},b);return fb(function(){S.clearInterval(e)})}}(nb.prototype),function(a){a.catchError=a["catch"]=function(a){return new xb(this,a)}}(nb.prototype);var qb,rb,sb=(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 jb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),nb.immediate=function(){function a(a,b){return b(this,a)}return new nb($,a,pa,pa)}()),tb=nb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new mb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new ab(4),c.enqueue(e);var f=p(a)();if(c=null,f===Za)return q(f.e)}return e.disposable}var c,d=new nb($,b,pa,pa);return d.scheduleRequired=function(){return!c},d}(),ub=function(){var a,b=Y;if(S.setTimeout)a=S.setTimeout,b=S.clearTimeout;else{if(!S.WScript)throw new ma;a=function(a,b){S.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),vb=ub.setTimeout,wb=ub.clearTimeout;!function(){function a(b){if(f)vb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(rb(b),f=!1,d===Za)return q(d.e)}}}function b(){if(!S.postMessage||S.importScripts)return!1;var a=!1,b=S.onmessage;return S.onmessage=function(){a=!0},S.postMessage("","*"),S.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;rb=function(a){delete e[a]};var g=RegExp("^"+String(Ia).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=W&&V&&W.setImmediate)&&!g.test(h)&&h;if(da(h))qb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))qb=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();S.addEventListener?S.addEventListener("message",c,!1):S.attachEvent?S.attachEvent("onmessage",c):S.onmessage=c,qb=function(a){var b=d++;return e[b]=a,S.postMessage(i+currentId,"*"),b}}else if(S.MessageChannel){var j=new S.MessageChannel;j.port1.onmessage=function(b){a(b.data)},qb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else qb="document"in S&&"onreadystatechange"in S.document.createElement("script")?function(b){var c=S.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},S.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,vb(function(){a(c)},0),c}}();var xb=(nb.timeout=nb["default"]=function(){function a(a,b){var c=this,d=new jb,e=qb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new cb(d,fb(function(){rb(e)}))}function b(a,b,c){var d=this,e=nb.normalize(b),f=new jb;if(0===e)return d.scheduleWithState(a,c);var g=vb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new cb(f,fb(function(){wb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new nb($,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 gb}}},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 jb;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}(nb)),yb=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 pb(a)||(a=sb),new Dc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),zb=yb.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 yb("N",d,null,a,b,c)}}(),Ab=yb.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 yb("E",null,d,a,b,c)}}(),Bb=yb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new yb("C",null,null,a,b,c)}}(),Cb=X.Observer=function(){};Cb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Cb.prototype.asObserver=function(){return new Gb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Cb.prototype.checked=function(){return new Hb(this)};var Db=Cb.create=function(a,b,c){return a||(a=Y),b||(b=ba),c||(c=Y),new Gb(a,b,c)};Cb.fromNotifier=function(a,b){return new Gb(function(c){return a.call(b,zb(c))},function(c){return a.call(b,Ab(c))},function(){return a.call(b,Bb())})},Cb.prototype.notifyOn=function(a){return new Jb(a,this)},Cb.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Eb,Fb=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}(Cb),Gb=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}(Fb),Hb=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}(Cb),Ib=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 kb}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}(Fb),Jb=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}(Ib),Kb=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 Eb=a.prototype,Eb.subscribe=Eb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Db(a,b,c))},Eb.subscribeOnNext=function(a,b){return this._subscribe(Db("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Eb.subscribeOnError=function(a,b){return this._subscribe(Db(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Eb.subscribeOnCompleted=function(a,b){return this._subscribe(Db(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Lb=X.ObservableBase=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?fb(a):gb}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 Ec(a),d=[b,this];return tb.scheduleRequired()?tb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Wa(e,a),e.prototype.subscribeCore=oa,e}(Kb),Mb=X.internals.Enumerable=function(){},Nb=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 kb,e=sb.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=Ub(h));var i=new jb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new cb(d,e,fb(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}(Lb);Mb.prototype.concat=function(){return new Nb(this)};var Ob=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 kb,e=sb.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=Ub(h));var i=new jb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new cb(d,e,fb(function(){b=!0}))},b}(Lb);Mb.prototype.catchError=function(){return new Ob(this)},Mb.prototype.catchErrorWhen=function(a){var b=this;return new Dc(function(c){var d,e,f=new Gc,g=new Gc,h=a(f),i=h.subscribe(g),j=b[qa](),k=new kb,l=sb.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=Ub(h));var i=new jb,l=new jb;k.setDisposable(new cb(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 cb(i,k,l,fb(function(){d=!0}))})};var Pb=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}(Mb),Qb=Mb.repeat=function(a,b){return new Pb(a,b)},Rb=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}(Mb),Sb=Mb.of=function(a,b,c){return new Rb(a,b,c)};Eb.observeOn=function(a){var b=this;return new Dc(function(c){return b.subscribe(new Jb(a,c))},b)},Eb.subscribeOn=function(a){var b=this;return new Dc(function(c){var d=new jb,e=new kb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Tb=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)}),gb},b}(Lb),Ub=Kb.fromPromise=function(a){return new Tb(a)};Eb.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 Vb=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}(Lb);Eb.toArray=function(){return new Vb(this)},Kb.create=Kb.createWithDisposable=function(a,b){return new Dc(a,b)};var Wb=(Kb.defer=function(a){return new Dc(function(b){var c;try{c=a()}catch(d){return kc(d).subscribe(b)}return ca(c)&&(c=Ub(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}(Lb)),Xb=Kb.empty=function(a){return pb(a)||(a=sb),new Wb(a)},Yb=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 Zb(a,this);return b.run()},b}(Lb),Zb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=A(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),$b=Math.pow(2,53)-1;v.prototype[qa]=function(){return new w(this._s)},w.prototype[qa]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ra},x.prototype[qa]=function(){return new y(this._a)},y.prototype[qa]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ra};var _b=Kb.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 pb(d)||(d=tb),new Yb(a,e,d)},ac=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 D(a,this);return b.run()},b}(Lb);D.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 bc=Kb.fromArray=function(a,b){return pb(b)||(b=tb),new ac(a,b)};Kb.generate=function(a,b,c,d,e){return pb(e)||(e=tb),new Dc(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 cc=function(a){function b(){a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return gb},b}(Lb),dc=Kb.never=function(){return new cc};Kb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new ac(b,tb)},Kb.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 ac(c,a)};var ec=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 F(a,this);return b.run()},b}(Lb);F.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)},Kb.pairs=function(a,b){return b||(b=tb),new ec(a,b)};var fc=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 gc(a,this);return b.run()},b}(Lb),gc=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}();Kb.range=function(a,b,c){return pb(c)||(c=tb),new fc(a,b,c)};var hc=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 G(a,this);return b.run()},b}(Lb);G.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)},Kb.repeat=function(a,b,c){return pb(c)||(c=tb),new hc(a,b,c)};var ic=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}(Lb),jc=(Kb["return"]=Kb.just=Kb.returnValue=function(a,b){return pb(b)||(b=sb),new ic(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}(Lb)),kc=Kb["throw"]=Kb.throwError=Kb.throwException=function(a,b){return pb(b)||(b=sb),new jc(a,b)};Kb.using=function(a,b){return new Dc(function(c){var d,e,f=gb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new cb(kc(g).subscribe(c),f)}return new cb(e.subscribe(c),f)})},Eb.amb=function(a){var b=this;return new Dc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new jb,j=new jb;return ca(a)&&(a=Ub(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 cb(i,j)})},Kb.amb=function(){function a(a,b){return a.amb(b)}var b=dc(),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},Eb["catch"]=Eb.catchError=Eb.catchException=function(a){return"function"==typeof a?H(this,a):lc([this,a])};var lc=Kb.catchError=Kb["catch"]=Kb.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Sb(a).catchError()};Eb.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),mc.apply(this,b)};var mc=Kb.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 Dc(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 jb;ca(f)&&(f=Ub(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 cb(l)},this)};Eb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),oc.apply(null,a)};var nc=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 kb,c=this.sources,d=c.length,e=this.o,f=sb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ca(h)&&(h=Ub(h));var i=new jb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new cb(b,f,fb(function(){a=!0}))},b}(Lb),oc=Kb.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 nc(a)};Eb.concatAll=Eb.concatObservable=function(){return this.merge(1)};var pc=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 cb;return b.add(this.source.subscribe(new qc(a,this.maxConcurrent,b))),b},b}(Lb),qc=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 jb;this.g.add(c),ca(a)&&(a=Ub(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}();Eb.merge=function(a){return"number"!=typeof a?rc(this,a):new pc(this,a)};var rc=Kb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(pb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=sb,b=0;d>b;b++)c.push(arguments[b]);else for(a=sb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),E(a,c).mergeAll()},sc=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 cb,d=new jb;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 jb;this.g.add(b),ca(a)&&(a=Ub(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}(Lb);Eb.mergeAll=Eb.mergeObservable=function(){return new sc(this)};var tc=X.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};tc.prototype=Error.prototype,Kb.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=E(null,a);return new Dc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new tc(g))}var c=new cb,e=new jb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new jb;c.add(e),ca(d)&&(d=Ub(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})},Eb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return uc([this,a])};var uc=Kb.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 Dc(function(b){var c=0,d=new kb,e=sb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ca(f)&&(f=Ub(f)),g=new jb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new cb(d,e)})};Eb.skipUntil=function(a){var b=this;return new Dc(function(c){var d=!1,e=new cb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ca(a)&&(a=Ub(a));var f=new jb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var vc=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 kb,d=this.source.subscribe(new c(a,b));return new cb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new jb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ca(a)&&(a=Ub(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}(Lb);Eb["switch"]=Eb.switchLatest=function(){return new vc(this)};var wc=function(a){function b(b,c){this.source=b,this.other=ca(c)?Ub(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 cb(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}(Lb);Eb.takeUntil=function(a){return new wc(this,a)},Eb.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 Dc(function(a){for(var c=b.length,f=n(c,I),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new jb;ca(d)&&(d=Ub(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 jb;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 cb(i)},this)},Eb.zip=function(){if(Array.isArray(arguments[0]))return J.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new Dc(function(a){for(var c=b.length,f=n(c,K),g=n(c,I),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new jb;ca(i)&&(i=Ub(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 cb(h)},d)},Kb.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)},Kb.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 Dc(function(b){for(var c=a.length,d=n(c,L),e=n(c,I),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new jb,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 cb(f)})},Eb.asObservable=function(){var a=this;return new Dc(function(b){return a.subscribe(b)},a)},Eb.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})},Eb.dematerialize=function(){var a=this;return new Dc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Eb.distinctUntilChanged=function(a,b){var c=this;return b||(b=_),new Dc(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 xc=function(a){function b(b,c,d,e){this.source=b,this.t=!c||da(c)?Db(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}(Lb);Eb["do"]=Eb.tap=Eb.doAction=function(a,b,c){return new xc(this,a,b,c)},Eb.doOnNext=Eb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Eb.doOnError=Eb.tapOnError=function(a,b){return this.tap(Y,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Eb.doOnCompleted=Eb.tapOnCompleted=function(a,b){return this.tap(Y,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Eb["finally"]=Eb.ensure=function(a){var b=this;return new Dc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return fb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Eb.finallyAction=function(a){return this.ensure(a)};var yc=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}(Lb);Eb.ignoreElements=function(){return new yc(this)},Eb.materialize=function(){var a=this;return new Dc(function(b){return a.subscribe(function(a){b.onNext(zb(a))},function(a){b.onNext(Ab(a)),b.onCompleted()},function(){b.onNext(Bb()),b.onCompleted()})},a)},Eb.repeat=function(a){return Qb(this,a).concat()},Eb.retry=function(a){return Qb(this,a).catchError()},Eb.retryWhen=function(a){return Qb(this).catchErrorWhen(a)};var zc=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 M(a,this))},b}(Lb);M.prototype.onNext=function(a){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,a):(this.accumulation=this.hasSeed?this.accumulator(this.seed,a):a,this.hasAccumulation=!0)}catch(b){return this.observer.onError(b)}this.observer.onNext(this.accumulation)}},M.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},M.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},M.prototype.dispose=function(){this.isStopped=!0},M.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Eb.scan=function(){var a,b,c=!1;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new zc(this,b,c,a)},Eb.skipLast=function(a){if(0>a)throw new la;var b=this;return new Dc(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)},Eb.startWith=function(){var a,b=0;arguments.length&&pb(arguments[0])?(a=arguments[0],b=1):a=sb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Sb([bc(c,a),this]).concat()},Eb.takeLast=function(a){if(0>a)throw new la;var b=this;return new Dc(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)},Eb.takeLastBuffer=function(a){var b=this;return new Dc(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)},Eb.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 Dc(function(d){function e(){var a=new Gc;i.push(a),d.onNext(Ya(a,g))}var f=new jb,g=new lb(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)},Eb.selectConcat=Eb.concatMap=function(a,b,c){return da(a)&&da(b)?this.concatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Ub(e)),(ta(e)||sa(e))&&(e=_b(e)),e.map(function(a,e){return b(c,a,d,e)})}):da(a)?N(this,a,c):N(this,function(){return a})},Eb.concatMapObserver=Eb.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 Dc(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=Ub(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ca(c)&&(c=Ub(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ca(b)&&(b=Ub(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Eb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Dc(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)},P.prototype.push=function(a){var b=-1===O(this.set,a,this.comparer);return b&&this.set.push(a),b},Eb.distinct=function(a,b){var c=this;return b||(b=_),new Dc(function(d){var e=new P(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 Ac=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}(Lb);Eb.map=Eb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Ac?this.internalMap(c,b):new Ac(this,c,b)},Eb.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})},Eb.selectMany=Eb.flatMap=function(a,b,c){return da(a)&&da(b)?this.flatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Ub(e)),(ta(e)||sa(e))&&(e=_b(e)),e.map(function(a,e){return b(c,a,d,e)})},c):da(a)?Q(this,a,c):Q(this,function(){return a})},Eb.flatMapObserver=Eb.selectManyObserver=function(a,b,c,d){var e=this;return new Dc(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=Ub(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ca(c)&&(c=Ub(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ca(a)&&(a=Ub(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Eb.selectSwitch=Eb.flatMapLatest=Eb.switchMap=function(a,b){return this.select(a,b).switchLatest()};var Bc=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}(Lb);Eb.skip=function(a){if(0>a)throw new la;return new Bc(this,a)},Eb.skipWhile=function(a,b){var c=this,d=va(a,b,3);return new Dc(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)},Eb.take=function(a,b){if(0>a)throw new la;if(0===a)return Xb(b);var c=this;return new Dc(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)},Eb.takeWhile=function(a,b){var c=this,d=va(a,b,3);return new Dc(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 Cc=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}(Lb);Eb.filter=Eb.where=function(a,b){return this instanceof Cc?this.internalFilter(a,b):new Cc(this,a,b)},Eb.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 Dc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var Dc=X.AnonymousObservable=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?fb(a):gb}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 Ec(a),e=[d,b];return tb.scheduleRequired()?tb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Wa(d,a),d}(Kb),Ec=function(a){function b(b){a.call(this),this.observer=b,this.m=new jb}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}(Fb),Fc=function(a,b){this.subject=a,this.observer=b};Fc.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 Gc=X.Subject=function(a){function c(a){return ib(this),this.isStopped?this.hasError?(a.onError(this.error),gb):(a.onCompleted(),gb):(this.observers.push(a),new Fc(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,Cb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(ib(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(ib(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(ib(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 Hc(a,b)},d}(Kb),Hc=(X.AsyncSubject=function(a){function c(a){return ib(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),gb):(this.observers.push(a),new Fc(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,Cb,{hasObservers:function(){return ib(this),this.observers.length>0},onCompleted:function(){var a,c;if(ib(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(ib(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){ib(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Kb),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,Cb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Kb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(S.Rx=X,define(function(){return X})):T&&U?V?(U.exports=X).Rx=X:T.Rx=X:S.Rx=X;var Ic=g()}).call(this);
|
|
//# sourceMappingURL=rx.compat.map
|