rxjs-rails 2.2.27 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -3
  3. data/lib/rxjs/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
  5. data/vendor/assets/javascripts/rx.all.compat.js +1545 -1441
  6. data/vendor/assets/javascripts/rx.all.compat.min.js +3 -3
  7. data/vendor/assets/javascripts/rx.all.js +1545 -1441
  8. data/vendor/assets/javascripts/rx.all.min.js +3 -3
  9. data/vendor/assets/javascripts/rx.async.compat.js +149 -152
  10. data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
  11. data/vendor/assets/javascripts/rx.async.js +140 -143
  12. data/vendor/assets/javascripts/rx.async.min.js +1 -1
  13. data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
  14. data/vendor/assets/javascripts/rx.binding.js +18 -18
  15. data/vendor/assets/javascripts/rx.binding.min.js +1 -1
  16. data/vendor/assets/javascripts/rx.coincidence.min.js +1 -1
  17. data/vendor/assets/javascripts/rx.compat.js +490 -339
  18. data/vendor/assets/javascripts/rx.compat.min.js +2 -2
  19. data/vendor/assets/javascripts/rx.core.compat.js +109 -141
  20. data/vendor/assets/javascripts/rx.core.compat.min.js +1 -1
  21. data/vendor/assets/javascripts/rx.core.js +109 -141
  22. data/vendor/assets/javascripts/rx.core.min.js +1 -1
  23. data/vendor/assets/javascripts/rx.experimental.js +129 -136
  24. data/vendor/assets/javascripts/rx.experimental.min.js +1 -1
  25. data/vendor/assets/javascripts/rx.joinpatterns.js +59 -59
  26. data/vendor/assets/javascripts/rx.joinpatterns.min.js +1 -1
  27. data/vendor/assets/javascripts/rx.js +490 -339
  28. data/vendor/assets/javascripts/rx.lite.compat.js +1099 -954
  29. data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
  30. data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
  31. data/vendor/assets/javascripts/rx.lite.js +1099 -954
  32. data/vendor/assets/javascripts/rx.lite.min.js +2 -2
  33. data/vendor/assets/javascripts/rx.min.js +2 -2
  34. data/vendor/assets/javascripts/rx.testing.min.js +1 -1
  35. data/vendor/assets/javascripts/rx.time.js +715 -747
  36. data/vendor/assets/javascripts/rx.time.min.js +1 -1
  37. data/vendor/assets/javascripts/rx.virtualtime.min.js +1 -1
  38. metadata +11 -10
@@ -33,164 +33,161 @@
33
33
  }
