rxjs-rails 2.2.27 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -3
  3. data/lib/rxjs/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  5. data/vendor/assets/javascripts/rx.all.compat.js +1545 -1441
  6. data/vendor/assets/javascripts/rx.all.compat.min.js +3 -3
  7. data/vendor/assets/javascripts/rx.all.js +1545 -1441
  8. data/vendor/assets/javascripts/rx.all.min.js +3 -3
  9. data/vendor/assets/javascripts/rx.async.compat.js +149 -152
  10. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  11. data/vendor/assets/javascripts/rx.async.js +140 -143
  12. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  13. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  14. data/vendor/assets/javascripts/rx.binding.js +18 -18
  15. data/vendor/assets/javascripts/rx.binding.min.js +1 -1
  16. data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
  17. data/vendor/assets/javascripts/rx.compat.js +490 -339
  18. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  19. data/vendor/assets/javascripts/rx.core.compat.js +109 -141
  20. data/vendor/assets/javascripts/rx.core.compat.min.js +1 -1
  21. data/vendor/assets/javascripts/rx.core.js +109 -141
  22. data/vendor/assets/javascripts/rx.core.min.js +1 -1
  23. data/vendor/assets/javascripts/rx.experimental.js +129 -136
  24. data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
  25. data/vendor/assets/javascripts/rx.joinpatterns.js +59 -59
  26. data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
  27. data/vendor/assets/javascripts/rx.js +490 -339
  28. data/vendor/assets/javascripts/rx.lite.compat.js +1099 -954
  29. data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
  30. data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
  31. data/vendor/assets/javascripts/rx.lite.js +1099 -954
  32. data/vendor/assets/javascripts/rx.lite.min.js +2 -2
  33. data/vendor/assets/javascripts/rx.min.js +2 -2
  34. data/vendor/assets/javascripts/rx.testing.min.js +1 -1
  35. data/vendor/assets/javascripts/rx.time.js +715 -747
  36. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  37. data/vendor/assets/javascripts/rx.virtualtime.min.js +1 -1
  38. metadata +11 -10
