rxjs-rails 2.2.17 → 2.2.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Rakefile +19 -0
  4. data/lib/rxjs/rails/version.rb +1 -1
  5. data/vendor/assets/javascripts/rx.aggregates.js +23 -23
  6. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  7. data/vendor/assets/javascripts/rx.async.compat.js +2 -2
  8. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  9. data/vendor/assets/javascripts/rx.async.js +2 -2
  10. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  11. data/vendor/assets/javascripts/rx.backpressure.js +2 -2
  12. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  13. data/vendor/assets/javascripts/rx.binding.js +85 -85
  14. data/vendor/assets/javascripts/rx.coincidence.js +17 -17
  15. data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
  16. data/vendor/assets/javascripts/rx.compat.js +461 -456
  17. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  18. data/vendor/assets/javascripts/rx.experimental.js +31 -31
  19. data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
  20. data/vendor/assets/javascripts/rx.joinpatterns.js +284 -284
  21. data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
  22. data/vendor/assets/javascripts/rx.js +446 -441
  23. data/vendor/assets/javascripts/rx.lite.compat.js +469 -464
  24. data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
  25. data/vendor/assets/javascripts/rx.lite.js +469 -464
  26. data/vendor/assets/javascripts/rx.lite.min.js +2 -2
  27. data/vendor/assets/javascripts/rx.min.js +2 -2
  28. data/vendor/assets/javascripts/rx.testing.js +165 -165
  29. data/vendor/assets/javascripts/rx.time.js +19 -19
  30. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  31. data/vendor/assets/javascripts/rx.virtualtime.js +2 -2
  32. metadata +3 -2
