4 lines
48 KiB
JavaScript
4 lines
48 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(){if(this.isDisposed)throw new Error(Y)}function c(a,b){if(Z&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(bb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+bb+"\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===_&&d>=ab&&Nc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(Z)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 _=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(!Db(a))return b;Cb.nonEnumArgs&&a.length&&Eb(a)&&(a=Gb.call(a));var c=Cb.enumPrototypes&&"function"==typeof a,d=Cb.enumErrorProps&&(a===xb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Cb.nonEnumShadows&&a!==yb){var f=a.constructor,g=-1,h=jb;if(a===(f&&f.prototype))var i=a===zb?tb:a===xb?ob:ub.call(a),j=Bb[i];for(;++g<h;)e=ib[g],j&&j[e]||!vb.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=ub.call(a),h=ub.call(b);if(g==kb&&(g=rb),h==kb&&(h=rb),g!=h)return!1;switch(g){case mb:case nb:return+a==+b;case qb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case sb:case tb:return a==String(b)}var i=g==lb;if(!i){if(g!=rb||!Cb.nodeClass&&(l(a)||l(b)))return!1;var j=!Cb.argsObject&&Eb(a)?Object:a.constructor,n=!Cb.argsObject&&Eb(b)?Object:b.constructor;if(!(j==n||vb.call(a,"constructor")&&vb.call(b,"constructor")||W(j)&&j instanceof j&&W(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 vb.call(f,e)?(p++,q=vb.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return vb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Gb.call(a)}function o(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function p(a,b){this.id=a,this.value=b}function q(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function r(){this._s=s}function t(){this._s=s,this._l=s.length,this._i=0}function u(a){this._a=a}function v(a){this._a=a,this._l=z(a),this._i=0}function w(a){return"number"==typeof a&&I.isFinite(a)}function x(b){var c,d=b[cb];if(!d&&"string"==typeof b)return c=new r(b),c[cb]();if(!d&&b.length!==a)return c=new u(b),c[cb]();if(!d)throw new TypeError("Object is not iterable");return b[cb]()}function y(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function z(a){var b=+a.length;return isNaN(b)?0:0!==b&&w(b)?(b=y(b)*Math.floor(Math.abs(b)),0>=b?0:b>xc?xc:b):b}function A(a,b){return P(a)||(a=Zb),new Ic(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function B(a,b){return new Ic(function(c){var d=new Rb,e=new Sb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}V(f)&&(f=uc(f)),d=new Rb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e},a)}function C(a,b){var c=this;return new Ic(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void
|
||
|
V(f)&&(f=uc(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},function(a){c.onError(a)},function(){e(b)})),l[b]=g}(m);return new Mb(l)},this)};nc.concat=function(){var a=Gb.call(arguments,0);return a.unshift(this),Fc.apply(this,a)};var Fc=tc.concat=function(){return kc(n(arguments,0)).concat()};nc.concatAll=function(){return this.merge(1)},nc.concatObservable=function(){return this.merge(1)},nc.merge=function(a){if("number"!=typeof a)return Gc(this,a);var b=this;return new Ic(function(c){function d(a){var b=new Rb;f.add(b),V(a)&&(a=uc(a)),b.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){c.onError(a)},function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Mb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},function(a){c.onError(a)},function(){g=!0,0===e&&c.onCompleted()})),f},b)};var Gc=tc.merge=function(){var a,b;return arguments[0]?P(arguments[0])?(a=arguments[0],b=Gb.call(arguments,1)):(a=Yb,b=Gb.call(arguments,0)):(a=Yb,b=Gb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),A(a,b).mergeAll()};nc.mergeAll=function(){var a=this;return new Ic(function(b){var c=new Mb,d=!1,e=new Rb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Rb;c.add(e),V(a)&&(a=uc(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},function(a){b.onError(a)},function(){d=!0,1===c.length&&b.onCompleted()})),c},a)},nc.mergeObservable=function(){return this.mergeAll.apply(this,arguments)},nc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return Hc([this,a])};var Hc=tc.onErrorResumeNext=function(){var a=n(arguments,0);return new Ic(function(b){var c=0,d=new Sb,e=Yb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],V(f)&&(f=uc(f)),g=new Rb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Mb(d,e)})};nc.skipUntil=function(a){var b=this;return new Ic(function(c){var d=!1,e=new Mb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));V(a)&&(a=uc(a));var f=new Rb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},nc["switch"]=nc.switchLatest=function(){var a=this;return new Ic(function(b){var c=!1,d=new Sb,e=!1,f=0,g=a.subscribe(function(a){var g=new Rb,h=++f;c=!0,d.setDisposable(g),V(a)&&(a=uc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Mb(g,d)},a)},nc.takeUntil=function(a){var b=this;return new Ic(function(c){return V(a)&&(a=uc(a)),new Mb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},O))},b)},nc.withLatestFrom=function(){var a=this,b=Gb.call(arguments),c=b.pop();if("undefined"==typeof a)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof c)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new Ic(function(d){for(var e=function(){return!1},f=b.length,g=o(f,e),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(a){var c=b[a],e=new Rb;V(c)&&(c=uc(c)),e.setDisposable(c.subscribe(function(b){i[a]=b,g[a]=!0,h=g.every(Q)},d.onError.bind(d),function(){})),j[a]=e}(k);var l=new Rb;return l.setDisposable(a.subscribe(function(a){var b,e=[a].concat(i);if(h){try{b=c.apply(null,e)}catch(f){return void d.onError(f)}d.onNext(b)}},d.onError.bind(d),function(){d.onCompleted()})),j[f]=l,new Mb(j)},this)},nc.zip=function(){if(Array.isArray(arguments[0]))return C.apply(this,arguments);var a=this,b=Gb.call(arguments),c=b.pop();return b.unshift(a),new Ic(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!
|
||
|
//# sourceMappingURL=rx.map
|