Socket
Socket
Sign inDemoInstall

@auth0/auth0-spa-js

Package Overview
Dependencies
Maintainers
38
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auth0/auth0-spa-js - npm Package Compare versions

Comparing version 1.7.0-beta.4 to 1.7.0-beta.5

dist/typings/index.cjs.d.ts

25

CHANGELOG.md
# Change Log
## [v1.7.0-beta.5](https://github.com/auth0/auth0-spa-js/tree/v1.7.0-beta.5) (2020-03-26)
[Full Changelog](https://github.com/auth0/auth0-spa-js/compare/v1.7.0-beta.4...v1.7.0-beta.5)
**Changed**
- [SDK-1379] Export constructor [\#385](https://github.com/auth0/auth0-spa-js/pull/385) ([adamjmcgrath](https://github.com/adamjmcgrath))
## [v1.7.0-beta.4](https://github.com/auth0/auth0-spa-js/tree/v1.7.0-beta.4) (2020-03-03)

@@ -44,2 +52,19 @@

## [v1.6.5](https://github.com/auth0/auth0-spa-js/tree/v1.6.5) (2020-03-19)
[Full Changelog](https://github.com/auth0/auth0-spa-js/compare/v1.6.4...v1.6.5)
**Changed**
- [SDK-1395] Refactor loginWithPopup to optionally accept an existing popup window [\#368](https://github.com/auth0/auth0-spa-js/pull/368) ([stevehobbsdev](https://github.com/stevehobbsdev))
- handleRedirectCallback wont pass redirect_uri undefined if not set in transaction [\#374](https://github.com/auth0/auth0-spa-js/pull/374) ([albertlockett](https://github.com/albertlockett))
- Update dependencies within semver ranges [\#371](https://github.com/auth0/auth0-spa-js/pull/371) ([stevehobbsdev](https://github.com/stevehobbsdev))
- [SDK-1099] Add `localOnly` logout option [\#362](https://github.com/auth0/auth0-spa-js/pull/362) ([adamjmcgrath](https://github.com/adamjmcgrath))
- center popup over owner window [\#356](https://github.com/auth0/auth0-spa-js/pull/356) ([ggascoigne](https://github.com/ggascoigne))
**Fixed**
- [SDK-1127] Delay removal of iframe to prevent Chrome hanging status bug #240 [\#376](https://github.com/auth0/auth0-spa-js/pull/376) ([adamjmcgrath](https://github.com/adamjmcgrath))
- [SDK-1125] createAuth0Client now throws errors that are not login_required [\#369](https://github.com/auth0/auth0-spa-js/pull/369) ([stevehobbsdev](https://github.com/stevehobbsdev))
## [v1.6.4](https://github.com/auth0/auth0-spa-js/tree/v1.6.4) (2020-02-10)

@@ -46,0 +71,0 @@

16

dist/auth0-spa-js.production.esm.js

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

var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function o(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}s((r=r.apply(e,t||[])).next())})}function i(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e,t){return e(t={exports:{}},t.exports),t.exports}var u,f,l,d="object",p=function(e){return e&&e.Math==Math&&e},h=p(typeof globalThis==d&&globalThis)||p(typeof window==d&&window)||p(typeof self==d&&self)||p(typeof a==d&&a)||Function("return this")(),y=function(e){try{return!!e()}catch(e){return!0}},v=!y(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),m={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,w={f:g&&!m.call({1:2},1)?function(e){var t=g(this,e);return!!t&&t.enumerable}:m},b=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},_={}.toString,k=function(e){return _.call(e).slice(8,-1)},S="".split,O=y(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==k(e)?S.call(e,""):Object(e)}:Object,T=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},E=function(e){return O(T(e))},A=function(e){return"object"==typeof e?null!==e:"function"==typeof e},I=function(e,t){if(!A(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!A(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!A(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!A(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},j={}.hasOwnProperty,P=function(e,t){return j.call(e,t)},x=h.document,C=A(x)&&A(x.createElement),L=function(e){return C?x.createElement(e):{}},U=!v&&!y(function(){return 7!=Object.defineProperty(L("div"),"a",{get:function(){return 7}}).a}),D=Object.getOwnPropertyDescriptor,R={f:v?D:function(e,t){if(e=E(e),t=I(t,!0),U)try{return D(e,t)}catch(e){}if(P(e,t))return b(!w.f.call(e,t),e[t])}},F=function(e){if(!A(e))throw TypeError(String(e)+" is not an object");return e},M=Object.defineProperty,N={f:v?M:function(e,t,n){if(F(e),t=I(t,!0),F(n),U)try{return M(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},z=v?function(e,t,n){return N.f(e,t,b(1,n))}:function(e,t,n){return e[t]=n,e},q=function(e,t){try{z(h,e,t)}catch(n){h[e]=t}return t},W=s(function(e){var t=h["__core-js_shared__"]||q("__core-js_shared__",{});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),J=W("native-function-to-string",Function.toString),B=h.WeakMap,G="function"==typeof B&&/native code/.test(J.call(B)),Y=0,H=Math.random(),V=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Y+H).toString(36)},K=W("keys"),Q=function(e){return K[e]||(K[e]=V(e))},X={},Z=h.WeakMap;if(G){var $=new Z,ee=$.get,te=$.has,ne=$.set;u=function(e,t){return ne.call($,e,t),t},f=function(e){return ee.call($,e)||{}},l=function(e){return te.call($,e)}}else{var re=Q("state");X[re]=!0,u=function(e,t){return z(e,re,t),t},f=function(e){return P(e,re)?e[re]:{}},l=function(e){return P(e,re)}}var oe={set:u,get:f,has:l,enforce:function(e){return l(e)?f(e):u(e,{})},getterFor:function(e){return function(t){var n;if(!A(t)||(n=f(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ie=s(function(e){var t=oe.get,n=oe.enforce,r=String(J).split("toString");W("inspectSource",function(e){return J.call(e)}),(e.exports=function(e,t,o,i){var a=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,s=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||P(o,"name")||z(o,"name",t),n(o).source=r.join("string"==typeof t?t:"")),e!==h?(a?!s&&e[t]&&(c=!0):delete e[t],c?e[t]=o:z(e,t,o)):c?e[t]=o:q(t,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&t(this).source||J.call(this)})}),ae=h,ce=function(e){return"function"==typeof e?e:void 0},se=function(e,t){return arguments.length<2?ce(ae[e])||ce(h[e]):ae[e]&&ae[e][t]||h[e]&&h[e][t]},ue=Math.ceil,fe=Math.floor,le=function(e){return isNaN(e=+e)?0:(e>0?fe:ue)(e)},de=Math.min,pe=function(e){return e>0?de(le(e),9007199254740991):0},he=Math.max,ye=Math.min,ve=function(e){return function(t,n,r){var o,i=E(t),a=pe(i.length),c=function(e,t){var n=le(e);return n<0?he(n+t,0):ye(n,t)}(r,a);if(e&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},me={includes:ve(!0),indexOf:ve(!1)},ge=me.indexOf,we=function(e,t){var n,r=E(e),o=0,i=[];for(n in r)!P(X,n)&&P(r,n)&&i.push(n);for(;t.length>o;)P(r,n=t[o++])&&(~ge(i,n)||i.push(n));return i},be=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_e=be.concat("length","prototype"),ke={f:Object.getOwnPropertyNames||function(e){return we(e,_e)}},Se={f:Object.getOwnPropertySymbols},Oe=se("Reflect","ownKeys")||function(e){var t=ke.f(F(e)),n=Se.f;return n?t.concat(n(e)):t},Te=function(e,t){for(var n=Oe(t),r=N.f,o=R.f,i=0;i<n.length;i++){var a=n[i];P(e,a)||r(e,a,o(t,a))}},Ee=/#|\.prototype\./,Ae=function(e,t){var n=je[Ie(e)];return n==xe||n!=Pe&&("function"==typeof t?y(t):!!t)},Ie=Ae.normalize=function(e){return String(e).replace(Ee,".").toLowerCase()},je=Ae.data={},Pe=Ae.NATIVE="N",xe=Ae.POLYFILL="P",Ce=Ae,Le=R.f,Ue=function(e,t){var n,r,o,i,a,c=e.target,s=e.global,u=e.stat;if(n=s?h:u?h[c]||q(c,{}):(h[c]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=Le(n,r))&&a.value:n[r],!Ce(s?r:c+(u?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Te(i,o)}(e.sham||o&&o.sham)&&z(i,"sham",!0),ie(n,r,i,e)}},De=!!Object.getOwnPropertySymbols&&!y(function(){return!String(Symbol())}),Re=h.Symbol,Fe=W("wks"),Me=function(e){return Fe[e]||(Fe[e]=De&&Re[e]||(De?Re:V)("Symbol."+e))},Ne=Me("match"),ze=function(e){if(function(e){var t;return A(e)&&(void 0!==(t=e[Ne])?!!t:"RegExp"==k(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},qe=Me("match"),We=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[qe]=!1,"/./"[e](t)}catch(e){}}return!1},Je="".startsWith,Be=Math.min;Ue({target:"String",proto:!0,forced:!We("startsWith")},{startsWith:function(e){var t=String(T(this));ze(e);var n=pe(Be(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Je?Je.call(t,r,n):t.slice(n,n+r.length)===r}});var Ge,Ye,He,Ve=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Ke=function(e,t,n){if(Ve(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}},Qe=Function.call,Xe=function(e,t,n){return Ke(Qe,h[e].prototype[t],n)},Ze=(Xe("String","startsWith"),function(e){return function(t,n){var r,o,i=String(T(t)),a=le(n),c=i.length;return a<0||a>=c?e?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):r:e?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}}),$e={codeAt:Ze(!1),charAt:Ze(!0)},et=function(e){return Object(T(e))},tt=!y(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),nt=Q("IE_PROTO"),rt=Object.prototype,ot=tt?Object.getPrototypeOf:function(e){return e=et(e),P(e,nt)?e[nt]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?rt:null},it=Me("iterator"),at=!1;[].keys&&("next"in(He=[].keys())?(Ye=ot(ot(He)))!==Object.prototype&&(Ge=Ye):at=!0),null==Ge&&(Ge={}),P(Ge,it)||z(Ge,it,function(){return this});var ct={IteratorPrototype:Ge,BUGGY_SAFARI_ITERATORS:at},st=Object.keys||function(e){return we(e,be)},ut=v?Object.defineProperties:function(e,t){F(e);for(var n,r=st(t),o=r.length,i=0;o>i;)N.f(e,n=r[i++],t[n]);return e},ft=se("document","documentElement"),lt=Q("IE_PROTO"),dt=function(){},pt=function(){var e,t=L("iframe"),n=be.length;for(t.style.display="none",ft.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),pt=e.F;n--;)delete pt.prototype[be[n]];return pt()},ht=Object.create||function(e,t){var n;return null!==e?(dt.prototype=F(e),n=new dt,dt.prototype=null,n[lt]=e):n=pt(),void 0===t?n:ut(n,t)};X[lt]=!0;var yt=N.f,vt=Me("toStringTag"),mt=function(e,t,n){e&&!P(e=n?e:e.prototype,vt)&&yt(e,vt,{configurable:!0,value:t})},gt={},wt=ct.IteratorPrototype,bt=function(){return this},_t=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return F(n),function(e){if(!A(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),kt=ct.IteratorPrototype,St=ct.BUGGY_SAFARI_ITERATORS,Ot=Me("iterator"),Tt=function(){return this},Et=$e.charAt,At=oe.set,It=oe.getterFor("String Iterator");!function(e,t,n,r,o,i,a){!function(e,t,n){var r=t+" Iterator";e.prototype=ht(wt,{next:b(1,n)}),mt(e,r,!1),gt[r]=bt}(n,t,r);var c,s,u,f=function(e){if(e===o&&y)return y;if(!St&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",d=!1,p=e.prototype,h=p[Ot]||p["@@iterator"]||o&&p[o],y=!St&&h||f(o),v="Array"==t&&p.entries||h;if(v&&(c=ot(v.call(new e)),kt!==Object.prototype&&c.next&&(ot(c)!==kt&&(_t?_t(c,kt):"function"!=typeof c[Ot]&&z(c,Ot,Tt)),mt(c,l,!0))),"values"==o&&h&&"values"!==h.name&&(d=!0,y=function(){return h.call(this)}),p[Ot]!==y&&z(p,Ot,y),gt[t]=y,o)if(s={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},a)for(u in s)!St&&!d&&u in p||ie(p,u,s[u]);else Ue({target:t,proto:!0,forced:St||d},s)}(String,"String",function(e){At(this,{type:"String Iterator",string:String(e),index:0})},function(){var e,t=It(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Et(n,r),t.index+=e.length,{value:e,done:!1})});var jt=function(e,t,n,r){try{return r?t(F(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&F(o.call(e)),t}},Pt=Me("iterator"),xt=Array.prototype,Ct=function(e){return void 0!==e&&(gt.Array===e||xt[Pt]===e)},Lt=function(e,t,n){var r=I(t);r in e?N.f(e,r,b(0,n)):e[r]=n},Ut=Me("toStringTag"),Dt="Arguments"==k(function(){return arguments}()),Rt=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Ut))?n:Dt?k(t):"Object"==(r=k(t))&&"function"==typeof t.callee?"Arguments":r},Ft=Me("iterator"),Mt=function(e){if(null!=e)return e[Ft]||e["@@iterator"]||gt[Rt(e)]},Nt=Me("iterator"),zt=!1;try{var qt=0,Wt={next:function(){return{done:!!qt++}},return:function(){zt=!0}};Wt[Nt]=function(){return this},Array.from(Wt,function(){throw 2})}catch(e){}var Jt=!function(e,t){if(!t&&!zt)return!1;var n=!1;try{var r={};r[Nt]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}(function(e){Array.from(e)});Ue({target:"Array",stat:!0,forced:Jt},{from:function(e){var t,n,r,o,i=et(e),a="function"==typeof this?this:Array,c=arguments.length,s=c>1?arguments[1]:void 0,u=void 0!==s,f=0,l=Mt(i);if(u&&(s=Ke(s,c>2?arguments[2]:void 0,2)),null==l||a==Array&&Ct(l))for(n=new a(t=pe(i.length));t>f;f++)Lt(n,f,u?s(i[f],f):i[f]);else for(o=l.call(i),n=new a;!(r=o.next()).done;f++)Lt(n,f,u?jt(o,s,[r.value,f],!0):r.value);return n.length=f,n}});ae.Array.from;var Bt,Gt=N.f,Yt=h.DataView,Ht=Yt&&Yt.prototype,Vt=h.Int8Array,Kt=Vt&&Vt.prototype,Qt=h.Uint8ClampedArray,Xt=Qt&&Qt.prototype,Zt=Vt&&ot(Vt),$t=Kt&&ot(Kt),en=Object.prototype,tn=en.isPrototypeOf,nn=Me("toStringTag"),rn=V("TYPED_ARRAY_TAG"),on=!(!h.ArrayBuffer||!Yt),an=on&&!!_t&&"Opera"!==Rt(h.opera),cn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},sn=function(e){return A(e)&&P(cn,Rt(e))};for(Bt in cn)h[Bt]||(an=!1);if((!an||"function"!=typeof Zt||Zt===Function.prototype)&&(Zt=function(){throw TypeError("Incorrect invocation")},an))for(Bt in cn)h[Bt]&&_t(h[Bt],Zt);if((!an||!$t||$t===en)&&($t=Zt.prototype,an))for(Bt in cn)h[Bt]&&_t(h[Bt].prototype,$t);if(an&&ot(Xt)!==$t&&_t(Xt,$t),v&&!P($t,nn))for(Bt in!0,Gt($t,nn,{get:function(){return A(this)?this[rn]:void 0}}),cn)h[Bt]&&z(h[Bt],rn,Bt);on&&_t&&ot(Ht)!==en&&_t(Ht,en);var un=function(e){if(sn(e))return e;throw TypeError("Target is not a typed array")},fn=function(e){if(_t){if(tn.call(Zt,e))return e}else for(var t in cn)if(P(cn,Bt)){var n=h[t];if(n&&(e===n||tn.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},ln=function(e,t,n){if(v){if(n)for(var r in cn){var o=h[r];o&&P(o.prototype,e)&&delete o.prototype[e]}$t[e]&&!n||ie($t,e,n?t:an&&Kt[e]||t)}},dn=Me("species"),pn=un,hn=fn,yn=[].slice;ln("slice",function(e,t){for(var n=yn.call(pn(this),e,t),r=function(e,t){var n,r=F(e).constructor;return void 0===r||null==(n=F(r)[dn])?t:Ve(n)}(this,this.constructor),o=0,i=n.length,a=new(hn(r))(i);i>o;)a[o]=n[o++];return a},y(function(){new Int8Array(1).slice()}));var vn=Me("unscopables"),mn=Array.prototype;null==mn[vn]&&z(mn,vn,ht(null));var gn,wn=me.includes;Ue({target:"Array",proto:!0},{includes:function(e){return wn(this,e,arguments.length>1?arguments[1]:void 0)}}),gn="includes",mn[vn][gn]=!0;Xe("Array","includes");Ue({target:"String",proto:!0,forced:!We("includes")},{includes:function(e){return!!~String(T(this)).indexOf(ze(e),arguments.length>1?arguments[1]:void 0)}});Xe("String","includes");function bn(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}var _n=setTimeout;function kn(e){return Boolean(e&&void 0!==e.length)}function Sn(){}function On(e){if(!(this instanceof On))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Pn(e,this)}function Tn(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,On._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void An(t.promise,e)}En(t.promise,r)}else(1===e._state?En:An)(t.promise,e._value)})):e._deferreds.push(t)}function En(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof On)return e._state=3,e._value=t,void In(e);if("function"==typeof n)return void Pn((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,In(e)}catch(t){An(e,t)}var r,o}function An(e,t){e._state=2,e._value=t,In(e)}function In(e){2===e._state&&0===e._deferreds.length&&On._immediateFn(function(){e._handled||On._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)Tn(e,e._deferreds[t]);e._deferreds=null}function jn(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function Pn(e,t){var n=!1;try{e(function(e){n||(n=!0,En(t,e))},function(e){n||(n=!0,An(t,e))})}catch(e){if(n)return;n=!0,An(t,e)}}On.prototype.catch=function(e){return this.then(null,e)},On.prototype.then=function(e,t){var n=new this.constructor(Sn);return Tn(this,new jn(e,t,n)),n},On.prototype.finally=bn,On.all=function(e){return new On(function(t,n){if(!kn(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,function(t){i(e,t)},n)}r[e]=a,0==--o&&t(r)}catch(e){n(e)}}for(var a=0;a<r.length;a++)i(a,r[a])})},On.resolve=function(e){return e&&"object"==typeof e&&e.constructor===On?e:new On(function(t){t(e)})},On.reject=function(e){return new On(function(t,n){n(e)})},On.race=function(e){return new On(function(t,n){if(!kn(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)On.resolve(e[r]).then(t,n)})},On._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){_n(e,0)},On._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var xn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in xn?xn.Promise.prototype.finally||(xn.Promise.prototype.finally=bn):xn.Promise=On,function(e){function t(e){if("utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+e+"') is invalid.")}function n(e,t){if(t=void 0===t?{fatal:!1}:t,"utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(e.TextEncoder&&e.TextDecoder)return!1;Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var n=e.length,r=0,o=Math.max(32,n+(n>>1)+7),i=new Uint8Array(o>>3<<3);t<n;){var a=e.charCodeAt(t++);if(55296<=a&&56319>=a){if(t<n){var c=e.charCodeAt(t);56320==(64512&c)&&(++t,a=((1023&a)<<10)+(1023&c)+65536)}if(55296<=a&&56319>=a)continue}if(r+4>i.length&&(o+=8,o=(o*=1+t/e.length*2)>>3<<3,(c=new Uint8Array(o)).set(i),i=c),0==(4294967168&a))i[r++]=a;else{if(0==(4294965248&a))i[r++]=a>>6&31|192;else if(0==(4294901760&a))i[r++]=a>>12&15|224,i[r++]=a>>6&63|128;else{if(0!=(4292870144&a))continue;i[r++]=a>>18&7|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128}i[r++]=63&a|128}}return i.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");t=0;for(var n=(e=new Uint8Array(e)).length,r=[];t<n;){var o=e[t++];if(0===o)break;if(0==(128&o))r.push(o);else if(192==(224&o)){var i=63&e[t++];r.push((31&o)<<6|i)}else if(224==(240&o)){i=63&e[t++];var a=63&e[t++];r.push((31&o)<<12|i<<6|a)}else if(240==(248&o)){65535<(o=(7&o)<<18|(i=63&e[t++])<<12|(a=63&e[t++])<<6|63&e[t++])&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}}return String.fromCharCode.apply(null,r)},e.TextEncoder=t,e.TextDecoder=n}("undefined"!=typeof window?window:a),function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var s=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(t,[{key:"addEventListener",value:function(e,t){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0,o=n.length;r<o;r++)if(n[r]===t)return void n.splice(r,1)}},{key:"dispatchEvent",value:function(e){var t=this;if(e.type in this.listeners){for(var n=function(n){setTimeout(function(){return n.call(t,e)})},r=this.listeners[e.type],o=0,i=r.length;o<i;o++)n(r[o]);return!e.defaultPrevented}}}]),t}(),u=function(t){function a(){var t;return e(this,a),(t=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?i(e):t}(this,r(a).call(this))).listeners||s.call(i(t)),Object.defineProperty(i(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(i(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,t),n(a,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),c(r(a.prototype),"dispatchEvent",this).call(this,e)}}]),a}(s),f=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new u,writable:!0,configurable:!0})}return n(t,[{key:"abort",value:function(){var e;try{e=new Event("abort")}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(e)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",u.prototype[Symbol.toStringTag]="AbortSignal"),function(e){(function(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController})(e)&&(e.AbortController=f,e.AbortSignal=u)}("undefined"!=typeof self?self:a)}();var Cn=s(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())})},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}});c(Cn);var Ln=c(s(function(e,t){var n=a&&a.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}s((r=r.apply(e,t||[])).next())})},r=a&&a.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(t,"__esModule",{value:!0});var o="browser-tabs-lock-key";function i(e){return new Promise(function(t){return setTimeout(t,e)})}function c(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++){n+=t[Math.floor(Math.random()*t.length)]}return n}var s=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+c(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(e,t){return void 0===t&&(t=5e3),n(this,void 0,void 0,function(){var n,a,s,f,l,d;return r(this,function(r){switch(r.label){case 0:n=Date.now()+c(4),a=Date.now()+t,s=o+"-"+e,f=window.localStorage,r.label=1;case 1:return Date.now()<a?null!==f.getItem(s)?[3,4]:(l=this.id+"-"+e+"-"+n,[4,i(Math.floor(25*Math.random()))]):[3,7];case 2:return r.sent(),f.setItem(s,JSON.stringify({id:this.id,iat:n,timeoutKey:l,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,i(30)];case 3:return r.sent(),null!==(d=f.getItem(s))&&(d=JSON.parse(d)).id===this.id&&d.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(s,n),[2,!0]):[3,6];case 4:return u(),[4,this.waitForSomethingToChange(a)];case 5:r.sent(),r.label=6;case 6:return n=Date.now()+c(4),[3,1];case 7:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return n(this,void 0,void 0,function(){var o=this;return r(this,function(i){return setTimeout(function(){return n(o,void 0,void 0,function(){var n,o;return r(this,function(r){switch(r.label){case 0:return[4,Cn.default().lock(t)];case 1:return r.sent(),this.acquiredIatSet.has(t)?(n=window.localStorage,null===(o=n.getItem(e))?(Cn.default().unlock(t),[2]):((o=JSON.parse(o)).timeRefreshed=Date.now(),n.setItem(e,JSON.stringify(o)),Cn.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(Cn.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return n(this,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,o=Date.now(),i=50,a=!1;function c(){if(a||(window.removeEventListener("storage",c),e.removeFromWaiting(c),clearTimeout(s),a=!0),!r){r=!0;var t=i-(Date.now()-o);t>0?setTimeout(n,t):n()}}window.addEventListener("storage",c),e.addToWaiting(c);var s=setTimeout(c,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,i,a;return r(this,function(r){switch(r.label){case 0:return n=window.localStorage,i=o+"-"+t,null===(a=n.getItem(i))?[2]:(a=JSON.parse(a)).id!==this.id?[3,2]:[4,Cn.default().lock(a.iat)];case 1:r.sent(),this.acquiredIatSet.delete(a.iat),n.removeItem(i),Cn.default().unlock(a.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.waiters=void 0,e}();function u(){for(var e=Date.now()-5e3,t=window.localStorage,n=Object.keys(t),r=!1,i=0;i<n.length;i++){var a=n[i];if(a.includes(o)){var c=t.getItem(a);null!==c&&(void 0===(c=JSON.parse(c)).timeRefreshed&&c.timeAcquired<e||void 0!==c.timeRefreshed&&c.timeRefreshed<e)&&(t.removeItem(a),r=!0)}}r&&s.notifyWaiters()}t.default=s}));var Un={timeoutInSeconds:60},Dn="memory",Rn=function(e){return e.filter(function(t,n){return e.indexOf(t)===n})},Fn={error:"timeout",error_description:"Timeout"},Mn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(Boolean).join();return Rn(n.replace(/\s/g,",").split(",")).join(" ").trim()},Nn=function(){var e=window.open("","auth0:authorize:popup","left=100,top=100,width=400,height=600,resizable,scrollbars=yes,status=1");if(!e)throw new Error("Could not open popup");return e},zn=function(e,t,r){return e.location.href=t,new Promise(function(t,o){var i=setTimeout(function(){o(n(n({},Fn),{popup:e}))},1e3*(r.timeoutInSeconds||60));window.addEventListener("message",function(n){if(n.data&&"authorization_response"===n.data.type){if(clearTimeout(i),e.close(),n.data.response.error)return o(n.data.response);t(n.data.response)}})})},qn=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(Qn().getRandomValues(new Uint8Array(43))).forEach(function(n){return t+=e[n%e.length]}),t},Wn=function(e){return btoa(e)},Jn=function(e){return Object.keys(e).filter(function(t){return void 0!==e[t]}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},Bn=function(e){return o(void 0,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return t=Xn().digest({name:"SHA-256"},(new TextEncoder).encode(e)),window.msCrypto?[2,new Promise(function(e,n){t.oncomplete=function(t){e(t.target.result)},t.onerror=function(e){n(e.error)},t.onabort=function(){n("The digest operation was aborted")}})]:[4,t];case 1:return[2,n.sent()]}})})},Gn=function(e){return function(e){return decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},Yn=function(e){var t=new Uint8Array(e);return function(e){var t={"+":"-","/":"_","=":""};return e.replace(/[\+\/=]/g,function(e){return t[e]})}(window.btoa(String.fromCharCode.apply(String,Array.from(t))))},Hn=function(e,t,r){void 0===r&&(r=1e4);var o,i,a=new AbortController,c=a.signal,s=n(n({},t),{signal:c});return Promise.race([(o=e,i=s,i=i||{},new Promise(function(e,t){var n=new XMLHttpRequest,r=[],a=[],c={},s=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:s,headers:{keys:function(){return r},entries:function(){return a},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}};for(var u in n.open(i.method||"get",o,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){r.push(t=t.toLowerCase()),a.push([t,n]),c[t]=c[t]?c[t]+","+n:n}),e(s())},n.onerror=t,n.withCredentials="include"==i.credentials,i.headers)n.setRequestHeader(u,i.headers[u]);n.send(i.body||null)})),new Promise(function(e,t){setTimeout(function(){a.abort(),t(new Error("Timeout when executing 'fetch'"))},r)})])},Vn=function(e,t,n){return o(void 0,void 0,void 0,function(){var o,a,c,s,u,f,l,d,p,h;return i(this,function(i){switch(i.label){case 0:c=0,i.label=1;case 1:if(!(c<3))return[3,6];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,Hn(e,n,t)];case 3:return a=i.sent(),o=null,[3,6];case 4:return s=i.sent(),o=s,[3,5];case 5:return c++,[3,1];case 6:if(o)throw o;return[4,a.json()];case 7:if(u=i.sent(),f=u.error,l=u.error_description,d=r(u,["error","error_description"]),!a.ok)throw p=l||"HTTP error. Unable to fetch "+e,(h=new Error(p)).error=f||"request_error",h.error_description=p,h;return[2,d]}})})},Kn=function(e){return o(void 0,void 0,void 0,function(){var t=e.baseUrl,o=e.timeout,a=r(e,["baseUrl","timeout"]);return i(this,function(e){switch(e.label){case 0:return[4,Vn(t+"/oauth/token",o,{method:"POST",body:JSON.stringify(n({redirect_uri:window.location.origin},a)),headers:{"Content-type":"application/json"}})];case 1:return[2,e.sent()]}})})},Qn=function(){return window.crypto||window.msCrypto},Xn=function(){var e=Qn();return e.subtle||e.webkitSubtle},Zn=function(){if(!Qn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===Xn())throw new Error("\n auth0-spa-js must run on a secure origin.\n See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin \n for more information.\n ")},$n=function(e){return"@@auth0spajs@@::"+e.client_id+"::"+e.audience+"::"+e.scope},er=function(e){var t=Math.floor(Date.now()/1e3)+e.expires_in;return{body:e,expiresAt:Math.min(t,e.decodedToken.claims.exp)-60}},tr=function(){function e(){}return e.prototype.save=function(e){var t=$n(e),n=er(e);window.localStorage.setItem(t,JSON.stringify(n))},e.prototype.get=function(e){var t=$n(e),n=this.readJson(t),r=Math.floor(Date.now()/1e3);if(n){if(!(n.expiresAt<r))return n.body;if(n.body.refresh_token){var o=this.stripData(n);return this.writeJson(t,o),o.body}localStorage.removeItem(t)}},e.prototype.clear=function(){for(var e=localStorage.length-1;e>=0;e--)localStorage.key(e).startsWith("@@auth0spajs@@")&&localStorage.removeItem(localStorage.key(e))},e.prototype.readJson=function(e){var t,n=window.localStorage.getItem(e);if(n&&(t=JSON.parse(n)))return t},e.prototype.writeJson=function(e,t){localStorage.setItem(e,JSON.stringify(t))},e.prototype.stripData=function(e){return{body:{refresh_token:e.body.refresh_token},expiresAt:e.expiresAt}},e}(),nr=function(){var e;this.enclosedCache=(e={body:{},expiresAt:0},{save:function(t){var n=$n(t),r=er(t);e[n]=r},get:function(t){var n=$n(t),r=e[n],o=Math.floor(Date.now()/1e3);if(r)return r.expiresAt<o?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},r.body):void delete e[n]:r.body},clear:function(){e={body:{},expiresAt:0}}})},rr=s(function(e,t){var n=a&&a.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function r(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function o(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return r("Expires",e.expires?e.expires.toUTCString():"")+r("Domain",e.domain)+r("Path",e.path)+r("Secure",e.secure)+r("SameSite",e.sameSite)}(n)}function i(e){for(var t={},n=e?e.split("; "):[],r=/(%[0-9A-Z]{2})+/g,o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=a.replace(r,decodeURIComponent)}catch(e){}}return t}function c(){return i(document.cookie)}function s(e,t,r){document.cookie=o(e,t,n({path:"/"},r))}t.__esModule=!0,t.encode=o,t.parse=i,t.getAll=c,t.get=function(e){return c()[e]},t.set=s,t.remove=function(e,t){s(e,"",n({},t,{expires:-1}))}});c(rr);rr.encode,rr.parse;var or=rr.getAll,ir=rr.get,ar=rr.set,cr=rr.remove,sr=function(){return Object.keys(or()||{})},ur=function(e){var t=ir(e);if(void 0!==t)return JSON.parse(t)},fr=function(e,t,n){ar(e,JSON.stringify(t),{expires:n.daysUntilExpire})},lr=function(e){cr(e)},dr="a0.spajs.txs.",pr=function(e){return""+dr+e},hr=function(){function e(){var e=this;this.transactions={},sr().filter(function(e){return e.startsWith(dr)}).forEach(function(t){var n=t.replace(dr,"");e.transactions[n]=ur(t)})}return e.prototype.create=function(e,t){this.transactions[e]=t,fr(pr(e),t,{daysUntilExpire:1})},e.prototype.get=function(e){return this.transactions[e]},e.prototype.remove=function(e){delete this.transactions[e],lr(pr(e))},e}(),yr=function(e){return"number"==typeof e},vr=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],mr=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(e){var t=e.split("."),n=t[0],r=t[1],o=t[2];if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");var i=JSON.parse(Gn(r)),a={__raw:e},c={};return Object.keys(i).forEach(function(e){a[e]=i[e],vr.includes(e)||(c[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(Gn(n)),claims:a,user:c}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'+e.iss+'", found "'+t.claims.iss+'"');if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error('Signature algorithm of "'+t.header.alg+'" is not supported. Expected the ID token to be signed with "RS256".');if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but was not one of "'+t.claims.aud.join(", ")+'"');if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'+e.aud+'", found "'+t.claims.azp+'"')}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but found "'+t.claims.aud+'"');if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'+e.nonce+'", found "'+t.claims.nonce+'"')}if(e.max_age&&!yr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!yr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!yr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=e.leeway||60,r=new Date,o=new Date(0),i=new Date(0),a=new Date(0);if(a.setUTCSeconds((parseInt(t.claims.auth_time)+e.max_age)/1e3+n),o.setUTCSeconds(t.claims.exp+n),i.setUTCSeconds(t.claims.nbf-n),r>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time ("+r+") is after expiration time ("+o+")");if(yr(t.claims.nbf)&&r<i)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time ("+r+") is before "+i);if(yr(t.claims.auth_time)&&r>a)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time ("+r+") is after last auth at "+a);return t},gr=function(e){function n(t,r,o,i){void 0===i&&(i=null);var a=e.call(this,t,r)||this;return a.state=o,a.appState=i,Object.setPrototypeOf(a,n.prototype),a}return t(n,e),n}(function(e){function n(t,r){var o=e.call(this,r)||this;return o.error=t,o.error_description=r,Object.setPrototypeOf(o,n.prototype),o}return t(n,e),n}(Error)),wr=new Ln,br={memory:function(){return(new nr).enclosedCache},localstorage:function(){return new tr}},_r=function(e){return br[e]},kr=function(){function e(e){if(this.options=e,this.DEFAULT_SCOPE="openid profile email",this.cacheLocation=e.cacheLocation||"memory",!_r(this.cacheLocation))throw new Error('Invalid cache location "'+this.cacheLocation+'"');this.cache=_r(this.cacheLocation)(),this.transactionManager=new hr,this.domainUrl="https://"+this.options.domain,this.tokenIssuer=this.options.issuer?"https://"+this.options.issuer+"/":this.domainUrl+"/"}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify({name:"auth0-spa-js",version:"1.7.0-beta.4"})));return""+this.domainUrl+e+"&auth0Client="+t},e.prototype._getParams=function(e,t,o,i,a){var c=this.options,s=(c.domain,c.leeway,c.useRefreshTokens,c.cacheLocation,r(c,["domain","leeway","useRefreshTokens","cacheLocation"]));return n(n(n({},s),e),{scope:Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),response_type:"code",response_mode:"query",state:t,nonce:o,redirect_uri:a||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(e){return this._url("/authorize?"+Jn(e))},e.prototype._verifyIdToken=function(e,t){return mr({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age)})},e.prototype._parseNumber=function(e){return"string"!=typeof e?e:parseInt(e,10)||void 0},e.prototype.buildAuthorizeUrl=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,function(){var t,n,o,a,c,s,u,f,l,d,p;return i(this,function(i){switch(i.label){case 0:return t=e.redirect_uri,n=e.appState,e.cacheStrategy,o=r(e,["redirect_uri","appState","cacheStrategy"]),a=Wn(qn()),c=Wn(qn()),s=qn(),[4,Bn(s)];case 1:return u=i.sent(),f=Yn(u),l=e.fragment?"#"+e.fragment:"",d=this._getParams(o,a,c,f,t),p=this._authorizeUrl(d),this.transactionManager.create(a,{nonce:c,code_verifier:s,appState:n,scope:d.scope,audience:d.audience||"default",redirect_uri:d.redirect_uri}),[2,p+l]}})})},e.prototype.loginWithPopup=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),o(this,void 0,void 0,function(){var o,a,c,s,u,f,l,d,p,h,y,v,m;return i(this,function(i){switch(i.label){case 0:return[4,Nn()];case 1:return o=i.sent(),a=r(e,[]),c=Wn(qn()),s=Wn(qn()),u=qn(),[4,Bn(u)];case 2:return f=i.sent(),l=Yn(f),d=this._getParams(a,c,s,l,this.options.redirect_uri||window.location.origin),p=this._authorizeUrl(n(n({},d),{response_mode:"web_message"})),[4,zn(o,p,n(n({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 3:if(h=i.sent(),c!==h.state)throw new Error("Invalid state");return[4,Kn({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:u,code:h.code,grant_type:"authorization_code",redirect_uri:d.redirect_uri})];case 4:return y=i.sent(),v=this._verifyIdToken(y.id_token,s),m=n(n({},y),{decodedToken:v,scope:d.scope,audience:d.audience||"default",client_id:this.options.client_id}),this.cache.save(m),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2]}})})},e.prototype.getUser=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),o(this,void 0,void 0,function(){var t;return i(this,function(r){return e.scope=Mn(this.DEFAULT_SCOPE,e.scope),[2,(t=this.cache.get(n({client_id:this.options.client_id},e)))&&t.decodedToken&&t.decodedToken.user]})})},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),o(this,void 0,void 0,function(){var t;return i(this,function(r){return e.scope=Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[2,(t=this.cache.get(n({client_id:this.options.client_id},e)))&&t.decodedToken&&t.decodedToken.claims]})})},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return[4,this.buildAuthorizeUrl(e)];case 1:return t=n.sent(),window.location.assign(t),[2]}})})},e.prototype.handleRedirectCallback=function(e){return void 0===e&&(e=window.location.href),o(this,void 0,void 0,function(){var t,r,o,a,c,s,u,f,l,d;return i(this,function(i){switch(i.label){case 0:if(0===(t=e.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(r=function(e){e.indexOf("#")>-1&&(e=e.substr(0,e.indexOf("#")));var t=e.split("&"),r={};return t.forEach(function(e){var t=e.split("="),n=t[0],o=t[1];r[n]=decodeURIComponent(o)}),n(n({},r),{expires_in:parseInt(r.expires_in)})}(t.join("")),o=r.state,a=r.code,c=r.error,s=r.error_description,!(u=this.transactionManager.get(o)))throw new Error("Invalid state");if(c)throw this.transactionManager.remove(o),new gr(c,s,o,u.appState);return this.transactionManager.remove(o),[4,Kn({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:u.code_verifier,code:a,grant_type:"authorization_code",redirect_uri:u.redirect_uri})];case 1:return f=i.sent(),l=this._verifyIdToken(f.id_token,u.nonce),d=n(n({},f),{decodedToken:l,audience:u.audience,scope:u.scope,client_id:this.options.client_id}),this.cache.save(d),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,{appState:u.appState}]}})})},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,function(){var t,o,a,c,s,u;return i(this,function(i){switch(i.label){case 0:t=n({audience:this.options.audience,scope:Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),ignoreCache:!1},e),o=t.ignoreCache,a=r(t,["ignoreCache"]),i.label=1;case 1:return i.trys.push([1,7,8,10]),!o&&(c=this.cache.get({scope:a.scope,audience:a.audience||"default",client_id:this.options.client_id}))&&c.access_token?[2,c.access_token]:[4,wr.acquireLock("auth0.lock.getTokenSilently",5e3)];case 2:return i.sent(),this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(a)]:[3,4];case 3:return u=i.sent(),[3,6];case 4:return[4,this._getTokenFromIFrame(a)];case 5:u=i.sent(),i.label=6;case 6:return s=u,this.cache.save(n({client_id:this.options.client_id},s)),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,s.access_token];case 7:throw i.sent();case 8:return[4,wr.releaseLock("auth0.lock.getTokenSilently")];case 9:return i.sent(),[7];case 10:return[2]}})})},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE}),void 0===t&&(t=Un),o(this,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return e.scope=Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[4,this.loginWithPopup(e,t)];case 1:return n.sent(),[2,this.cache.get({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}).access_token]}})})},e.prototype.isAuthenticated=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.getUser()];case 1:return[2,!!e.sent()]}})})},e.prototype.logout=function(e){void 0===e&&(e={}),null!==e.client_id?e.client_id=e.client_id||this.options.client_id:delete e.client_id,lr("auth0.is.authenticated"),this.cache.clear();var t=e.federated,n=r(e,["federated"]),o=t?"&federated":"",i=this._url("/v2/logout?"+Jn(n));window.location.assign(""+i+o)},e.prototype._getTokenFromIFrame=function(e){return o(this,void 0,void 0,function(){var t,r,o,a,c,s,u,f,l,d,p;return i(this,function(i){switch(i.label){case 0:return t=Wn(qn()),r=Wn(qn()),o=qn(),[4,Bn(o)];case 1:return a=i.sent(),c=Yn(a),s=this._getParams(e,t,r,c,e.redirect_uri||this.options.redirect_uri||window.location.origin),u=this._authorizeUrl(n(n({},s),{prompt:"none",response_mode:"web_message"})),f=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,(h=u,y=this.domainUrl,v=f,void 0===v&&(v=60),new Promise(function(e,t){var n=window.document.createElement("iframe");n.setAttribute("width","0"),n.setAttribute("height","0"),n.style.display="none";var r=setTimeout(function(){t(Fn),window.document.body.removeChild(n)},1e3*v),o=function(i){i.origin==y&&i.data&&"authorization_response"===i.data.type&&(i.source.close(),i.data.response.error?t(i.data.response):e(i.data.response),clearTimeout(r),window.removeEventListener("message",o,!1),window.document.body.removeChild(n))};window.addEventListener("message",o,!1),window.document.body.appendChild(n),n.setAttribute("src",h)}))];case 2:if(l=i.sent(),t!==l.state)throw new Error("Invalid state");return[4,Kn({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:o,code:l.code,grant_type:"authorization_code",redirect_uri:s.redirect_uri})];case 3:return d=i.sent(),p=this._verifyIdToken(d.id_token,r),[2,n(n({},d),{decodedToken:p,scope:s.scope,audience:s.audience||"default"})]}var h,y,v})})},e.prototype._getTokenUsingRefreshToken=function(e){return o(this,void 0,void 0,function(){var t,r,o,a;return i(this,function(i){switch(i.label){case 0:return e.scope=Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),(t=this.cache.get({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}))&&t.refresh_token?[3,2]:[4,this._getTokenFromIFrame(e)];case 1:return[2,i.sent()];case 2:return r=e.redirect_uri||this.options.redirect_uri||window.location.origin,[4,Kn({baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:t.refresh_token,redirect_uri:r})];case 3:return o=i.sent(),a=this._verifyIdToken(o.id_token),[2,n(n({},o),{decodedToken:a,scope:e.scope,audience:e.audience||"default"})]}})})},e}();export default function(e){return o(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:if(Zn(),e.useRefreshTokens&&(e.scope=Mn(e.scope,"offline_access")),(t=new kr(e)).cacheLocation===Dn&&!ur("auth0.is.authenticated"))return[2,t];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.getTokenSilently()];case 2:case 3:return n.sent(),[3,4];case 4:return[2,t]}})})}
/*! *****************************************************************************
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 e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function o(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(a,c)}u((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u(e,t){return e(t={exports:{}},t.exports),t.exports}var s=function(e){return e&&e.Math==Math&&e},f=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof a&&a)||Function("return this")(),l=function(e){try{return!!e()}catch(e){return!0}},d=!l((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),p={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,y={f:h&&!p.call({1:2},1)?function(e){var t=h(this,e);return!!t&&t.enumerable}:p},v=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},m={}.toString,w=function(e){return m.call(e).slice(8,-1)},g="".split,b=l((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==w(e)?g.call(e,""):Object(e)}:Object,_=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},S=function(e){return b(_(e))},k=function(e){return"object"==typeof e?null!==e:"function"==typeof e},O=function(e,t){if(!k(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!k(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!k(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!k(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},T={}.hasOwnProperty,E=function(e,t){return T.call(e,t)},A=f.document,j=k(A)&&k(A.createElement),I=function(e){return j?A.createElement(e):{}},x=!d&&!l((function(){return 7!=Object.defineProperty(I("div"),"a",{get:function(){return 7}}).a})),P=Object.getOwnPropertyDescriptor,C={f:d?P:function(e,t){if(e=S(e),t=O(t,!0),x)try{return P(e,t)}catch(e){}if(E(e,t))return v(!y.f.call(e,t),e[t])}},L=function(e){if(!k(e))throw TypeError(String(e)+" is not an object");return e},U=Object.defineProperty,D={f:d?U:function(e,t,n){if(L(e),t=O(t,!0),L(n),x)try{return U(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},R=d?function(e,t,n){return D.f(e,t,v(1,n))}:function(e,t,n){return e[t]=n,e},F=function(e,t){try{R(f,e,t)}catch(n){f[e]=t}return t},M=f["__core-js_shared__"]||F("__core-js_shared__",{}),N=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(e){return N.call(e)});var z,W,q,J=M.inspectSource,B=f.WeakMap,G="function"==typeof B&&/native code/.test(J(B)),Y=u((function(e){(e.exports=function(e,t){return M[e]||(M[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),H=0,V=Math.random(),X=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++H+V).toString(36)},K=Y("keys"),Q=function(e){return K[e]||(K[e]=X(e))},Z={},$=f.WeakMap;if(G){var ee=new $,te=ee.get,ne=ee.has,re=ee.set;z=function(e,t){return re.call(ee,e,t),t},W=function(e){return te.call(ee,e)||{}},q=function(e){return ne.call(ee,e)}}else{var oe=Q("state");Z[oe]=!0,z=function(e,t){return R(e,oe,t),t},W=function(e){return E(e,oe)?e[oe]:{}},q=function(e){return E(e,oe)}}var ie,ae={set:z,get:W,has:q,enforce:function(e){return q(e)?W(e):z(e,{})},getterFor:function(e){return function(t){var n;if(!k(t)||(n=W(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ce=u((function(e){var t=ae.get,n=ae.enforce,r=String(String).split("String");(e.exports=function(e,t,o,i){var a=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||E(o,"name")||R(o,"name",t),n(o).source=r.join("string"==typeof t?t:"")),e!==f?(a?!u&&e[t]&&(c=!0):delete e[t],c?e[t]=o:R(e,t,o)):c?e[t]=o:F(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||J(this)}))})),ue=f,se=function(e){return"function"==typeof e?e:void 0},fe=function(e,t){return arguments.length<2?se(ue[e])||se(f[e]):ue[e]&&ue[e][t]||f[e]&&f[e][t]},le=Math.ceil,de=Math.floor,pe=function(e){return isNaN(e=+e)?0:(e>0?de:le)(e)},he=Math.min,ye=function(e){return e>0?he(pe(e),9007199254740991):0},ve=Math.max,me=Math.min,we=function(e){return function(t,n,r){var o,i=S(t),a=ye(i.length),c=function(e,t){var n=pe(e);return n<0?ve(n+t,0):me(n,t)}(r,a);if(e&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},ge={includes:we(!0),indexOf:we(!1)},be=ge.indexOf,_e=function(e,t){var n,r=S(e),o=0,i=[];for(n in r)!E(Z,n)&&E(r,n)&&i.push(n);for(;t.length>o;)E(r,n=t[o++])&&(~be(i,n)||i.push(n));return i},Se=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ke=Se.concat("length","prototype"),Oe={f:Object.getOwnPropertyNames||function(e){return _e(e,ke)}},Te={f:Object.getOwnPropertySymbols},Ee=fe("Reflect","ownKeys")||function(e){var t=Oe.f(L(e)),n=Te.f;return n?t.concat(n(e)):t},Ae=function(e,t){for(var n=Ee(t),r=D.f,o=C.f,i=0;i<n.length;i++){var a=n[i];E(e,a)||r(e,a,o(t,a))}},je=/#|\.prototype\./,Ie=function(e,t){var n=Pe[xe(e)];return n==Le||n!=Ce&&("function"==typeof t?l(t):!!t)},xe=Ie.normalize=function(e){return String(e).replace(je,".").toLowerCase()},Pe=Ie.data={},Ce=Ie.NATIVE="N",Le=Ie.POLYFILL="P",Ue=Ie,De=C.f,Re=function(e,t){var n,r,o,i,a,c=e.target,u=e.global,s=e.stat;if(n=u?f:s?f[c]||F(c,{}):(f[c]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=De(n,r))&&a.value:n[r],!Ue(u?r:c+(s?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Ae(i,o)}(e.sham||o&&o.sham)&&R(i,"sham",!0),ce(n,r,i,e)}},Fe=!!Object.getOwnPropertySymbols&&!l((function(){return!String(Symbol())})),Me=Fe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ne=Y("wks"),ze=f.Symbol,We=Me?ze:ze&&ze.withoutSetter||X,qe=function(e){return E(Ne,e)||(Fe&&E(ze,e)?Ne[e]=ze[e]:Ne[e]=We("Symbol."+e)),Ne[e]},Je=qe("match"),Be=function(e){if(function(e){var t;return k(e)&&(void 0!==(t=e[Je])?!!t:"RegExp"==w(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},Ge=qe("match"),Ye=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Ge]=!1,"/./"[e](t)}catch(e){}}return!1},He=C.f,Ve="".startsWith,Xe=Math.min,Ke=Ye("startsWith"),Qe=!(Ke||(ie=He(String.prototype,"startsWith"),!ie||ie.writable));Re({target:"String",proto:!0,forced:!Qe&&!Ke},{startsWith:function(e){var t=String(_(this));Be(e);var n=ye(Xe(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Ve?Ve.call(t,r,n):t.slice(n,n+r.length)===r}});var Ze,$e,et,tt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},nt=function(e,t,n){if(tt(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}},rt=Function.call,ot=function(e,t,n){return nt(rt,f[e].prototype[t],n)},it=(ot("String","startsWith"),function(e){return function(t,n){var r,o,i=String(_(t)),a=pe(n),c=i.length;return a<0||a>=c?e?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):r:e?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}}),at={codeAt:it(!1),charAt:it(!0)},ct=function(e){return Object(_(e))},ut=!l((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),st=Q("IE_PROTO"),ft=Object.prototype,lt=ut?Object.getPrototypeOf:function(e){return e=ct(e),E(e,st)?e[st]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ft:null},dt=qe("iterator"),pt=!1;[].keys&&("next"in(et=[].keys())?($e=lt(lt(et)))!==Object.prototype&&(Ze=$e):pt=!0),null==Ze&&(Ze={}),E(Ze,dt)||R(Ze,dt,(function(){return this}));var ht,yt={IteratorPrototype:Ze,BUGGY_SAFARI_ITERATORS:pt},vt=Object.keys||function(e){return _e(e,Se)},mt=d?Object.defineProperties:function(e,t){L(e);for(var n,r=vt(t),o=r.length,i=0;o>i;)D.f(e,n=r[i++],t[n]);return e},wt=fe("document","documentElement"),gt=Q("IE_PROTO"),bt=function(){},_t=function(e){return"<script>"+e+"<\/script>"},St=function(){try{ht=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;St=ht?function(e){e.write(_t("")),e.close();var t=e.parentWindow.Object;return e=null,t}(ht):((t=I("iframe")).style.display="none",wt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(_t("document.F=Object")),e.close(),e.F);for(var n=Se.length;n--;)delete St.prototype[Se[n]];return St()};Z[gt]=!0;var kt=Object.create||function(e,t){var n;return null!==e?(bt.prototype=L(e),n=new bt,bt.prototype=null,n[gt]=e):n=St(),void 0===t?n:mt(n,t)},Ot=D.f,Tt=qe("toStringTag"),Et=function(e,t,n){e&&!E(e=n?e:e.prototype,Tt)&&Ot(e,Tt,{configurable:!0,value:t})},At={},jt=yt.IteratorPrototype,It=function(){return this},xt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return L(n),function(e){if(!k(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Pt=yt.IteratorPrototype,Ct=yt.BUGGY_SAFARI_ITERATORS,Lt=qe("iterator"),Ut=function(){return this},Dt=at.charAt,Rt=ae.set,Ft=ae.getterFor("String Iterator");!function(e,t,n,r,o,i,a){!function(e,t,n){var r=t+" Iterator";e.prototype=kt(jt,{next:v(1,n)}),Et(e,r,!1),At[r]=It}(n,t,r);var c,u,s,f=function(e){if(e===o&&y)return y;if(!Ct&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",d=!1,p=e.prototype,h=p[Lt]||p["@@iterator"]||o&&p[o],y=!Ct&&h||f(o),m="Array"==t&&p.entries||h;if(m&&(c=lt(m.call(new e)),Pt!==Object.prototype&&c.next&&(lt(c)!==Pt&&(xt?xt(c,Pt):"function"!=typeof c[Lt]&&R(c,Lt,Ut)),Et(c,l,!0))),"values"==o&&h&&"values"!==h.name&&(d=!0,y=function(){return h.call(this)}),p[Lt]!==y&&R(p,Lt,y),At[t]=y,o)if(u={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},a)for(s in u)!Ct&&!d&&s in p||ce(p,s,u[s]);else Re({target:t,proto:!0,forced:Ct||d},u)}(String,"String",(function(e){Rt(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Ft(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Dt(n,r),t.index+=e.length,{value:e,done:!1})}));var Mt=function(e,t,n,r){try{return r?t(L(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&L(o.call(e)),t}},Nt=qe("iterator"),zt=Array.prototype,Wt=function(e){return void 0!==e&&(At.Array===e||zt[Nt]===e)},qt=function(e,t,n){var r=O(t);r in e?D.f(e,r,v(0,n)):e[r]=n},Jt={};Jt[qe("toStringTag")]="z";var Bt="[object z]"===String(Jt),Gt=qe("toStringTag"),Yt="Arguments"==w(function(){return arguments}()),Ht=Bt?w:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Gt))?n:Yt?w(t):"Object"==(r=w(t))&&"function"==typeof t.callee?"Arguments":r},Vt=qe("iterator"),Xt=function(e){if(null!=e)return e[Vt]||e["@@iterator"]||At[Ht(e)]},Kt=qe("iterator"),Qt=!1;try{var Zt=0,$t={next:function(){return{done:!!Zt++}},return:function(){Qt=!0}};$t[Kt]=function(){return this},Array.from($t,(function(){throw 2}))}catch(e){}var en=!function(e,t){if(!t&&!Qt)return!1;var n=!1;try{var r={};r[Kt]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}((function(e){Array.from(e)}));Re({target:"Array",stat:!0,forced:en},{from:function(e){var t,n,r,o,i,a,c=ct(e),u="function"==typeof this?this:Array,s=arguments.length,f=s>1?arguments[1]:void 0,l=void 0!==f,d=Xt(c),p=0;if(l&&(f=nt(f,s>2?arguments[2]:void 0,2)),null==d||u==Array&&Wt(d))for(n=new u(t=ye(c.length));t>p;p++)a=l?f(c[p],p):c[p],qt(n,p,a);else for(i=(o=d.call(c)).next,n=new u;!(r=i.call(o)).done;p++)a=l?Mt(o,f,[r.value,p],!0):r.value,qt(n,p,a);return n.length=p,n}});ue.Array.from;var tn,nn="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,rn=D.f,on=f.Int8Array,an=on&&on.prototype,cn=f.Uint8ClampedArray,un=cn&&cn.prototype,sn=on&&lt(on),fn=an&&lt(an),ln=Object.prototype,dn=ln.isPrototypeOf,pn=qe("toStringTag"),hn=X("TYPED_ARRAY_TAG"),yn=nn&&!!xt&&"Opera"!==Ht(f.opera),vn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},mn=function(e){return k(e)&&E(vn,Ht(e))};for(tn in vn)f[tn]||(yn=!1);if((!yn||"function"!=typeof sn||sn===Function.prototype)&&(sn=function(){throw TypeError("Incorrect invocation")},yn))for(tn in vn)f[tn]&&xt(f[tn],sn);if((!yn||!fn||fn===ln)&&(fn=sn.prototype,yn))for(tn in vn)f[tn]&&xt(f[tn].prototype,fn);if(yn&&lt(un)!==fn&&xt(un,fn),d&&!E(fn,pn))for(tn in!0,rn(fn,pn,{get:function(){return k(this)?this[hn]:void 0}}),vn)f[tn]&&R(f[tn],hn,tn);var wn=function(e){if(mn(e))return e;throw TypeError("Target is not a typed array")},gn=function(e){if(xt){if(dn.call(sn,e))return e}else for(var t in vn)if(E(vn,tn)){var n=f[t];if(n&&(e===n||dn.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},bn=function(e,t,n){if(d){if(n)for(var r in vn){var o=f[r];o&&E(o.prototype,e)&&delete o.prototype[e]}fn[e]&&!n||ce(fn,e,n?t:yn&&an[e]||t)}},_n=qe("species"),Sn=wn,kn=gn,On=[].slice;bn("slice",(function(e,t){for(var n=On.call(Sn(this),e,t),r=function(e,t){var n,r=L(e).constructor;return void 0===r||null==(n=L(r)[_n])?t:tt(n)}(this,this.constructor),o=0,i=n.length,a=new(kn(r))(i);i>o;)a[o]=n[o++];return a}),l((function(){new Int8Array(1).slice()})));var Tn=qe("unscopables"),En=Array.prototype;null==En[Tn]&&D.f(En,Tn,{configurable:!0,value:kt(null)});var An,jn=Object.defineProperty,In={},xn=function(e){throw e},Pn=ge.includes,Cn=function(e,t){if(E(In,e))return In[e];t||(t={});var n=[][e],r=!!E(t,"ACCESSORS")&&t.ACCESSORS,o=E(t,0)?t[0]:xn,i=E(t,1)?t[1]:void 0;return In[e]=!!n&&!l((function(){if(r&&!d)return!0;var e={length:-1};r?jn(e,1,{enumerable:!0,get:xn}):e[1]=1,n.call(e,o,i)}))}("indexOf",{ACCESSORS:!0,1:0});Re({target:"Array",proto:!0,forced:!Cn},{includes:function(e){return Pn(this,e,arguments.length>1?arguments[1]:void 0)}}),An="includes",En[Tn][An]=!0;ot("Array","includes");Re({target:"String",proto:!0,forced:!Ye("includes")},{includes:function(e){return!!~String(_(this)).indexOf(Be(e),arguments.length>1?arguments[1]:void 0)}});ot("String","includes");function Ln(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}var Un=setTimeout;function Dn(e){return Boolean(e&&void 0!==e.length)}function Rn(){}function Fn(e){if(!(this instanceof Fn))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Jn(e,this)}function Mn(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,Fn._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void zn(t.promise,e)}Nn(t.promise,r)}else(1===e._state?Nn:zn)(t.promise,e._value)}))):e._deferreds.push(t)}function Nn(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof Fn)return e._state=3,e._value=t,void Wn(e);if("function"==typeof n)return void Jn((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,Wn(e)}catch(t){zn(e,t)}var r,o}function zn(e,t){e._state=2,e._value=t,Wn(e)}function Wn(e){2===e._state&&0===e._deferreds.length&&Fn._immediateFn((function(){e._handled||Fn._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)Mn(e,e._deferreds[t]);e._deferreds=null}function qn(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function Jn(e,t){var n=!1;try{e((function(e){n||(n=!0,Nn(t,e))}),(function(e){n||(n=!0,zn(t,e))}))}catch(e){if(n)return;n=!0,zn(t,e)}}Fn.prototype.catch=function(e){return this.then(null,e)},Fn.prototype.then=function(e,t){var n=new this.constructor(Rn);return Mn(this,new qn(e,t,n)),n},Fn.prototype.finally=Ln,Fn.all=function(e){return new Fn((function(t,n){if(!Dn(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,(function(t){i(e,t)}),n)}r[e]=a,0==--o&&t(r)}catch(e){n(e)}}for(var a=0;a<r.length;a++)i(a,r[a])}))},Fn.resolve=function(e){return e&&"object"==typeof e&&e.constructor===Fn?e:new Fn((function(t){t(e)}))},Fn.reject=function(e){return new Fn((function(t,n){n(e)}))},Fn.race=function(e){return new Fn((function(t,n){if(!Dn(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)Fn.resolve(e[r]).then(t,n)}))},Fn._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){Un(e,0)},Fn._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Bn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in Bn?Bn.Promise.prototype.finally||(Bn.Promise.prototype.finally=Ln):Bn.Promise=Fn,function(e){function t(){}function n(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1==r.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(e.TextEncoder&&e.TextDecoder)return!1;var r=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var n=e.length,r=0,o=Math.max(32,n+(n>>1)+7),i=new Uint8Array(o>>3<<3);t<n;){var a=e.charCodeAt(t++);if(55296<=a&&56319>=a){if(t<n){var c=e.charCodeAt(t);56320==(64512&c)&&(++t,a=((1023&a)<<10)+(1023&c)+65536)}if(55296<=a&&56319>=a)continue}if(r+4>i.length&&(o+=8,o=(o*=1+t/e.length*2)>>3<<3,(c=new Uint8Array(o)).set(i),i=c),0==(4294967168&a))i[r++]=a;else{if(0==(4294965248&a))i[r++]=a>>6&31|192;else if(0==(4294901760&a))i[r++]=a>>12&15|224,i[r++]=a>>6&63|128;else{if(0!=(4292870144&a))continue;i[r++]=a>>18&7|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128}i[r++]=63&a|128}}return i.slice?i.slice(0,r):i.subarray(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");e.buffer instanceof ArrayBuffer&&(e=e.buffer),e=new Uint8Array(e),t=0;for(var n=[],r=[];;){var o=t<e.length;if(!o||65536&t){if(r.push(String.fromCharCode.apply(null,n)),!o)return r.join("");n=[],e=e.subarray(t),t=0}if(0===(o=e[t++]))n.push(0);else if(0==(128&o))n.push(o);else if(192==(224&o)){var i=63&e[t++];n.push((31&o)<<6|i)}else if(224==(240&o)){i=63&e[t++];var a=63&e[t++];n.push((31&o)<<12|i<<6|a)}else if(240==(248&o)){65535<(o=(7&o)<<18|(i=63&e[t++])<<12|(a=63&e[t++])<<6|63&e[t++])&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o)}}},e.TextEncoder=t,e.TextDecoder=n}("undefined"!=typeof window?window:a),function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var u=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(t,[{key:"addEventListener",value:function(e,t){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0,o=n.length;r<o;r++)if(n[r]===t)return void n.splice(r,1)}},{key:"dispatchEvent",value:function(e){var t=this;if(e.type in this.listeners){for(var n=function(n){setTimeout((function(){return n.call(t,e)}))},r=this.listeners[e.type],o=0,i=r.length;o<i;o++)n(r[o]);return!e.defaultPrevented}}}]),t}(),s=function(t){function a(){var t;return e(this,a),(t=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?i(e):t}(this,r(a).call(this))).listeners||u.call(i(t)),Object.defineProperty(i(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(i(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,t),n(a,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),c(r(a.prototype),"dispatchEvent",this).call(this,e)}}]),a}(u),f=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new s,writable:!0,configurable:!0})}return n(t,[{key:"abort",value:function(){var e;try{e=new Event("abort")}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(e)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",s.prototype[Symbol.toStringTag]="AbortSignal"),function(e){(function(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController})(e)&&(e.AbortController=f,e.AbortSignal=s)}("undefined"!=typeof self?self:a)}();var Gn=u((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())}))},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}}));c(Gn);var Yn=c(u((function(e,t){var n=a&&a.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(a,c)}u((r=r.apply(e,t||[])).next())}))},r=a&&a.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(t,"__esModule",{value:!0});function o(e){return new Promise((function(t){return setTimeout(t,e)}))}function i(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++){n+=t[Math.floor(Math.random()*t.length)]}return n}var c=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+i(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,a){return void 0===a&&(a=5e3),n(this,void 0,void 0,(function(){var n,c,u,s,f,l;return r(this,(function(r){switch(r.label){case 0:n=Date.now()+i(4),c=Date.now()+a,u="browser-tabs-lock-key-"+t,s=window.localStorage,r.label=1;case 1:return Date.now()<c?[4,o(30)]:[3,8];case 2:return r.sent(),null!==s.getItem(u)?[3,5]:(f=this.id+"-"+t+"-"+n,[4,o(Math.floor(25*Math.random()))]);case 3:return r.sent(),s.setItem(u,JSON.stringify({id:this.id,iat:n,timeoutKey:f,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return r.sent(),null!==(l=s.getItem(u))&&(l=JSON.parse(l)).id===this.id&&l.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(u,n),[2,!0]):[3,7];case 5:return e.lockCorrector(),[4,this.waitForSomethingToChange(c)];case 6:r.sent(),r.label=7;case 7:return n=Date.now()+i(4),[3,1];case 8:return[2,!1]}}))}))},e.prototype.refreshLockWhileAcquired=function(e,t){return n(this,void 0,void 0,(function(){var o=this;return r(this,(function(i){return setTimeout((function(){return n(o,void 0,void 0,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:return[4,Gn.default().lock(t)];case 1:return r.sent(),this.acquiredIatSet.has(t)?(n=window.localStorage,null===(o=n.getItem(e))?(Gn.default().unlock(t),[2]):((o=JSON.parse(o)).timeRefreshed=Date.now(),n.setItem(e,JSON.stringify(o)),Gn.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(Gn.default().unlock(t),[2])}}))}))}),1e3),[2]}))}))},e.prototype.waitForSomethingToChange=function(t){return n(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(n){var r=!1,o=Date.now(),i=!1;function a(){if(i||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(c),i=!0),!r){r=!0;var t=50-(Date.now()-o);t>0?setTimeout(n,t):n()}}window.addEventListener("storage",a),e.addToWaiting(a);var c=setTimeout(a,Math.max(0,t-Date.now()))}))];case 1:return n.sent(),[2]}}))}))},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter((function(e){return e!==t})))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach((function(e){return e()}))},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,(function(){var n,o,i;return r(this,(function(r){switch(r.label){case 0:return n=window.localStorage,o="browser-tabs-lock-key-"+t,null===(i=n.getItem(o))?[2]:(i=JSON.parse(i)).id!==this.id?[3,2]:[4,Gn.default().lock(i.iat)];case 1:r.sent(),this.acquiredIatSet.delete(i.iat),n.removeItem(o),Gn.default().unlock(i.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}}))}))},e.lockCorrector=function(){for(var t=Date.now()-5e3,n=window.localStorage,r=Object.keys(n),o=!1,i=0;i<r.length;i++){var a=r[i];if(a.includes("browser-tabs-lock-key")){var c=n.getItem(a);null!==c&&(void 0===(c=JSON.parse(c)).timeRefreshed&&c.timeAcquired<t||void 0!==c.timeRefreshed&&c.timeRefreshed<t)&&(n.removeItem(a),o=!0)}}o&&e.notifyWaiters()},e.waiters=void 0,e}();t.default=c})));var Hn={timeoutInSeconds:60},Vn=function(e){return e.filter((function(t,n){return e.indexOf(t)===n}))},Xn={error:"timeout",error_description:"Timeout"},Kn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(Boolean).join();return Vn(n.replace(/\s/g,",").split(",")).join(" ").trim()},Qn=function(e,t){var r,o,i,a=t.popup;if(a?a.location.href=e:(r=e,o=window.screenX+(window.innerWidth-400)/2,i=window.screenY+(window.innerHeight-600)/2,a=window.open(r,"auth0:authorize:popup","left="+o+",top="+i+",width=400,height=600,resizable,scrollbars=yes,status=1")),!a)throw new Error("Could not open popup");return new Promise((function(e,r){var o=setTimeout((function(){r(n(n({},Xn),{popup:a}))}),1e3*(t.timeoutInSeconds||60));window.addEventListener("message",(function(t){if(t.data&&"authorization_response"===t.data.type){if(clearTimeout(o),a.close(),t.data.response.error)return r(t.data.response);e(t.data.response)}}))}))},Zn=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(cr().getRandomValues(new Uint8Array(43))).forEach((function(n){return t+=e[n%e.length]})),t},$n=function(e){return btoa(e)},er=function(e){return Object.keys(e).filter((function(t){return void 0!==e[t]})).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")},tr=function(e){return o(void 0,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=ur().digest({name:"SHA-256"},(new TextEncoder).encode(e)),window.msCrypto?[2,new Promise((function(e,n){t.oncomplete=function(t){e(t.target.result)},t.onerror=function(e){n(e.error)},t.onabort=function(){n("The digest operation was aborted")}}))]:[4,t];case 1:return[2,n.sent()]}}))}))},nr=function(e){return function(e){return decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},rr=function(e){var t=new Uint8Array(e);return function(e){var t={"+":"-","/":"_","=":""};return e.replace(/[\+\/=]/g,(function(e){return t[e]}))}(window.btoa(String.fromCharCode.apply(String,Array.from(t))))},or=function(e,t,r){void 0===r&&(r=1e4);var o,i,a=new AbortController,c=a.signal,u=n(n({},t),{signal:c});return Promise.race([(o=e,i=u,i=i||{},new Promise((function(e,t){var n=new XMLHttpRequest,r=[],a=[],c={},u=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:u,headers:{keys:function(){return r},entries:function(){return a},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}};for(var s in n.open(i.method||"get",o,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){r.push(t=t.toLowerCase()),a.push([t,n]),c[t]=c[t]?c[t]+","+n:n})),e(u())},n.onerror=t,n.withCredentials="include"==i.credentials,i.headers)n.setRequestHeader(s,i.headers[s]);n.send(i.body||null)}))),new Promise((function(e,t){setTimeout((function(){a.abort(),t(new Error("Timeout when executing 'fetch'"))}),r)}))])},ir=function(e,t,n){return o(void 0,void 0,void 0,(function(){var o,a,c,u,s,f,l,d,p,h;return i(this,(function(i){switch(i.label){case 0:c=0,i.label=1;case 1:if(!(c<3))return[3,6];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,or(e,n,t)];case 3:return a=i.sent(),o=null,[3,6];case 4:return u=i.sent(),o=u,[3,5];case 5:return c++,[3,1];case 6:if(o)throw o;return[4,a.json()];case 7:if(s=i.sent(),f=s.error,l=s.error_description,d=r(s,["error","error_description"]),!a.ok)throw p=l||"HTTP error. Unable to fetch "+e,(h=new Error(p)).error=f||"request_error",h.error_description=p,h;return[2,d]}}))}))},ar=function(e){return o(void 0,void 0,void 0,(function(){var t=e.baseUrl,o=e.timeout,a=r(e,["baseUrl","timeout"]);return i(this,(function(e){switch(e.label){case 0:return[4,ir(t+"/oauth/token",o,{method:"POST",body:JSON.stringify(n({redirect_uri:window.location.origin},a)),headers:{"Content-type":"application/json"}})];case 1:return[2,e.sent()]}}))}))},cr=function(){return window.crypto||window.msCrypto},ur=function(){var e=cr();return e.subtle||e.webkitSubtle},sr=function(e){return"@@auth0spajs@@::"+e.client_id+"::"+e.audience+"::"+e.scope},fr=function(e){var t=Math.floor(Date.now()/1e3)+e.expires_in;return{body:e,expiresAt:Math.min(t,e.decodedToken.claims.exp)-60}},lr=function(){function e(){}return e.prototype.save=function(e){var t=sr(e),n=fr(e);window.localStorage.setItem(t,JSON.stringify(n))},e.prototype.get=function(e){var t=sr(e),n=this.readJson(t),r=Math.floor(Date.now()/1e3);if(n){if(!(n.expiresAt<r))return n.body;if(n.body.refresh_token){var o=this.stripData(n);return this.writeJson(t,o),o.body}localStorage.removeItem(t)}},e.prototype.clear=function(){for(var e=localStorage.length-1;e>=0;e--)localStorage.key(e).startsWith("@@auth0spajs@@")&&localStorage.removeItem(localStorage.key(e))},e.prototype.readJson=function(e){var t,n=window.localStorage.getItem(e);if(n&&(t=JSON.parse(n)))return t},e.prototype.writeJson=function(e,t){localStorage.setItem(e,JSON.stringify(t))},e.prototype.stripData=function(e){return{body:{refresh_token:e.body.refresh_token},expiresAt:e.expiresAt}},e}(),dr=function(){this.enclosedCache=function(){var e={body:{},expiresAt:0};return{save:function(t){var n=sr(t),r=fr(t);e[n]=r},get:function(t){var n=sr(t),r=e[n],o=Math.floor(Date.now()/1e3);if(r)return r.expiresAt<o?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},r.body):void delete e[n]:r.body},clear:function(){e={body:{},expiresAt:0}}}}()},pr=u((function(e,t){var n=a&&a.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function o(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return r("Expires",e.expires?e.expires.toUTCString():"")+r("Domain",e.domain)+r("Path",e.path)+r("Secure",e.secure)+r("SameSite",e.sameSite)}(n)}function i(e){for(var t={},n=e?e.split("; "):[],r=/(%[\dA-F]{2})+/gi,o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=a.replace(r,decodeURIComponent)}catch(e){}}return t}function c(){return i(document.cookie)}function u(e,t,r){document.cookie=o(e,t,n({path:"/"},r))}t.__esModule=!0,t.encode=o,t.parse=i,t.getAll=c,t.get=function(e){return c()[e]},t.set=u,t.remove=function(e,t){u(e,"",n(n({},t),{expires:-1}))}}));c(pr);pr.encode,pr.parse;var hr=pr.getAll,yr=pr.get,vr=pr.set,mr=pr.remove,wr=function(e){var t=yr(e);if(void 0!==t)return JSON.parse(t)},gr=function(e,t,n){vr(e,JSON.stringify(t),{expires:n.daysUntilExpire})},br=function(e){mr(e)},_r=function(e){return"a0.spajs.txs."+e},Sr=function(){function e(){var e=this;this.transactions={},Object.keys(hr()||{}).filter((function(e){return e.startsWith("a0.spajs.txs.")})).forEach((function(t){var n=t.replace("a0.spajs.txs.","");e.transactions[n]=wr(t)}))}return e.prototype.create=function(e,t){this.transactions[e]=t,gr(_r(e),t,{daysUntilExpire:1})},e.prototype.get=function(e){return this.transactions[e]},e.prototype.remove=function(e){delete this.transactions[e],br(_r(e))},e}(),kr=function(e){return"number"==typeof e},Or=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],Tr=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(e){var t=e.split("."),n=t[0],r=t[1],o=t[2];if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");var i=JSON.parse(nr(r)),a={__raw:e},c={};return Object.keys(i).forEach((function(e){a[e]=i[e],Or.includes(e)||(c[e]=i[e])})),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(nr(n)),claims:a,user:c}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'+e.iss+'", found "'+t.claims.iss+'"');if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error('Signature algorithm of "'+t.header.alg+'" is not supported. Expected the ID token to be signed with "RS256".');if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but was not one of "'+t.claims.aud.join(", ")+'"');if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'+e.aud+'", found "'+t.claims.azp+'"')}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but found "'+t.claims.aud+'"');if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'+e.nonce+'", found "'+t.claims.nonce+'"')}if(e.max_age&&!kr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!kr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!kr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=e.leeway||60,r=new Date,o=new Date(0),i=new Date(0),a=new Date(0);if(a.setUTCSeconds((parseInt(t.claims.auth_time)+e.max_age)/1e3+n),o.setUTCSeconds(t.claims.exp+n),i.setUTCSeconds(t.claims.nbf-n),r>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time ("+r+") is after expiration time ("+o+")");if(kr(t.claims.nbf)&&r<i)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time ("+r+") is before "+i);if(kr(t.claims.auth_time)&&r>a)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time ("+r+") is after last auth at "+a);return t},Er=function(e){function n(t,r,o,i){void 0===i&&(i=null);var a=e.call(this,t,r)||this;return a.state=o,a.appState=i,Object.setPrototypeOf(a,n.prototype),a}return t(n,e),n}(function(e){function n(t,r){var o=e.call(this,r)||this;return o.error=t,o.error_description=r,Object.setPrototypeOf(o,n.prototype),o}return t(n,e),n}(Error)),Ar=new Yn,jr={memory:function(){return(new dr).enclosedCache},localstorage:function(){return new lr}},Ir=function(e){return jr[e]},xr=function(){function e(e){if(this.options=e,this.DEFAULT_SCOPE="openid profile email",function(){if(!cr())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===ur())throw new Error("\n auth0-spa-js must run on a secure origin.\n See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin \n for more information.\n ")}(),this.cacheLocation=e.cacheLocation||"memory",!Ir(this.cacheLocation))throw new Error('Invalid cache location "'+this.cacheLocation+'"');this.cache=Ir(this.cacheLocation)(),this.transactionManager=new Sr,this.domainUrl="https://"+this.options.domain,this.tokenIssuer=this.options.issuer?"https://"+this.options.issuer+"/":this.domainUrl+"/"}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify({name:"auth0-spa-js",version:"1.7.0-beta.5"})));return""+this.domainUrl+e+"&auth0Client="+t},e.prototype._getParams=function(e,t,o,i,a){var c=this.options,u=(c.domain,c.leeway,c.useRefreshTokens,c.cacheLocation,r(c,["domain","leeway","useRefreshTokens","cacheLocation"]));return n(n(n({},u),e),{scope:Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),response_type:"code",response_mode:"query",state:t,nonce:o,redirect_uri:a||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(e){return this._url("/authorize?"+er(e))},e.prototype._verifyIdToken=function(e,t){return Tr({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age)})},e.prototype._parseNumber=function(e){return"string"!=typeof e?e:parseInt(e,10)||void 0},e.prototype.buildAuthorizeUrl=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,n,o,a,c,u,s,f,l,d,p;return i(this,(function(i){switch(i.label){case 0:return t=e.redirect_uri,n=e.appState,o=r(e,["redirect_uri","appState"]),a=$n(Zn()),c=$n(Zn()),u=Zn(),[4,tr(u)];case 1:return s=i.sent(),f=rr(s),l=e.fragment?"#"+e.fragment:"",d=this._getParams(o,a,c,f,t),p=this._authorizeUrl(d),this.transactionManager.create(a,{nonce:c,code_verifier:u,appState:n,scope:d.scope,audience:d.audience||"default",redirect_uri:d.redirect_uri}),[2,p+l]}}))}))},e.prototype.loginWithPopup=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),o(this,void 0,void 0,(function(){var o,a,c,u,s,f,l,d,p,h,y,v;return i(this,(function(i){switch(i.label){case 0:return o=r(e,[]),a=$n(Zn()),c=$n(Zn()),u=Zn(),[4,tr(u)];case 1:return s=i.sent(),f=rr(s),l=this._getParams(o,a,c,f,this.options.redirect_uri||window.location.origin),d=this._authorizeUrl(n(n({},l),{response_mode:"web_message"})),[4,Qn(d,n(n({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(p=i.sent(),a!==p.state)throw new Error("Invalid state");return[4,ar({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:u,code:p.code,grant_type:"authorization_code",redirect_uri:l.redirect_uri})];case 3:return h=i.sent(),y=this._verifyIdToken(h.id_token,c),v=n(n({},h),{decodedToken:y,scope:l.scope,audience:l.audience||"default",client_id:this.options.client_id}),this.cache.save(v),gr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2]}}))}))},e.prototype.getUser=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return e.scope=Kn(this.DEFAULT_SCOPE,e.scope),[2,(t=this.cache.get(n({client_id:this.options.client_id},e)))&&t.decodedToken&&t.decodedToken.user]}))}))},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return e.scope=Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[2,(t=this.cache.get(n({client_id:this.options.client_id},e)))&&t.decodedToken&&t.decodedToken.claims]}))}))},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.buildAuthorizeUrl(e)];case 1:return t=n.sent(),window.location.assign(t),[2]}}))}))},e.prototype.handleRedirectCallback=function(e){return void 0===e&&(e=window.location.href),o(this,void 0,void 0,(function(){var t,r,o,a,c,u,s,f,l,d,p;return i(this,(function(i){switch(i.label){case 0:if(0===(t=e.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(r=function(e){e.indexOf("#")>-1&&(e=e.substr(0,e.indexOf("#")));var t=e.split("&"),r={};return t.forEach((function(e){var t=e.split("="),n=t[0],o=t[1];r[n]=decodeURIComponent(o)})),n(n({},r),{expires_in:parseInt(r.expires_in)})}(t.join("")),o=r.state,a=r.code,c=r.error,u=r.error_description,!(s=this.transactionManager.get(o)))throw new Error("Invalid state");if(c)throw this.transactionManager.remove(o),new Er(c,u,o,s.appState);return this.transactionManager.remove(o),f={baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},void 0!==s.redirect_uri&&(f.redirect_uri=s.redirect_uri),[4,ar(f)];case 1:return l=i.sent(),d=this._verifyIdToken(l.id_token,s.nonce),p=n(n({},l),{decodedToken:d,audience:s.audience,scope:s.scope,client_id:this.options.client_id}),this.cache.save(p),gr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,{appState:s.appState}]}}))}))},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,o,a,c,u,s;return i(this,(function(i){switch(i.label){case 0:t=n({audience:this.options.audience,scope:Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),ignoreCache:!1},e),o=t.ignoreCache,a=r(t,["ignoreCache"]),i.label=1;case 1:return i.trys.push([1,7,8,10]),!o&&(c=this.cache.get({scope:a.scope,audience:a.audience||"default",client_id:this.options.client_id}))&&c.access_token?[2,c.access_token]:[4,Ar.acquireLock("auth0.lock.getTokenSilently",5e3)];case 2:return i.sent(),this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(a)]:[3,4];case 3:return s=i.sent(),[3,6];case 4:return[4,this._getTokenFromIFrame(a)];case 5:s=i.sent(),i.label=6;case 6:return u=s,this.cache.save(n({client_id:this.options.client_id},u)),gr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,u.access_token];case 7:throw i.sent();case 8:return[4,Ar.releaseLock("auth0.lock.getTokenSilently")];case 9:return i.sent(),[7];case 10:return[2]}}))}))},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE}),void 0===t&&(t=Hn),o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return e.scope=Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[4,this.loginWithPopup(e,t)];case 1:return n.sent(),[2,this.cache.get({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}).access_token]}}))}))},e.prototype.isAuthenticated=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.getUser()];case 1:return[2,!!e.sent()]}}))}))},e.prototype.logout=function(e){void 0===e&&(e={}),null!==e.client_id?e.client_id=e.client_id||this.options.client_id:delete e.client_id;var t=e.federated,n=e.localOnly,o=r(e,["federated","localOnly"]);if(n&&t)throw new Error("It is invalid to set both the `federated` and `localOnly` options to `true`");if(this.cache.clear(),br("auth0.is.authenticated"),!n){var i=t?"&federated":"",a=this._url("/v2/logout?"+er(o));window.location.assign(""+a+i)}},e.prototype._getTokenFromIFrame=function(e){return o(this,void 0,void 0,(function(){var t,r,o,a,c,u,s,f,l,d,p;return i(this,(function(i){switch(i.label){case 0:return t=$n(Zn()),r=$n(Zn()),o=Zn(),[4,tr(o)];case 1:return a=i.sent(),c=rr(a),u=this._getParams(e,t,r,c,e.redirect_uri||this.options.redirect_uri||window.location.origin),s=this._authorizeUrl(n(n({},u),{prompt:"none",response_mode:"web_message"})),f=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,(h=s,y=this.domainUrl,v=f,void 0===v&&(v=60),new Promise((function(e,t){var n=window.document.createElement("iframe");n.setAttribute("width","0"),n.setAttribute("height","0"),n.style.display="none";var r=setTimeout((function(){t(Xn),window.document.body.removeChild(n)}),1e3*v),o=function(i){i.origin==y&&i.data&&"authorization_response"===i.data.type&&(i.source.close(),i.data.response.error?t(i.data.response):e(i.data.response),clearTimeout(r),window.removeEventListener("message",o,!1),setTimeout((function(){return window.document.body.removeChild(n)}),2e3))};window.addEventListener("message",o,!1),window.document.body.appendChild(n),n.setAttribute("src",h)})))];case 2:if(l=i.sent(),t!==l.state)throw new Error("Invalid state");return[4,ar({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:o,code:l.code,grant_type:"authorization_code",redirect_uri:u.redirect_uri})];case 3:return d=i.sent(),p=this._verifyIdToken(d.id_token,r),[2,n(n({},d),{decodedToken:p,scope:u.scope,audience:u.audience||"default"})]}var h,y,v}))}))},e.prototype._getTokenUsingRefreshToken=function(e){return o(this,void 0,void 0,(function(){var t,r,o,a;return i(this,(function(i){switch(i.label){case 0:return e.scope=Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),(t=this.cache.get({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}))&&t.refresh_token?[3,2]:[4,this._getTokenFromIFrame(e)];case 1:return[2,i.sent()];case 2:return r=e.redirect_uri||this.options.redirect_uri||window.location.origin,[4,ar({baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:t.refresh_token,redirect_uri:r})];case 3:return o=i.sent(),a=this._verifyIdToken(o.id_token),[2,n(n({},o),{decodedToken:a,scope:e.scope,audience:e.audience||"default"})]}}))}))},e}();export default function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:if(e.useRefreshTokens&&(e.scope=Kn(e.scope,"offline_access")),"memory"===(t=new xr(e)).cacheLocation&&!wr("auth0.is.authenticated"))return[2,t];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.getTokenSilently()];case 2:return r.sent(),[3,4];case 3:if("login_required"!==(n=r.sent()).error)throw n;return[3,4];case 4:return[2,t]}}))}))}export{xr as Auth0Client};
//# sourceMappingURL=auth0-spa-js.production.esm.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).createAuth0Client=t()}(this,function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function o(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}s((r=r.apply(e,t||[])).next())})}function i(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e,t){return e(t={exports:{}},t.exports),t.exports}var u,f,l,d="object",p=function(e){return e&&e.Math==Math&&e},h=p(typeof globalThis==d&&globalThis)||p(typeof window==d&&window)||p(typeof self==d&&self)||p(typeof a==d&&a)||Function("return this")(),y=function(e){try{return!!e()}catch(e){return!0}},v=!y(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),m={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,w={f:g&&!m.call({1:2},1)?function(e){var t=g(this,e);return!!t&&t.enumerable}:m},b=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},_={}.toString,k=function(e){return _.call(e).slice(8,-1)},S="".split,O=y(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==k(e)?S.call(e,""):Object(e)}:Object,T=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},E=function(e){return O(T(e))},A=function(e){return"object"==typeof e?null!==e:"function"==typeof e},I=function(e,t){if(!A(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!A(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!A(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!A(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},j={}.hasOwnProperty,P=function(e,t){return j.call(e,t)},x=h.document,C=A(x)&&A(x.createElement),L=function(e){return C?x.createElement(e):{}},U=!v&&!y(function(){return 7!=Object.defineProperty(L("div"),"a",{get:function(){return 7}}).a}),D=Object.getOwnPropertyDescriptor,R={f:v?D:function(e,t){if(e=E(e),t=I(t,!0),U)try{return D(e,t)}catch(e){}if(P(e,t))return b(!w.f.call(e,t),e[t])}},F=function(e){if(!A(e))throw TypeError(String(e)+" is not an object");return e},M=Object.defineProperty,N={f:v?M:function(e,t,n){if(F(e),t=I(t,!0),F(n),U)try{return M(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},z=v?function(e,t,n){return N.f(e,t,b(1,n))}:function(e,t,n){return e[t]=n,e},q=function(e,t){try{z(h,e,t)}catch(n){h[e]=t}return t},W=s(function(e){var t=h["__core-js_shared__"]||q("__core-js_shared__",{});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),J=W("native-function-to-string",Function.toString),B=h.WeakMap,G="function"==typeof B&&/native code/.test(J.call(B)),Y=0,H=Math.random(),V=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Y+H).toString(36)},K=W("keys"),Q=function(e){return K[e]||(K[e]=V(e))},X={},Z=h.WeakMap;if(G){var $=new Z,ee=$.get,te=$.has,ne=$.set;u=function(e,t){return ne.call($,e,t),t},f=function(e){return ee.call($,e)||{}},l=function(e){return te.call($,e)}}else{var re=Q("state");X[re]=!0,u=function(e,t){return z(e,re,t),t},f=function(e){return P(e,re)?e[re]:{}},l=function(e){return P(e,re)}}var oe={set:u,get:f,has:l,enforce:function(e){return l(e)?f(e):u(e,{})},getterFor:function(e){return function(t){var n;if(!A(t)||(n=f(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ie=s(function(e){var t=oe.get,n=oe.enforce,r=String(J).split("toString");W("inspectSource",function(e){return J.call(e)}),(e.exports=function(e,t,o,i){var a=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,s=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||P(o,"name")||z(o,"name",t),n(o).source=r.join("string"==typeof t?t:"")),e!==h?(a?!s&&e[t]&&(c=!0):delete e[t],c?e[t]=o:z(e,t,o)):c?e[t]=o:q(t,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&t(this).source||J.call(this)})}),ae=h,ce=function(e){return"function"==typeof e?e:void 0},se=function(e,t){return arguments.length<2?ce(ae[e])||ce(h[e]):ae[e]&&ae[e][t]||h[e]&&h[e][t]},ue=Math.ceil,fe=Math.floor,le=function(e){return isNaN(e=+e)?0:(e>0?fe:ue)(e)},de=Math.min,pe=function(e){return e>0?de(le(e),9007199254740991):0},he=Math.max,ye=Math.min,ve=function(e){return function(t,n,r){var o,i=E(t),a=pe(i.length),c=function(e,t){var n=le(e);return n<0?he(n+t,0):ye(n,t)}(r,a);if(e&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},me={includes:ve(!0),indexOf:ve(!1)},ge=me.indexOf,we=function(e,t){var n,r=E(e),o=0,i=[];for(n in r)!P(X,n)&&P(r,n)&&i.push(n);for(;t.length>o;)P(r,n=t[o++])&&(~ge(i,n)||i.push(n));return i},be=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_e=be.concat("length","prototype"),ke={f:Object.getOwnPropertyNames||function(e){return we(e,_e)}},Se={f:Object.getOwnPropertySymbols},Oe=se("Reflect","ownKeys")||function(e){var t=ke.f(F(e)),n=Se.f;return n?t.concat(n(e)):t},Te=function(e,t){for(var n=Oe(t),r=N.f,o=R.f,i=0;i<n.length;i++){var a=n[i];P(e,a)||r(e,a,o(t,a))}},Ee=/#|\.prototype\./,Ae=function(e,t){var n=je[Ie(e)];return n==xe||n!=Pe&&("function"==typeof t?y(t):!!t)},Ie=Ae.normalize=function(e){return String(e).replace(Ee,".").toLowerCase()},je=Ae.data={},Pe=Ae.NATIVE="N",xe=Ae.POLYFILL="P",Ce=Ae,Le=R.f,Ue=function(e,t){var n,r,o,i,a,c=e.target,s=e.global,u=e.stat;if(n=s?h:u?h[c]||q(c,{}):(h[c]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=Le(n,r))&&a.value:n[r],!Ce(s?r:c+(u?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Te(i,o)}(e.sham||o&&o.sham)&&z(i,"sham",!0),ie(n,r,i,e)}},De=!!Object.getOwnPropertySymbols&&!y(function(){return!String(Symbol())}),Re=h.Symbol,Fe=W("wks"),Me=function(e){return Fe[e]||(Fe[e]=De&&Re[e]||(De?Re:V)("Symbol."+e))},Ne=Me("match"),ze=function(e){if(function(e){var t;return A(e)&&(void 0!==(t=e[Ne])?!!t:"RegExp"==k(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},qe=Me("match"),We=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[qe]=!1,"/./"[e](t)}catch(e){}}return!1},Je="".startsWith,Be=Math.min;Ue({target:"String",proto:!0,forced:!We("startsWith")},{startsWith:function(e){var t=String(T(this));ze(e);var n=pe(Be(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Je?Je.call(t,r,n):t.slice(n,n+r.length)===r}});var Ge,Ye,He,Ve=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Ke=function(e,t,n){if(Ve(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}},Qe=Function.call,Xe=function(e,t,n){return Ke(Qe,h[e].prototype[t],n)},Ze=(Xe("String","startsWith"),function(e){return function(t,n){var r,o,i=String(T(t)),a=le(n),c=i.length;return a<0||a>=c?e?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):r:e?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}}),$e={codeAt:Ze(!1),charAt:Ze(!0)},et=function(e){return Object(T(e))},tt=!y(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),nt=Q("IE_PROTO"),rt=Object.prototype,ot=tt?Object.getPrototypeOf:function(e){return e=et(e),P(e,nt)?e[nt]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?rt:null},it=Me("iterator"),at=!1;[].keys&&("next"in(He=[].keys())?(Ye=ot(ot(He)))!==Object.prototype&&(Ge=Ye):at=!0),null==Ge&&(Ge={}),P(Ge,it)||z(Ge,it,function(){return this});var ct={IteratorPrototype:Ge,BUGGY_SAFARI_ITERATORS:at},st=Object.keys||function(e){return we(e,be)},ut=v?Object.defineProperties:function(e,t){F(e);for(var n,r=st(t),o=r.length,i=0;o>i;)N.f(e,n=r[i++],t[n]);return e},ft=se("document","documentElement"),lt=Q("IE_PROTO"),dt=function(){},pt=function(){var e,t=L("iframe"),n=be.length;for(t.style.display="none",ft.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),pt=e.F;n--;)delete pt.prototype[be[n]];return pt()},ht=Object.create||function(e,t){var n;return null!==e?(dt.prototype=F(e),n=new dt,dt.prototype=null,n[lt]=e):n=pt(),void 0===t?n:ut(n,t)};X[lt]=!0;var yt=N.f,vt=Me("toStringTag"),mt=function(e,t,n){e&&!P(e=n?e:e.prototype,vt)&&yt(e,vt,{configurable:!0,value:t})},gt={},wt=ct.IteratorPrototype,bt=function(){return this},_t=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return F(n),function(e){if(!A(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),kt=ct.IteratorPrototype,St=ct.BUGGY_SAFARI_ITERATORS,Ot=Me("iterator"),Tt=function(){return this},Et=$e.charAt,At=oe.set,It=oe.getterFor("String Iterator");!function(e,t,n,r,o,i,a){!function(e,t,n){var r=t+" Iterator";e.prototype=ht(wt,{next:b(1,n)}),mt(e,r,!1),gt[r]=bt}(n,t,r);var c,s,u,f=function(e){if(e===o&&y)return y;if(!St&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",d=!1,p=e.prototype,h=p[Ot]||p["@@iterator"]||o&&p[o],y=!St&&h||f(o),v="Array"==t&&p.entries||h;if(v&&(c=ot(v.call(new e)),kt!==Object.prototype&&c.next&&(ot(c)!==kt&&(_t?_t(c,kt):"function"!=typeof c[Ot]&&z(c,Ot,Tt)),mt(c,l,!0))),"values"==o&&h&&"values"!==h.name&&(d=!0,y=function(){return h.call(this)}),p[Ot]!==y&&z(p,Ot,y),gt[t]=y,o)if(s={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},a)for(u in s)!St&&!d&&u in p||ie(p,u,s[u]);else Ue({target:t,proto:!0,forced:St||d},s)}(String,"String",function(e){At(this,{type:"String Iterator",string:String(e),index:0})},function(){var e,t=It(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Et(n,r),t.index+=e.length,{value:e,done:!1})});var jt=function(e,t,n,r){try{return r?t(F(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&F(o.call(e)),t}},Pt=Me("iterator"),xt=Array.prototype,Ct=function(e){return void 0!==e&&(gt.Array===e||xt[Pt]===e)},Lt=function(e,t,n){var r=I(t);r in e?N.f(e,r,b(0,n)):e[r]=n},Ut=Me("toStringTag"),Dt="Arguments"==k(function(){return arguments}()),Rt=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Ut))?n:Dt?k(t):"Object"==(r=k(t))&&"function"==typeof t.callee?"Arguments":r},Ft=Me("iterator"),Mt=function(e){if(null!=e)return e[Ft]||e["@@iterator"]||gt[Rt(e)]},Nt=Me("iterator"),zt=!1;try{var qt=0,Wt={next:function(){return{done:!!qt++}},return:function(){zt=!0}};Wt[Nt]=function(){return this},Array.from(Wt,function(){throw 2})}catch(e){}var Jt=!function(e,t){if(!t&&!zt)return!1;var n=!1;try{var r={};r[Nt]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}(function(e){Array.from(e)});Ue({target:"Array",stat:!0,forced:Jt},{from:function(e){var t,n,r,o,i=et(e),a="function"==typeof this?this:Array,c=arguments.length,s=c>1?arguments[1]:void 0,u=void 0!==s,f=0,l=Mt(i);if(u&&(s=Ke(s,c>2?arguments[2]:void 0,2)),null==l||a==Array&&Ct(l))for(n=new a(t=pe(i.length));t>f;f++)Lt(n,f,u?s(i[f],f):i[f]);else for(o=l.call(i),n=new a;!(r=o.next()).done;f++)Lt(n,f,u?jt(o,s,[r.value,f],!0):r.value);return n.length=f,n}});ae.Array.from;var Bt,Gt=N.f,Yt=h.DataView,Ht=Yt&&Yt.prototype,Vt=h.Int8Array,Kt=Vt&&Vt.prototype,Qt=h.Uint8ClampedArray,Xt=Qt&&Qt.prototype,Zt=Vt&&ot(Vt),$t=Kt&&ot(Kt),en=Object.prototype,tn=en.isPrototypeOf,nn=Me("toStringTag"),rn=V("TYPED_ARRAY_TAG"),on=!(!h.ArrayBuffer||!Yt),an=on&&!!_t&&"Opera"!==Rt(h.opera),cn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},sn=function(e){return A(e)&&P(cn,Rt(e))};for(Bt in cn)h[Bt]||(an=!1);if((!an||"function"!=typeof Zt||Zt===Function.prototype)&&(Zt=function(){throw TypeError("Incorrect invocation")},an))for(Bt in cn)h[Bt]&&_t(h[Bt],Zt);if((!an||!$t||$t===en)&&($t=Zt.prototype,an))for(Bt in cn)h[Bt]&&_t(h[Bt].prototype,$t);if(an&&ot(Xt)!==$t&&_t(Xt,$t),v&&!P($t,nn))for(Bt in!0,Gt($t,nn,{get:function(){return A(this)?this[rn]:void 0}}),cn)h[Bt]&&z(h[Bt],rn,Bt);on&&_t&&ot(Ht)!==en&&_t(Ht,en);var un=function(e){if(sn(e))return e;throw TypeError("Target is not a typed array")},fn=function(e){if(_t){if(tn.call(Zt,e))return e}else for(var t in cn)if(P(cn,Bt)){var n=h[t];if(n&&(e===n||tn.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},ln=function(e,t,n){if(v){if(n)for(var r in cn){var o=h[r];o&&P(o.prototype,e)&&delete o.prototype[e]}$t[e]&&!n||ie($t,e,n?t:an&&Kt[e]||t)}},dn=Me("species"),pn=un,hn=fn,yn=[].slice;ln("slice",function(e,t){for(var n=yn.call(pn(this),e,t),r=function(e,t){var n,r=F(e).constructor;return void 0===r||null==(n=F(r)[dn])?t:Ve(n)}(this,this.constructor),o=0,i=n.length,a=new(hn(r))(i);i>o;)a[o]=n[o++];return a},y(function(){new Int8Array(1).slice()}));var vn=Me("unscopables"),mn=Array.prototype;null==mn[vn]&&z(mn,vn,ht(null));var gn,wn=me.includes;Ue({target:"Array",proto:!0},{includes:function(e){return wn(this,e,arguments.length>1?arguments[1]:void 0)}}),gn="includes",mn[vn][gn]=!0;Xe("Array","includes");Ue({target:"String",proto:!0,forced:!We("includes")},{includes:function(e){return!!~String(T(this)).indexOf(ze(e),arguments.length>1?arguments[1]:void 0)}});Xe("String","includes");function bn(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}var _n=setTimeout;function kn(e){return Boolean(e&&void 0!==e.length)}function Sn(){}function On(e){if(!(this instanceof On))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Pn(e,this)}function Tn(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,On._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void An(t.promise,e)}En(t.promise,r)}else(1===e._state?En:An)(t.promise,e._value)})):e._deferreds.push(t)}function En(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof On)return e._state=3,e._value=t,void In(e);if("function"==typeof n)return void Pn((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,In(e)}catch(t){An(e,t)}var r,o}function An(e,t){e._state=2,e._value=t,In(e)}function In(e){2===e._state&&0===e._deferreds.length&&On._immediateFn(function(){e._handled||On._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)Tn(e,e._deferreds[t]);e._deferreds=null}function jn(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function Pn(e,t){var n=!1;try{e(function(e){n||(n=!0,En(t,e))},function(e){n||(n=!0,An(t,e))})}catch(e){if(n)return;n=!0,An(t,e)}}On.prototype.catch=function(e){return this.then(null,e)},On.prototype.then=function(e,t){var n=new this.constructor(Sn);return Tn(this,new jn(e,t,n)),n},On.prototype.finally=bn,On.all=function(e){return new On(function(t,n){if(!kn(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,function(t){i(e,t)},n)}r[e]=a,0==--o&&t(r)}catch(e){n(e)}}for(var a=0;a<r.length;a++)i(a,r[a])})},On.resolve=function(e){return e&&"object"==typeof e&&e.constructor===On?e:new On(function(t){t(e)})},On.reject=function(e){return new On(function(t,n){n(e)})},On.race=function(e){return new On(function(t,n){if(!kn(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)On.resolve(e[r]).then(t,n)})},On._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){_n(e,0)},On._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var xn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in xn?xn.Promise.prototype.finally||(xn.Promise.prototype.finally=bn):xn.Promise=On,function(e){function t(e){if("utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+e+"') is invalid.")}function n(e,t){if(t=void 0===t?{fatal:!1}:t,"utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(e.TextEncoder&&e.TextDecoder)return!1;Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var n=e.length,r=0,o=Math.max(32,n+(n>>1)+7),i=new Uint8Array(o>>3<<3);t<n;){var a=e.charCodeAt(t++);if(55296<=a&&56319>=a){if(t<n){var c=e.charCodeAt(t);56320==(64512&c)&&(++t,a=((1023&a)<<10)+(1023&c)+65536)}if(55296<=a&&56319>=a)continue}if(r+4>i.length&&(o+=8,o=(o*=1+t/e.length*2)>>3<<3,(c=new Uint8Array(o)).set(i),i=c),0==(4294967168&a))i[r++]=a;else{if(0==(4294965248&a))i[r++]=a>>6&31|192;else if(0==(4294901760&a))i[r++]=a>>12&15|224,i[r++]=a>>6&63|128;else{if(0!=(4292870144&a))continue;i[r++]=a>>18&7|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128}i[r++]=63&a|128}}return i.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");t=0;for(var n=(e=new Uint8Array(e)).length,r=[];t<n;){var o=e[t++];if(0===o)break;if(0==(128&o))r.push(o);else if(192==(224&o)){var i=63&e[t++];r.push((31&o)<<6|i)}else if(224==(240&o)){i=63&e[t++];var a=63&e[t++];r.push((31&o)<<12|i<<6|a)}else if(240==(248&o)){65535<(o=(7&o)<<18|(i=63&e[t++])<<12|(a=63&e[t++])<<6|63&e[t++])&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}}return String.fromCharCode.apply(null,r)},e.TextEncoder=t,e.TextDecoder=n}("undefined"!=typeof window?window:a),function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var s=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(t,[{key:"addEventListener",value:function(e,t){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0,o=n.length;r<o;r++)if(n[r]===t)return void n.splice(r,1)}},{key:"dispatchEvent",value:function(e){var t=this;if(e.type in this.listeners){for(var n=function(n){setTimeout(function(){return n.call(t,e)})},r=this.listeners[e.type],o=0,i=r.length;o<i;o++)n(r[o]);return!e.defaultPrevented}}}]),t}(),u=function(t){function a(){var t;return e(this,a),(t=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?i(e):t}(this,r(a).call(this))).listeners||s.call(i(t)),Object.defineProperty(i(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(i(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,t),n(a,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),c(r(a.prototype),"dispatchEvent",this).call(this,e)}}]),a}(s),f=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new u,writable:!0,configurable:!0})}return n(t,[{key:"abort",value:function(){var e;try{e=new Event("abort")}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(e)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",u.prototype[Symbol.toStringTag]="AbortSignal"),function(e){(function(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController})(e)&&(e.AbortController=f,e.AbortSignal=u)}("undefined"!=typeof self?self:a)}();var Cn=s(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())})},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}});c(Cn);var Ln=c(s(function(e,t){var n=a&&a.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}s((r=r.apply(e,t||[])).next())})},r=a&&a.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(t,"__esModule",{value:!0});var o="browser-tabs-lock-key";function i(e){return new Promise(function(t){return setTimeout(t,e)})}function c(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++){n+=t[Math.floor(Math.random()*t.length)]}return n}var s=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+c(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(e,t){return void 0===t&&(t=5e3),n(this,void 0,void 0,function(){var n,a,s,f,l,d;return r(this,function(r){switch(r.label){case 0:n=Date.now()+c(4),a=Date.now()+t,s=o+"-"+e,f=window.localStorage,r.label=1;case 1:return Date.now()<a?null!==f.getItem(s)?[3,4]:(l=this.id+"-"+e+"-"+n,[4,i(Math.floor(25*Math.random()))]):[3,7];case 2:return r.sent(),f.setItem(s,JSON.stringify({id:this.id,iat:n,timeoutKey:l,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,i(30)];case 3:return r.sent(),null!==(d=f.getItem(s))&&(d=JSON.parse(d)).id===this.id&&d.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(s,n),[2,!0]):[3,6];case 4:return u(),[4,this.waitForSomethingToChange(a)];case 5:r.sent(),r.label=6;case 6:return n=Date.now()+c(4),[3,1];case 7:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return n(this,void 0,void 0,function(){var o=this;return r(this,function(i){return setTimeout(function(){return n(o,void 0,void 0,function(){var n,o;return r(this,function(r){switch(r.label){case 0:return[4,Cn.default().lock(t)];case 1:return r.sent(),this.acquiredIatSet.has(t)?(n=window.localStorage,null===(o=n.getItem(e))?(Cn.default().unlock(t),[2]):((o=JSON.parse(o)).timeRefreshed=Date.now(),n.setItem(e,JSON.stringify(o)),Cn.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(Cn.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return n(this,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,o=Date.now(),i=50,a=!1;function c(){if(a||(window.removeEventListener("storage",c),e.removeFromWaiting(c),clearTimeout(s),a=!0),!r){r=!0;var t=i-(Date.now()-o);t>0?setTimeout(n,t):n()}}window.addEventListener("storage",c),e.addToWaiting(c);var s=setTimeout(c,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,i,a;return r(this,function(r){switch(r.label){case 0:return n=window.localStorage,i=o+"-"+t,null===(a=n.getItem(i))?[2]:(a=JSON.parse(a)).id!==this.id?[3,2]:[4,Cn.default().lock(a.iat)];case 1:r.sent(),this.acquiredIatSet.delete(a.iat),n.removeItem(i),Cn.default().unlock(a.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.waiters=void 0,e}();function u(){for(var e=Date.now()-5e3,t=window.localStorage,n=Object.keys(t),r=!1,i=0;i<n.length;i++){var a=n[i];if(a.includes(o)){var c=t.getItem(a);null!==c&&(void 0===(c=JSON.parse(c)).timeRefreshed&&c.timeAcquired<e||void 0!==c.timeRefreshed&&c.timeRefreshed<e)&&(t.removeItem(a),r=!0)}}r&&s.notifyWaiters()}t.default=s}));var Un={timeoutInSeconds:60},Dn="memory",Rn=function(e){return e.filter(function(t,n){return e.indexOf(t)===n})},Fn={error:"timeout",error_description:"Timeout"},Mn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(Boolean).join();return Rn(n.replace(/\s/g,",").split(",")).join(" ").trim()},Nn=function(){var e=window.open("","auth0:authorize:popup","left=100,top=100,width=400,height=600,resizable,scrollbars=yes,status=1");if(!e)throw new Error("Could not open popup");return e},zn=function(e,t,r){return e.location.href=t,new Promise(function(t,o){var i=setTimeout(function(){o(n(n({},Fn),{popup:e}))},1e3*(r.timeoutInSeconds||60));window.addEventListener("message",function(n){if(n.data&&"authorization_response"===n.data.type){if(clearTimeout(i),e.close(),n.data.response.error)return o(n.data.response);t(n.data.response)}})})},qn=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(Qn().getRandomValues(new Uint8Array(43))).forEach(function(n){return t+=e[n%e.length]}),t},Wn=function(e){return btoa(e)},Jn=function(e){return Object.keys(e).filter(function(t){return void 0!==e[t]}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},Bn=function(e){return o(void 0,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return t=Xn().digest({name:"SHA-256"},(new TextEncoder).encode(e)),window.msCrypto?[2,new Promise(function(e,n){t.oncomplete=function(t){e(t.target.result)},t.onerror=function(e){n(e.error)},t.onabort=function(){n("The digest operation was aborted")}})]:[4,t];case 1:return[2,n.sent()]}})})},Gn=function(e){return function(e){return decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},Yn=function(e){var t=new Uint8Array(e);return function(e){var t={"+":"-","/":"_","=":""};return e.replace(/[\+\/=]/g,function(e){return t[e]})}(window.btoa(String.fromCharCode.apply(String,Array.from(t))))},Hn=function(e,t,r){void 0===r&&(r=1e4);var o,i,a=new AbortController,c=a.signal,s=n(n({},t),{signal:c});return Promise.race([(o=e,i=s,i=i||{},new Promise(function(e,t){var n=new XMLHttpRequest,r=[],a=[],c={},s=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:s,headers:{keys:function(){return r},entries:function(){return a},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}};for(var u in n.open(i.method||"get",o,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){r.push(t=t.toLowerCase()),a.push([t,n]),c[t]=c[t]?c[t]+","+n:n}),e(s())},n.onerror=t,n.withCredentials="include"==i.credentials,i.headers)n.setRequestHeader(u,i.headers[u]);n.send(i.body||null)})),new Promise(function(e,t){setTimeout(function(){a.abort(),t(new Error("Timeout when executing 'fetch'"))},r)})])},Vn=function(e,t,n){return o(void 0,void 0,void 0,function(){var o,a,c,s,u,f,l,d,p,h;return i(this,function(i){switch(i.label){case 0:c=0,i.label=1;case 1:if(!(c<3))return[3,6];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,Hn(e,n,t)];case 3:return a=i.sent(),o=null,[3,6];case 4:return s=i.sent(),o=s,[3,5];case 5:return c++,[3,1];case 6:if(o)throw o;return[4,a.json()];case 7:if(u=i.sent(),f=u.error,l=u.error_description,d=r(u,["error","error_description"]),!a.ok)throw p=l||"HTTP error. Unable to fetch "+e,(h=new Error(p)).error=f||"request_error",h.error_description=p,h;return[2,d]}})})},Kn=function(e){return o(void 0,void 0,void 0,function(){var t=e.baseUrl,o=e.timeout,a=r(e,["baseUrl","timeout"]);return i(this,function(e){switch(e.label){case 0:return[4,Vn(t+"/oauth/token",o,{method:"POST",body:JSON.stringify(n({redirect_uri:window.location.origin},a)),headers:{"Content-type":"application/json"}})];case 1:return[2,e.sent()]}})})},Qn=function(){return window.crypto||window.msCrypto},Xn=function(){var e=Qn();return e.subtle||e.webkitSubtle},Zn=function(){if(!Qn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===Xn())throw new Error("\n auth0-spa-js must run on a secure origin.\n See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin \n for more information.\n ")},$n=function(e){return"@@auth0spajs@@::"+e.client_id+"::"+e.audience+"::"+e.scope},er=function(e){var t=Math.floor(Date.now()/1e3)+e.expires_in;return{body:e,expiresAt:Math.min(t,e.decodedToken.claims.exp)-60}},tr=function(){function e(){}return e.prototype.save=function(e){var t=$n(e),n=er(e);window.localStorage.setItem(t,JSON.stringify(n))},e.prototype.get=function(e){var t=$n(e),n=this.readJson(t),r=Math.floor(Date.now()/1e3);if(n){if(!(n.expiresAt<r))return n.body;if(n.body.refresh_token){var o=this.stripData(n);return this.writeJson(t,o),o.body}localStorage.removeItem(t)}},e.prototype.clear=function(){for(var e=localStorage.length-1;e>=0;e--)localStorage.key(e).startsWith("@@auth0spajs@@")&&localStorage.removeItem(localStorage.key(e))},e.prototype.readJson=function(e){var t,n=window.localStorage.getItem(e);if(n&&(t=JSON.parse(n)))return t},e.prototype.writeJson=function(e,t){localStorage.setItem(e,JSON.stringify(t))},e.prototype.stripData=function(e){return{body:{refresh_token:e.body.refresh_token},expiresAt:e.expiresAt}},e}(),nr=function(){var e;this.enclosedCache=(e={body:{},expiresAt:0},{save:function(t){var n=$n(t),r=er(t);e[n]=r},get:function(t){var n=$n(t),r=e[n],o=Math.floor(Date.now()/1e3);if(r)return r.expiresAt<o?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},r.body):void delete e[n]:r.body},clear:function(){e={body:{},expiresAt:0}}})},rr=s(function(e,t){var n=a&&a.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function r(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function o(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return r("Expires",e.expires?e.expires.toUTCString():"")+r("Domain",e.domain)+r("Path",e.path)+r("Secure",e.secure)+r("SameSite",e.sameSite)}(n)}function i(e){for(var t={},n=e?e.split("; "):[],r=/(%[0-9A-Z]{2})+/g,o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=a.replace(r,decodeURIComponent)}catch(e){}}return t}function c(){return i(document.cookie)}function s(e,t,r){document.cookie=o(e,t,n({path:"/"},r))}t.__esModule=!0,t.encode=o,t.parse=i,t.getAll=c,t.get=function(e){return c()[e]},t.set=s,t.remove=function(e,t){s(e,"",n({},t,{expires:-1}))}});c(rr);rr.encode,rr.parse;var or=rr.getAll,ir=rr.get,ar=rr.set,cr=rr.remove,sr=function(){return Object.keys(or()||{})},ur=function(e){var t=ir(e);if(void 0!==t)return JSON.parse(t)},fr=function(e,t,n){ar(e,JSON.stringify(t),{expires:n.daysUntilExpire})},lr=function(e){cr(e)},dr="a0.spajs.txs.",pr=function(e){return""+dr+e},hr=function(){function e(){var e=this;this.transactions={},sr().filter(function(e){return e.startsWith(dr)}).forEach(function(t){var n=t.replace(dr,"");e.transactions[n]=ur(t)})}return e.prototype.create=function(e,t){this.transactions[e]=t,fr(pr(e),t,{daysUntilExpire:1})},e.prototype.get=function(e){return this.transactions[e]},e.prototype.remove=function(e){delete this.transactions[e],lr(pr(e))},e}(),yr=function(e){return"number"==typeof e},vr=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],mr=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(e){var t=e.split("."),n=t[0],r=t[1],o=t[2];if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");var i=JSON.parse(Gn(r)),a={__raw:e},c={};return Object.keys(i).forEach(function(e){a[e]=i[e],vr.includes(e)||(c[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(Gn(n)),claims:a,user:c}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'+e.iss+'", found "'+t.claims.iss+'"');if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error('Signature algorithm of "'+t.header.alg+'" is not supported. Expected the ID token to be signed with "RS256".');if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but was not one of "'+t.claims.aud.join(", ")+'"');if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'+e.aud+'", found "'+t.claims.azp+'"')}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but found "'+t.claims.aud+'"');if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'+e.nonce+'", found "'+t.claims.nonce+'"')}if(e.max_age&&!yr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!yr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!yr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=e.leeway||60,r=new Date,o=new Date(0),i=new Date(0),a=new Date(0);if(a.setUTCSeconds((parseInt(t.claims.auth_time)+e.max_age)/1e3+n),o.setUTCSeconds(t.claims.exp+n),i.setUTCSeconds(t.claims.nbf-n),r>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time ("+r+") is after expiration time ("+o+")");if(yr(t.claims.nbf)&&r<i)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time ("+r+") is before "+i);if(yr(t.claims.auth_time)&&r>a)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time ("+r+") is after last auth at "+a);return t},gr=function(e){function n(t,r,o,i){void 0===i&&(i=null);var a=e.call(this,t,r)||this;return a.state=o,a.appState=i,Object.setPrototypeOf(a,n.prototype),a}return t(n,e),n}(function(e){function n(t,r){var o=e.call(this,r)||this;return o.error=t,o.error_description=r,Object.setPrototypeOf(o,n.prototype),o}return t(n,e),n}(Error)),wr=new Ln,br={memory:function(){return(new nr).enclosedCache},localstorage:function(){return new tr}},_r=function(e){return br[e]},kr=function(){function e(e){if(this.options=e,this.DEFAULT_SCOPE="openid profile email",this.cacheLocation=e.cacheLocation||"memory",!_r(this.cacheLocation))throw new Error('Invalid cache location "'+this.cacheLocation+'"');this.cache=_r(this.cacheLocation)(),this.transactionManager=new hr,this.domainUrl="https://"+this.options.domain,this.tokenIssuer=this.options.issuer?"https://"+this.options.issuer+"/":this.domainUrl+"/"}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify({name:"auth0-spa-js",version:"1.7.0-beta.4"})));return""+this.domainUrl+e+"&auth0Client="+t},e.prototype._getParams=function(e,t,o,i,a){var c=this.options,s=(c.domain,c.leeway,c.useRefreshTokens,c.cacheLocation,r(c,["domain","leeway","useRefreshTokens","cacheLocation"]));return n(n(n({},s),e),{scope:Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),response_type:"code",response_mode:"query",state:t,nonce:o,redirect_uri:a||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(e){return this._url("/authorize?"+Jn(e))},e.prototype._verifyIdToken=function(e,t){return mr({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age)})},e.prototype._parseNumber=function(e){return"string"!=typeof e?e:parseInt(e,10)||void 0},e.prototype.buildAuthorizeUrl=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,function(){var t,n,o,a,c,s,u,f,l,d,p;return i(this,function(i){switch(i.label){case 0:return t=e.redirect_uri,n=e.appState,e.cacheStrategy,o=r(e,["redirect_uri","appState","cacheStrategy"]),a=Wn(qn()),c=Wn(qn()),s=qn(),[4,Bn(s)];case 1:return u=i.sent(),f=Yn(u),l=e.fragment?"#"+e.fragment:"",d=this._getParams(o,a,c,f,t),p=this._authorizeUrl(d),this.transactionManager.create(a,{nonce:c,code_verifier:s,appState:n,scope:d.scope,audience:d.audience||"default",redirect_uri:d.redirect_uri}),[2,p+l]}})})},e.prototype.loginWithPopup=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),o(this,void 0,void 0,function(){var o,a,c,s,u,f,l,d,p,h,y,v,m;return i(this,function(i){switch(i.label){case 0:return[4,Nn()];case 1:return o=i.sent(),a=r(e,[]),c=Wn(qn()),s=Wn(qn()),u=qn(),[4,Bn(u)];case 2:return f=i.sent(),l=Yn(f),d=this._getParams(a,c,s,l,this.options.redirect_uri||window.location.origin),p=this._authorizeUrl(n(n({},d),{response_mode:"web_message"})),[4,zn(o,p,n(n({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 3:if(h=i.sent(),c!==h.state)throw new Error("Invalid state");return[4,Kn({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:u,code:h.code,grant_type:"authorization_code",redirect_uri:d.redirect_uri})];case 4:return y=i.sent(),v=this._verifyIdToken(y.id_token,s),m=n(n({},y),{decodedToken:v,scope:d.scope,audience:d.audience||"default",client_id:this.options.client_id}),this.cache.save(m),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2]}})})},e.prototype.getUser=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),o(this,void 0,void 0,function(){var t;return i(this,function(r){return e.scope=Mn(this.DEFAULT_SCOPE,e.scope),[2,(t=this.cache.get(n({client_id:this.options.client_id},e)))&&t.decodedToken&&t.decodedToken.user]})})},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),o(this,void 0,void 0,function(){var t;return i(this,function(r){return e.scope=Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[2,(t=this.cache.get(n({client_id:this.options.client_id},e)))&&t.decodedToken&&t.decodedToken.claims]})})},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return[4,this.buildAuthorizeUrl(e)];case 1:return t=n.sent(),window.location.assign(t),[2]}})})},e.prototype.handleRedirectCallback=function(e){return void 0===e&&(e=window.location.href),o(this,void 0,void 0,function(){var t,r,o,a,c,s,u,f,l,d;return i(this,function(i){switch(i.label){case 0:if(0===(t=e.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(r=function(e){e.indexOf("#")>-1&&(e=e.substr(0,e.indexOf("#")));var t=e.split("&"),r={};return t.forEach(function(e){var t=e.split("="),n=t[0],o=t[1];r[n]=decodeURIComponent(o)}),n(n({},r),{expires_in:parseInt(r.expires_in)})}(t.join("")),o=r.state,a=r.code,c=r.error,s=r.error_description,!(u=this.transactionManager.get(o)))throw new Error("Invalid state");if(c)throw this.transactionManager.remove(o),new gr(c,s,o,u.appState);return this.transactionManager.remove(o),[4,Kn({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:u.code_verifier,code:a,grant_type:"authorization_code",redirect_uri:u.redirect_uri})];case 1:return f=i.sent(),l=this._verifyIdToken(f.id_token,u.nonce),d=n(n({},f),{decodedToken:l,audience:u.audience,scope:u.scope,client_id:this.options.client_id}),this.cache.save(d),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,{appState:u.appState}]}})})},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,function(){var t,o,a,c,s,u;return i(this,function(i){switch(i.label){case 0:t=n({audience:this.options.audience,scope:Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),ignoreCache:!1},e),o=t.ignoreCache,a=r(t,["ignoreCache"]),i.label=1;case 1:return i.trys.push([1,7,8,10]),!o&&(c=this.cache.get({scope:a.scope,audience:a.audience||"default",client_id:this.options.client_id}))&&c.access_token?[2,c.access_token]:[4,wr.acquireLock("auth0.lock.getTokenSilently",5e3)];case 2:return i.sent(),this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(a)]:[3,4];case 3:return u=i.sent(),[3,6];case 4:return[4,this._getTokenFromIFrame(a)];case 5:u=i.sent(),i.label=6;case 6:return s=u,this.cache.save(n({client_id:this.options.client_id},s)),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,s.access_token];case 7:throw i.sent();case 8:return[4,wr.releaseLock("auth0.lock.getTokenSilently")];case 9:return i.sent(),[7];case 10:return[2]}})})},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE}),void 0===t&&(t=Un),o(this,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return e.scope=Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[4,this.loginWithPopup(e,t)];case 1:return n.sent(),[2,this.cache.get({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}).access_token]}})})},e.prototype.isAuthenticated=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.getUser()];case 1:return[2,!!e.sent()]}})})},e.prototype.logout=function(e){void 0===e&&(e={}),null!==e.client_id?e.client_id=e.client_id||this.options.client_id:delete e.client_id,lr("auth0.is.authenticated"),this.cache.clear();var t=e.federated,n=r(e,["federated"]),o=t?"&federated":"",i=this._url("/v2/logout?"+Jn(n));window.location.assign(""+i+o)},e.prototype._getTokenFromIFrame=function(e){return o(this,void 0,void 0,function(){var t,r,o,a,c,s,u,f,l,d,p;return i(this,function(i){switch(i.label){case 0:return t=Wn(qn()),r=Wn(qn()),o=qn(),[4,Bn(o)];case 1:return a=i.sent(),c=Yn(a),s=this._getParams(e,t,r,c,e.redirect_uri||this.options.redirect_uri||window.location.origin),u=this._authorizeUrl(n(n({},s),{prompt:"none",response_mode:"web_message"})),f=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,(h=u,y=this.domainUrl,v=f,void 0===v&&(v=60),new Promise(function(e,t){var n=window.document.createElement("iframe");n.setAttribute("width","0"),n.setAttribute("height","0"),n.style.display="none";var r=setTimeout(function(){t(Fn),window.document.body.removeChild(n)},1e3*v),o=function(i){i.origin==y&&i.data&&"authorization_response"===i.data.type&&(i.source.close(),i.data.response.error?t(i.data.response):e(i.data.response),clearTimeout(r),window.removeEventListener("message",o,!1),window.document.body.removeChild(n))};window.addEventListener("message",o,!1),window.document.body.appendChild(n),n.setAttribute("src",h)}))];case 2:if(l=i.sent(),t!==l.state)throw new Error("Invalid state");return[4,Kn({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:o,code:l.code,grant_type:"authorization_code",redirect_uri:s.redirect_uri})];case 3:return d=i.sent(),p=this._verifyIdToken(d.id_token,r),[2,n(n({},d),{decodedToken:p,scope:s.scope,audience:s.audience||"default"})]}var h,y,v})})},e.prototype._getTokenUsingRefreshToken=function(e){return o(this,void 0,void 0,function(){var t,r,o,a;return i(this,function(i){switch(i.label){case 0:return e.scope=Mn(this.DEFAULT_SCOPE,this.options.scope,e.scope),(t=this.cache.get({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}))&&t.refresh_token?[3,2]:[4,this._getTokenFromIFrame(e)];case 1:return[2,i.sent()];case 2:return r=e.redirect_uri||this.options.redirect_uri||window.location.origin,[4,Kn({baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:t.refresh_token,redirect_uri:r})];case 3:return o=i.sent(),a=this._verifyIdToken(o.id_token),[2,n(n({},o),{decodedToken:a,scope:e.scope,audience:e.audience||"default"})]}})})},e}();return function(e){return o(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:if(Zn(),e.useRefreshTokens&&(e.scope=Mn(e.scope,"offline_access")),(t=new kr(e)).cacheLocation===Dn&&!ur("auth0.is.authenticated"))return[2,t];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.getTokenSilently()];case 2:case 3:return n.sent(),[3,4];case 4:return[2,t]}})})}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).createAuth0Client=t()}(this,(function(){"use strict";
/*! *****************************************************************************
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 e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function o(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(a,c)}s((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e,t){return e(t={exports:{}},t.exports),t.exports}var u=function(e){return e&&e.Math==Math&&e},f=u("object"==typeof globalThis&&globalThis)||u("object"==typeof window&&window)||u("object"==typeof self&&self)||u("object"==typeof a&&a)||Function("return this")(),l=function(e){try{return!!e()}catch(e){return!0}},d=!l((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),p={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,y={f:h&&!p.call({1:2},1)?function(e){var t=h(this,e);return!!t&&t.enumerable}:p},v=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},m={}.toString,w=function(e){return m.call(e).slice(8,-1)},g="".split,b=l((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==w(e)?g.call(e,""):Object(e)}:Object,_=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},S=function(e){return b(_(e))},k=function(e){return"object"==typeof e?null!==e:"function"==typeof e},O=function(e,t){if(!k(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!k(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!k(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!k(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},T={}.hasOwnProperty,A=function(e,t){return T.call(e,t)},E=f.document,j=k(E)&&k(E.createElement),I=function(e){return j?E.createElement(e):{}},x=!d&&!l((function(){return 7!=Object.defineProperty(I("div"),"a",{get:function(){return 7}}).a})),P=Object.getOwnPropertyDescriptor,C={f:d?P:function(e,t){if(e=S(e),t=O(t,!0),x)try{return P(e,t)}catch(e){}if(A(e,t))return v(!y.f.call(e,t),e[t])}},L=function(e){if(!k(e))throw TypeError(String(e)+" is not an object");return e},U=Object.defineProperty,D={f:d?U:function(e,t,n){if(L(e),t=O(t,!0),L(n),x)try{return U(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},R=d?function(e,t,n){return D.f(e,t,v(1,n))}:function(e,t,n){return e[t]=n,e},F=function(e,t){try{R(f,e,t)}catch(n){f[e]=t}return t},M=f["__core-js_shared__"]||F("__core-js_shared__",{}),N=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(e){return N.call(e)});var z,W,q,J=M.inspectSource,B=f.WeakMap,G="function"==typeof B&&/native code/.test(J(B)),Y=s((function(e){(e.exports=function(e,t){return M[e]||(M[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),H=0,V=Math.random(),X=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++H+V).toString(36)},K=Y("keys"),Q=function(e){return K[e]||(K[e]=X(e))},Z={},$=f.WeakMap;if(G){var ee=new $,te=ee.get,ne=ee.has,re=ee.set;z=function(e,t){return re.call(ee,e,t),t},W=function(e){return te.call(ee,e)||{}},q=function(e){return ne.call(ee,e)}}else{var oe=Q("state");Z[oe]=!0,z=function(e,t){return R(e,oe,t),t},W=function(e){return A(e,oe)?e[oe]:{}},q=function(e){return A(e,oe)}}var ie,ae={set:z,get:W,has:q,enforce:function(e){return q(e)?W(e):z(e,{})},getterFor:function(e){return function(t){var n;if(!k(t)||(n=W(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ce=s((function(e){var t=ae.get,n=ae.enforce,r=String(String).split("String");(e.exports=function(e,t,o,i){var a=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,s=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||A(o,"name")||R(o,"name",t),n(o).source=r.join("string"==typeof t?t:"")),e!==f?(a?!s&&e[t]&&(c=!0):delete e[t],c?e[t]=o:R(e,t,o)):c?e[t]=o:F(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||J(this)}))})),se=f,ue=function(e){return"function"==typeof e?e:void 0},fe=function(e,t){return arguments.length<2?ue(se[e])||ue(f[e]):se[e]&&se[e][t]||f[e]&&f[e][t]},le=Math.ceil,de=Math.floor,pe=function(e){return isNaN(e=+e)?0:(e>0?de:le)(e)},he=Math.min,ye=function(e){return e>0?he(pe(e),9007199254740991):0},ve=Math.max,me=Math.min,we=function(e){return function(t,n,r){var o,i=S(t),a=ye(i.length),c=function(e,t){var n=pe(e);return n<0?ve(n+t,0):me(n,t)}(r,a);if(e&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},ge={includes:we(!0),indexOf:we(!1)},be=ge.indexOf,_e=function(e,t){var n,r=S(e),o=0,i=[];for(n in r)!A(Z,n)&&A(r,n)&&i.push(n);for(;t.length>o;)A(r,n=t[o++])&&(~be(i,n)||i.push(n));return i},Se=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ke=Se.concat("length","prototype"),Oe={f:Object.getOwnPropertyNames||function(e){return _e(e,ke)}},Te={f:Object.getOwnPropertySymbols},Ae=fe("Reflect","ownKeys")||function(e){var t=Oe.f(L(e)),n=Te.f;return n?t.concat(n(e)):t},Ee=function(e,t){for(var n=Ae(t),r=D.f,o=C.f,i=0;i<n.length;i++){var a=n[i];A(e,a)||r(e,a,o(t,a))}},je=/#|\.prototype\./,Ie=function(e,t){var n=Pe[xe(e)];return n==Le||n!=Ce&&("function"==typeof t?l(t):!!t)},xe=Ie.normalize=function(e){return String(e).replace(je,".").toLowerCase()},Pe=Ie.data={},Ce=Ie.NATIVE="N",Le=Ie.POLYFILL="P",Ue=Ie,De=C.f,Re=function(e,t){var n,r,o,i,a,c=e.target,s=e.global,u=e.stat;if(n=s?f:u?f[c]||F(c,{}):(f[c]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=De(n,r))&&a.value:n[r],!Ue(s?r:c+(u?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Ee(i,o)}(e.sham||o&&o.sham)&&R(i,"sham",!0),ce(n,r,i,e)}},Fe=!!Object.getOwnPropertySymbols&&!l((function(){return!String(Symbol())})),Me=Fe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ne=Y("wks"),ze=f.Symbol,We=Me?ze:ze&&ze.withoutSetter||X,qe=function(e){return A(Ne,e)||(Fe&&A(ze,e)?Ne[e]=ze[e]:Ne[e]=We("Symbol."+e)),Ne[e]},Je=qe("match"),Be=function(e){if(function(e){var t;return k(e)&&(void 0!==(t=e[Je])?!!t:"RegExp"==w(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},Ge=qe("match"),Ye=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Ge]=!1,"/./"[e](t)}catch(e){}}return!1},He=C.f,Ve="".startsWith,Xe=Math.min,Ke=Ye("startsWith"),Qe=!(Ke||(ie=He(String.prototype,"startsWith"),!ie||ie.writable));Re({target:"String",proto:!0,forced:!Qe&&!Ke},{startsWith:function(e){var t=String(_(this));Be(e);var n=ye(Xe(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Ve?Ve.call(t,r,n):t.slice(n,n+r.length)===r}});var Ze,$e,et,tt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},nt=function(e,t,n){if(tt(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}},rt=Function.call,ot=function(e,t,n){return nt(rt,f[e].prototype[t],n)},it=(ot("String","startsWith"),function(e){return function(t,n){var r,o,i=String(_(t)),a=pe(n),c=i.length;return a<0||a>=c?e?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):r:e?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}}),at={codeAt:it(!1),charAt:it(!0)},ct=function(e){return Object(_(e))},st=!l((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ut=Q("IE_PROTO"),ft=Object.prototype,lt=st?Object.getPrototypeOf:function(e){return e=ct(e),A(e,ut)?e[ut]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ft:null},dt=qe("iterator"),pt=!1;[].keys&&("next"in(et=[].keys())?($e=lt(lt(et)))!==Object.prototype&&(Ze=$e):pt=!0),null==Ze&&(Ze={}),A(Ze,dt)||R(Ze,dt,(function(){return this}));var ht,yt={IteratorPrototype:Ze,BUGGY_SAFARI_ITERATORS:pt},vt=Object.keys||function(e){return _e(e,Se)},mt=d?Object.defineProperties:function(e,t){L(e);for(var n,r=vt(t),o=r.length,i=0;o>i;)D.f(e,n=r[i++],t[n]);return e},wt=fe("document","documentElement"),gt=Q("IE_PROTO"),bt=function(){},_t=function(e){return"<script>"+e+"<\/script>"},St=function(){try{ht=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;St=ht?function(e){e.write(_t("")),e.close();var t=e.parentWindow.Object;return e=null,t}(ht):((t=I("iframe")).style.display="none",wt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(_t("document.F=Object")),e.close(),e.F);for(var n=Se.length;n--;)delete St.prototype[Se[n]];return St()};Z[gt]=!0;var kt=Object.create||function(e,t){var n;return null!==e?(bt.prototype=L(e),n=new bt,bt.prototype=null,n[gt]=e):n=St(),void 0===t?n:mt(n,t)},Ot=D.f,Tt=qe("toStringTag"),At=function(e,t,n){e&&!A(e=n?e:e.prototype,Tt)&&Ot(e,Tt,{configurable:!0,value:t})},Et={},jt=yt.IteratorPrototype,It=function(){return this},xt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return L(n),function(e){if(!k(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Pt=yt.IteratorPrototype,Ct=yt.BUGGY_SAFARI_ITERATORS,Lt=qe("iterator"),Ut=function(){return this},Dt=at.charAt,Rt=ae.set,Ft=ae.getterFor("String Iterator");!function(e,t,n,r,o,i,a){!function(e,t,n){var r=t+" Iterator";e.prototype=kt(jt,{next:v(1,n)}),At(e,r,!1),Et[r]=It}(n,t,r);var c,s,u,f=function(e){if(e===o&&y)return y;if(!Ct&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",d=!1,p=e.prototype,h=p[Lt]||p["@@iterator"]||o&&p[o],y=!Ct&&h||f(o),m="Array"==t&&p.entries||h;if(m&&(c=lt(m.call(new e)),Pt!==Object.prototype&&c.next&&(lt(c)!==Pt&&(xt?xt(c,Pt):"function"!=typeof c[Lt]&&R(c,Lt,Ut)),At(c,l,!0))),"values"==o&&h&&"values"!==h.name&&(d=!0,y=function(){return h.call(this)}),p[Lt]!==y&&R(p,Lt,y),Et[t]=y,o)if(s={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},a)for(u in s)!Ct&&!d&&u in p||ce(p,u,s[u]);else Re({target:t,proto:!0,forced:Ct||d},s)}(String,"String",(function(e){Rt(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Ft(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Dt(n,r),t.index+=e.length,{value:e,done:!1})}));var Mt=function(e,t,n,r){try{return r?t(L(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&L(o.call(e)),t}},Nt=qe("iterator"),zt=Array.prototype,Wt=function(e){return void 0!==e&&(Et.Array===e||zt[Nt]===e)},qt=function(e,t,n){var r=O(t);r in e?D.f(e,r,v(0,n)):e[r]=n},Jt={};Jt[qe("toStringTag")]="z";var Bt="[object z]"===String(Jt),Gt=qe("toStringTag"),Yt="Arguments"==w(function(){return arguments}()),Ht=Bt?w:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Gt))?n:Yt?w(t):"Object"==(r=w(t))&&"function"==typeof t.callee?"Arguments":r},Vt=qe("iterator"),Xt=function(e){if(null!=e)return e[Vt]||e["@@iterator"]||Et[Ht(e)]},Kt=qe("iterator"),Qt=!1;try{var Zt=0,$t={next:function(){return{done:!!Zt++}},return:function(){Qt=!0}};$t[Kt]=function(){return this},Array.from($t,(function(){throw 2}))}catch(e){}var en=!function(e,t){if(!t&&!Qt)return!1;var n=!1;try{var r={};r[Kt]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}((function(e){Array.from(e)}));Re({target:"Array",stat:!0,forced:en},{from:function(e){var t,n,r,o,i,a,c=ct(e),s="function"==typeof this?this:Array,u=arguments.length,f=u>1?arguments[1]:void 0,l=void 0!==f,d=Xt(c),p=0;if(l&&(f=nt(f,u>2?arguments[2]:void 0,2)),null==d||s==Array&&Wt(d))for(n=new s(t=ye(c.length));t>p;p++)a=l?f(c[p],p):c[p],qt(n,p,a);else for(i=(o=d.call(c)).next,n=new s;!(r=i.call(o)).done;p++)a=l?Mt(o,f,[r.value,p],!0):r.value,qt(n,p,a);return n.length=p,n}});se.Array.from;var tn,nn="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,rn=D.f,on=f.Int8Array,an=on&&on.prototype,cn=f.Uint8ClampedArray,sn=cn&&cn.prototype,un=on&&lt(on),fn=an&&lt(an),ln=Object.prototype,dn=ln.isPrototypeOf,pn=qe("toStringTag"),hn=X("TYPED_ARRAY_TAG"),yn=nn&&!!xt&&"Opera"!==Ht(f.opera),vn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},mn=function(e){return k(e)&&A(vn,Ht(e))};for(tn in vn)f[tn]||(yn=!1);if((!yn||"function"!=typeof un||un===Function.prototype)&&(un=function(){throw TypeError("Incorrect invocation")},yn))for(tn in vn)f[tn]&&xt(f[tn],un);if((!yn||!fn||fn===ln)&&(fn=un.prototype,yn))for(tn in vn)f[tn]&&xt(f[tn].prototype,fn);if(yn&&lt(sn)!==fn&&xt(sn,fn),d&&!A(fn,pn))for(tn in!0,rn(fn,pn,{get:function(){return k(this)?this[hn]:void 0}}),vn)f[tn]&&R(f[tn],hn,tn);var wn=function(e){if(mn(e))return e;throw TypeError("Target is not a typed array")},gn=function(e){if(xt){if(dn.call(un,e))return e}else for(var t in vn)if(A(vn,tn)){var n=f[t];if(n&&(e===n||dn.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},bn=function(e,t,n){if(d){if(n)for(var r in vn){var o=f[r];o&&A(o.prototype,e)&&delete o.prototype[e]}fn[e]&&!n||ce(fn,e,n?t:yn&&an[e]||t)}},_n=qe("species"),Sn=wn,kn=gn,On=[].slice;bn("slice",(function(e,t){for(var n=On.call(Sn(this),e,t),r=function(e,t){var n,r=L(e).constructor;return void 0===r||null==(n=L(r)[_n])?t:tt(n)}(this,this.constructor),o=0,i=n.length,a=new(kn(r))(i);i>o;)a[o]=n[o++];return a}),l((function(){new Int8Array(1).slice()})));var Tn=qe("unscopables"),An=Array.prototype;null==An[Tn]&&D.f(An,Tn,{configurable:!0,value:kt(null)});var En,jn=Object.defineProperty,In={},xn=function(e){throw e},Pn=ge.includes,Cn=function(e,t){if(A(In,e))return In[e];t||(t={});var n=[][e],r=!!A(t,"ACCESSORS")&&t.ACCESSORS,o=A(t,0)?t[0]:xn,i=A(t,1)?t[1]:void 0;return In[e]=!!n&&!l((function(){if(r&&!d)return!0;var e={length:-1};r?jn(e,1,{enumerable:!0,get:xn}):e[1]=1,n.call(e,o,i)}))}("indexOf",{ACCESSORS:!0,1:0});Re({target:"Array",proto:!0,forced:!Cn},{includes:function(e){return Pn(this,e,arguments.length>1?arguments[1]:void 0)}}),En="includes",An[Tn][En]=!0;ot("Array","includes");Re({target:"String",proto:!0,forced:!Ye("includes")},{includes:function(e){return!!~String(_(this)).indexOf(Be(e),arguments.length>1?arguments[1]:void 0)}});ot("String","includes");function Ln(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}var Un=setTimeout;function Dn(e){return Boolean(e&&void 0!==e.length)}function Rn(){}function Fn(e){if(!(this instanceof Fn))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Jn(e,this)}function Mn(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,Fn._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void zn(t.promise,e)}Nn(t.promise,r)}else(1===e._state?Nn:zn)(t.promise,e._value)}))):e._deferreds.push(t)}function Nn(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof Fn)return e._state=3,e._value=t,void Wn(e);if("function"==typeof n)return void Jn((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,Wn(e)}catch(t){zn(e,t)}var r,o}function zn(e,t){e._state=2,e._value=t,Wn(e)}function Wn(e){2===e._state&&0===e._deferreds.length&&Fn._immediateFn((function(){e._handled||Fn._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)Mn(e,e._deferreds[t]);e._deferreds=null}function qn(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function Jn(e,t){var n=!1;try{e((function(e){n||(n=!0,Nn(t,e))}),(function(e){n||(n=!0,zn(t,e))}))}catch(e){if(n)return;n=!0,zn(t,e)}}Fn.prototype.catch=function(e){return this.then(null,e)},Fn.prototype.then=function(e,t){var n=new this.constructor(Rn);return Mn(this,new qn(e,t,n)),n},Fn.prototype.finally=Ln,Fn.all=function(e){return new Fn((function(t,n){if(!Dn(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,(function(t){i(e,t)}),n)}r[e]=a,0==--o&&t(r)}catch(e){n(e)}}for(var a=0;a<r.length;a++)i(a,r[a])}))},Fn.resolve=function(e){return e&&"object"==typeof e&&e.constructor===Fn?e:new Fn((function(t){t(e)}))},Fn.reject=function(e){return new Fn((function(t,n){n(e)}))},Fn.race=function(e){return new Fn((function(t,n){if(!Dn(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)Fn.resolve(e[r]).then(t,n)}))},Fn._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){Un(e,0)},Fn._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Bn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in Bn?Bn.Promise.prototype.finally||(Bn.Promise.prototype.finally=Ln):Bn.Promise=Fn,function(e){function t(){}function n(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1==r.indexOf(e.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(e.TextEncoder&&e.TextDecoder)return!1;var r=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var n=e.length,r=0,o=Math.max(32,n+(n>>1)+7),i=new Uint8Array(o>>3<<3);t<n;){var a=e.charCodeAt(t++);if(55296<=a&&56319>=a){if(t<n){var c=e.charCodeAt(t);56320==(64512&c)&&(++t,a=((1023&a)<<10)+(1023&c)+65536)}if(55296<=a&&56319>=a)continue}if(r+4>i.length&&(o+=8,o=(o*=1+t/e.length*2)>>3<<3,(c=new Uint8Array(o)).set(i),i=c),0==(4294967168&a))i[r++]=a;else{if(0==(4294965248&a))i[r++]=a>>6&31|192;else if(0==(4294901760&a))i[r++]=a>>12&15|224,i[r++]=a>>6&63|128;else{if(0!=(4292870144&a))continue;i[r++]=a>>18&7|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128}i[r++]=63&a|128}}return i.slice?i.slice(0,r):i.subarray(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");e.buffer instanceof ArrayBuffer&&(e=e.buffer),e=new Uint8Array(e),t=0;for(var n=[],r=[];;){var o=t<e.length;if(!o||65536&t){if(r.push(String.fromCharCode.apply(null,n)),!o)return r.join("");n=[],e=e.subarray(t),t=0}if(0===(o=e[t++]))n.push(0);else if(0==(128&o))n.push(o);else if(192==(224&o)){var i=63&e[t++];n.push((31&o)<<6|i)}else if(224==(240&o)){i=63&e[t++];var a=63&e[t++];n.push((31&o)<<12|i<<6|a)}else if(240==(248&o)){65535<(o=(7&o)<<18|(i=63&e[t++])<<12|(a=63&e[t++])<<6|63&e[t++])&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o)}}},e.TextEncoder=t,e.TextDecoder=n}("undefined"!=typeof window?window:a),function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var s=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(t,[{key:"addEventListener",value:function(e,t){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0,o=n.length;r<o;r++)if(n[r]===t)return void n.splice(r,1)}},{key:"dispatchEvent",value:function(e){var t=this;if(e.type in this.listeners){for(var n=function(n){setTimeout((function(){return n.call(t,e)}))},r=this.listeners[e.type],o=0,i=r.length;o<i;o++)n(r[o]);return!e.defaultPrevented}}}]),t}(),u=function(t){function a(){var t;return e(this,a),(t=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?i(e):t}(this,r(a).call(this))).listeners||s.call(i(t)),Object.defineProperty(i(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(i(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,t),n(a,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),c(r(a.prototype),"dispatchEvent",this).call(this,e)}}]),a}(s),f=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new u,writable:!0,configurable:!0})}return n(t,[{key:"abort",value:function(){var e;try{e=new Event("abort")}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(e)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",u.prototype[Symbol.toStringTag]="AbortSignal"),function(e){(function(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController})(e)&&(e.AbortController=f,e.AbortSignal=u)}("undefined"!=typeof self?self:a)}();var Gn=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())}))},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}}));c(Gn);var Yn=c(s((function(e,t){var n=a&&a.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(a,c)}s((r=r.apply(e,t||[])).next())}))},r=a&&a.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(t,"__esModule",{value:!0});function o(e){return new Promise((function(t){return setTimeout(t,e)}))}function i(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++){n+=t[Math.floor(Math.random()*t.length)]}return n}var c=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+i(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,a){return void 0===a&&(a=5e3),n(this,void 0,void 0,(function(){var n,c,s,u,f,l;return r(this,(function(r){switch(r.label){case 0:n=Date.now()+i(4),c=Date.now()+a,s="browser-tabs-lock-key-"+t,u=window.localStorage,r.label=1;case 1:return Date.now()<c?[4,o(30)]:[3,8];case 2:return r.sent(),null!==u.getItem(s)?[3,5]:(f=this.id+"-"+t+"-"+n,[4,o(Math.floor(25*Math.random()))]);case 3:return r.sent(),u.setItem(s,JSON.stringify({id:this.id,iat:n,timeoutKey:f,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return r.sent(),null!==(l=u.getItem(s))&&(l=JSON.parse(l)).id===this.id&&l.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(s,n),[2,!0]):[3,7];case 5:return e.lockCorrector(),[4,this.waitForSomethingToChange(c)];case 6:r.sent(),r.label=7;case 7:return n=Date.now()+i(4),[3,1];case 8:return[2,!1]}}))}))},e.prototype.refreshLockWhileAcquired=function(e,t){return n(this,void 0,void 0,(function(){var o=this;return r(this,(function(i){return setTimeout((function(){return n(o,void 0,void 0,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:return[4,Gn.default().lock(t)];case 1:return r.sent(),this.acquiredIatSet.has(t)?(n=window.localStorage,null===(o=n.getItem(e))?(Gn.default().unlock(t),[2]):((o=JSON.parse(o)).timeRefreshed=Date.now(),n.setItem(e,JSON.stringify(o)),Gn.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(Gn.default().unlock(t),[2])}}))}))}),1e3),[2]}))}))},e.prototype.waitForSomethingToChange=function(t){return n(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(n){var r=!1,o=Date.now(),i=!1;function a(){if(i||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(c),i=!0),!r){r=!0;var t=50-(Date.now()-o);t>0?setTimeout(n,t):n()}}window.addEventListener("storage",a),e.addToWaiting(a);var c=setTimeout(a,Math.max(0,t-Date.now()))}))];case 1:return n.sent(),[2]}}))}))},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter((function(e){return e!==t})))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach((function(e){return e()}))},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,(function(){var n,o,i;return r(this,(function(r){switch(r.label){case 0:return n=window.localStorage,o="browser-tabs-lock-key-"+t,null===(i=n.getItem(o))?[2]:(i=JSON.parse(i)).id!==this.id?[3,2]:[4,Gn.default().lock(i.iat)];case 1:r.sent(),this.acquiredIatSet.delete(i.iat),n.removeItem(o),Gn.default().unlock(i.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}}))}))},e.lockCorrector=function(){for(var t=Date.now()-5e3,n=window.localStorage,r=Object.keys(n),o=!1,i=0;i<r.length;i++){var a=r[i];if(a.includes("browser-tabs-lock-key")){var c=n.getItem(a);null!==c&&(void 0===(c=JSON.parse(c)).timeRefreshed&&c.timeAcquired<t||void 0!==c.timeRefreshed&&c.timeRefreshed<t)&&(n.removeItem(a),o=!0)}}o&&e.notifyWaiters()},e.waiters=void 0,e}();t.default=c})));var Hn={timeoutInSeconds:60},Vn=function(e){return e.filter((function(t,n){return e.indexOf(t)===n}))},Xn={error:"timeout",error_description:"Timeout"},Kn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(Boolean).join();return Vn(n.replace(/\s/g,",").split(",")).join(" ").trim()},Qn=function(e,t){var r,o,i,a=t.popup;if(a?a.location.href=e:(r=e,o=window.screenX+(window.innerWidth-400)/2,i=window.screenY+(window.innerHeight-600)/2,a=window.open(r,"auth0:authorize:popup","left="+o+",top="+i+",width=400,height=600,resizable,scrollbars=yes,status=1")),!a)throw new Error("Could not open popup");return new Promise((function(e,r){var o=setTimeout((function(){r(n(n({},Xn),{popup:a}))}),1e3*(t.timeoutInSeconds||60));window.addEventListener("message",(function(t){if(t.data&&"authorization_response"===t.data.type){if(clearTimeout(o),a.close(),t.data.response.error)return r(t.data.response);e(t.data.response)}}))}))},Zn=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(cr().getRandomValues(new Uint8Array(43))).forEach((function(n){return t+=e[n%e.length]})),t},$n=function(e){return btoa(e)},er=function(e){return Object.keys(e).filter((function(t){return void 0!==e[t]})).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")},tr=function(e){return o(void 0,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=sr().digest({name:"SHA-256"},(new TextEncoder).encode(e)),window.msCrypto?[2,new Promise((function(e,n){t.oncomplete=function(t){e(t.target.result)},t.onerror=function(e){n(e.error)},t.onabort=function(){n("The digest operation was aborted")}}))]:[4,t];case 1:return[2,n.sent()]}}))}))},nr=function(e){return function(e){return decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},rr=function(e){var t=new Uint8Array(e);return function(e){var t={"+":"-","/":"_","=":""};return e.replace(/[\+\/=]/g,(function(e){return t[e]}))}(window.btoa(String.fromCharCode.apply(String,Array.from(t))))},or=function(e,t,r){void 0===r&&(r=1e4);var o,i,a=new AbortController,c=a.signal,s=n(n({},t),{signal:c});return Promise.race([(o=e,i=s,i=i||{},new Promise((function(e,t){var n=new XMLHttpRequest,r=[],a=[],c={},s=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:s,headers:{keys:function(){return r},entries:function(){return a},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}};for(var u in n.open(i.method||"get",o,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){r.push(t=t.toLowerCase()),a.push([t,n]),c[t]=c[t]?c[t]+","+n:n})),e(s())},n.onerror=t,n.withCredentials="include"==i.credentials,i.headers)n.setRequestHeader(u,i.headers[u]);n.send(i.body||null)}))),new Promise((function(e,t){setTimeout((function(){a.abort(),t(new Error("Timeout when executing 'fetch'"))}),r)}))])},ir=function(e,t,n){return o(void 0,void 0,void 0,(function(){var o,a,c,s,u,f,l,d,p,h;return i(this,(function(i){switch(i.label){case 0:c=0,i.label=1;case 1:if(!(c<3))return[3,6];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,or(e,n,t)];case 3:return a=i.sent(),o=null,[3,6];case 4:return s=i.sent(),o=s,[3,5];case 5:return c++,[3,1];case 6:if(o)throw o;return[4,a.json()];case 7:if(u=i.sent(),f=u.error,l=u.error_description,d=r(u,["error","error_description"]),!a.ok)throw p=l||"HTTP error. Unable to fetch "+e,(h=new Error(p)).error=f||"request_error",h.error_description=p,h;return[2,d]}}))}))},ar=function(e){return o(void 0,void 0,void 0,(function(){var t=e.baseUrl,o=e.timeout,a=r(e,["baseUrl","timeout"]);return i(this,(function(e){switch(e.label){case 0:return[4,ir(t+"/oauth/token",o,{method:"POST",body:JSON.stringify(n({redirect_uri:window.location.origin},a)),headers:{"Content-type":"application/json"}})];case 1:return[2,e.sent()]}}))}))},cr=function(){return window.crypto||window.msCrypto},sr=function(){var e=cr();return e.subtle||e.webkitSubtle},ur=function(e){return"@@auth0spajs@@::"+e.client_id+"::"+e.audience+"::"+e.scope},fr=function(e){var t=Math.floor(Date.now()/1e3)+e.expires_in;return{body:e,expiresAt:Math.min(t,e.decodedToken.claims.exp)-60}},lr=function(){function e(){}return e.prototype.save=function(e){var t=ur(e),n=fr(e);window.localStorage.setItem(t,JSON.stringify(n))},e.prototype.get=function(e){var t=ur(e),n=this.readJson(t),r=Math.floor(Date.now()/1e3);if(n){if(!(n.expiresAt<r))return n.body;if(n.body.refresh_token){var o=this.stripData(n);return this.writeJson(t,o),o.body}localStorage.removeItem(t)}},e.prototype.clear=function(){for(var e=localStorage.length-1;e>=0;e--)localStorage.key(e).startsWith("@@auth0spajs@@")&&localStorage.removeItem(localStorage.key(e))},e.prototype.readJson=function(e){var t,n=window.localStorage.getItem(e);if(n&&(t=JSON.parse(n)))return t},e.prototype.writeJson=function(e,t){localStorage.setItem(e,JSON.stringify(t))},e.prototype.stripData=function(e){return{body:{refresh_token:e.body.refresh_token},expiresAt:e.expiresAt}},e}(),dr=function(){this.enclosedCache=function(){var e={body:{},expiresAt:0};return{save:function(t){var n=ur(t),r=fr(t);e[n]=r},get:function(t){var n=ur(t),r=e[n],o=Math.floor(Date.now()/1e3);if(r)return r.expiresAt<o?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},r.body):void delete e[n]:r.body},clear:function(){e={body:{},expiresAt:0}}}}()},pr=s((function(e,t){var n=a&&a.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function o(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return r("Expires",e.expires?e.expires.toUTCString():"")+r("Domain",e.domain)+r("Path",e.path)+r("Secure",e.secure)+r("SameSite",e.sameSite)}(n)}function i(e){for(var t={},n=e?e.split("; "):[],r=/(%[\dA-F]{2})+/gi,o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=a.replace(r,decodeURIComponent)}catch(e){}}return t}function c(){return i(document.cookie)}function s(e,t,r){document.cookie=o(e,t,n({path:"/"},r))}t.__esModule=!0,t.encode=o,t.parse=i,t.getAll=c,t.get=function(e){return c()[e]},t.set=s,t.remove=function(e,t){s(e,"",n(n({},t),{expires:-1}))}}));c(pr);pr.encode,pr.parse;var hr=pr.getAll,yr=pr.get,vr=pr.set,mr=pr.remove,wr=function(e){var t=yr(e);if(void 0!==t)return JSON.parse(t)},gr=function(e,t,n){vr(e,JSON.stringify(t),{expires:n.daysUntilExpire})},br=function(e){mr(e)},_r=function(e){return"a0.spajs.txs."+e},Sr=function(){function e(){var e=this;this.transactions={},Object.keys(hr()||{}).filter((function(e){return e.startsWith("a0.spajs.txs.")})).forEach((function(t){var n=t.replace("a0.spajs.txs.","");e.transactions[n]=wr(t)}))}return e.prototype.create=function(e,t){this.transactions[e]=t,gr(_r(e),t,{daysUntilExpire:1})},e.prototype.get=function(e){return this.transactions[e]},e.prototype.remove=function(e){delete this.transactions[e],br(_r(e))},e}(),kr=function(e){return"number"==typeof e},Or=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],Tr=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(e){var t=e.split("."),n=t[0],r=t[1],o=t[2];if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");var i=JSON.parse(nr(r)),a={__raw:e},c={};return Object.keys(i).forEach((function(e){a[e]=i[e],Or.includes(e)||(c[e]=i[e])})),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(nr(n)),claims:a,user:c}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'+e.iss+'", found "'+t.claims.iss+'"');if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error('Signature algorithm of "'+t.header.alg+'" is not supported. Expected the ID token to be signed with "RS256".');if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but was not one of "'+t.claims.aud.join(", ")+'"');if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'+e.aud+'", found "'+t.claims.azp+'"')}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but found "'+t.claims.aud+'"');if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'+e.nonce+'", found "'+t.claims.nonce+'"')}if(e.max_age&&!kr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!kr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!kr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=e.leeway||60,r=new Date,o=new Date(0),i=new Date(0),a=new Date(0);if(a.setUTCSeconds((parseInt(t.claims.auth_time)+e.max_age)/1e3+n),o.setUTCSeconds(t.claims.exp+n),i.setUTCSeconds(t.claims.nbf-n),r>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time ("+r+") is after expiration time ("+o+")");if(kr(t.claims.nbf)&&r<i)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time ("+r+") is before "+i);if(kr(t.claims.auth_time)&&r>a)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time ("+r+") is after last auth at "+a);return t},Ar=function(e){function n(t,r,o,i){void 0===i&&(i=null);var a=e.call(this,t,r)||this;return a.state=o,a.appState=i,Object.setPrototypeOf(a,n.prototype),a}return t(n,e),n}(function(e){function n(t,r){var o=e.call(this,r)||this;return o.error=t,o.error_description=r,Object.setPrototypeOf(o,n.prototype),o}return t(n,e),n}(Error)),Er=new Yn,jr={memory:function(){return(new dr).enclosedCache},localstorage:function(){return new lr}},Ir=function(e){return jr[e]},xr=function(){function e(e){if(this.options=e,this.DEFAULT_SCOPE="openid profile email",function(){if(!cr())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===sr())throw new Error("\n auth0-spa-js must run on a secure origin.\n See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin \n for more information.\n ")}(),this.cacheLocation=e.cacheLocation||"memory",!Ir(this.cacheLocation))throw new Error('Invalid cache location "'+this.cacheLocation+'"');this.cache=Ir(this.cacheLocation)(),this.transactionManager=new Sr,this.domainUrl="https://"+this.options.domain,this.tokenIssuer=this.options.issuer?"https://"+this.options.issuer+"/":this.domainUrl+"/"}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify({name:"auth0-spa-js",version:"1.7.0-beta.5"})));return""+this.domainUrl+e+"&auth0Client="+t},e.prototype._getParams=function(e,t,o,i,a){var c=this.options,s=(c.domain,c.leeway,c.useRefreshTokens,c.cacheLocation,r(c,["domain","leeway","useRefreshTokens","cacheLocation"]));return n(n(n({},s),e),{scope:Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),response_type:"code",response_mode:"query",state:t,nonce:o,redirect_uri:a||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(e){return this._url("/authorize?"+er(e))},e.prototype._verifyIdToken=function(e,t){return Tr({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age)})},e.prototype._parseNumber=function(e){return"string"!=typeof e?e:parseInt(e,10)||void 0},e.prototype.buildAuthorizeUrl=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,n,o,a,c,s,u,f,l,d,p;return i(this,(function(i){switch(i.label){case 0:return t=e.redirect_uri,n=e.appState,o=r(e,["redirect_uri","appState"]),a=$n(Zn()),c=$n(Zn()),s=Zn(),[4,tr(s)];case 1:return u=i.sent(),f=rr(u),l=e.fragment?"#"+e.fragment:"",d=this._getParams(o,a,c,f,t),p=this._authorizeUrl(d),this.transactionManager.create(a,{nonce:c,code_verifier:s,appState:n,scope:d.scope,audience:d.audience||"default",redirect_uri:d.redirect_uri}),[2,p+l]}}))}))},e.prototype.loginWithPopup=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),o(this,void 0,void 0,(function(){var o,a,c,s,u,f,l,d,p,h,y,v;return i(this,(function(i){switch(i.label){case 0:return o=r(e,[]),a=$n(Zn()),c=$n(Zn()),s=Zn(),[4,tr(s)];case 1:return u=i.sent(),f=rr(u),l=this._getParams(o,a,c,f,this.options.redirect_uri||window.location.origin),d=this._authorizeUrl(n(n({},l),{response_mode:"web_message"})),[4,Qn(d,n(n({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(p=i.sent(),a!==p.state)throw new Error("Invalid state");return[4,ar({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:s,code:p.code,grant_type:"authorization_code",redirect_uri:l.redirect_uri})];case 3:return h=i.sent(),y=this._verifyIdToken(h.id_token,c),v=n(n({},h),{decodedToken:y,scope:l.scope,audience:l.audience||"default",client_id:this.options.client_id}),this.cache.save(v),gr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2]}}))}))},e.prototype.getUser=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return e.scope=Kn(this.DEFAULT_SCOPE,e.scope),[2,(t=this.cache.get(n({client_id:this.options.client_id},e)))&&t.decodedToken&&t.decodedToken.user]}))}))},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return e.scope=Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[2,(t=this.cache.get(n({client_id:this.options.client_id},e)))&&t.decodedToken&&t.decodedToken.claims]}))}))},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.buildAuthorizeUrl(e)];case 1:return t=n.sent(),window.location.assign(t),[2]}}))}))},e.prototype.handleRedirectCallback=function(e){return void 0===e&&(e=window.location.href),o(this,void 0,void 0,(function(){var t,r,o,a,c,s,u,f,l,d,p;return i(this,(function(i){switch(i.label){case 0:if(0===(t=e.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(r=function(e){e.indexOf("#")>-1&&(e=e.substr(0,e.indexOf("#")));var t=e.split("&"),r={};return t.forEach((function(e){var t=e.split("="),n=t[0],o=t[1];r[n]=decodeURIComponent(o)})),n(n({},r),{expires_in:parseInt(r.expires_in)})}(t.join("")),o=r.state,a=r.code,c=r.error,s=r.error_description,!(u=this.transactionManager.get(o)))throw new Error("Invalid state");if(c)throw this.transactionManager.remove(o),new Ar(c,s,o,u.appState);return this.transactionManager.remove(o),f={baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:u.code_verifier,grant_type:"authorization_code",code:a},void 0!==u.redirect_uri&&(f.redirect_uri=u.redirect_uri),[4,ar(f)];case 1:return l=i.sent(),d=this._verifyIdToken(l.id_token,u.nonce),p=n(n({},l),{decodedToken:d,audience:u.audience,scope:u.scope,client_id:this.options.client_id}),this.cache.save(p),gr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,{appState:u.appState}]}}))}))},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,o,a,c,s,u;return i(this,(function(i){switch(i.label){case 0:t=n({audience:this.options.audience,scope:Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),ignoreCache:!1},e),o=t.ignoreCache,a=r(t,["ignoreCache"]),i.label=1;case 1:return i.trys.push([1,7,8,10]),!o&&(c=this.cache.get({scope:a.scope,audience:a.audience||"default",client_id:this.options.client_id}))&&c.access_token?[2,c.access_token]:[4,Er.acquireLock("auth0.lock.getTokenSilently",5e3)];case 2:return i.sent(),this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(a)]:[3,4];case 3:return u=i.sent(),[3,6];case 4:return[4,this._getTokenFromIFrame(a)];case 5:u=i.sent(),i.label=6;case 6:return s=u,this.cache.save(n({client_id:this.options.client_id},s)),gr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,s.access_token];case 7:throw i.sent();case 8:return[4,Er.releaseLock("auth0.lock.getTokenSilently")];case 9:return i.sent(),[7];case 10:return[2]}}))}))},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE}),void 0===t&&(t=Hn),o(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return e.scope=Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[4,this.loginWithPopup(e,t)];case 1:return n.sent(),[2,this.cache.get({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}).access_token]}}))}))},e.prototype.isAuthenticated=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.getUser()];case 1:return[2,!!e.sent()]}}))}))},e.prototype.logout=function(e){void 0===e&&(e={}),null!==e.client_id?e.client_id=e.client_id||this.options.client_id:delete e.client_id;var t=e.federated,n=e.localOnly,o=r(e,["federated","localOnly"]);if(n&&t)throw new Error("It is invalid to set both the `federated` and `localOnly` options to `true`");if(this.cache.clear(),br("auth0.is.authenticated"),!n){var i=t?"&federated":"",a=this._url("/v2/logout?"+er(o));window.location.assign(""+a+i)}},e.prototype._getTokenFromIFrame=function(e){return o(this,void 0,void 0,(function(){var t,r,o,a,c,s,u,f,l,d,p;return i(this,(function(i){switch(i.label){case 0:return t=$n(Zn()),r=$n(Zn()),o=Zn(),[4,tr(o)];case 1:return a=i.sent(),c=rr(a),s=this._getParams(e,t,r,c,e.redirect_uri||this.options.redirect_uri||window.location.origin),u=this._authorizeUrl(n(n({},s),{prompt:"none",response_mode:"web_message"})),f=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,(h=u,y=this.domainUrl,v=f,void 0===v&&(v=60),new Promise((function(e,t){var n=window.document.createElement("iframe");n.setAttribute("width","0"),n.setAttribute("height","0"),n.style.display="none";var r=setTimeout((function(){t(Xn),window.document.body.removeChild(n)}),1e3*v),o=function(i){i.origin==y&&i.data&&"authorization_response"===i.data.type&&(i.source.close(),i.data.response.error?t(i.data.response):e(i.data.response),clearTimeout(r),window.removeEventListener("message",o,!1),setTimeout((function(){return window.document.body.removeChild(n)}),2e3))};window.addEventListener("message",o,!1),window.document.body.appendChild(n),n.setAttribute("src",h)})))];case 2:if(l=i.sent(),t!==l.state)throw new Error("Invalid state");return[4,ar({baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:o,code:l.code,grant_type:"authorization_code",redirect_uri:s.redirect_uri})];case 3:return d=i.sent(),p=this._verifyIdToken(d.id_token,r),[2,n(n({},d),{decodedToken:p,scope:s.scope,audience:s.audience||"default"})]}var h,y,v}))}))},e.prototype._getTokenUsingRefreshToken=function(e){return o(this,void 0,void 0,(function(){var t,r,o,a;return i(this,(function(i){switch(i.label){case 0:return e.scope=Kn(this.DEFAULT_SCOPE,this.options.scope,e.scope),(t=this.cache.get({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}))&&t.refresh_token?[3,2]:[4,this._getTokenFromIFrame(e)];case 1:return[2,i.sent()];case 2:return r=e.redirect_uri||this.options.redirect_uri||window.location.origin,[4,ar({baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:t.refresh_token,redirect_uri:r})];case 3:return o=i.sent(),a=this._verifyIdToken(o.id_token),[2,n(n({},o),{decodedToken:a,scope:e.scope,audience:e.audience||"default"})]}}))}))},e}();function Pr(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:if(e.useRefreshTokens&&(e.scope=Kn(e.scope,"offline_access")),"memory"===(t=new xr(e)).cacheLocation&&!wr("auth0.is.authenticated"))return[2,t];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.getTokenSilently()];case 2:return r.sent(),[3,4];case 3:if("login_required"!==(n=r.sent()).error)throw n;return[3,4];case 4:return[2,t]}}))}))}return Object.assign(Pr,{Auth0Client:xr,createAuth0Client:Pr})})),"Auth0Client"in this&&this.console&&this.console.warn&&this.console.warn("Auth0Client already declared on the global namespace"),this&&this.createAuth0Client&&(this.Auth0Client=this.Auth0Client||this.createAuth0Client.Auth0Client);
//# sourceMappingURL=auth0-spa-js.production.js.map

9

dist/typings/Auth0Client.d.ts

@@ -129,4 +129,9 @@ import { Auth0ClientOptions, RedirectLoginOptions, PopupLoginOptions, PopupConfigOptions, GetUserOptions, GetIdTokenClaimsOptions, RedirectLoginResult, GetTokenSilentlyOptions, GetTokenWithPopupOptions, LogoutOptions, CacheLocation } from './global';

*
* Performs a redirect to `/v2/logout` using the parameters provided
* as arguments. [Read more about how Logout works at Auth0](https://auth0.com/docs/logout).
* Clears the application session and performs a redirect to `/v2/logout`, using
* the parameters provided as arguments, to clear the Auth0 session.
* If the `federated` option is specified it also clears the Identity Provider session.
* If the `localOnly` option is specified, it only clears the application session.
* It is invalid to set both the `federated` and `localOnly` options to `true`,
* and an error will be thrown if you do.
* [Read more about how Logout works at Auth0](https://auth0.com/docs/logout).
*

@@ -133,0 +138,0 @@ * @param options

@@ -17,4 +17,8 @@ import { PopupConfigOptions } from './global';

*/
export declare const CLEANUP_IFRAME_TIMEOUT_IN_SECONDS = 2;
/**
* @ignore
*/
export declare const DEFAULT_FETCH_TIMEOUT_MS = 10000;
export declare const CACHE_LOCATION_MEMORY = "memory";
export declare const CACHE_LOCATION_LOCAL_STORAGE = "localstorage";

@@ -157,2 +157,8 @@ /**

timeoutInSeconds?: number;
/**
* Accepts an already-created popup window to use. If not specified, the SDK
* will create its own. This may be useful for platforms like iOS that have
* security restrictions around when popups can be invoked (e.g. from a user click event)
*/
popup?: any;
}

@@ -235,5 +241,13 @@ export interface GetUserOptions {

* and from Auth0.
* This option cannot be specified along with the `localOnly` option.
* [Read more about how federated logout works at Auth0](https://auth0.com/docs/logout/guides/logout-idps)
*/
federated?: boolean;
/**
* When `true`, this skips the request to the logout endpoint on the authorization server,
* effectively performing a "local" logout of the application. No redirect should take place,
* you should update local logged in state.
* This option cannot be specified along with the `federated` option.
*/
localOnly?: boolean;
}

@@ -240,0 +254,0 @@ /**

@@ -9,7 +9,7 @@ import 'core-js/es/string/starts-with';

import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
import Auth0Client_ from './Auth0Client';
import Auth0Client from './Auth0Client';
import { Auth0ClientOptions } from './global';
import './global';
export * from './global';
export default function createAuth0Client(options: Auth0ClientOptions): Promise<Auth0Client_>;
export declare type Auth0Client = Auth0Client_;
export default function createAuth0Client(options: Auth0ClientOptions): Promise<Auth0Client>;
export { Auth0Client };

@@ -6,4 +6,3 @@ import { AuthenticationResult, PopupConfigOptions, TokenEndpointOptions } from './global';

export declare const runIframe: (authorizeUrl: string, eventOrigin: string, timeoutInSeconds?: number) => Promise<AuthenticationResult>;
export declare const openPopup: () => Window;
export declare const runPopup: (popup: any, authorizeUrl: string, config: PopupConfigOptions) => Promise<AuthenticationResult>;
export declare const runPopup: (authorizeUrl: string, config: PopupConfigOptions) => Promise<AuthenticationResult>;
export declare const createRandomString: () => string;

@@ -10,0 +9,0 @@ export declare const encode: (value: string) => string;

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

declare const _default: "1.7.0-beta.4";
declare const _default: "1.7.0-beta.5";
export default _default;

@@ -6,6 +6,5 @@ {

"license": "MIT",
"version": "1.7.0-beta.4",
"version": "1.7.0-beta.5",
"main": "dist/lib/auth0-spa-js.cjs.js",
"types": "dist/typings/index.d.ts",
"browser": "dist/auth0-spa-js.production.js",
"module": "dist/auth0-spa-js.production.esm.js",

@@ -36,38 +35,38 @@ "scripts": {

"devDependencies": {
"@auth0/component-cdn-uploader": "auth0/component-cdn-uploader#v2.2.2",
"@auth0/component-cdn-uploader": "github:auth0/component-cdn-uploader#v2.2.2",
"@types/cypress": "^1.1.3",
"@types/jest": "^24.0.15",
"@typescript-eslint/eslint-plugin-tslint": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"@types/jest": "^24.9.1",
"@typescript-eslint/eslint-plugin-tslint": "^2.22.0",
"@typescript-eslint/parser": "^2.22.0",
"cli-table": "^0.3.1",
"concurrently": "^4.1.1",
"cypress": "^3.4.0",
"es-check": "^5.0.0",
"eslint": "^6.0.1",
"cypress": "^3.8.3",
"es-check": "^5.1.0",
"eslint": "^6.8.0",
"gzip-size": "^5.1.1",
"husky": "^3.0.0",
"idtoken-verifier": "^1.4.1",
"husky": "^3.1.0",
"idtoken-verifier": "^1.5.1",
"jest": "^24.9.0",
"jest-localstorage-mock": "^2.4.0",
"jsonwebtoken": "^8.5.1",
"pem": "^1.14.2",
"prettier": "^1.18.2",
"pem": "^1.14.4",
"prettier": "^1.19.1",
"pretty-quick": "^1.11.1",
"qss": "^2.0.3",
"rimraf": "^3.0.0",
"rollup": "^1.17.0",
"rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-livereload": "^1.0.1",
"rimraf": "^3.0.2",
"rollup": "^1.32.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-livereload": "^1.0.4",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-serve": "^1.0.1",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-typescript2": "^0.23.0",
"rollup-plugin-visualizer": "^2.5.0",
"serve": "^11.1.0",
"ts-jest": "^24.0.2",
"tslint": "^5.18.0",
"rollup-plugin-visualizer": "^2.7.2",
"serve": "^11.3.0",
"ts-jest": "^24.3.0",
"tslint": "^5.20.1",
"tslint-config-security": "^1.16.0",
"typedoc": "^0.15.0",
"typescript": "^3.6.4",
"typedoc": "^0.15.8",
"typescript": "^3.8.3",
"wait-on": "^3.3.0"

@@ -77,6 +76,6 @@ },

"abortcontroller-polyfill": "^1.4.0",
"browser-tabs-lock": "^1.2.1",
"core-js": "^3.2.1",
"es-cookie": "^1.2.0",
"fast-text-encoding": "^1.0.0",
"browser-tabs-lock": "^1.2.7",
"core-js": "^3.6.4",
"es-cookie": "^1.3.2",
"fast-text-encoding": "^1.0.1",
"promise-polyfill": "^8.1.3",

@@ -83,0 +82,0 @@ "unfetch": "^4.1.0"

@@ -31,3 +31,3 @@ # @auth0/auth0-spa-js

```html
<script src="https://cdn.auth0.com/js/auth0-spa-js/1.7.0-beta.4/auth0-spa-js.production.js"></script>
<script src="https://cdn.auth0.com/js/auth0-spa-js/1.7.0-beta.5/auth0-spa-js.production.js"></script>
```

@@ -71,2 +71,18 @@

});
//or, you can just instantiate the client on it's own
import { Auth0Client } from '@auth0/auth0-spa-js';
const auth0 = new Auth0Client({
domain: '<AUTH0_DOMAIN>',
client_id: '<AUTH0_CLIENT_ID>',
redirect_uri: '<MY_CALLBACK_URL>'
});
//if you do this, you'll need to check the session yourself
try {
await getTokenSilently();
} catch (error) {
if (error.error !== 'login_required') {
throw error;
}
}
```

@@ -169,7 +185,7 @@

### Caching strategy
### Data caching
The SDK can be configured to cache ID tokens and access tokens either in memory or in local storage. The default is in memory. This setting can be controlled using the `cacheStrategy` option when creating the Auth0 client.
The SDK can be configured to cache ID tokens and access tokens either in memory or in local storage. The default is in memory. This setting can be controlled using the `cacheLocation` option when creating the Auth0 client.
To use the in-memory mode, no additional options need are required as this is the default setting. To configure the SDK to cache data using local storage, set `cacheStrategy` as follows:
To use the in-memory mode, no additional options need are required as this is the default setting. To configure the SDK to cache data using local storage, set `cacheLocation` as follows:

@@ -181,3 +197,3 @@ ```js

redirect_uri: '<MY_CALLBACK_URL>',
cacheStrategy: 'localstorage' // valid values are: 'memory' or 'localstorage'
cacheLocation: 'localstorage' // valid values are: 'memory' or 'localstorage'
}).then(auth0 => {

@@ -200,6 +216,4 @@ // ...

This SDK is in Early Access with selected stakeholders.
For support or to provide feedback, please [raise an issue on our issue tracker](https://github.com/auth0/auth0-spa-js/issues).
We process feedback and provide support via private channels.
## Frequently Asked Questions

@@ -206,0 +220,0 @@

@@ -14,3 +14,3 @@ import Lock from 'browser-tabs-lock';

oauthToken,
openPopup
validateCrypto
} from './utils';

@@ -84,2 +84,3 @@

constructor(private options: Auth0ClientOptions) {
validateCrypto();
this.cacheLocation = options.cacheLocation || 'memory';

@@ -92,2 +93,3 @@

this.cache = cacheFactory(this.cacheLocation)();
this.transactionManager = new TransactionManager();

@@ -180,8 +182,3 @@ this.domainUrl = `https://${this.options.domain}`;

): Promise<string> {
const {
redirect_uri,
appState,
cacheStrategy,
...authorizeOptions
} = options;
const { redirect_uri, appState, ...authorizeOptions } = options;

@@ -237,3 +234,2 @@ const stateIn = encode(createRandomString());

) {
const popup = await openPopup();
const { ...authorizeOptions } = options;

@@ -259,3 +255,3 @@ const stateIn = encode(createRandomString());

const codeResult = await runPopup(popup, url, {
const codeResult = await runPopup(url, {
...config,

@@ -403,11 +399,18 @@ timeoutInSeconds:

const authResult = await oauthToken({
const tokenOptions = {
baseUrl: this.domainUrl,
client_id: this.options.client_id,
code_verifier: transaction.code_verifier,
code,
grant_type: 'authorization_code',
redirect_uri: transaction.redirect_uri
} as OAuthTokenOptions);
code
} as OAuthTokenOptions;
// some old versions of the SDK might not have added redirect_uri to the
// transaction, we dont want the key to be set to undefined.
if (undefined !== transaction.redirect_uri) {
tokenOptions.redirect_uri = transaction.redirect_uri;
}
const authResult = await oauthToken(tokenOptions);
const decodedToken = this._verifyIdToken(

@@ -547,4 +550,9 @@ authResult.id_token,

*
* Performs a redirect to `/v2/logout` using the parameters provided
* as arguments. [Read more about how Logout works at Auth0](https://auth0.com/docs/logout).
* Clears the application session and performs a redirect to `/v2/logout`, using
* the parameters provided as arguments, to clear the Auth0 session.
* If the `federated` option is specified it also clears the Identity Provider session.
* If the `localOnly` option is specified, it only clears the application session.
* It is invalid to set both the `federated` and `localOnly` options to `true`,
* and an error will be thrown if you do.
* [Read more about how Logout works at Auth0](https://auth0.com/docs/logout).
*

@@ -560,7 +568,20 @@ * @param options

const { federated, localOnly, ...logoutOptions } = options;
if (localOnly && federated) {
throw new Error(
'It is invalid to set both the `federated` and `localOnly` options to `true`'
);
}
this.cache.clear();
ClientStorage.remove('auth0.is.authenticated');
this.cache.clear();
const { federated, ...logoutOptions } = options;
if (localOnly) {
return;
}
const federatedQuery = federated ? `&federated` : '';
const url = this._url(`/v2/logout?${createQueryParams(logoutOptions)}`);
window.location.assign(`${url}${federatedQuery}`);

@@ -567,0 +588,0 @@ }

@@ -11,3 +11,2 @@ import { PopupConfigOptions } from './global';

*/
export const DEFAULT_POPUP_CONFIG_OPTIONS: PopupConfigOptions = {

@@ -25,2 +24,7 @@ timeoutInSeconds: DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS

*/
export const CLEANUP_IFRAME_TIMEOUT_IN_SECONDS = 2;
/**
* @ignore
*/
export const DEFAULT_FETCH_TIMEOUT_MS = 10000;

@@ -27,0 +31,0 @@

@@ -167,2 +167,9 @@ /**

timeoutInSeconds?: number;
/**
* Accepts an already-created popup window to use. If not specified, the SDK
* will create its own. This may be useful for platforms like iOS that have
* security restrictions around when popups can be invoked (e.g. from a user click event)
*/
popup?: any;
}

@@ -260,5 +267,14 @@

* and from Auth0.
* This option cannot be specified along with the `localOnly` option.
* [Read more about how federated logout works at Auth0](https://auth0.com/docs/logout/guides/logout-idps)
*/
federated?: boolean;
/**
* When `true`, this skips the request to the logout endpoint on the authorization server,
* effectively performing a "local" logout of the application. No redirect should take place,
* you should update local logged in state.
* This option cannot be specified along with the `federated` option.
*/
localOnly?: boolean;
}

@@ -265,0 +281,0 @@

@@ -10,3 +10,3 @@ import 'core-js/es/string/starts-with';

import Auth0Client_ from './Auth0Client';
import Auth0Client from './Auth0Client';
import * as ClientStorage from './storage';

@@ -17,10 +17,7 @@ import { Auth0ClientOptions } from './global';

import './global';
import { getUniqueScopes } from './utils';
import { validateCrypto, getUniqueScopes } from './utils';
export * from './global';
export default async function createAuth0Client(options: Auth0ClientOptions) {
validateCrypto();
if (options.useRefreshTokens) {

@@ -30,3 +27,3 @@ options.scope = getUniqueScopes(options.scope, 'offline_access');

const auth0 = new Auth0Client_(options);
const auth0 = new Auth0Client(options);

@@ -43,3 +40,5 @@ if (

} catch (error) {
// ignore
if (error.error !== 'login_required') {
throw error;
}
}

@@ -50,2 +49,2 @@

export type Auth0Client = Auth0Client_;
export { Auth0Client };

@@ -12,3 +12,4 @@ import fetch from 'unfetch';

DEFAULT_SILENT_TOKEN_RETRY_COUNT,
DEFAULT_FETCH_TIMEOUT_MS
DEFAULT_FETCH_TIMEOUT_MS,
CLEANUP_IFRAME_TIMEOUT_IN_SECONDS
} from './constants';

@@ -71,3 +72,8 @@

window.removeEventListener('message', iframeEventHandler, false);
window.document.body.removeChild(iframe);
// Delay the removal of the iframe to prevent hanging loading status
// in Chrome: https://github.com/auth0/auth0-spa-js/issues/240
setTimeout(
() => window.document.body.removeChild(iframe),
CLEANUP_IFRAME_TIMEOUT_IN_SECONDS * 1000
);
};

@@ -80,20 +86,28 @@ window.addEventListener('message', iframeEventHandler, false);

export const openPopup = () => {
const popup = window.open(
'',
const openPopup = url => {
const width = 400;
const height = 600;
const left = window.screenX + (window.innerWidth - width) / 2;
const top = window.screenY + (window.innerHeight - height) / 2;
return window.open(
url,
'auth0:authorize:popup',
'left=100,top=100,width=400,height=600,resizable,scrollbars=yes,status=1'
`left=${left},top=${top},width=${width},height=${height},resizable,scrollbars=yes,status=1`
);
};
export const runPopup = (authorizeUrl: string, config: PopupConfigOptions) => {
let popup = config.popup;
if (popup) {
popup.location.href = authorizeUrl;
} else {
popup = openPopup(authorizeUrl);
}
if (!popup) {
throw new Error('Could not open popup');
}
return popup;
};
export const runPopup = (
popup: any,
authorizeUrl: string,
config: PopupConfigOptions
) => {
popup.location.href = authorizeUrl;
return new Promise<AuthenticationResult>((resolve, reject) => {

@@ -100,0 +114,0 @@ const timeoutId = setTimeout(() => {

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

export default '1.7.0-beta.4';
export default '1.7.0-beta.5';

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc