Bones/node_modules/rx/dist/rx.all.compat.min.js

6 lines
98 KiB
JavaScript
Raw Normal View History

2017-05-17 13:45:25 -04:00
/* 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(Gb)}function c(a,b){if(Hb&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Lb)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+Lb+"\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===Jb&&d>=Kb&&Wd>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(Hb)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 Jb=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(!lc(a))return b;kc.nonEnumArgs&&a.length&&mc(a)&&(a=oc.call(a));var c=kc.enumPrototypes&&"function"==typeof a,d=kc.enumErrorProps&&(a===fc||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(kc.nonEnumShadows&&a!==gc){var f=a.constructor,g=-1,h=Tb;if(a===(f&&f.prototype))var i=a===hc?bc:a===fc?Yb:cc.call(a),j=jc[i];for(;++g<h;)e=Sb[g],j&&j[e]||!dc.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=cc.call(a),h=cc.call(b);if(g==Ub&&(g=_b),h==Ub&&(h=_b),g!=h)return!1;switch(g){case Wb:case Xb:return+a==+b;case $b:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ac:case bc:return a==String(b)}var i=g==Vb;if(!i){if(g!=_b||!kc.nodeClass&&(l(a)||l(b)))return!1;var j=!kc.argsObject&&mc(a)?Object:a.constructor,n=!kc.argsObject&&mc(b)?Object:b.constructor;if(!(j==n||dc.call(a,"constructor")&&dc.call(b,"constructor")||Db(j)&&j instanceof j&&Db(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 dc.call(f,e)?(p++,q=dc.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return dc.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]:oc.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&&ob.isFinite(a)}function x(b){var c,d=b[Mb];if(!d&&"string"==typeof b)return c=new r(b),c[Mb]();if(!d&&b.length!==a)return c=new u(b),c[Mb]();if(!d)throw new TypeError("Object is not iterable");return b[Mb]()}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>jd?jd:b):b}function A(a,b){return vb(a)||(a=Kc),new Qd(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 Qd(function(c){var d=new Bc,e=new Cc;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)}Bb(f)&&(f=gd(f)),d=new Bc,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e},a)}function C(a,b){var c=this;return new Qd(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){r
},function(){c.onCompleted()})),e.onNext(b)},c.onCompleted.bind(c)))}});return new wc(h,l,m,zc(function(){j=!0}))})};var Xc=Wc.repeat=function(a,b){return null==b&&(b=-1),new Wc(function(){var c=b;return new Vc(function(){return 0===c?Nb:(c>0&&c--,{done:!1,value:a})})})},Yc=Wc.of=function(a,b,c){return b||(b=wb),new Wc(function(){var d=-1;return new Vc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:Nb})})},Zc=tb.Observer=function(){};Zc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Zc.prototype.asObserver=function(){return new bd(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Zc.prototype.checked=function(){return new cd(this)};var $c=Zc.create=function(a,b,c){return a||(a=ub),b||(b=Ab),c||(c=ub),new bd(a,b,c)};Zc.fromNotifier=function(a,b){return new bd(function(c){return a.call(b,Sc(c))},function(c){return a.call(b,Tc(c))},function(){return a.call(b,Uc())})},Zc.prototype.notifyOn=function(a){return new ed(a,this)};var _c,ad=tb.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return pc(b,a),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}(Zc),bd=tb.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return pc(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}(ad),cd=function(a){function b(b){a.call(this),this._observer=b,this._state=0}pc(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Zc),dd=tb.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 Cc}return pc(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}(ad),ed=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return pc(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}(dd),fd=tb.Observable=function(){function a(a){if(tb.config.longStackSupport&&Hb){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._subscr
b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Td,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return pc(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(fd);_c.pausableBuffered=function(a){return new Ad(this,a)};var Bd=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b,c),this.subject=new Cd(d),this.source=c.multicast(this.subject).refCount()}return pc(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(fd),Cd=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new Td,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=Ac,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Ac}return pc(c,a),qc(c.prototype,Zc,{onCompleted:function(){this.hasCompleted=!0,(!this.enableQueue||0===this.queue.length)&&this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,(!this.enableQueue||0===this.queue.length)&&this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Ac):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Ac),{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this,c=this._processRequest(a),a=c.numberOfItems;return c.returnValue?Ac:(this.requestedCount=a,this.requestedDisposable=zc(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Ac}}),c}(fd);_c.controlled=function(a){return null==a&&(a=!0),new Bd(this,a)};var Dd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return Pc.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}pc(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}pc(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;Pc.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(ad);return c}(fd);Bd.prototype.stopAndWait=function(){return new Dd(this)};var Ed=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return Pc.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}pc(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}pc(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;Pc.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(ad);return c}(fd);Bd.prototype.windowed=fun
}return null},i.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,g)},i.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new Ec(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},h}(Fc),tb.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||zb;a.call(this,d,e)}pc(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toDateTimeOffset=function(a){return new Date(a).getTime()},c.toRelative=function(a){return a},b}(tb.VirtualTimeScheduler);var Qd=tb.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?zc(a):Ac}function c(d,e){function f(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Rd(a);return Kc.scheduleRequired()?Kc.schedule(c):c(),e}return this.source=e,this instanceof c?void a.call(this,f):new c(d)}return pc(c,a),c}(fd),Rd=function(a){function b(b){a.call(this),this.observer=b,this.m=new Bc}pc(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},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}(ad),Sd=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Qd(function(a){return new wc(e.getDisposable(),d.subscribe(a))}):d}return pc(c,a),c}(fd),Td=tb.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.hasError?(a.onError(this.error),Ac):(a.onCompleted(),Ac):(this.observers.push(a),new Fd(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return pc(d,a),qc(d.prototype,Zc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers.length=0}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.error=a,this.hasError=!0;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers.length=0}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Vd(a,b)},d}(fd),Ud=tb.AsyncSubject=function(a){function c(a){return b.call(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Ac):(this.observers.push(a),new Fd(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return pc(d,a),qc(d.prototype,Zc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c;if(b.call(this),!this.isStopped){this.isStopped=!0;var d=this.observers.slice(0),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(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.hasError=!0,this.error=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers.length=0}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(fd),Vd=tb.AnonymousSubject=function(a){function b(a){this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return pc(c,a),qc(c.prototype,Zc.prototype,{onCompleted:function()
//# sourceMappingURL=rx.all.compat.map