@auth0/auth0-react 1.12.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/auth0-context.d.ts +9 -43
- package/dist/auth0-context.d.ts.map +1 -1
- package/dist/auth0-provider.d.ts +3 -106
- package/dist/auth0-provider.d.ts.map +1 -1
- package/dist/auth0-react.cjs.js +34 -58
- package/dist/auth0-react.cjs.js.map +1 -1
- package/dist/auth0-react.esm.js +29 -47
- package/dist/auth0-react.esm.js.map +1 -1
- package/dist/auth0-react.js +34 -58
- package/dist/auth0-react.js.map +1 -1
- package/dist/auth0-react.min.js +1 -15
- package/dist/auth0-react.min.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/reducer.d.ts +1 -1
- package/dist/reducer.d.ts.map +1 -1
- package/dist/with-authentication-required.d.ts +1 -7
- package/dist/with-authentication-required.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/auth0-context.tsx +14 -54
- package/src/auth0-provider.tsx +9 -155
- package/src/index.tsx +2 -2
- package/src/reducer.tsx +1 -1
- package/src/with-authentication-required.tsx +8 -19
package/dist/auth0-react.min.js
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).reactAuth0={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var i=function(){return i=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},i.apply(this,arguments)};function c(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 a(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}s((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)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 c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}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,a])}}}var u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},u(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var d=function(){return d=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},d.apply(this,arguments)};function f(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 p(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}s((r=r.apply(e,t||[])).next())}))}function h(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)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 c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}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,a])}}}function y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)c.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return c}function m(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g(e,t){return e(t={exports:{}},t.exports),t.exports}var w,S,k=function(e){return e&&e.Math==Math&&e},I=k("object"==typeof globalThis&&globalThis)||k("object"==typeof window&&window)||k("object"==typeof self&&self)||k("object"==typeof b&&b)||function(){return this}()||Function("return this")(),Z=function(e){try{return!!e()}catch(e){return!0}},W=!Z((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),_=!Z((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),G=Function.prototype.call,x=_?G.bind(G):function(){return G.apply(G,arguments)},C={}.propertyIsEnumerable,L=Object.getOwnPropertyDescriptor,X=L&&!C.call({1:2},1)?function(e){var t=L(this,e);return!!t&&t.enumerable}:C,T={f:X},O=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},R=Function,j=R.prototype,K=j.bind,H=j.call,Y=_&&K.bind(H,H),V=function(e){return e instanceof R?_?Y(e):function(){return H.apply(e,arguments)}:void 0},P=V({}.toString),N=V("".slice),E=function(e){return N(P(e),8,-1)},J=Object,F=V("".split),U=Z((function(){return!J("z").propertyIsEnumerable(0)}))?function(e){return"String"==E(e)?F(e,""):J(e)}:J,A=function(e){return null==e},z=TypeError,D=function(e){if(A(e))throw z("Can't call method on "+e);return e},B=function(e){return U(D(e))},M="object"==typeof document&&document.all,Q={all:M,IS_HTMLDDA:void 0===M&&void 0!==M},q=Q.all,$=Q.IS_HTMLDDA?function(e){return"function"==typeof e||e===q}:function(e){return"function"==typeof e},ee=Q.all,te=Q.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:$(e)||e===ee}:function(e){return"object"==typeof e?null!==e:$(e)},ne=function(e){return $(e)?e:void 0},re=function(e,t){return arguments.length<2?ne(I[e]):I[e]&&I[e][t]},oe=V({}.isPrototypeOf),ie=re("navigator","userAgent")||"",ce=I.process,ae=I.Deno,se=ce&&ce.versions||ae&&ae.version,ue=se&&se.v8;ue&&(S=(w=ue.split("."))[0]>0&&w[0]<4?1:+(w[0]+w[1])),!S&&ie&&(!(w=ie.match(/Edge\/(\d+)/))||w[1]>=74)&&(w=ie.match(/Chrome\/(\d+)/))&&(S=+w[1]);var le=S,de=!!Object.getOwnPropertySymbols&&!Z((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&le&&le<41})),fe=de&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,pe=Object,he=fe?function(e){return"symbol"==typeof e}:function(e){var t=re("Symbol");return $(t)&&oe(t.prototype,pe(e))},ye=String,me=function(e){try{return ye(e)}catch(e){return"Object"}},be=TypeError,ve=function(e){if($(e))return e;throw be(me(e)+" is not a function")},ge=function(e,t){var n=e[t];return A(n)?void 0:ve(n)},we=TypeError,Se=Object.defineProperty,ke=function(e,t){try{Se(I,e,{value:t,configurable:!0,writable:!0})}catch(n){I[e]=t}return t},Ie=I["__core-js_shared__"]||ke("__core-js_shared__",{}),Ze=g((function(e){(e.exports=function(e,t){return Ie[e]||(Ie[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.4/LICENSE",source:"https://github.com/zloirock/core-js"})})),We=Object,_e=function(e){return We(D(e))},Ge=V({}.hasOwnProperty),xe=Object.hasOwn||function(e,t){return Ge(_e(e),t)},Ce=0,Le=Math.random(),Xe=V(1..toString),Te=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Xe(++Ce+Le,36)},Oe=Ze("wks"),Re=I.Symbol,je=Re&&Re.for,Ke=fe?Re:Re&&Re.withoutSetter||Te,He=function(e){if(!xe(Oe,e)||!de&&"string"!=typeof Oe[e]){var t="Symbol."+e;de&&xe(Re,e)?Oe[e]=Re[e]:Oe[e]=fe&&je?je(t):Ke(t)}return Oe[e]},Ye=TypeError,Ve=He("toPrimitive"),Pe=function(e){var t=function(e,t){if(!te(e)||he(e))return e;var n,r=ge(e,Ve);if(r){if(void 0===t&&(t="default"),n=x(r,e,t),!te(n)||he(n))return n;throw Ye("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&$(n=e.toString)&&!te(r=x(n,e)))return r;if($(n=e.valueOf)&&!te(r=x(n,e)))return r;if("string"!==t&&$(n=e.toString)&&!te(r=x(n,e)))return r;throw we("Can't convert object to primitive value")}(e,t)}(e,"string");return he(t)?t:t+""},Ne=I.document,Ee=te(Ne)&&te(Ne.createElement),Je=function(e){return Ee?Ne.createElement(e):{}},Fe=!W&&!Z((function(){return 7!=Object.defineProperty(Je("div"),"a",{get:function(){return 7}}).a})),Ue=Object.getOwnPropertyDescriptor,Ae={f:W?Ue:function(e,t){if(e=B(e),t=Pe(t),Fe)try{return Ue(e,t)}catch(e){}if(xe(e,t))return O(!x(T.f,e,t),e[t])}},ze=W&&Z((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),De=String,Be=TypeError,Me=function(e){if(te(e))return e;throw Be(De(e)+" is not an object")},Qe=TypeError,qe=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,et={f:W?ze?function(e,t,n){if(Me(e),t=Pe(t),Me(n),"function"==typeof e&&"prototype"===t&&"value"in n&&"writable"in n&&!n.writable){var r=$e(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return qe(e,t,n)}:qe:function(e,t,n){if(Me(e),t=Pe(t),Me(n),Fe)try{return qe(e,t,n)}catch(e){}if("get"in n||"set"in n)throw Qe("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},tt=W?function(e,t,n){return et.f(e,t,O(1,n))}:function(e,t,n){return e[t]=n,e},nt=Function.prototype,rt=W&&Object.getOwnPropertyDescriptor,ot=xe(nt,"name"),it={EXISTS:ot,PROPER:ot&&"something"===function(){}.name,CONFIGURABLE:ot&&(!W||W&&rt(nt,"name").configurable)},ct=V(Function.toString);$(Ie.inspectSource)||(Ie.inspectSource=function(e){return ct(e)});var at,st,ut,lt=Ie.inspectSource,dt=I.WeakMap,ft=$(dt)&&/native code/.test(String(dt)),pt=Ze("keys"),ht=function(e){return pt[e]||(pt[e]=Te(e))},yt={},mt=I.TypeError,bt=I.WeakMap;if(ft||Ie.state){var vt=Ie.state||(Ie.state=new bt),gt=V(vt.get),wt=V(vt.has),St=V(vt.set);at=function(e,t){if(wt(vt,e))throw mt("Object already initialized");return t.facade=e,St(vt,e,t),t},st=function(e){return gt(vt,e)||{}},ut=function(e){return wt(vt,e)}}else{var kt=ht("state");yt[kt]=!0,at=function(e,t){if(xe(e,kt))throw mt("Object already initialized");return t.facade=e,tt(e,kt,t),t},st=function(e){return xe(e,kt)?e[kt]:{}},ut=function(e){return xe(e,kt)}}var It={set:at,get:st,has:ut,enforce:function(e){return ut(e)?st(e):at(e,{})},getterFor:function(e){return function(t){var n;if(!te(t)||(n=st(t)).type!==e)throw mt("Incompatible receiver, "+e+" required");return n}}},Zt=g((function(e){var t=it.CONFIGURABLE,n=It.enforce,r=It.get,o=Object.defineProperty,i=W&&!Z((function(){return 8!==o((function(){}),"length",{value:8}).length})),c=String(String).split("String"),a=e.exports=function(e,r,a){"Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),a&&a.getter&&(r="get "+r),a&&a.setter&&(r="set "+r),(!xe(e,"name")||t&&e.name!==r)&&(W?o(e,"name",{value:r,configurable:!0}):e.name=r),i&&a&&xe(a,"arity")&&e.length!==a.arity&&o(e,"length",{value:a.arity});try{a&&xe(a,"constructor")&&a.constructor?W&&o(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=n(e);return xe(s,"source")||(s.source=c.join("string"==typeof r?r:"")),e};Function.prototype.toString=a((function(){return $(this)&&r(this).source||lt(this)}),"toString")})),Wt=function(e,t,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:t;if($(n)&&Zt(n,i,r),r.global)o?e[t]=n:ke(t,n);else{try{r.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=n:et.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},_t=Math.ceil,Gt=Math.floor,xt=Math.trunc||function(e){var t=+e;return(t>0?Gt:_t)(t)},Ct=function(e){var t=+e;return t!=t||0===t?0:xt(t)},Lt=Math.max,Xt=Math.min,Tt=function(e,t){var n=Ct(e);return n<0?Lt(n+t,0):Xt(n,t)},Ot=Math.min,Rt=function(e){return e>0?Ot(Ct(e),9007199254740991):0},jt=function(e){return Rt(e.length)},Kt=function(e){return function(t,n,r){var o,i=B(t),c=jt(i),a=Tt(r,c);if(e&&n!=n){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((e||a in i)&&i[a]===n)return e||a||0;return!e&&-1}},Ht={includes:Kt(!0),indexOf:Kt(!1)},Yt=Ht.indexOf,Vt=V([].push),Pt=function(e,t){var n,r=B(e),o=0,i=[];for(n in r)!xe(yt,n)&&xe(r,n)&&Vt(i,n);for(;t.length>o;)xe(r,n=t[o++])&&(~Yt(i,n)||Vt(i,n));return i},Nt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Et=Nt.concat("length","prototype"),Jt={f:Object.getOwnPropertyNames||function(e){return Pt(e,Et)}},Ft={f:Object.getOwnPropertySymbols},Ut=V([].concat),At=re("Reflect","ownKeys")||function(e){var t=Jt.f(Me(e)),n=Ft.f;return n?Ut(t,n(e)):t},zt=function(e,t,n){for(var r=At(t),o=et.f,i=Ae.f,c=0;c<r.length;c++){var a=r[c];xe(e,a)||n&&xe(n,a)||o(e,a,i(t,a))}},Dt=/#|\.prototype\./,Bt=function(e,t){var n=Qt[Mt(e)];return n==$t||n!=qt&&($(t)?Z(t):!!t)},Mt=Bt.normalize=function(e){return String(e).replace(Dt,".").toLowerCase()},Qt=Bt.data={},qt=Bt.NATIVE="N",$t=Bt.POLYFILL="P",en=Bt,tn=Ae.f,nn=function(e,t){var n,r,o,i,c,a=e.target,s=e.global,u=e.stat;if(n=s?I:u?I[a]||ke(a,{}):(I[a]||{}).prototype)for(r in t){if(i=t[r],o=e.dontCallGetSet?(c=tn(n,r))&&c.value:n[r],!en(s?r:a+(u?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;zt(i,o)}(e.sham||o&&o.sham)&&tt(i,"sham",!0),Wt(n,r,i,e)}},rn={};rn[He("toStringTag")]="z";var on,cn="[object z]"===String(rn),an=He("toStringTag"),sn=Object,un="Arguments"==E(function(){return arguments}()),ln=cn?E: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=sn(e),an))?n:un?E(t):"Object"==(r=E(t))&&$(t.callee)?"Arguments":r},dn=String,fn=function(e){if("Symbol"===ln(e))throw TypeError("Cannot convert a Symbol value to a string");return dn(e)},pn=He("match"),hn=TypeError,yn=function(e){if(function(e){var t;return te(e)&&(void 0!==(t=e[pn])?!!t:"RegExp"==E(e))}(e))throw hn("The method doesn't accept regular expressions");return e},mn=He("match"),bn=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[mn]=!1,"/./"[e](t)}catch(e){}}return!1},vn=Ae.f,gn=V("".startsWith),wn=V("".slice),Sn=Math.min,kn=bn("startsWith"),In=!(kn||(on=vn(String.prototype,"startsWith"),!on||on.writable));nn({target:"String",proto:!0,forced:!In&&!kn},{startsWith:function(e){var t=fn(D(this));yn(e);var n=Rt(Sn(arguments.length>1?arguments[1]:void 0,t.length)),r=fn(e);return gn?gn(t,r,n):wn(t,n,n+r.length)===r}});var Zn=function(e,t){return V(I[e].prototype[t])};Zn("String","startsWith");var Wn=Array.isArray||function(e){return"Array"==E(e)},_n=TypeError,Gn=function(e){if(e>9007199254740991)throw _n("Maximum allowed index exceeded");return e},xn=function(e,t,n){var r=Pe(t);r in e?et.f(e,r,O(0,n)):e[r]=n},Cn=function(){},Ln=[],Xn=re("Reflect","construct"),Tn=/^\s*(?:class|function)\b/,On=V(Tn.exec),Rn=!Tn.exec(Cn),jn=function(e){if(!$(e))return!1;try{return Xn(Cn,Ln,e),!0}catch(e){return!1}},Kn=function(e){if(!$(e))return!1;switch(ln(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Rn||!!On(Tn,lt(e))}catch(e){return!0}};Kn.sham=!0;var Hn=!Xn||Z((function(){var e;return jn(jn.call)||!jn(Object)||!jn((function(){e=!0}))||e}))?Kn:jn,Yn=He("species"),Vn=Array,Pn=function(e,t){return new(function(e){var t;return Wn(e)&&(t=e.constructor,(Hn(t)&&(t===Vn||Wn(t.prototype))||te(t)&&null===(t=t[Yn]))&&(t=void 0)),void 0===t?Vn:t}(e))(0===t?0:t)},Nn=He("species"),En=He("isConcatSpreadable"),Jn=le>=51||!Z((function(){var e=[];return e[En]=!1,e.concat()[0]!==e})),Fn=("concat",le>=51||!Z((function(){var e=[];return(e.constructor={})[Nn]=function(){return{foo:1}},1!==e.concat(Boolean).foo}))),Un=function(e){if(!te(e))return!1;var t=e[En];return void 0!==t?!!t:Wn(e)};nn({target:"Array",proto:!0,arity:1,forced:!Jn||!Fn},{concat:function(e){var t,n,r,o,i,c=_e(this),a=Pn(c,0),s=0;for(t=-1,r=arguments.length;t<r;t++)if(Un(i=-1===t?c:arguments[t]))for(o=jt(i),Gn(s+o),n=0;n<o;n++,s++)n in i&&xn(a,s,i[n]);else Gn(s+1),xn(a,s++,i);return a.length=s,a}});var An=cn?{}.toString:function(){return"[object "+ln(this)+"]"};cn||Wt(Object.prototype,"toString",An,{unsafe:!0});var zn,Dn=Object.keys||function(e){return Pt(e,Nt)},Bn=W&&!ze?Object.defineProperties:function(e,t){Me(e);for(var n,r=B(t),o=Dn(t),i=o.length,c=0;i>c;)et.f(e,n=o[c++],r[n]);return e},Mn={f:Bn},Qn=re("document","documentElement"),qn=ht("IE_PROTO"),$n=function(){},er=function(e){return"<script>"+e+"<\/script>"},tr=function(e){e.write(er("")),e.close();var t=e.parentWindow.Object;return e=null,t},nr=function(){try{zn=new ActiveXObject("htmlfile")}catch(e){}var e,t;nr="undefined"!=typeof document?document.domain&&zn?tr(zn):((t=Je("iframe")).style.display="none",Qn.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(er("document.F=Object")),e.close(),e.F):tr(zn);for(var n=Nt.length;n--;)delete nr.prototype[Nt[n]];return nr()};yt[qn]=!0;var rr=Object.create||function(e,t){var n;return null!==e?($n.prototype=Me(e),n=new $n,$n.prototype=null,n[qn]=e):n=nr(),void 0===t?n:Mn.f(n,t)},or=Array,ir=Math.max,cr=Jt.f,ar="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],sr={f:function(e){return ar&&"Window"==E(e)?function(e){try{return cr(e)}catch(e){return function(e,t,n){for(var r=jt(e),o=Tt(void 0,r),i=Tt(r,r),c=or(ir(i-o,0)),a=0;o<i;o++,a++)xn(c,a,e[o]);return c.length=a,c}(ar)}}(e):cr(B(e))}},ur={f:He},lr=I,dr=et.f,fr=function(e){var t=lr.Symbol||(lr.Symbol={});xe(t,e)||dr(t,e,{value:ur.f(e)})},pr=function(){var e=re("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,r=He("toPrimitive");t&&!t[r]&&Wt(t,r,(function(e){return x(n,this)}),{arity:1})},hr=et.f,yr=He("toStringTag"),mr=function(e,t,n){e&&!n&&(e=e.prototype),e&&!xe(e,yr)&&hr(e,yr,{configurable:!0,value:t})},br=V(V.bind),vr=function(e,t){return ve(e),void 0===t?e:_?br(e,t):function(){return e.apply(t,arguments)}},gr=V([].push),wr=function(e){var t=1==e,n=2==e,r=3==e,o=4==e,i=6==e,c=7==e,a=5==e||i;return function(s,u,l,d){for(var f,p,h=_e(s),y=U(h),m=vr(u,l),b=jt(y),v=0,g=d||Pn,w=t?g(s,b):n||c?g(s,0):void 0;b>v;v++)if((a||v in y)&&(p=m(f=y[v],v,h),e))if(t)w[v]=p;else if(p)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:gr(w,f)}else switch(e){case 4:return!1;case 7:gr(w,f)}return i?-1:r||o?o:w}},Sr=[wr(0),wr(1),wr(2),wr(3),wr(4),wr(5),wr(6),wr(7)][0],kr=ht("hidden"),Ir=It.set,Zr=It.getterFor("Symbol"),Wr=Object.prototype,_r=I.Symbol,Gr=_r&&_r.prototype,xr=I.TypeError,Cr=I.QObject,Lr=Ae.f,Xr=et.f,Tr=sr.f,Or=T.f,Rr=V([].push),jr=Ze("symbols"),Kr=Ze("op-symbols"),Hr=Ze("wks"),Yr=!Cr||!Cr.prototype||!Cr.prototype.findChild,Vr=W&&Z((function(){return 7!=rr(Xr({},"a",{get:function(){return Xr(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Lr(Wr,t);r&&delete Wr[t],Xr(e,t,n),r&&e!==Wr&&Xr(Wr,t,r)}:Xr,Pr=function(e,t){var n=jr[e]=rr(Gr);return Ir(n,{type:"Symbol",tag:e,description:t}),W||(n.description=t),n},Nr=function(e,t,n){e===Wr&&Nr(Kr,t,n),Me(e);var r=Pe(t);return Me(n),xe(jr,r)?(n.enumerable?(xe(e,kr)&&e[kr][r]&&(e[kr][r]=!1),n=rr(n,{enumerable:O(0,!1)})):(xe(e,kr)||Xr(e,kr,O(1,{})),e[kr][r]=!0),Vr(e,r,n)):Xr(e,r,n)},Er=function(e,t){Me(e);var n=B(t),r=Dn(n).concat(Ar(n));return Sr(r,(function(t){W&&!x(Jr,n,t)||Nr(e,t,n[t])})),e},Jr=function(e){var t=Pe(e),n=x(Or,this,t);return!(this===Wr&&xe(jr,t)&&!xe(Kr,t))&&(!(n||!xe(this,t)||!xe(jr,t)||xe(this,kr)&&this[kr][t])||n)},Fr=function(e,t){var n=B(e),r=Pe(t);if(n!==Wr||!xe(jr,r)||xe(Kr,r)){var o=Lr(n,r);return!o||!xe(jr,r)||xe(n,kr)&&n[kr][r]||(o.enumerable=!0),o}},Ur=function(e){var t=Tr(B(e)),n=[];return Sr(t,(function(e){xe(jr,e)||xe(yt,e)||Rr(n,e)})),n},Ar=function(e){var t=e===Wr,n=Tr(t?Kr:B(e)),r=[];return Sr(n,(function(e){!xe(jr,e)||t&&!xe(Wr,e)||Rr(r,jr[e])})),r};de||(Gr=(_r=function(){if(oe(Gr,this))throw xr("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?fn(arguments[0]):void 0,t=Te(e),n=function(e){this===Wr&&x(n,Kr,e),xe(this,kr)&&xe(this[kr],t)&&(this[kr][t]=!1),Vr(this,t,O(1,e))};return W&&Yr&&Vr(Wr,t,{configurable:!0,set:n}),Pr(t,e)}).prototype,Wt(Gr,"toString",(function(){return Zr(this).tag})),Wt(_r,"withoutSetter",(function(e){return Pr(Te(e),e)})),T.f=Jr,et.f=Nr,Mn.f=Er,Ae.f=Fr,Jt.f=sr.f=Ur,Ft.f=Ar,ur.f=function(e){return Pr(He(e),e)},W&&(Xr(Gr,"description",{configurable:!0,get:function(){return Zr(this).description}}),Wt(Wr,"propertyIsEnumerable",Jr,{unsafe:!0}))),nn({global:!0,constructor:!0,wrap:!0,forced:!de,sham:!de},{Symbol:_r}),Sr(Dn(Hr),(function(e){fr(e)})),nn({target:"Symbol",stat:!0,forced:!de},{useSetter:function(){Yr=!0},useSimple:function(){Yr=!1}}),nn({target:"Object",stat:!0,forced:!de,sham:!W},{create:function(e,t){return void 0===t?rr(e):Er(rr(e),t)},defineProperty:Nr,defineProperties:Er,getOwnPropertyDescriptor:Fr}),nn({target:"Object",stat:!0,forced:!de},{getOwnPropertyNames:Ur}),pr(),mr(_r,"Symbol"),yt[kr]=!0;var zr=de&&!!Symbol.for&&!!Symbol.keyFor,Dr=Ze("string-to-symbol-registry"),Br=Ze("symbol-to-string-registry");nn({target:"Symbol",stat:!0,forced:!zr},{for:function(e){var t=fn(e);if(xe(Dr,t))return Dr[t];var n=re("Symbol")(t);return Dr[t]=n,Br[n]=t,n}});var Mr=Ze("symbol-to-string-registry");nn({target:"Symbol",stat:!0,forced:!zr},{keyFor:function(e){if(!he(e))throw TypeError(me(e)+" is not a symbol");if(xe(Mr,e))return Mr[e]}});var Qr=Function.prototype,qr=Qr.apply,$r=Qr.call,eo="object"==typeof Reflect&&Reflect.apply||(_?$r.bind(qr):function(){return $r.apply(qr,arguments)}),to=V([].slice),no=re("JSON","stringify"),ro=V(/./.exec),oo=V("".charAt),io=V("".charCodeAt),co=V("".replace),ao=V(1..toString),so=/[\uD800-\uDFFF]/g,uo=/^[\uD800-\uDBFF]$/,lo=/^[\uDC00-\uDFFF]$/,fo=!de||Z((function(){var e=re("Symbol")();return"[null]"!=no([e])||"{}"!=no({a:e})||"{}"!=no(Object(e))})),po=Z((function(){return'"\\udf06\\ud834"'!==no("\udf06\ud834")||'"\\udead"'!==no("\udead")})),ho=function(e,t){var n=to(arguments),r=t;if((te(t)||void 0!==e)&&!he(e))return Wn(t)||(t=function(e,t){if($(r)&&(t=x(r,this,e,t)),!he(t))return t}),n[1]=t,eo(no,null,n)},yo=function(e,t,n){var r=oo(n,t-1),o=oo(n,t+1);return ro(uo,e)&&!ro(lo,o)||ro(lo,e)&&!ro(uo,r)?"\\u"+ao(io(e,0),16):e};no&&nn({target:"JSON",stat:!0,arity:3,forced:fo||po},{stringify:function(e,t,n){var r=to(arguments),o=eo(fo?ho:no,null,r);return po&&"string"==typeof o?co(o,so,yo):o}});var mo=!de||Z((function(){Ft.f(1)}));nn({target:"Object",stat:!0,forced:mo},{getOwnPropertySymbols:function(e){var t=Ft.f;return t?t(_e(e)):[]}}),fr("asyncIterator");var bo=et.f,vo=I.Symbol,go=vo&&vo.prototype;if(W&&$(vo)&&(!("description"in go)||void 0!==vo().description)){var wo={},So=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:fn(arguments[0]),t=oe(go,this)?new vo(e):void 0===e?vo():vo(e);return""===e&&(wo[t]=!0),t};zt(So,vo),So.prototype=go,go.constructor=So;var ko="Symbol(test)"==String(vo("test")),Io=V(go.valueOf),Zo=V(go.toString),Wo=/^Symbol\((.*)\)[^)]+$/,_o=V("".replace),Go=V("".slice);bo(go,"description",{configurable:!0,get:function(){var e=Io(this);if(xe(wo,e))return"";var t=Zo(e),n=ko?Go(t,7,-1):_o(t,Wo,"$1");return""===n?void 0:n}}),nn({global:!0,constructor:!0,forced:!0},{Symbol:So})}fr("hasInstance"),fr("isConcatSpreadable"),fr("iterator"),fr("match"),fr("matchAll"),fr("replace"),fr("search"),fr("species"),fr("split"),fr("toPrimitive"),pr(),fr("toStringTag"),mr(re("Symbol"),"Symbol"),fr("unscopables"),mr(I.JSON,"JSON",!0),mr(Math,"Math",!0),nn({global:!0},{Reflect:{}}),mr(I.Reflect,"Reflect",!0),lr.Symbol;var xo,Co,Lo,Xo=V("".charAt),To=V("".charCodeAt),Oo=V("".slice),Ro=function(e){return function(t,n){var r,o,i=fn(D(t)),c=Ct(n),a=i.length;return c<0||c>=a?e?"":void 0:(r=To(i,c))<55296||r>56319||c+1===a||(o=To(i,c+1))<56320||o>57343?e?Xo(i,c):r:e?Oo(i,c,c+2):o-56320+(r-55296<<10)+65536}},jo={codeAt:Ro(!1),charAt:Ro(!0)},Ko=!Z((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ho=ht("IE_PROTO"),Yo=Object,Vo=Yo.prototype,Po=Ko?Yo.getPrototypeOf:function(e){var t=_e(e);if(xe(t,Ho))return t[Ho];var n=t.constructor;return $(n)&&t instanceof n?n.prototype:t instanceof Yo?Vo:null},No=He("iterator"),Eo=!1;[].keys&&("next"in(Lo=[].keys())?(Co=Po(Po(Lo)))!==Object.prototype&&(xo=Co):Eo=!0);var Jo=!te(xo)||Z((function(){var e={};return xo[No].call(e)!==e}));Jo&&(xo={}),$(xo[No])||Wt(xo,No,(function(){return this}));var Fo={IteratorPrototype:xo,BUGGY_SAFARI_ITERATORS:Eo},Uo={},Ao=Fo.IteratorPrototype,zo=function(){return this},Do=String,Bo=TypeError,Mo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=V(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Me(n),function(e){if("object"==typeof e||$(e))return e;throw Bo("Can't set "+Do(e)+" as a prototype")}(r),t?e(n,r):n.__proto__=r,n}}():void 0),Qo=it.PROPER,qo=it.CONFIGURABLE,$o=Fo.IteratorPrototype,ei=Fo.BUGGY_SAFARI_ITERATORS,ti=He("iterator"),ni=function(){return this},ri=function(e,t,n,r,o,i,c){!function(e,t,n,r){var o=t+" Iterator";e.prototype=rr(Ao,{next:O(1,n)}),mr(e,o,!1),Uo[o]=zo}(n,t,r);var a,s,u,l=function(e){if(e===o&&y)return y;if(!ei&&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)}},d=t+" Iterator",f=!1,p=e.prototype,h=p[ti]||p["@@iterator"]||o&&p[o],y=!ei&&h||l(o),m="Array"==t&&p.entries||h;if(m&&(a=Po(m.call(new e)))!==Object.prototype&&a.next&&(Po(a)!==$o&&(Mo?Mo(a,$o):$(a[ti])||Wt(a,ti,ni)),mr(a,d,!0)),Qo&&"values"==o&&h&&"values"!==h.name&&(qo?tt(p,"name","values"):(f=!0,y=function(){return x(h,this)})),o)if(s={values:l("values"),keys:i?y:l("keys"),entries:l("entries")},c)for(u in s)(ei||f||!(u in p))&&Wt(p,u,s[u]);else nn({target:t,proto:!0,forced:ei||f},s);return p[ti]!==y&&Wt(p,ti,y,{name:o}),Uo[t]=y,s},oi=function(e,t){return{value:e,done:t}},ii=jo.charAt,ci=It.set,ai=It.getterFor("String Iterator");ri(String,"String",(function(e){ci(this,{type:"String Iterator",string:fn(e),index:0})}),(function(){var e,t=ai(this),n=t.string,r=t.index;return r>=n.length?oi(void 0,!0):(e=ii(n,r),t.index+=e.length,oi(e,!1))}));var si=function(e,t,n){var r,o;Me(e);try{if(!(r=ge(e,"return"))){if("throw"===t)throw n;return n}r=x(r,e)}catch(e){o=!0,r=e}if("throw"===t)throw n;if(o)throw r;return Me(r),n},ui=function(e,t,n,r){try{return r?t(Me(n)[0],n[1]):t(n)}catch(t){si(e,"throw",t)}},li=He("iterator"),di=Array.prototype,fi=function(e){return void 0!==e&&(Uo.Array===e||di[li]===e)},pi=He("iterator"),hi=function(e){if(!A(e))return ge(e,pi)||ge(e,"@@iterator")||Uo[ln(e)]},yi=TypeError,mi=function(e,t){var n=arguments.length<2?hi(e):t;if(ve(n))return Me(x(n,e));throw yi(me(e)+" is not iterable")},bi=Array,vi=He("iterator"),gi=!1;try{var wi=0,Si={next:function(){return{done:!!wi++}},return:function(){gi=!0}};Si[vi]=function(){return this},Array.from(Si,(function(){throw 2}))}catch(u){}var ki=function(e,t){if(!t&&!gi)return!1;var n=!1;try{var r={};r[vi]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Ii=!ki((function(e){Array.from(e)}));nn({target:"Array",stat:!0,forced:Ii},{from:function(e){var t=_e(e),n=Hn(this),r=arguments.length,o=r>1?arguments[1]:void 0,i=void 0!==o;i&&(o=vr(o,r>2?arguments[2]:void 0));var c,a,s,u,l,d,f=hi(t),p=0;if(!f||this===bi&&fi(f))for(c=jt(t),a=n?new this(c):bi(c);c>p;p++)d=i?o(t[p],p):t[p],xn(a,p,d);else for(l=(u=mi(t,f)).next,a=n?new this:[];!(s=x(l,u)).done;p++)d=i?ui(u,o,[s.value,p],!0):s.value,xn(a,p,d);return a.length=p,a}}),lr.Array.from;var Zi,Wi,_i,Gi="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,xi=et.f,Ci=It.enforce,Li=It.get,Xi=I.Int8Array,Ti=Xi&&Xi.prototype,Oi=I.Uint8ClampedArray,Ri=Oi&&Oi.prototype,ji=Xi&&Po(Xi),Ki=Ti&&Po(Ti),Hi=Object.prototype,Yi=I.TypeError,Vi=He("toStringTag"),Pi=Te("TYPED_ARRAY_TAG"),Ni=Gi&&!!Mo&&"Opera"!==ln(I.opera),Ei=!1,Ji={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Fi={BigInt64Array:8,BigUint64Array:8},Ui=function(e){var t=Po(e);if(te(t)){var n=Li(t);return n&&xe(n,"TypedArrayConstructor")?n.TypedArrayConstructor:Ui(t)}},Ai=function(e){if(!te(e))return!1;var t=ln(e);return xe(Ji,t)||xe(Fi,t)};for(Zi in Ji)(_i=(Wi=I[Zi])&&Wi.prototype)?Ci(_i).TypedArrayConstructor=Wi:Ni=!1;for(Zi in Fi)(_i=(Wi=I[Zi])&&Wi.prototype)&&(Ci(_i).TypedArrayConstructor=Wi);if((!Ni||!$(ji)||ji===Function.prototype)&&(ji=function(){throw Yi("Incorrect invocation")},Ni))for(Zi in Ji)I[Zi]&&Mo(I[Zi],ji);if((!Ni||!Ki||Ki===Hi)&&(Ki=ji.prototype,Ni))for(Zi in Ji)I[Zi]&&Mo(I[Zi].prototype,Ki);if(Ni&&Po(Ri)!==Ki&&Mo(Ri,Ki),W&&!xe(Ki,Vi))for(Zi in Ei=!0,xi(Ki,Vi,{get:function(){return te(this)?this[Pi]:void 0}}),Ji)I[Zi]&&tt(I[Zi],Pi,Zi);var zi={NATIVE_ARRAY_BUFFER_VIEWS:Ni,TYPED_ARRAY_TAG:Ei&&Pi,aTypedArray:function(e){if(Ai(e))return e;throw Yi("Target is not a typed array")},aTypedArrayConstructor:function(e){if($(e)&&(!Mo||oe(ji,e)))return e;throw Yi(me(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(W){if(n)for(var o in Ji){var i=I[o];if(i&&xe(i.prototype,e))try{delete i.prototype[e]}catch(n){try{i.prototype[e]=t}catch(e){}}}Ki[e]&&!n||Wt(Ki,e,n?t:Ni&&Ti[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(W){if(Mo){if(n)for(r in Ji)if((o=I[r])&&xe(o,e))try{delete o[e]}catch(e){}if(ji[e]&&!n)return;try{return Wt(ji,e,n?t:Ni&&ji[e]||t)}catch(e){}}for(r in Ji)!(o=I[r])||o[e]&&!n||Wt(o,e,t)}},getTypedArrayConstructor:Ui,isView:function(e){if(!te(e))return!1;var t=ln(e);return"DataView"===t||xe(Ji,t)||xe(Fi,t)},isTypedArray:Ai,TypedArray:ji,TypedArrayPrototype:Ki},Di=TypeError,Bi=He("species"),Mi=zi.aTypedArrayConstructor,Qi=zi.getTypedArrayConstructor,qi=zi.aTypedArray;(0,zi.exportTypedArrayMethod)("slice",(function(e,t){for(var n=to(qi(this),e,t),r=Mi(function(e,t){var n,r=Me(e).constructor;return void 0===r||A(n=Me(r)[Bi])?t:function(e){if(Hn(e))return e;throw Di(me(e)+" is not a constructor")}(n)}(this,Qi(this))),o=0,i=n.length,c=new r(i);i>o;)c[o]=n[o++];return c}),Z((function(){new Int8Array(1).slice()})));var $i=et.f,ec=He("unscopables"),tc=Array.prototype;null==tc[ec]&&$i(tc,ec,{configurable:!0,value:rr(null)});var nc=function(e){tc[ec][e]=!0},rc=Ht.includes,oc=Z((function(){return!Array(1).includes()}));nn({target:"Array",proto:!0,forced:oc},{includes:function(e){return rc(this,e,arguments.length>1?arguments[1]:void 0)}}),nc("includes"),Zn("Array","includes");var ic=V("".indexOf);nn({target:"String",proto:!0,forced:!bn("includes")},{includes:function(e){return!!~ic(fn(D(this)),fn(yn(e)),arguments.length>1?arguments[1]:void 0)}}),Zn("String","includes");var cc=et.f,ac=It.set,sc=It.getterFor("Array Iterator");ri(Array,"Array",(function(e,t){ac(this,{type:"Array Iterator",target:B(e),index:0,kind:t})}),(function(){var e=sc(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,oi(void 0,!0)):oi("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values");var uc=Uo.Arguments=Uo.Array;if(nc("keys"),nc("values"),nc("entries"),W&&"values"!==uc.name)try{cc(uc,"name",{value:"values"})}catch(u){}var lc=Z((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),dc=Object.isExtensible,fc=Z((function(){dc(1)}))||lc?function(e){return!!te(e)&&(!lc||"ArrayBuffer"!=E(e))&&(!dc||dc(e))}:dc,pc=!Z((function(){return Object.isExtensible(Object.preventExtensions({}))})),hc=g((function(e){var t=et.f,n=!1,r=Te("meta"),o=0,i=function(e){t(e,r,{value:{objectID:"O"+o++,weakData:{}}})},c=e.exports={enable:function(){c.enable=function(){},n=!0;var e=Jt.f,t=V([].splice),o={};o[r]=1,e(o).length&&(Jt.f=function(n){for(var o=e(n),i=0,c=o.length;i<c;i++)if(o[i]===r){t(o,i,1);break}return o},nn({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:sr.f}))},fastKey:function(e,t){if(!te(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!xe(e,r)){if(!fc(e))return"F";if(!t)return"E";i(e)}return e[r].objectID},getWeakData:function(e,t){if(!xe(e,r)){if(!fc(e))return!0;if(!t)return!1;i(e)}return e[r].weakData},onFreeze:function(e){return pc&&n&&fc(e)&&!xe(e,r)&&i(e),e}};yt[r]=!0}));hc.enable,hc.fastKey,hc.getWeakData,hc.onFreeze;var yc=TypeError,mc=function(e,t){this.stopped=e,this.result=t},bc=mc.prototype,vc=function(e,t,n){var r,o,i,c,a,s,u,l=n&&n.that,d=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),h=!(!n||!n.INTERRUPTED),y=vr(t,l),m=function(e){return r&&si(r,"normal",e),new mc(!0,e)},b=function(e){return d?(Me(e),h?y(e[0],e[1],m):y(e[0],e[1])):h?y(e,m):y(e)};if(f)r=e.iterator;else if(p)r=e;else{if(!(o=hi(e)))throw yc(me(e)+" is not iterable");if(fi(o)){for(i=0,c=jt(e);c>i;i++)if((a=b(e[i]))&&oe(bc,a))return a;return new mc(!1)}r=mi(e,o)}for(s=f?e.next:r.next;!(u=x(s,r)).done;){try{a=b(u.value)}catch(e){si(r,"throw",e)}if("object"==typeof a&&a&&oe(bc,a))return a}return new mc(!1)},gc=TypeError,wc=function(e,t){if(oe(t,e))return e;throw gc("Incorrect invocation")},Sc=function(e,t,n){for(var r in t)Wt(e,r,t[r],n);return e},kc=He("species"),Ic=et.f,Zc=hc.fastKey,Wc=It.set,_c=It.getterFor,Gc={getConstructor:function(e,t,n,r){var o=e((function(e,o){wc(e,i),Wc(e,{type:t,index:rr(null),first:void 0,last:void 0,size:0}),W||(e.size=0),A(o)||vc(o,e[r],{that:e,AS_ENTRIES:n})})),i=o.prototype,c=_c(t),a=function(e,t,n){var r,o,i=c(e),a=s(e,t);return a?a.value=n:(i.last=a={index:o=Zc(t,!0),key:t,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=a),r&&(r.next=a),W?i.size++:e.size++,"F"!==o&&(i.index[o]=a)),e},s=function(e,t){var n,r=c(e),o=Zc(t);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==t)return n};return Sc(i,{clear:function(){for(var e=c(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,W?e.size=0:this.size=0},delete:function(e){var t=this,n=c(t),r=s(t,e);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first==r&&(n.first=o),n.last==r&&(n.last=i),W?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=c(this),r=vr(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),Sc(i,n?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),W&&Ic(i,"size",{get:function(){return c(this).size}}),o},setStrong:function(e,t,n){var r=t+" Iterator",o=_c(t),i=_c(r);ri(e,t,(function(e,t){Wc(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?oi("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,oi(void 0,!0))}),n?"entries":"values",!n,!0),function(e){var t=re(e),n=et.f;W&&t&&!t[kc]&&n(t,kc,{configurable:!0,get:function(){return this}})}(t)}};function xc(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)}))}))}function Cc(e){return new this((function(t,n){if(!e||void 0===e.length)return n(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,n){if(n&&("object"==typeof n||"function"==typeof n)){var c=n.then;if("function"==typeof c)return void c.call(n,(function(t){i(e,t)}),(function(n){r[e]={status:"rejected",reason:n},0==--o&&t(r)}))}r[e]={status:"fulfilled",value:n},0==--o&&t(r)}for(var c=0;c<r.length;c++)i(c,r[c])}))}!function(e,t,n){var r=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),i=r?"set":"add",c=I[e],a=c&&c.prototype,s=c,u={},l=function(e){var t=V(a[e]);Wt(a,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(o&&!te(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return o&&!te(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(o&&!te(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(en(e,!$(c)||!(o||a.forEach&&!Z((function(){(new c).entries().next()})))))s=n.getConstructor(t,e,r,i),hc.enable();else if(en(e,!0)){var d=new s,f=d[i](o?{}:-0,1)!=d,p=Z((function(){d.has(1)})),h=ki((function(e){new c(e)})),y=!o&&Z((function(){for(var e=new c,t=5;t--;)e[i](t,t);return!e.has(-0)}));h||((s=t((function(e,t){wc(e,a);var n=function(e,t,n){var r,o;return Mo&&$(r=t.constructor)&&r!==n&&te(o=r.prototype)&&o!==n.prototype&&Mo(e,o),e}(new c,e,s);return A(t)||vc(t,n[i],{that:n,AS_ENTRIES:r}),n}))).prototype=a,a.constructor=s),(p||y)&&(l("delete"),l("has"),r&&l("get")),(y||f)&&l(i),o&&a.clear&&delete a.clear}u[e]=s,nn({global:!0,constructor:!0,forced:s!=c},u),mr(s,e),o||n.setStrong(s,e,r)}("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Gc),lr.Set;var Lc=setTimeout;function Xc(e){return Boolean(e&&void 0!==e.length)}function Tc(){}function Oc(e){if(!(this instanceof Oc))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=[],Vc(e,this)}function Rc(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,Oc._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 Kc(t.promise,e)}jc(t.promise,r)}else(1===e._state?jc:Kc)(t.promise,e._value)}))):e._deferreds.push(t)}function jc(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 Oc)return e._state=3,e._value=t,void Hc(e);if("function"==typeof n)return void Vc((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,Hc(e)}catch(t){Kc(e,t)}var r,o}function Kc(e,t){e._state=2,e._value=t,Hc(e)}function Hc(e){2===e._state&&0===e._deferreds.length&&Oc._immediateFn((function(){e._handled||Oc._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)Rc(e,e._deferreds[t]);e._deferreds=null}function Yc(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function Vc(e,t){var n=!1;try{e((function(e){n||(n=!0,jc(t,e))}),(function(e){n||(n=!0,Kc(t,e))}))}catch(e){if(n)return;n=!0,Kc(t,e)}}Oc.prototype.catch=function(e){return this.then(null,e)},Oc.prototype.then=function(e,t){var n=new this.constructor(Tc);return Rc(this,new Yc(e,t,n)),n},Oc.prototype.finally=xc,Oc.all=function(e){return new Oc((function(t,n){if(!Xc(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,c){try{if(c&&("object"==typeof c||"function"==typeof c)){var a=c.then;if("function"==typeof a)return void a.call(c,(function(t){i(e,t)}),n)}r[e]=c,0==--o&&t(r)}catch(e){n(e)}}for(var c=0;c<r.length;c++)i(c,r[c])}))},Oc.allSettled=Cc,Oc.resolve=function(e){return e&&"object"==typeof e&&e.constructor===Oc?e:new Oc((function(t){t(e)}))},Oc.reject=function(e){return new Oc((function(t,n){n(e)}))},Oc.race=function(e){return new Oc((function(t,n){if(!Xc(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)Oc.resolve(e[r]).then(t,n)}))},Oc._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){Lc(e,0)},Oc._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Pc=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")}();"function"!=typeof Pc.Promise?Pc.Promise=Oc:(Pc.Promise.prototype.finally||(Pc.Promise.prototype.finally=xc),Pc.Promise.allSettled||(Pc.Promise.allSettled=Cc)),function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),r=new Uint16Array(n),o=[],i=0;;){var c=t<e.length;if(!c||i>=n-1){var a=r.subarray(0,i);if(o.push(String.fromCharCode.apply(null,a)),!c)return o.join("");e=e.subarray(t),t=0,i=0}var s=e[t++];if(0==(128&s))r[i++]=s;else if(192==(224&s)){var u=63&e[t++];r[i++]=(31&s)<<6|u}else if(224==(240&s)){u=63&e[t++];var l=63&e[t++];r[i++]=(31&s)<<12|u<<6|l}else if(240==(248&s)){var d=(7&s)<<18|(u=63&e[t++])<<12|(l=63&e[t++])<<6|63&e[t++];d>65535&&(d-=65536,r[i++]=d>>>10&1023|55296,d=56320|1023&d),r[i++]=d}}}var n="Failed to ",r=function(e,t,r){if(e)throw new Error("".concat(n).concat(t,": the '").concat(r,"' option is unsupported."))},o="function"==typeof Buffer&&Buffer.from,i=o?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,r=0,o=Math.max(32,n+(n>>>1)+7),i=new Uint8Array(o>>>3<<3);t<n;){var c=e.charCodeAt(t++);if(c>=55296&&c<=56319){if(t<n){var a=e.charCodeAt(t);56320==(64512&a)&&(++t,c=((1023&c)<<10)+(1023&a)+65536)}if(c>=55296&&c<=56319)continue}if(r+4>i.length){o+=8,o=(o*=1+t/e.length*2)>>>3<<3;var s=new Uint8Array(o);s.set(i),i=s}if(0!=(4294967168&c)){if(0==(4294965248&c))i[r++]=c>>>6&31|192;else if(0==(4294901760&c))i[r++]=c>>>12&15|224,i[r++]=c>>>6&63|128;else{if(0!=(4292870144&c))continue;i[r++]=c>>>18&7|240,i[r++]=c>>>12&63|128,i[r++]=c>>>6&63|128}i[r++]=63&c|128}else i[r++]=c}return i.slice?i.slice(0,r):i.subarray(0,r)};function c(){this.encoding="utf-8"}c.prototype.encode=function(e,t){return r(t&&t.stream,"encode","stream"),i(e)};var a=!o&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,s=["utf-8","utf8","unicode-1-1-utf-8"],u=t;o?u=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:a&&(u=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var r=new XMLHttpRequest;return r.open("GET",t,!1),r.send(),r.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var l="construct 'TextDecoder'",d="".concat(n," ").concat(l,": the ");function f(e,t){if(r(t&&t.fatal,l,"fatal"),e=e||"utf-8",!(o?Buffer.isEncoding(e):-1!==s.indexOf(e.toLowerCase())))throw new RangeError("".concat(d," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}f.prototype.decode=function(e,t){var n;return r(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),u(n,this.encoding)},e.TextEncoder=e.TextEncoder||c,e.TextDecoder=e.TextDecoder||f}("undefined"!=typeof window?window:b),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,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&&i(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?c(e):t}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return a(this,n)}}function u(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}function l(e,t,n){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=u(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}},l(e,t,n||e)}var d=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(t,[{key:"addEventListener",value:function(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}},{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].callback===t)return void n.splice(r,1)}},{key:"dispatchEvent",value:function(e){if(e.type in this.listeners){for(var t=this.listeners[e.type].slice(),n=0,r=t.length;n<r;n++){var o=t[n];try{o.callback.call(this,e)}catch(e){Promise.resolve().then((function(){throw e}))}o.options&&o.options.once&&this.removeEventListener(e.type,o.callback)}return!e.defaultPrevented}}}]),t}(),f=function(t){r(a,t);var i=s(a);function a(){var t;return e(this,a),(t=i.call(this)).listeners||d.call(c(t)),Object.defineProperty(c(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(c(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return 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)),l(o(a.prototype),"dispatchEvent",this).call(this,e)}}]),a}(d),p=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new f,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&&(p.prototype[Symbol.toStringTag]="AbortController",f.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=p,e.AbortSignal=f)}("undefined"!=typeof self?self:b)}();var Nc=g((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()}}));v(Nc);var Ec=g((function(e,t){var n=b&&b.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{s(r.next(e))}catch(e){i(e)}}function a(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(c,a)}s((r=r.apply(e,t||[])).next())}))},r=b&&b.__generator||function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)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 c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}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,a])}}};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 a=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(t,a){return void 0===a&&(a=5e3),n(this,void 0,void 0,(function(){var n,s,u,l,d,f;return r(this,(function(r){switch(r.label){case 0:n=Date.now()+c(4),s=Date.now()+a,u=o+"-"+t,l=window.localStorage,r.label=1;case 1:return Date.now()<s?[4,i(30)]:[3,8];case 2:return r.sent(),null!==l.getItem(u)?[3,5]:(d=this.id+"-"+t+"-"+n,[4,i(Math.floor(25*Math.random()))]);case 3:return r.sent(),l.setItem(u,JSON.stringify({id:this.id,iat:n,timeoutKey:d,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,i(30)];case 4:return r.sent(),null!==(f=l.getItem(u))&&(f=JSON.parse(f)).id===this.id&&f.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(u,n),[2,!0]):[3,7];case 5:return e.lockCorrector(),[4,this.waitForSomethingToChange(s)];case 6:r.sent(),r.label=7;case 7:return n=Date.now()+c(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,Nc.default().lock(t)];case 1:return r.sent(),this.acquiredIatSet.has(t)?(n=window.localStorage,null===(o=n.getItem(e))?(Nc.default().unlock(t),[2]):((o=JSON.parse(o)).timeRefreshed=Date.now(),n.setItem(e,JSON.stringify(o)),Nc.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(Nc.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 c(){if(i||(window.removeEventListener("storage",c),e.removeFromWaiting(c),clearTimeout(a),i=!0),!r){r=!0;var t=50-(Date.now()-o);t>0?setTimeout(n,t):n()}}window.addEventListener("storage",c),e.addToWaiting(c);var a=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,c;return r(this,(function(r){switch(r.label){case 0:return n=window.localStorage,i=o+"-"+t,null===(c=n.getItem(i))?[2]:(c=JSON.parse(c)).id!==this.id?[3,2]:[4,Nc.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItem(i),Nc.default().unlock(c.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),i=!1,c=0;c<r.length;c++){var a=r[c];if(a.includes(o)){var s=n.getItem(a);null!==s&&(void 0===(s=JSON.parse(s)).timeRefreshed&&s.timeAcquired<t||void 0!==s.timeRefreshed&&s.timeRefreshed<t)&&(n.removeItem(a),i=!0)}}i&&e.notifyWaiters()},e.waiters=void 0,e}();t.default=a})),Jc=v(Ec),Fc={timeoutInSeconds:60},Uc=["login_required","consent_required","interaction_required","account_selection_required","access_denied"],Ac={name:"auth0-spa-js",version:"1.22.6"},zc=function(){return Date.now()},Dc=function(e){function t(n,r){var o=e.call(this,r)||this;return o.error=n,o.error_description=r,Object.setPrototypeOf(o,t.prototype),o}return l(t,e),t.fromPayload=function(e){return new t(e.error,e.error_description)},t}(Error),Bc=function(e){function t(n,r,o,i){void 0===i&&(i=null);var c=e.call(this,n,r)||this;return c.state=o,c.appState=i,Object.setPrototypeOf(c,t.prototype),c}return l(t,e),t}(Dc),Mc=function(e){function t(){var n=e.call(this,"timeout","Timeout")||this;return Object.setPrototypeOf(n,t.prototype),n}return l(t,e),t}(Dc),Qc=function(e){function t(n){var r=e.call(this)||this;return r.popup=n,Object.setPrototypeOf(r,t.prototype),r}return l(t,e),t}(Mc),qc=function(e){function t(n){var r=e.call(this,"cancelled","Popup closed")||this;return r.popup=n,Object.setPrototypeOf(r,t.prototype),r}return l(t,e),t}(Dc),$c=function(e){function t(n,r,o){var i=e.call(this,n,r)||this;return i.mfa_token=o,Object.setPrototypeOf(i,t.prototype),i}return l(t,e),t}(Dc),ea=function(e){function t(n,r){var o=e.call(this,"missing_refresh_token","Missing Refresh Token (audience: '".concat(la(n,["default"]),"', scope: '").concat(la(r),"')"))||this;return o.audience=n,o.scope=r,Object.setPrototypeOf(o,t.prototype),o}return l(t,e),t}(Dc),ta=function(e){return new Promise((function(t,n){var r,o=setInterval((function(){e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(i),window.removeEventListener("message",r,!1),n(new qc(e.popup)))}),1e3),i=setTimeout((function(){clearInterval(o),n(new Qc(e.popup)),window.removeEventListener("message",r,!1)}),1e3*(e.timeoutInSeconds||60));r=function(c){if(c.data&&"authorization_response"===c.data.type){if(clearTimeout(i),clearInterval(o),window.removeEventListener("message",r,!1),e.popup.close(),c.data.response.error)return n(Dc.fromPayload(c.data.response));t(c.data.response)}},window.addEventListener("message",r)}))},na=function(){return window.crypto||window.msCrypto},ra=function(){var e=na();return e.subtle||e.webkitSubtle},oa=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(na().getRandomValues(new Uint8Array(43))).forEach((function(n){return t+=e[n%e.length]})),t},ia=function(e){return btoa(e)},ca=function(e){return Object.keys(e).filter((function(t){return void 0!==e[t]})).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")},aa=function(e){return p(void 0,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return t=ra().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()]}}))}))},sa=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,"+"))},ua=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,m([],y(Array.from(t)),!1))))};function la(e,t){return void 0===t&&(t=[]),e&&!t.includes(e)?e:""}var da=function(e,t){return p(void 0,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return[4,(i=e,c=t,c=c||{},new Promise((function(e,t){var n=new XMLHttpRequest,r=[],o=[],a={},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(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:s,headers:{keys:function(){return r},entries:function(){return o},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in n.open(c.method||"get",i,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){r.push(t=t.toLowerCase()),o.push([t,n]),a[t]=a[t]?a[t]+","+n:n})),e(s())},n.onerror=t,n.withCredentials="include"==c.credentials,c.headers)n.setRequestHeader(u,c.headers[u]);n.send(c.body||null)})))];case 1:return n=o.sent(),r={ok:n.ok},[4,n.json()];case 2:return[2,(r.json=o.sent(),r)]}var i,c}))}))},fa=function(e,t,n){return p(void 0,void 0,void 0,(function(){var r,o;return h(this,(function(i){return r=new AbortController,t.signal=r.signal,[2,Promise.race([da(e,t),new Promise((function(e,t){o=setTimeout((function(){r.abort(),t(new Error("Timeout when executing 'fetch'"))}),n)}))]).finally((function(){clearTimeout(o)}))]}))}))},pa=function(e,t,n,r,o,i,c){return p(void 0,void 0,void 0,(function(){return h(this,(function(a){return[2,(s={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:c},u=i,new Promise((function(e,t){var n=new MessageChannel;n.port1.onmessage=function(r){r.data.error?t(new Error(r.data.error)):e(r.data),n.port1.close()},u.postMessage(s,[n.port2])})))];var s,u}))}))},ha=function(e,t,n,r,o,i,c){return void 0===c&&(c=1e4),p(void 0,void 0,void 0,(function(){return h(this,(function(a){return o?[2,pa(e,t,n,r,c,o,i)]:[2,fa(e,r,c)]}))}))};function ya(e,t,n,r,o,i,c){return p(this,void 0,void 0,(function(){var a,s,u,l,d,p,y,m,b;return h(this,(function(h){switch(h.label){case 0:a=null,u=0,h.label=1;case 1:if(!(u<3))return[3,6];h.label=2;case 2:return h.trys.push([2,4,,5]),[4,ha(e,n,r,o,i,c,t)];case 3:return s=h.sent(),a=null,[3,6];case 4:return l=h.sent(),a=l,[3,5];case 5:return u++,[3,1];case 6:if(a)throw a.message=a.message||"Failed to fetch",a;if(d=s.json,p=d.error,y=d.error_description,m=f(d,["error","error_description"]),!s.ok){if(b=y||"HTTP error. Unable to fetch ".concat(e),"mfa_required"===p)throw new $c(p,b,m.mfa_token);throw new Dc(p||"request_error",b)}return[2,m]}}))}))}function ma(e,t){var n=e.baseUrl,r=e.timeout,o=e.audience,i=e.scope,c=e.auth0Client,a=e.useFormData,s=f(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);return p(this,void 0,void 0,(function(){var e;return h(this,(function(u){switch(u.label){case 0:return e=a?ca(s):JSON.stringify(s),[4,ya("".concat(n,"/oauth/token"),r,o||"default",i,{method:"POST",body:e,headers:{"Content-Type":a?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(c||Ac))}},t,a)];case 1:return[2,u.sent()]}}))}))}var ba=function(e){return Array.from(new Set(e))},va=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ba(e.join(" ").trim().split(/\s+/)).join(" ")},ga=function(){function e(e,t){void 0===t&&(t="@@auth0spajs@@"),this.prefix=t,this.client_id=e.client_id,this.scope=e.scope,this.audience=e.audience}return e.prototype.toKey=function(){return"".concat(this.prefix,"::").concat(this.client_id,"::").concat(this.audience,"::").concat(this.scope)},e.fromKey=function(t){var n=y(t.split("::"),4),r=n[0],o=n[1],i=n[2];return new e({client_id:o,scope:n[3],audience:i},r)},e.fromCacheEntry=function(t){return new e({scope:t.scope,audience:t.audience,client_id:t.client_id})},e}(),wa=function(){function e(){}return e.prototype.set=function(e,t){localStorage.setItem(e,JSON.stringify(t))},e.prototype.get=function(e){var t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}},e.prototype.remove=function(e){localStorage.removeItem(e)},e.prototype.allKeys=function(){return Object.keys(window.localStorage).filter((function(e){return e.startsWith("@@auth0spajs@@")}))},e}(),Sa=function(){var e;this.enclosedCache=(e={},{set:function(t,n){e[t]=n},get:function(t){var n=e[t];if(n)return n},remove:function(t){delete e[t]},allKeys:function(){return Object.keys(e)}})},ka=function(){function e(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n,this.nowProvider=this.nowProvider||zc}return e.prototype.get=function(e,t){var n;return void 0===t&&(t=0),p(this,void 0,void 0,(function(){var r,o,i,c,a;return h(this,(function(s){switch(s.label){case 0:return[4,this.cache.get(e.toKey())];case 1:return(r=s.sent())?[3,4]:[4,this.getCacheKeys()];case 2:return(o=s.sent())?(i=this.matchExistingCacheKey(e,o))?[4,this.cache.get(i)]:[3,4]:[2];case 3:r=s.sent(),s.label=4;case 4:return r?[4,this.nowProvider()]:[2];case 5:return c=s.sent(),a=Math.floor(c/1e3),r.expiresAt-t<a?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},[4,this.cache.set(e.toKey(),r)]):[3,7]:[3,10];case 6:return s.sent(),[2,r.body];case 7:return[4,this.cache.remove(e.toKey())];case 8:return s.sent(),[4,null===(n=this.keyManifest)||void 0===n?void 0:n.remove(e.toKey())];case 9:return s.sent(),[2];case 10:return[2,r.body]}}))}))},e.prototype.set=function(e){var t;return p(this,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return n=new ga({client_id:e.client_id,scope:e.scope,audience:e.audience}),[4,this.wrapCacheEntry(e)];case 1:return r=o.sent(),[4,this.cache.set(n.toKey(),r)];case 2:return o.sent(),[4,null===(t=this.keyManifest)||void 0===t?void 0:t.add(n.toKey())];case 3:return o.sent(),[2]}}))}))},e.prototype.clear=function(e){var t;return p(this,void 0,void 0,(function(){var n,r=this;return h(this,(function(o){switch(o.label){case 0:return[4,this.getCacheKeys()];case 1:return(n=o.sent())?[4,n.filter((function(t){return!e||t.includes(e)})).reduce((function(e,t){return p(r,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return n.sent(),[4,this.cache.remove(t)];case 2:return n.sent(),[2]}}))}))}),Promise.resolve())]:[2];case 2:return o.sent(),[4,null===(t=this.keyManifest)||void 0===t?void 0:t.clear()];case 3:return o.sent(),[2]}}))}))},e.prototype.clearSync=function(e){var t=this,n=this.cache.allKeys();n&&n.filter((function(t){return!e||t.includes(e)})).forEach((function(e){t.cache.remove(e)}))},e.prototype.wrapCacheEntry=function(e){return p(this,void 0,void 0,(function(){var t,n,r;return h(this,(function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return t=o.sent(),n=Math.floor(t/1e3)+e.expires_in,r=Math.min(n,e.decodedToken.claims.exp),[2,{body:e,expiresAt:r}]}}))}))},e.prototype.getCacheKeys=function(){var e;return p(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return this.keyManifest?[4,this.keyManifest.get()]:[3,2];case 1:return t=null===(e=n.sent())||void 0===e?void 0:e.keys,[3,4];case 2:return[4,this.cache.allKeys()];case 3:t=n.sent(),n.label=4;case 4:return[2,t]}}))}))},e.prototype.matchExistingCacheKey=function(e,t){return t.filter((function(t){var n=ga.fromKey(t),r=new Set(n.scope&&n.scope.split(" ")),o=e.scope.split(" "),i=n.scope&&o.reduce((function(e,t){return e&&r.has(t)}),!0);return"@@auth0spajs@@"===n.prefix&&n.client_id===e.client_id&&n.audience===e.audience&&i}))[0]},e}(),Ia=function(){function e(e,t){this.storage=e,this.clientId=t,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId),this.transaction=this.storage.get(this.storageKey)}return e.prototype.create=function(e){this.transaction=e,this.storage.save(this.storageKey,e,{daysUntilExpire:1})},e.prototype.get=function(){return this.transaction},e.prototype.remove=function(){delete this.transaction,this.storage.remove(this.storageKey)},e}(),Za=function(e){return"number"==typeof e},Wa=["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"],_a=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(e){var t=e.split("."),n=y(t,3),r=n[0],o=n[1],i=n[2];if(3!==t.length||!r||!o||!i)throw new Error("ID token could not be decoded");var c=JSON.parse(sa(o)),a={__raw:e},s={};return Object.keys(c).forEach((function(e){a[e]=c[e],Wa.includes(e)||(s[e]=c[e])})),{encoded:{header:r,payload:o,signature:i},header:JSON.parse(sa(r)),claims:a,user:s}}(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 "'.concat(e.iss,'", found "').concat(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 "'.concat(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 "'.concat(e.aud,'" but was not one of "').concat(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 "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(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 "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Za(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(!Za(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Za(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(e.now||Date.now()),o=new Date(0),i=new Date(0),c=new Date(0);if(c.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+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 (".concat(r,") is after expiration time (").concat(o,")"));if(Za(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 (".concat(r,") is before ").concat(i));if(Za(t.claims.auth_time)&&r>c)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 (".concat(r,") is after last auth at ").concat(c));if(e.organizationId){if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e.organizationId!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(e.organizationId,'", found "').concat(t.claims.org_id,'"'))}return t},Ga=g((function(e,t){var n=b&&b.__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},n.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("="),c=i.slice(1).join("=");'"'===c.charAt(0)&&(c=c.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=c.replace(r,decodeURIComponent)}catch(e){}}return t}function c(){return i(document.cookie)}function a(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=a,t.remove=function(e,t){a(e,"",n(n({},t),{expires:-1}))}}));v(Ga),Ga.encode,Ga.parse,Ga.getAll;var xa=Ga.get,Ca=Ga.set,La=Ga.remove,Xa={get:function(e){var t=xa(e);if(void 0!==t)return JSON.parse(t)},save:function(e,t,n){var r={};"https:"===window.location.protocol&&(r={secure:!0,sameSite:"none"}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),Ca(e,JSON.stringify(t),r)},remove:function(e,t){var n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),La(e,n)}},Ta={get:function(e){return Xa.get(e)||Xa.get("".concat("_legacy_").concat(e))},save:function(e,t,n){var r={};"https:"===window.location.protocol&&(r={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),Ca("".concat("_legacy_").concat(e),JSON.stringify(t),r),Xa.save(e,t,n)},remove:function(e,t){var n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),La(e,n),Xa.remove(e,t),Xa.remove("".concat("_legacy_").concat(e),t)}},Oa={get:function(e){if("undefined"!=typeof sessionStorage){var t=sessionStorage.getItem(e);if(void 0!==t)return JSON.parse(t)}},save:function(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove:function(e){sessionStorage.removeItem(e)}};var Ra,ja=("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIHQ9ZnVuY3Rpb24oZSxyKXtyZXR1cm4gdD1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxlKXt0Ll9fcHJvdG9fXz1lfXx8ZnVuY3Rpb24odCxlKXtmb3IodmFyIHIgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxyKSYmKHRbcl09ZVtyXSl9LHQoZSxyKX07ZnVuY3Rpb24gZShlLHIpe2lmKCJmdW5jdGlvbiIhPXR5cGVvZiByJiZudWxsIT09cil0aHJvdyBuZXcgVHlwZUVycm9yKCJDbGFzcyBleHRlbmRz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0Q29udHJvbGxlcixsLnNpZ25hbD1kLnNpZ25hbCksdz12b2lkIDAsby5sYWJlbD0yO2Nhc2UgMjpyZXR1cm4gby50cnlzLnB1c2goWzIsNCwsNV0pLFs0LFByb21pc2UucmFjZShbKGc9YyxuZXcgUHJvbWlzZSgoZnVuY3Rpb24odCl7cmV0dXJuIHNldFRpbWVvdXQodCxnKX0pKSksZmV0Y2goZixyKHt9LGwpKV0pXTtjYXNlIDM6cmV0dXJuIHc9by5zZW50KCksWzMsNV07Y2FzZSA0OnJldHVybiBPPW8uc2VudCgpLGgucG9zdE1lc3NhZ2Uoe2Vycm9yOk8ubWVzc2FnZX0pLFsyXTtjYXNlIDU6cmV0dXJuIHc/WzQsdy5qc29uKCldOihkJiZkLmFib3J0KCksaC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KSxbMl0pO2Nhc2UgNjpyZXR1cm4odD1vLnNlbnQoKSkucmVmcmVzaF90b2tlbj8oZnVuY3Rpb24odCxlLHIpe3NbdShlLHIpXT10fSh0LnJlZnJlc2hfdG9rZW4sbix5KSxkZWxldGUgdC5yZWZyZXNoX3Rva2VuKTpmdW5jdGlvbih0LGUpe2RlbGV0ZSBzW3UodCxlKV19KG4seSksaC5wb3N0TWVzc2FnZSh7b2s6dy5vayxqc29uOnR9KSxbMyw4XTtjYXNlIDc6cmV0dXJuIF89by5zZW50KCksaC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3JfZGVzY3JpcHRpb246Xy5tZXNzYWdlfX0pLFszLDhdO2Nhc2UgODpyZXR1cm5bMl19dmFyIGcsbSxrLFB9KSl9KSl9KSl9KCk7Cgo=",null,!1,function(e){return Ra=Ra||function(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),i=o.indexOf("\n",10)+1,c=o.substring(i)+(r?"//# sourceMappingURL="+r:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIHQ9ZnVuY3Rpb24oZSxyKXtyZXR1cm4gdD1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxlKXt0Ll9fcHJvdG9fXz1lfXx8ZnVuY3Rpb24odCxlKXtmb3IodmFyIHIgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxyKSYmKHRbcl09ZVtyXSl9LHQoZSxyKX07ZnVuY3Rpb24gZShlLHIpe2lmKCJmdW5jdGlvbiIhPXR5cGVvZiByJiZudWxsIT09cil0aHJvdyBuZXcgVHlwZUVycm9yKCJDbGFzcyBleHRlbmRzIHZhbHVlICIrU3RyaW5nKHIpKyIgaXMgbm90IGEgY29uc3RydWN0b3Igb3IgbnVsbCIpO2Z1bmN0aW9uIG4oKXt0aGlzLmNvbnN0cnVjdG9yPWV9dChlLHIpLGUucHJvdG90eXBlPW51bGw9PT1yP09iamVjdC5jcmVhdGUocik6KG4ucHJvdG90eXBlPXIucHJvdG90eXBlLG5ldyBuKX12YXIgcj1mdW5jdGlvbigpe3JldHVybiByPU9iamVjdC5hc3NpZ258fGZ1bmN0aW9uKHQpe2Zvcih2YXIgZSxyPTEsbj1hcmd1bWVudHMubGVuZ3RoO3I8bjtyKyspZm9yKHZhciBvIGluIGU9YXJndW1lbnRzW3JdKU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChlLG8pJiYodFtvXT1lW29dKTtyZXR1cm4gdH0sci5hcHBseSh0aGlzLGFyZ3VtZW50cyl9O2Z1bmN0aW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Ml0pO2Nhc2UgNjpyZXR1cm4odD1vLnNlbnQoKSkucmVmcmVzaF90b2tlbj8oZnVuY3Rpb24odCxlLHIpe3NbdShlLHIpXT10fSh0LnJlZnJlc2hfdG9rZW4sbix5KSxkZWxldGUgdC5yZWZyZXNoX3Rva2VuKTpmdW5jdGlvbih0LGUpe2RlbGV0ZSBzW3UodCxlKV19KG4seSksaC5wb3N0TWVzc2FnZSh7b2s6dy5vayxqc29uOnR9KSxbMyw4XTtjYXNlIDc6cmV0dXJuIF89by5zZW50KCksaC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3JfZGVzY3JpcHRpb246Xy5tZXNzYWdlfX0pLFszLDhdO2Nhc2UgODpyZXR1cm5bMl19dmFyIGcsbSxrLFB9KSl9KSl9KSl9KCk7Cgo=",null,false),new Worker(Ra,e)}),Ka={},Ha=function(){function e(e,t){this.cache=e,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId)}return e.prototype.add=function(e){var t;return p(this,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return r=Set.bind,[4,this.cache.get(this.manifestKey)];case 1:return(n=new(r.apply(Set,[void 0,(null===(t=o.sent())||void 0===t?void 0:t.keys)||[]]))).add(e),[4,this.cache.set(this.manifestKey,{keys:m([],y(n),!1)})];case 2:return o.sent(),[2]}}))}))},e.prototype.remove=function(e){return p(this,void 0,void 0,(function(){var t,n;return h(this,(function(r){switch(r.label){case 0:return[4,this.cache.get(this.manifestKey)];case 1:return(t=r.sent())?((n=new Set(t.keys)).delete(e),n.size>0?[4,this.cache.set(this.manifestKey,{keys:m([],y(n),!1)})]:[3,3]):[3,5];case 2:case 4:return[2,r.sent()];case 3:return[4,this.cache.remove(this.manifestKey)];case 5:return[2]}}))}))},e.prototype.get=function(){return this.cache.get(this.manifestKey)},e.prototype.clear=function(){return this.cache.remove(this.manifestKey)},e.prototype.createManifestKeyFrom=function(e){return"".concat("@@auth0spajs@@","::").concat(e)},e}(),Ya=new Jc,Va={memory:function(){return(new Sa).enclosedCache},localstorage:function(){return new wa}},Pa=function(e){return Va[e]},Na=function(){function e(e){var t,n,r,o,i=this;if(this.options=e,this._releaseLockOnPageHide=function(){return p(i,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,Ya.releaseLock("auth0.lock.getTokenSilently")];case 1:return e.sent(),window.removeEventListener("pagehide",this._releaseLockOnPageHide),[2]}}))}))},"undefined"!=typeof window&&function(){if(!na())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===ra())throw new Error("\n auth0-spa-js must run on a secure origin. 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 for more information.\n ")}(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)r=e.cache;else{if(this.cacheLocation=e.cacheLocation||"memory",!Pa(this.cacheLocation))throw new Error('Invalid cache location "'.concat(this.cacheLocation,'"'));r=Pa(this.cacheLocation)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?Xa:Ta,this.orgHintCookieName=(o=this.options.client_id,"auth0.".concat(o,".organization_hint")),this.isAuthenticatedCookieName=function(e){return"auth0.".concat(e,".is.authenticated")}(this.options.client_id),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;var c,a=e.useCookiesForTransactions?this.cookieStorage:Oa;this.scope=this.options.scope,this.transactionManager=new Ia(a,this.options.client_id),this.nowProvider=this.options.nowProvider||zc,this.cacheManager=new ka(r,r.allKeys?null:new Ha(r,this.options.client_id),this.nowProvider),this.domainUrl=(c=this.options.domain,/^https?:\/\//.test(c)?c:"https://".concat(c)),this.tokenIssuer=function(e,t){return e?e.startsWith("https://")?e:"https://".concat(e,"/"):"".concat(t,"/")}(this.options.issuer,this.domainUrl),this.defaultScope=va("openid",void 0!==(null===(n=null===(t=this.options)||void 0===t?void 0:t.advancedOptions)||void 0===n?void 0:n.defaultScope)?this.options.advancedOptions.defaultScope:"openid profile email"),this.options.useRefreshTokens&&(this.scope=va(this.scope,"offline_access")),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===this.cacheLocation&&!/Trident.*rv:11\.0/.test(navigator.userAgent)&&(this.worker=new ja),this.customOptions=function(e){return e.advancedOptions,e.audience,e.auth0Client,e.authorizeTimeoutInSeconds,e.cacheLocation,e.cache,e.client_id,e.domain,e.issuer,e.leeway,e.max_age,e.nowProvider,e.redirect_uri,e.scope,e.useRefreshTokens,e.useRefreshTokensFallback,e.useCookiesForTransactions,e.useFormData,f(e,["advancedOptions","audience","auth0Client","authorizeTimeoutInSeconds","cacheLocation","cache","client_id","domain","issuer","leeway","max_age","nowProvider","redirect_uri","scope","useRefreshTokens","useRefreshTokensFallback","useCookiesForTransactions","useFormData"])}(e),this.useRefreshTokensFallback=!1!==this.options.useRefreshTokensFallback}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Ac)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(t)},e.prototype._getParams=function(e,t,n,r,o){var i=this.options;i.useRefreshTokens,i.useCookiesForTransactions,i.useFormData,i.auth0Client,i.cacheLocation,i.advancedOptions,i.detailedResponse,i.nowProvider,i.authorizeTimeoutInSeconds,i.legacySameSiteCookie,i.sessionCheckExpiryDays,i.domain,i.leeway,i.httpTimeoutInSeconds;var c=f(i,["useRefreshTokens","useCookiesForTransactions","useFormData","auth0Client","cacheLocation","advancedOptions","detailedResponse","nowProvider","authorizeTimeoutInSeconds","legacySameSiteCookie","sessionCheckExpiryDays","domain","leeway","httpTimeoutInSeconds"]);return d(d(d({},c),e),{scope:va(this.defaultScope,this.scope,e.scope),response_type:"code",response_mode:"query",state:t,nonce:n,redirect_uri:o||this.options.redirect_uri,code_challenge:r,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(e){return this._url("/authorize?".concat(ca(e)))},e.prototype._verifyIdToken=function(e,t,n){return p(this,void 0,void 0,(function(){var r;return h(this,(function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return r=o.sent(),[2,_a({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,organizationId:n,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age),now:r})]}}))}))},e.prototype._parseNumber=function(e){return"string"!=typeof e?e:parseInt(e,10)||void 0},e.prototype._processOrgIdHint=function(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})},e.prototype.buildAuthorizeUrl=function(e){return void 0===e&&(e={}),p(this,void 0,void 0,(function(){var t,n,r,o,i,c,a,s,u,l,p,y;return h(this,(function(h){switch(h.label){case 0:return t=e.redirect_uri,n=e.appState,r=f(e,["redirect_uri","appState"]),o=ia(oa()),i=ia(oa()),c=oa(),[4,aa(c)];case 1:return a=h.sent(),s=ua(a),u=e.fragment?"#".concat(e.fragment):"",l=this._getParams(r,o,i,s,t),p=this._authorizeUrl(l),y=e.organization||this.options.organization,this.transactionManager.create(d({nonce:i,code_verifier:c,appState:n,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:o},y&&{organizationId:y})),[2,p+u]}}))}))},e.prototype.loginWithPopup=function(e,t){return p(this,void 0,void 0,(function(){var n,r,o,i,c,a,s,u,l,p,y,m,b;return h(this,(function(h){switch(h.label){case 0:if(e=e||{},!(t=t||{}).popup&&(t.popup=function(e){var t=window.screenX+(window.innerWidth-400)/2,n=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup","left=".concat(t,",top=").concat(n,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))}(),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");return n=f(e,[]),r=ia(oa()),o=ia(oa()),i=oa(),[4,aa(i)];case 1:return c=h.sent(),a=ua(c),s=this._getParams(n,r,o,a,this.options.redirect_uri||window.location.origin),u=this._authorizeUrl(d(d({},s),{response_mode:"web_message"})),t.popup.location.href=u,[4,ta(d(d({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(l=h.sent(),r!==l.state)throw new Error("Invalid state");return[4,ma({audience:s.audience,scope:s.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:i,code:l.code,grant_type:"authorization_code",redirect_uri:s.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},this.worker)];case 3:return p=h.sent(),y=e.organization||this.options.organization,[4,this._verifyIdToken(p.id_token,o,y)];case 4:return m=h.sent(),b=d(d({},p),{decodedToken:m,scope:s.scope,audience:s.audience||"default",client_id:this.options.client_id}),[4,this.cacheManager.set(b)];case 5:return h.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(m.claims.org_id),[2]}}))}))},e.prototype.getUser=function(e){return void 0===e&&(e={}),p(this,void 0,void 0,(function(){var t,n,r;return h(this,(function(o){switch(o.label){case 0:return t=e.audience||this.options.audience||"default",n=va(this.defaultScope,this.scope,e.scope),[4,this.cacheManager.get(new ga({client_id:this.options.client_id,audience:t,scope:n}))];case 1:return[2,(r=o.sent())&&r.decodedToken&&r.decodedToken.user]}}))}))},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={}),p(this,void 0,void 0,(function(){var t,n,r;return h(this,(function(o){switch(o.label){case 0:return t=e.audience||this.options.audience||"default",n=va(this.defaultScope,this.scope,e.scope),[4,this.cacheManager.get(new ga({client_id:this.options.client_id,audience:t,scope:n}))];case 1:return[2,(r=o.sent())&&r.decodedToken&&r.decodedToken.claims]}}))}))},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),p(this,void 0,void 0,(function(){var t,n,r;return h(this,(function(o){switch(o.label){case 0:return t=e.redirectMethod,n=f(e,["redirectMethod"]),[4,this.buildAuthorizeUrl(n)];case 1:return r=o.sent(),window.location[t||"assign"](r),[2]}}))}))},e.prototype.handleRedirectCallback=function(e){return void 0===e&&(e=window.location.href),p(this,void 0,void 0,(function(){var t,n,r,o,i,c,a,s,u,l;return h(this,(function(f){switch(f.label){case 0:if(0===(t=e.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(n=function(e){e.indexOf("#")>-1&&(e=e.substr(0,e.indexOf("#")));var t=e.split("&"),n={};return t.forEach((function(e){var t=y(e.split("="),2),r=t[0],o=t[1];n[r]=decodeURIComponent(o)})),n.expires_in&&(n.expires_in=parseInt(n.expires_in)),n}(t.join("")),r=n.state,o=n.code,i=n.error,c=n.error_description,!(a=this.transactionManager.get()))throw new Error("Invalid state");if(this.transactionManager.remove(),i)throw new Bc(i,c,r,a.appState);if(!a.code_verifier||a.state&&a.state!==r)throw new Error("Invalid state");return s={audience:a.audience,scope:a.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:a.code_verifier,grant_type:"authorization_code",code:o,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},void 0!==a.redirect_uri&&(s.redirect_uri=a.redirect_uri),[4,ma(s,this.worker)];case 1:return u=f.sent(),[4,this._verifyIdToken(u.id_token,a.nonce,a.organizationId)];case 2:return l=f.sent(),[4,this.cacheManager.set(d(d(d(d({},u),{decodedToken:l,audience:a.audience,scope:a.scope}),u.scope?{oauthTokenScope:u.scope}:null),{client_id:this.options.client_id}))];case 3:return f.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(l.claims.org_id),[2,{appState:a.appState}]}}))}))},e.prototype.checkSession=function(e){return p(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return[2];this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.getTokenSilently(e)];case 2:return n.sent(),[3,4];case 3:if(t=n.sent(),!Uc.includes(t.error))throw t;return[3,4];case 4:return[2]}}))}))},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={}),p(this,void 0,void 0,(function(){var t,n,r,o,i=this;return h(this,(function(c){switch(c.label){case 0:return t=d(d({audience:this.options.audience,ignoreCache:!1},e),{scope:va(this.defaultScope,this.scope,e.scope)}),n=t.ignoreCache,r=f(t,["ignoreCache"]),[4,(a=function(){return i._getTokenSilently(d({ignoreCache:n},r))},s="".concat(this.options.client_id,"::").concat(r.audience,"::").concat(r.scope),u=Ka[s],u||(u=a().finally((function(){delete Ka[s],u=null})),Ka[s]=u),u)];case 1:return o=c.sent(),[2,e.detailedResponse?o:o.access_token]}var a,s,u}))}))},e.prototype._getTokenSilently=function(e){return void 0===e&&(e={}),p(this,void 0,void 0,(function(){var t,n,r,o,i,c,a,s,u;return h(this,(function(l){switch(l.label){case 0:return t=e.ignoreCache,n=f(e,["ignoreCache"]),t?[3,2]:[4,this._getEntryFromCache({scope:n.scope,audience:n.audience||"default",client_id:this.options.client_id})];case 1:if(r=l.sent())return[2,r];l.label=2;case 2:return[4,(y=function(){return Ya.acquireLock("auth0.lock.getTokenSilently",5e3)},m=10,void 0===m&&(m=3),p(void 0,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<m?[4,y()]:[3,4];case 2:if(t.sent())return[2,!0];t.label=3;case 3:return e++,[3,1];case 4:return[2,!1]}}))})))];case 3:if(!l.sent())return[3,15];l.label=4;case 4:return l.trys.push([4,,12,14]),window.addEventListener("pagehide",this._releaseLockOnPageHide),t?[3,6]:[4,this._getEntryFromCache({scope:n.scope,audience:n.audience||"default",client_id:this.options.client_id})];case 5:if(r=l.sent())return[2,r];l.label=6;case 6:return this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(n)]:[3,8];case 7:return i=l.sent(),[3,10];case 8:return[4,this._getTokenFromIFrame(n)];case 9:i=l.sent(),l.label=10;case 10:return o=i,[4,this.cacheManager.set(d({client_id:this.options.client_id},o))];case 11:return l.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),c=o.id_token,a=o.access_token,s=o.oauthTokenScope,u=o.expires_in,[2,d(d({id_token:c,access_token:a},s?{scope:s}:null),{expires_in:u})];case 12:return[4,Ya.releaseLock("auth0.lock.getTokenSilently")];case 13:return l.sent(),window.removeEventListener("pagehide",this._releaseLockOnPageHide),[7];case 14:return[3,16];case 15:throw new Mc;case 16:return[2]}var y,m}))}))},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),p(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return e.audience=e.audience||this.options.audience,e.scope=va(this.defaultScope,this.scope,e.scope),t=d(d({},Fc),t),[4,this.loginWithPopup(e,t)];case 1:return n.sent(),[4,this.cacheManager.get(new ga({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}))];case 2:return[2,n.sent().access_token]}}))}))},e.prototype.isAuthenticated=function(){return p(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.getUser()];case 1:return[2,!!e.sent()]}}))}))},e.prototype.buildLogoutUrl=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=f(e,["federated"]),r=t?"&federated":"";return this._url("/v2/logout?".concat(ca(n)))+r},e.prototype.logout=function(e){var t=this;void 0===e&&(e={});var n=e.localOnly,r=f(e,["localOnly"]);if(n&&r.federated)throw new Error("It is invalid to set both the `federated` and `localOnly` options to `true`");var o=function(){if(t.cookieStorage.remove(t.orgHintCookieName,{cookieDomain:t.options.cookieDomain}),t.cookieStorage.remove(t.isAuthenticatedCookieName,{cookieDomain:t.options.cookieDomain}),!n){var e=t.buildLogoutUrl(r);window.location.assign(e)}};if(this.options.cache)return this.cacheManager.clear().then((function(){return o()}));this.cacheManager.clearSync(),o()},e.prototype._getTokenFromIFrame=function(e){return p(this,void 0,void 0,(function(){var t,n,r,o,i,c,a,s,u,l,p,y,m,b,v,g,w;return h(this,(function(h){switch(h.label){case 0:return t=ia(oa()),n=ia(oa()),r=oa(),[4,aa(r)];case 1:o=h.sent(),i=ua(o),c=f(e,["detailedResponse"]),a=this._getParams(c,t,n,i,e.redirect_uri||this.options.redirect_uri||window.location.origin),(s=this.cookieStorage.get(this.orgHintCookieName))&&!a.organization&&(a.organization=s),u=this._authorizeUrl(d(d({},a),{prompt:"none",response_mode:"web_message"})),h.label=2;case 2:if(h.trys.push([2,6,,7]),window.crossOriginIsolated)throw new Dc("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");return l=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,(S=u,k=this.domainUrl,I=l,void 0===I&&(I=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,o=function(){window.document.body.contains(n)&&(window.document.body.removeChild(n),window.removeEventListener("message",r,!1))},i=setTimeout((function(){t(new Mc),o()}),1e3*I);r=function(n){if(n.origin==k&&n.data&&"authorization_response"===n.data.type){var c=n.source;c&&c.close(),n.data.response.error?t(Dc.fromPayload(n.data.response)):e(n.data.response),clearTimeout(i),window.removeEventListener("message",r,!1),setTimeout(o,2e3)}},window.addEventListener("message",r,!1),window.document.body.appendChild(n),n.setAttribute("src",S)})))];case 3:if(p=h.sent(),t!==p.state)throw new Error("Invalid state");return y=e.scope,m=e.audience,b=f(e,["scope","audience","redirect_uri","ignoreCache","timeoutInSeconds","detailedResponse"]),[4,ma(d(d(d({},this.customOptions),b),{scope:y,audience:m,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:r,code:p.code,grant_type:"authorization_code",redirect_uri:a.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:b.timeout||this.httpTimeoutMs}),this.worker)];case 4:return v=h.sent(),[4,this._verifyIdToken(v.id_token,n)];case 5:return g=h.sent(),this._processOrgIdHint(g.claims.org_id),[2,d(d({},v),{decodedToken:g,scope:a.scope,oauthTokenScope:v.scope,audience:a.audience||"default"})];case 6:throw"login_required"===(w=h.sent()).error&&this.logout({localOnly:!0}),w;case 7:return[2]}var S,k,I}))}))},e.prototype._getTokenUsingRefreshToken=function(e){return p(this,void 0,void 0,(function(){var t,n,r,o,i,c,a,s,u;return h(this,(function(l){switch(l.label){case 0:return e.scope=va(this.defaultScope,this.options.scope,e.scope),[4,this.cacheManager.get(new ga({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}))];case 1:return(t=l.sent())&&t.refresh_token||this.worker?[3,4]:this.useRefreshTokensFallback?[4,this._getTokenFromIFrame(e)]:[3,3];case 2:return[2,l.sent()];case 3:throw new ea(e.audience||"default",e.scope);case 4:n=e.redirect_uri||this.options.redirect_uri||window.location.origin,o=e.scope,i=e.audience,c=f(e,["scope","audience","ignoreCache","timeoutInSeconds","detailedResponse"]),a="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,l.label=5;case 5:return l.trys.push([5,7,,10]),[4,ma(d(d(d(d(d({},this.customOptions),c),{audience:i,scope:o,baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),a&&{timeout:a}),{auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs}),this.worker)];case 6:return r=l.sent(),[3,10];case 7:return((s=l.sent()).message.indexOf("Missing Refresh Token")>-1||s.message&&s.message.indexOf("invalid refresh token")>-1)&&this.useRefreshTokensFallback?[4,this._getTokenFromIFrame(e)]:[3,9];case 8:return[2,l.sent()];case 9:throw s;case 10:return[4,this._verifyIdToken(r.id_token)];case 11:return u=l.sent(),[2,d(d({},r),{decodedToken:u,scope:e.scope,oauthTokenScope:r.scope,audience:e.audience||"default"})]}}))}))},e.prototype._getEntryFromCache=function(e){var t=e.scope,n=e.audience,r=e.client_id;return p(this,void 0,void 0,(function(){var e,o,i,c,a;return h(this,(function(s){switch(s.label){case 0:return[4,this.cacheManager.get(new ga({scope:t,audience:n,client_id:r}),60)];case 1:return(e=s.sent())&&e.access_token?(o=e.id_token,i=e.access_token,c=e.oauthTokenScope,a=e.expires_in,[2,d(d({id_token:o,access_token:i},c?{scope:c}:null),{expires_in:a})]):[2]}}))}))},e}(),Ea={isAuthenticated:!1,isLoading:!0},Ja=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},Fa=i(i({},Ea),{buildAuthorizeUrl:Ja,buildLogoutUrl:Ja,getAccessTokenSilently:Ja,getAccessTokenWithPopup:Ja,getIdTokenClaims:Ja,loginWithRedirect:Ja,loginWithPopup:Ja,logout:Ja,handleRedirectCallback:Ja}),Ua=t.createContext(Fa),Aa=function(e){function t(n,r){var o=e.call(this,r||n)||this;return o.error=n,o.error_description=r,Object.setPrototypeOf(o,t.prototype),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),za=/[?&]code=[^&]+/,Da=/[?&]state=[^&]+/,Ba=/[?&]error=[^&]+/,Ma=function(e){return function(t){return"error"in t?new Aa(t.error,t.error_description):t instanceof Error?t:new Error(e)}},Qa=Ma("Login failed"),qa=Ma("Get access token failed"),$a=function(e,t){var n,r;switch(t.type){case"LOGIN_POPUP_STARTED":return i(i({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return i(i({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return(null===(n=e.user)||void 0===n?void 0:n.updated_at)===(null===(r=t.user)||void 0===r?void 0:r.updated_at)?e:i(i({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return i(i({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return i(i({},e),{isLoading:!1,error:t.error})}},es=function(e){if(e){var t=e.redirectUri,n=c(e,["redirectUri"]);return i(i({},n),{redirect_uri:t})}},ts=function(e){window.history.replaceState({},document.title,(null==e?void 0:e.returnTo)||window.location.pathname)},ns=function(e){return void 0===e&&(e=Ua),t.useContext(e)},rs=function(){return r.default.createElement(r.default.Fragment,null)},os=function(){return"".concat(window.location.pathname).concat(window.location.search)};e.Auth0Context=Ua,e.Auth0Provider=function(e){var n=e.children,o=e.skipRedirectCallback,u=e.onRedirectCallback,l=void 0===u?ts:u,d=e.context,f=void 0===d?Ua:d,p=c(e,["children","skipRedirectCallback","onRedirectCallback","context"]),h=t.useState((function(){return new Na(function(e){var t=e.clientId,n=e.redirectUri,r=e.maxAge,o=c(e,["clientId","redirectUri","maxAge"]);return i(i({},o),{client_id:t,redirect_uri:n,max_age:r,auth0Client:{name:"auth0-react",version:"1.12.1"}})}(p))}))[0],y=t.useReducer($a,Ea),m=y[0],b=y[1],v=t.useRef(!1);t.useEffect((function(){v.current||(v.current=!0,a(void 0,void 0,void 0,(function(){var e,t,n;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,7,,8]),e=void 0,void 0===i&&(i=window.location.search),!za.test(i)&&!Ba.test(i)||!Da.test(i)||o?[3,3]:[4,h.handleRedirectCallback()];case 1:return t=r.sent().appState,[4,h.getUser()];case 2:return e=r.sent(),l(t,e),[3,6];case 3:return[4,h.checkSession()];case 4:return r.sent(),[4,h.getUser()];case 5:e=r.sent(),r.label=6;case 6:return b({type:"INITIALISED",user:e}),[3,8];case 7:return n=r.sent(),b({type:"ERROR",error:Qa(n)}),[3,8];case 8:return[2]}var i}))})))}),[h,l,o]);var g=t.useCallback((function(e){return h.buildAuthorizeUrl(es(e))}),[h]),w=t.useCallback((function(e){return h.buildLogoutUrl(e)}),[h]),S=t.useCallback((function(e){return h.loginWithRedirect(es(e))}),[h]),k=t.useCallback((function(e,t){return a(void 0,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:b({type:"LOGIN_POPUP_STARTED"}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,h.loginWithPopup(e,t)];case 2:return o.sent(),[3,4];case 3:return n=o.sent(),b({type:"ERROR",error:Qa(n)}),[2];case 4:return[4,h.getUser()];case 5:return r=o.sent(),b({type:"LOGIN_POPUP_COMPLETE",user:r}),[2]}}))}))}),[h]),I=t.useCallback((function(e){void 0===e&&(e={});var t=h.logout(e);if(e.localOnly){if(t&&"function"==typeof t.then)return t.then((function(){return b({type:"LOGOUT"})}));b({type:"LOGOUT"})}return t}),[h]),Z=t.useCallback((function(e){return a(void 0,void 0,void 0,(function(){var t,n,r,o;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,3,5]),[4,h.getTokenSilently(e)];case 1:return t=i.sent(),[3,5];case 2:throw n=i.sent(),qa(n);case 3:return r=b,o={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,h.getUser()];case 4:return r.apply(void 0,[(o.user=i.sent(),o)]),[7];case 5:return[2,t]}}))}))}),[h]),W=t.useCallback((function(e,t){return a(void 0,void 0,void 0,(function(){var n,r,o,i;return s(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,3,5]),[4,h.getTokenWithPopup(e,t)];case 1:return n=c.sent(),[3,5];case 2:throw r=c.sent(),qa(r);case 3:return o=b,i={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,h.getUser()];case 4:return o.apply(void 0,[(i.user=c.sent(),i)]),[7];case 5:return[2,n]}}))}))}),[h]),_=t.useCallback((function(e){return h.getIdTokenClaims(e)}),[h]),G=t.useCallback((function(e){return a(void 0,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,5]),[4,h.handleRedirectCallback(e)];case 1:return[2,o.sent()];case 2:throw t=o.sent(),qa(t);case 3:return n=b,r={type:"HANDLE_REDIRECT_COMPLETE"},[4,h.getUser()];case 4:return n.apply(void 0,[(r.user=o.sent(),r)]),[7];case 5:return[2]}}))}))}),[h]),x=t.useMemo((function(){return i(i({},m),{buildAuthorizeUrl:g,buildLogoutUrl:w,getAccessTokenSilently:Z,getAccessTokenWithPopup:W,getIdTokenClaims:_,loginWithRedirect:S,loginWithPopup:k,logout:I,handleRedirectCallback:G})}),[m,g,w,Z,W,_,S,k,I,G]);return r.default.createElement(f.Provider,{value:x},n)},e.InMemoryCache=Sa,e.LocalStorageCache=wa,e.OAuthError=Aa,e.User=function(){},e.initialContext=Fa,e.useAuth0=ns,e.withAuth0=function(e,t){return void 0===t&&(t=Ua),function(n){return r.default.createElement(t.Consumer,null,(function(t){return r.default.createElement(e,i({},n,{auth0:t}))}))}},e.withAuthenticationRequired=function(e,n){return void 0===n&&(n={}),function(o){var c=this,u=n.returnTo,l=void 0===u?os:u,d=n.onRedirecting,f=void 0===d?rs:d,p=n.claimCheck,h=void 0===p?function(){return!0}:p,y=n.loginOptions,m=n.context,b=ns(void 0===m?Ua:m),v=b.user,g=b.isAuthenticated,w=b.isLoading,S=b.loginWithRedirect,k=g&&h(v);return t.useEffect((function(){if(!w&&!k){var e=i(i({},y),{appState:i(i({},y&&y.appState),{returnTo:"function"==typeof l?l():l})});a(c,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,S(e)];case 1:return t.sent(),[2]}}))}))}}),[w,k,S,y,l]),k?r.default.createElement(e,i({},o)):f()}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).reactAuth0={},e.React)}(this,(function(e,t){"use strict";var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},i(e,t)};var n=function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e,t,i,n){return new(i||(i=Promise))((function(o,r){function a(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function r(e,t){var i,n,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(i=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function a(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]])}return i}var s="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 l=u((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,i){var n=e.locked.get(t);void 0===n?void 0===i?e.locked.set(t,[]):e.locked.set(t,[i]):void 0!==i&&(n.unshift(i),e.locked.set(t,n))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(i,n){e.isLocked(t)?e.addToLocked(t,i):(e.addToLocked(t),i())}))},this.unlock=function(t){var i=e.locked.get(t);if(void 0!==i&&0!==i.length){var n=i.pop();e.locked.set(t,i),void 0!==n&&setTimeout(n,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 i.getInstance()}}));c(l);var d=c(u((function(e,t){var i=s&&s.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function a(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){e.done?o(e.value):new i((function(t){t(e.value)})).then(a,s)}c((n=n.apply(e,t||[])).next())}))},n=s&&s.__generator||function(e,t){var i,n,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,n=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],n=0}finally{i=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var o="browser-tabs-lock-key";function r(e){return new Promise((function(t){return setTimeout(t,e)}))}function a(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="",n=0;n<e;n++)i+=t[Math.floor(Math.random()*t.length)];return i}var c=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+a(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,s){return void 0===s&&(s=5e3),i(this,void 0,void 0,(function(){var i,c,u,l,d,h;return n(this,(function(n){switch(n.label){case 0:i=Date.now()+a(4),c=Date.now()+s,u=o+"-"+t,l=window.localStorage,n.label=1;case 1:return Date.now()<c?[4,r(30)]:[3,8];case 2:return n.sent(),null!==l.getItem(u)?[3,5]:(d=this.id+"-"+t+"-"+i,[4,r(Math.floor(25*Math.random()))]);case 3:return n.sent(),l.setItem(u,JSON.stringify({id:this.id,iat:i,timeoutKey:d,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,r(30)];case 4:return n.sent(),null!==(h=l.getItem(u))&&(h=JSON.parse(h)).id===this.id&&h.iat===i?(this.acquiredIatSet.add(i),this.refreshLockWhileAcquired(u,i),[2,!0]):[3,7];case 5:return e.lockCorrector(),[4,this.waitForSomethingToChange(c)];case 6:n.sent(),n.label=7;case 7:return i=Date.now()+a(4),[3,1];case 8:return[2,!1]}}))}))},e.prototype.refreshLockWhileAcquired=function(e,t){return i(this,void 0,void 0,(function(){var o=this;return n(this,(function(r){return setTimeout((function(){return i(o,void 0,void 0,(function(){var i,o;return n(this,(function(n){switch(n.label){case 0:return[4,l.default().lock(t)];case 1:return n.sent(),this.acquiredIatSet.has(t)?(i=window.localStorage,null===(o=i.getItem(e))?(l.default().unlock(t),[2]):((o=JSON.parse(o)).timeRefreshed=Date.now(),i.setItem(e,JSON.stringify(o)),l.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(l.default().unlock(t),[2])}}))}))}),1e3),[2]}))}))},e.prototype.waitForSomethingToChange=function(t){return i(this,void 0,void 0,(function(){return n(this,(function(i){switch(i.label){case 0:return[4,new Promise((function(i){var n=!1,o=Date.now(),r=!1;function a(){if(r||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(s),r=!0),!n){n=!0;var t=50-(Date.now()-o);t>0?setTimeout(i,t):i()}}window.addEventListener("storage",a),e.addToWaiting(a);var s=setTimeout(a,Math.max(0,t-Date.now()))}))];case 1:return i.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 i(this,void 0,void 0,(function(){return n(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 i(this,void 0,void 0,(function(){var i,r,a;return n(this,(function(n){switch(n.label){case 0:return i=window.localStorage,r=o+"-"+t,null===(a=i.getItem(r))?[2]:(a=JSON.parse(a)).id!==this.id?[3,2]:[4,l.default().lock(a.iat)];case 1:n.sent(),this.acquiredIatSet.delete(a.iat),i.removeItem(r),l.default().unlock(a.iat),e.notifyWaiters(),n.label=2;case 2:return[2]}}))}))},e.lockCorrector=function(){for(var t=Date.now()-5e3,i=window.localStorage,n=Object.keys(i),r=!1,a=0;a<n.length;a++){var s=n[a];if(s.includes(o)){var c=i.getItem(s);null!==c&&(void 0===(c=JSON.parse(c)).timeRefreshed&&c.timeAcquired<t||void 0!==c.timeRefreshed&&c.timeRefreshed<t)&&(i.removeItem(s),r=!0)}}r&&e.notifyWaiters()},e.waiters=void 0,e}();t.default=c})));const h={timeoutInSeconds:60},p={name:"auth0-spa-js",version:"2.0.2"},m=()=>Date.now();class f extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,f.prototype)}static fromPayload({error:e,error_description:t}){return new f(e,t)}}class y extends f{constructor(e,t,i,n=null){super(e,t),this.state=i,this.appState=n,Object.setPrototypeOf(this,y.prototype)}}class g extends f{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,g.prototype)}}class w extends g{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,w.prototype)}}class b extends f{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,b.prototype)}}class v extends f{constructor(e,t,i){super(e,t),this.mfa_token=i,Object.setPrototypeOf(this,v.prototype)}}class k extends f{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${I(e,["default"])}', scope: '${I(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,k.prototype)}}function I(e,t=[]){return e&&!t.includes(e)?e:""}const _=()=>window.crypto,S=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(_().getRandomValues(new Uint8Array(43))).forEach((i=>t+=e[i%e.length])),t},T=e=>btoa(e),Z=e=>{var{clientId:t}=e,i=a(e,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter((t=>void 0!==e[t])).reduce(((t,i)=>Object.assign(Object.assign({},t),{[i]:e[i]})),{}))(Object.assign({client_id:t},i))).toString()},C=e=>(e=>decodeURIComponent(atob(e).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),O=async(e,t)=>{const i=await fetch(e,t);return{ok:i.ok,json:await i.json()}},j=async(e,t,i,n,o,r,a=1e4)=>o?(async(e,t,i,n,o,r,a)=>{return s={auth:{audience:t,scope:i},timeout:o,fetchUrl:e,fetchOptions:n,useFormData:a},c=r,new Promise((function(e,t){const i=new MessageChannel;i.port1.onmessage=function(n){n.data.error?t(new Error(n.data.error)):e(n.data),i.port1.close()},c.postMessage(s,[i.port2])}));var s,c})(e,t,i,n,a,o,r):(async(e,t,i)=>{const n=new AbortController;let o;return t.signal=n.signal,Promise.race([O(e,t),new Promise(((e,t)=>{o=setTimeout((()=>{n.abort(),t(new Error("Timeout when executing 'fetch'"))}),i)}))]).finally((()=>{clearTimeout(o)}))})(e,n,a);async function x(e,t){var{baseUrl:i,timeout:n,audience:o,scope:r,auth0Client:s,useFormData:c}=e,u=a(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const l=c?Z(u):JSON.stringify(u);return await async function(e,t,i,n,o,r,s){let c,u=null;for(let a=0;a<3;a++)try{c=await j(e,i,n,o,r,s,t),u=null;break}catch(e){u=e}if(u)throw u;const l=c.json,{error:d,error_description:h}=l,p=a(l,["error","error_description"]),{ok:m}=c;if(!m){const t=h||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===d)throw new v(d,t,p.mfa_token);throw new f(d||"request_error",t)}return p}(`${i}/oauth/token`,n,o||"default",r,{method:"POST",body:l,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(s||p))}},t,c)}const P=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};class R{constructor(e,t="@@auth0spajs@@",i){this.prefix=t,this.suffix=i,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[t,i,n,o]=e.split("::");return new R({clientId:i,scope:o,audience:n},t)}static fromCacheEntry(e){const{scope:t,audience:i,client_id:n}=e;return new R({scope:t,audience:i,clientId:n})}}class L{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter((e=>e.startsWith("@@auth0spajs@@")))}}class X{constructor(){this.enclosedCache=function(){let e={};return{set(t,i){e[t]=i},get(t){const i=e[t];if(i)return i},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class K{constructor(e,t,i){this.cache=e,this.keyManifest=t,this.nowProvider=i||m}async setIdToken(e,t,i){var n;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:i}),await(null===(n=this.keyManifest)||void 0===n?void 0:n.add(o))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e,t=0){var i;let n=await this.cache.get(e.toKey());if(!n){const t=await this.getCacheKeys();if(!t)return;const i=this.matchExistingCacheKey(e,t);i&&(n=await this.cache.get(i))}if(!n)return;const o=await this.nowProvider(),r=Math.floor(o/1e3);return n.expiresAt-t<r?n.body.refresh_token?(n.body={refresh_token:n.body.refresh_token},await this.cache.set(e.toKey(),n),n.body):(await this.cache.remove(e.toKey()),void await(null===(i=this.keyManifest)||void 0===i?void 0:i.remove(e.toKey()))):n.body}async set(e){var t;const i=new R({clientId:e.client_id,scope:e.scope,audience:e.audience}),n=await this.wrapCacheEntry(e);await this.cache.set(i.toKey(),n),await(null===(t=this.keyManifest)||void 0===t?void 0:t.add(i.toKey()))}async clear(e){var t;const i=await this.getCacheKeys();i&&(await i.filter((t=>!e||t.includes(e))).reduce((async(e,t)=>{await e,await this.cache.remove(t)}),Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new R({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter((t=>{var i;const n=R.fromKey(t),o=new Set(n.scope&&n.scope.split(" ")),r=(null===(i=e.scope)||void 0===i?void 0:i.split(" "))||[],a=n.scope&&r.reduce(((e,t)=>e&&o.has(t)),!0);return"@@auth0spajs@@"===n.prefix&&n.clientId===e.clientId&&n.audience===e.audience&&a}))[0]}}class W{constructor(e,t){this.storage=e,this.clientId=t,this.storageKey=`a0.spajs.txs.${this.clientId}`,this.transaction=this.storage.get(this.storageKey)}create(e){this.transaction=e,this.storage.save(this.storageKey,e,{daysUntilExpire:1})}get(){return this.transaction}remove(){delete this.transaction,this.storage.remove(this.storageKey)}}const z=e=>"number"==typeof e,V=["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"];var E=u((function(e,t){var i=s&&s.__assign||function(){return i=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function n(e,t){if(!t)return"";var i="; "+e;return!0===t?i:i+"="+t}function o(e,t,i){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 n("Expires",e.expires?e.expires.toUTCString():"")+n("Domain",e.domain)+n("Path",e.path)+n("Secure",e.secure)+n("SameSite",e.sameSite)}(i)}function r(e){for(var t={},i=e?e.split("; "):[],n=/(%[\dA-F]{2})+/gi,o=0;o<i.length;o++){var r=i[o].split("="),a=r.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[r[0].replace(n,decodeURIComponent)]=a.replace(n,decodeURIComponent)}catch(e){}}return t}function a(){return r(document.cookie)}function c(e,t,n){document.cookie=o(e,t,i({path:"/"},n))}t.__esModule=!0,t.encode=o,t.parse=r,t.getAll=a,t.get=function(e){return a()[e]},t.set=c,t.remove=function(e,t){c(e,"",i(i({},t),{expires:-1}))}}));c(E),E.encode,E.parse,E.getAll;var N=E.get,G=E.set,U=E.remove;const J={get(e){const t=N(e);if(void 0!==t)return JSON.parse(t)},save(e,t,i){let n={};"https:"===window.location.protocol&&(n={secure:!0,sameSite:"none"}),(null==i?void 0:i.daysUntilExpire)&&(n.expires=i.daysUntilExpire),(null==i?void 0:i.cookieDomain)&&(n.domain=i.cookieDomain),G(e,JSON.stringify(t),n)},remove(e,t){let i={};(null==t?void 0:t.cookieDomain)&&(i.domain=t.cookieDomain),U(e,i)}},H={get:e=>J.get(e)||J.get(`_legacy_${e}`),save(e,t,i){let n={};"https:"===window.location.protocol&&(n={secure:!0}),(null==i?void 0:i.daysUntilExpire)&&(n.expires=i.daysUntilExpire),G(`_legacy_${e}`,JSON.stringify(t),n),J.save(e,t,i)},remove(e,t){let i={};(null==t?void 0:t.cookieDomain)&&(i.domain=t.cookieDomain),U(e,i),J.remove(e,t),J.remove(`_legacy_${e}`,t)}},Y={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var F,A=("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9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X3Rva2VuLGwsdSksZGVsZXRlIHAucmVmcmVzaF90b2tlbik6KChlLHQpPT57ZGVsZXRlIG9bbihlLHQpXX0pKGwsdSksZi5wb3N0TWVzc2FnZSh7b2s6Zy5vayxqc29uOnB9KX1jYXRjaChlKXtmLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGh9KSl9KCk7Cgo=",null,!1,function(e){return F=F||function(e,t,i){var n=void 0===t?null:t,o=function(e,t){var i=atob(e);if(t){for(var n=new Uint8Array(i.length),o=0,r=i.length;o<r;++o)n[o]=i.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return i}(e,void 0!==i&&i),r=o.indexOf("\n",10)+1,a=o.substring(r)+(n?"//# sourceMappingURL="+n:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlw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6KChlLHQpPT57ZGVsZXRlIG9bbihlLHQpXX0pKGwsdSksZi5wb3N0TWVzc2FnZSh7b2s6Zy5vayxqc29uOnB9KX1jYXRjaChlKXtmLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGh9KSl9KCk7Cgo=",null,false),new Worker(F,e)});const D={};class M{constructor(e,t){this.cache=e,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var t;const i=new Set((null===(t=await this.cache.get(this.manifestKey))||void 0===t?void 0:t.keys)||[]);i.add(e),await this.cache.set(this.manifestKey,{keys:[...i]})}async remove(e){const t=await this.cache.get(this.manifestKey);if(t){const i=new Set(t.keys);return i.delete(e),i.size>0?await this.cache.set(this.manifestKey,{keys:[...i]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return`@@auth0spajs@@::${e}`}}const B={memory:()=>(new X).enclosedCache,localstorage:()=>new L},Q=e=>B[e],q=e=>{const{openUrl:t,onRedirect:i}=e,n=a(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:!1===t||t?t:i})},$=new d;class ee{constructor(e){let t,i;if(this.userCache=(new X).enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await $.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!_())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===_().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. 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 for more information.\n ")})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)i=e.cache;else{if(t=e.cacheLocation||"memory",!Q(t))throw new Error(`Invalid cache location "${t}"`);i=Q(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?J:H,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(e=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const n=e.useCookiesForTransactions?this.cookieStorage:Y;var o;this.scope=P("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new W(n,this.options.clientId),this.nowProvider=this.options.nowProvider||m,this.cacheManager=new K(i,i.allKeys?void 0:new M(i,this.options.clientId),this.nowProvider),this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:`https://${e}/`:`${t}/`)(this.options.issuer,this.domainUrl),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.worker=new A)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||p)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${Z(e)}`)}async _verifyIdToken(e,t,i){const n=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),[i,n,o]=t;if(3!==t.length||!i||!n||!o)throw new Error("ID token could not be decoded");const r=JSON.parse(C(n)),a={__raw:e},s={};return Object.keys(r).forEach((e=>{a[e]=r[e],V.includes(e)||(s[e]=r[e])})),{encoded:{header:i,payload:n,signature:o},header:JSON.parse(C(i)),claims:a,user:s}})(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&&!z(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(null==t.claims.exp||!z(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!z(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const i=e.leeway||60,n=new Date(e.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+i),n>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${o})`);if(null!=t.claims.nbf&&z(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-i),n<e)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${e}`)}if(null!=t.claims.auth_time&&z(t.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+i),n>o)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. Current time (${n}) is after last auth at ${o}`)}if(e.organizationId){if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e.organizationId!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${e.organizationId}", found "${t.claims.org_id}"`)}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organizationId:i,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:n});var o}_processOrgIdHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,t,i){const n=T(S()),o=T(S()),r=S(),a=(e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,(e=>t[e]))})(window.btoa(String.fromCharCode(...Array.from(t))))})(await(async e=>{const t=_().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t})(r)),s=((e,t,i,n,o,r,a,s)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),i),{scope:P(t,i.scope),response_type:"code",response_mode:s||"query",state:n,nonce:o,redirect_uri:a||e.authorizationParams.redirect_uri,code_challenge:r,code_challenge_method:"S256"}))(this.options,this.scope,e,n,o,a,e.redirect_uri||this.options.authorizationParams.redirect_uri||i,null==t?void 0:t.response_mode),c=this._authorizeUrl(s);return{nonce:o,code_verifier:r,scope:s.scope,audience:s.audience||"default",redirect_uri:s.redirect_uri,state:n,url:c}}async loginWithPopup(e,t){var i;if(e=e||{},!(t=t||{}).popup&&(t.popup=(e=>{const t=window.screenX+(window.innerWidth-400)/2,i=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${t},top=${i},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const n=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=n.url;const o=await(e=>new Promise(((t,i)=>{let n;const o=setInterval((()=>{e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(r),window.removeEventListener("message",n,!1),i(new b(e.popup)))}),1e3),r=setTimeout((()=>{clearInterval(o),i(new w(e.popup)),window.removeEventListener("message",n,!1)}),1e3*(e.timeoutInSeconds||60));n=function(a){if(a.data&&"authorization_response"===a.data.type){if(clearTimeout(r),clearInterval(o),window.removeEventListener("message",n,!1),e.popup.close(),a.data.response.error)return i(f.fromPayload(a.data.response));t(a.data.response)}},window.addEventListener("message",n)})))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(n.state!==o.state)throw new Error("Invalid state");const r=(null===(i=e.authorizationParams)||void 0===i?void 0:i.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:n.redirect_uri},{nonceIn:n.nonce,organizationId:r})}async getUser(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(e={}){var t;const i=q(e),{openUrl:n,fragment:o,appState:r}=i,s=a(i,["openUrl","fragment","appState"]),c=(null===(t=s.authorizationParams)||void 0===t?void 0:t.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=u,d=a(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:r}),c&&{organizationId:c}));const h=o?`${l}#${o}`:l;n?await n(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const{state:i,code:n,error:o,error_description:r}=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join("")),a=this.transactionManager.get();if(!a)throw new Error("Invalid state");if(this.transactionManager.remove(),o)throw new y(o,r||o,i,a.appState);if(!a.code_verifier||a.state&&a.state!==i)throw new Error("Invalid state");const s=a.organizationId,c=a.nonce,u=a.redirect_uri;return await this._requestToken(Object.assign({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:n},u?{redirect_uri:u}:{}),{nonceIn:c,organizationId:s}),{appState:a.appState}}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t;const i=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:P(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope)})}),n=await((e,t)=>{let i=D[t];return i||(i=e().finally((()=>{delete D[t],i=null})),D[t]=i),i})((()=>this._getTokenSilently(i)),`${this.options.clientId}::${i.authorizationParams.audience}::${i.authorizationParams.scope}`);return e.detailedResponse?n:null==n?void 0:n.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,i=a(e,["cacheMode"]);if("off"!==t){const e=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}if("cache-only"!==t){if(!await(async(e,t=3)=>{for(let i=0;i<t;i++)if(await e())return!0;return!1})((()=>$.acquireLock("auth0.lock.getTokenSilently",5e3)),10))throw new g;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),"off"!==t){const e=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(i):await this._getTokenFromIFrame(i),{id_token:n,access_token:o,oauthTokenScope:r,expires_in:a}=e;return Object.assign(Object.assign({id_token:n,access_token:o},r?{scope:r}:null),{expires_in:a})}finally{await $.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(e={},t={}){var i;const n=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:P(this.scope,null===(i=e.authorizationParams)||void 0===i?void 0:i.scope)})});return t=Object.assign(Object.assign({},h),t),await this.loginWithPopup(n,t),(await this.cacheManager.get(new R({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},{federated:i}=t,n=a(t,["federated"]),o=i?"&federated":"";return this._url(`/v2/logout?${Z(Object.assign({clientId:e.clientId},n))}`)+o}async logout(e={}){const t=q(e),{openUrl:i}=t,n=a(t,["openUrl"]);await this.cacheManager.clear(),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const o=this._buildLogoutUrl(n);i?await i(o):!1!==i&&window.location.assign(o)}async _getTokenFromIFrame(e){const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),i=this.cookieStorage.get(this.orgHintCookieName);i&&!t.organization&&(t.organization=i);const{url:n,state:o,nonce:r,code_verifier:a,redirect_uri:s,scope:c,audience:u}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new f("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const t=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,i=await((e,t,i=60)=>new Promise(((n,o)=>{const r=window.document.createElement("iframe");r.setAttribute("width","0"),r.setAttribute("height","0"),r.style.display="none";const a=()=>{window.document.body.contains(r)&&(window.document.body.removeChild(r),window.removeEventListener("message",s,!1))};let s;const c=setTimeout((()=>{o(new g),a()}),1e3*i);s=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const i=e.source;i&&i.close(),e.data.response.error?o(f.fromPayload(e.data.response)):n(e.data.response),clearTimeout(c),window.removeEventListener("message",s,!1),setTimeout(a,2e3)},window.addEventListener("message",s,!1),window.document.body.appendChild(r),r.setAttribute("src",e)})))(n,this.domainUrl,t);if(o!==i.state)throw new Error("Invalid state");const l=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:i.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:r});return Object.assign(Object.assign({},l),{scope:c,oauthTokenScope:l.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new R({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new k(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const i=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,n="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null;try{const o=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:i}),n&&{timeout:n}));return Object.assign(Object.assign({},o),{scope:e.authorizationParams.scope,oauthTokenScope:o.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}}async _saveEntryInCache(e){const{id_token:t,decodedToken:i}=e,n=a(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:t,decodedToken:i}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(n)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",t=await this.cacheManager.getIdToken(new R({clientId:this.options.clientId,audience:e,scope:this.scope})),i=this.userCache.get("@@user@@");return t&&t.id_token===(null==i?void 0:i.id_token)?i:(this.userCache.set("@@user@@",t),t)}async _getEntryFromCache({scope:e,audience:t,clientId:i}){const n=await this.cacheManager.get(new R({scope:e,audience:t,clientId:i}),60);if(n&&n.access_token){const{access_token:e,oauthTokenScope:t,expires_in:i}=n,o=await this._getIdTokenFromCache();return o&&Object.assign(Object.assign({id_token:o.id_token,access_token:e},t?{scope:t}:null),{expires_in:i})}}async _requestToken(e,t){const{nonceIn:i,organizationId:n}=t||{},o=await x(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},e),this.worker),r=await this._verifyIdToken(o.id_token,i,n);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:r,scope:e.scope,audience:e.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(r.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:r})}}var te={isAuthenticated:!1,isLoading:!0},ie=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},ne=n(n({},te),{buildAuthorizeUrl:ie,buildLogoutUrl:ie,getAccessTokenSilently:ie,getAccessTokenWithPopup:ie,getIdTokenClaims:ie,loginWithRedirect:ie,loginWithPopup:ie,logout:ie,handleRedirectCallback:ie}),oe=t.createContext(ne),re=function(e){function t(i,n){var o=e.call(this,n||i)||this;return o.error=i,o.error_description=n,Object.setPrototypeOf(o,t.prototype),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),ae=/[?&]code=[^&]+/,se=/[?&]state=[^&]+/,ce=/[?&]error=[^&]+/,ue=function(e){return function(t){return"error"in t?new re(t.error,t.error_description):t instanceof Error?t:new Error(e)}},le=ue("Login failed"),de=ue("Get access token failed"),he=function(e,t){switch(t.type){case"LOGIN_POPUP_STARTED":return n(n({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return n(n({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return e.user===t.user?e:n(n({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return n(n({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return n(n({},e),{isLoading:!1,error:t.error})}},pe=function(e){window.history.replaceState({},document.title,(null==e?void 0:e.returnTo)||window.location.pathname)},me=function(e){return void 0===e&&(e=oe),t.useContext(e)},fe=function(){return t.createElement(t.Fragment,null)},ye=function(){return"".concat(window.location.pathname).concat(window.location.search)};e.Auth0Context=oe,e.Auth0Provider=function(e){var i=e.children,a=e.skipRedirectCallback,s=e.onRedirectCallback,c=void 0===s?pe:s,u=e.context,l=void 0===u?oe:u,d=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]])}return i}(e,["children","skipRedirectCallback","onRedirectCallback","context"]),h=t.useState((function(){return new ee(function(e){return n(n({},e),{auth0Client:{name:"auth0-react",version:"2.0.0"}})}(d))}))[0],p=t.useReducer(he,te),m=p[0],f=p[1],y=t.useRef(!1);t.useEffect((function(){y.current||(y.current=!0,o(void 0,void 0,void 0,(function(){var e,t,i;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,7,,8]),e=void 0,void 0===o&&(o=window.location.search),!ae.test(o)&&!ce.test(o)||!se.test(o)||a?[3,3]:[4,h.handleRedirectCallback()];case 1:return t=n.sent().appState,[4,h.getUser()];case 2:return e=n.sent(),c(t,e),[3,6];case 3:return[4,h.checkSession()];case 4:return n.sent(),[4,h.getUser()];case 5:e=n.sent(),n.label=6;case 6:return f({type:"INITIALISED",user:e}),[3,8];case 7:return i=n.sent(),f({type:"ERROR",error:le(i)}),[3,8];case 8:return[2]}var o}))})))}),[h,c,a]);var g=t.useCallback((function(e){return h.loginWithRedirect(e)}),[h]),w=t.useCallback((function(e,t){return o(void 0,void 0,void 0,(function(){var i,n;return r(this,(function(o){switch(o.label){case 0:f({type:"LOGIN_POPUP_STARTED"}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,h.loginWithPopup(e,t)];case 2:return o.sent(),[3,4];case 3:return i=o.sent(),f({type:"ERROR",error:le(i)}),[2];case 4:return[4,h.getUser()];case 5:return n=o.sent(),f({type:"LOGIN_POPUP_COMPLETE",user:n}),[2]}}))}))}),[h]),b=t.useCallback((function(e){return void 0===e&&(e={}),o(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,h.logout(e)];case 1:return t.sent(),(e.openUrl||!1===e.openUrl)&&f({type:"LOGOUT"}),[2]}}))}))}),[h]),v=t.useCallback((function(e){return o(void 0,void 0,void 0,(function(){var t,i,n,o;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,3,5]),[4,h.getTokenSilently(e)];case 1:return t=r.sent(),[3,5];case 2:throw i=r.sent(),de(i);case 3:return n=f,o={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,h.getUser()];case 4:return n.apply(void 0,[(o.user=r.sent(),o)]),[7];case 5:return[2,t]}}))}))}),[h]),k=t.useCallback((function(e,t){return o(void 0,void 0,void 0,(function(){var i,n,o,a;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,3,5]),[4,h.getTokenWithPopup(e,t)];case 1:return i=r.sent(),[3,5];case 2:throw n=r.sent(),de(n);case 3:return o=f,a={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,h.getUser()];case 4:return o.apply(void 0,[(a.user=r.sent(),a)]),[7];case 5:return[2,i]}}))}))}),[h]),I=t.useCallback((function(){return h.getIdTokenClaims()}),[h]),_=t.useCallback((function(e){return o(void 0,void 0,void 0,(function(){var t,i,n;return r(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,5]),[4,h.handleRedirectCallback(e)];case 1:return[2,o.sent()];case 2:throw t=o.sent(),de(t);case 3:return i=f,n={type:"HANDLE_REDIRECT_COMPLETE"},[4,h.getUser()];case 4:return i.apply(void 0,[(n.user=o.sent(),n)]),[7];case 5:return[2]}}))}))}),[h]),S=t.useMemo((function(){return n(n({},m),{getAccessTokenSilently:v,getAccessTokenWithPopup:k,getIdTokenClaims:I,loginWithRedirect:g,loginWithPopup:w,logout:b,handleRedirectCallback:_})}),[m,v,k,I,g,w,b,_]);return t.createElement(l.Provider,{value:S},i)},e.InMemoryCache=X,e.LocalStorageCache=L,e.OAuthError=re,e.User=class{},e.initialContext=ne,e.useAuth0=me,e.withAuth0=function(e,i){return void 0===i&&(i=oe),function(o){return t.createElement(i.Consumer,null,(function(i){return t.createElement(e,n({},o,{auth0:i}))}))}},e.withAuthenticationRequired=function(e,i){return void 0===i&&(i={}),function(a){var s=this,c=i.returnTo,u=void 0===c?ye:c,l=i.onRedirecting,d=void 0===l?fe:l,h=i.loginOptions,p=i.context,m=me(void 0===p?oe:p),f=m.isAuthenticated,y=m.isLoading,g=m.loginWithRedirect;return t.useEffect((function(){if(!y&&!f){var e=n(n({},h),{appState:n(n({},h&&h.appState),{returnTo:"function"==typeof u?u():u})});o(s,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,g(e)];case 1:return t.sent(),[2]}}))}))}}),[y,f,g,h,u]),f?t.createElement(e,n({},a)):d()}}}));
|
|
16
2
|
//# sourceMappingURL=auth0-react.min.js.map
|