Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rx

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx - npm Package Compare versions

Comparing version 2.3.18 to 2.3.19

src/core/linq/observable/bufferwithtimeorcount.js

2

bower.json
{
"name": "rxjs",
"version": "2.3.18",
"version": "2.3.19",
"main": [

@@ -5,0 +5,0 @@ "dist/rx.all.js",

@@ -714,38 +714,48 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

if (!!root.Set) {
/**
* Converts the observable sequence to a Set if it exists.
* @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
*/
observableProto.toSet = function () {
var source = this;
return new AnonymousObservable(function (observer) {
var s = new root.Set();
return source.subscribe(
s.add.bind(s),
observer.onError.bind(observer),
function () {
observer.onNext(s);
observer.onCompleted();
});
});
};
}
if (!!root.Map) {
/**
* Converts the observable sequence to a Map if it exists.
* @param {Function} keySelector A function which produces the key for the Map.
* @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
* @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
*/
observableProto.toMap = function (keySelector, elementSelector) {
var source = this;
return new AnonymousObservable(function (observer) {
var m = new root.Map();
return source.subscribe(
function (x) {
var key;
/**
* Converts the observable sequence to a Set if it exists.
* @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
*/
observableProto.toSet = function () {
if (typeof root.Set === 'undefined') { throw new TypeError(); }
var source = this;
return new AnonymousObservable(function (observer) {
var s = new root.Set();
return source.subscribe(
s.add.bind(s),
observer.onError.bind(observer),
function () {
observer.onNext(s);
observer.onCompleted();
});
});
};
/**
* Converts the observable sequence to a Map if it exists.
* @param {Function} keySelector A function which produces the key for the Map.
* @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
* @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
*/
observableProto.toMap = function (keySelector, elementSelector) {
if (typeof root.Map === 'undefined') { throw new TypeError(); }
var source = this;
return new AnonymousObservable(function (observer) {
var m = new root.Map();
return source.subscribe(
function (x) {
var key;
try {
key = keySelector(x);
} catch (e) {
observer.onError(e);
return;
}
var element = x;
if (elementSelector) {
try {
key = keySelector(x);
element = elementSelector(x);
} catch (e) {

@@ -755,25 +765,15 @@ observer.onError(e);

}
}
var element = x;
if (elementSelector) {
try {
element = elementSelector(x);
} catch (e) {
observer.onError(e);
return;
}
}
m.set(key, element);
},
observer.onError.bind(observer),
function () {
observer.onNext(m);
observer.onCompleted();
});
});
};
m.set(key, element);
},
observer.onError.bind(observer),
function () {
observer.onNext(m);
observer.onCompleted();
});
});
};
}
return Rx;
}));
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b,c){return new o(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},d.onError.bind(d),function(){d.onNext(g),d.onCompleted()})})}function f(a){if(0===a.length)throw new Error(D);return a[0]}function g(a,b,c,d){if(0>b)throw new Error(C);return new o(function(e){var f=b;return a.subscribe(function(a){0===f&&(e.onNext(a),e.onCompleted()),f--},e.onError.bind(e),function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Error(C))})})}function h(a,b,c){return new o(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(D))})})}function i(a,b,c){return new o(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},d.onError.bind(d),function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Error(D))})})}function j(a,b,c){return new o(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(D))})})}function k(a,b,c,e){return new o(function(f){var g=0;return a.subscribe(function(d){var h;try{h=b.call(c,d,g,a)}catch(i){return void f.onError(i)}h?(f.onNext(e?g:d),f.onCompleted()):g++},f.onError.bind(f),function(){f.onNext(e?-1:d),f.onCompleted()})})}var l=c.Observable,m=l.prototype,n=c.CompositeDisposable,o=c.AnonymousObservable,p=c.Disposable.empty,q=(c.internals.isEqual,c.helpers),r=q.not,s=q.defaultComparer,t=q.identity,u=q.defaultSubComparer,v=q.isFunction,w=q.isPromise,x=q.isArrayLike,y=q.isIterable,z=l.fromPromise,A=l.from,B=q.deprecate,C="Argument out of range",D="Sequence contains no elements.";return m.finalValue=function(){var a=this;return new o(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(D))})})},m.aggregate=function(){B("aggregate","reduce");var a,b,c;return 2===arguments.length?(a=arguments[0],b=!0,c=arguments[1]):c=arguments[0],b?this.scan(a,c).startWith(a).finalValue():this.scan(c).finalValue()},m.reduce=function(a){var b,c;return 2===arguments.length&&(c=!0,b=arguments[1]),c?this.scan(b,a).startWith(b).finalValue():this.scan(a).finalValue()},m.some=function(a,b){var c=this;return a?c.filter(a,b).some():new o(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},a.onError.bind(a),function(){a.onNext(!1),a.onCompleted()})})},m.any=function(){return B("any","some"),this.some.apply(this,arguments)},m.isEmpty=function(){return this.any().map(r)},m.every=function(a,b){return this.filter(function(b){return!a(b)},b).some().map(r)},m.all=function(){return B("all","every"),this.every.apply(this,arguments)},m.contains=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new o(function(e){var f=0,g=+b||0;return 1/0===Math.abs(g)&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),p):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},e.onError.bind(e),function(){e.onNext(!1),e.onCompleted()})})},m.count=function(a,b){return a?this.where(a,b).count():this.aggregate(0,function(a){return a+1})},m.indexOf=function(a,b){var c=this;return new o(function(d){var e=0,f=+b||0;return 1/0===Math.abs(f)&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),p):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},d.onError.bind(d),function(){d.onNext(-1),d.onCompleted()})})},m.sum=function(a,b){return a&&v(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},m.minBy=function(a,b){return b||(b=u),e(this,a,function(a,c){return-1*b(a,c)})},m.min=function(a){return this.minBy(t,a).map(function(a){return f(a)})},m.maxBy=function(a,b){return b||(b=u),e(this,a,b)},m.max=function(a){return this.maxBy(t,a).map(function(a){return f(a)})},m.average=function(a,b){return a&&v(a)?this.select(a,b).average():this.scan({sum:0,count:0},function(a,b){return{sum:a.sum+b,count:a.count+1}}).finalValue().map(function(a){if(0===a.count)throw new Error("The input sequence was empty");return a.sum/a.count})},m.sequenceEqual=function(a,b){var c=this;return b||(b=s),new o(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},d.onError.bind(d),function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(x(a)||y(a))&&(a=A(a)),w(a)&&(a=z(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},d.onError.bind(d),function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new n(i,j)})},m.elementAt=function(a){return g(this,a,!1)},m.elementAtOrDefault=function(a,b){return g(this,a,!0,b)},m.single=function(a,b){return a&&v(a)?this.where(a,b).single():h(this,!1)},m.singleOrDefault=function(a,b,c){return a&&v(a)?this.where(a,c).singleOrDefault(null,b):h(this,!0,b)},m.first=function(a,b){return a?this.where(a,b).first():i(this,!1)},m.firstOrDefault=function(a,b){return a?this.where(a).firstOrDefault(null,b):i(this,!0,b)},m.last=function(a,b){return a?this.where(a,b).last():j(this,!1)},m.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):j(this,!0,b)},m.find=function(a,b){return k(this,a,b,!1)},m.findIndex=function(a,b){return k(this,a,b,!0)},a.Set&&(m.toSet=function(){var b=this;return new o(function(c){var d=new a.Set;return b.subscribe(d.add.bind(d),c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})}),a.Map&&(m.toMap=function(b,c){var d=this;return new o(function(e){var f=new a.Map;return d.subscribe(function(a){var d;try{d=b(a)}catch(g){return void e.onError(g)}var h=a;if(c)try{h=c(a)}catch(g){return void e.onError(g)}f.set(d,h)},e.onError.bind(e),function(){e.onNext(f),e.onCompleted()})})}),c});
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b,c){return new o(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},d.onError.bind(d),function(){d.onNext(g),d.onCompleted()})})}function f(a){if(0===a.length)throw new Error(D);return a[0]}function g(a,b,c,d){if(0>b)throw new Error(C);return new o(function(e){var f=b;return a.subscribe(function(a){0===f&&(e.onNext(a),e.onCompleted()),f--},e.onError.bind(e),function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Error(C))})})}function h(a,b,c){return new o(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(D))})})}function i(a,b,c){return new o(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},d.onError.bind(d),function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Error(D))})})}function j(a,b,c){return new o(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(D))})})}function k(a,b,c,e){return new o(function(f){var g=0;return a.subscribe(function(d){var h;try{h=b.call(c,d,g,a)}catch(i){return void f.onError(i)}h?(f.onNext(e?g:d),f.onCompleted()):g++},f.onError.bind(f),function(){f.onNext(e?-1:d),f.onCompleted()})})}var l=c.Observable,m=l.prototype,n=c.CompositeDisposable,o=c.AnonymousObservable,p=c.Disposable.empty,q=(c.internals.isEqual,c.helpers),r=q.not,s=q.defaultComparer,t=q.identity,u=q.defaultSubComparer,v=q.isFunction,w=q.isPromise,x=q.isArrayLike,y=q.isIterable,z=l.fromPromise,A=l.from,B=q.deprecate,C="Argument out of range",D="Sequence contains no elements.";return m.finalValue=function(){var a=this;return new o(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(D))})})},m.aggregate=function(){B("aggregate","reduce");var a,b,c;return 2===arguments.length?(a=arguments[0],b=!0,c=arguments[1]):c=arguments[0],b?this.scan(a,c).startWith(a).finalValue():this.scan(c).finalValue()},m.reduce=function(a){var b,c;return 2===arguments.length&&(c=!0,b=arguments[1]),c?this.scan(b,a).startWith(b).finalValue():this.scan(a).finalValue()},m.some=function(a,b){var c=this;return a?c.filter(a,b).some():new o(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},a.onError.bind(a),function(){a.onNext(!1),a.onCompleted()})})},m.any=function(){return B("any","some"),this.some.apply(this,arguments)},m.isEmpty=function(){return this.any().map(r)},m.every=function(a,b){return this.filter(function(b){return!a(b)},b).some().map(r)},m.all=function(){return B("all","every"),this.every.apply(this,arguments)},m.contains=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new o(function(e){var f=0,g=+b||0;return 1/0===Math.abs(g)&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),p):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},e.onError.bind(e),function(){e.onNext(!1),e.onCompleted()})})},m.count=function(a,b){return a?this.where(a,b).count():this.aggregate(0,function(a){return a+1})},m.indexOf=function(a,b){var c=this;return new o(function(d){var e=0,f=+b||0;return 1/0===Math.abs(f)&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),p):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},d.onError.bind(d),function(){d.onNext(-1),d.onCompleted()})})},m.sum=function(a,b){return a&&v(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},m.minBy=function(a,b){return b||(b=u),e(this,a,function(a,c){return-1*b(a,c)})},m.min=function(a){return this.minBy(t,a).map(function(a){return f(a)})},m.maxBy=function(a,b){return b||(b=u),e(this,a,b)},m.max=function(a){return this.maxBy(t,a).map(function(a){return f(a)})},m.average=function(a,b){return a&&v(a)?this.select(a,b).average():this.scan({sum:0,count:0},function(a,b){return{sum:a.sum+b,count:a.count+1}}).finalValue().map(function(a){if(0===a.count)throw new Error("The input sequence was empty");return a.sum/a.count})},m.sequenceEqual=function(a,b){var c=this;return b||(b=s),new o(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},d.onError.bind(d),function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(x(a)||y(a))&&(a=A(a)),w(a)&&(a=z(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},d.onError.bind(d),function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new n(i,j)})},m.elementAt=function(a){return g(this,a,!1)},m.elementAtOrDefault=function(a,b){return g(this,a,!0,b)},m.single=function(a,b){return a&&v(a)?this.where(a,b).single():h(this,!1)},m.singleOrDefault=function(a,b,c){return a&&v(a)?this.where(a,c).singleOrDefault(null,b):h(this,!0,b)},m.first=function(a,b){return a?this.where(a,b).first():i(this,!1)},m.firstOrDefault=function(a,b){return a?this.where(a).firstOrDefault(null,b):i(this,!0,b)},m.last=function(a,b){return a?this.where(a,b).last():j(this,!1)},m.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):j(this,!0,b)},m.find=function(a,b){return k(this,a,b,!1)},m.findIndex=function(a,b){return k(this,a,b,!0)},m.toSet=function(){if("undefined"==typeof a.Set)throw new TypeError;var b=this;return new o(function(c){var d=new a.Set;return b.subscribe(d.add.bind(d),c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},m.toMap=function(b,c){if("undefined"==typeof a.Map)throw new TypeError;var d=this;return new o(function(e){var f=new a.Map;return d.subscribe(function(a){var d;try{d=b(a)}catch(g){return void e.onError(g)}var h=a;if(c)try{h=c(a)}catch(g){return void e.onError(g)}f.set(d,h)},e.onError.bind(e),function(){e.onNext(f),e.onCompleted()})})},c});
//# sourceMappingURL=rx.aggregates.map

@@ -343,4 +343,2 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

var n = this.q.length;
for (var i = 0, len = this.q.length; i < len; i++) {

@@ -351,10 +349,8 @@ so.onNext(this.q[i].value);

if (this.hasError) {
n++;
so.onError(this.error);
} else if (this.isStopped) {
n++;
so.onCompleted();
}
so.ensureActive(n);
so.ensureActive();
return subscription;

@@ -361,0 +357,0 @@ }

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(){if(this.isDisposed)throw new Error(s)}var e=c.Observable,f=e.prototype,g=c.AnonymousObservable,h=c.Subject,i=c.AsyncSubject,j=c.Observer,k=c.internals.ScheduledObserver,l=c.Disposable.create,m=c.Disposable.empty,n=c.CompositeDisposable,o=c.Scheduler.currentThread,p=c.helpers.isFunction,q=c.internals.inherits,r=c.internals.addProperties,s="Object has been disposed";f.multicast=function(a,b){var c=this;return"function"==typeof a?new g(function(d){var e=c.multicast(a());return new n(b(e).subscribe(d),e.connect())}):new w(c,a)},f.publish=function(a){return a&&p(a)?this.multicast(function(){return new h},a):this.multicast(new h)},f.share=function(){return this.publish().refCount()},f.publishLast=function(a){return a&&p(a)?this.multicast(function(){return new i},a):this.multicast(new i)},f.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new u(b)},a):this.multicast(new u(a))},f.shareValue=function(a){return this.publishValue(a).refCount()},f.replay=function(a,b,c,d){return a&&p(a)?this.multicast(function(){return new v(b,c,d)},a):this.multicast(new v(b,c,d))},f.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var t=function(a,b){this.subject=a,this.observer=b};t.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var u=c.BehaviorSubject=function(a){function b(a){if(d.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new t(this,a);var b=this.exception;return b?a.onError(b):a.onCompleted(),m}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return q(c,a),r(c.prototype,j,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(d.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=this.observers.slice(0),c=b.length;c>a;a++)b[a].onCompleted();this.observers=[]}},onError:function(a){if(d.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var b=0,c=this.observers.slice(0),e=c.length;e>b;b++)c[b].onError(a);this.observers=[]}},onNext:function(a){if(d.call(this),!this.isStopped){this.value=a;for(var b=0,c=this.observers.slice(0),e=c.length;e>b;b++)c[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(e),v=c.ReplaySubject=function(a){function b(a,b){return l(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function c(a){var c=new k(this.scheduler,a),e=b(this,c);d.call(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)c.onNext(this.q[g].value);return this.hasError?(f++,c.onError(this.error)):this.isStopped&&(f++,c.onCompleted()),c.ensureActive(f),e}function e(b,d,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==d?Number.MAX_VALUE:d,this.scheduler=e||o,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,c)}return q(e,a),r(e.prototype,j,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(d.call(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var c=this.observers.slice(0),e=0,f=c.length;f>e;e++){var g=c[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(d.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var c=this.observers.slice(0),e=0,f=c.length;f>e;e++){var g=c[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(d.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=this.observers.slice(0),c=0,e=b.length;e>c;c++){var f=b[c];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(e),w=c.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new n(f.subscribe(c),l(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return q(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new g(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(e);return c});
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(){if(this.isDisposed)throw new Error(s)}var e=c.Observable,f=e.prototype,g=c.AnonymousObservable,h=c.Subject,i=c.AsyncSubject,j=c.Observer,k=c.internals.ScheduledObserver,l=c.Disposable.create,m=c.Disposable.empty,n=c.CompositeDisposable,o=c.Scheduler.currentThread,p=c.helpers.isFunction,q=c.internals.inherits,r=c.internals.addProperties,s="Object has been disposed";f.multicast=function(a,b){var c=this;return"function"==typeof a?new g(function(d){var e=c.multicast(a());return new n(b(e).subscribe(d),e.connect())}):new w(c,a)},f.publish=function(a){return a&&p(a)?this.multicast(function(){return new h},a):this.multicast(new h)},f.share=function(){return this.publish().refCount()},f.publishLast=function(a){return a&&p(a)?this.multicast(function(){return new i},a):this.multicast(new i)},f.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new u(b)},a):this.multicast(new u(a))},f.shareValue=function(a){return this.publishValue(a).refCount()},f.replay=function(a,b,c,d){return a&&p(a)?this.multicast(function(){return new v(b,c,d)},a):this.multicast(new v(b,c,d))},f.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var t=function(a,b){this.subject=a,this.observer=b};t.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var u=c.BehaviorSubject=function(a){function b(a){if(d.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new t(this,a);var b=this.exception;return b?a.onError(b):a.onCompleted(),m}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return q(c,a),r(c.prototype,j,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(d.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=this.observers.slice(0),c=b.length;c>a;a++)b[a].onCompleted();this.observers=[]}},onError:function(a){if(d.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var b=0,c=this.observers.slice(0),e=c.length;e>b;b++)c[b].onError(a);this.observers=[]}},onNext:function(a){if(d.call(this),!this.isStopped){this.value=a;for(var b=0,c=this.observers.slice(0),e=c.length;e>b;b++)c[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(e),v=c.ReplaySubject=function(a){function b(a,b){return l(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function c(a){var c=new k(this.scheduler,a),e=b(this,c);d.call(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var f=0,g=this.q.length;g>f;f++)c.onNext(this.q[f].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),e}function e(b,d,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==d?Number.MAX_VALUE:d,this.scheduler=e||o,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,c)}return q(e,a),r(e.prototype,j,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(d.call(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var c=this.observers.slice(0),e=0,f=c.length;f>e;e++){var g=c[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(d.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var c=this.observers.slice(0),e=0,f=c.length;f>e;e++){var g=c[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(d.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=this.observers.slice(0),c=0,e=b.length;e>c;c++){var f=b[c];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(e),w=c.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new n(f.subscribe(c),l(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return q(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new g(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(e);return c});
//# sourceMappingURL=rx.binding.map

@@ -60,3 +60,3 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

function isPrime(candidate) {
if (candidate & 1 === 0) { return candidate === 2; }
if ((candidate & 1) === 0) { return candidate === 2; }
var num1 = Math.sqrt(candidate),

@@ -124,6 +124,6 @@ num2 = 3;

}
if (obj.getHashCode) { return obj.getHashCode(); }
if (obj.hashCode) { return obj.hashCode(); }
var id = 17 * uniqueIdCounter++;
obj.getHashCode = function () { return id; };
obj.hashCode = function () { return id; };
return id;

@@ -161,3 +161,3 @@ };

dictionaryProto.add = function (key, value) {
return this._insert(key, value, true);
this._insert(key, value, true);
};

@@ -164,0 +164,0 @@

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return a.groupJoin(this,b,o,function(a,b){return b})}function f(a){var b=this;return new q(function(c){var d=new m,e=new i,f=new j(e);return c.onNext(r(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),v(a)&&(a=w(a)),e.add(a.subscribe(function(){d.onCompleted(),d=new m,c.onNext(r(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f})}function g(a){var b=this;return new q(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}v(b)&&(b=w(b));var i=new k;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(t,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new m,c.onNext(r(h,g)),d()}))}var e=new l,f=new i(e),g=new j(f),h=new m;return c.onNext(r(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g})}var h=c.Observable,i=c.CompositeDisposable,j=c.RefCountDisposable,k=c.SingleAssignmentDisposable,l=c.SerialDisposable,m=c.Subject,n=h.prototype,o=h.empty,p=h.never,q=c.AnonymousObservable,r=(c.Observer.create,c.internals.addRef),s=c.internals.isEqual,t=c.helpers.noop,u=c.helpers.identity,v=c.helpers.isPromise,w=h.fromPromise,x=function(){function a(a){if(a&!1)return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function b(b){var c,d,e;for(c=0;c<h.length;++c)if(d=h[c],d>=b)return d;for(e=1|b;e<h[h.length-1];){if(a(e))return e;e+=2}return b}function c(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function e(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function f(){return{key:null,value:null,next:0,hashCode:0}}function g(a,b){if(0>a)throw new Error("out of range");a>0&&this._initialize(a),this.comparer=b||s,this.freeCount=0,this.size=0,this.freeList=-1}var h=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],i="no such key",j="duplicate key",k=function(){var a=0;return function(b){if(null==b)throw new Error(i);if("string"==typeof b)return c(b);if("number"==typeof b)return e(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return e(b.valueOf());if(b instanceof RegExp)return c(b.toString());if("function"==typeof b.valueOf){var d=b.valueOf();if("number"==typeof d)return e(d);if("string"==typeof b)return c(d)}if(b.getHashCode)return b.getHashCode();var f=17*a++;return b.getHashCode=function(){return f},f}}(),l=g.prototype;return l._initialize=function(a){var c,d=b(a);for(this.buckets=new Array(d),this.entries=new Array(d),c=0;d>c;c++)this.buckets[c]=-1,this.entries[c]=f();this.freeList=-1},l.add=function(a,b){return this._insert(a,b,!0)},l._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&k(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(j);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},l._resize=function(){var a=b(2*this.size),c=new Array(a);for(e=0;e<c.length;++e)c[e]=-1;var d=new Array(a);for(e=0;e<this.size;++e)d[e]=this.entries[e];for(var e=this.size;a>e;++e)d[e]=f();for(var g=0;g<this.size;++g){var h=d[g].hashCode%a;d[g].next=c[h],c[h]=g}this.buckets=c,this.entries=d},l.remove=function(a){if(this.buckets)for(var b=2147483647&k(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},l.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=f();this.freeList=-1,this.size=0}},l._findEntry=function(a){if(this.buckets)for(var b=2147483647&k(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},l.count=function(){return this.size-this.freeCount},l.tryGetValue=function(a){var b=this._findEntry(a);return b>=0?this.entries[b].value:d},l.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},l.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(i)},l.set=function(a,b){this._insert(a,b,!1)},l.containskey=function(a){return this._findEntry(a)>=0},g}();n.join=function(a,b,c,d){var e=this;return new q(function(f){var g=new i,h=!1,j=!1,l=0,m=0,n=new x,o=new x;return g.add(e.subscribe(function(a){var c=l++,e=new k;n.add(c,a),g.add(e);var i,j=function(){n.remove(c)&&0===n.count()&&h&&f.onCompleted(),g.remove(e)};try{i=b(a)}catch(m){return void f.onError(m)}e.setDisposable(i.take(1).subscribe(t,f.onError.bind(f),j)),o.getValues().forEach(function(b){var c;try{c=d(a,b)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){h=!0,(j||0===n.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=m++,e=new k;o.add(b,a),g.add(e);var h,i=function(){o.remove(b)&&0===o.count()&&j&&f.onCompleted(),g.remove(e)};try{h=c(a)}catch(l){return void f.onError(l)}e.setDisposable(h.take(1).subscribe(t,f.onError.bind(f),i)),n.getValues().forEach(function(b){var c;try{c=d(b,a)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){j=!0,(h||0===o.count())&&f.onCompleted()})),g})},n.groupJoin=function(a,b,c,d){var e=this;return new q(function(f){function g(a){return function(b){b.onError(a)}}var h=new i,l=new j(h),n=new x,o=new x,p=0,q=0;return h.add(e.subscribe(function(a){var c=new m,e=p++;n.add(e,c);var i;try{i=d(a,r(c,l))}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}f.onNext(i),o.getValues().forEach(function(a){c.onNext(a)});var q=new k;h.add(q);var s,u=function(){n.remove(e)&&c.onCompleted(),h.remove(q)};try{s=b(a)}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}q.setDisposable(s.take(1).subscribe(t,function(a){n.getValues().forEach(g(a)),f.onError(a)},u))},function(a){n.getValues().forEach(g(a)),f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b=q++;o.add(b,a);var d=new k;h.add(d);var e,i=function(){o.remove(b),h.remove(d)};try{e=c(a)}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}d.setDisposable(e.take(1).subscribe(t,function(a){n.getValues().forEach(g(a)),f.onError(a)},i)),n.getValues().forEach(function(b){b.onNext(a)})},function(a){n.getValues().forEach(g(a)),f.onError(a)})),l})},n.buffer=function(){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},n.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?f.call(this,a):"function"==typeof a?g.call(this,a):e.call(this,a,b)},n.pairwise=function(){var a=this;return new q(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))})},n.partition=function(a,b){var c=this.publish().refCount();return[c.filter(a,b),c.filter(function(c,d,e){return!a.call(b,c,d,e)})]},n.groupBy=function(a,b,c){return this.groupByUntil(a,b,p,c)},n.groupByUntil=function(a,b,c,d){var e=this;return b||(b=u),d||(d=s),new q(function(f){function g(a){return function(b){b.onError(a)}}var h=new x(0,d),l=new i,n=new j(l);return l.add(e.subscribe(function(d){var e;try{e=a(d)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}var j=!1,o=h.tryGetValue(e);if(o||(o=new m,h.set(e,o),j=!0),j){var p=new y(e,o,n),q=new y(e,o);try{duration=c(q)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}f.onNext(p);var r=new k;l.add(r);var s=function(){h.remove(e)&&o.onCompleted(),l.remove(r)};r.setDisposable(duration.take(1).subscribe(t,function(a){h.getValues().forEach(g(a)),f.onError(a)},s))}var u;try{u=b(d)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}o.onNext(u)},function(a){h.getValues().forEach(g(a)),f.onError(a)},function(){h.getValues().forEach(function(a){a.onCompleted()}),f.onCompleted()})),n})};var y=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new q(function(a){return new i(e.getDisposable(),d.subscribe(a))}):d}return inherits(c,a),c}(h);return c});
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return a.groupJoin(this,b,o,function(a,b){return b})}function f(a){var b=this;return new q(function(c){var d=new m,e=new i,f=new j(e);return c.onNext(r(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),v(a)&&(a=w(a)),e.add(a.subscribe(function(){d.onCompleted(),d=new m,c.onNext(r(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f})}function g(a){var b=this;return new q(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}v(b)&&(b=w(b));var i=new k;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(t,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new m,c.onNext(r(h,g)),d()}))}var e=new l,f=new i(e),g=new j(f),h=new m;return c.onNext(r(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g})}var h=c.Observable,i=c.CompositeDisposable,j=c.RefCountDisposable,k=c.SingleAssignmentDisposable,l=c.SerialDisposable,m=c.Subject,n=h.prototype,o=h.empty,p=h.never,q=c.AnonymousObservable,r=(c.Observer.create,c.internals.addRef),s=c.internals.isEqual,t=c.helpers.noop,u=c.helpers.identity,v=c.helpers.isPromise,w=h.fromPromise,x=function(){function a(a){if(0===(1&a))return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function b(b){var c,d,e;for(c=0;c<h.length;++c)if(d=h[c],d>=b)return d;for(e=1|b;e<h[h.length-1];){if(a(e))return e;e+=2}return b}function c(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function e(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function f(){return{key:null,value:null,next:0,hashCode:0}}function g(a,b){if(0>a)throw new Error("out of range");a>0&&this._initialize(a),this.comparer=b||s,this.freeCount=0,this.size=0,this.freeList=-1}var h=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],i="no such key",j="duplicate key",k=function(){var a=0;return function(b){if(null==b)throw new Error(i);if("string"==typeof b)return c(b);if("number"==typeof b)return e(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return e(b.valueOf());if(b instanceof RegExp)return c(b.toString());if("function"==typeof b.valueOf){var d=b.valueOf();if("number"==typeof d)return e(d);if("string"==typeof b)return c(d)}if(b.hashCode)return b.hashCode();var f=17*a++;return b.hashCode=function(){return f},f}}(),l=g.prototype;return l._initialize=function(a){var c,d=b(a);for(this.buckets=new Array(d),this.entries=new Array(d),c=0;d>c;c++)this.buckets[c]=-1,this.entries[c]=f();this.freeList=-1},l.add=function(a,b){this._insert(a,b,!0)},l._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&k(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(j);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},l._resize=function(){var a=b(2*this.size),c=new Array(a);for(e=0;e<c.length;++e)c[e]=-1;var d=new Array(a);for(e=0;e<this.size;++e)d[e]=this.entries[e];for(var e=this.size;a>e;++e)d[e]=f();for(var g=0;g<this.size;++g){var h=d[g].hashCode%a;d[g].next=c[h],c[h]=g}this.buckets=c,this.entries=d},l.remove=function(a){if(this.buckets)for(var b=2147483647&k(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},l.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=f();this.freeList=-1,this.size=0}},l._findEntry=function(a){if(this.buckets)for(var b=2147483647&k(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},l.count=function(){return this.size-this.freeCount},l.tryGetValue=function(a){var b=this._findEntry(a);return b>=0?this.entries[b].value:d},l.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},l.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(i)},l.set=function(a,b){this._insert(a,b,!1)},l.containskey=function(a){return this._findEntry(a)>=0},g}();n.join=function(a,b,c,d){var e=this;return new q(function(f){var g=new i,h=!1,j=!1,l=0,m=0,n=new x,o=new x;return g.add(e.subscribe(function(a){var c=l++,e=new k;n.add(c,a),g.add(e);var i,j=function(){n.remove(c)&&0===n.count()&&h&&f.onCompleted(),g.remove(e)};try{i=b(a)}catch(m){return void f.onError(m)}e.setDisposable(i.take(1).subscribe(t,f.onError.bind(f),j)),o.getValues().forEach(function(b){var c;try{c=d(a,b)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){h=!0,(j||0===n.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=m++,e=new k;o.add(b,a),g.add(e);var h,i=function(){o.remove(b)&&0===o.count()&&j&&f.onCompleted(),g.remove(e)};try{h=c(a)}catch(l){return void f.onError(l)}e.setDisposable(h.take(1).subscribe(t,f.onError.bind(f),i)),n.getValues().forEach(function(b){var c;try{c=d(b,a)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){j=!0,(h||0===o.count())&&f.onCompleted()})),g})},n.groupJoin=function(a,b,c,d){var e=this;return new q(function(f){function g(a){return function(b){b.onError(a)}}var h=new i,l=new j(h),n=new x,o=new x,p=0,q=0;return h.add(e.subscribe(function(a){var c=new m,e=p++;n.add(e,c);var i;try{i=d(a,r(c,l))}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}f.onNext(i),o.getValues().forEach(function(a){c.onNext(a)});var q=new k;h.add(q);var s,u=function(){n.remove(e)&&c.onCompleted(),h.remove(q)};try{s=b(a)}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}q.setDisposable(s.take(1).subscribe(t,function(a){n.getValues().forEach(g(a)),f.onError(a)},u))},function(a){n.getValues().forEach(g(a)),f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b=q++;o.add(b,a);var d=new k;h.add(d);var e,i=function(){o.remove(b),h.remove(d)};try{e=c(a)}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}d.setDisposable(e.take(1).subscribe(t,function(a){n.getValues().forEach(g(a)),f.onError(a)},i)),n.getValues().forEach(function(b){b.onNext(a)})},function(a){n.getValues().forEach(g(a)),f.onError(a)})),l})},n.buffer=function(){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},n.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?f.call(this,a):"function"==typeof a?g.call(this,a):e.call(this,a,b)},n.pairwise=function(){var a=this;return new q(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))})},n.partition=function(a,b){var c=this.publish().refCount();return[c.filter(a,b),c.filter(function(c,d,e){return!a.call(b,c,d,e)})]},n.groupBy=function(a,b,c){return this.groupByUntil(a,b,p,c)},n.groupByUntil=function(a,b,c,d){var e=this;return b||(b=u),d||(d=s),new q(function(f){function g(a){return function(b){b.onError(a)}}var h=new x(0,d),l=new i,n=new j(l);return l.add(e.subscribe(function(d){var e;try{e=a(d)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}var j=!1,o=h.tryGetValue(e);if(o||(o=new m,h.set(e,o),j=!0),j){var p=new y(e,o,n),q=new y(e,o);try{duration=c(q)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}f.onNext(p);var r=new k;l.add(r);var s=function(){h.remove(e)&&o.onCompleted(),l.remove(r)};r.setDisposable(duration.take(1).subscribe(t,function(a){h.getValues().forEach(g(a)),f.onError(a)},s))}var u;try{u=b(d)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}o.onNext(u)},function(a){h.getValues().forEach(g(a)),f.onError(a)},function(){h.getValues().forEach(function(a){a.onCompleted()}),f.onCompleted()})),n})};var y=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new q(function(a){return new i(e.getDisposable(),d.subscribe(a))}):d}return inherits(c,a),c}(h);return c});
//# sourceMappingURL=rx.coincidence.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(U)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&h(a)&&(a=ub.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===mb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==nb){var g=a.constructor,i=-1,j=qb.length;if(a===(g&&g.prototype))var k=a===stringProto?ib:a===mb?db:jb.call(a),l=rb[k];for(;++i<j;)f=qb[i],l&&l[f]||!kb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?jb.call(a)==_:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=jb.call(a),l=jb.call(b);if(k==_&&(k=gb),l==_&&(l=gb),k!=l)return!1;switch(k){case bb:case cb:return+a==+b;case fb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case hb:case ib:return a==String(b)}var m=k==ab;if(!m){if(k!=gb||!sb.nodeClass&&(g(a)||g(b)))return!1;var n=!sb.argsObject&&h(a)?Object:a.constructor,o=!sb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||kb.call(a,"constructor")&&kb.call(b,"constructor")||S(n)&&n instanceof n&&S(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return kb.call(f,e)?(q++,r=kb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return kb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ub.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(){this._s=s}function o(){this._s=s,this._l=s.length,this._i=0}function p(a){this._a=a}function q(a){this._a=a,this._l=v(a),this._i=0}function r(a){return"number"==typeof a&&E.isFinite(a)}function t(b){var c,d=b[V];if(!d&&"string"==typeof b)return c=new n(b),c[V]();if(!d&&b.length!==a)return c=new p(b),c[V]();if(!d)throw new TypeError("Object is not iterable");return b[V]()}function u(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function v(a){var b=+a.length;return isNaN(b)?0:0!==b&&r(b)?(b=u(b)*Math.floor(Math.abs(b)),0>=b?0:b>nc?nc:b):b}function w(a,b){return L(a)||(a=Pb),new yc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function x(a,b){return new yc(function(c){var d=new Hb,e=new Ib;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}R(f)&&(f=kc(f)),d=new Hb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function y(a,b){var c=this;return new yc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=kc(f)),(Y(f)||X(f))&&(f=oc(f)),f}).concatAll()}function A(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function B(a){this.comparer=a,this.set=[]}function C(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=kc(f)),(Y(f)||X(f))&&(f=oc(f)),f}).mergeAll()}var D={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},E=D[typeof window]&&window||this,F=D[typeof exports]&&exports&&!exports.nodeType&&exports,G=D[typeof module]&&module&&!module.nodeType&&module,H=G&&G.exports===F&&F,I=D[typeof global]&&global;!I||I.global!==I&&I.window!==I||(E=I);var J={internals:{},config:{Promise:E.Promise},helpers:{}},K=J.helpers.noop=function(){},L=(J.helpers.notDefined=function(a){return"undefined"==typeof a},J.helpers.isScheduler=function(a){return a instanceof J.Scheduler}),M=J.helpers.identity=function(a){return a},N=(J.helpers.pluck=function(a){return function(b){return b[a]}},J.helpers.just=function(a){return function(){return a}},J.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),O=J.helpers.defaultComparer=function(a,b){return tb(a,b)},P=J.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Q=(J.helpers.defaultKeySerializer=function(a){return a.toString()},J.helpers.defaultError=function(a){throw a}),R=J.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},S=(J.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},J.helpers.not=function(a){return!a},J.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==jb.call(a)}),a}()),T="Argument out of range",U="Object has been disposed",V="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";E.Set&&"function"==typeof(new E.Set)["@@iterator"]&&(V="@@iterator");var W=J.doneEnumerator={done:!0,value:a},X=J.helpers.isIterable=function(b){return b[V]!==a},Y=J.helpers.isArrayLike=function(b){return b&&b.length!==a};J.helpers.iterator=V;var Z,$=J.helpers.deprecate=function(){},_="[object Arguments]",ab="[object Array]",bb="[object Boolean]",cb="[object Date]",db="[object Error]",eb="[object Function]",fb="[object Number]",gb="[object Object]",hb="[object RegExp]",ib="[object String]",jb=Object.prototype.toString,kb=Object.prototype.hasOwnProperty,lb=jb.call(arguments)==_,mb=Error.prototype,nb=Object.prototype,ob=nb.propertyIsEnumerable;try{Z=!(jb.call(document)==gb&&!({toString:0}+""))}catch(pb){Z=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[ab]=rb[cb]=rb[fb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[bb]=rb[ib]={constructor:!0,toString:!0,valueOf:!0},rb[db]=rb[eb]=rb[hb]={constructor:!0,toString:!0},rb[gb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(mb,"message")||ob.call(mb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1),lb||(h=function(a){return a&&"object"==typeof a?kb.call(a,"callee"):!1});var tb=J.internals.isEqual=function(a,b){return i(a,b,[],[])},ub=Array.prototype.slice,vb=({}.hasOwnProperty,this.inherits=J.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),wb=J.internals.addProperties=function(a){for(var b=ub.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},xb=J.internals.addRef=function(a,b){return new yc(function(c){return new Cb(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=ub.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(ub.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(ub.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var yb=Object("a"),zb="a"!=yb[0]||!(0 in yb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=zb&&{}.toString.call(this)==ib?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=eb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=zb&&{}.toString.call(this)==ib?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=eb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==ab}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Ab=J.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Bb=Ab.prototype;Bb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Bb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Bb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Bb.peek=function(){return this.items[0].value},Bb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Bb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Bb.enqueue=function(a){var b=this.length++;this.items[b]=new l(Ab.count++,a),this.percolate(b)},Bb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Ab.count=0;var Cb=J.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Db=Cb.prototype;Db.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Db.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Db.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Db.toArray=function(){return this.disposables.slice(0)};var Eb=J.Disposable=function(a){this.isDisposed=!1,this.action=a||K};Eb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Fb=Eb.create=function(a){return new Eb(a)},Gb=Eb.empty={dispose:K},Hb=J.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Ib=J.SerialDisposable=Hb,Jb=J.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Gb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Kb=J.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||P,this.disposable=new Hb};Kb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Kb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Kb.prototype.isCancelled=function(){return this.disposable.isDisposed},Kb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Lb=J.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Gb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=N,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Mb=Lb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Cb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Gb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Cb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Gb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Lb.prototype),function(){Lb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Lb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof E.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=E.setInterval(function(){d=c(d)},b);return Fb(function(){E.clearInterval(e)})}}(Lb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Ub(this,a)}}(Lb.prototype);var Nb,Ob=(J.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Hb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Lb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Mb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Lb(N,a,b,c)}()),Pb=Lb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Lb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Lb.normalize(c),g=new Kb(this,b,d,f);if(e)e.enqueue(g);else{e=new Ab(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Lb(N,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Qb=K,Rb=function(){var a,b=K;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!E.setTimeout)throw new Error("No concurrency detected!");a=E.setTimeout,b=E.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Sb=Rb.setTimeout,Tb=Rb.clearTimeout;!function(){function a(){if(!E.postMessage||E.importScripts)return!1;var a=!1,b=E.onmessage;return E.onmessage=function(){a=!0},E.postMessage("","*"),E.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(jb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=I&&H&&I.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=I&&H&&I.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Nb=d,Qb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Nb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;E.addEventListener?E.addEventListener("message",b,!1):E.attachEvent("onmessage",b,!1),Nb=function(a){var b=h++;g[b]=a,E.postMessage(f+b,"*")}}else if(E.MessageChannel){var i=new E.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Nb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in E&&"onreadystatechange"in E.document.createElement("script")?Nb=function(a){var b=E.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},E.document.documentElement.appendChild(b)}:(Nb=function(a){return Sb(a,0)},Qb=Tb)}();var Ub=(Lb.timeout=function(){function a(a,b){var c=this,d=new Hb,e=Nb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Cb(d,Fb(function(){Qb(e)}))}function b(a,b,c){var d=this,e=Lb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Hb,g=Sb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Cb(f,Fb(function(){Tb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Lb(N,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return vb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Gb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Hb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Lb)),Vb=J.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return L(a)||(a=Ob),new yc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Wb=Vb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Vb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Xb=Vb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Vb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Yb=Vb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Vb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Zb=J.internals.Enumerator=function(a){this._next=a};Zb.prototype.next=function(){return this._next()},Zb.prototype[V]=function(){return this};var $b=J.internals.Enumerable=function(a){this._iterator=a};$b.prototype[V]=function(){return this._iterator()},$b.prototype.concat=function(){var a=this;return new yc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f=new Ib,g=Ob.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;R(h)&&(h=kc(h));var i=new Hb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Cb(f,g,Fb(function(){e=!0}))})},$b.prototype.catchError=function(){var a=this;return new yc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f,g=new Ib,h=Ob.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;R(i)&&(i=kc(i));var j=new Hb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Cb(g,h,Fb(function(){e=!0}))})};var _b=$b.repeat=function(a,b){return null==b&&(b=-1),new $b(function(){var c=b;return new Zb(function(){return 0===c?W:(c>0&&c--,{done:!1,value:a})})})},ac=$b.of=function(a,b,c){return b||(b=M),new $b(function(){var d=-1;return new Zb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:W})})},bc=J.Observer=function(){};bc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},bc.prototype.asObserver=function(){return new fc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},bc.prototype.checked=function(){return new gc(this)};var cc=bc.create=function(a,b,c){return a||(a=K),b||(b=Q),c||(c=K),new fc(a,b,c)};bc.fromNotifier=function(a,b){return new fc(function(c){return a.call(b,Wb(c))},function(c){return a.call(b,Xb(c))},function(){return a.call(b,Yb())})},bc.notifyOn=function(a){return new ic(a,this)};var dc,ec=J.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return vb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(bc),fc=J.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return vb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(ec),gc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}vb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(bc),hc=J.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Ib}return vb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(ec),ic=function(a){function b(){a.apply(this,arguments)}return vb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b}(hc),jc=J.Observable=function(){function a(a){this._subscribe=a}return dc=a.prototype,dc.subscribe=dc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:cc(a,b,c))},dc.subscribeOnNext=function(a,b){return this._subscribe(cc(2===arguments.length?function(c){a.call(b,c)}:a))},dc.subscribeOnError=function(a,b){return this._subscribe(cc(null,2===arguments.length?function(c){a.call(b,c)}:a))},dc.subscribeOnCompleted=function(a,b){return this._subscribe(cc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();dc.observeOn=function(a){var b=this;return new yc(function(c){return b.subscribe(new ic(a,c))})},dc.subscribeOn=function(a){var b=this;return new yc(function(c){var d=new Hb,e=new Ib;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var kc=jc.fromPromise=function(a){return lc(function(){var b=new J.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};dc.toPromise=function(a){if(a||(a=J.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},dc.toArray=function(){var a=this;return new yc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},jc.create=jc.createWithDisposable=function(a){return new yc(a)};var lc=jc.defer=function(a){return new yc(function(b){var c;try{c=a()}catch(d){return sc(d).subscribe(b)}return R(c)&&(c=kc(c)),c.subscribe(b)})},mc=jc.empty=function(a){return L(a)||(a=Ob),new yc(function(b){return a.schedule(function(){b.onCompleted()})})},nc=Math.pow(2,53)-1;n.prototype[V]=function(){return new o(this._s)},o.prototype[V]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return W},p.prototype[V]=function(){return new q(this._a)},q.prototype[V]=function(){return this},q.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return W};var oc=jc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!S(b))throw new Error("mapFn when provided must be a function");L(d)||(d=Pb);var e=Object(a),f=t(e);return new yc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&S(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},pc=jc.fromArray=function(a,b){return $("fromArray","from"),L(b)||(b=Pb),new yc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};jc.generate=function(a,b,c,d,e){return L(e)||(e=Pb),new yc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var qc=jc.never=function(){return new yc(function(){return Gb})};jc.of=function(){return w(null,arguments)},jc.ofWithScheduler=function(a){return w(a,ub.call(arguments,1))},jc.range=function(a,b,c){return L(c)||(c=Pb),new yc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},jc.repeat=function(a,b,c){return L(c)||(c=Pb),rc(a,c).repeat(null==b?-1:b)};var rc=jc["return"]=jc.just=function(a,b){return L(b)||(b=Ob),new yc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};jc.returnValue=function(){return $("returnValue","return or just"),rc.apply(null,arguments)};var sc=jc["throw"]=jc.throwException=jc.throwError=function(a,b){return L(b)||(b=Ob),new yc(function(c){return b.schedule(function(){c.onError(a)})})};jc.using=function(a,b){return new yc(function(c){var d,e,f=Gb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Cb(sc(g).subscribe(c),f)}return new Cb(e.subscribe(c),f)})},dc.amb=function(a){var b=this;return new yc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Hb,j=new Hb;return R(a)&&(a=kc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Cb(i,j)})},jc.amb=function(){function a(a,b){return a.amb(b)}for(var b=qc(),c=j(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},dc["catch"]=dc.catchError=function(a){return"function"==typeof a?x(this,a):tc([this,a])},dc.catchException=function(a){return $("catchException","catch or catchError"),this.catchError(a)};var tc=jc.catchError=jc["catch"]=function(){return ac(j(arguments,0)).catchError()};jc.catchException=function(){return $("catchException","catch or catchError"),tc.apply(null,arguments)},dc.combineLatest=function(){var a=ub.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),uc.apply(this,a)};var uc=jc.combineLatest=function(){var a=ub.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new yc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(M))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(M)&&c.onCompleted()}function e(a){j[a]=!0,j.every(M)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Hb;R(f)&&(f=kc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Cb(m)})};dc.concat=function(){var a=ub.call(arguments,0);return a.unshift(this),vc.apply(this,a)};var vc=jc.concat=function(){return ac(j(arguments,0)).concat()};dc.concatAll=function(){return this.merge(1)},dc.concatObservable=function(){return $("concatObservable","concatAll"),this.merge(1)},dc.merge=function(a){if("number"!=typeof a)return wc(this,a);var b=this;return new yc(function(c){function d(a){var b=new Hb;f.add(b),R(a)&&(a=kc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())
}))}var e=0,f=new Cb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var wc=jc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ub.call(arguments,1)):(a=Ob,b=ub.call(arguments,0)):(a=Ob,b=ub.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),w(a,b).mergeAll()};dc.mergeAll=function(){var a=this;return new yc(function(b){var c=new Cb,d=!1,e=new Hb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Hb;c.add(e),R(a)&&(a=kc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},dc.mergeObservable=function(){return $("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},dc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return xc([this,a])};var xc=jc.onErrorResumeNext=function(){var a=j(arguments,0);return new yc(function(b){var c=0,d=new Ib,e=Ob.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],R(f)&&(f=kc(f)),g=new Hb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Cb(d,e)})};dc.skipUntil=function(a){var b=this;return new yc(function(c){var d=!1,e=new Cb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));R(a)&&(a=kc(a));var f=new Hb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},dc["switch"]=dc.switchLatest=function(){var a=this;return new yc(function(b){var c=!1,d=new Ib,e=!1,f=0,g=a.subscribe(function(a){var g=new Hb,h=++f;c=!0,d.setDisposable(g),R(a)&&(a=kc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Cb(g,d)})},dc.takeUntil=function(a){var b=this;return new yc(function(c){return R(a)&&(a=kc(a)),new Cb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),K))})},dc.zip=function(){if(Array.isArray(arguments[0]))return y.apply(this,arguments);var a=this,b=ub.call(arguments),c=b.pop();return b.unshift(a),new yc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(M)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Hb;R(c)&&(c=kc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Cb(j)})},jc.zip=function(){var a=ub.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},jc.zipArray=function(){var a=j(arguments,0);return new yc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(M))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(M)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Hb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Cb(h);return j.add(Fb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},dc.asObservable=function(){return new yc(this.subscribe.bind(this))},dc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},dc.dematerialize=function(){var a=this;return new yc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},dc.distinctUntilChanged=function(a,b){var c=this;return a||(a=M),b||(b=O),new yc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},dc["do"]=dc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new yc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},dc.doAction=function(){return $("doAction","do or tap"),this.tap.apply(this,arguments)},dc.doOnNext=dc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},dc.doOnError=dc.tapOnError=function(a,b){return this.tap(K,2===arguments.length?function(c){a.call(b,c)}:a)},dc.doOnCompleted=dc.tapOnCompleted=function(a,b){return this.tap(K,null,2===arguments.length?function(){a.call(b)}:a)},dc["finally"]=dc.ensure=function(a){var b=this;return new yc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Fb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},dc.finallyAction=function(a){return $("finallyAction","finally or ensure"),this.ensure(a)},dc.ignoreElements=function(){var a=this;return new yc(function(b){return a.subscribe(K,b.onError.bind(b),b.onCompleted.bind(b))})},dc.materialize=function(){var a=this;return new yc(function(b){return a.subscribe(function(a){b.onNext(Wb(a))},function(a){b.onNext(Xb(a)),b.onCompleted()},function(){b.onNext(Yb()),b.onCompleted()})})},dc.repeat=function(a){return _b(this,a).concat()},dc.retry=function(a){return _b(this,a).catchError()},dc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new yc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},dc.skipLast=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},dc.startWith=function(){var a,b,c=0;return arguments.length&&L(arguments[0])?(b=arguments[0],c=1):b=Ob,a=ub.call(arguments,c),ac([pc(a,b),this]).concat()},dc.takeLast=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},dc.takeLastBuffer=function(a){var b=this;return new yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},dc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(T);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(T);return new yc(function(d){function e(){var a=new Bc;i.push(a),d.onNext(xb(a,g))}var f=new Hb,g=new Jb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},dc.selectConcat=dc.concatMap=function(a,b,c){return S(a)&&S(b)?this.concatMap(function(c,d){var e=a(c,d);return R(e)&&(e=kc(e)),(Y(e)||X(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})}):S(a)?z(this,a,c):z(this,function(){return a})},dc.concatMapObserver=dc.selectConcatObserver=function(a,b,c,d){var e=this;return new yc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=kc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},dc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new yc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},B.prototype.push=function(a){var b=-1===A(this.set,a,this.comparer);return b&&this.set.push(a),b},dc.distinct=function(a,b){var c=this;return b||(b=O),new yc(function(d){var e=new B(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.select=dc.map=function(a,b){var c=S(a)?a:function(){return a},d=this;return new yc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},dc.pluck=function(a){return this.map(function(b){return b[a]})},dc.selectMany=dc.flatMap=function(a,b,c){return S(a)&&S(b)?this.flatMap(function(c,d){var e=a(c,d);return R(e)&&(e=kc(e)),(Y(e)||X(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):S(a)?C(this,a,c):C(this,function(){return a})},dc.flatMapObserver=dc.selectManyObserver=function(a,b,c,d){var e=this;return new yc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=kc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=kc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},dc.selectSwitch=dc.flatMapLatest=dc.switchMap=function(a,b){return this.select(a,b).switchLatest()},dc.skip=function(a){if(0>a)throw new Error(T);var b=this;return new yc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},dc.skipWhile=function(a,b){var c=this;return new yc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.take=function(a,b){if(0>a)throw new RangeError(T);if(0===a)return mc(b);var c=this;return new yc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},dc.takeWhile=function(a,b){var c=this;return new yc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},dc.where=dc.filter=function(a,b){var c=this;return new yc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},dc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new yc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var yc=J.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Fb(a):Gb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new zc(a);return Pb.scheduleRequired()?Pb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return vb(c,a),c}(jc),zc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Hb}vb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(ec),Ac=function(a,b){this.subject=a,this.observer=b};Ac.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Bc=J.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Gb):(a.onCompleted(),Gb):(this.observers.push(a),new Ac(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return vb(d,a),wb(d.prototype,bc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Cc(a,b)},d}(jc),Cc=(J.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Ac(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Gb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return vb(d,a),wb(d.prototype,bc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(jc),J.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return vb(b,a),wb(b.prototype,bc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(jc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(E.Rx=J,define(function(){return J})):F&&G?H?(G.exports=J).Rx=J:F.Rx=J:E.Rx=J}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(T)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&tb(a)&&(a=vb.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===lb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==mb){var g=a.constructor,h=-1,i=qb.length;if(a===(g&&g.prototype))var j=a===nb?hb:a===lb?cb:ib.call(a),k=rb[j];for(;++h<i;)f=qb[h],k&&k[f]||!jb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=ib.call(a),k=ib.call(b);if(j==$&&(j=fb),k==$&&(k=fb),j!=k)return!1;switch(j){case ab:case bb:return+a==+b;case eb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case gb:case hb:return a==String(b)}var l=j==_;if(!l){if(j!=fb||!sb.nodeClass&&(g(a)||g(b)))return!1;var m=!sb.argsObject&&tb(a)?Object:a.constructor,n=!sb.argsObject&&tb(b)?Object:b.constructor;if(!(m==n||jb.call(a,"constructor")&&jb.call(b,"constructor")||R(m)&&m instanceof m&&R(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return jb.call(f,e)?(p++,q=jb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return jb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:vb.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&D.isFinite(a)}function r(b){var c,d=b[U];if(!d&&"string"==typeof b)return c=new m(b),c[U]();if(!d&&b.length!==a)return c=new o(b),c[U]();if(!d)throw new TypeError("Object is not iterable");return b[U]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>oc?oc:b):b}function v(a,b){return K(a)||(a=Qb),new zc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new zc(function(c){var d=new Ib,e=new Jb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Q(f)&&(f=lc(f)),d=new Ib,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new zc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=lc(f)),(X(f)||W(f))&&(f=pc(f)),f}).concatAll()}function z(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function A(a){this.comparer=a,this.set=[]}function B(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=lc(f)),(X(f)||W(f))&&(f=pc(f)),f}).mergeAll()}var C={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},D=C[typeof window]&&window||this,E=C[typeof exports]&&exports&&!exports.nodeType&&exports,F=C[typeof module]&&module&&!module.nodeType&&module,G=F&&F.exports===E&&E,H=C[typeof global]&&global;!H||H.global!==H&&H.window!==H||(D=H);var I={internals:{},config:{Promise:D.Promise},helpers:{}},J=I.helpers.noop=function(){},K=(I.helpers.notDefined=function(a){return"undefined"==typeof a},I.helpers.isScheduler=function(a){return a instanceof I.Scheduler}),L=I.helpers.identity=function(a){return a},M=(I.helpers.pluck=function(a){return function(b){return b[a]}},I.helpers.just=function(a){return function(){return a}},I.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),N=I.helpers.defaultComparer=function(a,b){return ub(a,b)},O=I.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},P=(I.helpers.defaultKeySerializer=function(a){return a.toString()},I.helpers.defaultError=function(a){throw a}),Q=I.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},R=(I.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},I.helpers.not=function(a){return!a},I.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==ib.call(a)}),a}()),S="Argument out of range",T="Object has been disposed",U="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";D.Set&&"function"==typeof(new D.Set)["@@iterator"]&&(U="@@iterator");var V=I.doneEnumerator={done:!0,value:a},W=I.helpers.isIterable=function(b){return b[U]!==a},X=I.helpers.isArrayLike=function(b){return b&&b.length!==a};I.helpers.iterator=U;var Y,Z=I.helpers.deprecate=function(){},$="[object Arguments]",_="[object Array]",ab="[object Boolean]",bb="[object Date]",cb="[object Error]",db="[object Function]",eb="[object Number]",fb="[object Object]",gb="[object RegExp]",hb="[object String]",ib=Object.prototype.toString,jb=Object.prototype.hasOwnProperty,kb=ib.call(arguments)==$,lb=Error.prototype,mb=Object.prototype,nb=String.prototype,ob=mb.propertyIsEnumerable;try{Y=!(ib.call(document)==fb&&!({toString:0}+""))}catch(pb){Y=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[_]=rb[bb]=rb[eb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[ab]=rb[hb]={constructor:!0,toString:!0,valueOf:!0},rb[cb]=rb[db]=rb[gb]={constructor:!0,toString:!0},rb[fb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(lb,"message")||ob.call(lb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1);var tb=function(a){return a&&"object"==typeof a?ib.call(a)==$:!1};kb||(tb=function(a){return a&&"object"==typeof a?jb.call(a,"callee"):!1});var ub=I.internals.isEqual=function(a,b){return h(a,b,[],[])},vb=Array.prototype.slice,wb=({}.hasOwnProperty,this.inherits=I.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),xb=I.internals.addProperties=function(a){for(var b=vb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},yb=I.internals.addRef=function(a,b){return new zc(function(c){return new Db(b.getDisposable(),a.subscribe(c))})};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=vb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(vb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(vb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var zb=Object("a"),Ab="a"!=zb[0]||!(0 in zb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Ab&&{}.toString.call(this)==hb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=db)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Ab&&{}.toString.call(this)==hb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=db)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==_}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Bb=I.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Cb=Bb.prototype;Cb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Cb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Cb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Cb.peek=function(){return this.items[0].value},Cb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Cb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Cb.enqueue=function(a){var b=this.length++;this.items[b]=new k(Bb.count++,a),this.percolate(b)},Cb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Bb.count=0;var Db=I.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Eb=Db.prototype;Eb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Eb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Eb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Eb.toArray=function(){return this.disposables.slice(0)};var Fb=I.Disposable=function(a){this.isDisposed=!1,this.action=a||J};Fb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Gb=Fb.create=function(a){return new Fb(a)},Hb=Fb.empty={dispose:J},Ib=I.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Jb=I.SerialDisposable=Ib,Kb=I.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Hb:new a(this)},b}();l.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Lb=I.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||O,this.disposable=new Ib};Lb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Lb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Lb.prototype.isCancelled=function(){return this.disposable.isDisposed},Lb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Mb=I.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Hb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=M,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Nb=Mb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Db,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Hb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Db,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Hb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Mb.prototype),function(){Mb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Mb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof D.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=D.setInterval(function(){d=c(d)},b);return Gb(function(){D.clearInterval(e)})}}(Mb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Vb(this,a)}}(Mb.prototype);var Ob,Pb=(I.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Ib;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Mb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Nb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Mb(M,a,b,c)}()),Qb=Mb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Mb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Mb.normalize(c),g=new Lb(this,b,d,f);if(e)e.enqueue(g);else{e=new Bb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Mb(M,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Rb=J,Sb=function(){var a,b=J;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!D.setTimeout)throw new Error("No concurrency detected!");a=D.setTimeout,b=D.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Tb=Sb.setTimeout,Ub=Sb.clearTimeout;!function(){function a(){if(!D.postMessage||D.importScripts)return!1;var a=!1,b=D.onmessage;return D.onmessage=function(){a=!0},D.postMessage("","*"),D.onmessage=b,a}var b=RegExp("^"+String(ib).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=H&&G&&H.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=H&&G&&H.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Ob=c,Rb=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Ob=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};D.addEventListener?D.addEventListener("message",h,!1):D.attachEvent("onmessage",h,!1),Ob=function(a){var b=g++;f[b]=a,D.postMessage(e+b,"*")}}else if(D.MessageChannel){var i=new D.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Ob=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in D&&"onreadystatechange"in D.document.createElement("script")?Ob=function(a){var b=D.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},D.document.documentElement.appendChild(b)}:(Ob=function(a){return Tb(a,0)},Rb=Ub)}();var Vb=(Mb.timeout=function(){function a(a,b){var c=this,d=new Ib,e=Ob(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Db(d,Gb(function(){Rb(e)}))}function b(a,b,c){var d=this,e=Mb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Ib,g=Tb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Db(f,Gb(function(){Ub(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Mb(M,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return wb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Hb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Ib;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Mb)),Wb=I.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return K(a)||(a=Pb),new zc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Xb=Wb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Wb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Yb=Wb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Wb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Zb=Wb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Wb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),$b=I.internals.Enumerator=function(a){this._next=a};$b.prototype.next=function(){return this._next()},$b.prototype[U]=function(){return this};var _b=I.internals.Enumerable=function(a){this._iterator=a};_b.prototype[U]=function(){return this._iterator()},_b.prototype.concat=function(){var a=this;return new zc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f=new Jb,g=Pb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Q(h)&&(h=lc(h));var i=new Ib;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Db(f,g,Gb(function(){e=!0}))})},_b.prototype.catchError=function(){var a=this;return new zc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f,g=new Jb,h=Pb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Q(i)&&(i=lc(i));var j=new Ib;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Db(g,h,Gb(function(){e=!0}))})};var ac=_b.repeat=function(a,b){return null==b&&(b=-1),new _b(function(){var c=b;return new $b(function(){return 0===c?V:(c>0&&c--,{done:!1,value:a})})})},bc=_b.of=function(a,b,c){return b||(b=L),new _b(function(){var d=-1;return new $b(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:V})})},cc=I.Observer=function(){};cc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},cc.prototype.asObserver=function(){return new gc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},cc.prototype.checked=function(){return new hc(this)};var dc=cc.create=function(a,b,c){return a||(a=J),b||(b=P),c||(c=J),new gc(a,b,c)};cc.fromNotifier=function(a,b){return new gc(function(c){return a.call(b,Xb(c))},function(c){return a.call(b,Yb(c))},function(){return a.call(b,Zb())})},cc.prototype.notifyOn=function(a){return new jc(a,this)};var ec,fc=I.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return wb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(cc),gc=I.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return wb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(fc),hc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}wb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(cc),ic=I.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Jb}return wb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(fc),jc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return wb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(ic),kc=I.Observable=function(){function a(a){this._subscribe=a}return ec=a.prototype,ec.subscribe=ec.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:dc(a,b,c))},ec.subscribeOnNext=function(a,b){return this._subscribe(dc(2===arguments.length?function(c){a.call(b,c)}:a))},ec.subscribeOnError=function(a,b){return this._subscribe(dc(null,2===arguments.length?function(c){a.call(b,c)}:a))},ec.subscribeOnCompleted=function(a,b){return this._subscribe(dc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();ec.observeOn=function(a){var b=this;return new zc(function(c){return b.subscribe(new jc(a,c))})},ec.subscribeOn=function(a){var b=this;return new zc(function(c){var d=new Ib,e=new Jb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new l(a,b.subscribe(c)))})),e})};var lc=kc.fromPromise=function(a){return mc(function(){var b=new I.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};ec.toPromise=function(a){if(a||(a=I.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},ec.toArray=function(){var a=this;return new zc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},kc.create=kc.createWithDisposable=function(a){return new zc(a)};var mc=kc.defer=function(a){return new zc(function(b){var c;try{c=a()}catch(d){return tc(d).subscribe(b)}return Q(c)&&(c=lc(c)),c.subscribe(b)})},nc=kc.empty=function(a){return K(a)||(a=Pb),new zc(function(b){return a.schedule(function(){b.onCompleted()})})},oc=Math.pow(2,53)-1;m.prototype[U]=function(){return new n(this._s)},n.prototype[U]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return V},o.prototype[U]=function(){return new p(this._a)},p.prototype[U]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return V};var pc=kc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!R(b))throw new Error("mapFn when provided must be a function");K(d)||(d=Qb);var e=Object(a),f=r(e);return new zc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&R(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},qc=kc.fromArray=function(a,b){return Z("fromArray","from"),K(b)||(b=Qb),new zc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};kc.generate=function(a,b,c,d,e){return K(e)||(e=Qb),new zc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var rc=kc.never=function(){return new zc(function(){return Hb})};kc.of=function(){return v(null,arguments)},kc.ofWithScheduler=function(a){return v(a,vb.call(arguments,1))},kc.range=function(a,b,c){return K(c)||(c=Qb),new zc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},kc.repeat=function(a,b,c){return K(c)||(c=Qb),sc(a,c).repeat(null==b?-1:b)};var sc=kc["return"]=kc.just=function(a,b){return K(b)||(b=Pb),new zc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};kc.returnValue=function(){return Z("returnValue","return or just"),sc.apply(null,arguments)};var tc=kc["throw"]=kc.throwException=kc.throwError=function(a,b){return K(b)||(b=Pb),new zc(function(c){return b.schedule(function(){c.onError(a)})})};kc.using=function(a,b){return new zc(function(c){var d,e,f=Hb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Db(tc(g).subscribe(c),f)}return new Db(e.subscribe(c),f)})},ec.amb=function(a){var b=this;return new zc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Ib,j=new Ib;return Q(a)&&(a=lc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Db(i,j)})},kc.amb=function(){function a(a,b){return a.amb(b)}for(var b=rc(),c=i(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},ec["catch"]=ec.catchError=function(a){return"function"==typeof a?w(this,a):uc([this,a])},ec.catchException=function(a){return Z("catchException","catch or catchError"),this.catchError(a)};var uc=kc.catchError=kc["catch"]=function(){return bc(i(arguments,0)).catchError()};kc.catchException=function(){return Z("catchException","catch or catchError"),uc.apply(null,arguments)},ec.combineLatest=function(){var a=vb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),vc.apply(this,a)};var vc=kc.combineLatest=function(){var a=vb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new zc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(L))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(L)&&c.onCompleted()}function e(a){k[a]=!0,k.every(L)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Ib;Q(f)&&(f=lc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Db(m)})};ec.concat=function(){var a=vb.call(arguments,0);return a.unshift(this),wc.apply(this,a)};var wc=kc.concat=function(){return bc(i(arguments,0)).concat()};ec.concatAll=function(){return this.merge(1)},ec.concatObservable=function(){return Z("concatObservable","concatAll"),this.merge(1)},ec.merge=function(a){if("number"!=typeof a)return xc(this,a);var b=this;
return new zc(function(c){function d(a){var b=new Ib;f.add(b),Q(a)&&(a=lc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Db,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var xc=kc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=vb.call(arguments,1)):(a=Pb,b=vb.call(arguments,0)):(a=Pb,b=vb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};ec.mergeAll=function(){var a=this;return new zc(function(b){var c=new Db,d=!1,e=new Ib;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Ib;c.add(e),Q(a)&&(a=lc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},ec.mergeObservable=function(){return Z("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},ec.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return yc([this,a])};var yc=kc.onErrorResumeNext=function(){var a=i(arguments,0);return new zc(function(b){var c=0,d=new Jb,e=Pb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Q(f)&&(f=lc(f)),g=new Ib,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Db(d,e)})};ec.skipUntil=function(a){var b=this;return new zc(function(c){var d=!1,e=new Db(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Q(a)&&(a=lc(a));var f=new Ib;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},ec["switch"]=ec.switchLatest=function(){var a=this;return new zc(function(b){var c=!1,d=new Jb,e=!1,f=0,g=a.subscribe(function(a){var g=new Ib,h=++f;c=!0,d.setDisposable(g),Q(a)&&(a=lc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Db(g,d)})},ec.takeUntil=function(a){var b=this;return new zc(function(c){return Q(a)&&(a=lc(a)),new Db(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),J))})},ec.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=vb.call(arguments),c=b.pop();return b.unshift(a),new zc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(L)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Ib;Q(c)&&(c=lc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Db(k)})},kc.zip=function(){var a=vb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},kc.zipArray=function(){var a=i(arguments,0);return new zc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(L))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(L)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Ib,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Db(h);return k.add(Gb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},ec.asObservable=function(){return new zc(this.subscribe.bind(this))},ec.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},ec.dematerialize=function(){var a=this;return new zc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},ec.distinctUntilChanged=function(a,b){var c=this;return a||(a=L),b||(b=N),new zc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},ec["do"]=ec.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new zc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},ec.doAction=function(){return Z("doAction","do or tap"),this.tap.apply(this,arguments)},ec.doOnNext=ec.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},ec.doOnError=ec.tapOnError=function(a,b){return this.tap(J,2===arguments.length?function(c){a.call(b,c)}:a)},ec.doOnCompleted=ec.tapOnCompleted=function(a,b){return this.tap(J,null,2===arguments.length?function(){a.call(b)}:a)},ec["finally"]=ec.ensure=function(a){var b=this;return new zc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Gb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},ec.finallyAction=function(a){return Z("finallyAction","finally or ensure"),this.ensure(a)},ec.ignoreElements=function(){var a=this;return new zc(function(b){return a.subscribe(J,b.onError.bind(b),b.onCompleted.bind(b))})},ec.materialize=function(){var a=this;return new zc(function(b){return a.subscribe(function(a){b.onNext(Xb(a))},function(a){b.onNext(Yb(a)),b.onCompleted()},function(){b.onNext(Zb()),b.onCompleted()})})},ec.repeat=function(a){return ac(this,a).concat()},ec.retry=function(a){return ac(this,a).catchError()},ec.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new zc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},ec.skipLast=function(a){var b=this;return new zc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},ec.startWith=function(){var a,b,c=0;return arguments.length&&K(arguments[0])?(b=arguments[0],c=1):b=Pb,a=vb.call(arguments,c),bc([qc(a,b),this]).concat()},ec.takeLast=function(a){var b=this;return new zc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},ec.takeLastBuffer=function(a){var b=this;return new zc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},ec.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(S);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(S);return new zc(function(d){function e(){var a=new Cc;i.push(a),d.onNext(yb(a,g))}var f=new Ib,g=new Kb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},ec.selectConcat=ec.concatMap=function(a,b,c){return R(a)&&R(b)?this.concatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=lc(e)),(X(e)||W(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})}):R(a)?y(this,a,c):y(this,function(){return a})},ec.concatMapObserver=ec.selectConcatObserver=function(a,b,c,d){var e=this;return new zc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=lc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=lc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=lc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},ec.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new zc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},A.prototype.push=function(a){var b=-1===z(this.set,a,this.comparer);return b&&this.set.push(a),b},ec.distinct=function(a,b){var c=this;return b||(b=N),new zc(function(d){var e=new A(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},ec.select=ec.map=function(a,b){var c=R(a)?a:function(){return a},d=this;return new zc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},ec.pluck=function(a){return this.map(function(b){return b[a]})},ec.selectMany=ec.flatMap=function(a,b,c){return R(a)&&R(b)?this.flatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=lc(e)),(X(e)||W(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):R(a)?B(this,a,c):B(this,function(){return a})},ec.flatMapObserver=ec.selectManyObserver=function(a,b,c,d){var e=this;return new zc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=lc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=lc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=lc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},ec.selectSwitch=ec.flatMapLatest=ec.switchMap=function(a,b){return this.select(a,b).switchLatest()},ec.skip=function(a){if(0>a)throw new Error(S);var b=this;return new zc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},ec.skipWhile=function(a,b){var c=this;return new zc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},ec.take=function(a,b){if(0>a)throw new RangeError(S);if(0===a)return nc(b);var c=this;return new zc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},ec.takeWhile=function(a,b){var c=this;return new zc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},ec.where=ec.filter=function(a,b){var c=this;return new zc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},ec.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new zc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var zc=I.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Gb(a):Hb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Ac(a);return Qb.scheduleRequired()?Qb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return wb(c,a),c}(kc),Ac=function(a){function b(b){a.call(this),this.observer=b,this.m=new Ib}wb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(fc),Bc=function(a,b){this.subject=a,this.observer=b};Bc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Cc=I.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Hb):(a.onCompleted(),Hb):(this.observers.push(a),new Bc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return wb(d,a),xb(d.prototype,cc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Dc(a,b)},d}(kc),Dc=(I.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Bc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Hb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return wb(d,a),xb(d.prototype,cc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(kc),I.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return wb(b,a),xb(b.prototype,cc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(kc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(D.Rx=I,define(function(){return I})):E&&F?G?(F.exports=I).Rx=I:E.Rx=I:D.Rx=I}).call(this);
//# sourceMappingURL=rx.compat.map

@@ -0,0 +0,0 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(ab)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;Ab.nonEnumArgs&&a.length&&h(a)&&(a=Cb.call(a));var d=Ab.enumPrototypes&&"function"==typeof a,e=Ab.enumErrorProps&&(a===ub||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(Ab.nonEnumShadows&&a!==vb){var g=a.constructor,i=-1,j=yb.length;if(a===(g&&g.prototype))var k=a===stringProto?qb:a===ub?lb:rb.call(a),l=zb[k];for(;++i<j;)f=yb[i],l&&l[f]||!sb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?rb.call(a)==hb:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=rb.call(a),l=rb.call(b);if(k==hb&&(k=ob),l==hb&&(l=ob),k!=l)return!1;switch(k){case jb:case kb:return+a==+b;case nb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case pb:case qb:return a==String(b)}var m=k==ib;if(!m){if(k!=ob||!Ab.nodeClass&&(g(a)||g(b)))return!1;var n=!Ab.argsObject&&h(a)?Object:a.constructor,o=!Ab.argsObject&&h(b)?Object:b.constructor;if(!(n==o||sb.call(a,"constructor")&&sb.call(b,"constructor")||$(n)&&n instanceof n&&$(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return sb.call(f,e)?(q++,r=sb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return sb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Cb.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&M.isFinite(a)}function r(b){var c,d=b[bb];if(!d&&"string"==typeof b)return c=new m(b),c[bb]();if(!d&&b.length!==a)return c=new o(b),c[bb]();if(!d)throw new TypeError("Object is not iterable");return b[bb]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>qc?qc:b):b}function v(a,b){return T(a)||(a=Vb),new Kc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new Kc(function(c){var d=new Ob,e=new Pb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Z(f)&&(f=Dc(f)),d=new Ob,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new Kc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Z(f)&&(f=Dc(f)),(eb(f)||db(f))&&(f=rc(f)),f}).concatAll()}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Z(f)&&(f=Dc(f)),(eb(f)||db(f))&&(f=rc(f)),f}).mergeAll()}function A(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=M.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function B(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Mb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(A(a))};return a.attachEvent("on"+b,d),Mb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Mb(function(){a["on"+b]=null})}function C(a,b,c){var d=new Jb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(C(a.item(e),b,c));else a&&d.add(B(a,b,c));return d}function D(a,b){return new Kc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function E(a,b,c){return new Kc(function(d){var e=0,f=a,g=Sb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function F(a,b){return new Kc(function(c){return b.scheduleWithRelative(Sb(a),function(){c.onNext(0),c.onCompleted()})})}function G(a,b,c){return a===b?new Kc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):oc(function(){return E(c.now()+a,b,c)})}function H(a,b,c){return new Kc(function(d){var e,f=!1,g=new Pb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Ob,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Jb(e,g)})}function I(a,b,c){return oc(function(){return H(a,b-c.now(),c)})}function J(a,b){return new Kc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Jb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function K(a,b,c){return new Kc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(U))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Jb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var L={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},M=L[typeof window]&&window||this,N=L[typeof exports]&&exports&&!exports.nodeType&&exports,O=L[typeof module]&&module&&!module.nodeType&&module,P=O&&O.exports===N&&N,Q=L[typeof global]&&global;!Q||Q.global!==Q&&Q.window!==Q||(M=Q);var R={internals:{},config:{Promise:M.Promise},helpers:{}},S=R.helpers.noop=function(){},T=(R.helpers.notDefined=function(a){return"undefined"==typeof a},R.helpers.isScheduler=function(a){return a instanceof R.Scheduler}),U=R.helpers.identity=function(a){return a},V=(R.helpers.pluck=function(a){return function(b){return b[a]}},R.helpers.just=function(a){return function(){return a}},R.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),W=R.helpers.defaultComparer=function(a,b){return Bb(a,b)},X=R.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Y=(R.helpers.defaultKeySerializer=function(a){return a.toString()},R.helpers.defaultError=function(a){throw a}),Z=R.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},$=(R.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},R.helpers.not=function(a){return!a},R.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==rb.call(a)}),a}()),_="Argument out of range",ab="Object has been disposed",bb="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";M.Set&&"function"==typeof(new M.Set)["@@iterator"]&&(bb="@@iterator");var cb=R.doneEnumerator={done:!0,value:a},db=R.helpers.isIterable=function(b){return b[bb]!==a},eb=R.helpers.isArrayLike=function(b){return b&&b.length!==a};R.helpers.iterator=bb;var fb,gb=R.helpers.deprecate=function(){},hb="[object Arguments]",ib="[object Array]",jb="[object Boolean]",kb="[object Date]",lb="[object Error]",mb="[object Function]",nb="[object Number]",ob="[object Object]",pb="[object RegExp]",qb="[object String]",rb=Object.prototype.toString,sb=Object.prototype.hasOwnProperty,tb=rb.call(arguments)==hb,ub=Error.prototype,vb=Object.prototype,wb=vb.propertyIsEnumerable;try{fb=!(rb.call(document)==ob&&!({toString:0}+""))}catch(xb){fb=!0}var yb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],zb={};zb[ib]=zb[kb]=zb[nb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},zb[jb]=zb[qb]={constructor:!0,toString:!0,valueOf:!0},zb[lb]=zb[mb]=zb[pb]={constructor:!0,toString:!0},zb[ob]={constructor:!0};var Ab={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Ab.enumErrorProps=wb.call(ub,"message")||wb.call(ub,"name"),Ab.enumPrototypes=wb.call(a,"prototype"),Ab.nonEnumArgs=0!=c,Ab.nonEnumShadows=!/valueOf/.test(b)}(1),tb||(h=function(a){return a&&"object"==typeof a?sb.call(a,"callee"):!1});{var Bb=R.internals.isEqual=function(a,b){return i(a,b,[],[])},Cb=Array.prototype.slice,Db=({}.hasOwnProperty,this.inherits=R.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Eb=R.internals.addProperties=function(a){for(var b=Cb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};R.internals.addRef=function(a,b){return new Kc(function(c){return new Jb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Cb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Cb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Cb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Fb=Object("a"),Gb="a"!=Fb[0]||!(0 in Fb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Gb&&{}.toString.call(this)==qb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=mb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Gb&&{}.toString.call(this)==qb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=mb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==ib}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Hb=R.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ib=Hb.prototype;Ib.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ib.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Ib.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Ib.peek=function(){return this.items[0].value},Ib.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Ib.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ib.enqueue=function(a){var b=this.length++;this.items[b]=new l(Hb.count++,a),this.percolate(b)},Ib.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Hb.count=0;var Jb=R.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Kb=Jb.prototype;Kb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Kb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Kb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Kb.toArray=function(){return this.disposables.slice(0)};var Lb=R.Disposable=function(a){this.isDisposed=!1,this.action=a||S};Lb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Mb=Lb.create=function(a){return new Lb(a)},Nb=Lb.empty={dispose:S},Ob=R.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Pb=R.SerialDisposable=Ob,Qb=(R.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Nb:new a(this)},b}(),R.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||X,this.disposable=new Ob});Qb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Qb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Qb.prototype.isCancelled=function(){return this.disposable.isDisposed},Qb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Rb=R.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Nb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=V,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Sb=Rb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Jb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Nb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Jb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Nb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Rb.prototype),function(){Rb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Rb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof M.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=M.setInterval(function(){d=c(d)},b);return Mb(function(){M.clearInterval(e)})}}(Rb.prototype);var Tb,Ub=Rb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Sb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Rb(V,a,b,c)}(),Vb=Rb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Rb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Rb.normalize(c),g=new Qb(this,b,d,f);if(e)e.enqueue(g);else{e=new Hb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Rb(V,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Wb=(R.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Ob;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),S),Xb=function(){var a,b=S;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!M.setTimeout)throw new Error("No concurrency detected!");a=M.setTimeout,b=M.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Yb=Xb.setTimeout,Zb=Xb.clearTimeout;!function(){function a(){if(!M.postMessage||M.importScripts)return!1;var a=!1,b=M.onmessage;return M.onmessage=function(){a=!0},M.postMessage("","*"),M.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(rb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=Q&&P&&Q.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=Q&&P&&Q.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Tb=d,Wb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Tb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;M.addEventListener?M.addEventListener("message",b,!1):M.attachEvent("onmessage",b,!1),Tb=function(a){var b=h++;g[b]=a,M.postMessage(f+b,"*")}}else if(M.MessageChannel){var i=new M.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Tb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in M&&"onreadystatechange"in M.document.createElement("script")?Tb=function(a){var b=M.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},M.document.documentElement.appendChild(b)}:(Tb=function(a){return Yb(a,0)},Wb=Zb)}();var $b=Rb.timeout=function(){function a(a,b){var c=this,d=new Ob,e=Tb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Jb(d,Mb(function(){Wb(e)}))}function b(a,b,c){var d=this,e=Rb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Ob,g=Yb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Jb(f,Mb(function(){Zb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Rb(V,a,b,c)}(),_b=R.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return T(a)||(a=Ub),new Kc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),ac=_b.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new _b("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),bc=_b.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new _b("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),cc=_b.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new _b("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),dc=R.internals.Enumerator=function(a){this._next=a};dc.prototype.next=function(){return this._next()},dc.prototype[bb]=function(){return this};var ec=R.internals.Enumerable=function(a){this._iterator=a};ec.prototype[bb]=function(){return this._iterator()},ec.prototype.concat=function(){var a=this;return new Kc(function(b){var c;try{c=a[bb]()}catch(d){return void b.onError()}var e,f=new Pb,g=Ub.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Z(h)&&(h=Dc(h));var i=new Ob;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Jb(f,g,Mb(function(){e=!0}))})},ec.prototype.catchError=function(){var a=this;return new Kc(function(b){var c;try{c=a[bb]()}catch(d){return void b.onError()}var e,f,g=new Pb,h=Ub.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Z(i)&&(i=Dc(i));var j=new Ob;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Jb(g,h,Mb(function(){e=!0}))})};var fc=ec.repeat=function(a,b){return null==b&&(b=-1),new ec(function(){var c=b;return new dc(function(){return 0===c?cb:(c>0&&c--,{done:!1,value:a})})})},gc=ec.of=function(a,b,c){return b||(b=U),new ec(function(){var d=-1;return new dc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:cb})})},hc=R.Observer=function(){};hc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},hc.prototype.asObserver=function(){return new lc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var ic=hc.create=function(a,b,c){return a||(a=S),b||(b=Y),c||(c=S),new lc(a,b,c)};hc.fromNotifier=function(a,b){return new lc(function(c){return a.call(b,ac(c))},function(c){return a.call(b,bc(c))},function(){return a.call(b,cc())})};var jc,kc=R.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Db(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(hc),lc=R.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Db(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(kc),mc=R.Observable=function(){function a(a){this._subscribe=a}return jc=a.prototype,jc.subscribe=jc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ic(a,b,c))},jc.subscribeOnNext=function(a,b){return this._subscribe(ic(2===arguments.length?function(c){a.call(b,c)}:a))},jc.subscribeOnError=function(a,b){return this._subscribe(ic(null,2===arguments.length?function(c){a.call(b,c)}:a))},jc.subscribeOnCompleted=function(a,b){return this._subscribe(ic(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),nc=R.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Pb}return Db(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(kc);jc.toArray=function(){var a=this;return new Kc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},mc.create=mc.createWithDisposable=function(a){return new Kc(a)};var oc=mc.defer=function(a){return new Kc(function(b){var c;try{c=a()}catch(d){return uc(d).subscribe(b)}return Z(c)&&(c=Dc(c)),c.subscribe(b)})},pc=mc.empty=function(a){return T(a)||(a=Ub),new Kc(function(b){return a.schedule(function(){b.onCompleted()})})},qc=Math.pow(2,53)-1;m.prototype[bb]=function(){return new n(this._s)},n.prototype[bb]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return cb},o.prototype[bb]=function(){return new p(this._a)},p.prototype[bb]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return cb};{var rc=mc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!$(b))throw new Error("mapFn when provided must be a function");T(d)||(d=Vb);var e=Object(a),f=r(e);return new Kc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&$(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},sc=mc.fromArray=function(a,b){return gb("fromArray","from"),T(b)||(b=Vb),new Kc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};mc.never=function(){return new Kc(function(){return Nb})}}mc.of=function(){return v(null,arguments)},mc.ofWithScheduler=function(a){return v(a,Cb.call(arguments,1))},mc.range=function(a,b,c){return T(c)||(c=Vb),new Kc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},mc.repeat=function(a,b,c){return T(c)||(c=Vb),tc(a,c).repeat(null==b?-1:b)};var tc=mc["return"]=mc.just=function(a,b){return T(b)||(b=Ub),new Kc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};mc.returnValue=function(){return gb("returnValue","return or just"),tc.apply(null,arguments)};var uc=mc["throw"]=mc.throwException=mc.throwError=function(a,b){return T(b)||(b=Ub),new Kc(function(c){return b.schedule(function(){c.onError(a)})})};jc["catch"]=jc.catchError=function(a){return"function"==typeof a?w(this,a):vc([this,a])},jc.catchException=function(a){return gb("catchException","catch or catchError"),this.catchError(a)};var vc=mc.catchError=mc["catch"]=function(){return gc(j(arguments,0)).catchError()};mc.catchException=function(){return gb("catchException","catch or catchError"),vc.apply(null,arguments)},jc.combineLatest=function(){var a=Cb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),wc.apply(this,a)};var wc=mc.combineLatest=function(){var a=Cb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Kc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(U))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(U)&&c.onCompleted()}function e(a){j[a]=!0,j.every(U)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Ob;Z(f)&&(f=Dc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Jb(m)})};jc.concat=function(){var a=Cb.call(arguments,0);return a.unshift(this),xc.apply(this,a)};var xc=mc.concat=function(){return gc(j(arguments,0)).concat()};jc.concatAll=function(){return this.merge(1)},jc.concatObservable=function(){return gb("concatObservable","concatAll"),this.merge(1)},jc.merge=function(a){if("number"!=typeof a)return yc(this,a);var b=this;return new Kc(function(c){function d(a){var b=new Ob;f.add(b),Z(a)&&(a=Dc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Jb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var yc=mc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Cb.call(arguments,1)):(a=Ub,b=Cb.call(arguments,0)):(a=Ub,b=Cb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};jc.mergeAll=function(){var a=this;return new Kc(function(b){var c=new Jb,d=!1,e=new Ob;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Ob;c.add(e),Z(a)&&(a=Dc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},jc.mergeObservable=function(){return gb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},jc.skipUntil=function(a){var b=this;return new Kc(function(c){var d=!1,e=new Jb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Z(a)&&(a=Dc(a));var f=new Ob;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()
})),e})},jc["switch"]=jc.switchLatest=function(){var a=this;return new Kc(function(b){var c=!1,d=new Pb,e=!1,f=0,g=a.subscribe(function(a){var g=new Ob,h=++f;c=!0,d.setDisposable(g),Z(a)&&(a=Dc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Jb(g,d)})},jc.takeUntil=function(a){var b=this;return new Kc(function(c){return Z(a)&&(a=Dc(a)),new Jb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),S))})},jc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=Cb.call(arguments),c=b.pop();return b.unshift(a),new Kc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(U)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Ob;Z(c)&&(c=Dc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Jb(j)})},mc.zip=function(){var a=Cb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},mc.zipArray=function(){var a=j(arguments,0);return new Kc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(U))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(U)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Ob,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Jb(h);return j.add(Mb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},jc.asObservable=function(){return new Kc(this.subscribe.bind(this))},jc.dematerialize=function(){var a=this;return new Kc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},jc.distinctUntilChanged=function(a,b){var c=this;return a||(a=U),b||(b=W),new Kc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},jc["do"]=jc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Kc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},jc.doAction=function(){return gb("doAction","do or tap"),this.tap.apply(this,arguments)},jc.doOnNext=jc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},jc.doOnError=jc.tapOnError=function(a,b){return this.tap(S,2===arguments.length?function(c){a.call(b,c)}:a)},jc.doOnCompleted=jc.tapOnCompleted=function(a,b){return this.tap(S,null,2===arguments.length?function(){a.call(b)}:a)},jc["finally"]=jc.ensure=function(a){var b=this;return new Kc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Mb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},jc.finallyAction=function(a){return gb("finallyAction","finally or ensure"),this.ensure(a)},jc.ignoreElements=function(){var a=this;return new Kc(function(b){return a.subscribe(S,b.onError.bind(b),b.onCompleted.bind(b))})},jc.materialize=function(){var a=this;return new Kc(function(b){return a.subscribe(function(a){b.onNext(ac(a))},function(a){b.onNext(bc(a)),b.onCompleted()},function(){b.onNext(cc()),b.onCompleted()})})},jc.repeat=function(a){return fc(this,a).concat()},jc.retry=function(a){return fc(this,a).catchError()},jc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Kc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},jc.skipLast=function(a){var b=this;return new Kc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},jc.startWith=function(){var a,b,c=0;return arguments.length&&T(arguments[0])?(b=arguments[0],c=1):b=Ub,a=Cb.call(arguments,c),gc([sc(a,b),this]).concat()},jc.takeLast=function(a){var b=this;return new Kc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},jc.selectConcat=jc.concatMap=function(a,b,c){return $(a)&&$(b)?this.concatMap(function(c,d){var e=a(c,d);return Z(e)&&(e=Dc(e)),(eb(e)||db(e))&&(e=rc(e)),e.map(function(a,e){return b(c,a,d,e)})}):$(a)?y(this,a,c):y(this,function(){return a})},jc.select=jc.map=function(a,b){var c=$(a)?a:function(){return a},d=this;return new Kc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},jc.pluck=function(a){return this.map(function(b){return b[a]})},jc.selectMany=jc.flatMap=function(a,b,c){return $(a)&&$(b)?this.flatMap(function(c,d){var e=a(c,d);return Z(e)&&(e=Dc(e)),(eb(e)||db(e))&&(e=rc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):$(a)?z(this,a,c):z(this,function(){return a})},jc.selectSwitch=jc.flatMapLatest=jc.switchMap=function(a,b){return this.select(a,b).switchLatest()},jc.skip=function(a){if(0>a)throw new Error(_);var b=this;return new Kc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},jc.skipWhile=function(a,b){var c=this;return new Kc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},jc.take=function(a,b){if(0>a)throw new RangeError(_);if(0===a)return pc(b);var c=this;return new Kc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},jc.takeWhile=function(a,b){var c=this;return new Kc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},jc.where=jc.filter=function(a,b){var c=this;return new Kc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},mc.fromCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Kc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},mc.fromNodeCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Kc(function(e){function f(a){if(a)return void e.onError(a);var b=Cb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},R.config.useNativeEvents=!1;var zc=M.angular&&angular.element?angular.element:M.jQuery?M.jQuery:M.Zepto?M.Zepto:null,Ac=!!M.Ember&&"function"==typeof M.Ember.addListener,Bc=!!M.Backbone&&!!M.Backbone.Marionette;mc.fromEvent=function(a,b,c){if(a.addListener)return Cc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!R.config.useNativeEvents){if(Bc)return Cc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Ac)return Cc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(zc){var d=zc(a);return Cc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Kc(function(d){return C(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Cc=mc.fromEventPattern=function(a,b,c){return new Kc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Mb(function(){b&&b(e,f)})}).publish().refCount()},Dc=mc.fromPromise=function(a){return oc(function(){var b=new R.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};jc.toPromise=function(a){if(a||(a=R.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},mc.startAsync=function(a){var b;try{b=a()}catch(c){return uc(c)}return Dc(b)},jc.multicast=function(a,b){var c=this;return"function"==typeof a?new Kc(function(d){var e=c.multicast(a());return new Jb(b(e).subscribe(d),e.connect())}):new Ec(c,a)},jc.publish=function(a){return a&&$(a)?this.multicast(function(){return new Nc},a):this.multicast(new Nc)},jc.share=function(){return this.publish().refCount()},jc.publishLast=function(a){return a&&$(a)?this.multicast(function(){return new Oc},a):this.multicast(new Oc)},jc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Qc(b)},a):this.multicast(new Qc(a))},jc.shareValue=function(a){return this.publishValue(a).refCount()},jc.replay=function(a,b,c,d){return a&&$(a)?this.multicast(function(){return new Rc(b,c,d)},a):this.multicast(new Rc(b,c,d))},jc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Ec=R.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Jb(f.subscribe(c),Mb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Db(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Kc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(mc),Fc=mc.interval=function(a,b){return G(a,a,T(b)?b:$b)};mc.timer=function(b,c,d){var e;return T(d)||(d=$b),c!==a&&"number"==typeof c?e=c:T(c)&&(d=c),b instanceof Date&&e===a?D(b.getTime(),d):b instanceof Date&&e!==a?(e=c,E(b.getTime(),e,d)):e===a?F(b,d):G(b,e,d)}}jc.delay=function(a,b){return T(b)||(b=$b),a instanceof Date?I(this,a.getTime(),b):H(this,a,b)},jc.debounce=jc.throttleWithTimeout=function(a,b){T(b)||(b=$b);var c=this;return new Kc(function(d){var e,f=new Pb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Ob;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Jb(i,f)})},jc.throttle=function(a,b){return gb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},jc.timestamp=function(a){return T(a)||(a=$b),this.map(function(b){return{value:b,timestamp:a.now()}})},jc.sample=jc.throttleLatest=function(a,b){return T(b)||(b=$b),"number"==typeof a?J(this,Fc(a,b)):J(this,a)},jc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=uc(new Error(b||"Timeout"))),T(c)||(c=$b);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Kc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Z(b)&&(b=Dc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Ob,j=new Pb,k=!1,l=new Pb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Jb(j,l)})},jc.throttleFirst=function(a,b){T(b)||(b=$b);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Kc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Gc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Nb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Nb)});return new Jb(c,d,e)}function c(c,d){this.source=c,this.controller=new Nc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Db(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(mc);jc.pausable=function(a){return new Gc(this,a)};var Hc=function(b){function c(b){var c,d=[],e=K(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Nc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Db(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(mc);jc.pausableBuffered=function(a){return new Hc(this,a)},jc.controlled=function(a){return null==a&&(a=!0),new Ic(this,a)};var Ic=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Jc(d),this.source=c.multicast(this.subject).refCount()}return Db(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(mc),Jc=R.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Nc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Nb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Nb}return Db(d,a),Eb(d.prototype,hc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Nb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Nb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Nb:(this.requestedCount=a,this.requestedDisposable=Mb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Nb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(mc);jc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Kc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Kc=R.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Mb(a):Nb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Lc(a);return Vb.scheduleRequired()?Vb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Db(c,a),c}(mc),Lc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Ob}Db(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(kc),Mc=function(a,b){this.subject=a,this.observer=b};Mc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Nc=R.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Nb):(a.onCompleted(),Nb):(this.observers.push(a),new Mc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Pc(a,b)},d}(mc),Oc=R.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Mc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Nb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(mc),Pc=R.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Db(b,a),Eb(b.prototype,hc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(mc),Qc=R.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Mc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Nb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Db(d,a),Eb(d.prototype,hc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(mc),Rc=R.ReplaySubject=function(a){function c(a,b){return Mb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new nc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Vb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Db(e,a),Eb(e.prototype,hc,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(mc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(M.Rx=R,define(function(){return R})):N&&O?P?(O.exports=R).Rx=R:N.Rx=R:M.Rx=R}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(_)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;Ab.nonEnumArgs&&a.length&&Bb(a)&&(a=Db.call(a));var d=Ab.enumPrototypes&&"function"==typeof a,e=Ab.enumErrorProps&&(a===tb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(Ab.nonEnumShadows&&a!==ub){var g=a.constructor,h=-1,i=yb.length;if(a===(g&&g.prototype))var j=a===vb?pb:a===tb?kb:qb.call(a),k=zb[j];for(;++h<i;)f=yb[h],k&&k[f]||!rb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=qb.call(a),k=qb.call(b);if(j==gb&&(j=nb),k==gb&&(k=nb),j!=k)return!1;switch(j){case ib:case jb:return+a==+b;case mb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ob:case pb:return a==String(b)}var l=j==hb;if(!l){if(j!=nb||!Ab.nodeClass&&(g(a)||g(b)))return!1;var m=!Ab.argsObject&&Bb(a)?Object:a.constructor,n=!Ab.argsObject&&Bb(b)?Object:b.constructor;if(!(m==n||rb.call(a,"constructor")&&rb.call(b,"constructor")||Z(m)&&m instanceof m&&Z(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return rb.call(f,e)?(p++,q=rb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return rb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Db.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(){this._s=s}function m(){this._s=s,this._l=s.length,this._i=0}function n(a){this._a=a}function o(a){this._a=a,this._l=t(a),this._i=0}function p(a){return"number"==typeof a&&L.isFinite(a)}function q(b){var c,d=b[ab];if(!d&&"string"==typeof b)return c=new l(b),c[ab]();if(!d&&b.length!==a)return c=new n(b),c[ab]();if(!d)throw new TypeError("Object is not iterable");return b[ab]()}function r(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function t(a){var b=+a.length;return isNaN(b)?0:0!==b&&p(b)?(b=r(b)*Math.floor(Math.abs(b)),0>=b?0:b>rc?rc:b):b}function u(a,b){return S(a)||(a=Wb),new Lc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function v(a,b){return new Lc(function(c){var d=new Pb,e=new Qb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Y(f)&&(f=Ec(f)),d=new Pb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function w(a,b){var c=this;return new Lc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function x(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ec(f)),(db(f)||cb(f))&&(f=sc(f)),f}).concatAll()}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ec(f)),(db(f)||cb(f))&&(f=sc(f)),f}).mergeAll()}function z(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=L.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function A(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Nb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(z(a))};return a.attachEvent("on"+b,d),Nb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Nb(function(){a["on"+b]=null})}function B(a,b,c){var d=new Kb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(B(a.item(e),b,c));else a&&d.add(A(a,b,c));return d}function C(a,b){return new Lc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function D(a,b,c){return new Lc(function(d){var e=0,f=a,g=Tb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function E(a,b){return new Lc(function(c){return b.scheduleWithRelative(Tb(a),function(){c.onNext(0),c.onCompleted()})})}function F(a,b,c){return a===b?new Lc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):pc(function(){return D(c.now()+a,b,c)})}function G(a,b,c){return new Lc(function(d){var e,f=!1,g=new Qb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Pb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Kb(e,g)})}function H(a,b,c){return pc(function(){return G(a,b-c.now(),c)})}function I(a,b){return new Lc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Kb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function J(a,b,c){return new Lc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(T))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Kb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var K={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},L=K[typeof window]&&window||this,M=K[typeof exports]&&exports&&!exports.nodeType&&exports,N=K[typeof module]&&module&&!module.nodeType&&module,O=N&&N.exports===M&&M,P=K[typeof global]&&global;!P||P.global!==P&&P.window!==P||(L=P);var Q={internals:{},config:{Promise:L.Promise},helpers:{}},R=Q.helpers.noop=function(){},S=(Q.helpers.notDefined=function(a){return"undefined"==typeof a},Q.helpers.isScheduler=function(a){return a instanceof Q.Scheduler}),T=Q.helpers.identity=function(a){return a},U=(Q.helpers.pluck=function(a){return function(b){return b[a]}},Q.helpers.just=function(a){return function(){return a}},Q.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),V=Q.helpers.defaultComparer=function(a,b){return Cb(a,b)},W=Q.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},X=(Q.helpers.defaultKeySerializer=function(a){return a.toString()},Q.helpers.defaultError=function(a){throw a}),Y=Q.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Z=(Q.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Q.helpers.not=function(a){return!a},Q.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==qb.call(a)}),a}()),$="Argument out of range",_="Object has been disposed",ab="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";L.Set&&"function"==typeof(new L.Set)["@@iterator"]&&(ab="@@iterator");var bb=Q.doneEnumerator={done:!0,value:a},cb=Q.helpers.isIterable=function(b){return b[ab]!==a},db=Q.helpers.isArrayLike=function(b){return b&&b.length!==a};Q.helpers.iterator=ab;var eb,fb=Q.helpers.deprecate=function(){},gb="[object Arguments]",hb="[object Array]",ib="[object Boolean]",jb="[object Date]",kb="[object Error]",lb="[object Function]",mb="[object Number]",nb="[object Object]",ob="[object RegExp]",pb="[object String]",qb=Object.prototype.toString,rb=Object.prototype.hasOwnProperty,sb=qb.call(arguments)==gb,tb=Error.prototype,ub=Object.prototype,vb=String.prototype,wb=ub.propertyIsEnumerable;try{eb=!(qb.call(document)==nb&&!({toString:0}+""))}catch(xb){eb=!0}var yb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],zb={};zb[hb]=zb[jb]=zb[mb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},zb[ib]=zb[pb]={constructor:!0,toString:!0,valueOf:!0},zb[kb]=zb[lb]=zb[ob]={constructor:!0,toString:!0},zb[nb]={constructor:!0};var Ab={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Ab.enumErrorProps=wb.call(tb,"message")||wb.call(tb,"name"),Ab.enumPrototypes=wb.call(a,"prototype"),Ab.nonEnumArgs=0!=c,Ab.nonEnumShadows=!/valueOf/.test(b)}(1);var Bb=function(a){return a&&"object"==typeof a?qb.call(a)==gb:!1};sb||(Bb=function(a){return a&&"object"==typeof a?rb.call(a,"callee"):!1});{var Cb=Q.internals.isEqual=function(a,b){return h(a,b,[],[])},Db=Array.prototype.slice,Eb=({}.hasOwnProperty,this.inherits=Q.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Fb=Q.internals.addProperties=function(a){for(var b=Db.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};Q.internals.addRef=function(a,b){return new Lc(function(c){return new Kb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Db.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Db.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Db.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Gb=Object("a"),Hb="a"!=Gb[0]||!(0 in Gb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Hb&&{}.toString.call(this)==pb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=lb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Hb&&{}.toString.call(this)==pb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=lb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==hb}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&1/0!=d&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Ib=Q.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Jb=Ib.prototype;Jb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Jb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Jb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Jb.peek=function(){return this.items[0].value},Jb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Jb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Jb.enqueue=function(a){var b=this.length++;this.items[b]=new k(Ib.count++,a),this.percolate(b)},Jb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Ib.count=0;var Kb=Q.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Lb=Kb.prototype;Lb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Lb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Lb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Lb.toArray=function(){return this.disposables.slice(0)};var Mb=Q.Disposable=function(a){this.isDisposed=!1,this.action=a||R};Mb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Nb=Mb.create=function(a){return new Mb(a)},Ob=Mb.empty={dispose:R},Pb=Q.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Qb=Q.SerialDisposable=Pb,Rb=(Q.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Ob:new a(this)},b}(),Q.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||W,this.disposable=new Pb});Rb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Rb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Rb.prototype.isCancelled=function(){return this.disposable.isDisposed},Rb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Sb=Q.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Ob}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=U,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Tb=Sb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Kb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Ob});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Kb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Ob});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Sb.prototype),function(){Sb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Sb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof L.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=L.setInterval(function(){d=c(d)},b);return Nb(function(){L.clearInterval(e)})}}(Sb.prototype);var Ub,Vb=Sb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Tb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Sb(U,a,b,c)}(),Wb=Sb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Sb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Sb.normalize(c),g=new Rb(this,b,d,f);if(e)e.enqueue(g);else{e=new Ib(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Sb(U,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Xb=(Q.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Pb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),R),Yb=function(){var a,b=R;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!L.setTimeout)throw new Error("No concurrency detected!");a=L.setTimeout,b=L.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Zb=Yb.setTimeout,$b=Yb.clearTimeout;!function(){function a(){if(!L.postMessage||L.importScripts)return!1;var a=!1,b=L.onmessage;return L.onmessage=function(){a=!0},L.postMessage("","*"),L.onmessage=b,a}var b=RegExp("^"+String(qb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=P&&O&&P.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=P&&O&&P.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Ub=c,Xb=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Ub=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};L.addEventListener?L.addEventListener("message",h,!1):L.attachEvent("onmessage",h,!1),Ub=function(a){var b=g++;f[b]=a,L.postMessage(e+b,"*")}}else if(L.MessageChannel){var i=new L.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Ub=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in L&&"onreadystatechange"in L.document.createElement("script")?Ub=function(a){var b=L.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},L.document.documentElement.appendChild(b)}:(Ub=function(a){return Zb(a,0)},Xb=$b)}();var _b=Sb.timeout=function(){function a(a,b){var c=this,d=new Pb,e=Ub(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Kb(d,Nb(function(){Xb(e)}))}function b(a,b,c){var d=this,e=Sb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Pb,g=Zb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Kb(f,Nb(function(){$b(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Sb(U,a,b,c)}(),ac=Q.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return S(a)||(a=Vb),new Lc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),bc=ac.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new ac("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),cc=ac.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new ac("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),dc=ac.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new ac("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),ec=Q.internals.Enumerator=function(a){this._next=a};ec.prototype.next=function(){return this._next()},ec.prototype[ab]=function(){return this};var fc=Q.internals.Enumerable=function(a){this._iterator=a};fc.prototype[ab]=function(){return this._iterator()},fc.prototype.concat=function(){var a=this;return new Lc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError(d)}var e,f=new Qb,g=Vb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Y(h)&&(h=Ec(h));var i=new Pb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Kb(f,g,Nb(function(){e=!0}))})},fc.prototype.catchError=function(){var a=this;return new Lc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError(d)}var e,f,g=new Qb,h=Vb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Y(i)&&(i=Ec(i));var j=new Pb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Kb(g,h,Nb(function(){e=!0}))})};var gc=fc.repeat=function(a,b){return null==b&&(b=-1),new fc(function(){var c=b;return new ec(function(){return 0===c?bb:(c>0&&c--,{done:!1,value:a})})})},hc=fc.of=function(a,b,c){return b||(b=T),new fc(function(){var d=-1;return new ec(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:bb})})},ic=Q.Observer=function(){};ic.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ic.prototype.asObserver=function(){return new mc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var jc=ic.create=function(a,b,c){return a||(a=R),b||(b=X),c||(c=R),new mc(a,b,c)};ic.fromNotifier=function(a,b){return new mc(function(c){return a.call(b,bc(c))},function(c){return a.call(b,cc(c))},function(){return a.call(b,dc())})};var kc,lc=Q.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Eb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ic),mc=Q.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Eb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(lc),nc=Q.Observable=function(){function a(a){this._subscribe=a}return kc=a.prototype,kc.subscribe=kc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:jc(a,b,c))},kc.subscribeOnNext=function(a,b){return this._subscribe(jc(2===arguments.length?function(c){a.call(b,c)}:a))},kc.subscribeOnError=function(a,b){return this._subscribe(jc(null,2===arguments.length?function(c){a.call(b,c)}:a))},kc.subscribeOnCompleted=function(a,b){return this._subscribe(jc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),oc=Q.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Qb}return Eb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(lc);kc.toArray=function(){var a=this;return new Lc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},nc.create=nc.createWithDisposable=function(a){return new Lc(a)};var pc=nc.defer=function(a){return new Lc(function(b){var c;try{c=a()}catch(d){return vc(d).subscribe(b)}return Y(c)&&(c=Ec(c)),c.subscribe(b)})},qc=nc.empty=function(a){return S(a)||(a=Vb),new Lc(function(b){return a.schedule(function(){b.onCompleted()})})},rc=Math.pow(2,53)-1;l.prototype[ab]=function(){return new m(this._s)},m.prototype[ab]=function(){return this},m.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return bb},n.prototype[ab]=function(){return new o(this._a)},o.prototype[ab]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return bb};{var sc=nc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Z(b))throw new Error("mapFn when provided must be a function");S(d)||(d=Wb);var e=Object(a),f=q(e);return new Lc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&Z(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},tc=nc.fromArray=function(a,b){return fb("fromArray","from"),S(b)||(b=Wb),new Lc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};nc.never=function(){return new Lc(function(){return Ob})}}nc.of=function(){return u(null,arguments)},nc.ofWithScheduler=function(a){return u(a,Db.call(arguments,1))},nc.range=function(a,b,c){return S(c)||(c=Wb),new Lc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},nc.repeat=function(a,b,c){return S(c)||(c=Wb),uc(a,c).repeat(null==b?-1:b)};var uc=nc["return"]=nc.just=function(a,b){return S(b)||(b=Vb),new Lc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};nc.returnValue=function(){return fb("returnValue","return or just"),uc.apply(null,arguments)};var vc=nc["throw"]=nc.throwException=nc.throwError=function(a,b){return S(b)||(b=Vb),new Lc(function(c){return b.schedule(function(){c.onError(a)})})};kc["catch"]=kc.catchError=function(a){return"function"==typeof a?v(this,a):wc([this,a])},kc.catchException=function(a){return fb("catchException","catch or catchError"),this.catchError(a)};var wc=nc.catchError=nc["catch"]=function(){return hc(i(arguments,0)).catchError()};nc.catchException=function(){return fb("catchException","catch or catchError"),wc.apply(null,arguments)},kc.combineLatest=function(){var a=Db.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),xc.apply(this,a)};var xc=nc.combineLatest=function(){var a=Db.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Lc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(T))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(T)&&c.onCompleted()}function e(a){k[a]=!0,k.every(T)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Pb;Y(f)&&(f=Ec(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Kb(m)})};kc.concat=function(){var a=Db.call(arguments,0);return a.unshift(this),yc.apply(this,a)};var yc=nc.concat=function(){return hc(i(arguments,0)).concat()};kc.concatAll=function(){return this.merge(1)},kc.concatObservable=function(){return fb("concatObservable","concatAll"),this.merge(1)},kc.merge=function(a){if("number"!=typeof a)return zc(this,a);var b=this;return new Lc(function(c){function d(a){var b=new Pb;f.add(b),Y(a)&&(a=Ec(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Kb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var zc=nc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Db.call(arguments,1)):(a=Vb,b=Db.call(arguments,0)):(a=Vb,b=Db.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),u(a,b).mergeAll()};kc.mergeAll=function(){var a=this;return new Lc(function(b){var c=new Kb,d=!1,e=new Pb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Pb;c.add(e),Y(a)&&(a=Ec(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},kc.mergeObservable=function(){return fb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},kc.skipUntil=function(a){var b=this;return new Lc(function(c){var d=!1,e=new Kb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Y(a)&&(a=Ec(a));var f=new Pb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()
},c.onError.bind(c),function(){f.dispose()})),e})},kc["switch"]=kc.switchLatest=function(){var a=this;return new Lc(function(b){var c=!1,d=new Qb,e=!1,f=0,g=a.subscribe(function(a){var g=new Pb,h=++f;c=!0,d.setDisposable(g),Y(a)&&(a=Ec(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Kb(g,d)})},kc.takeUntil=function(a){var b=this;return new Lc(function(c){return Y(a)&&(a=Ec(a)),new Kb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),R))})},kc.zip=function(){if(Array.isArray(arguments[0]))return w.apply(this,arguments);var a=this,b=Db.call(arguments),c=b.pop();return b.unshift(a),new Lc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(T)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Pb;Y(c)&&(c=Ec(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Kb(k)})},nc.zip=function(){var a=Db.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},nc.zipArray=function(){var a=i(arguments,0);return new Lc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(T))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(T)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Pb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Kb(h);return k.add(Nb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},kc.asObservable=function(){return new Lc(this.subscribe.bind(this))},kc.dematerialize=function(){var a=this;return new Lc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},kc.distinctUntilChanged=function(a,b){var c=this;return a||(a=T),b||(b=V),new Lc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},kc["do"]=kc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Lc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},kc.doAction=function(){return fb("doAction","do or tap"),this.tap.apply(this,arguments)},kc.doOnNext=kc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},kc.doOnError=kc.tapOnError=function(a,b){return this.tap(R,2===arguments.length?function(c){a.call(b,c)}:a)},kc.doOnCompleted=kc.tapOnCompleted=function(a,b){return this.tap(R,null,2===arguments.length?function(){a.call(b)}:a)},kc["finally"]=kc.ensure=function(a){var b=this;return new Lc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Nb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},kc.finallyAction=function(a){return fb("finallyAction","finally or ensure"),this.ensure(a)},kc.ignoreElements=function(){var a=this;return new Lc(function(b){return a.subscribe(R,b.onError.bind(b),b.onCompleted.bind(b))})},kc.materialize=function(){var a=this;return new Lc(function(b){return a.subscribe(function(a){b.onNext(bc(a))},function(a){b.onNext(cc(a)),b.onCompleted()},function(){b.onNext(dc()),b.onCompleted()})})},kc.repeat=function(a){return gc(this,a).concat()},kc.retry=function(a){return gc(this,a).catchError()},kc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Lc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},kc.skipLast=function(a){var b=this;return new Lc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},kc.startWith=function(){var a,b,c=0;return arguments.length&&S(arguments[0])?(b=arguments[0],c=1):b=Vb,a=Db.call(arguments,c),hc([tc(a,b),this]).concat()},kc.takeLast=function(a){var b=this;return new Lc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},kc.selectConcat=kc.concatMap=function(a,b,c){return Z(a)&&Z(b)?this.concatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ec(e)),(db(e)||cb(e))&&(e=sc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Z(a)?x(this,a,c):x(this,function(){return a})},kc.select=kc.map=function(a,b){var c=Z(a)?a:function(){return a},d=this;return new Lc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},kc.pluck=function(a){return this.map(function(b){return b[a]})},kc.selectMany=kc.flatMap=function(a,b,c){return Z(a)&&Z(b)?this.flatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ec(e)),(db(e)||cb(e))&&(e=sc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Z(a)?y(this,a,c):y(this,function(){return a})},kc.selectSwitch=kc.flatMapLatest=kc.switchMap=function(a,b){return this.select(a,b).switchLatest()},kc.skip=function(a){if(0>a)throw new Error($);var b=this;return new Lc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},kc.skipWhile=function(a,b){var c=this;return new Lc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},kc.take=function(a,b){if(0>a)throw new RangeError($);if(0===a)return qc(b);var c=this;return new Lc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},kc.takeWhile=function(a,b){var c=this;return new Lc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},kc.where=kc.filter=function(a,b){var c=this;return new Lc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},nc.fromCallback=function(a,b,c){return function(){var d=Db.call(arguments,0);return new Lc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},nc.fromNodeCallback=function(a,b,c){return function(){var d=Db.call(arguments,0);return new Lc(function(e){function f(a){if(a)return void e.onError(a);var b=Db.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},Q.config.useNativeEvents=!1;var Ac=L.angular&&angular.element?angular.element:L.jQuery?L.jQuery:L.Zepto?L.Zepto:null,Bc=!!L.Ember&&"function"==typeof L.Ember.addListener,Cc=!!L.Backbone&&!!L.Backbone.Marionette;nc.fromEvent=function(a,b,c){if(a.addListener)return Dc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!Q.config.useNativeEvents){if(Cc)return Dc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(Bc)return Dc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(Ac){var d=Ac(a);return Dc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Lc(function(d){return B(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Dc=nc.fromEventPattern=function(a,b,c){return new Lc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Nb(function(){b&&b(e,f)})}).publish().refCount()},Ec=nc.fromPromise=function(a){return pc(function(){var b=new Q.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};kc.toPromise=function(a){if(a||(a=Q.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},nc.startAsync=function(a){var b;try{b=a()}catch(c){return vc(c)}return Ec(b)},kc.multicast=function(a,b){var c=this;return"function"==typeof a?new Lc(function(d){var e=c.multicast(a());return new Kb(b(e).subscribe(d),e.connect())}):new Fc(c,a)},kc.publish=function(a){return a&&Z(a)?this.multicast(function(){return new Oc},a):this.multicast(new Oc)},kc.share=function(){return this.publish().refCount()},kc.publishLast=function(a){return a&&Z(a)?this.multicast(function(){return new Pc},a):this.multicast(new Pc)},kc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Rc(b)},a):this.multicast(new Rc(a))},kc.shareValue=function(a){return this.publishValue(a).refCount()},kc.replay=function(a,b,c,d){return a&&Z(a)?this.multicast(function(){return new Sc(b,c,d)},a):this.multicast(new Sc(b,c,d))},kc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Fc=Q.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Kb(f.subscribe(c),Nb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Eb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Lc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(nc),Gc=nc.interval=function(a,b){return F(a,a,S(b)?b:_b)};nc.timer=function(b,c,d){var e;return S(d)||(d=_b),c!==a&&"number"==typeof c?e=c:S(c)&&(d=c),b instanceof Date&&e===a?C(b.getTime(),d):b instanceof Date&&e!==a?(e=c,D(b.getTime(),e,d)):e===a?E(b,d):F(b,e,d)}}kc.delay=function(a,b){return S(b)||(b=_b),a instanceof Date?H(this,a.getTime(),b):G(this,a,b)},kc.debounce=kc.throttleWithTimeout=function(a,b){S(b)||(b=_b);var c=this;return new Lc(function(d){var e,f=new Qb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Pb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Kb(i,f)})},kc.throttle=function(a,b){return fb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},kc.timestamp=function(a){return S(a)||(a=_b),this.map(function(b){return{value:b,timestamp:a.now()}})},kc.sample=kc.throttleLatest=function(a,b){return S(b)||(b=_b),"number"==typeof a?I(this,Gc(a,b)):I(this,a)},kc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=vc(new Error(b||"Timeout"))),S(c)||(c=_b);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Lc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Y(b)&&(b=Ec(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Pb,j=new Qb,k=!1,l=new Qb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Kb(j,l)})},kc.throttleFirst=function(a,b){S(b)||(b=_b);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Lc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Hc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Ob,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Ob)});return new Kb(c,d,e)}function c(c,d){this.source=c,this.controller=new Oc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Eb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(nc);kc.pausable=function(a){return new Hc(this,a)};var Ic=function(b){function c(b){var c,d=[],e=J(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Oc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Eb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(nc);kc.pausableBuffered=function(a){return new Ic(this,a)},kc.controlled=function(a){return null==a&&(a=!0),new Jc(this,a)};var Jc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Kc(d),this.source=c.multicast(this.subject).refCount()}return Eb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(nc),Kc=Q.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Oc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Ob,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Ob}return Eb(d,a),Fb(d.prototype,ic,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Ob):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Ob),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Ob:(this.requestedCount=a,this.requestedDisposable=Nb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Ob},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(nc);kc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Lc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Lc=Q.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Nb(a):Ob}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Mc(a);return Wb.scheduleRequired()?Wb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Eb(c,a),c}(nc),Mc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Pb}Eb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(lc),Nc=function(a,b){this.subject=a,this.observer=b};Nc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Oc=Q.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Ob):(a.onCompleted(),Ob):(this.observers.push(a),new Nc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Eb(d,a),Fb(d.prototype,ic,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Qc(a,b)},d}(nc),Pc=Q.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Nc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Ob}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Eb(d,a),Fb(d.prototype,ic,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(nc),Qc=Q.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Eb(b,a),Fb(b.prototype,ic,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(nc),Rc=Q.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Nc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Ob}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Eb(d,a),Fb(d.prototype,ic,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(nc),Sc=Q.ReplaySubject=function(a){function c(a,b){return Nb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new oc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Wb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Eb(e,a),Fb(e.prototype,ic,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(nc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(L.Rx=Q,define(function(){return Q})):M&&N?O?(N.exports=Q).Rx=Q:M.Rx=Q:L.Rx=Q}).call(this);
//# sourceMappingURL=rx.lite.compat.map

@@ -46,2 +46,3 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

ScheduledObserver = internals.ScheduledObserver,
SerialDisposable = Rx.SerialDisposable,
SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,

@@ -142,4 +143,5 @@ CompositeDisposable = Rx.CompositeDisposable,

function ObserveOnObserver() {
__super__.apply(this, arguments);
function ObserveOnObserver(scheduler, observer, cancel) {
__super__.call(this, scheduler, observer);
this._cancel = cancel;
}

@@ -162,2 +164,8 @@

ObserveOnObserver.prototype.dispose = function () {
__super__.prototype.dispose.call(this);
this._cancel && this._cancel.dispose();
this._cancel = null;
};
return ObserveOnObserver;

@@ -164,0 +172,0 @@ })(ScheduledObserver);

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:C.call(a)}function f(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function g(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function h(a){this.comparer=a,this.set=[]}var i=c.Observable,j=i.prototype,k=i.never,l=i.throwException,m=c.AnonymousObservable,n=c.Observer,o=c.Subject,p=c.internals,q=c.helpers,r=p.ScheduledObserver,s=c.SingleAssignmentDisposable,t=c.CompositeDisposable,u=c.RefCountDisposable,v=c.Disposable.empty,w=c.Scheduler.immediate,x=(q.defaultKeySerializer,c.internals.addRef),y=(q.identity,q.isPromise),z=p.inherits,A=(q.noop,q.isScheduler),B=i.fromPromise,C=Array.prototype.slice,D="Argument out of range";f.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var E=(function(a){function b(b){a.call(this),this._observer=b,this._state=0}z(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(n),function(a){function b(){a.apply(this,arguments)}return z(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b}(r));j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new E(a,c))})},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new s,e=new SerialDisposable;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new f(a,b.subscribe(c)))})),e})},i.generate=function(a,b,c,d,e){return A(e)||(e=currentThreadScheduler),new m(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=v;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new t(l(g).subscribe(c),f)}return new t(e.subscribe(c),f)})},j.amb=function(a){var b=this;return new m(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new s,j=new s;return y(a)&&(a=B(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new t(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}for(var b=k(),c=e(arguments,0),d=0,f=c.length;f>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return F([this,a])};var F=i.onErrorResumeNext=function(){var a=e(arguments,0);return new m(function(b){var c=0,d=new SerialDisposable,e=w.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],y(f)&&(f=B(f)),g=new s,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new t(d,e)})};return j.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},j.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(D);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(D);return new m(function(d){function e(){var a=new o;i.push(a),d.onNext(x(a,g))}var f=new s,g=new u(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},j.takeLastBuffer=function(a){var b=this;return new m(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},j.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new m(function(c){var d=!1;return b.subscribe(function(a){d=!0,c.onNext(a)},c.onError.bind(c),function(){d||c.onNext(a),c.onCompleted()})})},h.prototype.push=function(a){var b=-1===g(this.set,a,this.comparer);return b&&this.set.push(a),b},j.distinct=function(a,b){var c=this;return b||(b=defaultComparer),new m(function(d){var e=new h(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},c});
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:D.call(a)}function f(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function g(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function h(a){this.comparer=a,this.set=[]}var i=c.Observable,j=i.prototype,k=i.never,l=i.throwException,m=c.AnonymousObservable,n=c.Observer,o=c.Subject,p=c.internals,q=c.helpers,r=p.ScheduledObserver,s=c.SerialDisposable,t=c.SingleAssignmentDisposable,u=c.CompositeDisposable,v=c.RefCountDisposable,w=c.Disposable.empty,x=c.Scheduler.immediate,y=(q.defaultKeySerializer,c.internals.addRef),z=(q.identity,q.isPromise),A=p.inherits,B=(q.noop,q.isScheduler),C=i.fromPromise,D=Array.prototype.slice,E="Argument out of range";f.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var F=(function(a){function b(b){a.call(this),this._observer=b,this._state=0}A(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(n),function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return A(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(r));j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new F(a,c))})},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new t,e=new s;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new f(a,b.subscribe(c)))})),e})},i.generate=function(a,b,c,d,e){return B(e)||(e=currentThreadScheduler),new m(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=w;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new u(l(g).subscribe(c),f)}return new u(e.subscribe(c),f)})},j.amb=function(a){var b=this;return new m(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new t,j=new t;return z(a)&&(a=C(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new u(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}for(var b=k(),c=e(arguments,0),d=0,f=c.length;f>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return G([this,a])};var G=i.onErrorResumeNext=function(){var a=e(arguments,0);return new m(function(b){var c=0,d=new s,e=x.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],z(f)&&(f=C(f)),g=new t,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new u(d,e)})};return j.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},j.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(E);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(E);return new m(function(d){function e(){var a=new o;i.push(a),d.onNext(y(a,g))}var f=new t,g=new v(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},j.takeLastBuffer=function(a){var b=this;return new m(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},j.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new m(function(c){var d=!1;return b.subscribe(function(a){d=!0,c.onNext(a)},c.onError.bind(c),function(){d||c.onNext(a),c.onCompleted()})})},h.prototype.push=function(a){var b=-1===g(this.set,a,this.comparer);return b&&this.set.push(a),b},j.distinct=function(a,b){var c=this;return b||(b=defaultComparer),new m(function(d){var e=new h(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},c});
//# sourceMappingURL=rx.lite.extras.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(_)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;zb.nonEnumArgs&&a.length&&h(a)&&(a=Bb.call(a));var d=zb.enumPrototypes&&"function"==typeof a,e=zb.enumErrorProps&&(a===tb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(zb.nonEnumShadows&&a!==ub){var g=a.constructor,i=-1,j=xb.length;if(a===(g&&g.prototype))var k=a===stringProto?pb:a===tb?kb:qb.call(a),l=yb[k];for(;++i<j;)f=xb[i],l&&l[f]||!rb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?qb.call(a)==gb:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=qb.call(a),l=qb.call(b);if(k==gb&&(k=nb),l==gb&&(l=nb),k!=l)return!1;switch(k){case ib:case jb:return+a==+b;case mb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ob:case pb:return a==String(b)}var m=k==hb;if(!m){if(k!=nb||!zb.nodeClass&&(g(a)||g(b)))return!1;var n=!zb.argsObject&&h(a)?Object:a.constructor,o=!zb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||rb.call(a,"constructor")&&rb.call(b,"constructor")||Z(n)&&n instanceof n&&Z(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return rb.call(f,e)?(q++,r=rb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return rb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Bb.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&L.isFinite(a)}function r(b){var c,d=b[ab];if(!d&&"string"==typeof b)return c=new m(b),c[ab]();if(!d&&b.length!==a)return c=new o(b),c[ab]();if(!d)throw new TypeError("Object is not iterable");return b[ab]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>nc?nc:b):b}function v(a,b){return S(a)||(a=Sb),new Hc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new Hc(function(c){var d=new Lb,e=new Mb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Y(f)&&(f=Ac(f)),d=new Lb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new Hc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ac(f)),(db(f)||cb(f))&&(f=oc(f)),f}).concatAll()}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Y(f)&&(f=Ac(f)),(db(f)||cb(f))&&(f=oc(f)),f}).mergeAll()}function A(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Jb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function B(a,b,c){var d=new Gb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(B(a.item(e),b,c));else a&&d.add(A(a,b,c));return d}function C(a,b){return new Hc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function D(a,b,c){return new Hc(function(d){var e=0,f=a,g=Pb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function E(a,b){return new Hc(function(c){return b.scheduleWithRelative(Pb(a),function(){c.onNext(0),c.onCompleted()})})}function F(a,b,c){return a===b?new Hc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):lc(function(){return D(c.now()+a,b,c)})}function G(a,b,c){return new Hc(function(d){var e,f=!1,g=new Mb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Lb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Gb(e,g)})}function H(a,b,c){return lc(function(){return G(a,b-c.now(),c)})}function I(a,b){return new Hc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Gb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function J(a,b,c){return new Hc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(T))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Gb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var K={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},L=K[typeof window]&&window||this,M=K[typeof exports]&&exports&&!exports.nodeType&&exports,N=K[typeof module]&&module&&!module.nodeType&&module,O=N&&N.exports===M&&M,P=K[typeof global]&&global;!P||P.global!==P&&P.window!==P||(L=P);var Q={internals:{},config:{Promise:L.Promise},helpers:{}},R=Q.helpers.noop=function(){},S=(Q.helpers.notDefined=function(a){return"undefined"==typeof a},Q.helpers.isScheduler=function(a){return a instanceof Q.Scheduler}),T=Q.helpers.identity=function(a){return a},U=(Q.helpers.pluck=function(a){return function(b){return b[a]}},Q.helpers.just=function(a){return function(){return a}},Q.helpers.defaultNow=Date.now),V=Q.helpers.defaultComparer=function(a,b){return Ab(a,b)},W=Q.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},X=(Q.helpers.defaultKeySerializer=function(a){return a.toString()},Q.helpers.defaultError=function(a){throw a}),Y=Q.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Z=(Q.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Q.helpers.not=function(a){return!a},Q.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==qb.call(a)}),a}()),$="Argument out of range",_="Object has been disposed",ab="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";L.Set&&"function"==typeof(new L.Set)["@@iterator"]&&(ab="@@iterator");var bb=Q.doneEnumerator={done:!0,value:a},cb=Q.helpers.isIterable=function(b){return b[ab]!==a},db=Q.helpers.isArrayLike=function(b){return b&&b.length!==a};Q.helpers.iterator=ab;var eb,fb=Q.helpers.deprecate=function(){},gb="[object Arguments]",hb="[object Array]",ib="[object Boolean]",jb="[object Date]",kb="[object Error]",lb="[object Function]",mb="[object Number]",nb="[object Object]",ob="[object RegExp]",pb="[object String]",qb=Object.prototype.toString,rb=Object.prototype.hasOwnProperty,sb=qb.call(arguments)==gb,tb=Error.prototype,ub=Object.prototype,vb=ub.propertyIsEnumerable;try{eb=!(qb.call(document)==nb&&!({toString:0}+""))}catch(wb){eb=!0}var xb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yb={};yb[hb]=yb[jb]=yb[mb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},yb[ib]=yb[pb]={constructor:!0,toString:!0,valueOf:!0},yb[kb]=yb[lb]=yb[ob]={constructor:!0,toString:!0},yb[nb]={constructor:!0};var zb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);zb.enumErrorProps=vb.call(tb,"message")||vb.call(tb,"name"),zb.enumPrototypes=vb.call(a,"prototype"),zb.nonEnumArgs=0!=c,zb.nonEnumShadows=!/valueOf/.test(b)}(1),sb||(h=function(a){return a&&"object"==typeof a?rb.call(a,"callee"):!1});{var Ab=Q.internals.isEqual=function(a,b){return i(a,b,[],[])},Bb=Array.prototype.slice,Cb=({}.hasOwnProperty,this.inherits=Q.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Db=Q.internals.addProperties=function(a){for(var b=Bb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};Q.internals.addRef=function(a,b){return new Hc(function(c){return new Gb(b.getDisposable(),a.subscribe(c))})}}l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Eb=Q.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Fb=Eb.prototype;Fb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Fb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Fb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Fb.peek=function(){return this.items[0].value},Fb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Fb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Fb.enqueue=function(a){var b=this.length++;this.items[b]=new l(Eb.count++,a),this.percolate(b)},Fb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Eb.count=0;var Gb=Q.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Hb=Gb.prototype;Hb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Hb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Hb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Hb.toArray=function(){return this.disposables.slice(0)};var Ib=Q.Disposable=function(a){this.isDisposed=!1,this.action=a||R};Ib.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Jb=Ib.create=function(a){return new Ib(a)},Kb=Ib.empty={dispose:R},Lb=Q.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Mb=Q.SerialDisposable=Lb,Nb=(Q.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Kb:new a(this)},b}(),Q.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||W,this.disposable=new Lb});Nb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Nb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Nb.prototype.isCancelled=function(){return this.disposable.isDisposed},Nb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Ob=Q.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Kb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=U,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Pb=Ob.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Gb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Kb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Gb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Kb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Ob.prototype),function(){Ob.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Ob.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof L.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=L.setInterval(function(){d=c(d)},b);return Jb(function(){L.clearInterval(e)})}}(Ob.prototype);var Qb,Rb=Ob.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Pb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ob(U,a,b,c)}(),Sb=Ob.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Ob.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Ob.normalize(c),g=new Nb(this,b,d,f);if(e)e.enqueue(g);else{e=new Eb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Ob(U,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Tb=(Q.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Lb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),R),Ub=function(){var a,b=R;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!L.setTimeout)throw new Error("No concurrency detected!");a=L.setTimeout,b=L.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Vb=Ub.setTimeout,Wb=Ub.clearTimeout;!function(){function a(){if(!L.postMessage||L.importScripts)return!1;var a=!1,b=L.onmessage;return L.onmessage=function(){a=!0},L.postMessage("","*"),L.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(qb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=P&&O&&P.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=P&&O&&P.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Qb=d,Tb=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Qb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;L.addEventListener?L.addEventListener("message",b,!1):L.attachEvent("onmessage",b,!1),Qb=function(a){var b=h++;g[b]=a,L.postMessage(f+b,"*")}}else if(L.MessageChannel){var i=new L.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Qb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in L&&"onreadystatechange"in L.document.createElement("script")?Qb=function(a){var b=L.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},L.document.documentElement.appendChild(b)}:(Qb=function(a){return Vb(a,0)},Tb=Wb)}();var Xb=Ob.timeout=function(){function a(a,b){var c=this,d=new Lb,e=Qb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Gb(d,Jb(function(){Tb(e)}))}function b(a,b,c){var d=this,e=Ob.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Lb,g=Vb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Gb(f,Jb(function(){Wb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Ob(U,a,b,c)}(),Yb=Q.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return S(a)||(a=Rb),new Hc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Zb=Yb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Yb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),$b=Yb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Yb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),_b=Yb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Yb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),ac=Q.internals.Enumerator=function(a){this._next=a};ac.prototype.next=function(){return this._next()},ac.prototype[ab]=function(){return this};var bc=Q.internals.Enumerable=function(a){this._iterator=a};bc.prototype[ab]=function(){return this._iterator()},bc.prototype.concat=function(){var a=this;return new Hc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError()}var e,f=new Mb,g=Rb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Y(h)&&(h=Ac(h));var i=new Lb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Gb(f,g,Jb(function(){e=!0}))})},bc.prototype.catchError=function(){var a=this;return new Hc(function(b){var c;try{c=a[ab]()}catch(d){return void b.onError()}var e,f,g=new Mb,h=Rb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Y(i)&&(i=Ac(i));var j=new Lb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Gb(g,h,Jb(function(){e=!0}))})};var cc=bc.repeat=function(a,b){return null==b&&(b=-1),new bc(function(){var c=b;return new ac(function(){return 0===c?bb:(c>0&&c--,{done:!1,value:a})})})},dc=bc.of=function(a,b,c){return b||(b=T),new bc(function(){var d=-1;return new ac(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:bb})})},ec=Q.Observer=function(){};ec.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ec.prototype.asObserver=function(){return new ic(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var fc=ec.create=function(a,b,c){return a||(a=R),b||(b=X),c||(c=R),new ic(a,b,c)};ec.fromNotifier=function(a,b){return new ic(function(c){return a.call(b,Zb(c))},function(c){return a.call(b,$b(c))},function(){return a.call(b,_b())})};var gc,hc=Q.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Cb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ec),ic=Q.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Cb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(hc),jc=Q.Observable=function(){function a(a){this._subscribe=a}return gc=a.prototype,gc.subscribe=gc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:fc(a,b,c))},gc.subscribeOnNext=function(a,b){return this._subscribe(fc(2===arguments.length?function(c){a.call(b,c)}:a))},gc.subscribeOnError=function(a,b){return this._subscribe(fc(null,2===arguments.length?function(c){a.call(b,c)}:a))},gc.subscribeOnCompleted=function(a,b){return this._subscribe(fc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),kc=Q.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Mb}return Cb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(hc);gc.toArray=function(){var a=this;return new Hc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},jc.create=jc.createWithDisposable=function(a){return new Hc(a)};var lc=jc.defer=function(a){return new Hc(function(b){var c;try{c=a()}catch(d){return rc(d).subscribe(b)}return Y(c)&&(c=Ac(c)),c.subscribe(b)})},mc=jc.empty=function(a){return S(a)||(a=Rb),new Hc(function(b){return a.schedule(function(){b.onCompleted()})})},nc=Math.pow(2,53)-1;m.prototype[ab]=function(){return new n(this._s)},n.prototype[ab]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return bb},o.prototype[ab]=function(){return new p(this._a)},p.prototype[ab]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return bb};{var oc=jc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Z(b))throw new Error("mapFn when provided must be a function");S(d)||(d=Sb);var e=Object(a),f=r(e);return new Hc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&Z(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},pc=jc.fromArray=function(a,b){return fb("fromArray","from"),S(b)||(b=Sb),new Hc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};jc.never=function(){return new Hc(function(){return Kb})}}jc.of=function(){return v(null,arguments)},jc.ofWithScheduler=function(a){return v(a,Bb.call(arguments,1))},jc.range=function(a,b,c){return S(c)||(c=Sb),new Hc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},jc.repeat=function(a,b,c){return S(c)||(c=Sb),qc(a,c).repeat(null==b?-1:b)};var qc=jc["return"]=jc.just=function(a,b){return S(b)||(b=Rb),new Hc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};jc.returnValue=function(){return fb("returnValue","return or just"),qc.apply(null,arguments)};var rc=jc["throw"]=jc.throwException=jc.throwError=function(a,b){return S(b)||(b=Rb),new Hc(function(c){return b.schedule(function(){c.onError(a)})})};gc["catch"]=gc.catchError=function(a){return"function"==typeof a?w(this,a):sc([this,a])},gc.catchException=function(a){return fb("catchException","catch or catchError"),this.catchError(a)};var sc=jc.catchError=jc["catch"]=function(){return dc(j(arguments,0)).catchError()};jc.catchException=function(){return fb("catchException","catch or catchError"),sc.apply(null,arguments)},gc.combineLatest=function(){var a=Bb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),tc.apply(this,a)};var tc=jc.combineLatest=function(){var a=Bb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Hc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(T))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(T)&&c.onCompleted()}function e(a){j[a]=!0,j.every(T)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Lb;Y(f)&&(f=Ac(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Gb(m)})};gc.concat=function(){var a=Bb.call(arguments,0);return a.unshift(this),uc.apply(this,a)};var uc=jc.concat=function(){return dc(j(arguments,0)).concat()};gc.concatAll=function(){return this.merge(1)},gc.concatObservable=function(){return fb("concatObservable","concatAll"),this.merge(1)},gc.merge=function(a){if("number"!=typeof a)return vc(this,a);var b=this;return new Hc(function(c){function d(a){var b=new Lb;f.add(b),Y(a)&&(a=Ac(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Gb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var vc=jc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Bb.call(arguments,1)):(a=Rb,b=Bb.call(arguments,0)):(a=Rb,b=Bb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};gc.mergeAll=function(){var a=this;return new Hc(function(b){var c=new Gb,d=!1,e=new Lb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Lb;c.add(e),Y(a)&&(a=Ac(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},gc.mergeObservable=function(){return fb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},gc.skipUntil=function(a){var b=this;return new Hc(function(c){var d=!1,e=new Gb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Y(a)&&(a=Ac(a));var f=new Lb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},gc["switch"]=gc.switchLatest=function(){var a=this;return new Hc(function(b){var c=!1,d=new Mb,e=!1,f=0,g=a.subscribe(function(a){var g=new Lb,h=++f;c=!0,d.setDisposable(g),Y(a)&&(a=Ac(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Gb(g,d)})},gc.takeUntil=function(a){var b=this;return new Hc(function(c){return Y(a)&&(a=Ac(a)),new Gb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),R))})},gc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=Bb.call(arguments),c=b.pop();return b.unshift(a),new Hc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(T)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Lb;Y(c)&&(c=Ac(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Gb(j)})},jc.zip=function(){var a=Bb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},jc.zipArray=function(){var a=j(arguments,0);return new Hc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(T))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(T)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Lb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Gb(h);return j.add(Jb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},gc.asObservable=function(){return new Hc(this.subscribe.bind(this))},gc.dematerialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},gc.distinctUntilChanged=function(a,b){var c=this;return a||(a=T),b||(b=V),new Hc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},gc["do"]=gc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Hc(function(a){return e.subscribe(function(b){try{d(b)
}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},gc.doAction=function(){return fb("doAction","do or tap"),this.tap.apply(this,arguments)},gc.doOnNext=gc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},gc.doOnError=gc.tapOnError=function(a,b){return this.tap(R,2===arguments.length?function(c){a.call(b,c)}:a)},gc.doOnCompleted=gc.tapOnCompleted=function(a,b){return this.tap(R,null,2===arguments.length?function(){a.call(b)}:a)},gc["finally"]=gc.ensure=function(a){var b=this;return new Hc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Jb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},gc.finallyAction=function(a){return fb("finallyAction","finally or ensure"),this.ensure(a)},gc.ignoreElements=function(){var a=this;return new Hc(function(b){return a.subscribe(R,b.onError.bind(b),b.onCompleted.bind(b))})},gc.materialize=function(){var a=this;return new Hc(function(b){return a.subscribe(function(a){b.onNext(Zb(a))},function(a){b.onNext($b(a)),b.onCompleted()},function(){b.onNext(_b()),b.onCompleted()})})},gc.repeat=function(a){return cc(this,a).concat()},gc.retry=function(a){return cc(this,a).catchError()},gc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Hc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},gc.skipLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},gc.startWith=function(){var a,b,c=0;return arguments.length&&S(arguments[0])?(b=arguments[0],c=1):b=Rb,a=Bb.call(arguments,c),dc([pc(a,b),this]).concat()},gc.takeLast=function(a){var b=this;return new Hc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},gc.selectConcat=gc.concatMap=function(a,b,c){return Z(a)&&Z(b)?this.concatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ac(e)),(db(e)||cb(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Z(a)?y(this,a,c):y(this,function(){return a})},gc.select=gc.map=function(a,b){var c=Z(a)?a:function(){return a},d=this;return new Hc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},gc.pluck=function(a){return this.map(function(b){return b[a]})},gc.selectMany=gc.flatMap=function(a,b,c){return Z(a)&&Z(b)?this.flatMap(function(c,d){var e=a(c,d);return Y(e)&&(e=Ac(e)),(db(e)||cb(e))&&(e=oc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Z(a)?z(this,a,c):z(this,function(){return a})},gc.selectSwitch=gc.flatMapLatest=gc.switchMap=function(a,b){return this.select(a,b).switchLatest()},gc.skip=function(a){if(0>a)throw new Error($);var b=this;return new Hc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},gc.skipWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},gc.take=function(a,b){if(0>a)throw new RangeError($);if(0===a)return mc(b);var c=this;return new Hc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},gc.takeWhile=function(a,b){var c=this;return new Hc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},gc.where=gc.filter=function(a,b){var c=this;return new Hc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},jc.fromCallback=function(a,b,c){return function(){var d=Bb.call(arguments,0);return new Hc(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},jc.fromNodeCallback=function(a,b,c){return function(){var d=Bb.call(arguments,0);return new Hc(function(e){function f(a){if(a)return void e.onError(a);var b=Bb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},Q.config.useNativeEvents=!1;var wc=L.angular&&angular.element?angular.element:L.jQuery?L.jQuery:L.Zepto?L.Zepto:null,xc=!!L.Ember&&"function"==typeof L.Ember.addListener,yc=!!L.Backbone&&!!L.Backbone.Marionette;jc.fromEvent=function(a,b,c){if(a.addListener)return zc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!Q.config.useNativeEvents){if(yc)return zc(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(xc)return zc(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(wc){var d=wc(a);return zc(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Hc(function(d){return B(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var zc=jc.fromEventPattern=function(a,b,c){return new Hc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Jb(function(){b&&b(e,f)})}).publish().refCount()},Ac=jc.fromPromise=function(a){return lc(function(){var b=new Q.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};gc.toPromise=function(a){if(a||(a=Q.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},jc.startAsync=function(a){var b;try{b=a()}catch(c){return rc(c)}return Ac(b)},gc.multicast=function(a,b){var c=this;return"function"==typeof a?new Hc(function(d){var e=c.multicast(a());return new Gb(b(e).subscribe(d),e.connect())}):new Bc(c,a)},gc.publish=function(a){return a&&Z(a)?this.multicast(function(){return new Kc},a):this.multicast(new Kc)},gc.share=function(){return this.publish().refCount()},gc.publishLast=function(a){return a&&Z(a)?this.multicast(function(){return new Lc},a):this.multicast(new Lc)},gc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Nc(b)},a):this.multicast(new Nc(a))},gc.shareValue=function(a){return this.publishValue(a).refCount()},gc.replay=function(a,b,c,d){return a&&Z(a)?this.multicast(function(){return new Oc(b,c,d)},a):this.multicast(new Oc(b,c,d))},gc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Bc=Q.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Gb(f.subscribe(c),Jb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Cb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Hc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(jc),Cc=jc.interval=function(a,b){return F(a,a,S(b)?b:Xb)};jc.timer=function(b,c,d){var e;return S(d)||(d=Xb),c!==a&&"number"==typeof c?e=c:S(c)&&(d=c),b instanceof Date&&e===a?C(b.getTime(),d):b instanceof Date&&e!==a?(e=c,D(b.getTime(),e,d)):e===a?E(b,d):F(b,e,d)}}gc.delay=function(a,b){return S(b)||(b=Xb),a instanceof Date?H(this,a.getTime(),b):G(this,a,b)},gc.debounce=gc.throttleWithTimeout=function(a,b){S(b)||(b=Xb);var c=this;return new Hc(function(d){var e,f=new Mb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Lb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Gb(i,f)})},gc.throttle=function(a,b){return fb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},gc.timestamp=function(a){return S(a)||(a=Xb),this.map(function(b){return{value:b,timestamp:a.now()}})},gc.sample=gc.throttleLatest=function(a,b){return S(b)||(b=Xb),"number"==typeof a?I(this,Cc(a,b)):I(this,a)},gc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=rc(new Error(b||"Timeout"))),S(c)||(c=Xb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Hc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Y(b)&&(b=Ac(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Lb,j=new Mb,k=!1,l=new Mb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Gb(j,l)})},gc.throttleFirst=function(a,b){S(b)||(b=Xb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Hc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Dc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Kb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Kb)});return new Gb(c,d,e)}function c(c,d){this.source=c,this.controller=new Kc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Cb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(jc);gc.pausable=function(a){return new Dc(this,a)};var Ec=function(b){function c(b){var c,d=[],e=J(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Kc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Cb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(jc);gc.pausableBuffered=function(a){return new Ec(this,a)},gc.controlled=function(a){return null==a&&(a=!0),new Fc(this,a)};var Fc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Gc(d),this.source=c.multicast(this.subject).refCount()}return Cb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(jc),Gc=Q.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Kc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Kb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Kb}return Cb(d,a),Db(d.prototype,ec,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Kb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Kb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Kb:(this.requestedCount=a,this.requestedDisposable=Jb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Kb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(jc);gc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Hc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Hc=Q.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Jb(a):Kb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Ic(a);return Sb.scheduleRequired()?Sb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Cb(c,a),c}(jc),Ic=function(a){function b(b){a.call(this),this.observer=b,this.m=new Lb}Cb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(hc),Jc=function(a,b){this.subject=a,this.observer=b};Jc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Kc=Q.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Kb):(a.onCompleted(),Kb):(this.observers.push(a),new Jc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Mc(a,b)},d}(jc),Lc=Q.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Jc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Kb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(jc),Mc=Q.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Cb(b,a),Db(b.prototype,ec,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(jc),Nc=Q.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Jc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Kb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Cb(d,a),Db(d.prototype,ec,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(jc),Oc=Q.ReplaySubject=function(a){function c(a,b){return Jb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new kc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=this.q.length,g=0,h=this.q.length;h>g;g++)d.onNext(this.q[g].value);return this.hasError?(f++,d.onError(this.error)):this.isStopped&&(f++,d.onCompleted()),d.ensureActive(f),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Sb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Cb(e,a),Db(e.prototype,ec,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(jc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(L.Rx=Q,define(function(){return Q})):M&&N?O?(N.exports=Q).Rx=Q:M.Rx=Q:L.Rx=Q}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error($)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;zb.nonEnumArgs&&a.length&&Ab(a)&&(a=Cb.call(a));var d=zb.enumPrototypes&&"function"==typeof a,e=zb.enumErrorProps&&(a===sb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(zb.nonEnumShadows&&a!==tb){var g=a.constructor,h=-1,i=xb.length;if(a===(g&&g.prototype))var j=a===ub?ob:a===sb?jb:pb.call(a),k=yb[j];for(;++h<i;)f=xb[h],k&&k[f]||!qb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=pb.call(a),k=pb.call(b);if(j==fb&&(j=mb),k==fb&&(k=mb),j!=k)return!1;switch(j){case hb:case ib:return+a==+b;case lb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case nb:case ob:return a==String(b)}var l=j==gb;if(!l){if(j!=mb||!zb.nodeClass&&(g(a)||g(b)))return!1;var m=!zb.argsObject&&Ab(a)?Object:a.constructor,n=!zb.argsObject&&Ab(b)?Object:b.constructor;if(!(m==n||qb.call(a,"constructor")&&qb.call(b,"constructor")||Y(m)&&m instanceof m&&Y(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return qb.call(f,e)?(p++,q=qb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return qb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:Cb.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(){this._s=s}function m(){this._s=s,this._l=s.length,this._i=0}function n(a){this._a=a}function o(a){this._a=a,this._l=t(a),this._i=0}function p(a){return"number"==typeof a&&K.isFinite(a)}function q(b){var c,d=b[_];if(!d&&"string"==typeof b)return c=new l(b),c[_]();if(!d&&b.length!==a)return c=new n(b),c[_]();if(!d)throw new TypeError("Object is not iterable");return b[_]()}function r(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function t(a){var b=+a.length;return isNaN(b)?0:0!==b&&p(b)?(b=r(b)*Math.floor(Math.abs(b)),0>=b?0:b>oc?oc:b):b}function u(a,b){return R(a)||(a=Tb),new Ic(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function v(a,b){return new Ic(function(c){var d=new Mb,e=new Nb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}X(f)&&(f=Bc(f)),d=new Mb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function w(a,b){var c=this;return new Ic(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function x(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return X(f)&&(f=Bc(f)),(cb(f)||bb(f))&&(f=pc(f)),f}).concatAll()}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return X(f)&&(f=Bc(f)),(cb(f)||bb(f))&&(f=pc(f)),f}).mergeAll()}function z(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Kb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function A(a,b,c){var d=new Hb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(A(a.item(e),b,c));else a&&d.add(z(a,b,c));return d}function B(a,b){return new Ic(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function C(a,b,c){return new Ic(function(d){var e=0,f=a,g=Qb(b);return c.scheduleRecursiveWithAbsolute(f,function(a){if(g>0){var b=c.now();f+=g,b>=f&&(f=b+g)}d.onNext(e++),a(f)})})}function D(a,b){return new Ic(function(c){return b.scheduleWithRelative(Qb(a),function(){c.onNext(0),c.onCompleted()})})}function E(a,b,c){return a===b?new Ic(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):mc(function(){return C(c.now()+a,b,c)})}function F(a,b,c){return new Ic(function(d){var e,f=!1,g=new Nb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Mb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Hb(e,g)})}function G(a,b,c){return mc(function(){return F(a,b-c.now(),c)})}function H(a,b){return new Ic(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new Hb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))})}function I(a,b,c){return new Ic(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(S))){if(f)return void d.onError(f);try{e=c.apply(null,j)}catch(k){return void d.onError(k)}d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Hb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},d.onError.bind(d),function(){i=!0,e(!0,1)}))})}var J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},K=J[typeof window]&&window||this,L=J[typeof exports]&&exports&&!exports.nodeType&&exports,M=J[typeof module]&&module&&!module.nodeType&&module,N=M&&M.exports===L&&L,O=J[typeof global]&&global;!O||O.global!==O&&O.window!==O||(K=O);var P={internals:{},config:{Promise:K.Promise},helpers:{}},Q=P.helpers.noop=function(){},R=(P.helpers.notDefined=function(a){return"undefined"==typeof a},P.helpers.isScheduler=function(a){return a instanceof P.Scheduler}),S=P.helpers.identity=function(a){return a},T=(P.helpers.pluck=function(a){return function(b){return b[a]}},P.helpers.just=function(a){return function(){return a}},P.helpers.defaultNow=Date.now),U=P.helpers.defaultComparer=function(a,b){return Bb(a,b)},V=P.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},W=(P.helpers.defaultKeySerializer=function(a){return a.toString()},P.helpers.defaultError=function(a){throw a}),X=P.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},Y=(P.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},P.helpers.not=function(a){return!a},P.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==pb.call(a)}),a}()),Z="Argument out of range",$="Object has been disposed",_="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";K.Set&&"function"==typeof(new K.Set)["@@iterator"]&&(_="@@iterator");var ab=P.doneEnumerator={done:!0,value:a},bb=P.helpers.isIterable=function(b){return b[_]!==a},cb=P.helpers.isArrayLike=function(b){return b&&b.length!==a};P.helpers.iterator=_;var db,eb=P.helpers.deprecate=function(){},fb="[object Arguments]",gb="[object Array]",hb="[object Boolean]",ib="[object Date]",jb="[object Error]",kb="[object Function]",lb="[object Number]",mb="[object Object]",nb="[object RegExp]",ob="[object String]",pb=Object.prototype.toString,qb=Object.prototype.hasOwnProperty,rb=pb.call(arguments)==fb,sb=Error.prototype,tb=Object.prototype,ub=String.prototype,vb=tb.propertyIsEnumerable;try{db=!(pb.call(document)==mb&&!({toString:0}+""))}catch(wb){db=!0}var xb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yb={};yb[gb]=yb[ib]=yb[lb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},yb[hb]=yb[ob]={constructor:!0,toString:!0,valueOf:!0},yb[jb]=yb[kb]=yb[nb]={constructor:!0,toString:!0},yb[mb]={constructor:!0};var zb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);zb.enumErrorProps=vb.call(sb,"message")||vb.call(sb,"name"),zb.enumPrototypes=vb.call(a,"prototype"),zb.nonEnumArgs=0!=c,zb.nonEnumShadows=!/valueOf/.test(b)}(1);var Ab=function(a){return a&&"object"==typeof a?pb.call(a)==fb:!1};rb||(Ab=function(a){return a&&"object"==typeof a?qb.call(a,"callee"):!1});{var Bb=P.internals.isEqual=function(a,b){return h(a,b,[],[])},Cb=Array.prototype.slice,Db=({}.hasOwnProperty,this.inherits=P.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Eb=P.internals.addProperties=function(a){for(var b=Cb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}};P.internals.addRef=function(a,b){return new Ic(function(c){return new Hb(b.getDisposable(),a.subscribe(c))})}}k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Fb=P.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Gb=Fb.prototype;Gb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Gb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Gb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Gb.peek=function(){return this.items[0].value},Gb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Gb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Gb.enqueue=function(a){var b=this.length++;this.items[b]=new k(Fb.count++,a),this.percolate(b)},Gb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Fb.count=0;var Hb=P.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Ib=Hb.prototype;Ib.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Ib.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Ib.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Ib.toArray=function(){return this.disposables.slice(0)};var Jb=P.Disposable=function(a){this.isDisposed=!1,this.action=a||Q};Jb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Kb=Jb.create=function(a){return new Jb(a)},Lb=Jb.empty={dispose:Q},Mb=P.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Nb=P.SerialDisposable=Mb,Ob=(P.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Lb:new a(this)},b}(),P.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||V,this.disposable=new Mb});Ob.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Ob.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Ob.prototype.isCancelled=function(){return this.disposable.isDisposed},Ob.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Pb=P.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Lb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=T,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Qb=Pb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Hb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Lb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Hb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Lb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Pb.prototype),function(){Pb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Pb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof K.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=K.setInterval(function(){d=c(d)},b);return Kb(function(){K.clearInterval(e)})}}(Pb.prototype);var Rb,Sb=Pb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Qb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Pb(T,a,b,c)}(),Tb=Pb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Pb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Pb.normalize(c),g=new Ob(this,b,d,f);if(e)e.enqueue(g);else{e=new Fb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Pb(T,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ub=(P.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Mb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Q),Vb=function(){var a,b=Q;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!K.setTimeout)throw new Error("No concurrency detected!");a=K.setTimeout,b=K.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Wb=Vb.setTimeout,Xb=Vb.clearTimeout;!function(){function a(){if(!K.postMessage||K.importScripts)return!1;var a=!1,b=K.onmessage;return K.onmessage=function(){a=!0},K.postMessage("","*"),K.onmessage=b,a}var b=RegExp("^"+String(pb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=O&&N&&O.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=O&&N&&O.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Rb=c,Ub=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Rb=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};K.addEventListener?K.addEventListener("message",h,!1):K.attachEvent("onmessage",h,!1),Rb=function(a){var b=g++;f[b]=a,K.postMessage(e+b,"*")}}else if(K.MessageChannel){var i=new K.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Rb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in K&&"onreadystatechange"in K.document.createElement("script")?Rb=function(a){var b=K.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},K.document.documentElement.appendChild(b)}:(Rb=function(a){return Wb(a,0)},Ub=Xb)}();var Yb=Pb.timeout=function(){function a(a,b){var c=this,d=new Mb,e=Rb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Hb(d,Kb(function(){Ub(e)}))}function b(a,b,c){var d=this,e=Pb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Mb,g=Wb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Hb(f,Kb(function(){Xb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Pb(T,a,b,c)}(),Zb=P.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return R(a)||(a=Sb),new Ic(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),$b=Zb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Zb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),_b=Zb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Zb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),ac=Zb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Zb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),bc=P.internals.Enumerator=function(a){this._next=a};bc.prototype.next=function(){return this._next()},bc.prototype[_]=function(){return this};var cc=P.internals.Enumerable=function(a){this._iterator=a};cc.prototype[_]=function(){return this._iterator()},cc.prototype.concat=function(){var a=this;return new Ic(function(b){var c;try{c=a[_]()}catch(d){return void b.onError(d)}var e,f=new Nb,g=Sb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;X(h)&&(h=Bc(h));var i=new Mb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Hb(f,g,Kb(function(){e=!0}))})},cc.prototype.catchError=function(){var a=this;return new Ic(function(b){var c;try{c=a[_]()}catch(d){return void b.onError(d)}var e,f,g=new Nb,h=Sb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;X(i)&&(i=Bc(i));var j=new Mb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Hb(g,h,Kb(function(){e=!0}))})};var dc=cc.repeat=function(a,b){return null==b&&(b=-1),new cc(function(){var c=b;return new bc(function(){return 0===c?ab:(c>0&&c--,{done:!1,value:a})})})},ec=cc.of=function(a,b,c){return b||(b=S),new cc(function(){var d=-1;return new bc(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:ab})})},fc=P.Observer=function(){};fc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},fc.prototype.asObserver=function(){return new jc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))};var gc=fc.create=function(a,b,c){return a||(a=Q),b||(b=W),c||(c=Q),new jc(a,b,c)};fc.fromNotifier=function(a,b){return new jc(function(c){return a.call(b,$b(c))},function(c){return a.call(b,_b(c))},function(){return a.call(b,ac())})};var hc,ic=P.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Db(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(fc),jc=P.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Db(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(ic),kc=P.Observable=function(){function a(a){this._subscribe=a}return hc=a.prototype,hc.subscribe=hc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:gc(a,b,c))},hc.subscribeOnNext=function(a,b){return this._subscribe(gc(2===arguments.length?function(c){a.call(b,c)}:a))},hc.subscribeOnError=function(a,b){return this._subscribe(gc(null,2===arguments.length?function(c){a.call(b,c)}:a))},hc.subscribeOnCompleted=function(a,b){return this._subscribe(gc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}(),lc=P.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Nb}return Db(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(ic);hc.toArray=function(){var a=this;return new Ic(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},kc.create=kc.createWithDisposable=function(a){return new Ic(a)};var mc=kc.defer=function(a){return new Ic(function(b){var c;try{c=a()}catch(d){return sc(d).subscribe(b)}return X(c)&&(c=Bc(c)),c.subscribe(b)})},nc=kc.empty=function(a){return R(a)||(a=Sb),new Ic(function(b){return a.schedule(function(){b.onCompleted()})})},oc=Math.pow(2,53)-1;l.prototype[_]=function(){return new m(this._s)},m.prototype[_]=function(){return this},m.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return ab},n.prototype[_]=function(){return new o(this._a)},o.prototype[_]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return ab};{var pc=kc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Y(b))throw new Error("mapFn when provided must be a function");R(d)||(d=Tb);var e=Object(a),f=q(e);return new Ic(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&Y(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},qc=kc.fromArray=function(a,b){return eb("fromArray","from"),R(b)||(b=Tb),new Ic(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};kc.never=function(){return new Ic(function(){return Lb})}}kc.of=function(){return u(null,arguments)},kc.ofWithScheduler=function(a){return u(a,Cb.call(arguments,1))},kc.range=function(a,b,c){return R(c)||(c=Tb),new Ic(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},kc.repeat=function(a,b,c){return R(c)||(c=Tb),rc(a,c).repeat(null==b?-1:b)};var rc=kc["return"]=kc.just=function(a,b){return R(b)||(b=Sb),new Ic(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};kc.returnValue=function(){return eb("returnValue","return or just"),rc.apply(null,arguments)};var sc=kc["throw"]=kc.throwException=kc.throwError=function(a,b){return R(b)||(b=Sb),new Ic(function(c){return b.schedule(function(){c.onError(a)})})};hc["catch"]=hc.catchError=function(a){return"function"==typeof a?v(this,a):tc([this,a])},hc.catchException=function(a){return eb("catchException","catch or catchError"),this.catchError(a)};var tc=kc.catchError=kc["catch"]=function(){return ec(i(arguments,0)).catchError()};kc.catchException=function(){return eb("catchException","catch or catchError"),tc.apply(null,arguments)},hc.combineLatest=function(){var a=Cb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),uc.apply(this,a)};var uc=kc.combineLatest=function(){var a=Cb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new Ic(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(S))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(S)&&c.onCompleted()}function e(a){k[a]=!0,k.every(S)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Mb;X(f)&&(f=Bc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Hb(m)})};hc.concat=function(){var a=Cb.call(arguments,0);return a.unshift(this),vc.apply(this,a)};var vc=kc.concat=function(){return ec(i(arguments,0)).concat()};hc.concatAll=function(){return this.merge(1)},hc.concatObservable=function(){return eb("concatObservable","concatAll"),this.merge(1)},hc.merge=function(a){if("number"!=typeof a)return wc(this,a);var b=this;return new Ic(function(c){function d(a){var b=new Mb;f.add(b),X(a)&&(a=Bc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Hb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var wc=kc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=Cb.call(arguments,1)):(a=Sb,b=Cb.call(arguments,0)):(a=Sb,b=Cb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),u(a,b).mergeAll()};hc.mergeAll=function(){var a=this;return new Ic(function(b){var c=new Hb,d=!1,e=new Mb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Mb;c.add(e),X(a)&&(a=Bc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},hc.mergeObservable=function(){return eb("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},hc.skipUntil=function(a){var b=this;return new Ic(function(c){var d=!1,e=new Hb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));X(a)&&(a=Bc(a));var f=new Mb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},hc["switch"]=hc.switchLatest=function(){var a=this;return new Ic(function(b){var c=!1,d=new Nb,e=!1,f=0,g=a.subscribe(function(a){var g=new Mb,h=++f;c=!0,d.setDisposable(g),X(a)&&(a=Bc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Hb(g,d)})},hc.takeUntil=function(a){var b=this;return new Ic(function(c){return X(a)&&(a=Bc(a)),new Hb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),Q))})},hc.zip=function(){if(Array.isArray(arguments[0]))return w.apply(this,arguments);var a=this,b=Cb.call(arguments),c=b.pop();return b.unshift(a),new Ic(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(S)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Mb;X(c)&&(c=Bc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Hb(k)})},kc.zip=function(){var a=Cb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},kc.zipArray=function(){var a=i(arguments,0);return new Ic(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(S))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(S)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Mb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Hb(h);return k.add(Kb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},hc.asObservable=function(){return new Ic(this.subscribe.bind(this))},hc.dematerialize=function(){var a=this;return new Ic(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},hc.distinctUntilChanged=function(a,b){var c=this;return a||(a=S),b||(b=U),new Ic(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},hc["do"]=hc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new Ic(function(a){return e.subscribe(function(b){try{d(b)
}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},hc.doAction=function(){return eb("doAction","do or tap"),this.tap.apply(this,arguments)},hc.doOnNext=hc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},hc.doOnError=hc.tapOnError=function(a,b){return this.tap(Q,2===arguments.length?function(c){a.call(b,c)}:a)},hc.doOnCompleted=hc.tapOnCompleted=function(a,b){return this.tap(Q,null,2===arguments.length?function(){a.call(b)}:a)},hc["finally"]=hc.ensure=function(a){var b=this;return new Ic(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Kb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},hc.finallyAction=function(a){return eb("finallyAction","finally or ensure"),this.ensure(a)},hc.ignoreElements=function(){var a=this;return new Ic(function(b){return a.subscribe(Q,b.onError.bind(b),b.onCompleted.bind(b))})},hc.materialize=function(){var a=this;return new Ic(function(b){return a.subscribe(function(a){b.onNext($b(a))},function(a){b.onNext(_b(a)),b.onCompleted()},function(){b.onNext(ac()),b.onCompleted()})})},hc.repeat=function(a){return dc(this,a).concat()},hc.retry=function(a){return dc(this,a).catchError()},hc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Ic(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},hc.skipLast=function(a){var b=this;return new Ic(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},hc.startWith=function(){var a,b,c=0;return arguments.length&&R(arguments[0])?(b=arguments[0],c=1):b=Sb,a=Cb.call(arguments,c),ec([qc(a,b),this]).concat()},hc.takeLast=function(a){var b=this;return new Ic(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},hc.selectConcat=hc.concatMap=function(a,b,c){return Y(a)&&Y(b)?this.concatMap(function(c,d){var e=a(c,d);return X(e)&&(e=Bc(e)),(cb(e)||bb(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Y(a)?x(this,a,c):x(this,function(){return a})},hc.select=hc.map=function(a,b){var c=Y(a)?a:function(){return a},d=this;return new Ic(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},hc.pluck=function(a){return this.map(function(b){return b[a]})},hc.selectMany=hc.flatMap=function(a,b,c){return Y(a)&&Y(b)?this.flatMap(function(c,d){var e=a(c,d);return X(e)&&(e=Bc(e)),(cb(e)||bb(e))&&(e=pc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Y(a)?y(this,a,c):y(this,function(){return a})},hc.selectSwitch=hc.flatMapLatest=hc.switchMap=function(a,b){return this.select(a,b).switchLatest()},hc.skip=function(a){if(0>a)throw new Error(Z);var b=this;return new Ic(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},hc.skipWhile=function(a,b){var c=this;return new Ic(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},hc.take=function(a,b){if(0>a)throw new RangeError(Z);if(0===a)return nc(b);var c=this;return new Ic(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},hc.takeWhile=function(a,b){var c=this;return new Ic(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},hc.where=hc.filter=function(a,b){var c=this;return new Ic(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},kc.fromCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Ic(function(e){function f(a){var b=a;if(c){try{b=c(arguments)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},kc.fromNodeCallback=function(a,b,c){return function(){var d=Cb.call(arguments,0);return new Ic(function(e){function f(a){if(a)return void e.onError(a);var b=Cb.call(arguments,1);if(c){try{b=c(b)}catch(d){return void e.onError(d)}e.onNext(b)}else b.length<=1?e.onNext.apply(e,b):e.onNext(b);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},P.config.useNativeEvents=!1;var xc=K.angular&&angular.element?angular.element:K.jQuery?K.jQuery:K.Zepto?K.Zepto:null,yc=!!K.Ember&&"function"==typeof K.Ember.addListener,zc=!!K.Backbone&&!!K.Backbone.Marionette;kc.fromEvent=function(a,b,c){if(a.addListener)return Ac(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c);if(!P.config.useNativeEvents){if(zc)return Ac(function(c){a.on(b,c)},function(c){a.off(b,c)},c);if(yc)return Ac(function(c){Ember.addListener(a,b,c)},function(c){Ember.removeListener(a,b,c)},c);if(xc){var d=xc(a);return Ac(function(a){d.on(b,a)},function(a){d.off(b,a)},c)}}return new Ic(function(d){return A(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)})}).publish().refCount()};var Ac=kc.fromEventPattern=function(a,b,c){return new Ic(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return void d.onError(e)}d.onNext(b)}var f=a(e);return Kb(function(){b&&b(e,f)})}).publish().refCount()},Bc=kc.fromPromise=function(a){return mc(function(){var b=new P.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};hc.toPromise=function(a){if(a||(a=P.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},kc.startAsync=function(a){var b;try{b=a()}catch(c){return sc(c)}return Bc(b)},hc.multicast=function(a,b){var c=this;return"function"==typeof a?new Ic(function(d){var e=c.multicast(a());return new Hb(b(e).subscribe(d),e.connect())}):new Cc(c,a)},hc.publish=function(a){return a&&Y(a)?this.multicast(function(){return new Lc},a):this.multicast(new Lc)},hc.share=function(){return this.publish().refCount()},hc.publishLast=function(a){return a&&Y(a)?this.multicast(function(){return new Mc},a):this.multicast(new Mc)},hc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Oc(b)},a):this.multicast(new Oc(a))},hc.shareValue=function(a){return this.publishValue(a).refCount()},hc.replay=function(a,b,c,d){return a&&Y(a)?this.multicast(function(){return new Pc(b,c,d)},a):this.multicast(new Pc(b,c,d))},hc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Cc=P.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Hb(f.subscribe(c),Kb(function(){e=!1}))),d},a.call(this,c.subscribe.bind(c))}return Db(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Ic(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(kc),Dc=kc.interval=function(a,b){return E(a,a,R(b)?b:Yb)};kc.timer=function(b,c,d){var e;return R(d)||(d=Yb),c!==a&&"number"==typeof c?e=c:R(c)&&(d=c),b instanceof Date&&e===a?B(b.getTime(),d):b instanceof Date&&e!==a?(e=c,C(b.getTime(),e,d)):e===a?D(b,d):E(b,e,d)}}hc.delay=function(a,b){return R(b)||(b=Yb),a instanceof Date?G(this,a.getTime(),b):F(this,a,b)},hc.debounce=hc.throttleWithTimeout=function(a,b){R(b)||(b=Yb);var c=this;return new Ic(function(d){var e,f=new Nb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Mb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Hb(i,f)})},hc.throttle=function(a,b){return eb("throttle","debounce or throttleWithTimeout"),this.debounce(a,b)},hc.timestamp=function(a){return R(a)||(a=Yb),this.map(function(b){return{value:b,timestamp:a.now()}})},hc.sample=hc.throttleLatest=function(a,b){return R(b)||(b=Yb),"number"==typeof a?H(this,Dc(a,b)):H(this,a)},hc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=sc(new Error(b||"Timeout"))),R(c)||(c=Yb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Ic(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(X(b)&&(b=Bc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Mb,j=new Nb,k=!1,l=new Nb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Hb(j,l)})},hc.throttleFirst=function(a,b){R(b)||(b=Yb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Ic(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},a.onError.bind(a),a.onCompleted.bind(a))})};var Ec=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Lb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Lb)});return new Hb(c,d,e)}function c(c,d){this.source=c,this.controller=new Lc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b)}return Db(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(kc);hc.pausable=function(a){return new Ec(this,a)};var Fc=function(b){function c(b){var c,d=[],e=I(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(e){if(c!==a&&e.shouldFire!=c){if(c=e.shouldFire,e.shouldFire)for(;d.length>0;)b.onNext(d.shift())}else c=e.shouldFire,e.shouldFire?b.onNext(e.data):d.push(e.data)},function(a){for(;d.length>0;)b.onNext(d.shift());b.onError(a)},function(){for(;d.length>0;)b.onNext(d.shift());b.onCompleted()});return e}function d(a,d){this.source=a,this.controller=new Lc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c)}return Db(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(kc);hc.pausableBuffered=function(a){return new Fc(this,a)},hc.controlled=function(a){return null==a&&(a=!0),new Gc(this,a)};var Gc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b),this.subject=new Hc(d),this.source=c.multicast(this.subject).refCount()}return Db(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(kc),Hc=P.ControlledSubject=function(a){function c(a){return this.subject.subscribe(a)}function d(b){null==b&&(b=!0),a.call(this,c),this.subject=new Lc,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=Lb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.controlledDisposable=Lb}return Db(d,a),Eb(d.prototype,fc,{onCompleted:function(){b.call(this),this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length||this.subject.onCompleted()},onError:function(a){b.call(this),this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length||this.subject.onError(a)},onNext:function(a){b.call(this);var c=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(a):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),c=!0),c&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0;)this.subject.onNext(this.queue.shift()),a--;return 0!==this.queue.length?{numberOfItems:a,returnValue:!0}:{numberOfItems:a,returnValue:!1}}return this.hasFailed?(this.subject.onError(this.error),this.controlledDisposable.dispose(),this.controlledDisposable=Lb):this.hasCompleted&&(this.subject.onCompleted(),this.controlledDisposable.dispose(),this.controlledDisposable=Lb),{numberOfItems:a,returnValue:!1}},request:function(a){b.call(this),this.disposeCurrentRequest();var c=this,d=this._processRequest(a);return a=d.numberOfItems,d.returnValue?Lb:(this.requestedCount=a,this.requestedDisposable=Kb(function(){c.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Lb},dispose:function(){this.isDisposed=!0,this.error=null,this.subject.dispose(),this.requestedDisposable.dispose()}}),d}(kc);hc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new Ic(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var Ic=P.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Kb(a):Lb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new Jc(a);return Tb.scheduleRequired()?Tb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return Db(c,a),c}(kc),Jc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Mb}Db(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(ic),Kc=function(a,b){this.subject=a,this.observer=b};Kc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Lc=P.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Lb):(a.onCompleted(),Lb):(this.observers.push(a),new Kc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Nc(a,b)},d}(kc),Mc=P.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new Kc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Lb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(kc),Nc=P.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return Db(b,a),Eb(b.prototype,fc,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(kc),Oc=P.BehaviorSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),a.onNext(this.value),new Kc(this,a);var c=this.exception;return c?a.onError(c):a.onCompleted(),Lb}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.exception=null}return Db(d,a),Eb(d.prototype,fc,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=this.observers.slice(0),d=c.length;d>a;a++)c[a].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.exception=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped){this.value=a;for(var c=0,d=this.observers.slice(0),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(kc),Pc=P.ReplaySubject=function(a){function c(a,b){return Kb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var d=new lc(this.scheduler,a),e=c(this,d);b.call(this),this._trim(this.scheduler.now()),this.observers.push(d);for(var f=0,g=this.q.length;g>f;f++)d.onNext(this.q[f].value);return this.hasError?d.onError(this.error):this.isStopped&&d.onCompleted(),d.ensureActive(),e}function e(b,c,e){this.bufferSize=null==b?Number.MAX_VALUE:b,this.windowSize=null==c?Number.MAX_VALUE:c,this.scheduler=e||Tb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}return Db(e,a),Eb(e.prototype,fc,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(b.call(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onNext(a),g.ensureActive()}}},onError:function(a){if(b.call(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=this.observers.slice(0),e=0,f=d.length;f>e;e++){var g=d[e];g.onError(a),g.ensureActive()}this.observers=[]}},onCompleted:function(){if(b.call(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.onCompleted(),f.ensureActive()}this.observers=[]}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(kc);"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K.Rx=P,define(function(){return P})):L&&M?N?(M.exports=P).Rx=P:L.Rx=P:K.Rx=P}).call(this);
//# sourceMappingURL=rx.lite.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(){if(this.isDisposed)throw new Error(U)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&h(a)&&(a=ub.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===mb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==nb){var g=a.constructor,i=-1,j=qb.length;if(a===(g&&g.prototype))var k=a===stringProto?ib:a===mb?db:jb.call(a),l=rb[k];for(;++i<j;)f=qb[i],l&&l[f]||!kb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a){return a&&"object"==typeof a?jb.call(a)==_:!1}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,j=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=j&&"object"!=j))return!1;var k=jb.call(a),l=jb.call(b);if(k==_&&(k=gb),l==_&&(l=gb),k!=l)return!1;switch(k){case bb:case cb:return+a==+b;case fb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case hb:case ib:return a==String(b)}var m=k==ab;if(!m){if(k!=gb||!sb.nodeClass&&(g(a)||g(b)))return!1;var n=!sb.argsObject&&h(a)?Object:a.constructor,o=!sb.argsObject&&h(b)?Object:b.constructor;if(!(n==o||kb.call(a,"constructor")&&kb.call(b,"constructor")||S(n)&&n instanceof n&&S(o)&&o instanceof o||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var p=c.length;p--;)if(c[p]==a)return d[p]==b;var q=0,r=!0;if(c.push(a),d.push(b),m){if(p=a.length,q=b.length,r=q==p)for(;q--;){var s=b[q];if(!(r=i(a[q],s,c,d)))break}}else f(b,function(b,e,f){return kb.call(f,e)?(q++,r=kb.call(a,e)&&i(a[e],b,c,d)):void 0}),r&&f(a,function(a,b,c){return kb.call(c,b)?r=--q>-1:void 0});return c.pop(),d.pop(),r}function j(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:ub.call(a)}function k(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function l(a,b){this.id=a,this.value=b}function m(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function n(){this._s=s}function o(){this._s=s,this._l=s.length,this._i=0}function p(a){this._a=a}function q(a){this._a=a,this._l=v(a),this._i=0}function r(a){return"number"==typeof a&&E.isFinite(a)}function t(b){var c,d=b[V];if(!d&&"string"==typeof b)return c=new n(b),c[V]();if(!d&&b.length!==a)return c=new p(b),c[V]();if(!d)throw new TypeError("Object is not iterable");return b[V]()}function u(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function v(a){var b=+a.length;return isNaN(b)?0:0!==b&&r(b)?(b=u(b)*Math.floor(Math.abs(b)),0>=b?0:b>lc?lc:b):b}function w(a,b){return L(a)||(a=Nb),new wc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function x(a,b){return new wc(function(c){var d=new Fb,e=new Gb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}R(f)&&(f=ic(f)),d=new Fb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function y(a,b){var c=this;return new wc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function z(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=ic(f)),(Y(f)||X(f))&&(f=mc(f)),f}).concatAll()}function A(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function B(a){this.comparer=a,this.set=[]}function C(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return R(f)&&(f=ic(f)),(Y(f)||X(f))&&(f=mc(f)),f}).mergeAll()}var D={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},E=D[typeof window]&&window||this,F=D[typeof exports]&&exports&&!exports.nodeType&&exports,G=D[typeof module]&&module&&!module.nodeType&&module,H=G&&G.exports===F&&F,I=D[typeof global]&&global;!I||I.global!==I&&I.window!==I||(E=I);var J={internals:{},config:{Promise:E.Promise},helpers:{}},K=J.helpers.noop=function(){},L=(J.helpers.notDefined=function(a){return"undefined"==typeof a},J.helpers.isScheduler=function(a){return a instanceof J.Scheduler}),M=J.helpers.identity=function(a){return a},N=(J.helpers.pluck=function(a){return function(b){return b[a]}},J.helpers.just=function(a){return function(){return a}},J.helpers.defaultNow=Date.now),O=J.helpers.defaultComparer=function(a,b){return tb(a,b)},P=J.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Q=(J.helpers.defaultKeySerializer=function(a){return a.toString()},J.helpers.defaultError=function(a){throw a}),R=J.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},S=(J.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},J.helpers.not=function(a){return!a},J.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==jb.call(a)}),a}()),T="Argument out of range",U="Object has been disposed",V="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";E.Set&&"function"==typeof(new E.Set)["@@iterator"]&&(V="@@iterator");var W=J.doneEnumerator={done:!0,value:a},X=J.helpers.isIterable=function(b){return b[V]!==a},Y=J.helpers.isArrayLike=function(b){return b&&b.length!==a};J.helpers.iterator=V;var Z,$=J.helpers.deprecate=function(){},_="[object Arguments]",ab="[object Array]",bb="[object Boolean]",cb="[object Date]",db="[object Error]",eb="[object Function]",fb="[object Number]",gb="[object Object]",hb="[object RegExp]",ib="[object String]",jb=Object.prototype.toString,kb=Object.prototype.hasOwnProperty,lb=jb.call(arguments)==_,mb=Error.prototype,nb=Object.prototype,ob=nb.propertyIsEnumerable;try{Z=!(jb.call(document)==gb&&!({toString:0}+""))}catch(pb){Z=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[ab]=rb[cb]=rb[fb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[bb]=rb[ib]={constructor:!0,toString:!0,valueOf:!0},rb[db]=rb[eb]=rb[hb]={constructor:!0,toString:!0},rb[gb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(mb,"message")||ob.call(mb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1),lb||(h=function(a){return a&&"object"==typeof a?kb.call(a,"callee"):!1});var tb=J.internals.isEqual=function(a,b){return i(a,b,[],[])},ub=Array.prototype.slice,vb=({}.hasOwnProperty,this.inherits=J.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),wb=J.internals.addProperties=function(a){for(var b=ub.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},xb=J.internals.addRef=function(a,b){return new wc(function(c){return new Ab(b.getDisposable(),a.subscribe(c))})};l.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var yb=J.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},zb=yb.prototype;zb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},zb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},zb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},zb.peek=function(){return this.items[0].value},zb.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},zb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},zb.enqueue=function(a){var b=this.length++;this.items[b]=new l(yb.count++,a),this.percolate(b)},zb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},yb.count=0;var Ab=J.CompositeDisposable=function(){this.disposables=j(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Bb=Ab.prototype;Bb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Bb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Bb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Bb.toArray=function(){return this.disposables.slice(0)};var Cb=J.Disposable=function(a){this.isDisposed=!1,this.action=a||K};Cb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Db=Cb.create=function(a){return new Cb(a)},Eb=Cb.empty={dispose:K},Fb=J.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Gb=J.SerialDisposable=Fb,Hb=J.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Eb:new a(this)},b}();m.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Ib=J.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||P,this.disposable=new Fb};Ib.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Ib.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Ib.prototype.isCancelled=function(){return this.disposable.isDisposed},Ib.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Jb=J.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Eb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=N,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Kb=Jb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Ab,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Eb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Ab,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Eb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Jb.prototype),function(){Jb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Jb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof E.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=E.setInterval(function(){d=c(d)},b);return Db(function(){E.clearInterval(e)})}}(Jb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Sb(this,a)}}(Jb.prototype);var Lb,Mb=(J.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Fb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Jb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Kb(d);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Jb(N,a,b,c)}()),Nb=Jb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Jb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Jb.normalize(c),g=new Ib(this,b,d,f);if(e)e.enqueue(g);else{e=new yb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Jb(N,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Ob=K,Pb=function(){var a,b=K;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!E.setTimeout)throw new Error("No concurrency detected!");a=E.setTimeout,b=E.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Qb=Pb.setTimeout,Rb=Pb.clearTimeout;!function(){function a(){if(!E.postMessage||E.importScripts)return!1;var a=!1,b=E.onmessage;return E.onmessage=function(){a=!0},E.postMessage("","*"),E.onmessage=b,a}function b(a){if("string"==typeof a.data&&a.data.substring(0,f.length)===f){var b=a.data.substring(f.length),c=g[b];c(),delete g[b]}}var c=RegExp("^"+String(jb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),d="function"==typeof(d=I&&H&&I.setImmediate)&&!c.test(d)&&d,e="function"==typeof(e=I&&H&&I.clearImmediate)&&!c.test(e)&&e;if("function"==typeof d)Lb=d,Ob=e;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Lb=process.nextTick;else if(a()){var f="ms.rx.schedule"+Math.random(),g={},h=0;E.addEventListener?E.addEventListener("message",b,!1):E.attachEvent("onmessage",b,!1),Lb=function(a){var b=h++;g[b]=a,E.postMessage(f+b,"*")}}else if(E.MessageChannel){var i=new E.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Lb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in E&&"onreadystatechange"in E.document.createElement("script")?Lb=function(a){var b=E.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},E.document.documentElement.appendChild(b)}:(Lb=function(a){return Qb(a,0)},Ob=Rb)}();var Sb=(Jb.timeout=function(){function a(a,b){var c=this,d=new Fb,e=Lb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Ab(d,Db(function(){Ob(e)}))}function b(a,b,c){var d=this,e=Jb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Fb,g=Qb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Ab(f,Db(function(){Rb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Jb(N,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return vb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Eb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Fb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Jb)),Tb=J.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return L(a)||(a=Mb),new wc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ub=Tb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Tb("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Vb=Tb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Tb("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Wb=Tb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Tb("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Xb=J.internals.Enumerator=function(a){this._next=a};Xb.prototype.next=function(){return this._next()},Xb.prototype[V]=function(){return this};var Yb=J.internals.Enumerable=function(a){this._iterator=a};Yb.prototype[V]=function(){return this._iterator()},Yb.prototype.concat=function(){var a=this;return new wc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f=new Gb,g=Mb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;R(h)&&(h=ic(h));var i=new Fb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Ab(f,g,Db(function(){e=!0}))})},Yb.prototype.catchError=function(){var a=this;return new wc(function(b){var c;try{c=a[V]()}catch(d){return void b.onError()}var e,f,g=new Gb,h=Mb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;R(i)&&(i=ic(i));var j=new Fb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Ab(g,h,Db(function(){e=!0}))})};var Zb=Yb.repeat=function(a,b){return null==b&&(b=-1),new Yb(function(){var c=b;return new Xb(function(){return 0===c?W:(c>0&&c--,{done:!1,value:a})})})},$b=Yb.of=function(a,b,c){return b||(b=M),new Yb(function(){var d=-1;return new Xb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:W})})},_b=J.Observer=function(){};_b.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},_b.prototype.asObserver=function(){return new dc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},_b.prototype.checked=function(){return new ec(this)};var ac=_b.create=function(a,b,c){return a||(a=K),b||(b=Q),c||(c=K),new dc(a,b,c)};_b.fromNotifier=function(a,b){return new dc(function(c){return a.call(b,Ub(c))},function(c){return a.call(b,Vb(c))},function(){return a.call(b,Wb())})},_b.notifyOn=function(a){return new gc(a,this)};var bc,cc=J.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return vb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(_b),dc=J.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return vb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(cc),ec=function(a){function b(b){a.call(this),this._observer=b,this._state=0}vb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(_b),fc=J.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Gb}return vb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(cc),gc=function(a){function b(){a.apply(this,arguments)}return vb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b}(fc),hc=J.Observable=function(){function a(a){this._subscribe=a}return bc=a.prototype,bc.subscribe=bc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:ac(a,b,c))},bc.subscribeOnNext=function(a,b){return this._subscribe(ac(2===arguments.length?function(c){a.call(b,c)}:a))},bc.subscribeOnError=function(a,b){return this._subscribe(ac(null,2===arguments.length?function(c){a.call(b,c)}:a))},bc.subscribeOnCompleted=function(a,b){return this._subscribe(ac(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();bc.observeOn=function(a){var b=this;return new wc(function(c){return b.subscribe(new gc(a,c))})},bc.subscribeOn=function(a){var b=this;return new wc(function(c){var d=new Fb,e=new Gb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new m(a,b.subscribe(c)))})),e})};var ic=hc.fromPromise=function(a){return jc(function(){var b=new J.AsyncSubject;return a.then(function(a){b.isDisposed||(b.onNext(a),b.onCompleted())},b.onError.bind(b)),b})};bc.toPromise=function(a){if(a||(a=J.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},bc.toArray=function(){var a=this;return new wc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},hc.create=hc.createWithDisposable=function(a){return new wc(a)};var jc=hc.defer=function(a){return new wc(function(b){var c;try{c=a()}catch(d){return qc(d).subscribe(b)}return R(c)&&(c=ic(c)),c.subscribe(b)})},kc=hc.empty=function(a){return L(a)||(a=Mb),new wc(function(b){return a.schedule(function(){b.onCompleted()})})},lc=Math.pow(2,53)-1;n.prototype[V]=function(){return new o(this._s)},o.prototype[V]=function(){return this},o.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return W},p.prototype[V]=function(){return new q(this._a)},q.prototype[V]=function(){return this},q.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return W};var mc=hc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!S(b))throw new Error("mapFn when provided must be a function");L(d)||(d=Nb);var e=Object(a),f=t(e);return new wc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&S(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},nc=hc.fromArray=function(a,b){return $("fromArray","from"),L(b)||(b=Nb),new wc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};hc.generate=function(a,b,c,d,e){return L(e)||(e=Nb),new wc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var oc=hc.never=function(){return new wc(function(){return Eb})};hc.of=function(){return w(null,arguments)},hc.ofWithScheduler=function(a){return w(a,ub.call(arguments,1))},hc.range=function(a,b,c){return L(c)||(c=Nb),new wc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},hc.repeat=function(a,b,c){return L(c)||(c=Nb),pc(a,c).repeat(null==b?-1:b)};var pc=hc["return"]=hc.just=function(a,b){return L(b)||(b=Mb),new wc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};hc.returnValue=function(){return $("returnValue","return or just"),pc.apply(null,arguments)};var qc=hc["throw"]=hc.throwException=hc.throwError=function(a,b){return L(b)||(b=Mb),new wc(function(c){return b.schedule(function(){c.onError(a)})})};hc.using=function(a,b){return new wc(function(c){var d,e,f=Eb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Ab(qc(g).subscribe(c),f)}return new Ab(e.subscribe(c),f)})},bc.amb=function(a){var b=this;return new wc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Fb,j=new Fb;return R(a)&&(a=ic(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Ab(i,j)})},hc.amb=function(){function a(a,b){return a.amb(b)}for(var b=oc(),c=j(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},bc["catch"]=bc.catchError=function(a){return"function"==typeof a?x(this,a):rc([this,a])},bc.catchException=function(a){return $("catchException","catch or catchError"),this.catchError(a)};var rc=hc.catchError=hc["catch"]=function(){return $b(j(arguments,0)).catchError()};hc.catchException=function(){return $("catchException","catch or catchError"),rc.apply(null,arguments)},bc.combineLatest=function(){var a=ub.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),sc.apply(this,a)};var sc=hc.combineLatest=function(){var a=ub.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new wc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(M))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else j.filter(function(b,c){return c!==a}).every(M)&&c.onCompleted()}function e(a){j[a]=!0,j.every(M)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=k(g,f),i=!1,j=k(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Fb;R(f)&&(f=ic(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Ab(m)})};bc.concat=function(){var a=ub.call(arguments,0);return a.unshift(this),tc.apply(this,a)};var tc=hc.concat=function(){return $b(j(arguments,0)).concat()};bc.concatAll=function(){return this.merge(1)},bc.concatObservable=function(){return $("concatObservable","concatAll"),this.merge(1)},bc.merge=function(a){if("number"!=typeof a)return uc(this,a);var b=this;return new wc(function(c){function d(a){var b=new Fb;f.add(b),R(a)&&(a=ic(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Ab,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var uc=hc.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=ub.call(arguments,1)):(a=Mb,b=ub.call(arguments,0)):(a=Mb,b=ub.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),w(a,b).mergeAll()};bc.mergeAll=function(){var a=this;return new wc(function(b){var c=new Ab,d=!1,e=new Fb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Fb;c.add(e),R(a)&&(a=ic(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},bc.mergeObservable=function(){return $("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},bc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return vc([this,a])};var vc=hc.onErrorResumeNext=function(){var a=j(arguments,0);return new wc(function(b){var c=0,d=new Gb,e=Mb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],R(f)&&(f=ic(f)),g=new Fb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Ab(d,e)})};bc.skipUntil=function(a){var b=this;return new wc(function(c){var d=!1,e=new Ab(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));R(a)&&(a=ic(a));var f=new Fb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},bc["switch"]=bc.switchLatest=function(){var a=this;return new wc(function(b){var c=!1,d=new Gb,e=!1,f=0,g=a.subscribe(function(a){var g=new Fb,h=++f;c=!0,d.setDisposable(g),R(a)&&(a=ic(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)
},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Ab(g,d)})},bc.takeUntil=function(a){var b=this;return new wc(function(c){return R(a)&&(a=ic(a)),new Ab(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),K))})},bc.zip=function(){if(Array.isArray(arguments[0]))return y.apply(this,arguments);var a=this,b=ub.call(arguments),c=b.pop();return b.unshift(a),new wc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(M)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=k(g,function(){return[]}),i=k(g,function(){return!1}),j=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Fb;R(c)&&(c=ic(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),j[a]=g}(l);return new Ab(j)})},hc.zip=function(){var a=ub.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},hc.zipArray=function(){var a=j(arguments,0);return new wc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(M))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(M)?void b.onCompleted():void 0}for(var e=a.length,f=k(e,function(){return[]}),g=k(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Fb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var j=new Ab(h);return j.add(Db(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),j})},bc.asObservable=function(){return new wc(this.subscribe.bind(this))},bc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},bc.dematerialize=function(){var a=this;return new wc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},bc.distinctUntilChanged=function(a,b){var c=this;return a||(a=M),b||(b=O),new wc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},bc["do"]=bc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new wc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},bc.doAction=function(){return $("doAction","do or tap"),this.tap.apply(this,arguments)},bc.doOnNext=bc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},bc.doOnError=bc.tapOnError=function(a,b){return this.tap(K,2===arguments.length?function(c){a.call(b,c)}:a)},bc.doOnCompleted=bc.tapOnCompleted=function(a,b){return this.tap(K,null,2===arguments.length?function(){a.call(b)}:a)},bc["finally"]=bc.ensure=function(a){var b=this;return new wc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Db(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},bc.finallyAction=function(a){return $("finallyAction","finally or ensure"),this.ensure(a)},bc.ignoreElements=function(){var a=this;return new wc(function(b){return a.subscribe(K,b.onError.bind(b),b.onCompleted.bind(b))})},bc.materialize=function(){var a=this;return new wc(function(b){return a.subscribe(function(a){b.onNext(Ub(a))},function(a){b.onNext(Vb(a)),b.onCompleted()},function(){b.onNext(Wb()),b.onCompleted()})})},bc.repeat=function(a){return Zb(this,a).concat()},bc.retry=function(a){return Zb(this,a).catchError()},bc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new wc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},bc.skipLast=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},bc.startWith=function(){var a,b,c=0;return arguments.length&&L(arguments[0])?(b=arguments[0],c=1):b=Mb,a=ub.call(arguments,c),$b([nc(a,b),this]).concat()},bc.takeLast=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},bc.takeLastBuffer=function(a){var b=this;return new wc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},bc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(T);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(T);return new wc(function(d){function e(){var a=new zc;i.push(a),d.onNext(xb(a,g))}var f=new Fb,g=new Hb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},bc.selectConcat=bc.concatMap=function(a,b,c){return S(a)&&S(b)?this.concatMap(function(c,d){var e=a(c,d);return R(e)&&(e=ic(e)),(Y(e)||X(e))&&(e=mc(e)),e.map(function(a,e){return b(c,a,d,e)})}):S(a)?z(this,a,c):z(this,function(){return a})},bc.concatMapObserver=bc.selectConcatObserver=function(a,b,c,d){var e=this;return new wc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=ic(a)),f.onNext(a),f.onCompleted()})}).concatAll()},bc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new wc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},B.prototype.push=function(a){var b=-1===A(this.set,a,this.comparer);return b&&this.set.push(a),b},bc.distinct=function(a,b){var c=this;return b||(b=O),new wc(function(d){var e=new B(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.select=bc.map=function(a,b){var c=S(a)?a:function(){return a},d=this;return new wc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},bc.pluck=function(a){return this.map(function(b){return b[a]})},bc.flatMapObserver=bc.selectManyObserver=function(a,b,c,d){var e=this;return new wc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}R(c)&&(c=ic(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}R(a)&&(a=ic(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},bc.selectMany=bc.flatMap=function(a,b,c){return S(a)&&S(b)?this.flatMap(function(c,d){var e=a(c,d);return R(e)&&(e=ic(e)),(Y(e)||X(e))&&(e=mc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):S(a)?C(this,a,c):C(this,function(){return a})},bc.selectSwitch=bc.flatMapLatest=bc.switchMap=function(a,b){return this.select(a,b).switchLatest()},bc.skip=function(a){if(0>a)throw new Error(T);var b=this;return new wc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},bc.skipWhile=function(a,b){var c=this;return new wc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.take=function(a,b){if(0>a)throw new RangeError(T);if(0===a)return kc(b);var c=this;return new wc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},bc.takeWhile=function(a,b){var c=this;return new wc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},bc.where=bc.filter=function(a,b){var c=this;return new wc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},bc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new wc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var wc=J.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Db(a):Eb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new xc(a);return Nb.scheduleRequired()?Nb.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return vb(c,a),c}(hc),xc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Fb}vb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{b||this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.disposable=function(a){return arguments.length?this.getDisposable():setDisposable(a)},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(cc),yc=function(a,b){this.subject=a,this.observer=b};yc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var zc=J.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Eb):(a.onCompleted(),Eb):(this.observers.push(a),new yc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return vb(d,a),wb(d.prototype,_b,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Ac(a,b)},d}(hc),Ac=(J.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new yc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Eb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return vb(d,a),wb(d.prototype,_b,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(hc),J.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return vb(b,a),wb(b.prototype,_b,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(hc));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(E.Rx=J,define(function(){return J})):F&&G?H?(G.exports=J).Rx=J:F.Rx=J:E.Rx=J}).call(this);
(function(a){function b(){if(this.isDisposed)throw new Error(T)}function c(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1}function d(a){var b=[];if(!c(a))return b;sb.nonEnumArgs&&a.length&&tb(a)&&(a=vb.call(a));var d=sb.enumPrototypes&&"function"==typeof a,e=sb.enumErrorProps&&(a===lb||a instanceof Error);for(var f in a)d&&"prototype"==f||e&&("message"==f||"name"==f)||b.push(f);if(sb.nonEnumShadows&&a!==mb){var g=a.constructor,h=-1,i=qb.length;if(a===(g&&g.prototype))var j=a===nb?hb:a===lb?cb:ib.call(a),k=rb[j];for(;++h<i;)f=qb[h],k&&k[f]||!jb.call(a,f)||b.push(f)}return b}function e(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function f(a,b){return e(a,b,d)}function g(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function h(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,i=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=i&&"object"!=i))return!1;var j=ib.call(a),k=ib.call(b);if(j==$&&(j=fb),k==$&&(k=fb),j!=k)return!1;switch(j){case ab:case bb:return+a==+b;case eb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case gb:case hb:return a==String(b)}var l=j==_;if(!l){if(j!=fb||!sb.nodeClass&&(g(a)||g(b)))return!1;var m=!sb.argsObject&&tb(a)?Object:a.constructor,n=!sb.argsObject&&tb(b)?Object:b.constructor;if(!(m==n||jb.call(a,"constructor")&&jb.call(b,"constructor")||R(m)&&m instanceof m&&R(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=h(a[p],r,c,d)))break}}else f(b,function(b,e,f){return jb.call(f,e)?(p++,q=jb.call(a,e)&&h(a[e],b,c,d)):void 0}),q&&f(a,function(a,b,c){return jb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function i(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:vb.call(a)}function j(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function k(a,b){this.id=a,this.value=b}function l(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function m(){this._s=s}function n(){this._s=s,this._l=s.length,this._i=0}function o(a){this._a=a}function p(a){this._a=a,this._l=u(a),this._i=0}function q(a){return"number"==typeof a&&D.isFinite(a)}function r(b){var c,d=b[U];if(!d&&"string"==typeof b)return c=new m(b),c[U]();if(!d&&b.length!==a)return c=new o(b),c[U]();if(!d)throw new TypeError("Object is not iterable");return b[U]()}function t(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function u(a){var b=+a.length;return isNaN(b)?0:0!==b&&q(b)?(b=t(b)*Math.floor(Math.abs(b)),0>=b?0:b>mc?mc:b):b}function v(a,b){return K(a)||(a=Ob),new xc(function(c){var d=0,e=b.length;return a.scheduleRecursive(function(a){e>d?(c.onNext(b[d++]),a()):c.onCompleted()})})}function w(a,b){return new xc(function(c){var d=new Gb,e=new Hb;return e.setDisposable(d),d.setDisposable(a.subscribe(c.onNext.bind(c),function(a){var d,f;try{f=b(a)}catch(g){return void c.onError(g)}Q(f)&&(f=jc(f)),d=new Gb,e.setDisposable(d),d.setDisposable(f.subscribe(c))},c.onCompleted.bind(c))),e})}function x(a,b){var c=this;return new xc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return void d.onError(i)}d.onNext(g)}else d.onCompleted()},d.onError.bind(d),d.onCompleted.bind(d))})}function y(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=jc(f)),(X(f)||W(f))&&(f=nc(f)),f}).concatAll()}function z(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function A(a){this.comparer=a,this.set=[]}function B(a,b,c){return a.map(function(d,e){var f=b.call(c,d,e,a);return Q(f)&&(f=jc(f)),(X(f)||W(f))&&(f=nc(f)),f}).mergeAll()}var C={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},D=C[typeof window]&&window||this,E=C[typeof exports]&&exports&&!exports.nodeType&&exports,F=C[typeof module]&&module&&!module.nodeType&&module,G=F&&F.exports===E&&E,H=C[typeof global]&&global;!H||H.global!==H&&H.window!==H||(D=H);var I={internals:{},config:{Promise:D.Promise},helpers:{}},J=I.helpers.noop=function(){},K=(I.helpers.notDefined=function(a){return"undefined"==typeof a},I.helpers.isScheduler=function(a){return a instanceof I.Scheduler}),L=I.helpers.identity=function(a){return a},M=(I.helpers.pluck=function(a){return function(b){return b[a]}},I.helpers.just=function(a){return function(){return a}},I.helpers.defaultNow=Date.now),N=I.helpers.defaultComparer=function(a,b){return ub(a,b)},O=I.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},P=(I.helpers.defaultKeySerializer=function(a){return a.toString()},I.helpers.defaultError=function(a){throw a}),Q=I.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},R=(I.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},I.helpers.not=function(a){return!a},I.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==ib.call(a)}),a}()),S="Argument out of range",T="Object has been disposed",U="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";D.Set&&"function"==typeof(new D.Set)["@@iterator"]&&(U="@@iterator");var V=I.doneEnumerator={done:!0,value:a},W=I.helpers.isIterable=function(b){return b[U]!==a},X=I.helpers.isArrayLike=function(b){return b&&b.length!==a};I.helpers.iterator=U;var Y,Z=I.helpers.deprecate=function(){},$="[object Arguments]",_="[object Array]",ab="[object Boolean]",bb="[object Date]",cb="[object Error]",db="[object Function]",eb="[object Number]",fb="[object Object]",gb="[object RegExp]",hb="[object String]",ib=Object.prototype.toString,jb=Object.prototype.hasOwnProperty,kb=ib.call(arguments)==$,lb=Error.prototype,mb=Object.prototype,nb=String.prototype,ob=mb.propertyIsEnumerable;try{Y=!(ib.call(document)==fb&&!({toString:0}+""))}catch(pb){Y=!0}var qb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rb={};rb[_]=rb[bb]=rb[eb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},rb[ab]=rb[hb]={constructor:!0,toString:!0,valueOf:!0},rb[cb]=rb[db]=rb[gb]={constructor:!0,toString:!0},rb[fb]={constructor:!0};var sb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);sb.enumErrorProps=ob.call(lb,"message")||ob.call(lb,"name"),sb.enumPrototypes=ob.call(a,"prototype"),sb.nonEnumArgs=0!=c,sb.nonEnumShadows=!/valueOf/.test(b)}(1);var tb=function(a){return a&&"object"==typeof a?ib.call(a)==$:!1};kb||(tb=function(a){return a&&"object"==typeof a?jb.call(a,"callee"):!1});var ub=I.internals.isEqual=function(a,b){return h(a,b,[],[])},vb=Array.prototype.slice,wb=({}.hasOwnProperty,this.inherits=I.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),xb=I.internals.addProperties=function(a){for(var b=vb.call(arguments,1),c=0,d=b.length;d>c;c++){var e=b[c];for(var f in e)a[f]=e[f]}},yb=I.internals.addRef=function(a,b){return new xc(function(c){return new Bb(b.getDisposable(),a.subscribe(c))})};k.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var zb=I.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Ab=zb.prototype;Ab.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Ab.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Ab.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Ab.peek=function(){return this.items[0].value},Ab.removeAt=function(a){this.items[a]=this.items[--this.length],delete this.items[this.length],this.heapify()},Ab.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Ab.enqueue=function(a){var b=this.length++;this.items[b]=new k(zb.count++,a),this.percolate(b)},Ab.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},zb.count=0;var Bb=I.CompositeDisposable=function(){this.disposables=i(arguments,0),this.isDisposed=!1,this.length=this.disposables.length},Cb=Bb.prototype;Cb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Cb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Cb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.disposables.slice(0);this.disposables=[],this.length=0;for(var b=0,c=a.length;c>b;b++)a[b].dispose()}},Cb.toArray=function(){return this.disposables.slice(0)};var Db=I.Disposable=function(a){this.isDisposed=!1,this.action=a||J};Db.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Eb=Db.create=function(a){return new Db(a)},Fb=Db.empty={dispose:J},Gb=I.SingleAssignmentDisposable=function(){function a(){this.isDisposed=!1,this.current=null}var b=a.prototype;return b.getDisposable=function(){return this.current},b.setDisposable=function(a){var b,c=this.isDisposed;c||(b=this.current,this.current=a),b&&b.dispose(),c&&a&&a.dispose()},b.dispose=function(){var a;this.isDisposed||(this.isDisposed=!0,a=this.current,this.current=null),a&&a.dispose()},a}(),Hb=I.SerialDisposable=Gb,Ib=I.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Fb:new a(this)},b}();l.prototype.dispose=function(){var a=this;this.scheduler.schedule(function(){a.isDisposed||(a.isDisposed=!0,a.disposable.dispose())})};var Jb=I.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||O,this.disposable=new Gb};Jb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Jb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Jb.prototype.isCancelled=function(){return this.disposable.isDisposed},Jb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Kb=I.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Fb}var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=M,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Lb=Kb.normalize;!function(a){function b(a,b){var c=b.first,d=b.second,e=new Bb,f=function(b){d(b,function(b){var c=!1,d=!1,g=a.scheduleWithState(b,function(a,b){return c?e.remove(g):d=!0,f(b),Fb});d||(e.add(g),c=!0)})};return f(c),e}function c(a,b,c){var d=b.first,e=b.second,f=new Bb,g=function(b){e(b,function(b,d){var e=!1,h=!1,i=a[c].call(a,b,d,function(a,b){return e?f.remove(i):h=!0,g(b),Fb});h||(f.add(i),e=!0)})};return g(d),f}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,function(a,b){a(function(){b(a)})})},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState({first:a,second:c},b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute({first:a,second:d},b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Kb.prototype),function(){Kb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Kb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof D.setInterval)throw new Error("Periodic scheduling not supported.");var d=a,e=D.setInterval(function(){d=c(d)},b);return Eb(function(){D.clearInterval(e)})}}(Kb.prototype),function(a){a.catchError=a["catch"]=function(a){return new Tb(this,a)}}(Kb.prototype);var Mb,Nb=(I.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Gb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Kb.immediate=function(){function a(a,b){return b(this,a)}function b(a,b,c){for(var d=Lb(b);d-this.now()>0;);return c(this,a)}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Kb(M,a,b,c)}()),Ob=Kb.currentThread=function(){function a(a){for(var b;a.length>0;)if(b=a.dequeue(),!b.isCancelled()){for(;b.dueTime-Kb.now()>0;);b.isCancelled()||b.invoke()}}function b(a,b){return this.scheduleWithRelativeAndState(a,0,b)}function c(b,c,d){var f=this.now()+Kb.normalize(c),g=new Jb(this,b,d,f);if(e)e.enqueue(g);else{e=new zb(4),e.enqueue(g);try{a(e)}catch(h){throw h}finally{e=null}}return g.disposable}function d(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}var e,f=new Kb(M,b,c,d);return f.scheduleRequired=function(){return!e},f.ensureTrampoline=function(a){e?a():this.schedule(a)},f}(),Pb=J,Qb=function(){var a,b=J;if("WScript"in this)a=function(a,b){WScript.Sleep(b),a()};else{if(!D.setTimeout)throw new Error("No concurrency detected!");a=D.setTimeout,b=D.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),Rb=Qb.setTimeout,Sb=Qb.clearTimeout;!function(){function a(){if(!D.postMessage||D.importScripts)return!1;var a=!1,b=D.onmessage;return D.onmessage=function(){a=!0},D.postMessage("","*"),D.onmessage=b,a}var b=RegExp("^"+String(ib).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),c="function"==typeof(c=H&&G&&H.setImmediate)&&!b.test(c)&&c,d="function"==typeof(d=H&&G&&H.clearImmediate)&&!b.test(d)&&d;if("function"==typeof c)Mb=c,Pb=d;else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Mb=process.nextTick;else if(a()){var e="ms.rx.schedule"+Math.random(),f={},g=0,h=function(a){if("string"==typeof a.data&&a.data.substring(0,e.length)===e){var b=a.data.substring(e.length),c=f[b];c(),delete f[b]}};D.addEventListener?D.addEventListener("message",h,!1):D.attachEvent("onmessage",h,!1),Mb=function(a){var b=g++;f[b]=a,D.postMessage(e+b,"*")}}else if(D.MessageChannel){var i=new D.MessageChannel,j={},k=0;i.port1.onmessage=function(a){var b=a.data,c=j[b];c(),delete j[b]},Mb=function(a){var b=k++;j[b]=a,i.port2.postMessage(b)}}else"document"in D&&"onreadystatechange"in D.document.createElement("script")?Mb=function(a){var b=D.document.createElement("script");b.onreadystatechange=function(){a(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},D.document.documentElement.appendChild(b)}:(Mb=function(a){return Rb(a,0)},Pb=Sb)}();var Tb=(Kb.timeout=function(){function a(a,b){var c=this,d=new Gb,e=Mb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new Bb(d,Eb(function(){Pb(e)}))}function b(a,b,c){var d=this,e=Kb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new Gb,g=Rb(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new Bb(f,Eb(function(){Sb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Kb(M,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return wb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Fb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Gb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Kb)),Ub=I.Notification=function(){function a(a,b){this.hasValue=null==b?!1:b,this.kind=a}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return K(a)||(a=Nb),new xc(function(c){return a.schedule(function(){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Vb=Ub.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){var e=new Ub("N",!0);return e.value=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Wb=Ub.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){var e=new Ub("E");return e.exception=d,e._accept=a,e._acceptObservable=b,e.toString=c,e}}(),Xb=Ub.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){var d=new Ub("C");return d._accept=a,d._acceptObservable=b,d.toString=c,d}}(),Yb=I.internals.Enumerator=function(a){this._next=a};Yb.prototype.next=function(){return this._next()},Yb.prototype[U]=function(){return this};var Zb=I.internals.Enumerable=function(a){this._iterator=a};Zb.prototype[U]=function(){return this._iterator()},Zb.prototype.concat=function(){var a=this;return new xc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f=new Hb,g=Nb.scheduleRecursive(function(a){var d;if(!e){try{d=c.next()}catch(g){return void b.onError(g)}if(d.done)return void b.onCompleted();var h=d.value;Q(h)&&(h=jc(h));var i=new Gb;f.setDisposable(i),i.setDisposable(h.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){a()}))}});return new Bb(f,g,Eb(function(){e=!0}))})},Zb.prototype.catchError=function(){var a=this;return new xc(function(b){var c;try{c=a[U]()}catch(d){return void b.onError(d)}var e,f,g=new Hb,h=Nb.scheduleRecursive(function(a){if(!e){var d;try{d=c.next()}catch(h){return void b.onError(h)}if(d.done)return void(f?b.onError(f):b.onCompleted());var i=d.value;Q(i)&&(i=jc(i));var j=new Gb;g.setDisposable(j),j.setDisposable(i.subscribe(b.onNext.bind(b),function(b){f=b,a()},b.onCompleted.bind(b)))}});return new Bb(g,h,Eb(function(){e=!0}))})};var $b=Zb.repeat=function(a,b){return null==b&&(b=-1),new Zb(function(){var c=b;return new Yb(function(){return 0===c?V:(c>0&&c--,{done:!1,value:a})})})},_b=Zb.of=function(a,b,c){return b||(b=L),new Zb(function(){var d=-1;return new Yb(function(){return++d<a.length?{done:!1,value:b.call(c,a[d],d,a)}:V})})},ac=I.Observer=function(){};ac.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ac.prototype.asObserver=function(){return new ec(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},ac.prototype.checked=function(){return new fc(this)};var bc=ac.create=function(a,b,c){return a||(a=J),b||(b=P),c||(c=J),new ec(a,b,c)};ac.fromNotifier=function(a,b){return new ec(function(c){return a.call(b,Vb(c))},function(c){return a.call(b,Wb(c))},function(){return a.call(b,Xb())})},ac.prototype.notifyOn=function(a){return new hc(a,this)};var cc,dc=I.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return wb(b,a),b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ac),ec=I.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return wb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(dc),fc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}wb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();try{this._observer.onNext(a)}catch(b){throw b}finally{this._state=0}},c.onError=function(a){this.checkAccess();try{this._observer.onError(a)}catch(b){throw b}finally{this._state=2}},c.onCompleted=function(){this.checkAccess();try{this._observer.onCompleted()}catch(a){throw a}finally{this._state=2}},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(ac),gc=I.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Hb}return wb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(dc),hc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return wb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(gc),ic=I.Observable=function(){function a(a){this._subscribe=a}return cc=a.prototype,cc.subscribe=cc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:bc(a,b,c))},cc.subscribeOnNext=function(a,b){return this._subscribe(bc(2===arguments.length?function(c){a.call(b,c)}:a))},cc.subscribeOnError=function(a,b){return this._subscribe(bc(null,2===arguments.length?function(c){a.call(b,c)}:a))},cc.subscribeOnCompleted=function(a,b){return this._subscribe(bc(null,null,2===arguments.length?function(){a.call(b)}:a))},a}();cc.observeOn=function(a){var b=this;return new xc(function(c){return b.subscribe(new hc(a,c))})},cc.subscribeOn=function(a){var b=this;return new xc(function(c){var d=new Gb,e=new Hb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new l(a,b.subscribe(c)))})),e})};var jc=ic.fromPromise=function(a){return kc(function(){var b=new I.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};cc.toPromise=function(a){if(a||(a=I.config.Promise),!a)throw new TypeError("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},cc.toArray=function(){var a=this;return new xc(function(b){var c=[];return a.subscribe(c.push.bind(c),b.onError.bind(b),function(){b.onNext(c),b.onCompleted()})})},ic.create=ic.createWithDisposable=function(a){return new xc(a)};var kc=ic.defer=function(a){return new xc(function(b){var c;try{c=a()}catch(d){return rc(d).subscribe(b)}return Q(c)&&(c=jc(c)),c.subscribe(b)})},lc=ic.empty=function(a){return K(a)||(a=Nb),new xc(function(b){return a.schedule(function(){b.onCompleted()})})},mc=Math.pow(2,53)-1;m.prototype[U]=function(){return new n(this._s)},n.prototype[U]=function(){return this},n.prototype.next=function(){if(this._i<this._l){var a=this._s.charAt(this._i++);return{done:!1,value:a}}return V},o.prototype[U]=function(){return new p(this._a)},p.prototype[U]=function(){return this},p.prototype.next=function(){if(this._i<this._l){var a=this._a[this._i++];return{done:!1,value:a}}return V};var nc=ic.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!R(b))throw new Error("mapFn when provided must be a function");K(d)||(d=Ob);var e=Object(a),f=r(e);return new xc(function(a){var e=0;return d.scheduleRecursive(function(d){var g;try{g=f.next()}catch(h){return void a.onError(h)}if(g.done)return void a.onCompleted();var i=g.value;if(b&&R(b))try{i=b.call(c,i,e)}catch(h){return void a.onError(h)}a.onNext(i),e++,d()})})},oc=ic.fromArray=function(a,b){return Z("fromArray","from"),K(b)||(b=Ob),new xc(function(c){var d=0,e=a.length;return b.scheduleRecursive(function(b){e>d?(c.onNext(a[d++]),b()):c.onCompleted()})})};ic.generate=function(a,b,c,d,e){return K(e)||(e=Ob),new xc(function(f){var g=!0,h=a;return e.scheduleRecursive(function(a){var e,i;try{g?g=!1:h=c(h),e=b(h),e&&(i=d(h))}catch(j){return void f.onError(j)}e?(f.onNext(i),a()):f.onCompleted()})})};var pc=ic.never=function(){return new xc(function(){return Fb})};ic.of=function(){return v(null,arguments)},ic.ofWithScheduler=function(a){return v(a,vb.call(arguments,1))},ic.range=function(a,b,c){return K(c)||(c=Ob),new xc(function(d){return c.scheduleRecursiveWithState(0,function(c,e){b>c?(d.onNext(a+c),e(c+1)):d.onCompleted()})})},ic.repeat=function(a,b,c){return K(c)||(c=Ob),qc(a,c).repeat(null==b?-1:b)};var qc=ic["return"]=ic.just=function(a,b){return K(b)||(b=Nb),new xc(function(c){return b.schedule(function(){c.onNext(a),c.onCompleted()})})};ic.returnValue=function(){return Z("returnValue","return or just"),qc.apply(null,arguments)};var rc=ic["throw"]=ic.throwException=ic.throwError=function(a,b){return K(b)||(b=Nb),new xc(function(c){return b.schedule(function(){c.onError(a)})})};ic.using=function(a,b){return new xc(function(c){var d,e,f=Fb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Bb(rc(g).subscribe(c),f)}return new Bb(e.subscribe(c),f)})},cc.amb=function(a){var b=this;return new xc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Gb,j=new Gb;return Q(a)&&(a=jc(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Bb(i,j)})},ic.amb=function(){function a(a,b){return a.amb(b)}for(var b=pc(),c=i(arguments,0),d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},cc["catch"]=cc.catchError=function(a){return"function"==typeof a?w(this,a):sc([this,a])},cc.catchException=function(a){return Z("catchException","catch or catchError"),this.catchError(a)};var sc=ic.catchError=ic["catch"]=function(){return _b(i(arguments,0)).catchError()};ic.catchException=function(){return Z("catchException","catch or catchError"),sc.apply(null,arguments)},cc.combineLatest=function(){var a=vb.call(arguments);return Array.isArray(a[0])?a[0].unshift(this):a.unshift(this),tc.apply(this,a)};var tc=ic.combineLatest=function(){var a=vb.call(arguments),b=a.pop();return Array.isArray(a[0])&&(a=a[0]),new xc(function(c){function d(a){var d;if(h[a]=!0,i||(i=h.every(L))){try{d=b.apply(null,l)}catch(e){return void c.onError(e)}c.onNext(d)}else k.filter(function(b,c){return c!==a}).every(L)&&c.onCompleted()}function e(a){k[a]=!0,k.every(L)&&c.onCompleted()}for(var f=function(){return!1},g=a.length,h=j(g,f),i=!1,k=j(g,f),l=new Array(g),m=new Array(g),n=0;g>n;n++)!function(b){var f=a[b],g=new Gb;Q(f)&&(f=jc(f)),g.setDisposable(f.subscribe(function(a){l[b]=a,d(b)},c.onError.bind(c),function(){e(b)})),m[b]=g}(n);return new Bb(m)})};cc.concat=function(){var a=vb.call(arguments,0);return a.unshift(this),uc.apply(this,a)};var uc=ic.concat=function(){return _b(i(arguments,0)).concat()};cc.concatAll=function(){return this.merge(1)},cc.concatObservable=function(){return Z("concatObservable","concatAll"),this.merge(1)},cc.merge=function(a){if("number"!=typeof a)return vc(this,a);var b=this;return new xc(function(c){function d(a){var b=new Gb;f.add(b),Q(a)&&(a=jc(a)),b.setDisposable(a.subscribe(c.onNext.bind(c),c.onError.bind(c),function(){f.remove(b),h.length>0?d(h.shift()):(e--,g&&0===e&&c.onCompleted())}))}var e=0,f=new Bb,g=!1,h=[];return f.add(b.subscribe(function(b){a>e?(e++,d(b)):h.push(b)},c.onError.bind(c),function(){g=!0,0===e&&c.onCompleted()})),f})};var vc=ic.merge=function(){var a,b;return arguments[0]?arguments[0].now?(a=arguments[0],b=vb.call(arguments,1)):(a=Nb,b=vb.call(arguments,0)):(a=Nb,b=vb.call(arguments,1)),Array.isArray(b[0])&&(b=b[0]),v(a,b).mergeAll()};cc.mergeAll=function(){var a=this;return new xc(function(b){var c=new Bb,d=!1,e=new Gb;return c.add(e),e.setDisposable(a.subscribe(function(a){var e=new Gb;c.add(e),Q(a)&&(a=jc(a)),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){c.remove(e),d&&1===c.length&&b.onCompleted()}))},b.onError.bind(b),function(){d=!0,1===c.length&&b.onCompleted()})),c})},cc.mergeObservable=function(){return Z("mergeObservable","mergeAll"),this.mergeAll.apply(this,arguments)},cc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return wc([this,a])};var wc=ic.onErrorResumeNext=function(){var a=i(arguments,0);return new xc(function(b){var c=0,d=new Hb,e=Nb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Q(f)&&(f=jc(f)),g=new Gb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Bb(d,e)})};cc.skipUntil=function(a){var b=this;return new xc(function(c){var d=!1,e=new Bb(b.subscribe(function(a){d&&c.onNext(a)},c.onError.bind(c),function(){d&&c.onCompleted()}));Q(a)&&(a=jc(a));var f=new Gb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},c.onError.bind(c),function(){f.dispose()})),e})},cc["switch"]=cc.switchLatest=function(){var a=this;return new xc(function(b){var c=!1,d=new Hb,e=!1,f=0,g=a.subscribe(function(a){var g=new Gb,h=++f;
c=!0,d.setDisposable(g),Q(a)&&(a=jc(a)),g.setDisposable(a.subscribe(function(a){f===h&&b.onNext(a)},function(a){f===h&&b.onError(a)},function(){f===h&&(c=!1,e&&b.onCompleted())}))},b.onError.bind(b),function(){e=!0,!c&&b.onCompleted()});return new Bb(g,d)})},cc.takeUntil=function(a){var b=this;return new xc(function(c){return Q(a)&&(a=jc(a)),new Bb(b.subscribe(c),a.subscribe(c.onCompleted.bind(c),c.onError.bind(c),J))})},cc.zip=function(){if(Array.isArray(arguments[0]))return x.apply(this,arguments);var a=this,b=vb.call(arguments),c=b.pop();return b.unshift(a),new xc(function(d){function e(b){var e,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),e=c.apply(a,f)}catch(g){return void d.onError(g)}d.onNext(e)}else i.filter(function(a,c){return c!==b}).every(L)&&d.onCompleted()}function f(a){i[a]=!0,i.every(function(a){return a})&&d.onCompleted()}for(var g=b.length,h=j(g,function(){return[]}),i=j(g,function(){return!1}),k=new Array(g),l=0;g>l;l++)!function(a){var c=b[a],g=new Gb;Q(c)&&(c=jc(c)),g.setDisposable(c.subscribe(function(b){h[a].push(b),e(a)},d.onError.bind(d),function(){f(a)})),k[a]=g}(l);return new Bb(k)})},ic.zip=function(){var a=vb.call(arguments,0),b=a.shift();return b.zip.apply(b,a)},ic.zipArray=function(){var a=i(arguments,0);return new xc(function(b){function c(a){if(f.every(function(a){return a.length>0})){var c=f.map(function(a){return a.shift()});b.onNext(c)}else if(g.filter(function(b,c){return c!==a}).every(L))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(L)?void b.onCompleted():void 0}for(var e=a.length,f=j(e,function(){return[]}),g=j(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new Gb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},b.onError.bind(b),function(){d(e)}))}(i);var k=new Bb(h);return k.add(Eb(function(){for(var a=0,b=f.length;b>a;a++)f[a]=[]})),k})},cc.asObservable=function(){return new xc(this.subscribe.bind(this))},cc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},cc.dematerialize=function(){var a=this;return new xc(function(b){return a.subscribe(function(a){return a.accept(b)},b.onError.bind(b),b.onCompleted.bind(b))})},cc.distinctUntilChanged=function(a,b){var c=this;return a||(a=L),b||(b=N),new xc(function(d){var e,f=!1;return c.subscribe(function(c){var g,h=!1;try{g=a(c)}catch(i){return void d.onError(i)}if(f)try{h=b(e,g)}catch(i){return void d.onError(i)}f&&h||(f=!0,e=g,d.onNext(c))},d.onError.bind(d),d.onCompleted.bind(d))})},cc["do"]=cc.tap=function(a,b,c){var d,e=this;return"function"==typeof a?d=a:(d=a.onNext.bind(a),b=a.onError.bind(a),c=a.onCompleted.bind(a)),new xc(function(a){return e.subscribe(function(b){try{d(b)}catch(c){a.onError(c)}a.onNext(b)},function(c){if(b)try{b(c)}catch(d){a.onError(d)}a.onError(c)},function(){if(c)try{c()}catch(b){a.onError(b)}a.onCompleted()})})},cc.doAction=function(){return Z("doAction","do or tap"),this.tap.apply(this,arguments)},cc.doOnNext=cc.tapOnNext=function(a,b){return this.tap(2===arguments.length?function(c){a.call(b,c)}:a)},cc.doOnError=cc.tapOnError=function(a,b){return this.tap(J,2===arguments.length?function(c){a.call(b,c)}:a)},cc.doOnCompleted=cc.tapOnCompleted=function(a,b){return this.tap(J,null,2===arguments.length?function(){a.call(b)}:a)},cc["finally"]=cc.ensure=function(a){var b=this;return new xc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Eb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})})},cc.finallyAction=function(a){return Z("finallyAction","finally or ensure"),this.ensure(a)},cc.ignoreElements=function(){var a=this;return new xc(function(b){return a.subscribe(J,b.onError.bind(b),b.onCompleted.bind(b))})},cc.materialize=function(){var a=this;return new xc(function(b){return a.subscribe(function(a){b.onNext(Vb(a))},function(a){b.onNext(Wb(a)),b.onCompleted()},function(){b.onNext(Xb()),b.onCompleted()})})},cc.repeat=function(a){return $b(this,a).concat()},cc.retry=function(a){return $b(this,a).catchError()},cc.scan=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new xc(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=b(g,d):(g=c?b(a,d):d,f=!0)}catch(i){return void e.onError(i)}e.onNext(g)},e.onError.bind(e),function(){!h&&c&&e.onNext(a),e.onCompleted()})})},cc.skipLast=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},c.onError.bind(c),c.onCompleted.bind(c))})},cc.startWith=function(){var a,b,c=0;return arguments.length&&K(arguments[0])?(b=arguments[0],c=1):b=Nb,a=vb.call(arguments,c),_b([oc(a,b),this]).concat()},cc.takeLast=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})})},cc.takeLastBuffer=function(a){var b=this;return new xc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})},cc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),1/0===Math.abs(a)&&(a=0),0>=a)throw new Error(S);if(null==b&&(b=a),+b||(b=0),1/0===Math.abs(b)&&(b=0),0>=b)throw new Error(S);return new xc(function(d){function e(){var a=new Ac;i.push(a),d.onNext(yb(a,g))}var f=new Gb,g=new Ib(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g})},cc.selectConcat=cc.concatMap=function(a,b,c){return R(a)&&R(b)?this.concatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=jc(e)),(X(e)||W(e))&&(e=nc(e)),e.map(function(a,e){return b(c,a,d,e)})}):R(a)?y(this,a,c):y(this,function(){return a})},cc.concatMapObserver=cc.selectConcatObserver=function(a,b,c,d){var e=this;return new xc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=jc(a)),f.onNext(a),f.onCompleted()})}).concatAll()},cc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new xc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},a.onError.bind(a),function(){d||a.onNext(b),a.onCompleted()})})},A.prototype.push=function(a){var b=-1===z(this.set,a,this.comparer);return b&&this.set.push(a),b},cc.distinct=function(a,b){var c=this;return b||(b=N),new xc(function(d){var e=new A(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.select=cc.map=function(a,b){var c=R(a)?a:function(){return a},d=this;return new xc(function(a){var e=0;return d.subscribe(function(f){var g;try{g=c.call(b,f,e++,d)}catch(h){return void a.onError(h)}a.onNext(g)},a.onError.bind(a),a.onCompleted.bind(a))})},cc.pluck=function(a){return this.map(function(b){return b[a]})},cc.flatMapObserver=cc.selectManyObserver=function(a,b,c,d){var e=this;return new xc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Q(c)&&(c=jc(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Q(a)&&(a=jc(a)),f.onNext(a),f.onCompleted()})}).mergeAll()},cc.selectMany=cc.flatMap=function(a,b,c){return R(a)&&R(b)?this.flatMap(function(c,d){var e=a(c,d);return Q(e)&&(e=jc(e)),(X(e)||W(e))&&(e=nc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):R(a)?B(this,a,c):B(this,function(){return a})},cc.selectSwitch=cc.flatMapLatest=cc.switchMap=function(a,b){return this.select(a,b).switchLatest()},cc.skip=function(a){if(0>a)throw new Error(S);var b=this;return new xc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},c.onError.bind(c),c.onCompleted.bind(c))})},cc.skipWhile=function(a,b){var c=this;return new xc(function(d){var e=0,f=!1;return c.subscribe(function(g){if(!f)try{f=!a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f&&d.onNext(g)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.take=function(a,b){if(0>a)throw new RangeError(S);if(0===a)return lc(b);var c=this;return new xc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},b.onError.bind(b),b.onCompleted.bind(b))})},cc.takeWhile=function(a,b){var c=this;return new xc(function(d){var e=0,f=!0;return c.subscribe(function(g){if(f){try{f=a.call(b,g,e++,c)}catch(h){return void d.onError(h)}f?d.onNext(g):d.onCompleted()}},d.onError.bind(d),d.onCompleted.bind(d))})},cc.where=cc.filter=function(a,b){var c=this;return new xc(function(d){var e=0;return c.subscribe(function(f){var g;try{g=a.call(b,f,e++,c)}catch(h){return void d.onError(h)}g&&d.onNext(f)},d.onError.bind(d),d.onCompleted.bind(d))})},cc.transduce=function(a){function b(a){return{init:function(){return a},step:function(a,b){return a.onNext(b)},result:function(a){return a.onCompleted()}}}var c=this;return new xc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e.step(d,a)}catch(b){d.onError(b)}},d.onError.bind(d),function(){e.result(d)})})};var xc=I.AnonymousObservable=function(a){function b(a){return a&&"function"==typeof a.dispose?a:"function"==typeof a?Eb(a):Fb}function c(d){function e(a){var c=function(){try{e.setDisposable(b(d(e)))}catch(a){if(!e.fail(a))throw a}},e=new yc(a);return Ob.scheduleRequired()?Ob.schedule(c):c(),e}return this instanceof c?void a.call(this,e):new c(d)}return wb(c,a),c}(ic),yc=function(a){function b(b){a.call(this),this.observer=b,this.m=new Gb}wb(b,a);var c=b.prototype;return c.next=function(a){var b=!1;try{this.observer.onNext(a),b=!0}catch(c){throw c}finally{!b&&this.dispose()}},c.error=function(a){try{this.observer.onError(a)}catch(b){throw b}finally{this.dispose()}},c.completed=function(){try{this.observer.onCompleted()}catch(a){throw a}finally{this.dispose()}},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(dc),zc=function(a,b){this.subject=a,this.observer=b};zc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Ac=I.Subject=function(a){function c(a){return b.call(this),this.isStopped?this.exception?(a.onError(this.exception),Fb):(a.onCompleted(),Fb):(this.observers.push(a),new zc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[]}return wb(d,a),xb(d.prototype,ac,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(b.call(this),!this.isStopped){var a=this.observers.slice(0);this.isStopped=!0;for(var c=0,d=a.length;d>c;c++)a[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){if(b.call(this),!this.isStopped)for(var c=this.observers.slice(0),d=0,e=c.length;e>d;d++)c[d].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Bc(a,b)},d}(ic),Bc=(I.AsyncSubject=function(a){function c(a){if(b.call(this),!this.isStopped)return this.observers.push(a),new zc(this,a);var c=this.exception,d=this.hasValue,e=this.value;return c?a.onError(c):d?(a.onNext(e),a.onCompleted()):a.onCompleted(),Fb}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.value=null,this.hasValue=!1,this.observers=[],this.exception=null}return wb(d,a),xb(d.prototype,ac,{hasObservers:function(){return b.call(this),this.observers.length>0},onCompleted:function(){var a,c,d;if(b.call(this),!this.isStopped){this.isStopped=!0;var e=this.observers.slice(0),f=this.value,g=this.hasValue;if(g)for(c=0,d=e.length;d>c;c++)a=e[c],a.onNext(f),a.onCompleted();else for(c=0,d=e.length;d>c;c++)e[c].onCompleted();this.observers=[]}},onError:function(a){if(b.call(this),!this.isStopped){var c=this.observers.slice(0);this.isStopped=!0,this.exception=a;for(var d=0,e=c.length;e>d;d++)c[d].onError(a);this.observers=[]}},onNext:function(a){b.call(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(ic),I.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this,this.observable.subscribe.bind(this.observable))}return wb(b,a),xb(b.prototype,ac,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(ic));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(D.Rx=I,define(function(){return I})):E&&F?G?(F.exports=I).Rx=I:E.Rx=I:D.Rx=I}).call(this);
//# sourceMappingURL=rx.map

@@ -241,3 +241,3 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

function MockPromise(scheduler, messages) {
var message, notification, observable = this;
var self = this;
this.scheduler = scheduler;

@@ -248,7 +248,7 @@ this.messages = messages;

for (var i = 0, len = this.messages.length; i < len; i++) {
message = this.messages[i];
notification = message.value;
var message = this.messages[i],
notification = message.value;
(function (innerNotification) {
scheduler.scheduleAbsoluteWithState(null, message.time, function () {
var obs = observable.observers.slice(0);
var obs = self.observers.slice(0);

@@ -267,7 +267,19 @@ for (var j = 0, jLen = obs.length; j < jLen; j++) {

this.subscriptions.push(new Subscription(this.scheduler.clock));
var index = this.subscriptions.length - 1;
var newPromise;
var observer = Rx.Observer.create(
function (x) {
onResolved(x);
var retValue = onResolved(x);
if (retValue && typeof retValue.then === 'function') {
newPromise = retValue;
} else {
var ticks = self.scheduler.clock;
newPromise = new MockPromise(self.scheduler, [Rx.ReactiveTest.onNext(ticks, undefined), Rx.ReactiveTest.onCompleted(ticks)]);
}
var idx = self.observers.indexOf(observer);
self.observers.splice(idx, 1);
self.subscriptions[index] = new Subscription(self.subscriptions[index].subscribe, self.scheduler.clock);
},

@@ -278,2 +290,3 @@ function (err) {

self.observers.splice(idx, 1);
self.subscriptions[index] = new Subscription(self.subscriptions[index].subscribe, self.scheduler.clock);
}

@@ -283,4 +296,4 @@ );

return new MockPromise(this.scheduler, []);
}
return newPromise || new MockPromise(this.scheduler, this.messages);
};

@@ -287,0 +300,0 @@ var HotObservable = (function (__super__) {

/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.virtualtime","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx.all")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:p.call(a)}function e(a){this.predicate=a}function f(a){this.predicate=a}function g(a,b){var c,d,e=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var f=0,g=this.messages.length;g>f;f++)c=this.messages[f],d=c.value,function(b){a.scheduleAbsoluteWithState(null,c.time,function(){for(var a=e.observers.slice(0),c=0,d=a.length;d>c;c++)b.accept(a[c]);return m})}(d)}var h=c.Observer,i=c.Observable,j=c.Notification,k=c.VirtualTimeScheduler,l=c.Disposable,m=l.empty,n=l.create,o=c.CompositeDisposable,p=(c.SingleAssignmentDisposable,Array.prototype.slice),q=c.internals.inherits,r=c.internals.isEqual;e.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},f.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.exception)};var s=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new t(a,new e(b)):new t(a,j.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new t(a,new f(b)):new t(a,j.createOnError(b))},onCompleted:function(a){return new t(a,j.createOnCompleted())},subscribe:function(a,b){return new u(a,b)}},t=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||r};t.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},t.prototype.toString=function(){return this.value.toString()+"@"+this.time};var u=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};u.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},u.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var v=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};v.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var w=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}q(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new t(this.scheduler.clock,j.createOnNext(a)))},c.onError=function(a){this.messages.push(new t(this.scheduler.clock,j.createOnError(a)))},c.onCompleted=function(){this.messages.push(new t(this.scheduler.clock,j.createOnCompleted()))},b}(h);g.prototype.then=function(a,b){var d=this,e=c.Observer.create(function(b){a(b);var c=d.observers.indexOf(e);d.observers.splice(c,1)},function(a){b(a);var c=d.observers.indexOf(e);d.observers.splice(c,1)});return this.observers.push(e),new g(this.scheduler,[])};var x=function(a){function b(a){var b=this;this.observers.push(a),this.subscriptions.push(new u(this.scheduler.clock));var c=this.subscriptions.length-1;return n(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new u(b.subscriptions[c].subscribe,b.scheduler.clock)})}function c(c,d){a.call(this,b);var e,f,g=this;this.scheduler=c,this.messages=d,this.subscriptions=[],this.observers=[];for(var h=0,i=this.messages.length;i>h;h++)e=this.messages[h],f=e.value,function(a){c.scheduleAbsoluteWithState(null,e.time,function(){for(var b=g.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return m})}(f)}return q(c,a),c}(i),y=function(a){function b(a){var b,c,d=this;this.subscriptions.push(new u(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new o,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelativeWithState(null,b.time,function(){return c.accept(a),m}))}(c);return n(function(){d.subscriptions[e]=new u(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})}function c(c,d){a.call(this,b),this.scheduler=c,this.messages=d,this.subscriptions=[]}return q(c,a),c}(i);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function e(){a.call(this,0,b)}return q(e,a),e.prototype.scheduleAbsoluteWithState=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsoluteWithState.call(this,b,c,d)},e.prototype.add=function(a,b){return a+b},e.prototype.toDateTimeOffset=function(a){return new Date(a).getTime()},e.prototype.toRelative=function(a){return a},e.prototype.startWithTiming=function(a,b,c,d){var e,f,g=this.createObserver();return this.scheduleAbsoluteWithState(null,b,function(){return e=a(),m}),this.scheduleAbsoluteWithState(null,c,function(){return f=e.subscribe(g),m}),this.scheduleAbsoluteWithState(null,d,function(){return f.dispose(),m}),this.start(),g},e.prototype.startWithDispose=function(a,b){return this.startWithTiming(a,s.created,s.subscribed,b)},e.prototype.startWithCreate=function(a){return this.startWithTiming(a,s.created,s.subscribed,s.disposed)},e.prototype.createHotObservable=function(){var a=d(arguments,0);return new x(this,a)},e.prototype.createColdObservable=function(){var a=d(arguments,0);return new y(this,a)},e.prototype.createResolvedPromise=function(a,b){return new g(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},e.prototype.createRejectedPromise=function(a,b){return new g(this,[c.ReactiveTest.onError(a,b)])},e.prototype.createObserver=function(){return new w(this)},e}(k),c});
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.virtualtime","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx.all")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:q.call(a)}function f(a){this.predicate=a}function g(a){this.predicate=a}function h(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsoluteWithState(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return n})}(g)}}var i=c.Observer,j=c.Observable,k=c.Notification,l=c.VirtualTimeScheduler,m=c.Disposable,n=m.empty,o=m.create,p=c.CompositeDisposable,q=(c.SingleAssignmentDisposable,Array.prototype.slice),r=c.internals.inherits,s=c.internals.isEqual;f.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},g.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.exception)};var t=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new u(a,new f(b)):new u(a,k.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new u(a,new g(b)):new u(a,k.createOnError(b))},onCompleted:function(a){return new u(a,k.createOnCompleted())},subscribe:function(a,b){return new v(a,b)}},u=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||s};u.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},u.prototype.toString=function(){return this.value.toString()+"@"+this.time};var v=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};v.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},v.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var w=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};w.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var x=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}r(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new u(this.scheduler.clock,k.createOnNext(a)))},c.onError=function(a){this.messages.push(new u(this.scheduler.clock,k.createOnError(a)))},c.onCompleted=function(){this.messages.push(new u(this.scheduler.clock,k.createOnCompleted()))},b}(i);h.prototype.then=function(a,b){var e=this;this.subscriptions.push(new v(this.scheduler.clock));var f,g=this.subscriptions.length-1,i=c.Observer.create(function(b){var j=a(b);if(j&&"function"==typeof j.then)f=j;else{var k=e.scheduler.clock;f=new h(e.scheduler,[c.ReactiveTest.onNext(k,d),c.ReactiveTest.onCompleted(k)])}var l=e.observers.indexOf(i);e.observers.splice(l,1),e.subscriptions[g]=new v(e.subscriptions[g].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(i);e.observers.splice(c,1),e.subscriptions[g]=new v(e.subscriptions[g].subscribe,e.scheduler.clock)});return this.observers.push(i),f||new h(this.scheduler,this.messages)};var y=function(a){function b(a){var b=this;this.observers.push(a),this.subscriptions.push(new v(this.scheduler.clock));var c=this.subscriptions.length-1;return o(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new v(b.subscriptions[c].subscribe,b.scheduler.clock)})}function c(c,d){a.call(this,b);var e,f,g=this;this.scheduler=c,this.messages=d,this.subscriptions=[],this.observers=[];for(var h=0,i=this.messages.length;i>h;h++)e=this.messages[h],f=e.value,function(a){c.scheduleAbsoluteWithState(null,e.time,function(){for(var b=g.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return n})}(f)}return r(c,a),c}(j),z=function(a){function b(a){var b,c,d=this;this.subscriptions.push(new v(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new p,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelativeWithState(null,b.time,function(){return c.accept(a),n}))}(c);return o(function(){d.subscriptions[e]=new v(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})}function c(c,d){a.call(this,b),this.scheduler=c,this.messages=d,this.subscriptions=[]}return r(c,a),c}(j);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return r(d,a),d.prototype.scheduleAbsoluteWithState=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsoluteWithState.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toDateTimeOffset=function(a){return new Date(a).getTime()},d.prototype.toRelative=function(a){return a},d.prototype.startWithTiming=function(a,b,c,d){var e,f,g=this.createObserver();return this.scheduleAbsoluteWithState(null,b,function(){return e=a(),n}),this.scheduleAbsoluteWithState(null,c,function(){return f=e.subscribe(g),n}),this.scheduleAbsoluteWithState(null,d,function(){return f.dispose(),n}),this.start(),g},d.prototype.startWithDispose=function(a,b){return this.startWithTiming(a,t.created,t.subscribed,b)},d.prototype.startWithCreate=function(a){return this.startWithTiming(a,t.created,t.subscribed,t.disposed)},d.prototype.createHotObservable=function(){var a=e(arguments,0);return new y(this,a)},d.prototype.createColdObservable=function(){var a=e(arguments,0);return new z(this,a)},d.prototype.createResolvedPromise=function(a,b){return new h(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new h(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new x(this)},d}(l),c});
//# sourceMappingURL=rx.testing.map

@@ -0,0 +0,0 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

@@ -5,3 +5,3 @@ {

"description": "Library for composing asynchronous and event-based operations in JavaScript",
"version": "2.3.18",
"version": "2.3.19",
"homepage": "https://github.com/Reactive-Extensions/RxJS",

@@ -8,0 +8,0 @@ "author": {

@@ -6,3 +6,2 @@ [![Build Status](https://travis-ci.org/Reactive-Extensions/RxJS.png)](https://travis-ci.org/Reactive-Extensions/RxJS)

[![NuGet](http://img.shields.io/nuget/v/RxJS-All.svg)](http://www.nuget.org/packages/RxJS-All/)
[![Code Climate](https://codeclimate.com/github/Reactive-Extensions/RxJS/badges/gpa.svg)](https://codeclimate.com/github/Reactive-Extensions/RxJS)
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

@@ -177,3 +176,3 @@

function (error) {
$results.empty().append($'<li>').text('Error:' + error);
$results.empty().append($('<li>')).text('Error:' + error);
});

@@ -209,3 +208,4 @@ ```

- [Learn RxJS](https://github.com/jhusain/learnrx)
- [RxJS Koans](https://github.com/mattpodwysocki/RxJSKoans)
- [RxJS Koans](https://github.com/Reactive-Extensions/RxJSKoans)
- [RxJS Workshop](https://github.com/Reactive-Extensions/BuildStuffWorkshop)
- [Rx Workshop](http://rxworkshop.codeplex.com/)

@@ -219,12 +219,19 @@ - [Reactive Programming and MVC](http://aaronstacy.com/writings/reactive-programming-and-mvc/)

- [101 Rx Samples Wiki](http://rxwiki.wikidot.com/101samples)
- [Rx Design Guidelines](http://go.microsoft.com/fwlink/?LinkID=205219)
- [Rx Design Guidelines](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/designguidelines)
- [Beginners Guide to Rx](http://msdn.microsoft.com/en-us/data/gg577611)
- Examples
- [React RxJS Autocomplete](https://github.com/eliseumds/react-autocomplete)
- [React RxJS TODO MVC](https://github.com/fdecampredon/react-rxjs-todomvc)
- [Rx-React](https://github.com/fdecampredon/rx-react)
- [React RxJS Router](https://github.com/kmcclosk/reactjs-rxjs-example)
- [Ninya.io - Angular + RxJS + rx.angular.js](https://github.com/ninya-io/ninya.io) - [Site](http://stackwho.herokuapp.com/)
- [Reactive Trader](https://github.com/AdaptiveConsulting/ReactiveTrader) - [Site](https://reactivetrader.azurewebsites.net/)
- [React](http://facebook.github.io/react/)
- [React RxJS Autocomplete](https://github.com/eliseumds/react-autocomplete)
- [React RxJS TODO MVC](https://github.com/fdecampredon/react-rxjs-todomvc)
- [Rx-React](https://github.com/fdecampredon/rx-react)
- [React RxJS Router](https://github.com/kmcclosk/reactjs-rxjs-example)
- [AngularJS](http://angularjs.org)
- [Ninya.io - Angular + RxJS + rx.angular.js](https://github.com/ninya-io/ninya.io) - [Site](http://stackwho.herokuapp.com/)
- [Cycle](https://github.com/staltz/cycle)
- [Cycle TODO MVC](https://github.com/staltz/todomvc-cycle)
- [jQuery](http://jquery.com)
- [Mario Elm Example](http://fudini.github.io/rx/mario.html)
- [Knockout.js](http://knockoutjs.com/)
- [Reactive Trader](https://github.com/AdaptiveConsulting/ReactiveTrader) - [Site](https://reactivetrader.azurewebsites.net/)

@@ -260,2 +267,3 @@ - Presentations

- Books
- [RxJS](http://xgrommx.github.io/rx-book)
- [Intro to Rx](http://www.amazon.com/Introduction-to-Rx-ebook/dp/B008GM3YPM/)

@@ -273,3 +281,3 @@ - [Programming Reactive Extensions and LINQ](http://www.amazon.com/Programming-Reactive-Extensions-Jesse-Liberty/dp/1430237473/)

```bash
rx --lite --compat --methods select,selectmany,takeuntil,fromevent
$ rx --lite --compat --methods select,selectmany,takeuntil,fromevent
```

@@ -287,4 +295,4 @@

```bash`
npm install rx
npm install -g rx
$ npm install rx
$ npm install -g rx
```

@@ -301,13 +309,13 @@

```bash
bower install rxjs
$ bower install rxjs
```
### Installing with [Jam](http://jamjs.org/)
jam install rx
```bash
$ jam install rx
```
### Installing All of RxJS via [NuGet](http://nuget.org/)
Install-Package RxJS-All
```bash
$ Install-Package RxJS-All
```
### Install individual packages via [NuGet](http://nuget.org/):

@@ -360,9 +368,9 @@

require({
'paths': {
'rx': 'path/to/rx.js'
}
'paths': {
'rx': 'path/to/rx-lite.js'
}
},
['rx'], function(Rx) {
var obs = Rx.Observable.return(42);
obs.subscribe(function (x) { console.log(x); });
var obs = Rx.Observable.of(42);
obs.subscribe(function (x) { console.log(x); });
});

@@ -375,2 +383,3 @@ ```

- [React (Rx-React)](https://github.com/fdecampredon/rx-react)
- [AngularJS](https://github.com/Reactive-Extensions/rx.angular.js)

@@ -377,0 +386,0 @@ - [HTML DOM](https://github.com/Reactive-Extensions/RxJS-DOM)

@@ -1,60 +0,53 @@

/** @private */
var AutoDetachObserver = (function (_super) {
inherits(AutoDetachObserver, _super);
var AutoDetachObserver = (function (__super__) {
inherits(AutoDetachObserver, __super__);
function AutoDetachObserver(observer) {
_super.call(this);
this.observer = observer;
this.m = new SingleAssignmentDisposable();
}
function AutoDetachObserver(observer) {
__super__.call(this);
this.observer = observer;
this.m = new SingleAssignmentDisposable();
}
var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
AutoDetachObserverPrototype.next = function (value) {
var noError = false;
try {
this.observer.onNext(value);
noError = true;
} catch (e) {
throw e;
} finally {
if (!noError) {
this.dispose();
}
}
};
AutoDetachObserverPrototype.next = function (value) {
var noError = false;
try {
this.observer.onNext(value);
noError = true;
} catch (e) {
throw e;
} finally {
!noError && this.dispose();
}
};
AutoDetachObserverPrototype.error = function (exn) {
try {
this.observer.onError(exn);
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.error = function (err) {
try {
this.observer.onError(err);
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.completed = function () {
try {
this.observer.onCompleted();
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.completed = function () {
try {
this.observer.onCompleted();
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); };
/* @private */
AutoDetachObserverPrototype.disposable = function (value) {
return arguments.length ? this.getDisposable() : setDisposable(value);
};
AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); };
AutoDetachObserverPrototype.dispose = function () {
_super.prototype.dispose.call(this);
this.m.dispose();
};
AutoDetachObserverPrototype.dispose = function () {
__super__.prototype.dispose.call(this);
this.m.dispose();
};
return AutoDetachObserver;
}(AbstractObserver));
return AutoDetachObserver;
}(AbstractObserver));

@@ -0,0 +0,0 @@ var CatchScheduler = (function (__super__) {

@@ -1,4 +0,2 @@

/**
* Gets a scheduler that schedules work immediately on the current thread.
*/
/** Gets a scheduler that schedules work immediately on the current thread. */
var immediateScheduler = Scheduler.immediate = (function () {

@@ -9,3 +7,3 @@

function scheduleRelative(state, dueTime, action) {
var dt = normalizeTime(dt);
var dt = normalizeTime(dueTime);
while (dt - this.now() > 0) { }

@@ -12,0 +10,0 @@ return action(this, state);

@@ -0,0 +0,0 @@ var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {

@@ -0,0 +0,0 @@ var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {

@@ -0,0 +0,0 @@ /** Provides a set of static properties to access commonly used schedulers. */

@@ -61,3 +61,3 @@ var scheduleMethod, clearMethod = noop;

function onGlobalPostMessage(event) {
var onGlobalPostMessage = function (event) {
// Only if we're a match to avoid any other global events

@@ -64,0 +64,0 @@ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {

@@ -0,0 +0,0 @@ var hasStacks = false;

@@ -0,0 +0,0 @@ // Shim in iterator support

@@ -8,3 +8,3 @@ var Dictionary = (function () {

function isPrime(candidate) {
if (candidate & 1 === 0) { return candidate === 2; }
if ((candidate & 1) === 0) { return candidate === 2; }
var num1 = Math.sqrt(candidate),

@@ -72,6 +72,6 @@ num2 = 3;

}
if (obj.getHashCode) { return obj.getHashCode(); }
if (obj.hashCode) { return obj.hashCode(); }
var id = 17 * uniqueIdCounter++;
obj.getHashCode = function () { return id; };
obj.hashCode = function () { return id; };
return id;

@@ -109,3 +109,3 @@ };

dictionaryProto.add = function (key, value) {
return this._insert(key, value, true);
this._insert(key, value, true);
};

@@ -112,0 +112,0 @@

@@ -16,3 +16,3 @@ var Enumerable = Rx.internals.Enumerable = function (iterator) {

} catch (err) {
observer.onError();
observer.onError(err);
return;

@@ -65,3 +65,3 @@ }

} catch (err) {
observer.onError();
observer.onError(err);
return;

@@ -68,0 +68,0 @@ }

@@ -16,11 +16,12 @@ /** `Object#toString` result shortcuts */

supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
suportNodeClass,
supportNodeClass,
errorProto = Error.prototype,
objectProto = Object.prototype,
stringProto = String.prototype,
propertyIsEnumerable = objectProto.propertyIsEnumerable;
try {
suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch (e) {
suportNodeClass = true;
supportNodeClass = true;
}

@@ -130,3 +131,3 @@

function isArguments(value) {
var isArguments = function(value) {
return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;

@@ -133,0 +134,0 @@ }

@@ -0,0 +0,0 @@ function observableCatchHandler(source, handler) {

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ function flatMapWithMaxConcurrent(source, maxConcurrent, selector, thisArg) {

@@ -12,6 +12,4 @@ /**

function (value) {
if (!subject.isDisposed) {
subject.onNext(value);
subject.onCompleted();
}
subject.onNext(value);
subject.onCompleted();
},

@@ -18,0 +16,0 @@ subject.onError.bind(subject));

@@ -0,0 +0,0 @@ function observableOf (scheduler, array) {

@@ -1,17 +0,27 @@

if (!!root.Map) {
/**
* Converts the observable sequence to a Map if it exists.
* @param {Function} keySelector A function which produces the key for the Map.
* @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
* @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
*/
observableProto.toMap = function (keySelector, elementSelector) {
var source = this;
return new AnonymousObservable(function (observer) {
var m = new root.Map();
return source.subscribe(
function (x) {
var key;
/**
* Converts the observable sequence to a Map if it exists.
* @param {Function} keySelector A function which produces the key for the Map.
* @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
* @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
*/
observableProto.toMap = function (keySelector, elementSelector) {
if (typeof root.Map === 'undefined') { throw new TypeError(); }
var source = this;
return new AnonymousObservable(function (observer) {
var m = new root.Map();
return source.subscribe(
function (x) {
var key;
try {
key = keySelector(x);
} catch (e) {
observer.onError(e);
return;
}
var element = x;
if (elementSelector) {
try {
key = keySelector(x);
element = elementSelector(x);
} catch (e) {

@@ -21,22 +31,12 @@ observer.onError(e);

}
}
var element = x;
if (elementSelector) {
try {
element = elementSelector(x);
} catch (e) {
observer.onError(e);
return;
}
}
m.set(key, element);
},
observer.onError.bind(observer),
function () {
observer.onNext(m);
observer.onCompleted();
});
});
};
}
m.set(key, element);
},
observer.onError.bind(observer),
function () {
observer.onNext(m);
observer.onCompleted();
});
});
};

@@ -1,19 +0,19 @@

if (!!root.Set) {
/**
* Converts the observable sequence to a Set if it exists.
* @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
*/
observableProto.toSet = function () {
var source = this;
return new AnonymousObservable(function (observer) {
var s = new root.Set();
return source.subscribe(
s.add.bind(s),
observer.onError.bind(observer),
function () {
observer.onNext(s);
observer.onCompleted();
});
});
};
}
/**
* Converts the observable sequence to a Set if it exists.
* @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
*/
observableProto.toSet = function () {
if (typeof root.Set === 'undefined') { throw new TypeError(); }
var source = this;
return new AnonymousObservable(function (observer) {
var s = new root.Set();
return source.subscribe(
s.add.bind(s),
observer.onError.bind(observer),
function () {
observer.onNext(s);
observer.onCompleted();
});
});
};

@@ -12,2 +12,3 @@ // References

ScheduledObserver = internals.ScheduledObserver,
SerialDisposable = Rx.SerialDisposable,
SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,

@@ -14,0 +15,0 @@ CompositeDisposable = Rx.CompositeDisposable,

@@ -0,0 +0,0 @@ /**

var ObserveOnObserver = (function (__super__) {
inherits(ObserveOnObserver, __super__);
function ObserveOnObserver() {
__super__.apply(this, arguments);
function ObserveOnObserver(scheduler, observer, cancel) {
__super__.call(this, scheduler, observer);
this._cancel = cancel;
}

@@ -23,3 +24,9 @@

ObserveOnObserver.prototype.dispose = function () {
__super__.prototype.dispose.call(this);
this._cancel && this._cancel.dispose();
this._cancel = null;
};
return ObserveOnObserver;
})(ScheduledObserver);

@@ -67,4 +67,4 @@ /**

*/
Observer.notifyOn = function (scheduler) {
Observer.prototype.notifyOn = function (scheduler) {
return new ObserveOnObserver(scheduler, this);
};

@@ -16,12 +16,8 @@ var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {

var self = this;
this.queue.push(function () {
self.observer.onNext(value);
});
this.queue.push(function () { self.observer.onNext(value); });
};
ScheduledObserver.prototype.error = function (err) {
ScheduledObserver.prototype.error = function (e) {
var self = this;
this.queue.push(function () {
self.observer.onError(err);
});
this.queue.push(function () { self.observer.onError(e); });
};

@@ -31,5 +27,3 @@

var self = this;
this.queue.push(function () {
self.observer.onCompleted();
});
this.queue.push(function () { self.observer.onCompleted(); });
};

@@ -36,0 +30,0 @@

@@ -21,4 +21,2 @@ /**

var n = this.q.length;
for (var i = 0, len = this.q.length; i < len; i++) {

@@ -29,10 +27,8 @@ so.onNext(this.q[i].value);

if (this.hasError) {
n++;
so.onError(this.error);
} else if (this.isStopped) {
n++;
so.onCompleted();
}
so.ensureActive(n);
so.ensureActive();
return subscription;

@@ -39,0 +35,0 @@ }

@@ -0,0 +0,0 @@ var ColdObservable = (function (__super__) {

@@ -0,0 +0,0 @@ var HotObservable = (function (__super__) {

@@ -0,0 +0,0 @@ var MockObserver = (function (__super__) {

function MockPromise(scheduler, messages) {
var message, notification, observable = this;
var self = this;
this.scheduler = scheduler;

@@ -8,7 +8,7 @@ this.messages = messages;

for (var i = 0, len = this.messages.length; i < len; i++) {
message = this.messages[i];
notification = message.value;
var message = this.messages[i],
notification = message.value;
(function (innerNotification) {
scheduler.scheduleAbsoluteWithState(null, message.time, function () {
var obs = observable.observers.slice(0);
var obs = self.observers.slice(0);

@@ -27,7 +27,19 @@ for (var j = 0, jLen = obs.length; j < jLen; j++) {

this.subscriptions.push(new Subscription(this.scheduler.clock));
var index = this.subscriptions.length - 1;
var newPromise;
var observer = Rx.Observer.create(
function (x) {
onResolved(x);
var retValue = onResolved(x);
if (retValue && typeof retValue.then === 'function') {
newPromise = retValue;
} else {
var ticks = self.scheduler.clock;
newPromise = new MockPromise(self.scheduler, [Rx.ReactiveTest.onNext(ticks, undefined), Rx.ReactiveTest.onCompleted(ticks)]);
}
var idx = self.observers.indexOf(observer);
self.observers.splice(idx, 1);
self.subscriptions[index] = new Subscription(self.subscriptions[index].subscribe, self.scheduler.clock);
},

@@ -38,2 +50,3 @@ function (err) {

self.observers.splice(idx, 1);
self.subscriptions[index] = new Subscription(self.subscriptions[index].subscribe, self.scheduler.clock);
}

@@ -43,3 +56,3 @@ );

return new MockPromise(this.scheduler, []);
}
return newPromise || new MockPromise(this.scheduler, this.messages);
};

@@ -0,0 +0,0 @@ function OnNextPredicate(predicate) {

@@ -0,0 +0,0 @@ // Refernces

@@ -63,2 +63,3 @@ // DefinitelyTyped: partial

function not(value: any): boolean;
function isFunction(value: any): boolean;
}

@@ -80,4 +81,2 @@

remove(item: IDisposable): boolean;
clear(): void;
contains(item: IDisposable): boolean;
toArray(): IDisposable[];

@@ -107,11 +106,5 @@ }

// Multiple assignment disposable
export class SerialDisposable implements IDisposable {
// SerialDisposable it's an alias of SingleAssignmentDisposable
export class SerialDisposable extends SingleAssignmentDisposable {
constructor();
isDisposed: boolean;
dispose(): void;
getDisposable(): IDisposable;
setDisposable(value: IDisposable): void;
}

@@ -149,2 +142,21 @@

export interface Scheduler extends IScheduler {
}
export interface SchedulerStatic {
new (
now: () => number,
schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable,
scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable,
scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable): Scheduler;
normalize(timeSpan: number): number;
immediate: IScheduler;
currentThread: ICurrentThreadScheduler;
timeout: IScheduler;
}
export var Scheduler: SchedulerStatic;
// Current Thread IScheduler

@@ -195,3 +207,3 @@ interface ICurrentThreadScheduler extends IScheduler {

create<T>(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observer<T>;
fromNotifier<T>(handler: (notification: Notification<T>) => void): Observer<T>;
fromNotifier<T>(handler: (notification: Notification<T>, thisArg?: any) => void): Observer<T>;
}

@@ -204,2 +216,6 @@

subscribe(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable;
subscribeOnNext(onNext: (value: T) => void, thisArg?: any): IDisposable;
subscribeOnError(onError: (exception: any) => void, thisArg?: any): IDisposable;
subscribeOnCompleted(onCompleted: () => void, thisArg?: any): IDisposable;
}

@@ -280,4 +296,14 @@

doAction(observer: Observer<T>): Observable<T>; // alias for do
tap(observer: Observer<T>): Observable<T>; // alias for do
do(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable<T>;
doAction(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable<T>; // alias for do
tap(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable<T>; // alias for do
doOnNext(onNext: (value: T) => void, thisArg?: any): Observable<T>;
doOnError(onError: (exception: any) => void, thisArg?: any): Observable<T>;
doOnCompleted(onCompleted: () => void, thisArg?: any): Observable<T>;
tapOnNext(onNext: (value: T) => void, thisArg?: any): Observable<T>;
tapOnError(onError: (exception: any) => void, thisArg?: any): Observable<T>;
tapOnCompleted(onCompleted: () => void, thisArg?: any): Observable<T>;
finally(action: () => void): Observable<T>;

@@ -294,3 +320,3 @@ finallyAction(action: () => void): Observable<T>; // alias for finally

startWith(scheduler: IScheduler, ...values: T[]): Observable<T>;
takeLast(count: number, scheduler?: IScheduler): Observable<T>;
takeLast(count: number): Observable<T>;
takeLastBuffer(count: number): Observable<T[]>;

@@ -300,2 +326,3 @@

map<TResult>(selector: (value: T, index: number, source: Observable<T>) => TResult, thisArg?: any): Observable<TResult>; // alias for select
pluck<TResult>(prop: string): Observable<TResult>;
selectMany<TOther, TResult>(selector: (value: T) => Observable<TOther>, resultSelector: (item: T, other: TOther) => TResult): Observable<TResult>;

@@ -513,2 +540,4 @@ selectMany<TOther, TResult>(selector: (value: T) => IPromise<TOther>, resultSelector: (item: T, other: TOther) => TResult): Observable<TResult>;

throwException<T>(exception: any, scheduler?: IScheduler): Observable<T>; // alias for throw
throwError<T>(error: Error, scheduler?: IScheduler): Observable<T>; // alias for throw
throwError<T>(error: any, scheduler?: IScheduler): Observable<T>; // alias for throw

@@ -519,2 +548,4 @@ catch<T>(sources: Observable<T>[]): Observable<T>;

catchException<T>(sources: IPromise<T>[]): Observable<T>; // alias for catch
catchError<T>(sources: Observable<T>[]): Observable<T>; // alias for catch
catchError<T>(sources: IPromise<T>[]): Observable<T>; // alias for catch
catch<T>(...sources: Observable<T>[]): Observable<T>;

@@ -524,2 +555,4 @@ catch<T>(...sources: IPromise<T>[]): Observable<T>;

catchException<T>(...sources: IPromise<T>[]): Observable<T>; // alias for catch
catchError<T>(...sources: Observable<T>[]): Observable<T>; // alias for catch
catchError<T>(...sources: IPromise<T>[]): Observable<T>; // alias for catch

@@ -526,0 +559,0 @@ combineLatest<T, T2, TResult>(first: Observable<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;

@@ -9,2 +9,9 @@ // DefinitelyTyped: partial

declare module Rx {
export module config {
/**
* Configuration option to determine whether to use native events only
*/
export var useNativeEvents: boolean;
}
interface ObservableStatic {

@@ -11,0 +18,0 @@ /**

@@ -18,4 +18,3 @@ // DefinitelyTyped: partial

*/
pausable(pauser: Observable<boolean>): Observable<T>;
pausable(pauser?: ISubject<boolean>): PausableObservable<T>;
pausable(pauser?: Observable<boolean>): PausableObservable<T>;

@@ -31,3 +30,3 @@ /**

*/
pausableBuffered(pauser?: ISubject<boolean>): PausableObservable<T>;
pausableBuffered(pauser?: Observable<boolean>): PausableObservable<T>;

@@ -34,0 +33,0 @@ /**

@@ -1,2 +0,2 @@

// Type definitions for RxJS-BackPressure v2.2.28
// Type definitions for RxJS-BackPressure v2.3.12
// Project: http://rx.codeplex.com/

@@ -3,0 +3,0 @@ // Definitions by: Igor Oleinikov <https://github.com/Igorbek>

@@ -9,3 +9,3 @@ // Type definitions for RxJS v2.2.28

declare module Rx {
export interface IScheduler {
export interface IScheduler {
catch(handler: (exception: any) => boolean): IScheduler;

@@ -15,38 +15,3 @@ catchException(handler: (exception: any) => boolean): IScheduler;

export class Scheduler implements IScheduler {
constructor(
now: () => number,
schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable,
scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable,
scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable);
static normalize(timeSpan: number): number;
static immediate: IScheduler;
static currentThread: ICurrentThreadScheduler;
static timeout: IScheduler;
now(): number;
catch(handler: (exception: any) => boolean): IScheduler;
catchException(handler: (exception: any) => boolean): IScheduler;
schedule(action: () => void): IDisposable;
scheduleWithState<TState>(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable;
scheduleWithAbsoluteAndState<TState>(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
scheduleWithRelative(dueTime: number, action: () => void): IDisposable;
scheduleWithRelativeAndState<TState>(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
scheduleRecursive(action: (action: () => void) => void): IDisposable;
scheduleRecursiveWithState<TState>(state: TState, action: (state: TState, action: (state: TState) => void) => void): IDisposable;
scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable;
scheduleRecursiveWithAbsoluteAndState<TState>(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable;
scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable;
scheduleRecursiveWithRelativeAndState<TState>(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable;
schedulePeriodic(period: number, action: () => void): IDisposable;
schedulePeriodicWithState<TState>(state: TState, period: number, action: (state: TState) => TState): IDisposable;
}
// Observer
// Observer
export interface Observer<T> {

@@ -79,3 +44,3 @@ checked(): Observer<any>;

groupBy<TKey, TElement>(keySelector: (value: T) => TKey, skipElementSelector?: boolean, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, T>>;
groupBy<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, T>>;
groupBy<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
groupByUntil<TKey, TDuration>(keySelector: (value: T) => TKey, skipElementSelector: boolean, durationSelector: (group: GroupedObservable<TKey, T>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, T>>;

@@ -82,0 +47,0 @@ groupByUntil<TKey, TElement, TDuration>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable<TKey, TElement>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;

@@ -0,0 +0,0 @@ // Type definitions for RxJS-Join v2.2.28

@@ -13,39 +13,4 @@ // Type definitions for RxJS-Lite v2.2.28

declare module Rx {
export class Scheduler implements IScheduler {
constructor(
now: () => number,
schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable,
scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable,
scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable);
static normalize(timeSpan: number): number;
static immediate: IScheduler;
static currentThread: ICurrentThreadScheduler;
static timeout: IScheduler;
now(): number;
schedule(action: () => void): IDisposable;
scheduleWithState<TState>(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable;
scheduleWithAbsoluteAndState<TState>(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
scheduleWithRelative(dueTime: number, action: () => void): IDisposable;
scheduleWithRelativeAndState<TState>(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
scheduleRecursive(action: (action: () => void) => void): IDisposable;
scheduleRecursiveWithState<TState>(state: TState, action: (state: TState, action: (state: TState) => void) => void): IDisposable;
scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable;
scheduleRecursiveWithAbsoluteAndState<TState>(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable;
scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable;
scheduleRecursiveWithRelativeAndState<TState>(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable;
schedulePeriodic(period: number, action: () => void): IDisposable;
schedulePeriodicWithState<TState>(state: TState, period: number, action: (state: TState) => TState): IDisposable;
}
}
declare module "rx.lite" {
export = Rx;
}

@@ -10,5 +10,3 @@ // Type definitions for RxJS-Testing v2.2.28

declare module Rx {
export class TestScheduler extends VirtualTimeScheduler<number, number> {
constructor();
export interface TestScheduler extends VirtualTimeScheduler<number, number> {
createColdObservable<T>(...records: Recorded[]): Observable<T>;

@@ -23,2 +21,6 @@ createHotObservable<T>(...records: Recorded[]): Observable<T>;

export var TestScheduler: {
new (): TestScheduler;
};
export class Recorded {

@@ -25,0 +27,0 @@ constructor(time: number, value: any, equalityComparer?: (x: any, y: any) => boolean);

@@ -20,2 +20,3 @@ // DefinitelyTyped: partial

export interface Observable<T> {
delay(dueTime: Date, scheduler?: IScheduler): Observable<T>;
delay(dueTime: number, scheduler?: IScheduler): Observable<T>;

@@ -29,21 +30,2 @@ throttle(dueTime: number, scheduler?: IScheduler): Observable<T>;

timeout(dueTime: number, other?: Observable<T>, scheduler?: IScheduler): Observable<T>;
delaySubscription(dueTime: number, scheduler?: IScheduler): Observable<T>;
delayWithSelector(delayDurationSelector: (item: T) => number): Observable<T>;
delayWithSelector(subscriptionDelay: number, delayDurationSelector: (item: T) => number): Observable<T>;
timeoutWithSelector<TTimeout>(firstTimeout: Observable<TTimeout>, timeoutdurationSelector?: (item: T) => Observable<TTimeout>, other?: Observable<T>): Observable<T>;
throttleWithSelector<TTimeout>(throttleDurationSelector: (item: T) => Observable<TTimeout>): Observable<T>;
skipLastWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
takeLastWithTime(duration: number, timerScheduler?: IScheduler, loopScheduler?: IScheduler): Observable<T>;
takeLastBufferWithTime(duration: number, scheduler?: IScheduler): Observable<T[]>;
takeWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
skipWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
skipUntilWithTime(startTime: Date, scheduler?: IScheduler): Observable<T>;
skipUntilWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
takeUntilWithTime(endTime: Date, scheduler?: IScheduler): Observable<T>;
takeUntilWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
}

@@ -56,10 +38,3 @@

timer(dueTime: number, scheduler?: IScheduler): Observable<number>;
generateWithRelativeTime<TState, TResult>(
initialState: TState,
condition: (state: TState) => boolean,
iterate: (state: TState) => TState,
resultSelector: (state: TState) => TResult,
timeSelector: (state: TState) => number,
scheduler?: IScheduler): Observable<TResult>;
}
}

@@ -11,2 +11,21 @@ // Type definitions for RxJS-Time v2.2.28

export interface Observable<T> {
delaySubscription(dueTime: number, scheduler?: IScheduler): Observable<T>;
delayWithSelector(delayDurationSelector: (item: T) => number): Observable<T>;
delayWithSelector(subscriptionDelay: number, delayDurationSelector: (item: T) => number): Observable<T>;
timeoutWithSelector<TTimeout>(firstTimeout: Observable<TTimeout>, timeoutdurationSelector?: (item: T) => Observable<TTimeout>, other?: Observable<T>): Observable<T>;
throttleWithSelector<TTimeout>(throttleDurationSelector: (item: T) => Observable<TTimeout>): Observable<T>;
skipLastWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
takeLastWithTime(duration: number, timerScheduler?: IScheduler, loopScheduler?: IScheduler): Observable<T>;
takeLastBufferWithTime(duration: number, scheduler?: IScheduler): Observable<T[]>;
takeWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
skipWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
skipUntilWithTime(startTime: Date, scheduler?: IScheduler): Observable<T>;
skipUntilWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
takeUntilWithTime(endTime: Date, scheduler?: IScheduler): Observable<T>;
takeUntilWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
windowWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable<Observable<T>>;

@@ -24,2 +43,9 @@ windowWithTime(timeSpan: number, scheduler?: IScheduler): Observable<Observable<T>>;

generateWithRelativeTime<TState, TResult>(
initialState: TState,
condition: (state: TState) => boolean,
iterate: (state: TState) => TState,
resultSelector: (state: TState) => TResult,
timeSelector: (state: TState) => number,
scheduler?: IScheduler): Observable<TResult>;
generateWithAbsoluteTime<TState, TResult>(

@@ -26,0 +52,0 @@ initialState: TState,

@@ -9,5 +9,4 @@ // Type definitions for RxJS-VirtualTime v2.2.28

declare module Rx {
// Virtual IScheduler
export /*abstract*/ class VirtualTimeScheduler<TAbsolute, TRelative> extends Scheduler {
constructor(initialClock: TAbsolute, comparer: (first: TAbsolute, second: TAbsolute) => number);
export interface VirtualTimeScheduler<TAbsolute, TRelative> extends Scheduler {
//protected constructor(initialClock: TAbsolute, comparer: (first: TAbsolute, second: TAbsolute) => number);

@@ -33,5 +32,8 @@ advanceBy(time: TRelative): void;

export class HistoricalScheduler extends VirtualTimeScheduler<number, number> {
constructor(initialClock: number, comparer: (first: number, second: number) => number);
export interface HistoricalScheduler extends VirtualTimeScheduler<number, number> {
}
export var HistoricalScheduler: {
new (initialClock: number, comparer: (first: number, second: number) => number): HistoricalScheduler;
};
}

@@ -38,0 +40,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc