-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRx.min.js
294 lines (292 loc) · 138 KB
/
Rx.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/**
@license
Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt
**/
/*
*****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
*****************************************************************************/
(function(t,k){"object"===typeof exports&&"undefined"!==typeof module?k(exports):"function"===typeof define&&define.amd?define(["exports"],k):k(t.Rx=t.Rx||{})})(this,function(t){function k(b,a){function c(){this.constructor=b}ob(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function N(b){return"function"===typeof b}function pb(){try{return la.apply(this,arguments)}catch(b){return m.e=b,m}}function r(b){la=b;return pb}function ma(b){return b.reduce(function(a,c){return a.concat(c instanceof
O?c.errors:c)},[])}function na(b){var a=b.subject;a.next(b.value);a.complete()}function qb(b){b.subject.error(b.err)}function rb(b){var a=this,c=b.source,e=b.subscriber;b=b.context;var d=c.callbackFunc,f=c.args,h=c.scheduler,g=c.subject;if(!g){var g=c.subject=new L,k=function sb(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=sb.source,b=e.selector,e=e.subject,d=c.shift();d?a.add(h.schedule(da,0,{err:d,subject:e})):b?(c=r(b).apply(this,c),c===m?a.add(h.schedule(da,0,{err:m.e,subject:e})):
a.add(h.schedule(oa,0,{value:c,subject:e}))):a.add(h.schedule(oa,0,{value:1>=c.length?c[0]:c,subject:e}))};k.source=c;r(d).apply(b,f.concat(k))===m&&a.add(h.schedule(da,0,{err:m.e,subject:g}))}a.add(g.subscribe(e))}function oa(b){var a=b.subject;a.next(b.value);a.complete()}function da(b){b.subject.error(b.err)}function z(b){return b&&"function"===typeof b.schedule}function pa(b){return b&&"function"!==typeof b.subscribe&&"function"===typeof b.then}function p(b,a,c,e){var d=new qa(b,c,e);if(d.closed)return null;
if(a instanceof g)if(a._isScalar)d.next(a.value),d.complete();else return a.subscribe(d);else if(a&&"number"===typeof a.length){b=0;for(c=a.length;b<c&&!d.closed;b++)d.next(a[b]);d.closed||d.complete()}else{if(pa(a))return a.then(function(c){d.closed||(d.next(c),d.complete())},function(c){return d.error(c)}).then(null,function(c){n.setTimeout(function(){throw c;})}),d;if(a&&"function"===typeof a[A]){a=a[A]();do{b=a.next();if(b.done){d.complete();break}d.next(b.value);if(d.closed)break}while(1)}else if(a&&
"function"===typeof a[I])if(a=a[I](),"function"!==typeof a.subscribe)d.error(new TypeError("Provided object does not correctly implement Symbol.observable"));else return a.subscribe(new qa(b,c,e));else d.error(new TypeError("You provided "+(null!=a&&"object"===typeof a?"an invalid object":"'"+a+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable."))}return null}function P(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=null;z(b[b.length-1])&&
(a=b.pop());return null===a&&1===b.length&&b[0]instanceof g?b[0]:(new E(b,a)).lift(new W(1))}function ra(b){var a=b.value;b=b.subscriber;b.closed||(b.next(a),b.complete())}function ub(b){var a=b.err;b=b.subscriber;b.closed||b.error(a)}function Q(b){return!D(b)&&0<=b-parseFloat(b)+1}function sa(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var a=Number.POSITIVE_INFINITY,c=null,e=b[b.length-1];z(e)?(c=b.pop(),1<b.length&&"number"===typeof b[b.length-1]&&(a=b.pop())):"number"===typeof e&&
(a=b.pop());return null===c&&1===b.length&&b[0]instanceof g?b[0]:(new E(b,c)).lift(new W(a))}function ta(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];if(1===b.length)if(D(b[0]))b=b[0];else return b[0];return(new E(b)).lift(new vb)}function wb(b){var a=b.obj,c=b.keys,e=b.index,d=b.subscriber;e===b.length?d.complete():(c=c[e],d.next([c,a[c]]),b.index=e+1,this.schedule(b))}function X(b){return b instanceof Date&&!isNaN(+b)}function ua(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=
arguments[a];a=b[b.length-1];"function"===typeof a&&b.pop();return(new E(b)).lift(new va(a))}function wa(b,a){if("function"!==typeof b)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new xa(b,a))}function xb(b,a){void 0===a&&(a=null);return new J({method:"GET",url:b,headers:a})}function yb(b,a,c){return new J({method:"POST",url:b,body:a,headers:c})}function zb(b,a){return new J({method:"DELETE",url:b,headers:a})}function Ab(b,a,c){return new J({method:"PUT",
url:b,body:a,headers:c})}function Bb(b,a,c){return new J({method:"PATCH",url:b,body:a,headers:c})}function Cb(b,a){return(new J({method:"GET",url:b,responseType:"json",headers:a})).lift(new xa(function(c,a){return c.response},null))}function Db(b){for(var a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];for(var c=a.length,e=0;e<c;e++){var d=a[e],f;for(f in d)d.hasOwnProperty(f)&&(b[f]=d[f])}return b}function ya(b){var a=b.subscriber,c=b.context;c&&a.closeContext(c);a.closed||(b.context=a.openContext(),
b.context.closeAction=this.schedule(b,b.bufferTimeSpan))}function Eb(b){var a=b.bufferCreationInterval,c=b.bufferTimeSpan,e=b.subscriber,d=b.scheduler,f=e.openContext();e.closed||(e.add(f.closeAction=d.schedule(za,c,{subscriber:e,context:f})),this.schedule(b,a))}function za(b){b.subscriber.closeContext(b.context)}function Aa(b){b=new Fb(b);var a=this.lift(b);return b.caught=a}function Ba(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);"number"===typeof a&&(c=a,a=null);return this.lift(new Ca(b,a,
c))}function Da(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);"number"===typeof a&&(c=a,a=null);return this.lift(new Ea(b,a,c))}function Gb(b){b.debouncedNext()}function Hb(){return function(){function b(){this._values=[]}b.prototype.add=function(a){this.has(a)||this._values.push(a)};b.prototype.has=function(a){return-1!==this._values.indexOf(a)};Object.defineProperty(b.prototype,"size",{get:function(){return this._values.length},enumerable:!0,configurable:!0});b.prototype.clear=function(){this._values.length=
0};return b}()}function Fa(b,a){return this.lift(new Ib(b,a))}function Ga(b,a,c){return this.lift(new Jb(b,a,c))}function ea(b,a){return this.lift(new Kb(b,a))}function Ha(b){return this.lift(new Lb(b))}function Mb(b){b.clearThrottle()}function Ia(b){return b(this)}function G(b,a){var c;c="function"===typeof b?b:function(){return b};if("function"===typeof a)return this.lift(new Nb(c,a));a=Object.create(this,Ob);a.source=this;a.subjectFactory=c;return a}function Pb(b,a){function c(){return!c.pred.apply(c.thisArg,
arguments)}c.pred=b;c.thisArg=a;return c}function Qb(b,a){return function(c){var e=c;for(c=0;c<a;c++)if(e=e[b[c]],"undefined"===typeof e)return;return e}}function Rb(b){var a=b.period;b.subscriber.notifyNext();this.schedule(b,a)}function Sb(){return new v}function Ja(){return this.lift(new Tb)}function Ub(b){b.subscriber.clearThrottle()}function Vb(b){var a=b.subscriber,c=b.windowTimeSpan,e=b.window;e&&a.closeWindow(e);b.window=a.openWindow();this.schedule(b,c)}function Wb(b){var a=b.windowTimeSpan,
c=b.subscriber,e=b.scheduler,d=b.windowCreationInterval,f=c.openWindow(),h={action:this,subscription:null};h.subscription=e.schedule(Ka,a,{subscriber:c,window:f,context:h});this.add(h.subscription);this.schedule(b,d)}function Ka(b){var a=b.subscriber,c=b.window;(b=b.context)&&b.action&&b.subscription&&b.action.remove(b.subscription);a.closeWindow(c)}function La(b,a){for(var c=0,e=a.length;c<e;c++)for(var d=a[c],f=Object.getOwnPropertyNames(d.prototype),h=0,g=f.length;h<g;h++){var k=f[h];b.prototype[k]=
d.prototype[k]}}var ob=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c])},Xb="undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Yb="undefined"!==typeof global&&global,n="undefined"!==typeof window&&window||Yb||Xb;if(!n)throw Error("RxJS could not find any global context (window, self, global)");var D=Array.isArray||function(b){return b&&"number"===
typeof b.length},m={e:{}},la,O=function(b){function a(c){b.call(this);this.errors=c;c=Error.call(this,c?c.length+" errors occurred during unsubscription:\n "+c.map(function(c,a){return a+1+") "+c.toString()}).join("\n "):"");this.name=c.name="UnsubscriptionError";this.stack=c.stack;this.message=c.message}k(a,b);return a}(Error),u=function(){function b(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}b.prototype.unsubscribe=function(){var a=!1,c;if(!this.closed){var b=
this._parent,d=this._parents,f=this._unsubscribe,h=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var g=-1,k=d?d.length:0;b;)b.remove(this),b=++g<k&&d[g]||null;N(f)&&(b=r(f).call(this),b===m&&(a=!0,c=c||(m.e instanceof O?ma(m.e.errors):[m.e])));if(D(h))for(g=-1,k=h.length;++g<k;)b=h[g],null!=b&&"object"===typeof b&&(b=r(b.unsubscribe).call(b),b===m&&(a=!0,c=c||[],b=m.e,b instanceof O?c=c.concat(ma(b.errors)):c.push(b)));if(a)throw new O(c);}};b.prototype.add=
function(a){if(!a||a===b.EMPTY)return b.EMPTY;if(a===this)return this;var c=a;switch(typeof a){case "function":c=new b(a);case "object":if(c.closed||"function"!==typeof c.unsubscribe)return c;if(this.closed)return c.unsubscribe(),c;"function"!==typeof c._addParent&&(a=c,c=new b,c._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}(this._subscriptions||(this._subscriptions=[])).push(c);c._addParent(this);return c};b.prototype.remove=function(a){var c=
this._subscriptions;c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))};b.prototype._addParent=function(a){var c=this._parent,b=this._parents;c&&c!==a?b?-1===b.indexOf(a)&&b.push(a):this._parents=[a]:this._parent=a};b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),Y={closed:!0,next:function(b){},error:function(b){throw b;},complete:function(){}},fa=n.Symbol,R="function"===typeof fa&&"function"===typeof fa.for?fa.for("rxSubscriber"):"@@rxSubscriber",l=function(b){function a(c,e,d){b.call(this);
this.syncErrorValue=null;this.isStopped=this.syncErrorThrowable=this.syncErrorThrown=!1;switch(arguments.length){case 0:this.destination=Y;break;case 1:if(!c){this.destination=Y;break}if("object"===typeof c){c instanceof a?(this.destination=c,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new Ma(this,c));break}default:this.syncErrorThrowable=!0,this.destination=new Ma(this,c,e,d)}}k(a,b);a.prototype[R]=function(){return this};a.create=function(c,b,d){c=new a(c,b,d);c.syncErrorThrowable=
!1;return c};a.prototype.next=function(c){this.isStopped||this._next(c)};a.prototype.error=function(c){this.isStopped||(this.isStopped=!0,this._error(c))};a.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,b.prototype.unsubscribe.call(this))};a.prototype._next=function(c){this.destination.next(c)};a.prototype._error=function(c){this.destination.error(c);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();
this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var c=this._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped=this.closed=!1;this._parent=c;this._parents=a;return this};return a}(u),Ma=function(b){function a(c,a,d,f){b.call(this);this._parentSubscriber=c;var e;c=this;N(a)?e=a:a&&(e=a.next,d=a.error,f=a.complete,a!==Y&&(c=Object.create(a),N(c.unsubscribe)&&this.add(c.unsubscribe.bind(c)),c.unsubscribe=this.unsubscribe.bind(this)));this._context=
c;this._next=e;this._error=d;this._complete=f}k(a,b);a.prototype.next=function(c){if(!this.isStopped&&this._next){var a=this._parentSubscriber;a.syncErrorThrowable?this.__tryOrSetError(a,this._next,c)&&this.unsubscribe():this.__tryOrUnsub(this._next,c)}};a.prototype.error=function(c){if(!this.isStopped){var a=this._parentSubscriber;if(this._error)a.syncErrorThrowable?this.__tryOrSetError(a,this._error,c):this.__tryOrUnsub(this._error,c),this.unsubscribe();else if(a.syncErrorThrowable)a.syncErrorValue=
c,a.syncErrorThrown=!0,this.unsubscribe();else throw this.unsubscribe(),c;}};a.prototype.complete=function(){var c=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var b=function(){return c._complete.call(c._context)};a.syncErrorThrowable?this.__tryOrSetError(a,b):this.__tryOrUnsub(b)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(c,a){try{c.call(this._context,a)}catch(d){throw this.unsubscribe(),d;}};a.prototype.__tryOrSetError=function(c,a,b){try{a.call(this._context,
b)}catch(f){return c.syncErrorValue=f,c.syncErrorThrown=!0}return!1};a.prototype._unsubscribe=function(){var c=this._parentSubscriber;this._parentSubscriber=this._context=null;c.unsubscribe()};return a}(l),I=function(b){var a=b.Symbol;"function"===typeof a?a.observable?b=a.observable:(b=a("observable"),a.observable=b):b="@@observable";return b}(n),g=function(){function b(a){this._isScalar=!1;a&&(this._subscribe=a)}b.prototype.lift=function(a){var c=new b;c.source=this;c.operator=a;return c};b.prototype.subscribe=
function(a,c,b){var e=this.operator;a:{if(a){if(a instanceof l)break a;if(a[R]){a=a[R]();break a}}a=a||c||b?new l(a,c,b):new l(Y)}e?e.call(a,this.source):a.add(this.source?this._subscribe(a):this._trySubscribe(a));if(a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a};b.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(c){a.syncErrorThrown=!0,a.syncErrorValue=c,a.error(c)}};b.prototype.forEach=function(a,c){var b=this;c||(n.Rx&&
n.Rx.config&&n.Rx.config.Promise?c=n.Rx.config.Promise:n.Promise&&(c=n.Promise));if(!c)throw Error("no Promise impl found");return new c(function(c,e){var d;d=b.subscribe(function(c){if(d)try{a(c)}catch(C){e(C),d.unsubscribe()}else a(c)},e,c)})};b.prototype._subscribe=function(a){return this.source.subscribe(a)};b.prototype[I]=function(){return this};b.create=function(a){return new b(a)};return b}(),H=function(b){function a(){var c=b.call(this,"object unsubscribed");this.name=c.name="ObjectUnsubscribedError";
this.stack=c.stack;this.message=c.message}k(a,b);return a}(Error),Na=function(b){function a(c,a){b.call(this);this.subject=c;this.subscriber=a;this.closed=!1}k(a,b);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var c=this.subject,a=c.observers;this.subject=null;!a||0===a.length||c.isStopped||c.closed||(c=a.indexOf(this.subscriber),-1!==c&&a.splice(c,1))}};return a}(u),Oa=function(b){function a(c){b.call(this,c);this.destination=c}k(a,b);return a}(l),v=function(b){function a(){b.call(this);
this.observers=[];this.hasError=this.isStopped=this.closed=!1;this.thrownError=null}k(a,b);a.prototype[R]=function(){return new Oa(this)};a.prototype.lift=function(c){var a=new Z(this,this);a.operator=c;return a};a.prototype.next=function(c){if(this.closed)throw new H;if(!this.isStopped)for(var a=this.observers,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].next(c)};a.prototype.error=function(c){if(this.closed)throw new H;this.hasError=!0;this.thrownError=c;this.isStopped=!0;for(var a=this.observers,b=a.length,
a=a.slice(),f=0;f<b;f++)a[f].error(c);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new H;this.isStopped=!0;for(var c=this.observers,a=c.length,c=c.slice(),b=0;b<a;b++)c[b].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(c){if(this.closed)throw new H;return b.prototype._trySubscribe.call(this,c)};a.prototype._subscribe=function(c){if(this.closed)throw new H;
if(this.hasError)return c.error(this.thrownError),u.EMPTY;if(this.isStopped)return c.complete(),u.EMPTY;this.observers.push(c);return new Na(this,c)};a.prototype.asObservable=function(){var c=new g;c.source=this;return c};a.create=function(c,a){return new Z(c,a)};return a}(g),Z=function(b){function a(c,a){b.call(this);this.destination=c;this.source=a}k(a,b);a.prototype.next=function(c){var a=this.destination;a&&a.next&&a.next(c)};a.prototype.error=function(c){var a=this.destination;a&&a.error&&this.destination.error(c)};
a.prototype.complete=function(){var c=this.destination;c&&c.complete&&this.destination.complete()};a.prototype._subscribe=function(c){return this.source?this.source.subscribe(c):u.EMPTY};return a}(v),L=function(b){function a(){b.apply(this,arguments);this.value=null;this.hasCompleted=this.hasNext=!1}k(a,b);a.prototype._subscribe=function(c){return this.hasError?(c.error(this.thrownError),u.EMPTY):this.hasCompleted&&this.hasNext?(c.next(this.value),c.complete(),u.EMPTY):b.prototype._subscribe.call(this,
c)};a.prototype.next=function(c){this.hasCompleted||(this.value=c,this.hasNext=!0)};a.prototype.error=function(c){this.hasCompleted||b.prototype.error.call(this,c)};a.prototype.complete=function(){this.hasCompleted=!0;this.hasNext&&b.prototype.next.call(this,this.value);b.prototype.complete.call(this)};return a}(v),Zb=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);
return function(){for(var e=[],h=0;h<arguments.length;h++)e[h-0]=arguments[h];return new a(c,b,e,this,d)}};a.prototype._subscribe=function(c){var b=this.callbackFunc,d=this.args,f=this.scheduler,h=this.subject;if(f)return f.schedule(a.dispatch,0,{source:this,subscriber:c,context:this.context});h||(h=this.subject=new L,f=function C(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=C.source,a=b.selector,b=b.subject;a?(c=r(a).apply(this,c),c===m?b.error(m.e):(b.next(c),b.complete())):
(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,r(b).apply(this.context,d.concat(f))===m&&h.error(m.e));return h.subscribe(c)};a.dispatch=function(c){var a=this,b=c.source,f=c.subscriber;c=c.context;var h=b.callbackFunc,g=b.args,k=b.scheduler,B=b.subject;if(!B){var B=b.subject=new L,l=function tb(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];var e=tb.source,b=e.selector,e=e.subject;b?(c=r(b).apply(this,c),c===m?a.add(k.schedule(qb,0,{err:m.e,subject:e})):a.add(k.schedule(na,
0,{value:c,subject:e}))):a.add(k.schedule(na,0,{value:1>=c.length?c[0]:c,subject:e}))};l.source=b;r(h).apply(c,g.concat(l))===m&&B.error(m.e)}a.add(B.subscribe(f))};return a}(g).create;g.bindCallback=Zb;var $b=function(b){function a(c,a,d,f,h){b.call(this);this.callbackFunc=c;this.selector=a;this.args=d;this.context=f;this.scheduler=h}k(a,b);a.create=function(c,b,d){void 0===b&&(b=void 0);return function(){for(var e=[],h=0;h<arguments.length;h++)e[h-0]=arguments[h];return new a(c,b,e,this,d)}};a.prototype._subscribe=
function(c){var a=this.callbackFunc,b=this.args,f=this.scheduler,h=this.subject;if(f)return f.schedule(rb,0,{source:this,subscriber:c,context:this.context});h||(h=this.subject=new L,f=function C(){for(var c=[],a=0;a<arguments.length;a++)c[a-0]=arguments[a];var b=C.source,a=b.selector,b=b.subject,e=c.shift();e?b.error(e):a?(c=r(a).apply(this,c),c===m?b.error(m.e):(b.next(c),b.complete())):(b.next(1>=c.length?c[0]:c),b.complete())},f.source=this,r(a).apply(this.context,b.concat(f))===m&&h.error(m.e));
return h.subscribe(c)};return a}(g).create;g.bindNodeCallback=$b;var ga=function(b){function a(c,a){b.call(this);this.value=c;this.scheduler=a;this._isScalar=!0;a&&(this._isScalar=!1)}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.value,b=c.subscriber;c.done?b.complete():(b.next(a),b.closed||(c.done=!0,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.value,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{done:!1,value:b,subscriber:c});c.next(b);
c.closed||c.complete()};return a}(g),F=function(b){function a(c){b.call(this);this.scheduler=c}k(a,b);a.create=function(c){return new a(c)};a.dispatch=function(c){c.subscriber.complete()};a.prototype._subscribe=function(c){var b=this.scheduler;if(b)return b.schedule(a.dispatch,0,{subscriber:c});c.complete()};return a}(g),E=function(b){function a(c,a){b.call(this);this.array=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){return new a(c,b)};a.of=
function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];b=c[c.length-1];z(b)?c.pop():b=null;var d=c.length;return 1<d?new a(c,b):1===d?new ga(c[0],b):new F(b)};a.dispatch=function(c){var a=c.array,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a[b]),f.closed||(c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.array,d=b.length,f=this.scheduler;if(f)return f.schedule(a.dispatch,0,{array:b,index:0,count:d,subscriber:c});for(f=0;f<d&&!c.closed;f++)c.next(b[f]);
c.complete()};return a}(g),q=function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype.notifyNext=function(c,a,b,f,h){this.destination.next(a)};a.prototype.notifyError=function(c,a){this.destination.error(c)};a.prototype.notifyComplete=function(c){this.destination.complete()};return a}(l),A=function(b){var a=b.Symbol;if("function"===typeof a)return a.iterator||(a.iterator=a("iterator polyfill")),a.iterator;if((a=b.Set)&&"function"===typeof(new a)["@@iterator"])return"@@iterator";if(b=b.Map)for(var a=
Object.getOwnPropertyNames(b.prototype),c=0;c<a.length;++c){var e=a[c];if("entries"!==e&&"size"!==e&&b.prototype[e]===b.prototype.entries)return e}return"@@iterator"}(n),qa=function(b){function a(c,a,d){b.call(this);this.parent=c;this.outerValue=a;this.outerIndex=d;this.index=0}k(a,b);a.prototype._next=function(c){this.parent.notifyNext(this.outerValue,c,this.outerIndex,this.index++,this)};a.prototype._error=function(c){this.parent.notifyError(c,this);this.unsubscribe()};a.prototype._complete=function(){this.parent.notifyComplete(this);
this.unsubscribe()};return a}(l),Pa={},ha=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new ac(a,this.project))};return b}(),ac=function(b){function a(c,a){b.call(this,c);this.project=a;this.active=0;this.values=[];this.observables=[]}k(a,b);a.prototype._next=function(c){this.values.push(Pa);this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{this.toRespond=this.active=a;
for(var b=0;b<a;b++){var f=c[b];this.add(p(this,f,f,b))}}};a.prototype.notifyComplete=function(c){0===--this.active&&this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,h){c=this.values;f=c[b];f=this.toRespond?f===Pa?--this.toRespond:this.toRespond:0;c[b]=a;0===f&&(this.project?this._tryProject(c):this.destination.next(c.slice()))};a.prototype._tryProject=function(c){var a;try{a=this.project.apply(this,c)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(q);
g.combineLatest=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c=a=null;z(b[b.length-1])&&(c=b.pop());"function"===typeof b[b.length-1]&&(a=b.pop());1===b.length&&D(b[0])&&(b=b[0]);return(new E(b,c)).lift(new ha(a))};var W=function(){function b(a){this.concurrent=a}b.prototype.call=function(a,c){return c.subscribe(new bc(a,this.concurrent))};return b}(),bc=function(b){function a(c,a){b.call(this,c);this.concurrent=a;this.hasCompleted=!1;this.buffer=[];this.active=0}k(a,
b);a.prototype._next=function(c){this.active<this.concurrent?(this.active++,this.add(p(this,c))):this.buffer.push(c)};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyComplete=function(c){var a=this.buffer;this.remove(c);this.active--;0<a.length?this._next(a.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q);g.concat=P;var dc=function(b){function a(c){b.call(this);this.observableFactory=
c}k(a,b);a.create=function(c){return new a(c)};a.prototype._subscribe=function(c){return new cc(c,this.observableFactory)};return a}(g),cc=function(b){function a(c,a){b.call(this,c);this.factory=a;this.tryDefer()}k(a,b);a.prototype.tryDefer=function(){try{this._callFactory()}catch(c){this._error(c)}};a.prototype._callFactory=function(){var c=this.factory();c&&this.add(p(this,c))};return a}(q);g.defer=dc.create;g.empty=F.create;var fc=function(b){function a(c,a){b.call(this);this.sources=c;this.resultSelector=
a}k(a,b);a.create=function(){for(var c=[],b=0;b<arguments.length;b++)c[b-0]=arguments[b];if(null===c||0===arguments.length)return new F;b=null;"function"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&D(c[0])&&(c=c[0]);return 0===c.length?new F:new a(c,b)};a.prototype._subscribe=function(c){return new ec(c,this.sources,this.resultSelector)};return a}(g),ec=function(b){function a(c,a,d){b.call(this,c);this.sources=a;this.resultSelector=d;this.haveValues=this.completed=0;this.total=c=a.length;this.values=
Array(c);for(d=0;d<c;d++){var e=p(this,a[d],null,d);e&&(e.outerIndex=d,this.add(e))}}k(a,b);a.prototype.notifyNext=function(c,a,b,f,h){this.values[b]=a;h._hasValue||(h._hasValue=!0,this.haveValues++)};a.prototype.notifyComplete=function(c){var a=this.destination,b=this.haveValues,f=this.resultSelector,h=this.values,g=h.length;c._hasValue?(this.completed++,this.completed===g&&(b===g&&(c=f?f.apply(this,h):h,a.next(c)),a.complete())):a.complete()};return a}(q);g.forkJoin=fc.create;var Qa=function(b){function a(c,
a){b.call(this);this.promise=c;this.scheduler=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this,b=this.promise,f=this.scheduler;if(null==f)this._isScalar?c.closed||(c.next(this.value),c.complete()):b.then(function(b){a.value=b;a._isScalar=!0;c.closed||(c.next(b),c.complete())},function(a){c.closed||c.error(a)}).then(null,function(c){n.setTimeout(function(){throw c;})});else if(this._isScalar){if(!c.closed)return f.schedule(ra,0,{value:this.value,subscriber:c})}else b.then(function(b){a.value=
b;a._isScalar=!0;c.closed||c.add(f.schedule(ra,0,{value:b,subscriber:c}))},function(a){c.closed||c.add(f.schedule(ub,0,{err:a,subscriber:c}))}).then(null,function(c){n.setTimeout(function(){throw c;})})};return a}(g),ic=function(b){function a(c,a){b.call(this);this.scheduler=a;if(null==c)throw Error("iterator cannot be null.");if((a=c[A])||"string"!==typeof c)if(a||void 0===c.length){if(!a)throw new TypeError("object is not iterable");c=c[A]()}else c=new gc(c);else c=new hc(c);this.iterator=c}k(a,
b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){var a=c.index,b=c.iterator,f=c.subscriber;if(c.hasError)f.error(c.error);else{var h=b.next();h.done?f.complete():(f.next(h.value),c.index=a+1,f.closed?"function"===typeof b.return&&b.return():this.schedule(c))}};a.prototype._subscribe=function(c){var b=this.iterator,d=this.scheduler;if(d)return d.schedule(a.dispatch,0,{index:0,iterator:b,subscriber:c});do{d=b.next();if(d.done){c.complete();break}else c.next(d.value);if(c.closed){"function"===
typeof b.return&&b.return();break}}while(1)};return a}(g),hc=function(){function b(a,c,b){void 0===c&&(c=0);void 0===b&&(b=a.length);this.str=a;this.idx=c;this.len=b}b.prototype[A]=function(){return this};b.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}};return b}(),gc=function(){function b(a,c,b){void 0===c&&(c=0);if(void 0===b)if(b=+a.length,isNaN(b))b=0;else if(0!==b&&"number"===typeof b&&n.isFinite(b)){var e;e=+b;e=0===e?e:
isNaN(e)?e:0>e?-1:1;b=e*Math.floor(Math.abs(b));b=0>=b?0:b>Ra?Ra:b}this.arr=a;this.idx=c;this.len=b}b.prototype[A]=function(){return this};b.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}};return b}(),Ra=Math.pow(2,53)-1,jc=function(b){function a(c,a){b.call(this);this.arrayLike=c;this.scheduler=a;a||1!==c.length||(this._isScalar=!0,this.value=c[0])}k(a,b);a.create=function(c,b){var e=c.length;return 0===e?new F:1===e?new ga(c[0],b):
new a(c,b)};a.dispatch=function(c){var a=c.arrayLike,b=c.index,f=c.subscriber;f.closed||(b>=c.length?f.complete():(f.next(a[b]),c.index=b+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=this.arrayLike,d=this.scheduler,f=b.length;if(d)return d.schedule(a.dispatch,0,{arrayLike:b,index:0,length:f,subscriber:c});for(d=0;d<f&&!c.closed;d++)c.next(b[d]);c.complete()};return a}(g),w=function(){function b(a,c,b){this.kind=a;this.value=c;this.error=b;this.hasValue="N"===a}b.prototype.observe=
function(a){switch(this.kind){case "N":return a.next&&a.next(this.value);case "E":return a.error&&a.error(this.error);case "C":return a.complete&&a.complete()}};b.prototype.do=function(a,c,b){switch(this.kind){case "N":return a&&a(this.value);case "E":return c&&c(this.error);case "C":return b&&b()}};b.prototype.accept=function(a,c,b){return a&&"function"===typeof a.next?this.observe(a):this.do(a,c,b)};b.prototype.toObservable=function(){switch(this.kind){case "N":return g.of(this.value);case "E":return g.throw(this.error);
case "C":return g.empty()}throw Error("unexpected notification kind value");};b.createNext=function(a){return"undefined"!==typeof a?new b("N",a):b.undefinedValueNotification};b.createError=function(a){return new b("E",void 0,a)};b.createComplete=function(){return b.completeNotification};b.completeNotification=new b("C");b.undefinedValueNotification=new b("N",void 0);return b}(),kc=function(){function b(a,c){void 0===c&&(c=0);this.scheduler=a;this.delay=c}b.prototype.call=function(a,c){return c.subscribe(new ia(a,
this.scheduler,this.delay))};return b}(),ia=function(b){function a(c,a,d){void 0===d&&(d=0);b.call(this,c);this.scheduler=a;this.delay=d}k(a,b);a.dispatch=function(c){c.notification.observe(c.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(c){this.add(this.scheduler.schedule(a.dispatch,this.delay,new lc(c,this.destination)))};a.prototype._next=function(c){this.scheduleMessage(w.createNext(c))};a.prototype._error=function(c){this.scheduleMessage(w.createError(c))};a.prototype._complete=
function(){this.scheduleMessage(w.createComplete())};return a}(l),lc=function(){return function(b,a){this.notification=b;this.destination=a}}(),Sa=function(b){function a(c,a){b.call(this,null);this.ish=c;this.scheduler=a}k(a,b);a.create=function(c,b){if(null!=c){if("function"===typeof c[I])return c instanceof g&&!b?c:new a(c,b);if(D(c))return new E(c,b);if(pa(c))return new Qa(c,b);if("function"===typeof c[A]||"string"===typeof c)return new ic(c,b);if(c&&"number"===typeof c.length)return new jc(c,
b)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");};a.prototype._subscribe=function(c){var a=this.ish,b=this.scheduler;return null==b?a[I]().subscribe(c):a[I]().subscribe(new ia(c,b,0))};return a}(g);g.from=Sa.create;var Ta=Object.prototype.toString,mc=function(b){function a(c,a,d,f){b.call(this);this.sourceObj=c;this.eventName=a;this.selector=d;this.options=f}k(a,b);a.create=function(c,b,d,f){N(d)&&(f=d,d=void 0);return new a(c,b,f,d)};a.setupSubscription=function(c,b,d,f,h){var e;
if(c&&"[object NodeList]"===Ta.call(c)||c&&"[object HTMLCollection]"===Ta.call(c))for(var g=0,k=c.length;g<k;g++)a.setupSubscription(c[g],b,d,f,h);else if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(b,d,h),e=function(){return c.removeEventListener(b,d)};else if(c&&"function"===typeof c.on&&"function"===typeof c.off)c.on(b,d),e=function(){return c.off(b,d)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(b,
d),e=function(){return c.removeListener(b,d)};else throw new TypeError("Invalid event target");f.add(new u(e))};a.prototype._subscribe=function(c){var b=this.selector;a.setupSubscription(this.sourceObj,this.eventName,b?function(){for(var a=[],e=0;e<arguments.length;e++)a[e-0]=arguments[e];a=r(b).apply(void 0,a);a===m?c.error(m.e):c.next(a)}:function(a){return c.next(a)},c,this.options)};return a}(g).create;g.fromEvent=mc;var nc=function(b){function a(c,a,d){b.call(this);this.addHandler=c;this.removeHandler=
a;this.selector=d}k(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=function(c){var a=this,b=this.removeHandler,f=this.selector?function(){for(var b=[],e=0;e<arguments.length;e++)b[e-0]=arguments[e];a._callSelector(c,b)}:function(a){c.next(a)},h=this._callAddHandler(f,c);N(b)&&c.add(new u(function(){b(f,h)}))};a.prototype._callSelector=function(c,a){try{var b=this.selector.apply(this,a);c.next(b)}catch(f){c.error(f)}};a.prototype._callAddHandler=function(c,a){try{return this.addHandler(c)||
null}catch(d){a.error(d)}};return a}(g).create;g.fromEventPattern=nc;g.fromPromise=Qa.create;var Ua=function(b){return b},oc=function(b){function a(c,a,d,f,h){b.call(this);this.initialState=c;this.condition=a;this.iterate=d;this.resultSelector=f;this.scheduler=h}k(a,b);a.create=function(c,b,d,f,h){return 1==arguments.length?new a(c.initialState,c.condition,c.iterate,c.resultSelector||Ua,c.scheduler):void 0===f||z(f)?new a(c,b,d,Ua,f):new a(c,b,d,f,h)};a.prototype._subscribe=function(c){var b=this.initialState;
if(this.scheduler)return this.scheduler.schedule(a.dispatch,0,{subscriber:c,iterate:this.iterate,condition:this.condition,resultSelector:this.resultSelector,state:b});var d=this.condition,f=this.resultSelector,h=this.iterate;do{if(d){var g=void 0;try{g=d(b)}catch(C){c.error(C);break}if(!g){c.complete();break}}g=void 0;try{g=f(b)}catch(C){c.error(C);break}c.next(g);if(c.closed)break;try{b=h(b)}catch(C){c.error(C);break}}while(1)};a.dispatch=function(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=
c.iterate(c.state)}catch(y){a.error(y);return}else c.needIterate=!0;if(b){var f=void 0;try{f=b(c.state)}catch(y){a.error(y);return}if(!f){a.complete();return}if(a.closed)return}var h;try{h=c.resultSelector(c.state)}catch(y){a.error(y);return}if(!a.closed&&(a.next(h),!a.closed))return this.schedule(c)}};return a}(g).create;g.generate=oc;var qc=function(b){function a(c,a,d){b.call(this);this.condition=c;this.thenSource=a;this.elseSource=d}k(a,b);a.create=function(c,b,d){return new a(c,b,d)};a.prototype._subscribe=
function(c){return new pc(c,this.condition,this.thenSource,this.elseSource)};return a}(g),pc=function(b){function a(c,a,d,f){b.call(this,c);this.condition=a;this.thenSource=d;this.elseSource=f;this.tryIf()}k(a,b);a.prototype.tryIf=function(){var c=this.condition,a=this.thenSource,b=this.elseSource,f;try{(c=(f=c())?a:b)?this.add(p(this,c)):this._complete()}catch(h){this._error(h)}};return a}(q);g.if=qc.create;var S=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a;this.pending=
!1}k(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(this.closed)return this;this.state=c;this.pending=!0;c=this.id;var b=this.scheduler;null!=c&&(this.id=this.recycleAsyncId(b,c,a));this.delay=a;this.id=this.id||this.requestAsyncId(b,this.id,a);return this};a.prototype.requestAsyncId=function(c,a,b){void 0===b&&(b=0);return n.setInterval(c.flush.bind(c,this),b)};a.prototype.recycleAsyncId=function(c,a,b){void 0===b&&(b=0);return null!==b&&this.delay===b&&!1===this.pending?a:(n.clearInterval(a),
void 0)};a.prototype.execute=function(c,a){if(this.closed)return Error("executing a cancelled action");this.pending=!1;if(c=this._execute(c,a))return c;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(c,a){a=!1;var b=void 0;try{this.work(c)}catch(f){a=!0,b=!!f&&f||Error(f)}if(a)return this.unsubscribe(),b};a.prototype._unsubscribe=function(){var c=this.id,a=this.scheduler,b=a.actions,f=b.indexOf(this);this.state=this.work=
null;this.pending=!1;this.scheduler=null;-1!==f&&b.splice(f,1);null!=c&&(this.id=this.recycleAsyncId(a,c,null));this.delay=null};return a}(function(b){function a(c,a){b.call(this)}k(a,b);a.prototype.schedule=function(c,a){return this};return a}(u)),T=function(b){function a(){b.apply(this,arguments);this.actions=[];this.active=!1;this.scheduled=void 0}k(a,b);a.prototype.flush=function(c){var a=this.actions;if(this.active)a.push(c);else{var b;this.active=!0;do if(b=c.execute(c.state,c.delay))break;
while(c=a.shift());this.active=!1;if(b){for(;c=a.shift();)c.unsubscribe();throw b;}}};return a}(function(){function b(a,c){void 0===c&&(c=b.now);this.SchedulerAction=a;this.now=c}b.prototype.schedule=function(a,c,b){void 0===c&&(c=0);return(new this.SchedulerAction(this,a)).schedule(b,c)};b.now=Date.now?Date.now:function(){return+new Date};return b}()),x=new T(S),rc=function(b){function a(c,a){void 0===c&&(c=0);void 0===a&&(a=x);b.call(this);this.period=c;this.scheduler=a;if(!Q(c)||0>c)this.period=
0;a&&"function"===typeof a.schedule||(this.scheduler=x)}k(a,b);a.create=function(c,b){void 0===c&&(c=0);void 0===b&&(b=x);return new a(c,b)};a.dispatch=function(c){var a=c.subscriber,b=c.period;a.next(c.index);a.closed||(c.index+=1,this.schedule(c,b))};a.prototype._subscribe=function(c){var b=this.period;c.add(this.scheduler.schedule(a.dispatch,b,{index:0,subscriber:c,period:b}))};return a}(g).create;g.interval=rc;g.merge=sa;var vb=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new sc(a))};
return b}(),sc=function(b){function a(c){b.call(this,c);this.hasFirst=!1;this.observables=[];this.subscriptions=[]}k(a,b);a.prototype._next=function(c){this.observables.push(c)};a.prototype._complete=function(){var c=this.observables,a=c.length;if(0===a)this.destination.complete();else{for(var b=0;b<a&&!this.hasFirst;b++){var f=c[b],f=p(this,f,f,b);this.subscriptions&&this.subscriptions.push(f);this.add(f)}this.observables=null}};a.prototype.notifyNext=function(c,a,b,f,h){if(!this.hasFirst){this.hasFirst=
!0;for(c=0;c<this.subscriptions.length;c++)c!==b&&(f=this.subscriptions[c],f.unsubscribe(),this.remove(f));this.subscriptions=null}this.destination.next(a)};return a}(q);g.race=ta;var tc=function(b){function a(){b.call(this)}k(a,b);a.create=function(){return new a};a.prototype._subscribe=function(c){};return a}(g).create;g.never=tc;g.of=E.of;var Va=function(){function b(a){this.nextSources=a}b.prototype.call=function(a,c){return c.subscribe(new uc(a,this.nextSources))};return b}(),uc=function(b){function a(c,
a){b.call(this,c);this.destination=c;this.nextSources=a}k(a,b);a.prototype.notifyError=function(c,a){this.subscribeToNextSource()};a.prototype.notifyComplete=function(c){this.subscribeToNextSource()};a.prototype._error=function(c){this.subscribeToNextSource()};a.prototype._complete=function(){this.subscribeToNextSource()};a.prototype.subscribeToNextSource=function(){var c=this.nextSources.shift();c?this.add(p(this,c)):this.destination.complete()};return a}(q);g.onErrorResumeNext=function(){for(var b=
[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&D(b[0])&&(b=b[0]);a=b.shift();return(new Sa(a,null)).lift(new Va(b))};var vc=function(b){function a(c,a){b.call(this);this.obj=c;this.scheduler=a;this.keys=Object.keys(c)}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.keys,b=this.scheduler,f=a.length;if(b)return b.schedule(wb,0,{obj:this.obj,keys:a,length:f,index:0,subscriber:c});for(b=0;b<f;b++){var h=a[b];c.next([h,this.obj[h]])}c.complete()};
return a}(g).create;g.pairs=vc;var wc=function(b){function a(c,a,d){b.call(this);this.start=c;this._count=a;this.scheduler=d}k(a,b);a.create=function(c,b,d){void 0===c&&(c=0);void 0===b&&(b=0);return new a(c,b,d)};a.dispatch=function(c){var a=c.start,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a),f.closed||(c.index=b+1,c.start=a+1,this.schedule(c)))};a.prototype._subscribe=function(c){var b=0,d=this.start,f=this._count,h=this.scheduler;if(h)return h.schedule(a.dispatch,0,{index:b,count:f,
start:d,subscriber:c});do{if(b++>=f){c.complete();break}c.next(d++);if(c.closed)break}while(1)};return a}(g).create;g.range=wc;var yc=function(b){function a(c,a){b.call(this);this.resourceFactory=c;this.observableFactory=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.prototype._subscribe=function(c){var a=this.resourceFactory,b=this.observableFactory,f;try{return f=a(),new xc(c,f,b)}catch(h){c.error(h)}};return a}(g),xc=function(b){function a(c,a,d){b.call(this,c);this.resource=a;this.observableFactory=
d;c.add(a);this.tryUse()}k(a,b);a.prototype.tryUse=function(){try{var c=this.observableFactory.call(this,this.resource);c&&this.add(p(this,c))}catch(e){this._error(e)}};return a}(q);g.using=yc.create;var zc=function(b){function a(c,a){b.call(this);this.error=c;this.scheduler=a}k(a,b);a.create=function(c,b){return new a(c,b)};a.dispatch=function(c){c.subscriber.error(c.error)};a.prototype._subscribe=function(c){var b=this.error,d=this.scheduler;c.syncErrorThrowable=!0;if(d)return d.schedule(a.dispatch,
0,{error:b,subscriber:c});c.error(b)};return a}(g).create;g.throw=zc;var Ac=function(b){function a(c,a,d){void 0===c&&(c=0);b.call(this);this.period=-1;this.dueTime=0;Q(a)?this.period=1>Number(a)&&1||Number(a):z(a)&&(d=a);z(d)||(d=x);this.scheduler=d;this.dueTime=X(c)?+c-this.scheduler.now():c}k(a,b);a.create=function(c,b,d){void 0===c&&(c=0);return new a(c,b,d)};a.dispatch=function(c){var a=c.index,b=c.period,f=c.subscriber;f.next(a);if(!f.closed){if(-1===b)return f.complete();c.index=a+1;this.schedule(c,
b)}};a.prototype._subscribe=function(c){return this.scheduler.schedule(a.dispatch,this.dueTime,{index:0,period:this.period,subscriber:c})};return a}(g).create;g.timer=Ac;var va=function(){function b(a){this.project=a}b.prototype.call=function(a,c){return c.subscribe(new Bc(a,this.project))};return b}(),Bc=function(b){function a(c,a,d){void 0===d&&(d=Object.create(null));b.call(this,c);this.iterators=[];this.active=0;this.project="function"===typeof a?a:null;this.values=d}k(a,b);a.prototype._next=
function(c){var a=this.iterators;D(c)?a.push(new Cc(c)):"function"===typeof c[A]?a.push(new Dc(c[A]())):a.push(new Ec(this.destination,this,c))};a.prototype._complete=function(){var c=this.iterators,a=c.length;if(0===a)this.destination.complete();else{this.active=a;for(var b=0;b<a;b++){var f=c[b];f.stillUnsubscribed?this.add(f.subscribe(f,b)):this.active--}}};a.prototype.notifyInactive=function(){this.active--;0===this.active&&this.destination.complete()};a.prototype.checkIterators=function(){for(var c=
this.iterators,a=c.length,b=this.destination,f=0;f<a;f++){var h=c[f];if("function"===typeof h.hasValue&&!h.hasValue())return}for(var g=!1,k=[],f=0;f<a;f++){var h=c[f],l=h.next();h.hasCompleted()&&(g=!0);if(l.done){b.complete();return}k.push(l.value)}this.project?this._tryProject(k):b.next(k);g&&b.complete()};a.prototype._tryProject=function(c){var a;try{a=this.project.apply(this,c)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(l),Dc=function(){function b(a){this.iterator=
a;this.nextResult=a.next()}b.prototype.hasValue=function(){return!0};b.prototype.next=function(){var a=this.nextResult;this.nextResult=this.iterator.next();return a};b.prototype.hasCompleted=function(){var a=this.nextResult;return a&&a.done};return b}(),Cc=function(){function b(a){this.array=a;this.length=this.index=0;this.length=a.length}b.prototype[A]=function(){return this};b.prototype.next=function(a){a=this.index++;var c=this.array;return a<this.length?{value:c[a],done:!1}:{value:null,done:!0}};
b.prototype.hasValue=function(){return this.array.length>this.index};b.prototype.hasCompleted=function(){return this.array.length===this.index};return b}(),Ec=function(b){function a(c,a,d){b.call(this,c);this.parent=a;this.observable=d;this.stillUnsubscribed=!0;this.buffer=[];this.isComplete=!1}k(a,b);a.prototype[A]=function(){return this};a.prototype.next=function(){var c=this.buffer;return 0===c.length&&this.isComplete?{value:null,done:!0}:{value:c.shift(),done:!1}};a.prototype.hasValue=function(){return 0<
this.buffer.length};a.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete};a.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()};a.prototype.notifyNext=function(c,a,b,f,h){this.buffer.push(a);this.parent.checkIterators()};a.prototype.subscribe=function(c,a){return p(this,this.observable,this,a)};return a}(q);g.zip=ua;var xa=function(){function b(a,c){this.project=a;this.thisArg=c}b.prototype.call=
function(a,c){return c.subscribe(new Fc(a,this.project,this.thisArg))};return b}(),Fc=function(b){function a(c,a,d){b.call(this,c);this.project=a;this.count=0;this.thisArg=d||this}k(a,b);a.prototype._next=function(c){var a;try{a=this.project.call(this.thisArg,c,this.count++)}catch(d){this.destination.error(d);return}this.destination.next(a)};return a}(l),J=function(b){function a(c){b.call(this);var a={async:!0,createXHR:function(){var c;if(this.crossDomain)if(n.XMLHttpRequest)c=new n.XMLHttpRequest;
else if(n.XDomainRequest)c=new n.XDomainRequest;else throw Error("CORS is not supported by your browser");else if(n.XMLHttpRequest)c=new n.XMLHttpRequest;else{var a=void 0;try{for(var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=0;3>e;e++)try{a=b[e];new n.ActiveXObject(a);break}catch(B){}c=new n.ActiveXObject(a)}catch(B){throw Error("XMLHttpRequest is not supported by your browser");}}return c},crossDomain:!1,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};
if("string"===typeof c)a.url=c;else for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d]);this.request=a}k(a,b);a.prototype._subscribe=function(c){return new Gc(c,this.request)};a.create=function(){var c=function(c){return new a(c)};c.get=xb;c.post=yb;c.delete=zb;c.put=Ab;c.patch=Bb;c.getJSON=Cb;return c}();return a}(g),Gc=function(b){function a(c,a){b.call(this,c);this.request=a;this.done=!1;c=a.headers=a.headers||{};a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");"Content-Type"in
c||n.FormData&&a.body instanceof n.FormData||"undefined"===typeof a.body||(c["Content-Type"]="application/x-www-form-urlencoded; charset\x3dUTF-8");a.body=this.serializeBody(a.body,a.headers["Content-Type"]);this.send()}k(a,b);a.prototype.next=function(c){this.done=!0;var a=this.destination;c=new Wa(c,this.xhr,this.request);a.next(c)};a.prototype.send=function(){var c=this.request,a=this.request,b=a.user,f=a.method,h=a.url,g=a.async,k=a.password,l=a.headers,a=a.body,n=r(c.createXHR).call(c);if(n===
m)this.error(m.e);else{this.xhr=n;this.setupEvents(n,c);b=b?r(n.open).call(n,f,h,g,b,k):r(n.open).call(n,f,h,g);if(b===m)return this.error(m.e),null;g&&(n.timeout=c.timeout,n.responseType=c.responseType);"withCredentials"in n&&(n.withCredentials=!!c.withCredentials);this.setHeaders(n,l);b=a?r(n.send).call(n,a):r(n.send).call(n);if(b===m)return this.error(m.e),null}return n};a.prototype.serializeBody=function(c,a){if(!c||"string"===typeof c||n.FormData&&c instanceof n.FormData)return c;if(a){var b=
a.indexOf(";");-1!==b&&(a=a.substring(0,b))}switch(a){case "application/x-www-form-urlencoded":return Object.keys(c).map(function(a){return encodeURI(a)+"\x3d"+encodeURI(c[a])}).join("\x26");case "application/json":return JSON.stringify(c);default:return c}};a.prototype.setHeaders=function(c,a){for(var b in a)a.hasOwnProperty(b)&&c.setRequestHeader(b,a[b])};a.prototype.setupEvents=function(c,a){function b(c){var a=b.subscriber,e=b.progressSubscriber,d=b.request;e&&e.error(c);a.error(new Xa(this,d))}
function e(c){var a=e.subscriber,b=e.progressSubscriber,d=e.request;if(4===this.readyState){var f=1223===this.status?204:this.status,h="text"===this.responseType?this.response||this.responseText:this.response;0===f&&(f=h?200:0);200<=f&&300>f?(b&&b.complete(),a.next(c),a.complete()):(b&&b.error(c),a.error(new aa("ajax error "+f,this,d)))}}var h=a.progressSubscriber;c.ontimeout=b;b.request=a;b.subscriber=this;b.progressSubscriber=h;if(c.upload&&"withCredentials"in c){if(h){var g;g=function(c){g.progressSubscriber.next(c)};
n.XDomainRequest?c.onprogress=g:c.upload.onprogress=g;g.progressSubscriber=h}var k;k=function(c){var a=k.progressSubscriber,b=k.subscriber,e=k.request;a&&a.error(c);b.error(new aa("ajax error",this,e))};c.onerror=k;k.request=a;k.subscriber=this;k.progressSubscriber=h}c.onreadystatechange=e;e.subscriber=this;e.progressSubscriber=h;e.request=a};a.prototype.unsubscribe=function(){var c=this.xhr;!this.done&&c&&4!==c.readyState&&"function"===typeof c.abort&&c.abort();b.prototype.unsubscribe.call(this)};
return a}(l),Wa=function(){return function(b,a,c){this.originalEvent=b;this.xhr=a;this.request=c;this.status=a.status;this.responseType=a.responseType||c.responseType;switch(this.responseType){case "json":this.response="response"in a?a.responseType?a.response:JSON.parse(a.response||a.responseText||"null"):JSON.parse(a.responseText||"null");break;case "xml":this.response=a.responseXML;break;default:this.response="response"in a?a.response:a.responseText}}}(),aa=function(b){function a(c,a,d){b.call(this,
c);this.message=c;this.xhr=a;this.request=d;this.status=a.status}k(a,b);return a}(Error),Xa=function(b){function a(c,a){b.call(this,"ajax timeout",c,a)}k(a,b);return a}(aa);g.ajax=J.create;var Hc=function(b){function a(c,a){b.call(this,c,a);this.scheduler=c;this.work=a}k(a,b);a.prototype.schedule=function(c,a){void 0===a&&(a=0);if(0<a)return b.prototype.schedule.call(this,c,a);this.delay=a;this.state=c;this.scheduler.flush(this);return this};a.prototype.execute=function(c,a){return 0<a||this.closed?
b.prototype.execute.call(this,c,a):this._execute(c,a)};a.prototype.requestAsyncId=function(c,a,d){void 0===d&&(d=0);return null!==d&&0<d||null===d&&0<this.delay?b.prototype.requestAsyncId.call(this,c,a,d):c.flush(this)};return a}(S),Ya=new (function(b){function a(){b.apply(this,arguments)}k(a,b);return a}(T))(Hc),K=function(b){function a(c,a,d){void 0===c&&(c=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);b.call(this);this.scheduler=d;this._events=[];this._bufferSize=1>c?1:c;this._windowTime=
1>a?1:a}k(a,b);a.prototype.next=function(c){var a=this._getNow();this._events.push(new Ic(a,c));this._trimBufferThenGetEvents();b.prototype.next.call(this,c)};a.prototype._subscribe=function(c){var a=this._trimBufferThenGetEvents(),b=this.scheduler,f;if(this.closed)throw new H;this.hasError?f=u.EMPTY:this.isStopped?f=u.EMPTY:(this.observers.push(c),f=new Na(this,c));b&&c.add(c=new ia(c,b));for(var b=a.length,h=0;h<b&&!c.closed;h++)c.next(a[h].value);this.hasError?c.error(this.thrownError):this.isStopped&&
c.complete();return f};a.prototype._getNow=function(){return(this.scheduler||Ya).now()};a.prototype._trimBufferThenGetEvents=function(){for(var c=this._getNow(),a=this._bufferSize,b=this._windowTime,f=this._events,h=f.length,g=0;g<h&&!(c-f[g].time<b);)g++;h>a&&(g=Math.max(g,h-a));0<g&&f.splice(0,g);return f};return a}(v),Ic=function(){return function(b,a){this.time=b;this.value=a}}(),Jc=n.Object.assign||Db,Kc=function(b){function a(c,a){if(c instanceof g)b.call(this,a,c);else{b.call(this);this.WebSocketCtor=
n.WebSocket;this._output=new v;"string"===typeof c?this.url=c:Jc(this,c);if(!this.WebSocketCtor)throw Error("no WebSocket constructor can be found");this.destination=new K}}k(a,b);a.prototype.resultSelector=function(c){return JSON.parse(c.data)};a.create=function(c){return new a(c)};a.prototype.lift=function(c){var b=new a(this,this.destination);b.operator=c;return b};a.prototype._resetState=function(){this.socket=null;this.source||(this.destination=new K);this._output=new v};a.prototype.multiplex=
function(c,a,b){var e=this;return new g(function(d){var f=r(c)();f===m?d.error(m.e):e.next(f);var h=e.subscribe(function(c){var a=r(b)(c);a===m?d.error(m.e):a&&d.next(c)},function(c){return d.error(c)},function(){return d.complete()});return function(){var c=r(a)();c===m?d.error(m.e):e.next(c);h.unsubscribe()}})};a.prototype._connectSocket=function(){var c=this,a=this.WebSocketCtor,b=this._output,f=null;try{this.socket=f=this.protocol?new a(this.url,this.protocol):new a(this.url),this.binaryType&&
(this.socket.binaryType=this.binaryType)}catch(y){b.error(y);return}var h=new u(function(){c.socket=null;f&&1===f.readyState&&f.close()});f.onopen=function(a){var e=c.openObserver;e&&e.next(a);a=c.destination;c.destination=l.create(function(c){return 1===f.readyState&&f.send(c)},function(a){var e=c.closingObserver;e&&e.next(void 0);a&&a.code?f.close(a.code,a.reason):b.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }"));
c._resetState()},function(){var a=c.closingObserver;a&&a.next(void 0);f.close();c._resetState()});a&&a instanceof K&&h.add(a.subscribe(c.destination))};f.onerror=function(a){c._resetState();b.error(a)};f.onclose=function(a){c._resetState();var e=c.closeObserver;e&&e.next(a);a.wasClean?b.complete():b.error(a)};f.onmessage=function(a){a=r(c.resultSelector)(a);a===m?b.error(m.e):b.next(a)}};a.prototype._subscribe=function(c){var a=this,b=this.source;if(b)return b.subscribe(c);this.socket||this._connectSocket();
b=new u;b.add(this._output.subscribe(c));b.add(function(){var c=a.socket;0===a._output.observers.length&&(c&&1===c.readyState&&c.close(),a._resetState())});return b};a.prototype.unsubscribe=function(){var c=this.source,a=this.socket;a&&1===a.readyState&&(a.close(),this._resetState());b.prototype.unsubscribe.call(this);c||(this.destination=new K)};return a}(Z).create;g.webSocket=Kc;var Mc=function(){function b(a){this.closingNotifier=a}b.prototype.call=function(a,c){return c.subscribe(new Lc(a,this.closingNotifier))};
return b}(),Lc=function(b){function a(c,a){b.call(this,c);this.buffer=[];this.add(p(this,a))}k(a,b);a.prototype._next=function(c){this.buffer.push(c)};a.prototype.notifyNext=function(c,a,b,f,h){c=this.buffer;this.buffer=[];this.destination.next(c)};return a}(q);g.prototype.buffer=function(b){return this.lift(new Mc(b))};var Pc=function(){function b(a,c){this.bufferSize=a;this.subscriberClass=(this.startBufferEvery=c)&&a!==c?Nc:Oc}b.prototype.call=function(a,c){return c.subscribe(new this.subscriberClass(a,
this.bufferSize,this.startBufferEvery))};return b}(),Oc=function(b){function a(c,a){b.call(this,c);this.bufferSize=a;this.buffer=[]}k(a,b);a.prototype._next=function(c){var a=this.buffer;a.push(c);a.length==this.bufferSize&&(this.destination.next(a),this.buffer=[])};a.prototype._complete=function(){var c=this.buffer;0<c.length&&this.destination.next(c);b.prototype._complete.call(this)};return a}(l),Nc=function(b){function a(c,a,d){b.call(this,c);this.bufferSize=a;this.startBufferEvery=d;this.buffers=
[];this.count=0}k(a,b);a.prototype._next=function(c){var a=this.bufferSize,b=this.startBufferEvery,f=this.buffers,h=this.count;this.count++;0===h%b&&f.push([]);for(b=f.length;b--;)h=f[b],h.push(c),h.length===a&&(f.splice(b,1),this.destination.next(h))};a.prototype._complete=function(){for(var c=this.buffers,a=this.destination;0<c.length;){var d=c.shift();0<d.length&&a.next(d)}b.prototype._complete.call(this)};return a}(l);g.prototype.bufferCount=function(b,a){void 0===a&&(a=null);return this.lift(new Pc(b,
a))};var Rc=function(){function b(a,c,b,d){this.bufferTimeSpan=a;this.bufferCreationInterval=c;this.maxBufferSize=b;this.scheduler=d}b.prototype.call=function(a,c){return c.subscribe(new Qc(a,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))};return b}(),Sc=function(){return function(){this.buffer=[]}}(),Qc=function(b){function a(c,a,d,f,h){b.call(this,c);this.bufferTimeSpan=a;this.bufferCreationInterval=d;this.maxBufferSize=f;this.scheduler=h;this.contexts=[];c=
this.openContext();(this.timespanOnly=null==d||0>d)?this.add(c.closeAction=h.schedule(ya,a,{subscriber:this,context:c,bufferTimeSpan:a})):(f={bufferTimeSpan:a,bufferCreationInterval:d,subscriber:this,scheduler:h},this.add(c.closeAction=h.schedule(za,a,{subscriber:this,context:c})),this.add(h.schedule(Eb,d,f)))}k(a,b);a.prototype._next=function(a){for(var c=this.contexts,b=c.length,f,h=0;h<b;h++){var g=c[h],k=g.buffer;k.push(a);k.length==this.maxBufferSize&&(f=g)}if(f)this.onBufferFull(f)};a.prototype._error=
function(a){this.contexts.length=0;b.prototype._error.call(this,a)};a.prototype._complete=function(){for(var a=this.contexts,e=this.destination;0<a.length;){var d=a.shift();e.next(d.buffer)}b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.contexts=null};a.prototype.onBufferFull=function(a){this.closeContext(a);a=a.closeAction;a.unsubscribe();this.remove(a);if(!this.closed&&this.timespanOnly){a=this.openContext();var c=this.bufferTimeSpan;this.add(a.closeAction=this.scheduler.schedule(ya,
c,{subscriber:this,context:a,bufferTimeSpan:c}))}};a.prototype.openContext=function(){var a=new Sc;this.contexts.push(a);return a};a.prototype.closeContext=function(a){this.destination.next(a.buffer);var c=this.contexts;0<=(c?c.indexOf(a):-1)&&c.splice(c.indexOf(a),1)};return a}(l);g.prototype.bufferTime=function(b){var a=arguments.length,c=x;z(arguments[arguments.length-1])&&(c=arguments[arguments.length-1],a--);var e=null;2<=a&&(e=arguments[1]);var d=Number.POSITIVE_INFINITY;3<=a&&(d=arguments[2]);
return this.lift(new Rc(b,e,d,c))};var Uc=function(){function b(a,c){this.openings=a;this.closingSelector=c}b.prototype.call=function(a,c){return c.subscribe(new Tc(a,this.openings,this.closingSelector))};return b}(),Tc=function(b){function a(a,e,d){b.call(this,a);this.openings=e;this.closingSelector=d;this.contexts=[];this.add(p(this,e))}k(a,b);a.prototype._next=function(a){for(var c=this.contexts,b=c.length,f=0;f<b;f++)c[f].buffer.push(a)};a.prototype._error=function(a){for(var c=this.contexts;0<
c.length;){var d=c.shift();d.subscription.unsubscribe();d.buffer=null;d.subscription=null}this.contexts=null;b.prototype._error.call(this,a)};a.prototype._complete=function(){for(var a=this.contexts;0<a.length;){var e=a.shift();this.destination.next(e.buffer);e.subscription.unsubscribe();e.buffer=null;e.subscription=null}this.contexts=null;b.prototype._complete.call(this)};a.prototype.notifyNext=function(a,b,d,f,h){a?this.closeBuffer(a):this.openBuffer(b)};a.prototype.notifyComplete=function(a){this.closeBuffer(a.context)};
a.prototype.openBuffer=function(a){try{var c=this.closingSelector.call(this,a);c&&this.trySubscribe(c)}catch(d){this._error(d)}};a.prototype.closeBuffer=function(a){var c=this.contexts;if(c&&a){var b=a.subscription;this.destination.next(a.buffer);c.splice(c.indexOf(a),1);this.remove(b);b.unsubscribe()}};a.prototype.trySubscribe=function(a){var c=this.contexts,b=new u,f={buffer:[],subscription:b};c.push(f);a=p(this,a,f);!a||a.closed?this.closeBuffer(f):(a.context=f,this.add(a),b.add(a))};return a}(q);
g.prototype.bufferToggle=function(b,a){return this.lift(new Uc(b,a))};var Wc=function(){function b(a){this.closingSelector=a}b.prototype.call=function(a,c){return c.subscribe(new Vc(a,this.closingSelector))};return b}(),Vc=function(b){function a(a,e){b.call(this,a);this.closingSelector=e;this.subscribing=!1;this.openBuffer()}k(a,b);a.prototype._next=function(a){this.buffer.push(a)};a.prototype._complete=function(){var a=this.buffer;a&&this.destination.next(a);b.prototype._complete.call(this)};a.prototype._unsubscribe=
function(){this.buffer=null;this.subscribing=!1};a.prototype.notifyNext=function(a,b,d,f,h){this.openBuffer()};a.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()};a.prototype.openBuffer=function(){var a=this.closingSubscription;a&&(this.remove(a),a.unsubscribe());(a=this.buffer)&&this.destination.next(a);this.buffer=[];var b=r(this.closingSelector)();b===m?this.error(m.e):(this.closingSubscription=a=new u,this.add(a),this.subscribing=!0,a.add(p(this,b)),this.subscribing=
!1)};return a}(q);g.prototype.bufferWhen=function(b){return this.lift(new Wc(b))};var Fb=function(){function b(a){this.selector=a}b.prototype.call=function(a,c){return c.subscribe(new Xc(a,this.selector,this.caught))};return b}(),Xc=function(b){function a(a,e,d){b.call(this,a);this.selector=e;this.caught=d}k(a,b);a.prototype.error=function(a){if(!this.isStopped){var c=void 0;try{c=this.selector(a,this.caught)}catch(d){b.prototype.error.call(this,d);return}this._unsubscribeAndRecycle();this.add(p(this,
c))}};return a}(q);g.prototype.catch=Aa;g.prototype._catch=Aa;g.prototype.combineAll=function(b){return this.lift(new ha(b))};g.prototype.combineLatest=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=null;"function"===typeof b[b.length-1]&&(a=b.pop());1===b.length&&D(b[0])&&(b=b[0].slice());b.unshift(this);return this.lift.call(new E(b),new ha(a))};g.prototype.concat=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return this.lift.call(P.apply(void 0,
[this].concat(b)))};g.prototype.concatAll=function(){return this.lift(new W(1))};var Ca=function(){function b(a,c,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.project=a;this.resultSelector=c;this.concurrent=b}b.prototype.call=function(a,c){return c.subscribe(new Yc(a,this.project,this.resultSelector,this.concurrent))};return b}(),Yc=function(b){function a(a,e,d,f){void 0===f&&(f=Number.POSITIVE_INFINITY);b.call(this,a);this.project=e;this.resultSelector=d;this.concurrent=f;this.hasCompleted=!1;
this.buffer=[];this.index=this.active=0}k(a,b);a.prototype._next=function(a){this.active<this.concurrent?this._tryNext(a):this.buffer.push(a)};a.prototype._tryNext=function(a){var c,b=this.index++;try{c=this.project(a,b)}catch(f){this.destination.error(f);return}this.active++;this._innerSub(c,a,b)};a.prototype._innerSub=function(a,b,d){this.add(p(this,a,b,d))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyNext=
function(a,b,d,f,h){this.resultSelector?this._notifyResultSelector(a,b,d,f):this.destination.next(b)};a.prototype._notifyResultSelector=function(a,b,d,f){var c;try{c=this.resultSelector(a,b,d,f)}catch(y){this.destination.error(y);return}this.destination.next(c)};a.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;0<c.length?this._next(c.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q);g.prototype.concatMap=function(b,a){return this.lift(new Ca(b,
a,1))};var Ea=function(){function b(a,c,b){void 0===b&&(b=Number.POSITIVE_INFINITY);this.ish=a;this.resultSelector=c;this.concurrent=b}b.prototype.call=function(a,c){return c.subscribe(new Zc(a,this.ish,this.resultSelector,this.concurrent))};return b}(),Zc=function(b){function a(a,e,d,f){void 0===f&&(f=Number.POSITIVE_INFINITY);b.call(this,a);this.ish=e;this.resultSelector=d;this.concurrent=f;this.hasCompleted=!1;this.buffer=[];this.index=this.active=0}k(a,b);a.prototype._next=function(a){if(this.active<
this.concurrent){var c=this.resultSelector,b=this.index++,f=this.ish,h=this.destination;this.active++;this._innerSub(f,h,c,a,b)}else this.buffer.push(a)};a.prototype._innerSub=function(a,b,d,f,h){this.add(p(this,a,f,h))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&this.destination.complete()};a.prototype.notifyNext=function(a,b,d,f,h){h=this.destination;this.resultSelector?this.trySelectResult(a,b,d,f):h.next(b)};a.prototype.trySelectResult=function(a,
b,d,f){var c=this.resultSelector,e=this.destination,g;try{g=c(a,b,d,f)}catch(B){e.error(B);return}e.next(g)};a.prototype.notifyError=function(a){this.destination.error(a)};a.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;0<c.length?this._next(c.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()};return a}(q);g.prototype.concatMapTo=function(b,a){return this.lift(new Ea(b,a,1))};var ad=function(){function b(a,c){this.predicate=a;this.source=
c}b.prototype.call=function(a,c){return c.subscribe(new $c(a,this.predicate,this.source))};return b}(),$c=function(b){function a(a,e,d){b.call(this,a);this.predicate=e;this.source=d;this.index=this.count=0}k(a,b);a.prototype._next=function(a){this.predicate?this._tryPredicate(a):this.count++};a.prototype._tryPredicate=function(a){var c;try{c=this.predicate(a,this.index++,this.source)}catch(d){this.destination.error(d);return}c&&this.count++};a.prototype._complete=function(){this.destination.next(this.count);
this.destination.complete()};return a}(l);g.prototype.count=function(b){return this.lift(new ad(b,this))};var cd=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new bd(a))};return b}(),bd=function(b){function a(a){b.call(this,a)}k(a,b);a.prototype._next=function(a){a.observe(this.destination)};return a}(l);g.prototype.dematerialize=function(){return this.lift(new cd)};var ed=function(){function b(a){this.durationSelector=a}b.prototype.call=function(a,c){return c.subscribe(new dd(a,
this.durationSelector))};return b}(),dd=function(b){function a(a,e){b.call(this,a);this.durationSelector=e;this.hasValue=!1;this.durationSubscription=null}k(a,b);a.prototype._next=function(a){try{var c=this.durationSelector.call(this,a);c&&this._tryNext(a,c)}catch(d){this.destination.error(d)}};a.prototype._complete=function(){this.emitValue();this.destination.complete()};a.prototype._tryNext=function(a,b){var c=this.durationSubscription;this.value=a;this.hasValue=!0;c&&(c.unsubscribe(),this.remove(c));
c=p(this,b);c.closed||this.add(this.durationSubscription=c)};a.prototype.notifyNext=function(a,b,d,f,h){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){if(this.hasValue){var a=this.value,e=this.durationSubscription;e&&(this.durationSubscription=null,e.unsubscribe(),this.remove(e));this.value=null;this.hasValue=!1;b.prototype._next.call(this,a)}};return a}(q);g.prototype.debounce=function(b){return this.lift(new ed(b))};var gd=function(){function b(a,
c){this.dueTime=a;this.scheduler=c}b.prototype.call=function(a,c){return c.subscribe(new fd(a,this.dueTime,this.scheduler))};return b}(),fd=function(b){function a(a,e,d){b.call(this,a);this.dueTime=e;this.scheduler=d;this.lastValue=this.debouncedSubscription=null;this.hasValue=!1}k(a,b);a.prototype._next=function(a){this.clearDebounce();this.lastValue=a;this.hasValue=!0;this.add(this.debouncedSubscription=this.scheduler.schedule(Gb,this.dueTime,this))};a.prototype._complete=function(){this.debouncedNext();
this.destination.complete()};a.prototype.debouncedNext=function(){this.clearDebounce();this.hasValue&&(this.destination.next(this.lastValue),this.lastValue=null,this.hasValue=!1)};a.prototype.clearDebounce=function(){var a=this.debouncedSubscription;null!==a&&(this.remove(a),a.unsubscribe(),this.debouncedSubscription=null)};return a}(l);g.prototype.debounceTime=function(b,a){void 0===a&&(a=x);return this.lift(new gd(b,a))};var id=function(){function b(a){this.defaultValue=a}b.prototype.call=function(a,
c){return c.subscribe(new hd(a,this.defaultValue))};return b}(),hd=function(b){function a(a,e){b.call(this,a);this.defaultValue=e;this.isEmpty=!0}k(a,b);a.prototype._next=function(a){this.isEmpty=!1;this.destination.next(a)};a.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue);this.destination.complete()};return a}(l);g.prototype.defaultIfEmpty=function(b){void 0===b&&(b=null);return this.lift(new id(b))};var kd=function(){function b(a,c){this.delay=a;this.scheduler=
c}b.prototype.call=function(a,c){return c.subscribe(new jd(a,this.delay,this.scheduler))};return b}(),jd=function(b){function a(a,e,d){b.call(this,a);this.delay=e;this.scheduler=d;this.queue=[];this.errored=this.active=!1}k(a,b);a.dispatch=function(a){for(var c=a.source,b=c.queue,f=a.scheduler,h=a.destination;0<b.length&&0>=b[0].time-f.now();)b.shift().notification.observe(h);0<b.length?(c=Math.max(0,b[0].time-f.now()),this.schedule(a,c)):c.active=!1};a.prototype._schedule=function(c){this.active=
!0;this.add(c.schedule(a.dispatch,this.delay,{source:this,destination:this.destination,scheduler:c}))};a.prototype.scheduleNotification=function(a){if(!0!==this.errored){var c=this.scheduler;a=new ld(c.now()+this.delay,a);this.queue.push(a);!1===this.active&&this._schedule(c)}};a.prototype._next=function(a){this.scheduleNotification(w.createNext(a))};a.prototype._error=function(a){this.errored=!0;this.queue=[];this.destination.error(a)};a.prototype._complete=function(){this.scheduleNotification(w.createComplete())};
return a}(l),ld=function(){return function(b,a){this.time=b;this.notification=a}}();g.prototype.delay=function(b,a){void 0===a&&(a=x);b=X(b)?+b-a.now():Math.abs(b);return this.lift(new kd(b,a))};var Za=function(){function b(a){this.delayDurationSelector=a}b.prototype.call=function(a,c){return c.subscribe(new md(a,this.delayDurationSelector))};return b}(),md=function(b){function a(a,e){b.call(this,a);this.delayDurationSelector=e;this.completed=!1;this.delayNotifierSubscriptions=[];this.values=[]}k(a,
b);a.prototype.notifyNext=function(a,b,d,f,h){this.destination.next(a);this.removeSubscription(h);this.tryComplete()};a.prototype.notifyError=function(a,b){this._error(a)};a.prototype.notifyComplete=function(a){(a=this.removeSubscription(a))&&this.destination.next(a);this.tryComplete()};a.prototype._next=function(a){try{var c=this.delayDurationSelector(a);c&&this.tryDelay(c,a)}catch(d){this.destination.error(d)}};a.prototype._complete=function(){this.completed=!0;this.tryComplete()};a.prototype.removeSubscription=
function(a){a.unsubscribe();a=this.delayNotifierSubscriptions.indexOf(a);var c=null;-1!==a&&(c=this.values[a],this.delayNotifierSubscriptions.splice(a,1),this.values.splice(a,1));return c};a.prototype.tryDelay=function(a,b){(a=p(this,a,b))&&!a.closed&&(this.add(a),this.delayNotifierSubscriptions.push(a));this.values.push(b)};a.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()};return a}(q),od=function(b){function a(a,e){b.call(this);
this.source=a;this.subscriptionDelay=e}k(a,b);a.prototype._subscribe=function(a){this.subscriptionDelay.subscribe(new nd(a,this.source))};return a}(g),nd=function(b){function a(a,e){b.call(this);this.parent=a;this.source=e;this.sourceSubscribed=!1}k(a,b);a.prototype._next=function(a){this.subscribeToSource()};a.prototype._error=function(a){this.unsubscribe();this.parent.error(a)};a.prototype._complete=function(){this.subscribeToSource()};a.prototype.subscribeToSource=function(){this.sourceSubscribed||
(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))};return a}(l);g.prototype.delayWhen=function(b,a){return a?(new od(this,a)).lift(new Za(b)):this.lift(new Za(b))};var pd=n.Set||Hb(),rd=function(){function b(a,c){this.keySelector=a;this.flushes=c}b.prototype.call=function(a,c){return c.subscribe(new qd(a,this.keySelector,this.flushes))};return b}(),qd=function(b){function a(a,e,d){b.call(this,a);this.keySelector=e;this.values=new pd;d&&this.add(p(this,d))}k(a,b);a.prototype.notifyNext=
function(a,b,d,f,h){this.values.clear()};a.prototype.notifyError=function(a,b){this._error(a)};a.prototype._next=function(a){this.keySelector?this._useKeySelector(a):this._finalizeNext(a,a)};a.prototype._useKeySelector=function(a){var c,b=this.destination;try{c=this.keySelector(a)}catch(f){b.error(f);return}this._finalizeNext(c,a)};a.prototype._finalizeNext=function(a,b){var c=this.values;c.has(a)||(c.add(a),this.destination.next(b))};return a}(q);g.prototype.distinct=function(b,a){return this.lift(new rd(b,
a))};var Ib=function(){function b(a,c){this.compare=a;this.keySelector=c}b.prototype.call=function(a,c){return c.subscribe(new sd(a,this.compare,this.keySelector))};return b}(),sd=function(b){function a(a,e,d){b.call(this,a);this.keySelector=d;this.hasKey=!1;"function"===typeof e&&(this.compare=e)}k(a,b);a.prototype.compare=function(a,b){return a===b};a.prototype._next=function(a){var c=a;if(this.keySelector&&(c=r(this.keySelector)(a),c===m))return this.destination.error(m.e);var b=!1;if(this.hasKey){if(b=
r(this.compare)(this.key,c),b===m)return this.destination.error(m.e)}else this.hasKey=!0;!1===!!b&&(this.key=c,this.destination.next(a))};return a}(l);g.prototype.distinctUntilChanged=Fa;g.prototype.distinctUntilKeyChanged=function(b,a){return Fa.call(this,function(c,e){return a?a(c[b],e[b]):c[b]===e[b]})};var Jb=function(){function b(a,c,b){this.nextOrObserver=a;this.error=c;this.complete=b}b.prototype.call=function(a,c){return c.subscribe(new td(a,this.nextOrObserver,this.error,this.complete))};
return b}(),td=function(b){function a(a,e,d,f){b.call(this,a);a=new l(e,d,f);a.syncErrorThrowable=!0;this.add(a);this.safeSubscriber=a}k(a,b);a.prototype._next=function(a){var c=this.safeSubscriber;c.next(a);c.syncErrorThrown?this.destination.error(c.syncErrorValue):this.destination.next(a)};a.prototype._error=function(a){var c=this.safeSubscriber;c.error(a);c.syncErrorThrown?this.destination.error(c.syncErrorValue):this.destination.error(a)};a.prototype._complete=function(){var a=this.safeSubscriber;
a.complete();a.syncErrorThrown?this.destination.error(a.syncErrorValue):this.destination.complete()};return a}(l);g.prototype.do=Ga;g.prototype._do=Ga;var vd=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new ud(a))};return b}(),ud=function(b){function a(a){b.call(this,a);this.hasSubscription=this.hasCompleted=!1}k(a,b);a.prototype._next=function(a){this.hasSubscription||(this.hasSubscription=!0,this.add(p(this,a)))};a.prototype._complete=function(){this.hasCompleted=!0;
this.hasSubscription||this.destination.complete()};a.prototype.notifyComplete=function(a){this.remove(a);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(q);g.prototype.exhaust=function(){return this.lift(new vd)};var xd=function(){function b(a,c){this.project=a;this.resultSelector=c}b.prototype.call=function(a,c){return c.subscribe(new wd(a,this.project,this.resultSelector))};return b}(),wd=function(b){function a(a,e,d){b.call(this,a);this.project=e;this.resultSelector=
d;this.hasCompleted=this.hasSubscription=!1;this.index=0}k(a,b);a.prototype._next=function(a){this.hasSubscription||this.tryNext(a)};a.prototype.tryNext=function(a){var c=this.index++,b=this.destination;try{var f=this.project(a,c);this.hasSubscription=!0;this.add(p(this,f,a,c))}catch(h){b.error(h)}};a.prototype._complete=function(){this.hasCompleted=!0;this.hasSubscription||this.destination.complete()};a.prototype.notifyNext=function(a,b,d,f,h){h=this.destination;this.resultSelector?this.trySelectResult(a,
b,d,f):h.next(b)};a.prototype.trySelectResult=function(a,b,d,f){var c=this.resultSelector,e=this.destination;try{var g=c(a,b,d,f);e.next(g)}catch(B){e.error(B)}};a.prototype.notifyError=function(a){this.destination.error(a)};a.prototype.notifyComplete=function(a){this.remove(a);this.hasSubscription=!1;this.hasCompleted&&this.destination.complete()};return a}(q);g.prototype.exhaustMap=function(b,a){return this.lift(new xd(b,a))};var zd=function(){function b(a,c,b){this.project=a;this.concurrent=c;
this.scheduler=b}b.prototype.call=function(a,c){return c.subscribe(new yd(a,this.project,this.concurrent,this.scheduler))};return b}(),yd=function(b){function a(a,e,d,f){b.call(this,a);this.project=e;this.concurrent=d;this.scheduler=f;this.active=this.index=0;this.hasCompleted=!1;d<Number.POSITIVE_INFINITY&&(this.buffer=[])}k(a,b);a.dispatch=function(a){a.subscriber.subscribeToProjection(a.result,a.value,a.index)};a.prototype._next=function(c){var b=this.destination;if(b.closed)this._complete();else{var d=
this.index++;if(this.active<this.concurrent){b.next(c);var f=r(this.project)(c,d);f===m?b.error(m.e):this.scheduler?this.add(this.scheduler.schedule(a.dispatch,0,{subscriber:this,result:f,value:c,index:d})):this.subscribeToProjection(f,c,d)}else this.buffer.push(c)}};a.prototype.subscribeToProjection=function(a,b,d){this.active++;this.add(p(this,a,b,d))};a.prototype._complete=function(){(this.hasCompleted=!0,0===this.active)&&this.destination.complete()};a.prototype.notifyNext=function(a,b,d,f,h){this._next(b)};
a.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;c&&0<c.length&&this._next(c.shift());this.hasCompleted&&0===this.active&&this.destination.complete()};return a}(q);g.prototype.expand=function(b,a,c){void 0===a&&(a=Number.POSITIVE_INFINITY);void 0===c&&(c=void 0);a=1>(a||0)?Number.POSITIVE_INFINITY:a;return this.lift(new zd(b,a,c))};var M=function(b){function a(){var a=b.call(this,"argument out of range");this.name=a.name="ArgumentOutOfRangeError";this.stack=a.stack;
this.message=a.message}k(a,b);return a}(Error),Bd=function(){function b(a,c){this.index=a;this.defaultValue=c;if(0>a)throw new M;}b.prototype.call=function(a,c){return c.subscribe(new Ad(a,this.index,this.defaultValue))};return b}(),Ad=function(b){function a(a,e,d){b.call(this,a);this.index=e;this.defaultValue=d}k(a,b);a.prototype._next=function(a){0===this.index--&&(this.destination.next(a),this.destination.complete())};a.prototype._complete=function(){var a=this.destination;0<=this.index&&("undefined"!==
typeof this.defaultValue?a.next(this.defaultValue):a.error(new M));a.complete()};return a}(l);g.prototype.elementAt=function(b,a){return this.lift(new Bd(b,a))};var Kb=function(){function b(a,c){this.predicate=a;this.thisArg=c}b.prototype.call=function(a,c){return c.subscribe(new Cd(a,this.predicate,this.thisArg))};return b}(),Cd=function(b){function a(a,e,d){b.call(this,a);this.predicate=e;this.thisArg=d;this.count=0}k(a,b);a.prototype._next=function(a){var c;try{c=this.predicate.call(this.thisArg,
a,this.count++)}catch(d){this.destination.error(d);return}c&&this.destination.next(a)};return a}(l);g.prototype.filter=ea;var Lb=function(){function b(a){this.callback=a}b.prototype.call=function(a,c){return c.subscribe(new Dd(a,this.callback))};return b}(),Dd=function(b){function a(a,e){b.call(this,a);this.add(new u(e))}k(a,b);return a}(l);g.prototype.finally=Ha;g.prototype._finally=Ha;var $a=function(){function b(a,c,b,d){this.predicate=a;this.source=c;this.yieldIndex=b;this.thisArg=d}b.prototype.call=
function(a,c){return c.subscribe(new Ed(a,this.predicate,this.source,this.yieldIndex,this.thisArg))};return b}(),Ed=function(b){function a(a,e,d,f,h){b.call(this,a);this.predicate=e;this.source=d;this.yieldIndex=f;this.thisArg=h;this.index=0}k(a,b);a.prototype.notifyComplete=function(a){var c=this.destination;c.next(a);c.complete()};a.prototype._next=function(a){var c=this.predicate,b=this.thisArg,f=this.index++;try{c.call(b||this,a,f,this.source)&&this.notifyComplete(this.yieldIndex?f:a)}catch(h){this.destination.error(h)}};
a.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)};return a}(l);g.prototype.find=function(b,a){if("function"!==typeof b)throw new TypeError("predicate is not a function");return this.lift(new $a(b,this,!1,a))};g.prototype.findIndex=function(b,a){return this.lift(new $a(b,this,!0,a))};var ba=function(b){function a(){var a=b.call(this,"no elements in sequence");this.name=a.name="EmptyError";this.stack=a.stack;this.message=a.message}k(a,b);return a}(Error),Gd=function(){function b(a,
c,b,d){this.predicate=a;this.resultSelector=c;this.defaultValue=b;this.source=d}b.prototype.call=function(a,c){return c.subscribe(new Fd(a,this.predicate,this.resultSelector,this.defaultValue,this.source))};return b}(),Fd=function(b){function a(a,e,d,f,h){b.call(this,a);this.predicate=e;this.resultSelector=d;this.defaultValue=f;this.source=h;this.index=0;this._emitted=this.hasCompleted=!1}k(a,b);a.prototype._next=function(a){var c=this.index++;this.predicate?this._tryPredicate(a,c):this._emit(a,c)};
a.prototype._tryPredicate=function(a,b){var c;try{c=this.predicate(a,b,this.source)}catch(f){this.destination.error(f);return}c&&this._emit(a,b)};a.prototype._emit=function(a,b){this.resultSelector?this._tryResultSelector(a,b):this._emitFinal(a)};a.prototype._tryResultSelector=function(a,b){var c;try{c=this.resultSelector(a,b)}catch(f){this.destination.error(f);return}this._emitFinal(c)};a.prototype._emitFinal=function(a){var c=this.destination;this._emitted||(this._emitted=!0,c.next(a),c.complete(),
this.hasCompleted=!0)};a.prototype._complete=function(){var a=this.destination;this.hasCompleted||"undefined"===typeof this.defaultValue?this.hasCompleted||a.error(new ba):(a.next(this.defaultValue),a.complete())};return a}(l);g.prototype.first=function(b,a,c){return this.lift(new Gd(b,a,c,this))};var Hd=function(){function b(){this.size=0;this._values=[];this._keys=[]}b.prototype.get=function(a){a=this._keys.indexOf(a);return-1===a?void 0:this._values[a]};b.prototype.set=function(a,c){var b=this._keys.indexOf(a);
-1===b?(this._keys.push(a),this._values.push(c),this.size++):this._values[b]=c;return this};b.prototype.delete=function(a){a=this._keys.indexOf(a);if(-1===a)return!1;this._values.splice(a,1);this._keys.splice(a,1);this.size--;return!0};b.prototype.clear=function(){this._keys.length=0;this.size=this._values.length=0};b.prototype.forEach=function(a,c){for(var b=0;b<this.size;b++)a.call(c,this._values[b],this._keys[b])};return b}(),Id=n.Map||Hd,Jd=function(){function b(){this.values={}}b.prototype.delete=
function(a){this.values[a]=null;return!0};b.prototype.set=function(a,c){this.values[a]=c;return this};b.prototype.get=function(a){return this.values[a]};b.prototype.forEach=function(a,c){var b=this.values,d;for(d in b)b.hasOwnProperty(d)&&null!==b[d]&&a.call(c,b[d],d)};b.prototype.clear=function(){this.values={}};return b}(),Ld=function(){function b(a,c,b,d){this.keySelector=a;this.elementSelector=c;this.durationSelector=b;this.subjectSelector=d}b.prototype.call=function(a,c){return c.subscribe(new Kd(a,
this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return b}(),Kd=function(b){function a(a,e,d,f,h){b.call(this,a);this.keySelector=e;this.elementSelector=d;this.durationSelector=f;this.subjectSelector=h;this.groups=null;this.attemptedToUnsubscribe=!1;this.count=0}k(a,b);a.prototype._next=function(a){var c;try{c=this.keySelector(a)}catch(d){this.error(d);return}this._group(a,c)};a.prototype._group=function(a,b){var c=this.groups;c||(c=this.groups="string"===typeof b?
new Jd:new Id);var e=c.get(b),h;if(this.elementSelector)try{h=this.elementSelector(a)}catch(y){this.error(y)}else h=a;if(!e&&(e=this.subjectSelector?this.subjectSelector():new v,c.set(b,e),a=new ab(b,e,this),this.destination.next(a),this.durationSelector)){a=void 0;try{a=this.durationSelector(new ab(b,e))}catch(y){this.error(y);return}this.add(a.subscribe(new Md(b,e,this)))}e.closed||e.next(h)};a.prototype._error=function(a){var c=this.groups;c&&(c.forEach(function(c,b){c.error(a)}),c.clear());this.destination.error(a)};
a.prototype._complete=function(){var a=this.groups;a&&(a.forEach(function(a,c){a.complete()}),a.clear());this.destination.complete()};a.prototype.removeGroup=function(a){this.groups.delete(a)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&b.prototype.unsubscribe.call(this))};return a}(l),Md=function(b){function a(a,e,d){b.call(this,e);this.key=a;this.group=e;this.parent=d}k(a,b);a.prototype._next=function(a){this.complete()};a.prototype._unsubscribe=
function(){var a=this.parent,b=this.key;this.key=this.parent=null;a&&a.removeGroup(b)};return a}(l),ab=function(b){function a(a,e,d){b.call(this);this.key=a;this.groupSubject=e;this.refCountSubscription=d}k(a,b);a.prototype._subscribe=function(a){var c=new u,b=this.refCountSubscription,f=this.groupSubject;b&&!b.closed&&c.add(new Nd(b));c.add(f.subscribe(a));return c};return a}(g),Nd=function(b){function a(a){b.call(this);this.parent=a;a.count++}k(a,b);a.prototype.unsubscribe=function(){var a=this.parent;
a.closed||this.closed||(b.prototype.unsubscribe.call(this),--a.count,0===a.count&&a.attemptedToUnsubscribe&&a.unsubscribe())};return a}(u);g.prototype.groupBy=function(b,a,c,e){return this.lift(new Ld(b,a,c,e))};var Pd=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new Od(a))};return b}(),Od=function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype._next=function(a){};return a}(l);g.prototype.ignoreElements=function(){return this.lift(new Pd)};var Rd=function(){function b(){}
b.prototype.call=function(a,c){return c.subscribe(new Qd(a))};return b}(),Qd=function(b){function a(a){b.call(this,a)}k(a,b);a.prototype.notifyComplete=function(a){var c=this.destination;c.next(a);c.complete()};a.prototype._next=function(a){this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(l);g.prototype.isEmpty=function(){return this.lift(new Rd)};var Td=function(){function b(a){this.durationSelector=a}b.prototype.call=function(a,c){return c.subscribe(new Sd(a,
this.durationSelector))};return b}(),Sd=function(b){function a(a,e){b.call(this,a);this.durationSelector=e;this.hasValue=!1}k(a,b);a.prototype._next=function(a){this.value=a;this.hasValue=!0;this.throttled||(a=r(this.durationSelector)(a),a===m?this.destination.error(m.e):(a=p(this,a),a.closed?this.clearThrottle():this.add(this.throttled=a)))};a.prototype.clearThrottle=function(){var a=this.value,b=this.hasValue,d=this.throttled;d&&(this.remove(d),this.throttled=null,d.unsubscribe());b&&(this.value=
null,this.hasValue=!1,this.destination.next(a))};a.prototype.notifyNext=function(a,b,d,f){this.clearThrottle()};a.prototype.notifyComplete=function(){this.clearThrottle()};return a}(q);g.prototype.audit=function(b){return this.lift(new Td(b))};var Vd=function(){function b(a,c){this.duration=a;this.scheduler=c}b.prototype.call=function(a,c){return c.subscribe(new Ud(a,this.duration,this.scheduler))};return b}(),Ud=function(b){function a(a,e,d){b.call(this,a);this.duration=e;this.scheduler=d;this.hasValue=
!1}k(a,b);a.prototype._next=function(a){this.value=a;this.hasValue=!0;this.throttled||this.add(this.throttled=this.scheduler.schedule(Mb,this.duration,this))};a.prototype.clearThrottle=function(){var a=this.value,b=this.hasValue,d=this.throttled;d&&(this.remove(d),this.throttled=null,d.unsubscribe());b&&(this.value=null,this.hasValue=!1,this.destination.next(a))};return a}(l);g.prototype.auditTime=function(b,a){void 0===a&&(a=x);return this.lift(new Vd(b,a))};var Xd=function(){function b(a,c,b,d){this.predicate=
a;this.resultSelector=c;this.defaultValue=b;this.source=d}b.prototype.call=function(a,c){return c.subscribe(new Wd(a,this.predicate,this.resultSelector,this.defaultValue,this.source))};return b}(),Wd=function(b){function a(a,e,d,f,h){b.call(this,a);this.predicate=e;this.resultSelector=d;this.defaultValue=f;this.source=h;this.hasValue=!1;this.index=0;"undefined"!==typeof f&&(this.lastValue=f,this.hasValue=!0)}k(a,b);a.prototype._next=function(a){var c=this.index++;this.predicate?this._tryPredicate(a,
c):this.resultSelector?this._tryResultSelector(a,c):(this.lastValue=a,this.hasValue=!0)};a.prototype._tryPredicate=function(a,b){var c;try{c=this.predicate(a,b,this.source)}catch(f){this.destination.error(f);return}c&&(this.resultSelector?this._tryResultSelector(a,b):(this.lastValue=a,this.hasValue=!0))};a.prototype._tryResultSelector=function(a,b){var c;try{c=this.resultSelector(a,b)}catch(f){this.destination.error(f);return}this.lastValue=c;this.hasValue=!0};a.prototype._complete=function(){var a=
this.destination;this.hasValue?(a.next(this.lastValue),a.complete()):a.error(new ba)};return a}(l);g.prototype.last=function(b,a,c){return this.lift(new Xd(b,a,c,this))};g.prototype.let=Ia;g.prototype.letBind=Ia;var Zd=function(){function b(a,c,b){this.predicate=a;this.thisArg=c;this.source=b}b.prototype.call=function(a,c){return c.subscribe(new Yd(a,this.predicate,this.thisArg,this.source))};return b}(),Yd=function(b){function a(a,e,d,f){b.call(this,a);this.predicate=e;this.thisArg=d;this.source=
f;this.index=0;this.thisArg=d||this}k(a,b);a.prototype.notifyComplete=function(a){this.destination.next(a);this.destination.complete()};a.prototype._next=function(a){var c=!1;try{c=this.predicate.call(this.thisArg,a,this.index++,this.source)}catch(d){this.destination.error(d);return}c||this.notifyComplete(!1)};a.prototype._complete=function(){this.notifyComplete(!0)};return a}(l);g.prototype.every=function(b,a){return this.lift(new Zd(b,a,this))};g.prototype.map=wa;var ae=function(){function b(a){this.value=
a}b.prototype.call=function(a,c){return c.subscribe(new $d(a,this.value))};return b}(),$d=function(b){function a(a,e){b.call(this,a);this.value=e}k(a,b);a.prototype._next=function(a){this.destination.next(this.value)};return a}(l);g.prototype.mapTo=function(b){return this.lift(new ae(b))};var ce=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new be(a))};return b}(),be=function(b){function a(a){b.call(this,a)}k(a,b);a.prototype._next=function(a){this.destination.next(w.createNext(a))};
a.prototype._error=function(a){var c=this.destination;c.next(w.createError(a));c.complete()};a.prototype._complete=function(){var a=this.destination;a.next(w.createComplete());a.complete()};return a}(l);g.prototype.materialize=function(){return this.lift(new ce)};var ja=function(){function b(a,c,b){void 0===b&&(b=!1);this.accumulator=a;this.seed=c;this.hasSeed=b}b.prototype.call=function(a,c){return c.subscribe(new de(a,this.accumulator,this.seed,this.hasSeed))};return b}(),de=function(b){function a(a,
e,d,f){b.call(this,a);this.accumulator=e;this.hasSeed=f;this.index=0;this.hasValue=!1;this.acc=d;this.hasSeed||this.index++}k(a,b);a.prototype._next=function(a){this.hasValue||(this.hasValue=this.hasSeed)?this._tryReduce(a):(this.acc=a,this.hasValue=!0)};a.prototype._tryReduce=function(a){var c;try{c=this.accumulator(this.acc,a,this.index++)}catch(d){this.destination.error(d);return}this.acc=c};a.prototype._complete=function(){(this.hasValue||this.hasSeed)&&this.destination.next(this.acc);this.destination.complete()};
return a}(l);g.prototype.max=function(b){return this.lift(new ja("function"===typeof b?function(a,c){return 0<b(a,c)?a:c}:function(a,c){return a>c?a:c}))};g.prototype.merge=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];return this.lift.call(sa.apply(void 0,[this].concat(b)))};g.prototype.mergeAll=function(b){void 0===b&&(b=Number.POSITIVE_INFINITY);return this.lift(new W(b))};g.prototype.mergeMap=Ba;g.prototype.flatMap=Ba;g.prototype.flatMapTo=Da;g.prototype.mergeMapTo=Da;
var fe=function(){function b(a,c,b){this.accumulator=a;this.seed=c;this.concurrent=b}b.prototype.call=function(a,c){return c.subscribe(new ee(a,this.accumulator,this.seed,this.concurrent))};return b}(),ee=function(b){function a(a,e,d,f){b.call(this,a);this.accumulator=e;this.acc=d;this.concurrent=f;this.hasCompleted=this.hasValue=!1;this.buffer=[];this.index=this.active=0}k(a,b);a.prototype._next=function(a){if(this.active<this.concurrent){var c=this.index++,b=r(this.accumulator)(this.acc,a),f=this.destination;
b===m?f.error(m.e):(this.active++,this._innerSub(b,a,c))}else this.buffer.push(a)};a.prototype._innerSub=function(a,b,d){this.add(p(this,a,b,d))};a.prototype._complete=function(){this.hasCompleted=!0;0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())};a.prototype.notifyNext=function(a,b,d,f,h){a=this.destination;this.acc=b;this.hasValue=!0;a.next(b)};a.prototype.notifyComplete=function(a){var c=this.buffer;this.remove(a);this.active--;
0<c.length?this._next(c.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())};return a}(q);g.prototype.mergeScan=function(b,a,c){void 0===c&&(c=Number.POSITIVE_INFINITY);return this.lift(new fe(b,a,c))};g.prototype.min=function(b){return this.lift(new ja("function"===typeof b?function(a,c){return 0>b(a,c)?a:c}:function(a,c){return a<c?a:c}))};var bb=function(b){function a(a,e){b.call(this);this.source=a;this.subjectFactory=
e;this._refCount=0;this._isComplete=!1}k(a,b);a.prototype._subscribe=function(a){return this.getSubject().subscribe(a)};a.prototype.getSubject=function(){var a=this._subject;if(!a||a.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect=function(){var a=this._connection;a||(this._isComplete=!1,a=this._connection=new u,a.add(this.source.subscribe(new ge(this.getSubject(),this))),a.closed?(this._connection=null,a=u.EMPTY):this._connection=a);return a};a.prototype.refCount=
function(){return this.lift(new he(this))};return a}(g),U=bb.prototype,Ob={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:U._subscribe},_isComplete:{value:U._isComplete,writable:!0},getSubject:{value:U.getSubject},connect:{value:U.connect},refCount:{value:U.refCount}},ge=function(b){function a(a,e){b.call(this,a);this.connectable=e}k(a,b);a.prototype._error=function(a){this._unsubscribe();b.prototype._error.call(this,
a)};a.prototype._complete=function(){this.connectable._isComplete=!0;this._unsubscribe();b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var a=this.connectable;if(a){this.connectable=null;var b=a._connection;a._refCount=0;a._subject=null;a._connection=null;b&&b.unsubscribe()}};return a}(Oa),he=function(){function b(a){this.connectable=a}b.prototype.call=function(a,c){var b=this.connectable;b._refCount++;a=new ie(a,b);c=c.subscribe(a);a.closed||(a.connection=b.connect());return c};
return b}(),ie=function(b){function a(a,e){b.call(this,a);this.connectable=e}k(a,b);a.prototype._unsubscribe=function(){var a=this.connectable;if(a){this.connectable=null;var b=a._refCount;0>=b?this.connection=null:(a._refCount=b-1,1<b?this.connection=null:(b=this.connection,a=a._connection,this.connection=null,!a||b&&a!==b||a.unsubscribe()))}else this.connection=null};return a}(l),Nb=function(){function b(a,c){this.subjectFactory=a;this.selector=c}b.prototype.call=function(a,c){var b=this.selector,
d=this.subjectFactory();a=b(d).subscribe(a);a.add(c.subscribe(d));return a};return b}();g.prototype.multicast=G;g.prototype.observeOn=function(b,a){void 0===a&&(a=0);return this.lift(new kc(b,a))};g.prototype.onErrorResumeNext=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&D(b[0])&&(b=b[0]);return this.lift(new Va(b))};var ke=function(){function b(){}b.prototype.call=function(a,c){return c.subscribe(new je(a))};return b}(),je=function(b){function a(a){b.call(this,
a);this.hasPrev=!1}k(a,b);a.prototype._next=function(a){this.hasPrev?this.destination.next([this.prev,a]):this.hasPrev=!0;this.prev=a};return a}(l);g.prototype.pairwise=function(){return this.lift(new ke)};g.prototype.partition=function(b,a){return[ea.call(this,b,a),ea.call(this,Pb(b,a))]};g.prototype.pluck=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=b.length;if(0===a)throw Error("list of properties cannot be empty.");return wa.call(this,Qb(b,a))};g.prototype.publish=
function(b){return b?G.call(this,function(){return new v},b):G.call(this,new v)};var cb=function(b){function a(a){b.call(this);this._value=a}k(a,b);Object.defineProperty(a.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe=function(a){var c=b.prototype._subscribe.call(this,a);c&&!c.closed&&a.next(this._value);return c};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new H;return this._value};
a.prototype.next=function(a){b.prototype.next.call(this,this._value=a)};return a}(v);g.prototype.publishBehavior=function(b){return G.call(this,new cb(b))};g.prototype.publishReplay=function(b,a,c){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);return G.call(this,new K(b,a,c))};g.prototype.publishLast=function(){return G.call(this,new L)};g.prototype.race=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];1===b.length&&D(b[0])&&(b=b[0]);return this.lift.call(ta.apply(void 0,
[this].concat(b)))};g.prototype.reduce=function(b,a){var c=!1;2<=arguments.length&&(c=!0);return this.lift(new ja(b,a,c))};var db=function(){function b(a,c){this.count=a;this.source=c}b.prototype.call=function(a,c){return c.subscribe(new le(a,this.count,this.source))};return b}(),le=function(b){function a(a,e,d){b.call(this,a);this.count=e;this.source=d}k(a,b);a.prototype.complete=function(){if(!this.isStopped){var a=this.source,e=this.count;if(0===e)return b.prototype.complete.call(this);-1<e&&(this.count=
e-1);a.subscribe(this._unsubscribeAndRecycle())}};return a}(l);g.prototype.repeat=function(b){void 0===b&&(b=-1);return 0===b?new F:0>b?this.lift(new db(-1,this)):this.lift(new db(b-1,this))};var ne=function(){function b(a){this.notifier=a}b.prototype.call=function(a,c){return c.subscribe(new me(a,this.notifier,c))};return b}(),me=function(b){function a(a,e,d){b.call(this,a);this.notifier=e;this.source=d;this.sourceIsBeingSubscribedTo=!0}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.sourceIsBeingSubscribedTo=
!0;this.source.subscribe(this)};a.prototype.notifyComplete=function(a){if(!1===this.sourceIsBeingSubscribedTo)return b.prototype.complete.call(this)};a.prototype.complete=function(){this.sourceIsBeingSubscribedTo=!1;if(!this.isStopped){if(!this.retries)this.subscribeToRetries();else if(this.retriesSubscription.closed)return b.prototype.complete.call(this);this._unsubscribeAndRecycle();this.notifications.next()}};a.prototype._unsubscribe=function(){var a=this.notifications,b=this.retriesSubscription;
a&&(a.unsubscribe(),this.notifications=null);b&&(b.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype._unsubscribeAndRecycle=function(){var a=this.notifications,e=this.retries,d=this.retriesSubscription;this.retriesSubscription=this.retries=this.notifications=null;b.prototype._unsubscribeAndRecycle.call(this);this.notifications=a;this.retries=e;this.retriesSubscription=d;return this};a.prototype.subscribeToRetries=function(){this.notifications=new v;var a=r(this.notifier)(this.notifications);
if(a===m)return b.prototype.complete.call(this);this.retries=a;this.retriesSubscription=p(this,a)};return a}(q);g.prototype.repeatWhen=function(b){return this.lift(new ne(b))};var pe=function(){function b(a,c){this.count=a;this.source=c}b.prototype.call=function(a,c){return c.subscribe(new oe(a,this.count,this.source))};return b}(),oe=function(b){function a(a,e,d){b.call(this,a);this.count=e;this.source=d}k(a,b);a.prototype.error=function(a){if(!this.isStopped){var c=this.source,d=this.count;if(0===
d)return b.prototype.error.call(this,a);-1<d&&(this.count=d-1);c.subscribe(this._unsubscribeAndRecycle())}};return a}(l);g.prototype.retry=function(b){void 0===b&&(b=-1);return this.lift(new pe(b,this))};var re=function(){function b(a,c){this.notifier=a;this.source=c}b.prototype.call=function(a,c){return c.subscribe(new qe(a,this.notifier,this.source))};return b}(),qe=function(b){function a(a,e,d){b.call(this,a);this.notifier=e;this.source=d}k(a,b);a.prototype.error=function(a){if(!this.isStopped){var c=
this.errors,d=this.retries,f=this.retriesSubscription;if(d)this.retriesSubscription=this.errors=null;else{c=new v;d=r(this.notifier)(c);if(d===m)return b.prototype.error.call(this,m.e);f=p(this,d)}this._unsubscribeAndRecycle();this.errors=c;this.retries=d;this.retriesSubscription=f;c.next(a)}};a.prototype._unsubscribe=function(){var a=this.errors,b=this.retriesSubscription;a&&(a.unsubscribe(),this.errors=null);b&&(b.unsubscribe(),this.retriesSubscription=null);this.retries=null};a.prototype.notifyNext=
function(a,b,d,f,h){a=this.errors;b=this.retries;d=this.retriesSubscription;this.retriesSubscription=this.retries=this.errors=null;this._unsubscribeAndRecycle();this.errors=a;this.retries=b;this.retriesSubscription=d;this.source.subscribe(this)};return a}(q);g.prototype.retryWhen=function(b){return this.lift(new re(b,this))};var te=function(){function b(a){this.notifier=a}b.prototype.call=function(a,c){a=new se(a);c=c.subscribe(a);c.add(p(a,this.notifier));return c};return b}(),se=function(b){function a(){b.apply(this,
arguments);this.hasValue=!1}k(a,b);a.prototype._next=function(a){this.value=a;this.hasValue=!0};a.prototype.notifyNext=function(a,b,d,f,h){this.emitValue()};a.prototype.notifyComplete=function(){this.emitValue()};a.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))};return a}(q);g.prototype.sample=function(b){return this.lift(new te(b))};var ve=function(){function b(a,c){this.period=a;this.scheduler=c}b.prototype.call=function(a,c){return c.subscribe(new ue(a,
this.period,this.scheduler))};return b}(),ue=function(b){function a(a,e,d){b.call(this,a);this.period=e;this.scheduler=d;this.hasValue=!1;this.add(d.schedule(Rb,e,{subscriber:this,period:e}))}k(a,b);a.prototype._next=function(a){this.lastValue=a;this.hasValue=!0};a.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))};return a}(l);g.prototype.sampleTime=function(b,a){void 0===a&&(a=x);return this.lift(new ve(b,a))};var xe=function(){function b(a,
c,b){void 0===b&&(b=!1);this.accumulator=a;this.seed=c;this.hasSeed=b}b.prototype.call=function(a,c){return c.subscribe(new we(a,this.accumulator,this.seed,this.hasSeed))};return b}(),we=function(b){function a(a,e,d,f){b.call(this,a);this.accumulator=e;this._seed=d;this.hasSeed=f;this.index=0}k(a,b);Object.defineProperty(a.prototype,"seed",{get:function(){return this._seed},set:function(a){this.hasSeed=!0;this._seed=a},enumerable:!0,configurable:!0});a.prototype._next=function(a){if(this.hasSeed)return this._tryNext(a);
this.seed=a;this.destination.next(a)};a.prototype._tryNext=function(a){var c=this.index++,b;try{b=this.accumulator(this.seed,a,c)}catch(f){this.destination.error(f)}this.seed=b;this.destination.next(b)};return a}(l);g.prototype.scan=function(b,a){var c=!1;2<=arguments.length&&(c=!0);return this.lift(new xe(b,a,c))};var ze=function(){function b(a,c){this.compareTo=a;this.comparor=c}b.prototype.call=function(a,c){return c.subscribe(new ye(a,this.compareTo,this.comparor))};return b}(),ye=function(b){function a(a,
e,d){b.call(this,a);this.compareTo=e;this.comparor=d;this._a=[];this._b=[];this._oneComplete=!1;this.add(e.subscribe(new Ae(a,this)))}k(a,b);a.prototype._next=function(a){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(a),this.checkValues())};a.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0};a.prototype.checkValues=function(){for(var a=this._a,b=this._b,d=this.comparor;0<a.length&&0<b.length;){var f=a.shift(),
h=b.shift();d?(f=r(d)(f,h),f===m&&this.destination.error(m.e)):f=f===h;f||this.emit(!1)}};a.prototype.emit=function(a){var c=this.destination;c.next(a);c.complete()};a.prototype.nextB=function(a){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(a),this.checkValues())};return a}(l),Ae=function(b){function a(a,e){b.call(this,a);this.parent=e}k(a,b);a.prototype._next=function(a){this.parent.nextB(a)};a.prototype._error=function(a){this.parent.error(a)};a.prototype._complete=function(){this.parent._complete()};
return a}(l);g.prototype.sequenceEqual=function(b,a){return this.lift(new ze(b,a))};g.prototype.share=function(){return G.call(this,Sb).refCount()};g.prototype.shareReplay=function(b,a,c){var e;return G.call(this,function(){return this._isComplete?e:e=new K(b,a,c)}).refCount()};var Ce=function(){function b(a,c){this.predicate=a;this.source=c}b.prototype.call=function(a,c){return c.subscribe(new Be(a,this.predicate,this.source))};return b}(),Be=function(b){function a(a,e,d){b.call(this,a);this.predicate=
e;this.source=d;this.seenValue=!1;this.index=0}k(a,b);a.prototype.applySingleValue=function(a){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=a)};a.prototype._next=function(a){var c=this.index++;this.predicate?this.tryNext(a,c):this.applySingleValue(a)};a.prototype.tryNext=function(a,b){try{this.predicate(a,b,this.source)&&this.applySingleValue(a)}catch(d){this.destination.error(d)}};a.prototype._complete=function(){var a=this.destination;
0<this.index?(a.next(this.seenValue?this.singleValue:void 0),a.complete()):a.error(new ba)};return a}(l);g.prototype.single=function(b){return this.lift(new Ce(b,this))};var Ee=function(){function b(a){this.total=a}b.prototype.call=function(a,c){return c.subscribe(new De(a,this.total))};return b}(),De=function(b){function a(a,e){b.call(this,a);this.total=e;this.count=0}k(a,b);a.prototype._next=function(a){++this.count>this.total&&this.destination.next(a)};return a}(l);g.prototype.skip=function(b){return this.lift(new Ee(b))};
var Ge=function(){function b(a){this._skipCount=a;if(0>this._skipCount)throw new M;}b.prototype.call=function(a,c){return 0===this._skipCount?c.subscribe(new l(a)):c.subscribe(new Fe(a,this._skipCount))};return b}(),Fe=function(b){function a(a,e){b.call(this,a);this._skipCount=e;this._count=0;this._ring=Array(e)}k(a,b);a.prototype._next=function(a){var c=this._skipCount,b=this._count++;if(b<c)this._ring[b]=a;else{var c=b%c,b=this._ring,f=b[c];b[c]=a;this.destination.next(f)}};return a}(l);g.prototype.skipLast=
function(b){return this.lift(new Ge(b))};var Ie=function(){function b(a){this.notifier=a}b.prototype.call=function(a,c){return c.subscribe(new He(a,this.notifier))};return b}(),He=function(b){function a(a,e){b.call(this,a);this.isInnerStopped=this.hasValue=!1;this.add(p(this,e))}k(a,b);a.prototype._next=function(a){this.hasValue&&b.prototype._next.call(this,a)};a.prototype._complete=function(){this.isInnerStopped?b.prototype._complete.call(this):this.unsubscribe()};a.prototype.notifyNext=function(a,
b,d,f,h){this.hasValue=!0};a.prototype.notifyComplete=function(){this.isInnerStopped=!0;this.isStopped&&b.prototype._complete.call(this)};return a}(q);g.prototype.skipUntil=function(b){return this.lift(new Ie(b))};var Ke=function(){function b(a){this.predicate=a}b.prototype.call=function(a,b){return b.subscribe(new Je(a,this.predicate))};return b}(),Je=function(b){function a(a,e){b.call(this,a);this.predicate=e;this.skipping=!0;this.index=0}k(a,b);a.prototype._next=function(a){var b=this.destination;
this.skipping&&this.tryCallPredicate(a);this.skipping||b.next(a)};a.prototype.tryCallPredicate=function(a){try{this.skipping=!!this.predicate(a,this.index++)}catch(e){this.destination.error(e)}};return a}(l);g.prototype.skipWhile=function(b){return this.lift(new Ke(b))};g.prototype.startWith=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];a=b[b.length-1];z(a)?b.pop():a=null;var c=b.length;return 1===c?P(new ga(b[0],a),this):1<c?P(new E(b,a),this):P(new F(a),this)};var eb=new (function(){function b(a){this.root=
a;a.setImmediate&&"function"===typeof a.setImmediate?(this.setImmediate=a.setImmediate.bind(a),this.clearImmediate=a.clearImmediate.bind(a)):(this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.canUseProcessNextTick()?this.setImmediate=this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.setImmediate=this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.setImmediate=this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.setImmediate=
this.createReadyStateChangeSetImmediate():this.setImmediate=this.createSetTimeoutSetImmediate(),a=function e(a){delete e.instance.tasksByHandle[a]},a.instance=this,this.clearImmediate=a)}b.prototype.identify=function(a){return this.root.Object.prototype.toString.call(a)};b.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)};b.prototype.canUseMessageChannel=function(){return!!this.root.MessageChannel};b.prototype.canUseReadyStateChange=function(){var a=
this.root.document;return!!(a&&"onreadystatechange"in a.createElement("script"))};b.prototype.canUsePostMessage=function(){var a=this.root;if(a.postMessage&&!a.importScripts){var b=!0,e=a.onmessage;a.onmessage=function(){b=!1};a.postMessage("","*");a.onmessage=e;return b}return!1};b.prototype.partiallyApplied=function(a){for(var b=[],e=1;e<arguments.length;e++)b[e-1]=arguments[e];e=function f(){var a=f.handler,b=f.args;"function"===typeof a?a.apply(void 0,b):(new Function(""+a))()};e.handler=a;e.args=
b;return e};b.prototype.addFromSetImmediateArguments=function(a){this.tasksByHandle[this.nextHandle]=this.partiallyApplied.apply(void 0,a);return this.nextHandle++};b.prototype.createProcessNextTickSetImmediate=function(){var a=function e(){var a=e.instance,b=a.addFromSetImmediateArguments(arguments);a.root.process.nextTick(a.partiallyApplied(a.runIfPresent,b));return b};a.instance=this;return a};b.prototype.createPostMessageSetImmediate=function(){var a=this.root,b="setImmediate$"+a.Math.random()+
"$",e=function f(c){var e=f.instance;c.source===a&&"string"===typeof c.data&&0===c.data.indexOf(b)&&e.runIfPresent(+c.data.slice(b.length))};e.instance=this;a.addEventListener("message",e,!1);e=function h(){var a=h,b=a.messagePrefix,a=a.instance,c=a.addFromSetImmediateArguments(arguments);a.root.postMessage(b+c,"*");return c};e.instance=this;e.messagePrefix=b;return e};b.prototype.runIfPresent=function(a){if(this.currentlyRunningATask)this.root.setTimeout(this.partiallyApplied(this.runIfPresent,a),
0);else{var b=this.tasksByHandle[a];if(b){this.currentlyRunningATask=!0;try{b()}finally{this.clearImmediate(a),this.currentlyRunningATask=!1}}}};b.prototype.createMessageChannelSetImmediate=function(){var a=this,b=new this.root.MessageChannel;b.port1.onmessage=function(b){a.runIfPresent(b.data)};var e=function f(){var a=f,b=a.channel,a=a.instance.addFromSetImmediateArguments(arguments);b.port2.postMessage(a);return a};e.channel=b;e.instance=this;return e};b.prototype.createReadyStateChangeSetImmediate=
function(){var a=function e(){var a=e.instance,b=a.root.document,h=b.documentElement,g=a.addFromSetImmediateArguments(arguments),k=b.createElement("script");k.onreadystatechange=function(){a.runIfPresent(g);k.onreadystatechange=null;h.removeChild(k);k=null};h.appendChild(k);return g};a.instance=this;return a};b.prototype.createSetTimeoutSetImmediate=function(){var a=function e(){var a=e.instance,b=a.addFromSetImmediateArguments(arguments);a.root.setTimeout(a.partiallyApplied(a.runIfPresent,b),0);
return b};a.instance=this;return a};return b}())(n),Le=function(b){function a(a,e){b.call(this,a,e);this.scheduler=a;this.work=e}k(a,b);a.prototype.requestAsyncId=function(a,e,d){void 0===d&&(d=0);if(null!==d&&0<d)return b.prototype.requestAsyncId.call(this,a,e,d);a.actions.push(this);return a.scheduled||(a.scheduled=eb.setImmediate(a.flush.bind(a,null)))};a.prototype.recycleAsyncId=function(a,e,d){void 0===d&&(d=0);if(null!==d&&0<d||null===d&&0<this.delay)return b.prototype.recycleAsyncId.call(this,
a,e,d);0===a.actions.length&&(eb.clearImmediate(e),a.scheduled=void 0)};return a}(S),ca=new (function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype.flush=function(a){this.active=!0;this.scheduled=void 0;var b=this.actions,c,f=-1,h=b.length;a=a||b.shift();do if(c=a.execute(a.state,a.delay))break;while(++f<h&&(a=b.shift()));this.active=!1;if(c){for(;++f<h&&(a=b.shift());)a.unsubscribe();throw c;}};return a}(T))(Le),Me=function(b){function a(a,e,d){void 0===e&&(e=0);void 0===d&&(d=ca);b.call(this);
this.source=a;this.delayTime=e;this.scheduler=d;if(!Q(e)||0>e)this.delayTime=0;d&&"function"===typeof d.schedule||(this.scheduler=ca)}k(a,b);a.create=function(b,e,d){void 0===e&&(e=0);void 0===d&&(d=ca);return new a(b,e,d)};a.dispatch=function(a){return this.add(a.source.subscribe(a.subscriber))};a.prototype._subscribe=function(b){return this.scheduler.schedule(a.dispatch,this.delayTime,{source:this.source,subscriber:b})};return a}(g),Ne=function(){function b(a,b){this.scheduler=a;this.delay=b}b.prototype.call=
function(a,b){return(new Me(b,this.delay,this.scheduler)).subscribe(a)};return b}();g.prototype.subscribeOn=function(b,a){void 0===a&&(a=0);return this.lift(new Ne(b,a))};var Tb=function(){function b(){}b.prototype.call=function(a,b){return b.subscribe(new Oe(a))};return b}(),Oe=function(b){function a(a){b.call(this,a);this.active=0;this.hasCompleted=!1}k(a,b);a.prototype._next=function(a){this.unsubscribeInner();this.active++;this.add(this.innerSubscription=p(this,a))};a.prototype._complete=function(){this.hasCompleted=
!0;0===this.active&&this.destination.complete()};a.prototype.unsubscribeInner=function(){this.active=0<this.active?this.active-1:0;var a=this.innerSubscription;a&&(a.unsubscribe(),this.remove(a))};a.prototype.notifyNext=function(a,b,d,f,h){this.destination.next(b)};a.prototype.notifyError=function(a){this.destination.error(a)};a.prototype.notifyComplete=function(){this.unsubscribeInner();this.hasCompleted&&0===this.active&&this.destination.complete()};return a}(q);g.prototype.switch=Ja;g.prototype._switch=
Ja;var Qe=function(){function b(a,b){this.project=a;this.resultSelector=b}b.prototype.call=function(a,b){return b.subscribe(new Pe(a,this.project,this.resultSelector))};return b}(),Pe=function(b){function a(a,e,d){b.call(this,a);this.project=e;this.resultSelector=d;this.index=0}k(a,b);a.prototype._next=function(a){var b,c=this.index++;try{b=this.project(a,c)}catch(f){this.destination.error(f);return}this._innerSub(b,a,c)};a.prototype._innerSub=function(a,b,d){var c=this.innerSubscription;c&&c.unsubscribe();
this.add(this.innerSubscription=p(this,a,b,d))};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.remove(a);this.innerSubscription=null;this.isStopped&&b.prototype._complete.call(this)};a.prototype.notifyNext=function(a,b,d,f,h){this.resultSelector?this._tryNotifyNext(a,b,d,f):this.destination.next(b)};a.prototype._tryNotifyNext=function(a,
b,d,f){var c;try{c=this.resultSelector(a,b,d,f)}catch(y){this.destination.error(y);return}this.destination.next(c)};return a}(q);g.prototype.switchMap=function(b,a){return this.lift(new Qe(b,a))};var Se=function(){function b(a,b){this.observable=a;this.resultSelector=b}b.prototype.call=function(a,b){return b.subscribe(new Re(a,this.observable,this.resultSelector))};return b}(),Re=function(b){function a(a,e,d){b.call(this,a);this.inner=e;this.resultSelector=d;this.index=0}k(a,b);a.prototype._next=
function(a){var b=this.innerSubscription;b&&b.unsubscribe();this.add(this.innerSubscription=p(this,this.inner,a,this.index++))};a.prototype._complete=function(){var a=this.innerSubscription;a&&!a.closed||b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){this.innerSubscription=null};a.prototype.notifyComplete=function(a){this.remove(a);this.innerSubscription=null;this.isStopped&&b.prototype._complete.call(this)};a.prototype.notifyNext=function(a,b,d,f,h){h=this.destination;this.resultSelector?
this.tryResultSelector(a,b,d,f):h.next(b)};a.prototype.tryResultSelector=function(a,b,d,f){var c=this.resultSelector,e=this.destination,g;try{g=c(a,b,d,f)}catch(B){e.error(B);return}e.next(g)};return a}(q);g.prototype.switchMapTo=function(b,a){return this.lift(new Se(b,a))};var Ue=function(){function b(a){this.total=a;if(0>this.total)throw new M;}b.prototype.call=function(a,b){return b.subscribe(new Te(a,this.total))};return b}(),Te=function(b){function a(a,e){b.call(this,a);this.total=e;this.count=
0}k(a,b);a.prototype._next=function(a){var b=this.total,c=++this.count;c<=b&&(this.destination.next(a),c===b&&(this.destination.complete(),this.unsubscribe()))};return a}(l);g.prototype.take=function(b){return 0===b?new F:this.lift(new Ue(b))};var We=function(){function b(a){this.total=a;if(0>this.total)throw new M;}b.prototype.call=function(a,b){return b.subscribe(new Ve(a,this.total))};return b}(),Ve=function(b){function a(a,e){b.call(this,a);this.total=e;this.ring=[];this.count=0}k(a,b);a.prototype._next=
function(a){var b=this.ring,c=this.total,f=this.count++;b.length<c?b.push(a):b[f%c]=a};a.prototype._complete=function(){var a=this.destination,b=this.count;if(0<b)for(var d=this.count>=this.total?this.total:this.count,f=this.ring,h=0;h<d;h++){var g=b++%d;a.next(f[g])}a.complete()};return a}(l);g.prototype.takeLast=function(b){return 0===b?new F:this.lift(new We(b))};var Ye=function(){function b(a){this.notifier=a}b.prototype.call=function(a,b){return b.subscribe(new Xe(a,this.notifier))};return b}(),
Xe=function(b){function a(a,e){b.call(this,a);this.notifier=e;this.add(p(this,e))}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.complete()};a.prototype.notifyComplete=function(){};return a}(q);g.prototype.takeUntil=function(b){return this.lift(new Ye(b))};var $e=function(){function b(a){this.predicate=a}b.prototype.call=function(a,b){return b.subscribe(new Ze(a,this.predicate))};return b}(),Ze=function(b){function a(a,e){b.call(this,a);this.predicate=e;this.index=0}k(a,b);a.prototype._next=
function(a){var b=this.destination,c;try{c=this.predicate(a,this.index++)}catch(f){b.error(f);return}this.nextOrComplete(a,c)};a.prototype.nextOrComplete=function(a,b){var c=this.destination;b?c.next(a):c.complete()};return a}(l);g.prototype.takeWhile=function(b){return this.lift(new $e(b))};var fb={leading:!0,trailing:!1},bf=function(){function b(a,b,e){this.durationSelector=a;this.leading=b;this.trailing=e}b.prototype.call=function(a,b){return b.subscribe(new af(a,this.durationSelector,this.leading,
this.trailing))};return b}(),af=function(b){function a(a,e,d,f){b.call(this,a);this.destination=a;this.durationSelector=e;this._leading=d;this._trailing=f;this._hasTrailingValue=!1}k(a,b);a.prototype._next=function(a){if(this.throttled)this._trailing&&(this._hasTrailingValue=!0,this._trailingValue=a);else{var b=this.tryDurationSelector(a);b&&this.add(this.throttled=p(this,b));this._leading&&(this.destination.next(a),this._trailing&&(this._hasTrailingValue=!0,this._trailingValue=a))}};a.prototype.tryDurationSelector=
function(a){try{return this.durationSelector(a)}catch(e){return this.destination.error(e),null}};a.prototype._unsubscribe=function(){var a=this.throttled;this._trailingValue=null;this._hasTrailingValue=!1;a&&(this.remove(a),this.throttled=null,a.unsubscribe())};a.prototype._sendTrailing=function(){var a=this.destination,b=this._trailing,d=this._trailingValue,f=this._hasTrailingValue;this.throttled&&b&&f&&(a.next(d),this._trailingValue=null,this._hasTrailingValue=!1)};a.prototype.notifyNext=function(a,
b,d,f,h){this._sendTrailing();this._unsubscribe()};a.prototype.notifyComplete=function(){this._sendTrailing();this._unsubscribe()};return a}(q);g.prototype.throttle=function(b,a){void 0===a&&(a=fb);return this.lift(new bf(b,a.leading,a.trailing))};var df=function(){function b(a,b,e,d){this.duration=a;this.scheduler=b;this.leading=e;this.trailing=d}b.prototype.call=function(a,b){return b.subscribe(new cf(a,this.duration,this.scheduler,this.leading,this.trailing))};return b}(),cf=function(b){function a(a,
e,d,f,h){b.call(this,a);this.duration=e;this.scheduler=d;this.leading=f;this.trailing=h;this._hasTrailingValue=!1;this._trailingValue=null}k(a,b);a.prototype._next=function(a){this.throttled?this.trailing&&(this._trailingValue=a,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Ub,this.duration,{subscriber:this})),this.leading&&this.destination.next(a))};a.prototype.clearThrottle=function(){var a=this.throttled;a&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),
this._trailingValue=null,this._hasTrailingValue=!1),a.unsubscribe(),this.remove(a),this.throttled=null)};return a}(l);g.prototype.throttleTime=function(b,a,c){void 0===a&&(a=x);void 0===c&&(c=fb);return this.lift(new df(b,a,c.leading,c.trailing))};var gb=function(){return function(b,a){this.value=b;this.interval=a}}(),ff=function(){function b(a){this.scheduler=a}b.prototype.call=function(a,b){return b.subscribe(new ef(a,this.scheduler))};return b}(),ef=function(b){function a(a,e){b.call(this,a);this.scheduler=
e;this.lastTime=0;this.lastTime=e.now()}k(a,b);a.prototype._next=function(a){var b=this.scheduler.now(),c=b-this.lastTime;this.lastTime=b;this.destination.next(new gb(a,c))};return a}(l);g.prototype.timeInterval=function(b){void 0===b&&(b=x);return this.lift(new ff(b))};var hb=function(b){function a(){var a=b.call(this,"Timeout has occurred");this.name=a.name="TimeoutError";this.stack=a.stack;this.message=a.message}k(a,b);return a}(Error),hf=function(){function b(a,b,e,d){this.waitFor=a;this.absoluteTimeout=
b;this.scheduler=e;this.errorInstance=d}b.prototype.call=function(a,b){return b.subscribe(new gf(a,this.absoluteTimeout,this.waitFor,this.scheduler,this.errorInstance))};return b}(),gf=function(b){function a(a,e,d,f,h){b.call(this,a);this.absoluteTimeout=e;this.waitFor=d;this.scheduler=f;this.errorInstance=h;this.action=null;this.scheduleTimeout()}k(a,b);a.dispatchTimeout=function(a){a.error(a.errorInstance)};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=b.schedule(this,this.waitFor):
this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();b.prototype._next.call(this,a)};a.prototype._unsubscribe=function(){this.errorInstance=this.scheduler=this.action=null};return a}(l);g.prototype.timeout=function(b,a){void 0===a&&(a=x);var c=X(b);b=c?+b-a.now():Math.abs(b);return this.lift(new hf(b,c,a,new hb))};var kf=function(){function b(a,b,e,d){this.waitFor=a;this.absoluteTimeout=b;this.withObservable=
e;this.scheduler=d}b.prototype.call=function(a,b){return b.subscribe(new jf(a,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))};return b}(),jf=function(b){function a(a,e,d,f,h){b.call(this,a);this.absoluteTimeout=e;this.waitFor=d;this.withObservable=f;this.scheduler=h;this.action=null;this.scheduleTimeout()}k(a,b);a.dispatchTimeout=function(a){var b=a.withObservable;a._unsubscribeAndRecycle();a.add(p(a,b))};a.prototype.scheduleTimeout=function(){var b=this.action;b?this.action=
b.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(a.dispatchTimeout,this.waitFor,this))};a.prototype._next=function(a){this.absoluteTimeout||this.scheduleTimeout();b.prototype._next.call(this,a)};a.prototype._unsubscribe=function(){this.withObservable=this.scheduler=this.action=null};return a}(q);g.prototype.timeoutWith=function(b,a,c){void 0===c&&(c=x);var e=X(b);b=e?+b-c.now():Math.abs(b);return this.lift(new kf(b,e,a,c))};var ib=function(){return function(b,a){this.value=
b;this.timestamp=a}}(),mf=function(){function b(a){this.scheduler=a}b.prototype.call=function(a,b){return b.subscribe(new lf(a,this.scheduler))};return b}(),lf=function(b){function a(a,e){b.call(this,a);this.scheduler=e}k(a,b);a.prototype._next=function(a){var b=this.scheduler.now();this.destination.next(new ib(a,b))};return a}(l);g.prototype.timestamp=function(b){void 0===b&&(b=x);return this.lift(new mf(b))};var of=function(){function b(){}b.prototype.call=function(a,b){return b.subscribe(new nf(a))};
return b}(),nf=function(b){function a(a){b.call(this,a);this.array=[]}k(a,b);a.prototype._next=function(a){this.array.push(a)};a.prototype._complete=function(){this.destination.next(this.array);this.destination.complete()};return a}(l);g.prototype.toArray=function(){return this.lift(new of)};g.prototype.toPromise=function(b){var a=this;b||(n.Rx&&n.Rx.config&&n.Rx.config.Promise?b=n.Rx.config.Promise:n.Promise&&(b=n.Promise));if(!b)throw Error("no Promise impl found");return new b(function(b,e){var c;
a.subscribe(function(a){return c=a},function(a){return e(a)},function(){return b(c)})})};var qf=function(){function b(a){this.windowBoundaries=a}b.prototype.call=function(a,b){a=new pf(a);b=b.subscribe(a);b.closed||a.add(p(a,this.windowBoundaries));return b};return b}(),pf=function(b){function a(a){b.call(this,a);this.window=new v;a.next(this.window)}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.openWindow()};a.prototype.notifyError=function(a,b){this._error(a)};a.prototype.notifyComplete=
function(a){this._complete()};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a)};a.prototype._complete=function(){this.window.complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.window=null};a.prototype.openWindow=function(){var a=this.window;a&&a.complete();var a=this.destination,b=this.window=new v;a.next(b)};return a}(q);g.prototype.window=function(b){return this.lift(new qf(b))};var sf=
function(){function b(a,b){this.windowSize=a;this.startWindowEvery=b}b.prototype.call=function(a,b){return b.subscribe(new rf(a,this.windowSize,this.startWindowEvery))};return b}(),rf=function(b){function a(a,e,d){b.call(this,a);this.destination=a;this.windowSize=e;this.startWindowEvery=d;this.windows=[new v];this.count=0;a.next(this.windows[0])}k(a,b);a.prototype._next=function(a){for(var b=0<this.startWindowEvery?this.startWindowEvery:this.windowSize,c=this.destination,f=this.windowSize,h=this.windows,
g=h.length,k=0;k<g&&!this.closed;k++)h[k].next(a);a=this.count-f+1;0<=a&&0===a%b&&!this.closed&&h.shift().complete();0!==++this.count%b||this.closed||(b=new v,h.push(b),c.next(b))};a.prototype._error=function(a){var b=this.windows;if(b)for(;0<b.length&&!this.closed;)b.shift().error(a);this.destination.error(a)};a.prototype._complete=function(){var a=this.windows;if(a)for(;0<a.length&&!this.closed;)a.shift().complete();this.destination.complete()};a.prototype._unsubscribe=function(){this.count=0;this.windows=
null};return a}(l);g.prototype.windowCount=function(b,a){void 0===a&&(a=0);return this.lift(new sf(b,a))};var uf=function(){function b(a,b,e,d){this.windowTimeSpan=a;this.windowCreationInterval=b;this.maxWindowSize=e;this.scheduler=d}b.prototype.call=function(a,b){return b.subscribe(new tf(a,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))};return b}(),vf=function(b){function a(){b.apply(this,arguments);this._numberOfNextedValues=0}k(a,b);a.prototype.next=function(a){this._numberOfNextedValues++;
b.prototype.next.call(this,a)};Object.defineProperty(a.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0});return a}(v),tf=function(b){function a(a,e,d,f,h){b.call(this,a);this.destination=a;this.windowTimeSpan=e;this.windowCreationInterval=d;this.maxWindowSize=f;this.scheduler=h;this.windows=[];a=this.openWindow();null!==d&&0<=d?(f={windowTimeSpan:e,windowCreationInterval:d,subscriber:this,scheduler:h},this.add(h.schedule(Ka,e,{subscriber:this,
window:a,context:null})),this.add(h.schedule(Wb,d,f))):this.add(h.schedule(Vb,e,{subscriber:this,window:a,windowTimeSpan:e}))}k(a,b);a.prototype._next=function(a){for(var b=this.windows,c=b.length,f=0;f<c;f++){var h=b[f];h.closed||(h.next(a),h.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(h))}};a.prototype._error=function(a){for(var b=this.windows;0<b.length;)b.shift().error(a);this.destination.error(a)};a.prototype._complete=function(){for(var a=this.windows;0<a.length;){var b=a.shift();
b.closed||b.complete()}this.destination.complete()};a.prototype.openWindow=function(){var a=new vf;this.windows.push(a);this.destination.next(a);return a};a.prototype.closeWindow=function(a){a.complete();var b=this.windows;b.splice(b.indexOf(a),1)};return a}(l);g.prototype.windowTime=function(b,a,c,e){var d=x,f=null,h=Number.POSITIVE_INFINITY;z(e)&&(d=e);z(c)?d=c:Q(c)&&(h=c);z(a)?d=a:Q(a)&&(f=a);return this.lift(new uf(b,f,h,d))};var xf=function(){function b(a,b){this.openings=a;this.closingSelector=
b}b.prototype.call=function(a,b){return b.subscribe(new wf(a,this.openings,this.closingSelector))};return b}(),wf=function(b){function a(a,e,d){b.call(this,a);this.openings=e;this.closingSelector=d;this.contexts=[];this.add(this.openSubscription=p(this,e,e))}k(a,b);a.prototype._next=function(a){var b=this.contexts;if(b)for(var c=b.length,f=0;f<c;f++)b[f].window.next(a)};a.prototype._error=function(a){var c=this.contexts;this.contexts=null;if(c)for(var d=c.length,f=-1;++f<d;){var h=c[f];h.window.error(a);
h.subscription.unsubscribe()}b.prototype._error.call(this,a)};a.prototype._complete=function(){var a=this.contexts;this.contexts=null;if(a)for(var e=a.length,d=-1;++d<e;){var f=a[d];f.window.complete();f.subscription.unsubscribe()}b.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var a=this.contexts;this.contexts=null;if(a)for(var b=a.length,d=-1;++d<b;){var f=a[d];f.window.unsubscribe();f.subscription.unsubscribe()}};a.prototype.notifyNext=function(a,b,d,f,h){if(a===this.openings){f=
r(this.closingSelector)(b);if(f===m)return this.error(m.e);a=new v;b=new u;d={window:a,subscription:b};this.contexts.push(d);f=p(this,f,d);f.closed?this.closeWindow(this.contexts.length-1):(f.context=d,b.add(f));this.destination.next(a)}else this.closeWindow(this.contexts.indexOf(a))};a.prototype.notifyError=function(a){this.error(a)};a.prototype.notifyComplete=function(a){a!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(a.context))};a.prototype.closeWindow=function(a){if(-1!==a){var b=
this.contexts,c=b[a],f=c.window,c=c.subscription;b.splice(a,1);f.complete();c.unsubscribe()}};return a}(q);g.prototype.windowToggle=function(b,a){return this.lift(new xf(b,a))};var zf=function(){function b(a){this.closingSelector=a}b.prototype.call=function(a,b){return b.subscribe(new yf(a,this.closingSelector))};return b}(),yf=function(b){function a(a,e){b.call(this,a);this.destination=a;this.closingSelector=e;this.openWindow()}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.openWindow(h)};
a.prototype.notifyError=function(a,b){this._error(a)};a.prototype.notifyComplete=function(a){this.openWindow(a)};a.prototype._next=function(a){this.window.next(a)};a.prototype._error=function(a){this.window.error(a);this.destination.error(a);this.unsubscribeClosingNotification()};a.prototype._complete=function(){this.window.complete();this.destination.complete();this.unsubscribeClosingNotification()};a.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()};
a.prototype.openWindow=function(a){void 0===a&&(a=null);a&&(this.remove(a),a.unsubscribe());(a=this.window)&&a.complete();a=this.window=new v;this.destination.next(a);a=r(this.closingSelector)();a===m?(a=m.e,this.destination.error(a),this.window.error(a)):this.add(this.closingNotification=p(this,a))};return a}(q);g.prototype.windowWhen=function(b){return this.lift(new zf(b))};var Bf=function(){function b(a,b){this.observables=a;this.project=b}b.prototype.call=function(a,b){return b.subscribe(new Af(a,
this.observables,this.project))};return b}(),Af=function(b){function a(a,e,d){b.call(this,a);this.observables=e;this.project=d;this.toRespond=[];a=e.length;this.values=Array(a);for(d=0;d<a;d++)this.toRespond.push(d);for(d=0;d<a;d++){var c=e[d];this.add(p(this,c,c,d))}}k(a,b);a.prototype.notifyNext=function(a,b,d,f,h){this.values[d]=b;a=this.toRespond;0<a.length&&(d=a.indexOf(d),-1!==d&&a.splice(d,1))};a.prototype.notifyComplete=function(){};a.prototype._next=function(a){0===this.toRespond.length&&
(a=[a].concat(this.values),this.project?this._tryProject(a):this.destination.next(a))};a.prototype._tryProject=function(a){var b;try{b=this.project.apply(this,a)}catch(d){this.destination.error(d);return}this.destination.next(b)};return a}(q);g.prototype.withLatestFrom=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];var c;"function"===typeof b[b.length-1]&&(c=b.pop());return this.lift(new Bf(b,c))};g.prototype.zip=function(){for(var b=[],a=0;a<arguments.length;a++)b[a-0]=arguments[a];
return this.lift.call(ua.apply(void 0,[this].concat(b)))};g.prototype.zipAll=function(b){return this.lift(new va(b))};var V=function(){return function(b,a){void 0===a&&(a=Number.POSITIVE_INFINITY);this.subscribedFrame=b;this.unsubscribedFrame=a}}(),jb=function(){function b(){this.subscriptions=[]}b.prototype.logSubscribedFrame=function(){this.subscriptions.push(new V(this.scheduler.now()));return this.subscriptions.length-1};b.prototype.logUnsubscribedFrame=function(a){var b=this.subscriptions;b[a]=
new V(b[a].subscribedFrame,this.scheduler.now())};return b}(),ka=function(b){function a(a,e){b.call(this,function(a){var b=this,c=b.logSubscribedFrame();a.add(new u(function(){b.logUnsubscribedFrame(c)}));b.scheduleMessages(a);return a});this.messages=a;this.subscriptions=[];this.scheduler=e}k(a,b);a.prototype.scheduleMessages=function(a){for(var b=this.messages.length,c=0;c<b;c++){var f=this.messages[c];a.add(this.scheduler.schedule(function(a){a.message.notification.observe(a.subscriber)},f.frame,
{message:f,subscriber:a}))}};return a}(g);La(ka,[jb]);var kb=function(b){function a(a,e){b.call(this);this.messages=a;this.subscriptions=[];this.scheduler=e}k(a,b);a.prototype._subscribe=function(a){var c=this,d=c.logSubscribedFrame();a.add(new u(function(){c.logUnsubscribedFrame(d)}));return b.prototype._subscribe.call(this,a)};a.prototype.setup=function(){for(var a=this,b=a.messages.length,d=0;d<b;d++)(function(){var b=a.messages[d];a.scheduler.schedule(function(){b.notification.observe(a)},b.frame)})()};
return a}(v);La(kb,[jb]);var mb=function(b){function a(a,e){var c=this;void 0===a&&(a=lb);void 0===e&&(e=Number.POSITIVE_INFINITY);b.call(this,a,function(){return c.frame});this.maxFrames=e;this.frame=0;this.index=-1}k(a,b);a.prototype.flush=function(){for(var a=this.actions,b=this.maxFrames,d,f;(f=a.shift())&&(this.frame=f.delay)<=b&&!(d=f.execute(f.state,f.delay)););if(d){for(;f=a.shift();)f.unsubscribe();throw d;}};a.frameTimeFactor=10;return a}(T),lb=function(b){function a(a,e,d){void 0===d&&
(d=a.index+=1);b.call(this,a,e);this.scheduler=a;this.work=e;this.index=d;this.active=!0;this.index=a.index=d}k(a,b);a.prototype.schedule=function(c,e){void 0===e&&(e=0);if(!this.id)return b.prototype.schedule.call(this,c,e);this.active=!1;var d=new a(this.scheduler,this.work);this.add(d);return d.schedule(c,e)};a.prototype.requestAsyncId=function(b,e,d){void 0===d&&(d=0);this.delay=b.frame+d;b=b.actions;b.push(this);b.sort(a.sortActions);return!0};a.prototype.recycleAsyncId=function(a,b,d){};a.prototype._execute=
function(a,e){if(!0===this.active)return b.prototype._execute.call(this,a,e)};a.sortActions=function(a,b){return a.delay===b.delay?a.index===b.index?0:a.index>b.index?1:-1:a.delay>b.delay?1:-1};return a}(S),Cf=function(b){function a(a){b.call(this,lb,750);this.assertDeepEqual=a;this.hotObservables=[];this.coldObservables=[];this.flushTests=[]}k(a,b);a.prototype.createTime=function(b){b=b.indexOf("|");if(-1===b)throw Error('marble diagram for time should have a completion marker "|"');return b*a.frameTimeFactor};
a.prototype.createColdObservable=function(b,e,d){if(-1!==b.indexOf("^"))throw Error('cold observable cannot have subscription offset "^"');if(-1!==b.indexOf("!"))throw Error('cold observable cannot have unsubscription marker "!"');b=a.parseMarbles(b,e,d);b=new ka(b,this);this.coldObservables.push(b);return b};a.prototype.createHotObservable=function(b,e,d){if(-1!==b.indexOf("!"))throw Error('hot observable cannot have unsubscription marker "!"');b=a.parseMarbles(b,e,d);b=new kb(b,this);this.hotObservables.push(b);
return b};a.prototype.materializeInnerObservable=function(a,b){var c=this,e=[];a.subscribe(function(a){e.push({frame:c.frame-b,notification:w.createNext(a)})},function(a){e.push({frame:c.frame-b,notification:w.createError(a)})},function(){e.push({frame:c.frame-b,notification:w.createComplete()})});return e};a.prototype.expectObservable=function(b,e){var c=this;void 0===e&&(e=null);var f=[],h={actual:f,ready:!1};e=a.parseMarblesAsSubscriptions(e).unsubscribedFrame;var k;this.schedule(function(){k=
b.subscribe(function(a){var b=a;a instanceof g&&(b=c.materializeInnerObservable(b,c.frame));f.push({frame:c.frame,notification:w.createNext(b)})},function(a){f.push({frame:c.frame,notification:w.createError(a)})},function(){f.push({frame:c.frame,notification:w.createComplete()})})},0);e!==Number.POSITIVE_INFINITY&&this.schedule(function(){return k.unsubscribe()},e);this.flushTests.push(h);return{toBe:function(b,c,d){h.ready=!0;h.expected=a.parseMarbles(b,c,d,!0)}}};a.prototype.expectSubscriptions=
function(b){var c={actual:b,ready:!1};this.flushTests.push(c);return{toBe:function(b){b="string"===typeof b?[b]:b;c.ready=!0;c.expected=b.map(function(b){return a.parseMarblesAsSubscriptions(b)})}}};a.prototype.flush=function(){for(var a=this.hotObservables;0<a.length;)a.shift().setup();b.prototype.flush.call(this);for(a=this.flushTests.filter(function(a){return a.ready});0<a.length;){var e=a.shift();this.assertDeepEqual(e.actual,e.expected)}};a.parseMarblesAsSubscriptions=function(a){if("string"!==
typeof a)return new V(Number.POSITIVE_INFINITY);for(var b=a.length,c=-1,f=Number.POSITIVE_INFINITY,g=Number.POSITIVE_INFINITY,k=0;k<b;k++){var l=k*this.frameTimeFactor,m=a[k];switch(m){case "-":case " ":break;case "(":c=l;break;case ")":c=-1;break;case "^":if(f!==Number.POSITIVE_INFINITY)throw Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");f=-1<c?c:l;break;case "!":if(g!==Number.POSITIVE_INFINITY)throw Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");
g=-1<c?c:l;break;default:throw Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+m+"'.");}}return 0>g?new V(f):new V(f,g)};a.parseMarbles=function(a,b,d,f){void 0===f&&(f=!1);if(-1!==a.indexOf("!"))throw Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var c=a.length,e=[],g=a.indexOf("^"),g=-1===g?0:g*-this.frameTimeFactor,k="object"!==typeof b?function(a){return a}:function(a){return f&&b[a]instanceof ka?b[a].messages:
b[a]},l=-1,m=0;m<c;m++){var n=m*this.frameTimeFactor+g,p=void 0,q=a[m];switch(q){case "-":case " ":break;case "(":l=n;break;case ")":l=-1;break;case "|":p=w.createComplete();break;case "^":break;case "#":p=w.createError(d||"error");break;default:p=w.createNext(k(q))}p&&e.push({frame:-1<l?l:n,notification:p})}return e};return a}(mb),nb=new (function(){return function(b){b.requestAnimationFrame?(this.cancelAnimationFrame=b.cancelAnimationFrame.bind(b),this.requestAnimationFrame=b.requestAnimationFrame.bind(b)):
b.mozRequestAnimationFrame?(this.cancelAnimationFrame=b.mozCancelAnimationFrame.bind(b),this.requestAnimationFrame=b.mozRequestAnimationFrame.bind(b)):b.webkitRequestAnimationFrame?(this.cancelAnimationFrame=b.webkitCancelAnimationFrame.bind(b),this.requestAnimationFrame=b.webkitRequestAnimationFrame.bind(b)):b.msRequestAnimationFrame?(this.cancelAnimationFrame=b.msCancelAnimationFrame.bind(b),this.requestAnimationFrame=b.msRequestAnimationFrame.bind(b)):b.oRequestAnimationFrame?(this.cancelAnimationFrame=
b.oCancelAnimationFrame.bind(b),this.requestAnimationFrame=b.oRequestAnimationFrame.bind(b)):(this.cancelAnimationFrame=b.clearTimeout.bind(b),this.requestAnimationFrame=function(a){return b.setTimeout(a,1E3/60)})}}())(n),Df=function(b){function a(a,e){b.call(this,a,e);this.scheduler=a;this.work=e}k(a,b);a.prototype.requestAsyncId=function(a,e,d){void 0===d&&(d=0);if(null!==d&&0<d)return b.prototype.requestAsyncId.call(this,a,e,d);a.actions.push(this);return a.scheduled||(a.scheduled=nb.requestAnimationFrame(a.flush.bind(a,
null)))};a.prototype.recycleAsyncId=function(a,e,d){void 0===d&&(d=0);if(null!==d&&0<d||null===d&&0<this.delay)return b.prototype.recycleAsyncId.call(this,a,e,d);0===a.actions.length&&(nb.cancelAnimationFrame(e),a.scheduled=void 0)};return a}(S),Ef=new (function(b){function a(){b.apply(this,arguments)}k(a,b);a.prototype.flush=function(a){this.active=!0;this.scheduled=void 0;var b=this.actions,c,f=-1,g=b.length;a=a||b.shift();do if(c=a.execute(a.state,a.delay))break;while(++f<g&&(a=b.shift()));this.active=
!1;if(c){for(;++f<g&&(a=b.shift());)a.unsubscribe();throw c;}};return a}(T))(Df),Ff={rxSubscriber:R,observable:I,iterator:A};t.Scheduler={asap:ca,queue:Ya,animationFrame:Ef,async:x};t.Symbol=Ff;t.Subject=v;t.AnonymousSubject=Z;t.Observable=g;t.Subscription=u;t.Subscriber=l;t.AsyncSubject=L;t.ReplaySubject=K;t.BehaviorSubject=cb;t.ConnectableObservable=bb;t.Notification=w;t.EmptyError=ba;t.ArgumentOutOfRangeError=M;t.ObjectUnsubscribedError=H;t.TimeoutError=hb;t.UnsubscriptionError=O;t.TimeInterval=
gb;t.Timestamp=ib;t.TestScheduler=Cf;t.VirtualTimeScheduler=mb;t.AjaxResponse=Wa;t.AjaxError=aa;t.AjaxTimeoutError=Xa;Object.defineProperty(t,"__esModule",{value:!0})});