34
34
  }.call(this, function (root, exp, Rx, undefined) {
35
35
 
36
- // Aliases
37
- var Observable = Rx.Observable,
38
- observableProto = Observable.prototype,
39
- observableFromPromise = Observable.fromPromise,
40
- observableThrow = Observable.throwException,
41
- AnonymousObservable = Rx.AnonymousObservable,
42
- AsyncSubject = Rx.AsyncSubject,
43
- disposableCreate = Rx.Disposable.create,
44
- CompositeDisposable= Rx.CompositeDisposable,
45
- immediateScheduler = Rx.Scheduler.immediate,
46
- timeoutScheduler = Rx.Scheduler.timeout,
47
- slice = Array.prototype.slice;
36
+ // Aliases
37
+ var Observable = Rx.Observable,
38
+ observableProto = Observable.prototype,
39
+ observableFromPromise = Observable.fromPromise,
40
+ observableThrow = Observable.throwException,
41
+ AnonymousObservable = Rx.AnonymousObservable,
42
+ AsyncSubject = Rx.AsyncSubject,
43
+ disposableCreate = Rx.Disposable.create,
44
+ CompositeDisposable= Rx.CompositeDisposable,
45
+ immediateScheduler = Rx.Scheduler.immediate,
46
+ timeoutScheduler = Rx.Scheduler.timeout,
47
+ isScheduler = Rx.helpers.isScheduler,
48
+ slice = Array.prototype.slice;
48
49
 
49
- /**
50
- * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
51
- *
52
- * @example
53
- * var res = Rx.Observable.start(function () { console.log('hello'); });
54
- * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
55
- * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
56
- *
57
- * @param {Function} func Function to run asynchronously.
58
- * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
59
- * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
60
- * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
61
- *
62
- * Remarks
63
- * * The function is called immediately, not during the subscription of the resulting sequence.
64
- * * Multiple subscriptions to the resulting sequence can observe the function's result.
65
- */
66
- Observable.start = function (func, scheduler, context) {
67
- return observableToAsync(func, scheduler, context)();
68
- };
50
+ /**
51
+ * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
52
+ *
53
+ * @example
54
+ * var res = Rx.Observable.start(function () { console.log('hello'); });
55
+ * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
56
+ * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
57
+ *
58
+ * @param {Function} func Function to run asynchronously.
59
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
60
+ * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
61
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
62
+ *
63
+ * Remarks
64
+ * * The function is called immediately, not during the subscription of the resulting sequence.
65
+ * * Multiple subscriptions to the resulting sequence can observe the function's result.
66
+ */
67
+ Observable.start = function (func, context, scheduler) {
68
+ return observableToAsync(func, context, scheduler)();
69
+ };
69
70
 
70
- /**
71
- * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
72
- *
73
- * @example
74
- * var res = Rx.Observable.toAsync(function (x, y) { return x + y; })(4, 3);
75
- * var res = Rx.Observable.toAsync(function (x, y) { return x + y; }, Rx.Scheduler.timeout)(4, 3);
76
- * var res = Rx.Observable.toAsync(function (x) { this.log(x); }, Rx.Scheduler.timeout, console)('hello');
77
- *
78
- * @param {Function} function Function to convert to an asynchronous function.
79
- * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
80
- * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
81
- * @returns {Function} Asynchronous function.
82
- */
83
- var observableToAsync = Observable.toAsync = function (func, scheduler, context) {
84
- scheduler || (scheduler = timeoutScheduler);
85
- return function () {
86
- var args = arguments,
87
- subject = new AsyncSubject();
71
+ /**
72
+ * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
73
+ *
74
+ * @example
75
+ * var res = Rx.Observable.toAsync(function (x, y) { return x + y; })(4, 3);
76
+ * var res = Rx.Observable.toAsync(function (x, y) { return x + y; }, Rx.Scheduler.timeout)(4, 3);
77
+ * var res = Rx.Observable.toAsync(function (x) { this.log(x); }, Rx.Scheduler.timeout, console)('hello');
78
+ *
79
+ * @param {Function} function Function to convert to an asynchronous function.
80
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
81
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
82
+ * @returns {Function} Asynchronous function.
83
+ */
84
+ var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
85
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
86
+ return function () {
87
+ var args = arguments,
88
+ subject = new AsyncSubject();
88
89
 
89
- scheduler.schedule(function () {
90
- var result;
91
- try {
92
- result = func.apply(context, args);
93
- } catch (e) {
94
- subject.onError(e);
95
- return;
96
- }
97
- subject.onNext(result);
98
- subject.onCompleted();
99
- });
100
- return subject.asObservable();
101
- };
90
+ scheduler.schedule(function () {
91
+ var result;
92
+ try {
93
+ result = func.apply(context, args);
94
+ } catch (e) {
95
+ subject.onError(e);
96
+ return;
97
+ }
98
+ subject.onNext(result);
99
+ subject.onCompleted();
100
+ });
101
+ return subject.asObservable();
102
102
  };
103
+ };
103
104
 
104
- /**
105
- * Converts a callback function to an observable sequence.
106
- *
107
- * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
108
- * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
109
- * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
110
- * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
111
- * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
112
- */
113
- Observable.fromCallback = function (func, scheduler, context, selector) {
114
- scheduler || (scheduler = immediateScheduler);
115
- return function () {
116
- var args = slice.call(arguments, 0);
105
+ /**
106
+ * Converts a callback function to an observable sequence.
107
+ *
108
+ * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
109
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
110
+ * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
111
+ * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
112
+ */
113
+ Observable.fromCallback = function (func, context, selector) {
114
+ return function () {
115
+ var args = slice.call(arguments, 0);
117
116
 
118
- return new AnonymousObservable(function (observer) {
119
- return scheduler.schedule(function () {
120
- function handler(e) {
121
- var results = e;
122
-
123
- if (selector) {
124
- try {
125
- results = selector(arguments);
126
- } catch (err) {
127
- observer.onError(err);
128
- return;
129
- }
130
- } else {
131
- if (results.length === 1) {
132
- results = results[0];
133
- }
134
- }
117
+ return new AnonymousObservable(function (observer) {
118
+ function handler(e) {
119
+ var results = e;
120
+
121
+ if (selector) {
122
+ try {
123
+ results = selector(arguments);
124
+ } catch (err) {
125
+ observer.onError(err);
126
+ return;
127
+ }
135
128
 
136
- observer.onNext(results);
137
- observer.onCompleted();
138
- }
129
+ observer.onNext(results);
130
+ } else {
131
+ if (results.length <= 1) {
132
+ observer.onNext.apply(observer, results);
133
+ } else {
134
+ observer.onNext(results);
135
+ }
136
+ }
137
+
138
+ observer.onCompleted();
139
+ }
139
140
 
140
- args.push(handler);
141
- func.apply(context, args);
142
- });
143
- });
144
- };
141
+ args.push(handler);
142
+ func.apply(context, args);
143
+ });
145
144
  };
145
+ };
146
146
 
147
- /**
148
- * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
149
- * @param {Function} func The function to call
150
- * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
151
- * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
152
- * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
153
- * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
154
- */
155
- Observable.fromNodeCallback = function (func, scheduler, context, selector) {
156
- scheduler || (scheduler = immediateScheduler);
157
- return function () {
158
- var args = slice.call(arguments, 0);
147
+ /**
148
+ * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
149
+ * @param {Function} func The function to call
150
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
151
+ * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
152
+ * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
153
+ */
154
+ Observable.fromNodeCallback = function (func, context, selector) {
155
+ return function () {
156
+ var args = slice.call(arguments, 0);
159
157
 
160
- return new AnonymousObservable(function (observer) {
161
- return scheduler.schedule(function () {
162
-
163
- function handler(err) {
164
- if (err) {
165
- observer.onError(err);
166
- return;
167
- }
158
+ return new AnonymousObservable(function (observer) {
159
+ function handler(err) {
160
+ if (err) {
161
+ observer.onError(err);
162
+ return;
163
+ }
168
164
 
169
- var results = slice.call(arguments, 1);
170
-
171
- if (selector) {
172
- try {
173
- results = selector(results);
174
- } catch (e) {
175
- observer.onError(e);
176
- return;
177
- }
178
- } else {
179
- if (results.length === 1) {
180
- results = results[0];
181
- }
182
- }
165
+ var results = slice.call(arguments, 1);
166
+
167
+ if (selector) {
168
+ try {
169
+ results = selector(results);
170
+ } catch (e) {
171
+ observer.onError(e);
172
+ return;
173
+ }
174
+ observer.onNext(results);
175
+ } else {
176
+ if (results.length <= 1) {
177
+ observer.onNext.apply(observer, results);
178
+ } else {
179
+ observer.onNext(results);
180
+ }
181
+ }
183
182
 
184
- observer.onNext(results);
185
- observer.onCompleted();
186
- }
183
+ observer.onCompleted();
184
+ }
187
185
 
188
- args.push(handler);
189
- func.apply(context, args);
190
- });
191
- });
192
- };
186
+ args.push(handler);
187
+ func.apply(context, args);
188
+ });
193
189
  };
190
+ };
194
191
 
195
192
  function createListener (element, name, handler) {
196
193
  // Node.js specific
@@ -1 +1 @@
1
- (function(t){var e={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=e[typeof window]&&window||this,r=e[typeof exports]&&exports&&!exports.nodeType&&exports,i=e[typeof module]&&module&&!module.nodeType&&module,o=(i&&i.exports===r&&r,e[typeof global]&&global);!o||o.global!==o&&o.window!==o||(n=o),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(e,r){return n.Rx=t(n,r,e),n.Rx}):"object"==typeof module&&module&&module.exports===r?module.exports=t(n,module.exports,require("./rx")):n.Rx=t(n,{},n.Rx)}).call(this,function(t,e,n){function r(t,e,n){if(t.addListener)return t.addListener(e,n),h(function(){t.removeListener(e,n)});if(t.addEventListener)return t.addEventListener(e,n,!1),h(function(){t.removeEventListener(e,n,!1)});throw Error("No listener found")}function i(t,e,n){var o=new l;if("function"==typeof t.item&&"number"==typeof t.length)for(var s=0,u=t.length;u>s;s++)o.add(i(t.item(s),e,n));else t&&o.add(r(t,e,n));return o}var o=n.Observable,s=(o.prototype,o.fromPromise),u=o.throwException,c=n.AnonymousObservable,a=n.AsyncSubject,h=n.Disposable.create,l=n.CompositeDisposable,f=n.Scheduler.immediate,p=n.Scheduler.timeout,d=Array.prototype.slice;o.start=function(t,e,n){return v(t,e,n)()};var v=o.toAsync=function(t,e,n){return e||(e=p),function(){var r=arguments,i=new a;return e.schedule(function(){var e;try{e=t.apply(n,r)}catch(o){return i.onError(o),undefined}i.onNext(e),i.onCompleted()}),i.asObservable()}};o.fromCallback=function(t,e,n,r){return e||(e=f),function(){var i=d.call(arguments,0);return new c(function(o){return e.schedule(function(){function e(t){var e=t;if(r)try{e=r(arguments)}catch(n){return o.onError(n),undefined}else 1===e.length&&(e=e[0]);o.onNext(e),o.onCompleted()}i.push(e),t.apply(n,i)})})}},o.fromNodeCallback=function(t,e,n,r){return e||(e=f),function(){var i=d.call(arguments,0);return new c(function(o){return e.schedule(function(){function e(t){if(t)return o.onError(t),undefined;var e=d.call(arguments,1);if(r)try{e=r(e)}catch(n){return o.onError(n),undefined}else 1===e.length&&(e=e[0]);o.onNext(e),o.onCompleted()}i.push(e),t.apply(n,i)})})}};var b=t.angular&&angular.element?angular.element:t.jQuery?t.jQuery:t.Zepto?t.Zepto:null,m=!!t.Ember&&"function"==typeof t.Ember.addListener;o.fromEvent=function(t,e,n){if(m)return y(function(n){Ember.addListener(t,e,n)},function(n){Ember.removeListener(t,e,n)},n);if(b){var r=b(t);return y(function(t){r.on(e,t)},function(t){r.off(e,t)},n)}return new c(function(r){return i(t,e,function(t){var e=t;if(n)try{e=n(arguments)}catch(i){return r.onError(i),undefined}r.onNext(e)})}).publish().refCount()};var y=o.fromEventPattern=function(t,e,n){return new c(function(r){function i(t){var e=t;if(n)try{e=n(arguments)}catch(i){return r.onError(i),undefined}r.onNext(e)}var o=t(i);return h(function(){e&&e(i,o)})}).publish().refCount()};return o.startAsync=function(t){var e;try{e=t()}catch(n){return u(n)}return s(e)},n});
1
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b,c){if(a.addListener)return a.addListener(b,c),k(function(){a.removeListener(b,c)});if(a.addEventListener)return a.addEventListener(b,c,!1),k(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function e(a,b,c){var f=new l;if("function"==typeof a.item&&"number"==typeof a.length)for(var g=0,h=a.length;h>g;g++)f.add(e(a.item(g),b,c));else a&&f.add(d(a,b,c));return f}var f=c.Observable,g=(f.prototype,f.fromPromise),h=f.throwException,i=c.AnonymousObservable,j=c.AsyncSubject,k=c.Disposable.create,l=c.CompositeDisposable,m=(c.Scheduler.immediate,c.Scheduler.timeout),n=c.helpers.isScheduler,o=Array.prototype.slice;f.start=function(a,b,c){return p(a,b,c)()};var p=f.toAsync=function(a,b,c){return n(c)||(c=m),function(){var d=arguments,e=new j;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};f.fromCallback=function(a,b,c){return function(){var d=o.call(arguments,0);return new i(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)})}},f.fromNodeCallback=function(a,b,c){return function(){var d=o.call(arguments,0);return new i(function(e){function f(a){if(a)return void e.onError(a);var b=o.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)})}};var q=a.angular&&angular.element?angular.element:a.jQuery?a.jQuery:a.Zepto?a.Zepto:null,r=!!a.Ember&&"function"==typeof a.Ember.addListener;f.fromEvent=function(a,b,c){if(r)return s(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(q){var d=q(a);return s(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}return new i(function(d){return e(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var s=f.fromEventPattern=function(a,b,c){return new i(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return k(function(){b&&b(e,f)})}).publish().refCount()};return f.startAsync=function(a){var b;try{b=a()}catch(c){return h(c)}return g(b)},c});
@@ -1 +1 @@
1
- (function(t){var e={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=e[typeof window]&&window||this,r=e[typeof exports]&&exports&&!exports.nodeType&&exports,i=e[typeof module]&&module&&!module.nodeType&&module,o=(i&&i.exports===r&&r,e[typeof global]&&global);!o||o.global!==o&&o.window!==o||(n=o),"function"==typeof define&&define.amd?define(["rx","exports"],function(e,r){return n.Rx=t(n,r,e),n.Rx}):"object"==typeof module&&module&&module.exports===r?module.exports=t(n,module.exports,require("./rx")):n.Rx=t(n,{},n.Rx)}).call(this,function(t,e,n){function r(){if(this.isDisposed)throw Error(b)}function i(t,e,n){return new u(function(r){function i(t,e){h[e]=t;var i;if(s[e]=!0,u||(u=s.every(v))){try{i=n.apply(null,h)}catch(o){return r.onError(o),undefined}r.onNext(i)}else a&&r.onCompleted()}var o=2,s=[!1,!1],u=!1,a=!1,h=Array(o);return new c(t.subscribe(function(t){i(t,0)},r.onError.bind(r),function(){a=!0,r.onCompleted()}),e.subscribe(function(t){i(t,1)},r.onError.bind(r)))})}var o=n.Observable,s=o.prototype,u=n.AnonymousObservable,c=n.CompositeDisposable,a=n.Subject,h=n.Observer,l=n.Disposable.empty,f=n.Disposable.create,p=n.internals.inherits,d=n.internals.addProperties,v=(n.Scheduler.timeout,n.helpers.identity),b="Object has been disposed",m=function(t){function e(t){var e=this.source.publish(),n=e.subscribe(t),r=l,i=this.subject.distinctUntilChanged().subscribe(function(t){t?r=e.connect():(r.dispose(),r=l)});return new c(n,r,i)}function n(n,r){this.source=n,this.subject=r||new a,this.isPaused=!0,t.call(this,e)}return p(n,t),n.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},n.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},n}(o);s.pausable=function(t){return new m(this,t)};var y=function(t){function e(t){var e=[],n=!0,r=i(this.source,this.subject.distinctUntilChanged(),function(t,e){return{data:t,shouldFire:e}}).subscribe(function(r){if(r.shouldFire&&n&&t.onNext(r.data),r.shouldFire&&!n){for(;e.length>0;)t.onNext(e.shift());n=!0}else r.shouldFire||n?!r.shouldFire&&n&&(n=!1):e.push(r.data)},function(n){for(;e.length>0;)t.onNext(e.shift());t.onError(n)},function(){for(;e.length>0;)t.onNext(e.shift());t.onCompleted()});return this.subject.onNext(!1),r}function n(n,r){this.source=n,this.subject=r||new a,this.isPaused=!0,t.call(this,e)}return p(n,t),n.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},n.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},n}(o);s.pausableBuffered=function(t){return new y(this,t)},s.controlled=function(t){return null==t&&(t=!0),new w(this,t)};var w=function(t){function e(t){return this.source.subscribe(t)}function n(n,r){t.call(this,e),this.subject=new g(r),this.source=n.multicast(this.subject).refCount()}return p(n,t),n.prototype.request=function(t){return null==t&&(t=-1),this.subject.request(t)},n}(o),g=n.ControlledSubject=function(t){function e(t){return this.subject.subscribe(t)}function n(n){null==n&&(n=!0),t.call(this,e),this.subject=new a,this.enableQueue=n,this.queue=n?[]:null,this.requestedCount=0,this.requestedDisposable=l,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=l}return p(n,t),d(n.prototype,h,{onCompleted:function(){r.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(t){r.call(this),this.hasFailed=!0,this.error=t,this.enableQueue&&0!==this.queue.length||this.subject.onError(t)},onNext:function(t){r.call(this);var e=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(t):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),e=!0),e&&this.subject.onNext(t)},_processRequest:function(t){if(this.enableQueue){for(;this.queue.length>=t&&t>0;)this.subject.onNext(this.queue.shift()),t--;return 0!==this.queue.length?{numberOfItems:t,returnValue:!0}:{numberOfItems:t,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=l):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=l),{numberOfItems:t,returnValue:!1}},request:function(t){r.call(this),this.disposeCurrentRequest();var e=this,n=this._processRequest(t);return t=n.numberOfItems,n.returnValue?l:(this.requestedCount=t,this.requestedDisposable=f(function(){e.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=l},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),n}(o);return n});
1
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(){if(this.isDisposed)throw new Error(q)}function e(a,b,c){return new h(function(d){function e(a,b){k[b]=a;var e;if(g[b]=!0,h||(h=g.every(p))){try{e=c.apply(null,k)}catch(f){return void d.onError(f)}d.onNext(e)}else j&&d.onCompleted()}var f=2,g=[!1,!1],h=!1,j=!1,k=new Array(f);return new i(a.subscribe(function(a){e(a,0)},d.onError.bind(d),function(){j=!0,d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d)))})}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=c.CompositeDisposable,j=c.Subject,k=c.Observer,l=c.Disposable.empty,m=c.Disposable.create,n=c.internals.inherits,o=c.internals.addProperties,p=(c.Scheduler.timeout,c.helpers.identity),q="Object has been disposed",r=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=l,e=this.subject.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=l)});return new i(c,d,e)}function c(c,d){this.source=c,this.subject=d||new j,this.isPaused=!0,a.call(this,b)}return n(c,a),c.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},c.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},c}(f);g.pausable=function(a){return new r(this,a)};var s=function(a){function b(a){var b=[],c=!0,d=e(this.source,this.subject.distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(d){if(d.shouldFire&&c&&a.onNext(d.data),d.shouldFire&&!c){for(;b.length>0;)a.onNext(b.shift());c=!0}else d.shouldFire||c?!d.shouldFire&&c&&(c=!1):b.push(d.data)},function(c){for(;b.length>0;)a.onNext(b.shift());a.onError(c)},function(){for(;b.length>0;)a.onNext(b.shift());a.onCompleted()});return this.subject.onNext(!1),d}function c(c,d){this.source=c,this.subject=d||new j,this.isPaused=!0,a.call(this,b)}return n(c,a),c.prototype.pause=function(){this.isPaused!==!0&&(this.isPaused=!0,this.subject.onNext(!1))},c.prototype.resume=function(){this.isPaused!==!1&&(this.isPaused=!1,this.subject.onNext(!0))},c}(f);g.pausableBuffered=function(a){return new s(this,a)},g.controlled=function(a){return null==a&&(a=!0),new t(this,a)};var t=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new u(d),this.source=c.multicast(this.subject).refCount()}return n(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(f),u=c.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 j,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=l,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=l}return n(c,a),o(c.prototype,k,{onCompleted:function(){d.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){d.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){d.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=l):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=l),{numberOfItems:a,returnValue:!1}},request:function(a){d.call(this),this.disposeCurrentRequest();var b=this,c=this._processRequest(a);return a=c.numberOfItems,c.returnValue?l:(this.requestedCount=a,this.requestedDisposable=m(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=l},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),c}(f);return c});
@@ -192,24 +192,24 @@
192
192
  }, selector);
193
193
  };
194
194
 
195
- /**
196
- * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
197
- * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
198
- *
199
- * @example
200
- * var res = source.replayWhileObserved(3);
201
- * var res = source.replayWhileObserved(3, 500);
202
- * var res = source.replayWhileObserved(3, 500, scheduler);
203
- *
204
-
205
- * @param bufferSize [Optional] Maximum element count of the replay buffer.
206
- * @param window [Optional] Maximum time length of the replay buffer.
207
- * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
208
- * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
209
- */
210
- observableProto.replayWhileObserved = function (bufferSize, window, scheduler) {
211
- return this.replay(null, bufferSize, window, scheduler).refCount();
212
- };
195
+ /**
196
+ * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
197
+ * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
198
+ *
199
+ * @example
200
+ * var res = source.shareReplay(3);
201
+ * var res = source.shareReplay(3, 500);
202
+ * var res = source.shareReplay(3, 500, scheduler);
203
+ *
204
+
205
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
206
+ * @param window [Optional] Maximum time length of the replay buffer.
207
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
208
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
209
+ */
210
+ observableProto.shareReplay = function (bufferSize, window, scheduler) {
211
+ return this.replay(null, bufferSize, window, scheduler).refCount();
212
+ };
213
213
 
214
214
  /** @private */
215
215
  var InnerSubscription = function (subject, observer) {
@@ -1 +1 @@
1
- (function(t){var e={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=e[typeof window]&&window||this,r=e[typeof exports]&&exports&&!exports.nodeType&&exports,i=e[typeof module]&&module&&!module.nodeType&&module,o=(i&&i.exports===r&&r,e[typeof global]&&global);!o||o.global!==o&&o.window!==o||(n=o),"function"==typeof define&&define.amd?define(["rx","exports"],function(e,r){return n.Rx=t(n,r,e),n.Rx}):"object"==typeof module&&module&&module.exports===r?module.exports=t(n,module.exports,require("./rx")):n.Rx=t(n,{},n.Rx)}).call(this,function(t,e,n){function r(){if(this.isDisposed)throw Error(m)}var i=n.Observable,o=i.prototype,s=n.AnonymousObservable,u=n.Subject,c=n.AsyncSubject,a=n.Observer,h=n.internals.ScheduledObserver,l=n.Disposable.create,f=n.Disposable.empty,p=n.CompositeDisposable,d=n.Scheduler.currentThread,v=n.internals.inherits,b=n.internals.addProperties,m="Object has been disposed";o.multicast=function(t,e){var n=this;return"function"==typeof t?new s(function(r){var i=n.multicast(t());return new p(e(i).subscribe(r),i.connect())}):new E(n,t)},o.publish=function(t){return t?this.multicast(function(){return new u},t):this.multicast(new u)},o.share=function(){return this.publish(null).refCount()},o.publishLast=function(t){return t?this.multicast(function(){return new c},t):this.multicast(new c)},o.publishValue=function(t,e){return 2===arguments.length?this.multicast(function(){return new w(e)},t):this.multicast(new w(t))},o.shareValue=function(t){return this.publishValue(t).refCount()},o.replay=function(t,e,n,r){return t?this.multicast(function(){return new g(e,n,r)},t):this.multicast(new g(e,n,r))},o.replayWhileObserved=function(t,e,n){return this.replay(null,t,e,n).refCount()};var y=function(t,e){this.subject=t,this.observer=e};y.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var t=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(t,1),this.observer=null}};var w=n.BehaviorSubject=function(t){function e(t){if(r.call(this),!this.isStopped)return this.observers.push(t),t.onNext(this.value),new y(this,t);var e=this.exception;return e?t.onError(e):t.onCompleted(),f}function n(n){t.call(this,e),this.value=n,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return v(n,t),b(n.prototype,a,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(r.call(this),!this.isStopped){var t=this.observers.slice(0);this.isStopped=!0;for(var e=0,n=t.length;n>e;e++)t[e].onCompleted();this.observers=[]}},onError:function(t){if(r.call(this),!this.isStopped){var e=this.observers.slice(0);this.isStopped=!0,this.exception=t;for(var n=0,i=e.length;i>n;n++)e[n].onError(t);this.observers=[]}},onNext:function(t){if(r.call(this),!this.isStopped){this.value=t;for(var e=this.observers.slice(0),n=0,i=e.length;i>n;n++)e[n].onNext(t)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),n}(i),g=n.ReplaySubject=function(t){function e(t,e){this.subject=t,this.observer=e}function n(t){var n=new h(this.scheduler,t),i=new e(this,n);r.call(this),this._trim(this.scheduler.now()),this.observers.push(n);for(var o=this.q.length,s=0,u=this.q.length;u>s;s++)n.onNext(this.q[s].value);return this.hasError?(o++,n.onError(this.error)):this.isStopped&&(o++,n.onCompleted()),n.ensureActive(o),i}function i(e,r,i){this.bufferSize=null==e?Number.MAX_VALUE:e,this.windowSize=null==r?Number.MAX_VALUE:r,this.scheduler=i||d,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,t.call(this,n)}return e.prototype.dispose=function(){if(this.observer.dispose(),!this.subject.isDisposed){var t=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(t,1)}},v(i,t),b(i.prototype,a,{hasObservers:function(){return this.observers.length>0},_trim:function(t){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&t-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(t){var e;if(r.call(this),!this.isStopped){var n=this.scheduler.now();this.q.push({interval:n,value:t}),this._trim(n);for(var i=this.observers.slice(0),o=0,s=i.length;s>o;o++)e=i[o],e.onNext(t),e.ensureActive()}},onError:function(t){var e;if(r.call(this),!this.isStopped){this.isStopped=!0,this.error=t,this.hasError=!0;var n=this.scheduler.now();this._trim(n);for(var i=this.observers.slice(0),o=0,s=i.length;s>o;o++)e=i[o],e.onError(t),e.ensureActive();this.observers=[]}},onCompleted:function(){var t;if(r.call(this),!this.isStopped){this.isStopped=!0;var e=this.scheduler.now();this._trim(e);for(var n=this.observers.slice(0),i=0,o=n.length;o>i;i++)t=n[i],t.onCompleted(),t.ensureActive();this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),i}(i),E=n.ConnectableObservable=function(t){function e(e,n){function r(t){return i.subject.subscribe(t)}var i={subject:n,source:e.asObservable(),hasSubscription:!1,subscription:null};this.connect=function(){return i.hasSubscription||(i.hasSubscription=!0,i.subscription=new p(i.source.subscribe(i.subject),l(function(){i.hasSubscription=!1}))),i.subscription},t.call(this,r)}return v(e,t),e.prototype.connect=function(){return this.connect()},e.prototype.refCount=function(){var t=null,e=0,n=this;return new s(function(r){var i,o;return e++,i=1===e,o=n.subscribe(r),i&&(t=n.connect()),l(function(){o.dispose(),e--,0===e&&t.dispose()})})},e}(i);return n});
1
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(){if(this.isDisposed)throw new Error(r)}var e=c.Observable,f=e.prototype,g=c.AnonymousObservable,h=c.Subject,i=c.AsyncSubject,j=c.Observer,k=c.internals.ScheduledObserver,l=c.Disposable.create,m=c.Disposable.empty,n=c.CompositeDisposable,o=c.Scheduler.currentThread,p=c.internals.inherits,q=c.internals.addProperties,r="Object has been disposed";f.multicast=function(a,b){var c=this;return"function"==typeof a?new g(function(d){var e=c.multicast(a());return new n(b(e).subscribe(d),e.connect())}):new v(c,a)},f.publish=function(a){return a?this.multicast(function(){return new h},a):this.multicast(new h)},f.share=function(){return this.publish(null).refCount()},f.publishLast=function(a){return a?this.multicast(function(){return new i},a):this.multicast(new i)},f.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new t(b)},a):this.multicast(new t(a))},f.shareValue=function(a){return this.publishValue(a).refCount()},f.replay=function(a,b,c,d){return a?this.multicast(function(){return new u(b,c,d)},a):this.multicast(new u(b,c,d))},f.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var s=function(a,b){this.subject=a,this.observer=b};s.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 t=c.BehaviorSubject=function(a){function b(a){if(d.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new s(this,a);var b=this.exception;return b?a.onError(b):a.onCompleted(),m}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return p(c,a),q(c.prototype,j,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(d.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(d.call(this),!this.isStopped){var b=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var c=0,e=b.length;e>c;c++)b[c].onError(a);this.observers=[]}},onNext:function(a){if(d.call(this),!this.isStopped){this.value=a;for(var b=this.observers.slice(0),c=0,e=b.length;e>c;c++)b[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(e),u=c.ReplaySubject=function(a){function b(a,b){this.subject=a,this.observer=b}function c(a){var c=new k(this.scheduler,a),e=new b(this,c);d.call(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)c.onNext(this.q[g].value);return this.hasError?(f++,c.onError(this.error)):this.isStopped&&(f++,c.onCompleted()),c.ensureActive(f),e}function e(b,d,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==d?Number.MAX_VALUE:d,this.scheduler=e||o,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)}},p(e,a),q(e.prototype,j,{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(d.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)b=e[f],b.onNext(a),b.ensureActive()}},onError:function(a){var b;if(d.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var e=this.observers.slice(0),f=0,g=e.length;g>f;f++)b=e[f],b.onError(a),b.ensureActive();this.observers=[]}},onCompleted:function(){var a;if(d.call(this),!this.isStopped){this.isStopped=!0;var b=this.scheduler.now();this._trim(b);for(var c=this.observers.slice(0),e=0,f=c.length;f>e;e++)a=c[e],a.onCompleted(),a.ensureActive();this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(e),v=c.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 n(e.source.subscribe(e.subject),l(function(){e.hasSubscription=!1}))),e.subscription},a.call(this,d)}return p(b,a),b.prototype.connect=function(){return this.connect()},b.prototype.refCount=function(){var a=null,b=0,c=this;return new g(function(d){var e,f;return b++,e=1===b,f=c.subscribe(d),e&&(a=c.connect()),l(function(){f.dispose(),b--,0===b&&a.dispose()})})},b}(e);return c});
@@ -1 +1 @@
1
- (function(t){var e={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},n=e[typeof window]&&window||this,r=e[typeof exports]&&exports&&!exports.nodeType&&exports,i=e[typeof module]&&module&&!module.nodeType&&module,o=(i&&i.exports===r&&r,e[typeof global]&&global);!o||o.global!==o&&o.window!==o||(n=o),"function"==typeof define&&define.amd?define(["rx","exports"],function(e,r){return n.Rx=t(n,r,e),n.Rx}):"object"==typeof module&&module&&module.exports===r?module.exports=t(n,module.exports,require("./rx")):n.Rx=t(n,{},n.Rx)}).call(this,function(t,e,n,r){function i(t){if(false&t)return 2===t;for(var e=Math.sqrt(t),n=3;e>=n;){if(0===t%n)return!1;n+=2}return!0}function o(t){var e,n,r;for(e=0;D.length>e;++e)if(n=D[e],n>=t)return n;for(r=1|t;D[D.length-1]>r;){if(i(r))return r;r+=2}return t}function s(t){var e=757602046;if(!t.length)return e;for(var n=0,r=t.length;r>n;n++){var i=t.charCodeAt(n);e=(e<<5)-e+i,e&=e}return e}function u(t){var e=668265261;return t=61^t^t>>>16,t+=t<<3,t^=t>>>4,t*=e,t^=t>>>15}function c(){return{key:null,value:null,next:0,hashCode:0}}function a(t,e){return t.groupJoin(this,e,function(){return w()},function(t,e){return e})}function h(t){var e=this;return new g(function(n){var r=new m,i=new p,o=new d(i);return n.onNext(E(r,o)),i.add(e.subscribe(function(t){r.onNext(t)},function(t){r.onError(t),n.onError(t)},function(){r.onCompleted(),n.onCompleted()})),i.add(t.subscribe(function(){r.onCompleted(),r=new m,n.onNext(E(r,o))},function(t){r.onError(t),n.onError(t)},function(){r.onCompleted(),n.onCompleted()})),o})}function l(t){var e=this;return new g(function(n){var i,o=new b,s=new p(o),u=new d(s),c=new m;return n.onNext(E(c,u)),s.add(e.subscribe(function(t){c.onNext(t)},function(t){c.onError(t),n.onError(t)},function(){c.onCompleted(),n.onCompleted()})),i=function(){var e,s;try{s=t()}catch(a){return n.onError(a),r}e=new v,o.setDisposable(e),e.setDisposable(s.take(1).subscribe(C,function(t){c.onError(t),n.onError(t)},function(){c.onCompleted(),c=new m,n.onNext(E(c,u)),i()}))},i(),u})}var f=n.Observable,p=n.CompositeDisposable,d=n.RefCountDisposable,v=n.SingleAssignmentDisposable,b=n.SerialDisposable,m=n.Subject,y=f.prototype,w=f.empty,g=n.AnonymousObservable,E=(n.Observer.create,n.internals.addRef),x=n.internals.isEqual,C=n.helpers.noop,D=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],S="no such key",N="duplicate key",A=function(){var t=0;return function(e){if(null==e)throw Error(S);if("string"==typeof e)return s(e);if("number"==typeof e)return u(e);if("boolean"==typeof e)return e===!0?1:0;if(e instanceof Date)return e.getTime();if(e.getHashCode)return e.getHashCode();var n=17*t++;return e.getHashCode=function(){return n},n}}(),_=function(t,e){if(0>t)throw Error("out of range");t>0&&this._initialize(t),this.comparer=e||x,this.freeCount=0,this.size=0,this.freeList=-1};return _.prototype._initialize=function(t){var e,n=o(t);for(this.buckets=Array(n),this.entries=Array(n),e=0;n>e;e++)this.buckets[e]=-1,this.entries[e]=c();this.freeList=-1},_.prototype.count=function(){return this.size},_.prototype.add=function(t,e){return this._insert(t,e,!0)},_.prototype._insert=function(t,e,n){this.buckets||this._initialize(0);for(var i,o=2147483647&A(t),s=o%this.buckets.length,u=this.buckets[s];u>=0;u=this.entries[u].next)if(this.entries[u].hashCode===o&&this.comparer(this.entries[u].key,t)){if(n)throw Error(N);return this.entries[u].value=e,r}this.freeCount>0?(i=this.freeList,this.freeList=this.entries[i].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),s=o%this.buckets.length),i=this.size,++this.size),this.entries[i].hashCode=o,this.entries[i].next=this.buckets[s],this.entries[i].key=t,this.entries[i].value=e,this.buckets[s]=i},_.prototype._resize=function(){var t=o(2*this.size),e=Array(t);for(r=0;e.length>r;++r)e[r]=-1;var n=Array(t);for(r=0;this.size>r;++r)n[r]=this.entries[r];for(var r=this.size;t>r;++r)n[r]=c();for(var i=0;this.size>i;++i){var s=n[i].hashCode%t;n[i].next=e[s],e[s]=i}this.buckets=e,this.entries=n},_.prototype.remove=function(t){if(this.buckets)for(var e=2147483647&A(t),n=e%this.buckets.length,r=-1,i=this.buckets[n];i>=0;i=this.entries[i].next){if(this.entries[i].hashCode===e&&this.comparer(this.entries[i].key,t))return 0>r?this.buckets[n]=this.entries[i].next:this.entries[r].next=this.entries[i].next,this.entries[i].hashCode=-1,this.entries[i].next=this.freeList,this.entries[i].key=null,this.entries[i].value=null,this.freeList=i,++this.freeCount,!0;r=i}return!1},_.prototype.clear=function(){var t,e;if(!(0>=this.size)){for(t=0,e=this.buckets.length;e>t;++t)this.buckets[t]=-1;for(t=0;this.size>t;++t)this.entries[t]=c();this.freeList=-1,this.size=0}},_.prototype._findEntry=function(t){if(this.buckets)for(var e=2147483647&A(t),n=this.buckets[e%this.buckets.length];n>=0;n=this.entries[n].next)if(this.entries[n].hashCode===e&&this.comparer(this.entries[n].key,t))return n;return-1},_.prototype.count=function(){return this.size-this.freeCount},_.prototype.tryGetValue=function(t){var e=this._findEntry(t);return e>=0?this.entries[e].value:r},_.prototype.getValues=function(){var t=0,e=[];if(this.entries)for(var n=0;this.size>n;n++)this.entries[n].hashCode>=0&&(e[t++]=this.entries[n].value);return e},_.prototype.get=function(t){var e=this._findEntry(t);if(e>=0)return this.entries[e].value;throw Error(S)},_.prototype.set=function(t,e){this._insert(t,e,!1)},_.prototype.containskey=function(t){return this._findEntry(t)>=0},y.join=function(t,e,n,i){var o=this;return new g(function(s){var u=new p,c=!1,a=0,h=new _,l=!1,f=0,d=new _;return u.add(o.subscribe(function(t){var n,o,l,f,p=a++,b=new v;h.add(p,t),u.add(b),o=function(){return h.remove(p)&&0===h.count()&&c&&s.onCompleted(),u.remove(b)};try{n=e(t)}catch(m){return s.onError(m),r}b.setDisposable(n.take(1).subscribe(C,s.onError.bind(s),function(){o()})),f=d.getValues();for(var y=0;f.length>y;y++){try{l=i(t,f[y])}catch(w){return s.onError(w),r}s.onNext(l)}},s.onError.bind(s),function(){c=!0,(l||0===h.count())&&s.onCompleted()})),u.add(t.subscribe(function(t){var e,o,c,a,p=f++,b=new v;d.add(p,t),u.add(b),o=function(){return d.remove(p)&&0===d.count()&&l&&s.onCompleted(),u.remove(b)};try{e=n(t)}catch(m){return s.onError(m),r}b.setDisposable(e.take(1).subscribe(C,s.onError.bind(s),function(){o()})),a=h.getValues();for(var y=0;a.length>y;y++){try{c=i(a[y],t)}catch(m){return s.onError(m),r}s.onNext(c)}},s.onError.bind(s),function(){l=!0,(c||0===d.count())&&s.onCompleted()})),u})},y.groupJoin=function(t,e,n,i){var o=this;return new g(function(s){var u=function(){},c=new p,a=new d(c),h=new _,l=new _,f=0,b=0;return c.add(o.subscribe(function(t){var n=new m,o=f++;h.add(o,n);var p,d,b,y,w;try{w=i(t,E(n,a))}catch(g){for(b=h.getValues(),p=0,d=b.length;d>p;p++)b[p].onError(g);return s.onError(g),r}for(s.onNext(w),y=l.getValues(),p=0,d=y.length;d>p;p++)n.onNext(y[p]);var x=new v;c.add(x);var C,D=function(){h.remove(o)&&n.onCompleted(),c.remove(x)};try{C=e(t)}catch(g){for(b=h.getValues(),p=0,d=h.length;d>p;p++)b[p].onError(g);return s.onError(g),r}x.setDisposable(C.take(1).subscribe(u,function(t){for(b=h.getValues(),p=0,d=b.length;d>p;p++)b[p].onError(t);s.onError(t)},D))},function(t){for(var e=h.getValues(),n=0,r=e.length;r>n;n++)e[n].onError(t);s.onError(t)},s.onCompleted.bind(s))),c.add(t.subscribe(function(t){var e,i,o,a=b++;l.add(a,t);var f=new v;c.add(f);var p,d=function(){l.remove(a),c.remove(f)};try{p=n(t)}catch(m){for(e=h.getValues(),i=0,o=h.length;o>i;i++)e[i].onError(m);return s.onError(m),r}for(f.setDisposable(p.take(1).subscribe(u,function(t){for(e=h.getValues(),i=0,o=h.length;o>i;i++)e[i].onError(t);s.onError(t)},d)),e=h.getValues(),i=0,o=e.length;o>i;i++)e[i].onNext(t)},function(t){for(var e=h.getValues(),n=0,r=e.length;r>n;n++)e[n].onError(t);s.onError(t)})),a})},y.buffer=function(){return this.window.apply(this,arguments).selectMany(function(t){return t.toArray()})},y.window=function(t,e){return 1===arguments.length&&"function"!=typeof arguments[0]?h.call(this,t):"function"==typeof t?l.call(this,t):a.call(this,t,e)},y.pairwise=function(){var t=this;return new g(function(e){var n,r=!1;return t.subscribe(function(t){r?e.onNext([n,t]):r=!0,n=t},e.onError.bind(e),e.onCompleted.bind(e))})},y.partition=function(t,e){var n=this.publish().refCount();return[n.filter(t,e),n.filter(function(n,r,i){return!t.call(e,n,r,i)})]},n});
1
+ (function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a){if(a&!1)return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function f(a){var b,c,d;for(b=0;b<y.length;++b)if(c=y[b],c>=a)return c;for(d=1|a;d<y[y.length-1];){if(e(d))return d;d+=2}return a}function g(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function h(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function i(){return{key:null,value:null,next:0,hashCode:0}}function j(a,b){return a.groupJoin(this,b,function(){return t()},function(a,b){return b})}function k(a){var b=this;return new u(function(c){var d=new r,e=new n,f=new o(e);return c.onNext(v(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),e.add(a.subscribe(function(){d.onCompleted(),d=new r,c.onNext(v(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f})}function l(a){var b=this;return new u(function(c){var d,e=new q,f=new n(e),g=new o(f),h=new r;return c.onNext(v(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d=function(){var b,f;try{f=a()}catch(i){return void c.onError(i)}b=new p,e.setDisposable(b),b.setDisposable(f.take(1).subscribe(x,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new r,c.onNext(v(h,g)),d()}))},d(),g})}var m=c.Observable,n=c.CompositeDisposable,o=c.RefCountDisposable,p=c.SingleAssignmentDisposable,q=c.SerialDisposable,r=c.Subject,s=m.prototype,t=m.empty,u=c.AnonymousObservable,v=(c.Observer.create,c.internals.addRef),w=c.internals.isEqual,x=c.helpers.noop,y=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],z="no such key",A="duplicate key",B=function(){var a=0;return function(b){if(null==b)throw new Error(z);if("string"==typeof b)return g(b);if("number"==typeof b)return h(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return b.getTime();if(b.getHashCode)return b.getHashCode();var c=17*a++;return b.getHashCode=function(){return c},c}}(),C=function(a,b){if(0>a)throw new Error("out of range");a>0&&this._initialize(a),this.comparer=b||w,this.freeCount=0,this.size=0,this.freeList=-1};return C.prototype._initialize=function(a){var b,c=f(a);for(this.buckets=new Array(c),this.entries=new Array(c),b=0;c>b;b++)this.buckets[b]=-1,this.entries[b]=i();this.freeList=-1},C.prototype.count=function(){return this.size},C.prototype.add=function(a,b){return this._insert(a,b,!0)},C.prototype._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&B(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(A);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},C.prototype._resize=function(){var a=f(2*this.size),b=new Array(a);for(d=0;d<b.length;++d)b[d]=-1;var c=new Array(a);for(d=0;d<this.size;++d)c[d]=this.entries[d];for(var d=this.size;a>d;++d)c[d]=i();for(var e=0;e<this.size;++e){var g=c[e].hashCode%a;c[e].next=b[g],b[g]=e}this.buckets=b,this.entries=c},C.prototype.remove=function(a){if(this.buckets)for(var b=2147483647&B(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},C.prototype.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=i();this.freeList=-1,this.size=0}},C.prototype._findEntry=function(a){if(this.buckets)for(var b=2147483647&B(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},C.prototype.count=function(){return this.size-this.freeCount},C.prototype.tryGetValue=function(a){var b=this._findEntry(a);return b>=0?this.entries[b].value:d},C.prototype.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},C.prototype.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(z)},C.prototype.set=function(a,b){this._insert(a,b,!1)},C.prototype.containskey=function(a){return this._findEntry(a)>=0},s.join=function(a,b,c,d){var e=this;return new u(function(f){var g=new n,h=!1,i=0,j=new C,k=!1,l=0,m=new C;return g.add(e.subscribe(function(a){var c,e,k,l,n=i++,o=new p;j.add(n,a),g.add(o),e=function(){return j.remove(n)&&0===j.count()&&h&&f.onCompleted(),g.remove(o)};try{c=b(a)}catch(q){return void f.onError(q)}o.setDisposable(c.take(1).subscribe(x,f.onError.bind(f),function(){e()})),l=m.getValues();for(var r=0;r<l.length;r++){try{k=d(a,l[r])}catch(s){return void f.onError(s)}f.onNext(k)}},f.onError.bind(f),function(){h=!0,(k||0===j.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b,e,h,i,n=l++,o=new p;m.add(n,a),g.add(o),e=function(){return m.remove(n)&&0===m.count()&&k&&f.onCompleted(),g.remove(o)};try{b=c(a)}catch(q){return void f.onError(q)}o.setDisposable(b.take(1).subscribe(x,f.onError.bind(f),function(){e()})),i=j.getValues();for(var r=0;r<i.length;r++){try{h=d(i[r],a)}catch(q){return void f.onError(q)}f.onNext(h)}},f.onError.bind(f),function(){k=!0,(h||0===m.count())&&f.onCompleted()})),g})},s.groupJoin=function(a,b,c,d){var e=this;return new u(function(f){var g=function(){},h=new n,i=new o(h),j=new C,k=new C,l=0,m=0;return h.add(e.subscribe(function(a){var c=new r,e=l++;j.add(e,c);var m,n,o,q,s;try{s=d(a,v(c,i))}catch(t){for(o=j.getValues(),m=0,n=o.length;n>m;m++)o[m].onError(t);return void f.onError(t)}for(f.onNext(s),q=k.getValues(),m=0,n=q.length;n>m;m++)c.onNext(q[m]);var u=new p;h.add(u);var w,x=function(){j.remove(e)&&c.onCompleted(),h.remove(u)};try{w=b(a)}catch(t){for(o=j.getValues(),m=0,n=j.length;n>m;m++)o[m].onError(t);return void f.onError(t)}u.setDisposable(w.take(1).subscribe(g,function(a){for(o=j.getValues(),m=0,n=o.length;n>m;m++)o[m].onError(a);f.onError(a)},x))},function(a){for(var b=j.getValues(),c=0,d=b.length;d>c;c++)b[c].onError(a);f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b,d,e,i=m++;k.add(i,a);var l=new p;h.add(l);var n,o=function(){k.remove(i),h.remove(l)};try{n=c(a)}catch(q){for(b=j.getValues(),d=0,e=j.length;e>d;d++)b[d].onError(q);return void f.onError(q)}for(l.setDisposable(n.take(1).subscribe(g,function(a){for(b=j.getValues(),d=0,e=j.length;e>d;d++)b[d].onError(a);f.onError(a)},o)),b=j.getValues(),d=0,e=b.length;e>d;d++)b[d].onNext(a)},function(a){for(var b=j.getValues(),c=0,d=b.length;d>c;c++)b[c].onError(a);f.onError(a)})),i})},s.buffer=function(){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},s.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?k.call(this,a):"function"==typeof a?l.call(this,a):j.call(this,a,b)},s.pairwise=function(){var a=this;return new u(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))})},s.partition=function(a,b){var c=this.publish().refCount();return[c.filter(a,b),c.filter(function(c,d,e){return!a.call(b,c,d,e)})]},c});