@@ -1,2 +1,2 @@
1
- (function(t){function e(){if(this.isDisposed)throw Error(k)}function n(t){var e=typeof t;return t&&("function"==e||"object"==e)||!1}function r(t){var e=[];if(!n(t))return e;ne.nonEnumArgs&&t.length&&u(t)&&(t=ie.call(t));var r=ne.enumPrototypes&&"function"==typeof t,i=ne.enumErrorProps&&(t===X||t instanceof Error);for(var o in t)r&&"prototype"==o||i&&("message"==o||"name"==o)||e.push(o);if(ne.nonEnumShadows&&t!==Z){var s=t.constructor,c=-1,a=te.length;if(t===(s&&s.prototype))var h=t===stringProto?Q:t===X?I:$.call(t),l=ee[h];for(;a>++c;)o=te[c],l&&l[o]||!K.call(t,o)||e.push(o)}return e}function i(t,e,n){for(var r=-1,i=n(t),o=i.length;o>++r;){var s=i[r];if(e(t[s],s,t)===!1)break}return t}function o(t,e){return i(t,e,r)}function s(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function u(t){return t&&"object"==typeof t?$.call(t)==V:!1}function c(t){return"function"==typeof t||!1}function a(e,n,r,i){if(e===n)return 0!==e||1/e==1/n;var h=typeof e,l=typeof n;if(e===e&&(null==e||null==n||"function"!=h&&"object"!=h&&"function"!=l&&"object"!=l))return!1;var f=$.call(e),p=$.call(n);if(f==V&&(f=H),p==V&&(p=H),f!=p)return!1;switch(f){case z:case M:return+e==+n;case B:return e!=+e?n!=+n:0==e?1/e==1/n:e==+n;case U:case Q:return e==n+""}var d=f==L;if(!d){if(f!=H||!ne.nodeClass&&(s(e)||s(n)))return!1;var v=!ne.argsObject&&u(e)?Object:e.constructor,b=!ne.argsObject&&u(n)?Object:n.constructor;if(!(v==b||K.call(e,"constructor")&&K.call(n,"constructor")||c(v)&&v instanceof v&&c(b)&&b instanceof b||!("constructor"in e&&"constructor"in n)))return!1}r||(r=[]),i||(i=[]);for(var m=r.length;m--;)if(r[m]==e)return i[m]==n;var y=0;if(result=!0,r.push(e),i.push(n),d){if(m=e.length,y=n.length,result=y==m)for(;y--;){var w=n[y];if(!(result=a(e[y],w,r,i)))break}}else o(n,function(n,o,s){return K.call(s,o)?(y++,result=K.call(e,o)&&a(e[o],n,r,i)):t}),result&&o(e,function(e,n,r){return K.call(r,n)?result=--y>-1:t});return r.pop(),i.pop(),result}function h(t,e){return 1===t.length&&Array.isArray(t[e])?t[e]:ie.call(t)}function l(t,e){for(var n=Array(t),r=0;t>r;r++)n[r]=e();return n}function f(t,e){this.scheduler=t,this.disposable=e,this.isDisposed=!1}function p(e,n){return new on(function(r){var i=new we,o=new ge;return o.setDisposable(i),i.setDisposable(e.subscribe(r.onNext.bind(r),function(e){var i,s;try{s=n(e)}catch(u){return r.onError(u),t}R(s)&&(s=$e(s)),i=new we,o.setDisposable(i),i.setDisposable(s.subscribe(r))},r.onCompleted.bind(r))),o})}function d(e,n){var r=this;return new on(function(i){var o=0,s=e.length;return r.subscribe(function(r){if(s>o){var u,c=e[o++];try{u=n(r,c)}catch(a){return i.onError(a),t}i.onNext(u)}else i.onCompleted()},i.onError.bind(i),i.onCompleted.bind(i))})}function v(t){return this.map(function(e,n){var r=t(e,n);return R(r)?$e(r):r}).concatAll()}function b(t){return this.select(function(e,n){var r=t(e,n);return R(r)?$e(r):r}).mergeObservable()}var m={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},y=m[typeof window]&&window||this,w=m[typeof exports]&&exports&&!exports.nodeType&&exports,g=m[typeof module]&&module&&!module.nodeType&&module,E=g&&g.exports===w&&w,x=m[typeof global]&&global;!x||x.global!==x&&x.window!==x||(y=x);var C={internals:{},config:{Promise:y.Promise},helpers:{}},D=C.helpers.noop=function(){},S=C.helpers.identity=function(t){return t},A=(C.helpers.pluck=function(t){return function(e){return e[t]}},C.helpers.just=function(t){return function(){return t}},C.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),N=C.helpers.defaultComparer=function(t,e){return re(t,e)},_=C.helpers.defaultSubComparer=function(t,e){return t>e?1:e>t?-1:0},O=C.helpers.defaultKeySerializer=function(t){return""+t},W=C.helpers.defaultError=function(t){throw t},R=C.helpers.isPromise=function(t){return!!t&&"function"==typeof t.then&&t.then!==C.Observable.prototype.then};C.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},C.helpers.not=function(t){return!t};var j="Argument out of range",k="Object has been disposed",q="object"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";y.Set&&"function"==typeof(new y.Set)["@@iterator"]&&(q="@@iterator");var P,T={done:!0,value:t},V="[object Arguments]",L="[object Array]",z="[object Boolean]",M="[object Date]",I="[object Error]",F="[object Function]",B="[object Number]",H="[object Object]",U="[object RegExp]",Q="[object String]",$=Object.prototype.toString,K=Object.prototype.hasOwnProperty,J=$.call(arguments)==V,X=Error.prototype,Z=Object.prototype,G=Z.propertyIsEnumerable;try{P=!($.call(document)==H&&!({toString:0}+""))}catch(Y){P=!0}var te=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ee={};ee[L]=ee[M]=ee[B]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},ee[z]=ee[Q]={constructor:!0,toString:!0,valueOf:!0},ee[I]=ee[F]=ee[U]={constructor:!0,toString:!0},ee[H]={constructor:!0};var ne={};(function(){var t=function(){this.x=1},e=[];t.prototype={valueOf:1,y:1};for(var n in new t)e.push(n);for(n in arguments);ne.enumErrorProps=G.call(X,"message")||G.call(X,"name"),ne.enumPrototypes=G.call(t,"prototype"),ne.nonEnumArgs=0!=n,ne.nonEnumShadows=!/valueOf/.test(e)})(1),J||(u=function(t){return t&&"object"==typeof t?K.call(t,"callee"):!1}),c(/x/)&&(c=function(t){return"function"==typeof t&&$.call(t)==F});var re=C.internals.isEqual=function(t,e){return a(t,e,[],[])},ie=Array.prototype.slice;({}).hasOwnProperty;var oe=this.inherits=C.internals.inherits=function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n},se=C.internals.addProperties=function(t){for(var e=ie.call(arguments,1),n=0,r=e.length;r>n;n++){var i=e[n];for(var o in i)t[o]=i[o]}},ue=C.internals.addRef=function(t,e){return new on(function(n){return new pe(e.getDisposable(),t.subscribe(n))})};Function.prototype.bind||(Function.prototype.bind=function(t){var e=this,n=ie.call(arguments,1),r=function(){function i(){}if(this instanceof r){i.prototype=e.prototype;var o=new i,s=e.apply(o,n.concat(ie.call(arguments)));return Object(s)===s?s:o}return e.apply(t,n.concat(ie.call(arguments)))};return r});var ce=Object("a"),ae="a"!=ce[0]||!(0 in ce);Array.prototype.every||(Array.prototype.every=function(t){var e=Object(this),n=ae&&{}.toString.call(this)==Q?this.split(""):e,r=n.length>>>0,i=arguments[1];if({}.toString.call(t)!=F)throw new TypeError(t+" is not a function");for(var o=0;r>o;o++)if(o in n&&!t.call(i,n[o],o,e))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(t){var e=Object(this),n=ae&&{}.toString.call(this)==Q?this.split(""):e,r=n.length>>>0,i=Array(r),o=arguments[1];if({}.toString.call(t)!=F)throw new TypeError(t+" is not a function");for(var s=0;r>s;s++)s in n&&(i[s]=t.call(o,n[s],s,e));return i}),Array.prototype.filter||(Array.prototype.filter=function(t){for(var e,n=[],r=Object(this),i=0,o=r.length>>>0;o>i;i++)e=r[i],i in r&&t.call(arguments[1],e,i,r)&&n.push(e);return n}),Array.isArray||(Array.isArray=function(t){return Object.prototype.toString.call(t)==L}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t){var e=Object(this),n=e.length>>>0;if(0===n)return-1;var r=0;if(arguments.length>1&&(r=Number(arguments[1]),r!==r?r=0:0!==r&&1/0!=r&&r!==-1/0&&(r=(r>0||-1)*Math.floor(Math.abs(r)))),r>=n)return-1;for(var i=r>=0?r:Math.max(n-Math.abs(r),0);n>i;i++)if(i in e&&e[i]===t)return i;return-1});var he=function(t,e){this.id=t,this.value=e};he.prototype.compareTo=function(t){var e=this.value.compareTo(t.value);return 0===e&&(e=this.id-t.id),e};var le=C.internals.PriorityQueue=function(t){this.items=Array(t),this.length=0},fe=le.prototype;fe.isHigherPriority=function(t,e){return 0>this.items[t].compareTo(this.items[e])},fe.percolate=function(t){if(!(t>=this.length||0>t)){var e=t-1>>1;if(!(0>e||e===t)&&this.isHigherPriority(t,e)){var n=this.items[t];this.items[t]=this.items[e],this.items[e]=n,this.percolate(e)}}},fe.heapify=function(e){if(e===t&&(e=0),!(e>=this.length||0>e)){var n=2*e+1,r=2*e+2,i=e;if(this.length>n&&this.isHigherPriority(n,i)&&(i=n),this.length>r&&this.isHigherPriority(r,i)&&(i=r),i!==e){var o=this.items[e];this.items[e]=this.items[i],this.items[i]=o,this.heapify(i)}}},fe.peek=function(){return this.items[0].value},fe.removeAt=function(t){this.items[t]=this.items[--this.length],delete this.items[this.length],this.heapify()},fe.dequeue=function(){var t=this.peek();return this.removeAt(0),t},fe.enqueue=function(t){var e=this.length++;this.items[e]=new he(le.count++,t),this.percolate(e)},fe.remove=function(t){for(var e=0;this.length>e;e++)if(this.items[e].value===t)return this.removeAt(e),!0;return!1},le.count=0;var pe=C.CompositeDisposable=function(){this.disposables=h(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},de=pe.prototype;de.add=function(t){this.isDisposed?t.dispose():(this.disposables.push(t),this.length++)},de.remove=function(t){var e=!1;if(!this.isDisposed){var n=this.disposables.indexOf(t);-1!==n&&(e=!0,this.disposables.splice(n,1),this.length--,t.dispose())}return e},de.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var t=this.disposables.slice(0);this.disposables=[],this.length=0;for(var e=0,n=t.length;n>e;e++)t[e].dispose()}},de.clear=function(){var t=this.disposables.slice(0);this.disposables=[],this.length=0;for(var e=0,n=t.length;n>e;e++)t[e].dispose()},de.contains=function(t){return-1!==this.disposables.indexOf(t)},de.toArray=function(){return this.disposables.slice(0)};var ve=C.Disposable=function(t){this.isDisposed=!1,this.action=t||D};ve.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var be=ve.create=function(t){return new ve(t)},me=ve.empty={dispose:D},ye=function(){function t(t){this.isSingle=t,this.isDisposed=!1,this.current=null}var e=t.prototype;return e.getDisposable=function(){return this.current},e.setDisposable=function(t){if(this.current&&this.isSingle)throw Error("Disposable has already been assigned");var e,n=this.isDisposed;n||(e=this.current,this.current=t),e&&e.dispose(),n&&t&&t.dispose()},e.dispose=function(){var t;this.isDisposed||(this.isDisposed=!0,t=this.current,this.current=null),t&&t.dispose()},t}(),we=C.SingleAssignmentDisposable=function(t){function e(){t.call(this,!0)}return oe(e,t),e}(ye),ge=C.SerialDisposable=function(t){function e(){t.call(this,!1)}return oe(e,t),e}(ye),Ee=C.RefCountDisposable=function(){function t(t){this.disposable=t,this.disposable.count++,this.isInnerDisposed=!1}function e(t){this.underlyingDisposable=t,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return t.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()))},e.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},e.prototype.getDisposable=function(){return this.isDisposed?me:new t(this)},e}();f.prototype.dispose=function(){var t=this;this.scheduler.schedule(function(){t.isDisposed||(t.isDisposed=!0,t.disposable.dispose())})};var xe=C.internals.ScheduledItem=function(t,e,n,r,i){this.scheduler=t,this.state=e,this.action=n,this.dueTime=r,this.comparer=i||_,this.disposable=new we};xe.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},xe.prototype.compareTo=function(t){return this.comparer(this.dueTime,t.dueTime)},xe.prototype.isCancelled=function(){return this.disposable.isDisposed},xe.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Ce=C.Scheduler=function(){function t(t,e,n,r){this.now=t,this._schedule=e,this._scheduleRelative=n,this._scheduleAbsolute=r}function e(t,e){var n=e.first,r=e.second,i=new pe,o=function(e){r(e,function(e){var n=!1,r=!1,s=t.scheduleWithState(e,function(t,e){return n?i.remove(s):r=!0,o(e),me});r||(i.add(s),n=!0)})};return o(n),i}function n(t,e,n){var r=e.first,i=e.second,o=new pe,s=function(e){i(e,function(e,r){var i=!1,u=!1,c=t[n].call(t,e,r,function(t,e){return i?o.remove(c):u=!0,s(e),me});u||(o.add(c),i=!0)})};return s(r),o}function r(t,e){return e(),me}var i=t.prototype;return i.catchException=i["catch"]=function(t){return new Oe(this,t)},i.schedulePeriodic=function(t,e){return this.schedulePeriodicWithState(null,t,function(){e()})},i.schedulePeriodicWithState=function(t,e,n){var r=t,i=setInterval(function(){r=n(r)},e);return be(function(){clearInterval(i)})},i.schedule=function(t){return this._schedule(t,r)},i.scheduleWithState=function(t,e){return this._schedule(t,e)},i.scheduleWithRelative=function(t,e){return this._scheduleRelative(e,t,r)},i.scheduleWithRelativeAndState=function(t,e,n){return this._scheduleRelative(t,e,n)},i.scheduleWithAbsolute=function(t,e){return this._scheduleAbsolute(e,t,r)},i.scheduleWithAbsoluteAndState=function(t,e,n){return this._scheduleAbsolute(t,e,n)},i.scheduleRecursive=function(t){return this.scheduleRecursiveWithState(t,function(t,e){t(function(){e(t)})})},i.scheduleRecursiveWithState=function(t,n){return this.scheduleWithState({first:t,second:n},function(t,n){return e(t,n)})},i.scheduleRecursiveWithRelative=function(t,e){return this.scheduleRecursiveWithRelativeAndState(e,t,function(t,e){t(function(n){e(t,n)})})},i.scheduleRecursiveWithRelativeAndState=function(t,e,r){return this._scheduleRelative({first:t,second:r},e,function(t,e){return n(t,e,"scheduleWithRelativeAndState")})},i.scheduleRecursiveWithAbsolute=function(t,e){return this.scheduleRecursiveWithAbsoluteAndState(e,t,function(t,e){t(function(n){e(t,n)})})},i.scheduleRecursiveWithAbsoluteAndState=function(t,e,r){return this._scheduleAbsolute({first:t,second:r},e,function(t,e){return n(t,e,"scheduleWithAbsoluteAndState")})},t.now=A,t.normalize=function(t){return 0>t&&(t=0),t},t}(),De=Ce.normalize;C.internals.SchedulePeriodicRecursive=function(){function t(t,e){e(0,this._period);try{this._state=this._action(this._state)}catch(n){throw this._cancel.dispose(),n}}function e(t,e,n,r){this._scheduler=t,this._state=e,this._period=n,this._action=r}return e.prototype.start=function(){var e=new we;return this._cancel=e,e.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,t.bind(this))),e},e}();var Se,Ae=Ce.immediate=function(){function t(t,e){return e(this,t)}function e(t,e,n){for(var r=De(r);r-this.now()>0;);return n(this,t)}function n(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}return new Ce(A,t,e,n)}(),Ne=Ce.currentThread=function(){function t(t){for(var e;t.length>0;)if(e=t.dequeue(),!e.isCancelled()){for(;e.dueTime-Ce.now()>0;);e.isCancelled()||e.invoke()}}function e(t,e){return this.scheduleWithRelativeAndState(t,0,e)}function n(e,n,r){var o=this.now()+Ce.normalize(n),s=new xe(this,e,r,o);if(i)i.enqueue(s);else{i=new le(4),i.enqueue(s);try{t(i)}catch(u){throw u}finally{i=null}}return s.disposable}function r(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}var i,o=new Ce(A,e,n,r);return o.scheduleRequired=function(){return null===i},o.ensureTrampoline=function(t){return null===i?this.schedule(t):t()},o}(),_e=D;(function(){function t(){if(!y.postMessage||y.importScripts)return!1;var t=!1,e=y.onmessage;return y.onmessage=function(){t=!0},y.postMessage("","*"),y.onmessage=e,t}function e(t){if("string"==typeof t.data&&t.data.substring(0,o.length)===o){var e=t.data.substring(o.length),n=s[e];n(),delete s[e]}}var n=RegExp("^"+($+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),r="function"==typeof(r=x&&E&&x.setImmediate)&&!n.test(r)&&r,i="function"==typeof(i=x&&E&&x.clearImmediate)&&!n.test(i)&&i;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Se=process.nextTick;else if("function"==typeof r)Se=r,_e=i;else if(t()){var o="ms.rx.schedule"+Math.random(),s={},u=0;y.addEventListener?y.addEventListener("message",e,!1):y.attachEvent("onmessage",e,!1),Se=function(t){var e=u++;s[e]=t,y.postMessage(o+e,"*")}}else if(y.MessageChannel){var c=new y.MessageChannel,a={},h=0;c.port1.onmessage=function(t){var e=t.data,n=a[e];n(),delete a[e]},Se=function(t){var e=h++;a[e]=t,c.port2.postMessage(e)}}else"document"in y&&"onreadystatechange"in y.document.createElement("script")?Se=function(t){var e=y.document.createElement("script");e.onreadystatechange=function(){t(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},y.document.documentElement.appendChild(e)}:(Se=function(t){return setTimeout(t,0)},_e=clearTimeout)})(),Ce.timeout=function(){function t(t,e){var n=this,r=new we,i=Se(function(){r.isDisposed||r.setDisposable(e(n,t))});return new pe(r,be(function(){_e(i)}))}function e(t,e,n){var r=this,i=Ce.normalize(e);if(0===i)return r.scheduleWithState(t,n);var o=new we,s=setTimeout(function(){o.isDisposed||o.setDisposable(n(r,t))},i);return new pe(o,be(function(){clearTimeout(s)}))}function n(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}return new Ce(A,t,e,n)}();var Oe=function(t){function e(){return this._scheduler.now()}function n(t,e){return this._scheduler.scheduleWithState(t,this._wrap(e))}function r(t,e,n){return this._scheduler.scheduleWithRelativeAndState(t,e,this._wrap(n))}function i(t,e,n){return this._scheduler.scheduleWithAbsoluteAndState(t,e,this._wrap(n))}function o(o,s){this._scheduler=o,this._handler=s,this._recursiveOriginal=null,this._recursiveWrapper=null,t.call(this,e,n,r,i)}return oe(o,t),o.prototype._clone=function(t){return new o(t,this._handler)},o.prototype._wrap=function(t){var e=this;return function(n,r){try{return t(e._getRecursiveWrapper(n),r)}catch(i){if(!e._handler(i))throw i;return me}}},o.prototype._getRecursiveWrapper=function(t){if(this._recursiveOriginal!==t){this._recursiveOriginal=t;var e=this._clone(t);e._recursiveOriginal=t,e._recursiveWrapper=e,this._recursiveWrapper=e}return this._recursiveWrapper},o.prototype.schedulePeriodicWithState=function(t,e,n){var r=this,i=!1,o=new we;return o.setDisposable(this._scheduler.schedulePeriodicWithState(t,e,function(t){if(i)return null;try{return n(t)}catch(e){if(i=!0,!r._handler(e))throw e;return o.dispose(),null}})),o},o}(Ce),We=C.Notification=function(){function t(t,e){this.hasValue=null==e?!1:e,this.kind=t}var e=t.prototype;return e.accept=function(t,e,n){return 1===arguments.length&&"object"==typeof t?this._acceptObservable(t):this._accept(t,e,n)},e.toObservable=function(t){var e=this;return t||(t=Ae),new on(function(n){return t.schedule(function(){e._acceptObservable(n),"N"===e.kind&&n.onCompleted()})})},t}(),Re=We.createOnNext=function(){function t(t){return t(this.value)}function e(t){return t.onNext(this.value)}function n(){return"OnNext("+this.value+")"}return function(r){var i=new We("N",!0);return i.value=r,i._accept=t,i._acceptObservable=e,i.toString=n,i}}(),je=We.createOnError=function(){function t(t,e){return e(this.exception)}function e(t){return t.onError(this.exception)}function n(){return"OnError("+this.exception+")"}return function(r){var i=new We("E");return i.exception=r,i._accept=t,i._acceptObservable=e,i.toString=n,i}}(),ke=We.createOnCompleted=function(){function t(t,e,n){return n()}function e(t){return t.onCompleted()}function n(){return"OnCompleted()"}return function(){var r=new We("C");return r._accept=t,r._acceptObservable=e,r.toString=n,r}}(),qe=C.internals.Enumerator=function(t){this._next=t};qe.prototype.next=function(){return this._next()},qe.prototype[q]=function(){return this};var Pe=C.internals.Enumerable=function(t){this._iterator=t};Pe.prototype[q]=function(){return this._iterator()},Pe.prototype.concat=function(){var e=this;return new on(function(n){var r;try{r=e[q]()}catch(i){return n.onError(),t}var o,s=new ge,u=Ae.scheduleRecursive(function(e){var i;if(!o){try{i=r.next()}catch(u){return n.onError(u),t}if(i.done)return n.onCompleted(),t;var c=i.value;R(c)&&(c=$e(c));var a=new we;s.setDisposable(a),a.setDisposable(c.subscribe(n.onNext.bind(n),n.onError.bind(n),function(){e()}))}});return new pe(s,u,be(function(){o=!0}))})},Pe.prototype.catchException=function(){var e=this;return new on(function(n){var r;try{r=e[q]()}catch(i){return n.onError(),t}var o,s,u=new ge,c=Ae.scheduleRecursive(function(e){if(!o){var i;try{i=r.next()}catch(c){return n.onError(c),t}if(i.done)return s?n.onError(s):n.onCompleted(),t;var a=i.value;R(a)&&(a=$e(a));var h=new we;u.setDisposable(h),h.setDisposable(a.subscribe(n.onNext.bind(n),function(t){s=t,e()},n.onCompleted.bind(n)))}});return new pe(u,c,be(function(){o=!0}))})};var Te=Pe.repeat=function(t,e){return null==e&&(e=-1),new Pe(function(){var n=e;return new qe(function(){return 0===n?T:(n>0&&n--,{done:!1,value:t})})})},Ve=Pe.forEach=function(t,e,n){return e||(e=S),new Pe(function(){var r=-1;return new qe(function(){return++r<t.length?{done:!1,value:e.call(n,t[r],r,t)}:T})})},Le=C.Observer=function(){};Le.prototype.toNotifier=function(){var t=this;return function(e){return e.accept(t)}},Le.prototype.asObserver=function(){return new Fe(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Le.prototype.checked=function(){return new Be(this)};var ze=Le.create=function(t,e,n){return t||(t=D),e||(e=W),n||(n=D),new Fe(t,e,n)};Le.fromNotifier=function(t){return new Fe(function(e){return t(Re(e))},function(e){return t(je(e))},function(){return t(ke())})},Le.notifyOn=function(t){return new Ue(t,this)};var Me,Ie=C.internals.AbstractObserver=function(t){function e(){this.isStopped=!1,t.call(this)}return oe(e,t),e.prototype.onNext=function(t){this.isStopped||this.next(t)},e.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.error(t))},e.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},e.prototype.dispose=function(){this.isStopped=!0},e.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.error(t),!0)},e}(Le),Fe=C.AnonymousObserver=function(t){function e(e,n,r){t.call(this),this._onNext=e,this._onError=n,this._onCompleted=r}return oe(e,t),e.prototype.next=function(t){this._onNext(t)},e.prototype.error=function(t){this._onError(t)},e.prototype.completed=function(){this._onCompleted()},e}(Ie),Be=function(t){function e(e){t.call(this),this._observer=e,this._state=0}oe(e,t);var n=e.prototype;return n.onNext=function(t){this.checkAccess();try{this._observer.onNext(t)}catch(e){throw e}finally{this._state=0}},n.onError=function(t){this.checkAccess();try{this._observer.onError(t)}catch(e){throw e}finally{this._state=2}},n.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(t){throw t}finally{this._state=2}},n.checkAccess=function(){if(1===this._state)throw Error("Re-entrancy detected");if(2===this._state)throw Error("Observer completed");0===this._state&&(this._state=1)},e}(Le),He=C.internals.ScheduledObserver=function(e){function n(t,n){e.call(this),this.scheduler=t,this.observer=n,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new ge}return oe(n,e),n.prototype.next=function(t){var e=this;this.queue.push(function(){e.observer.onNext(t)})},n.prototype.error=function(t){var e=this;this.queue.push(function(){e.observer.onError(t)})},n.prototype.completed=function(){var t=this;this.queue.push(function(){t.observer.onCompleted()})},n.prototype.ensureActive=function(){var e=!1,n=this;!this.hasFaulted&&this.queue.length>0&&(e=!this.isAcquired,this.isAcquired=!0),e&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(e){var r;if(!(n.queue.length>0))return n.isAcquired=!1,t;r=n.queue.shift();try{r()}catch(i){throw n.queue=[],n.hasFaulted=!0,i}e()}))},n.prototype.dispose=function(){e.prototype.dispose.call(this),this.disposable.dispose()},n}(Ie),Ue=function(t){function e(){t.apply(this,arguments)}return oe(e,t),e.prototype.next=function(e){t.prototype.next.call(this,e),this.ensureActive()},e.prototype.error=function(e){t.prototype.error.call(this,e),this.ensureActive()},e.prototype.completed=function(){t.prototype.completed.call(this),this.ensureActive()},e}(He),Qe=C.Observable=function(){function t(t){this._subscribe=t}return Me=t.prototype,Me.subscribe=Me.forEach=function(t,e,n){var r="object"==typeof t?t:ze(t,e,n);return this._subscribe(r)},t}();Me.observeOn=function(t){var e=this;return new on(function(n){return e.subscribe(new Ue(t,n))})},Me.subscribeOn=function(t){var e=this;return new on(function(n){var r=new we,i=new ge;return i.setDisposable(r),r.setDisposable(t.schedule(function(){i.setDisposable(new f(t,e.subscribe(n)))})),i})};var $e=Qe.fromPromise=function(t){return new on(function(e){return t.then(function(t){e.onNext(t),e.onCompleted()},function(t){e.onError(t)}),function(){t&&t.abort&&t.abort()}})};Me.toPromise=function(t){if(t||(t=C.config.Promise),!t)throw Error("Promise type not provided nor in Rx.config.Promise");var e=this;return new t(function(t,n){var r,i=!1;e.subscribe(function(t){r=t,i=!0},function(t){n(t)},function(){i&&t(r)})})},Me.toArray=function(){var t=this;return new on(function(e){var n=[];return t.subscribe(n.push.bind(n),e.onError.bind(e),function(){e.onNext(n),e.onCompleted()})})},Qe.create=Qe.createWithDisposable=function(t){return new on(t)},Qe.defer=function(t){return new on(function(e){var n;try{n=t()}catch(r){return Ge(r).subscribe(e)}return R(n)&&(n=$e(n)),n.subscribe(e)})};var Ke=Qe.empty=function(t){return t||(t=Ae),new on(function(e){return t.schedule(function(){e.onCompleted()})})},Je=Qe.fromArray=function(t,e){return e||(e=Ne),new on(function(n){var r=0;return e.scheduleRecursive(function(e){t.length>r?(n.onNext(t[r++]),e()):n.onCompleted()})})};Qe.fromIterable=function(e,n){return n||(n=Ne),new on(function(r){var i;try{i=e[q]()}catch(o){return r.onError(o),t}return n.scheduleRecursive(function(e){var n;try{n=i.next()}catch(o){return r.onError(o),t}n.done?r.onCompleted():(r.onNext(n.value),e())})})},Qe.generate=function(e,n,r,i,o){return o||(o=Ne),new on(function(s){var u=!0,c=e;return o.scheduleRecursive(function(e){var o,a;try{u?u=!1:c=r(c),o=n(c),o&&(a=i(c))}catch(h){return s.onError(h),t}o?(s.onNext(a),e()):s.onCompleted()})})};var Xe=Qe.never=function(){return new on(function(){return me})};Qe.range=function(t,e,n){return n||(n=Ne),new on(function(r){return n.scheduleRecursiveWithState(0,function(n,i){e>n?(r.onNext(t+n),i(n+1)):r.onCompleted()})})},Qe.repeat=function(t,e,n){return n||(n=Ne),null==e&&(e=-1),Ze(t,n).repeat(e)};var Ze=Qe["return"]=Qe.returnValue=function(t,e){return e||(e=Ae),new on(function(n){return e.schedule(function(){n.onNext(t),n.onCompleted()})})},Ge=Qe["throw"]=Qe.throwException=function(t,e){return e||(e=Ae),new on(function(n){return e.schedule(function(){n.onError(t)})})};Qe.using=function(t,e){return new on(function(n){var r,i,o=me;try{r=t(),r&&(o=r),i=e(r)}catch(s){return new pe(Ge(s).subscribe(n),o)}return new pe(i.subscribe(n),o)})},Me.amb=function(t){var e=this;return new on(function(n){function r(){o||(o=s,a.dispose())}function i(){o||(o=u,c.dispose())}var o,s="L",u="R",c=new we,a=new we;return R(t)&&(t=$e(t)),c.setDisposable(e.subscribe(function(t){r(),o===s&&n.onNext(t)},function(t){r(),o===s&&n.onError(t)},function(){r(),o===s&&n.onCompleted()})),a.setDisposable(t.subscribe(function(t){i(),o===u&&n.onNext(t)},function(t){i(),o===u&&n.onError(t)},function(){i(),o===u&&n.onCompleted()})),new pe(c,a)})},Qe.amb=function(){function t(t,e){return t.amb(e)}for(var e=Xe(),n=h(arguments,0),r=0,i=n.length;i>r;r++)e=t(e,n[r]);return e},Me["catch"]=Me.catchException=function(t){return"function"==typeof t?p(this,t):Ye([this,t])};var Ye=Qe.catchException=Qe["catch"]=function(){var t=h(arguments,0);return Ve(t).catchException()};Me.combineLatest=function(){var t=ie.call(arguments);return Array.isArray(t[0])?t[0].unshift(this):t.unshift(this),tn.apply(this,t)};var tn=Qe.combineLatest=function(){var e=ie.call(arguments),n=e.pop();return Array.isArray(e[0])&&(e=e[0]),new on(function(r){function i(e){var i;if(c[e]=!0,a||(a=c.every(S))){try{i=n.apply(null,f)}catch(o){return r.onError(o),t}r.onNext(i)}else h.filter(function(t,n){return n!==e}).every(S)&&r.onCompleted()}function o(t){h[t]=!0,h.every(S)&&r.onCompleted()}for(var s=function(){return!1},u=e.length,c=l(u,s),a=!1,h=l(u,s),f=Array(u),p=Array(u),d=0;u>d;d++)(function(t){var n=e[t],s=new we;R(n)&&(n=$e(n)),s.setDisposable(n.subscribe(function(e){f[t]=e,i(t)},r.onError.bind(r),function(){o(t)})),p[t]=s})(d);return new pe(p)})};Me.concat=function(){var t=ie.call(arguments,0);return t.unshift(this),en.apply(this,t)};var en=Qe.concat=function(){var t=h(arguments,0);return Ve(t).concat()};Me.concatObservable=Me.concatAll=function(){return this.merge(1)},Me.merge=function(t){if("number"!=typeof t)return nn(this,t);var e=this;return new on(function(n){var r=0,i=new pe,o=!1,s=[],u=function(t){var e=new we;i.add(e),R(t)&&(t=$e(t)),e.setDisposable(t.subscribe(n.onNext.bind(n),n.onError.bind(n),function(){var t;i.remove(e),s.length>0?(t=s.shift(),u(t)):(r--,o&&0===r&&n.onCompleted())}))};return i.add(e.subscribe(function(e){t>r?(r++,u(e)):s.push(e)},n.onError.bind(n),function(){o=!0,0===r&&n.onCompleted()})),i})};var nn=Qe.merge=function(){var t,e;return arguments[0]?arguments[0].now?(t=arguments[0],e=ie.call(arguments,1)):(t=Ae,e=ie.call(arguments,0)):(t=Ae,e=ie.call(arguments,1)),Array.isArray(e[0])&&(e=e[0]),Je(e,t).mergeObservable()};Me.mergeObservable=Me.mergeAll=function(){var t=this;return new on(function(e){var n=new pe,r=!1,i=new we;return n.add(i),i.setDisposable(t.subscribe(function(t){var i=new we;n.add(i),R(t)&&(t=$e(t)),i.setDisposable(t.subscribe(function(t){e.onNext(t)},e.onError.bind(e),function(){n.remove(i),r&&1===n.length&&e.onCompleted()}))},e.onError.bind(e),function(){r=!0,1===n.length&&e.onCompleted()})),n})},Me.onErrorResumeNext=function(t){if(!t)throw Error("Second observable is required");return rn([this,t])};var rn=Qe.onErrorResumeNext=function(){var t=h(arguments,0);return new on(function(e){var n=0,r=new ge,i=Ae.scheduleRecursive(function(i){var o,s;t.length>n?(o=t[n++],R(o)&&(o=$e(o)),s=new we,r.setDisposable(s),s.setDisposable(o.subscribe(e.onNext.bind(e),function(){i()},function(){i()}))):e.onCompleted()});return new pe(r,i)})};Me.skipUntil=function(t){var e=this;return new on(function(n){var r=!1,i=new pe(e.subscribe(function(t){r&&n.onNext(t)},n.onError.bind(n),function(){r&&n.onCompleted()}));R(t)&&(t=$e(t));var o=new we;return i.add(o),o.setDisposable(t.subscribe(function(){r=!0,o.dispose()},n.onError.bind(n),function(){o.dispose()})),i})},Me["switch"]=Me.switchLatest=function(){var t=this;return new on(function(e){var n=!1,r=new ge,i=!1,o=0,s=t.subscribe(function(t){var s=new we,u=++o;n=!0,r.setDisposable(s),R(t)&&(t=$e(t)),s.setDisposable(t.subscribe(function(t){o===u&&e.onNext(t)},function(t){o===u&&e.onError(t)},function(){o===u&&(n=!1,i&&e.onCompleted())}))},e.onError.bind(e),function(){i=!0,n||e.onCompleted()});return new pe(s,r)})},Me.takeUntil=function(t){var e=this;return new on(function(n){return R(t)&&(t=$e(t)),new pe(e.subscribe(n),t.subscribe(n.onCompleted.bind(n),n.onError.bind(n),D))})},Me.zip=function(){if(Array.isArray(arguments[0]))return d.apply(this,arguments);var e=this,n=ie.call(arguments),r=n.pop();return n.unshift(e),new on(function(i){function o(n){var o,s;if(c.every(function(t){return t.length>0})){try{s=c.map(function(t){return t.shift()}),o=r.apply(e,s)}catch(u){return i.onError(u),t}i.onNext(o)}else a.filter(function(t,e){return e!==n}).every(S)&&i.onCompleted()}function s(t){a[t]=!0,a.every(function(t){return t})&&i.onCompleted()}for(var u=n.length,c=l(u,function(){return[]}),a=l(u,function(){return!1}),h=Array(u),f=0;u>f;f++)(function(t){var e=n[t],r=new we;R(e)&&(e=$e(e)),r.setDisposable(e.subscribe(function(e){c[t].push(e),o(t)},i.onError.bind(i),function(){s(t)})),h[t]=r})(f);return new pe(h)})},Qe.zip=function(){var t=ie.call(arguments,0),e=t.shift();return e.zip.apply(e,t)
2
- },Qe.zipArray=function(){var e=h(arguments,0);return new on(function(n){function r(e){if(s.every(function(t){return t.length>0})){var r=s.map(function(t){return t.shift()});n.onNext(r)}else if(u.filter(function(t,n){return n!==e}).every(S))return n.onCompleted(),t}function i(e){return u[e]=!0,u.every(S)?(n.onCompleted(),t):t}for(var o=e.length,s=l(o,function(){return[]}),u=l(o,function(){return!1}),c=Array(o),a=0;o>a;a++)(function(t){c[t]=new we,c[t].setDisposable(e[t].subscribe(function(e){s[t].push(e),r(t)},n.onError.bind(n),function(){i(t)}))})(a);var h=new pe(c);return h.add(be(function(){for(var t=0,e=s.length;e>t;t++)s[t]=[]})),h})},Me.asObservable=function(){var t=this;return new on(function(e){return t.subscribe(e)})},Me.bufferWithCount=function(t,e){return"number"!=typeof e&&(e=t),this.windowWithCount(t,e).selectMany(function(t){return t.toArray()}).where(function(t){return t.length>0})},Me.dematerialize=function(){var t=this;return new on(function(e){return t.subscribe(function(t){return t.accept(e)},e.onError.bind(e),e.onCompleted.bind(e))})},Me.distinctUntilChanged=function(e,n){var r=this;return e||(e=S),n||(n=N),new on(function(i){var o,s=!1;return r.subscribe(function(r){var u,c=!1;try{u=e(r)}catch(a){return i.onError(a),t}if(s)try{c=n(o,u)}catch(a){return i.onError(a),t}s&&c||(s=!0,o=u,i.onNext(r))},i.onError.bind(i),i.onCompleted.bind(i))})},Me["do"]=Me.doAction=function(t,e,n){var r,i=this;return"function"==typeof t?r=t:(r=t.onNext.bind(t),e=t.onError.bind(t),n=t.onCompleted.bind(t)),new on(function(t){return i.subscribe(function(e){try{r(e)}catch(n){t.onError(n)}t.onNext(e)},function(n){if(e){try{e(n)}catch(r){t.onError(r)}t.onError(n)}else t.onError(n)},function(){if(n){try{n()}catch(e){t.onError(e)}t.onCompleted()}else t.onCompleted()})})},Me["finally"]=Me.finallyAction=function(t){var e=this;return new on(function(n){var r;try{r=e.subscribe(n)}catch(i){throw t(),i}return be(function(){try{r.dispose()}catch(e){throw e}finally{t()}})})},Me.ignoreElements=function(){var t=this;return new on(function(e){return t.subscribe(D,e.onError.bind(e),e.onCompleted.bind(e))})},Me.materialize=function(){var t=this;return new on(function(e){return t.subscribe(function(t){e.onNext(Re(t))},function(t){e.onNext(je(t)),e.onCompleted()},function(){e.onNext(ke()),e.onCompleted()})})},Me.repeat=function(t){return Te(this,t).concat()},Me.retry=function(t){return Te(this,t).catchException()},Me.scan=function(){var e,n,r=!1,i=this;return 2===arguments.length?(r=!0,e=arguments[0],n=arguments[1]):n=arguments[0],new on(function(o){var s,u,c;return i.subscribe(function(i){try{c||(c=!0),s?u=n(u,i):(u=r?n(e,i):i,s=!0)}catch(a){return o.onError(a),t}o.onNext(u)},o.onError.bind(o),function(){!c&&r&&o.onNext(e),o.onCompleted()})})},Me.skipLast=function(t){var e=this;return new on(function(n){var r=[];return e.subscribe(function(e){r.push(e),r.length>t&&n.onNext(r.shift())},n.onError.bind(n),n.onCompleted.bind(n))})},Me.startWith=function(){var t,e,n=0;return arguments.length&&"now"in Object(arguments[0])?(e=arguments[0],n=1):e=Ae,t=ie.call(arguments,n),Ve([Je(t,e),this]).concat()},Me.takeLast=function(t,e){return this.takeLastBuffer(t).selectMany(function(t){return Je(t,e)})},Me.takeLastBuffer=function(t){var e=this;return new on(function(n){var r=[];return e.subscribe(function(e){r.push(e),r.length>t&&r.shift()},n.onError.bind(n),function(){n.onNext(r),n.onCompleted()})})},Me.windowWithCount=function(t,e){var n=this;if(0>=t)throw Error(j);if(1===arguments.length&&(e=t),0>=e)throw Error(j);return new on(function(r){var i=new we,o=new Ee(i),s=0,u=[],c=function(){var t=new an;u.push(t),r.onNext(ue(t,o))};return c(),i.setDisposable(n.subscribe(function(n){for(var r,i=0,o=u.length;o>i;i++)u[i].onNext(n);var a=s-t+1;a>=0&&0===a%e&&(r=u.shift(),r.onCompleted()),s++,0===s%e&&c()},function(t){for(;u.length>0;)u.shift().onError(t);r.onError(t)},function(){for(;u.length>0;)u.shift().onCompleted();r.onCompleted()})),o})},Me.selectConcat=Me.concatMap=function(t,e){return e?this.concatMap(function(n,r){var i=t(n,r),o=R(i)?$e(i):i;return o.map(function(t){return e(n,t,r)})}):"function"==typeof t?v.call(this,t):v.call(this,function(){return t})},Me.defaultIfEmpty=function(e){var n=this;return e===t&&(e=null),new on(function(t){var r=!1;return n.subscribe(function(e){r=!0,t.onNext(e)},t.onError.bind(t),function(){r||t.onNext(e),t.onCompleted()})})},Me.distinct=function(e,n){var r=this;return e||(e=S),n||(n=O),new on(function(i){var o={};return r.subscribe(function(r){var s,u,c,a=!1;try{s=e(r),u=n(s)}catch(h){return i.onError(h),t}for(c in o)if(u===c){a=!0;break}a||(o[u]=null,i.onNext(r))},i.onError.bind(i),i.onCompleted.bind(i))})},Me.groupBy=function(t,e,n){return this.groupByUntil(t,e,function(){return Xe()},n)},Me.groupByUntil=function(e,n,r,i){var o=this;return n||(n=S),i||(i=O),new on(function(s){var u={},c=new pe,a=new Ee(c);return c.add(o.subscribe(function(o){var h,l,f,p,d,v,b,m,y,w;try{v=e(o),b=i(v)}catch(g){for(w in u)u[w].onError(g);return s.onError(g),t}p=!1;try{y=u[b],y||(y=new an,u[b]=y,p=!0)}catch(g){for(w in u)u[w].onError(g);return s.onError(g),t}if(p){d=new un(v,y,a),l=new un(v,y);try{h=r(l)}catch(g){for(w in u)u[w].onError(g);return s.onError(g),t}s.onNext(d),m=new we,c.add(m);var E=function(){b in u&&(delete u[b],y.onCompleted()),c.remove(m)};m.setDisposable(h.take(1).subscribe(D,function(t){for(w in u)u[w].onError(t);s.onError(t)},function(){E()}))}try{f=n(o)}catch(g){for(w in u)u[w].onError(g);return s.onError(g),t}y.onNext(f)},function(t){for(var e in u)u[e].onError(t);s.onError(t)},function(){for(var t in u)u[t].onCompleted();s.onCompleted()})),a})},Me.select=Me.map=function(e,n){var r=this;return new on(function(i){var o=0;return r.subscribe(function(s){var u;try{u=e.call(n,s,o++,r)}catch(c){return i.onError(c),t}i.onNext(u)},i.onError.bind(i),i.onCompleted.bind(i))})},Me.pluck=function(t){return this.select(function(e){return e[t]})},Me.selectMany=Me.flatMap=function(t,e){return e?this.selectMany(function(n,r){var i=t(n,r),o=R(i)?$e(i):i;return o.select(function(t){return e(n,t,r)})}):"function"==typeof t?b.call(this,t):b.call(this,function(){return t})},Me.selectSwitch=Me.flatMapLatest=function(t,e){return this.select(t,e).switchLatest()},Me.skip=function(t){if(0>t)throw Error(j);var e=this;return new on(function(n){var r=t;return e.subscribe(function(t){0>=r?n.onNext(t):r--},n.onError.bind(n),n.onCompleted.bind(n))})},Me.skipWhile=function(e,n){var r=this;return new on(function(i){var o=0,s=!1;return r.subscribe(function(u){if(!s)try{s=!e.call(n,u,o++,r)}catch(c){return i.onError(c),t}s&&i.onNext(u)},i.onError.bind(i),i.onCompleted.bind(i))})},Me.take=function(t,e){if(0>t)throw Error(j);if(0===t)return Ke(e);var n=this;return new on(function(e){var r=t;return n.subscribe(function(t){r>0&&(r--,e.onNext(t),0===r&&e.onCompleted())},e.onError.bind(e),e.onCompleted.bind(e))})},Me.takeWhile=function(e,n){var r=this;return new on(function(i){var o=0,s=!0;return r.subscribe(function(u){if(s){try{s=e.call(n,u,o++,r)}catch(c){return i.onError(c),t}s?i.onNext(u):i.onCompleted()}},i.onError.bind(i),i.onCompleted.bind(i))})},Me.where=Me.filter=function(e,n){var r=this;return new on(function(i){var o=0;return r.subscribe(function(s){var u;try{u=e.call(n,s,o++,r)}catch(c){return i.onError(c),t}u&&i.onNext(s)},i.onError.bind(i),i.onCompleted.bind(i))})};var on=C.AnonymousObservable=function(e){function n(e){return e===t?e=me:"function"==typeof e&&(e=be(e)),e}function r(i){function o(t){var e=new sn(t);if(Ne.scheduleRequired())Ne.schedule(function(){try{e.setDisposable(n(i(e)))}catch(t){if(!e.fail(t))throw t}});else try{e.setDisposable(n(i(e)))}catch(r){if(!e.fail(r))throw r}return e}return this instanceof r?(e.call(this,o),t):new r(i)}return oe(r,e),r}(Qe),sn=function(t){function e(e){t.call(this),this.observer=e,this.m=new we}oe(e,t);var n=e.prototype;return n.next=function(t){var e=!1;try{this.observer.onNext(t),e=!0}catch(n){throw n}finally{e||this.dispose()}},n.error=function(t){try{this.observer.onError(t)}catch(e){throw e}finally{this.dispose()}},n.completed=function(){try{this.observer.onCompleted()}catch(t){throw t}finally{this.dispose()}},n.setDisposable=function(t){this.m.setDisposable(t)},n.getDisposable=function(){return this.m.getDisposable()},n.disposable=function(t){return arguments.length?this.getDisposable():setDisposable(t)},n.dispose=function(){t.prototype.dispose.call(this),this.m.dispose()},e}(Ie),un=function(t){function e(t){return this.underlyingObservable.subscribe(t)}function n(n,r,i){t.call(this,e),this.key=n,this.underlyingObservable=i?new on(function(t){return new pe(i.getDisposable(),r.subscribe(t))}):r}return oe(n,t),n}(Qe),cn=function(t,e){this.subject=t,this.observer=e};cn.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var t=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(t,1),this.observer=null}};var an=C.Subject=function(t){function n(t){return e.call(this),this.isStopped?this.exception?(t.onError(this.exception),me):(t.onCompleted(),me):(this.observers.push(t),new cn(this,t))}function r(){t.call(this,n),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return oe(r,t),se(r.prototype,Le,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(e.call(this),!this.isStopped){var t=this.observers.slice(0);this.isStopped=!0;for(var n=0,r=t.length;r>n;n++)t[n].onCompleted();this.observers=[]}},onError:function(t){if(e.call(this),!this.isStopped){var n=this.observers.slice(0);this.isStopped=!0,this.exception=t;for(var r=0,i=n.length;i>r;r++)n[r].onError(t);this.observers=[]}},onNext:function(t){if(e.call(this),!this.isStopped)for(var n=this.observers.slice(0),r=0,i=n.length;i>r;r++)n[r].onNext(t)},dispose:function(){this.isDisposed=!0,this.observers=null}}),r.create=function(t,e){return new hn(t,e)},r}(Qe);C.AsyncSubject=function(t){function n(t){if(e.call(this),!this.isStopped)return this.observers.push(t),new cn(this,t);var n=this.exception,r=this.hasValue,i=this.value;return n?t.onError(n):r?(t.onNext(i),t.onCompleted()):t.onCompleted(),me}function r(){t.call(this,n),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return oe(r,t),se(r.prototype,Le,{hasObservers:function(){return e.call(this),this.observers.length>0},onCompleted:function(){var t,n,r;if(e.call(this),!this.isStopped){this.isStopped=!0;var i=this.observers.slice(0),o=this.value,s=this.hasValue;if(s)for(n=0,r=i.length;r>n;n++)t=i[n],t.onNext(o),t.onCompleted();else for(n=0,r=i.length;r>n;n++)i[n].onCompleted();this.observers=[]}},onError:function(t){if(e.call(this),!this.isStopped){var n=this.observers.slice(0);this.isStopped=!0,this.exception=t;for(var r=0,i=n.length;i>r;r++)n[r].onError(t);this.observers=[]}},onNext:function(t){e.call(this),this.isStopped||(this.value=t,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),r}(Qe);var hn=function(t){function e(t){return this.observable.subscribe(t)}function n(n,r){t.call(this,e),this.observer=n,this.observable=r}return oe(n,t),se(n.prototype,Le,{onCompleted:function(){this.observer.onCompleted()},onError:function(t){this.observer.onError(t)},onNext:function(t){this.observer.onNext(t)}}),n}(Qe);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(y.Rx=C,define(function(){return C})):w&&g?E?(g.exports=C).Rx=C:w.Rx=C:y.Rx=C}).call(this);
1
+ (function(a){function b(){if(this.isDisposed)throw new Error(N)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;ib.nonEnumArgs&&a.length&&h(a)&&(a=kb.call(a));var d=ib.enumPrototypes&&"function"==typeof a,e=ib.enumErrorProps&&(a===cb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(ib.nonEnumShadows&&a!==db){var g=a.constructor,i=-1,j=gb.length;if(a===(g&&g.prototype))var k=a===stringProto?$:a===cb?V:_.call(a),l=hb[k];for(;++i<j;)f=gb[i],l&&l[f]||!ab.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?_.call(a)==R:!1}function i(a){return"function"==typeof a||!1}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=_.call(a),m=_.call(b);if(l==R&&(l=Y),m==R&&(m=Y),l!=m)return!1;switch(l){case T:case U:return+a==+b;case X:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Z:case $:return a==String(b)}var n=l==S;if(!n){if(l!=Y||!ib.nodeClass&&(g(a)||g(b)))return!1;var o=!ib.argsObject&&h(a)?Object:a.constructor,p=!ib.argsObject&&h(b)?Object:b.constructor;if(!(o==p||ab.call(a,"constructor")&&ab.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 ab.call(f,e)?(r++,result=ab.call(a,e)&&j(a[e],b,c,d)):void 0}),result&&f(a,function(a,b,c){return ab.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]:kb.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){return"number"==typeof a&&x.isFinite(a)}function o(b){return b[O]!==a}function p(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function q(a){var b=+a.length;return isNaN(b)?0:0!==b&&n(b)?(b=p(b)*Math.floor(Math.abs(b)),0>=b?0:b>bc?bc:b):b}function r(a){return"[object Function]"===Object.prototype.toString.call(a)&&"function"==typeof a}function s(a,b){return new lc(function(c){var d=new zb,e=new Ab;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)}L(f)&&(f=_b(f)),d=new zb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function t(a,b){var c=this;return new lc(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 u(a){return this.map(function(b,c){var d=a(b,c);return L(d)?_b(d):d}).concatAll()}function v(a){return this.select(function(b,c){var d=a(b,c);return L(d)?_b(d):d}).mergeObservable()}var w={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},x=w[typeof window]&&window||this,y=w[typeof exports]&&exports&&!exports.nodeType&&exports,z=w[typeof module]&&module&&!module.nodeType&&module,A=z&&z.exports===y&&y,B=w[typeof global]&&global;!B||B.global!==B&&B.window!==B||(x=B);var C={internals:{},config:{Promise:x.Promise},helpers:{}},D=C.helpers.noop=function(){},E=(C.helpers.notDefined=function(a){return"undefined"==typeof a},C.helpers.isScheduler=function(a){return a instanceof C.Scheduler}),F=C.helpers.identity=function(a){return a},G=(C.helpers.pluck=function(a){return function(b){return b[a]}},C.helpers.just=function(a){return function(){return a}},C.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),H=C.helpers.defaultComparer=function(a,b){return jb(a,b)},I=C.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},J=C.helpers.defaultKeySerializer=function(a){return a.toString()},K=C.helpers.defaultError=function(a){throw a},L=C.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then&&a.then!==C.Observable.prototype.then},M=(C.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},C.helpers.not=function(a){return!a},"Argument out of range"),N="Object has been disposed",O="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";x.Set&&"function"==typeof(new x.Set)["@@iterator"]&&(O="@@iterator");var P,Q={done:!0,value:a},R="[object Arguments]",S="[object Array]",T="[object Boolean]",U="[object Date]",V="[object Error]",W="[object Function]",X="[object Number]",Y="[object Object]",Z="[object RegExp]",$="[object String]",_=Object.prototype.toString,ab=Object.prototype.hasOwnProperty,bb=_.call(arguments)==R,cb=Error.prototype,db=Object.prototype,eb=db.propertyIsEnumerable;try{P=!(_.call(document)==Y&&!({toString:0}+""))}catch(fb){P=!0}var gb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],hb={};hb[S]=hb[U]=hb[X]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},hb[T]=hb[$]={constructor:!0,toString:!0,valueOf:!0},hb[V]=hb[W]=hb[Z]={constructor:!0,toString:!0},hb[Y]={constructor:!0};var ib={};!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);ib.enumErrorProps=eb.call(cb,"message")||eb.call(cb,"name"),ib.enumPrototypes=eb.call(a,"prototype"),ib.nonEnumArgs=0!=c,ib.nonEnumShadows=!/valueOf/.test(b)}(1),bb||(h=function(a){return a&&"object"==typeof a?ab.call(a,"callee"):!1}),i(/x/)&&(i=function(a){return"function"==typeof a&&_.call(a)==W});var jb=C.internals.isEqual=function(a,b){return j(a,b,[],[])},kb=Array.prototype.slice,lb=({}.hasOwnProperty,this.inherits=C.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),mb=C.internals.addProperties=function(a){for(var b=kb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},nb=C.internals.addRef=function(a,b){return new lc(function(c){return new tb(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=kb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(kb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(kb.call(arguments)))};return d});var ob=Object("a"),pb="a"!=ob[0]||!(0 in ob);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=pb&&{}.toString.call(this)==$?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=W)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=pb&&{}.toString.call(this)==$?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=W)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return Object.prototype.toString.call(a)==S}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1});var qb=function(a,b){this.id=a,this.value=b};qb.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var rb=C.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},sb=rb.prototype;sb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},sb.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)}}},sb.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)}}},sb.peek=function(){return this.items[0].value},sb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},sb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},sb.enqueue=function(a){var b=this.length++;this.items[b]=new qb(rb.count++,a),this.percolate(b)},sb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},rb.count=0;var tb=C.CompositeDisposable=function(){this.disposables=k(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},ub=tb.prototype;ub.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},ub.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},ub.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()}},ub.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()},ub.contains=function(a){return-1!==this.disposables.indexOf(a)},ub.toArray=function(){return this.disposables.slice(0)};var vb=C.Disposable=function(a){this.isDisposed=!1,this.action=a||D};vb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var wb=vb.create=function(a){return new vb(a)},xb=vb.empty={dispose:D},yb=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}(),zb=C.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return lb(b,a),b}(yb),Ab=C.SerialDisposable=function(a){function b(){a.call(this,!1)}return lb(b,a),b}(yb),Bb=C.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?xb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Cb=C.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||I,this.disposable=new zb};Cb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Cb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Cb.prototype.isCancelled=function(){return this.disposable.isDisposed},Cb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Db,Eb=C.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 tb,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),xb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new tb,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),xb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),xb}var e=a.prototype;return e.catchException=e["catch"]=function(a){return new Jb(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 wb(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=G,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Fb=Eb.normalize,Gb=(C.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 zb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Eb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Fb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Eb(G,a,b,c)}()),Hb=Eb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Eb.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()+Eb.normalize(c),g=new Cb(this,b,d,f);if(e)e.enqueue(g);else{e=new rb(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 Eb(G,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),Ib=D;!function(){function a(){if(!x.postMessage||x.importScripts)return!1;var a=!1,b=x.onmessage;return x.onmessage=function(){a=!0},x.postMessage("","*"),x.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(_).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=B&&A&&B.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=B&&A&&B.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Db=process.nextTick;else if("function"==typeof d)Db=d,Ib=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;x.addEventListener?x.addEventListener("message",b,!1):x.attachEvent("onmessage",b,!1),Db=function(a){var b=h++;g[b]=a,x.postMessage(f+b,"*")}}else if(x.MessageChannel){var i=new x.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Db=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in x&&"onreadystatechange"in x.document.createElement("script")?Db=function(a){var b=x.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},x.document.documentElement.appendChild(b)}:(Db=function(a){return setTimeout(a,0)},Ib=clearTimeout)}();var Jb=(Eb.timeout=function(){function a(a,b){var c=this,d=new zb,e=Db(function(){d.isDisposed||d.setDisposable(b(c,a))});return new tb(d,wb(function(){Ib(e)}))}function b(a,b,c){var d=this,e=Eb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new zb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new tb(f,wb(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Eb(G,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 lb(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 xb}}},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 zb;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}(Eb)),Kb=C.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return E(a)||(a=Gb),new lc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Lb=Kb.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 Kb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Mb=Kb.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 Kb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Nb=Kb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Kb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Ob=C.internals.Enumerator=function(a){this._next=a};Ob.prototype.next=function(){return this._next()},Ob.prototype[O]=function(){return this};var Pb=C.internals.Enumerable=function(a){this._iterator=a};Pb.prototype[O]=function(){return this._iterator()},Pb.prototype.concat=function(){var a=this;return new lc(function(b){var c;try{c=a[O]()}catch(d){return void b.onError()}var e,f=new Ab,g=Gb.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;L(h)&&(h=_b(h));var i=new zb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new tb(f,g,wb(function(){e=!0}))})},Pb.prototype.catchException=function(){var a=this;return new lc(function(b){var c;try{c=a[O]()}catch(d){return void b.onError()}var e,f,g=new Ab,h=Gb.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;L(i)&&(i=_b(i));var j=new zb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new tb(g,h,wb(function(){e=!0}))})};var Qb=Pb.repeat=function(a,b){return null==b&&(b=-1),new Pb(function(){var c=b;return new Ob(function(){return 0===c?Q:(c>0&&c--,{done:!1,value:a})})})},Rb=Pb.forEach=function(a,b,c){return b||(b=F),new Pb(function(){var d=-1;return new Ob(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:Q})})},Sb=C.Observer=function(){};Sb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Sb.prototype.asObserver=function(){return new Wb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Sb.prototype.checked=function(){return new Xb(this)};var Tb=Sb.create=function(a,b,c){return a||(a=D),b||(b=K),c||(c=D),new Wb(a,b,c)};Sb.fromNotifier=function(a){return new Wb(function(b){return a(Lb(b))},function(b){return a(Mb(b))},function(){return a(Nb())})},Sb.notifyOn=function(a){return new Zb(a,this)};var Ub,Vb=C.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return lb(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}(Sb),Wb=C.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return lb(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}(Vb),Xb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}lb(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}(Sb),Yb=C.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 Ab}return lb(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}(Vb),Zb=function(a){function b(){a.apply(this,arguments)}return lb(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}(Yb),$b=C.Observable=function(){function a(a){this._subscribe=a}return Ub=a.prototype,Ub.subscribe=Ub.forEach=function(a,b,c){var d="object"==typeof a?a:Tb(a,b,c);return this._subscribe(d)},a}();Ub.observeOn=function(a){var b=this;return new lc(function(c){return b.subscribe(new Zb(a,c))})},Ub.subscribeOn=function(a){var b=this;return new lc(function(c){var d=new zb,e=new Ab;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var _b=$b.fromPromise=function(a){return new lc(function(b){return a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)}),function(){a&&a.abort&&a.abort()}})};Ub.toPromise=function(a){if(a||(a=C.config.Promise),!a)throw new Error("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},function(a){c(a)},function(){e&&a(d)})})},Ub.toArray=function(){var a=this;return new lc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},$b.create=$b.createWithDisposable=function(a){return new lc(a)};var ac=($b.defer=function(a){return new lc(function(b){var c;try{c=a()}catch(d){return fc(d).subscribe(b)}return L(c)&&(c=_b(c)),c.subscribe(b)})},$b.empty=function(a){return E(a)||(a=Gb),new lc(function(b){return a.schedule(function(){b.onCompleted()})})}),bc=Math.pow(2,53)-1;$b.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!r(b))throw new Error("mapFn when provided must be a function");return E(d)||(d=Hb),new lc(function(e){var f=Object(a),g=o(f),h=g?0:q(f),i=g?f[O]():null,j=0;return d.scheduleRecursive(function(a){if(h>j||g){var d;if(g){var k=i.next();if(k.done)return void e.onCompleted();d=k.value}else d=f[j];if(b&&r(b))try{d=c?b.call(c,d,j):b(d,j)}catch(l){return void e.onError(l)}e.onNext(d),j++,a()}else e.onCompleted()})})};var cc=$b.fromArray=function(a,b){return E(b)||(b=Hb),new lc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};$b.generate=function(a,b,c,d,e){return E(e)||(e=Hb),new lc(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 dc=$b.never=function(){return new lc(function(){return xb})};$b.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return cc(b)};$b.ofWithScheduler=function(a){for(var b=arguments.length-1,c=new Array(b),d=0;b>d;d++)c[d]=arguments[d+1];return cc(c,a)};$b.range=function(a,b,c){return E(c)||(c=Hb),new lc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},$b.repeat=function(a,b,c){return E(c)||(c=Hb),ec(a,c).repeat(null==b?-1:b)};var ec=$b["return"]=$b.returnValue=$b.just=function(a,b){return E(b)||(b=Gb),new lc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},fc=$b["throw"]=$b.throwException=function(a,b){return E(b)||(b=Gb),new lc(function(c){return b.schedule(function(){c.onError(a)})})};$b.using=function(a,b){return new lc(function(c){var d,e,f=xb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new tb(fc(g).subscribe(c),f)}return new tb(e.subscribe(c),f)})},Ub.amb=function(a){var b=this;return new lc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new zb,j=new zb;return L(a)&&(a=_b(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 tb(i,j)})},$b.amb=function(){function a(a,b){return a.amb(b)}for(var b=dc(),c=k(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Ub["catch"]=Ub.catchException=function(a){return"function"==typeof a?s(this,a):gc([this,a])};var gc=$b.catchException=$b["catch"]=function(){var a=k(arguments,0);return Rb(a).catchException()};Ub.combineLatest=function(){var a=kb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),hc.apply(this,a)};var hc=$b.combineLatest=function(){var a=kb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new lc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(F))){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(F)&&c.onCompleted()}function e(a){j[a]=!0,j.every(F)&&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 zb;L(f)&&(f=_b(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 tb(m)})};Ub.concat=function(){var a=kb.call(arguments,0);return a.unshift(this),ic.apply(this,a)};var ic=$b.concat=function(){var a=k(arguments,0);return Rb(a).concat()};Ub.concatObservable=Ub.concatAll=function(){return this.merge(1)},Ub.merge=function(a){if("number"!=typeof a)return jc(this,a);var b=this;return new lc(function(c){var d=0,e=new tb,f=!1,g=[],h=function(a){var b=new zb;e.add(b),L(a)&&(a=_b(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 jc=$b.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=kb.call(arguments,1)):(a=Gb,b=kb.call(arguments,0)):(a=Gb,b=kb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),cc(b,a).mergeObservable()};Ub.mergeObservable=Ub.mergeAll=function(){var a=this;return new lc(function(b){var c=new tb,d=!1,e=new zb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new zb;c.add(e),L(a)&&(a=_b(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})},Ub.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return kc([this,a])};var kc=$b.onErrorResumeNext=function(){var a=k(arguments,0);return new lc(function(b){var c=0,d=new Ab,e=Gb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],L(f)&&(f=_b(f)),g=new zb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),function(){e()},function(){e()}))):b.onCompleted()});return new tb(d,e)})};Ub.skipUntil=function(a){var b=this;return new lc(function(c){var d=!1,e=new tb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));L(a)&&(a=_b(a));var f=new zb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Ub["switch"]=Ub.switchLatest=function(){var a=this;return new lc(function(b){var c=!1,d=new Ab,e=!1,f=0,g=a.subscribe(function(a){var g=new zb,h=++f;c=!0,d.setDisposable(g),L(a)&&(a=_b(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)
2
+ },function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new tb(g,d)})},Ub.takeUntil=function(a){var b=this;return new lc(function(c){return L(a)&&(a=_b(a)),new tb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),D))})},Ub.zip=function(){if(Array.isArray(arguments[0]))return t.apply(this,arguments);var a=this,b=kb.call(arguments),c=b.pop();return b.unshift(a),new lc(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(F)&&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 zb;L(c)&&(c=_b(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 tb(j)})},$b.zip=function(){var a=kb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},$b.zipArray=function(){var a=k(arguments,0);return new lc(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(F))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(F)?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 zb,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 tb(h);return j.add(wb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},Ub.asObservable=function(){var a=this;return new lc(function(b){return a.subscribe(b)})},Ub.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Ub.dematerialize=function(){var a=this;return new lc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Ub.distinctUntilChanged=function(a,b){var c=this;return a||(a=F),b||(b=H),new lc(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))})},Ub["do"]=Ub.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 lc(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()})})},Ub["finally"]=Ub.finallyAction=function(a){var b=this;return new lc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return wb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Ub.ignoreElements=function(){var a=this;return new lc(function(b){return a.subscribe(D,b.onError.bind(b),b.onCompleted.bind(b))})},Ub.materialize=function(){var a=this;return new lc(function(b){return a.subscribe(function(a){b.onNext(Lb(a))},function(a){b.onNext(Mb(a)),b.onCompleted()},function(){b.onNext(Nb()),b.onCompleted()})})},Ub.repeat=function(a){return Qb(this,a).concat()},Ub.retry=function(a){return Qb(this,a).catchException()},Ub.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 lc(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()})})},Ub.skipLast=function(a){var b=this;return new lc(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))})},Ub.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=Gb,a=kb.call(arguments,c),Rb([cc(a,b),this]).concat()},Ub.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return cc(a,b)})},Ub.takeLastBuffer=function(a){var b=this;return new lc(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()})})},Ub.windowWithCount=function(a,b){var c=this;if(0>=a)throw new Error(M);if(1===arguments.length&&(b=a),0>=b)throw new Error(M);return new lc(function(d){var e=new zb,f=new Bb(e),g=0,h=[],i=function(){var a=new pc;h.push(a),d.onNext(nb(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})},Ub.selectConcat=Ub.concatMap=function(a,b){return b?this.concatMap(function(c,d){var e=a(c,d),f=L(e)?_b(e):e;return f.map(function(a){return b(c,a,d)})}):"function"==typeof a?u.call(this,a):u.call(this,function(){return a})},Ub.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new lc(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()})})},Ub.distinct=function(a,b){var c=this;return a||(a=F),b||(b=J),new lc(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))})},Ub.groupBy=function(a,b,c){return this.groupByUntil(a,b,function(){return dc()},c)},Ub.groupByUntil=function(a,b,c,d){var e=this;return b||(b=F),d||(d=J),new lc(function(f){var g={},h=new tb,i=new Bb(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 pc,g[p]=r,m=!0)}catch(t){for(s in g)g[s].onError(t);return void f.onError(t)}if(m){n=new nc(o,r,i),k=new nc(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 zb,h.add(q);var u=function(){p in g&&(delete g[p],r.onCompleted()),h.remove(q)};q.setDisposable(j.take(1).subscribe(D,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})},Ub.select=Ub.map=function(a,b){var c=this;return new lc(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))})},Ub.pluck=function(a){return this.select(function(b){return b[a]})},Ub.selectMany=Ub.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=L(e)?_b(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?v.call(this,a):v.call(this,function(){return a})},Ub.selectSwitch=Ub.flatMapLatest=Ub.switchMap=function(a,b){return this.select(a,b).switchLatest()},Ub.skip=function(a){if(0>a)throw new Error(M);var b=this;return new lc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Ub.skipWhile=function(a,b){var c=this;return new lc(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))})},Ub.take=function(a,b){if(0>a)throw new Error(M);if(0===a)return ac(b);var c=this;return new lc(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))})},Ub.takeWhile=function(a,b){var c=this;return new lc(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))})},Ub.where=Ub.filter=function(a,b){var c=this;return new lc(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))})},Ub.exclusive=function(){var a=this;return new lc(function(b){var c=!1,d=!1,e=new zb,f=new tb;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,L(a)&&(a=_b(a));var e=new zb;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f})},Ub.exclusiveMap=function(a,b){var c=this;return new lc(function(d){var e=0,f=!1,g=!0,h=new zb,i=new tb;return i.add(h),h.setDisposable(c.subscribe(function(c){f||(f=!0,innerSubscription=new zb,i.add(innerSubscription),L(c)&&(c=_b(c)),innerSubscription.setDisposable(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),function(){i.remove(innerSubscription),f=!1,g&&1===i.length&&d.onCompleted()})))},d.onError.bind(d),function(){g=!0,1!==i.length||f||d.onCompleted()})),i})};var lc=C.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=xb:"function"==typeof a&&(a=wb(a)),a}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new mc(a);return Hb.scheduleRequired()?Hb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return lb(c,a),c}($b),mc=function(a){function b(b){a.call(this),this.observer=b,this.m=new zb}lb(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}(Vb),nc=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 lc(function(a){return new tb(e.getDisposable(),d.subscribe(a))}):d}return lb(c,a),c}($b),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=C.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),xb):(a.onCompleted(),xb):(this.observers.push(a),new oc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return lb(d,a),mb(d.prototype,Sb,{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 qc(a,b)},d}($b),qc=(C.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(),xb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return lb(d,a),mb(d.prototype,Sb,{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}($b),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 lb(c,a),mb(c.prototype,Sb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}($b));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(x.Rx=C,define(function(){return C})):y&&z?A?(z.exports=C).Rx=C:y.Rx=C:x.Rx=C}).call(this);
@@ -31,6 +31,8 @@
31
31
 
