Socket
Socket
Sign inDemoInstall

rx

Package Overview
Dependencies
0
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.10 to 2.5.0

src/core/headers/litetestintro.js

2

bower.json
{
"name": "rxjs",
"version": "2.4.10",
"version": "2.5.0",
"main": [

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

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

return function () {
for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
var len = arguments.length, args = new Array(len)
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new AnonymousObservable(function (observer) {
function handler() {
var results = arguments;
var len = arguments.length, results = new Array(len);
for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
if (selector) {
try {
results = selector(results);
results = selector.apply(context, results);
} catch (e) {

@@ -359,3 +361,3 @@ return observer.onError(e);

try {
results = selector(results);
results = selector.apply(context, results);
} catch (e) {

@@ -362,0 +364,0 @@ return observer.onError(e);

/* 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.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return Array.isArray(a)?e.call(b,a):i(a)?A(a.call(b)):j(a)?A(a):h(a)?f(a):isPromise(a)?g(a):typeof a===x?a:z(a)||Array.isArray(a)?e.call(b,a):a}function e(a){var b=this;return function(c){function e(a,e){if(!f)try{if(a=d(a,b),typeof a!==x)return i[e]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[e]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void v.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)e(a[g[j]],g[j])}}function f(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function g(a){return function(b){a.then(function(a){b(null,a)},b)}}function h(a){return a&&typeof a.subscribe===x}function i(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function j(a){return a&&typeof a.next===x&&typeof a[y]===x}function k(a){a&&v.schedule(function(){throw a})}function l(b){var c=function(){this.cancelBubble=!0},d=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(b||(b=a.event),!b.target)switch(b.target=b.target||b.srcElement,"mouseover"==b.type&&(b.relatedTarget=b.fromElement),"mouseout"==b.type&&(b.relatedTarget=b.toElement),b.stopPropagation||(b.stopPropagation=c,b.preventDefault=d),b.type){case"keypress":var e="charCode"in b?b.charCode:b.keyCode;10==e?(e=0,b.keyCode=13):13==e||27==e?e=0:3==e&&(e=99),b.charCode=e,b.keyChar=b.charCode?String.fromCharCode(b.charCode):""}return b}function m(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),t(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(l(a))};return a.attachEvent("on"+b,d),t(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,t(function(){a["on"+b]=null})}function n(a,b,c){var d=new u;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(n(a.item(e),b,c));else a&&d.add(m(a,b,c));return d}var o=c.Observable,p=(o.prototype,o.fromPromise),q=o.throwError,r=c.AnonymousObservable,s=c.AsyncSubject,t=c.Disposable.create,u=c.CompositeDisposable,v=(c.Scheduler.immediate,c.Scheduler.timeout),w=c.helpers.isScheduler,x=(Array.prototype.slice,"function"),y="throw",z=c.internals.isObject,A=c.spawn=function(a){var b=i(a);return function(c){function e(a,b){v.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2)for(var b=[],i=1,j=arguments.length;j>i;i++)b.push(arguments[i]);if(a)try{c=h[y](a)}catch(k){return e(k)}if(!a)try{c=h.next(b)}catch(k){return e(k)}if(c.done)return e(null,c.value);if(c.value=d(c.value,g),typeof c.value!==x)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var l=!1;try{c.value.call(g,function(){l||(l=!0,f.apply(g,arguments))})}catch(k){v.schedule(function(){l||(l=!0,f.call(g,k))})}}}var g=this,h=a;if(b){for(var i=[],j=0,l=arguments.length;l>j;j++)i.push(arguments[j]);var l=i.length,m=l&&typeof i[l-1]===x;c=m?i.pop():k,h=a.apply(this,i)}else c=c||k;f()}};o.start=function(a,b,c){return B(a,b,c)()};var B=o.toAsync=function(a,b,c){return w(c)||(c=v),function(){var d=arguments,e=new s;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};o.fromCallback=function(a,b,c){return function(){for(var d=[],e=0,f=arguments.length;f>e;e++)d.push(arguments[e]);return new r(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},o.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new r(function(d){function f(a){if(a)return void d.onError(a);for(var b=arguments.length,e=[],f=1;b>f;f++)e[f-1]=arguments[f];if(c){try{e=c(e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},c.config.useNativeEvents=!1,o.fromEvent=function(a,b,d){return a.addListener?C(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new r(function(c){return n(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return c.onError(e)}c.onNext(b)})}).publish().refCount():C(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var C=o.fromEventPattern=function(a,b,c){return new r(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return t(function(){b&&b(e,f)})}).publish().refCount()};return o.startAsync=function(a){var b;try{b=a()}catch(c){return q(c)}return p(b)},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.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return Array.isArray(a)?e.call(b,a):i(a)?A(a.call(b)):j(a)?A(a):h(a)?f(a):isPromise(a)?g(a):typeof a===x?a:z(a)||Array.isArray(a)?e.call(b,a):a}function e(a){var b=this;return function(c){function e(a,e){if(!f)try{if(a=d(a,b),typeof a!==x)return i[e]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[e]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void v.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)e(a[g[j]],g[j])}}function f(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function g(a){return function(b){a.then(function(a){b(null,a)},b)}}function h(a){return a&&typeof a.subscribe===x}function i(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function j(a){return a&&typeof a.next===x&&typeof a[y]===x}function k(a){a&&v.schedule(function(){throw a})}function l(b){var c=function(){this.cancelBubble=!0},d=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(b||(b=a.event),!b.target)switch(b.target=b.target||b.srcElement,"mouseover"==b.type&&(b.relatedTarget=b.fromElement),"mouseout"==b.type&&(b.relatedTarget=b.toElement),b.stopPropagation||(b.stopPropagation=c,b.preventDefault=d),b.type){case"keypress":var e="charCode"in b?b.charCode:b.keyCode;10==e?(e=0,b.keyCode=13):13==e||27==e?e=0:3==e&&(e=99),b.charCode=e,b.keyChar=b.charCode?String.fromCharCode(b.charCode):""}return b}function m(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),t(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(l(a))};return a.attachEvent("on"+b,d),t(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,t(function(){a["on"+b]=null})}function n(a,b,c){var d=new u;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(n(a.item(e),b,c));else a&&d.add(m(a,b,c));return d}var o=c.Observable,p=(o.prototype,o.fromPromise),q=o.throwError,r=c.AnonymousObservable,s=c.AsyncSubject,t=c.Disposable.create,u=c.CompositeDisposable,v=(c.Scheduler.immediate,c.Scheduler.timeout),w=c.helpers.isScheduler,x=(Array.prototype.slice,"function"),y="throw",z=c.internals.isObject,A=c.spawn=function(a){var b=i(a);return function(c){function e(a,b){v.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2)for(var b=[],i=1,j=arguments.length;j>i;i++)b.push(arguments[i]);if(a)try{c=h[y](a)}catch(k){return e(k)}if(!a)try{c=h.next(b)}catch(k){return e(k)}if(c.done)return e(null,c.value);if(c.value=d(c.value,g),typeof c.value!==x)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var l=!1;try{c.value.call(g,function(){l||(l=!0,f.apply(g,arguments))})}catch(k){v.schedule(function(){l||(l=!0,f.call(g,k))})}}}var g=this,h=a;if(b){for(var i=[],j=0,l=arguments.length;l>j;j++)i.push(arguments[j]);var l=i.length,m=l&&typeof i[l-1]===x;c=m?i.pop():k,h=a.apply(this,i)}else c=c||k;f()}};o.start=function(a,b,c){return B(a,b,c)()};var B=o.toAsync=function(a,b,c){return w(c)||(c=v),function(){var d=arguments,e=new s;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};o.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new r(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},o.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new r(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},c.config.useNativeEvents=!1,o.fromEvent=function(a,b,d){return a.addListener?C(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new r(function(c){return n(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return c.onError(e)}c.onNext(b)})}).publish().refCount():C(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var C=o.fromEventPattern=function(a,b,c){return new r(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return t(function(){b&&b(e,f)})}).publish().refCount()};return o.startAsync=function(a){var b;try{b=a()}catch(c){return q(c)}return p(b)},c});
//# sourceMappingURL=rx.async.compat.map

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

return function () {
for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
var len = arguments.length, args = new Array(len)
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new AnonymousObservable(function (observer) {
function handler() {
var results = arguments;
var len = arguments.length, results = new Array(len);
for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
if (selector) {
try {
results = selector(results);
results = selector.apply(context, results);
} catch (e) {

@@ -359,3 +361,3 @@ return observer.onError(e);

try {
results = selector(results);
results = selector.apply(context, results);
} catch (e) {

@@ -362,0 +364,0 @@ return observer.onError(e);

/* 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.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return Array.isArray(a)?e.call(b,a):i(a)?z(a.call(b)):j(a)?z(a):h(a)?f(a):isPromise(a)?g(a):typeof a===w?a:y(a)||Array.isArray(a)?e.call(b,a):a}function e(a){var b=this;return function(c){function e(a,e){if(!f)try{if(a=d(a,b),typeof a!==w)return i[e]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[e]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void u.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)e(a[g[j]],g[j])}}function f(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function g(a){return function(b){a.then(function(a){b(null,a)},b)}}function h(a){return a&&typeof a.subscribe===w}function i(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function j(a){return a&&typeof a.next===w&&typeof a[x]===w}function k(a){a&&u.schedule(function(){throw a})}function l(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),s(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function m(a,b,c){var d=new t;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(m(a.item(e),b,c));else a&&d.add(l(a,b,c));return d}var n=c.Observable,o=(n.prototype,n.fromPromise),p=n.throwError,q=c.AnonymousObservable,r=c.AsyncSubject,s=c.Disposable.create,t=c.CompositeDisposable,u=(c.Scheduler.immediate,c.Scheduler.timeout),v=c.helpers.isScheduler,w=(Array.prototype.slice,"function"),x="throw",y=c.internals.isObject,z=c.spawn=function(a){var b=i(a);return function(c){function e(a,b){u.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2)for(var b=[],i=1,j=arguments.length;j>i;i++)b.push(arguments[i]);if(a)try{c=h[x](a)}catch(k){return e(k)}if(!a)try{c=h.next(b)}catch(k){return e(k)}if(c.done)return e(null,c.value);if(c.value=d(c.value,g),typeof c.value!==w)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var l=!1;try{c.value.call(g,function(){l||(l=!0,f.apply(g,arguments))})}catch(k){u.schedule(function(){l||(l=!0,f.call(g,k))})}}}var g=this,h=a;if(b){for(var i=[],j=0,l=arguments.length;l>j;j++)i.push(arguments[j]);var l=i.length,m=l&&typeof i[l-1]===w;c=m?i.pop():k,h=a.apply(this,i)}else c=c||k;f()}};n.start=function(a,b,c){return A(a,b,c)()};var A=n.toAsync=function(a,b,c){return v(c)||(c=u),function(){var d=arguments,e=new r;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};n.fromCallback=function(a,b,c){return function(){for(var d=[],e=0,f=arguments.length;f>e;e++)d.push(arguments[e]);return new q(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},n.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new q(function(d){function f(a){if(a)return void d.onError(a);for(var b=arguments.length,e=[],f=1;b>f;f++)e[f-1]=arguments[f];if(c){try{e=c(e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},c.config.useNativeEvents=!1,n.fromEvent=function(a,b,d){return a.addListener?B(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new q(function(c){return m(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return c.onError(e)}c.onNext(b)})}).publish().refCount():B(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var B=n.fromEventPattern=function(a,b,c){return new q(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return s(function(){b&&b(e,f)})}).publish().refCount()};return n.startAsync=function(a){var b;try{b=a()}catch(c){return p(c)}return o(b)},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.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c){function d(a,b){return Array.isArray(a)?e.call(b,a):i(a)?z(a.call(b)):j(a)?z(a):h(a)?f(a):isPromise(a)?g(a):typeof a===w?a:y(a)||Array.isArray(a)?e.call(b,a):a}function e(a){var b=this;return function(c){function e(a,e){if(!f)try{if(a=d(a,b),typeof a!==w)return i[e]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[e]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void u.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)e(a[g[j]],g[j])}}function f(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function g(a){return function(b){a.then(function(a){b(null,a)},b)}}function h(a){return a&&typeof a.subscribe===w}function i(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function j(a){return a&&typeof a.next===w&&typeof a[x]===w}function k(a){a&&u.schedule(function(){throw a})}function l(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),s(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function m(a,b,c){var d=new t;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(m(a.item(e),b,c));else a&&d.add(l(a,b,c));return d}var n=c.Observable,o=(n.prototype,n.fromPromise),p=n.throwError,q=c.AnonymousObservable,r=c.AsyncSubject,s=c.Disposable.create,t=c.CompositeDisposable,u=(c.Scheduler.immediate,c.Scheduler.timeout),v=c.helpers.isScheduler,w=(Array.prototype.slice,"function"),x="throw",y=c.internals.isObject,z=c.spawn=function(a){var b=i(a);return function(c){function e(a,b){u.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2)for(var b=[],i=1,j=arguments.length;j>i;i++)b.push(arguments[i]);if(a)try{c=h[x](a)}catch(k){return e(k)}if(!a)try{c=h.next(b)}catch(k){return e(k)}if(c.done)return e(null,c.value);if(c.value=d(c.value,g),typeof c.value!==w)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var l=!1;try{c.value.call(g,function(){l||(l=!0,f.apply(g,arguments))})}catch(k){u.schedule(function(){l||(l=!0,f.call(g,k))})}}}var g=this,h=a;if(b){for(var i=[],j=0,l=arguments.length;l>j;j++)i.push(arguments[j]);var l=i.length,m=l&&typeof i[l-1]===w;c=m?i.pop():k,h=a.apply(this,i)}else c=c||k;f()}};n.start=function(a,b,c){return A(a,b,c)()};var A=n.toAsync=function(a,b,c){return v(c)||(c=u),function(){var d=arguments,e=new r;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};n.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new q(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},n.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new q(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},c.config.useNativeEvents=!1,n.fromEvent=function(a,b,d){return a.addListener?B(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new q(function(c){return m(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return c.onError(e)}c.onNext(b)})}).publish().refCount():B(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var B=n.fromEventPattern=function(a,b,c){return new q(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return s(function(){b&&b(e,f)})}).publish().refCount()};return n.startAsync=function(a){var b;try{b=a()}catch(c){return p(c)}return o(b)},c});
//# sourceMappingURL=rx.async.map
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(ea&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ia)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+ia+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===ga&&d>=ha&&tc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ea)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ga=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Ra(a))return b;Qa.nonEnumArgs&&a.length&&Sa(a)&&(a=Va.call(a));var c=Qa.enumPrototypes&&"function"==typeof a,d=Qa.enumErrorProps&&(a===La||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Qa.nonEnumShadows&&a!==Ma){var f=a.constructor,g=-1,h=xa;if(a===(f&&f.prototype))var i=a===Na?Ha:a===La?Ca:Ia.call(a),j=Pa[i];for(;++g<h;)e=wa[g],j&&j[e]||!Ja.call(a,e)||b.push(e)}return b}function j(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 k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Ia.call(a),h=Ia.call(b);if(g==ya&&(g=Fa),h==ya&&(h=Fa),g!=h)return!1;switch(g){case Aa:case Ba:return+a==+b;case Ea:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ga:case Ha:return a==String(b)}var i=g==za;if(!i){if(g!=Fa||!Qa.nodeClass&&(l(a)||l(b)))return!1;var j=!Qa.argsObject&&Sa(a)?Object:a.constructor,n=!Qa.argsObject&&Sa(b)?Object:b.constructor;if(!(j==n||Ja.call(a,"constructor")&&Ja.call(b,"constructor")||da(j)&&j instanceof j&&da(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),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Ja.call(f,e)?(p++,q=Ja.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Ja.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Ta.apply(this,arguments)}catch(a){return Za.e=a,Za}}function p(a){if(!da(a))throw new TypeError("fn must be a function");return Ta=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this.observer=a,this.a=[],this.isStopped=!1}function w(){this._s=s}function x(){this._s=s,this._l=s.length,this._i=0}function y(a){this._a=a}function z(a){this._a=a,this._l=D(a),this._i=0}function A(a){return"number"==typeof a&&R.isFinite(a)}function B(b){var c,d=b[qa];if(!d&&"string"==typeof b)return c=new w(b),c[qa]();if(!d&&b.length!==a)return c=new y(b),c[qa]();if(!d)throw new TypeError("Object is not iterable");return b[qa]()}function C(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function D(a){var b=+a.length;return isNaN(b)?0:0!==b&&A(b)?(b=C(b)*Math.floor(Math.abs(b)),0>=b?0:b>Vb?Vb:b):b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return Y(a)||(a=sb),new Xb(b,a)}function G(a,b){return new oc(function(c){var d=new jb,e=new kb;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ca(d)&&(d=Pb(d));var g=new jb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function H(a,b){var c=this;return new oc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function I(){return!1}function J(){return[]}function K(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Pb(e)),(ta(e)||sa(e))&&(e=Wb(e)),e}).concatAll()}function L(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function M(a){this.comparer=a,this.set=[]}function N(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function O(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Pb(e)),(ta(e)||sa(e))&&(e=Wb(e)),e}).mergeAll()}function P(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}var Q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},R=Q[typeof window]&&window||this,S=Q[typeof exports]&&exports&&!exports.nodeType&&exports,T=Q[typeof module]&&module&&!module.nodeType&&module,U=T&&T.exports===S&&S,V=Q[typeof global]&&global;!V||V.global!==V&&V.window!==V||(R=V);var W={internals:{},config:{Promise:R.Promise},helpers:{}},X=W.helpers.noop=function(){},Y=(W.helpers.notDefined=function(a){return"undefined"==typeof a},W.helpers.isScheduler=function(a){return a instanceof W.Scheduler}),Z=W.helpers.identity=function(a){return a},$=(W.helpers.pluck=function(a){return function(b){return b[a]}},W.helpers.just=function(a){return function(){return a}},W.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),_=W.helpers.defaultComparer=function(a,b){return Ua(a,b)},aa=W.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ba=(W.helpers.defaultKeySerializer=function(a){return a.toString()},W.helpers.defaultError=function(a){throw a}),ca=W.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},da=(W.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},W.helpers.not=function(a){return!a},W.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ia.call(a)}),a}());W.config.longStackSupport=!1;var ea=!1;try{throw new Error}catch(fa){ea=!!fa.stack}var ga,ha=g(),ia="From previous event:",ja=W.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ja.prototype=Error.prototype;var ka=W.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};ka.prototype=Error.prototype;var la=W.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};la.prototype=Error.prototype;var ma=W.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ma.prototype=Error.prototype;var na=W.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};na.prototype=Error.prototype;var oa=W.helpers.notImplemented=function(){throw new na},pa=W.helpers.notSupported=function(){throw new ma},qa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";R.Set&&"function"==typeof(new R.Set)["@@iterator"]&&(qa="@@iterator");var ra=W.doneEnumerator={done:!0,value:a},sa=W.helpers.isIterable=function(b){return b[qa]!==a},ta=W.helpers.isArrayLike=function(b){return b&&b.length!==a};W.helpers.iterator=qa;var ua,va=W.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},wa=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xa=wa.length,ya="[object Arguments]",za="[object Array]",Aa="[object Boolean]",Ba="[object Date]",Ca="[object Error]",Da="[object Function]",Ea="[object Number]",Fa="[object Object]",Ga="[object RegExp]",Ha="[object String]",Ia=Object.prototype.toString,Ja=Object.prototype.hasOwnProperty,Ka=Ia.call(arguments)==ya,La=Error.prototype,Ma=Object.prototype,Na=String.prototype,Oa=Ma.propertyIsEnumerable;try{ua=!(Ia.call(document)==Fa&&!({toString:0}+""))}catch(fa){ua=!0}var Pa={};Pa[za]=Pa[Ba]=Pa[Ea]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Pa[Aa]=Pa[Ha]={constructor:!0,toString:!0,valueOf:!0},Pa[Ca]=Pa[Da]=Pa[Ga]={constructor:!0,toString:!0},Pa[Fa]={constructor:!0};var Qa={};!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);Qa.enumErrorProps=Oa.call(La,"message")||Oa.call(La,"name"),Qa.enumPrototypes=Oa.call(a,"prototype"),Qa.nonEnumArgs=0!=c,Qa.nonEnumShadows=!/valueOf/.test(b)}(1);var Ra=W.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Sa=function(a){return a&&"object"==typeof a?Ia.call(a)==ya:!1};Ka||(Sa=function(a){return a&&"object"==typeof a?Ja.call(a,"callee"):!1});var Ta,Ua=W.internals.isEqual=function(a,b){return m(a,b,[],[])},Va=({}.hasOwnProperty,Array.prototype.slice),Wa=this.inherits=W.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Xa=W.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Ya=W.internals.addRef=function(a,b){return new oc(function(c){return new cb(b.getDisposable(),a.subscribe(c))})},Za={e:{}};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Va.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(Va.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Va.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 $a=Object("a"),_a="a"!=$a[0]||!(0 in $a);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=_a&&{}.toString.call(this)==Ha?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Da)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=_a&&{}.toString.call(this)==Ha?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Da)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)==za}),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&&d!=1/0&&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}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;xa>e;e++)a.call(c,wa[e])&&f.push(wa[e]);return f}}()),r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var ab=W.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(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,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 r(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=W.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!hb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.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;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var eb=W.Disposable=function(a){this.isDisposed=!1,this.action=a||X};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:X},hb=eb.isDisposable=function(a){return a&&da(a.dispose)},ib=eb.checkDisposed=function(a){if(a.isDisposed)throw new ka},jb=W.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=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},b.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()},a}(),kb=W.SerialDisposable=jb,lb=W.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}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var mb=W.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||aa,this.disposable=new jb};mb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},mb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},mb.prototype.isCancelled=function(){return this.disposable.isDisposed},mb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var nb=W.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=$,a.normalize=function(a){return 0>a&&(a=0),a},a}(),ob=nb.normalize;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),gb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new cb;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),gb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new cb;return d(e),g}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([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,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([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(nb.prototype),function(){nb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},nb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof R.setInterval)throw new ma;b=ob(b);var d=a,e=R.setInterval(function(){d=c(d)},b);return fb(function(){R.clearInterval(e)})}}(nb.prototype),function(a){a.catchError=a["catch"]=function(a){return new wb(this,a)}}(nb.prototype);var pb,qb,rb=(W.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 jb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),nb.immediate=function(){function a(a,b){return b(this,a)}return new nb($,a,pa,pa)}()),sb=nb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new mb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new ab(4),c.enqueue(e);var f=p(a)();if(c=null,f===Za)return q(f.e)}return e.disposable}var c,d=new nb($,b,pa,pa);return d.scheduleRequired=function(){return!c},d}(),tb=function(){var a,b=X;if(R.WScript)a=function(a,b){R.WScript.Sleep(b),a()};else{if(!R.setTimeout)throw new ma;a=R.setTimeout,b=R.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),ub=tb.setTimeout,vb=tb.clearTimeout;!function(){function a(b){if(f)ub(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(qb(b),f=!1,d===Za)return q(d.e)}}}function b(){if(!R.postMessage||R.importScripts)return!1;var a=!1,b=R.onmessage;return R.onmessage=function(){a=!0},R.postMessage("","*"),R.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;qb=function(a){delete e[a]};var g=RegExp("^"+String(Ia).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=V&&U&&V.setImmediate)&&!g.test(h)&&h;if(da(h))pb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))pb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();R.addEventListener?R.addEventListener("message",c,!1):R.attachEvent("onmessage",c,!1),pb=function(a){var b=d++;return e[b]=a,R.postMessage(i+currentId,"*"),b}}else if(R.MessageChannel){var j=new R.MessageChannel;j.port1.onmessage=function(b){a(b.data)},pb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else pb="document"in R&&"onreadystatechange"in R.document.createElement("script")?function(b){var c=R.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},R.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,ub(function(){a(c)},0),c}}();var wb=(nb.timeout=nb["default"]=function(){function a(a,b){var c=this,d=new jb,e=pb(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=nb.normalize(b);if(0===e)return d.scheduleWithState(a,c);var f=new jb,g=ub(function(){f.isDisposed||f.setDisposable(c(d,a))},e);return new cb(f,fb(function(){vb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new nb($,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 Wa(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 jb;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}(nb)),xb=W.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}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 Y(a)||(a=rb),new oc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),yb=xb.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){return new xb("N",d,null,a,b,c)}}(),zb=xb.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){return new xb("E",null,d,a,b,c)}}(),Ab=xb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new xb("C",null,null,a,b,c)}}(),Bb=W.internals.Enumerator=function(a){this._next=a};Bb.prototype.next=function(){return this._next()},Bb.prototype[qa]=function(){return this};var Cb=W.internals.Enumerable=function(a){this._iterator=a};Cb.prototype[qa]=function(){return this._iterator()},Cb.prototype.concat=function(){var a=this;return new oc(function(b){var c,d=a[qa](),e=new kb,f=rb.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;ca(h)&&(h=Pb(h));var i=new jb;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new cb(e,f,fb(function(){c=!0}))})},Cb.prototype.catchError=function(){var a=this;return new oc(function(b){var c,d=a[qa](),e=new kb,f=rb.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;ca(i)&&(i=Pb(i));var j=new jb;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new cb(e,f,fb(function(){c=!0}))})},Cb.prototype.catchErrorWhen=function(a){var b=this;return new oc(function(c){var d,e,f=new rc,g=new rc,h=a(f),i=h.subscribe(g),j=b[qa](),k=new kb,l=rb.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;ca(i)&&(i=Pb(i));var l=new jb,m=new jb;k.setDisposable(new cb(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new cb(i,k,l,fb(function(){d=!0}))})};var Db=Cb.repeat=function(a,b){return null==b&&(b=-1),new Cb(function(){var c=b;return new Bb(function(){return 0===c?ra:(c>0&&c--,{done:!1,value:a})})})},Eb=Cb.of=function(a,b,c){if(b)var d=va(b,c,3);return new Cb(function(){var c=-1;return new Bb(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:ra})})},Fb=W.Observer=function(){};Fb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Fb.prototype.asObserver=function(){return new Jb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Fb.prototype.checked=function(){return new Kb(this)};var Gb=Fb.create=function(a,b,c){return a||(a=X),b||(b=ba),c||(c=X),new Jb(a,b,c)};Fb.fromNotifier=function(a,b){return new Jb(function(c){return a.call(b,yb(c))},function(c){return a.call(b,zb(c))},function(){return a.call(b,Ab())})},Fb.prototype.notifyOn=function(a){return new Mb(a,this)},Fb.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Hb,Ib=W.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Wa(b,a),b.prototype.next=oa,b.prototype.error=oa,b.prototype.completed=oa,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}(Fb),Jb=W.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Wa(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}(Ib),Kb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Wa(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Za&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Za&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Za&&q(a.e)},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}(Fb),Lb=W.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 kb}return Wa(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}(Ib),Mb=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Wa(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}(Lb),Nb=W.Observable=function(){function a(a){if(W.config.longStackSupport&&ea){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Hb=a.prototype,Hb.subscribe=Hb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Gb(a,b,c))},Hb.subscribeOnNext=function(a,b){return this._subscribe(Gb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Hb.subscribeOnError=function(a,b){return this._subscribe(Gb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Hb.subscribeOnCompleted=function(a,b){return this._subscribe(Gb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Ob=W.ObservableBase=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?fb(a):gb}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(a){var b=new pc(a),d=[b,this];return sb.scheduleRequired()?sb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Wa(e,a),e.prototype.subscribeCore=oa,e}(Nb);Hb.observeOn=function(a){var b=this;return new oc(function(c){return b.subscribe(new Mb(a,c))},b)},Hb.subscribeOn=function(a){var b=this;return new oc(function(c){var d=new jb,e=new kb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Pb=Nb.fromPromise=function(a){return Rb(function(){var b=new W.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};Hb.toPromise=function(a){if(a||(a=W.config.Promise),!a)throw new ma("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)})})};var Qb=function(a){function b(b){this.source=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new v(a))},b}(Ob);v.prototype.onNext=function(a){this.isStopped||this.a.push(a)},v.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},v.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},v.prototype.dispose=function(){this.isStopped=!0},v.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,
this.observer.onError(a),!0)},Hb.toArray=function(){return new Qb(this)},Nb.create=Nb.createWithDisposable=function(a,b){return new oc(a,b)};var Rb=Nb.defer=function(a){return new oc(function(b){var c;try{c=a()}catch(d){return bc(d).subscribe(b)}return ca(c)&&(c=Pb(c)),c.subscribe(b)})},Sb=Nb.empty=function(a){return Y(a)||(a=rb),new oc(function(b){return a.scheduleWithState(null,function(){b.onCompleted()})})},Tb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new Ub(a,this);return b.run()},b}(Ob),Ub=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=B(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Vb=Math.pow(2,53)-1;w.prototype[qa]=function(){return new x(this._s)},x.prototype[qa]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ra},y.prototype[qa]=function(){return new z(this._a)},z.prototype[qa]=function(){return this},z.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ra};var Wb=Nb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!da(b))throw new Error("mapFn when provided must be a function");if(b)var e=va(b,c,2);return Y(d)||(d=sb),new Tb(a,e,d)},Xb=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Ob);E.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Yb=Nb.fromArray=function(a,b){return Y(b)||(b=sb),new Xb(a,b)};Nb.generate=function(a,b,c,d,e){return Y(e)||(e=sb),new oc(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return void f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var Zb=Nb.never=function(){return new oc(function(){return gb})};Nb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Xb(b,sb)},Nb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Xb(c,a)},Nb.pairs=function(a,b){return b||(b=W.Scheduler.currentThread),new oc(function(c){var d=Object.keys(a),e=d.length;return b.scheduleRecursiveWithState(0,function(b,f){if(e>b){var g=d[b];c.onNext([g,a[g]]),f(b+1)}else c.onCompleted()})})};var $b=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new _b(a,this);return b.run()},b}(Ob),_b=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.count,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Nb.range=function(a,b,c){return Y(c)||(c=sb),new $b(a,b,c)},Nb.repeat=function(a,b,c){return Y(c)||(c=sb),ac(a,c).repeat(null==b?-1:b)};var ac=Nb["return"]=Nb.just=Nb.returnValue=function(a,b){return Y(b)||(b=rb),new oc(function(c){return b.scheduleWithState(a,function(a,b){c.onNext(b),c.onCompleted()})})},bc=Nb["throw"]=Nb.throwError=function(a,b){return Y(b)||(b=rb),new oc(function(c){return b.schedule(function(){c.onError(a)})})};Nb.throwException=function(){return Nb.throwError.apply(null,arguments)},Nb.using=function(a,b){return new oc(function(c){var d,e,f=gb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new cb(bc(g).subscribe(c),f)}return new cb(e.subscribe(c),f)})},Hb.amb=function(a){var b=this;return new oc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new jb,j=new jb;return ca(a)&&(a=Pb(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)})},Nb.amb=function(){function a(a,b){return a.amb(b)}var b=Zb(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Hb["catch"]=Hb.catchError=Hb.catchException=function(a){return"function"==typeof a?G(this,a):cc([this,a])};var cc=Nb.catchError=Nb["catch"]=Nb.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Eb(a).catchError()};Hb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),dc.apply(this,b)};var dc=Nb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new oc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Z))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Z)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new jb;ca(f)&&(f=Pb(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new cb(l)},this)};Hb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),ec.apply(null,a)};var ec=Nb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return Eb(a).concat()};Hb.concatAll=Hb.concatObservable=function(){return this.merge(1)};var fc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new cb;return b.add(this.source.subscribe(new gc(a,this.maxConcurrent,b))),b},b}(Ob),gc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new jb;this.g.add(c),ca(a)&&(a=Pb(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Hb.merge=function(a){return"number"!=typeof a?hc(this,a):new fc(this,a)};var hc=Nb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Y(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=rb,b=0;d>b;b++)c.push(arguments[b]);else for(a=rb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),F(a,c).mergeAll()},ic=function(a){function b(b){this.source=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new cb,c=new jb;return b.add(c),c.setDisposable(this.source.subscribe(new jc(a,b))),b},b}(Ob),jc=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype.onNext=function(a){if(!this.isStopped){var c=new jb;this.g.add(c),ca(a)&&(a=Pb(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Hb.mergeAll=Hb.mergeObservable=function(){return new ic(this)};var kc=W.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};kc.prototype=Error.prototype,Nb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=F(null,a);return new oc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new kc(g))}var c=new cb,e=new jb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new jb;c.add(e),ca(d)&&(d=Pb(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},Hb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return lc([this,a])};var lc=Nb.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new oc(function(b){var c=0,d=new kb,e=rb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ca(f)&&(f=Pb(f)),g=new jb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new cb(d,e)})};Hb.skipUntil=function(a){var b=this;return new oc(function(c){var d=!1,e=new cb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ca(a)&&(a=Pb(a));var f=new jb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},Hb["switch"]=Hb.switchLatest=function(){var a=this;return new oc(function(b){var c=!1,d=new kb,e=!1,f=0,g=a.subscribe(function(a){var g=new jb,h=++f;c=!0,d.setDisposable(g),ca(a)&&(a=Pb(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())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new cb(g,d)},a)},Hb.takeUntil=function(a){var b=this;return new oc(function(c){return ca(a)&&(a=Pb(a)),new cb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},X))},b)},Hb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new oc(function(a){for(var c=function(){return!1},f=b.length,g=n(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=b[c],e=new jb;ca(d)&&(d=Pb(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Z)},a.onError.bind(a),function(){})),j[c]=e}(k);var l=new jb;return l.setDisposable(e.subscribe(function(b){var c,e=[b].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void a.onError(f)}a.onNext(c)}},a.onError.bind(a),function(){a.onCompleted()})),j[f]=l,new cb(j)},this)},Hb.zip=function(){if(Array.isArray(arguments[0]))return H.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new oc(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=n(g,J),i=n(g,I),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new jb;ca(e)&&(e=Pb(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new cb(j)},d)},Nb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Nb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new oc(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(Z))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Z)?void b.onCompleted():void 0}for(var e=a.length,f=n(e,function(){return[]}),g=n(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new jb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},function(a){b.onError(a)},function(){d(e)}))}(i);return new cb(h)})},Hb.asObservable=function(){var a=this;return new oc(function(b){return a.subscribe(b)},this)},Hb.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})},Hb.dematerialize=function(){var a=this;return new oc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Hb.distinctUntilChanged=function(a,b){var c=this;return b||(b=_),new oc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},Hb["do"]=Hb.tap=Hb.doAction=function(a,b,c){var d=this;return new oc(function(e){var f=!a||da(a)?Gb(a||X,b||X,c||X):a;return d.subscribe(function(a){try{f.onNext(a)}catch(b){e.onError(b)}e.onNext(a)},function(a){try{f.onError(a)}catch(b){e.onError(b)}e.onError(a)},function(){try{f.onCompleted()}catch(a){e.onError(a)}e.onCompleted()})},this)},Hb.doOnNext=Hb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Hb.doOnError=Hb.tapOnError=function(a,b){return this.tap(X,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Hb.doOnCompleted=Hb.tapOnCompleted=function(a,b){return this.tap(X,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Hb["finally"]=Hb.ensure=function(a){var b=this;return new oc(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()}})},this)},Hb.finallyAction=function(a){return this.ensure(a)},Hb.ignoreElements=function(){var a=this;return new oc(function(b){return a.subscribe(X,function(a){b.onError(a)},function(){b.onCompleted()})},a)},Hb.materialize=function(){var a=this;return new oc(function(b){return a.subscribe(function(a){b.onNext(yb(a))},function(a){b.onNext(zb(a)),b.onCompleted()},function(){b.onNext(Ab()),b.onCompleted()})},a)},Hb.repeat=function(a){return Db(this,a).concat()},Hb.retry=function(a){return Db(this,a).catchError()},Hb.retryWhen=function(a){return Db(this).catchErrorWhen(a)},Hb.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 oc(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)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},Hb.skipLast=function(a){if(0>a)throw new la;var b=this;return new oc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Hb.startWith=function(){var a,b=0;arguments.length&&Y(arguments[0])?(a=arguments[0],b=1):a=rb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Eb([Yb(c,a),this]).concat()},Hb.takeLast=function(a){if(0>a)throw new la;var b=this;return new oc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Hb.takeLastBuffer=function(a){var b=this;return new oc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},Hb.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new la;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new la;return new oc(function(d){function e(){var a=new rc;i.push(a),d.onNext(Ya(a,g))}var f=new jb,g=new lb(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},c)},Hb.selectConcat=Hb.concatMap=function(a,b,c){return da(a)&&da(b)?this.concatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Pb(e)),(ta(e)||sa(e))&&(e=Wb(e)),e.map(function(a,e){return b(c,a,d,e)})}):da(a)?K(this,a,c):K(this,function(){return a})},Hb.concatMapObserver=Hb.selectConcatObserver=function(a,b,c,d){var e=this,f=va(a,d,2),g=va(b,d,1),h=va(c,d,0);return new oc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ca(d)&&(d=Pb(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ca(c)&&(c=Pb(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ca(b)&&(b=Pb(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Hb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new oc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},M.prototype.push=function(a){var b=-1===L(this.set,a,this.comparer);return b&&this.set.push(a),b},Hb.distinct=function(a,b){var c=this;return b||(b=_),new oc(function(d){var e=new M(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)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var mc=function(a){function b(b,c,d){this.source=b,this.selector=va(c,d,3),a.call(this)}return Wa(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a.call(this,d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new N(a,this.selector,this))},b}(Ob);N.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector).call(this,a,this.i++,this.source);return b===Za?this.observer.onError(b.e):void this.observer.onNext(b)}},N.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},N.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},N.prototype.dispose=function(){this.isStopped=!0},N.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Hb.map=Hb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof mc?this.internalMap(c,b):new mc(this,c,b)},Hb.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Hb.selectMany=Hb.flatMap=function(a,b,c){return da(a)&&da(b)?this.flatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Pb(e)),(ta(e)||sa(e))&&(e=Wb(e)),e.map(function(a,e){return b(c,a,d,e)})},c):da(a)?O(this,a,c):O(this,function(){return a})},Hb.flatMapObserver=Hb.selectManyObserver=function(a,b,c,d){var e=this;return new oc(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)}ca(c)&&(c=Pb(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ca(c)&&(c=Pb(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ca(a)&&(a=Pb(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Hb.selectSwitch=Hb.flatMapLatest=Hb.switchMap=function(a,b){return this.select(a,b).switchLatest()},Hb.skip=function(a){if(0>a)throw new la;var b=this;return new oc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Hb.skipWhile=function(a,b){var c=this,d=va(a,b,3);return new oc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Hb.take=function(a,b){if(0>a)throw new la;if(0===a)return Sb(b);var c=this;return new oc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Hb.takeWhile=function(a,b){var c=this,d=va(a,b,3);return new oc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var nc=function(a){function b(b,c,d){this.source=b,this.predicate=va(c,d,3),a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new P(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a.call(this,b,c,e)},c)},b}(Ob);P.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate).call(this,a,this.i++,this.source);return b===Za?this.observer.onError(b.e):void(b&&this.observer.onNext(a))}},P.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},P.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},P.prototype.dispose=function(){this.isStopped=!0},P.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Hb.filter=Hb.where=function(a,b){return this instanceof nc?this.internalFilter(a,b):new nc(this,a,b)},Hb.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 oc(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)})},c)};var oc=W.AnonymousObservable=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?fb(a):gb}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(b,d){function e(a){var d=new pc(a),e=[d,b];return sb.scheduleRequired()?sb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Wa(d,a),d}(Nb),pc=function(a){function b(b){a.call(this),this.observer=b,this.m=new jb}Wa(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===Za&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Za&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Za&&q(a.e)},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}(Ib),qc=function(a,b){this.subject=a,this.observer=b};qc.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 rc=W.Subject=function(a){function c(a){return ib(this),this.isStopped?this.hasError?(a.onError(this.error),gb):(a.onCompleted(),gb):(this.observers.push(a),new qc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Fb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(ib(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(ib(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(ib(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new sc(a,b)},d}(Nb),sc=(W.AsyncSubject=function(a){function c(a){return ib(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),gb):(this.observers.push(a),new qc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Fb,{hasObservers:function(){return ib(this),this.observers.length>0},onCompleted:function(){var a,c;if(ib(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(ib(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){ib(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Nb),W.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Wa(c,a),Xa(c.prototype,Fb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Nb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(R.Rx=W,define(function(){return W})):S&&T?U?(T.exports=W).Rx=W:S.Rx=W:R.Rx=W;var tc=g()}).call(this);
this.observer.onError(a),!0)},Hb.toArray=function(){return new Qb(this)},Nb.create=Nb.createWithDisposable=function(a,b){return new oc(a,b)};var Rb=Nb.defer=function(a){return new oc(function(b){var c;try{c=a()}catch(d){return bc(d).subscribe(b)}return ca(c)&&(c=Pb(c)),c.subscribe(b)})},Sb=Nb.empty=function(a){return Y(a)||(a=rb),new oc(function(b){return a.scheduleWithState(null,function(){b.onCompleted()})})},Tb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new Ub(a,this);return b.run()},b}(Ob),Ub=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=B(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Vb=Math.pow(2,53)-1;w.prototype[qa]=function(){return new x(this._s)},x.prototype[qa]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ra},y.prototype[qa]=function(){return new z(this._a)},z.prototype[qa]=function(){return this},z.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ra};var Wb=Nb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!da(b))throw new Error("mapFn when provided must be a function");if(b)var e=va(b,c,2);return Y(d)||(d=sb),new Tb(a,e,d)},Xb=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Ob);E.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Yb=Nb.fromArray=function(a,b){return Y(b)||(b=sb),new Xb(a,b)};Nb.generate=function(a,b,c,d,e){return Y(e)||(e=sb),new oc(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var Zb=Nb.never=function(){return new oc(function(){return gb})};Nb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Xb(b,sb)},Nb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Xb(c,a)},Nb.pairs=function(a,b){return b||(b=W.Scheduler.currentThread),new oc(function(c){var d=Object.keys(a),e=d.length;return b.scheduleRecursiveWithState(0,function(b,f){if(e>b){var g=d[b];c.onNext([g,a[g]]),f(b+1)}else c.onCompleted()})})};var $b=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new _b(a,this);return b.run()},b}(Ob),_b=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.count,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Nb.range=function(a,b,c){return Y(c)||(c=sb),new $b(a,b,c)},Nb.repeat=function(a,b,c){return Y(c)||(c=sb),ac(a,c).repeat(null==b?-1:b)};var ac=Nb["return"]=Nb.just=Nb.returnValue=function(a,b){return Y(b)||(b=rb),new oc(function(c){return b.scheduleWithState(a,function(a,b){c.onNext(b),c.onCompleted()})})},bc=Nb["throw"]=Nb.throwError=function(a,b){return Y(b)||(b=rb),new oc(function(c){return b.schedule(function(){c.onError(a)})})};Nb.throwException=function(){return Nb.throwError.apply(null,arguments)},Nb.using=function(a,b){return new oc(function(c){var d,e,f=gb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new cb(bc(g).subscribe(c),f)}return new cb(e.subscribe(c),f)})},Hb.amb=function(a){var b=this;return new oc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new jb,j=new jb;return ca(a)&&(a=Pb(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)})},Nb.amb=function(){function a(a,b){return a.amb(b)}var b=Zb(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Hb["catch"]=Hb.catchError=Hb.catchException=function(a){return"function"==typeof a?G(this,a):cc([this,a])};var cc=Nb.catchError=Nb["catch"]=Nb.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Eb(a).catchError()};Hb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),dc.apply(this,b)};var dc=Nb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new oc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Z))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Z)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new jb;ca(f)&&(f=Pb(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new cb(l)},this)};Hb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),ec.apply(null,a)};var ec=Nb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return Eb(a).concat()};Hb.concatAll=Hb.concatObservable=function(){return this.merge(1)};var fc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new cb;return b.add(this.source.subscribe(new gc(a,this.maxConcurrent,b))),b},b}(Ob),gc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new jb;this.g.add(c),ca(a)&&(a=Pb(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Hb.merge=function(a){return"number"!=typeof a?hc(this,a):new fc(this,a)};var hc=Nb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Y(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=rb,b=0;d>b;b++)c.push(arguments[b]);else for(a=rb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),F(a,c).mergeAll()},ic=function(a){function b(b){this.source=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new cb,c=new jb;return b.add(c),c.setDisposable(this.source.subscribe(new jc(a,b))),b},b}(Ob),jc=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype.onNext=function(a){if(!this.isStopped){var c=new jb;this.g.add(c),ca(a)&&(a=Pb(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Hb.mergeAll=Hb.mergeObservable=function(){return new ic(this)};var kc=W.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};kc.prototype=Error.prototype,Nb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=F(null,a);return new oc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new kc(g))}var c=new cb,e=new jb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new jb;c.add(e),ca(d)&&(d=Pb(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},Hb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return lc([this,a])};var lc=Nb.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new oc(function(b){var c=0,d=new kb,e=rb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ca(f)&&(f=Pb(f)),g=new jb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new cb(d,e)})};Hb.skipUntil=function(a){var b=this;return new oc(function(c){var d=!1,e=new cb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ca(a)&&(a=Pb(a));var f=new jb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},Hb["switch"]=Hb.switchLatest=function(){var a=this;return new oc(function(b){var c=!1,d=new kb,e=!1,f=0,g=a.subscribe(function(a){var g=new jb,h=++f;c=!0,d.setDisposable(g),ca(a)&&(a=Pb(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())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new cb(g,d)},a)},Hb.takeUntil=function(a){var b=this;return new oc(function(c){return ca(a)&&(a=Pb(a)),new cb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},X))},b)},Hb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new oc(function(a){for(var c=function(){return!1},f=b.length,g=n(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=b[c],e=new jb;ca(d)&&(d=Pb(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Z)},a.onError.bind(a),function(){})),j[c]=e}(k);var l=new jb;return l.setDisposable(e.subscribe(function(b){var c,e=[b].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void a.onError(f)}a.onNext(c)}},a.onError.bind(a),function(){a.onCompleted()})),j[f]=l,new cb(j)},this)},Hb.zip=function(){if(Array.isArray(arguments[0]))return H.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new oc(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=n(g,J),i=n(g,I),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new jb;ca(e)&&(e=Pb(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new cb(j)},d)},Nb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Nb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new oc(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(Z))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Z)?void b.onCompleted():void 0}for(var e=a.length,f=n(e,function(){return[]}),g=n(e,function(){return!1}),h=new Array(e),i=0;e>i;i++)!function(e){h[e]=new jb,h[e].setDisposable(a[e].subscribe(function(a){f[e].push(a),c(e)},function(a){b.onError(a)},function(){d(e)}))}(i);return new cb(h)})},Hb.asObservable=function(){var a=this;return new oc(function(b){return a.subscribe(b)},this)},Hb.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})},Hb.dematerialize=function(){var a=this;return new oc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Hb.distinctUntilChanged=function(a,b){var c=this;return b||(b=_),new oc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},Hb["do"]=Hb.tap=Hb.doAction=function(a,b,c){var d=this;return new oc(function(e){var f=!a||da(a)?Gb(a||X,b||X,c||X):a;return d.subscribe(function(a){try{f.onNext(a)}catch(b){e.onError(b)}e.onNext(a)},function(a){try{f.onError(a)}catch(b){e.onError(b)}e.onError(a)},function(){try{f.onCompleted()}catch(a){e.onError(a)}e.onCompleted()})},this)},Hb.doOnNext=Hb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Hb.doOnError=Hb.tapOnError=function(a,b){return this.tap(X,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Hb.doOnCompleted=Hb.tapOnCompleted=function(a,b){return this.tap(X,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Hb["finally"]=Hb.ensure=function(a){var b=this;return new oc(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()}})},this)},Hb.finallyAction=function(a){return this.ensure(a)},Hb.ignoreElements=function(){var a=this;return new oc(function(b){return a.subscribe(X,function(a){b.onError(a)},function(){b.onCompleted()})},a)},Hb.materialize=function(){var a=this;return new oc(function(b){return a.subscribe(function(a){b.onNext(yb(a))},function(a){b.onNext(zb(a)),b.onCompleted()},function(){b.onNext(Ab()),b.onCompleted()})},a)},Hb.repeat=function(a){return Db(this,a).concat()},Hb.retry=function(a){return Db(this,a).catchError()},Hb.retryWhen=function(a){return Db(this).catchErrorWhen(a)},Hb.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 oc(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)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},Hb.skipLast=function(a){if(0>a)throw new la;var b=this;return new oc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Hb.startWith=function(){var a,b=0;arguments.length&&Y(arguments[0])?(a=arguments[0],b=1):a=rb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Eb([Yb(c,a),this]).concat()},Hb.takeLast=function(a){if(0>a)throw new la;var b=this;return new oc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Hb.takeLastBuffer=function(a){var b=this;return new oc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},Hb.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new la;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new la;return new oc(function(d){function e(){var a=new rc;i.push(a),d.onNext(Ya(a,g))}var f=new jb,g=new lb(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},c)},Hb.selectConcat=Hb.concatMap=function(a,b,c){return da(a)&&da(b)?this.concatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Pb(e)),(ta(e)||sa(e))&&(e=Wb(e)),e.map(function(a,e){return b(c,a,d,e)})}):da(a)?K(this,a,c):K(this,function(){return a})},Hb.concatMapObserver=Hb.selectConcatObserver=function(a,b,c,d){var e=this,f=va(a,d,2),g=va(b,d,1),h=va(c,d,0);return new oc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ca(d)&&(d=Pb(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ca(c)&&(c=Pb(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ca(b)&&(b=Pb(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Hb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new oc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},M.prototype.push=function(a){var b=-1===L(this.set,a,this.comparer);return b&&this.set.push(a),b},Hb.distinct=function(a,b){var c=this;return b||(b=_),new oc(function(d){var e=new M(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)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var mc=function(a){function b(b,c,d){this.source=b,this.selector=va(c,d,3),a.call(this)}return Wa(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a.call(this,d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new N(a,this.selector,this))},b}(Ob);N.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector).call(this,a,this.i++,this.source);return b===Za?this.observer.onError(b.e):void this.observer.onNext(b)}},N.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},N.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},N.prototype.dispose=function(){this.isStopped=!0},N.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Hb.map=Hb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof mc?this.internalMap(c,b):new mc(this,c,b)},Hb.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Hb.selectMany=Hb.flatMap=function(a,b,c){return da(a)&&da(b)?this.flatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Pb(e)),(ta(e)||sa(e))&&(e=Wb(e)),e.map(function(a,e){return b(c,a,d,e)})},c):da(a)?O(this,a,c):O(this,function(){return a})},Hb.flatMapObserver=Hb.selectManyObserver=function(a,b,c,d){var e=this;return new oc(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)}ca(c)&&(c=Pb(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ca(c)&&(c=Pb(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ca(a)&&(a=Pb(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Hb.selectSwitch=Hb.flatMapLatest=Hb.switchMap=function(a,b){return this.select(a,b).switchLatest()},Hb.skip=function(a){if(0>a)throw new la;var b=this;return new oc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Hb.skipWhile=function(a,b){var c=this,d=va(a,b,3);return new oc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Hb.take=function(a,b){if(0>a)throw new la;if(0===a)return Sb(b);var c=this;return new oc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Hb.takeWhile=function(a,b){var c=this,d=va(a,b,3);return new oc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var nc=function(a){function b(b,c,d){this.source=b,this.predicate=va(c,d,3),a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new P(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a.call(this,b,c,e)},c)},b}(Ob);P.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate).call(this,a,this.i++,this.source);return b===Za?this.observer.onError(b.e):void(b&&this.observer.onNext(a))}},P.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},P.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},P.prototype.dispose=function(){this.isStopped=!0},P.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Hb.filter=Hb.where=function(a,b){return this instanceof nc?this.internalFilter(a,b):new nc(this,a,b)},Hb.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 oc(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)})},c)};var oc=W.AnonymousObservable=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?fb(a):gb}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(b,d){function e(a){var d=new pc(a),e=[d,b];return sb.scheduleRequired()?sb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Wa(d,a),d}(Nb),pc=function(a){function b(b){a.call(this),this.observer=b,this.m=new jb}Wa(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===Za&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Za&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Za&&q(a.e)},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}(Ib),qc=function(a,b){this.subject=a,this.observer=b};qc.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 rc=W.Subject=function(a){function c(a){return ib(this),this.isStopped?this.hasError?(a.onError(this.error),gb):(a.onCompleted(),gb):(this.observers.push(a),new qc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Fb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(ib(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(ib(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(ib(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new sc(a,b)},d}(Nb),sc=(W.AsyncSubject=function(a){function c(a){return ib(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),gb):(this.observers.push(a),new qc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Fb,{hasObservers:function(){return ib(this),this.observers.length>0},onCompleted:function(){var a,c;if(ib(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(ib(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){ib(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Nb),W.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Wa(c,a),Xa(c.prototype,Fb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Nb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(R.Rx=W,define(function(){return W})):S&&T?U?(T.exports=W).Rx=W:S.Rx=W:R.Rx=W;var tc=g()}).call(this);
//# sourceMappingURL=rx.compat.map

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

} else if (typeof module === 'object' && module && module.exports === freeExports) {
module.exports = factory(root, module.exports, require('./rx-lite-compat'));
module.exports = factory(root, module.exports, require('rx-lite-compat'));
} else {

@@ -279,4 +279,3 @@ root.Rx = factory(root, {}, root.Rx);

} catch (e) {
o.onError(e);
return;
return o.onError(e);
}

@@ -283,0 +282,0 @@ if (hasResult) {

/* 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-lite-compat"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx-lite-compat")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function f(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}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.AnonymousObserver,o=c.Notification.createOnNext,p=c.Notification.createOnError,q=c.Notification.createOnCompleted,r=c.Observer,s=c.Subject,t=c.internals,u=c.helpers,v=t.ScheduledObserver,w=c.SerialDisposable,x=c.SingleAssignmentDisposable,y=c.CompositeDisposable,z=c.RefCountDisposable,A=c.Disposable.empty,B=c.Scheduler.immediate,C=(u.defaultKeySerializer,c.internals.addRef),D=(u.identity,u.isPromise),E=t.inherits,F=t.bindCallback,G=(u.noop,u.isScheduler),H=i.fromPromise,I=c.ArgumentOutOfRangeError;e.prototype.dispose=function(){this.scheduler.scheduleWithState(this,f)};var J=function(a){function b(b){a.call(this),this._observer=b,this._state=0}E(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=tryCatch(this._observer.onNext).call(this._observer,a);this._state=0,b===errorObj&&thrower(b.e)},c.onError=function(a){this.checkAccess();var b=tryCatch(this._observer.onError).call(this._observer,a);this._state=2,b===errorObj&&thrower(b.e)},c.onCompleted=function(){this.checkAccess();var a=tryCatch(this._observer.onCompleted).call(this._observer);this._state=2,a===errorObj&&thrower(a.e)},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}(r),K=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return E(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}(v);r.prototype.checked=function(){return new J(this)},r.notifyOn=function(a){return new K(a,this)},r.fromNotifier=function(a,b){var c=F(a,b,1);return new n(function(a){return c(o(a))},function(a){return c(p(a))},function(){return c(q())})},r.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},r.prototype.asObserver=function(){var a=this;return new n(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new K(a,c))},b)},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new x,f=new w;return f.setDisposable(d),d.setDisposable(a.schedule(function(){f.setDisposable(new e(a,b.subscribe(c)))})),f},b)},i.generate=function(a,b,c,d,e){return G(e)||(e=currentThreadScheduler),new m(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return void f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=A;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new y(l(g).subscribe(c),f)}return new y(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 x,j=new x;return D(a)&&(a=H(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 y(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}var b=k(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return L([this,a])};var L=i.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new m(function(b){var c=0,d=new w,e=B.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],D(f)&&(f=H(f)),g=new x,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new y(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),Math.abs(a)===1/0&&(a=0),0>=a)throw new I;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new I;return new m(function(d){function e(){var a=new s;i.push(a),d.onNext(C(a,g))}var f=new x,g=new z(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},c)},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()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},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)},function(a){c.onError(a)},function(){!d&&c.onNext(a),c.onCompleted()})},b)},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)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},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-lite-compat"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("rx-lite-compat")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function f(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}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.AnonymousObserver,o=c.Notification.createOnNext,p=c.Notification.createOnError,q=c.Notification.createOnCompleted,r=c.Observer,s=c.Subject,t=c.internals,u=c.helpers,v=t.ScheduledObserver,w=c.SerialDisposable,x=c.SingleAssignmentDisposable,y=c.CompositeDisposable,z=c.RefCountDisposable,A=c.Disposable.empty,B=c.Scheduler.immediate,C=(u.defaultKeySerializer,c.internals.addRef),D=(u.identity,u.isPromise),E=t.inherits,F=t.bindCallback,G=(u.noop,u.isScheduler),H=i.fromPromise,I=c.ArgumentOutOfRangeError;e.prototype.dispose=function(){this.scheduler.scheduleWithState(this,f)};var J=function(a){function b(b){a.call(this),this._observer=b,this._state=0}E(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=tryCatch(this._observer.onNext).call(this._observer,a);this._state=0,b===errorObj&&thrower(b.e)},c.onError=function(a){this.checkAccess();var b=tryCatch(this._observer.onError).call(this._observer,a);this._state=2,b===errorObj&&thrower(b.e)},c.onCompleted=function(){this.checkAccess();var a=tryCatch(this._observer.onCompleted).call(this._observer);this._state=2,a===errorObj&&thrower(a.e)},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}(r),K=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return E(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}(v);r.prototype.checked=function(){return new J(this)},r.notifyOn=function(a){return new K(a,this)},r.fromNotifier=function(a,b){var c=F(a,b,1);return new n(function(a){return c(o(a))},function(a){return c(p(a))},function(){return c(q())})},r.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},r.prototype.asObserver=function(){var a=this;return new n(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new K(a,c))},b)},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new x,f=new w;return f.setDisposable(d),d.setDisposable(a.schedule(function(){f.setDisposable(new e(a,b.subscribe(c)))})),f},b)},i.generate=function(a,b,c,d,e){return G(e)||(e=currentThreadScheduler),new m(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=A;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new y(l(g).subscribe(c),f)}return new y(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 x,j=new x;return D(a)&&(a=H(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 y(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}var b=k(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return L([this,a])};var L=i.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new m(function(b){var c=0,d=new w,e=B.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],D(f)&&(f=H(f)),g=new x,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new y(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),Math.abs(a)===1/0&&(a=0),0>=a)throw new I;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new I;return new m(function(d){function e(){var a=new s;i.push(a),d.onNext(C(a,g))}var f=new x,g=new z(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},c)},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()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},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)},function(a){c.onError(a)},function(){!d&&c.onNext(a),c.onCompleted()})},b)},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)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},c});
//# sourceMappingURL=rx.lite.extras.compat.map

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

} catch (e) {
o.onError(e);
return;
return o.onError(e);
}

@@ -282,0 +281,0 @@ if (hasResult) {

/* 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-lite"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("rx-lite")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function f(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}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.AnonymousObserver,o=c.Notification.createOnNext,p=c.Notification.createOnError,q=c.Notification.createOnCompleted,r=c.Observer,s=c.Subject,t=c.internals,u=c.helpers,v=t.ScheduledObserver,w=c.SerialDisposable,x=c.SingleAssignmentDisposable,y=c.CompositeDisposable,z=c.RefCountDisposable,A=c.Disposable.empty,B=c.Scheduler.immediate,C=(u.defaultKeySerializer,c.internals.addRef),D=(u.identity,u.isPromise),E=t.inherits,F=t.bindCallback,G=(u.noop,u.isScheduler),H=i.fromPromise,I=c.ArgumentOutOfRangeError;e.prototype.dispose=function(){this.scheduler.scheduleWithState(this,f)};var J=function(a){function b(b){a.call(this),this._observer=b,this._state=0}E(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=tryCatch(this._observer.onNext).call(this._observer,a);this._state=0,b===errorObj&&thrower(b.e)},c.onError=function(a){this.checkAccess();var b=tryCatch(this._observer.onError).call(this._observer,a);this._state=2,b===errorObj&&thrower(b.e)},c.onCompleted=function(){this.checkAccess();var a=tryCatch(this._observer.onCompleted).call(this._observer);this._state=2,a===errorObj&&thrower(a.e)},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}(r),K=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return E(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}(v);r.prototype.checked=function(){return new J(this)},r.notifyOn=function(a){return new K(a,this)},r.fromNotifier=function(a,b){var c=F(a,b,1);return new n(function(a){return c(o(a))},function(a){return c(p(a))},function(){return c(q())})},r.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},r.prototype.asObserver=function(){var a=this;return new n(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new K(a,c))},b)},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new x,f=new w;return f.setDisposable(d),d.setDisposable(a.schedule(function(){f.setDisposable(new e(a,b.subscribe(c)))})),f},b)},i.generate=function(a,b,c,d,e){return G(e)||(e=currentThreadScheduler),new m(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return void f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=A;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new y(l(g).subscribe(c),f)}return new y(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 x,j=new x;return D(a)&&(a=H(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 y(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}var b=k(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return L([this,a])};var L=i.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new m(function(b){var c=0,d=new w,e=B.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],D(f)&&(f=H(f)),g=new x,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new y(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),Math.abs(a)===1/0&&(a=0),0>=a)throw new I;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new I;return new m(function(d){function e(){var a=new s;i.push(a),d.onNext(C(a,g))}var f=new x,g=new z(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},c)},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()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},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)},function(a){c.onError(a)},function(){!d&&c.onNext(a),c.onCompleted()})},b)},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)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},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-lite"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("rx-lite")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function f(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}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.AnonymousObserver,o=c.Notification.createOnNext,p=c.Notification.createOnError,q=c.Notification.createOnCompleted,r=c.Observer,s=c.Subject,t=c.internals,u=c.helpers,v=t.ScheduledObserver,w=c.SerialDisposable,x=c.SingleAssignmentDisposable,y=c.CompositeDisposable,z=c.RefCountDisposable,A=c.Disposable.empty,B=c.Scheduler.immediate,C=(u.defaultKeySerializer,c.internals.addRef),D=(u.identity,u.isPromise),E=t.inherits,F=t.bindCallback,G=(u.noop,u.isScheduler),H=i.fromPromise,I=c.ArgumentOutOfRangeError;e.prototype.dispose=function(){this.scheduler.scheduleWithState(this,f)};var J=function(a){function b(b){a.call(this),this._observer=b,this._state=0}E(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=tryCatch(this._observer.onNext).call(this._observer,a);this._state=0,b===errorObj&&thrower(b.e)},c.onError=function(a){this.checkAccess();var b=tryCatch(this._observer.onError).call(this._observer,a);this._state=2,b===errorObj&&thrower(b.e)},c.onCompleted=function(){this.checkAccess();var a=tryCatch(this._observer.onCompleted).call(this._observer);this._state=2,a===errorObj&&thrower(a.e)},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}(r),K=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return E(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}(v);r.prototype.checked=function(){return new J(this)},r.notifyOn=function(a){return new K(a,this)},r.fromNotifier=function(a,b){var c=F(a,b,1);return new n(function(a){return c(o(a))},function(a){return c(p(a))},function(){return c(q())})},r.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},r.prototype.asObserver=function(){var a=this;return new n(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new K(a,c))},b)},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new x,f=new w;return f.setDisposable(d),d.setDisposable(a.schedule(function(){f.setDisposable(new e(a,b.subscribe(c)))})),f},b)},i.generate=function(a,b,c,d,e){return G(e)||(e=currentThreadScheduler),new m(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=A;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new y(l(g).subscribe(c),f)}return new y(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 x,j=new x;return D(a)&&(a=H(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 y(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}var b=k(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return L([this,a])};var L=i.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new m(function(b){var c=0,d=new w,e=B.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],D(f)&&(f=H(f)),g=new x,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new y(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),Math.abs(a)===1/0&&(a=0),0>=a)throw new I;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new I;return new m(function(d){function e(){var a=new s;i.push(a),d.onNext(C(a,g))}var f=new x,g=new z(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},c)},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()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},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)},function(a){c.onError(a)},function(){!d&&c.onNext(a),c.onCompleted()})},b)},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)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},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(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(ka&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(oa)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+oa+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===ma&&d>=na&&Bc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ka)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ma=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Xa(a))return b;Wa.nonEnumArgs&&a.length&&Ya(a)&&(a=ab.call(a));var c=Wa.enumPrototypes&&"function"==typeof a,d=Wa.enumErrorProps&&(a===Ra||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Wa.nonEnumShadows&&a!==Sa){var f=a.constructor,g=-1,h=Da;if(a===(f&&f.prototype))var i=a===Ta?Na:a===Ra?Ia:Oa.call(a),j=Va[i];for(;++g<h;)e=Ca[g],j&&j[e]||!Pa.call(a,e)||b.push(e)}return b}function j(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 k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Oa.call(a),h=Oa.call(b);if(g==Ea&&(g=La),h==Ea&&(h=La),g!=h)return!1;switch(g){case Ga:case Ha:return+a==+b;case Ka:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ma:case Na:return a==String(b)}var i=g==Fa;if(!i){if(g!=La||!Wa.nodeClass&&(l(a)||l(b)))return!1;var j=!Wa.argsObject&&Ya(a)?Object:a.constructor,n=!Wa.argsObject&&Ya(b)?Object:b.constructor;if(!(j==n||Pa.call(a,"constructor")&&Pa.call(b,"constructor")||ja(j)&&j instanceof j&&ja(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),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Pa.call(f,e)?(p++,q=Pa.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Pa.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(){try{return Za.apply(this,arguments)}catch(a){return _a.e=a,_a}}function o(a){if(!ja(a))throw new TypeError("fn must be a function");return Za=a,n}function p(a){throw a}function q(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function r(a,b){this.id=a,this.value=b}function t(a){this.observer=a,this.a=[],this.isStopped=!1}function u(){this._s=s}function v(){this._s=s,this._l=s.length,this._i=0}function w(a){this._a=a}function x(a){this._a=a,this._l=B(a),this._i=0}function y(a){return"number"==typeof a&&X.isFinite(a)}function z(b){var c,d=b[wa];if(!d&&"string"==typeof b)return c=new u(b),c[wa]();if(!d&&b.length!==a)return c=new w(b),c[wa]();if(!d)throw new TypeError("Object is not iterable");return b[wa]()}function A(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function B(a){var b=+a.length;return isNaN(b)?0:0!==b&&y(b)?(b=A(b)*Math.floor(Math.abs(b)),0>=b?0:b>Ub?Ub:b):b}function C(a,b){this.observer=a,this.parent=b}function D(a,b){return ca(a)||(a=ub),new Wb(b,a)}function E(a,b){return new tc(function(c){var d=new mb,e=new nb;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ia(d)&&(d=mc(d));var g=new mb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function F(a,b){var c=this;return new tc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function G(){return!1}function H(){return[]}function I(a,b,c){var d=Ba(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ia(e)&&(e=mc(e)),(za(e)||ya(e))&&(e=Vb(e)),e}).concatAll()}function J(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function K(a,b,c){var d=Ba(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ia(e)&&(e=mc(e)),(za(e)||ya(e))&&(e=Vb(e)),e}).mergeAll()}function L(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}function M(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),ib(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function N(a,b,c){var d=new fb;if("[object NodeList]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(N(a.item(e),b,c));else a&&d.add(M(a,b,c));return d}function O(a,b){return new tc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function P(a,b,c){return new tc(function(d){var e=a,f=qb(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function Q(a,b){return new tc(function(c){return b.scheduleWithRelative(qb(a),function(){c.onNext(0),c.onCompleted()})})}function R(a,b,c){return a===b?new tc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Qb(function(){return P(c.now()+a,b,c)})}function S(a,b,c){return new tc(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 fb(e,g)},a)}function T(a,b,c){return Qb(function(){return S(a,b-c.now(),c)})}function U(a,b){return new tc(function(c){function d(){g&&(g=!1,c.onNext(f)),e&&c.onCompleted()}var e,f,g;return new fb(a.subscribe(function(a){g=!0,f=a},c.onError.bind(c),function(){e=!0}),b.subscribe(d,c.onError.bind(c),d))},a)}function V(a,b,c){return new tc(function(d){function e(a,b){j[b]=a;var e;if(g[b]=!0,h||(h=g.every(da))){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 fb(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)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}var W={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},X=W[typeof window]&&window||this,Y=W[typeof exports]&&exports&&!exports.nodeType&&exports,Z=W[typeof module]&&module&&!module.nodeType&&module,$=Z&&Z.exports===Y&&Y,_=W[typeof global]&&global;!_||_.global!==_&&_.window!==_||(X=_);var aa={internals:{},config:{Promise:X.Promise},helpers:{}},ba=aa.helpers.noop=function(){},ca=(aa.helpers.notDefined=function(a){return"undefined"==typeof a},aa.helpers.isScheduler=function(a){return a instanceof aa.Scheduler}),da=aa.helpers.identity=function(a){return a},ea=(aa.helpers.pluck=function(a){return function(b){return b[a]}},aa.helpers.just=function(a){return function(){return a}},aa.helpers.defaultNow=Date.now),fa=aa.helpers.defaultComparer=function(a,b){return $a(a,b)},ga=aa.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ha=(aa.helpers.defaultKeySerializer=function(a){return a.toString()},aa.helpers.defaultError=function(a){throw a}),ia=aa.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},ja=(aa.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},aa.helpers.not=function(a){return!a},aa.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Oa.call(a)}),a}());aa.config.longStackSupport=!1;var ka=!1;try{throw new Error}catch(la){ka=!!la.stack}var ma,na=g(),oa="From previous event:",pa=aa.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};pa.prototype=Error.prototype;var qa=aa.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};qa.prototype=Error.prototype;var ra=aa.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};ra.prototype=Error.prototype;var sa=aa.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};sa.prototype=Error.prototype;var ta=aa.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};ta.prototype=Error.prototype;var ua=aa.helpers.notImplemented=function(){throw new ta},va=aa.helpers.notSupported=function(){throw new sa},wa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";X.Set&&"function"==typeof(new X.Set)["@@iterator"]&&(wa="@@iterator");var xa=aa.doneEnumerator={done:!0,value:a},ya=aa.helpers.isIterable=function(b){return b[wa]!==a},za=aa.helpers.isArrayLike=function(b){return b&&b.length!==a};aa.helpers.iterator=wa;var Aa,Ba=aa.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},Ca=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Da=Ca.length,Ea="[object Arguments]",Fa="[object Array]",Ga="[object Boolean]",Ha="[object Date]",Ia="[object Error]",Ja="[object Function]",Ka="[object Number]",La="[object Object]",Ma="[object RegExp]",Na="[object String]",Oa=Object.prototype.toString,Pa=Object.prototype.hasOwnProperty,Qa=Oa.call(arguments)==Ea,Ra=Error.prototype,Sa=Object.prototype,Ta=String.prototype,Ua=Sa.propertyIsEnumerable;try{Aa=!(Oa.call(document)==La&&!({toString:0}+""))}catch(la){Aa=!0}var Va={};Va[Fa]=Va[Ha]=Va[Ka]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Va[Ga]=Va[Na]={constructor:!0,toString:!0,valueOf:!0},Va[Ia]=Va[Ja]=Va[Ma]={constructor:!0,toString:!0},Va[La]={constructor:!0};var Wa={};!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);Wa.enumErrorProps=Ua.call(Ra,"message")||Ua.call(Ra,"name"),Wa.enumPrototypes=Ua.call(a,"prototype"),Wa.nonEnumArgs=0!=c,Wa.nonEnumShadows=!/valueOf/.test(b)}(1);var Xa=aa.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Ya=function(a){return a&&"object"==typeof a?Oa.call(a)==Ea:!1};Qa||(Ya=function(a){return a&&"object"==typeof a?Pa.call(a,"callee"):!1});{var Za,$a=aa.internals.isEqual=function(a,b){return m(a,b,[],[])},_a={e:{}},ab=({}.hasOwnProperty,Array.prototype.slice),bb=this.inherits=aa.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},cb=aa.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}};aa.internals.addRef=function(a,b){return new tc(function(c){return new fb(b.getDisposable(),a.subscribe(c))})}}r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var db=aa.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},eb=db.prototype;eb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},eb.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)}}},eb.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)}}},eb.peek=function(){return this.items[0].value},eb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},eb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},eb.enqueue=function(a){var b=this.length++;this.items[b]=new r(db.count++,a),this.percolate(b)},eb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},db.count=0;var fb=aa.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!kb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},gb=fb.prototype;gb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},gb.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},gb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var hb=aa.Disposable=function(a){this.isDisposed=!1,this.action=a||ba};hb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ib=hb.create=function(a){return new hb(a)},jb=hb.empty={dispose:ba},kb=hb.isDisposable=function(a){return a&&ja(a.dispose)},lb=hb.checkDisposed=function(a){if(a.isDisposed)throw new qa},mb=aa.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=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},b.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()},a}(),nb=aa.SerialDisposable=mb,ob=(aa.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?jb:new a(this)},b}(),aa.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ga,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=aa.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(),jb}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=ea,a.normalize=function(a){return 0>a&&(a=0),a},a}(),qb=pb.normalize;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),jb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new fb;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),jb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new fb;return d(e),g}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([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,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([a,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 X.setInterval)throw new sa;b=qb(b);var d=a,e=X.setInterval(function(){d=c(d)},b);return ib(function(){X.clearInterval(e)})}}(pb.prototype);var rb,sb,tb=pb.immediate=function(){function a(a,b){return b(this,a)}return new pb(ea,a,va,va)}(),ub=pb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new ob(this,b,d,this.now());if(c)c.enqueue(e);else{c=new db(4),c.enqueue(e);var f=o(a)();if(c=null,f===_a)return p(f.e)}return e.disposable}var c,d=new pb(ea,b,va,va);return d.scheduleRequired=function(){return!c},d}(),vb=(aa.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}(),function(){var a,b=ba;if(X.WScript)a=function(a,b){X.WScript.Sleep(b),a()};else{if(!X.setTimeout)throw new sa;a=X.setTimeout,b=X.clearTimeout}return{setTimeout:a,clearTimeout:b}}()),wb=vb.setTimeout,xb=vb.clearTimeout;!function(){function a(b){if(f)wb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=o(c)();if(sb(b),f=!1,d===_a)return p(d.e)}}}function b(){if(!X.postMessage||X.importScripts)return!1;var a=!1,b=X.onmessage;return X.onmessage=function(){a=!0},X.postMessage("","*"),X.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;sb=function(a){delete e[a]};var g=RegExp("^"+String(Oa).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=_&&$&&_.setImmediate)&&!g.test(h)&&h;if(ja(h))rb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))rb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();X.addEventListener?X.addEventListener("message",c,!1):X.attachEvent("onmessage",c,!1),rb=function(a){var b=d++;return e[b]=a,X.postMessage(i+currentId,"*"),b}}else if(X.MessageChannel){var j=new X.MessageChannel;j.port1.onmessage=function(b){a(b.data)},rb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else rb="document"in X&&"onreadystatechange"in X.document.createElement("script")?function(b){var c=X.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},X.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,wb(function(){a(c)},0),c}}();var yb=pb.timeout=pb["default"]=function(){function a(a,b){var c=this,d=new mb,e=rb(function(){d.isDisposed||d.setDisposable(b(c,a))});return new fb(d,ib(function(){sb(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 fb(f,ib(function(){xb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new pb(ea,a,b,c)}(),zb=aa.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}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 ca(a)||(a=tb),new tc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ab=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){return new zb("N",d,null,a,b,c)}}(),Bb=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){return new zb("E",null,d,a,b,c)}}(),Cb=zb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new zb("C",null,null,a,b,c)}}(),Db=aa.internals.Enumerator=function(a){this._next=a};Db.prototype.next=function(){return this._next()},Db.prototype[wa]=function(){return this};var Eb=aa.internals.Enumerable=function(a){this._iterator=a};Eb.prototype[wa]=function(){return this._iterator()},Eb.prototype.concat=function(){var a=this;return new tc(function(b){var c,d=a[wa](),e=new nb,f=tb.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;ia(h)&&(h=mc(h));var i=new mb;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new fb(e,f,ib(function(){c=!0}))})},Eb.prototype.catchError=function(){var a=this;return new tc(function(b){var c,d=a[wa](),e=new nb,f=tb.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;ia(i)&&(i=mc(i));var j=new mb;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new fb(e,f,ib(function(){c=!0}))})},Eb.prototype.catchErrorWhen=function(a){var b=this;return new tc(function(c){var d,e,f=new wc,g=new wc,h=a(f),i=h.subscribe(g),j=b[wa](),k=new nb,l=tb.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;ia(i)&&(i=mc(i));var l=new mb,m=new mb;k.setDisposable(new fb(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new fb(i,k,l,ib(function(){d=!0}))})};var Fb,Gb=Eb.repeat=function(a,b){return null==b&&(b=-1),new Eb(function(){var c=b;return new Db(function(){return 0===c?xa:(c>0&&c--,{done:!1,value:a})})})},Hb=Eb.of=function(a,b,c){if(b)var d=Ba(b,c,3);return new Eb(function(){var c=-1;return new Db(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:xa})})},Ib=aa.Observer=function(){},Jb=Ib.create=function(a,b,c){return a||(a=ba),b||(b=ha),c||(c=ba),new Lb(a,b,c)},Kb=aa.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return bb(b,a),b.prototype.next=ua,b.prototype.error=ua,b.prototype.completed=ua,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}(Ib),Lb=aa.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return bb(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}(Kb),Mb=aa.Observable=function(){function a(a){if(aa.config.longStackSupport&&ka){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Fb=a.prototype,Fb.subscribe=Fb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Jb(a,b,c))},Fb.subscribeOnNext=function(a,b){return this._subscribe(Jb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Fb.subscribeOnError=function(a,b){return this._subscribe(Jb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Fb.subscribeOnCompleted=function(a,b){return this._subscribe(Jb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Nb=aa.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 bb(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}(Kb),Ob=aa.ObservableBase=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?ib(a):jb}function c(a,c){var d=c[0],e=c[1],f=o(e.subscribeCore).call(e,d);return f!==_a||d.fail(_a.e)?void d.setDisposable(b(f)):p(_a.e)}function d(a){var b=new uc(a),d=[b,this];return ub.scheduleRequired()?ub.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return bb(e,a),e.prototype.subscribeCore=ua,e}(Mb),Pb=function(a){function b(b){this.source=b,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new t(a))},b}(Ob);t.prototype.onNext=function(a){this.isStopped||this.a.push(a)},t.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},t.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},t.prototype.dispose=function(){this.isStopped=!0},t.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.toArray=function(){return new Pb(this)},Mb.create=Mb.createWithDisposable=function(a,b){return new tc(a,b)};var Qb=Mb.defer=function(a){return new tc(function(b){var c;try{c=a()}catch(d){return _b(d).subscribe(b)}return ia(c)&&(c=mc(c)),c.subscribe(b)})},Rb=Mb.empty=function(a){return ca(a)||(a=tb),new tc(function(b){return a.scheduleWithState(null,function(){b.onCompleted()})})},Sb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new Tb(a,this);return b.run()},b}(Ob),Tb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=z(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Ub=Math.pow(2,53)-1;u.prototype[wa]=function(){return new v(this._s)},v.prototype[wa]=function(){return this},v.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:xa},w.prototype[wa]=function(){return new x(this._a)},x.prototype[wa]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:xa};var Vb=Mb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ja(b))throw new Error("mapFn when provided must be a function");if(b)var e=Ba(b,c,2);return ca(d)||(d=ub),new Sb(a,e,d)},Wb=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new C(a,this);return b.run()},b}(Ob);C.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};{var Xb=Mb.fromArray=function(a,b){return ca(b)||(b=ub),new Wb(a,b)};Mb.never=function(){return new tc(function(){return jb})}}Mb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Wb(b,ub)},Mb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Wb(c,a)},Mb.pairs=function(a,b){return b||(b=aa.Scheduler.currentThread),new tc(function(c){var d=Object.keys(a),e=d.length;return b.scheduleRecursiveWithState(0,function(b,f){if(e>b){var g=d[b];c.onNext([g,a[g]]),f(b+1)}else c.onCompleted()})})};var Yb=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new Zb(a,this);return b.run()},b}(Ob),Zb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.count,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Mb.range=function(a,b,c){return ca(c)||(c=ub),new Yb(a,b,c)},Mb.repeat=function(a,b,c){return ca(c)||(c=ub),$b(a,c).repeat(null==b?-1:b)};var $b=Mb["return"]=Mb.just=Mb.returnValue=function(a,b){return ca(b)||(b=tb),new tc(function(c){return b.scheduleWithState(a,function(a,b){c.onNext(b),c.onCompleted()})})},_b=Mb["throw"]=Mb.throwError=function(a,b){return ca(b)||(b=tb),new tc(function(c){return b.schedule(function(){c.onError(a)})})};Mb.throwException=function(){return Mb.throwError.apply(null,arguments)},Fb["catch"]=Fb.catchError=Fb.catchException=function(a){return"function"==typeof a?E(this,a):ac([this,a])};var ac=Mb.catchError=Mb["catch"]=Mb.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Hb(a).catchError()};Fb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];
return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),bc.apply(this,b)};var bc=Mb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new tc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(da))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(da)&&a.onCompleted()}function e(b){j[b]=!0,j.every(da)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=q(f,g),i=!1,j=q(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new mb;ia(f)&&(f=mc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new fb(l)},this)};Fb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),cc.apply(null,a)};var cc=Mb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return Hb(a).concat()};Fb.concatAll=Fb.concatObservable=function(){return this.merge(1)};var dc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new fb;return b.add(this.source.subscribe(new ec(a,this.maxConcurrent,b))),b},b}(Ob),ec=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new mb;this.g.add(c),ia(a)&&(a=mc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Fb.merge=function(a){return"number"!=typeof a?fc(this,a):new dc(this,a)};var fc=Mb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(ca(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=tb,b=0;d>b;b++)c.push(arguments[b]);else for(a=tb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),D(a,c).mergeAll()},gc=aa.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};gc.prototype=Error.prototype,Mb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=D(null,a);return new tc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new gc(g))}var c=new fb,e=new mb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new mb;c.add(e),ia(d)&&(d=mc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var hc=function(a){function b(b){this.source=b,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new fb,c=new mb;return b.add(c),c.setDisposable(this.source.subscribe(new ic(a,b))),b},b}(Ob),ic=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype.onNext=function(a){if(!this.isStopped){var c=new mb;this.g.add(c),ia(a)&&(a=mc(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Fb.mergeAll=Fb.mergeObservable=function(){return new hc(this)},Fb.skipUntil=function(a){var b=this;return new tc(function(c){var d=!1,e=new fb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ia(a)&&(a=mc(a));var f=new mb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},Fb["switch"]=Fb.switchLatest=function(){var a=this;return new tc(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),ia(a)&&(a=mc(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())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new fb(g,d)},a)},Fb.takeUntil=function(a){var b=this;return new tc(function(c){return ia(a)&&(a=mc(a)),new fb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},ba))},b)},Fb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new tc(function(a){for(var c=function(){return!1},f=b.length,g=q(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=b[c],e=new mb;ia(d)&&(d=mc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(da)},a.onError.bind(a),function(){})),j[c]=e}(k);var l=new mb;return l.setDisposable(e.subscribe(function(b){var c,e=[b].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void a.onError(f)}a.onNext(c)}},a.onError.bind(a),function(){a.onCompleted()})),j[f]=l,new fb(j)},this)},Fb.zip=function(){if(Array.isArray(arguments[0]))return F.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new tc(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(da)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=q(g,H),i=q(g,G),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new mb;ia(e)&&(e=mc(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new fb(j)},d)},Mb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Mb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new tc(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(da))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(da)?void b.onCompleted():void 0}for(var e=a.length,f=q(e,function(){return[]}),g=q(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)},function(a){b.onError(a)},function(){d(e)}))}(i);return new fb(h)})},Fb.asObservable=function(){var a=this;return new tc(function(b){return a.subscribe(b)},this)},Fb.dematerialize=function(){var a=this;return new tc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Fb.distinctUntilChanged=function(a,b){var c=this;return b||(b=fa),new tc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},Fb["do"]=Fb.tap=Fb.doAction=function(a,b,c){var d=this;return new tc(function(e){var f=!a||ja(a)?Jb(a||ba,b||ba,c||ba):a;return d.subscribe(function(a){try{f.onNext(a)}catch(b){e.onError(b)}e.onNext(a)},function(a){try{f.onError(a)}catch(b){e.onError(b)}e.onError(a)},function(){try{f.onCompleted()}catch(a){e.onError(a)}e.onCompleted()})},this)},Fb.doOnNext=Fb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Fb.doOnError=Fb.tapOnError=function(a,b){return this.tap(ba,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Fb.doOnCompleted=Fb.tapOnCompleted=function(a,b){return this.tap(ba,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Fb["finally"]=Fb.ensure=function(a){var b=this;return new tc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return ib(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Fb.finallyAction=function(a){return this.ensure(a)},Fb.ignoreElements=function(){var a=this;return new tc(function(b){return a.subscribe(ba,function(a){b.onError(a)},function(){b.onCompleted()})},a)},Fb.materialize=function(){var a=this;return new tc(function(b){return a.subscribe(function(a){b.onNext(Ab(a))},function(a){b.onNext(Bb(a)),b.onCompleted()},function(){b.onNext(Cb()),b.onCompleted()})},a)},Fb.repeat=function(a){return Gb(this,a).concat()},Fb.retry=function(a){return Gb(this,a).catchError()},Fb.retryWhen=function(a){return Gb(this).catchErrorWhen(a)},Fb.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 tc(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)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},Fb.skipLast=function(a){if(0>a)throw new ra;var b=this;return new tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Fb.startWith=function(){var a,b=0;arguments.length&&ca(arguments[0])?(a=arguments[0],b=1):a=tb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Hb([Xb(c,a),this]).concat()},Fb.takeLast=function(a){if(0>a)throw new ra;var b=this;return new tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Fb.selectConcat=Fb.concatMap=function(a,b,c){return ja(a)&&ja(b)?this.concatMap(function(c,d){var e=a(c,d);return ia(e)&&(e=mc(e)),(za(e)||ya(e))&&(e=Vb(e)),e.map(function(a,e){return b(c,a,d,e)})}):ja(a)?I(this,a,c):I(this,function(){return a})};var jc=function(a){function b(b,c,d){this.source=b,this.selector=Ba(c,d,3),a.call(this)}return bb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a.call(this,d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new J(a,this.selector,this))},b}(Ob);J.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.selector).call(this,a,this.i++,this.source);return b===_a?this.observer.onError(b.e):void this.observer.onNext(b)}},J.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},J.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},J.prototype.dispose=function(){this.isStopped=!0},J.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.map=Fb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof jc?this.internalMap(c,b):new jc(this,c,b)},Fb.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Fb.selectMany=Fb.flatMap=function(a,b,c){return ja(a)&&ja(b)?this.flatMap(function(c,d){var e=a(c,d);return ia(e)&&(e=mc(e)),(za(e)||ya(e))&&(e=Vb(e)),e.map(function(a,e){return b(c,a,d,e)})},c):ja(a)?K(this,a,c):K(this,function(){return a})},Fb.selectSwitch=Fb.flatMapLatest=Fb.switchMap=function(a,b){return this.select(a,b).switchLatest()},Fb.skip=function(a){if(0>a)throw new ra;var b=this;return new tc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Fb.skipWhile=function(a,b){var c=this,d=Ba(a,b,3);return new tc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Fb.take=function(a,b){if(0>a)throw new ra;if(0===a)return Rb(b);var c=this;return new tc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Fb.takeWhile=function(a,b){var c=this,d=Ba(a,b,3);return new tc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var kc=function(a){function b(b,c,d){this.source=b,this.predicate=Ba(c,d,3),a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new L(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a.call(this,b,c,e)},c)},b}(Ob);L.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.predicate).call(this,a,this.i++,this.source);return b===_a?this.observer.onError(b.e):void(b&&this.observer.onNext(a))}},L.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},L.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},L.prototype.dispose=function(){this.isStopped=!0},L.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.filter=Fb.where=function(a,b){return this instanceof kc?this.internalFilter(a,b):new kc(this,a,b)},Mb.fromCallback=function(a,b,c){return function(){for(var d=[],e=0,f=arguments.length;f>e;e++)d.push(arguments[e]);return new tc(function(e){function f(){var a=arguments;if(c){try{a=c(a)}catch(b){return e.onError(b)}e.onNext(a)}else a.length<=1?e.onNext.apply(e,a):e.onNext(a);e.onCompleted()}d.push(f),a.apply(b,d)}).publishLast().refCount()}},Mb.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new tc(function(d){function f(a){if(a)return void d.onError(a);for(var b=arguments.length,e=[],f=1;b>f;f++)e[f-1]=arguments[f];if(c){try{e=c(e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},aa.config.useNativeEvents=!1,Mb.fromEvent=function(a,b,c){return a.addListener?lc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):aa.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new tc(function(d){return N(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)})}).publish().refCount():lc(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var lc=Mb.fromEventPattern=function(a,b,c){return new tc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return ib(function(){b&&b(e,f)})}).publish().refCount()},mc=Mb.fromPromise=function(a){return Qb(function(){var b=new aa.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};Fb.toPromise=function(a){if(a||(a=aa.config.Promise),!a)throw new sa("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)})})},Mb.startAsync=function(a){var b;try{b=a()}catch(c){return _b(c)}return mc(b)},Fb.multicast=function(a,b){var c=this;return"function"==typeof a?new tc(function(d){var e=c.multicast(a());return new fb(b(e).subscribe(d),e.connect())},c):new nc(c,a)},Fb.publish=function(a){return a&&ja(a)?this.multicast(function(){return new wc},a):this.multicast(new wc)},Fb.share=function(){return this.publish().refCount()},Fb.publishLast=function(a){return a&&ja(a)?this.multicast(function(){return new xc},a):this.multicast(new xc)},Fb.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new zc(b)},a):this.multicast(new zc(a))},Fb.shareValue=function(a){return this.publishValue(a).refCount()},Fb.replay=function(a,b,c,d){return a&&ja(a)?this.multicast(function(){return new Ac(b,c,d)},a):this.multicast(new Ac(b,c,d))},Fb.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var nc=aa.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new fb(f.subscribe(c),ib(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return bb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new tc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(Mb),oc=Mb.interval=function(a,b){return R(a,a,ca(b)?b:yb)};Mb.timer=function(b,c,d){var e;return ca(d)||(d=yb),c!==a&&"number"==typeof c?e=c:ca(c)&&(d=c),b instanceof Date&&e===a?O(b.getTime(),d):b instanceof Date&&e!==a?(e=c,P(b.getTime(),e,d)):e===a?Q(b,d):R(b,e,d)}}Fb.delay=function(a,b){return ca(b)||(b=yb),a instanceof Date?T(this,a.getTime(),b):S(this,a,b)},Fb.debounce=Fb.throttleWithTimeout=function(a,b){ca(b)||(b=yb);var c=this;return new tc(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 fb(i,f)},this)},Fb.throttle=function(a,b){return this.debounce(a,b)},Fb.timestamp=function(a){return ca(a)||(a=yb),this.map(function(b){return{value:b,timestamp:a.now()}})},Fb.sample=Fb.throttleLatest=function(a,b){return ca(b)||(b=yb),"number"==typeof a?U(this,oc(a,b)):U(this,a)},Fb.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=_b(new Error(b||"Timeout"))),ca(c)||(c=yb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new tc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(ia(b)&&(b=mc(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 fb(j,l)},d)},Fb.throttleFirst=function(a,b){ca(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 tc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var pc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=jb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=jb)});return new fb(c,d,e)}function c(c,d){this.source=c,this.controller=new wc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b,c)}return bb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Mb);Fb.pausable=function(a){return new pc(this,a)};var qc=function(b){function c(b){var c,d=[],e=V(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 wc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return bb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(Mb);Fb.pausableBuffered=function(a){return new qc(this,a)};var rc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b,c),this.subject=new sc(d),this.source=c.multicast(this.subject).refCount()}return bb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(Mb),sc=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new wc,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=jb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1}return bb(c,a),cb(c.prototype,Ib,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(aa.Notification.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(aa.Notification.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(aa.Notification.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this,c=this._processRequest(a),a=c.numberOfItems;return c.returnValue?jb:(this.requestedCount=a,this.requestedDisposable=ib(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=jb}}),c}(Mb);Fb.controlled=function(a){return null==a&&(a=!0),new rc(this,a)},Fb.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 tc(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)})},c)};var tc=aa.AnonymousObservable=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?ib(a):jb}function c(a,c){var d=c[0],e=c[1],f=o(e)(d);return f!==_a||d.fail(_a.e)?void d.setDisposable(b(f)):p(_a.e)}function d(b,d){function e(a){var d=new uc(a),e=[d,b];return ub.scheduleRequired()?ub.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return bb(d,a),d}(Mb),uc=function(a){function b(b){a.call(this),this.observer=b,this.m=new mb}bb(b,a);var c=b.prototype;return c.next=function(a){var b=o(this.observer.onNext).call(this.observer,a);b===_a&&(this.dispose(),p(b.e))},c.error=function(a){var b=o(this.observer.onError).call(this.observer,a);this.dispose(),b===_a&&p(b.e)},c.completed=function(){var a=o(this.observer.onCompleted).call(this.observer);this.dispose(),a===_a&&p(a.e)},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}(Kb),vc=function(a,b){this.subject=a,this.observer=b};vc.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 wc=aa.Subject=function(a){function c(a){return lb(this),this.isStopped?this.hasError?(a.onError(this.error),jb):(a.onCompleted(),jb):(this.observers.push(a),new vc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return bb(d,a),cb(d.prototype,Ib.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(lb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new yc(a,b)},d}(Mb),xc=aa.AsyncSubject=function(a){function c(a){return lb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),jb):(this.observers.push(a),new vc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return bb(d,a),cb(d.prototype,Ib,{hasObservers:function(){return lb(this),this.observers.length>0},onCompleted:function(){var a,c;if(lb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){lb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Mb),yc=aa.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return bb(c,a),cb(c.prototype,Ib.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Mb),zc=aa.BehaviorSubject=function(a){function c(a){return lb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),jb):(this.observers.push(a),a.onNext(this.value),new vc(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return bb(d,a),cb(d.prototype,Ib,{getValue:function(){if(lb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(lb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),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}(Mb),Ac=aa.ReplaySubject=function(a){function c(a,b){return ib(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new Nb(this.scheduler,a),d=c(this,b);lb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||ub,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return bb(e,a),cb(e.prototype,Ib.prototype,{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(lb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(Mb);aa.Pauser=function(a){function b(){a.call(this)}return bb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(wc),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X.Rx=aa,define(function(){return aa})):Y&&Z?$?(Z.exports=aa).Rx=aa:Y.Rx=aa:X.Rx=aa;var Bc=g()}).call(this);
return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),bc.apply(this,b)};var bc=Mb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new tc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(da))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(da)&&a.onCompleted()}function e(b){j[b]=!0,j.every(da)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=q(f,g),i=!1,j=q(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new mb;ia(f)&&(f=mc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new fb(l)},this)};Fb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),cc.apply(null,a)};var cc=Mb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return Hb(a).concat()};Fb.concatAll=Fb.concatObservable=function(){return this.merge(1)};var dc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new fb;return b.add(this.source.subscribe(new ec(a,this.maxConcurrent,b))),b},b}(Ob),ec=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new mb;this.g.add(c),ia(a)&&(a=mc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Fb.merge=function(a){return"number"!=typeof a?fc(this,a):new dc(this,a)};var fc=Mb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(ca(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=tb,b=0;d>b;b++)c.push(arguments[b]);else for(a=tb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),D(a,c).mergeAll()},gc=aa.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};gc.prototype=Error.prototype,Mb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=D(null,a);return new tc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new gc(g))}var c=new fb,e=new mb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new mb;c.add(e),ia(d)&&(d=mc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var hc=function(a){function b(b){this.source=b,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new fb,c=new mb;return b.add(c),c.setDisposable(this.source.subscribe(new ic(a,b))),b},b}(Ob),ic=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype.onNext=function(a){if(!this.isStopped){var c=new mb;this.g.add(c),ia(a)&&(a=mc(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Fb.mergeAll=Fb.mergeObservable=function(){return new hc(this)},Fb.skipUntil=function(a){var b=this;return new tc(function(c){var d=!1,e=new fb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ia(a)&&(a=mc(a));var f=new mb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},Fb["switch"]=Fb.switchLatest=function(){var a=this;return new tc(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),ia(a)&&(a=mc(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())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new fb(g,d)},a)},Fb.takeUntil=function(a){var b=this;return new tc(function(c){return ia(a)&&(a=mc(a)),new fb(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},ba))},b)},Fb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new tc(function(a){for(var c=function(){return!1},f=b.length,g=q(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=b[c],e=new mb;ia(d)&&(d=mc(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(da)},a.onError.bind(a),function(){})),j[c]=e}(k);var l=new mb;return l.setDisposable(e.subscribe(function(b){var c,e=[b].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void a.onError(f)}a.onNext(c)}},a.onError.bind(a),function(){a.onCompleted()})),j[f]=l,new fb(j)},this)},Fb.zip=function(){if(Array.isArray(arguments[0]))return F.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new tc(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(da)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=q(g,H),i=q(g,G),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new mb;ia(e)&&(e=mc(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new fb(j)},d)},Mb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Mb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new tc(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(da))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(da)?void b.onCompleted():void 0}for(var e=a.length,f=q(e,function(){return[]}),g=q(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)},function(a){b.onError(a)},function(){d(e)}))}(i);return new fb(h)})},Fb.asObservable=function(){var a=this;return new tc(function(b){return a.subscribe(b)},this)},Fb.dematerialize=function(){var a=this;return new tc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Fb.distinctUntilChanged=function(a,b){var c=this;return b||(b=fa),new tc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},Fb["do"]=Fb.tap=Fb.doAction=function(a,b,c){var d=this;return new tc(function(e){var f=!a||ja(a)?Jb(a||ba,b||ba,c||ba):a;return d.subscribe(function(a){try{f.onNext(a)}catch(b){e.onError(b)}e.onNext(a)},function(a){try{f.onError(a)}catch(b){e.onError(b)}e.onError(a)},function(){try{f.onCompleted()}catch(a){e.onError(a)}e.onCompleted()})},this)},Fb.doOnNext=Fb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Fb.doOnError=Fb.tapOnError=function(a,b){return this.tap(ba,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Fb.doOnCompleted=Fb.tapOnCompleted=function(a,b){return this.tap(ba,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Fb["finally"]=Fb.ensure=function(a){var b=this;return new tc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return ib(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Fb.finallyAction=function(a){return this.ensure(a)},Fb.ignoreElements=function(){var a=this;return new tc(function(b){return a.subscribe(ba,function(a){b.onError(a)},function(){b.onCompleted()})},a)},Fb.materialize=function(){var a=this;return new tc(function(b){return a.subscribe(function(a){b.onNext(Ab(a))},function(a){b.onNext(Bb(a)),b.onCompleted()},function(){b.onNext(Cb()),b.onCompleted()})},a)},Fb.repeat=function(a){return Gb(this,a).concat()},Fb.retry=function(a){return Gb(this,a).catchError()},Fb.retryWhen=function(a){return Gb(this).catchErrorWhen(a)},Fb.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 tc(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)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},Fb.skipLast=function(a){if(0>a)throw new ra;var b=this;return new tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Fb.startWith=function(){var a,b=0;arguments.length&&ca(arguments[0])?(a=arguments[0],b=1):a=tb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Hb([Xb(c,a),this]).concat()},Fb.takeLast=function(a){if(0>a)throw new ra;var b=this;return new tc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Fb.selectConcat=Fb.concatMap=function(a,b,c){return ja(a)&&ja(b)?this.concatMap(function(c,d){var e=a(c,d);return ia(e)&&(e=mc(e)),(za(e)||ya(e))&&(e=Vb(e)),e.map(function(a,e){return b(c,a,d,e)})}):ja(a)?I(this,a,c):I(this,function(){return a})};var jc=function(a){function b(b,c,d){this.source=b,this.selector=Ba(c,d,3),a.call(this)}return bb(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a.call(this,d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new J(a,this.selector,this))},b}(Ob);J.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.selector).call(this,a,this.i++,this.source);return b===_a?this.observer.onError(b.e):void this.observer.onNext(b)}},J.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},J.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},J.prototype.dispose=function(){this.isStopped=!0},J.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.map=Fb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof jc?this.internalMap(c,b):new jc(this,c,b)},Fb.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Fb.selectMany=Fb.flatMap=function(a,b,c){return ja(a)&&ja(b)?this.flatMap(function(c,d){var e=a(c,d);return ia(e)&&(e=mc(e)),(za(e)||ya(e))&&(e=Vb(e)),e.map(function(a,e){return b(c,a,d,e)})},c):ja(a)?K(this,a,c):K(this,function(){return a})},Fb.selectSwitch=Fb.flatMapLatest=Fb.switchMap=function(a,b){return this.select(a,b).switchLatest()},Fb.skip=function(a){if(0>a)throw new ra;var b=this;return new tc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Fb.skipWhile=function(a,b){var c=this,d=Ba(a,b,3);return new tc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Fb.take=function(a,b){if(0>a)throw new ra;if(0===a)return Rb(b);var c=this;return new tc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Fb.takeWhile=function(a,b){var c=this,d=Ba(a,b,3);return new tc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var kc=function(a){function b(b,c,d){this.source=b,this.predicate=Ba(c,d,3),a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new L(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a.call(this,b,c,e)},c)},b}(Ob);L.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.predicate).call(this,a,this.i++,this.source);return b===_a?this.observer.onError(b.e):void(b&&this.observer.onNext(a))}},L.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},L.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},L.prototype.dispose=function(){this.isStopped=!0},L.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.filter=Fb.where=function(a,b){return this instanceof kc?this.internalFilter(a,b):new kc(this,a,b)},Mb.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new tc(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},Mb.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new tc(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},aa.config.useNativeEvents=!1,Mb.fromEvent=function(a,b,c){return a.addListener?lc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):aa.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new tc(function(d){return N(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)})}).publish().refCount():lc(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var lc=Mb.fromEventPattern=function(a,b,c){return new tc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return ib(function(){b&&b(e,f)})}).publish().refCount()},mc=Mb.fromPromise=function(a){return Qb(function(){var b=new aa.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};Fb.toPromise=function(a){if(a||(a=aa.config.Promise),!a)throw new sa("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)})})},Mb.startAsync=function(a){var b;try{b=a()}catch(c){return _b(c)}return mc(b)},Fb.multicast=function(a,b){var c=this;return"function"==typeof a?new tc(function(d){var e=c.multicast(a());return new fb(b(e).subscribe(d),e.connect())},c):new nc(c,a)},Fb.publish=function(a){return a&&ja(a)?this.multicast(function(){return new wc},a):this.multicast(new wc)},Fb.share=function(){return this.publish().refCount()},Fb.publishLast=function(a){return a&&ja(a)?this.multicast(function(){return new xc},a):this.multicast(new xc)},Fb.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new zc(b)},a):this.multicast(new zc(a))},Fb.shareValue=function(a){return this.publishValue(a).refCount()},Fb.replay=function(a,b,c,d){return a&&ja(a)?this.multicast(function(){return new Ac(b,c,d)},a):this.multicast(new Ac(b,c,d))},Fb.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var nc=aa.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new fb(f.subscribe(c),ib(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return bb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new tc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(Mb),oc=Mb.interval=function(a,b){return R(a,a,ca(b)?b:yb)};Mb.timer=function(b,c,d){var e;return ca(d)||(d=yb),c!==a&&"number"==typeof c?e=c:ca(c)&&(d=c),b instanceof Date&&e===a?O(b.getTime(),d):b instanceof Date&&e!==a?(e=c,P(b.getTime(),e,d)):e===a?Q(b,d):R(b,e,d)}}Fb.delay=function(a,b){return ca(b)||(b=yb),a instanceof Date?T(this,a.getTime(),b):S(this,a,b)},Fb.debounce=Fb.throttleWithTimeout=function(a,b){ca(b)||(b=yb);var c=this;return new tc(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 fb(i,f)},this)},Fb.throttle=function(a,b){return this.debounce(a,b)},Fb.timestamp=function(a){return ca(a)||(a=yb),this.map(function(b){return{value:b,timestamp:a.now()}})},Fb.sample=Fb.throttleLatest=function(a,b){return ca(b)||(b=yb),"number"==typeof a?U(this,oc(a,b)):U(this,a)},Fb.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=_b(new Error(b||"Timeout"))),ca(c)||(c=yb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new tc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(ia(b)&&(b=mc(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 fb(j,l)},d)},Fb.throttleFirst=function(a,b){ca(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 tc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var pc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=jb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=jb)});return new fb(c,d,e)}function c(c,d){this.source=c,this.controller=new wc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,a.call(this,b,c)}return bb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Mb);Fb.pausable=function(a){return new pc(this,a)};var qc=function(b){function c(b){var c,d=[],e=V(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 wc,this.pauser=d&&d.subscribe?this.controller.merge(d):this.controller,b.call(this,c,a)}return bb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(Mb);Fb.pausableBuffered=function(a){return new qc(this,a)};var rc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d){a.call(this,b,c),this.subject=new sc(d),this.source=c.multicast(this.subject).refCount()}return bb(c,a),c.prototype.request=function(a){return null==a&&(a=-1),this.subject.request(a)},c}(Mb),sc=function(a){function b(a){return this.subject.subscribe(a)}function c(c){null==c&&(c=!0),a.call(this,b),this.subject=new wc,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=jb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1}return bb(c,a),cb(c.prototype,Ib,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(aa.Notification.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(aa.Notification.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(aa.Notification.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this,c=this._processRequest(a),a=c.numberOfItems;return c.returnValue?jb:(this.requestedCount=a,this.requestedDisposable=ib(function(){b.requestedCount=0}),this.requestedDisposable)},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=jb}}),c}(Mb);Fb.controlled=function(a){return null==a&&(a=!0),new rc(this,a)},Fb.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},Fb.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 tc(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)})},c)};var tc=aa.AnonymousObservable=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?ib(a):jb}function c(a,c){var d=c[0],e=c[1],f=o(e)(d);return f!==_a||d.fail(_a.e)?void d.setDisposable(b(f)):p(_a.e)}function d(b,d){function e(a){var d=new uc(a),e=[d,b];return ub.scheduleRequired()?ub.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return bb(d,a),d}(Mb),uc=function(a){function b(b){a.call(this),this.observer=b,this.m=new mb}bb(b,a);var c=b.prototype;return c.next=function(a){var b=o(this.observer.onNext).call(this.observer,a);b===_a&&(this.dispose(),p(b.e))},c.error=function(a){var b=o(this.observer.onError).call(this.observer,a);this.dispose(),b===_a&&p(b.e)},c.completed=function(){var a=o(this.observer.onCompleted).call(this.observer);this.dispose(),a===_a&&p(a.e)},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}(Kb),vc=function(a,b){this.subject=a,this.observer=b};vc.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 wc=aa.Subject=function(a){function c(a){return lb(this),this.isStopped?this.hasError?(a.onError(this.error),jb):(a.onCompleted(),jb):(this.observers.push(a),new vc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return bb(d,a),cb(d.prototype,Ib.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(lb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new yc(a,b)},d}(Mb),xc=aa.AsyncSubject=function(a){function c(a){return lb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),jb):(this.observers.push(a),new vc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return bb(d,a),cb(d.prototype,Ib,{hasObservers:function(){return lb(this),this.observers.length>0},onCompleted:function(){var a,c;if(lb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){lb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Mb),yc=aa.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return bb(c,a),cb(c.prototype,Ib.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Mb),zc=aa.BehaviorSubject=function(a){function c(a){return lb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),jb):(this.observers.push(a),a.onNext(this.value),new vc(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return bb(d,a),cb(d.prototype,Ib,{getValue:function(){if(lb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(lb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),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}(Mb),Ac=aa.ReplaySubject=function(a){function c(a,b){return ib(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new Nb(this.scheduler,a),d=c(this,b);lb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||ub,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return bb(e,a),cb(e.prototype,Ib.prototype,{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(lb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(Mb);aa.Pauser=function(a){function b(){a.call(this)}return bb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(wc),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X.Rx=aa,define(function(){return aa})):Y&&Z?$?(Z.exports=aa).Rx=aa:Y.Rx=aa:X.Rx=aa;var Bc=g()}).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(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(a,b){if(ea&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ia)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+ia+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===ga&&d>=ha&&rc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ea)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ga=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Ra(a))return b;Qa.nonEnumArgs&&a.length&&Sa(a)&&(a=Va.call(a));var c=Qa.enumPrototypes&&"function"==typeof a,d=Qa.enumErrorProps&&(a===La||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Qa.nonEnumShadows&&a!==Ma){var f=a.constructor,g=-1,h=xa;if(a===(f&&f.prototype))var i=a===Na?Ha:a===La?Ca:Ia.call(a),j=Pa[i];for(;++g<h;)e=wa[g],j&&j[e]||!Ja.call(a,e)||b.push(e)}return b}function j(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 k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Ia.call(a),h=Ia.call(b);if(g==ya&&(g=Fa),h==ya&&(h=Fa),g!=h)return!1;switch(g){case Aa:case Ba:return+a==+b;case Ea:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ga:case Ha:return a==String(b)}var i=g==za;if(!i){if(g!=Fa||!Qa.nodeClass&&(l(a)||l(b)))return!1;var j=!Qa.argsObject&&Sa(a)?Object:a.constructor,n=!Qa.argsObject&&Sa(b)?Object:b.constructor;if(!(j==n||Ja.call(a,"constructor")&&Ja.call(b,"constructor")||da(j)&&j instanceof j&&da(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),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Ja.call(f,e)?(p++,q=Ja.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Ja.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Ta.apply(this,arguments)}catch(a){return Za.e=a,Za}}function p(a){if(!da(a))throw new TypeError("fn must be a function");return Ta=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this.observer=a,this.a=[],this.isStopped=!1}function w(){this._s=s}function x(){this._s=s,this._l=s.length,this._i=0}function y(a){this._a=a}function z(a){this._a=a,this._l=D(a),this._i=0}function A(a){return"number"==typeof a&&R.isFinite(a)}function B(b){var c,d=b[qa];if(!d&&"string"==typeof b)return c=new w(b),c[qa]();if(!d&&b.length!==a)return c=new y(b),c[qa]();if(!d)throw new TypeError("Object is not iterable");return b[qa]()}function C(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function D(a){var b=+a.length;return isNaN(b)?0:0!==b&&A(b)?(b=C(b)*Math.floor(Math.abs(b)),0>=b?0:b>Tb?Tb:b):b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return Y(a)||(a=qb),new Vb(b,a)}function G(a,b){return new mc(function(c){var d=new hb,e=new ib;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ca(d)&&(d=Nb(d));var g=new hb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function H(a,b){var c=this;return new mc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function I(){return!1}function J(){return[]}function K(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Nb(e)),(ta(e)||sa(e))&&(e=Ub(e)),e}).concatAll()}function L(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function M(a){this.comparer=a,this.set=[]}function N(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function O(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Nb(e)),(ta(e)||sa(e))&&(e=Ub(e)),e}).mergeAll()}function P(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}var Q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},R=Q[typeof window]&&window||this,S=Q[typeof exports]&&exports&&!exports.nodeType&&exports,T=Q[typeof module]&&module&&!module.nodeType&&module,U=T&&T.exports===S&&S,V=Q[typeof global]&&global;!V||V.global!==V&&V.window!==V||(R=V);var W={internals:{},config:{Promise:R.Promise},helpers:{}},X=W.helpers.noop=function(){},Y=(W.helpers.notDefined=function(a){return"undefined"==typeof a},W.helpers.isScheduler=function(a){return a instanceof W.Scheduler}),Z=W.helpers.identity=function(a){return a},$=(W.helpers.pluck=function(a){return function(b){return b[a]}},W.helpers.just=function(a){return function(){return a}},W.helpers.defaultNow=Date.now),_=W.helpers.defaultComparer=function(a,b){return Ua(a,b)},aa=W.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ba=(W.helpers.defaultKeySerializer=function(a){return a.toString()},W.helpers.defaultError=function(a){throw a}),ca=W.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},da=(W.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},W.helpers.not=function(a){return!a},W.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ia.call(a)}),a}());W.config.longStackSupport=!1;var ea=!1;try{throw new Error}catch(fa){ea=!!fa.stack}var ga,ha=g(),ia="From previous event:",ja=W.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ja.prototype=Error.prototype;var ka=W.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};ka.prototype=Error.prototype;var la=W.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};la.prototype=Error.prototype;var ma=W.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ma.prototype=Error.prototype;var na=W.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};na.prototype=Error.prototype;var oa=W.helpers.notImplemented=function(){throw new na},pa=W.helpers.notSupported=function(){throw new ma},qa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";R.Set&&"function"==typeof(new R.Set)["@@iterator"]&&(qa="@@iterator");var ra=W.doneEnumerator={done:!0,value:a},sa=W.helpers.isIterable=function(b){return b[qa]!==a},ta=W.helpers.isArrayLike=function(b){return b&&b.length!==a};W.helpers.iterator=qa;var ua,va=W.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},wa=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xa=wa.length,ya="[object Arguments]",za="[object Array]",Aa="[object Boolean]",Ba="[object Date]",Ca="[object Error]",Da="[object Function]",Ea="[object Number]",Fa="[object Object]",Ga="[object RegExp]",Ha="[object String]",Ia=Object.prototype.toString,Ja=Object.prototype.hasOwnProperty,Ka=Ia.call(arguments)==ya,La=Error.prototype,Ma=Object.prototype,Na=String.prototype,Oa=Ma.propertyIsEnumerable;try{ua=!(Ia.call(document)==Fa&&!({toString:0}+""))}catch(fa){ua=!0}var Pa={};Pa[za]=Pa[Ba]=Pa[Ea]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Pa[Aa]=Pa[Ha]={constructor:!0,toString:!0,valueOf:!0},Pa[Ca]=Pa[Da]=Pa[Ga]={constructor:!0,toString:!0},Pa[Fa]={constructor:!0};var Qa={};!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);Qa.enumErrorProps=Oa.call(La,"message")||Oa.call(La,"name"),Qa.enumPrototypes=Oa.call(a,"prototype"),Qa.nonEnumArgs=0!=c,Qa.nonEnumShadows=!/valueOf/.test(b)}(1);var Ra=W.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Sa=function(a){return a&&"object"==typeof a?Ia.call(a)==ya:!1};Ka||(Sa=function(a){return a&&"object"==typeof a?Ja.call(a,"callee"):!1});var Ta,Ua=W.internals.isEqual=function(a,b){return m(a,b,[],[])},Va=({}.hasOwnProperty,Array.prototype.slice),Wa=this.inherits=W.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Xa=W.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Ya=W.internals.addRef=function(a,b){return new mc(function(c){return new ab(b.getDisposable(),a.subscribe(c))})},Za={e:{}};r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var $a=W.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},_a=$a.prototype;_a.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},_a.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)}}},_a.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)}}},_a.peek=function(){return this.items[0].value},_a.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},_a.dequeue=function(){var a=this.peek();return this.removeAt(0),a},_a.enqueue=function(a){var b=this.length++;this.items[b]=new r($a.count++,a),this.percolate(b)},_a.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},$a.count=0;var ab=W.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!fb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.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;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var cb=W.Disposable=function(a){this.isDisposed=!1,this.action=a||X};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:X},fb=cb.isDisposable=function(a){return a&&da(a.dispose)},gb=cb.checkDisposed=function(a){if(a.isDisposed)throw new ka},hb=W.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=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},b.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()},a}(),ib=W.SerialDisposable=hb,jb=W.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}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var kb=W.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||aa,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=W.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=$,a.normalize=function(a){return 0>a&&(a=0),a},a}(),mb=lb.normalize;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),eb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new ab;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),eb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new ab;return d(e),g}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([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,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([a,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 R.setInterval)throw new ma;b=mb(b);var d=a,e=R.setInterval(function(){d=c(d)},b);return db(function(){R.clearInterval(e)})}}(lb.prototype),function(a){a.catchError=a["catch"]=function(a){return new ub(this,a)}}(lb.prototype);var nb,ob,pb=(W.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)}return new lb($,a,pa,pa)}()),qb=lb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new kb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new $a(4),c.enqueue(e);var f=p(a)();if(c=null,f===Za)return q(f.e)}return e.disposable}var c,d=new lb($,b,pa,pa);return d.scheduleRequired=function(){return!c},d}(),rb=function(){var a,b=X;if(R.WScript)a=function(a,b){R.WScript.Sleep(b),a()};else{if(!R.setTimeout)throw new ma;a=R.setTimeout,b=R.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),sb=rb.setTimeout,tb=rb.clearTimeout;!function(){function a(b){if(f)sb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(ob(b),f=!1,d===Za)return q(d.e)}}}function b(){if(!R.postMessage||R.importScripts)return!1;var a=!1,b=R.onmessage;return R.onmessage=function(){a=!0},R.postMessage("","*"),R.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;ob=function(a){delete e[a]};var g=RegExp("^"+String(Ia).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=V&&U&&V.setImmediate)&&!g.test(h)&&h;if(da(h))nb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))nb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();R.addEventListener?R.addEventListener("message",c,!1):R.attachEvent("onmessage",c,!1),nb=function(a){var b=d++;return e[b]=a,R.postMessage(i+currentId,"*"),b}}else if(R.MessageChannel){var j=new R.MessageChannel;j.port1.onmessage=function(b){a(b.data)},nb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else nb="document"in R&&"onreadystatechange"in R.document.createElement("script")?function(b){var c=R.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},R.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,sb(function(){a(c)},0),c}}();var ub=(lb.timeout=lb["default"]=function(){function a(a,b){var c=this,d=new hb,e=nb(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=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 ab(f,db(function(){tb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new lb($,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 Wa(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 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=W.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}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 Y(a)||(a=pb),new mc(function(c){return a.scheduleWithState(b,function(a,b){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){return new vb("N",d,null,a,b,c)}}(),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){return new vb("E",null,d,a,b,c)}}(),yb=vb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new vb("C",null,null,a,b,c)}}(),zb=W.internals.Enumerator=function(a){this._next=a};zb.prototype.next=function(){return this._next()},zb.prototype[qa]=function(){return this};var Ab=W.internals.Enumerable=function(a){this._iterator=a};Ab.prototype[qa]=function(){return this._iterator()},Ab.prototype.concat=function(){var a=this;return new mc(function(b){var c,d=a[qa](),e=new ib,f=pb.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;ca(h)&&(h=Nb(h));var i=new hb;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new ab(e,f,db(function(){c=!0}))})},Ab.prototype.catchError=function(){var a=this;return new mc(function(b){var c,d=a[qa](),e=new ib,f=pb.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;ca(i)&&(i=Nb(i));var j=new hb;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new ab(e,f,db(function(){c=!0}))})},Ab.prototype.catchErrorWhen=function(a){var b=this;return new mc(function(c){var d,e,f=new pc,g=new pc,h=a(f),i=h.subscribe(g),j=b[qa](),k=new ib,l=pb.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;ca(i)&&(i=Nb(i));var l=new hb,m=new hb;k.setDisposable(new ab(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new ab(i,k,l,db(function(){d=!0}))})};var Bb=Ab.repeat=function(a,b){return null==b&&(b=-1),new Ab(function(){var c=b;return new zb(function(){return 0===c?ra:(c>0&&c--,{done:!1,value:a})})})},Cb=Ab.of=function(a,b,c){if(b)var d=va(b,c,3);return new Ab(function(){var c=-1;return new zb(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:ra})})},Db=W.Observer=function(){};Db.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Db.prototype.asObserver=function(){return new Hb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Db.prototype.checked=function(){return new Ib(this)};var Eb=Db.create=function(a,b,c){return a||(a=X),b||(b=ba),c||(c=X),new Hb(a,b,c)};Db.fromNotifier=function(a,b){return new Hb(function(c){return a.call(b,wb(c))},function(c){return a.call(b,xb(c))},function(){return a.call(b,yb())})},Db.prototype.notifyOn=function(a){return new Kb(a,this)},Db.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Fb,Gb=W.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Wa(b,a),b.prototype.next=oa,b.prototype.error=oa,b.prototype.completed=oa,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}(Db),Hb=W.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Wa(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}(Gb),Ib=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Wa(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Za&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Za&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Za&&q(a.e)},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}(Db),Jb=W.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 Wa(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}(Gb),Kb=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Wa(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}(Jb),Lb=W.Observable=function(){function a(a){if(W.config.longStackSupport&&ea){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Fb=a.prototype,Fb.subscribe=Fb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Eb(a,b,c))},Fb.subscribeOnNext=function(a,b){return this._subscribe(Eb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Fb.subscribeOnError=function(a,b){return this._subscribe(Eb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Fb.subscribeOnCompleted=function(a,b){return this._subscribe(Eb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Mb=W.ObservableBase=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?db(a):eb}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(a){var b=new nc(a),d=[b,this];return qb.scheduleRequired()?qb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Wa(e,a),e.prototype.subscribeCore=oa,e}(Lb);Fb.observeOn=function(a){var b=this;return new mc(function(c){return b.subscribe(new Kb(a,c))},b)},Fb.subscribeOn=function(a){var b=this;return new mc(function(c){var d=new hb,e=new ib;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Nb=Lb.fromPromise=function(a){return Pb(function(){var b=new W.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};Fb.toPromise=function(a){if(a||(a=W.config.Promise),!a)throw new ma("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)})})};var Ob=function(a){function b(b){this.source=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new v(a))},b}(Mb);v.prototype.onNext=function(a){this.isStopped||this.a.push(a)},v.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},v.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},v.prototype.dispose=function(){this.isStopped=!0},v.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.toArray=function(){return new Ob(this)},Lb.create=Lb.createWithDisposable=function(a,b){return new mc(a,b)};var Pb=Lb.defer=function(a){return new mc(function(b){var c;try{c=a()}catch(d){return _b(d).subscribe(b)}return ca(c)&&(c=Nb(c)),c.subscribe(b)})},Qb=Lb.empty=function(a){return Y(a)||(a=pb),new mc(function(b){return a.scheduleWithState(null,function(){b.onCompleted()})})},Rb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new Sb(a,this);return b.run()},b}(Mb),Sb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=B(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Tb=Math.pow(2,53)-1;w.prototype[qa]=function(){return new x(this._s)},x.prototype[qa]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ra},y.prototype[qa]=function(){return new z(this._a)},z.prototype[qa]=function(){return this},z.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ra};var Ub=Lb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!da(b))throw new Error("mapFn when provided must be a function");if(b)var e=va(b,c,2);return Y(d)||(d=qb),new Rb(a,e,d)},Vb=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Mb);E.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Wb=Lb.fromArray=function(a,b){return Y(b)||(b=qb),new Vb(a,b)};Lb.generate=function(a,b,c,d,e){return Y(e)||(e=qb),new mc(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return void f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var Xb=Lb.never=function(){return new mc(function(){return eb})};Lb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];
(function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(a,b){if(ea&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ia)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+ia+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===ga&&d>=ha&&rc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ea)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ga=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Ra(a))return b;Qa.nonEnumArgs&&a.length&&Sa(a)&&(a=Va.call(a));var c=Qa.enumPrototypes&&"function"==typeof a,d=Qa.enumErrorProps&&(a===La||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Qa.nonEnumShadows&&a!==Ma){var f=a.constructor,g=-1,h=xa;if(a===(f&&f.prototype))var i=a===Na?Ha:a===La?Ca:Ia.call(a),j=Pa[i];for(;++g<h;)e=wa[g],j&&j[e]||!Ja.call(a,e)||b.push(e)}return b}function j(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 k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Ia.call(a),h=Ia.call(b);if(g==ya&&(g=Fa),h==ya&&(h=Fa),g!=h)return!1;switch(g){case Aa:case Ba:return+a==+b;case Ea:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ga:case Ha:return a==String(b)}var i=g==za;if(!i){if(g!=Fa||!Qa.nodeClass&&(l(a)||l(b)))return!1;var j=!Qa.argsObject&&Sa(a)?Object:a.constructor,n=!Qa.argsObject&&Sa(b)?Object:b.constructor;if(!(j==n||Ja.call(a,"constructor")&&Ja.call(b,"constructor")||da(j)&&j instanceof j&&da(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),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Ja.call(f,e)?(p++,q=Ja.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Ja.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Ta.apply(this,arguments)}catch(a){return Za.e=a,Za}}function p(a){if(!da(a))throw new TypeError("fn must be a function");return Ta=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this.observer=a,this.a=[],this.isStopped=!1}function w(){this._s=s}function x(){this._s=s,this._l=s.length,this._i=0}function y(a){this._a=a}function z(a){this._a=a,this._l=D(a),this._i=0}function A(a){return"number"==typeof a&&R.isFinite(a)}function B(b){var c,d=b[qa];if(!d&&"string"==typeof b)return c=new w(b),c[qa]();if(!d&&b.length!==a)return c=new y(b),c[qa]();if(!d)throw new TypeError("Object is not iterable");return b[qa]()}function C(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function D(a){var b=+a.length;return isNaN(b)?0:0!==b&&A(b)?(b=C(b)*Math.floor(Math.abs(b)),0>=b?0:b>Tb?Tb:b):b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return Y(a)||(a=qb),new Vb(b,a)}function G(a,b){return new mc(function(c){var d=new hb,e=new ib;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ca(d)&&(d=Nb(d));var g=new hb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function H(a,b){var c=this;return new mc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g,h=a[e++];try{g=b(c,h)}catch(i){return d.onError(i)}d.onNext(g)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function I(){return!1}function J(){return[]}function K(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Nb(e)),(ta(e)||sa(e))&&(e=Ub(e)),e}).concatAll()}function L(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function M(a){this.comparer=a,this.set=[]}function N(a,b,c){this.observer=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}function O(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Nb(e)),(ta(e)||sa(e))&&(e=Ub(e)),e}).mergeAll()}function P(a,b,c){this.observer=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}var Q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},R=Q[typeof window]&&window||this,S=Q[typeof exports]&&exports&&!exports.nodeType&&exports,T=Q[typeof module]&&module&&!module.nodeType&&module,U=T&&T.exports===S&&S,V=Q[typeof global]&&global;!V||V.global!==V&&V.window!==V||(R=V);var W={internals:{},config:{Promise:R.Promise},helpers:{}},X=W.helpers.noop=function(){},Y=(W.helpers.notDefined=function(a){return"undefined"==typeof a},W.helpers.isScheduler=function(a){return a instanceof W.Scheduler}),Z=W.helpers.identity=function(a){return a},$=(W.helpers.pluck=function(a){return function(b){return b[a]}},W.helpers.just=function(a){return function(){return a}},W.helpers.defaultNow=Date.now),_=W.helpers.defaultComparer=function(a,b){return Ua(a,b)},aa=W.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ba=(W.helpers.defaultKeySerializer=function(a){return a.toString()},W.helpers.defaultError=function(a){throw a}),ca=W.helpers.isPromise=function(a){return!!a&&"function"==typeof a.then},da=(W.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},W.helpers.not=function(a){return!a},W.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ia.call(a)}),a}());W.config.longStackSupport=!1;var ea=!1;try{throw new Error}catch(fa){ea=!!fa.stack}var ga,ha=g(),ia="From previous event:",ja=W.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ja.prototype=Error.prototype;var ka=W.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};ka.prototype=Error.prototype;var la=W.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};la.prototype=Error.prototype;var ma=W.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ma.prototype=Error.prototype;var na=W.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};na.prototype=Error.prototype;var oa=W.helpers.notImplemented=function(){throw new na},pa=W.helpers.notSupported=function(){throw new ma},qa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";R.Set&&"function"==typeof(new R.Set)["@@iterator"]&&(qa="@@iterator");var ra=W.doneEnumerator={done:!0,value:a},sa=W.helpers.isIterable=function(b){return b[qa]!==a},ta=W.helpers.isArrayLike=function(b){return b&&b.length!==a};W.helpers.iterator=qa;var ua,va=W.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},wa=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xa=wa.length,ya="[object Arguments]",za="[object Array]",Aa="[object Boolean]",Ba="[object Date]",Ca="[object Error]",Da="[object Function]",Ea="[object Number]",Fa="[object Object]",Ga="[object RegExp]",Ha="[object String]",Ia=Object.prototype.toString,Ja=Object.prototype.hasOwnProperty,Ka=Ia.call(arguments)==ya,La=Error.prototype,Ma=Object.prototype,Na=String.prototype,Oa=Ma.propertyIsEnumerable;try{ua=!(Ia.call(document)==Fa&&!({toString:0}+""))}catch(fa){ua=!0}var Pa={};Pa[za]=Pa[Ba]=Pa[Ea]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Pa[Aa]=Pa[Ha]={constructor:!0,toString:!0,valueOf:!0},Pa[Ca]=Pa[Da]=Pa[Ga]={constructor:!0,toString:!0},Pa[Fa]={constructor:!0};var Qa={};!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);Qa.enumErrorProps=Oa.call(La,"message")||Oa.call(La,"name"),Qa.enumPrototypes=Oa.call(a,"prototype"),Qa.nonEnumArgs=0!=c,Qa.nonEnumShadows=!/valueOf/.test(b)}(1);var Ra=W.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Sa=function(a){return a&&"object"==typeof a?Ia.call(a)==ya:!1};Ka||(Sa=function(a){return a&&"object"==typeof a?Ja.call(a,"callee"):!1});var Ta,Ua=W.internals.isEqual=function(a,b){return m(a,b,[],[])},Va=({}.hasOwnProperty,Array.prototype.slice),Wa=this.inherits=W.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Xa=W.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Ya=W.internals.addRef=function(a,b){return new mc(function(c){return new ab(b.getDisposable(),a.subscribe(c))})},Za={e:{}};r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var $a=W.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},_a=$a.prototype;_a.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},_a.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)}}},_a.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)}}},_a.peek=function(){return this.items[0].value},_a.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},_a.dequeue=function(){var a=this.peek();return this.removeAt(0),a},_a.enqueue=function(a){var b=this.length++;this.items[b]=new r($a.count++,a),this.percolate(b)},_a.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},$a.count=0;var ab=W.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!fb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.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;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var cb=W.Disposable=function(a){this.isDisposed=!1,this.action=a||X};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:X},fb=cb.isDisposable=function(a){return a&&da(a.dispose)},gb=cb.checkDisposed=function(a){if(a.isDisposed)throw new ka},hb=W.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=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},b.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()},a}(),ib=W.SerialDisposable=hb,jb=W.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}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var kb=W.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||aa,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=W.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=$,a.normalize=function(a){return 0>a&&(a=0),a},a}(),mb=lb.normalize;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),eb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new ab;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),eb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new ab;return d(e),g}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([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,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([a,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 R.setInterval)throw new ma;b=mb(b);var d=a,e=R.setInterval(function(){d=c(d)},b);return db(function(){R.clearInterval(e)})}}(lb.prototype),function(a){a.catchError=a["catch"]=function(a){return new ub(this,a)}}(lb.prototype);var nb,ob,pb=(W.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)}return new lb($,a,pa,pa)}()),qb=lb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new kb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new $a(4),c.enqueue(e);var f=p(a)();if(c=null,f===Za)return q(f.e)}return e.disposable}var c,d=new lb($,b,pa,pa);return d.scheduleRequired=function(){return!c},d}(),rb=function(){var a,b=X;if(R.WScript)a=function(a,b){R.WScript.Sleep(b),a()};else{if(!R.setTimeout)throw new ma;a=R.setTimeout,b=R.clearTimeout}return{setTimeout:a,clearTimeout:b}}(),sb=rb.setTimeout,tb=rb.clearTimeout;!function(){function a(b){if(f)sb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(ob(b),f=!1,d===Za)return q(d.e)}}}function b(){if(!R.postMessage||R.importScripts)return!1;var a=!1,b=R.onmessage;return R.onmessage=function(){a=!0},R.postMessage("","*"),R.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;ob=function(a){delete e[a]};var g=RegExp("^"+String(Ia).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=V&&U&&V.setImmediate)&&!g.test(h)&&h;if(da(h))nb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))nb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();R.addEventListener?R.addEventListener("message",c,!1):R.attachEvent("onmessage",c,!1),nb=function(a){var b=d++;return e[b]=a,R.postMessage(i+currentId,"*"),b}}else if(R.MessageChannel){var j=new R.MessageChannel;j.port1.onmessage=function(b){a(b.data)},nb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else nb="document"in R&&"onreadystatechange"in R.document.createElement("script")?function(b){var c=R.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},R.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,sb(function(){a(c)},0),c}}();var ub=(lb.timeout=lb["default"]=function(){function a(a,b){var c=this,d=new hb,e=nb(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=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 ab(f,db(function(){tb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new lb($,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 Wa(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 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=W.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}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 Y(a)||(a=pb),new mc(function(c){return a.scheduleWithState(b,function(a,b){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){return new vb("N",d,null,a,b,c)}}(),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){return new vb("E",null,d,a,b,c)}}(),yb=vb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new vb("C",null,null,a,b,c)}}(),zb=W.internals.Enumerator=function(a){this._next=a};zb.prototype.next=function(){return this._next()},zb.prototype[qa]=function(){return this};var Ab=W.internals.Enumerable=function(a){this._iterator=a};Ab.prototype[qa]=function(){return this._iterator()},Ab.prototype.concat=function(){var a=this;return new mc(function(b){var c,d=a[qa](),e=new ib,f=pb.scheduleRecursive(function(a){if(!c){try{var f=d.next()}catch(g){return b.onError(g)}if(f.done)return b.onCompleted();var h=f.value;ca(h)&&(h=Nb(h));var i=new hb;e.setDisposable(i),i.setDisposable(h.subscribe(function(a){b.onNext(a)},function(a){b.onError(a)},a))}});return new ab(e,f,db(function(){c=!0}))})},Ab.prototype.catchError=function(){var a=this;return new mc(function(b){var c,d=a[qa](),e=new ib,f=pb.scheduleRecursiveWithState(null,function(a,f){if(!c){try{var g=d.next()}catch(h){return observer.onError(h)}if(g.done)return void(null!==a?b.onError(a):b.onCompleted());var i=g.value;ca(i)&&(i=Nb(i));var j=new hb;e.setDisposable(j),j.setDisposable(i.subscribe(function(a){b.onNext(a)},f,function(){b.onCompleted()}))}});return new ab(e,f,db(function(){c=!0}))})},Ab.prototype.catchErrorWhen=function(a){var b=this;return new mc(function(c){var d,e,f=new pc,g=new pc,h=a(f),i=h.subscribe(g),j=b[qa](),k=new ib,l=pb.scheduleRecursive(function(a){if(!d){try{var b=j.next()}catch(h){return c.onError(h)}if(b.done)return void(e?c.onError(e):c.onCompleted());var i=b.value;ca(i)&&(i=Nb(i));var l=new hb,m=new hb;k.setDisposable(new ab(m,l)),l.setDisposable(i.subscribe(function(a){c.onNext(a)},function(b){m.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new ab(i,k,l,db(function(){d=!0}))})};var Bb=Ab.repeat=function(a,b){return null==b&&(b=-1),new Ab(function(){var c=b;return new zb(function(){return 0===c?ra:(c>0&&c--,{done:!1,value:a})})})},Cb=Ab.of=function(a,b,c){if(b)var d=va(b,c,3);return new Ab(function(){var c=-1;return new zb(function(){return++c<a.length?{done:!1,value:b?d(a[c],c,a):a[c]}:ra})})},Db=W.Observer=function(){};Db.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Db.prototype.asObserver=function(){return new Hb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Db.prototype.checked=function(){return new Ib(this)};var Eb=Db.create=function(a,b,c){return a||(a=X),b||(b=ba),c||(c=X),new Hb(a,b,c)};Db.fromNotifier=function(a,b){return new Hb(function(c){return a.call(b,wb(c))},function(c){return a.call(b,xb(c))},function(){return a.call(b,yb())})},Db.prototype.notifyOn=function(a){return new Kb(a,this)},Db.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Fb,Gb=W.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Wa(b,a),b.prototype.next=oa,b.prototype.error=oa,b.prototype.completed=oa,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}(Db),Hb=W.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Wa(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}(Gb),Ib=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Wa(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Za&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Za&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Za&&q(a.e)},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}(Db),Jb=W.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 Wa(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}(Gb),Kb=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Wa(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}(Jb),Lb=W.Observable=function(){function a(a){if(W.config.longStackSupport&&ea){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Fb=a.prototype,Fb.subscribe=Fb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Eb(a,b,c))},Fb.subscribeOnNext=function(a,b){return this._subscribe(Eb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Fb.subscribeOnError=function(a,b){return this._subscribe(Eb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Fb.subscribeOnCompleted=function(a,b){return this._subscribe(Eb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Mb=W.ObservableBase=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?db(a):eb}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(a){var b=new nc(a),d=[b,this];return qb.scheduleRequired()?qb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Wa(e,a),e.prototype.subscribeCore=oa,e}(Lb);Fb.observeOn=function(a){var b=this;return new mc(function(c){return b.subscribe(new Kb(a,c))},b)},Fb.subscribeOn=function(a){var b=this;return new mc(function(c){var d=new hb,e=new ib;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Nb=Lb.fromPromise=function(a){return Pb(function(){var b=new W.AsyncSubject;return a.then(function(a){b.onNext(a),b.onCompleted()},b.onError.bind(b)),b})};Fb.toPromise=function(a){if(a||(a=W.config.Promise),!a)throw new ma("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)})})};var Ob=function(a){function b(b){this.source=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new v(a))},b}(Mb);v.prototype.onNext=function(a){this.isStopped||this.a.push(a)},v.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},v.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onNext(this.a),this.observer.onCompleted())},v.prototype.dispose=function(){this.isStopped=!0},v.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.toArray=function(){return new Ob(this)},Lb.create=Lb.createWithDisposable=function(a,b){return new mc(a,b)};var Pb=Lb.defer=function(a){return new mc(function(b){var c;try{c=a()}catch(d){return _b(d).subscribe(b)}return ca(c)&&(c=Nb(c)),c.subscribe(b)})},Qb=Lb.empty=function(a){return Y(a)||(a=pb),new mc(function(b){return a.scheduleWithState(null,function(){b.onCompleted()})})},Rb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new Sb(a,this);return b.run()},b}(Mb),Sb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=B(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Tb=Math.pow(2,53)-1;w.prototype[qa]=function(){return new x(this._s)},x.prototype[qa]=function(){return this},x.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ra},y.prototype[qa]=function(){return new z(this._a)},z.prototype[qa]=function(){return this},z.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ra};var Ub=Lb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!da(b))throw new Error("mapFn when provided must be a function");if(b)var e=va(b,c,2);return Y(d)||(d=qb),new Rb(a,e,d)},Vb=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Mb);E.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Wb=Lb.fromArray=function(a,b){return Y(b)||(b=qb),new Vb(a,b)};Lb.generate=function(a,b,c,d,e){return Y(e)||(e=qb),new mc(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var Xb=Lb.never=function(){return new mc(function(){return eb})};Lb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];
return new Vb(b,qb)},Lb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Vb(c,a)},Lb.pairs=function(a,b){return b||(b=W.Scheduler.currentThread),new mc(function(c){var d=Object.keys(a),e=d.length;return b.scheduleRecursiveWithState(0,function(b,f){if(e>b){var g=d[b];c.onNext([g,a[g]]),f(b+1)}else c.onCompleted()})})};var Yb=function(a){function b(b,c,d){this.start=b,this.count=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new Zb(a,this);return b.run()},b}(Mb),Zb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.count,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Lb.range=function(a,b,c){return Y(c)||(c=qb),new Yb(a,b,c)},Lb.repeat=function(a,b,c){return Y(c)||(c=qb),$b(a,c).repeat(null==b?-1:b)};var $b=Lb["return"]=Lb.just=Lb.returnValue=function(a,b){return Y(b)||(b=pb),new mc(function(c){return b.scheduleWithState(a,function(a,b){c.onNext(b),c.onCompleted()})})},_b=Lb["throw"]=Lb.throwError=function(a,b){return Y(b)||(b=pb),new mc(function(c){return b.schedule(function(){c.onError(a)})})};Lb.throwException=function(){return Lb.throwError.apply(null,arguments)},Lb.using=function(a,b){return new mc(function(c){var d,e,f=eb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new ab(_b(g).subscribe(c),f)}return new ab(e.subscribe(c),f)})},Fb.amb=function(a){var b=this;return new mc(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 ca(a)&&(a=Nb(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)})},Lb.amb=function(){function a(a,b){return a.amb(b)}var b=Xb(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Fb["catch"]=Fb.catchError=Fb.catchException=function(a){return"function"==typeof a?G(this,a):ac([this,a])};var ac=Lb.catchError=Lb["catch"]=Lb.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Cb(a).catchError()};Fb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),bc.apply(this,b)};var bc=Lb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new mc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Z))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Z)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new hb;ca(f)&&(f=Nb(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new ab(l)},this)};Fb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),cc.apply(null,a)};var cc=Lb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return Cb(a).concat()};Fb.concatAll=Fb.concatObservable=function(){return this.merge(1)};var dc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new ab;return b.add(this.source.subscribe(new ec(a,this.maxConcurrent,b))),b},b}(Mb),ec=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new hb;this.g.add(c),ca(a)&&(a=Nb(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Fb.merge=function(a){return"number"!=typeof a?fc(this,a):new dc(this,a)};var fc=Lb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Y(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=pb,b=0;d>b;b++)c.push(arguments[b]);else for(a=pb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),F(a,c).mergeAll()},gc=W.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};gc.prototype=Error.prototype,Lb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=F(null,a);return new mc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new gc(g))}var c=new ab,e=new hb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new hb;c.add(e),ca(d)&&(d=Nb(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var hc=function(a){function b(b){this.source=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new ab,c=new hb;return b.add(c),c.setDisposable(this.source.subscribe(new ic(a,b))),b},b}(Mb),ic=function(){function a(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function b(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return a.prototype.onNext=function(a){if(!this.isStopped){var c=new hb;this.g.add(c),ca(a)&&(a=Nb(a)),c.setDisposable(a.subscribe(new b(this,this.g,c)))}},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Fb.mergeAll=Fb.mergeObservable=function(){return new hc(this)},Fb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return jc([this,a])};var jc=Lb.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new mc(function(b){var c=0,d=new ib,e=pb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ca(f)&&(f=Nb(f)),g=new hb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new ab(d,e)})};Fb.skipUntil=function(a){var b=this;return new mc(function(c){var d=!1,e=new ab(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ca(a)&&(a=Nb(a));var f=new hb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)},Fb["switch"]=Fb.switchLatest=function(){var a=this;return new mc(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),ca(a)&&(a=Nb(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())}))},function(a){b.onError(a)},function(){e=!0,!c&&b.onCompleted()});return new ab(g,d)},a)},Fb.takeUntil=function(a){var b=this;return new mc(function(c){return ca(a)&&(a=Nb(a)),new ab(b.subscribe(c),a.subscribe(function(){c.onCompleted()},function(a){c.onError(a)},X))},b)},Fb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;if("undefined"==typeof e)throw new Error("Source observable not found for withLatestFrom().");if("function"!=typeof d)throw new Error("withLatestFrom() expects a resultSelector function.");return Array.isArray(b[0])&&(b=b[0]),new mc(function(a){for(var c=function(){return!1},f=b.length,g=n(f,c),h=!1,i=new Array(f),j=new Array(f+1),k=0;f>k;k++)!function(c){var d=b[c],e=new hb;ca(d)&&(d=Nb(d)),e.setDisposable(d.subscribe(function(a){i[c]=a,g[c]=!0,h=g.every(Z)},a.onError.bind(a),function(){})),j[c]=e}(k);var l=new hb;return l.setDisposable(e.subscribe(function(b){var c,e=[b].concat(i);if(h){try{c=d.apply(null,e)}catch(f){return void a.onError(f)}a.onNext(c)}},a.onError.bind(a),function(){a.onCompleted()})),j[f]=l,new ab(j)},this)},Fb.zip=function(){if(Array.isArray(arguments[0]))return H.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new mc(function(a){function c(b){var c,f;if(h.every(function(a){return a.length>0})){try{f=h.map(function(a){return a.shift()}),c=e.apply(d,f)}catch(g){return void a.onError(g)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function f(b){i[b]=!0,i.every(function(a){return a})&&a.onCompleted()}for(var g=b.length,h=n(g,J),i=n(g,I),j=new Array(g),k=0;g>k;k++)!function(d){var e=b[d],g=new hb;ca(e)&&(e=Nb(e)),g.setDisposable(e.subscribe(function(a){h[d].push(a),c(d)},function(b){a.onError(b)},function(){f(d)})),j[d]=g}(k);return new ab(j)},d)},Lb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Lb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new mc(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(Z))return void b.onCompleted()}function d(a){return g[a]=!0,g.every(Z)?void b.onCompleted():void 0}for(var e=a.length,f=n(e,function(){return[]}),g=n(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)},function(a){b.onError(a)},function(){d(e)}))}(i);return new ab(h)})},Fb.asObservable=function(){var a=this;return new mc(function(b){return a.subscribe(b)},this)},Fb.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})},Fb.dematerialize=function(){var a=this;return new mc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Fb.distinctUntilChanged=function(a,b){var c=this;return b||(b=_),new mc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a)try{g=a(c)}catch(h){return void d.onError(h)}if(f)try{var i=b(e,g)}catch(h){return void d.onError(h)}f&&i||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)},Fb["do"]=Fb.tap=Fb.doAction=function(a,b,c){var d=this;return new mc(function(e){var f=!a||da(a)?Eb(a||X,b||X,c||X):a;return d.subscribe(function(a){try{f.onNext(a)}catch(b){e.onError(b)}e.onNext(a)},function(a){try{f.onError(a)}catch(b){e.onError(b)}e.onError(a)},function(){try{f.onCompleted()}catch(a){e.onError(a)}e.onCompleted()})},this)},Fb.doOnNext=Fb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Fb.doOnError=Fb.tapOnError=function(a,b){return this.tap(X,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Fb.doOnCompleted=Fb.tapOnCompleted=function(a,b){return this.tap(X,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Fb["finally"]=Fb.ensure=function(a){var b=this;return new mc(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()}})},this)},Fb.finallyAction=function(a){return this.ensure(a)},Fb.ignoreElements=function(){var a=this;return new mc(function(b){return a.subscribe(X,function(a){b.onError(a)},function(){b.onCompleted()})},a)},Fb.materialize=function(){var a=this;return new mc(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()})},a)},Fb.repeat=function(a){return Bb(this,a).concat()},Fb.retry=function(a){return Bb(this,a).catchError()},Fb.retryWhen=function(a){return Bb(this).catchErrorWhen(a)},Fb.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 mc(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)},function(a){e.onError(a)},function(){!h&&c&&e.onNext(a),e.onCompleted()})},d)},Fb.skipLast=function(a){if(0>a)throw new la;var b=this;return new mc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Fb.startWith=function(){var a,b=0;arguments.length&&Y(arguments[0])?(a=arguments[0],b=1):a=pb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Cb([Wb(c,a),this]).concat()},Fb.takeLast=function(a){if(0>a)throw new la;var b=this;return new mc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Fb.takeLastBuffer=function(a){var b=this;return new mc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},Fb.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new la;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new la;return new mc(function(d){function e(){var a=new pc;i.push(a),d.onNext(Ya(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},c)},Fb.selectConcat=Fb.concatMap=function(a,b,c){return da(a)&&da(b)?this.concatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Nb(e)),(ta(e)||sa(e))&&(e=Ub(e)),e.map(function(a,e){return b(c,a,d,e)})}):da(a)?K(this,a,c):K(this,function(){return a})},Fb.concatMapObserver=Fb.selectConcatObserver=function(a,b,c,d){var e=this,f=va(a,d,2),g=va(b,d,1),h=va(c,d,0);return new mc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ca(d)&&(d=Nb(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ca(c)&&(c=Nb(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ca(b)&&(b=Nb(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Fb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new mc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},M.prototype.push=function(a){var b=-1===L(this.set,a,this.comparer);return b&&this.set.push(a),b},Fb.distinct=function(a,b){var c=this;return b||(b=_),new mc(function(d){var e=new M(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)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var kc=function(a){function b(b,c,d){this.source=b,this.selector=va(c,d,3),a.call(this)}return Wa(b,a),b.prototype.internalMap=function(a,c){var d=this;return new b(this.source,function(b,c,e){return a.call(this,d.selector(b,c,e),c,e)},c)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new N(a,this.selector,this))},b}(Mb);N.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector).call(this,a,this.i++,this.source);return b===Za?this.observer.onError(b.e):void this.observer.onNext(b)}},N.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},N.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},N.prototype.dispose=function(){this.isStopped=!0},N.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.map=Fb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof kc?this.internalMap(c,b):new kc(this,c,b)},Fb.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Fb.flatMapObserver=Fb.selectManyObserver=function(a,b,c,d){var e=this;return new mc(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)}ca(c)&&(c=Nb(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ca(c)&&(c=Nb(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ca(a)&&(a=Nb(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Fb.selectMany=Fb.flatMap=function(a,b,c){return da(a)&&da(b)?this.flatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Nb(e)),(ta(e)||sa(e))&&(e=Ub(e)),e.map(function(a,e){return b(c,a,d,e)})},c):da(a)?O(this,a,c):O(this,function(){return a})},Fb.selectSwitch=Fb.flatMapLatest=Fb.switchMap=function(a,b){return this.select(a,b).switchLatest()},Fb.skip=function(a){if(0>a)throw new la;var b=this;return new mc(function(c){var d=a;return b.subscribe(function(a){0>=d?c.onNext(a):d--},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Fb.skipWhile=function(a,b){var c=this,d=va(a,b,3);return new mc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Fb.take=function(a,b){if(0>a)throw new la;if(0===a)return Qb(b);var c=this;return new mc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0===d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Fb.takeWhile=function(a,b){var c=this,d=va(a,b,3);return new mc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var lc=function(a){function b(b,c,d){this.source=b,this.predicate=va(c,d,3),a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new P(a,this.predicate,this))},b.prototype.internalFilter=function(a,c){var d=this;return new b(this.source,function(b,c,e){return d.predicate(b,c,e)&&a.call(this,b,c,e)},c)},b}(Mb);P.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate).call(this,a,this.i++,this.source);return b===Za?this.observer.onError(b.e):void(b&&this.observer.onNext(a))}},P.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},P.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.observer.onCompleted())},P.prototype.dispose=function(){this.isStopped=!0},P.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Fb.filter=Fb.where=function(a,b){return this instanceof lc?this.internalFilter(a,b):new lc(this,a,b)},Fb.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 mc(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)})},c)};var mc=W.AnonymousObservable=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?db(a):eb}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(b,d){function e(a){var d=new nc(a),e=[d,b];return qb.scheduleRequired()?qb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Wa(d,a),d}(Lb),nc=function(a){function b(b){a.call(this),this.observer=b,this.m=new hb}Wa(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===Za&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Za&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Za&&q(a.e)},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}(Gb),oc=function(a,b){this.subject=a,this.observer=b};oc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var pc=W.Subject=function(a){function c(a){return gb(this),this.isStopped?this.hasError?(a.onError(this.error),eb):(a.onCompleted(),eb):(this.observers.push(a),new oc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Db.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(gb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(gb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(gb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new qc(a,b)},d}(Lb),qc=(W.AsyncSubject=function(a){function c(a){return gb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),eb):(this.observers.push(a),new oc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Db,{hasObservers:function(){return gb(this),this.observers.length>0},onCompleted:function(){var a,c;if(gb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(gb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){gb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Lb),W.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Wa(c,a),Xa(c.prototype,Db.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Lb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(R.Rx=W,define(function(){return W})):S&&T?U?(T.exports=W).Rx=W:S.Rx=W:R.Rx=W;var rc=g()}).call(this);
//# sourceMappingURL=rx.map

@@ -14,218 +14,2 @@ var Rx = require('./dist/rx');

// Add specific Node functions
var EventEmitter = require('events').EventEmitter,
Observable = Rx.Observable;
Rx.Node = {
/**
* @deprecated Use Rx.Observable.fromCallback from rx.async.js instead.
*
* Converts a callback function to an observable sequence.
*
* @param {Function} func Function to convert to an asynchronous function.
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Function} Asynchronous function.
*/
fromCallback: function (func, context, selector) {
return Observable.fromCallback(func, context, selector);
},
/**
* @deprecated Use Rx.Observable.fromNodeCallback from rx.async.js instead.
*
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
*
* @param {Function} func The function to call
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
*/
fromNodeCallback: function (func, context, selector) {
return Observable.fromNodeCallback(func, context, selector);
},
/**
* @deprecated Use Rx.Observable.fromNodeCallback from rx.async.js instead.
*
* Handles an event from the given EventEmitter as an observable sequence.
*
* @param {EventEmitter} eventEmitter The EventEmitter to subscribe to the given event.
* @param {String} eventName The event name to subscribe
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence generated from the named event from the given EventEmitter. The data will be returned as an array of arguments to the handler.
*/
fromEvent: function (eventEmitter, eventName, selector) {
return Observable.fromEvent(eventEmitter, eventName, selector);
},
/**
* Converts the given observable sequence to an event emitter with the given event name.
* The errors are handled on the 'error' event and completion on the 'end' event.
* @param {Observable} observable The observable sequence to convert to an EventEmitter.
* @param {String} eventName The event name to emit onNext calls.
* @returns {EventEmitter} An EventEmitter which emits the given eventName for each onNext call in addition to 'error' and 'end' events.
* You must call publish in order to invoke the subscription on the Observable sequuence.
*/
toEventEmitter: function (observable, eventName, selector) {
var e = new EventEmitter();
// Used to publish the events from the observable
e.publish = function () {
e.subscription = observable.subscribe(
function (x) {
var result = x;
if (selector) {
try {
result = selector(x);
} catch (e) {
e.emit('error', e);
return;
}
}
e.emit(eventName, result);
},
function (err) {
e.emit('error', err);
},
function () {
e.emit('end');
});
};
return e;
},
/**
* Converts a flowing stream to an Observable sequence.
* @param {Stream} stream A stream to convert to a observable sequence.
* @param {String} [finishEventName] Event that notifies about closed stream. ("end" by default)
* @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and finish events like `end` or `finish`.
*/
fromStream: function (stream, finishEventName) {
stream.pause();
finishEventName || (finishEventName = 'end');
return Observable.create(function (observer) {
function dataHandler (data) {
observer.onNext(data);
}
function errorHandler (err) {
observer.onError(err);
}
function endHandler () {
observer.onCompleted();
}
stream.addListener('data', dataHandler);
stream.addListener('error', errorHandler);
stream.addListener(finishEventName, endHandler);
stream.resume();
return function () {
stream.removeListener('data', dataHandler);
stream.removeListener('error', errorHandler);
stream.removeListener(finishEventName, endHandler);
};
}).publish().refCount();
},
/**
* Converts a flowing readable stream to an Observable sequence.
* @param {Stream} stream A stream to convert to a observable sequence.
* @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'end' events.
*/
fromReadableStream: function (stream) {
return this.fromStream(stream, 'end');
},
/**
* Converts a flowing writeable stream to an Observable sequence.
* @param {Stream} stream A stream to convert to a observable sequence.
* @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'finish' events.
*/
fromWritableStream: function (stream) {
return this.fromStream(stream, 'finish');
},
/**
* Converts a flowing transform stream to an Observable sequence.
* @param {Stream} stream A stream to convert to a observable sequence.
* @returns {Observable} An observable sequence which fires on each 'data' event as well as handling 'error' and 'finish' events.
*/
fromTransformStream: function (stream) {
return this.fromStream(stream, 'finish');
},
/**
* Writes an observable sequence to a stream
* @param {Observable} observable Observable sequence to write to a stream.
* @param {Stream} stream The stream to write to.
* @param {String} [encoding] The encoding of the item to write.
* @returns {Disposable} The subscription handle.
*/
writeToStream: function (observable, stream, encoding) {
var source = observable.pausableBuffered();
function onDrain() {
source.resume();
}
stream.addListener('drain', onDrain);
return source.subscribe(
function (x) {
!stream.write(String(x), encoding) && source.pause();
},
function (err) {
stream.emit('error', err);
},
function () {
// Hack check because STDIO is not closable
!stream._isStdio && stream.end();
stream.removeListener('drain', onDrain);
});
source.resume();
}
};
/**
* Pipes the existing Observable sequence into a Node.js Stream.
* @param {Stream} dest The destination Node.js stream.
* @returns {Stream} The destination stream.
*/
Rx.Observable.prototype.pipe = function (dest) {
var source = this.pausableBuffered();
function onDrain() {
source.resume();
}
dest.addListener('drain', onDrain);
source.subscribe(
function (x) {
!dest.write(String(x)) && source.pause();
},
function (err) {
dest.emit('error', err);
},
function () {
// Hack check because STDIO is not closable
!dest._isStdio && dest.end();
dest.removeListener('drain', onDrain);
});
source.resume();
return dest;
};
module.exports = Rx;

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

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

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

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

- [Thundercats.js](https://github.com/r3dm/thundercats)
- [Flurx](https://github.com/cell303/flurx)
- [Ember](http://emberjs.com/)

@@ -401,2 +402,3 @@ - [RxEmber](https://github.com/blesh/RxEmber)

- [Thundercats.js](https://github.com/r3dm/thundercats)
- [Flurx](https://github.com/cell303/flurx)
- [Ember](http://emberjs.com/)

@@ -403,0 +405,0 @@ - [RxEmber](https://github.com/blesh/RxEmber)

@@ -27,3 +27,3 @@ ;(function (factory) {

} else if (typeof module === 'object' && module && module.exports === freeExports) {
module.exports = factory(root, module.exports, require('./rx-lite-compat'));
module.exports = factory(root, module.exports, require('rx-lite-compat'));
} else {

@@ -30,0 +30,0 @@ root.Rx = factory(root, {}, root.Rx);

@@ -11,11 +11,13 @@ /**

return function () {
for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
var len = arguments.length, args = new Array(len)
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new AnonymousObservable(function (observer) {
function handler() {
var results = arguments;
var len = arguments.length, results = new Array(len);
for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
if (selector) {
try {
results = selector(results);
results = selector.apply(context, results);
} catch (e) {

@@ -22,0 +24,0 @@ return observer.onError(e);

@@ -25,3 +25,3 @@ /**

try {
results = selector(results);
results = selector.apply(context, results);
} catch (e) {

@@ -28,0 +28,0 @@ return observer.onError(e);

@@ -10,8 +10,8 @@ /**

isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithState(value, function (_, v) {
observer.onNext(v);
observer.onCompleted();
return new AnonymousObservable(function (o) {
return scheduler.scheduleWithState(value, function(_,v) {
o.onNext(v);
o.onCompleted();
});
});
};

@@ -10,22 +10,34 @@ var JustObservable = (function(__super__) {

JustObservable.prototype.subscribeCore = function (observer) {
var sink = new FromArraySink(observer, this);
var sink = new JustSink(observer, this);
return sink.run();
};
return JustObservable;
}(ObservableBase));
function JustSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
function JustSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
JustSink.prototype.run = function () {
var observer = this.observer;
function schedule(s, state) {
observer.onNext(state);
function scheduleItem(s, state) {
var value = state[0], observer = state[1];
observer.onNext(value);
observer.onCompleted();
}
return this.parent.scheduler.scheduleWithState(this.parent.value, schedule);
JustSink.prototype.run = function () {
return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
};
return JustObservable;
}(ObservableBase));
/**
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
* There is an alias called 'just' or browsers <IE9.
* @param {Mixed} value Single element in the resulting observable sequence.
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence containing the single specified element.
*/
var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new JustObservable(value, scheduler);
};
var TapObservable = (function(__super__) {
inherits(TapObservable,__super__);
function TapObservable(source, tapObserver) {
function TapObservable(source, observerOrOnNext, onError, onCompleted) {
this.source = source;
this.tapObserver = tapObserver;
this.tapObserver = !observerOrOnNext || isFunction(observerOrOnNext) ?
observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
observerOrOnNext;;
__super__.call(this);

@@ -60,6 +62,4 @@ }

observableProto['do'] = observableProto.tap = function (observerOrOnNext, onError, onCompleted) {
var tapObserver = typeof observerOrOnNext === 'function' || typeof observerOrOnNext === 'undefined'?
observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
observerOrOnNext;
return new TapObservable(this, tapObserver);
return new TapObservable(this, observerOrOnNext, onError, onCompleted);
};

@@ -66,0 +66,0 @@

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 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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc