@corbado/webcomponent
Advanced tools
Comparing version 1.0.13 to 1.0.14
{ | ||
"name": "@corbado/webcomponent", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "pkg/auth.js", |
/*! For license information please see session.js.LICENSE.txt */ | ||
var e={230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};(()=>{function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}r.d(n,{Z:()=>Lt});var t=function t(r,n){function o(t,o,s){if("undefined"!=typeof document){"number"==typeof(s=e({},n,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in s)s[a]&&(i+="; "+a,!0!==s[a]&&(i+="="+s[a].split(";")[0]));return document.cookie=t+"="+r.write(o,t)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},o=0;o<t.length;o++){var s=t[o].split("="),i=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(n[a]=r.read(i,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(t,r){o(t,"",e({},r,{expires:-1}))},withAttributes:function(r){return t(this.converter,e({},this.attributes,r))},withConverter:function(r){return t(e({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(r)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const o=t;function s(e){const t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():""}const i=crypto,a=e=>e instanceof CryptoKey,c=new TextEncoder,u=new TextDecoder;const l=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r})(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class f extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class d extends f{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}class h extends f{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}class p extends f{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class m extends f{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class y extends f{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class w extends f{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class g extends f{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class b extends f{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class E extends f{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator;class S extends f{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class v extends f{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}i.getRandomValues.bind(i);const A=e=>a(e),R=["CryptoKey"],O=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:o}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new m(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new m('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),s=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:o];if("PBKDF2"===n.name)return i.subtle.importKey("raw",l(e.k),...s);const a={...e};return delete a.alg,delete a.use,i.subtle.importKey("jwk",a,...s)};function _(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function T(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const C=(e,...t)=>T("Key must be ",e,...t);function k(e,t,...r){return T(`Key for the ${e} algorithm must be `,t,...r)}function P(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function x(e,t){return e.name===t}function j(e){return parseInt(e.name.slice(4),10)}function D(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!x(e.algorithm,"HMAC"))throw P("HMAC");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!x(e.algorithm,"RSASSA-PKCS1-v1_5"))throw P("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!x(e.algorithm,"RSA-PSS"))throw P("RSA-PSS");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw P("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!x(e.algorithm,"ECDSA"))throw P("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw P(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}!function(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}Symbol();async function N(e,t,r){if(e instanceof Uint8Array&&(e=u.decode(e)),"string"!=typeof e)throw new y("Compact JWS must be a string or Uint8Array");const{0:n,1:o,2:s,length:f}=e.split(".");if(3!==f)throw new y("Invalid Compact JWS");const d=await async function(e,t,r){var n;if(!_(e))throw new y("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new y('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new y("JWS Protected Header incorrect type");if(void 0===e.payload)throw new y("JWS Payload missing");if("string"!=typeof e.signature)throw new y("JWS Signature missing or incorrect type");if(void 0!==e.header&&!_(e.header))throw new y("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const t=l(e.protected);o=JSON.parse(u.decode(t))}catch(e){throw new y("JWS Protected Header is invalid")}if(!((...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0})(o,e.header))throw new y("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const s={...o,...e.header};let f=!0;if(function(e,t,r,n,o){if(void 0!==o.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;s=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!s.has(t))throw new m(`Extension Header Parameter "${t}" is not recognized`);if(void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(s.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}(y,new Map([["b64",!0]]),null==r?void 0:r.crit,o,s).has("b64")&&(f=o.b64,"boolean"!=typeof f))throw new y('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:d}=s;if("string"!=typeof d||!d)throw new y('JWS "alg" (Algorithm) Header Parameter missing or invalid');const h=r&&((e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)})("algorithms",r.algorithms);if(h&&!h.has(d))throw new p('"alg" (Algorithm) Header Parameter not allowed');if(f){if("string"!=typeof e.payload)throw new y("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new y("JWS Payload must be a string or an Uint8Array instance");let w=!1;"function"==typeof t&&(t=await t(o,e),w=!0),((e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!A(t))throw new TypeError(k(e,t,...R,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${R.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!A(t))throw new TypeError(k(e,t,...R));if("secret"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)})(d,t,"verify");const g=function(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}(c.encode(null!==(n=e.protected)&&void 0!==n?n:""),c.encode("."),"string"==typeof e.payload?c.encode(e.payload):e.payload),b=l(e.signature);if(!await(async(e,t,r,n)=>{const o=await function(e,t,r){if(a(t))return D(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(C(t,...R));return i.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(C(t,...R,"Uint8Array"))}(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,o);const s=function(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new m(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,o.algorithm);try{return await i.subtle.verify(s,o,r,n)}catch(e){return!1}})(d,t,b,g))throw new v;let E;E=f?l(e.payload):"string"==typeof e.payload?c.encode(e.payload):e.payload;const S={payload:E};return void 0!==e.protected&&(S.protectedHeader=o),void 0!==e.header&&(S.unprotectedHeader=e.header),w?{...S,key:t}:S}({payload:o,protected:n,signature:s},t,r),h={payload:d.payload,protectedHeader:d.protectedHeader};return"function"==typeof t?{...h,key:d.key}:h}const U=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,I=e=>{const t=U.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(86400*r);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}},K=e=>e.toLowerCase().replace(/^application\//,""),W=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||K(e.typ)!==K(n)))throw new d('unexpected "typ" JWT header value',"typ","check_failed");let o;try{o=JSON.parse(u.decode(t))}catch(e){}if(!_(o))throw new w("JWT Claims Set must be a top-level JSON object");const{requiredClaims:s=[],issuer:i,subject:a,audience:c,maxTokenAge:l}=r;void 0!==l&&s.push("iat"),void 0!==c&&s.push("aud"),void 0!==a&&s.push("sub"),void 0!==i&&s.push("iss");for(const e of new Set(s.reverse()))if(!(e in o))throw new d(`missing required "${e}" claim`,e,"missing");if(i&&!(Array.isArray(i)?i:[i]).includes(o.iss))throw new d('unexpected "iss" claim value',"iss","check_failed");if(a&&o.sub!==a)throw new d('unexpected "sub" claim value',"sub","check_failed");if(c&&(p="string"==typeof c?[c]:c,!("string"==typeof(f=o.aud)?p.includes(f):Array.isArray(f)&&p.some(Set.prototype.has.bind(new Set(f))))))throw new d('unexpected "aud" claim value',"aud","check_failed");var f,p;let m;switch(typeof r.clockTolerance){case"string":m=I(r.clockTolerance);break;case"number":m=r.clockTolerance;break;case"undefined":m=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:y}=r,g=(b=y||new Date,Math.floor(b.getTime()/1e3));var b;if((void 0!==o.iat||l)&&"number"!=typeof o.iat)throw new d('"iat" claim must be a number',"iat","invalid");if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new d('"nbf" claim must be a number',"nbf","invalid");if(o.nbf>g+m)throw new d('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==o.exp){if("number"!=typeof o.exp)throw new d('"exp" claim must be a number',"exp","invalid");if(o.exp<=g-m)throw new h('"exp" claim timestamp check failed',"exp","check_failed")}if(l){const e=g-o.iat;if(e-m>("number"==typeof l?l:I(l)))throw new h('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-m)throw new d('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return o};function L(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(F)}function F(e){return _(e)}class H{constructor(e){if(this._cached=new WeakMap,!L(e))throw new g("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:n}={...e,...null==t?void 0:t.header},o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new m('Unsupported "alg" value for a JSON Web Key Set')}}(r),s=this._jwks.keys.filter((e=>{let t=o===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t})),{0:i,length:a}=s;if(0===a)throw new b;if(1!==a){const e=new E,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of s)try{yield await J(t,e,r)}catch(e){continue}},e}return J(this._cached,i,r)}}async function J(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await async function(e,t,r){var n;if(!_(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?O({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):l(e.k);case"RSA":if(void 0!==e.oth)throw new m('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return O({...e,alg:t});default:throw new m('Unsupported "kty" (Key Type) Parameter value')}}({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new g("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}class B extends H{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(r){if(r instanceof b&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw r}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(async(e,t,r)=>{let n,o,s=!1;"function"==typeof AbortController&&(n=new AbortController,o=setTimeout((()=>{s=!0,n.abort()}),t));const i=await fetch(e.href,{signal:n?n.signal:void 0,redirect:"manual",headers:r.headers}).catch((e=>{if(s)throw new S;throw e}));if(void 0!==o&&clearTimeout(o),200!==i.status)throw new f("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch(e){throw new f("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{if(!L(e))throw new g("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}function M(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:z}=Object,V=(q=Object.create(null),e=>{const t=$.call(e);return q[t]||(q[t]=t.slice(8,-1).toLowerCase())});var q;const G=e=>(e=e.toLowerCase(),t=>V(t)===e),X=e=>t=>typeof t===e,{isArray:Y}=Array,Z=X("undefined"),Q=G("ArrayBuffer"),ee=X("string"),te=X("function"),re=X("number"),ne=e=>null!==e&&"object"==typeof e,oe=e=>{if("object"!==V(e))return!1;const t=z(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},se=G("Date"),ie=G("File"),ae=G("Blob"),ce=G("FileList"),ue=G("URLSearchParams");function le(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),Y(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(n=0;n<s;n++)i=o[n],t.call(null,e[i],i,e)}}const fe=(de="undefined"!=typeof Uint8Array&&z(Uint8Array),e=>de&&e instanceof de);var de;const he=G("HTMLFormElement"),pe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),me=G("RegExp"),ye=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};le(r,((r,o)=>{!1!==t(r,o,e)&&(n[o]=r)})),Object.defineProperties(e,n)},we={isArray:Y,isArrayBuffer:Q,isBuffer:function(e){return null!==e&&!Z(e)&&null!==e.constructor&&!Z(e.constructor)&&te(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||$.call(e)===t||te(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Q(e.buffer),t},isString:ee,isNumber:re,isBoolean:e=>!0===e||!1===e,isObject:ne,isPlainObject:oe,isUndefined:Z,isDate:se,isFile:ie,isBlob:ae,isRegExp:me,isFunction:te,isStream:e=>ne(e)&&te(e.pipe),isURLSearchParams:ue,isTypedArray:fe,isFileList:ce,forEach:le,merge:function e(){const t={},r=(r,n)=>{oe(t[n])&&oe(r)?t[n]=e(t[n],r):oe(r)?t[n]=e({},r):Y(r)?t[n]=r.slice():t[n]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&le(arguments[e],r);return t},extend:(e,t,r,{allOwnKeys:n}={})=>(le(t,((t,n)=>{r&&te(t)?e[n]=M(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&z(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:V,kindOfTest:G,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(Y(e))return e;let t=e.length;if(!re(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:he,hasOwnProperty:pe,hasOwnProp:pe,reduceDescriptors:ye,freezeMethods:e=>{ye(e,((t,r)=>{const n=e[r];te(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return Y(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t)};function ge(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}we.inherits(ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const be=ge.prototype,Ee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Ee[e]={value:e}})),Object.defineProperties(ge,Ee),Object.defineProperty(be,"isAxiosError",{value:!0}),ge.from=(e,t,r,n,o,s)=>{const i=Object.create(be);return we.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ge.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Se=ge,ve=r(230);function Ae(e){return we.isPlainObject(e)||we.isArray(e)}function Re(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,r){return e?e.concat(t).map((function(e,t){return e=Re(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const _e=we.toFlatObject(we,{},null,(function(e){return/^is[A-Z]/.test(e)})),Te=function(e,t,r){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new(ve||FormData);const n=(r=we.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!we.isUndefined(t[e])}))).metaTokens,o=r.visitor||l,s=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&(c=t)&&we.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator];var c;if(!we.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(we.isDate(e))return e.toISOString();if(!a&&we.isBlob(e))throw new Se("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(e)||we.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(we.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(we.isArray(e)&&function(e){return we.isArray(e)&&!e.some(Ae)}(e)||we.isFileList(e)||we.endsWith(r,"[]")&&(a=we.toArray(e)))return r=Re(r),a.forEach((function(e,n){!we.isUndefined(e)&&null!==e&&t.append(!0===i?Oe([r],n,s):null===i?r:r+"[]",u(e))})),!1;return!!Ae(e)||(t.append(Oe(o,r,s),u(e)),!1)}const f=[],d=Object.assign(_e,{defaultVisitor:l,convertValue:u,isVisitable:Ae});if(!we.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!we.isUndefined(r)){if(-1!==f.indexOf(r))throw Error("Circular reference detected in "+n.join("."));f.push(r),we.forEach(r,(function(r,s){!0===(!(we.isUndefined(r)||null===r)&&o.call(t,r,we.isString(s)?s.trim():s,n,d))&&e(r,n?n.concat(s):[s])})),f.pop()}}(e),t};function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ke(e,t){this._pairs=[],e&&Te(e,this,t)}const Pe=ke.prototype;Pe.append=function(e,t){this._pairs.push([e,t])},Pe.toString=function(e){const t=e?function(t){return e.call(this,t,Ce)}:Ce;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const xe=ke;function je(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function De(e,t,r){if(!t)return e;const n=r&&r.encode||je,o=r&&r.serialize;let s;if(s=o?o(t,r):we.isURLSearchParams(t)?t.toString():new xe(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Ne=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ie="undefined"!=typeof URLSearchParams?URLSearchParams:xe,Ke=FormData,We=(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),Le={isBrowser:!0,classes:{URLSearchParams:Ie,FormData:Ke,Blob},isStandardBrowserEnv:We,protocols:["http","https","file","blob","url","data"]},Fe=function(e){function t(e,r,n,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&we.isArray(n)?n.length:s,a?(we.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!i):(n[s]&&we.isObject(n[s])||(n[s]=[]),t(e,r,n[s],o)&&we.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}(n[s])),!i)}if(we.isFormData(e)&&we.isFunction(e.entries)){const r={};return we.forEachEntry(e,((e,n)=>{t(function(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null},He=Le.isStandardBrowserEnv?{write:function(e,t,r,n,o,s){const i=[];i.push(e+"="+encodeURIComponent(t)),we.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),we.isString(n)&&i.push("path="+n),we.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Je(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Be=Le.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=we.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Me(e,t,r){Se.call(this,null==e?"canceled":e,Se.ERR_CANCELED,t,r),this.name="CanceledError"}we.inherits(Me,Se,{__CANCEL__:!0});const $e=Me,ze=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ve=Symbol("internals"),qe=Symbol("defaults");function Ge(e){return e&&String(e).trim().toLowerCase()}function Xe(e){return!1===e||null==e?e:we.isArray(e)?e.map(Xe):String(e)}function Ye(e,t,r,n){return we.isFunction(n)?n.call(this,t,r):we.isString(t)?we.isString(n)?-1!==t.indexOf(n):we.isRegExp(n)?n.test(t):void 0:void 0}function Ze(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}function Qe(e,t){e&&this.set(e),this[qe]=t||null}Object.assign(Qe.prototype,{set:function(e,t,r){const n=this;function o(e,t,r){const o=Ge(t);if(!o)throw new Error("header name must be a non-empty string");const s=Ze(n,o);(!s||!0===r||!1!==n[s]&&!1!==r)&&(n[s||t]=Xe(e))}return we.isPlainObject(e)?we.forEach(e,((e,r)=>{o(e,r,t)})):o(t,e,r),this},get:function(e,t){if(!(e=Ge(e)))return;const r=Ze(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(we.isFunction(t))return t.call(this,e,r);if(we.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,t){if(e=Ge(e)){const r=Ze(this,e);return!(!r||t&&!Ye(0,this[r],r,t))}return!1},delete:function(e,t){const r=this;let n=!1;function o(e){if(e=Ge(e)){const o=Ze(r,e);!o||t&&!Ye(0,r[o],o,t)||(delete r[o],n=!0)}}return we.isArray(e)?e.forEach(o):o(e),n},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const t=this,r={};return we.forEach(this,((n,o)=>{const s=Ze(r,o);if(s)return t[s]=Xe(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();i!==o&&delete t[o],t[i]=Xe(n),r[i]=!0})),this},toJSON:function(e){const t=Object.create(null);return we.forEach(Object.assign({},this[qe]||null,this),((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&we.isArray(r)?r.join(", "):r)})),t}}),Object.assign(Qe,{from:function(e){return we.isString(e)?new this((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&ze[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e)):e instanceof this?e:new this(e)},accessor:function(e){const t=(this[Ve]=this[Ve]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Ge(e);t[n]||(function(e,t){const r=we.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return we.isArray(e)?e.forEach(n):n(e),this}}),Qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),we.freezeMethods(Qe.prototype),we.freezeMethods(Qe);const et=Qe,tt=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=n[i];o||(o=c),r[s]=a,n[s]=c;let l=i,f=0;for(;l!==s;)f+=r[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}};function rt(e,t){let r=0;const n=tt(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-r,c=n(a);r=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0};u[t?"download":"upload"]=!0,e(u)}}function nt(e){return new Promise((function(t,r){let n=e.data;const o=et.from(e.headers).normalize(),s=e.responseType;let i;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}we.isFormData(n)&&Le.isStandardBrowserEnv&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}const u=Je(e.baseURL,e.url);function l(){if(!c)return;const n=et.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Se("Request failed with status code "+r.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),a()}),(function(e){r(e),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),De(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(r(new Se("Request aborted",Se.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new Se("Network Error",Se.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Ue;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new Se(t,n.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,e,c)),c=null},Le.isStandardBrowserEnv){const t=(e.withCredentials||Be(u))&&e.xsrfCookieName&&He.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===n&&o.setContentType(null),"setRequestHeader"in c&&we.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),we.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",rt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",rt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(r(!t||t.type?new $e(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===Le.protocols.indexOf(f)?r(new Se("Unsupported protocol "+f+":",Se.ERR_BAD_REQUEST,e)):c.send(n||null)}))}const ot={http:nt,xhr:nt},st=e=>{if(we.isString(e)){const t=ot[e];if(!e)throw Error(we.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return t}if(!we.isFunction(e))throw new TypeError("adapter is not a function");return e},it={"Content-Type":"application/x-www-form-urlencoded"},at={transitional:Ue,adapter:function(){let e;return"undefined"!=typeof XMLHttpRequest?e=st("xhr"):"undefined"!=typeof process&&"process"===we.kindOf(process)&&(e=st("http")),e}(),transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=we.isObject(e);if(o&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return n&&n?JSON.stringify(Fe(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Te(e,new Le.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Le.isNode&&we.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(we.isString(e))try{return(0,JSON.parse)(e),we.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||at.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&we.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw Se.from(e,Se.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Le.classes.FormData,Blob:Le.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};we.forEach(["delete","get","head"],(function(e){at.headers[e]={}})),we.forEach(["post","put","patch"],(function(e){at.headers[e]=we.merge(it)}));const ct=at;function ut(e,t){const r=this||ct,n=t||r,o=et.from(n.headers);let s=n.data;return we.forEach(e,(function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function lt(e){return!(!e||!e.__CANCEL__)}function ft(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $e}function dt(e){return ft(e),e.headers=et.from(e.headers),e.data=ut.call(e,e.transformRequest),(e.adapter||ct.adapter)(e).then((function(t){return ft(e),t.data=ut.call(e,e.transformResponse,t),t.headers=et.from(t.headers),t}),(function(t){return lt(t)||(ft(e),t&&t.response&&(t.response.data=ut.call(e,e.transformResponse,t.response),t.response.headers=et.from(t.response.headers))),Promise.reject(t)}))}function ht(e,t){t=t||{};const r={};function n(e,t){return we.isPlainObject(e)&&we.isPlainObject(t)?we.merge(e,t):we.isPlainObject(t)?we.merge({},t):we.isArray(t)?t.slice():t}function o(r){return we.isUndefined(t[r])?we.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function s(e){if(!we.isUndefined(t[e]))return n(void 0,t[e])}function i(r){return we.isUndefined(t[r])?we.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function a(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a};return we.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){const t=c[e]||o,n=t(e);we.isUndefined(n)&&t!==a||(r[e]=n)})),r}const pt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{pt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const mt={};pt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.1.3] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new Se(n(o," has been removed"+(t?" in "+t:"")),Se.ERR_DEPRECATED);return t&&!mt[o]&&(mt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}};const yt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const t=e[s],r=void 0===t||i(t,s,e);if(!0!==r)throw new Se("option "+s+" must be "+r,Se.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Se("Unknown option "+s,Se.ERR_BAD_OPTION)}},validators:pt},wt=yt.validators;class gt{constructor(e){this.defaults=e,this.interceptors={request:new Ne,response:new Ne}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ht(this.defaults,t);const{transitional:r,paramsSerializer:n}=t;void 0!==r&&yt.assertOptions(r,{silentJSONParsing:wt.transitional(wt.boolean),forcedJSONParsing:wt.transitional(wt.boolean),clarifyTimeoutError:wt.transitional(wt.boolean)},!1),void 0!==n&&yt.assertOptions(n,{encode:wt.function,serialize:wt.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();const o=t.headers&&we.merge(t.headers.common,t.headers[t.method]);o&&we.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),t.headers=new et(t.headers,o);const s=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const a=[];let c;this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)}));let u,l=0;if(!i){const e=[dt.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,a),u=e.length,c=Promise.resolve(t);l<u;)c=c.then(e[l++],e[l++]);return c}u=s.length;let f=t;for(l=0;l<u;){const e=s[l++],t=s[l++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=dt.call(this,f)}catch(e){return Promise.reject(e)}for(l=0,u=a.length;l<u;)c=c.then(a[l++],a[l++]);return c}getUri(e){return De(Je((e=ht(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}we.forEach(["delete","get","head","options"],(function(e){gt.prototype[e]=function(t,r){return this.request(ht(r||{},{method:e,url:t,data:(r||{}).data}))}})),we.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(ht(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}gt.prototype[e]=t(),gt.prototype[e+"Form"]=t(!0)}));const bt=gt;class Et{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new $e(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Et((function(t){e=t})),cancel:e}}}const St=Et,vt=function e(t){const r=new bt(t),n=M(bt.prototype.request,r);return we.extend(n,bt.prototype,r,{allOwnKeys:!0}),we.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(ht(t,r))},n}(ct);vt.Axios=bt,vt.CanceledError=$e,vt.CancelToken=St,vt.isCancel=lt,vt.VERSION="1.1.3",vt.toFormData=Te,vt.AxiosError=Se,vt.Cancel=vt.CanceledError,vt.all=function(e){return Promise.all(e)},vt.spread=function(e){return function(t){return e.apply(null,t)}},vt.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},vt.formToJSON=e=>Fe(we.isHTMLForm(e)?new FormData(e):e);const At=vt,{Axios:Rt,AxiosError:Ot,CanceledError:_t,isCancel:Tt,CancelToken:Ct,VERSION:kt,all:Pt,Cancel:xt,isAxiosError:jt,spread:Dt,toFormData:Nt}=At,Ut=At,It=new function(){let e=Ut.create();this.configure=t=>{e=t(e)},this.get=()=>e};class Kt{constructor(e,t,r,n,o){this.userID=e,this.userIdentifier=t,this.userFullName=r,this.email=n,this.phoneNumber=o}}class Wt{#e=null;error;#t;#r=null;#n=null;#o;constructor(e,t){this.#t=e,It.configure((r=>(r.defaults.baseURL=e,r.defaults.timeout=6e4,r.defaults.withCredentials=!0,""!==t&&(r.defaults.headers.common["X-Corbado-ProjectID"]=t),r.defaults.headers.common["X-Corbado-Client-Timezone"]=Intl.DateTimeFormat().resolvedOptions().timeZone,r)))}#s=async e=>{const t=function(e,t){const r=new B(e,void 0);return async function(e,t){return r.getKey(e,t)}}(new URL(this.#t+"/.well-known/jwks")),{payload:r,protectedHeader:n}=await async function(e,t,r){var n;const o=await N(e,t,r);if((null===(n=o.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===o.protectedHeader.b64)throw new w("JWTs MUST NOT use unencoded payload");const s={payload:W(o.protectedHeader,o.payload,r),protectedHeader:o.protectedHeader};return"function"==typeof t?{...s,key:o.key}:s}(e,t,{});return{protectedHeader:n,payload:r}};#i=()=>It.get().put("/v1/sessions/refresh").then((e=>(function(e){var t;e.shortSession&&(t=e.shortSession,o.set(t.key,t.value,{path:t.path,expires:new Date(t.expires),secure:t.secure,sameSite:t.sameSite,domain:t.domain}))}(e.data),e.data))).catch((e=>{if("AxiosError"!==e.name)throw e;return"ERR_NETWORK"===e.code?(this.error="Network error - please check cors settings",void this.#a()):e.response&&401===e.response.status?(this.#e=null,void this.#o(this.#e)):void 0}));#a=()=>{null===this.#n&&(this.#n=setInterval((()=>{this.#i().then((()=>{clearInterval(this.#n)}))}),1e5))};#c=()=>{this.#i().then((e=>{null!==e&&this.#u()}))};#u=()=>{this.#s(s("cbo_short_session")).then((e=>{const t=Math.floor(e.payload.exp-(new Date).getTime()/1e3);console.log("jwt expires in "+t+" sec"),this.#e=new Kt(e.payload.sub,e.payload.Orig,e.payload.Name,e.payload.email??"",e.payload.phone_number??""),this.#o(this.#e),t<=10?this.#c():this.#r=setTimeout(this.#c,1e3*(t-10))}))};#l=()=>""!==s("cbo_short_session");initialize(e){this.#o=e;let t=!1;this.#l()&&(t=!0,this.#u()),setInterval((()=>{const e=this.#l();if(e&&null===this.#r){if(t)return void(t=!1);this.#u()}else e||null===this.#r||(clearTimeout(this.#r),this.#r=null)}),200)}get currentUser(){return this.#e}isAuthed(){return null!==this.#e}logout(){It.get().delete("/v1/sessions/logout").catch((e=>{console.error(e)}))}}class Lt extends Wt{}})();var o=n.Z;export{o as default}; | ||
var e={230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};(()=>{function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}r.d(n,{Z:()=>Lt});var t=function t(r,n){function o(t,o,s){if("undefined"!=typeof document){"number"==typeof(s=e({},n,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in s)s[a]&&(i+="; "+a,!0!==s[a]&&(i+="="+s[a].split(";")[0]));return document.cookie=t+"="+r.write(o,t)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},o=0;o<t.length;o++){var s=t[o].split("="),i=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(n[a]=r.read(i,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(t,r){o(t,"",e({},r,{expires:-1}))},withAttributes:function(r){return t(this.converter,e({},this.attributes,r))},withConverter:function(r){return t(e({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(r)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const o=t;function s(e){const t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():""}const i=crypto,a=e=>e instanceof CryptoKey,c=new TextEncoder,u=new TextDecoder;const l=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r})(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class f extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class h extends f{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}class d extends f{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}class p extends f{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class m extends f{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class y extends f{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class w extends f{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class g extends f{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class b extends f{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class E extends f{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator;class S extends f{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class v extends f{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}i.getRandomValues.bind(i);const A=e=>a(e),R=["CryptoKey"],O=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:o}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new m(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new m('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),s=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:o];if("PBKDF2"===n.name)return i.subtle.importKey("raw",l(e.k),...s);const a={...e};return delete a.alg,delete a.use,i.subtle.importKey("jwk",a,...s)};function _(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function T(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const C=(e,...t)=>T("Key must be ",e,...t);function k(e,t,...r){return T(`Key for the ${e} algorithm must be `,t,...r)}function P(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function x(e,t){return e.name===t}function j(e){return parseInt(e.name.slice(4),10)}function D(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!x(e.algorithm,"HMAC"))throw P("HMAC");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!x(e.algorithm,"RSASSA-PKCS1-v1_5"))throw P("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!x(e.algorithm,"RSA-PSS"))throw P("RSA-PSS");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw P("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!x(e.algorithm,"ECDSA"))throw P("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw P(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}!function(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}Symbol();async function N(e,t,r){if(e instanceof Uint8Array&&(e=u.decode(e)),"string"!=typeof e)throw new y("Compact JWS must be a string or Uint8Array");const{0:n,1:o,2:s,length:f}=e.split(".");if(3!==f)throw new y("Invalid Compact JWS");const h=await async function(e,t,r){var n;if(!_(e))throw new y("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new y('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new y("JWS Protected Header incorrect type");if(void 0===e.payload)throw new y("JWS Payload missing");if("string"!=typeof e.signature)throw new y("JWS Signature missing or incorrect type");if(void 0!==e.header&&!_(e.header))throw new y("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const t=l(e.protected);o=JSON.parse(u.decode(t))}catch(e){throw new y("JWS Protected Header is invalid")}if(!((...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0})(o,e.header))throw new y("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const s={...o,...e.header};let f=!0;if(function(e,t,r,n,o){if(void 0!==o.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;s=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!s.has(t))throw new m(`Extension Header Parameter "${t}" is not recognized`);if(void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(s.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}(y,new Map([["b64",!0]]),null==r?void 0:r.crit,o,s).has("b64")&&(f=o.b64,"boolean"!=typeof f))throw new y('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:h}=s;if("string"!=typeof h||!h)throw new y('JWS "alg" (Algorithm) Header Parameter missing or invalid');const d=r&&((e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)})("algorithms",r.algorithms);if(d&&!d.has(h))throw new p('"alg" (Algorithm) Header Parameter not allowed');if(f){if("string"!=typeof e.payload)throw new y("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new y("JWS Payload must be a string or an Uint8Array instance");let w=!1;"function"==typeof t&&(t=await t(o,e),w=!0),((e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!A(t))throw new TypeError(k(e,t,...R,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${R.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!A(t))throw new TypeError(k(e,t,...R));if("secret"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)})(h,t,"verify");const g=function(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}(c.encode(null!==(n=e.protected)&&void 0!==n?n:""),c.encode("."),"string"==typeof e.payload?c.encode(e.payload):e.payload),b=l(e.signature);if(!await(async(e,t,r,n)=>{const o=await function(e,t,r){if(a(t))return D(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(C(t,...R));return i.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(C(t,...R,"Uint8Array"))}(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,o);const s=function(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new m(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,o.algorithm);try{return await i.subtle.verify(s,o,r,n)}catch(e){return!1}})(h,t,b,g))throw new v;let E;E=f?l(e.payload):"string"==typeof e.payload?c.encode(e.payload):e.payload;const S={payload:E};return void 0!==e.protected&&(S.protectedHeader=o),void 0!==e.header&&(S.unprotectedHeader=e.header),w?{...S,key:t}:S}({payload:o,protected:n,signature:s},t,r),d={payload:h.payload,protectedHeader:h.protectedHeader};return"function"==typeof t?{...d,key:h.key}:d}const U=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,I=e=>{const t=U.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(86400*r);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}},K=e=>e.toLowerCase().replace(/^application\//,""),W=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||K(e.typ)!==K(n)))throw new h('unexpected "typ" JWT header value',"typ","check_failed");let o;try{o=JSON.parse(u.decode(t))}catch(e){}if(!_(o))throw new w("JWT Claims Set must be a top-level JSON object");const{requiredClaims:s=[],issuer:i,subject:a,audience:c,maxTokenAge:l}=r;void 0!==l&&s.push("iat"),void 0!==c&&s.push("aud"),void 0!==a&&s.push("sub"),void 0!==i&&s.push("iss");for(const e of new Set(s.reverse()))if(!(e in o))throw new h(`missing required "${e}" claim`,e,"missing");if(i&&!(Array.isArray(i)?i:[i]).includes(o.iss))throw new h('unexpected "iss" claim value',"iss","check_failed");if(a&&o.sub!==a)throw new h('unexpected "sub" claim value',"sub","check_failed");if(c&&(p="string"==typeof c?[c]:c,!("string"==typeof(f=o.aud)?p.includes(f):Array.isArray(f)&&p.some(Set.prototype.has.bind(new Set(f))))))throw new h('unexpected "aud" claim value',"aud","check_failed");var f,p;let m;switch(typeof r.clockTolerance){case"string":m=I(r.clockTolerance);break;case"number":m=r.clockTolerance;break;case"undefined":m=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:y}=r,g=(b=y||new Date,Math.floor(b.getTime()/1e3));var b;if((void 0!==o.iat||l)&&"number"!=typeof o.iat)throw new h('"iat" claim must be a number',"iat","invalid");if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new h('"nbf" claim must be a number',"nbf","invalid");if(o.nbf>g+m)throw new h('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==o.exp){if("number"!=typeof o.exp)throw new h('"exp" claim must be a number',"exp","invalid");if(o.exp<=g-m)throw new d('"exp" claim timestamp check failed',"exp","check_failed")}if(l){const e=g-o.iat;if(e-m>("number"==typeof l?l:I(l)))throw new d('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-m)throw new h('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return o};function L(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(F)}function F(e){return _(e)}class H{constructor(e){if(this._cached=new WeakMap,!L(e))throw new g("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:n}={...e,...null==t?void 0:t.header},o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new m('Unsupported "alg" value for a JSON Web Key Set')}}(r),s=this._jwks.keys.filter((e=>{let t=o===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t})),{0:i,length:a}=s;if(0===a)throw new b;if(1!==a){const e=new E,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of s)try{yield await J(t,e,r)}catch(e){continue}},e}return J(this._cached,i,r)}}async function J(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await async function(e,t,r){var n;if(!_(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?O({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):l(e.k);case"RSA":if(void 0!==e.oth)throw new m('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return O({...e,alg:t});default:throw new m('Unsupported "kty" (Key Type) Parameter value')}}({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new g("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}class B extends H{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(r){if(r instanceof b&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw r}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(async(e,t,r)=>{let n,o,s=!1;"function"==typeof AbortController&&(n=new AbortController,o=setTimeout((()=>{s=!0,n.abort()}),t));const i=await fetch(e.href,{signal:n?n.signal:void 0,redirect:"manual",headers:r.headers}).catch((e=>{if(s)throw new S;throw e}));if(void 0!==o&&clearTimeout(o),200!==i.status)throw new f("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch(e){throw new f("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{if(!L(e))throw new g("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}function M(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:z}=Object,V=(q=Object.create(null),e=>{const t=$.call(e);return q[t]||(q[t]=t.slice(8,-1).toLowerCase())});var q;const G=e=>(e=e.toLowerCase(),t=>V(t)===e),X=e=>t=>typeof t===e,{isArray:Y}=Array,Z=X("undefined"),Q=G("ArrayBuffer"),ee=X("string"),te=X("function"),re=X("number"),ne=e=>null!==e&&"object"==typeof e,oe=e=>{if("object"!==V(e))return!1;const t=z(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},se=G("Date"),ie=G("File"),ae=G("Blob"),ce=G("FileList"),ue=G("URLSearchParams");function le(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),Y(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(n=0;n<s;n++)i=o[n],t.call(null,e[i],i,e)}}const fe=(he="undefined"!=typeof Uint8Array&&z(Uint8Array),e=>he&&e instanceof he);var he;const de=G("HTMLFormElement"),pe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),me=G("RegExp"),ye=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};le(r,((r,o)=>{!1!==t(r,o,e)&&(n[o]=r)})),Object.defineProperties(e,n)},we={isArray:Y,isArrayBuffer:Q,isBuffer:function(e){return null!==e&&!Z(e)&&null!==e.constructor&&!Z(e.constructor)&&te(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||$.call(e)===t||te(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Q(e.buffer),t},isString:ee,isNumber:re,isBoolean:e=>!0===e||!1===e,isObject:ne,isPlainObject:oe,isUndefined:Z,isDate:se,isFile:ie,isBlob:ae,isRegExp:me,isFunction:te,isStream:e=>ne(e)&&te(e.pipe),isURLSearchParams:ue,isTypedArray:fe,isFileList:ce,forEach:le,merge:function e(){const t={},r=(r,n)=>{oe(t[n])&&oe(r)?t[n]=e(t[n],r):oe(r)?t[n]=e({},r):Y(r)?t[n]=r.slice():t[n]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&le(arguments[e],r);return t},extend:(e,t,r,{allOwnKeys:n}={})=>(le(t,((t,n)=>{r&&te(t)?e[n]=M(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&z(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:V,kindOfTest:G,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(Y(e))return e;let t=e.length;if(!re(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:de,hasOwnProperty:pe,hasOwnProp:pe,reduceDescriptors:ye,freezeMethods:e=>{ye(e,((t,r)=>{const n=e[r];te(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return Y(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t)};function ge(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}we.inherits(ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const be=ge.prototype,Ee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Ee[e]={value:e}})),Object.defineProperties(ge,Ee),Object.defineProperty(be,"isAxiosError",{value:!0}),ge.from=(e,t,r,n,o,s)=>{const i=Object.create(be);return we.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ge.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Se=ge,ve=r(230);function Ae(e){return we.isPlainObject(e)||we.isArray(e)}function Re(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,r){return e?e.concat(t).map((function(e,t){return e=Re(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const _e=we.toFlatObject(we,{},null,(function(e){return/^is[A-Z]/.test(e)})),Te=function(e,t,r){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new(ve||FormData);const n=(r=we.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!we.isUndefined(t[e])}))).metaTokens,o=r.visitor||l,s=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&(c=t)&&we.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator];var c;if(!we.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(we.isDate(e))return e.toISOString();if(!a&&we.isBlob(e))throw new Se("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(e)||we.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(we.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(we.isArray(e)&&function(e){return we.isArray(e)&&!e.some(Ae)}(e)||we.isFileList(e)||we.endsWith(r,"[]")&&(a=we.toArray(e)))return r=Re(r),a.forEach((function(e,n){!we.isUndefined(e)&&null!==e&&t.append(!0===i?Oe([r],n,s):null===i?r:r+"[]",u(e))})),!1;return!!Ae(e)||(t.append(Oe(o,r,s),u(e)),!1)}const f=[],h=Object.assign(_e,{defaultVisitor:l,convertValue:u,isVisitable:Ae});if(!we.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!we.isUndefined(r)){if(-1!==f.indexOf(r))throw Error("Circular reference detected in "+n.join("."));f.push(r),we.forEach(r,(function(r,s){!0===(!(we.isUndefined(r)||null===r)&&o.call(t,r,we.isString(s)?s.trim():s,n,h))&&e(r,n?n.concat(s):[s])})),f.pop()}}(e),t};function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ke(e,t){this._pairs=[],e&&Te(e,this,t)}const Pe=ke.prototype;Pe.append=function(e,t){this._pairs.push([e,t])},Pe.toString=function(e){const t=e?function(t){return e.call(this,t,Ce)}:Ce;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const xe=ke;function je(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function De(e,t,r){if(!t)return e;const n=r&&r.encode||je,o=r&&r.serialize;let s;if(s=o?o(t,r):we.isURLSearchParams(t)?t.toString():new xe(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Ne=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ie="undefined"!=typeof URLSearchParams?URLSearchParams:xe,Ke=FormData,We=(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),Le={isBrowser:!0,classes:{URLSearchParams:Ie,FormData:Ke,Blob},isStandardBrowserEnv:We,protocols:["http","https","file","blob","url","data"]},Fe=function(e){function t(e,r,n,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&we.isArray(n)?n.length:s,a?(we.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!i):(n[s]&&we.isObject(n[s])||(n[s]=[]),t(e,r,n[s],o)&&we.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}(n[s])),!i)}if(we.isFormData(e)&&we.isFunction(e.entries)){const r={};return we.forEachEntry(e,((e,n)=>{t(function(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null},He=Le.isStandardBrowserEnv?{write:function(e,t,r,n,o,s){const i=[];i.push(e+"="+encodeURIComponent(t)),we.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),we.isString(n)&&i.push("path="+n),we.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Je(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Be=Le.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=we.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Me(e,t,r){Se.call(this,null==e?"canceled":e,Se.ERR_CANCELED,t,r),this.name="CanceledError"}we.inherits(Me,Se,{__CANCEL__:!0});const $e=Me,ze=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ve=Symbol("internals"),qe=Symbol("defaults");function Ge(e){return e&&String(e).trim().toLowerCase()}function Xe(e){return!1===e||null==e?e:we.isArray(e)?e.map(Xe):String(e)}function Ye(e,t,r,n){return we.isFunction(n)?n.call(this,t,r):we.isString(t)?we.isString(n)?-1!==t.indexOf(n):we.isRegExp(n)?n.test(t):void 0:void 0}function Ze(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}function Qe(e,t){e&&this.set(e),this[qe]=t||null}Object.assign(Qe.prototype,{set:function(e,t,r){const n=this;function o(e,t,r){const o=Ge(t);if(!o)throw new Error("header name must be a non-empty string");const s=Ze(n,o);(!s||!0===r||!1!==n[s]&&!1!==r)&&(n[s||t]=Xe(e))}return we.isPlainObject(e)?we.forEach(e,((e,r)=>{o(e,r,t)})):o(t,e,r),this},get:function(e,t){if(!(e=Ge(e)))return;const r=Ze(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(we.isFunction(t))return t.call(this,e,r);if(we.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,t){if(e=Ge(e)){const r=Ze(this,e);return!(!r||t&&!Ye(0,this[r],r,t))}return!1},delete:function(e,t){const r=this;let n=!1;function o(e){if(e=Ge(e)){const o=Ze(r,e);!o||t&&!Ye(0,r[o],o,t)||(delete r[o],n=!0)}}return we.isArray(e)?e.forEach(o):o(e),n},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const t=this,r={};return we.forEach(this,((n,o)=>{const s=Ze(r,o);if(s)return t[s]=Xe(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();i!==o&&delete t[o],t[i]=Xe(n),r[i]=!0})),this},toJSON:function(e){const t=Object.create(null);return we.forEach(Object.assign({},this[qe]||null,this),((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&we.isArray(r)?r.join(", "):r)})),t}}),Object.assign(Qe,{from:function(e){return we.isString(e)?new this((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&ze[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e)):e instanceof this?e:new this(e)},accessor:function(e){const t=(this[Ve]=this[Ve]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Ge(e);t[n]||(function(e,t){const r=we.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return we.isArray(e)?e.forEach(n):n(e),this}}),Qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),we.freezeMethods(Qe.prototype),we.freezeMethods(Qe);const et=Qe,tt=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=n[i];o||(o=c),r[s]=a,n[s]=c;let l=i,f=0;for(;l!==s;)f+=r[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const h=u&&c-u;return h?Math.round(1e3*f/h):void 0}};function rt(e,t){let r=0;const n=tt(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-r,c=n(a);r=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0};u[t?"download":"upload"]=!0,e(u)}}function nt(e){return new Promise((function(t,r){let n=e.data;const o=et.from(e.headers).normalize(),s=e.responseType;let i;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}we.isFormData(n)&&Le.isStandardBrowserEnv&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}const u=Je(e.baseURL,e.url);function l(){if(!c)return;const n=et.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Se("Request failed with status code "+r.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),a()}),(function(e){r(e),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),De(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(r(new Se("Request aborted",Se.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new Se("Network Error",Se.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Ue;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new Se(t,n.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,e,c)),c=null},Le.isStandardBrowserEnv){const t=(e.withCredentials||Be(u))&&e.xsrfCookieName&&He.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===n&&o.setContentType(null),"setRequestHeader"in c&&we.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),we.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",rt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",rt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(r(!t||t.type?new $e(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===Le.protocols.indexOf(f)?r(new Se("Unsupported protocol "+f+":",Se.ERR_BAD_REQUEST,e)):c.send(n||null)}))}const ot={http:nt,xhr:nt},st=e=>{if(we.isString(e)){const t=ot[e];if(!e)throw Error(we.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return t}if(!we.isFunction(e))throw new TypeError("adapter is not a function");return e},it={"Content-Type":"application/x-www-form-urlencoded"},at={transitional:Ue,adapter:function(){let e;return"undefined"!=typeof XMLHttpRequest?e=st("xhr"):"undefined"!=typeof process&&"process"===we.kindOf(process)&&(e=st("http")),e}(),transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=we.isObject(e);if(o&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return n&&n?JSON.stringify(Fe(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Te(e,new Le.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Le.isNode&&we.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(we.isString(e))try{return(0,JSON.parse)(e),we.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||at.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&we.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw Se.from(e,Se.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Le.classes.FormData,Blob:Le.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};we.forEach(["delete","get","head"],(function(e){at.headers[e]={}})),we.forEach(["post","put","patch"],(function(e){at.headers[e]=we.merge(it)}));const ct=at;function ut(e,t){const r=this||ct,n=t||r,o=et.from(n.headers);let s=n.data;return we.forEach(e,(function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function lt(e){return!(!e||!e.__CANCEL__)}function ft(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $e}function ht(e){return ft(e),e.headers=et.from(e.headers),e.data=ut.call(e,e.transformRequest),(e.adapter||ct.adapter)(e).then((function(t){return ft(e),t.data=ut.call(e,e.transformResponse,t),t.headers=et.from(t.headers),t}),(function(t){return lt(t)||(ft(e),t&&t.response&&(t.response.data=ut.call(e,e.transformResponse,t.response),t.response.headers=et.from(t.response.headers))),Promise.reject(t)}))}function dt(e,t){t=t||{};const r={};function n(e,t){return we.isPlainObject(e)&&we.isPlainObject(t)?we.merge(e,t):we.isPlainObject(t)?we.merge({},t):we.isArray(t)?t.slice():t}function o(r){return we.isUndefined(t[r])?we.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function s(e){if(!we.isUndefined(t[e]))return n(void 0,t[e])}function i(r){return we.isUndefined(t[r])?we.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function a(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a};return we.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){const t=c[e]||o,n=t(e);we.isUndefined(n)&&t!==a||(r[e]=n)})),r}const pt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{pt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const mt={};pt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.1.3] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new Se(n(o," has been removed"+(t?" in "+t:"")),Se.ERR_DEPRECATED);return t&&!mt[o]&&(mt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}};const yt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const t=e[s],r=void 0===t||i(t,s,e);if(!0!==r)throw new Se("option "+s+" must be "+r,Se.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Se("Unknown option "+s,Se.ERR_BAD_OPTION)}},validators:pt},wt=yt.validators;class gt{constructor(e){this.defaults=e,this.interceptors={request:new Ne,response:new Ne}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=dt(this.defaults,t);const{transitional:r,paramsSerializer:n}=t;void 0!==r&&yt.assertOptions(r,{silentJSONParsing:wt.transitional(wt.boolean),forcedJSONParsing:wt.transitional(wt.boolean),clarifyTimeoutError:wt.transitional(wt.boolean)},!1),void 0!==n&&yt.assertOptions(n,{encode:wt.function,serialize:wt.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();const o=t.headers&&we.merge(t.headers.common,t.headers[t.method]);o&&we.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),t.headers=new et(t.headers,o);const s=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const a=[];let c;this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)}));let u,l=0;if(!i){const e=[ht.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,a),u=e.length,c=Promise.resolve(t);l<u;)c=c.then(e[l++],e[l++]);return c}u=s.length;let f=t;for(l=0;l<u;){const e=s[l++],t=s[l++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=ht.call(this,f)}catch(e){return Promise.reject(e)}for(l=0,u=a.length;l<u;)c=c.then(a[l++],a[l++]);return c}getUri(e){return De(Je((e=dt(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}we.forEach(["delete","get","head","options"],(function(e){gt.prototype[e]=function(t,r){return this.request(dt(r||{},{method:e,url:t,data:(r||{}).data}))}})),we.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(dt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}gt.prototype[e]=t(),gt.prototype[e+"Form"]=t(!0)}));const bt=gt;class Et{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new $e(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Et((function(t){e=t})),cancel:e}}}const St=Et,vt=function e(t){const r=new bt(t),n=M(bt.prototype.request,r);return we.extend(n,bt.prototype,r,{allOwnKeys:!0}),we.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(dt(t,r))},n}(ct);vt.Axios=bt,vt.CanceledError=$e,vt.CancelToken=St,vt.isCancel=lt,vt.VERSION="1.1.3",vt.toFormData=Te,vt.AxiosError=Se,vt.Cancel=vt.CanceledError,vt.all=function(e){return Promise.all(e)},vt.spread=function(e){return function(t){return e.apply(null,t)}},vt.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},vt.formToJSON=e=>Fe(we.isHTMLForm(e)?new FormData(e):e);const At=vt,{Axios:Rt,AxiosError:Ot,CanceledError:_t,isCancel:Tt,CancelToken:Ct,VERSION:kt,all:Pt,Cancel:xt,isAxiosError:jt,spread:Dt,toFormData:Nt}=At,Ut=At,It=new function(){let e=Ut.create();this.configure=t=>{e=t(e)},this.get=()=>e};class Kt{constructor(e,t,r,n,o){this.userID=e,this.userIdentifier=t,this.userFullName=r,this.email=n,this.phoneNumber=o}}class Wt{#e=null;error;#t;#r=null;#n=null;#o=null;#s;constructor(e,t){this.#t=e,It.configure((r=>(r.defaults.baseURL=e,r.defaults.timeout=6e4,r.defaults.withCredentials=!0,""!==t&&(r.defaults.headers.common["X-Corbado-ProjectID"]=t),r.defaults.headers.common["X-Corbado-Client-Timezone"]=Intl.DateTimeFormat().resolvedOptions().timeZone,r)))}#i=async e=>{const t=function(e,t){const r=new B(e,void 0);return async function(e,t){return r.getKey(e,t)}}(new URL(this.#t+"/.well-known/jwks")),{payload:r,protectedHeader:n}=await async function(e,t,r){var n;const o=await N(e,t,r);if((null===(n=o.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===o.protectedHeader.b64)throw new w("JWTs MUST NOT use unencoded payload");const s={payload:W(o.protectedHeader,o.payload,r),protectedHeader:o.protectedHeader};return"function"==typeof t?{...s,key:o.key}:s}(e,t,{});return{protectedHeader:n,payload:r}};#a=()=>It.get().put("/v1/sessions/refresh").then((e=>(function(e){var t;e.shortSession&&(t=e.shortSession,o.set(t.key,t.value,{path:t.path,expires:new Date(t.expires),secure:t.secure,sameSite:t.sameSite,domain:t.domain}))}(e.data),e.data))).catch((e=>{if("AxiosError"!==e.name)throw e;return"ERR_NETWORK"===e.code?(this.error="Network error - please check cors settings",void this.#c()):e.response&&401===e.response.status?(this.#e=null,void this.#s(this.#e)):void 0}));#c=()=>{null===this.#o&&(this.#o=setInterval((()=>{this.#a().then((()=>{clearInterval(this.#o),this.#o=null}))}),1e5))};#u=()=>{this.#a().then((e=>{null!==e&&this.#l()}))};#l=()=>{this.#i(s("cbo_short_session")).then((e=>{const t=Math.floor(e.payload.exp-(new Date).getTime()/1e3);console.log("jwt expires in "+t+" sec"),this.#e=new Kt(e.payload.sub,e.payload.Orig,e.payload.Name,e.payload.email??"",e.payload.phone_number??""),this.#s(this.#e),t<=10?this.#u():this.#r=setTimeout(this.#u,1e3*(t-10))}))};#f=()=>""!==s("cbo_short_session");initialize(e){if(this.#s=e,null!==this.#n)return;let t=!1;this.#f()&&(t=!0,this.#l()),this.#n=setInterval((()=>{const e=this.#f();if(e&&null===this.#r){if(t)return void(t=!1);this.#l()}else e||null===this.#r||(clearTimeout(this.#r),this.#r=null)}),200)}get currentUser(){return this.#e}isAuthed(){return null!==this.#e}logout(){It.get().delete("/v1/sessions/logout").catch((e=>{console.error(e)}))}}class Lt extends Wt{}})();var o=n.Z;export{o as default}; | ||
//# sourceMappingURL=session.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1696029
1230