32
32
  // Defaults
33
33
  var noop = Rx.helpers.noop = function () { },
34
+ notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
35
+ isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; },
34
36
  identity = Rx.helpers.identity = function (x) { return x; },
35
37
  pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
36
38
  just = Rx.helpers.just = function (value) { return function () { return value; }; },
@@ -50,14 +52,13 @@
50
52
  function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } }
51
53
 
52
54
  // Shim in iterator support
53
- var $iterator$ = (typeof Symbol === 'object' && Symbol.iterator) ||
55
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
54
56
  '_es6shim_iterator_';
55
- // Firefox ships a partial implementation using the name @@iterator.
56
- // https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14
57
- // So use that name if we detect it.
57
+ // Bug for mozilla version
58
58
  if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
59
59
  $iterator$ = '@@iterator';
60
60
  }
61
+
61
62
  var doneEnumerator = { done: true, value: undefined };
62
63
 
63
64
  /** `Object#toString` result shortcuts */
@@ -1512,140 +1513,111 @@
1512
1513
  return CatchScheduler;
1513
1514
  }(Scheduler));
1514
1515
 
1515
- /**
1516
- * Represents a notification to an observer.
1517
- */
1518
- var Notification = Rx.Notification = (function () {
1519
- function Notification(kind, hasValue) {
1520
- this.hasValue = hasValue == null ? false : hasValue;
1521
- this.kind = kind;
1522
- }
1523
-
1524
- var NotificationPrototype = Notification.prototype;
1525
-
1526
- /**
1527
- * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
1528
- *
1529
- * @memberOf Notification
1530
- * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
1531
- * @param {Function} onError Delegate to invoke for an OnError notification.
1532
- * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
1533
- * @returns {Any} Result produced by the observation.
1534
- */
1535
- NotificationPrototype.accept = function (observerOrOnNext, onError, onCompleted) {
1536
- if (arguments.length === 1 && typeof observerOrOnNext === 'object') {
1537
- return this._acceptObservable(observerOrOnNext);
1538
- }
1539
- return this._accept(observerOrOnNext, onError, onCompleted);
1540
- };
1541
-
1542
- /**
1543
- * Returns an observable sequence with a single notification.
1544
- *
1545
- * @memberOf Notification
1546
- * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
1547
- * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
1548
- */
1549
- NotificationPrototype.toObservable = function (scheduler) {
1550
- var notification = this;
1551
- scheduler || (scheduler = immediateScheduler);
1552
- return new AnonymousObservable(function (observer) {
1553
- return scheduler.schedule(function () {
1554
- notification._acceptObservable(observer);
1555
- if (notification.kind === 'N') {
1556
- observer.onCompleted();
1557
- }
1558
- });
1559
- });
1560
- };
1561
-
1562
- return Notification;
1563
- })();
1564
-
1565
- /**
1566
- * Creates an object that represents an OnNext notification to an observer.
1567
- * @param {Any} value The value contained in the notification.
1568
- * @returns {Notification} The OnNext notification containing the value.
1569
- */
1570
- var notificationCreateOnNext = Notification.createOnNext = (function () {
1571
-
1572
- function _accept (onNext) {
1573
- return onNext(this.value);
1574
- }
1575
-
1576
- function _acceptObservable(observer) {
1577
- return observer.onNext(this.value);
1578
- }
1579
-
1580
- function toString () {
1581
- return 'OnNext(' + this.value + ')';
1582
- }
1583
-
1584
- return function (value) {
1585
- var notification = new Notification('N', true);
1586
- notification.value = value;
1587
- notification._accept = _accept;
1588
- notification._acceptObservable = _acceptObservable;
1589
- notification.toString = toString;
1590
- return notification;
1591
- };
1592
- }());
1516
+ /**
1517
+ * Represents a notification to an observer.
1518
+ */
1519
+ var Notification = Rx.Notification = (function () {
1520
+ function Notification(kind, hasValue) {
1521
+ this.hasValue = hasValue == null ? false : hasValue;
1522
+ this.kind = kind;
1523
+ }
1593
1524
 
1594
1525
  /**
1595
- * Creates an object that represents an OnError notification to an observer.
1596
- * @param {Any} error The exception contained in the notification.
1597
- * @returns {Notification} The OnError notification containing the exception.
1526
+ * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
1527
+ *
1528
+ * @memberOf Notification
1529
+ * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
1530
+ * @param {Function} onError Delegate to invoke for an OnError notification.
1531
+ * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
1532
+ * @returns {Any} Result produced by the observation.
1598
1533
  */
1599
- var notificationCreateOnError = Notification.createOnError = (function () {
1600
-
1601
- function _accept (onNext, onError) {
1602
- return onError(this.exception);
1603
- }
1604
-
1605
- function _acceptObservable(observer) {
1606
- return observer.onError(this.exception);
1607
- }
1608
-
1609
- function toString () {
1610
- return 'OnError(' + this.exception + ')';
1611
- }
1612
-
1613
- return function (exception) {
1614
- var notification = new Notification('E');
1615
- notification.exception = exception;
1616
- notification._accept = _accept;
1617
- notification._acceptObservable = _acceptObservable;
1618
- notification.toString = toString;
1619
- return notification;
1620
- };
1621
- }());
1534
+ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
1535
+ return observerOrOnNext && typeof observerOrOnNext === 'object' ?
1536
+ this._acceptObservable(observerOrOnNext) :
1537
+ this._accept(observerOrOnNext, onError, onCompleted);
1538
+ };
1622
1539
 
1623
1540
  /**
1624
- * Creates an object that represents an OnCompleted notification to an observer.
1625
- * @returns {Notification} The OnCompleted notification.
1541
+ * Returns an observable sequence with a single notification.
1542
+ *
1543
+ * @memberOf Notifications
1544
+ * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
1545
+ * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
1626
1546
  */
1627
- var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
1547
+ Notification.prototype.toObservable = function (scheduler) {
1548
+ var notification = this;
1549
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
1550
+ return new AnonymousObservable(function (observer) {
1551
+ return scheduler.schedule(function () {
1552
+ notification._acceptObservable(observer);
1553
+ notification.kind === 'N' && observer.onCompleted();
1554
+ });
1555
+ });
1556
+ };
1628
1557
 
1629
- function _accept (onNext, onError, onCompleted) {
1630
- return onCompleted();
1631
- }
1558
+ return Notification;
1559
+ })();
1632
1560
 
