genesys-cloud-client-auth 2.0.0 → 2.0.1-STREAM-1937.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "2.0.0",
2
+ "version": "STREAM-1937",
3
3
  "build": "5",
4
- "buildDate": "2026-05-29T11:36:41.758Z",
4
+ "buildDate": "2026-08-27T18:54:12.956Z",
5
5
  "indexFiles": [
6
6
  {
7
7
  "file": "index.html"
@@ -10,7 +10,7 @@
10
10
  "file": "/v2/genesys-cloud-client-auth.browser.min.js"
11
11
  },
12
12
  {
13
- "file": "/v2.0.0/genesys-cloud-client-auth.browser.min.js"
13
+ "file": "/v2.0.1/genesys-cloud-client-auth.browser.min.js"
14
14
  }
15
15
  ],
16
16
  "team": "Client Streaming and Signaling",
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{GenesysCloudClientAuthenticator:()=>Pt,TimeoutError:()=>s,VERSION:()=>r,authenticatorFactory:()=>Nt,default:()=>kt,handleRedirectFromLogin:()=>xt,isIssuedTimeWithinTimeframe:()=>l,isIssuedTimeWithinWindow:()=>u,parseOauthParams:()=>a,tokenWasIssuedAt:()=>d});var n={};e.r(n),e.d(n,{hasBrowserEnv:()=>Oe,hasStandardBrowserEnv:()=>Se,hasStandardBrowserWebWorkerEnv:()=>ve,navigator:()=>Re,origin:()=>Te}),Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;const r="2.0.0",o="color: #f29f2c";class s extends Error{constructor(){super(...arguments),this.name="TIMEOUT_ERROR"}}class i extends Error{constructor(e,t){const n=t&&t instanceof Error;super(n?t.message:t),n&&(this.name=t.name),this.translationKey=e}}const a=(e=window.location.hash)=>{const t={},n={},r=new RegExp("^#*(.+?)=(.+?)$","i");if(e.split("&").forEach(e=>{const n=r.exec(e);n&&(t[n[1]]=decodeURIComponent(decodeURIComponent(n[2].replace(/\+/g,"%20"))))}),t.error)return t;if(t.access_token){if(t.state&&(n.state=t.state),t.expires_in){const e=1e3*parseInt(t.expires_in.replace(/\+/g,"%20"));n.tokenExpiryTime=Date.now()+e,n.tokenExpiryTimeString=new Date(n.tokenExpiryTime).toISOString()}n.accessToken=t.access_token.replace(/\+/g,"%20")}return n},c=(e,t)=>{t?(console.log(`%c [DEBUG:gc-client-auth:${r}] ${e}`,o,t),"object"==typeof t&&console.log(`%c [DEBUG:gc-client-auth:${r}] ^ stringified: ${JSON.stringify(t)}`,o)):console.log(`%c [DEBUG:gc-client-auth:${r}] ${e}`,o)},l=(e,t=691199e3,n=168e4,r=Date.now())=>r-d(e,t)<n,u=(e,t,n)=>l(e,t,n),d=(e,t)=>e-t;function f(e,t){return function(){return e.apply(t,arguments)}}const{toString:h}=Object.prototype,{getPrototypeOf:p}=Object,{iterator:g,toStringTag:m}=Symbol,b=(y=Object.create(null),e=>{const t=h.call(e);return y[t]||(y[t]=t.slice(8,-1).toLowerCase())});var y;const w=e=>(e=e.toLowerCase(),t=>b(t)===e),E=e=>t=>typeof t===e,{isArray:O}=Array,R=E("undefined");function S(e){return null!==e&&!R(e)&&null!==e.constructor&&!R(e.constructor)&&_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const v=w("ArrayBuffer"),T=E("string"),_=E("function"),A=E("number"),C=e=>null!==e&&"object"==typeof e,P=e=>{if("object"!==b(e))return!1;const t=p(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||m in e||g in e)},x=w("Date"),U=w("File"),N=w("Blob"),k=w("FileList"),D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},j=void 0!==D.FormData?D.FormData:void 0,L=w("URLSearchParams"),[I,F,B,M]=["ReadableStream","Request","Response","Headers"].map(w);function q(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),O(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(S(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function $(e,t){if(S(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,H=e=>!R(e)&&e!==z,J=(W="undefined"!=typeof Uint8Array&&p(Uint8Array),e=>W&&e instanceof W);var W;const K=w("HTMLFormElement"),V=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),G=w("RegExp"),X=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};q(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)},Q=w("AsyncFunction"),Y=(Z="function"==typeof setImmediate,ee=_(z.postMessage),Z?setImmediate:ee?(te=`axios@${Math.random()}`,ne=[],z.addEventListener("message",({source:e,data:t})=>{e===z&&t===te&&ne.length&&ne.shift()()},!1),e=>{ne.push(e),z.postMessage(te,"*")}):e=>setTimeout(e));var Z,ee,te,ne;const re="undefined"!=typeof queueMicrotask?queueMicrotask.bind(z):"undefined"!=typeof process&&process.nextTick||Y,oe={isArray:O,isArrayBuffer:v,isBuffer:S,isFormData:e=>{if(!e)return!1;if(j&&e instanceof j)return!0;const t=p(e);if(!t||t===Object.prototype)return!1;if(!_(e.append))return!1;const n=b(e);return"formdata"===n||"object"===n&&_(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&v(e.buffer),t},isString:T,isNumber:A,isBoolean:e=>!0===e||!1===e,isObject:C,isPlainObject:P,isEmptyObject:e=>{if(!C(e)||S(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:I,isRequest:F,isResponse:B,isHeaders:M,isUndefined:R,isDate:x,isFile:U,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:N,isRegExp:G,isFunction:_,isStream:e=>C(e)&&_(e.pipe),isURLSearchParams:L,isTypedArray:J,isFileList:k,forEach:q,merge:function e(){const{caseless:t,skipUndefined:n}=H(this)&&this||{},r={},o=(o,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=t&&$(r,s)||s;P(r[i])&&P(o)?r[i]=e(r[i],o):P(o)?r[i]=e({},o):O(o)?r[i]=o.slice():n&&R(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&q(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(q(t,(t,r)=>{n&&_(t)?Object.defineProperty(e,r,{value:f(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),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,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{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],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&p(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:b,kindOfTest:w,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(O(e))return e;let t=e.length;if(!A(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[g]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:K,hasOwnProperty:V,hasOwnProp:V,reduceDescriptors:X,freezeMethods:e=>{X(e,(t,n)=>{if(_(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];_(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return O(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:$,global:z,isContextDefined:H,isSpecCompliantForm:function(e){return!!(e&&_(e.append)&&"FormData"===e[m]&&e[g])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(C(e)){if(t.indexOf(e)>=0)return;if(S(e))return e;if(!("toJSON"in e)){t[r]=e;const o=O(e)?[]:{};return q(e,(e,t)=>{const s=n(e,r+1);!R(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Q,isThenable:e=>e&&(C(e)||_(e))&&_(e.then)&&_(e.catch),setImmediate:Y,asap:re,isIterable:e=>null!=e&&_(e[g])};class se extends Error{static from(e,t,n,r,o,s){const i=new se(e.message,t||e.code,n,r,o);return i.cause=e,i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),s&&Object.assign(i,s),i}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){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:oe.toJSONObject(this.config),code:this.code,status:this.status}}}se.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",se.ERR_BAD_OPTION="ERR_BAD_OPTION",se.ECONNABORTED="ECONNABORTED",se.ETIMEDOUT="ETIMEDOUT",se.ERR_NETWORK="ERR_NETWORK",se.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",se.ERR_DEPRECATED="ERR_DEPRECATED",se.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",se.ERR_BAD_REQUEST="ERR_BAD_REQUEST",se.ERR_CANCELED="ERR_CANCELED",se.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",se.ERR_INVALID_URL="ERR_INVALID_URL",se.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const ie=se;function ae(e){return oe.isPlainObject(e)||oe.isArray(e)}function ce(e){return oe.endsWith(e,"[]")?e.slice(0,-2):e}function le(e,t,n){return e?e.concat(t).map(function(e,t){return e=ce(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ue=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)}),de=function(e,t,n){if(!oe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!oe.isUndefined(t[e])})).metaTokens,o=n.visitor||d,s=n.dots,i=n.indexes,a=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,l=a&&oe.isSpecCompliantForm(t);if(!oe.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(oe.isDate(e))return e.toISOString();if(oe.isBoolean(e))return e.toString();if(!l&&oe.isBlob(e))throw new ie("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(e)||oe.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,o){let a=e;if(oe.isReactNative(t)&&oe.isReactNativeBlob(e))return t.append(le(o,n,s),u(e)),!1;if(e&&!o&&"object"==typeof e)if(oe.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(oe.isArray(e)&&function(e){return oe.isArray(e)&&!e.some(ae)}(e)||(oe.isFileList(e)||oe.endsWith(n,"[]"))&&(a=oe.toArray(e)))return n=ce(n),a.forEach(function(e,r){!oe.isUndefined(e)&&null!==e&&t.append(!0===i?le([n],r,s):null===i?n:n+"[]",u(e))}),!1;return!!ae(e)||(t.append(le(o,n,s),u(e)),!1)}const f=[],h=Object.assign(ue,{defaultVisitor:d,convertValue:u,isVisitable:ae});if(!oe.isObject(e))throw new TypeError("data must be an object");return function e(n,r,s=0){if(!oe.isUndefined(n)){if(s>c)throw new ie("Object is too deeply nested ("+s+" levels). Max depth: "+c,ie.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),oe.forEach(n,function(n,i){!0===(!(oe.isUndefined(n)||null===n)&&o.call(t,n,oe.isString(i)?i.trim():i,r,h))&&e(n,r?r.concat(i):[i],s+1)}),f.pop()}}(e),t};function fe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function he(e,t){this._pairs=[],e&&de(e,this,t)}const pe=he.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,fe)}:fe;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ge=he;function me(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function be(e,t,n){if(!t)return e;const r=n&&n.encode||me,o=oe.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(i=s?s(t,o):oe.isURLSearchParams(t)?t.toString():new ge(t,o).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const ye=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(t){null!==t&&e(t)})}},we={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ge,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Oe="undefined"!=typeof window&&"undefined"!=typeof document,Re="object"==typeof navigator&&navigator||void 0,Se=Oe&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),ve="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Te=Oe&&window.location.href||"http://localhost",_e={...n,...Ee},Ae=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&oe.isArray(r)?r.length:s,a?(oe.hasOwnProp(r,s)?r[s]=oe.isArray(r[s])?r[s].concat(n):[r[s],n]:r[s]=n,!i):(r[s]&&oe.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&oe.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(oe.isFormData(e)&&oe.isFunction(e.entries)){const n={};return oe.forEachEntry(e,(e,r)=>{t(function(e){return oe.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},Ce=(e,t)=>null!=e&&oe.hasOwnProp(e,t)?e[t]:void 0,Pe={transitional:we,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=oe.isObject(e);if(o&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return r?JSON.stringify(Ae(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e)||oe.isReadableStream(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){const t=Ce(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return de(e,new _e.classes.URLSearchParams,{visitor:function(e,t,n,r){return _e.isNode&&oe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=oe.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ce(this,"env"),r=n&&n.FormData;return de(s?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e){if(oe.isString(e))try{return(0,JSON.parse)(e),oe.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ce(this,"transitional")||Pe.transitional,n=t&&t.forcedJSONParsing,r=Ce(this,"responseType"),o="json"===r;if(oe.isResponse(e)||oe.isReadableStream(e))return e;if(e&&oe.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Ce(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw ie.from(e,ie.ERR_BAD_RESPONSE,this,null,Ce(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_e.classes.FormData,Blob:_e.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],e=>{Pe.headers[e]={}});const xe=Pe,Ue=oe.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"]),Ne=Symbol("internals"),ke=/[^\x09\x20-\x7E\x80-\xFF]/g;function De(e){return e&&String(e).trim().toLowerCase()}function je(e){return!1===e||null==e?e:oe.isArray(e)?e.map(je):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(ke,""))}function Le(e,t,n,r,o){return oe.isFunction(r)?r.call(this,t,n):(o&&(t=n),oe.isString(t)?oe.isString(r)?-1!==t.indexOf(r):oe.isRegExp(r)?r.test(t):void 0:void 0)}class Ie{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=De(t);if(!o)throw new Error("header name must be a non-empty string");const s=oe.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=je(e))}const s=(e,t)=>oe.forEach(e,(e,n)=>o(e,n,t));if(oe.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(oe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ue[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(oe.isObject(e)&&oe.isIterable(e)){let n,r,o={};for(const t of e){if(!oe.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?oe.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=De(e)){const n=oe.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(oe.isFunction(t))return t.call(this,e,n);if(oe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=De(e)){const n=oe.findKey(this,e);return!(!n||void 0===this[n]||t&&!Le(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=De(e)){const o=oe.findKey(n,e);!o||t&&!Le(0,n[o],o,t)||(delete n[o],r=!0)}}return oe.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Le(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return oe.forEach(this,(r,o)=>{const s=oe.findKey(n,o);if(s)return t[s]=je(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=je(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return oe.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&oe.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Ne]=this[Ne]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=De(e);t[r]||(function(e,t){const n=oe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return oe.isArray(e)?e.forEach(r):r(e),this}}Ie.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oe.reduceDescriptors(Ie.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),oe.freezeMethods(Ie);const Fe=Ie;function Be(e,t){const n=this||xe,r=t||n,o=Fe.from(r.headers);let s=r.data;return oe.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Me(e){return!(!e||!e.__CANCEL__)}const qe=class extends ie{constructor(e,t,n){super(null==e?"canceled":e,ie.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function $e(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ie("Request failed with status code "+n.status,[ie.ERR_BAD_REQUEST,ie.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const ze=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=l&&c-l;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=null!=i?Math.min(s,i):s,c=Math.max(0,a-r),l=o(c);r=Math.max(r,a),e({loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:l||void 0,estimated:l&&i?(i-a)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},He=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Je=e=>(...t)=>oe.asap(()=>e(...t)),We=_e.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,_e.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(_e.origin),_e.navigator&&/(msie|trident)/i.test(_e.navigator.userAgent)):()=>!0,Ke=_e.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];oe.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),oe.isString(r)&&a.push(`path=${r}`),oe.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),oe.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Ve(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ge=e=>e instanceof Fe?{...e}:e;function Xe(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return oe.isPlainObject(e)&&oe.isPlainObject(t)?oe.merge.call({caseless:r},e,t):oe.isPlainObject(t)?oe.merge({},t):oe.isArray(t)?t.slice():t}function o(e,t,n,o){return oe.isUndefined(t)?oe.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!oe.isUndefined(t))return r(void 0,t)}function i(e,t){return oe.isUndefined(t)?oe.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return oe.hasOwnProp(t,s)?r(n,o):oe.hasOwnProp(e,s)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken: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,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Ge(e),Ge(t),0,!0)};return oe.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=oe.hasOwnProp(c,r)?c[r]:o,i=s(oe.hasOwnProp(e,r)?e[r]:void 0,oe.hasOwnProp(t,r)?t[r]:void 0,r);oe.isUndefined(i)&&s!==a||(n[r]=i)}),n}const Qe=e=>{const t=Xe({},e),n=e=>oe.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let o=n("withXSRFToken");const s=n("xsrfHeaderName"),i=n("xsrfCookieName");let a=n("headers");const c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=a=Fe.from(a),t.url=be(Ve(l,d,u),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),oe.isFormData(r))if(_e.hasStandardBrowserEnv||_e.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(oe.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}if(_e.hasStandardBrowserEnv&&(oe.isFunction(o)&&(o=o(t)),!0===o||null==o&&We(t.url))){const e=s&&i&&Ke.read(i);e&&a.set(s,e)}return t},Ye="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Qe(e);let o=r.data;const s=Fe.from(r.headers).normalize();let i,a,c,l,u,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function p(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=Fe.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());$e(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new ie("Request aborted",ie.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new ie(r,ie.ERR_NETWORK,e,g);o.event=t||null,n(o),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||we;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ie(t,o.clarifyTimeoutError?ie.ETIMEDOUT:ie.ECONNABORTED,e,g)),g=null},void 0===o&&s.setContentType(null),"setRequestHeader"in g&&oe.forEach(s.toJSON(),function(e,t){g.setRequestHeader(t,e)}),oe.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([c,u]=ze(h,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,l]=ze(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{g&&(n(!t||t.type?new qe(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===_e.protocols.indexOf(b)?n(new ie("Unsupported protocol "+b+":",ie.ERR_BAD_REQUEST,e)):g.send(o||null)})},Ze=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof ie?t:new qe(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new ie(`timeout of ${t}ms exceeded`,ie.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>oe.asap(i),a}},et=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},tt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*et(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:nt}=oe,rt=(({Request:e,Response:t})=>({Request:e,Response:t}))(oe.global),{ReadableStream:ot,TextEncoder:st}=oe.global,it=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},at=e=>{e=oe.merge.call({skipUndefined:!0},rt,e);const{fetch:t,Request:n,Response:r}=e,o=t?nt(t):"function"==typeof fetch,s=nt(n),i=nt(r);if(!o)return!1;const a=o&&nt(ot),c=o&&("function"==typeof st?(l=new st,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&it(()=>{let e=!1;const t=new n(_e.origin,{body:new ot,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),d=i&&a&&it(()=>oe.isReadableStream(new r("").body)),f={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ie(`Response type '${e}' is not supported`,ie.ERR_NOT_SUPPORT,n)})});return async e=>{let{url:o,method:i,data:a,signal:l,cancelToken:h,timeout:p,onDownloadProgress:g,onUploadProgress:m,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:E}=Qe(e),O=t||fetch;b=b?(b+"").toLowerCase():"text";let R=Ze([l,h&&h.toAbortSignal()],p),S=null;const v=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let T;try{if(m&&u&&"get"!==i&&"head"!==i&&0!==(T=await(async(e,t)=>{const r=oe.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(oe.isBlob(e))return e.size;if(oe.isSpecCompliantForm(e)){const t=new n(_e.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return oe.isArrayBufferView(e)||oe.isArrayBuffer(e)?e.byteLength:(oe.isURLSearchParams(e)&&(e+=""),oe.isString(e)?(await c(e)).byteLength:void 0)})(t):r})(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(oe.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=He(T,ze(Je(m)));a=tt(t.body,65536,e,n)}}oe.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype;if(oe.isFormData(a)){const e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete("content-type")}const l={...E,signal:R,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,l);let h=await(s?O(S,E):O(o,l));const p=d&&("stream"===b||"response"===b);if(d&&(g||p&&v)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=oe.toFiniteNumber(h.headers.get("content-length")),[n,o]=g&&He(t,ze(Je(g),!0))||[];h=new r(tt(h.body,65536,n,()=>{o&&o(),v&&v()}),e)}b=b||"text";let _=await f[oe.findKey(f,b)||"text"](h,e);return!p&&v&&v(),await new Promise((t,n)=>{$e(t,n,{data:_,headers:Fe.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:S})})}catch(t){if(v&&v(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ie("Network Error",ie.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw ie.from(t,t&&t.code,e,S,t&&t.response)}}},ct=new Map,lt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=ct;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:at(t)),l=a;return a},ut=(lt(),{http:null,xhr:Ye,fetch:{get:lt}});oe.forEach(ut,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const dt=e=>`- ${e}`,ft=e=>oe.isFunction(e)||null===e||!1===e,ht=function(e,t){e=oe.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!ft(r)&&(o=ut[(n=String(r)).toLowerCase()],void 0===o))throw new ie(`Unknown adapter '${n}'`);if(o&&(oe.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(dt).join("\n"):" "+dt(e[0]):"as no adapter specified";throw new ie("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o};function pt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new qe(null,e)}function gt(e){return pt(e),e.headers=Fe.from(e.headers),e.data=Be.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ht(e.adapter||xe.adapter,e)(e).then(function(t){return pt(e),t.data=Be.call(e,e.transformResponse,t),t.headers=Fe.from(t.headers),t},function(t){return Me(t)||(pt(e),t&&t.response&&(t.response.data=Be.call(e,e.transformResponse,t.response),t.response.headers=Fe.from(t.response.headers))),Promise.reject(t)})}const mt="1.15.2",bt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const yt={};bt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+mt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new ie(r(o," has been removed"+(t?" in "+t:"")),ie.ERR_DEPRECATED);return t&&!yt[o]&&(yt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},bt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const wt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ie("options must be an object",ie.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new ie("option "+s+" must be "+n,ie.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new ie("Unknown option "+s,ie.ERR_BAD_OPTION)}},validators:bt},Et=wt.validators;class Ot{constructor(e){this.defaults=e||{},this.interceptors={request:new ye,response:new ye}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),o=-1===r?"":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Xe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&wt.assertOptions(n,{silentJSONParsing:Et.transitional(Et.boolean),forcedJSONParsing:Et.transitional(Et.boolean),clarifyTimeoutError:Et.transitional(Et.boolean),legacyInterceptorReqResOrdering:Et.transitional(Et.boolean)},!1),null!=r&&(oe.isFunction(r)?t.paramsSerializer={serialize:r}:wt.assertOptions(r,{encode:Et.function,serialize:Et.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),wt.assertOptions(t,{baseUrl:Et.spelling("baseURL"),withXsrfToken:Et.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&oe.merge(o.common,o[t.method]);o&&oe.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Fe.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||we;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[gt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let f=t;for(;d<u;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=gt.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return be(Ve((e=Xe(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}oe.forEach(["delete","get","head","options"],function(e){Ot.prototype[e]=function(t,n){return this.request(Xe(n||{},{method:e,url:t,data:(n||{}).data}))}}),oe.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Xe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ot.prototype[e]=t(),Ot.prototype[e+"Form"]=t(!0)});const Rt=Ot;class St{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 n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new qe(e,r,o),t(n.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)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new St(function(t){e=t}),cancel:e}}}const vt=St,Tt={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Tt).forEach(([e,t])=>{Tt[t]=e});const _t=Tt,At=function e(t){const n=new Rt(t),r=f(Rt.prototype.request,n);return oe.extend(r,Rt.prototype,n,{allOwnKeys:!0}),oe.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Xe(t,n))},r}(xe);At.Axios=Rt,At.CanceledError=qe,At.CancelToken=vt,At.isCancel=Me,At.VERSION=mt,At.toFormData=de,At.AxiosError=ie,At.Cancel=At.CanceledError,At.all=function(e){return Promise.all(e)},At.spread=function(e){return function(t){return e.apply(null,t)}},At.isAxiosError=function(e){return oe.isObject(e)&&!0===e.isAxiosError},At.mergeConfig=Xe,At.AxiosHeaders=Fe,At.formToJSON=e=>Ae(oe.isHTMLForm(e)?new FormData(e):e),At.getAdapter=ht,At.HttpStatusCode=_t,At.default=At;const Ct=At;class Pt{constructor(e,t={}){this.VERSION=r,this.clientId=e,t.storageKey||(t.storageKey="gc_client_auth_data"),"boolean"!=typeof t.persist&&(t.persist=!1),this.config=Object.assign({},t),this.customHeaders=t.customHeaders,this.setEnvironment(t.environment),this.timeout=16e3,this.authData={},this.authentications={"PureCloud OAuth":{type:"oauth2"}};try{localStorage.setItem("genesys_cloud_local_storage_test","genesys_cloud_local_storage_test"),localStorage.removeItem("genesys_cloud_local_storage_test"),this.hasLocalStorage=!0}catch(e){this.hasLocalStorage=!1}this._loadSettings()}loginImplicitGrant(e={},t){const n=t||a();return new Promise((t,r)=>{e.org&&!e.provider?r(new Error("opts.provider must be set if opts.org is set")):e.provider&&!e.org?r(new Error("opts.org must be set if opts.provider is set")):e.redirectUri||e.usePopupAuth||r(new Error("redirectUri must be provided for implicit grant and not utilizing client-auth app for popup auth")),n&&n.error&&(n.accessToken=void 0,this._saveSettings(n),r(new Error(`[${n.error}] ${n.error_description}`))),n.accessToken&&this._saveSettings(n),this._testTokenAccess().then(()=>(!this.authData.state&&e.state&&(this.authData.state=e.state),t(this.authData))).catch(n=>{this._debug("Error encountered during login. This is normal if the application has not yet been authorized.",n);const o={client_id:encodeURIComponent(this.clientId),response_type:"token"};if(e.redirectUri&&(o.redirect_uri=encodeURIComponent(e.redirectUri)),e.state&&(o.state=encodeURIComponent(e.state)),e.org&&(o.org=encodeURIComponent(e.org)),e.provider&&(o.provider=encodeURIComponent(e.provider)),e.usePopupAuth){if(!this.hasLocalStorage)return r(new Error("localStorage is unavailable. Cannot authenticate via popup window."));this._debug("using popup auth – adding listener"),this._authenticateViaPopup(o,e.popupTimeout||15e3).then(e=>{this._saveSettings(e),t(e)}).catch(r)}else{const e=this._buildAuthUrl("oauth/authorize",o);this._debug("Implicit grant: redirecting to: "+e),window.location.replace(e),r(new Error(`Routing to login: "${e}"`))}})})}setEnvironment(e){e||(e="mypurecloud.com"),(e=e.replace(/\/+$/,"")).startsWith("https://")&&(e=e.substring(8)),e.startsWith("http://")&&(e=e.substring(7)),e.startsWith("api.")&&(e=e.substring(4)),this.environment=e,this.basePath=`https://api.${e}`,this.authUrl=`https://login.${e}`}clearAuthData(){this._saveSettings({accessToken:void 0,state:void 0,tokenExpiryTime:void 0,tokenExpiryTimeString:void 0})}logout(e){this.clearAuthData();const t={client_id:encodeURIComponent(this.clientId)};e&&(t.redirect_uri=encodeURIComponent(e));const n=this._buildAuthUrl("logout",t);window.location.replace(n)}setAccessToken(e){this._saveSettings({accessToken:e})}testAccessToken(e){return this.callApi("/api/v2/tokens/me","get",e)}parseDate(e){return new Date(e.replace(/T/i," "))}paramToString(e){return e?e instanceof Date?e.toJSON():e.toString():""}buildUrl(e,t={}){return e.match(/^\//)||(e=`/${e}`),(this.basePath+e).replace(/\{([\w-]+)\}/g,(e,n)=>{let r;return r=Object.getOwnPropertyDescriptor(t,n)?this.paramToString(t[n]):e,encodeURIComponent(r)})}callApi(e,t,n){var r;const o=this.buildUrl(e),s={Authorization:`Bearer ${n||(null===(r=this.authData)||void 0===r?void 0:r.accessToken)}`,"Content-Type":"application/json"};this.customHeaders&&Object.entries(this.customHeaders).forEach(([e,t])=>{s[e]=t});const i={method:t,url:o,headers:s,timeout:this.timeout};return Ct.request(i)}_debug(e,t){this.config.debugMode&&c(e,t)}_saveSettings(e){try{if(this.authData.accessToken=e.accessToken,this.authentications["PureCloud OAuth"].accessToken=e.accessToken,e.state&&(this.authData.state=e.state),this.authData.error=e.error,this.authData.error_description=e.error_description,e.tokenExpiryTime&&(this.authData.tokenExpiryTime=e.tokenExpiryTime,this.authData.tokenExpiryTimeString=e.tokenExpiryTimeString),!this.config.persist)return void this._debug("persist is not true. Settings will not be saved.");if(!this.hasLocalStorage)return void this._debug("Warning: Cannot access local storage. Settings will not be saved.");const t=JSON.parse(JSON.stringify(this.authData));delete t.state,localStorage.setItem(this.config.storageKey,JSON.stringify(t)),this._debug("Auth data saved to local storage",t)}catch(e){console.error(e)}}_getId(e){return`gc-ca_${e=e||globalThis.crypto.randomUUID()}`}_authenticateViaPopup(e,t){const n=this._getId(),r=Object.assign(Object.assign({},e),{storageKey:this.config.storageKey});this.config.debugMode&&(r.debug=!0),localStorage.setItem(n,JSON.stringify(r)),e.state=n,e.redirect_uri||(e.redirect_uri=encodeURIComponent(`https://apps.${this.environment}/client-auth`));const o=this._buildAuthUrl("oauth/authorize",e);return new Promise((r,i)=>{this._debug("Implicit grant: opening new window: "+o),window.open(o,"_blank","width=500px,height=500px,noreferrer,noopener,resizable,scrollbars,status");const a=setTimeout(()=>{this._debug("timeout for loginImplicitGrant using popup",e);const t=new s("Popup authentation timeout. It is possible that the popup was blocked or the login page encountered an error");i(t)},t),c=e=>{if(this._debug("value was just written to storage by another app",{key:e.key,newValue:e.newValue,oldValue:e.oldValue}),e.key===this.config.storageKey){this._debug("keys matched. resolving value",{key:e.key,value:e.newValue}),window.removeEventListener("storage",c),clearTimeout(a);const t=JSON.parse(e.newValue);localStorage.removeItem(n),r(t)}};window.addEventListener("storage",c)})}_testTokenAccess(){return e=this,t=void 0,r=function*(){if(this._loadSettings(),!this.authentications["PureCloud OAuth"].accessToken)throw new i("errorTokenNotSet","No access token provided.");try{yield this.callApi("/api/v2/tokens/me","get")}catch(e){throw this._saveSettings({accessToken:void 0}),e}},new((n=void 0)||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())});var e,t,n,r}_loadSettings(){if(!this.config.persist)return;if(!this.hasLocalStorage)return void this._debug("Warning: Cannot access local storage. Settings will not be loaded.");const e=this.authData.state,t=localStorage.getItem(this.config.storageKey);this.authData=t?JSON.parse(t):{},this.authData.accessToken&&this.setAccessToken(this.authData.accessToken),this.authData.state=e}_buildAuthUrl(e,t={}){return Object.keys(t).reduce((e,n)=>t[n]?`${e}&${n}=${t[n]}`:e,`${this.authUrl}/${e}?`)}}const xt=()=>{const e=a();if(e.error)throw new Error(`[${e.error}]: ${e.error_description}`);if(!e.accessToken)throw new i("errorToken","No access token provided.");const t=e.state;if(!t)throw new i("errorStateParam","No state param on redirect. Unable to determine location to save auth data.");const n=JSON.parse(localStorage.getItem(t)||"false");if(!n||!n.storageKey)throw new i("errorParse","Unable to parse information from localStorage.");n.state?e.state=n.state:delete e.state,c(`setting auth data to key: ${n.storageKey}`,e),localStorage.setItem(n.storageKey,JSON.stringify(e)),n.debug?c("In debug mode. Not closing window or removing storageId",{storageId:t,authData:e,href:window.location.href}):(c(`removing temp storage key: ${t}`),localStorage.removeItem(t),c("closing window"),window.close())},Ut=new Map,Nt=(e,t)=>{let n=Ut.get(e);return n||(n=new Pt(e,t),Ut.set(e,n)),n},kt=Nt;window.GenesysCloudClientAuth=t})();
1
+ (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{GenesysCloudClientAuthenticator:()=>sn,TimeoutError:()=>s,VERSION:()=>r,authenticatorFactory:()=>ln,default:()=>un,handleRedirectFromLogin:()=>an,isIssuedTimeWithinTimeframe:()=>l,isIssuedTimeWithinWindow:()=>u,parseOauthParams:()=>a,tokenWasIssuedAt:()=>d});var n={};e.r(n),e.d(n,{hasBrowserEnv:()=>He,hasStandardBrowserEnv:()=>Ke,hasStandardBrowserWebWorkerEnv:()=>Ge,navigator:()=>Ve,origin:()=>Xe}),Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;const r="2.0.1",o="color: #f29f2c";class s extends Error{constructor(){super(...arguments),this.name="TIMEOUT_ERROR"}}class i extends Error{constructor(e,t){const n=t&&t instanceof Error;super(n?t.message:t),n&&(this.name=t.name),this.translationKey=e}}const a=(e=window.location.hash)=>{const t={},n={},r=new RegExp("^#*(.+?)=(.+?)$","i");if(e.split("&").forEach(e=>{const n=r.exec(e);n&&(t[n[1]]=decodeURIComponent(decodeURIComponent(n[2].replace(/\+/g,"%20"))))}),t.error)return t;if(t.access_token){if(t.state&&(n.state=t.state),t.expires_in){const e=1e3*parseInt(t.expires_in.replace(/\+/g,"%20"));n.tokenExpiryTime=Date.now()+e,n.tokenExpiryTimeString=new Date(n.tokenExpiryTime).toISOString()}n.accessToken=t.access_token.replace(/\+/g,"%20")}return n},c=(e,t)=>{t?(console.log(`%c [DEBUG:gc-client-auth:${r}] ${e}`,o,t),"object"==typeof t&&console.log(`%c [DEBUG:gc-client-auth:${r}] ^ stringified: ${JSON.stringify(t)}`,o)):console.log(`%c [DEBUG:gc-client-auth:${r}] ${e}`,o)},l=(e,t=691199e3,n=168e4,r=Date.now())=>r-d(e,t)<n,u=(e,t,n)=>l(e,t,n),d=(e,t)=>e-t;function f(e,t){return function(){return e.apply(t,arguments)}}const{toString:h}=Object.prototype,{getPrototypeOf:p}=Object,{iterator:g,toStringTag:m}=Symbol,b=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),y=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),w=(e,t,n)=>e===Object.prototype||!n&&null===t,O=(e,t)=>{let n=e;const r=[];for(;null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);const o=p(n);if(w(n,o,n===e))return!1;if(b(n,t))return!0;n=o}return!1},E=(S=Object.create(null),e=>{const t=h.call(e);return S[t]||(S[t]=t.slice(8,-1).toLowerCase())});var S;const R=e=>(e=e.toLowerCase(),t=>E(t)===e),_=e=>t=>typeof t===e,{isArray:v}=Array,T=_("undefined");function A(e){return null!==e&&!T(e)&&null!==e.constructor&&!T(e.constructor)&&j(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const P=R("ArrayBuffer"),C=_("string"),j=_("function"),x=_("number"),N=e=>null!==e&&"object"==typeof e,U=e=>{if(!N(e))return!1;const t=p(e);return!(null!==t&&t!==Object.prototype&&null!==p(t)||O(e,m)||O(e,g))},D=R("Date"),k=R("File"),L=R("Blob"),I=R("FileList"),F=R("Set"),B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},q=void 0!==B.FormData?B.FormData:void 0,$=R("URLSearchParams"),[M,z,W,J]=["ReadableStream","Request","Response","Headers"].map(R);function H(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),v(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(A(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function V(e,t){if(A(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,G=e=>!T(e)&&e!==K,X=(Q="undefined"!=typeof Uint8Array&&p(Uint8Array),e=>Q&&e instanceof Q);var Q;const Z=R("HTMLFormElement"),{propertyIsEnumerable:Y}=Object.prototype,ee=R("RegExp"),te=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};H(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)},ne=R("AsyncFunction"),re=(oe="function"==typeof setImmediate,se=j(K.postMessage),oe?setImmediate:se?(ie=`axios@${Math.random()}`,ae=[],K.addEventListener("message",({source:e,data:t})=>{e===K&&t===ie&&ae.length&&ae.shift()()},!1),e=>{ae.push(e),K.postMessage(ie,"*")}):e=>setTimeout(e));var oe,se,ie,ae;const ce="undefined"!=typeof queueMicrotask?queueMicrotask.bind(K):"undefined"!=typeof process&&process.nextTick||re,le=e=>null!=e&&j(e[g]),ue={isArray:v,isArrayBuffer:P,isBuffer:A,isFormData:e=>{if(!e)return!1;if(q&&e instanceof q)return!0;const t=p(e);if(!t||t===Object.prototype)return!1;if(!j(e.append))return!1;const n=E(e);return"formdata"===n||"object"===n&&j(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:C,isNumber:x,isBoolean:e=>!0===e||!1===e,isObject:N,isPlainObject:U,isEmptyObject:e=>{if(!N(e)||A(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:M,isRequest:z,isResponse:W,isHeaders:J,isUndefined:T,isDate:D,isFile:k,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:L,isRegExp:ee,isFunction:j,isStream:e=>N(e)&&j(e.pipe),isURLSearchParams:$,isTypedArray:X,isFileList:I,forEach:H,merge:function e(...t){const{caseless:n,skipUndefined:r}=G(this)&&this||{},o={},s=(t,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=n&&"string"==typeof s&&V(o,s)||s,a=b(o,i)?o[i]:void 0;U(a)&&U(t)?o[i]=e(a,t):U(t)?o[i]=e({},t):v(t)?o[i]=t.slice():r&&T(t)||(o[i]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||A(n))continue;if(H(n,s),"object"!=typeof n||v(n))continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];Y.call(n,t)&&s(n[t],t)}}return o},extend:(e,t,n,{allOwnKeys:r}={})=>(H(t,(t,r)=>{n&&j(t)?Object.defineProperty(e,r,{__proto__:null,value:f(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),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,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{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],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&p(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:E,kindOfTest:R,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(v(e))return e;let t=e.length;if(!x(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[g]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Z,hasOwnProperty:b,hasOwnProp:b,hasOwnInPrototypeChain:O,getSafeProp:(e,t)=>null!=e&&O(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=p(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(y(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;const n=Object.create(null),r=Object.create(null),o=[];let s=e;for(;null!=s&&-1===o.indexOf(s);){o.push(s);const i=s===e?t:p(s);if(w(s,i,s===e))break;const a=Object.getOwnPropertyNames(s);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(s));for(const t of a)y(t)||b(r,t)||(n[t]=e[t],r[t]=!0);s=i}return n},reduceDescriptors:te,freezeMethods:e=>{te(e,(t,n)=>{if(j(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];j(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return v(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:V,global:K,isContextDefined:G,isSpecCompliantForm:function(e){return!!(e&&j(e.append)&&"FormData"===e[m]&&e[g])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(N(e)){if(t.has(e))return;if(A(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),F(e)){r=[];for(const t of e){const e=n(t);!T(e)&&r.push(e)}}else r=v(e)?[]:{},H(e,(e,t)=>{const o=n(e);!T(o)&&(r[t]=o)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:ne,isThenable:e=>e&&(N(e)||j(e))&&j(e.then)&&j(e.catch),setImmediate:re,asap:ce,isIterable:le,isSafeIterable:e=>null!=e&&O(e,g)&&le(e)},de=ue.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"]),fe=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),he=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function pe(e,t){return ue.isArray(e)?e.map(e=>pe(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function ge(e){const t=Object.create(null);return ue.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>pe(e,he))(e)}),t}const me=Symbol("internals");function be(e){return e&&String(e).trim().toLowerCase()}function ye(e){return!1===e||null==e?e:ue.isArray(e)?e.map(ye):(e=>pe(e,fe))(String(e))}const we=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Oe(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Ee(e,t,n,r,o){return ue.isFunction(r)?r.call(this,t,n):(o&&(t=n),ue.isString(t)?ue.isString(r)?-1!==t.indexOf(r):ue.isRegExp(r)?r.test(t):void 0:void 0)}class Se{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=be(t);if(!o)return;const s=ue.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ye(e))}const s=(e,t)=>ue.forEach(e,(e,n)=>o(e,n,t));if(ue.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(ue.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim();const s=ue.hasOwnProp(t,n);!n||s&&ue.hasOwnProp(de,n)||("set-cookie"===n?s?t[n].push(r):t[n]=[r]:t[n]=s?t[n]+", "+r:r)}),t})(e),t);else if(ue.isObject(e)&&ue.isSafeIterable(e)){let n,r,o=Object.create(null);for(const t of e){if(!ue.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],ue.hasOwnProp(o,r)?(n=o[r],o[r]=ue.isArray(n)?[...n,t[1]]:[n,t[1]]):o[r]=t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=be(e)){const n=ue.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(ue.isFunction(t))return t.call(this,e,n);if(ue.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=be(e)){const n=ue.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ee(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=be(e)){const o=ue.findKey(n,e);!o||t&&!Ee(0,n[o],o,t)||(delete n[o],r=!0)}}return ue.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ee(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return ue.forEach(this,(r,o)=>{const s=ue.findKey(n,o);if(s)return t[s]=ye(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=ye(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ue.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ue.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return ue.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,o=!1,s=!1;function i(e){const o=Oe(n.slice(r,e)),s=o.indexOf("=");if(s<1)return;const i=Oe(o.slice(0,s));if(!we.test(i))return;const a=i.toLowerCase();if("__proto__"===a||"constructor"===a||"prototype"===a)return;const c=Oe(o.slice(s+1));t[a]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const o=e.charCodeAt(r);if(34===o)return e;if(92===o&&(r+=1,r>=t))return e;n+=e[r]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);o?s?s=!1:92===t?s=!0:34===t&&(o=!1):34===t?o=!0:44!==t&&59!==t||(i(e),r=e+1)}return i(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[me]=this[me]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=be(e);t[r]||(function(e,t){const n=ue.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return ue.isArray(e)?e.forEach(r):r(e),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ue.reduceDescriptors(Se.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),ue.freezeMethods(Se);const Re=Se,_e="[REDACTED ****]";function ve(e){try{return String(e)}catch(e){return""}}class Te extends Error{static from(e,t,n,r,o,s){let i=e.message;!i&&ue.isArray(e.errors)&&e.errors.length&&(i=function(e){return e.errors.map(e=>{try{return e&&e.message?ve(e.message):ve(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const a=new Te(i,t||e.code,n,r,o);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),s&&Object.assign(a,s),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&ue.hasOwnProp(e,"redact")?e.redact:void 0,n=ue.isArray(t)&&t.length>0?function(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(ue.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof Re&&(e=e.toJSON()),r.push(e),ue.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);ue.isUndefined(r)||(t[n]=r)});else{if(!ue.isPlainObject(e)&&function(e){if(ue.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(ue.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,s]of Object.entries(e)){const e=n.has(r.toLowerCase())?_e:o(s);ue.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}(e,t):ue.toJSONObject(e);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:n,code:this.code,status:this.status}}}Te.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Te.ERR_BAD_OPTION="ERR_BAD_OPTION",Te.ECONNABORTED="ECONNABORTED",Te.ETIMEDOUT="ETIMEDOUT",Te.ECONNREFUSED="ECONNREFUSED",Te.ERR_NETWORK="ERR_NETWORK",Te.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Te.ERR_DEPRECATED="ERR_DEPRECATED",Te.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Te.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Te.ERR_CANCELED="ERR_CANCELED",Te.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Te.ERR_INVALID_URL="ERR_INVALID_URL",Te.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Ae=Te;function Pe(e){return ue.isPlainObject(e)||ue.isArray(e)}function Ce(e){return ue.endsWith(e,"[]")?e.slice(0,-2):e}function je(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ce(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const xe=ue.toFlatObject(ue,{},null,function(e){return/^is[A-Z]/.test(e)}),Ne=function(e,t,n){if(!ue.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=ue.getSafeProp(n,e);return ue.isUndefined(r)?t:r},o=r("metaTokens",!0),s=r("visitor")||p,i=r("dots",!1),a=r("indexes",!1),c=r("Blob")||"undefined"!=typeof Blob&&Blob,l=r("maxDepth",100),u=c&&ue.isSpecCompliantForm(t),d=[];if(!ue.isFunction(s))throw new TypeError("visitor must be a function");function f(e){if(null===e)return"";if(ue.isDate(e))return e.toISOString();if(ue.isBoolean(e))return e.toString();if(!u&&ue.isBlob(e))throw new Ae("Blob is not supported. Use a Buffer instead.");if(ue.isArrayBuffer(e)||ue.isTypedArray(e)){if(u&&"function"==typeof c)return new c([e]);throw new Ae("Blob is not supported. Use a Buffer instead.",Ae.ERR_NOT_SUPPORT)}return e}function h(e){if(e>l)throw new Ae("Object is too deeply nested ("+e+" levels). Max depth: "+l,Ae.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,r){let s=e;if(ue.isReactNative(t)&&ue.isReactNativeBlob(e))return t.append(je(r,n,i),f(e)),!1;if(e&&!r&&"object"==typeof e)if(ue.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e){if(l===1/0)return JSON.stringify(e);const t=[];return JSON.stringify(e,function(e,n){if(!ue.isObject(n))return n;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(n),h(1+t.length-1),n})}(e);else if(ue.isArray(e)&&function(e){return ue.isArray(e)&&!e.some(Pe)}(e)||(ue.isFileList(e)||ue.endsWith(n,"[]"))&&(s=ue.toArray(e)))return n=Ce(n),s.forEach(function(e,r){!ue.isUndefined(e)&&null!==e&&t.append(!0===a?je([n],r,i):null===a?n:n+"[]",f(e))}),!1;return!!Pe(e)||(t.append(je(r,n,i),f(e)),!1)}const g=Object.assign(xe,{defaultVisitor:p,convertValue:f,isVisitable:Pe});if(!ue.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!ue.isUndefined(n)){if(h(o),-1!==d.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));d.push(n),ue.forEach(n,function(n,i){!0===(!(ue.isUndefined(n)||null===n)&&s.call(t,n,ue.isString(i)?i.trim():i,r,g))&&e(n,r?r.concat(i):[i],o+1)}),d.pop()}}(e),t};function Ue(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function De(e,t){this._pairs=[],e&&Ne(e,this,t)}const ke=De.prototype;ke.append=function(e,t){this._pairs.push([e,t])},ke.toString=function(e){const t=e?t=>e.call(this,t,Ue):Ue;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Le=De;function Ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Fe(e,t,n){if(!t)return e;e=e||"";const r=ue.isFunction(n)?{serialize:n}:n,o=ue.getSafeProp(r,"encode")||Ie,s=ue.getSafeProp(r,"serialize");let i;if(i=s?s(t,r):ue.isURLSearchParams(t)?t.toString():new Le(t,r).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Be=Symbol("internals");function qe(e){return e?e.length:0}function $e(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function Me(e,t){const n=e.handlers,r=qe(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}const ze=class{constructor(){this.handlers=[],this[Be]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},o=this[Be];null==this.handlers&&(this.handlers=[]),Me(this,o);const s=o.nextId++;return this.handlers.push(r),o.handlerEntries.set(s,{handler:r,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,s}eject(e){const t=this[Be];Me(this,t);const n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||($e(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Me(this,this[Be]))}forEach(e){const t=this[Be];Me(this,t),t.iterationDepth++;try{ue.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(Me(this,t),$e(this.handlers),t.handlersLength=qe(this.handlers))}}},We={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Je={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Le,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},He="undefined"!=typeof window&&"undefined"!=typeof document,Ve="object"==typeof navigator&&navigator||void 0,Ke=He&&(!Ve||["ReactNative","NativeScript","NS"].indexOf(Ve.product)<0),Ge="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xe=He&&window.location.href||"http://localhost",Qe={...n,...Je};function Ze(e){if(e>100)throw new Ae("FormData field is too deeply nested ("+e+" levels). Max depth: 100",Ae.ERR_FORM_DATA_DEPTH_EXCEEDED)}const Ye=function(e){function t(e,n,r,o){Ze(o);let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&ue.isArray(r)?r.length:s,a?(ue.hasOwnProp(r,s)?r[s]=ue.isArray(r[s])?r[s].concat(n):[r[s],n]:r[s]=n,!i):(ue.hasOwnProp(r,s)&&ue.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&ue.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(ue.isFormData(e)&&ue.isFunction(e.entries)){const n={};return ue.forEachEntry(e,(e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)Ze(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),n}return null},et=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),tt=(e,t)=>null!=e&&ue.hasOwnProp(e,t)?e[t]:void 0,nt={transitional:We,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=ue.isObject(e);if(o&&ue.isHTMLForm(e)&&(e=new FormData(e)),ue.isFormData(e))return r?JSON.stringify(Ye(e)):e;if(ue.isArrayBuffer(e)||ue.isBuffer(e)||ue.isStream(e)||ue.isFile(e)||ue.isBlob(e)||ue.isReadableStream(e))return e;if(ue.isArrayBufferView(e))return e.buffer;if(ue.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){const t=tt(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ne(e,new Qe.classes.URLSearchParams,{visitor:function(e,t,n,r){return Qe.isNode&&ue.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=ue.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=tt(this,"env"),r=n&&n.FormData;return Ne(s?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e){if(ue.isString(e))try{return(0,JSON.parse)(e),ue.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=tt(this,"transitional")||nt.transitional,n=t&&t.forcedJSONParsing,r=tt(this,"responseType"),o="json"===r;if(ue.isResponse(e)||ue.isReadableStream(e))return e;if(e&&ue.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,tt(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Ae.from(e,Ae.ERR_BAD_RESPONSE,this,null,tt(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qe.classes.FormData,Blob:Qe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ue.forEach(et,e=>{nt.headers[e]={}});const rt=nt;function ot(e,t){const n=this||rt,r=t||n,o=Re.from(r.headers);let s=r.data;return ue.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function st(e){return!(!e||!e.__CANCEL__)}const it=class extends Ae{constructor(e,t,n){super(null==e?"canceled":e,Ae.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function at(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ae("Request failed with status code "+n.status,n.status>=400&&n.status<500?Ae.ERR_BAD_REQUEST:Ae.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const ct=/[\t\n\r]/g;function lt(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(ct,"")}function ut(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const dt=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=l&&c-l;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n),(...e)=>i(e)]}(n=>{if(!n||!ue.isNumber(n.loaded))return;const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=Math.max(0,null!=i?Math.min(s,i):s),c=Math.max(0,a-r),l=o(c);r=Math.max(r,a),e({loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:l||void 0,estimated:l&&i?(i-a)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},ft=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ht=(e,t=ue.asap)=>(...n)=>t(()=>e(...n)),pt=Qe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Qe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Qe.origin),Qe.navigator&&/(msie|trident)/i.test(Qe.navigator.userAgent)):()=>!0,gt=Qe.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];ue.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),ue.isString(r)&&a.push(`path=${r}`),ue.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),ue.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},mt=/^https?:(?!\/\/)/i;function bt(e,t){if("string"==typeof e){const n=lt(e);if(mt.test(n))throw new Ae(`Invalid URL ${JSON.stringify(function(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${_e}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${_e}`);return-1===n?r:`${r}#${o=t.slice(n+1),o?o.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${_e}`):o}`;var o}(n))}: missing "//" after protocol`,Ae.ERR_INVALID_URL,t)}}function yt(e,t,n,r){bt(t,r);let o=!("string"==typeof(s=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s));var s;return e&&(o||!1===n)?(bt(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const wt=e=>e instanceof Re?{...e}:e;function Ot(e,t){e=e||{},t=t||{};const n=Object.create(null);function r(e,t,n,r){return ue.isPlainObject(e)&&ue.isPlainObject(t)?ue.merge.call({caseless:r},e,t):ue.isPlainObject(t)?ue.merge({},t):ue.isArray(t)?t.slice():t}function o(e,t,n,o){return ue.isUndefined(t)?ue.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!ue.isUndefined(t))return r(void 0,t)}function i(e,t){return ue.isUndefined(t)?ue.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return ue.hasOwnProp(t,s)?r(n,o):ue.hasOwnProp(e,s)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutErrorMessage:i,withCredentials:i,withXSRFToken: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,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(wt(e),wt(t),0,!0)};var l;return ue.forEach((l={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(l).concat(Object.getOwnPropertySymbols(l).filter(e=>Object.getOwnPropertyDescriptor(l,e).enumerable)):Object.keys(l)),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=ue.hasOwnProp(c,r)?c[r]:o,i=s(ue.hasOwnProp(e,r)?e[r]:void 0,ue.hasOwnProp(t,r)?t[r]:void 0,r);ue.isUndefined(i)&&s!==a||(n[r]=i)}),ue.hasOwnProp(t,"validateStatus")&&ue.isUndefined(t.validateStatus)&&!1===function(n){const r=ue.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!ue.isUndefined(r)){if(!ue.isPlainObject(r))return;if(ue.hasOwnProp(r,n))return r[n]}const o=ue.hasOwnProp(e,"transitional")?e.transitional:void 0;if(ue.isPlainObject(o)&&ue.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(ue.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const Et=["content-type","content-length"],St=function(e){const t=Ot({},e),n=e=>ue.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let o=n("withXSRFToken");const s=n("xsrfHeaderName"),i=n("xsrfCookieName");let a=n("headers");const c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=a=Re.from(a),t.url=Fe(yt(l,d,u,t),n("params"),n("paramsSerializer")),c){const t=ue.getSafeProp(c,"username")||"",n=ue.getSafeProp(c,"password")||"";try{a.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw Ae.from(t,Ae.ERR_BAD_OPTION_VALUE,e)}}if(ue.isFormData(r)){const e=ue.getSafeProp(r,"getHeaders");Qe.hasStandardBrowserEnv||Qe.hasStandardBrowserWebWorkerEnv||ue.isReactNative(r)?a.setContentType(void 0):ue.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{Et.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(a,e.call(r),n("formDataHeaderPolicy"))}if(Qe.hasStandardBrowserEnv&&(ue.isFunction(o)&&(o=o(t)),!0===o||null==o&&pt(t.url))){const e=s&&i&&gt.read(i);e&&a.set(s,e)}return t},Rt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=St(e);let o=r.data;const s=Re.from(r.headers).normalize();let i,a,c,l,u,d,{responseType:f,onUploadProgress:h,onDownloadProgress:p}=r;function g(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function b(o){if(!m)return;if(!(0!==m.status||"file"===(ut(lt(r.url))||ut(Qe.origin))||m.responseURL&&m.responseURL.startsWith("file:")))return n(new Ae("Request aborted",Ae.ECONNABORTED,e,m)),g(),void(m=null);try{o?d&&d(o):u&&u()}catch(e){setTimeout(()=>{throw e})}if(!m)return;const s=Re.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());at(function(e){t(e),g()},function(e){n(e),g()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:s,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(b)},m.onabort=function(){m&&(n(new Ae("Request aborted",Ae.ECONNABORTED,e,m)),g(),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new Ae(r,Ae.ERR_NETWORK,e,m);o.event=t||null,n(o),g(),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||We;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ae(t,o.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,e,m)),g(),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&ue.forEach(ge(s),function(e,t){m.setRequestHeader(t,e)}),ue.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u,d]=dt(p,!0),m.addEventListener("progress",c)),h&&m.upload&&([a,l]=dt(h),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new it(null,e,m):t),m.abort(),g(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=ut(r.url);if(y&&!Qe.protocols.includes(y))return n(new Ae("Unsupported protocol "+y+":",Ae.ERR_BAD_REQUEST,e)),void g();m.send(o||null)})},_t=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Ae?t:new it(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new Ae(`timeout of ${t}ms exceeded`,Ae.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>{r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))});const{signal:a}=n;return a.unsubscribe=()=>ue.asap(i),a},vt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Tt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*vt(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},At=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Pt=(e,t,n)=>t+2<n&&At(e.charCodeAt(t+1))&&At(e.charCodeAt(t+2)),Ct=e=>e<=57?e-48:(223&e)-55,jt=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,xt=e=>9===e||10===e||12===e||13===e||32===e,Nt=e=>{const t=e.length;let n=0,r=0,o=!1;for(let s=0;s<t;s++){let i=e.charCodeAt(s);37===i&&Pt(e,s,t)&&(i=16*Ct(e.charCodeAt(s+1))+Ct(e.charCodeAt(s+2)),s+=2),xt(i)||(61!==i?!jt(i)||r>0?o=!0:n++:r++)}return o||r>2||r>0&&(n+r)%4!=0||n%4==1?(e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)})(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},Ut="1.20.0",Dt={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:kt}=ue,Lt=e=>{if(!ue.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},It=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ft=e=>{const t=void 0!==ue.global&&null!==ue.global?ue.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=ue.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:i}=e,a=o?kt(o):"function"==typeof fetch,c=kt(s),l=kt(i);if(!a)return!1;const u=a&&kt(n),d=a&&("function"==typeof r?(f=new r,e=>f.encode(e)):async e=>new Uint8Array(await new s(e).arrayBuffer()));var f;const h=c&&u&&It(()=>{let e=!1;const t=new s(Qe.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),p=l&&u&&It(()=>ue.isReadableStream(new i("").body)),g={stream:p&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!g[e]&&(g[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Ae(`Response type '${e}' is not supported`,Ae.ERR_NOT_SUPPORT,n)})});const m=async e=>{if(null==e)return 0;if(ue.isBlob(e))return e.size;if(ue.isSpecCompliantForm(e)){const t=new s(Qe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ue.isArrayBufferView(e)||ue.isArrayBuffer(e)?e.byteLength:(ue.isURLSearchParams(e)&&(e+=""),ue.isString(e)?(await d(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:a,signal:l,cancelToken:d,timeout:f,onDownloadProgress:b,onUploadProgress:y,responseType:w,headers:O,withCredentials:E="same-origin",fetchOptions:S,maxContentLength:R,maxBodyLength:_,maxRedirects:v}=St(e);const T=ue.isNumber(R)&&R>-1,A=ue.isNumber(_)&&_>-1;let P=o||fetch;w=w?(w+"").toLowerCase():"text";let C=_t([l,d&&d.toAbortSignal()],f),j=null;const x=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let N,U=null;const D=()=>new Ae("Request body larger than maxBodyLength limit",Ae.ERR_BAD_REQUEST,e,j);try{let o;const l=(L="auth",ue.hasOwnProp(e,L)?e[L]:void 0);if(l){o={username:ue.getSafeProp(l,"username")||"",password:ue.getSafeProp(l,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,Qe.origin);if(!o&&(e.username||e.password)){o={username:Lt(e.username),password:Lt(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(o&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa((k=(o.username||"")+":"+(o.password||""),encodeURIComponent(k).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),T&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return((e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),o=e.slice(n+1);if(/;base64/i.test(r))return t(o);let s=0;for(let e=0,t=o.length;e<t;e++){const n=o.charCodeAt(e);if(37===n&&Pt(o,e,t))s+=1,e+=2;else if(n<128)s+=1;else if(n<2048)s+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=o.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s})(-1===t?e:e.slice(0,t),Nt)}(t);if(n>R)throw new Ae("maxContentLength size of "+R+" exceeded",Ae.ERR_BAD_RESPONSE,e,j)}if(A&&"get"!==n&&"head"!==n){const e=await m(a);if("number"==typeof e&&isFinite(e)&&(N=e,e>_))throw D()}const d=A&&(ue.isReadableStream(a)||ue.isStream(a)),f=(e,t,n)=>Tt(e,65536,e=>{if(A&&e>_)throw U=D();t&&t(e)},n);if(h&&"get"!==n&&"head"!==n&&(y||d)){if(N=null==N?await(async(e,t)=>{const n=ue.toFiniteNumber(e.getContentLength());return null==n?m(t):n})(O,a):N,0!==N||d){let e,n=new s(t,{method:"POST",body:a,duplex:"half"});if(ue.isFormData(a)&&(e=n.headers.get("content-type"))&&O.setContentType(e),n.body){const[e,t]=y&&ft(N,dt(ht(y)))||[];a=f(n.body,e,t)}}}else if(d&&!c&&u&&"get"!==n&&"head"!==n)a=f(a);else if(d&&c&&!h&&"get"!==n&&"head"!==n)throw new Ae("Stream request bodies are not supported by the current fetch implementation",Ae.ERR_NOT_SUPPORT,e,j);ue.isString(E)||(E=E?"include":"omit");const I=c&&"credentials"in s.prototype;if(ue.isFormData(a)){const e=O.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&O.delete("content-type")}O.set("User-Agent","axios/"+Ut,!1);const F=null==S?S:Object.assign(Object.create(null),S);F&&(delete F.body,delete F.headers,delete F.method,delete F.signal,delete F.duplex,delete F.credentials);const B=Object.assign(Object.create(null),F,{signal:C,method:n.toUpperCase(),headers:ge(O.normalize()),body:a,duplex:"half",credentials:I?E:void 0});c&&(ue.forEach(Dt,(e,t)=>{void 0===B[t]&&(B[t]=e)}),void 0===B.signal&&(B.signal=null),void 0===B.body&&(B.body=null)),0===v&&(B.redirect="manual",F&&(F.redirect="manual")),j=c&&new s(t,B);let q=await(c?P(j,F):P(t,B));const $=Re.from(q.headers);if(T){const t=ue.toFiniteNumber($.getContentLength());if(null!=t&&t>R)throw new Ae("maxContentLength size of "+R+" exceeded",Ae.ERR_BAD_RESPONSE,e,j)}const M=p&&("stream"===w||"response"===w);if(p&&q.body&&(b||T||M&&x)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=q[e]});const n=ue.toFiniteNumber($.getContentLength()),[r,o]=b&&ft(n,dt(ht(b),!0))||[];let s=0;const a=t=>{if(T&&(s=t,s>R))throw new Ae("maxContentLength size of "+R+" exceeded",Ae.ERR_BAD_RESPONSE,e,j);r&&r(t)};q=new i(Tt(q.body,65536,a,()=>{o&&o(),x&&x()}),t)}w=w||"text";let z=await g[ue.findKey(g,w)||"text"](q,e);if(T&&!p&&!M){let t;if(null!=z&&("number"==typeof z.byteLength?t=z.byteLength:"number"==typeof z.size?t=z.size:"string"==typeof z&&(t="function"==typeof r?(new r).encode(z).byteLength:z.length)),"number"==typeof t&&t>R)throw new Ae("maxContentLength size of "+R+" exceeded",Ae.ERR_BAD_RESPONSE,e,j)}return!M&&x&&x(),await new Promise((t,n)=>{at(t,n,{data:z,headers:Re.from(q.headers),status:q.status,statusText:q.statusText,config:e,request:j})})}catch(t){if(x&&x(),C&&C.aborted&&C.reason instanceof Ae){const n=C.reason;throw n.config=e,j&&(n.request=j),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(U)throw j&&!U.request&&(U.request=j),U;if(t instanceof Ae)throw j&&!t.request&&(t.request=j),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new Ae("Network Error",Ae.ERR_NETWORK,e,j,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw Ae.from(t,t&&t.code,e,j,t&&t.response)}var k,L}},Bt=new Map,qt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=Bt;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:Ft(t)),l=a;return a},$t=(qt(),{http:null,xhr:Rt,fetch:{get:qt}});ue.forEach($t,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Mt=e=>`- ${e}`,zt=e=>ue.isFunction(e)||null===e||!1===e,Wt=function(e,t){e=ue.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!zt(r)&&(o=$t[(n=String(r)).toLowerCase()],void 0===o))throw new Ae(`Unknown adapter '${n}'`);if(o&&(ue.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Mt).join("\n"):" "+Mt(e[0]):"as no adapter specified";throw new Ae("There is no suitable adapter to dispatch the request "+t,Ae.ERR_NOT_SUPPORT)}return o};function Jt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new it(null,e)}function Ht(e){const t=ue.toSafeFlatObject(e);return Jt(t),t.headers=Re.from(ue.getSafeProp(t,"headers")),t.data=ot.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Wt(t.adapter||rt.adapter,t)(t).then(function(e){Jt(t),t.response=e;try{e.data=ot.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=Re.from(e.headers),e},function(e){if(!st(e)&&(Jt(t),e&&e.response)){t.response=e.response;try{e.response.data=ot.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=Re.from(e.response.headers)}return Promise.reject(e)})}const Vt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Kt={};Vt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ut+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new Ae(r(o," has been removed"+(t?" in "+t:"")),Ae.ERR_DEPRECATED);return t&&!Kt[o]&&(Kt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},Vt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Gt={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new Ae("options must be an object",Ae.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new Ae("option "+s+" must be "+n,Ae.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Ae("Unknown option "+s,Ae.ERR_BAD_OPTION)}},validators:Vt},Xt=Gt.validators;class Qt{constructor(e){this.defaults=e||{},this.interceptors={request:new ze,response:new ze}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),o=-1===n?"":r.slice(n+1);String(e.stack).endsWith(o)||(e.stack+="\n"+r)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ot(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Gt.assertOptions(n,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean),legacyInterceptorReqResOrdering:Xt.transitional(Xt.boolean),advertiseZstdAcceptEncoding:Xt.transitional(Xt.boolean),validateStatusUndefinedResolves:Xt.transitional(Xt.boolean)},!1),null!=r&&(ue.isFunction(r)?t.paramsSerializer={serialize:r}:Gt.assertOptions(r,{encode:Xt.function,serialize:Xt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Gt.assertOptions(t,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),t.method=(ue.getSafeProp(t,"method")||ue.getSafeProp(this.defaults,"method")||"get").toLowerCase();let s=o&&ue.merge(o.common,o[t.method]);o&&ue.forEach(et.concat("common"),e=>{delete o[e]}),t.headers=Re.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||We;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[Ht.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let f=t;for(;d<u;){const e=i[d++],t=i[d++];try{f=e?e(f):f}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);ue.isThenable(n)&&(l=Promise.resolve(n).then(()=>Ht.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Ht.call(this,f)}catch(e){l=Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return Fe(yt((e=Ot(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}ue.forEach(["delete","get","head","options"],function(e){Qt.prototype[e]=function(t,n){return this.request(Ot(n||{},{method:e,url:t,data:n&&ue.hasOwnProp(n,"data")?n.data:void 0}))}}),ue.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,r,o){return this.request(Ot(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Qt.prototype[e]=t(),"query"!==e&&(Qt.prototype[e+"Form"]=t(!0))});const Zt=Qt;class Yt{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 n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new it(e,r,o),t(n.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)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Yt(function(t){e=t}),cancel:e}}}const en=Yt,tn={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tn).forEach(([e,t])=>{void 0===tn[t]&&(tn[t]=e)});const nn=tn,rn=function e(t){const n=new Zt(t),r=f(Zt.prototype.request,n);return ue.extend(r,Zt.prototype,n,{allOwnKeys:!0}),ue.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ot(t,n))},r}(rt);rn.Axios=Zt,rn.CanceledError=it,rn.CancelToken=en,rn.isCancel=st,rn.VERSION=Ut,rn.toFormData=Ne,rn.AxiosError=Ae,rn.Cancel=rn.CanceledError,rn.all=function(e){return Promise.all(e)},rn.spread=function(e){return function(t){return e.apply(null,t)}},rn.isAxiosError=function(e){return ue.isObject(e)&&!0===e.isAxiosError},rn.mergeConfig=Ot,rn.AxiosHeaders=Re,rn.formToJSON=e=>Ye(ue.isHTMLForm(e)?new FormData(e):e),rn.getAdapter=Wt,rn.HttpStatusCode=nn,rn.default=rn;const on=rn;class sn{constructor(e,t={}){this.VERSION=r,this.clientId=e,t.storageKey||(t.storageKey="gc_client_auth_data"),"boolean"!=typeof t.persist&&(t.persist=!1),this.config=Object.assign({},t),this.customHeaders=t.customHeaders,this.setEnvironment(t.environment),this.timeout=16e3,this.authData={},this.authentications={"PureCloud OAuth":{type:"oauth2"}};try{localStorage.setItem("genesys_cloud_local_storage_test","genesys_cloud_local_storage_test"),localStorage.removeItem("genesys_cloud_local_storage_test"),this.hasLocalStorage=!0}catch(e){this.hasLocalStorage=!1}this._loadSettings()}loginImplicitGrant(e={},t){const n=t||a();return new Promise((t,r)=>{e.org&&!e.provider?r(new Error("opts.provider must be set if opts.org is set")):e.provider&&!e.org?r(new Error("opts.org must be set if opts.provider is set")):e.redirectUri||e.usePopupAuth||r(new Error("redirectUri must be provided for implicit grant and not utilizing client-auth app for popup auth")),n&&n.error&&(n.accessToken=void 0,this._saveSettings(n),r(new Error(`[${n.error}] ${n.error_description}`))),n.accessToken&&this._saveSettings(n),this._testTokenAccess().then(()=>(!this.authData.state&&e.state&&(this.authData.state=e.state),t(this.authData))).catch(n=>{this._debug("Error encountered during login. This is normal if the application has not yet been authorized.",n);const o={client_id:encodeURIComponent(this.clientId),response_type:"token"};if(e.redirectUri&&(o.redirect_uri=encodeURIComponent(e.redirectUri)),e.state&&(o.state=encodeURIComponent(e.state)),e.org&&(o.org=encodeURIComponent(e.org)),e.provider&&(o.provider=encodeURIComponent(e.provider)),e.usePopupAuth){if(!this.hasLocalStorage)return r(new Error("localStorage is unavailable. Cannot authenticate via popup window."));this._debug("using popup auth – adding listener"),this._authenticateViaPopup(o,e.popupTimeout||15e3).then(e=>{this._saveSettings(e),t(e)}).catch(r)}else{const e=this._buildAuthUrl("oauth/authorize",o);this._debug("Implicit grant: redirecting to: "+e),window.location.replace(e),r(new Error(`Routing to login: "${e}"`))}})})}setEnvironment(e){e||(e="mypurecloud.com"),(e=e.replace(/\/+$/,"")).startsWith("https://")&&(e=e.substring(8)),e.startsWith("http://")&&(e=e.substring(7)),e.startsWith("api.")&&(e=e.substring(4)),this.environment=e,this.basePath=`https://api.${e}`,this.authUrl=`https://login.${e}`}clearAuthData(){this._saveSettings({accessToken:void 0,state:void 0,tokenExpiryTime:void 0,tokenExpiryTimeString:void 0})}logout(e){this.clearAuthData();const t={client_id:encodeURIComponent(this.clientId)};e&&(t.redirect_uri=encodeURIComponent(e));const n=this._buildAuthUrl("logout",t);window.location.replace(n)}setAccessToken(e){this._saveSettings({accessToken:e})}testAccessToken(e){return this.callApi("/api/v2/tokens/me","get",e)}parseDate(e){return new Date(e.replace(/T/i," "))}paramToString(e){return e?e instanceof Date?e.toJSON():e.toString():""}buildUrl(e,t={}){return e.match(/^\//)||(e=`/${e}`),(this.basePath+e).replace(/\{([\w-]+)\}/g,(e,n)=>{let r;return r=Object.getOwnPropertyDescriptor(t,n)?this.paramToString(t[n]):e,encodeURIComponent(r)})}callApi(e,t,n){var r;const o=this.buildUrl(e),s={Authorization:`Bearer ${n||(null===(r=this.authData)||void 0===r?void 0:r.accessToken)}`,"Content-Type":"application/json"};this.customHeaders&&Object.entries(this.customHeaders).forEach(([e,t])=>{s[e]=t});const i={method:t,url:o,headers:s,timeout:this.timeout};return on.request(i)}_debug(e,t){this.config.debugMode&&c(e,t)}_saveSettings(e){try{if(this.authData.accessToken=e.accessToken,this.authentications["PureCloud OAuth"].accessToken=e.accessToken,e.state&&(this.authData.state=e.state),this.authData.error=e.error,this.authData.error_description=e.error_description,e.tokenExpiryTime&&(this.authData.tokenExpiryTime=e.tokenExpiryTime,this.authData.tokenExpiryTimeString=e.tokenExpiryTimeString),!this.config.persist)return void this._debug("persist is not true. Settings will not be saved.");if(!this.hasLocalStorage)return void this._debug("Warning: Cannot access local storage. Settings will not be saved.");const t=JSON.parse(JSON.stringify(this.authData));delete t.state,localStorage.setItem(this.config.storageKey,JSON.stringify(t)),this._debug("Auth data saved to local storage",t)}catch(e){console.error(e)}}_getId(e){return`gc-ca_${e=e||globalThis.crypto.randomUUID()}`}_authenticateViaPopup(e,t){const n=this._getId(),r=Object.assign(Object.assign({},e),{storageKey:this.config.storageKey});this.config.debugMode&&(r.debug=!0),localStorage.setItem(n,JSON.stringify(r)),e.state=n,e.redirect_uri||(e.redirect_uri=encodeURIComponent(`https://apps.${this.environment}/client-auth`));const o=this._buildAuthUrl("oauth/authorize",e);return new Promise((r,i)=>{this._debug("Implicit grant: opening new window: "+o),window.open(o,"_blank","width=500px,height=500px,noreferrer,noopener,resizable,scrollbars,status");const a=setTimeout(()=>{this._debug("timeout for loginImplicitGrant using popup",e);const t=new s("Popup authentation timeout. It is possible that the popup was blocked or the login page encountered an error");i(t)},t),c=e=>{if(this._debug("value was just written to storage by another app",{key:e.key,newValue:e.newValue,oldValue:e.oldValue}),e.key===this.config.storageKey){this._debug("keys matched. resolving value",{key:e.key,value:e.newValue}),window.removeEventListener("storage",c),clearTimeout(a);const t=JSON.parse(e.newValue);localStorage.removeItem(n),r(t)}};window.addEventListener("storage",c)})}_testTokenAccess(){return e=this,t=void 0,r=function*(){if(this._loadSettings(),!this.authentications["PureCloud OAuth"].accessToken)throw new i("errorTokenNotSet","No access token provided.");try{yield this.callApi("/api/v2/tokens/me","get")}catch(e){throw this._saveSettings({accessToken:void 0}),e}},new((n=void 0)||(n=Promise))(function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,a)}c((r=r.apply(e,t||[])).next())});var e,t,n,r}_loadSettings(){if(!this.config.persist)return;if(!this.hasLocalStorage)return void this._debug("Warning: Cannot access local storage. Settings will not be loaded.");const e=this.authData.state,t=localStorage.getItem(this.config.storageKey);this.authData=t?JSON.parse(t):{},this.authData.accessToken&&this.setAccessToken(this.authData.accessToken),this.authData.state=e}_buildAuthUrl(e,t={}){return Object.keys(t).reduce((e,n)=>t[n]?`${e}&${n}=${t[n]}`:e,`${this.authUrl}/${e}?`)}}const an=()=>{const e=a();if(e.error)throw new Error(`[${e.error}]: ${e.error_description}`);if(!e.accessToken)throw new i("errorToken","No access token provided.");const t=e.state;if(!t)throw new i("errorStateParam","No state param on redirect. Unable to determine location to save auth data.");const n=JSON.parse(localStorage.getItem(t)||"false");if(!n||!n.storageKey)throw new i("errorParse","Unable to parse information from localStorage.");n.state?e.state=n.state:delete e.state,c(`setting auth data to key: ${n.storageKey}`,e),localStorage.setItem(n.storageKey,JSON.stringify(e)),n.debug?c("In debug mode. Not closing window or removing storageId",{storageId:t,authData:e,href:window.location.href}):(c(`removing temp storage key: ${t}`),localStorage.removeItem(t),c("closing window"),window.close())},cn=new Map,ln=(e,t)=>{let n=cn.get(e);return n||(n=new sn(e,t),cn.set(e,n)),n},un=ln;window.GenesysCloudClientAuth=t})();
2
2
  //# sourceMappingURL=genesys-cloud-client-auth.browser.min.js.map