@selfcommunity/api-services
Version:
Client api for SelfCommunity.
2 lines • 102 kB
JavaScript
/*! For license information please see 956.js.LICENSE.txt */
"use strict";(self.webpackChunkSelfCommunityApiServices=self.webpackChunkSelfCommunityApiServices||[]).push([[956],{14:(e,t,r)=>{function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:o}=Object,i=(s=Object.create(null),e=>{const t=a.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const c=e=>(e=e.toLowerCase(),t=>i(t)===e),d=e=>t=>typeof t===e,{isArray:u}=Array,l=d("undefined"),p=c("ArrayBuffer"),h=d("string"),f=d("function"),y=d("number"),w=e=>null!==e&&"object"==typeof e,m=e=>{if("object"!==i(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},g=c("Date"),E=c("File"),b=c("Blob"),S=c("FileList"),A=c("URLSearchParams");function v(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,a;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let i;for(n=0;n<o;n++)i=a[n],t.call(null,e[i],i,e)}}function _(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,a=r.length;for(;a-- >0;)if(n=r[a],t===n.toLowerCase())return n;return null}const P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,H=e=>!l(e)&&e!==P,C=(O="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>O&&e instanceof O);var O;const R=c("HTMLFormElement"),T=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),k=c("RegExp"),K=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};v(r,((r,a)=>{!1!==t(r,a,e)&&(n[a]=r)})),Object.defineProperties(e,n)},W="abcdefghijklmnopqrstuvwxyz",x="0123456789",J={DIGIT:x,ALPHA:W,ALPHA_DIGIT:W+W.toUpperCase()+x},U=c("AsyncFunction");var D={isArray:u,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||f(e.append)&&("formdata"===(t=i(e))||"object"===t&&f(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:h,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:m,isUndefined:l,isDate:g,isFile:E,isBlob:b,isRegExp:k,isFunction:f,isStream:e=>w(e)&&f(e.pipe),isURLSearchParams:A,isTypedArray:C,isFileList:S,forEach:v,merge:function e(){const{caseless:t}=H(this)&&this||{},r={},n=(n,a)=>{const o=t&&_(r,a)||a;m(r[o])&&m(n)?r[o]=e(r[o],n):m(n)?r[o]=e({},n):u(n)?r[o]=n.slice():r[o]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&v(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:a}={})=>(v(t,((t,a)=>{r&&f(t)?e[a]=n(t,r):e[a]=t}),{allOwnKeys:a}),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 a,i,s;const c={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)s=a[i],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&o(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:c,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(u(e))return e;let t=e.length;if(!y(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:R,hasOwnProperty:T,hasOwnProp:T,reduceDescriptors:K,freezeMethods:e=>{K(e,((t,r)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];f(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return u(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),findKey:_,global:P,isContextDefined:H,ALPHABET:J,generateString:(e=16,t=J.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const a=u(e)?[]:{};return v(e,((e,t)=>{const o=r(e,n+1);!l(o)&&(a[t]=o)})),t[n]=void 0,a}}return e};return r(e,0)},isAsyncFn:U,isThenable:e=>e&&(w(e)||f(e))&&f(e.then)&&f(e.catch)};function I(e,t,r,n,a){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),a&&(this.response=a)}D.inherits(I,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:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const j=I.prototype,N={};function M(e){return D.isPlainObject(e)||D.isArray(e)}function B(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function L(e,t,r){return e?e.concat(t).map((function(e,t){return e=B(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}["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=>{N[e]={value:e}})),Object.defineProperties(I,N),Object.defineProperty(j,"isAxiosError",{value:!0}),I.from=(e,t,r,n,a,o)=>{const i=Object.create(j);return D.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),I.call(i,e.message,t,r,n,a),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const F=D.toFlatObject(D,{},null,(function(e){return/^is[A-Z]/.test(e)}));function G(e,t,r){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=D.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!D.isUndefined(t[e])}))).metaTokens,a=r.visitor||d,o=r.dots,i=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(a))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(D.isDate(e))return e.toISOString();if(!s&&D.isBlob(e))throw new I("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(e)||D.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,r,a){let s=e;if(e&&!a&&"object"==typeof e)if(D.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(D.isArray(e)&&function(e){return D.isArray(e)&&!e.some(M)}(e)||(D.isFileList(e)||D.endsWith(r,"[]"))&&(s=D.toArray(e)))return r=B(r),s.forEach((function(e,n){!D.isUndefined(e)&&null!==e&&t.append(!0===i?L([r],n,o):null===i?r:r+"[]",c(e))})),!1;return!!M(e)||(t.append(L(a,r,o),c(e)),!1)}const u=[],l=Object.assign(F,{defaultVisitor:d,convertValue:c,isVisitable:M});if(!D.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!D.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),D.forEach(r,(function(r,o){!0===(!(D.isUndefined(r)||null===r)&&a.call(t,r,D.isString(o)?o.trim():o,n,l))&&e(r,n?n.concat(o):[o])})),u.pop()}}(e),t}function $(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function z(e,t){this._pairs=[],e&&G(e,this,t)}const V=z.prototype;function q(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(e,t,r){if(!t)return e;const n=r&&r.encode||q,a=r&&r.serialize;let o;if(o=a?a(t,r):D.isURLSearchParams(t)?t.toString():new z(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}V.append=function(e,t){this._pairs.push([e,t])},V.toString=function(e){const t=e?function(t){return e.call(this,t,$)}:$;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Y=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){D.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Q={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Z={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:z,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,r,n,a){let o=e[a++];const i=Number.isFinite(+o),s=a>=e.length;return o=!o&&D.isArray(n)?n.length:o,s?(D.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i):(n[o]&&D.isObject(n[o])||(n[o]=[]),t(e,r,n[o],a)&&D.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const a=r.length;let o;for(n=0;n<a;n++)o=r[n],t[o]=e[o];return t}(n[o])),!i)}if(D.isFormData(e)&&D.isFunction(e.entries)){const r={};return D.forEachEntry(e,((e,n)=>{t(function(e){return D.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const te={"Content-Type":void 0},re={transitional:Q,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,a=D.isObject(e);if(a&&D.isHTMLForm(e)&&(e=new FormData(e)),D.isFormData(e))return n&&n?JSON.stringify(ee(e)):e;if(D.isArrayBuffer(e)||D.isBuffer(e)||D.isStream(e)||D.isFile(e)||D.isBlob(e))return e;if(D.isArrayBufferView(e))return e.buffer;if(D.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return G(e,new Z.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Z.isNode&&D.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=D.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return G(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||n?(t.setContentType("application/json",!1),function(e,t,r){if(D.isString(e))try{return(0,JSON.parse)(e),D.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||re.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&D.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 I.from(e,I.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:Z.classes.FormData,Blob:Z.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};D.forEach(["delete","get","head"],(function(e){re.headers[e]={}})),D.forEach(["post","put","patch"],(function(e){re.headers[e]=D.merge(te)}));var ne=re;const ae=D.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"]),oe=Symbol("internals");function ie(e){return e&&String(e).trim().toLowerCase()}function se(e){return!1===e||null==e?e:D.isArray(e)?e.map(se):String(e)}function ce(e,t,r,n,a){return D.isFunction(n)?n.call(this,t,r):(a&&(t=r),D.isString(t)?D.isString(n)?-1!==t.indexOf(n):D.isRegExp(n)?n.test(t):void 0:void 0)}class de{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function a(e,t,r){const a=ie(t);if(!a)throw new Error("header name must be a non-empty string");const o=D.findKey(n,a);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=se(e))}const o=(e,t)=>D.forEach(e,((e,r)=>a(e,r,t)));return D.isPlainObject(e)||e instanceof this.constructor?o(e,t):D.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let r,n,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),r=e.substring(0,a).trim().toLowerCase(),n=e.substring(a+1).trim(),!r||t[r]&&ae[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&a(t,e,r),this}get(e,t){if(e=ie(e)){const r=D.findKey(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(D.isFunction(t))return t.call(this,e,r);if(D.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ie(e)){const r=D.findKey(this,e);return!(!r||void 0===this[r]||t&&!ce(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function a(e){if(e=ie(e)){const a=D.findKey(r,e);!a||t&&!ce(0,r[a],a,t)||(delete r[a],n=!0)}}return D.isArray(e)?e.forEach(a):a(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const a=t[r];e&&!ce(0,this[a],a,e,!0)||(delete this[a],n=!0)}return n}normalize(e){const t=this,r={};return D.forEach(this,((n,a)=>{const o=D.findKey(r,a);if(o)return t[o]=se(n),void delete t[a];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(a):String(a).trim();i!==a&&delete t[a],t[i]=se(n),r[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return D.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&D.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ie(e);t[n]||(function(e,t){const r=D.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,a){return this[n].call(this,t,e,r,a)},configurable:!0})}))}(r,e),t[n]=!0)}return D.isArray(e)?e.forEach(n):n(e),this}}de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.freezeMethods(de.prototype),D.freezeMethods(de);var ue=de;function le(e,t){const r=this||ne,n=t||r,a=ue.from(n.headers);let o=n.data;return D.forEach(e,(function(e){o=e.call(r,o,a.normalize(),t?t.status:void 0)})),a.normalize(),o}function pe(e){return!(!e||!e.__CANCEL__)}function he(e,t,r){I.call(this,null==e?"canceled":e,I.ERR_CANCELED,t,r),this.name="CanceledError"}D.inherits(he,I,{__CANCEL__:!0});var fe=Z.isStandardBrowserEnv?{write:function(e,t,r,n,a,o){const i=[];i.push(e+"="+encodeURIComponent(t)),D.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),D.isString(n)&&i.push("path="+n),D.isString(a)&&i.push("domain="+a),!0===o&&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 ye(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}var we=Z.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=D.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function me(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a,o=0,i=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),d=n[i];a||(a=c),r[o]=s,n[o]=c;let u=i,l=0;for(;u!==o;)l+=r[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const p=d&&c-d;return p?Math.round(1e3*l/p):void 0}}(50,250);return a=>{const o=a.loaded,i=a.lengthComputable?a.total:void 0,s=o-r,c=n(s);r=o;const d={loaded:o,total:i,progress:i?o/i:void 0,bytes:s,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:a};d[t?"download":"upload"]=!0,e(d)}}const ge={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const a=ue.from(e.headers).normalize(),o=e.responseType;let i;function s(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}D.isFormData(n)&&(Z.isStandardBrowserEnv||Z.isStandardBrowserWebWorkerEnv?a.setContentType(!1):a.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(t+":"+r))}const d=ye(e.baseURL,e.url);function u(){if(!c)return;const n=ue.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),X(d,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=u:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=function(){c&&(r(new I("Request aborted",I.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new I("Network Error",I.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||Q;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new I(t,n.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,c)),c=null},Z.isStandardBrowserEnv){const t=(e.withCredentials||we(d))&&e.xsrfCookieName&&fe.read(e.xsrfCookieName);t&&a.set(e.xsrfHeaderName,t)}void 0===n&&a.setContentType(null),"setRequestHeader"in c&&D.forEach(a.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),D.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",me(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",me(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(r(!t||t.type?new he(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 l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);l&&-1===Z.protocols.indexOf(l)?r(new I("Unsupported protocol "+l+":",I.ERR_BAD_REQUEST,e)):c.send(n||null)}))}};D.forEach(ge,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function be(e){return Ee(e),e.headers=ue.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=D.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let a=0;a<t&&(r=e[a],!(n=D.isString(r)?ge[r.toLowerCase()]:r));a++);if(!n){if(!1===n)throw new I(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(D.hasOwnProp(ge,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!D.isFunction(n))throw new TypeError("adapter is not a function");return n})(e.adapter||ne.adapter)(e).then((function(t){return Ee(e),t.data=le.call(e,e.transformResponse,t),t.headers=ue.from(t.headers),t}),(function(t){return pe(t)||(Ee(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=ue.from(t.response.headers))),Promise.reject(t)}))}const Se=e=>e instanceof ue?e.toJSON():e;function Ae(e,t){t=t||{};const r={};function n(e,t,r){return D.isPlainObject(e)&&D.isPlainObject(t)?D.merge.call({caseless:r},e,t):D.isPlainObject(t)?D.merge({},t):D.isArray(t)?t.slice():t}function a(e,t,r){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!D.isUndefined(t))return n(void 0,t)}function i(e,t){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,a,o){return o in t?n(r,a):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,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:s,headers:(e,t)=>a(Se(e),Se(t),!0)};return D.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=c[n]||a,i=o(e[n],t[n],n);D.isUndefined(i)&&o!==s||(r[n]=i)})),r}const ve={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ve[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const _e={};ve.transitional=function(e,t,r){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,a,o)=>{if(!1===e)throw new I(n(a," has been removed"+(t?" in "+t:"")),I.ERR_DEPRECATED);return t&&!_e[a]&&(_e[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,a,o)}};var Pe={assertOptions:function(e,t,r){if("object"!=typeof e)throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const o=n[a],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new I("option "+o+" must be "+r,I.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new I("Unknown option "+o,I.ERR_BAD_OPTION)}},validators:ve};const He=Pe.validators;class Ce{constructor(e){this.defaults=e,this.interceptors={request:new Y,response:new Y}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ae(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:a}=t;let o;void 0!==r&&Pe.assertOptions(r,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean)},!1),null!=n&&(D.isFunction(n)?t.paramsSerializer={serialize:n}:Pe.assertOptions(n,{encode:He.function,serialize:He.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),o=a&&D.merge(a.common,a[t.method]),o&&D.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=ue.concat(o,a);const i=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let d;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,l=0;if(!s){const e=[be.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),u=e.length,d=Promise.resolve(t);l<u;)d=d.then(e[l++],e[l++]);return d}u=i.length;let p=t;for(l=0;l<u;){const e=i[l++],t=i[l++];try{p=e(p)}catch(e){t.call(this,e);break}}try{d=be.call(this,p)}catch(e){return Promise.reject(e)}for(l=0,u=c.length;l<u;)d=d.then(c[l++],c[l++]);return d}getUri(e){return X(ye((e=Ae(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}D.forEach(["delete","get","head","options"],(function(e){Ce.prototype[e]=function(t,r){return this.request(Ae(r||{},{method:e,url:t,data:(r||{}).data}))}})),D.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,a){return this.request(Ae(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ce.prototype[e]=t(),Ce.prototype[e+"Form"]=t(!0)}));var Oe=Ce;class Re{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,a){r.reason||(r.reason=new he(e,n,a),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 Re((function(t){e=t})),cancel:e}}}var Te=Re;const ke={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ke).forEach((([e,t])=>{ke[t]=e}));var Ke=ke;const We=function e(t){const r=new Oe(t),a=n(Oe.prototype.request,r);return D.extend(a,Oe.prototype,r,{allOwnKeys:!0}),D.extend(a,r,null,{allOwnKeys:!0}),a.create=function(r){return e(Ae(t,r))},a}(ne);We.Axios=Oe,We.CanceledError=he,We.CancelToken=Te,We.isCancel=pe,We.VERSION="1.4.0",We.toFormData=G,We.AxiosError=I,We.Cancel=We.CanceledError,We.all=function(e){return Promise.all(e)},We.spread=function(e){return function(t){return e.apply(null,t)}},We.isAxiosError=function(e){return D.isObject(e)&&!0===e.isAxiosError},We.mergeConfig=Ae,We.AxiosHeaders=ue,We.formToJSON=e=>ee(D.isHTMLForm(e)?new FormData(e):e),We.HttpStatusCode=Ke,We.default=We,e.exports=We},1137:(e,t,r)=>{r.r(t),r.d(t,{CompactEncrypt:()=>Ze,CompactSign:()=>tt,EmbeddedJWK:()=>ut,EncryptJWT:()=>it,FlattenedEncrypt:()=>Ie,FlattenedSign:()=>et,GeneralEncrypt:()=>Ne,GeneralSign:()=>nt,SignJWT:()=>ot,UnsecuredJWT:()=>gt,base64url:()=>a,calculateJwkThumbprint:()=>ct,calculateJwkThumbprintUri:()=>dt,compactDecrypt:()=>ke,compactVerify:()=>Fe,createLocalJWKSet:()=>yt,createRemoteJWKSet:()=>mt,decodeJwt:()=>At,decodeProtectedHeader:()=>St,errors:()=>n,exportJWK:()=>Je,exportPKCS8:()=>xe,exportSPKI:()=>We,flattenedDecrypt:()=>Te,flattenedVerify:()=>Le,generalDecrypt:()=>Ke,generalVerify:()=>Ge,generateKeyPair:()=>_t,generateSecret:()=>Pt,importJWK:()=>Pe,importPKCS8:()=>_e,importSPKI:()=>Ae,importX509:()=>ve,jwtDecrypt:()=>Qe,jwtVerify:()=>Ye});var n={};r.r(n),r.d(n,{JOSEAlgNotAllowed:()=>v,JOSEError:()=>b,JOSENotSupported:()=>_,JWEDecryptionFailed:()=>P,JWEInvalid:()=>H,JWKInvalid:()=>R,JWKSInvalid:()=>T,JWKSMultipleMatchingKeys:()=>K,JWKSNoMatchingKey:()=>k,JWKSTimeout:()=>W,JWSInvalid:()=>C,JWSSignatureVerificationFailed:()=>x,JWTClaimValidationFailed:()=>S,JWTExpired:()=>A,JWTInvalid:()=>O});var a={};r.r(a),r.d(a,{decode:()=>bt,encode:()=>Et});const o=crypto,i=e=>e instanceof CryptoKey,s=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await o.subtle.digest(r,t))},c=new TextEncoder,d=new TextDecoder,u=2**32;function l(...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}function p(e,t,r){if(t<0||t>=u)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function h(e){const t=Math.floor(e/u),r=e%u,n=new Uint8Array(8);return p(n,t,0),p(n,r,4),n}function f(e){const t=new Uint8Array(4);return p(t,e),t}function y(e){return l(f(e.length),e)}const w=e=>{let t=e;"string"==typeof t&&(t=c.encode(t));const r=[];for(let e=0;e<t.length;e+=32768)r.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(r.join(""))},m=e=>w(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),g=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},E=e=>{let t=e;t instanceof Uint8Array&&(t=d.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return g(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class b 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 S extends b{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 A extends b{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 v extends b{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class _ extends b{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class P extends b{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class H extends b{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class C extends b{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class O extends b{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class R extends b{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}class T extends b{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class k extends b{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 K extends b{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 W extends b{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class x extends b{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}const J=o.getRandomValues.bind(o);function U(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new _(`Unsupported JWE Algorithm: ${e}`)}}const D=e=>J(new Uint8Array(U(e)>>3)),I=(e,t)=>{if(t.length<<3!==U(e))throw new H("Invalid Initialization Vector length")},j=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new H(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function N(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function M(e,t){return e.name===t}function B(e){return parseInt(e.name.slice(4),10)}function L(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)}}function F(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!M(e.algorithm,"AES-GCM"))throw N("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw N(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!M(e.algorithm,"AES-KW"))throw N("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw N(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw N("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!M(e.algorithm,"PBKDF2"))throw N("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!M(e.algorithm,"RSA-OAEP"))throw N("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(B(e.algorithm.hash)!==r)throw N(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}L(e,r)}function G(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 $=(e,...t)=>G("Key must be ",e,...t);function z(e,t,...r){return G(`Key for the ${e} algorithm must be `,t,...r)}const V=e=>i(e),q=["CryptoKey"],X=async(e,t,r,n,a,s)=>{if(!(i(t)||t instanceof Uint8Array))throw new TypeError($(t,...q,"Uint8Array"));switch(I(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&j(t,parseInt(e.slice(-3),10)),async function(e,t,r,n,a,i){if(!(t instanceof Uint8Array))throw new TypeError($(t,"Uint8Array"));const s=parseInt(e.slice(1,4),10),c=await o.subtle.importKey("raw",t.subarray(s>>3),"AES-CBC",!1,["decrypt"]),d=await o.subtle.importKey("raw",t.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),u=l(i,n,r,h(i.length<<3)),p=new Uint8Array((await o.subtle.sign("HMAC",d,u)).slice(0,s>>3));let f,y;try{f=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,a=-1;for(;++a<r;)n|=e[a]^t[a];return 0===n})(a,p)}catch(e){}if(!f)throw new P;try{y=new Uint8Array(await o.subtle.decrypt({iv:n,name:"AES-CBC"},c,r))}catch(e){}if(!y)throw new P;return y}(e,t,r,n,a,s);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&j(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,a,i){let s;t instanceof Uint8Array?s=await o.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(F(t,e,"decrypt"),s=t);try{return new Uint8Array(await o.subtle.decrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},s,l(r,a)))}catch(e){throw new P}}(e,t,r,n,a,s);default:throw new _("Unsupported JWE Content Encryption Algorithm")}},Y=async()=>{throw new _('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Q=async()=>{throw new _('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Z=(...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};function ee(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}const te=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function re(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ne(e,t,r){if(i(e))return F(e,t,r),e;if(e instanceof Uint8Array)return o.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError($(e,...q,"Uint8Array"))}const ae=async(e,t,r)=>{const n=await ne(t,e,"wrapKey");re(n,e);const a=await o.subtle.importKey("raw",r,...te);return new Uint8Array(await o.subtle.wrapKey("raw",a,n,"AES-KW"))},oe=async(e,t,r)=>{const n=await ne(t,e,"unwrapKey");re(n,e);const a=await o.subtle.unwrapKey("raw",r,n,"AES-KW",...te);return new Uint8Array(await o.subtle.exportKey("raw",a))};async function ie(e,t,r,n,a=new Uint8Array(0),d=new Uint8Array(0)){if(!i(e))throw new TypeError($(e,...q));if(F(e,"ECDH"),!i(t))throw new TypeError($(t,...q));F(t,"ECDH","deriveBits");const u=l(y(c.encode(r)),y(a),y(d),f(n));let p;return p="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,async function(e,t,r){const n=Math.ceil((t>>3)/32),a=new Uint8Array(32*n);for(let t=0;t<n;t++){const n=new Uint8Array(4+e.length+r.length);n.set(f(t+1)),n.set(e,4),n.set(r,4+e.length),a.set(await s("sha256",n),32*t)}return a.slice(0,t>>3)}(new Uint8Array(await o.subtle.deriveBits({name:e.algorithm.name,public:e},t,p)),n,u)}function se(e){if(!i(e))throw new TypeError($(e,...q));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function ce(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new H("PBES2 Salt Input must be 8 or more octets")}(e);const a=function(e,t){return l(c.encode(e),new Uint8Array([0]),t)}(t,e),s=parseInt(t.slice(13,16),10),d={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:a},u={length:s,name:"AES-KW"},p=await function(e,t){if(e instanceof Uint8Array)return o.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(i(e))return F(e,t,"deriveBits","deriveKey"),e;throw new TypeError($(e,...q,"Uint8Array"))}(n,t);if(p.usages.includes("deriveBits"))return new Uint8Array(await o.subtle.deriveBits(d,p,s));if(p.usages.includes("deriveKey"))return o.subtle.deriveKey(d,p,u,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}function de(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new _(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}const ue=(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`)}};function le(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new _(`Unsupported JWE Algorithm: ${e}`)}}const pe=e=>J(new Uint8Array(le(e)>>3)),he=(e,t)=>`-----BEGIN ${t}-----\n${(e.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${t}-----`,fe=async(e,t,r)=>{if(!i(r))throw new TypeError($(r,...q));if(!r.extractable)throw new TypeError("CryptoKey is not extractable");if(r.type!==e)throw new TypeError(`key is not a ${e} key`);return he(w(new Uint8Array(await o.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},ye=(e,t,r=0)=>{0===r&&(t.unshift(t.length),t.unshift(6));let n=e.indexOf(t[0],r);if(-1===n)return!1;const a=e.subarray(n,n+t.length);return a.length===t.length&&(a.every(((e,r)=>e===t[r]))||ye(e,t,n+1))},we=e=>{switch(!0){case ye(e,[42,134,72,206,61,3,1,7]):return"P-256";case ye(e,[43,129,4,0,34]):return"P-384";case ye(e,[43,129,4,0,35]):return"P-521";case ye(e,[43,101,110]):return"X25519";case ye(e,[43,101,111]):return"X448";case ye(e,[43,101,112]):return"Ed25519";case ye(e,[43,101,113]):return"Ed448";default:throw new _("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},me=async(e,t,r,n,a)=>{var i;let s,c;const d=new Uint8Array(atob(r.replace(e,"")).split("").map((e=>e.charCodeAt(0)))),u="spki"===t;switch(n){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},c=u?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},c=u?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},c=u?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},c=u?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},c=u?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},c=u?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=we(d);s=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},c=u?[]:["deriveBits"];break}case"EdDSA":s={name:we(d)},c=u?["verify"]:["sign"];break;default:throw new _('Invalid or unsupported "alg" (Algorithm) value')}return o.subtle.importKey(t,d,s,null!==(i=null==a?void 0:a.extractable)&&void 0!==i&&i,c)},ge=(e,t,r)=>me(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,r);function Ee(e){let t=[],r=0;for(;r<e.length;){let n=be(e.subarray(r));t.push(n),r+=n.byteLength}return t}function be(e){let t=0,r=31&e[0];if(t++,31===r){for(r=0;e[t]>=128;)r=128*r+e[t]-128,t++;r=128*r+e[t]-128,t++}let n=0;if(e[t]<128)n=e[t],t++;else{if(128===n){for(n=0;0!==e[t+n]||0!==e[t+n+1];){if(n>e.byteLength)throw new TypeError("invalid indefinite form length");n++}const r=t+n+2;return{byteLength:r,contents:e.subarray(t,t+n),raw:e.subarray(0,r)}}{let r=127&e[t];t++,n=0;for(let a=0;a<r;a++)n=256*n+e[t],t++}}const a=t+n;return{byteLength:a,contents:e.subarray(t,a),raw:e.subarray(0,a)}}const Se=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:a}=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 _(`${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 _('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 _('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 _('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 _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new _('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),i=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:a];if("PBKDF2"===n.name)return o.subtle.importKey("raw",E(e.k),...i);const s={...e};return delete s.alg,delete s.use,o.subtle.importKey("jwk",s,...i)};async function Ae(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return ge(e,t,r)}async function ve(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return((e,t,r)=>{let n;try{n=function(e){const t=e.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),r=g(t);return he(function(e){const t=Ee(Ee(be(e).contents)[0].contents);return w(t[160===t[0].raw[0]?6:5].raw)}(r),"PUBLIC KEY")}(e)}catch(e){throw new TypeError("failed to parse the X.509 certificate",{cause:e})}return ge(n,t,r)})(e,t,r)}async function _e(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return((e,t,r)=>me(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,r))(e,t,r)}async function Pe(e,t,r){var n;if(!ee(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?Se({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):E(e.k);case"RSA":if(void 0!==e.oth)throw new _('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Se({...e,alg:t});default:throw new _('Unsupported "kty" (Key Type) Parameter value')}}const He=(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(!V(t))throw new TypeError(z(e,t,...q,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${q.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!V(t))throw new TypeError(z(e,t,...q));if("secret"===t.type)throw new TypeError(`${q.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${q.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${q.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${q.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${q.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)},Ce=async(e,t,r,n,a)=>{if(!(i(r)||r instanceof Uint8Array))throw new TypeError($(r,...q,"Uint8Array"));switch(I(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&j(r,parseI