UNPKG

oidc-client

Version:

OpenID Connect (OIDC) & OAuth2 client library

122 lines (120 loc) 136 kB
/** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. *****************************************************************************/ var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,d,l){if(l.get||l.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[d]=l.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this); $jscomp.polyfill=function(e,d,l,k){if(d){l=$jscomp.global;e=e.split(".");for(k=0;k<e.length-1;k++){var x=e[k];x in l||(l[x]={});l=l[x]}e=e[e.length-1];k=l[e];d=d(k);d!=k&&null!=d&&$jscomp.defineProperty(l,e,{configurable:!0,writable:!0,value:d})}};$jscomp.polyfill("Object.setPrototypeOf",function(e){return e?e:"object"!=typeof"".__proto__?null:function(d,e){d.__proto__=e;if(d.__proto__!==e)throw new TypeError(d+" is not extensible");return d}},"es6","es5"); $jscomp.owns=function(e,d){return Object.prototype.hasOwnProperty.call(e,d)};$jscomp.polyfill("Object.assign",function(e){return e?e:function(d,e){for(var k=1;k<arguments.length;k++){var l=arguments[k];if(l)for(var m in l)$jscomp.owns(l,m)&&(d[m]=l[m])}return d}},"es6-impl","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0; $jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++};$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}}; $jscomp.arrayIterator=function(e){var d=0;return $jscomp.iteratorPrototype(function(){return d<e.length?{done:!1,value:e[d++]}:{done:!0}})};$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.makeIterator=function(e){$jscomp.initSymbolIterator();var d=e[Symbol.iterator];return d?d.call(e):$jscomp.arrayIterator(e)};$jscomp.EXPOSE_ASYNC_EXECUTOR=!0;$jscomp.FORCE_POLYFILL_PROMISE=!1; $jscomp.polyfill("Promise",function(e){function d(){this.batch_=null}if(e&&!$jscomp.FORCE_POLYFILL_PROMISE)return e;d.prototype.asyncExecute=function(d){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(d);return this};d.prototype.asyncExecuteBatch_=function(){var d=this;this.asyncExecuteFunction(function(){d.executeBatch_()})};var l=$jscomp.global.setTimeout;d.prototype.asyncExecuteFunction=function(d){l(d,0)};d.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var d= this.batch_;this.batch_=[];for(var e=0;e<d.length;++e){var n=d[e];delete d[e];try{n()}catch(I){this.asyncThrow_(I)}}}this.batch_=null};d.prototype.asyncThrow_=function(d){this.asyncExecuteFunction(function(){throw d;})};var k=function(d){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var e=this.createResolveAndReject_();try{d(e.resolve,e.reject)}catch(n){e.reject(n)}};k.prototype.createResolveAndReject_=function(){function d(d){return function(m){n||(n=!0,d.call(e,m))}}var e=this,n= !1;return{resolve:d(this.resolveTo_),reject:d(this.reject_)}};k.prototype.resolveTo_=function(d){if(d===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(d instanceof k)this.settleSameAsPromise_(d);else{var e;a:switch(typeof d){case "object":e=null!=d;break a;case "function":e=!0;break a;default:e=!1}e?this.resolveToNonPromiseObj_(d):this.fulfill_(d)}};k.prototype.resolveToNonPromiseObj_=function(d){var e=void 0;try{e=d.then}catch(n){this.reject_(n);return}"function"== typeof e?this.settleSameAsThenable_(e,d):this.fulfill_(d)};k.prototype.reject_=function(d){this.settle_(2,d)};k.prototype.fulfill_=function(d){this.settle_(1,d)};k.prototype.settle_=function(d,e){if(0!=this.state_)throw Error("Cannot settle("+d+", "+e|"): Promise already settled in state"+this.state_);this.state_=d;this.result_=e;this.executeOnSettledCallbacks_()};k.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var d=this.onSettledCallbacks_,e=0;e<d.length;++e)d[e].call(), d[e]=null;this.onSettledCallbacks_=null}};var x=new d;k.prototype.settleSameAsPromise_=function(d){var e=this.createResolveAndReject_();d.callWhenSettled_(e.resolve,e.reject)};k.prototype.settleSameAsThenable_=function(d,e){var n=this.createResolveAndReject_();try{d.call(e,n.resolve,n.reject)}catch(I){n.reject(I)}};k.prototype.then=function(d,e){function n(d,e){return"function"==typeof d?function(e){try{l(d(e))}catch(ea){m(ea)}}:e}var l,m,Q=new k(function(d,e){l=d;m=e});this.callWhenSettled_(n(d, l),n(e,m));return Q};k.prototype.catch=function(d){return this.then(void 0,d)};k.prototype.callWhenSettled_=function(d,e){function n(){switch(k.state_){case 1:d(k.result_);break;case 2:e(k.result_);break;default:throw Error("Unexpected state: "+k.state_);}}var k=this;null==this.onSettledCallbacks_?x.asyncExecute(n):this.onSettledCallbacks_.push(function(){x.asyncExecute(n)})};k.resolve=function(d){return d instanceof k?d:new k(function(e,n){e(d)})};k.reject=function(d){return new k(function(e,n){n(d)})}; k.race=function(d){return new k(function(e,n){for(var l=$jscomp.makeIterator(d),m=l.next();!m.done;m=l.next())k.resolve(m.value).callWhenSettled_(e,n)})};k.all=function(d){var e=$jscomp.makeIterator(d),n=e.next();return n.done?k.resolve([]):new k(function(d,l){function m(e){return function(n){A[e]=n;I--;0==I&&d(A)}}var A=[],I=0;do A.push(void 0),I++,k.resolve(n.value).callWhenSettled_(m(A.length-1),l),n=e.next();while(!n.done)})};$jscomp.EXPOSE_ASYNC_EXECUTOR&&(k.$jscomp$new$AsyncExecutor=function(){return new d}); return k},"es6-impl","es3"); $jscomp.polyfill("WeakMap",function(e){function d(d){$jscomp.owns(d,k)||$jscomp.defineProperty(d,k,{value:{}})}function l(e){var n=Object[e];n&&(Object[e]=function(e){d(e);return n(e)})}if(function(){if(!e||!Object.seal)return!1;try{var d=Object.seal({}),n=Object.seal({}),k=new e([[d,2],[n,3]]);if(2!=k.get(d)||3!=k.get(n))return!1;k.delete(d);k.set(n,4);return!k.has(d)&&4==k.get(n)}catch(A){return!1}}())return e;var k="$jscomp_hidden_"+Math.random().toString().substring(2);l("freeze");l("preventExtensions"); l("seal");var x=0,m=function(d){this.id_=(x+=Math.random()+1).toString();if(d){$jscomp.initSymbol();$jscomp.initSymbolIterator();d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)e=e.value,this.set(e[0],e[1])}};m.prototype.set=function(e,n){d(e);if(!$jscomp.owns(e,k))throw Error("WeakMap key fail: "+e);e[k][this.id_]=n;return this};m.prototype.get=function(d){return $jscomp.owns(d,k)?d[k][this.id_]:void 0};m.prototype.has=function(d){return $jscomp.owns(d,k)&&$jscomp.owns(d[k],this.id_)};m.prototype.delete= function(d){return $jscomp.owns(d,k)&&$jscomp.owns(d[k],this.id_)?delete d[k][this.id_]:!1};return m},"es6-impl","es3");$jscomp.ASSUME_NO_NATIVE_MAP=!1; $jscomp.polyfill("Map",function(e){if(!$jscomp.ASSUME_NO_NATIVE_MAP&&function(){if(!e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var d=Object.seal({x:4}),k=new e($jscomp.makeIterator([[d,"s"]]));if("s"!=k.get(d)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=d||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x||"t"!=m.value[1]||!l.next().done?!1:!0}catch(va){return!1}}())return e;$jscomp.initSymbol(); $jscomp.initSymbolIterator();var d=new WeakMap,l=function(d){this.data_={};this.head_=m();this.size=0;if(d){d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)e=e.value,this.set(e[0],e[1])}};l.prototype.set=function(d,e){var n=k(this,d);n.list||(n.list=this.data_[n.id]=[]);n.entry?n.entry.value=e:(n.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:d,value:e},n.list.push(n.entry),this.head_.previous.next=n.entry,this.head_.previous=n.entry,this.size++);return this};l.prototype.delete= function(d){d=k(this,d);return d.entry&&d.list?(d.list.splice(d.index,1),d.list.length||delete this.data_[d.id],d.entry.previous.next=d.entry.next,d.entry.next.previous=d.entry.previous,d.entry.head=null,this.size--,!0):!1};l.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=m();this.size=0};l.prototype.has=function(d){return!!k(this,d).entry};l.prototype.get=function(d){return(d=k(this,d).entry)&&d.value};l.prototype.entries=function(){return x(this,function(d){return[d.key, d.value]})};l.prototype.keys=function(){return x(this,function(d){return d.key})};l.prototype.values=function(){return x(this,function(d){return d.value})};l.prototype.forEach=function(d,e){for(var k=this.entries(),l;!(l=k.next()).done;)l=l.value,d.call(e,l[1],l[0],this)};l.prototype[Symbol.iterator]=l.prototype.entries;var k=function(e,k){var l;l=k&&typeof k;"object"==l||"function"==l?d.has(k)?l=d.get(k):(l=""+ ++Q,d.set(k,l)):l="p_"+k;var m=e.data_[l];if(m&&$jscomp.owns(e.data_,l))for(e=0;e<m.length;e++){var n= m[e];if(k!==k&&n.key!==n.key||k===n.key)return{id:l,list:m,index:e,entry:n}}return{id:l,list:m,index:-1,entry:void 0}},x=function(d,e){var k=d.head_;return $jscomp.iteratorPrototype(function(){if(k){for(;k.head!=d.head_;)k=k.previous;for(;k.next!=k.head;)return k=k.next,{done:!1,value:e(k)};k=null}return{done:!0,value:void 0}})},m=function(){var d={};return d.previous=d.next=d.head=d},Q=0;return l},"es6-impl","es3");$jscomp.array=$jscomp.array||{}; $jscomp.iteratorFromArray=function(e,d){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var l=0,k={next:function(){if(l<e.length){var x=l++;return{value:d(x,e[x]),done:!1}}k.next=function(){return{done:!0,value:void 0}};return k.next()}};k[Symbol.iterator]=function(){return k};return k};$jscomp.polyfill("Array.prototype.values",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(d,e){return e})}},"es6","es3"); $jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6-impl","es3");$jscomp.ASSUME_NO_NATIVE_SET=!1; $jscomp.polyfill("Set",function(e){if(!$jscomp.ASSUME_NO_NATIVE_SET&&function(){if(!e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var d=Object.seal({x:4}),k=new e($jscomp.makeIterator([d]));if(!k.has(d)||1!=k.size||k.add(d)!=k||1!=k.size||k.add({x:4})!=k||2!=k.size)return!1;var x=k.entries(),m=x.next();if(m.done||m.value[0]!=d||m.value[1]!=d)return!1;m=x.next();return m.done||m.value[0]==d||4!=m.value[0].x||m.value[1]!=m.value[0]?!1:x.next().done}catch(Q){return!1}}())return e; $jscomp.initSymbol();$jscomp.initSymbolIterator();var d=function(d){this.map_=new Map;if(d){d=$jscomp.makeIterator(d);for(var e;!(e=d.next()).done;)this.add(e.value)}this.size=this.map_.size};d.prototype.add=function(d){this.map_.set(d,d);this.size=this.map_.size;return this};d.prototype.delete=function(d){d=this.map_.delete(d);this.size=this.map_.size;return d};d.prototype.clear=function(){this.map_.clear();this.size=0};d.prototype.has=function(d){return this.map_.has(d)};d.prototype.entries=function(){return this.map_.entries()}; d.prototype.values=function(){return this.map_.values()};d.prototype.keys=d.prototype.values;d.prototype[Symbol.iterator]=d.prototype.values;d.prototype.forEach=function(d,e){var k=this;this.map_.forEach(function(l){return d.call(e,l,l,k)})};return d},"es6-impl","es3"); (function(e,d){"object"===typeof exports&&"undefined"!==typeof module?d(exports):"function"===typeof define&&define.amd?define(["exports"],d):d(e.rxjs=e.rxjs||{})})(this,function(e){function d(c,a){function b(){this.constructor=c}Qb(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function l(c){return"function"===typeof c}function k(c){setTimeout(function(){throw c;})}function x(){try{return Pa.apply(this,arguments)}catch(c){return p.e=c,p}}function m(c){Pa=c;return x}function Q(c){Error.call(this); this.message=c?c.length+" errors occurred during unsubscription:\n"+c.map(function(a,b){return b+1+") "+a.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors=c;return this}function n(c){return c.reduce(function(a,b){return a.concat(b instanceof fa?b.errors:b)},[])}function I(c){for(;c;){var a=c.destination,b=c.isStopped;if(c.closed||b)return!1;c=a&&a instanceof q?a:null}return!0}function A(){}function wa(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return va(c)} function va(c){return c?1===c.length?c[0]:function(a){return c.reduce(function(b,a){return a(b)},a)}:A}function Oa(c){c||(c=H.Promise||Promise);if(!c)throw Error("no Promise impl found");return c}function J(){Error.call(this);this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}function ea(){return function(c){return c.lift(new Rb(c))}}function K(c){return c?Sb(c):R}function Sb(c){return new r(function(a){return c.schedule(function(){return a.complete()})})}function B(c){return c&& "function"===typeof c.schedule}function L(c,a){return a?new r(function(b){var f=new w,g=0;f.add(a.schedule(function(){g===c.length?b.complete():(b.next(c[g++]),b.closed||f.add(this.schedule()))}));return f}):new r(Qa(c))}function xa(c){var a=new r(function(b){b.next(c);b.complete()});a._isScalar=!0;a.value=c;return a}function ya(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];B(a)?c.pop():a=void 0;switch(c.length){case 0:return K(a);case 1:return a?L(c,a):xa(c[0]);default:return L(c, a)}}function za(c,a){return a?new r(function(b){return a.schedule(Tb,0,{error:c,subscriber:b})}):new r(function(b){return b.error(c)})}function Tb(c){c.subscriber.error(c.error)}function S(c){return c}function T(){Error.call(this);this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}function Ra(){Error.call(this);this.message="no elements in sequence";this.name="EmptyError";return this}function Aa(){Error.call(this);this.message="Timeout has occurred";this.name="TimeoutError"; return this}function G(c,a){return function(b){if("function"!==typeof c)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return b.lift(new Ub(c,a))}}function Sa(c,a,b){if(a)if(B(a))b=a;else return function(){for(var f=[],g=0;g<arguments.length;g++)f[g]=arguments[g];return Sa(c,b).apply(void 0,f).pipe(G(function(b){return D(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];var h=this,d,e={context:h,subject:d,callbackFunc:c, scheduler:b};return new r(function(f){if(b)return b.schedule(Vb,0,{args:a,subscriber:f,params:e});if(!d){d=new aa;try{c.apply(h,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];d.next(1>=b.length?b[0]:b);d.complete()}]))}catch(ga){I(d)?d.error(ga):console.warn(ga)}}return d.subscribe(f)})}}function Vb(c){var a=this,b=c.args,f=c.subscriber;c=c.params;var g=c.callbackFunc,h=c.context,d=c.scheduler,e=c.subject;if(!e){e=c.subject=new aa;try{g.apply(h,b.concat([function(){for(var b= [],c=0;c<arguments.length;c++)b[c]=arguments[c];a.add(d.schedule(Wb,0,{value:1>=b.length?b[0]:b,subject:e}))}]))}catch(U){e.error(U)}}this.add(e.subscribe(f))}function Wb(c){var a=c.subject;a.next(c.value);a.complete()}function Ta(c,a,b){if(a)if(B(a))b=a;else return function(){for(var f=[],g=0;g<arguments.length;g++)f[g]=arguments[g];return Ta(c,b).apply(void 0,f).pipe(G(function(b){return D(b)?a.apply(void 0,b):a(b)}))};return function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g]; var h={subject:void 0,args:a,callbackFunc:c,scheduler:b,context:this};return new r(function(f){var g=h.context,d=h.subject;if(b)return b.schedule(Xb,0,{params:h,subscriber:f,context:g});if(!d){d=h.subject=new aa;try{c.apply(g,a.concat([function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];(a=b.shift())?d.error(a):(d.next(1>=b.length?b[0]:b),d.complete())}]))}catch(ga){I(d)?d.error(ga):console.warn(ga)}}return d.subscribe(f)})}}function Xb(c){var a=this,b=c.params,f=c.subscriber;c=c.context; var g=b.callbackFunc,h=b.args,d=b.scheduler,e=b.subject;if(!e){e=b.subject=new aa;try{g.apply(c,h.concat([function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];(c=b.shift())?a.add(d.schedule(Ua,0,{err:c,subject:e})):a.add(d.schedule(Yb,0,{value:1>=b.length?b[0]:b,subject:e}))}]))}catch(U){this.add(d.schedule(Ua,0,{err:U,subject:e}))}}this.add(e.subscribe(f))}function Yb(c){var a=c.subject;a.next(c.value);a.complete()}function Ua(c){c.subject.error(c.err)}function Va(c){return c&&"function"!== typeof c.subscribe&&"function"===typeof c.then}function u(c,a,b,f,g){void 0===g&&(g=new O(c,b,f));if(!g.closed)return Wa(a)(g)}function Zb(c,a){return a?new r(function(b){var f=new w;f.add(a.schedule(function(){return c.then(function(c){f.add(a.schedule(function(){b.next(c);f.add(a.schedule(function(){return b.complete()}))}))},function(c){f.add(a.schedule(function(){return b.error(c)}))})}));return f}):new r(Xa(c))}function $b(c,a){if(!c)throw Error("Iterable cannot be null");return a?new r(function(b){var f= new w,g;f.add(function(){g&&"function"===typeof g.return&&g.return()});f.add(a.schedule(function(){g=c[M]();f.add(a.schedule(function(){if(!b.closed){var a,c;try{var f=g.next();a=f.value;c=f.done}catch(U){b.error(U);return}c?b.complete():(b.next(a),this.schedule())}}))}));return f}):new r(Ya(c))}function ac(c,a){return a?new r(function(b){var f=new w;f.add(a.schedule(function(){var g=c[ba]();f.add(g.subscribe({next:function(c){f.add(a.schedule(function(){return b.next(c)}))},error:function(c){f.add(a.schedule(function(){return b.error(c)}))}, complete:function(){f.add(a.schedule(function(){return b.complete()}))}}))}));return f}):new r(Za(c))}function N(c,a){if(!a)return c instanceof r?c:new r(Wa(c));if(null!=c){if(c&&"function"===typeof c[ba])return ac(c,a);if(Va(c))return Zb(c,a);if($a(c))return L(c,a);if(c&&"function"===typeof c[M]||"string"===typeof c)return $b(c,a)}throw new TypeError((null!==c&&typeof c||c)+" is not observable");}function V(c,a,b){void 0===b&&(b=Number.POSITIVE_INFINITY);if("function"===typeof a)return function(f){return f.pipe(V(function(b, f){return N(c(b,f)).pipe(G(function(c,g){return a(b,c,f,g)}))},b))};"number"===typeof a&&(b=a);return function(a){return a.lift(new bc(c,b))}}function Ca(c){void 0===c&&(c=Number.POSITIVE_INFINITY);return V(S,c)}function ab(){return Ca(1)}function P(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];return 1===c.length||2===c.length&&B(c[1])?N(c[0]):ab()(ya.apply(void 0,c))}function Da(c){return new r(function(a){var b;try{b=c()}catch(f){a.error(f);return}return(b?N(b):K()).subscribe(a)})} function bb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];var b;"function"===typeof c[c.length-1]&&(b=c.pop());1===c.length&&D(c[0])&&(c=c[0]);return 0===c.length?R:b?bb(c).pipe(G(function(a){return b.apply(void 0,a)})):new r(function(b){return new cc(b,c)})}function cb(c,a,b,f){l(b)&&(f=b,b=void 0);return f?cb(c,a,b).pipe(G(function(b){return D(b)?f.apply(void 0,b):f(b)})):new r(function(f){db(c,a,function(b){1<arguments.length?f.next(Array.prototype.slice.call(arguments)):f.next(b)}, f,b)})}function db(c,a,b,f,g){var h;if(c&&"function"===typeof c.addEventListener&&"function"===typeof c.removeEventListener)c.addEventListener(a,b,g),h=function(){return c.removeEventListener(a,b,g)};else if(c&&"function"===typeof c.on&&"function"===typeof c.off)c.on(a,b),h=function(){return c.off(a,b)};else if(c&&"function"===typeof c.addListener&&"function"===typeof c.removeListener)c.addListener(a,b),h=function(){return c.removeListener(a,b)};else if(c&&c.length)for(var d=0,e=c.length;d<e;d++)db(c[d], a,b,f,g);else throw new TypeError("Invalid event target");f.add(h)}function eb(c,a,b){return b?eb(c,a).pipe(G(function(a){return D(a)?b.apply(void 0,a):b(a)})):new r(function(b){var f=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return b.next(1===a.length?a[0]:a)},h;try{h=c(f)}catch(E){b.error(E);return}if(l(a))return function(){return a(f,h)}})}function dc(c){var a=c.subscriber,b=c.condition;if(!a.closed){if(c.needIterate)try{c.state=c.iterate(c.state)}catch(h){a.error(h); return}else c.needIterate=!0;if(b){var f=void 0;try{f=b(c.state)}catch(h){a.error(h);return}if(!f){a.complete();return}if(a.closed)return}var g;try{g=c.resultSelector(c.state)}catch(h){a.error(h);return}if(!a.closed&&(a.next(g),!a.closed))return this.schedule(c)}}function ca(c){return!D(c)&&0<=c-parseFloat(c)+1}function ec(c){var a=c.subscriber,b=c.counter;c=c.period;a.next(b);this.schedule({subscriber:a,counter:b+1,period:c},c)}function fb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a]; var a=Number.POSITIVE_INFINITY,b=null,f=c[c.length-1];B(f)?(b=c.pop(),1<c.length&&"number"===typeof c[c.length-1]&&(a=c.pop())):"number"===typeof f&&(a=c.pop());return null===b&&1===c.length&&c[0]instanceof r?c[0]:Ca(a)(L(c,b))}function Ea(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(0===c.length)return R;var b=c[0],f=c.slice(1);return 1===c.length&&D(b)?Ea.apply(void 0,b):new r(function(a){var c=function(){return a.add(Ea.apply(void 0,f).subscribe(a))};return N(b).subscribe({next:function(b){a.next(b)}, error:c,complete:c})})}function fc(c){var a=c.keys,b=c.index,f=c.subscriber,g=c.subscription;c=c.obj;if(!f.closed)if(b<a.length){var h=a[b];f.next([h,c[h]]);g.add(this.schedule({keys:a,index:b+1,subscriber:f,subscription:g,obj:c}))}else f.complete()}function gb(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];if(1===c.length)if(D(c[0]))c=c[0];else return c[0];return L(c,void 0).lift(new gc)}function hc(c){var a=c.start,b=c.index,f=c.subscriber;b>=c.count?f.complete():(f.next(a),f.closed|| (c.index=b+1,c.start=a+1,this.schedule(c)))}function hb(c,a,b){void 0===c&&(c=0);var f=-1;ca(a)?f=1>Number(a)&&1||Number(a):B(a)&&(b=a);B(b)||(b=C);return new r(function(a){var g=ca(c)?c:+c-b.now();return b.schedule(ic,g,{index:0,period:f,subscriber:a})})}function ic(c){var a=c.index,b=c.period,f=c.subscriber;f.next(a);if(!f.closed){if(-1===b)return f.complete();c.index=a+1;this.schedule(c,b)}}function ib(){for(var c=[],a=0;a<arguments.length;a++)c[a]=arguments[a];a=c[c.length-1];"function"===typeof a&& c.pop();return L(c,void 0).lift(new jb(a))}function kb(c){return function(a){return a.lift(new jc(c))}}function lb(c){var a=c.subscriber,b=c.context;b&&a.closeContext(b);a.closed||(c.context=a.openContext(),c.context.closeAction=this.schedule(c,c.bufferTimeSpan))}function kc(c){var a=c.bufferCreationInterval,b=c.bufferTimeSpan,f=c.subscriber,g=c.scheduler,h=f.openContext();f.closed||(f.add(h.closeAction=g.schedule(mb,b,{subscriber:f,context:h})),this.schedule(c,a))}function mb(c){c.subscriber.closeContext(c.context)} function nb(c,a){return V(c,a,1)}function lc(c){c.debouncedNext()}function ha(c){void 0===c&&(c=null);return function(a){return a.lift(new mc(c))}}function ob(c,a){return function(b){return b.lift(new nc(c,a))}}function da(c,a){return function(b){return b.lift(new oc(c,a))}}function pb(c,a,b){return function(f){return f.lift(new pc(c,a,b))}}function qc(){return new ia}function Fa(c){return function(a){return 0===c?K():a.lift(new rc(c))}}function qb(c,a){return a?function(b){return b.pipe(qb(function(b, g){return N(c(b,g)).pipe(G(function(c,f){return a(b,c,g,f)}))}))}:function(b){return b.lift(new sc(c))}}function na(c){return function(a){return 0===c?K():a.lift(new tc(c))}}function oa(c,a){var b=!1;2<=arguments.length&&(b=!0);return function(f){return f.lift(new uc(c,a,b))}}function pa(c,a){return 2<=arguments.length?function(b){return wa(oa(c,a),na(1),ha(a))(b)}:function(b){return wa(oa(function(b,a,h){return c(b,a,h+1)}),na(1))(b)}}function W(c,a){return function(b){var f;f="function"===typeof c? c:function(){return c};if("function"===typeof a)return b.lift(new vc(f,a));var g=Object.create(b,wc);g.source=b;g.subjectFactory=f;return g}}function xc(c,a){function b(){return!b.pred.apply(b.thisArg,arguments)}b.pred=c;b.thisArg=a;return b}function yc(c,a){return function(b){var f=b;for(b=0;b<a;b++)if(f=f[c[b]],"undefined"===typeof f)return;return f}}function zc(c){var a=c.period;c.subscriber.notifyNext();this.schedule(c,a)}function Ac(){return new y}function Bc(c,a,b){var f,g=0,h,d=!1,e=!1;return function(E){g++; if(!f||d)d=!1,f=new X(c,a,b),h=E.subscribe({next:function(b){f.next(b)},error:function(b){d=!0;f.error(b)},complete:function(){e=!0;f.complete()}});var k=f.subscribe(this);return function(){g--;k.unsubscribe();h&&0===g&&e&&h.unsubscribe()}}}function ja(c,a){return"function"===typeof a?function(b){return b.pipe(ja(function(b,g){return N(c(b,g)).pipe(G(function(c,f){return a(b,c,g,f)}))}))}:function(b){return b.lift(new Cc(c))}}function Dc(c){c.subscriber.clearThrottle()}function rb(c,a,b){void 0=== b&&(b=C);return function(f){var g=c instanceof Date&&!isNaN(+c),h=g?+c-b.now():Math.abs(c);return f.lift(new Ec(h,g,a,b))}}function Fc(c,a,b){if(0===b)return[a];c.push(a);return c}function Gc(c){var a=c.subscriber,b=c.windowTimeSpan,f=c.window;f&&a.closeWindow(f);c.window=a.openWindow();this.schedule(c,b)}function Hc(c){var a=c.windowTimeSpan,b=c.subscriber,f=c.scheduler,g=c.windowCreationInterval,h=b.openWindow(),d={action:this,subscription:null};d.subscription=f.schedule(sb,a,{subscriber:b,window:h, context:d});this.add(d.subscription);this.schedule(c,g)}function sb(c){var a=c.subscriber,b=c.window;(c=c.context)&&c.action&&c.subscription&&c.action.remove(c.subscription);a.closeWindow(b)}function tb(c,a){for(var b=0,f=a.length;b<f;b++)for(var g=a[b],h=Object.getOwnPropertyNames(g.prototype),d=0,e=h.length;d<e;d++){var k=h[d];c.prototype[k]=g.prototype[k]}}function Ic(c,a){void 0===a&&(a=null);return new Y({method:"GET",url:c,headers:a})}function Jc(c,a,b){return new Y({method:"POST",url:c,body:a, headers:b})}function Kc(c,a){return new Y({method:"DELETE",url:c,headers:a})}function Lc(c,a,b){return new Y({method:"PUT",url:c,body:a,headers:b})}function Mc(c,a,b){return new Y({method:"PATCH",url:c,body:a,headers:b})}function Nc(c,a){return Oc(new Y({method:"GET",url:c,responseType:"json",headers:a}))}function ub(c,a,b){Error.call(this);this.message=c;this.name="AjaxError";this.xhr=a;this.request=b;this.status=a.status;this.responseType=a.responseType||b.responseType;this.response=vb(this.responseType, a);return this}function Pc(c){return"response"in c?c.responseType?c.response:JSON.parse(c.response||c.responseText||"null"):JSON.parse(c.responseText||"null")}function vb(c,a){switch(c){case "json":return m(Pc)(a);case "xml":return a.responseXML;default:return"response"in a?a.response:a.responseText}}var Qb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},Qc=Object.assign||function(c){for(var a,b=1, f=arguments.length;b<f;b++){a=arguments[b];for(var g in a)Object.prototype.hasOwnProperty.call(a,g)&&(c[g]=a[g])}return c},Ga=!1,H={Promise:void 0,set useDeprecatedSynchronousErrorHandling(c){c?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):Ga&&console.log("RxJS: Back to a better error behavior. Thank you. \x3c3");Ga=c},get useDeprecatedSynchronousErrorHandling(){return Ga}},qa={closed:!0,next:function(c){},error:function(c){if(H.useDeprecatedSynchronousErrorHandling)throw c; k(c)},complete:function(){}},D=Array.isArray||function(c){return c&&"number"===typeof c.length},p={e:{}},Pa;Q.prototype=Object.create(Error.prototype);var fa=Q,w=function(){function c(a){this.closed=!1;this._subscriptions=this._parents=this._parent=null;a&&(this._unsubscribe=a)}c.prototype.unsubscribe=function(){var a=!1,b;if(!this.closed){var c=this._parent,g=this._parents,h=this._unsubscribe,d=this._subscriptions;this.closed=!0;this._subscriptions=this._parents=this._parent=null;for(var e=-1,k= g?g.length:0;c;)c.remove(this),c=++e<k&&g[e]||null;l(h)&&(c=m(h).call(this),c===p&&(a=!0,b=b||(p.e instanceof fa?n(p.e.errors):[p.e])));if(D(d))for(e=-1,k=d.length;++e<k;)c=d[e],null!=c&&"object"===typeof c&&(c=m(c.unsubscribe).call(c),c===p&&(a=!0,b=b||[],c=p.e,c instanceof fa?b=b.concat(n(c.errors)):b.push(c)));if(a)throw new fa(b);}};c.prototype.add=function(a){if(!a||a===c.EMPTY)return c.EMPTY;if(a===this)return this;var b=a;switch(typeof a){case "function":b=new c(a);case "object":if(b.closed|| "function"!==typeof b.unsubscribe)return b;if(this.closed)return b.unsubscribe(),b;"function"!==typeof b._addParent&&(a=b,b=new c,b._subscriptions=[a]);break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}(this._subscriptions||(this._subscriptions=[])).push(b);b._addParent(this);return b};c.prototype.remove=function(a){var b=this._subscriptions;b&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))};c.prototype._addParent=function(a){var b=this._parent,c=this._parents;b&&b!==a?c?-1=== c.indexOf(a)&&c.push(a):this._parents=[a]:this._parent=a};c.EMPTY=function(a){a.closed=!0;return a}(new c);return c}(),ra="function"===typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),q=function(c){function a(b,f,g){var h=c.call(this)||this;h.syncErrorValue=null;h.syncErrorThrown=!1;h.syncErrorThrowable=!1;h.isStopped=!1;h._parentSubscription=null;switch(arguments.length){case 0:h.destination=qa;break;case 1:if(!b){h.destination=qa;break}if("object"===typeof b){b instanceof a? (h.syncErrorThrowable=b.syncErrorThrowable,h.destination=b,b.add(h)):(h.syncErrorThrowable=!0,h.destination=new wb(h,b));break}default:h.syncErrorThrowable=!0,h.destination=new wb(h,b,f,g)}return h}d(a,c);a.prototype[ra]=function(){return this};a.create=function(b,c,g){b=new a(b,c,g);b.syncErrorThrowable=!1;return b};a.prototype.next=function(b){this.isStopped||this._next(b)};a.prototype.error=function(b){this.isStopped||(this.isStopped=!0,this._error(b))};a.prototype.complete=function(){this.isStopped|| (this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,c.prototype.unsubscribe.call(this))};a.prototype._next=function(b){this.destination.next(b)};a.prototype._error=function(b){this.destination.error(b);this.unsubscribe()};a.prototype._complete=function(){this.destination.complete();this.unsubscribe()};a.prototype._unsubscribeAndRecycle=function(){var b=this._parent,a=this._parents;this._parents=this._parent=null;this.unsubscribe();this.isStopped= this.closed=!1;this._parent=b;this._parents=a;this._parentSubscription=null;return this};return a}(w),wb=function(c){function a(b,a,g,h){var f=c.call(this)||this;f._parentSubscriber=b;var d;b=f;l(a)?d=a:a&&(d=a.next,g=a.error,h=a.complete,a!==qa&&(b=Object.create(a),l(b.unsubscribe)&&f.add(b.unsubscribe.bind(b)),b.unsubscribe=f.unsubscribe.bind(f)));f._context=b;f._next=d;f._error=g;f._complete=h;return f}d(a,c);a.prototype.next=function(b){if(!this.isStopped&&this._next){var a=this._parentSubscriber; H.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,this._next,b)&&this.unsubscribe():this.__tryOrUnsub(this._next,b)}};a.prototype.error=function(b){if(!this.isStopped){var a=this._parentSubscriber,c=H.useDeprecatedSynchronousErrorHandling;if(this._error)c&&a.syncErrorThrowable?this.__tryOrSetError(a,this._error,b):this.__tryOrUnsub(this._error,b),this.unsubscribe();else if(a.syncErrorThrowable)c?(a.syncErrorValue=b,a.syncErrorThrown=!0):k(b),this.unsubscribe();else{this.unsubscribe(); if(c)throw b;k(b)}}};a.prototype.complete=function(){var b=this;if(!this.isStopped){var a=this._parentSubscriber;if(this._complete){var c=function(){return b._complete.call(b._context)};H.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable?this.__tryOrSetError(a,c):this.__tryOrUnsub(c)}this.unsubscribe()}};a.prototype.__tryOrUnsub=function(b,a){try{b.call(this._context,a)}catch(g){this.unsubscribe();if(H.useDeprecatedSynchronousErrorHandling)throw g;k(g)}};a.prototype.__tryOrSetError=function(b, a,c){if(!H.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{a.call(this._context,c)}catch(h){return H.useDeprecatedSynchronousErrorHandling?(b.syncErrorValue=h,b.syncErrorThrown=!0):k(h),!0}return!1};a.prototype._unsubscribe=function(){var b=this._parentSubscriber;this._parentSubscriber=this._context=null;b.unsubscribe()};return a}(q),ba="function"===typeof Symbol&&Symbol.observable||"@@observable",r=function(){function c(a){this._isScalar=!1;a&&(this._subscribe=a)}c.prototype.lift= function(a){var b=new c;b.source=this;b.operator=a;return b};c.prototype.subscribe=function(a,b,c){var f=this.operator;a:{if(a){if(a instanceof q)break a;if(a[ra]){a=a[ra]();break a}}a=a||b||c?new q(a,b,c):new q(qa)}f?f.call(a,this.source):a.add(this.source||H.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a));if(H.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a}; c.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(b){H.useDeprecatedSynchronousErrorHandling&&(a.syncErrorThrown=!0,a.syncErrorValue=b),I(a)?a.error(b):console.warn(b)}};c.prototype.forEach=function(a,b){var c=this;b=Oa(b);return new b(function(b,f){var g;g=c.subscribe(function(b){try{a(b)}catch(U){f(U),g&&g.unsubscribe()}},f,b)})};c.prototype._subscribe=function(a){var b=this.source;return b&&b.subscribe(a)};c.prototype[ba]=function(){return this};c.prototype.pipe=function(){for(var a= [],b=0;b<arguments.length;b++)a[b]=arguments[b];return 0===a.length?this:va(a)(this)};c.prototype.toPromise=function(a){var b=this;a=Oa(a);return new a(function(a,c){var f;b.subscribe(function(b){return f=b},function(b){return c(b)},function(){return a(f)})})};c.create=function(a){return new c(a)};return c}();J.prototype=Object.create(Error.prototype);var xb=function(c){function a(b,a){var f=c.call(this)||this;f.subject=b;f.subscriber=a;f.closed=!1;return f}d(a,c);a.prototype.unsubscribe=function(){if(!this.closed){this.closed= !0;var b=this.subject,a=b.observers;this.subject=null;!a||0===a.length||b.isStopped||b.closed||(b=a.indexOf(this.subscriber),-1!==b&&a.splice(b,1))}};return a}(w),yb=function(c){function a(b){var a=c.call(this,b)||this;a.destination=b;return a}d(a,c);return a}(q),y=function(c){function a(){var b=c.call(this)||this;b.observers=[];b.closed=!1;b.isStopped=!1;b.hasError=!1;b.thrownError=null;return b}d(a,c);a.prototype[ra]=function(){return new yb(this)};a.prototype.lift=function(b){var a=new Ha(this, this);a.operator=b;return a};a.prototype.next=function(b){if(this.closed)throw new J;if(!this.isStopped)for(var a=this.observers,c=a.length,a=a.slice(),h=0;h<c;h++)a[h].next(b)};a.prototype.error=function(b){if(this.closed)throw new J;this.hasError=!0;this.thrownError=b;this.isStopped=!0;for(var a=this.observers,c=a.length,a=a.slice(),h=0;h<c;h++)a[h].error(b);this.observers.length=0};a.prototype.complete=function(){if(this.closed)throw new J;this.isStopped=!0;for(var b=this.observers,a=b.length, b=b.slice(),c=0;c<a;c++)b[c].complete();this.observers.length=0};a.prototype.unsubscribe=function(){this.closed=this.isStopped=!0;this.observers=null};a.prototype._trySubscribe=function(b){if(this.closed)throw new J;return c.prototype._trySubscribe.call(this,b)};a.prototype._subscribe=function(b){if(this.closed)throw new J;if(this.hasError)return b.error(this.thrownError),w.EMPTY;if(this.isStopped)return b.complete(),w.EMPTY;this.observers.push(b);return new xb(this,b)};a.prototype.asObservable=function(){var b= new r;b.source=this;return b};a.create=function(b,a){return new Ha(b,a)};return a}(r),Ha=function(c){function a(b,a){var f=c.call(this)||this;f.destination=b;f.source=a;return f}d(a,c);a.prototype.next=function(b){var a=this.destination;a&&a.next&&a.next(b)};a.prototype.error=function(b){var a=this.destination;a&&a.error&&this.destination.error(b)};a.prototype.complete=function(){var b=this.destination;b&&b.complete&&this.destination.complete()};a.prototype._subscribe=function(b){return this.source? this.source.subscribe(b):w.EMPTY};return a}(y),Rb=function(){function c(a){this.connectable=a}c.prototype.call=function(a,b){var c=this.connectable;c._refCount++;a=new Rc(a,c);b=b.subscribe(a);a.closed||(a.connection=c.connect());return b};return c}(),Rc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}d(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection= null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a}(q),zb=function(c){function a(b,a){var f=c.call(this)||this;f.source=b;f.subjectFactory=a;f._refCount=0;f._isComplete=!1;return f}d(a,c);a.prototype._subscribe=function(b){return this.getSubject().subscribe(b)};a.prototype.getSubject=function(){var b=this._subject;if(!b||b.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype.connect=function(){var b= this._connection;b||(this._isComplete=!1,b=this._connection=new w,b.add(this.source.subscribe(new Sc(this.getSubject(),this))),b.closed?(this._connection=null,b=w.EMPTY):this._connection=b);return b};a.prototype.refCount=function(){return ea()(this)};return a}(r),ka=zb.prototype,wc={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:ka._subscribe},_isComplete:{value:ka._isComplete,writable:!0},getSubject:{value:ka.getSubject}, connect:{value:ka.connect},refCount:{value:ka.refCount}},Sc=function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}d(a,c);a.prototype._error=function(b){this._unsubscribe();c.prototype._error.call(this,b)};a.prototype._complete=function(){this.connectable._isComplete=!0;this._unsubscribe();c.prototype._complete.call(this)};a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._connection;b._refCount=0;b._subject=null;b._connection=null; a&&a.unsubscribe()}};return a}(yb);(function(c){function a(b,a){b=c.call(this,b)||this;b.connectable=a;return b}d(a,c);a.prototype._unsubscribe=function(){var b=this.connectable;if(b){this.connectable=null;var a=b._refCount;0>=a?this.connection=null:(b._refCount=a-1,1<a?this.connection=null:(a=this.connection,b=b._connection,this.connection=null,!b||a&&b!==a||b.unsubscribe()))}else this.connection=null};return a})(q);var Uc=function(){function c(a,b,c,g){this.keySelector=a;this.elementSelector=b; this.durationSelector=c;this.subjectSelector=g}c.prototype.call=function(a,b){return b.subscribe(new Tc(a,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))};return c}(),Tc=function(c){function a(b,a,g,h,d){b=c.call(this,b)||this;b.keySelector=a;b.elementSelector=g;b.durationSelector=h;b.subjectSelector=d;b.groups=null;b.attemptedToUnsubscribe=!1;b.count=0;return b}d(a,c);a.prototype._next=function(b){var a;try{a=this.keySelector(b)}catch(g){this.error(g);return}this._group(b, a)};a.prototype._group=function(b,a){var c=this.groups;c||(c=this.groups=new Map);var f=c.get(a),d;if(this.elementSelector)try{d=this.elementSelector(b)}catch(Ba){this.error(Ba)}else d=b;if(!f&&(f=this.subjectSelector?this.subjectSelector():new y,c.set(a,f),b=new Ia(a,f,this),this.destination.next(b),this.durationSelector)){b=void 0;try{b=this.durationSelector(new Ia(a,f))}catch(Ba){this.error(Ba);return}this.add(b.subscribe(new Vc(a,f,this)))}f.closed||f.next(d)};a.prototype._error=function(b){var a= this.groups;a&&(a.forEach(function(a,c){a.error(b)}),a.clear());this.destination.error(b)};a.prototype._complete=function(){var b=this.groups;b&&(b.forEach(function(b,a){b.complete()}),b.clear());this.destination.complete()};a.prototype.removeGroup=function(b){this.groups.delete(b)};a.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&c.prototype.unsubscribe.call(this))};return a}(q),Vc=function(c){function a(b,a,g){var f=c.call(this,a)||this;f.key=b;f.group= a;f.parent=g;return f}d(a,c);a.prototype._next=function(b){this.complete()};a.prototype._unsubscribe=function(){var b=this.parent,a=this.key;this.key=this.parent=null;b&&b.removeGroup(a)};return a}(q),Ia=function(c){function a(b,a,g){var f=c.call(this)||this;f.key=b;f.groupSubject=a;f.refCountSubscription=g;return f}d(a,c);a.prototype._subscribe=function(b){var a=new w,c=this.refCountSubscription,h=this.groupSubject;c&&!c.closed&&a.add(new Wc(c));a.add(h.subscribe(b));return a};return a}(r),Wc=function(c){function a(b){var a= c.call(this)||this;a.parent=b;b.count++;return a}d(a,c);a.prototype.unsubscribe=function(){var b=this.parent;b.closed||this.closed||(c.prototype.unsubscribe.call(this),--b.count,0===b.count&&b.attemptedToUnsubscribe&&b.unsubscribe())};return a}(w),Ab=function(c){function a(b){var a=c.call(this)||this;a._value=b;return a}d(a,c);Object.defineProperty(a.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0});a.prototype._subscribe=function(b){var a=c.prototype._subscribe.call(this, b);a&&!a.closed&&b.next(this._value);return a};a.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new J;return this._value};a.prototype.next=function(b){c.prototype.next.call(this,this._value=b)};return a}(y),la=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;f.pending=!1;return f}d(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(this.closed)return this;this.state=b;b=this.id;var c=this.scheduler;null!=b&&(this.id= this.recycleAsyncId(c,b,a));this.pending=!0;this.delay=a;this.id=this.id||this.requestAsyncId(c,this.id,a);return this};a.prototype.requestAsyncId=function(b,a,c){void 0===c&&(c=0);return setInterval(b.flush.bind(b,this),c)};a.prototype.recycleAsyncId=function(b,a,c){void 0===c&&(c=0);if(null!==c&&this.delay===c&&!1===this.pending)return a;clearInterval(a)};a.prototype.execute=function(b,a){if(this.closed)return Error("executing a cancelled action");this.pending=!1;if(b=this._execute(b,a))return b; !1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(b,a){a=!1;var c=void 0;try{this.work(b)}catch(h){a=!0,c=!!h&&h||Error(h)}if(a)return this.unsubscribe(),c};a.prototype._unsubscribe=function(){var b=this.id,a=this.scheduler,c=a.actions,h=c.indexOf(this);this.state=this.work=null;this.pending=!1;this.scheduler=null;-1!==h&&c.splice(h,1);null!=b&&(this.id=this.recycleAsyncId(a,b,null));this.delay=null};return a}(function(c){function a(b, a){return c.call(this)||this}d(a,c);a.prototype.schedule=function(b,a){return this};return a}(w)),Xc=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;return f}d(a,c);a.prototype.schedule=function(b,a){void 0===a&&(a=0);if(0<a)return c.prototype.schedule.call(this,b,a);this.delay=a;this.state=b;this.scheduler.flush(this);return this};a.prototype.execute=function(b,a){return 0<a||this.closed?c.prototype.execute.call(this,b,a):this._execute(b,a)};a.prototype.requestAsyncId= function(b,a,g){void 0===g&&(g=0);return null!==g&&0<g||null===g&&0<this.delay?c.prototype.requestAsyncId.call(this,b,a,g):b.flush(this)};return a}(la),Ja=function(){function c(a,b){void 0===b&&(b=c.now);this.SchedulerAction=a;this.now=b}c.prototype.schedule=function(a,b,c){void 0===b&&(b=0);return(new this.SchedulerAction(this,a)).schedule(c,b)};c.now=function(){return Date.now()};return c}(),Z=function(c){function a(b,f){void 0===f&&(f=Ja.now);var g=c.call(this,b,function(){return a.delegate&&a.delegate!== g?a.delegate.now():f()})||this;g.actions=[];g.active=!1;g.scheduled=void 0;return g}d(a,c);a.prototype.schedule=function(b,f,g){void 0===f&&(f=0);return a.delegate&&a.delegate!==this?a.delegate.schedule(b,f,g):c.prototype.schedule.call(this,b,f,g)};a.prototype.flush=function(b){var a=this.actions;if(this.active)a.push(b);else{var c;this.active=!0;do if(c=b.execute(b.state,b.delay))break;while(b=a.shift());this.active=!1;if(c){for(;b=a.shift();)b.unsubscribe();throw c;}}};return a}(Ja),Bb=new (function(c){function a(){return null!== c&&c.apply(this,arguments)||this}d(a,c);return a}(Z))(Xc),R=new r(function(c){return c.complete()}),Qa=function(c){return function(a){for(var b=0,f=c.length;b<f&&!a.closed;b++)a.next(c[b]);a.closed||a.complete()}},z=function(){function c(a,b,c){this.kind=a;this.value=b;this.error=c;this.hasValue="N"===a}c.prototype.observe=function(a){switch(this.kind){case "N":return a.next&&a.next(this.value);case "E":return a.error&&a.error(this.error);case "C":return a.complete&&a.complete()}};c.prototype.do= function(a,b,c){switch(this.kind){case "N":return a&&a(this.value);case "E":return b&&b(this.error);case "C":return c&&c()}};c.prototype.accept=function(a,b,c){return a&&"function"===typeof a.next?this.observe(a):this.do(a,b,c)};c.prototype.toObservable=function(){switch(this.kind){case "N":return ya(this.value);case "E":return za(this.error);case "C":return K()}throw Error("unexpected notification kind value");};c.createNext=function(a){return"undefined"!==typeof a?new c("N",a):c.undefinedValueNotification}; c.createError=function(a){return new c("E",void 0,a)};c.createComplete=function(){return c.completeNotification};c.completeNotification=new c("C");c.undefinedValueNotification=new c("N",void 0);return c}(),Yc=function(){function c(a,b){void 0===b&&(b=0);this.scheduler=a;this.delay=b}c.prototype.call=function(a,b){return b.subscribe(new Cb(a,this.scheduler,this.delay))};return c}(),Cb=function(c){function a(b,a,g){void 0===g&&(g=0);b=c.call(this,b)||this;b.scheduler=a;b.delay=g;return b}d(a,c);a.dispatch= function(b){b.notification.observe(b.destination);this.unsubscribe()};a.prototype.scheduleMessage=function(b){this.destination.add(this.scheduler.schedule(a.dispatch,this.delay,new Zc(b,this.destination)))};a.prototype._next=function(b){this.scheduleMessage(z.createNext(b))};a.prototype._error=function(b){this.scheduleMessage(z.createError(b));this.unsubscribe()};a.prototype._complete=function(){this.scheduleMessage(z.createComplete());this.unsubscribe()};return a}(q),Zc=function(){return function(c, a){this.notification=c;this.destination=a}}(),X=function(c){function a(b,a,g){void 0===b&&(b=Number.POSITIVE_INFINITY);void 0===a&&(a=Number.POSITIVE_INFINITY);var f=c.call(this)||this;f.scheduler=g;f._events=[];f._infiniteTimeWindow=!1;f._bufferSize=1>b?1:b;f._windowTime=1>a?1:a;a===Number.POSITIVE_INFINITY?(f._infiniteTimeWindow=!0,f.next=f.nextInfiniteTimeWindow):f.next=f.nextTimeWindow;return f}d(a,c);a.prototype.nextInfiniteTimeWindow=function(b){var a=this._events;a.push(b);a.length>this._bufferSize&& a.shift();c.prototype.next.call(this,b)};a.prototype.nextTimeWindow=function(b){this._events.push(new $c(this._getNow(),b));this._trimBufferThenGetEvents();c.prototype.next.call(this,b)};a.prototype._subscribe=function(b){var a=this._infiniteTimeWindow,c=a?this._events:this._trimBufferThenGetEvents(),h=this.scheduler,d=c.length,e;if(this.closed)throw new J;this.isStopped||this.hasError?e=w.EMPTY:(this.observers.push(b),e=new xb(this,b));h&&b.add(b=new Cb(b,h));if(a)for(a=0;a<d&&!b.closed;a++)b.next(c[a]); else for(a=0;a<d&&!b.closed;a++)b.next(c[a].value);this.hasError?b.error(this.thrownError):this.isStopped&&b.complete();return e};a.prototype._getNow=function(){return(this.scheduler||Bb).now()};a.prototype._trimBufferThenGetEvents=function(){for(var b=this._getNow(),a=this._bufferSize,c=this._windowTime,h=this._events,d=h.length,e=0;e<d&&!(b-h[e].time<c);)e++;d>a&&(e=Math.max(e,d-a));0<e&&h.splice(0,e);return h};return a}(y),$c=function(){return function(c,a){this.time=c;this.value=a}}(),aa=function(c){function a(){var b= null!==c&&c.apply(this,arguments)||this;b.value=null;b.hasNext=!1;b.hasCompleted=!1;return b}d(a,c);a.prototype._subscribe=function(b){return this.hasError?(b.error(this.thrownError),w.EMPTY):this.hasCompleted&&this.hasNext?(b.next(this.value),b.complete(),w.EMPTY):c.prototype._subscribe.call(this,b)};a.prototype.next=function(b){this.hasCompleted||(this.value=b,this.hasNext=!0)};a.prototype.error=function(b){this.hasCompleted||c.prototype.error.call(this,b)};a.prototype.complete=function(){this.hasCompleted= !0;this.hasNext&&c.prototype.next.call(this,this.value);c.prototype.complete.call(this)};return a}(y),ad=1,Ka={},Db={setImmediate:function(c){var a=ad++;Ka[a]=c;Promise.resolve().then(function(){var b=Ka[a];b&&b()});return a},clearImmediate:function(c){delete Ka[c]}},bd=function(c){function a(b,a){var f=c.call(this,b,a)||this;f.scheduler=b;f.work=a;return f}d(a,c);a.prototype.requestAsyncId=function(b,a,g){void 0===g&&(g=0);if(null!==g&&0<g)return c.prototype.requestAsyncId.call(this,b,a,g