rxjs-rails 2.2.14 → 2.2.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -4506,6 +4506,259 @@
4506
4506
  return new CompositeDisposable(subscription, connection, pausable);
4507
4507
  });
4508
4508
  };
4509
+ function combineLatestSource(source, subject, resultSelector) {
4510
+ return new AnonymousObservable(function (observer) {
4511
+ var n = 2,
4512
+ hasValue = [false, false],
4513
+ hasValueAll = false,
4514
+ isDone = false,
4515
+ values = new Array(n);
4516
+
4517
+ function next(x, i) {
4518
+ values[i] = x
4519
+ var res;
4520
+ hasValue[i] = true;
4521
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
4522
+ try {
4523
+ res = resultSelector.apply(null, values);
4524
+ } catch (ex) {
4525
+ observer.onError(ex);
4526
+ return;
4527
+ }
4528
+ observer.onNext(res);
4529
+ } else if (isDone) {
4530
+ observer.onCompleted();
4531
+ }
4532
+ }
4533
+
4534
+ return new CompositeDisposable(
4535
+ source.subscribe(
4536
+ function (x) {
4537
+ next(x, 0);
4538
+ },
4539
+ observer.onError.bind(observer),
4540
+ function () {
4541
+ isDone = true;
4542
+ observer.onCompleted();
4543
+ }),
4544
+ subject.subscribe(
4545
+ function (x) {
4546
+ next(x, 1);
4547
+ },
4548
+ observer.onError.bind(observer))
4549
+ );
4550
+ });
4551
+ }
4552
+
4553
+ /**
4554
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
4555
+ * and yields the values that were buffered while paused.
4556
+ * @example
4557
+ * var pauser = new Rx.Subject();
4558
+ * var source = Rx.Observable.interval(100).pausableBuffered(pauser);
4559
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
4560
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
4561
+ */
4562
+ observableProto.pausableBuffered = function (subject) {
4563
+ var source = this;
4564
+ return new AnonymousObservable(function (observer) {
4565
+ var q = [], previous = true;
4566
+
4567
+ var subscription =
4568
+ combineLatestSource(
4569
+ source,
4570
+ subject.distinctUntilChanged(),
4571
+ function (data, shouldFire) {
4572
+ return { data: data, shouldFire: shouldFire };
4573
+ })
4574
+ .subscribe(
4575
+ function (results) {
4576
+ if (results.shouldFire && previous) {
4577
+ observer.onNext(results.data);
4578
+ }
4579
+ if (results.shouldFire && !previous) {
4580
+ while (q.length > 0) {
4581
+ observer.onNext(q.shift());
4582
+ }
4583
+ previous = true;
4584
+ } else if (!results.shouldFire && !previous) {
4585
+ q.push(results.data);
4586
+ } else if (!results.shouldFire && previous) {
4587
+ previous = false;
4588
+ }
4589
+
4590
+ },
4591
+ observer.onError.bind(observer),
4592
+ observer.onCompleted.bind(observer)
4593
+ );
4594
+
4595
+ subject.onNext(false);
4596
+
4597
+ return subscription;
4598
+ });
4599
+ };
4600
+
4601
+ /**
4602
+ * Attaches a controller to the observable sequence with the ability to queue.
4603
+ * @example
4604
+ * var source = Rx.Observable.interval(100).controlled();
4605
+ * source.request(3); // Reads 3 values
4606
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
4607
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
4608
+ */
4609
+ observableProto.controlled = function (enableQueue) {
4610
+ if (enableQueue == null) { enableQueue = true; }
4611
+ return new ControlledObservable(this, enableQueue);
4612
+ };
4613
+ var ControlledObservable = (function (_super) {
4614
+
4615
+ inherits(ControlledObservable, _super);
4616
+
4617
+ function subscribe (observer) {
4618
+ return this.source.subscribe(observer);
4619
+ }
4620
+
4621
+ function ControlledObservable (source, enableQueue) {
4622
+ _super.call(this, subscribe);
4623
+ this.subject = new ControlledSubject(enableQueue);
4624
+ this.source = source.multicast(this.subject).refCount();
4625
+ }
4626
+
4627
+ ControlledObservable.prototype.request = function (numberOfItems) {
4628
+ if (numberOfItems == null) { numberOfItems = -1; }
4629
+ return this.subject.request(numberOfItems);
4630
+ };
4631
+
4632
+ return ControlledObservable;
4633
+
4634
+ }(Observable));
4635
+
4636
+ var ControlledSubject = Rx.ControlledSubject = (function (_super) {
4637
+
4638
+ function subscribe (observer) {
4639
+ return this.subject.subscribe(observer);
4640
+ }
4641
+
4642
+ inherits(ControlledSubject, _super);
4643
+
4644
+ function ControlledSubject(enableQueue) {
4645
+ if (enableQueue == null) {
4646
+ enableQueue = true;
4647
+ }
4648
+
4649
+ _super.call(this, subscribe);
4650
+ this.subject = new Subject();
4651
+ this.enableQueue = enableQueue;
4652
+ this.queue = enableQueue ? [] : null;
4653
+ this.requestedCount = 0;
4654
+ this.requestedDisposable = disposableEmpty;
4655
+ this.error = null;
4656
+ this.hasFailed = false;
4657
+ this.hasCompleted = false;
4658
+ this.controlledDisposable = disposableEmpty;
4659
+ }
4660
+
4661
+ addProperties(ControlledSubject.prototype, Observer, {
4662
+ onCompleted: function () {
4663
+ checkDisposed.call(this);
4664
+ this.hasCompleted = true;
4665
+
4666
+ if (!this.enableQueue || this.queue.length === 0) {
4667
+ this.subject.onCompleted();
4668
+ }
4669
+ },
4670
+ onError: function (error) {
4671
+ checkDisposed.call(this);
4672
+ this.hasFailed = true;
4673
+ this.error = error;
4674
+
4675
+ if (!this.enableQueue || this.queue.length === 0) {
4676
+ this.subject.onError(error);
4677
+ }
4678
+ },
4679
+ onNext: function (value) {
4680
+ checkDisposed.call(this);
4681
+ var hasRequested = false;
4682
+
4683
+ if (this.requestedCount === 0) {
4684
+ if (this.enableQueue) {
4685
+ this.queue.push(value);
4686
+ }
4687
+ } else {
4688
+ if (this.requestedCount !== -1) {
4689
+ if (this.requestedCount-- === 0) {
4690
+ this.disposeCurrentRequest();
4691
+ }
4692
+ }
4693
+ hasRequested = true;
4694
+ }
4695
+
4696
+ if (hasRequested) {
4697
+ this.subject.onNext(value);
4698
+ }
4699
+ },
4700
+ _processRequest: function (numberOfItems) {
4701
+ if (this.enableQueue) {
4702
+ //console.log('queue length', this.queue.length);
4703
+
4704
+ while (this.queue.length >= numberOfItems && numberOfItems > 0) {
4705
+ //console.log('number of items', numberOfItems);
4706
+ this.subject.onNext(this.queue.shift());
4707
+ numberOfItems--;
4708
+ }
4709
+
4710
+ if (this.queue.length !== 0) {
4711
+ return { numberOfItems: numberOfItems, returnValue: true };
4712
+ } else {
4713
+ return { numberOfItems: numberOfItems, returnValue: false };
4714
+ }
4715
+ }
4716
+
4717
+ if (this.hasFailed) {
4718
+ this.subject.onError(this.error);
4719
+ this.controlledDisposable.dispose();
4720
+ this.controlledDisposable = disposableEmpty;
4721
+ } else if (this.hasCompleted) {
4722
+ this.subject.onCompleted();
4723
+ this.controlledDisposable.dispose();
4724
+ this.controlledDisposable = disposableEmpty;
4725
+ }
4726
+
4727
+ return { numberOfItems: numberOfItems, returnValue: false };
4728
+ },
4729
+ request: function (number) {
4730
+ checkDisposed.call(this);
4731
+ this.disposeCurrentRequest();
4732
+ var self = this,
4733
+ r = this._processRequest(number);
4734
+
4735
+ number = r.numberOfItems;
4736
+ if (!r.returnValue) {
4737
+ this.requestedCount = number;
4738
+ this.requestedDisposable = disposableCreate(function () {
4739
+ self.requestedCount = 0;
4740
+ });
4741
+
4742
+ return this.requestedDisposable
4743
+ } else {
4744
+ return disposableEmpty;
4745
+ }
4746
+ },
4747
+ disposeCurrentRequest: function () {
4748
+ this.requestedDisposable.dispose();
4749
+ this.requestedDisposable = disposableEmpty;
4750
+ },
4751
+
4752
+ dispose: function () {
4753
+ this.isDisposed = true;
4754
+ this.error = null;
4755
+ this.subject.dispose();
4756
+ this.requestedDisposable.dispose();
4757
+ }
4758
+ });
4759
+
4760
+ return ControlledSubject;
4761
+ }(Observable));
4509
4762
  var AnonymousObservable = Rx.AnonymousObservable = (function (_super) {
4510
4763
  inherits(AnonymousObservable, _super);
4511
4764
 
@@ -1,2 +1,2 @@
1
- (function(a){function b(){}function c(a){return a}function d(a,b){return eb(a,b)}function e(a,b){return a-b}function f(a){throw a}function g(a){return"function"==typeof a.then}function h(){if(this.isDisposed)throw new Error(L)}function i(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;db.nonEnumArgs&&a.length&&n(a)&&(a=fb.call(a));var c=db.enumPrototypes&&"function"==typeof a,d=db.enumErrorProps&&(a===Z||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(db.nonEnumShadows&&a!==$){var f=a.constructor,g=-1,h=bb.length;if(a===(f&&f.prototype))var j=a===stringProto?V:a===Z?Q:W.call(a),k=cb[j];for(;++g<h;)e=bb[g],k&&k[e]||!X.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(a){return a&&"object"==typeof a?W.call(a)==M:!1}function o(a){return"function"==typeof a}function p(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=W.call(a),h=W.call(b);if(g==M&&(g=T),h==M&&(h=T),g!=h)return!1;switch(g){case O:case P:return+a==+b;case S:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case U:case V:return a==String(b)}var i=g==N;if(!i){if(g!=T||!db.nodeClass&&(m(a)||m(b)))return!1;var j=!db.argsObject&&n(a)?Object:a.constructor,k=!db.argsObject&&n(b)?Object:b.constructor;if(!(j==k||X.call(a,"constructor")&&X.call(b,"constructor")||o(j)&&j instanceof j&&o(k)&&k instanceof k||!("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),i){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=p(a[r],s,c,d)))break}}else l(b,function(b,e,f){return X.call(f,e)?(r++,result=X.call(a,e)&&p(a[e],b,c,d)):void 0}),result&&l(a,function(a,b,c){return X.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function q(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:fb.call(a)}function r(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function s(a,b){return new dc(function(c){var d=new rb,e=new sb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return c.onError(g),void 0}d=new rb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function t(a,b){var c=this;return new dc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i),void 0}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function u(a){return this.select(function(b,c){var d=a(b,c);return g(d)?_b(d):d}).mergeObservable()}function v(a,b,c){return a.addListener?(a.addListener(b,c),ob(function(){a.removeListener(b,c)})):a.addEventListener?(a.addEventListener(b,c,!1),ob(function(){a.removeEventListener(b,c,!1)})):void 0}function w(a,b,c){var d=new lb;if(a&&a.length)for(var e=0,f=a.length;f>e;e++)d.add(w(a[e],b,c));else a&&d.add(v(a,b,c));return d}function x(a,b){var c=wb(a);return new dc(function(a){return b.scheduleWithRelative(c,function(){a.onNext(0),a.onCompleted()})})}function y(a,b,c){return a===b?new dc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Rb(function(){return observableTimerDateAndPeriod(c.now()+a,b,c)})}function z(a,b){return new dc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new lb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}var A={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},B=A[typeof window]&&window||this,C=A[typeof exports]&&exports&&!exports.nodeType&&exports,D=A[typeof module]&&module&&!module.nodeType&&module,E=D&&D.exports===C&&C,F=A[typeof global]&&global;!F||F.global!==F&&F.window!==F||(B=F);var G,H={internals:{},config:{}},I=Date.now,J="Sequence contains no elements.",K="Argument out of range",L="Object has been disposed",M="[object Arguments]",N="[object Array]",O="[object Boolean]",P="[object Date]",Q="[object Error]",R="[object Function]",S="[object Number]",T="[object Object]",U="[object RegExp]",V="[object String]",W=Object.prototype.toString,X=Object.prototype.hasOwnProperty,Y=W.call(arguments)==M,Z=Error.prototype,$=Object.prototype,_=$.propertyIsEnumerable;try{G=!(W.call(document)==T&&!({toString:0}+""))}catch(ab){G=!0}var bb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],cb={};cb[N]=cb[P]=cb[S]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},cb[O]=cb[V]={constructor:!0,toString:!0,valueOf:!0},cb[Q]=cb[R]=cb[U]={constructor:!0,toString:!0},cb[T]={constructor:!0};var db={};!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);db.enumErrorProps=_.call(Z,"message")||_.call(Z,"name"),db.enumPrototypes=_.call(a,"prototype"),db.nonEnumArgs=0!=c,db.nonEnumShadows=!/valueOf/.test(b)}(1),Y||(n=function(a){return a&&"object"==typeof a?X.call(a,"callee"):!1}),o(/x/)&&(o=function(a){return"function"==typeof a&&W.call(a)==R});var eb=H.internals.isEqual=function(a,b){return p(a,b,[],[])},fb=Array.prototype.slice,gb=({}.hasOwnProperty,this.inherits=H.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),hb=H.internals.addProperties=function(a){for(var b=fb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},ib=(H.internals.addRef=function(a,b){return new dc(function(c){return new lb(b.getDisposable(),a.subscribe(c))})},function(a,b){this.id=a,this.value=b});ib.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var jb=H.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},kb=jb.prototype;kb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},kb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},kb.heapify=function(b){if(b===a&&(b=0),!(b>=this.length||0>b)){var c=2*b+1,d=2*b+2,e=b;if(c<this.length&&this.isHigherPriority(c,e)&&(e=c),d<this.length&&this.isHigherPriority(d,e)&&(e=d),e!==b){var f=this.items[b];this.items[b]=this.items[e],this.items[e]=f,this.heapify(e)}}},kb.peek=function(){return this.items[0].value},kb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},kb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},kb.enqueue=function(a){var b=this.length++;this.items[b]=new ib(jb.count++,a),this.percolate(b)},kb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},jb.count=0;var lb=H.CompositeDisposable=function(){this.disposables=q(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},mb=lb.prototype;mb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},mb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},mb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},mb.clear=function(){var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()},mb.contains=function(a){return-1!==this.disposables.indexOf(a)},mb.toArray=function(){return this.disposables.slice(0)};var nb=H.Disposable=function(a){this.isDisposed=!1,this.action=a||b};nb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ob=nb.create=function(a){return new nb(a)},pb=nb.empty={dispose:b},qb=function(){function a(a){this.isSingle=a,this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){if(this.current&&this.isSingle)throw new Error("Disposable has already been assigned");var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),rb=H.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return gb(b,a),b}(qb),sb=H.SerialDisposable=function(a){function b(){a.call(this,!1)}return gb(b,a),b}(qb),tb=(H.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?pb:new a(this)},b}(),H.internals.ScheduledItem=function(a,b,c,d,f){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=f||e,this.disposable=new rb});tb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},tb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},tb.prototype.isCancelled=function(){return this.disposable.isDisposed},tb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var ub,vb=H.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){var c=b.first,d=b.second,e=new lb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),pb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new lb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),pb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),pb}var e=a.prototype;return e.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},e.schedulePeriodicWithState=function(a,b,c){var d=a,e=setInterval(function(){d=c(d)},b);return ob(function(){clearInterval(e)})},e.schedule=function(a){return this._schedule(a,d)},e.scheduleWithState=function(a,b){return this._schedule(a,b)},e.scheduleWithRelative=function(a,b){return this._scheduleRelative(b,a,d)},e.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},e.scheduleWithAbsolute=function(a,b){return this._scheduleAbsolute(b,a,d)},e.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},e.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},e.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},function(a,c){return b(a,c)})},e.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},e.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,function(a,b){a(function(c){b(a,c)})})},e.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})},a.now=I,a.normalize=function(a){return 0>a&&(a=0),a},a}(),wb=vb.normalize,xb=vb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=wb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new vb(I,a,b,c)}(),yb=vb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-vb.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()+vb.normalize(c),g=new tb(this,b,d,f);if(e)e.enqueue(g);else{e=new jb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new vb(I,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),zb=(H.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new rb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),b);!function(){function a(){if(!B.postMessage||B.importScripts)return!1;var a=!1,b=B.onmessage;return B.onmessage=function(){a=!0},B.postMessage("","*"),B.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(W).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=F&&E&&F.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=F&&E&&F.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))ub=process.nextTick;else if("function"==typeof d)ub=d,zb=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;B.addEventListener?B.addEventListener("message",b,!1):B.attachEvent("onmessage",b,!1),ub=function(a){var b=h++;g[b]=a,B.postMessage(f+b,"*")}}else if(B.MessageChannel){var i=new B.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},ub=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in B&&"onreadystatechange"in B.document.createElement("script")?ub=function(a){var b=B.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},B.document.documentElement.appendChild(b)}:(ub=function(a){return setTimeout(a,0)},zb=clearTimeout)}();var Ab=vb.timeout=function(){function a(a,b){var c=this,d=new rb,e=ub(function(){d.isDisposed||d.setDisposable(b(c,a))});return new lb(d,ob(function(){zb(e)}))}function b(a,b,c){var d=this,e=vb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new rb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new lb(f,ob(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new vb(I,a,b,c)}(),Bb=H.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}var b=a.prototype;return b.accept=function(a,b,c){return 1===arguments.length&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},b.toObservable=function(a){var b=this;return a||(a=xb),new dc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Cb=Bb.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 Bb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Db=Bb.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 Bb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Eb=Bb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Bb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Fb=H.internals.Enumerator=function(a,b){this.moveNext=a,this.getCurrent=b},Gb=Fb.create=function(a,b){var c=!1;return new Fb(function(){if(c)return!1;var b=a();return b||(c=!0),b},function(){return b()})},Hb=H.internals.Enumerable=function(a){this.getEnumerator=a};Hb.prototype.concat=function(){var a=this;return new dc(function(b){var c,d=a.getEnumerator(),e=new sb,f=xb.scheduleRecursive(function(a){var f,g;if(!c){try{g=d.moveNext(),g&&(f=d.getCurrent())}catch(h){return b.onError(h),void 0}if(!g)return b.onCompleted(),void 0;var i=new rb;e.setDisposable(i),i.setDisposable(f.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new lb(e,f,ob(function(){c=!0}))})},Hb.prototype.catchException=function(){var a=this;return new dc(function(b){var c,d,e=a.getEnumerator(),f=new sb,g=xb.scheduleRecursive(function(a){var g,h;if(!c){try{h=e.moveNext(),h&&(g=e.getCurrent())}catch(i){return b.onError(i),void 0}if(!h)return d?b.onError(d):b.onCompleted(),void 0;var j=new rb;f.setDisposable(j),j.setDisposable(g.subscribe(b.onNext.bind(b),function(b){d=b,a()},b.onCompleted.bind(b)))}});return new lb(f,g,ob(function(){c=!0}))})};var Ib=Hb.repeat=function(a,b){return 1===arguments.length&&(b=-1),new Hb(function(){var c,d=b;return Gb(function(){return 0===d?!1:(d>0&&d--,c=a,!0)},function(){return c})})},Jb=Hb.forEach=function(a,b,d){return b||(b=c),new Hb(function(){var c,e=-1;return Gb(function(){return++e<a.length?(c=b.call(d,a[e],e,a),!0):!1},function(){return c})})},Kb=H.Observer=function(){};Kb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Kb.prototype.asObserver=function(){return new Ob(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var Lb=Kb.create=function(a,c,d){return a||(a=b),c||(c=f),d||(d=b),new Ob(a,c,d)};Kb.fromNotifier=function(a){return new Ob(function(b){return a(Cb(b))},function(b){return a(Db(b))},function(){return a(Eb())})};var Mb,Nb=H.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return gb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Kb),Ob=H.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return gb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Nb),Pb=H.Observable=function(){function a(a){this._subscribe=a}return Mb=a.prototype,Mb.finalValue=function(){var a=this;return new dc(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(J))})})},Mb.subscribe=Mb.forEach=function(a,b,c){var d;return d="object"==typeof a?a:Lb(a,b,c),this._subscribe(d)},Mb.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}(),Qb=H.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new sb}return gb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return b.isAcquired=!1,void 0;c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Nb);Pb.create=Pb.createWithDisposable=function(a){return new dc(a)};var Rb=Pb.defer=function(a){return new dc(function(b){var c;try{c=a()}catch(d){return Wb(d).subscribe(b)}return c.subscribe(b)})},Sb=Pb.empty=function(a){return a||(a=xb),new dc(function(b){return a.schedule(function(){b.onCompleted()})})},Tb=Pb.fromArray=function(a,b){return b||(b=yb),new dc(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Mb.fromGenerator=function(a,b){return b||(b=yb),new dc(function(c){var d;try{d=a()}catch(e){return c.onError(e),void 0}return b.scheduleRecursive(function(a){var b=d.next();b.done?c.onCompleted():(c.onNext(b.value),a())})})},Pb.generate=function(a,b,c,d,e){return e||(e=yb),new dc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return f.onError(j),void 0}e?(f.onNext(i),a()):f.onCompleted()})})};var Ub=Pb.never=function(){return new dc(function(){return pb})};Pb.range=function(a,b,c){return c||(c=yb),new dc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Pb.repeat=function(a,b,c){return c||(c=yb),null==b&&(b=-1),Vb(a,c).repeat(b)};var Vb=Pb["return"]=Pb.returnValue=function(a,b){return b||(b=xb),new dc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Wb=Pb["throw"]=Pb.throwException=function(a,b){return b||(b=xb),new dc(function(c){return b.schedule(function(){c.onError(a)})})};Mb["catch"]=Mb.catchException=function(a){return"function"==typeof a?s(this,a):Xb([this,a])};var Xb=Pb.catchException=Pb["catch"]=function(){var a=q(arguments,0);return Jb(a).catchException()};Mb.combineLatest=function(){var a=fb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Yb.apply(this,a)};var Yb=Pb.combineLatest=function(){var a=fb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new dc(function(d){function e(a){var e;if(i[a]=!0,j||(j=i.every(c))){try{e=b.apply(null,l)}catch(f){return d.onError(f),void 0}d.onNext(e)}else k.filter(function(b,c){return c!==a}).every(c)&&d.onCompleted()}function f(a){k[a]=!0,k.every(c)&&d.onCompleted()}for(var g=function(){return!1},h=a.length,i=r(h,g),j=!1,k=r(h,g),l=new Array(h),m=new Array(h),n=0;h>n;n++)!function(b){m[b]=new rb,m[b].setDisposable(a[b].subscribe(function(a){l[b]=a,e(b)},d.onError.bind(d),function(){f(b)}))}(n);return new lb(m)})};Mb.concat=function(){var a=fb.call(arguments,0);return a.unshift(this),Zb.apply(this,a)};var Zb=Pb.concat=function(){var a=q(arguments,0);return Jb(a).concat()};Mb.concatObservable=Mb.concatAll=function(){return this.merge(1)},Mb.merge=function(a){if("number"!=typeof a)return $b(this,a);var b=this;return new dc(function(c){var d=0,e=new lb,f=!1,h=[],i=function(a){var b=new rb;e.add(b),g(a)&&(a=_b(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){var a;e.remove(b),h.length>0?(a=h.shift(),i(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,i(b)):h.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var $b=Pb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=fb.call(arguments,1)):(a=xb,b=fb.call(arguments,0)):(a=xb,b=fb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Tb(b,a).mergeObservable()};Mb.mergeObservable=Mb.mergeAll=function(){var a=this;return new dc(function(b){var c=new lb,d=!1,e=new rb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new rb;c.add(e),g(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})},Mb.skipUntil=function(a){var b=this;return new dc(function(c){var d=!1,e=new lb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new rb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Mb["switch"]=Mb.switchLatest=function(){var a=this;return new dc(function(b){var c=!1,d=new sb,e=!1,f=0,h=a.subscribe(function(a){var h=new rb,i=++f;c=!0,d.setDisposable(h),g(a)&&(a=_b(a)),h.setDisposable(a.subscribe(function(a){f===i&&b.onNext(a)},function(a){f===i&&b.onError(a)},function(){f===i&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new lb(h,d)})},Mb.takeUntil=function(a){var c=this;return new dc(function(d){return new lb(c.subscribe(d),a.subscribe(d.onCompleted.bind(d),d.onError.bind(d),b))})},Mb.zip=function(){if(Array.isArray(arguments[0]))return t.apply(this,arguments);var a=this,b=fb.call(arguments),d=b.pop();return b.unshift(a),new dc(function(e){function f(a){i[a]=!0,i.every(function(a){return a})&&e.onCompleted()}for(var g=b.length,h=r(g,function(){return[]}),i=r(g,function(){return!1}),j=function(b){var f,g;if(h.every(function(a){return a.length>0})){try{g=h.map(function(a){return a.shift()}),f=d.apply(a,g)}catch(j){return e.onError(j),void 0}e.onNext(f)}else i.filter(function(a,c){return c!==b}).every(c)&&e.onCompleted()},k=new Array(g),l=0;g>l;l++)!function(a){k[a]=new rb,k[a].setDisposable(b[a].subscribe(function(b){h[a].push(b),j(a)},e.onError.bind(e),function(){f(a)}))}(l);return new lb(k)})},Pb.zip=function(){var a=fb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Pb.zipArray=function(){var a=q(arguments,0);return new dc(function(b){function d(a){if(g.every(function(a){return a.length>0})){var d=g.map(function(a){return a.shift()});b.onNext(d)}else if(h.filter(function(b,c){return c!==a}).every(c))return b.onCompleted(),void 0}function e(a){return h[a]=!0,h.every(c)?(b.onCompleted(),void 0):void 0}for(var f=a.length,g=r(f,function(){return[]}),h=r(f,function(){return!1}),i=new Array(f),j=0;f>j;j++)!function(c){i[c]=new rb,i[c].setDisposable(a[c].subscribe(function(a){g[c].push(a),d(c)},b.onError.bind(b),function(){e(c)}))}(j);var k=new lb(i);return k.add(ob(function(){for(var a=0,b=g.length;b>a;a++)g[a]=[]})),k})},Mb.asObservable=function(){var a=this;return new dc(function(b){return a.subscribe(b)})},Mb.dematerialize=function(){var a=this;return new dc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Mb.distinctUntilChanged=function(a,b){var e=this;return a||(a=c),b||(b=d),new dc(function(c){var d,f=!1;return e.subscribe(function(e){var g,h=!1;try{g=a(e)}catch(i){return c.onError(i),void 0}if(f)try{h=b(d,g)}catch(i){return c.onError(i),void 0}f&&h||(f=!0,d=g,c.onNext(e))},c.onError.bind(c),c.onCompleted.bind(c))})},Mb["do"]=Mb.doAction=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new dc(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()})})},Mb["finally"]=Mb.finallyAction=function(a){var b=this;return new dc(function(c){var d=b.subscribe(c);return ob(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Mb.ignoreElements=function(){var a=this;return new dc(function(c){return a.subscribe(b,c.onError.bind(c),c.onCompleted.bind(c))})},Mb.materialize=function(){var a=this;return new dc(function(b){return a.subscribe(function(a){b.onNext(Cb(a))},function(a){b.onNext(Db(a)),b.onCompleted()},function(){b.onNext(Eb()),b.onCompleted()})})},Mb.repeat=function(a){return Ib(this,a).concat()},Mb.retry=function(a){return Ib(this,a).catchException()},Mb.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new dc(function(e){var f,g,h;return d.subscribe(function(d){try{h||(h=!0),f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return e.onError(i),void 0}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},Mb.skipLast=function(a){var b=this;return new dc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},Mb.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=xb,a=fb.call(arguments,c),Jb([Tb(a,b),this]).concat()},Mb.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Tb(a,b)})},Mb.takeLastBuffer=function(a){var b=this;return new dc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},Mb.select=Mb.map=function(a,b){var c=this;return new dc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Mb.selectMany=Mb.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=g(e)?_b(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?u.call(this,a):u.call(this,function(){return a})},Mb.selectSwitch=Mb.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},Mb.skip=function(a){if(0>a)throw new Error(K);var b=this;return new dc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Mb.skipWhile=function(a,b){var c=this;return new dc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Mb.take=function(a,b){if(0>a)throw new Error(K);if(0===a)return Sb(b);var c=this;return new dc(function(b){var d=a;return c.subscribe(function(a){d>0&&(d--,b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},Mb.takeWhile=function(a,b){var c=this;return new dc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},Mb.where=Mb.filter=function(a,b){var c=this;return new dc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},Pb.fromCallback=function(a,b,c,d){return b||(b=xb),function(){var e=fb.call(arguments,0);return new dc(function(f){return b.schedule(function(){function b(a){var b=a;if(d)try{b=d(arguments)}catch(c){return f.onError(c),void 0}else 1===b.length&&(b=b[0]);f.onNext(b),f.onCompleted()}e.push(b),a.apply(c,e)})})}},Pb.fromNodeCallback=function(a,b,c,d){return b||(b=xb),function(){var e=fb.call(arguments,0);return new dc(function(f){return b.schedule(function(){function b(a){if(a)return f.onError(a),void 0;var b=fb.call(arguments,1);if(d)try{b=d(b)}catch(c){return f.onError(c),void 0}else 1===b.length&&(b=b[0]);f.onNext(b),f.onCompleted()}e.push(b),a.apply(c,e)})})}},Pb.fromEvent=function(a,b,c){return new dc(function(d){return w(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e),void 0}d.onNext(b)})}).publish().refCount()},Pb.fromEventPattern=function(a,b,c){return new dc(function(d){function e(a){var b=a;
2
- if(c)try{b=c(arguments)}catch(e){return d.onError(e),void 0}d.onNext(b)}var f=a(e);return ob(function(){b&&b(e,f)})}).publish().refCount()};var _b=Pb.fromPromise=function(a){return new dc(function(b){a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)})})};Mb.toPromise=function(a){if(a||(a=H.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)})})},Pb.startAsync=function(a){var b;try{b=a()}catch(c){return Wb(c)}return _b(b)},Mb.multicast=function(a,b){var c=this;return"function"==typeof a?new dc(function(d){var e=c.multicast(a());return new lb(b(e).subscribe(d),e.connect())}):new ac(c,a)},Mb.publish=function(a){return a?this.multicast(function(){return new gc},a):this.multicast(new gc)},Mb.share=function(){return this.publish(null).refCount()},Mb.publishLast=function(a){return a?this.multicast(function(){return new hc},a):this.multicast(new hc)},Mb.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new jc(b)},a):this.multicast(new jc(a))},Mb.shareValue=function(a){return this.publishValue(a).refCount()},Mb.replay=function(a,b,c,d){return a?this.multicast(function(){return new kc(b,c,d)},a):this.multicast(new kc(b,c,d))},Mb.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var ac=H.ConnectableObservable=function(a){function b(b,c){function d(a){return e.subject.subscribe(a)}var e={subject:c,source:b.asObservable(),hasSubscription:!1,subscription:null};this.connect=function(){return e.hasSubscription||(e.hasSubscription=!0,e.subscription=new lb(e.source.subscribe(e.subject),ob(function(){e.hasSubscription=!1}))),e.subscription},a.call(this,d)}return gb(b,a),b.prototype.connect=function(){return this.connect()},b.prototype.refCount=function(){var a=null,b=0,c=this;return new dc(function(d){var e,f;return b++,e=1===b,f=c.subscribe(d),e&&(a=c.connect()),ob(function(){f.dispose(),b--,0===b&&a.dispose()})})},b}(Pb),bc=Pb.interval=function(a,b){return b||(b=Ab),y(a,a,b)},cc=Pb.timer=function(b,c,d){var e;return d||(d=Ab),"number"==typeof c?e=c:"object"==typeof c&&"now"in c&&(d=c),e===a?x(b,d):y(b,e,d)};Mb.delay=function(a,b){b||(b=Ab);var c=this;return new dc(function(d){var e,f=!1,g=new sb,h=null,i=[],j=!1;return e=c.materialize().timestamp(b).subscribe(function(c){var e,k;"E"===c.value.kind?(i=[],i.push(c),h=c.value.exception,k=!j):(i.push({value:c.value,timestamp:c.timestamp+a}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new rb,g.setDisposable(e),e.setDisposable(b.scheduleRecursiveWithRelative(a,function(a){var c,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-b.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-b.now())):f=!1,c=h,j=!1,null!==c?d.onError(c):k&&a(e)}}))))}),new lb(e,g)})},Mb.throttle=function(a,b){b||(b=Ab);return this.throttleWithSelector(function(){return cc(a,b)})},Mb.timeInterval=function(a){var b=this;return a||(a=Ab),Rb(function(){var c=a.now();return b.select(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},Mb.timestamp=function(a){return a||(a=Ab),this.select(function(b){return{value:b,timestamp:a.now()}})},Mb.sample=function(a,b){return b||(b=Ab),"number"==typeof a?z(this,bc(a,b)):z(this,a)},Mb.timeout=function(a,b,c){var d,e=this;return b||(b=Wb(new Error("Timeout"))),c||(c=Ab),d=a instanceof Date?function(a,b){c.scheduleWithAbsolute(a,b)}:function(a,b){c.scheduleWithRelative(a,b)},new dc(function(c){var f,g=0,h=new rb,i=new sb,j=!1,k=new sb;return i.setDisposable(h),f=function(){var e=g;k.setDisposable(d(a,function(){j=g===e;var a=j;a&&i.setDisposable(b.subscribe(c))}))},f(),h.setDisposable(e.subscribe(function(a){var b=!j;b&&(g++,c.onNext(a),f())},function(a){var b=!j;b&&(g++,c.onError(a))},function(){var a=!j;a&&(g++,c.onCompleted())})),new lb(i,k)})},Pb.generateWithTime=function(a,b,c,d,e,f){return f||(f=Ab),new dc(function(g){var h,i,j=!0,k=!1,l=a;return f.scheduleRecursiveWithRelative(0,function(a){k&&g.onNext(h);try{j?j=!1:l=c(l),k=b(l),k&&(h=d(l),i=e(l))}catch(f){return g.onError(f),void 0}k?a(i):g.onCompleted()})})},Mb.delaySubscription=function(a,b){return b||(b=Ab),this.delayWithSelector(cc(a,b),function(){return Sb()})},Mb.delayWithSelector=function(a,b){var c,d,e=this;return"function"==typeof a?d=a:(c=a,d=b),new dc(function(a){var b=new lb,f=!1,g=function(){f&&0===b.length&&a.onCompleted()},h=new sb,i=function(){h.setDisposable(e.subscribe(function(c){var e;try{e=d(c)}catch(f){return a.onError(f),void 0}var h=new rb;b.add(h),h.setDisposable(e.subscribe(function(){a.onNext(c),b.remove(h),g()},a.onError.bind(a),function(){a.onNext(c),b.remove(h),g()}))},a.onError.bind(a),function(){f=!0,h.dispose(),g()}))};return c?h.setDisposable(c.subscribe(function(){i()},a.onError.bind(a),function(){i()})):i(),new lb(h,b)})},Mb.timeoutWithSelector=function(a,b,c){if(1===arguments.length){b=a;var a=Ub()}c||(c=Wb(new Error("Timeout")));var d=this;return new dc(function(e){var f=new sb,g=new sb,h=new rb;f.setDisposable(h);var i=0,j=!1,k=function(a){var b=i,d=function(){return i===b},h=new rb;g.setDisposable(h),h.setDisposable(a.subscribe(function(){d()&&f.setDisposable(c.subscribe(e)),h.dispose()},function(a){d()&&e.onError(a)},function(){d()&&f.setDisposable(c.subscribe(e))}))};k(a);var l=function(){var a=!j;return a&&i++,a};return h.setDisposable(d.subscribe(function(a){if(l()){e.onNext(a);var c;try{c=b(a)}catch(d){return e.onError(d),void 0}k(c)}},function(a){l()&&e.onError(a)},function(){l()&&e.onCompleted()})),new lb(f,g)})},Mb.throttleWithSelector=function(a){var b=this;return new dc(function(c){var d,e=!1,f=new sb,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return c.onError(i),void 0}e=!0,d=b,g++;var j=g,k=new rb;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new lb(h,f)})},Mb.skipLastWithTime=function(a,b){b||(b=Ab);var c=this;return new dc(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},d.onError.bind(d),function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})})},Mb.takeLastWithTime=function(a,b,c){return this.takeLastBufferWithTime(a,b).selectMany(function(a){return Tb(a,c)})},Mb.takeLastBufferWithTime=function(a,b){var c=this;return b||(b=Ab),new dc(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},d.onError.bind(d),function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})})},Mb.takeWithTime=function(a,b){var c=this;return b||(b=Ab),new dc(function(d){var e=b.scheduleWithRelative(a,function(){d.onCompleted()});return new lb(e,c.subscribe(d))})},Mb.skipWithTime=function(a,b){var c=this;return b||(b=Ab),new dc(function(d){var e=!1,f=b.scheduleWithRelative(a,function(){e=!0}),g=c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d));return new lb(f,g)})},Mb.skipUntilWithTime=function(a,b){b||(b=Ab);var c=this;return new dc(function(d){var e=!1,f=b.scheduleWithAbsolute(a,function(){e=!0}),g=c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d));return new lb(f,g)})},Mb.takeUntilWithTime=function(a,b){b||(b=Ab);var c=this;return new dc(function(d){return new lb(b.scheduleWithAbsolute(a,function(){d.onCompleted()}),c.subscribe(d))})},Mb.pausable=function(a){var b=this;return new dc(function(c){var d=b.publish(),e=d.subscribe(c),f=pb,g=a.distinctUntilChanged().subscribe(function(a){a?f=d.connect():(f.dispose(),f=pb)});return new lb(e,f,g)})};var dc=H.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=pb:"function"==typeof a&&(a=ob(a)),a}function c(d){function e(a){var c=new ec(a);if(yb.scheduleRequired())yb.schedule(function(){try{c.setDisposable(b(d(c)))}catch(a){if(!c.fail(a))throw a}});else try{c.setDisposable(b(d(c)))}catch(e){if(!c.fail(e))throw e}return c}return this instanceof c?(a.call(this,e),void 0):new c(d)}return gb(c,a),c}(Pb),ec=function(a){function b(b){a.call(this),this.observer=b,this.m=new rb}gb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Nb),fc=function(a,b){this.subject=a,this.observer=b};fc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var gc=H.Subject=function(a){function b(a){return h.call(this),this.isStopped?this.exception?(a.onError(this.exception),pb):(a.onCompleted(),pb):(this.observers.push(a),new fc(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return gb(c,a),hb(c.prototype,Kb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(h.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(h.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(h.call(this),!this.isStopped)for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new ic(a,b)},c}(Pb),hc=H.AsyncSubject=function(a){function b(a){if(h.call(this),!this.isStopped)return this.observers.push(a),new fc(this,a);var b=this.exception,c=this.hasValue,d=this.value;return b?a.onError(b):c?(a.onNext(d),a.onCompleted()):a.onCompleted(),pb}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return gb(c,a),hb(c.prototype,Kb,{hasObservers:function(){return h.call(this),this.observers.length>0},onCompleted:function(){var a,b,c;if(h.call(this),!this.isStopped){this.isStopped=!0;var d=this.observers.slice(0),e=this.value,f=this.hasValue;if(f)for(b=0,c=d.length;c>b;b++)a=d[b],a.onNext(e),a.onCompleted();else for(b=0,c=d.length;c>b;b++)d[b].onCompleted();this.observers=[]}},onError:function(a){if(h.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){h.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(Pb),ic=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 gb(c,a),hb(c.prototype,Kb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Pb),jc=H.BehaviorSubject=function(a){function b(a){if(h.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new fc(this,a);var b=this.exception;return b?a.onError(b):a.onCompleted(),pb}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return gb(c,a),hb(c.prototype,Kb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(h.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(h.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(h.call(this),!this.isStopped){this.value=a;for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(Pb),kc=H.ReplaySubject=function(a){function b(a,b){this.subject=a,this.observer=b}function c(a){var c=new Qb(this.scheduler,a),d=new b(this,c);h.call(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var e=this.q.length,f=0,g=this.q.length;g>f;f++)c.onNext(this.q[f].value);return this.hasError?(e++,c.onError(this.error)):this.isStopped&&(e++,c.onCompleted()),c.ensureActive(e),d}function d(b,d,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==d?Number.MAX_VALUE:d,this.scheduler=e||yb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,c)}return b.prototype.dispose=function(){if(this.observer.dispose(),!this.subject.isDisposed){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1)}},gb(d,a),hb(d.prototype,Kb,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){var b;if(h.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++)b=d[e],b.onNext(a),b.ensureActive()}},onError:function(a){var b;if(h.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++)b=d[e],b.onError(a),b.ensureActive();this.observers=[]}},onCompleted:function(){var a;if(h.call(this),!this.isStopped){this.isStopped=!0;var b=this.scheduler.now();this._trim(b);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)a=c[d],a.onCompleted(),a.ensureActive();this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),d}(Pb);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(B.Rx=H,define(function(){return H})):C&&D?E?(D.exports=H).Rx=H:C.Rx=H:B.Rx=H}).call(this);
1
+ (function(a){function b(){}function c(a){return a}function d(a,b){return fb(a,b)}function e(a,b){return a-b}function f(a){throw a}function g(a){return"function"==typeof a.then}function h(){if(this.isDisposed)throw new Error(M)}function i(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function j(a){var b=[];if(!i(a))return b;eb.nonEnumArgs&&a.length&&n(a)&&(a=gb.call(a));var c=eb.enumPrototypes&&"function"==typeof a,d=eb.enumErrorProps&&(a===$||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(eb.nonEnumShadows&&a!==_){var f=a.constructor,g=-1,h=cb.length;if(a===(f&&f.prototype))var j=a===stringProto?W:a===$?R:X.call(a),k=db[j];for(;++g<h;)e=cb[g],k&&k[e]||!Y.call(a,e)||b.push(e)}return b}function k(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 l(a,b){return k(a,b,j)}function m(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function n(a){return a&&"object"==typeof a?X.call(a)==N:!1}function o(a){return"function"==typeof a}function p(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=X.call(a),h=X.call(b);if(g==N&&(g=U),h==N&&(h=U),g!=h)return!1;switch(g){case P:case Q:return+a==+b;case T:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case V:case W:return a==String(b)}var i=g==O;if(!i){if(g!=U||!eb.nodeClass&&(m(a)||m(b)))return!1;var j=!eb.argsObject&&n(a)?Object:a.constructor,k=!eb.argsObject&&n(b)?Object:b.constructor;if(!(j==k||Y.call(a,"constructor")&&Y.call(b,"constructor")||o(j)&&j instanceof j&&o(k)&&k instanceof k||!("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),i){if(q=a.length,r=b.length,result=r==q)for(;r--;){var s=b[r];if(!(result=p(a[r],s,c,d)))break}}else l(b,function(b,e,f){return Y.call(f,e)?(r++,result=Y.call(a,e)&&p(a[e],b,c,d)):void 0}),result&&l(a,function(a,b,c){return Y.call(c,b)?result=--r>-1:void 0});return c.pop(),d.pop(),result}function q(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:gb.call(a)}function r(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function s(a,b){return new gc(function(c){var d=new sb,e=new tb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return c.onError(g),void 0}d=new sb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function t(a,b){var c=this;return new gc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i),void 0}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function u(a){return this.select(function(b,c){var d=a(b,c);return g(d)?ac(d):d}).mergeObservable()}function v(a,b,c){return a.addListener?(a.addListener(b,c),pb(function(){a.removeListener(b,c)})):a.addEventListener?(a.addEventListener(b,c,!1),pb(function(){a.removeEventListener(b,c,!1)})):void 0}function w(a,b,c){var d=new mb;if(a&&a.length)for(var e=0,f=a.length;f>e;e++)d.add(w(a[e],b,c));else a&&d.add(v(a,b,c));return d}function x(a,b){var c=xb(a);return new gc(function(a){return b.scheduleWithRelative(c,function(){a.onNext(0),a.onCompleted()})})}function y(a,b,c){return a===b?new gc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Sb(function(){return observableTimerDateAndPeriod(c.now()+a,b,c)})}function z(a,b){return new gc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new mb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function A(a,b,d){return new gc(function(e){function f(a,b){k[b]=a;var f;if(h[b]=!0,i||(i=h.every(c))){try{f=d.apply(null,k)}catch(g){return e.onError(g),void 0}e.onNext(f)}else j&&e.onCompleted()}var g=2,h=[!1,!1],i=!1,j=!1,k=new Array(g);return new mb(a.subscribe(function(a){f(a,0)},e.onError.bind(e),function(){j=!0,e.onCompleted()}),b.subscribe(function(a){f(a,1)},e.onError.bind(e)))})}var B={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},C=B[typeof window]&&window||this,D=B[typeof exports]&&exports&&!exports.nodeType&&exports,E=B[typeof module]&&module&&!module.nodeType&&module,F=E&&E.exports===D&&D,G=B[typeof global]&&global;!G||G.global!==G&&G.window!==G||(C=G);var H,I={internals:{},config:{}},J=Date.now,K="Sequence contains no elements.",L="Argument out of range",M="Object has been disposed",N="[object Arguments]",O="[object Array]",P="[object Boolean]",Q="[object Date]",R="[object Error]",S="[object Function]",T="[object Number]",U="[object Object]",V="[object RegExp]",W="[object String]",X=Object.prototype.toString,Y=Object.prototype.hasOwnProperty,Z=X.call(arguments)==N,$=Error.prototype,_=Object.prototype,ab=_.propertyIsEnumerable;try{H=!(X.call(document)==U&&!({toString:0}+""))}catch(bb){H=!0}var cb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],db={};db[O]=db[Q]=db[T]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},db[P]=db[W]={constructor:!0,toString:!0,valueOf:!0},db[R]=db[S]=db[V]={constructor:!0,toString:!0},db[U]={constructor:!0};var eb={};!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);eb.enumErrorProps=ab.call($,"message")||ab.call($,"name"),eb.enumPrototypes=ab.call(a,"prototype"),eb.nonEnumArgs=0!=c,eb.nonEnumShadows=!/valueOf/.test(b)}(1),Z||(n=function(a){return a&&"object"==typeof a?Y.call(a,"callee"):!1}),o(/x/)&&(o=function(a){return"function"==typeof a&&X.call(a)==S});var fb=I.internals.isEqual=function(a,b){return p(a,b,[],[])},gb=Array.prototype.slice,hb=({}.hasOwnProperty,this.inherits=I.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),ib=I.internals.addProperties=function(a){for(var b=gb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},jb=(I.internals.addRef=function(a,b){return new gc(function(c){return new mb(b.getDisposable(),a.subscribe(c))})},function(a,b){this.id=a,this.value=b});jb.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var kb=I.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},lb=kb.prototype;lb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},lb.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)}}},lb.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)}}},lb.peek=function(){return this.items[0].value},lb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},lb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},lb.enqueue=function(a){var b=this.length++;this.items[b]=new jb(kb.count++,a),this.percolate(b)},lb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},kb.count=0;var mb=I.CompositeDisposable=function(){this.disposables=q(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},nb=mb.prototype;nb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},nb.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},nb.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()}},nb.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()},nb.contains=function(a){return-1!==this.disposables.indexOf(a)},nb.toArray=function(){return this.disposables.slice(0)};var ob=I.Disposable=function(a){this.isDisposed=!1,this.action=a||b};ob.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var pb=ob.create=function(a){return new ob(a)},qb=ob.empty={dispose:b},rb=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}(),sb=I.SingleAssignmentDisposable=function(a){function b(){a.call(this,!0)}return hb(b,a),b}(rb),tb=I.SerialDisposable=function(a){function b(){a.call(this,!1)}return hb(b,a),b}(rb),ub=(I.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?qb:new a(this)},b}(),I.internals.ScheduledItem=function(a,b,c,d,f){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=f||e,this.disposable=new sb});ub.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ub.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},ub.prototype.isCancelled=function(){return this.disposable.isDisposed},ub.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var vb,wb=I.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 mb,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),qb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new mb,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),qb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){return b(),qb}var e=a.prototype;return e.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,function(){b()})},e.schedulePeriodicWithState=function(a,b,c){var d=a,e=setInterval(function(){d=c(d)},b);return pb(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=J,a.normalize=function(a){return 0>a&&(a=0),a},a}(),xb=wb.normalize,yb=wb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=xb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new wb(J,a,b,c)}(),zb=wb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-wb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+wb.normalize(c),g=new ub(this,b,d,f);if(e)e.enqueue(g);else{e=new kb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new wb(J,b,c,d);return f.scheduleRequired=function(){return null===e},f.ensureTrampoline=function(a){return null===e?this.schedule(a):a()},f}(),Ab=(I.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 sb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),b);!function(){function a(){if(!C.postMessage||C.importScripts)return!1;var a=!1,b=C.onmessage;return C.onmessage=function(){a=!0},C.postMessage("","*"),C.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(X).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=G&&F&&G.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=G&&F&&G.clearImmediate)&&!c.test(e)&&e;if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))vb=process.nextTick;else if("function"==typeof d)vb=d,Ab=e;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;C.addEventListener?C.addEventListener("message",b,!1):C.attachEvent("onmessage",b,!1),vb=function(a){var b=h++;g[b]=a,C.postMessage(f+b,"*")}}else if(C.MessageChannel){var i=new C.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},vb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?vb=function(a){var b=C.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},C.document.documentElement.appendChild(b)}:(vb=function(a){return setTimeout(a,0)},Ab=clearTimeout)}();var Bb=wb.timeout=function(){function a(a,b){var c=this,d=new sb,e=vb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new mb(d,pb(function(){Ab(e)}))}function b(a,b,c){var d=this,e=wb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new sb,g=setTimeout(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new mb(f,pb(function(){clearTimeout(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new wb(J,a,b,c)}(),Cb=I.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}var b=a.prototype;return b.accept=function(a,b,c){return 1===arguments.length&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},b.toObservable=function(a){var b=this;return a||(a=yb),new gc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Db=Cb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Cb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Eb=Cb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Cb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Fb=Cb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Cb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Gb=I.internals.Enumerator=function(a,b){this.moveNext=a,this.getCurrent=b},Hb=Gb.create=function(a,b){var c=!1;return new Gb(function(){if(c)return!1;var b=a();return b||(c=!0),b},function(){return b()})},Ib=I.internals.Enumerable=function(a){this.getEnumerator=a};Ib.prototype.concat=function(){var a=this;return new gc(function(b){var c,d=a.getEnumerator(),e=new tb,f=yb.scheduleRecursive(function(a){var f,g;if(!c){try{g=d.moveNext(),g&&(f=d.getCurrent())}catch(h){return b.onError(h),void 0}if(!g)return b.onCompleted(),void 0;var i=new sb;e.setDisposable(i),i.setDisposable(f.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new mb(e,f,pb(function(){c=!0}))})},Ib.prototype.catchException=function(){var a=this;return new gc(function(b){var c,d,e=a.getEnumerator(),f=new tb,g=yb.scheduleRecursive(function(a){var g,h;if(!c){try{h=e.moveNext(),h&&(g=e.getCurrent())}catch(i){return b.onError(i),void 0}if(!h)return d?b.onError(d):b.onCompleted(),void 0;var j=new sb;f.setDisposable(j),j.setDisposable(g.subscribe(b.onNext.bind(b),function(b){d=b,a()},b.onCompleted.bind(b)))}});return new mb(f,g,pb(function(){c=!0}))})};var Jb=Ib.repeat=function(a,b){return 1===arguments.length&&(b=-1),new Ib(function(){var c,d=b;return Hb(function(){return 0===d?!1:(d>0&&d--,c=a,!0)},function(){return c})})},Kb=Ib.forEach=function(a,b,d){return b||(b=c),new Ib(function(){var c,e=-1;return Hb(function(){return++e<a.length?(c=b.call(d,a[e],e,a),!0):!1},function(){return c})})},Lb=I.Observer=function(){};Lb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Lb.prototype.asObserver=function(){return new Pb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var Mb=Lb.create=function(a,c,d){return a||(a=b),c||(c=f),d||(d=b),new Pb(a,c,d)};Lb.fromNotifier=function(a){return new Pb(function(b){return a(Db(b))},function(b){return a(Eb(b))},function(){return a(Fb())})};var Nb,Ob=I.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return hb(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}(Lb),Pb=I.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return hb(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}(Ob),Qb=I.Observable=function(){function a(a){this._subscribe=a}return Nb=a.prototype,Nb.finalValue=function(){var a=this;return new gc(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(K))})})},Nb.subscribe=Nb.forEach=function(a,b,c){var d;return d="object"==typeof a?a:Mb(a,b,c),this._subscribe(d)},Nb.toArray=function(){function a(a,b){var c=a.slice(0);return c.push(b),c}return this.scan([],a).startWith([]).finalValue()},a}(),Rb=I.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 tb}return hb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return b.isAcquired=!1,void 0;c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Ob);Qb.create=Qb.createWithDisposable=function(a){return new gc(a)};var Sb=Qb.defer=function(a){return new gc(function(b){var c;try{c=a()}catch(d){return Xb(d).subscribe(b)}return c.subscribe(b)})},Tb=Qb.empty=function(a){return a||(a=yb),new gc(function(b){return a.schedule(function(){b.onCompleted()})})},Ub=Qb.fromArray=function(a,b){return b||(b=zb),new gc(function(c){var d=0;return b.scheduleRecursive(function(b){d<a.length?(c.onNext(a[d++]),b()):c.onCompleted()})})};Nb.fromGenerator=function(a,b){return b||(b=zb),new gc(function(c){var d;try{d=a()}catch(e){return c.onError(e),void 0}return b.scheduleRecursive(function(a){var b=d.next();b.done?c.onCompleted():(c.onNext(b.value),a())})})},Qb.generate=function(a,b,c,d,e){return e||(e=zb),new gc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return f.onError(j),void 0}e?(f.onNext(i),a()):f.onCompleted()})})};var Vb=Qb.never=function(){return new gc(function(){return qb})};Qb.range=function(a,b,c){return c||(c=zb),new gc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},Qb.repeat=function(a,b,c){return c||(c=zb),null==b&&(b=-1),Wb(a,c).repeat(b)};var Wb=Qb["return"]=Qb.returnValue=function(a,b){return b||(b=yb),new gc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})},Xb=Qb["throw"]=Qb.throwException=function(a,b){return b||(b=yb),new gc(function(c){return b.schedule(function(){c.onError(a)})})};Nb["catch"]=Nb.catchException=function(a){return"function"==typeof a?s(this,a):Yb([this,a])};var Yb=Qb.catchException=Qb["catch"]=function(){var a=q(arguments,0);return Kb(a).catchException()};Nb.combineLatest=function(){var a=gb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),Zb.apply(this,a)};var Zb=Qb.combineLatest=function(){var a=gb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new gc(function(d){function e(a){var e;if(i[a]=!0,j||(j=i.every(c))){try{e=b.apply(null,l)}catch(f){return d.onError(f),void 0}d.onNext(e)}else k.filter(function(b,c){return c!==a}).every(c)&&d.onCompleted()}function f(a){k[a]=!0,k.every(c)&&d.onCompleted()}for(var g=function(){return!1},h=a.length,i=r(h,g),j=!1,k=r(h,g),l=new Array(h),m=new Array(h),n=0;h>n;n++)!function(b){m[b]=new sb,m[b].setDisposable(a[b].subscribe(function(a){l[b]=a,e(b)},d.onError.bind(d),function(){f(b)}))}(n);return new mb(m)})};Nb.concat=function(){var a=gb.call(arguments,0);return a.unshift(this),$b.apply(this,a)};var $b=Qb.concat=function(){var a=q(arguments,0);return Kb(a).concat()};Nb.concatObservable=Nb.concatAll=function(){return this.merge(1)},Nb.merge=function(a){if("number"!=typeof a)return _b(this,a);var b=this;return new gc(function(c){var d=0,e=new mb,f=!1,h=[],i=function(a){var b=new sb;e.add(b),g(a)&&(a=ac(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){var a;e.remove(b),h.length>0?(a=h.shift(),i(a)):(d--,f&&0===d&&c.onCompleted())}))};return e.add(b.subscribe(function(b){a>d?(d++,i(b)):h.push(b)},c.onError.bind(c),function(){f=!0,0===d&&c.onCompleted()})),e})};var _b=Qb.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=gb.call(arguments,1)):(a=yb,b=gb.call(arguments,0)):(a=yb,b=gb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),Ub(b,a).mergeObservable()};Nb.mergeObservable=Nb.mergeAll=function(){var a=this;return new gc(function(b){var c=new mb,d=!1,e=new sb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new sb;c.add(e),g(a)&&(a=ac(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})},Nb.skipUntil=function(a){var b=this;return new gc(function(c){var d=!1,e=new mb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()})),f=new sb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},Nb["switch"]=Nb.switchLatest=function(){var a=this;return new gc(function(b){var c=!1,d=new tb,e=!1,f=0,h=a.subscribe(function(a){var h=new sb,i=++f;c=!0,d.setDisposable(h),g(a)&&(a=ac(a)),h.setDisposable(a.subscribe(function(a){f===i&&b.onNext(a)},function(a){f===i&&b.onError(a)},function(){f===i&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,c||b.onCompleted()});return new mb(h,d)})},Nb.takeUntil=function(a){var c=this;return new gc(function(d){return new mb(c.subscribe(d),a.subscribe(d.onCompleted.bind(d),d.onError.bind(d),b))})},Nb.zip=function(){if(Array.isArray(arguments[0]))return t.apply(this,arguments);var a=this,b=gb.call(arguments),d=b.pop();return b.unshift(a),new gc(function(e){function f(a){i[a]=!0,i.every(function(a){return a})&&e.onCompleted()}for(var g=b.length,h=r(g,function(){return[]}),i=r(g,function(){return!1}),j=function(b){var f,g;if(h.every(function(a){return a.length>0})){try{g=h.map(function(a){return a.shift()}),f=d.apply(a,g)}catch(j){return e.onError(j),void 0}e.onNext(f)}else i.filter(function(a,c){return c!==b}).every(c)&&e.onCompleted()},k=new Array(g),l=0;g>l;l++)!function(a){k[a]=new sb,k[a].setDisposable(b[a].subscribe(function(b){h[a].push(b),j(a)},e.onError.bind(e),function(){f(a)}))}(l);return new mb(k)})},Qb.zip=function(){var a=gb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},Qb.zipArray=function(){var a=q(arguments,0);return new gc(function(b){function d(a){if(g.every(function(a){return a.length>0})){var d=g.map(function(a){return a.shift()});b.onNext(d)}else if(h.filter(function(b,c){return c!==a}).every(c))return b.onCompleted(),void 0}function e(a){return h[a]=!0,h.every(c)?(b.onCompleted(),void 0):void 0}for(var f=a.length,g=r(f,function(){return[]}),h=r(f,function(){return!1}),i=new Array(f),j=0;f>j;j++)!function(c){i[c]=new sb,i[c].setDisposable(a[c].subscribe(function(a){g[c].push(a),d(c)},b.onError.bind(b),function(){e(c)}))}(j);var k=new mb(i);return k.add(pb(function(){for(var a=0,b=g.length;b>a;a++)g[a]=[]})),k})},Nb.asObservable=function(){var a=this;return new gc(function(b){return a.subscribe(b)})},Nb.dematerialize=function(){var a=this;return new gc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},Nb.distinctUntilChanged=function(a,b){var e=this;return a||(a=c),b||(b=d),new gc(function(c){var d,f=!1;return e.subscribe(function(e){var g,h=!1;try{g=a(e)}catch(i){return c.onError(i),void 0}if(f)try{h=b(d,g)}catch(i){return c.onError(i),void 0}f&&h||(f=!0,d=g,c.onNext(e))},c.onError.bind(c),c.onCompleted.bind(c))})},Nb["do"]=Nb.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 gc(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()})})},Nb["finally"]=Nb.finallyAction=function(a){var b=this;return new gc(function(c){var d=b.subscribe(c);return pb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},Nb.ignoreElements=function(){var a=this;return new gc(function(c){return a.subscribe(b,c.onError.bind(c),c.onCompleted.bind(c))})},Nb.materialize=function(){var a=this;return new gc(function(b){return a.subscribe(function(a){b.onNext(Db(a))},function(a){b.onNext(Eb(a)),b.onCompleted()},function(){b.onNext(Fb()),b.onCompleted()})})},Nb.repeat=function(a){return Jb(this,a).concat()},Nb.retry=function(a){return Jb(this,a).catchException()},Nb.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 gc(function(e){var f,g,h;return d.subscribe(function(d){try{h||(h=!0),f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return e.onError(i),void 0}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},Nb.skipLast=function(a){var b=this;return new gc(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))})},Nb.startWith=function(){var a,b,c=0;return arguments.length&&"now"in Object(arguments[0])?(b=arguments[0],c=1):b=yb,a=gb.call(arguments,c),Kb([Ub(a,b),this]).concat()},Nb.takeLast=function(a,b){return this.takeLastBuffer(a).selectMany(function(a){return Ub(a,b)})},Nb.takeLastBuffer=function(a){var b=this;return new gc(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()})})},Nb.select=Nb.map=function(a,b){var c=this;return new gc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Nb.selectMany=Nb.flatMap=function(a,b){return b?this.selectMany(function(c,d){var e=a(c,d),f=g(e)?ac(e):e;return f.select(function(a){return b(c,a,d)})}):"function"==typeof a?u.call(this,a):u.call(this,function(){return a})},Nb.selectSwitch=Nb.flatMapLatest=function(a,b){return this.select(a,b).switchLatest()},Nb.skip=function(a){if(0>a)throw new Error(L);var b=this;return new gc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},Nb.skipWhile=function(a,b){var c=this;return new gc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},Nb.take=function(a,b){if(0>a)throw new Error(L);if(0===a)return Tb(b);var c=this;return new gc(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))})},Nb.takeWhile=function(a,b){var c=this;return new gc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return d.onError(h),void 0}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},Nb.where=Nb.filter=function(a,b){var c=this;return new gc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return d.onError(h),void 0}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},Qb.fromCallback=function(a,b,c,d){return b||(b=yb),function(){var e=gb.call(arguments,0);return new gc(function(f){return b.schedule(function(){function b(a){var b=a;if(d)try{b=d(arguments)}catch(c){return f.onError(c),void 0}else 1===b.length&&(b=b[0]);f.onNext(b),f.onCompleted()}e.push(b),a.apply(c,e)})})}},Qb.fromNodeCallback=function(a,b,c,d){return b||(b=yb),function(){var e=gb.call(arguments,0);return new gc(function(f){return b.schedule(function(){function b(a){if(a)return f.onError(a),void 0;
2
+ var b=gb.call(arguments,1);if(d)try{b=d(b)}catch(c){return f.onError(c),void 0}else 1===b.length&&(b=b[0]);f.onNext(b),f.onCompleted()}e.push(b),a.apply(c,e)})})}},Qb.fromEvent=function(a,b,c){return new gc(function(d){return w(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e),void 0}d.onNext(b)})}).publish().refCount()},Qb.fromEventPattern=function(a,b,c){return new gc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e),void 0}d.onNext(b)}var f=a(e);return pb(function(){b&&b(e,f)})}).publish().refCount()};var ac=Qb.fromPromise=function(a){return new gc(function(b){a.then(function(a){b.onNext(a),b.onCompleted()},function(a){b.onError(a)})})};Nb.toPromise=function(a){if(a||(a=I.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)})})},Qb.startAsync=function(a){var b;try{b=a()}catch(c){return Xb(c)}return ac(b)},Nb.multicast=function(a,b){var c=this;return"function"==typeof a?new gc(function(d){var e=c.multicast(a());return new mb(b(e).subscribe(d),e.connect())}):new bc(c,a)},Nb.publish=function(a){return a?this.multicast(function(){return new jc},a):this.multicast(new jc)},Nb.share=function(){return this.publish(null).refCount()},Nb.publishLast=function(a){return a?this.multicast(function(){return new kc},a):this.multicast(new kc)},Nb.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new mc(b)},a):this.multicast(new mc(a))},Nb.shareValue=function(a){return this.publishValue(a).refCount()},Nb.replay=function(a,b,c,d){return a?this.multicast(function(){return new nc(b,c,d)},a):this.multicast(new nc(b,c,d))},Nb.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var bc=I.ConnectableObservable=function(a){function b(b,c){function d(a){return e.subject.subscribe(a)}var e={subject:c,source:b.asObservable(),hasSubscription:!1,subscription:null};this.connect=function(){return e.hasSubscription||(e.hasSubscription=!0,e.subscription=new mb(e.source.subscribe(e.subject),pb(function(){e.hasSubscription=!1}))),e.subscription},a.call(this,d)}return hb(b,a),b.prototype.connect=function(){return this.connect()},b.prototype.refCount=function(){var a=null,b=0,c=this;return new gc(function(d){var e,f;return b++,e=1===b,f=c.subscribe(d),e&&(a=c.connect()),pb(function(){f.dispose(),b--,0===b&&a.dispose()})})},b}(Qb),cc=Qb.interval=function(a,b){return b||(b=Bb),y(a,a,b)},dc=Qb.timer=function(b,c,d){var e;return d||(d=Bb),"number"==typeof c?e=c:"object"==typeof c&&"now"in c&&(d=c),e===a?x(b,d):y(b,e,d)};Nb.delay=function(a,b){b||(b=Bb);var c=this;return new gc(function(d){var e,f=!1,g=new tb,h=null,i=[],j=!1;return e=c.materialize().timestamp(b).subscribe(function(c){var e,k;"E"===c.value.kind?(i=[],i.push(c),h=c.value.exception,k=!j):(i.push({value:c.value,timestamp:c.timestamp+a}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new sb,g.setDisposable(e),e.setDisposable(b.scheduleRecursiveWithRelative(a,function(a){var c,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-b.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-b.now())):f=!1,c=h,j=!1,null!==c?d.onError(c):k&&a(e)}}))))}),new mb(e,g)})},Nb.throttle=function(a,b){b||(b=Bb);return this.throttleWithSelector(function(){return dc(a,b)})},Nb.timeInterval=function(a){var b=this;return a||(a=Bb),Sb(function(){var c=a.now();return b.select(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},Nb.timestamp=function(a){return a||(a=Bb),this.select(function(b){return{value:b,timestamp:a.now()}})},Nb.sample=function(a,b){return b||(b=Bb),"number"==typeof a?z(this,cc(a,b)):z(this,a)},Nb.timeout=function(a,b,c){var d,e=this;return b||(b=Xb(new Error("Timeout"))),c||(c=Bb),d=a instanceof Date?function(a,b){c.scheduleWithAbsolute(a,b)}:function(a,b){c.scheduleWithRelative(a,b)},new gc(function(c){var f,g=0,h=new sb,i=new tb,j=!1,k=new tb;return i.setDisposable(h),f=function(){var e=g;k.setDisposable(d(a,function(){j=g===e;var a=j;a&&i.setDisposable(b.subscribe(c))}))},f(),h.setDisposable(e.subscribe(function(a){var b=!j;b&&(g++,c.onNext(a),f())},function(a){var b=!j;b&&(g++,c.onError(a))},function(){var a=!j;a&&(g++,c.onCompleted())})),new mb(i,k)})},Qb.generateWithTime=function(a,b,c,d,e,f){return f||(f=Bb),new gc(function(g){var h,i,j=!0,k=!1,l=a;return f.scheduleRecursiveWithRelative(0,function(a){k&&g.onNext(h);try{j?j=!1:l=c(l),k=b(l),k&&(h=d(l),i=e(l))}catch(f){return g.onError(f),void 0}k?a(i):g.onCompleted()})})},Nb.delaySubscription=function(a,b){return b||(b=Bb),this.delayWithSelector(dc(a,b),function(){return Tb()})},Nb.delayWithSelector=function(a,b){var c,d,e=this;return"function"==typeof a?d=a:(c=a,d=b),new gc(function(a){var b=new mb,f=!1,g=function(){f&&0===b.length&&a.onCompleted()},h=new tb,i=function(){h.setDisposable(e.subscribe(function(c){var e;try{e=d(c)}catch(f){return a.onError(f),void 0}var h=new sb;b.add(h),h.setDisposable(e.subscribe(function(){a.onNext(c),b.remove(h),g()},a.onError.bind(a),function(){a.onNext(c),b.remove(h),g()}))},a.onError.bind(a),function(){f=!0,h.dispose(),g()}))};return c?h.setDisposable(c.subscribe(function(){i()},a.onError.bind(a),function(){i()})):i(),new mb(h,b)})},Nb.timeoutWithSelector=function(a,b,c){if(1===arguments.length){b=a;var a=Vb()}c||(c=Xb(new Error("Timeout")));var d=this;return new gc(function(e){var f=new tb,g=new tb,h=new sb;f.setDisposable(h);var i=0,j=!1,k=function(a){var b=i,d=function(){return i===b},h=new sb;g.setDisposable(h),h.setDisposable(a.subscribe(function(){d()&&f.setDisposable(c.subscribe(e)),h.dispose()},function(a){d()&&e.onError(a)},function(){d()&&f.setDisposable(c.subscribe(e))}))};k(a);var l=function(){var a=!j;return a&&i++,a};return h.setDisposable(d.subscribe(function(a){if(l()){e.onNext(a);var c;try{c=b(a)}catch(d){return e.onError(d),void 0}k(c)}},function(a){l()&&e.onError(a)},function(){l()&&e.onCompleted()})),new mb(f,g)})},Nb.throttleWithSelector=function(a){var b=this;return new gc(function(c){var d,e=!1,f=new tb,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return c.onError(i),void 0}e=!0,d=b,g++;var j=g,k=new sb;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new mb(h,f)})},Nb.skipLastWithTime=function(a,b){b||(b=Bb);var c=this;return new gc(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},d.onError.bind(d),function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})})},Nb.takeLastWithTime=function(a,b,c){return this.takeLastBufferWithTime(a,b).selectMany(function(a){return Ub(a,c)})},Nb.takeLastBufferWithTime=function(a,b){var c=this;return b||(b=Bb),new gc(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},d.onError.bind(d),function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})})},Nb.takeWithTime=function(a,b){var c=this;return b||(b=Bb),new gc(function(d){var e=b.scheduleWithRelative(a,function(){d.onCompleted()});return new mb(e,c.subscribe(d))})},Nb.skipWithTime=function(a,b){var c=this;return b||(b=Bb),new gc(function(d){var e=!1,f=b.scheduleWithRelative(a,function(){e=!0}),g=c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d));return new mb(f,g)})},Nb.skipUntilWithTime=function(a,b){b||(b=Bb);var c=this;return new gc(function(d){var e=!1,f=b.scheduleWithAbsolute(a,function(){e=!0}),g=c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d));return new mb(f,g)})},Nb.takeUntilWithTime=function(a,b){b||(b=Bb);var c=this;return new gc(function(d){return new mb(b.scheduleWithAbsolute(a,function(){d.onCompleted()}),c.subscribe(d))})},Nb.pausable=function(a){var b=this;return new gc(function(c){var d=b.publish(),e=d.subscribe(c),f=qb,g=a.distinctUntilChanged().subscribe(function(a){a?f=d.connect():(f.dispose(),f=qb)});return new mb(e,f,g)})},Nb.pausableBuffered=function(a){var b=this;return new gc(function(c){var d=[],e=!0,f=A(b,a.distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(a){if(a.shouldFire&&e&&c.onNext(a.data),a.shouldFire&&!e){for(;d.length>0;)c.onNext(d.shift());e=!0}else a.shouldFire||e?!a.shouldFire&&e&&(e=!1):d.push(a.data)},c.onError.bind(c),c.onCompleted.bind(c));return a.onNext(!1),f})},Nb.controlled=function(a){return null==a&&(a=!0),new ec(this,a)};var ec=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new fc(d),this.source=c.multicast(this.subject).refCount()}return hb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(Qb),fc=I.ControlledSubject=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new jc,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=qb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=qb}return hb(c,a),ib(c.prototype,Lb,{onCompleted:function(){h.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){h.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){h.call(this);var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=qb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=qb),{numberOfItems:a,returnValue:!1}},request:function(a){h.call(this),this.disposeCurrentRequest();var b=this,c=this._processRequest(a);return a=c.numberOfItems,c.returnValue?qb:(this.requestedCount=a,this.requestedDisposable=pb(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=qb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),c}(Qb),gc=I.AnonymousObservable=function(a){function b(a){return"undefined"==typeof a?a=qb:"function"==typeof a&&(a=pb(a)),a}function c(d){function e(a){var c=new hc(a);if(zb.scheduleRequired())zb.schedule(function(){try{c.setDisposable(b(d(c)))}catch(a){if(!c.fail(a))throw a}});else try{c.setDisposable(b(d(c)))}catch(e){if(!c.fail(e))throw e}return c}return this instanceof c?(a.call(this,e),void 0):new c(d)}return hb(c,a),c}(Qb),hc=function(a){function b(b){a.call(this),this.observer=b,this.m=new sb}hb(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}(Ob),ic=function(a,b){this.subject=a,this.observer=b};ic.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 jc=I.Subject=function(a){function b(a){return h.call(this),this.isStopped?this.exception?(a.onError(this.exception),qb):(a.onCompleted(),qb):(this.observers.push(a),new ic(this,a))}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return hb(c,a),ib(c.prototype,Lb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(h.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(h.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(h.call(this),!this.isStopped)for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),c.create=function(a,b){return new lc(a,b)},c}(Qb),kc=I.AsyncSubject=function(a){function b(a){if(h.call(this),!this.isStopped)return this.observers.push(a),new ic(this,a);var b=this.exception,c=this.hasValue,d=this.value;return b?a.onError(b):c?(a.onNext(d),a.onCompleted()):a.onCompleted(),qb}function c(){a.call(this,b),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return hb(c,a),ib(c.prototype,Lb,{hasObservers:function(){return h.call(this),this.observers.length>0},onCompleted:function(){var a,b,c;if(h.call(this),!this.isStopped){this.isStopped=!0;var d=this.observers.slice(0),e=this.value,f=this.hasValue;if(f)for(b=0,c=d.length;c>b;b++)a=d[b],a.onNext(e),a.onCompleted();else for(b=0,c=d.length;c>b;b++)d[b].onCompleted();this.observers=[]}},onError:function(a){if(h.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){h.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),c}(Qb),lc=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 hb(c,a),ib(c.prototype,Lb,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Qb),mc=I.BehaviorSubject=function(a){function b(a){if(h.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new ic(this,a);var b=this.exception;return b?a.onError(b):a.onCompleted(),qb}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return hb(c,a),ib(c.prototype,Lb,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(h.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var b=0,c=a.length;c>b;b++)a[b].onCompleted();this.observers=[]}},onError:function(a){if(h.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,d=b.length;d>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(h.call(this),!this.isStopped){this.value=a;for(var b=this.observers.slice(0),c=0,d=b.length;d>c;c++)b[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(Qb),nc=I.ReplaySubject=function(a){function b(a,b){this.subject=a,this.observer=b}function c(a){var c=new Rb(this.scheduler,a),d=new b(this,c);h.call(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var e=this.q.length,f=0,g=this.q.length;g>f;f++)c.onNext(this.q[f].value);return this.hasError?(e++,c.onError(this.error)):this.isStopped&&(e++,c.onCompleted()),c.ensureActive(e),d}function d(b,d,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==d?Number.MAX_VALUE:d,this.scheduler=e||zb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,c)}return b.prototype.dispose=function(){if(this.observer.dispose(),!this.subject.isDisposed){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1)}},hb(d,a),ib(d.prototype,Lb,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){var b;if(h.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++)b=d[e],b.onNext(a),b.ensureActive()}},onError:function(a){var b;if(h.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++)b=d[e],b.onError(a),b.ensureActive();this.observers=[]}},onCompleted:function(){var a;if(h.call(this),!this.isStopped){this.isStopped=!0;var b=this.scheduler.now();this._trim(b);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)a=c[d],a.onCompleted(),a.ensureActive();this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),d}(Qb);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(C.Rx=I,define(function(){return I})):D&&E?F?(E.exports=I).Rx=I:D.Rx=I:C.Rx=I}).call(this);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.14
4
+ version: 2.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - jdeseno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-17 00:00:00.000000000 Z
11
+ date: 2014-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -47,6 +47,7 @@ files:
47
47
  - lib/rxjs/rails/railtie.rb
48
48
  - lib/rxjs/rails/version.rb
49
49
  - rxjs-rails.gemspec
50
+ - rxjs_license.txt
50
51
  - vendor/assets/javascripts/rx.aggregates.js
51
52
  - vendor/assets/javascripts/rx.aggregates.min.js
52
53
  - vendor/assets/javascripts/rx.async.compat.js
@@ -65,6 +66,7 @@ files:
65
66
  - vendor/assets/javascripts/rx.experimental.min.js
66
67
  - vendor/assets/javascripts/rx.joinpatterns.js
67
68
  - vendor/assets/javascripts/rx.joinpatterns.min.js
69
+ - vendor/assets/javascripts/rx.js
68
70
  - vendor/assets/javascripts/rx.lite.compat.js
69
71
  - vendor/assets/javascripts/rx.lite.compat.min.js
70
72
  - vendor/assets/javascripts/rx.lite.js