1633
- function _acceptObservable(observer) {
1634
- return observer.onCompleted();
1635
- }
1561
+ /**
1562
+ * Creates an object that represents an OnNext notification to an observer.
1563
+ * @param {Any} value The value contained in the notification.
1564
+ * @returns {Notification} The OnNext notification containing the value.
1565
+ */
1566
+ var notificationCreateOnNext = Notification.createOnNext = (function () {
1567
+
1568
+ function _accept (onNext) { return onNext(this.value); }
1569
+ function _acceptObservable(observer) { return observer.onNext(this.value); }
1570
+ function toString () { return 'OnNext(' + this.value + ')'; }
1571
+
1572
+ return function (value) {
1573
+ var notification = new Notification('N', true);
1574
+ notification.value = value;
1575
+ notification._accept = _accept;
1576
+ notification._acceptObservable = _acceptObservable;
1577
+ notification.toString = toString;
1578
+ return notification;
1579
+ };
1580
+ }());
1636
1581
 
1637
- function toString () {
1638
- return 'OnCompleted()';
1639
- }
1582
+ /**
1583
+ * Creates an object that represents an OnError notification to an observer.
1584
+ * @param {Any} error The exception contained in the notification.
1585
+ * @returns {Notification} The OnError notification containing the exception.
1586
+ */
1587
+ var notificationCreateOnError = Notification.createOnError = (function () {
1588
+
1589
+ function _accept (onNext, onError) { return onError(this.exception); }
1590
+ function _acceptObservable(observer) { return observer.onError(this.exception); }
1591
+ function toString () { return 'OnError(' + this.exception + ')'; }
1592
+
1593
+ return function (exception) {
1594
+ var notification = new Notification('E');
1595
+ notification.exception = exception;
1596
+ notification._accept = _accept;
1597
+ notification._acceptObservable = _acceptObservable;
1598
+ notification.toString = toString;
1599
+ return notification;
1600
+ };
1601
+ }());
1640
1602
 