@@ -1,2 +1,2 @@
1
- (function(a){function b(){}function c(a){return a}function d(a,b){return db(a,b)}function e(a,b){return a-b}function f(a){return a.toString()}function g(a){throw a}function h(a){return"function"==typeof a.then&&a.then!==D.Observable.prototype.then}function i(){if(this.isDisposed)throw new Error(H)}function j(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function k(a){var b=[];if(!j(a))return b;cb.nonEnumArgs&&a.length&&o(a)&&(a=eb.call(a));var c=cb.enumPrototypes&&"function"==typeof a,d=cb.enumErrorProps&&(a===Y||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(cb.nonEnumShadows&&a!==Z){var f=a.constructor,g=-1,h=ab.length;if(a===(f&&f.prototype))var i=a===stringProto?U:a===Y?P:V.call(a),k=bb[i];for(;++g<h;)e=ab[g],k&&k[e]||!W.call(a,e)||b.push(e)}return b}function l(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 m(a,b){return l(a,b,k)}function n(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function o(a){return a&&"object"==typeof a?V.call(a)==L:!1}function p(a){return"function"==typeof a}function q(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=V.call(a),h=V.call(b);if(g==L&&(g=S),h==L&&(h=S),g!=h)return!1;switch(g){case N:case O:return+a==+b;case R:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case T:case U:return a==String(b)}var i=g==M;if(!i){if(g!=S||!cb.nodeClass&&(n(a)||n(b)))return!1;var j=!cb.argsObject&&o(a)?Object:a.constructor,k=!cb.argsObject&&o(b)?Object:b.constructor;if(!(j==k||W.call(a,"constructor")&&W.call(b,"constructor")||p(j)&&j instanceof j&&p(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var r=0;if(result=!0,c.push(a),d.push(b),i){if(l=a.length,r=b.length,result=r==l)for(;r--;){var s=b[r];if(!(result=q(a[r],s,c,d)))break}}else m(b,function(b,e,f){return W.call(f,e)?(r++,result=W.call(a,e)&&q(a[e],b,c,d)):void 0}),result&&m(a,function(a,b,c){return W.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function r(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:eb.call(a)}function s(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){return new ec(function(c){var d=new tb,e=new ub;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return c.onError(g),void 0}d=new tb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function v(a,b){var c=this;return new ec(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 d.onError(i),void 0}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function w(a){return this.select(function(b,c){var d=a(b,c);return h(d)?Vb(d):d}).mergeObservable()}var x={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},y=x[typeof window]&&window||this,z=x[typeof exports]&&exports&&!exports.nodeType&&exports,A=x[typeof module]&&module&&!module.nodeType&&module,B=A&&A.exports===z&&z,C=x[typeof global]&&global;!C||C.global!==C&&C.window!==C||(y=C);var D={internals:{},config:{}},E=function(){return Date.now?Date.now:function(){return+new Date}}(),F="Sequence contains no elements.",G="Argument out of range",H="Object has been disposed",I="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";y.Set&&"function"==typeof(new y.Set)["@@iterator"]&&(I="@@iterator");var J,K={done:!0,value:a},L="[object Arguments]",M="[object Array]",N="[object Boolean]",O="[object Date]",P="[object Error]",Q="[object Function]",R="[object Number]",S="[object Object]",T="[object RegExp]",U="[object String]",V=Object.prototype.toString,W=Object.prototype.hasOwnProperty,X=V.call(arguments)==L,Y=Error.prototype,Z=Object.prototype,$=Z.propertyIsEnumerable;try{J=!(V.call(document)==S&&!({toString:0}+""))}catch(_){J=!0}var ab=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bb={};bb[M]=bb[O]=bb[R]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},bb[N]=bb[U]={constructor:!0,toString:!0,valueOf:!0},bb[P]=bb[Q]=bb[T]={constructor:!0,toString:!0},bb[S]={constructor:!0};var cb={};!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);cb.enumErrorProps=$.call(Y,"message")||$.call(Y,"name"),cb.enumPrototypes=$.call(a,"prototype"),cb.nonEnumArgs=0!=c,cb.nonEnumShadows=!/valueOf/.test(b)}(1),X||(o=function(a){return a&&"object"==typeof a?W.call(a,"callee"):!1}),p(/x/)&&(p=function(a){return"function"==typeof a&&V.call(a)==Q});var db=D.internals.isEqual=function(a,b){return q(a,b,[],[])},eb=Array.prototype.slice,fb=({}.hasOwnProperty,this.inherits=D.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),gb=D.internals.addProperties=function(a){for(var b=eb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},hb=D.internals.addRef=function(a,b){return new ec(function(c){return new nb(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=eb.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(eb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(eb.call(arguments)))};return d});var ib=Object("a"),jb="a"!=ib[0]||!(0 in ib);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=jb&&{}.toString.call(this)==U?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Q)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=jb&&{}.toString.call(this)==U?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Q)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 Object.prototype.toString.call(a)==M}),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&&1/0!=d&&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});var kb=function(a,b){this.id=a,this.value=b};kb.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var lb=D.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},mb=lb.prototype;mb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},mb.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)}}},mb.heapify=function(b){if(b===a&&(b=0),!(b>=this.length||0>b)){var c=2*b+1,d=2*b+2,e=b;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==b){var f=this.items[b];this.items[b]=this.items[e],this.items[e]=f,this.heapify(e)}}},mb.peek=function(){return this.items[0].value},mb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},mb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},mb.enqueue=function(a){var b=this.length++;this.items[b]=new kb(lb.count++,a),this.percolate(b)},mb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},lb.count=0;var nb=D.CompositeDisposable=function(){this.disposables=r(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},ob=nb.prototype;ob.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},ob.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},ob.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},ob.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},ob.contains=function(a){return-1!==this.disposables.indexOf(a)},ob.toArray=function(){return this.disposables.slice(0)};var pb=D.Disposable=function(a){this.isDisposed=!1,this.action=a||b};pb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var qb=pb.create=function(a){return new pb(a)},rb=pb.empty={dispose:b},sb=function(){function a(a){this.isSingle=a,this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){if(this.current&&this.isSingle)throw new Error("Disposable has already been assigned");var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),tb=D.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return fb(b,a),b}(sb),ub=D.SerialDisposable=function(a){function b(){a.call(this,!1)}return fb(b,a),b}(sb),vb=D.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?rb:new a(this)},b}();t.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var wb=D.internals.ScheduledItem=function(a,b,c,d,f){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=f||e,this.disposable=new tb};wb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},wb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},wb.prototype.isCancelled=function(){return this.disposable.isDisposed},wb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var xb,yb=D.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){var c=b.first,d=b.second,e=new nb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),rb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new nb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),rb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),rb}var e=a.prototype;return e.catchException=e["catch"]=function(a){return new Db(this,a)},e.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},e.schedulePeriodicWithState=function(a,b,c){var d=a,e=setInterval(function(){d=c(d)},b);return qb(function(){clearInterval(e)})},e.schedule=function(a){return this._schedule(a,d)},e.scheduleWithState=function(a,b){return this._schedule(a,b)},e.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,d)},e.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},e.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,d)},e.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},e.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},e.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},function(a,c){return b(a,c)})},e.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},e.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})},a.now=E,a.normalize=function(a){return 0>a&&(a=0),a},a}(),zb=yb.normalize,Ab=(D.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 tb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),yb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=zb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new yb(E,a,b,c)}()),Bb=yb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-yb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+yb.normalize(c),g=new wb(this,b,d,f);if(e)e.enqueue(g);else{e=new lb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new yb(E,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),Cb=b;!function(){function a(){if(!y.postMessage||y.importScripts)return!1;var a=!1,b=y.onmessage;return y.onmessage=function(){a=!0},y.postMessage("","*"),y.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(V).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=C&&B&&C.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=C&&B&&C.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))xb=process.nextTick;else if("function"==typeof d)xb=d,Cb=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;y.addEventListener?y.addEventListener("message",b,!1):y.attachEvent("onmessage",b,!1),xb=function(a){var b=h++;g[b]=a,y.postMessage(f+b,"*")}}else if(y.MessageChannel){var i=new y.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},xb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in y&&"onreadystatechange"in y.document.createElement("script")?xb=function(a){var b=y.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},y.document.documentElement.appendChild(b)}:(xb=function(a){return setTimeout(a,0)},Cb=clearTimeout)}();var Db=(yb.timeout=function(){function a(a,b){var c=this,d=new tb,e=xb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new nb(d,qb(function(){Cb(e)}))}function b(a,b,c){var d=this,e=yb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new tb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new nb(f,qb(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new yb(E,a,b,c)}(),function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return fb(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.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 rb}}},f.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},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new tb;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},f}(yb)),Eb=D.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}var b=a.prototype;return b.accept=function(a,b,c){return 1===arguments.length&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},b.toObservable=function(a){var b=this;return a||(a=Ab),new ec(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Fb=Eb.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){var e=new Eb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Gb=Eb.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){var e=new Eb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Hb=Eb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Eb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Ib=D.internals.Enumerator=function(a){this._next=a};Ib.prototype.next=function(){return this._next()},Ib.prototype[I]=function(){return this};var Jb=D.internals.Enumerable=function(a){this._iterator=a};Jb.prototype[I]=function(){return this._iterator()},Jb.prototype.concat=function(){var a=this;return new ec(function(b){var c;try{c=a[I]()}catch(d){return b.onError(),void 0}var e,f=new ub,g=Ab.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return b.onError(g),void 0}if(d.done)return b.onCompleted(),void 0;var h=new tb;f.setDisposable(h),h.setDisposable(d.value.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new nb(f,g,qb(function(){e=!0}))})},Jb.prototype.catchException=function(){var a=this;return new ec(function(b){var c;try{c=a[I]()}catch(d){return b.onError(),void 0}var e,f,g=new ub,h=Ab.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return b.onError(h),void 0}if(d.done)return f?b.onError(f):b.onCompleted(),void 0;var i=new tb;g.setDisposable(i),i.setDisposable(d.value.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new nb(g,h,qb(function(){e=!0}))})};var Kb=Jb.repeat=function(a,b){return null==b&&(b=-1),new Jb(function(){var c=b;return new Ib(function(){return 0===c?K:(c>0&&c--,{done:!1,value:a})})})},Lb=Jb.forEach=function(a,b,d){return b||(b=c),new Jb(function(){var c=-1;return new Ib(function(){return++c<a.length?{done:!1,value:b.call(d,a[c],c,a)}:K})})},Mb=D.Observer=function(){};Mb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Mb.prototype.asObserver=function(){return new Qb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Mb.prototype.checked=function(){return new Rb(this)};var Nb=Mb.create=function(a,c,d){return a||(a=b),c||(c=g),d||(d=b),new Qb(a,c,d)};Mb.fromNotifier=function(a){return new Qb(function(b){return a(Fb(b))},function(b){return a(Gb(b))},function(){return a(Hb())})},Mb.notifyOn=function(a){return new Tb(a,this)};var Ob,Pb=D.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return fb(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}(Mb),Qb=D.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return fb(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}(Pb),Rb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}fb(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}(Mb),Sb=D.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 ub}return fb(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 b.isAcquired=!1,void 0;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}(Pb),Tb=function(a){function b(){a.apply(this,arguments)}return fb(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}(Sb),Ub=D.Observable=function(){function a(a){this._subscribe=a}return Ob=a.prototype,Ob.finalValue=function(){var a=this;return new ec(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(F))})})},Ob.subscribe=Ob.forEach=function(a,b,c){var d;return d="object"==typeof a?a:Nb(a,b,c),this._subscribe(d)},Ob.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}();Ob.observeOn=function(a){var b=this;return new ec(function(c){return b.subscribe(new Tb(a,c))})},Ob.subscribeOn=function(a){var b=this;return new ec(function(c){var d=new tb,e=new ub;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e})};var Vb=Ub.fromPromise=function(a){return new ec(function(b){a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)})})};Ob.toPromise=function(a){if(a||(a=D.config.Promise),!a)throw new Error("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},function(a){c(a)},function(){e&&a(d)})})},Ub.create=Ub.createWithDisposable=function(a){return new ec(a)};var Wb=(Ub.defer=function(a){return new ec(function(b){var c;try{c=a()}catch(d){return $b(d).subscribe(b)}return c.subscribe(b)})},Ub.empty=function(a){return a||(a=Ab),new ec(function(b){return a.schedule(function(){b.onCompleted()})})}),Xb=Ub.fromArray=function(a,b){return b||(b=Bb),new ec(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Ub.fromIterable=function(a,b){return b||(b=Bb),new ec(function(c){var d;try{d=a[I]()}catch(e){return c.onError(e),void 0}return b.scheduleRecursive(function(a){var b;try{b=d.next()}catch(e){return c.onError(e),void 0}b.done?c.onCompleted():(c.onNext(b.value),a())})})},Ub.generate=function(a,b,c,d,e){return e||(e=Bb),new ec(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return f.onError(j),void 0}e?(f.onNext(i),a()):f.onCompleted()})})};var Yb=Ub.never=function(){return new ec(function(){return rb})};Ub.range=function(a,b,c){return c||(c=Bb),new ec(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Ub.repeat=function(a,b,c){return c||(c=Bb),null==b&&(b=-1),Zb(a,c).repeat(b)};var Zb=Ub["return"]=Ub.returnValue=function(a,b){return b||(b=Ab),new ec(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},$b=Ub["throw"]=Ub.throwException=function(a,b){return b||(b=Ab),new ec(function(c){return b.schedule(function(){c.onError(a)})})};Ub.using=function(a,b){return new ec(function(c){var d,e,f=rb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new nb($b(g).subscribe(c),f)}return new nb(e.subscribe(c),f)})},Ob.amb=function(a){var b=this;return new ec(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new tb,j=new tb;return 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 nb(i,j)})},Ub.amb=function(){function a(a,b){return a.amb(b)}for(var b=Yb(),c=r(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Ob["catch"]=Ob.catchException=function(a){return"function"==typeof a?u(this,a):_b([this,a])};var _b=Ub.catchException=Ub["catch"]=function(){var a=r(arguments,0);return Lb(a).catchException()};Ob.combineLatest=function(){var a=eb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),ac.apply(this,a)};var ac=Ub.combineLatest=function(){var a=eb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new ec(function(d){function e(a){var e;if(i[a]=!0,j||(j=i.every(c))){try{e=b.apply(null,l)}catch(f){return d.onError(f),void 0}d.onNext(e)}else k.filter(function(b,c){return c!==a}).every(c)&&d.onCompleted()}function f(a){k[a]=!0,k.every(c)&&d.onCompleted()}for(var g=function(){return!1},h=a.length,i=s(h,g),j=!1,k=s(h,g),l=new Array(h),m=new Array(h),n=0;h>n;n++)!function(b){m[b]=new tb,m[b].setDisposable(a[b].subscribe(function(a){l[b]=a,e(b)},d.onError.bind(d),function(){f(b)}))}(n);return new nb(m)})};Ob.concat=function(){var a=eb.call(arguments,0);return a.unshift(this),bc.apply(this,a)};var bc=Ub.concat=function(){var a=r(arguments,0);return Lb(a).concat()};Ob.concatObservable=Ob.concatAll=function(){return this.merge(1)},Ob.merge=function(a){if("number"!=typeof a)return cc(this,a);var b=this;return new ec(function(c){var d=0,e=new nb,f=!1,g=[],i=function(a){var b=new tb;e.add(b),h(a)&&(a=Vb(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){var a;e.remove(b),g.length>0?(a=g.shift(),i(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,i(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var cc=Ub.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=eb.call(arguments,1)):(a=Ab,b=eb.call(arguments,0)):(a=Ab,b=eb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Xb(b,a).mergeObservable()};Ob.mergeObservable=Ob.mergeAll=function(){var a=this;return new ec(function(b){var c=new nb,d=!1,e=new tb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new tb;c.add(e),h(a)&&(a=Vb(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},Ob.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return dc([this,a])};var dc=Ub.onErrorResumeNext=function(){var a=r(arguments,0);return new ec(function(b){var c=0,d=new ub,e=Ab.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],g=new tb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new nb(d,e)})};Ob.skipUntil=function(a){var b=this;return new ec(function(c){var d=!1,e=new nb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new tb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Ob["switch"]=Ob.switchLatest=function(){var a=this;return new ec(function(b){var c=!1,d=new ub,e=!1,f=0,g=a.subscribe(function(a){var g=new tb,i=++f;c=!0,d.setDisposable(g),h(a)&&(a=Vb(a)),g.setDisposable(a.subscribe(function(a){f===i&&b.onNext(a)},function(a){f===i&&b.onError(a)},function(){f===i&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new nb(g,d)})},Ob.takeUntil=function(a){var c=this;return new ec(function(d){return new nb(c.subscribe(d),a.subscribe(d.onCompleted.bind(d),d.onError.bind(d),b))})},Ob.zip=function(){if(Array.isArray(arguments[0]))return v.apply(this,arguments);var a=this,b=eb.call(arguments),d=b.pop();return b.unshift(a),new ec(function(e){function f(a){i[a]=!0,i.every(function(a){return a})&&e.onCompleted()}for(var g=b.length,h=s(g,function(){return[]}),i=s(g,function(){return!1}),j=function(b){var f,g;if(h.every(function(a){return a.length>0})){try{g=h.map(function(a){return a.shift()}),f=d.apply(a,g)}catch(j){return e.onError(j),void 0}e.onNext(f)}else i.filter(function(a,c){return c!==b}).every(c)&&e.onCompleted()},k=new Array(g),l=0;g>l;l++)!function(a){k[a]=new tb,k[a].setDisposable(b[a].subscribe(function(b){h[a].push(b),j(a)},e.onError.bind(e),function(){f(a)}))}(l);return new nb(k)})},Ub.zip=function(){var a=eb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Ub.zipArray=function(){var a=r(arguments,0);return new ec(function(b){function d(a){if(g.every(function(a){return a.length>0})){var d=g.map(function(a){return a.shift()});b.onNext(d)}else if(h.filter(function(b,c){return c!==a}).every(c))return b.onCompleted(),void 0}function e(a){return h[a]=!0,h.every(c)?(b.onCompleted(),void 0):void 0}for(var f=a.length,g=s(f,function(){return[]}),h=s(f,function(){return!1}),i=new Array(f),j=0;f>j;j++)!function(c){i[c]=new tb,i[c].setDisposable(a[c].subscribe(function(a){g[c].push(a),d(c)
2
- },b.onError.bind(b),function(){e(c)}))}(j);var k=new nb(i);return k.add(qb(function(){for(var a=0,b=g.length;b>a;a++)g[a]=[]})),k})},Ob.asObservable=function(){var a=this;return new ec(function(b){return a.subscribe(b)})},Ob.bufferWithCount=function(a,b){return 1===arguments.length&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Ob.dematerialize=function(){var a=this;return new ec(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Ob.distinctUntilChanged=function(a,b){var e=this;return a||(a=c),b||(b=d),new ec(function(c){var d,f=!1;return e.subscribe(function(e){var g,h=!1;try{g=a(e)}catch(i){return c.onError(i),void 0}if(f)try{h=b(d,g)}catch(i){return c.onError(i),void 0}f&&h||(f=!0,d=g,c.onNext(e))},c.onError.bind(c),c.onCompleted.bind(c))})},Ob["do"]=Ob.doAction=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new ec(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b){try{b(c)}catch(d){a.onError(d)}a.onError(c)}else a.onError(c)},function(){if(c){try{c()}catch(b){a.onError(b)}a.onCompleted()}else a.onCompleted()})})},Ob["finally"]=Ob.finallyAction=function(a){var b=this;return new ec(function(c){var d=b.subscribe(c);return qb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Ob.ignoreElements=function(){var a=this;return new ec(function(c){return a.subscribe(b,c.onError.bind(c),c.onCompleted.bind(c))})},Ob.materialize=function(){var a=this;return new ec(function(b){return a.subscribe(function(a){b.onNext(Fb(a))},function(a){b.onNext(Gb(a)),b.onCompleted()},function(){b.onNext(Hb()),b.onCompleted()})})},Ob.repeat=function(a){return Kb(this,a).concat()},Ob.retry=function(a){return Kb(this,a).catchException()},Ob.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new ec(function(e){var f,g,h;return d.subscribe(function(d){try{h||(h=!0),f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return e.onError(i),void 0}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},Ob.skipLast=function(a){var b=this;return new ec(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},Ob.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=Ab,a=eb.call(arguments,c),Lb([Xb(a,b),this]).concat()},Ob.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Xb(a,b)})},Ob.takeLastBuffer=function(a){var b=this;return new ec(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},Ob.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(G);if(1===arguments.length&&(b=a),0>=b)throw new Error(G);return new ec(function(d){var e=new tb,f=new vb(e),g=0,h=[],i=function(){var a=new ic;h.push(a),d.onNext(hb(a,f))};return i(),e.setDisposable(c.subscribe(function(c){for(var d,e=0,f=h.length;f>e;e++)h[e].onNext(c);var j=g-a+1;j>=0&&j%b===0&&(d=h.shift(),d.onCompleted()),g++,g%b===0&&i()},function(a){for(;h.length>0;)h.shift().onError(a);d.onError(a)},function(){for(;h.length>0;)h.shift().onCompleted();d.onCompleted()})),f})},Ob.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new ec(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},Ob.distinct=function(a,b){var d=this;return a||(a=c),b||(b=f),new ec(function(c){var e={};return d.subscribe(function(d){var f,g,h,i=!1;try{f=a(d),g=b(f)}catch(j){return c.onError(j),void 0}for(h in e)if(g===h){i=!0;break}i||(e[g]=null,c.onNext(d))},c.onError.bind(c),c.onCompleted.bind(c))})},Ob.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return Yb()},c)},Ob.groupByUntil=function(a,d,e,g){var h=this;return d||(d=c),g||(g=f),new ec(function(c){var f={},i=new nb,j=new vb(i);return i.add(h.subscribe(function(h){var k,l,m,n,o,p,q,r,s,t;try{p=a(h),q=g(p)}catch(u){for(t in f)f[t].onError(u);return c.onError(u),void 0}n=!1;try{s=f[q],s||(s=new ic,f[q]=s,n=!0)}catch(u){for(t in f)f[t].onError(u);return c.onError(u),void 0}if(n){o=new gc(p,s,j),l=new gc(p,s);try{k=e(l)}catch(u){for(t in f)f[t].onError(u);return c.onError(u),void 0}c.onNext(o),r=new tb,i.add(r);var v=function(){q in f&&(delete f[q],s.onCompleted()),i.remove(r)};r.setDisposable(k.take(1).subscribe(b,function(a){for(t in f)f[t].onError(a);c.onError(a)},function(){v()}))}try{m=d(h)}catch(u){for(t in f)f[t].onError(u);return c.onError(u),void 0}s.onNext(m)},function(a){for(var b in f)f[b].onError(a);c.onError(a)},function(){for(var a in f)f[a].onCompleted();c.onCompleted()})),j})},Ob.select=Ob.map=function(a,b){var c=this;return new ec(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Ob.pluck=function(a){return this.select(function(b){return b[a]})},Ob.selectMany=Ob.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=h(e)?Vb(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?w.call(this,a):w.call(this,function(){return a})},Ob.selectSwitch=Ob.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},Ob.skip=function(a){if(0>a)throw new Error(G);var b=this;return new ec(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Ob.skipWhile=function(a,b){var c=this;return new ec(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Ob.take=function(a,b){if(0>a)throw new Error(G);if(0===a)return Wb(b);var c=this;return new ec(function(b){var d=a;return c.subscribe(function(a){d>0&&(d--,b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},Ob.takeWhile=function(a,b){var c=this;return new ec(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},Ob.where=Ob.filter=function(a,b){var c=this;return new ec(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})};var ec=D.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=rb:"function"==typeof a&&(a=qb(a)),a}function c(d){function e(a){var c=new fc(a);if(Bb.scheduleRequired())Bb.schedule(function(){try{c.setDisposable(b(d(c)))}catch(a){if(!c.fail(a))throw a}});else try{c.setDisposable(b(d(c)))}catch(e){if(!c.fail(e))throw e}return c}return this instanceof c?(a.call(this,e),void 0):new c(d)}return fb(c,a),c}(Ub),fc=function(a){function b(b){a.call(this),this.observer=b,this.m=new tb}fb(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.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Pb),gc=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 ec(function(a){return new nb(e.getDisposable(),d.subscribe(a))}):d}return fb(c,a),c}(Ub),hc=function(a,b){this.subject=a,this.observer=b};hc.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 ic=D.Subject=function(a){function b(a){return i.call(this),this.isStopped?this.exception?(a.onError(this.exception),rb):(a.onCompleted(),rb):(this.observers.push(a),new hc(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return fb(c,a),gb(c.prototype,Mb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(i.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(i.call(this),!this.isStopped)for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new jc(a,b)},c}(Ub),jc=(D.AsyncSubject=function(a){function b(a){if(i.call(this),!this.isStopped)return this.observers.push(a),new hc(this,a);var b=this.exception,c=this.hasValue,d=this.value;return b?a.onError(b):c?(a.onNext(d),a.onCompleted()):a.onCompleted(),rb}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return fb(c,a),gb(c.prototype,Mb,{hasObservers:function(){return i.call(this),this.observers.length>0},onCompleted:function(){var a,b,c;if(i.call(this),!this.isStopped){this.isStopped=!0;var d=this.observers.slice(0),e=this.value,f=this.hasValue;if(f)for(b=0,c=d.length;c>b;b++)a=d[b],a.onNext(e),a.onCompleted();else for(b=0,c=d.length;c>b;b++)d[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){i.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(Ub),function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){a.call(this,b),this.observer=c,this.observable=d}return fb(c,a),gb(c.prototype,Mb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Ub));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(y.Rx=D,define(function(){return D})):z&&A?B?(A.exports=D).Rx=D:z.Rx=D:y.Rx=D}).call(this);
1
+ (function(a){function b(){}function c(a){return a}function d(a,b){return db(a,b)}function e(a,b){return a-b}function f(a){return a.toString()}function g(a){throw a}function h(a){return"function"==typeof a.then&&a.then!==D.Observable.prototype.then}function i(){if(this.isDisposed)throw new Error(H)}function j(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function k(a){var b=[];if(!j(a))return b;cb.nonEnumArgs&&a.length&&o(a)&&(a=eb.call(a));var c=cb.enumPrototypes&&"function"==typeof a,d=cb.enumErrorProps&&(a===Y||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(cb.nonEnumShadows&&a!==Z){var f=a.constructor,g=-1,h=ab.length;if(a===(f&&f.prototype))var i=a===stringProto?U:a===Y?P:V.call(a),k=bb[i];for(;++g<h;)e=ab[g],k&&k[e]||!W.call(a,e)||b.push(e)}return b}function l(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 m(a,b){return l(a,b,k)}function n(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function o(a){return a&&"object"==typeof a?V.call(a)==L:!1}function p(a){return"function"==typeof a}function q(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=V.call(a),h=V.call(b);if(g==L&&(g=S),h==L&&(h=S),g!=h)return!1;switch(g){case N:case O:return+a==+b;case R:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case T:case U:return a==String(b)}var i=g==M;if(!i){if(g!=S||!cb.nodeClass&&(n(a)||n(b)))return!1;var j=!cb.argsObject&&o(a)?Object:a.constructor,k=!cb.argsObject&&o(b)?Object:b.constructor;if(!(j==k||W.call(a,"constructor")&&W.call(b,"constructor")||p(j)&&j instanceof j&&p(k)&&k instanceof k||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var l=c.length;l--;)if(c[l]==a)return d[l]==b;var r=0;if(result=!0,c.push(a),d.push(b),i){if(l=a.length,r=b.length,result=r==l)for(;r--;){var s=b[r];if(!(result=q(a[r],s,c,d)))break}}else m(b,function(b,e,f){return W.call(f,e)?(r++,result=W.call(a,e)&&q(a[e],b,c,d)):void 0}),result&&m(a,function(a,b,c){return W.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function r(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:eb.call(a)}function s(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){return new ec(function(c){var d=new tb,e=new ub;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)}d=new tb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function v(a,b){var c=this;return new ec(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 d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function w(a){return this.select(function(b,c){var d=a(b,c);return h(d)?Vb(d):d}).mergeObservable()}var x={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},y=x[typeof window]&&window||this,z=x[typeof exports]&&exports&&!exports.nodeType&&exports,A=x[typeof module]&&module&&!module.nodeType&&module,B=A&&A.exports===z&&z,C=x[typeof global]&&global;!C||C.global!==C&&C.window!==C||(y=C);var D={internals:{},config:{Promise:y.Promise}},E=function(){return Date.now?Date.now:function(){return+new Date}}(),F="Sequence contains no elements.",G="Argument out of range",H="Object has been disposed",I="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";y.Set&&"function"==typeof(new y.Set)["@@iterator"]&&(I="@@iterator");var J,K={done:!0,value:a},L="[object Arguments]",M="[object Array]",N="[object Boolean]",O="[object Date]",P="[object Error]",Q="[object Function]",R="[object Number]",S="[object Object]",T="[object RegExp]",U="[object String]",V=Object.prototype.toString,W=Object.prototype.hasOwnProperty,X=V.call(arguments)==L,Y=Error.prototype,Z=Object.prototype,$=Z.propertyIsEnumerable;try{J=!(V.call(document)==S&&!({toString:0}+""))}catch(_){J=!0}var ab=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bb={};bb[M]=bb[O]=bb[R]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},bb[N]=bb[U]={constructor:!0,toString:!0,valueOf:!0},bb[P]=bb[Q]=bb[T]={constructor:!0,toString:!0},bb[S]={constructor:!0};var cb={};!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);cb.enumErrorProps=$.call(Y,"message")||$.call(Y,"name"),cb.enumPrototypes=$.call(a,"prototype"),cb.nonEnumArgs=0!=c,cb.nonEnumShadows=!/valueOf/.test(b)}(1),X||(o=function(a){return a&&"object"==typeof a?W.call(a,"callee"):!1}),p(/x/)&&(p=function(a){return"function"==typeof a&&V.call(a)==Q});var db=D.internals.isEqual=function(a,b){return q(a,b,[],[])},eb=Array.prototype.slice,fb=({}.hasOwnProperty,this.inherits=D.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),gb=D.internals.addProperties=function(a){for(var b=eb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},hb=D.internals.addRef=function(a,b){return new ec(function(c){return new nb(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=eb.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(eb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(eb.call(arguments)))};return d});var ib=Object("a"),jb="a"!=ib[0]||!(0 in ib);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=jb&&{}.toString.call(this)==U?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Q)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=jb&&{}.toString.call(this)==U?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Q)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 Object.prototype.toString.call(a)==M}),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&&1/0!=d&&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});var kb=function(a,b){this.id=a,this.value=b};kb.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var lb=D.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},mb=lb.prototype;mb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},mb.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)}}},mb.heapify=function(b){if(b===a&&(b=0),!(b>=this.length||0>b)){var c=2*b+1,d=2*b+2,e=b;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==b){var f=this.items[b];this.items[b]=this.items[e],this.items[e]=f,this.heapify(e)}}},mb.peek=function(){return this.items[0].value},mb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},mb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},mb.enqueue=function(a){var b=this.length++;this.items[b]=new kb(lb.count++,a),this.percolate(b)},mb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},lb.count=0;var nb=D.CompositeDisposable=function(){this.disposables=r(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},ob=nb.prototype;ob.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},ob.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},ob.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},ob.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},ob.contains=function(a){return-1!==this.disposables.indexOf(a)},ob.toArray=function(){return this.disposables.slice(0)};var pb=D.Disposable=function(a){this.isDisposed=!1,this.action=a||b};pb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var qb=pb.create=function(a){return new pb(a)},rb=pb.empty={dispose:b},sb=function(){function a(a){this.isSingle=a,this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){if(this.current&&this.isSingle)throw new Error("Disposable has already been assigned");var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),tb=D.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return fb(b,a),b}(sb),ub=D.SerialDisposable=function(a){function b(){a.call(this,!1)}return fb(b,a),b}(sb),vb=D.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?rb:new a(this)},b}();t.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var wb=D.internals.ScheduledItem=function(a,b,c,d,f){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=f||e,this.disposable=new tb};wb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},wb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},wb.prototype.isCancelled=function(){return this.disposable.isDisposed},wb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var xb,yb=D.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){var c=b.first,d=b.second,e=new nb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),rb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new nb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),rb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),rb}var e=a.prototype;return e.catchException=e["catch"]=function(a){return new Db(this,a)},e.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},e.schedulePeriodicWithState=function(a,b,c){var d=a,e=setInterval(function(){d=c(d)},b);return qb(function(){clearInterval(e)})},e.schedule=function(a){return this._schedule(a,d)},e.scheduleWithState=function(a,b){return this._schedule(a,b)},e.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,d)},e.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},e.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,d)},e.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},e.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},e.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},function(a,c){return b(a,c)})},e.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},e.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})},a.now=E,a.normalize=function(a){return 0>a&&(a=0),a},a}(),zb=yb.normalize,Ab=(D.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 tb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),yb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=zb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new yb(E,a,b,c)}()),Bb=yb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-yb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+yb.normalize(c),g=new wb(this,b,d,f);if(e)e.enqueue(g);else{e=new lb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new yb(E,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),Cb=b;!function(){function a(){if(!y.postMessage||y.importScripts)return!1;var a=!1,b=y.onmessage;return y.onmessage=function(){a=!0},y.postMessage("","*"),y.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(V).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=C&&B&&C.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=C&&B&&C.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))xb=process.nextTick;else if("function"==typeof d)xb=d,Cb=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;y.addEventListener?y.addEventListener("message",b,!1):y.attachEvent("onmessage",b,!1),xb=function(a){var b=h++;g[b]=a,y.postMessage(f+b,"*")}}else if(y.MessageChannel){var i=new y.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},xb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in y&&"onreadystatechange"in y.document.createElement("script")?xb=function(a){var b=y.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},y.document.documentElement.appendChild(b)}:(xb=function(a){return setTimeout(a,0)},Cb=clearTimeout)}();var Db=(yb.timeout=function(){function a(a,b){var c=this,d=new tb,e=xb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new nb(d,qb(function(){Cb(e)}))}function b(a,b,c){var d=this,e=yb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new tb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new nb(f,qb(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new yb(E,a,b,c)}(),function(a){function b(){return this._scheduler.now()}function c(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function d(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function e(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function f(f,g){this._scheduler=f,this._handler=g,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,b,c,d,e)}return fb(f,a),f.prototype._clone=function(a){return new f(a,this._handler)},f.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 rb}}},f.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},f.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new tb;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},f}(yb)),Eb=D.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}var b=a.prototype;return b.accept=function(a,b,c){return 1===arguments.length&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},b.toObservable=function(a){var b=this;return a||(a=Ab),new ec(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Fb=Eb.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){var e=new Eb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Gb=Eb.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){var e=new Eb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Hb=Eb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Eb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Ib=D.internals.Enumerator=function(a){this._next=a};Ib.prototype.next=function(){return this._next()},Ib.prototype[I]=function(){return this};var Jb=D.internals.Enumerable=function(a){this._iterator=a};Jb.prototype[I]=function(){return this._iterator()},Jb.prototype.concat=function(){var a=this;return new ec(function(b){var c;try{c=a[I]()}catch(d){return void b.onError()}var e,f=new ub,g=Ab.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=new tb;f.setDisposable(h),h.setDisposable(d.value.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new nb(f,g,qb(function(){e=!0}))})},Jb.prototype.catchException=function(){var a=this;return new ec(function(b){var c;try{c=a[I]()}catch(d){return void b.onError()}var e,f,g=new ub,h=Ab.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=new tb;g.setDisposable(i),i.setDisposable(d.value.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new nb(g,h,qb(function(){e=!0}))})};var Kb=Jb.repeat=function(a,b){return null==b&&(b=-1),new Jb(function(){var c=b;return new Ib(function(){return 0===c?K:(c>0&&c--,{done:!1,value:a})})})},Lb=Jb.forEach=function(a,b,d){return b||(b=c),new Jb(function(){var c=-1;return new Ib(function(){return++c<a.length?{done:!1,value:b.call(d,a[c],c,a)}:K})})},Mb=D.Observer=function(){};Mb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Mb.prototype.asObserver=function(){return new Qb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Mb.prototype.checked=function(){return new Rb(this)};var Nb=Mb.create=function(a,c,d){return a||(a=b),c||(c=g),d||(d=b),new Qb(a,c,d)};Mb.fromNotifier=function(a){return new Qb(function(b){return a(Fb(b))},function(b){return a(Gb(b))},function(){return a(Hb())})},Mb.notifyOn=function(a){return new Tb(a,this)};var Ob,Pb=D.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return fb(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}(Mb),Qb=D.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return fb(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}(Pb),Rb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}fb(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}(Mb),Sb=D.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 ub}return fb(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}(Pb),Tb=function(a){function b(){a.apply(this,arguments)}return fb(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}(Sb),Ub=D.Observable=function(){function a(a){this._subscribe=a}return Ob=a.prototype,Ob.finalValue=function(){var a=this;return new ec(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(F))})})},Ob.subscribe=Ob.forEach=function(a,b,c){var d;return d="object"==typeof a?a:Nb(a,b,c),this._subscribe(d)},Ob.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}();Ob.observeOn=function(a){var b=this;return new ec(function(c){return b.subscribe(new Tb(a,c))})},Ob.subscribeOn=function(a){var b=this;return new ec(function(c){var d=new tb,e=new ub;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e})};var Vb=Ub.fromPromise=function(a){return new ec(function(b){a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)})})};Ob.toPromise=function(a){if(a||(a=D.config.Promise),!a)throw new Error("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},function(a){c(a)},function(){e&&a(d)})})},Ub.create=Ub.createWithDisposable=function(a){return new ec(a)};var Wb=(Ub.defer=function(a){return new ec(function(b){var c;try{c=a()}catch(d){return $b(d).subscribe(b)}return c.subscribe(b)})},Ub.empty=function(a){return a||(a=Ab),new ec(function(b){return a.schedule(function(){b.onCompleted()})})}),Xb=Ub.fromArray=function(a,b){return b||(b=Bb),new ec(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Ub.fromIterable=function(a,b){return b||(b=Bb),new ec(function(c){var d;try{d=a[I]()}catch(e){return void c.onError(e)}return b.scheduleRecursive(function(a){var b;try{b=d.next()}catch(e){return void c.onError(e)}b.done?c.onCompleted():(c.onNext(b.value),a())})})},Ub.generate=function(a,b,c,d,e){return e||(e=Bb),new ec(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var Yb=Ub.never=function(){return new ec(function(){return rb})};Ub.range=function(a,b,c){return c||(c=Bb),new ec(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Ub.repeat=function(a,b,c){return c||(c=Bb),null==b&&(b=-1),Zb(a,c).repeat(b)};var Zb=Ub["return"]=Ub.returnValue=function(a,b){return b||(b=Ab),new ec(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},$b=Ub["throw"]=Ub.throwException=function(a,b){return b||(b=Ab),new ec(function(c){return b.schedule(function(){c.onError(a)})})};Ub.using=function(a,b){return new ec(function(c){var d,e,f=rb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new nb($b(g).subscribe(c),f)}return new nb(e.subscribe(c),f)})},Ob.amb=function(a){var b=this;return new ec(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new tb,j=new tb;return 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 nb(i,j)})},Ub.amb=function(){function a(a,b){return a.amb(b)}for(var b=Yb(),c=r(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Ob["catch"]=Ob.catchException=function(a){return"function"==typeof a?u(this,a):_b([this,a])};var _b=Ub.catchException=Ub["catch"]=function(){var a=r(arguments,0);return Lb(a).catchException()};Ob.combineLatest=function(){var a=eb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),ac.apply(this,a)};var ac=Ub.combineLatest=function(){var a=eb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new ec(function(d){function e(a){var e;if(i[a]=!0,j||(j=i.every(c))){try{e=b.apply(null,l)}catch(f){return void d.onError(f)}d.onNext(e)}else k.filter(function(b,c){return c!==a}).every(c)&&d.onCompleted()}function f(a){k[a]=!0,k.every(c)&&d.onCompleted()}for(var g=function(){return!1},h=a.length,i=s(h,g),j=!1,k=s(h,g),l=new Array(h),m=new Array(h),n=0;h>n;n++)!function(b){m[b]=new tb,m[b].setDisposable(a[b].subscribe(function(a){l[b]=a,e(b)},d.onError.bind(d),function(){f(b)}))}(n);return new nb(m)})};Ob.concat=function(){var a=eb.call(arguments,0);return a.unshift(this),bc.apply(this,a)};var bc=Ub.concat=function(){var a=r(arguments,0);return Lb(a).concat()};Ob.concatObservable=Ob.concatAll=function(){return this.merge(1)},Ob.merge=function(a){if("number"!=typeof a)return cc(this,a);var b=this;return new ec(function(c){var d=0,e=new nb,f=!1,g=[],i=function(a){var b=new tb;e.add(b),h(a)&&(a=Vb(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){var a;e.remove(b),g.length>0?(a=g.shift(),i(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,i(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var cc=Ub.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=eb.call(arguments,1)):(a=Ab,b=eb.call(arguments,0)):(a=Ab,b=eb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Xb(b,a).mergeObservable()};Ob.mergeObservable=Ob.mergeAll=function(){var a=this;return new ec(function(b){var c=new nb,d=!1,e=new tb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new tb;c.add(e),h(a)&&(a=Vb(a)),e.setDisposable(a.subscribe(function(a){b.onNext(a)},b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},Ob.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return dc([this,a])};var dc=Ub.onErrorResumeNext=function(){var a=r(arguments,0);return new ec(function(b){var c=0,d=new ub,e=Ab.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],g=new tb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new nb(d,e)})};Ob.skipUntil=function(a){var b=this;return new ec(function(c){var d=!1,e=new nb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new tb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Ob["switch"]=Ob.switchLatest=function(){var a=this;return new ec(function(b){var c=!1,d=new ub,e=!1,f=0,g=a.subscribe(function(a){var g=new tb,i=++f;c=!0,d.setDisposable(g),h(a)&&(a=Vb(a)),g.setDisposable(a.subscribe(function(a){f===i&&b.onNext(a)},function(a){f===i&&b.onError(a)},function(){f===i&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new nb(g,d)})},Ob.takeUntil=function(a){var c=this;return new ec(function(d){return new nb(c.subscribe(d),a.subscribe(d.onCompleted.bind(d),d.onError.bind(d),b))})},Ob.zip=function(){if(Array.isArray(arguments[0]))return v.apply(this,arguments);var a=this,b=eb.call(arguments),d=b.pop();return b.unshift(a),new ec(function(e){function f(a){i[a]=!0,i.every(function(a){return a})&&e.onCompleted()}for(var g=b.length,h=s(g,function(){return[]}),i=s(g,function(){return!1}),j=function(b){var f,g;if(h.every(function(a){return a.length>0})){try{g=h.map(function(a){return a.shift()}),f=d.apply(a,g)}catch(j){return void e.onError(j)}e.onNext(f)}else i.filter(function(a,c){return c!==b}).every(c)&&e.onCompleted()},k=new Array(g),l=0;g>l;l++)!function(a){k[a]=new tb,k[a].setDisposable(b[a].subscribe(function(b){h[a].push(b),j(a)},e.onError.bind(e),function(){f(a)}))}(l);return new nb(k)})},Ub.zip=function(){var a=eb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Ub.zipArray=function(){var a=r(arguments,0);return new ec(function(b){function d(a){if(g.every(function(a){return a.length>0})){var d=g.map(function(a){return a.shift()});b.onNext(d)}else if(h.filter(function(b,c){return c!==a}).every(c))return void b.onCompleted()}function e(a){return h[a]=!0,h.every(c)?void b.onCompleted():void 0}for(var f=a.length,g=s(f,function(){return[]}),h=s(f,function(){return!1}),i=new Array(f),j=0;f>j;j++)!function(c){i[c]=new tb,i[c].setDisposable(a[c].subscribe(function(a){g[c].push(a),d(c)
2
+ },b.onError.bind(b),function(){e(c)}))}(j);var k=new nb(i);return k.add(qb(function(){for(var a=0,b=g.length;b>a;a++)g[a]=[]})),k})},Ob.asObservable=function(){var a=this;return new ec(function(b){return a.subscribe(b)})},Ob.bufferWithCount=function(a,b){return 1===arguments.length&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Ob.dematerialize=function(){var a=this;return new ec(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Ob.distinctUntilChanged=function(a,b){var e=this;return a||(a=c),b||(b=d),new ec(function(c){var d,f=!1;return e.subscribe(function(e){var g,h=!1;try{g=a(e)}catch(i){return void c.onError(i)}if(f)try{h=b(d,g)}catch(i){return void c.onError(i)}f&&h||(f=!0,d=g,c.onNext(e))},c.onError.bind(c),c.onCompleted.bind(c))})},Ob["do"]=Ob.doAction=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new ec(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b){try{b(c)}catch(d){a.onError(d)}a.onError(c)}else a.onError(c)},function(){if(c){try{c()}catch(b){a.onError(b)}a.onCompleted()}else a.onCompleted()})})},Ob["finally"]=Ob.finallyAction=function(a){var b=this;return new ec(function(c){var d=b.subscribe(c);return qb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Ob.ignoreElements=function(){var a=this;return new ec(function(c){return a.subscribe(b,c.onError.bind(c),c.onCompleted.bind(c))})},Ob.materialize=function(){var a=this;return new ec(function(b){return a.subscribe(function(a){b.onNext(Fb(a))},function(a){b.onNext(Gb(a)),b.onCompleted()},function(){b.onNext(Hb()),b.onCompleted()})})},Ob.repeat=function(a){return Kb(this,a).concat()},Ob.retry=function(a){return Kb(this,a).catchException()},Ob.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new ec(function(e){var f,g,h;return d.subscribe(function(d){try{h||(h=!0),f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},Ob.skipLast=function(a){var b=this;return new ec(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},Ob.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=Ab,a=eb.call(arguments,c),Lb([Xb(a,b),this]).concat()},Ob.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Xb(a,b)})},Ob.takeLastBuffer=function(a){var b=this;return new ec(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},Ob.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(G);if(1===arguments.length&&(b=a),0>=b)throw new Error(G);return new ec(function(d){var e=new tb,f=new vb(e),g=0,h=[],i=function(){var a=new ic;h.push(a),d.onNext(hb(a,f))};return i(),e.setDisposable(c.subscribe(function(c){for(var d,e=0,f=h.length;f>e;e++)h[e].onNext(c);var j=g-a+1;j>=0&&j%b===0&&(d=h.shift(),d.onCompleted()),g++,g%b===0&&i()},function(a){for(;h.length>0;)h.shift().onError(a);d.onError(a)},function(){for(;h.length>0;)h.shift().onCompleted();d.onCompleted()})),f})},Ob.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new ec(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},Ob.distinct=function(a,b){var d=this;return a||(a=c),b||(b=f),new ec(function(c){var e={};return d.subscribe(function(d){var f,g,h,i=!1;try{f=a(d),g=b(f)}catch(j){return void c.onError(j)}for(h in e)if(g===h){i=!0;break}i||(e[g]=null,c.onNext(d))},c.onError.bind(c),c.onCompleted.bind(c))})},Ob.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return Yb()},c)},Ob.groupByUntil=function(a,d,e,g){var h=this;return d||(d=c),g||(g=f),new ec(function(c){var f={},i=new nb,j=new vb(i);return i.add(h.subscribe(function(h){var k,l,m,n,o,p,q,r,s,t;try{p=a(h),q=g(p)}catch(u){for(t in f)f[t].onError(u);return void c.onError(u)}n=!1;try{s=f[q],s||(s=new ic,f[q]=s,n=!0)}catch(u){for(t in f)f[t].onError(u);return void c.onError(u)}if(n){o=new gc(p,s,j),l=new gc(p,s);try{k=e(l)}catch(u){for(t in f)f[t].onError(u);return void c.onError(u)}c.onNext(o),r=new tb,i.add(r);var v=function(){q in f&&(delete f[q],s.onCompleted()),i.remove(r)};r.setDisposable(k.take(1).subscribe(b,function(a){for(t in f)f[t].onError(a);c.onError(a)},function(){v()}))}try{m=d(h)}catch(u){for(t in f)f[t].onError(u);return void c.onError(u)}s.onNext(m)},function(a){for(var b in f)f[b].onError(a);c.onError(a)},function(){for(var a in f)f[a].onCompleted();c.onCompleted()})),j})},Ob.select=Ob.map=function(a,b){var c=this;return new ec(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Ob.pluck=function(a){return this.select(function(b){return b[a]})},Ob.selectMany=Ob.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=h(e)?Vb(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?w.call(this,a):w.call(this,function(){return a})},Ob.selectSwitch=Ob.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},Ob.skip=function(a){if(0>a)throw new Error(G);var b=this;return new ec(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Ob.skipWhile=function(a,b){var c=this;return new ec(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Ob.take=function(a,b){if(0>a)throw new Error(G);if(0===a)return Wb(b);var c=this;return new ec(function(b){var d=a;return c.subscribe(function(a){d>0&&(d--,b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},Ob.takeWhile=function(a,b){var c=this;return new ec(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},Ob.where=Ob.filter=function(a,b){var c=this;return new ec(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})};var ec=D.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=rb:"function"==typeof a&&(a=qb(a)),a}function c(d){function e(a){var c=new fc(a);if(Bb.scheduleRequired())Bb.schedule(function(){try{c.setDisposable(b(d(c)))}catch(a){if(!c.fail(a))throw a}});else try{c.setDisposable(b(d(c)))}catch(e){if(!c.fail(e))throw e}return c}return this instanceof c?void a.call(this,e):new c(d)}return fb(c,a),c}(Ub),fc=function(a){function b(b){a.call(this),this.observer=b,this.m=new tb}fb(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.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Pb),gc=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 ec(function(a){return new nb(e.getDisposable(),d.subscribe(a))}):d}return fb(c,a),c}(Ub),hc=function(a,b){this.subject=a,this.observer=b};hc.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 ic=D.Subject=function(a){function b(a){return i.call(this),this.isStopped?this.exception?(a.onError(this.exception),rb):(a.onCompleted(),rb):(this.observers.push(a),new hc(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return fb(c,a),gb(c.prototype,Mb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(i.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(i.call(this),!this.isStopped)for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new jc(a,b)},c}(Ub),jc=(D.AsyncSubject=function(a){function b(a){if(i.call(this),!this.isStopped)return this.observers.push(a),new hc(this,a);var b=this.exception,c=this.hasValue,d=this.value;return b?a.onError(b):c?(a.onNext(d),a.onCompleted()):a.onCompleted(),rb}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return fb(c,a),gb(c.prototype,Mb,{hasObservers:function(){return i.call(this),this.observers.length>0},onCompleted:function(){var a,b,c;if(i.call(this),!this.isStopped){this.isStopped=!0;var d=this.observers.slice(0),e=this.value,f=this.hasValue;if(f)for(b=0,c=d.length;c>b;b++)a=d[b],a.onNext(e),a.onCompleted();else for(b=0,c=d.length;c>b;b++)d[b].onCompleted();this.observers=[]}},onError:function(a){if(i.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){i.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(Ub),function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){a.call(this,b),this.observer=c,this.observable=d}return fb(c,a),gb(c.prototype,Mb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Ub));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(y.Rx=D,define(function(){return D})):z&&A?B?(A.exports=D).Rx=D:z.Rx=D:y.Rx=D}).call(this);
@@ -1,4 +1,4 @@
1
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
1
+ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
2
 
3
3
  ;(function (factory) {
4
4
  var objectTypes = {
@@ -33,35 +33,35 @@
33
33
  }
34
34
  }.call(this, function (root, exp, Rx, undefined) {
35
35
 
36
- // Aliases
37
- var Observable = Rx.Observable,
38
- observableProto = Observable.prototype,
39
- AnonymousObservable = Rx.AnonymousObservable,
40
- observableConcat = Observable.concat,
41
- observableDefer = Observable.defer,
42
- observableEmpty = Observable.empty,
43
- disposableEmpty = Rx.Disposable.empty,
44
- CompositeDisposable = Rx.CompositeDisposable,
45
- SerialDisposable = Rx.SerialDisposable,
46
- SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
47
- Enumerator = Rx.internals.Enumerator,
48
- Enumerable = Rx.internals.Enumerable,
49
- enumerableForEach = Enumerable.forEach,
50
- immediateScheduler = Rx.Scheduler.immediate,
51
- currentThreadScheduler = Rx.Scheduler.currentThread,
52
- slice = Array.prototype.slice,
53
- AsyncSubject = Rx.AsyncSubject,
54
- Observer = Rx.Observer,
55
- inherits = Rx.internals.inherits,
56
- addProperties = Rx.internals.addProperties;
57
-
58
- // Utilities
59
- function nothing () { }
60
- function argsOrArray(args, idx) {
61
- return args.length === 1 && Array.isArray(args[idx]) ?
62
- args[idx] :
63
- slice.call(args);
64
- }
36
+ // Aliases
37
+ var Observable = Rx.Observable,
38
+ observableProto = Observable.prototype,
39
+ AnonymousObservable = Rx.AnonymousObservable,
40
+ observableConcat = Observable.concat,
41
+ observableDefer = Observable.defer,
42
+ observableEmpty = Observable.empty,
43
+ disposableEmpty = Rx.Disposable.empty,
44
+ CompositeDisposable = Rx.CompositeDisposable,
45
+ SerialDisposable = Rx.SerialDisposable,
46
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
47
+ Enumerator = Rx.internals.Enumerator,
48
+ Enumerable = Rx.internals.Enumerable,
49
+ enumerableForEach = Enumerable.forEach,
50
+ immediateScheduler = Rx.Scheduler.immediate,
51
+ currentThreadScheduler = Rx.Scheduler.currentThread,
52
+ slice = Array.prototype.slice,
53
+ AsyncSubject = Rx.AsyncSubject,
54
+ Observer = Rx.Observer,
55
+ inherits = Rx.internals.inherits,
56
+ addProperties = Rx.internals.addProperties;
57
+
58
+ // Utilities
59
+ function nothing () { }
60
+ function argsOrArray(args, idx) {
61
+ return args.length === 1 && Array.isArray(args[idx]) ?
62
+ args[idx] :
63
+ slice.call(args);
64
+ }
65
65
 
66
66
  // Shim in iterator support
67
67
  var $iterator$ = (typeof Symbol === 'object' && Symbol.iterator) ||
@@ -456,5 +456,5 @@
456
456
 
457
457
  }(Observable));
458
458
 
459
- return Rx;
459
+ return Rx;
460
460
  }));
@@ -1 +1 @@
1
- (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(){}function f(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:w.call(a)}function g(a,b){return new s(function(){return new r(function(){return a()?{done:!1,value:b}:{done:!0,value:d}})})}var h=c.Observable,i=h.prototype,j=c.AnonymousObservable,k=h.concat,l=h.defer,m=h.empty,n=c.Disposable.empty,o=c.CompositeDisposable,p=c.SerialDisposable,q=c.SingleAssignmentDisposable,r=c.internals.Enumerator,s=c.internals.Enumerable,t=s.forEach,u=c.Scheduler.immediate,v=c.Scheduler.currentThread,w=Array.prototype.slice,x=c.AsyncSubject,y=c.Observer,z=c.internals.inherits,A=c.internals.addProperties,B="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(B="@@iterator");i.letBind=i.let=function(a){return a(this)},h["if"]=h.ifThen=function(a,b,c){return l(function(){if(c||(c=m()),c.now){var d=c;c=m(d)}return a()?b:c})},h["for"]=h.forIn=function(a,b){return t(a,b).concat()};var C=h["while"]=h.whileDo=function(a,b){return g(a,b).concat()};i.doWhile=function(a){return k([this,C(a,this)])},h["case"]=h.switchCase=function(a,b,c){return l(function(){if(c||(c=m()),c.now){var e=c;c=m(e)}var f=b[a()];return f!==d?f:c})},i.expand=function(a,b){b||(b=u);var c=this;return new j(function(d){var e=[],f=new p,g=new o(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return i=!1,void 0;c=e.shift();var f=new q;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g})},h.forkJoin=function(){var a=f(arguments,0);return new j(function(b){var c=a.length;if(0===c)return b.onCompleted(),n;for(var d=new o,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return b.onCompleted(),void 0;g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},i.forkJoin=function(a,b){var c=this;return new j(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new q,l=new q;return k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return d.onError(c),void 0}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return d.onError(c),void 0}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new o(k,l)})},i.manySelect=function(a,b){b||(b=u);var c=this;return l(function(){var d;return c.select(function(a){var b=new D(a);return d&&d.onNext(a),d=b,b}).doAction(e,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).select(function(b,c,d){return a(b,c,d)})})};var D=function(a){function b(a){var b=this,c=new o;return c.add(v.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeObservable().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new x}return z(c,a),A(c.prototype,y,{onCompleted:function(){this.onNext(h.empty())},onError:function(a){this.onNext(h.throwException(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(h);return c});
1
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(){}function f(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:w.call(a)}function g(a,b){return new s(function(){return new r(function(){return a()?{done:!1,value:b}:{done:!0,value:d}})})}var h=c.Observable,i=h.prototype,j=c.AnonymousObservable,k=h.concat,l=h.defer,m=h.empty,n=c.Disposable.empty,o=c.CompositeDisposable,p=c.SerialDisposable,q=c.SingleAssignmentDisposable,r=c.internals.Enumerator,s=c.internals.Enumerable,t=s.forEach,u=c.Scheduler.immediate,v=c.Scheduler.currentThread,w=Array.prototype.slice,x=c.AsyncSubject,y=c.Observer,z=c.internals.inherits,A=c.internals.addProperties,B="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(B="@@iterator");i.letBind=i.let=function(a){return a(this)},h["if"]=h.ifThen=function(a,b,c){return l(function(){if(c||(c=m()),c.now){var d=c;c=m(d)}return a()?b:c})},h["for"]=h.forIn=function(a,b){return t(a,b).concat()};var C=h["while"]=h.whileDo=function(a,b){return g(a,b).concat()};i.doWhile=function(a){return k([this,C(a,this)])},h["case"]=h.switchCase=function(a,b,c){return l(function(){if(c||(c=m()),c.now){var e=c;c=m(e)}var f=b[a()];return f!==d?f:c})},i.expand=function(a,b){b||(b=u);var c=this;return new j(function(d){var e=[],f=new p,g=new o(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new q;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g})},h.forkJoin=function(){var a=f(arguments,0);return new j(function(b){var c=a.length;if(0===c)return b.onCompleted(),n;for(var d=new o,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},i.forkJoin=function(a,b){var c=this;return new j(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new q,l=new q;return k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new o(k,l)})},i.manySelect=function(a,b){b||(b=u);var c=this;return l(function(){var d;return c.select(function(a){var b=new D(a);return d&&d.onNext(a),d=b,b}).doAction(e,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).select(function(b,c,d){return a(b,c,d)})})};var D=function(a){function b(a){var b=this,c=new o;return c.add(v.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeObservable().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new x}return z(c,a),A(c.prototype,y,{onCompleted:function(){this.onNext(h.empty())},onError:function(a){this.onNext(h.throwException(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(h);return c});