rxjs-rails 2.2.19 → 2.2.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
- (function(a){function b(){if(this.isDisposed)throw new Error(L)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;gb.nonEnumArgs&&a.length&&h(a)&&(a=ib.call(a));var d=gb.enumPrototypes&&"function"==typeof a,e=gb.enumErrorProps&&(a===ab||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(gb.nonEnumShadows&&a!==bb){var g=a.constructor,i=-1,j=eb.length;if(a===(g&&g.prototype))var k=a===stringProto?Y:a===ab?T:Z.call(a),l=fb[k];for(;++i<j;)f=eb[i],l&&l[f]||!$.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?Z.call(a)==P:!1}function i(a){return"function"==typeof a}function j(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,k=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=k&&"object"!=k))return!1;var l=Z.call(a),m=Z.call(b);if(l==P&&(l=W),m==P&&(m=W),l!=m)return!1;switch(l){case R:case S:return+a==+b;case V:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case X:case Y:return a==String(b)}var n=l==Q;if(!n){if(l!=W||!gb.nodeClass&&(g(a)||g(b)))return!1;var o=!gb.argsObject&&h(a)?Object:a.constructor,p=!gb.argsObject&&h(b)?Object:b.constructor;if(!(o==p||$.call(a,"constructor")&&$.call(b,"constructor")||i(o)&&o instanceof o&&i(p)&&p instanceof p||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(result=!0,c.push(a),d.push(b),n){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=j(a[r],s,c,d)))break}}else f(b,function(b,e,f){return $.call(f,e)?(r++,result=$.call(a,e)&&j(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return $.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function k(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ib.call(a)}function l(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function m(a,b){return new mc(function(c){var d=new ub,e=new vb;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 ub,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function n(a,b){var c=this;return new mc(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 o(a){return this.select(function(b,c){var d=a(b,c);return I(d)?ec(d):d}).mergeObservable()}function p(a,b,c){if(a.addListener)return a.addListener(b,c),rb(function(){a.removeListener(b,c)});if(a.addEventListener)return a.addEventListener(b,c,!1),rb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function q(a,b,c){var d=new ob;if("function"==typeof a.item&&"number"==typeof a.length)for(var e=0,f=a.length;f>e;e++)d.add(q(a.item(e),b,c));else a&&d.add(p(a,b,c));return d}function r(a,b){var c=zb(a);return new mc(function(a){return b.scheduleWithRelative(c,function(){a.onNext(0),a.onCompleted()})})}function s(a,b,c){return a===b?new mc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Tb(function(){return observableTimerDateAndPeriod(c.now()+a,b,c)})}function t(a,b){return new mc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new ob(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function u(a,b,c){return new mc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(D))){try{e=c.apply(null,j)}catch(f){return void d.onError(f)}d.onNext(e)}else i&&d.onCompleted()}var f=2,g=[!1,!1],h=!1,i=!1,j=new Array(f);return new ob(a.subscribe(function(a){e(a,0)},d.onError.bind(d),function(){i=!0,d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d)))})}var v={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},w=v[typeof window]&&window||this,x=v[typeof exports]&&exports&&!exports.nodeType&&exports,y=v[typeof module]&&module&&!module.nodeType&&module,z=y&&y.exports===x&&x,A=v[typeof global]&&global;!A||A.global!==A&&A.window!==A||(w=A);var B={internals:{},config:{Promise:w.Promise},helpers:{}},C=B.helpers.noop=function(){},D=B.helpers.identity=function(a){return a},E=B.helpers.defaultNow=Date.now,F=B.helpers.defaultComparer=function(a,b){return hb(a,b)},G=B.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},H=(B.helpers.defaultKeySerializer=function(a){return a.toString()},B.helpers.defaultError=function(a){throw a}),I=B.helpers.isPromise=function(a){return"function"==typeof a.then&&a.then!==B.Observable.prototype.then},J=(B.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},B.helpers.not=function(a){return!a},"Sequence contains no elements."),K="Argument out of range",L="Object has been disposed",M="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";w.Set&&"function"==typeof(new w.Set)["@@iterator"]&&(M="@@iterator");var N,O={done:!0,value:a},P="[object Arguments]",Q="[object Array]",R="[object Boolean]",S="[object Date]",T="[object Error]",U="[object Function]",V="[object Number]",W="[object Object]",X="[object RegExp]",Y="[object String]",Z=Object.prototype.toString,$=Object.prototype.hasOwnProperty,_=Z.call(arguments)==P,ab=Error.prototype,bb=Object.prototype,cb=bb.propertyIsEnumerable;try{N=!(Z.call(document)==W&&!({toString:0}+""))}catch(db){N=!0}var eb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],fb={};fb[Q]=fb[S]=fb[V]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},fb[R]=fb[Y]={constructor:!0,toString:!0,valueOf:!0},fb[T]=fb[U]=fb[X]={constructor:!0,toString:!0},fb[W]={constructor:!0};var gb={};!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);gb.enumErrorProps=cb.call(ab,"message")||cb.call(ab,"name"),gb.enumPrototypes=cb.call(a,"prototype"),gb.nonEnumArgs=0!=c,gb.nonEnumShadows=!/valueOf/.test(b)}(1),_||(h=function(a){return a&&"object"==typeof a?$.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&Z.call(a)==U});var hb=B.internals.isEqual=function(a,b){return j(a,b,[],[])},ib=Array.prototype.slice,jb=({}.hasOwnProperty,this.inherits=B.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),kb=B.internals.addProperties=function(a){for(var b=ib.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},lb=(B.internals.addRef=function(a,b){return new mc(function(c){return new ob(b.getDisposable(),a.subscribe(c))})},function(a,b){this.id=a,this.value=b});lb.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var mb=B.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},nb=mb.prototype;nb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},nb.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)}}},nb.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)}}},nb.peek=function(){return this.items[0].value},nb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},nb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},nb.enqueue=function(a){var b=this.length++;this.items[b]=new lb(mb.count++,a),this.percolate(b)},nb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},mb.count=0;var ob=B.CompositeDisposable=function(){this.disposables=k(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},pb=ob.prototype;pb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},pb.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},pb.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()}},pb.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()},pb.contains=function(a){return-1!==this.disposables.indexOf(a)},pb.toArray=function(){return this.disposables.slice(0)};var qb=B.Disposable=function(a){this.isDisposed=!1,this.action=a||C};qb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var rb=qb.create=function(a){return new qb(a)},sb=qb.empty={dispose:C},tb=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}(),ub=B.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return jb(b,a),b}(tb),vb=B.SerialDisposable=function(a){function b(){a.call(this,!1)}return jb(b,a),b}(tb),wb=(B.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?sb:new a(this)},b}(),B.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||G,this.disposable=new ub});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=B.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 ob,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),sb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new ob,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),sb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),sb}var e=a.prototype;return 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 rb(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=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 mb(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.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 ub;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),C);!function(){function a(){if(!w.postMessage||w.importScripts)return!1;var a=!1,b=w.onmessage;return w.onmessage=function(){a=!0},w.postMessage("","*"),w.onmessage=b,a}function 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(Z).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=A&&z&&A.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=A&&z&&A.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;w.addEventListener?w.addEventListener("message",b,!1):w.attachEvent("onmessage",b,!1),xb=function(a){var b=h++;g[b]=a,w.postMessage(f+b,"*")}}else if(w.MessageChannel){var i=new w.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 w&&"onreadystatechange"in w.document.createElement("script")?xb=function(a){var b=w.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},w.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 ub,e=xb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new ob(d,rb(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 ub,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new ob(f,rb(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new yb(E,a,b,c)}(),Eb=B.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 mc(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=B.internals.Enumerator=function(a){this._next=a};Ib.prototype.next=function(){return this._next()},Ib.prototype[M]=function(){return this};var Jb=B.internals.Enumerable=function(a){this._iterator=a};Jb.prototype[M]=function(){return this._iterator()},Jb.prototype.concat=function(){var a=this;return new mc(function(b){var c;try{c=a[M]()}catch(d){return void b.onError()}var e,f=new vb,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=d.value;I(h)&&(h=ec(h));var i=new ub;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new ob(f,g,rb(function(){e=!0}))})},Jb.prototype.catchException=function(){var a=this;return new mc(function(b){var c;try{c=a[M]()}catch(d){return void b.onError()}var e,f,g=new vb,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=d.value;I(i)&&(i=ec(i));var j=new ub;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new ob(g,h,rb(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?O:(c>0&&c--,{done:!1,value:a})})})},Lb=Jb.forEach=function(a,b,c){return b||(b=D),new Jb(function(){var d=-1;return new Ib(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:O})})},Mb=B.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))};var Nb=Mb.create=function(a,b,c){return a||(a=C),b||(b=H),c||(c=C),new Qb(a,b,c)};Mb.fromNotifier=function(a){return new Qb(function(b){return a(Fb(b))},function(b){return a(Gb(b))},function(){return a(Hb())})};var Ob,Pb=B.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return jb(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=B.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return jb(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=B.Observable=function(){function a(a){this._subscribe=a}return Ob=a.prototype,Ob.finalValue=function(){var a=this;return new mc(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(J))})})},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}(),Sb=B.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 vb}return jb(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);Rb.create=Rb.createWithDisposable=function(a){return new mc(a)};var Tb=Rb.defer=function(a){return new mc(function(b){var c;try{c=a()}catch(d){return Yb(d).subscribe(b)}return I(c)&&(c=ec(c)),c.subscribe(b)})},Ub=Rb.empty=function(a){return a||(a=Ab),new mc(function(b){return a.schedule(function(){b.onCompleted()})})},Vb=Rb.fromArray=function(a,b){return b||(b=Bb),new mc(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Rb.fromIterable=function(a,b){return b||(b=Bb),new mc(function(c){var d;try{d=a[M]()}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())})})},Rb.generate=function(a,b,c,d,e){return e||(e=Bb),new mc(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 Wb=Rb.never=function(){return new mc(function(){return sb})};Rb.range=function(a,b,c){return c||(c=Bb),new mc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Rb.repeat=function(a,b,c){return c||(c=Bb),null==b&&(b=-1),Xb(a,c).repeat(b)};var Xb=Rb["return"]=Rb.returnValue=function(a,b){return b||(b=Ab),new mc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Yb=Rb["throw"]=Rb.throwException=function(a,b){return b||(b=Ab),new mc(function(c){return b.schedule(function(){c.onError(a)})})};Ob["catch"]=Ob.catchException=function(a){return"function"==typeof a?m(this,a):Zb([this,a])};var Zb=Rb.catchException=Rb["catch"]=function(){var a=k(arguments,0);return Lb(a).catchException()};Ob.combineLatest=function(){var a=ib.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),$b.apply(this,a)};var $b=Rb.combineLatest=function(){var a=ib.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new mc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(D))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(D)&&c.onCompleted()}function e(a){j[a]=!0,j.every(D)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=l(g,f),i=!1,j=l(g,f),k=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){m[b]=new ub,m[b].setDisposable(a[b].subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)}))}(n);return new ob(m)})};Ob.concat=function(){var a=ib.call(arguments,0);return a.unshift(this),_b.apply(this,a)};var _b=Rb.concat=function(){var a=k(arguments,0);return Lb(a).concat()};Ob.concatObservable=Ob.concatAll=function(){return this.merge(1)},Ob.merge=function(a){if("number"!=typeof a)return ac(this,a);var b=this;return new mc(function(c){var d=0,e=new ob,f=!1,g=[],h=function(a){var b=new ub;e.add(b),I(a)&&(a=ec(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(),h(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,h(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var ac=Rb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ib.call(arguments,1)):(a=Ab,b=ib.call(arguments,0)):(a=Ab,b=ib.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Vb(b,a).mergeObservable()};Ob.mergeObservable=Ob.mergeAll=function(){var a=this;return new mc(function(b){var c=new ob,d=!1,e=new ub;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new ub;c.add(e),I(a)&&(a=ec(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.skipUntil=function(a){var b=this;return new mc(function(c){var d=!1,e=new ob(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new ub;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 mc(function(b){var c=!1,d=new vb,e=!1,f=0,g=a.subscribe(function(a){var g=new ub,h=++f;c=!0,d.setDisposable(g),I(a)&&(a=ec(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new ob(g,d)})},Ob.takeUntil=function(a){var b=this;return new mc(function(c){return new ob(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),C))})},Ob.zip=function(){if(Array.isArray(arguments[0]))return n.apply(this,arguments);var a=this,b=ib.call(arguments),c=b.pop();return b.unshift(a),new mc(function(d){function e(a){h[a]=!0,h.every(function(a){return a})&&d.onCompleted()}for(var f=b.length,g=l(f,function(){return[]}),h=l(f,function(){return!1}),i=function(b){var e,f;if(g.every(function(a){return a.length>0})){try{f=g.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(i){return void d.onError(i)}d.onNext(e)}else h.filter(function(a,c){return c!==b}).every(D)&&d.onCompleted()},j=new Array(f),k=0;f>k;k++)!function(a){j[a]=new ub,j[a].setDisposable(b[a].subscribe(function(b){g[a].push(b),i(a)},d.onError.bind(d),function(){e(a)}))}(k);return new ob(j)})},Rb.zip=function(){var a=ib.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Rb.zipArray=function(){var a=k(arguments,0);return new mc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(D))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(D)?void b.onCompleted():void 0}for(var e=a.length,f=l(e,function(){return[]}),g=l(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new ub,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new ob(h);return j.add(rb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},Ob.asObservable=function(){var a=this;return new mc(function(b){return a.subscribe(b)})},Ob.dematerialize=function(){var a=this;return new mc(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 c=this;return a||(a=D),b||(b=F),new mc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},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 mc(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 mc(function(c){var d=b.subscribe(c);return rb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Ob.ignoreElements=function(){var a=this;return new mc(function(b){return a.subscribe(C,b.onError.bind(b),b.onCompleted.bind(b))})},Ob.materialize=function(){var a=this;return new mc(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 mc(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 mc(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=ib.call(arguments,c),Lb([Vb(a,b),this]).concat()},Ob.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Vb(a,b)})},Ob.takeLastBuffer=function(a){var b=this;return new mc(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.select=Ob.map=function(a,b){var c=this;return new mc(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.selectMany=Ob.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=I(e)?ec(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?o.call(this,a):o.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(K);var b=this;return new mc(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 mc(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(K);if(0===a)return Ub(b);var c=this;return new mc(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 mc(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))
2
- })},Ob.where=Ob.filter=function(a,b){var c=this;return new mc(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))})},Rb.fromCallback=function(a,b,c,d){return b||(b=Ab),function(){var e=ib.call(arguments,0);return new mc(function(f){return b.schedule(function(){function b(a){var b=a;if(d)try{b=d(arguments)}catch(c){return void f.onError(c)}else 1===b.length&&(b=b[0]);f.onNext(b),f.onCompleted()}e.push(b),a.apply(c,e)})})}},Rb.fromNodeCallback=function(a,b,c,d){return b||(b=Ab),function(){var e=ib.call(arguments,0);return new mc(function(f){return b.schedule(function(){function b(a){if(a)return void f.onError(a);var b=ib.call(arguments,1);if(d)try{b=d(b)}catch(c){return void f.onError(c)}else 1===b.length&&(b=b[0]);f.onNext(b),f.onCompleted()}e.push(b),a.apply(c,e)})})}};var bc=w.angular&&angular.element?angular.element:w.jQuery?w.jQuery:w.Zepto?w.Zepto:null,cc=!!w.Ember&&"function"==typeof w.Ember.addListener;Rb.fromEvent=function(a,b,c){if(cc)return dc(function(){Ember.addListener(a,b)},function(){Ember.removeListener(a,b)},c);if(bc){var d=bc(elem);return dc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}return new mc(function(d){return q(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var dc=Rb.fromEventPattern=function(a,b,c){return new mc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return rb(function(){b&&b(e,f)})}).publish().refCount()},ec=Rb.fromPromise=function(a){return new mc(function(b){return a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)}),function(){a&&a.abort&&a.abort()}})};Ob.toPromise=function(a){if(a||(a=B.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)})})},Rb.startAsync=function(a){var b;try{b=a()}catch(c){return Yb(c)}return ec(b)},Ob.multicast=function(a,b){var c=this;return"function"==typeof a?new mc(function(d){var e=c.multicast(a());return new ob(b(e).subscribe(d),e.connect())}):new fc(c,a)},Ob.publish=function(a){return a?this.multicast(function(){return new pc},a):this.multicast(new pc)},Ob.share=function(){return this.publish(null).refCount()},Ob.publishLast=function(a){return a?this.multicast(function(){return new qc},a):this.multicast(new qc)},Ob.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new sc(b)},a):this.multicast(new sc(a))},Ob.shareValue=function(a){return this.publishValue(a).refCount()},Ob.replay=function(a,b,c,d){return a?this.multicast(function(){return new tc(b,c,d)},a):this.multicast(new tc(b,c,d))},Ob.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var fc=B.ConnectableObservable=function(a){function b(b,c){function d(a){return e.subject.subscribe(a)}var e={subject:c,source:b.asObservable(),hasSubscription:!1,subscription:null};this.connect=function(){return e.hasSubscription||(e.hasSubscription=!0,e.subscription=new ob(e.source.subscribe(e.subject),rb(function(){e.hasSubscription=!1}))),e.subscription},a.call(this,d)}return jb(b,a),b.prototype.connect=function(){return this.connect()},b.prototype.refCount=function(){var a=null,b=0,c=this;return new mc(function(d){var e,f;return b++,e=1===b,f=c.subscribe(d),e&&(a=c.connect()),rb(function(){f.dispose(),b--,0===b&&a.dispose()})})},b}(Rb),gc=Rb.interval=function(a,b){return b||(b=Db),s(a,a,b)},hc=Rb.timer=function(b,c,d){var e;return d||(d=Db),"number"==typeof c?e=c:"object"==typeof c&&"now"in c&&(d=c),e===a?r(b,d):s(b,e,d)};Ob.delay=function(a,b){b||(b=Db);var c=this;return new mc(function(d){var e,f=!1,g=new vb,h=null,i=[],j=!1;return e=c.materialize().timestamp(b).subscribe(function(c){var e,k;"E"===c.value.kind?(i=[],i.push(c),h=c.value.exception,k=!j):(i.push({value:c.value,timestamp:c.timestamp+a}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new ub,g.setDisposable(e),e.setDisposable(b.scheduleRecursiveWithRelative(a,function(a){var c,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-b.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-b.now())):f=!1,c=h,j=!1,null!==c?d.onError(c):k&&a(e)}}))))}),new ob(e,g)})},Ob.throttle=function(a,b){b||(b=Db);return this.throttleWithSelector(function(){return hc(a,b)})},Ob.timeInterval=function(a){var b=this;return a||(a=Db),Tb(function(){var c=a.now();return b.select(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},Ob.timestamp=function(a){return a||(a=Db),this.select(function(b){return{value:b,timestamp:a.now()}})},Ob.sample=function(a,b){return b||(b=Db),"number"==typeof a?t(this,gc(a,b)):t(this,a)},Ob.timeout=function(a,b,c){var d,e=this;return b||(b=Yb(new Error("Timeout"))),c||(c=Db),d=a instanceof Date?function(a,b){c.scheduleWithAbsolute(a,b)}:function(a,b){c.scheduleWithRelative(a,b)},new mc(function(c){var f,g=0,h=new ub,i=new vb,j=!1,k=new vb;return i.setDisposable(h),f=function(){var e=g;k.setDisposable(d(a,function(){j=g===e;var a=j;a&&i.setDisposable(b.subscribe(c))}))},f(),h.setDisposable(e.subscribe(function(a){var b=!j;b&&(g++,c.onNext(a),f())},function(a){var b=!j;b&&(g++,c.onError(a))},function(){var a=!j;a&&(g++,c.onCompleted())})),new ob(i,k)})},Rb.generateWithRelativeTime=function(a,b,c,d,e,f){return f||(f=Db),new mc(function(g){var h,i,j=!0,k=!1,l=a;return f.scheduleRecursiveWithRelative(0,function(a){k&&g.onNext(h);try{j?j=!1:l=c(l),k=b(l),k&&(h=d(l),i=e(l))}catch(f){return void g.onError(f)}k?a(i):g.onCompleted()})})},Ob.delaySubscription=function(a,b){return b||(b=Db),this.delayWithSelector(hc(a,b),function(){return Ub()})},Ob.delayWithSelector=function(a,b){var c,d,e=this;return"function"==typeof a?d=a:(c=a,d=b),new mc(function(a){var b=new ob,f=!1,g=function(){f&&0===b.length&&a.onCompleted()},h=new vb,i=function(){h.setDisposable(e.subscribe(function(c){var e;try{e=d(c)}catch(f){return void a.onError(f)}var h=new ub;b.add(h),h.setDisposable(e.subscribe(function(){a.onNext(c),b.remove(h),g()},a.onError.bind(a),function(){a.onNext(c),b.remove(h),g()}))},a.onError.bind(a),function(){f=!0,h.dispose(),g()}))};return c?h.setDisposable(c.subscribe(function(){i()},a.onError.bind(a),function(){i()})):i(),new ob(h,b)})},Ob.timeoutWithSelector=function(a,b,c){if(1===arguments.length){b=a;var a=Wb()}c||(c=Yb(new Error("Timeout")));var d=this;return new mc(function(e){var f=new vb,g=new vb,h=new ub;f.setDisposable(h);var i=0,j=!1,k=function(a){var b=i,d=function(){return i===b},h=new ub;g.setDisposable(h),h.setDisposable(a.subscribe(function(){d()&&f.setDisposable(c.subscribe(e)),h.dispose()},function(a){d()&&e.onError(a)},function(){d()&&f.setDisposable(c.subscribe(e))}))};k(a);var l=function(){var a=!j;return a&&i++,a};return h.setDisposable(d.subscribe(function(a){if(l()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}k(c)}},function(a){l()&&e.onError(a)},function(){l()&&e.onCompleted()})),new ob(f,g)})},Ob.throttleWithSelector=function(a){var b=this;return new mc(function(c){var d,e=!1,f=new vb,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}e=!0,d=b,g++;var j=g,k=new ub;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new ob(h,f)})},Ob.skipLastWithTime=function(a,b){b||(b=Db);var c=this;return new mc(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},d.onError.bind(d),function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})})},Ob.takeLastWithTime=function(a,b,c){return this.takeLastBufferWithTime(a,b).selectMany(function(a){return Vb(a,c)})},Ob.takeLastBufferWithTime=function(a,b){var c=this;return b||(b=Db),new mc(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},d.onError.bind(d),function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})})},Ob.takeWithTime=function(a,b){var c=this;return b||(b=Db),new mc(function(d){var e=b.scheduleWithRelative(a,function(){d.onCompleted()});return new ob(e,c.subscribe(d))})},Ob.skipWithTime=function(a,b){var c=this;return b||(b=Db),new mc(function(d){var e=!1,f=b.scheduleWithRelative(a,function(){e=!0}),g=c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d));return new ob(f,g)})},Ob.skipUntilWithTime=function(a,b){b||(b=Db);var c=this;return new mc(function(d){var e=!1,f=b.scheduleWithAbsolute(a,function(){e=!0}),g=c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d));return new ob(f,g)})},Ob.takeUntilWithTime=function(a,b){b||(b=Db);var c=this;return new mc(function(d){return new ob(b.scheduleWithAbsolute(a,function(){d.onCompleted()}),c.subscribe(d))})};var ic=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=sb,e=this.subject.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=sb)});return new ob(c,d,e)}function c(c,d){this.source=c,this.subject=d||new pc,this.isPaused=!0,a.call(this,b)}return jb(c,a),c.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},c.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},c}(Rb);Ob.pausable=function(a){return new ic(this,a)};var jc=function(a){function b(a){var b=[],c=!0,d=u(this.source,this.subject.distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(d){if(d.shouldFire&&c&&a.onNext(d.data),d.shouldFire&&!c){for(;b.length>0;)a.onNext(b.shift());c=!0}else d.shouldFire||c?!d.shouldFire&&c&&(c=!1):b.push(d.data)},a.onError.bind(a),a.onCompleted.bind(a));return this.subject.onNext(!1),d}function c(c,d){this.source=c,this.subject=d||new pc,this.isPaused=!0,a.call(this,b)}return jb(c,a),c.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},c.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},c}(Rb);Ob.pausableBuffered=function(a){return new jc(this,a)},Ob.controlled=function(a){return null==a&&(a=!0),new kc(this,a)};var kc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new lc(d),this.source=c.multicast(this.subject).refCount()}return jb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(Rb),lc=B.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new pc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=sb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=sb}return jb(d,a),kb(d.prototype,Mb,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=sb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=sb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?sb:(this.requestedCount=a,this.requestedDisposable=rb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=sb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(Rb),mc=B.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=sb:"function"==typeof a&&(a=rb(a)),a}function c(d){function e(a){var c=new nc(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 jb(c,a),c}(Rb),nc=function(a){function b(b){a.call(this),this.observer=b,this.m=new ub}jb(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),oc=function(a,b){this.subject=a,this.observer=b};oc.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 pc=B.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),sb):(a.onCompleted(),sb):(this.observers.push(a),new oc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return jb(d,a),kb(d.prototype,Mb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new rc(a,b)},d}(Rb),qc=B.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new oc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),sb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return jb(d,a),kb(d.prototype,Mb,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Rb),rc=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 jb(c,a),kb(c.prototype,Mb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Rb),sc=B.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new oc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),sb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return jb(d,a),kb(d.prototype,Mb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(Rb),tc=B.ReplaySubject=function(a){function c(a,b){this.subject=a,this.observer=b}function d(a){var d=new Sb(this.scheduler,a),e=new c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Bb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return c.prototype.dispose=function(){if(this.observer.dispose(),!this.subject.isDisposed){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1)}},jb(e,a),kb(e.prototype,Mb,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){var c;if(b.call(this),!this.isStopped){var d=this.scheduler.now();this.q.push({interval:d,value:a}),this._trim(d);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)c=e[f],c.onNext(a),c.ensureActive()}},onError:function(a){var c;if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var d=this.scheduler.now();this._trim(d);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)c=e[f],c.onError(a),c.ensureActive();this.observers=[]}},onCompleted:function(){var a;if(b.call(this),!this.isStopped){this.isStopped=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++)a=d[e],a.onCompleted(),a.ensureActive();this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(Rb);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(w.Rx=B,define(function(){return B})):x&&y?z?(y.exports=B).Rx=B:x.Rx=B:w.Rx=B}).call(this);
1
+ (function(a){function b(){if(this.isDisposed)throw new Error(L)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;gb.nonEnumArgs&&a.length&&h(a)&&(a=ib.call(a));var d=gb.enumPrototypes&&"function"==typeof a,e=gb.enumErrorProps&&(a===ab||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(gb.nonEnumShadows&&a!==bb){var g=a.constructor,i=-1,j=eb.length;if(a===(g&&g.prototype))var k=a===stringProto?Y:a===ab?T:Z.call(a),l=fb[k];for(;++i<j;)f=eb[i],l&&l[f]||!$.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?Z.call(a)==P:!1}function i(a){return"function"==typeof a}function j(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,k=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=k&&"object"!=k))return!1;var l=Z.call(a),m=Z.call(b);if(l==P&&(l=W),m==P&&(m=W),l!=m)return!1;switch(l){case R:case S:return+a==+b;case V:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case X:case Y:return a==String(b)}var n=l==Q;if(!n){if(l!=W||!gb.nodeClass&&(g(a)||g(b)))return!1;var o=!gb.argsObject&&h(a)?Object:a.constructor,p=!gb.argsObject&&h(b)?Object:b.constructor;if(!(o==p||$.call(a,"constructor")&&$.call(b,"constructor")||i(o)&&o instanceof o&&i(p)&&p instanceof p||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(result=!0,c.push(a),d.push(b),n){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=j(a[r],s,c,d)))break}}else f(b,function(b,e,f){return $.call(f,e)?(r++,result=$.call(a,e)&&j(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return $.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function k(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ib.call(a)}function l(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function m(a,b){return new mc(function(c){var d=new ub,e=new vb;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)}I(f)&&(f=ec(f)),d=new ub,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function n(a,b){var c=this;return new mc(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 o(a){return this.select(function(b,c){var d=a(b,c);return I(d)?ec(d):d}).mergeObservable()}function p(a,b,c){if(a.addListener)return a.addListener(b,c),rb(function(){a.removeListener(b,c)});if(a.addEventListener)return a.addEventListener(b,c,!1),rb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function q(a,b,c){var d=new ob;if("function"==typeof a.item&&"number"==typeof a.length)for(var e=0,f=a.length;f>e;e++)d.add(q(a.item(e),b,c));else a&&d.add(p(a,b,c));return d}function r(a,b){var c=zb(a);return new mc(function(a){return b.scheduleWithRelative(c,function(){a.onNext(0),a.onCompleted()})})}function s(a,b,c){return a===b?new mc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Tb(function(){return observableTimerDateAndPeriod(c.now()+a,b,c)})}function t(a,b){return new mc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new ob(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function u(a,b,c){return new mc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(D))){try{e=c.apply(null,j)}catch(f){return void d.onError(f)}d.onNext(e)}else i&&d.onCompleted()}var f=2,g=[!1,!1],h=!1,i=!1,j=new Array(f);return new ob(a.subscribe(function(a){e(a,0)},d.onError.bind(d),function(){i=!0,d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d)))})}var v={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},w=v[typeof window]&&window||this,x=v[typeof exports]&&exports&&!exports.nodeType&&exports,y=v[typeof module]&&module&&!module.nodeType&&module,z=y&&y.exports===x&&x,A=v[typeof global]&&global;!A||A.global!==A&&A.window!==A||(w=A);var B={internals:{},config:{Promise:w.Promise},helpers:{}},C=B.helpers.noop=function(){},D=B.helpers.identity=function(a){return a},E=B.helpers.defaultNow=Date.now,F=B.helpers.defaultComparer=function(a,b){return hb(a,b)},G=B.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},H=(B.helpers.defaultKeySerializer=function(a){return a.toString()},B.helpers.defaultError=function(a){throw a}),I=B.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then&&a.then!==B.Observable.prototype.then},J=(B.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},B.helpers.not=function(a){return!a},"Sequence contains no elements."),K="Argument out of range",L="Object has been disposed",M="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";w.Set&&"function"==typeof(new w.Set)["@@iterator"]&&(M="@@iterator");var N,O={done:!0,value:a},P="[object Arguments]",Q="[object Array]",R="[object Boolean]",S="[object Date]",T="[object Error]",U="[object Function]",V="[object Number]",W="[object Object]",X="[object RegExp]",Y="[object String]",Z=Object.prototype.toString,$=Object.prototype.hasOwnProperty,_=Z.call(arguments)==P,ab=Error.prototype,bb=Object.prototype,cb=bb.propertyIsEnumerable;try{N=!(Z.call(document)==W&&!({toString:0}+""))}catch(db){N=!0}var eb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],fb={};fb[Q]=fb[S]=fb[V]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},fb[R]=fb[Y]={constructor:!0,toString:!0,valueOf:!0},fb[T]=fb[U]=fb[X]={constructor:!0,toString:!0},fb[W]={constructor:!0};var gb={};!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);gb.enumErrorProps=cb.call(ab,"message")||cb.call(ab,"name"),gb.enumPrototypes=cb.call(a,"prototype"),gb.nonEnumArgs=0!=c,gb.nonEnumShadows=!/valueOf/.test(b)}(1),_||(h=function(a){return a&&"object"==typeof a?$.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&Z.call(a)==U});var hb=B.internals.isEqual=function(a,b){return j(a,b,[],[])},ib=Array.prototype.slice,jb=({}.hasOwnProperty,this.inherits=B.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),kb=B.internals.addProperties=function(a){for(var b=ib.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},lb=(B.internals.addRef=function(a,b){return new mc(function(c){return new ob(b.getDisposable(),a.subscribe(c))})},function(a,b){this.id=a,this.value=b});lb.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var mb=B.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},nb=mb.prototype;nb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},nb.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)}}},nb.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)}}},nb.peek=function(){return this.items[0].value},nb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},nb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},nb.enqueue=function(a){var b=this.length++;this.items[b]=new lb(mb.count++,a),this.percolate(b)},nb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},mb.count=0;var ob=B.CompositeDisposable=function(){this.disposables=k(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},pb=ob.prototype;pb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},pb.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},pb.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()}},pb.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()},pb.contains=function(a){return-1!==this.disposables.indexOf(a)},pb.toArray=function(){return this.disposables.slice(0)};var qb=B.Disposable=function(a){this.isDisposed=!1,this.action=a||C};qb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var rb=qb.create=function(a){return new qb(a)},sb=qb.empty={dispose:C},tb=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}(),ub=B.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return jb(b,a),b}(tb),vb=B.SerialDisposable=function(a){function b(){a.call(this,!1)}return jb(b,a),b}(tb),wb=(B.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?sb:new a(this)},b}(),B.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||G,this.disposable=new ub});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=B.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 ob,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),sb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new ob,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),sb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),sb}var e=a.prototype;return 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 rb(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=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 mb(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.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 ub;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),C);!function(){function a(){if(!w.postMessage||w.importScripts)return!1;var a=!1,b=w.onmessage;return w.onmessage=function(){a=!0},w.postMessage("","*"),w.onmessage=b,a}function 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(Z).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=A&&z&&A.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=A&&z&&A.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;w.addEventListener?w.addEventListener("message",b,!1):w.attachEvent("onmessage",b,!1),xb=function(a){var b=h++;g[b]=a,w.postMessage(f+b,"*")}}else if(w.MessageChannel){var i=new w.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 w&&"onreadystatechange"in w.document.createElement("script")?xb=function(a){var b=w.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},w.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 ub,e=xb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new ob(d,rb(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 ub,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new ob(f,rb(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new yb(E,a,b,c)}(),Eb=B.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 mc(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=B.internals.Enumerator=function(a){this._next=a};Ib.prototype.next=function(){return this._next()},Ib.prototype[M]=function(){return this};var Jb=B.internals.Enumerable=function(a){this._iterator=a};Jb.prototype[M]=function(){return this._iterator()},Jb.prototype.concat=function(){var a=this;return new mc(function(b){var c;try{c=a[M]()}catch(d){return void b.onError()}var e,f=new vb,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=d.value;I(h)&&(h=ec(h));var i=new ub;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new ob(f,g,rb(function(){e=!0}))})},Jb.prototype.catchException=function(){var a=this;return new mc(function(b){var c;try{c=a[M]()}catch(d){return void b.onError()}var e,f,g=new vb,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=d.value;I(i)&&(i=ec(i));var j=new ub;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new ob(g,h,rb(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?O:(c>0&&c--,{done:!1,value:a})})})},Lb=Jb.forEach=function(a,b,c){return b||(b=D),new Jb(function(){var d=-1;return new Ib(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:O})})},Mb=B.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))};var Nb=Mb.create=function(a,b,c){return a||(a=C),b||(b=H),c||(c=C),new Qb(a,b,c)};Mb.fromNotifier=function(a){return new Qb(function(b){return a(Fb(b))},function(b){return a(Gb(b))},function(){return a(Hb())})};var Ob,Pb=B.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return jb(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=B.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return jb(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=B.Observable=function(){function a(a){this._subscribe=a}return Ob=a.prototype,Ob.finalValue=function(){var a=this;return new mc(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(J))})})},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}(),Sb=B.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 vb}return jb(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);Rb.create=Rb.createWithDisposable=function(a){return new mc(a)};var Tb=Rb.defer=function(a){return new mc(function(b){var c;try{c=a()}catch(d){return Yb(d).subscribe(b)}return I(c)&&(c=ec(c)),c.subscribe(b)})},Ub=Rb.empty=function(a){return a||(a=Ab),new mc(function(b){return a.schedule(function(){b.onCompleted()})})},Vb=Rb.fromArray=function(a,b){return b||(b=Bb),new mc(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Rb.fromIterable=function(a,b){return b||(b=Bb),new mc(function(c){var d;try{d=a[M]()}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())})})},Rb.generate=function(a,b,c,d,e){return e||(e=Bb),new mc(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 Wb=Rb.never=function(){return new mc(function(){return sb})};Rb.range=function(a,b,c){return c||(c=Bb),new mc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Rb.repeat=function(a,b,c){return c||(c=Bb),null==b&&(b=-1),Xb(a,c).repeat(b)};var Xb=Rb["return"]=Rb.returnValue=function(a,b){return b||(b=Ab),new mc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Yb=Rb["throw"]=Rb.throwException=function(a,b){return b||(b=Ab),new mc(function(c){return b.schedule(function(){c.onError(a)})})};Ob["catch"]=Ob.catchException=function(a){return"function"==typeof a?m(this,a):Zb([this,a])};var Zb=Rb.catchException=Rb["catch"]=function(){var a=k(arguments,0);return Lb(a).catchException()};Ob.combineLatest=function(){var a=ib.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),$b.apply(this,a)};var $b=Rb.combineLatest=function(){var a=ib.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new mc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(D))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(D)&&c.onCompleted()}function e(a){j[a]=!0,j.every(D)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=l(g,f),i=!1,j=l(g,f),k=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new ub;I(f)&&(f=ec(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new ob(m)})};Ob.concat=function(){var a=ib.call(arguments,0);return a.unshift(this),_b.apply(this,a)};var _b=Rb.concat=function(){var a=k(arguments,0);return Lb(a).concat()};Ob.concatObservable=Ob.concatAll=function(){return this.merge(1)},Ob.merge=function(a){if("number"!=typeof a)return ac(this,a);var b=this;return new mc(function(c){var d=0,e=new ob,f=!1,g=[],h=function(a){var b=new ub;e.add(b),I(a)&&(a=ec(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(),h(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,h(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var ac=Rb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ib.call(arguments,1)):(a=Ab,b=ib.call(arguments,0)):(a=Ab,b=ib.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Vb(b,a).mergeObservable()};Ob.mergeObservable=Ob.mergeAll=function(){var a=this;return new mc(function(b){var c=new ob,d=!1,e=new ub;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new ub;c.add(e),I(a)&&(a=ec(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.skipUntil=function(a){var b=this;return new mc(function(c){var d=!1,e=new ob(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new ub;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 mc(function(b){var c=!1,d=new vb,e=!1,f=0,g=a.subscribe(function(a){var g=new ub,h=++f;c=!0,d.setDisposable(g),I(a)&&(a=ec(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new ob(g,d)})},Ob.takeUntil=function(a){var b=this;return new mc(function(c){return new ob(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),C))})},Ob.zip=function(){if(Array.isArray(arguments[0]))return n.apply(this,arguments);var a=this,b=ib.call(arguments),c=b.pop();return b.unshift(a),new mc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(D)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=l(g,function(){return[]}),i=l(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new ub;I(c)&&(c=ec(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new ob(j)})},Rb.zip=function(){var a=ib.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Rb.zipArray=function(){var a=k(arguments,0);return new mc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(D))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(D)?void b.onCompleted():void 0}for(var e=a.length,f=l(e,function(){return[]}),g=l(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new ub,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new ob(h);return j.add(rb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},Ob.asObservable=function(){var a=this;return new mc(function(b){return a.subscribe(b)})},Ob.dematerialize=function(){var a=this;return new mc(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 c=this;return a||(a=D),b||(b=F),new mc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},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 mc(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 mc(function(c){var d=b.subscribe(c);return rb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Ob.ignoreElements=function(){var a=this;return new mc(function(b){return a.subscribe(C,b.onError.bind(b),b.onCompleted.bind(b))})},Ob.materialize=function(){var a=this;return new mc(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 mc(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 mc(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=ib.call(arguments,c),Lb([Vb(a,b),this]).concat()},Ob.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Vb(a,b)})},Ob.takeLastBuffer=function(a){var b=this;return new mc(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.select=Ob.map=function(a,b){var c=this;return new mc(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.selectMany=Ob.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=I(e)?ec(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?o.call(this,a):o.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(K);var b=this;return new mc(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 mc(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(K);if(0===a)return Ub(b);var c=this;return new mc(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 mc(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)
2
+ }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 mc(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))})},Rb.fromCallback=function(a,b,c,d){return b||(b=Ab),function(){var e=ib.call(arguments,0);return new mc(function(f){return b.schedule(function(){function b(a){var b=a;if(d)try{b=d(arguments)}catch(c){return void f.onError(c)}else 1===b.length&&(b=b[0]);f.onNext(b),f.onCompleted()}e.push(b),a.apply(c,e)})})}},Rb.fromNodeCallback=function(a,b,c,d){return b||(b=Ab),function(){var e=ib.call(arguments,0);return new mc(function(f){return b.schedule(function(){function b(a){if(a)return void f.onError(a);var b=ib.call(arguments,1);if(d)try{b=d(b)}catch(c){return void f.onError(c)}else 1===b.length&&(b=b[0]);f.onNext(b),f.onCompleted()}e.push(b),a.apply(c,e)})})}};var bc=w.angular&&angular.element?angular.element:w.jQuery?w.jQuery:w.Zepto?w.Zepto:null,cc=!!w.Ember&&"function"==typeof w.Ember.addListener;Rb.fromEvent=function(a,b,c){if(cc)return dc(function(){Ember.addListener(a,b)},function(){Ember.removeListener(a,b)},c);if(bc){var d=bc(a);return dc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}return new mc(function(d){return q(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var dc=Rb.fromEventPattern=function(a,b,c){return new mc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return rb(function(){b&&b(e,f)})}).publish().refCount()},ec=Rb.fromPromise=function(a){return new mc(function(b){return a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)}),function(){a&&a.abort&&a.abort()}})};Ob.toPromise=function(a){if(a||(a=B.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)})})},Rb.startAsync=function(a){var b;try{b=a()}catch(c){return Yb(c)}return ec(b)},Ob.multicast=function(a,b){var c=this;return"function"==typeof a?new mc(function(d){var e=c.multicast(a());return new ob(b(e).subscribe(d),e.connect())}):new fc(c,a)},Ob.publish=function(a){return a?this.multicast(function(){return new pc},a):this.multicast(new pc)},Ob.share=function(){return this.publish(null).refCount()},Ob.publishLast=function(a){return a?this.multicast(function(){return new qc},a):this.multicast(new qc)},Ob.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new sc(b)},a):this.multicast(new sc(a))},Ob.shareValue=function(a){return this.publishValue(a).refCount()},Ob.replay=function(a,b,c,d){return a?this.multicast(function(){return new tc(b,c,d)},a):this.multicast(new tc(b,c,d))},Ob.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var fc=B.ConnectableObservable=function(a){function b(b,c){function d(a){return e.subject.subscribe(a)}var e={subject:c,source:b.asObservable(),hasSubscription:!1,subscription:null};this.connect=function(){return e.hasSubscription||(e.hasSubscription=!0,e.subscription=new ob(e.source.subscribe(e.subject),rb(function(){e.hasSubscription=!1}))),e.subscription},a.call(this,d)}return jb(b,a),b.prototype.connect=function(){return this.connect()},b.prototype.refCount=function(){var a=null,b=0,c=this;return new mc(function(d){var e,f;return b++,e=1===b,f=c.subscribe(d),e&&(a=c.connect()),rb(function(){f.dispose(),b--,0===b&&a.dispose()})})},b}(Rb),gc=Rb.interval=function(a,b){return b||(b=Db),s(a,a,b)},hc=Rb.timer=function(b,c,d){var e;return d||(d=Db),"number"==typeof c?e=c:"object"==typeof c&&"now"in c&&(d=c),e===a?r(b,d):s(b,e,d)};Ob.delay=function(a,b){b||(b=Db);var c=this;return new mc(function(d){var e,f=!1,g=new vb,h=null,i=[],j=!1;return e=c.materialize().timestamp(b).subscribe(function(c){var e,k;"E"===c.value.kind?(i=[],i.push(c),h=c.value.exception,k=!j):(i.push({value:c.value,timestamp:c.timestamp+a}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new ub,g.setDisposable(e),e.setDisposable(b.scheduleRecursiveWithRelative(a,function(a){var c,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-b.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-b.now())):f=!1,c=h,j=!1,null!==c?d.onError(c):k&&a(e)}}))))}),new ob(e,g)})},Ob.throttle=function(a,b){b||(b=Db);return this.throttleWithSelector(function(){return hc(a,b)})},Ob.timeInterval=function(a){var b=this;return a||(a=Db),Tb(function(){var c=a.now();return b.select(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},Ob.timestamp=function(a){return a||(a=Db),this.select(function(b){return{value:b,timestamp:a.now()}})},Ob.sample=function(a,b){return b||(b=Db),"number"==typeof a?t(this,gc(a,b)):t(this,a)},Ob.timeout=function(a,b,c){var d,e=this;return b||(b=Yb(new Error("Timeout"))),c||(c=Db),d=a instanceof Date?function(a,b){c.scheduleWithAbsolute(a,b)}:function(a,b){c.scheduleWithRelative(a,b)},new mc(function(c){var f,g=0,h=new ub,i=new vb,j=!1,k=new vb;return i.setDisposable(h),f=function(){var e=g;k.setDisposable(d(a,function(){j=g===e;var a=j;a&&i.setDisposable(b.subscribe(c))}))},f(),h.setDisposable(e.subscribe(function(a){var b=!j;b&&(g++,c.onNext(a),f())},function(a){var b=!j;b&&(g++,c.onError(a))},function(){var a=!j;a&&(g++,c.onCompleted())})),new ob(i,k)})},Rb.generateWithRelativeTime=function(a,b,c,d,e,f){return f||(f=Db),new mc(function(g){var h,i,j=!0,k=!1,l=a;return f.scheduleRecursiveWithRelative(0,function(a){k&&g.onNext(h);try{j?j=!1:l=c(l),k=b(l),k&&(h=d(l),i=e(l))}catch(f){return void g.onError(f)}k?a(i):g.onCompleted()})})},Ob.delaySubscription=function(a,b){return b||(b=Db),this.delayWithSelector(hc(a,b),function(){return Ub()})},Ob.delayWithSelector=function(a,b){var c,d,e=this;return"function"==typeof a?d=a:(c=a,d=b),new mc(function(a){var b=new ob,f=!1,g=function(){f&&0===b.length&&a.onCompleted()},h=new vb,i=function(){h.setDisposable(e.subscribe(function(c){var e;try{e=d(c)}catch(f){return void a.onError(f)}var h=new ub;b.add(h),h.setDisposable(e.subscribe(function(){a.onNext(c),b.remove(h),g()},a.onError.bind(a),function(){a.onNext(c),b.remove(h),g()}))},a.onError.bind(a),function(){f=!0,h.dispose(),g()}))};return c?h.setDisposable(c.subscribe(function(){i()},a.onError.bind(a),function(){i()})):i(),new ob(h,b)})},Ob.timeoutWithSelector=function(a,b,c){if(1===arguments.length){b=a;var a=Wb()}c||(c=Yb(new Error("Timeout")));var d=this;return new mc(function(e){var f=new vb,g=new vb,h=new ub;f.setDisposable(h);var i=0,j=!1,k=function(a){var b=i,d=function(){return i===b},h=new ub;g.setDisposable(h),h.setDisposable(a.subscribe(function(){d()&&f.setDisposable(c.subscribe(e)),h.dispose()},function(a){d()&&e.onError(a)},function(){d()&&f.setDisposable(c.subscribe(e))}))};k(a);var l=function(){var a=!j;return a&&i++,a};return h.setDisposable(d.subscribe(function(a){if(l()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}k(c)}},function(a){l()&&e.onError(a)},function(){l()&&e.onCompleted()})),new ob(f,g)})},Ob.throttleWithSelector=function(a){var b=this;return new mc(function(c){var d,e=!1,f=new vb,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}e=!0,d=b,g++;var j=g,k=new ub;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new ob(h,f)})},Ob.skipLastWithTime=function(a,b){b||(b=Db);var c=this;return new mc(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},d.onError.bind(d),function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})})},Ob.takeLastWithTime=function(a,b,c){return this.takeLastBufferWithTime(a,b).selectMany(function(a){return Vb(a,c)})},Ob.takeLastBufferWithTime=function(a,b){var c=this;return b||(b=Db),new mc(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},d.onError.bind(d),function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})})},Ob.takeWithTime=function(a,b){var c=this;return b||(b=Db),new mc(function(d){var e=b.scheduleWithRelative(a,function(){d.onCompleted()});return new ob(e,c.subscribe(d))})},Ob.skipWithTime=function(a,b){var c=this;return b||(b=Db),new mc(function(d){var e=!1,f=b.scheduleWithRelative(a,function(){e=!0}),g=c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d));return new ob(f,g)})},Ob.skipUntilWithTime=function(a,b){b||(b=Db);var c=this;return new mc(function(d){var e=!1,f=b.scheduleWithAbsolute(a,function(){e=!0}),g=c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d));return new ob(f,g)})},Ob.takeUntilWithTime=function(a,b){b||(b=Db);var c=this;return new mc(function(d){return new ob(b.scheduleWithAbsolute(a,function(){d.onCompleted()}),c.subscribe(d))})};var ic=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=sb,e=this.subject.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=sb)});return new ob(c,d,e)}function c(c,d){this.source=c,this.subject=d||new pc,this.isPaused=!0,a.call(this,b)}return jb(c,a),c.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},c.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},c}(Rb);Ob.pausable=function(a){return new ic(this,a)};var jc=function(a){function b(a){var b=[],c=!0,d=u(this.source,this.subject.distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(d){if(d.shouldFire&&c&&a.onNext(d.data),d.shouldFire&&!c){for(;b.length>0;)a.onNext(b.shift());c=!0}else d.shouldFire||c?!d.shouldFire&&c&&(c=!1):b.push(d.data)},a.onError.bind(a),a.onCompleted.bind(a));return this.subject.onNext(!1),d}function c(c,d){this.source=c,this.subject=d||new pc,this.isPaused=!0,a.call(this,b)}return jb(c,a),c.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},c.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},c}(Rb);Ob.pausableBuffered=function(a){return new jc(this,a)},Ob.controlled=function(a){return null==a&&(a=!0),new kc(this,a)};var kc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new lc(d),this.source=c.multicast(this.subject).refCount()}return jb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(Rb),lc=B.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new pc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=sb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=sb}return jb(d,a),kb(d.prototype,Mb,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=sb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=sb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?sb:(this.requestedCount=a,this.requestedDisposable=rb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=sb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(Rb),mc=B.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=sb:"function"==typeof a&&(a=rb(a)),a}function c(d){function e(a){var c=new nc(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 jb(c,a),c}(Rb),nc=function(a){function b(b){a.call(this),this.observer=b,this.m=new ub}jb(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),oc=function(a,b){this.subject=a,this.observer=b};oc.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 pc=B.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),sb):(a.onCompleted(),sb):(this.observers.push(a),new oc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return jb(d,a),kb(d.prototype,Mb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new rc(a,b)},d}(Rb),qc=B.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new oc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),sb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return jb(d,a),kb(d.prototype,Mb,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Rb),rc=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 jb(c,a),kb(c.prototype,Mb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Rb),sc=B.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new oc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),sb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return jb(d,a),kb(d.prototype,Mb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(Rb),tc=B.ReplaySubject=function(a){function c(a,b){this.subject=a,this.observer=b}function d(a){var d=new Sb(this.scheduler,a),e=new c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Bb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return c.prototype.dispose=function(){if(this.observer.dispose(),!this.subject.isDisposed){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1)}},jb(e,a),kb(e.prototype,Mb,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){var c;if(b.call(this),!this.isStopped){var d=this.scheduler.now();this.q.push({interval:d,value:a}),this._trim(d);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)c=e[f],c.onNext(a),c.ensureActive()}},onError:function(a){var c;if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var d=this.scheduler.now();this._trim(d);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)c=e[f],c.onError(a),c.ensureActive();this.observers=[]}},onCompleted:function(){var a;if(b.call(this),!this.isStopped){this.isStopped=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++)a=d[e],a.onCompleted(),a.ensureActive();this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(Rb);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(w.Rx=B,define(function(){return B})):x&&y?z?(y.exports=B).Rx=B:x.Rx=B:w.Rx=B}).call(this);
@@ -1,2 +1,2 @@
1
- (function(a){function b(){if(this.isDisposed)throw new Error(H)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;cb.nonEnumArgs&&a.length&&h(a)&&(a=eb.call(a));var d=cb.enumPrototypes&&"function"==typeof a,e=cb.enumErrorProps&&(a===Y||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(cb.nonEnumShadows&&a!==Z){var g=a.constructor,i=-1,j=ab.length;if(a===(g&&g.prototype))var k=a===stringProto?U:a===Y?P:V.call(a),l=bb[k];for(;++i<j;)f=ab[i],l&&l[f]||!W.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?V.call(a)==L:!1}function i(a){return"function"==typeof a}function j(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,k=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=k&&"object"!=k))return!1;var l=V.call(a),m=V.call(b);if(l==L&&(l=S),m==L&&(m=S),l!=m)return!1;switch(l){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 n=l==M;if(!n){if(l!=S||!cb.nodeClass&&(g(a)||g(b)))return!1;var o=!cb.argsObject&&h(a)?Object:a.constructor,p=!cb.argsObject&&h(b)?Object:b.constructor;if(!(o==p||W.call(a,"constructor")&&W.call(b,"constructor")||i(o)&&o instanceof o&&i(p)&&p instanceof p||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(result=!0,c.push(a),d.push(b),n){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=j(a[r],s,c,d)))break}}else f(b,function(b,e,f){return W.call(f,e)?(r++,result=W.call(a,e)&&j(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return W.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function k(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:eb.call(a)}function l(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(a,b){return new cc(function(c){var d=new rb,e=new sb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}d=new rb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function o(a,b){var c=this;return new cc(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 p(a){return this.select(function(b,c){var d=a(b,c);return E(d)?Tb(d):d}).mergeObservable()}var q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},r=q[typeof window]&&window||this,s=q[typeof exports]&&exports&&!exports.nodeType&&exports,t=q[typeof module]&&module&&!module.nodeType&&module,u=t&&t.exports===s&&s,v=q[typeof global]&&global;!v||v.global!==v&&v.window!==v||(r=v);var w={internals:{},config:{Promise:r.Promise},helpers:{}},x=w.helpers.noop=function(){},y=w.helpers.identity=function(a){return a},z=w.helpers.defaultNow=Date.now,A=w.helpers.defaultComparer=function(a,b){return db(a,b)},B=w.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},C=w.helpers.defaultKeySerializer=function(a){return a.toString()},D=w.helpers.defaultError=function(a){throw a},E=w.helpers.isPromise=function(a){return"function"==typeof a.then&&a.then!==w.Observable.prototype.then},F=(w.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},w.helpers.not=function(a){return!a},"Sequence contains no elements."),G="Argument out of range",H="Object has been disposed",I="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";r.Set&&"function"==typeof(new r.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||(h=function(a){return a&&"object"==typeof a?W.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&V.call(a)==Q});var db=w.internals.isEqual=function(a,b){return j(a,b,[],[])},eb=Array.prototype.slice,fb=({}.hasOwnProperty,this.inherits=w.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),gb=w.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=w.internals.addRef=function(a,b){return new cc(function(c){return new lb(b.getDisposable(),a.subscribe(c))})},ib=function(a,b){this.id=a,this.value=b};ib.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var jb=w.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},kb=jb.prototype;kb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},kb.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)}}},kb.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)}}},kb.peek=function(){return this.items[0].value},kb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},kb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},kb.enqueue=function(a){var b=this.length++;this.items[b]=new ib(jb.count++,a),this.percolate(b)},kb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},jb.count=0;var lb=w.CompositeDisposable=function(){this.disposables=k(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},mb=lb.prototype;mb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},mb.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},mb.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()}},mb.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()},mb.contains=function(a){return-1!==this.disposables.indexOf(a)},mb.toArray=function(){return this.disposables.slice(0)};var nb=w.Disposable=function(a){this.isDisposed=!1,this.action=a||x};nb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ob=nb.create=function(a){return new nb(a)},pb=nb.empty={dispose:x},qb=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}(),rb=w.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return fb(b,a),b}(qb),sb=w.SerialDisposable=function(a){function b(){a.call(this,!1)}return fb(b,a),b}(qb),tb=w.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?pb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var ub=w.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||B,this.disposable=new rb};ub.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ub.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},ub.prototype.isCancelled=function(){return this.disposable.isDisposed},ub.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var vb,wb=w.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 lb,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),pb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new lb,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),pb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),pb}var e=a.prototype;return e.catchException=e["catch"]=function(a){return new Bb(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 ob(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=z,a.normalize=function(a){return 0>a&&(a=0),a},a}(),xb=wb.normalize,yb=(w.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 rb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),wb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=xb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new wb(z,a,b,c)}()),zb=wb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-wb.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()+wb.normalize(c),g=new ub(this,b,d,f);if(e)e.enqueue(g);else{e=new jb(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 wb(z,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),Ab=x;!function(){function a(){if(!r.postMessage||r.importScripts)return!1;var a=!1,b=r.onmessage;return r.onmessage=function(){a=!0},r.postMessage("","*"),r.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=v&&u&&v.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=v&&u&&v.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))vb=process.nextTick;else if("function"==typeof d)vb=d,Ab=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;r.addEventListener?r.addEventListener("message",b,!1):r.attachEvent("onmessage",b,!1),vb=function(a){var b=h++;g[b]=a,r.postMessage(f+b,"*")}}else if(r.MessageChannel){var i=new r.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},vb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in r&&"onreadystatechange"in r.document.createElement("script")?vb=function(a){var b=r.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},r.document.documentElement.appendChild(b)}:(vb=function(a){return setTimeout(a,0)},Ab=clearTimeout)}();var Bb=(wb.timeout=function(){function a(a,b){var c=this,d=new rb,e=vb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new lb(d,ob(function(){Ab(e)}))}function b(a,b,c){var d=this,e=wb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new rb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new lb(f,ob(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new wb(z,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 pb}}},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 rb;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}(wb)),Cb=w.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=yb),new cc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Db=Cb.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 Cb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Eb=Cb.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 Cb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Fb=Cb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Cb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Gb=w.internals.Enumerator=function(a){this._next=a};Gb.prototype.next=function(){return this._next()},Gb.prototype[I]=function(){return this};var Hb=w.internals.Enumerable=function(a){this._iterator=a};Hb.prototype[I]=function(){return this._iterator()},Hb.prototype.concat=function(){var a=this;return new cc(function(b){var c;try{c=a[I]()}catch(d){return void b.onError()}var e,f=new sb,g=yb.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=d.value;E(h)&&(h=Tb(h));var i=new rb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new lb(f,g,ob(function(){e=!0}))})},Hb.prototype.catchException=function(){var a=this;return new cc(function(b){var c;try{c=a[I]()}catch(d){return void b.onError()}var e,f,g=new sb,h=yb.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=d.value;E(i)&&(i=Tb(i));var j=new rb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new lb(g,h,ob(function(){e=!0}))})};var Ib=Hb.repeat=function(a,b){return null==b&&(b=-1),new Hb(function(){var c=b;return new Gb(function(){return 0===c?K:(c>0&&c--,{done:!1,value:a})})})},Jb=Hb.forEach=function(a,b,c){return b||(b=y),new Hb(function(){var d=-1;return new Gb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:K})})},Kb=w.Observer=function(){};Kb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Kb.prototype.asObserver=function(){return new Ob(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Kb.prototype.checked=function(){return new Pb(this)};var Lb=Kb.create=function(a,b,c){return a||(a=x),b||(b=D),c||(c=x),new Ob(a,b,c)};Kb.fromNotifier=function(a){return new Ob(function(b){return a(Db(b))},function(b){return a(Eb(b))},function(){return a(Fb())})},Kb.notifyOn=function(a){return new Rb(a,this)};var Mb,Nb=w.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}(Kb),Ob=w.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}(Nb),Pb=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}(Kb),Qb=w.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 sb}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}(Nb),Rb=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}(Qb),Sb=w.Observable=function(){function a(a){this._subscribe=a}return Mb=a.prototype,Mb.finalValue=function(){var a=this;return new cc(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))})})},Mb.subscribe=Mb.forEach=function(a,b,c){var d;return d="object"==typeof a?a:Lb(a,b,c),this._subscribe(d)},Mb.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}();Mb.observeOn=function(a){var b=this;return new cc(function(c){return b.subscribe(new Rb(a,c))})},Mb.subscribeOn=function(a){var b=this;return new cc(function(c){var d=new rb,e=new sb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var Tb=Sb.fromPromise=function(a){return new cc(function(b){return a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)}),function(){a&&a.abort&&a.abort()}})};Mb.toPromise=function(a){if(a||(a=w.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)})})},Sb.create=Sb.createWithDisposable=function(a){return new cc(a)};var Ub=(Sb.defer=function(a){return new cc(function(b){var c;try{c=a()}catch(d){return Yb(d).subscribe(b)}return E(c)&&(c=Tb(c)),c.subscribe(b)})},Sb.empty=function(a){return a||(a=yb),new cc(function(b){return a.schedule(function(){b.onCompleted()})})}),Vb=Sb.fromArray=function(a,b){return b||(b=zb),new cc(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Sb.fromIterable=function(a,b){return b||(b=zb),new cc(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())})})},Sb.generate=function(a,b,c,d,e){return e||(e=zb),new cc(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 Wb=Sb.never=function(){return new cc(function(){return pb})};Sb.range=function(a,b,c){return c||(c=zb),new cc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Sb.repeat=function(a,b,c){return c||(c=zb),null==b&&(b=-1),Xb(a,c).repeat(b)};var Xb=Sb["return"]=Sb.returnValue=function(a,b){return b||(b=yb),new cc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Yb=Sb["throw"]=Sb.throwException=function(a,b){return b||(b=yb),new cc(function(c){return b.schedule(function(){c.onError(a)})})};Sb.using=function(a,b){return new cc(function(c){var d,e,f=pb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new lb(Yb(g).subscribe(c),f)}return new lb(e.subscribe(c),f)})},Mb.amb=function(a){var b=this;return new cc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new rb,j=new rb;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 lb(i,j)})},Sb.amb=function(){function a(a,b){return a.amb(b)}for(var b=Wb(),c=k(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Mb["catch"]=Mb.catchException=function(a){return"function"==typeof a?n(this,a):Zb([this,a])};var Zb=Sb.catchException=Sb["catch"]=function(){var a=k(arguments,0);return Jb(a).catchException()};Mb.combineLatest=function(){var a=eb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),$b.apply(this,a)};var $b=Sb.combineLatest=function(){var a=eb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new cc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(y))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(y)&&c.onCompleted()}function e(a){j[a]=!0,j.every(y)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=l(g,f),i=!1,j=l(g,f),k=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){m[b]=new rb,m[b].setDisposable(a[b].subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)}))}(n);return new lb(m)})};Mb.concat=function(){var a=eb.call(arguments,0);return a.unshift(this),_b.apply(this,a)};var _b=Sb.concat=function(){var a=k(arguments,0);return Jb(a).concat()};Mb.concatObservable=Mb.concatAll=function(){return this.merge(1)},Mb.merge=function(a){if("number"!=typeof a)return ac(this,a);var b=this;return new cc(function(c){var d=0,e=new lb,f=!1,g=[],h=function(a){var b=new rb;e.add(b),E(a)&&(a=Tb(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(),h(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,h(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var ac=Sb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=eb.call(arguments,1)):(a=yb,b=eb.call(arguments,0)):(a=yb,b=eb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Vb(b,a).mergeObservable()};Mb.mergeObservable=Mb.mergeAll=function(){var a=this;return new cc(function(b){var c=new lb,d=!1,e=new rb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new rb;c.add(e),E(a)&&(a=Tb(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})},Mb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return bc([this,a])};var bc=Sb.onErrorResumeNext=function(){var a=k(arguments,0);return new cc(function(b){var c=0,d=new sb,e=yb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],g=new rb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new lb(d,e)})};Mb.skipUntil=function(a){var b=this;return new cc(function(c){var d=!1,e=new lb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new rb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Mb["switch"]=Mb.switchLatest=function(){var a=this;return new cc(function(b){var c=!1,d=new sb,e=!1,f=0,g=a.subscribe(function(a){var g=new rb,h=++f;c=!0,d.setDisposable(g),E(a)&&(a=Tb(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new lb(g,d)})},Mb.takeUntil=function(a){var b=this;return new cc(function(c){return new lb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),x))})},Mb.zip=function(){if(Array.isArray(arguments[0]))return o.apply(this,arguments);var a=this,b=eb.call(arguments),c=b.pop();return b.unshift(a),new cc(function(d){function e(a){h[a]=!0,h.every(function(a){return a})&&d.onCompleted()}for(var f=b.length,g=l(f,function(){return[]}),h=l(f,function(){return!1}),i=function(b){var e,f;if(g.every(function(a){return a.length>0})){try{f=g.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(i){return void d.onError(i)}d.onNext(e)}else h.filter(function(a,c){return c!==b}).every(y)&&d.onCompleted()},j=new Array(f),k=0;f>k;k++)!function(a){j[a]=new rb,j[a].setDisposable(b[a].subscribe(function(b){g[a].push(b),i(a)},d.onError.bind(d),function(){e(a)}))}(k);return new lb(j)})},Sb.zip=function(){var a=eb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Sb.zipArray=function(){var a=k(arguments,0);return new cc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(y))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(y)?void b.onCompleted():void 0}for(var e=a.length,f=l(e,function(){return[]}),g=l(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new rb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new lb(h);return j.add(ob(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},Mb.asObservable=function(){var a=this;return new cc(function(b){return a.subscribe(b)})},Mb.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})},Mb.dematerialize=function(){var a=this;return new cc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Mb.distinctUntilChanged=function(a,b){var c=this;return a||(a=y),b||(b=A),new cc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Mb["do"]=Mb.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 cc(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)
2
- }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()})})},Mb["finally"]=Mb.finallyAction=function(a){var b=this;return new cc(function(c){var d=b.subscribe(c);return ob(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Mb.ignoreElements=function(){var a=this;return new cc(function(b){return a.subscribe(x,b.onError.bind(b),b.onCompleted.bind(b))})},Mb.materialize=function(){var a=this;return new cc(function(b){return a.subscribe(function(a){b.onNext(Db(a))},function(a){b.onNext(Eb(a)),b.onCompleted()},function(){b.onNext(Fb()),b.onCompleted()})})},Mb.repeat=function(a){return Ib(this,a).concat()},Mb.retry=function(a){return Ib(this,a).catchException()},Mb.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 cc(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()})})},Mb.skipLast=function(a){var b=this;return new cc(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))})},Mb.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=yb,a=eb.call(arguments,c),Jb([Vb(a,b),this]).concat()},Mb.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Vb(a,b)})},Mb.takeLastBuffer=function(a){var b=this;return new cc(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()})})},Mb.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 cc(function(d){var e=new rb,f=new tb(e),g=0,h=[],i=function(){var a=new gc;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})},Mb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new cc(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()})})},Mb.distinct=function(a,b){var c=this;return a||(a=y),b||(b=C),new cc(function(d){var e={};return c.subscribe(function(c){var f,g,h,i=!1;try{f=a(c),g=b(f)}catch(j){return void d.onError(j)}for(h in e)if(g===h){i=!0;break}i||(e[g]=null,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Mb.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return Wb()},c)},Mb.groupByUntil=function(a,b,c,d){var e=this;return b||(b=y),d||(d=C),new cc(function(f){var g={},h=new lb,i=new tb(h);return h.add(e.subscribe(function(e){var j,k,l,m,n,o,p,q,r,s;try{o=a(e),p=d(o)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}m=!1;try{r=g[p],r||(r=new gc,g[p]=r,m=!0)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}if(m){n=new ec(o,r,i),k=new ec(o,r);try{j=c(k)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}f.onNext(n),q=new rb,h.add(q);var u=function(){p in g&&(delete g[p],r.onCompleted()),h.remove(q)};q.setDisposable(j.take(1).subscribe(x,function(a){for(s in g)g[s].onError(a);f.onError(a)},function(){u()}))}try{l=b(e)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}r.onNext(l)},function(a){for(var b in g)g[b].onError(a);f.onError(a)},function(){for(var a in g)g[a].onCompleted();f.onCompleted()})),i})},Mb.select=Mb.map=function(a,b){var c=this;return new cc(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))})},Mb.pluck=function(a){return this.select(function(b){return b[a]})},Mb.selectMany=Mb.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=E(e)?Tb(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?p.call(this,a):p.call(this,function(){return a})},Mb.selectSwitch=Mb.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},Mb.skip=function(a){if(0>a)throw new Error(G);var b=this;return new cc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Mb.skipWhile=function(a,b){var c=this;return new cc(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))})},Mb.take=function(a,b){if(0>a)throw new Error(G);if(0===a)return Ub(b);var c=this;return new cc(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))})},Mb.takeWhile=function(a,b){var c=this;return new cc(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))})},Mb.where=Mb.filter=function(a,b){var c=this;return new cc(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 cc=w.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=pb:"function"==typeof a&&(a=ob(a)),a}function c(d){function e(a){var c=new dc(a);if(zb.scheduleRequired())zb.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}(Sb),dc=function(a){function b(b){a.call(this),this.observer=b,this.m=new rb}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}(Nb),ec=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 cc(function(a){return new lb(e.getDisposable(),d.subscribe(a))}):d}return fb(c,a),c}(Sb),fc=function(a,b){this.subject=a,this.observer=b};fc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var gc=w.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),pb):(a.onCompleted(),pb):(this.observers.push(a),new fc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return fb(d,a),gb(d.prototype,Kb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new hc(a,b)},d}(Sb),hc=(w.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new fc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),pb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return fb(d,a),gb(d.prototype,Kb,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Sb),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,Kb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Sb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(r.Rx=w,define(function(){return w})):s&&t?u?(t.exports=w).Rx=w:s.Rx=w:r.Rx=w}).call(this);
1
+ (function(a){function b(){if(this.isDisposed)throw new Error(H)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;cb.nonEnumArgs&&a.length&&h(a)&&(a=eb.call(a));var d=cb.enumPrototypes&&"function"==typeof a,e=cb.enumErrorProps&&(a===Y||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(cb.nonEnumShadows&&a!==Z){var g=a.constructor,i=-1,j=ab.length;if(a===(g&&g.prototype))var k=a===stringProto?U:a===Y?P:V.call(a),l=bb[k];for(;++i<j;)f=ab[i],l&&l[f]||!W.call(a,f)||b.push(f)}return b}function e(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 f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?V.call(a)==L:!1}function i(a){return"function"==typeof a}function j(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,k=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=k&&"object"!=k))return!1;var l=V.call(a),m=V.call(b);if(l==L&&(l=S),m==L&&(m=S),l!=m)return!1;switch(l){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 n=l==M;if(!n){if(l!=S||!cb.nodeClass&&(g(a)||g(b)))return!1;var o=!cb.argsObject&&h(a)?Object:a.constructor,p=!cb.argsObject&&h(b)?Object:b.constructor;if(!(o==p||W.call(a,"constructor")&&W.call(b,"constructor")||i(o)&&o instanceof o&&i(p)&&p instanceof p||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var q=c.length;q--;)if(c[q]==a)return d[q]==b;var r=0;if(result=!0,c.push(a),d.push(b),n){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=j(a[r],s,c,d)))break}}else f(b,function(b,e,f){return W.call(f,e)?(r++,result=W.call(a,e)&&j(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return W.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function k(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:eb.call(a)}function l(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(a,b){return new cc(function(c){var d=new rb,e=new sb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}E(f)&&(f=Tb(f)),d=new rb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function o(a,b){var c=this;return new cc(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 p(a){return this.select(function(b,c){var d=a(b,c);return E(d)?Tb(d):d}).mergeObservable()}var q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},r=q[typeof window]&&window||this,s=q[typeof exports]&&exports&&!exports.nodeType&&exports,t=q[typeof module]&&module&&!module.nodeType&&module,u=t&&t.exports===s&&s,v=q[typeof global]&&global;!v||v.global!==v&&v.window!==v||(r=v);var w={internals:{},config:{Promise:r.Promise},helpers:{}},x=w.helpers.noop=function(){},y=w.helpers.identity=function(a){return a},z=w.helpers.defaultNow=Date.now,A=w.helpers.defaultComparer=function(a,b){return db(a,b)},B=w.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},C=w.helpers.defaultKeySerializer=function(a){return a.toString()},D=w.helpers.defaultError=function(a){throw a},E=w.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then&&a.then!==w.Observable.prototype.then},F=(w.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},w.helpers.not=function(a){return!a},"Sequence contains no elements."),G="Argument out of range",H="Object has been disposed",I="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";r.Set&&"function"==typeof(new r.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||(h=function(a){return a&&"object"==typeof a?W.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&V.call(a)==Q});var db=w.internals.isEqual=function(a,b){return j(a,b,[],[])},eb=Array.prototype.slice,fb=({}.hasOwnProperty,this.inherits=w.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),gb=w.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=w.internals.addRef=function(a,b){return new cc(function(c){return new lb(b.getDisposable(),a.subscribe(c))})},ib=function(a,b){this.id=a,this.value=b};ib.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var jb=w.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},kb=jb.prototype;kb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},kb.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)}}},kb.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)}}},kb.peek=function(){return this.items[0].value},kb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},kb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},kb.enqueue=function(a){var b=this.length++;this.items[b]=new ib(jb.count++,a),this.percolate(b)},kb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},jb.count=0;var lb=w.CompositeDisposable=function(){this.disposables=k(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},mb=lb.prototype;mb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},mb.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},mb.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()}},mb.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()},mb.contains=function(a){return-1!==this.disposables.indexOf(a)},mb.toArray=function(){return this.disposables.slice(0)};var nb=w.Disposable=function(a){this.isDisposed=!1,this.action=a||x};nb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ob=nb.create=function(a){return new nb(a)},pb=nb.empty={dispose:x},qb=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}(),rb=w.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return fb(b,a),b}(qb),sb=w.SerialDisposable=function(a){function b(){a.call(this,!1)}return fb(b,a),b}(qb),tb=w.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?pb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var ub=w.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||B,this.disposable=new rb};ub.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ub.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},ub.prototype.isCancelled=function(){return this.disposable.isDisposed},ub.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var vb,wb=w.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 lb,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),pb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new lb,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),pb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),pb}var e=a.prototype;return e.catchException=e["catch"]=function(a){return new Bb(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 ob(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=z,a.normalize=function(a){return 0>a&&(a=0),a},a}(),xb=wb.normalize,yb=(w.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 rb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),wb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=xb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new wb(z,a,b,c)}()),zb=wb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-wb.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()+wb.normalize(c),g=new ub(this,b,d,f);if(e)e.enqueue(g);else{e=new jb(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 wb(z,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),Ab=x;!function(){function a(){if(!r.postMessage||r.importScripts)return!1;var a=!1,b=r.onmessage;return r.onmessage=function(){a=!0},r.postMessage("","*"),r.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=v&&u&&v.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=v&&u&&v.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))vb=process.nextTick;else if("function"==typeof d)vb=d,Ab=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;r.addEventListener?r.addEventListener("message",b,!1):r.attachEvent("onmessage",b,!1),vb=function(a){var b=h++;g[b]=a,r.postMessage(f+b,"*")}}else if(r.MessageChannel){var i=new r.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},vb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in r&&"onreadystatechange"in r.document.createElement("script")?vb=function(a){var b=r.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},r.document.documentElement.appendChild(b)}:(vb=function(a){return setTimeout(a,0)},Ab=clearTimeout)}();var Bb=(wb.timeout=function(){function a(a,b){var c=this,d=new rb,e=vb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new lb(d,ob(function(){Ab(e)}))}function b(a,b,c){var d=this,e=wb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new rb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new lb(f,ob(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new wb(z,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 pb}}},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 rb;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}(wb)),Cb=w.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=yb),new cc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Db=Cb.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 Cb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Eb=Cb.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 Cb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Fb=Cb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Cb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Gb=w.internals.Enumerator=function(a){this._next=a};Gb.prototype.next=function(){return this._next()},Gb.prototype[I]=function(){return this};var Hb=w.internals.Enumerable=function(a){this._iterator=a};Hb.prototype[I]=function(){return this._iterator()},Hb.prototype.concat=function(){var a=this;return new cc(function(b){var c;try{c=a[I]()}catch(d){return void b.onError()}var e,f=new sb,g=yb.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=d.value;E(h)&&(h=Tb(h));var i=new rb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new lb(f,g,ob(function(){e=!0}))})},Hb.prototype.catchException=function(){var a=this;return new cc(function(b){var c;try{c=a[I]()}catch(d){return void b.onError()}var e,f,g=new sb,h=yb.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=d.value;E(i)&&(i=Tb(i));var j=new rb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new lb(g,h,ob(function(){e=!0}))})};var Ib=Hb.repeat=function(a,b){return null==b&&(b=-1),new Hb(function(){var c=b;return new Gb(function(){return 0===c?K:(c>0&&c--,{done:!1,value:a})})})},Jb=Hb.forEach=function(a,b,c){return b||(b=y),new Hb(function(){var d=-1;return new Gb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:K})})},Kb=w.Observer=function(){};Kb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Kb.prototype.asObserver=function(){return new Ob(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Kb.prototype.checked=function(){return new Pb(this)};var Lb=Kb.create=function(a,b,c){return a||(a=x),b||(b=D),c||(c=x),new Ob(a,b,c)};Kb.fromNotifier=function(a){return new Ob(function(b){return a(Db(b))},function(b){return a(Eb(b))},function(){return a(Fb())})},Kb.notifyOn=function(a){return new Rb(a,this)};var Mb,Nb=w.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}(Kb),Ob=w.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}(Nb),Pb=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}(Kb),Qb=w.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 sb}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}(Nb),Rb=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}(Qb),Sb=w.Observable=function(){function a(a){this._subscribe=a}return Mb=a.prototype,Mb.finalValue=function(){var a=this;return new cc(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))})})},Mb.subscribe=Mb.forEach=function(a,b,c){var d;return d="object"==typeof a?a:Lb(a,b,c),this._subscribe(d)},Mb.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}();Mb.observeOn=function(a){var b=this;return new cc(function(c){return b.subscribe(new Rb(a,c))})},Mb.subscribeOn=function(a){var b=this;return new cc(function(c){var d=new rb,e=new sb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var Tb=Sb.fromPromise=function(a){return new cc(function(b){return a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)}),function(){a&&a.abort&&a.abort()}})};Mb.toPromise=function(a){if(a||(a=w.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)})})},Sb.create=Sb.createWithDisposable=function(a){return new cc(a)};var Ub=(Sb.defer=function(a){return new cc(function(b){var c;try{c=a()}catch(d){return Yb(d).subscribe(b)}return E(c)&&(c=Tb(c)),c.subscribe(b)})},Sb.empty=function(a){return a||(a=yb),new cc(function(b){return a.schedule(function(){b.onCompleted()})})}),Vb=Sb.fromArray=function(a,b){return b||(b=zb),new cc(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Sb.fromIterable=function(a,b){return b||(b=zb),new cc(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())})})},Sb.generate=function(a,b,c,d,e){return e||(e=zb),new cc(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 Wb=Sb.never=function(){return new cc(function(){return pb})};Sb.range=function(a,b,c){return c||(c=zb),new cc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Sb.repeat=function(a,b,c){return c||(c=zb),null==b&&(b=-1),Xb(a,c).repeat(b)};var Xb=Sb["return"]=Sb.returnValue=function(a,b){return b||(b=yb),new cc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Yb=Sb["throw"]=Sb.throwException=function(a,b){return b||(b=yb),new cc(function(c){return b.schedule(function(){c.onError(a)})})};Sb.using=function(a,b){return new cc(function(c){var d,e,f=pb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new lb(Yb(g).subscribe(c),f)}return new lb(e.subscribe(c),f)})},Mb.amb=function(a){var b=this;return new cc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new rb,j=new rb;return E(a)&&(a=Tb(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new lb(i,j)})},Sb.amb=function(){function a(a,b){return a.amb(b)}for(var b=Wb(),c=k(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Mb["catch"]=Mb.catchException=function(a){return"function"==typeof a?n(this,a):Zb([this,a])};var Zb=Sb.catchException=Sb["catch"]=function(){var a=k(arguments,0);return Jb(a).catchException()};Mb.combineLatest=function(){var a=eb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),$b.apply(this,a)};var $b=Sb.combineLatest=function(){var a=eb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new cc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(y))){try{d=b.apply(null,k)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(y)&&c.onCompleted()}function e(a){j[a]=!0,j.every(y)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=l(g,f),i=!1,j=l(g,f),k=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new rb;E(f)&&(f=Tb(f)),g.setDisposable(f.subscribe(function(a){k[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new lb(m)})};Mb.concat=function(){var a=eb.call(arguments,0);return a.unshift(this),_b.apply(this,a)};var _b=Sb.concat=function(){var a=k(arguments,0);return Jb(a).concat()};Mb.concatObservable=Mb.concatAll=function(){return this.merge(1)},Mb.merge=function(a){if("number"!=typeof a)return ac(this,a);var b=this;return new cc(function(c){var d=0,e=new lb,f=!1,g=[],h=function(a){var b=new rb;e.add(b),E(a)&&(a=Tb(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(),h(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,h(b)):g.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var ac=Sb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=eb.call(arguments,1)):(a=yb,b=eb.call(arguments,0)):(a=yb,b=eb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Vb(b,a).mergeObservable()};Mb.mergeObservable=Mb.mergeAll=function(){var a=this;return new cc(function(b){var c=new lb,d=!1,e=new rb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new rb;c.add(e),E(a)&&(a=Tb(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})},Mb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return bc([this,a])};var bc=Sb.onErrorResumeNext=function(){var a=k(arguments,0);return new cc(function(b){var c=0,d=new sb,e=yb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],E(f)&&(f=Tb(f)),g=new rb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new lb(d,e)})};Mb.skipUntil=function(a){var b=this;return new cc(function(c){var d=!1,e=new lb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new rb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Mb["switch"]=Mb.switchLatest=function(){var a=this;return new cc(function(b){var c=!1,d=new sb,e=!1,f=0,g=a.subscribe(function(a){var g=new rb,h=++f;c=!0,d.setDisposable(g),E(a)&&(a=Tb(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new lb(g,d)})},Mb.takeUntil=function(a){var b=this;return new cc(function(c){return new lb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),x))})},Mb.zip=function(){if(Array.isArray(arguments[0]))return o.apply(this,arguments);var a=this,b=eb.call(arguments),c=b.pop();return b.unshift(a),new cc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(y)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=l(g,function(){return[]}),i=l(g,function(){return!1}),j=new Array(g),k=0;g>k;k++)!function(a){var c=b[a],g=new rb;E(c)&&(c=Tb(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(k);return new lb(j)})},Sb.zip=function(){var a=eb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Sb.zipArray=function(){var a=k(arguments,0);return new cc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(y))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(y)?void b.onCompleted():void 0}for(var e=a.length,f=l(e,function(){return[]}),g=l(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new rb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new lb(h);return j.add(ob(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},Mb.asObservable=function(){var a=this;return new cc(function(b){return a.subscribe(b)})},Mb.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})},Mb.dematerialize=function(){var a=this;return new cc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Mb.distinctUntilChanged=function(a,b){var c=this;return a||(a=y),b||(b=A),new cc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Mb["do"]=Mb.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 cc(function(a){return e.subscribe(function(b){try{d(b)
2
+ }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()})})},Mb["finally"]=Mb.finallyAction=function(a){var b=this;return new cc(function(c){var d=b.subscribe(c);return ob(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Mb.ignoreElements=function(){var a=this;return new cc(function(b){return a.subscribe(x,b.onError.bind(b),b.onCompleted.bind(b))})},Mb.materialize=function(){var a=this;return new cc(function(b){return a.subscribe(function(a){b.onNext(Db(a))},function(a){b.onNext(Eb(a)),b.onCompleted()},function(){b.onNext(Fb()),b.onCompleted()})})},Mb.repeat=function(a){return Ib(this,a).concat()},Mb.retry=function(a){return Ib(this,a).catchException()},Mb.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 cc(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()})})},Mb.skipLast=function(a){var b=this;return new cc(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))})},Mb.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=yb,a=eb.call(arguments,c),Jb([Vb(a,b),this]).concat()},Mb.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Vb(a,b)})},Mb.takeLastBuffer=function(a){var b=this;return new cc(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()})})},Mb.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 cc(function(d){var e=new rb,f=new tb(e),g=0,h=[],i=function(){var a=new gc;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})},Mb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new cc(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()})})},Mb.distinct=function(a,b){var c=this;return a||(a=y),b||(b=C),new cc(function(d){var e={};return c.subscribe(function(c){var f,g,h,i=!1;try{f=a(c),g=b(f)}catch(j){return void d.onError(j)}for(h in e)if(g===h){i=!0;break}i||(e[g]=null,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},Mb.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return Wb()},c)},Mb.groupByUntil=function(a,b,c,d){var e=this;return b||(b=y),d||(d=C),new cc(function(f){var g={},h=new lb,i=new tb(h);return h.add(e.subscribe(function(e){var j,k,l,m,n,o,p,q,r,s;try{o=a(e),p=d(o)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}m=!1;try{r=g[p],r||(r=new gc,g[p]=r,m=!0)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}if(m){n=new ec(o,r,i),k=new ec(o,r);try{j=c(k)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}f.onNext(n),q=new rb,h.add(q);var u=function(){p in g&&(delete g[p],r.onCompleted()),h.remove(q)};q.setDisposable(j.take(1).subscribe(x,function(a){for(s in g)g[s].onError(a);f.onError(a)},function(){u()}))}try{l=b(e)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}r.onNext(l)},function(a){for(var b in g)g[b].onError(a);f.onError(a)},function(){for(var a in g)g[a].onCompleted();f.onCompleted()})),i})},Mb.select=Mb.map=function(a,b){var c=this;return new cc(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))})},Mb.pluck=function(a){return this.select(function(b){return b[a]})},Mb.selectMany=Mb.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=E(e)?Tb(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?p.call(this,a):p.call(this,function(){return a})},Mb.selectSwitch=Mb.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},Mb.skip=function(a){if(0>a)throw new Error(G);var b=this;return new cc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Mb.skipWhile=function(a,b){var c=this;return new cc(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))})},Mb.take=function(a,b){if(0>a)throw new Error(G);if(0===a)return Ub(b);var c=this;return new cc(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))})},Mb.takeWhile=function(a,b){var c=this;return new cc(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))})},Mb.where=Mb.filter=function(a,b){var c=this;return new cc(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 cc=w.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=pb:"function"==typeof a&&(a=ob(a)),a}function c(d){function e(a){var c=new dc(a);if(zb.scheduleRequired())zb.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}(Sb),dc=function(a){function b(b){a.call(this),this.observer=b,this.m=new rb}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}(Nb),ec=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 cc(function(a){return new lb(e.getDisposable(),d.subscribe(a))}):d}return fb(c,a),c}(Sb),fc=function(a,b){this.subject=a,this.observer=b};fc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var gc=w.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),pb):(a.onCompleted(),pb):(this.observers.push(a),new fc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return fb(d,a),gb(d.prototype,Kb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new hc(a,b)},d}(Sb),hc=(w.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new fc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),pb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return fb(d,a),gb(d.prototype,Kb,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Sb),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,Kb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Sb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(r.Rx=w,define(function(){return w})):s&&t?u?(t.exports=w).Rx=w:s.Rx=w:r.Rx=w}).call(this);