1641
- return function () {
1642
- var notification = new Notification('C');
1643
- notification._accept = _accept;
1644
- notification._acceptObservable = _acceptObservable;
1645
- notification.toString = toString;
1646
- return notification;
1647
- };
1648
- }());
1603
+ /**
1604
+ * Creates an object that represents an OnCompleted notification to an observer.
1605
+ * @returns {Notification} The OnCompleted notification.
1606
+ */
1607
+ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
1608
+
1609
+ function _accept (onNext, onError, onCompleted) { return onCompleted(); }
1610
+ function _acceptObservable(observer) { return observer.onCompleted(); }
1611
+ function toString () { return 'OnCompleted()'; }
1612
+
1613
+ return function () {
1614
+ var notification = new Notification('C');
1615
+ notification._accept = _accept;
1616
+ notification._acceptObservable = _acceptObservable;
1617
+ notification.toString = toString;
1618
+ return notification;
1619
+ };
1620
+ }());
1649
1621
 
1650
1622
  var Enumerator = Rx.internals.Enumerator = function (next) {
1651
1623
  this._next = next;
@@ -2198,25 +2170,21 @@
2198
2170
  }
2199
2171
 
2200
2172
  function s(observer) {
2201
- var autoDetachObserver = new AutoDetachObserver(observer);
2202
- if (currentThreadScheduler.scheduleRequired()) {
2203
- currentThreadScheduler.schedule(function () {
2204
- try {
2205
- autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver)));
2206
- } catch (e) {
2207
- if (!autoDetachObserver.fail(e)) {
2208
- throw e;
2209
- }
2210
- }
2211
- });
2212
- } else {
2173
+ var setDisposable = function () {
2213
2174
  try {
2214
2175
  autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver)));
2215
2176
  } catch (e) {
2216
2177
  if (!autoDetachObserver.fail(e)) {
2217
2178
  throw e;
2218
- }
2179
+ }
2219
2180
  }
2181
+ };
2182
+
2183
+ var autoDetachObserver = new AutoDetachObserver(observer);
2184
+ if (currentThreadScheduler.scheduleRequired()) {
2185
+ currentThreadScheduler.schedule(setDisposable);
2186
+ } else {
2187
+ setDisposable();
2220
2188
  }
2221
2189
 
2222
2190
  return autoDetachObserver;