@dbs-portal/core-api
Version:
HTTP client and API utilities for DBS Portal
1,681 lines • 186 kB
JavaScript
var $s = Object.defineProperty;
var Bs = (t, e, r) => e in t ? $s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
var ue = (t, e, r) => Bs(t, typeof e != "symbol" ? e + "" : e, r);
import { QueryClient as zs, useQuery as Br, useMutation as Mn, useInfiniteQuery as Vs, useQueryClient as $n, QueryClientProvider as Ws } from "@tanstack/react-query";
import { useInfiniteQuery as zu, useMutation as Vu, useQueries as Wu, useQuery as Hu, useQueryClient as Ku, useSuspenseInfiniteQuery as Ju, useSuspenseQueries as Qu, useSuspenseQuery as Yu } from "@tanstack/react-query";
function Bn(t, e) {
return function() {
return t.apply(e, arguments);
};
}
const { toString: Hs } = Object.prototype, { getPrototypeOf: zr } = Object, { iterator: Zt, toStringTag: zn } = Symbol, er = /* @__PURE__ */ ((t) => (e) => {
const r = Hs.call(e);
return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), Ce = (t) => (t = t.toLowerCase(), (e) => er(e) === t), tr = (t) => (e) => typeof e === t, { isArray: at } = Array, St = tr("undefined");
function Ct(t) {
return t !== null && !St(t) && t.constructor !== null && !St(t.constructor) && be(t.constructor.isBuffer) && t.constructor.isBuffer(t);
}
const Vn = Ce("ArrayBuffer");
function Ks(t) {
let e;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Vn(t.buffer), e;
}
const Js = tr("string"), be = tr("function"), Wn = tr("number"), Tt = (t) => t !== null && typeof t == "object", Qs = (t) => t === !0 || t === !1, Jt = (t) => {
if (er(t) !== "object")
return !1;
const e = zr(t);
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(zn in t) && !(Zt in t);
}, Ys = (t) => {
if (!Tt(t) || Ct(t))
return !1;
try {
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
} catch {
return !1;
}
}, Gs = Ce("Date"), Xs = Ce("File"), Zs = Ce("Blob"), eo = Ce("FileList"), to = (t) => Tt(t) && be(t.pipe), ro = (t) => {
let e;
return t && (typeof FormData == "function" && t instanceof FormData || be(t.append) && ((e = er(t)) === "formdata" || // detect form-data instance
e === "object" && be(t.toString) && t.toString() === "[object FormData]"));
}, no = Ce("URLSearchParams"), [so, oo, io, ao] = ["ReadableStream", "Request", "Response", "Headers"].map(Ce), uo = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function _t(t, e, { allOwnKeys: r = !1 } = {}) {
if (t === null || typeof t > "u")
return;
let n, o;
if (typeof t != "object" && (t = [t]), at(t))
for (n = 0, o = t.length; n < o; n++)
e.call(null, t[n], n, t);
else {
if (Ct(t))
return;
const i = r ? Object.getOwnPropertyNames(t) : Object.keys(t), c = i.length;
let d;
for (n = 0; n < c; n++)
d = i[n], e.call(null, t[d], d, t);
}
}
function Hn(t, e) {
if (Ct(t))
return null;
e = e.toLowerCase();
const r = Object.keys(t);
let n = r.length, o;
for (; n-- > 0; )
if (o = r[n], e === o.toLowerCase())
return o;
return null;
}
const He = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Kn = (t) => !St(t) && t !== He;
function Ir() {
const { caseless: t } = Kn(this) && this || {}, e = {}, r = (n, o) => {
const i = t && Hn(e, o) || o;
Jt(e[i]) && Jt(n) ? e[i] = Ir(e[i], n) : Jt(n) ? e[i] = Ir({}, n) : at(n) ? e[i] = n.slice() : e[i] = n;
};
for (let n = 0, o = arguments.length; n < o; n++)
arguments[n] && _t(arguments[n], r);
return e;
}
const co = (t, e, r, { allOwnKeys: n } = {}) => (_t(e, (o, i) => {
r && be(o) ? t[i] = Bn(o, r) : t[i] = o;
}, { allOwnKeys: n }), t), lo = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), fo = (t, e, r, n) => {
t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
value: e.prototype
}), r && Object.assign(t.prototype, r);
}, po = (t, e, r, n) => {
let o, i, c;
const d = {};
if (e = e || {}, t == null) return e;
do {
for (o = Object.getOwnPropertyNames(t), i = o.length; i-- > 0; )
c = o[i], (!n || n(c, t, e)) && !d[c] && (e[c] = t[c], d[c] = !0);
t = r !== !1 && zr(t);
} while (t && (!r || r(t, e)) && t !== Object.prototype);
return e;
}, ho = (t, e, r) => {
t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length;
const n = t.indexOf(e, r);
return n !== -1 && n === r;
}, mo = (t) => {
if (!t) return null;
if (at(t)) return t;
let e = t.length;
if (!Wn(e)) return null;
const r = new Array(e);
for (; e-- > 0; )
r[e] = t[e];
return r;
}, yo = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && zr(Uint8Array)), go = (t, e) => {
const n = (t && t[Zt]).call(t);
let o;
for (; (o = n.next()) && !o.done; ) {
const i = o.value;
e.call(t, i[0], i[1]);
}
}, vo = (t, e) => {
let r;
const n = [];
for (; (r = t.exec(e)) !== null; )
n.push(r);
return n;
}, bo = Ce("HTMLFormElement"), Ro = (t) => t.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(r, n, o) {
return n.toUpperCase() + o;
}
), vn = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Eo = Ce("RegExp"), Jn = (t, e) => {
const r = Object.getOwnPropertyDescriptors(t), n = {};
_t(r, (o, i) => {
let c;
(c = e(o, i, t)) !== !1 && (n[i] = c || o);
}), Object.defineProperties(t, n);
}, wo = (t) => {
Jn(t, (e, r) => {
if (be(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
return !1;
const n = t[r];
if (be(n)) {
if (e.enumerable = !1, "writable" in e) {
e.writable = !1;
return;
}
e.set || (e.set = () => {
throw Error("Can not rewrite read-only method '" + r + "'");
});
}
});
}, So = (t, e) => {
const r = {}, n = (o) => {
o.forEach((i) => {
r[i] = !0;
});
};
return at(t) ? n(t) : n(String(t).split(e)), r;
}, Co = () => {
}, To = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
function _o(t) {
return !!(t && be(t.append) && t[zn] === "FormData" && t[Zt]);
}
const Oo = (t) => {
const e = new Array(10), r = (n, o) => {
if (Tt(n)) {
if (e.indexOf(n) >= 0)
return;
if (Ct(n))
return n;
if (!("toJSON" in n)) {
e[o] = n;
const i = at(n) ? [] : {};
return _t(n, (c, d) => {
const b = r(c, o + 1);
!St(b) && (i[d] = b);
}), e[o] = void 0, i;
}
}
return n;
};
return r(t, 0);
}, xo = Ce("AsyncFunction"), Po = (t) => t && (Tt(t) || be(t)) && be(t.then) && be(t.catch), Qn = ((t, e) => t ? setImmediate : e ? ((r, n) => (He.addEventListener("message", ({ source: o, data: i }) => {
o === He && i === r && n.length && n.shift()();
}, !1), (o) => {
n.push(o), He.postMessage(r, "*");
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
typeof setImmediate == "function",
be(He.postMessage)
), Ao = typeof queueMicrotask < "u" ? queueMicrotask.bind(He) : typeof process < "u" && process.nextTick || Qn, ko = (t) => t != null && be(t[Zt]), p = {
isArray: at,
isArrayBuffer: Vn,
isBuffer: Ct,
isFormData: ro,
isArrayBufferView: Ks,
isString: Js,
isNumber: Wn,
isBoolean: Qs,
isObject: Tt,
isPlainObject: Jt,
isEmptyObject: Ys,
isReadableStream: so,
isRequest: oo,
isResponse: io,
isHeaders: ao,
isUndefined: St,
isDate: Gs,
isFile: Xs,
isBlob: Zs,
isRegExp: Eo,
isFunction: be,
isStream: to,
isURLSearchParams: no,
isTypedArray: yo,
isFileList: eo,
forEach: _t,
merge: Ir,
extend: co,
trim: uo,
stripBOM: lo,
inherits: fo,
toFlatObject: po,
kindOf: er,
kindOfTest: Ce,
endsWith: ho,
toArray: mo,
forEachEntry: go,
matchAll: vo,
isHTMLForm: bo,
hasOwnProperty: vn,
hasOwnProp: vn,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Jn,
freezeMethods: wo,
toObjectSet: So,
toCamelCase: Ro,
noop: Co,
toFiniteNumber: To,
findKey: Hn,
global: He,
isContextDefined: Kn,
isSpecCompliantForm: _o,
toJSONObject: Oo,
isAsyncFn: xo,
isThenable: Po,
setImmediate: Qn,
asap: Ao,
isIterable: ko
};
function D(t, e, r, n, o) {
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), n && (this.request = n), o && (this.response = o, this.status = o.status ? o.status : null);
}
p.inherits(D, Error, {
toJSON: function() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: p.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const Yn = D.prototype, Gn = {};
[
"ERR_BAD_OPTION_VALUE",
"ERR_BAD_OPTION",
"ECONNABORTED",
"ETIMEDOUT",
"ERR_NETWORK",
"ERR_FR_TOO_MANY_REDIRECTS",
"ERR_DEPRECATED",
"ERR_BAD_RESPONSE",
"ERR_BAD_REQUEST",
"ERR_CANCELED",
"ERR_NOT_SUPPORT",
"ERR_INVALID_URL"
// eslint-disable-next-line func-names
].forEach((t) => {
Gn[t] = { value: t };
});
Object.defineProperties(D, Gn);
Object.defineProperty(Yn, "isAxiosError", { value: !0 });
D.from = (t, e, r, n, o, i) => {
const c = Object.create(Yn);
return p.toFlatObject(t, c, function(b) {
return b !== Error.prototype;
}, (d) => d !== "isAxiosError"), D.call(c, t.message, e, r, n, o), c.cause = t, c.name = t.name, i && Object.assign(c, i), c;
};
const Do = null;
function jr(t) {
return p.isPlainObject(t) || p.isArray(t);
}
function Xn(t) {
return p.endsWith(t, "[]") ? t.slice(0, -2) : t;
}
function bn(t, e, r) {
return t ? t.concat(e).map(function(o, i) {
return o = Xn(o), !r && i ? "[" + o + "]" : o;
}).join(r ? "." : "") : e;
}
function Io(t) {
return p.isArray(t) && !t.some(jr);
}
const jo = p.toFlatObject(p, {}, null, function(e) {
return /^is[A-Z]/.test(e);
});
function rr(t, e, r) {
if (!p.isObject(t))
throw new TypeError("target must be an object");
e = e || new FormData(), r = p.toFlatObject(r, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(P, S) {
return !p.isUndefined(S[P]);
});
const n = r.metaTokens, o = r.visitor || m, i = r.dots, c = r.indexes, b = (r.Blob || typeof Blob < "u" && Blob) && p.isSpecCompliantForm(e);
if (!p.isFunction(o))
throw new TypeError("visitor must be a function");
function y(C) {
if (C === null) return "";
if (p.isDate(C))
return C.toISOString();
if (p.isBoolean(C))
return C.toString();
if (!b && p.isBlob(C))
throw new D("Blob is not supported. Use a Buffer instead.");
return p.isArrayBuffer(C) || p.isTypedArray(C) ? b && typeof Blob == "function" ? new Blob([C]) : Buffer.from(C) : C;
}
function m(C, P, S) {
let B = C;
if (C && !S && typeof C == "object") {
if (p.endsWith(P, "{}"))
P = n ? P : P.slice(0, -2), C = JSON.stringify(C);
else if (p.isArray(C) && Io(C) || (p.isFileList(C) || p.endsWith(P, "[]")) && (B = p.toArray(C)))
return P = Xn(P), B.forEach(function(J, se) {
!(p.isUndefined(J) || J === null) && e.append(
// eslint-disable-next-line no-nested-ternary
c === !0 ? bn([P], se, i) : c === null ? P : P + "[]",
y(J)
);
}), !1;
}
return jr(C) ? !0 : (e.append(bn(S, P, i), y(C)), !1);
}
const E = [], I = Object.assign(jo, {
defaultVisitor: m,
convertValue: y,
isVisitable: jr
});
function M(C, P) {
if (!p.isUndefined(C)) {
if (E.indexOf(C) !== -1)
throw Error("Circular reference detected in " + P.join("."));
E.push(C), p.forEach(C, function(B, k) {
(!(p.isUndefined(B) || B === null) && o.call(
e,
B,
p.isString(k) ? k.trim() : k,
P,
I
)) === !0 && M(B, P ? P.concat(k) : [k]);
}), E.pop();
}
}
if (!p.isObject(t))
throw new TypeError("data must be an object");
return M(t), e;
}
function Rn(t) {
const e = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(n) {
return e[n];
});
}
function Vr(t, e) {
this._pairs = [], t && rr(t, this, e);
}
const Zn = Vr.prototype;
Zn.append = function(e, r) {
this._pairs.push([e, r]);
};
Zn.toString = function(e) {
const r = e ? function(n) {
return e.call(this, n, Rn);
} : Rn;
return this._pairs.map(function(o) {
return r(o[0]) + "=" + r(o[1]);
}, "").join("&");
};
function Fo(t) {
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function es(t, e, r) {
if (!e)
return t;
const n = r && r.encode || Fo;
p.isFunction(r) && (r = {
serialize: r
});
const o = r && r.serialize;
let i;
if (o ? i = o(e, r) : i = p.isURLSearchParams(e) ? e.toString() : new Vr(e, r).toString(n), i) {
const c = t.indexOf("#");
c !== -1 && (t = t.slice(0, c)), t += (t.indexOf("?") === -1 ? "?" : "&") + i;
}
return t;
}
let En = class {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(e, r, n) {
return this.handlers.push({
fulfilled: e,
rejected: r,
synchronous: n ? n.synchronous : !1,
runWhen: n ? n.runWhen : null
}), this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
*/
eject(e) {
this.handlers[e] && (this.handlers[e] = null);
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
this.handlers && (this.handlers = []);
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(e) {
p.forEach(this.handlers, function(n) {
n !== null && e(n);
});
}
};
const ts = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, No = typeof URLSearchParams < "u" ? URLSearchParams : Vr, Uo = typeof FormData < "u" ? FormData : null, qo = typeof Blob < "u" ? Blob : null, Lo = {
isBrowser: !0,
classes: {
URLSearchParams: No,
FormData: Uo,
Blob: qo
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, Wr = typeof window < "u" && typeof document < "u", Fr = typeof navigator == "object" && navigator || void 0, Mo = Wr && (!Fr || ["ReactNative", "NativeScript", "NS"].indexOf(Fr.product) < 0), $o = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Bo = Wr && window.location.href || "http://localhost", zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: Wr,
hasStandardBrowserEnv: Mo,
hasStandardBrowserWebWorkerEnv: $o,
navigator: Fr,
origin: Bo
}, Symbol.toStringTag, { value: "Module" })), he = {
...zo,
...Lo
};
function Vo(t, e) {
return rr(t, new he.classes.URLSearchParams(), {
visitor: function(r, n, o, i) {
return he.isNode && p.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
},
...e
});
}
function Wo(t) {
return p.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
}
function Ho(t) {
const e = {}, r = Object.keys(t);
let n;
const o = r.length;
let i;
for (n = 0; n < o; n++)
i = r[n], e[i] = t[i];
return e;
}
function rs(t) {
function e(r, n, o, i) {
let c = r[i++];
if (c === "__proto__") return !0;
const d = Number.isFinite(+c), b = i >= r.length;
return c = !c && p.isArray(o) ? o.length : c, b ? (p.hasOwnProp(o, c) ? o[c] = [o[c], n] : o[c] = n, !d) : ((!o[c] || !p.isObject(o[c])) && (o[c] = []), e(r, n, o[c], i) && p.isArray(o[c]) && (o[c] = Ho(o[c])), !d);
}
if (p.isFormData(t) && p.isFunction(t.entries)) {
const r = {};
return p.forEachEntry(t, (n, o) => {
e(Wo(n), o, r, 0);
}), r;
}
return null;
}
function Ko(t, e, r) {
if (p.isString(t))
try {
return (e || JSON.parse)(t), p.trim(t);
} catch (n) {
if (n.name !== "SyntaxError")
throw n;
}
return (r || JSON.stringify)(t);
}
const Ot = {
transitional: ts,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(e, r) {
const n = r.getContentType() || "", o = n.indexOf("application/json") > -1, i = p.isObject(e);
if (i && p.isHTMLForm(e) && (e = new FormData(e)), p.isFormData(e))
return o ? JSON.stringify(rs(e)) : e;
if (p.isArrayBuffer(e) || p.isBuffer(e) || p.isStream(e) || p.isFile(e) || p.isBlob(e) || p.isReadableStream(e))
return e;
if (p.isArrayBufferView(e))
return e.buffer;
if (p.isURLSearchParams(e))
return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
let d;
if (i) {
if (n.indexOf("application/x-www-form-urlencoded") > -1)
return Vo(e, this.formSerializer).toString();
if ((d = p.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
const b = this.env && this.env.FormData;
return rr(
d ? { "files[]": e } : e,
b && new b(),
this.formSerializer
);
}
}
return i || o ? (r.setContentType("application/json", !1), Ko(e)) : e;
}],
transformResponse: [function(e) {
const r = this.transitional || Ot.transitional, n = r && r.forcedJSONParsing, o = this.responseType === "json";
if (p.isResponse(e) || p.isReadableStream(e))
return e;
if (e && p.isString(e) && (n && !this.responseType || o)) {
const c = !(r && r.silentJSONParsing) && o;
try {
return JSON.parse(e);
} catch (d) {
if (c)
throw d.name === "SyntaxError" ? D.from(d, D.ERR_BAD_RESPONSE, this, null, this.response) : d;
}
}
return e;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: he.classes.FormData,
Blob: he.classes.Blob
},
validateStatus: function(e) {
return e >= 200 && e < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
p.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
Ot.headers[t] = {};
});
const Jo = p.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"
]), Qo = (t) => {
const e = {};
let r, n, o;
return t && t.split(`
`).forEach(function(c) {
o = c.indexOf(":"), r = c.substring(0, o).trim().toLowerCase(), n = c.substring(o + 1).trim(), !(!r || e[r] && Jo[r]) && (r === "set-cookie" ? e[r] ? e[r].push(n) : e[r] = [n] : e[r] = e[r] ? e[r] + ", " + n : n);
}), e;
}, wn = Symbol("internals");
function vt(t) {
return t && String(t).trim().toLowerCase();
}
function Qt(t) {
return t === !1 || t == null ? t : p.isArray(t) ? t.map(Qt) : String(t);
}
function Yo(t) {
const e = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let n;
for (; n = r.exec(t); )
e[n[1]] = n[2];
return e;
}
const Go = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
function Ar(t, e, r, n, o) {
if (p.isFunction(n))
return n.call(this, e, r);
if (o && (e = r), !!p.isString(e)) {
if (p.isString(n))
return e.indexOf(n) !== -1;
if (p.isRegExp(n))
return n.test(e);
}
}
function Xo(t) {
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, r, n) => r.toUpperCase() + n);
}
function Zo(t, e) {
const r = p.toCamelCase(" " + e);
["get", "set", "has"].forEach((n) => {
Object.defineProperty(t, n + r, {
value: function(o, i, c) {
return this[n].call(this, e, o, i, c);
},
configurable: !0
});
});
}
let Re = class {
constructor(e) {
e && this.set(e);
}
set(e, r, n) {
const o = this;
function i(d, b, y) {
const m = vt(b);
if (!m)
throw new Error("header name must be a non-empty string");
const E = p.findKey(o, m);
(!E || o[E] === void 0 || y === !0 || y === void 0 && o[E] !== !1) && (o[E || b] = Qt(d));
}
const c = (d, b) => p.forEach(d, (y, m) => i(y, m, b));
if (p.isPlainObject(e) || e instanceof this.constructor)
c(e, r);
else if (p.isString(e) && (e = e.trim()) && !Go(e))
c(Qo(e), r);
else if (p.isObject(e) && p.isIterable(e)) {
let d = {}, b, y;
for (const m of e) {
if (!p.isArray(m))
throw TypeError("Object iterator must return a key-value pair");
d[y = m[0]] = (b = d[y]) ? p.isArray(b) ? [...b, m[1]] : [b, m[1]] : m[1];
}
c(d, r);
} else
e != null && i(r, e, n);
return this;
}
get(e, r) {
if (e = vt(e), e) {
const n = p.findKey(this, e);
if (n) {
const o = this[n];
if (!r)
return o;
if (r === !0)
return Yo(o);
if (p.isFunction(r))
return r.call(this, o, n);
if (p.isRegExp(r))
return r.exec(o);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(e, r) {
if (e = vt(e), e) {
const n = p.findKey(this, e);
return !!(n && this[n] !== void 0 && (!r || Ar(this, this[n], n, r)));
}
return !1;
}
delete(e, r) {
const n = this;
let o = !1;
function i(c) {
if (c = vt(c), c) {
const d = p.findKey(n, c);
d && (!r || Ar(n, n[d], d, r)) && (delete n[d], o = !0);
}
}
return p.isArray(e) ? e.forEach(i) : i(e), o;
}
clear(e) {
const r = Object.keys(this);
let n = r.length, o = !1;
for (; n--; ) {
const i = r[n];
(!e || Ar(this, this[i], i, e, !0)) && (delete this[i], o = !0);
}
return o;
}
normalize(e) {
const r = this, n = {};
return p.forEach(this, (o, i) => {
const c = p.findKey(n, i);
if (c) {
r[c] = Qt(o), delete r[i];
return;
}
const d = e ? Xo(i) : String(i).trim();
d !== i && delete r[i], r[d] = Qt(o), n[d] = !0;
}), this;
}
concat(...e) {
return this.constructor.concat(this, ...e);
}
toJSON(e) {
const r = /* @__PURE__ */ Object.create(null);
return p.forEach(this, (n, o) => {
n != null && n !== !1 && (r[o] = e && p.isArray(n) ? n.join(", ") : n);
}), r;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([e, r]) => e + ": " + r).join(`
`);
}
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, ...r) {
const n = new this(e);
return r.forEach((o) => n.set(o)), n;
}
static accessor(e) {
const n = (this[wn] = this[wn] = {
accessors: {}
}).accessors, o = this.prototype;
function i(c) {
const d = vt(c);
n[d] || (Zo(o, c), n[d] = !0);
}
return p.isArray(e) ? e.forEach(i) : i(e), this;
}
};
Re.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
p.reduceDescriptors(Re.prototype, ({ value: t }, e) => {
let r = e[0].toUpperCase() + e.slice(1);
return {
get: () => t,
set(n) {
this[r] = n;
}
};
});
p.freezeMethods(Re);
function kr(t, e) {
const r = this || Ot, n = e || r, o = Re.from(n.headers);
let i = n.data;
return p.forEach(t, function(d) {
i = d.call(r, i, o.normalize(), e ? e.status : void 0);
}), o.normalize(), i;
}
function ns(t) {
return !!(t && t.__CANCEL__);
}
function ut(t, e, r) {
D.call(this, t ?? "canceled", D.ERR_CANCELED, e, r), this.name = "CanceledError";
}
p.inherits(ut, D, {
__CANCEL__: !0
});
function ss(t, e, r) {
const n = r.config.validateStatus;
!r.status || !n || n(r.status) ? t(r) : e(new D(
"Request failed with status code " + r.status,
[D.ERR_BAD_REQUEST, D.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
r.config,
r.request,
r
));
}
function ei(t) {
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
return e && e[1] || "";
}
function ti(t, e) {
t = t || 10;
const r = new Array(t), n = new Array(t);
let o = 0, i = 0, c;
return e = e !== void 0 ? e : 1e3, function(b) {
const y = Date.now(), m = n[i];
c || (c = y), r[o] = b, n[o] = y;
let E = i, I = 0;
for (; E !== o; )
I += r[E++], E = E % t;
if (o = (o + 1) % t, o === i && (i = (i + 1) % t), y - c < e)
return;
const M = m && y - m;
return M ? Math.round(I * 1e3 / M) : void 0;
};
}
function ri(t, e) {
let r = 0, n = 1e3 / e, o, i;
const c = (y, m = Date.now()) => {
r = m, o = null, i && (clearTimeout(i), i = null), t(...y);
};
return [(...y) => {
const m = Date.now(), E = m - r;
E >= n ? c(y, m) : (o = y, i || (i = setTimeout(() => {
i = null, c(o);
}, n - E)));
}, () => o && c(o)];
}
const Gt = (t, e, r = 3) => {
let n = 0;
const o = ti(50, 250);
return ri((i) => {
const c = i.loaded, d = i.lengthComputable ? i.total : void 0, b = c - n, y = o(b), m = c <= d;
n = c;
const E = {
loaded: c,
total: d,
progress: d ? c / d : void 0,
bytes: b,
rate: y || void 0,
estimated: y && d && m ? (d - c) / y : void 0,
event: i,
lengthComputable: d != null,
[e ? "download" : "upload"]: !0
};
t(E);
}, r);
}, Sn = (t, e) => {
const r = t != null;
return [(n) => e[0]({
lengthComputable: r,
total: t,
loaded: n
}), e[1]];
}, Cn = (t) => (...e) => p.asap(() => t(...e)), ni = he.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, he.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
new URL(he.origin),
he.navigator && /(msie|trident)/i.test(he.navigator.userAgent)
) : () => !0, si = he.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(t, e, r, n, o, i) {
const c = [t + "=" + encodeURIComponent(e)];
p.isNumber(r) && c.push("expires=" + new Date(r).toGMTString()), p.isString(n) && c.push("path=" + n), p.isString(o) && c.push("domain=" + o), i === !0 && c.push("secure"), document.cookie = c.join("; ");
},
read(t) {
const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
return e ? decodeURIComponent(e[3]) : null;
},
remove(t) {
this.write(t, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function oi(t) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
}
function ii(t, e) {
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
}
function os(t, e, r) {
let n = !oi(e);
return t && (n || r == !1) ? ii(t, e) : e;
}
const Tn = (t) => t instanceof Re ? { ...t } : t;
function Je(t, e) {
e = e || {};
const r = {};
function n(y, m, E, I) {
return p.isPlainObject(y) && p.isPlainObject(m) ? p.merge.call({ caseless: I }, y, m) : p.isPlainObject(m) ? p.merge({}, m) : p.isArray(m) ? m.slice() : m;
}
function o(y, m, E, I) {
if (p.isUndefined(m)) {
if (!p.isUndefined(y))
return n(void 0, y, E, I);
} else return n(y, m, E, I);
}
function i(y, m) {
if (!p.isUndefined(m))
return n(void 0, m);
}
function c(y, m) {
if (p.isUndefined(m)) {
if (!p.isUndefined(y))
return n(void 0, y);
} else return n(void 0, m);
}
function d(y, m, E) {
if (E in e)
return n(y, m);
if (E in t)
return n(void 0, y);
}
const b = {
url: i,
method: i,
data: i,
baseURL: c,
transformRequest: c,
transformResponse: c,
paramsSerializer: c,
timeout: c,
timeoutMessage: c,
withCredentials: c,
withXSRFToken: c,
adapter: c,
responseType: c,
xsrfCookieName: c,
xsrfHeaderName: c,
onUploadProgress: c,
onDownloadProgress: c,
decompress: c,
maxContentLength: c,
maxBodyLength: c,
beforeRedirect: c,
transport: c,
httpAgent: c,
httpsAgent: c,
cancelToken: c,
socketPath: c,
responseEncoding: c,
validateStatus: d,
headers: (y, m, E) => o(Tn(y), Tn(m), E, !0)
};
return p.forEach(Object.keys({ ...t, ...e }), function(m) {
const E = b[m] || o, I = E(t[m], e[m], m);
p.isUndefined(I) && E !== d || (r[m] = I);
}), r;
}
const is = (t) => {
const e = Je({}, t);
let { data: r, withXSRFToken: n, xsrfHeaderName: o, xsrfCookieName: i, headers: c, auth: d } = e;
e.headers = c = Re.from(c), e.url = es(os(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), d && c.set(
"Authorization",
"Basic " + btoa((d.username || "") + ":" + (d.password ? unescape(encodeURIComponent(d.password)) : ""))
);
let b;
if (p.isFormData(r)) {
if (he.hasStandardBrowserEnv || he.hasStandardBrowserWebWorkerEnv)
c.setContentType(void 0);
else if ((b = c.getContentType()) !== !1) {
const [y, ...m] = b ? b.split(";").map((E) => E.trim()).filter(Boolean) : [];
c.setContentType([y || "multipart/form-data", ...m].join("; "));
}
}
if (he.hasStandardBrowserEnv && (n && p.isFunction(n) && (n = n(e)), n || n !== !1 && ni(e.url))) {
const y = o && i && si.read(i);
y && c.set(o, y);
}
return e;
}, ai = typeof XMLHttpRequest < "u", ui = ai && function(t) {
return new Promise(function(r, n) {
const o = is(t);
let i = o.data;
const c = Re.from(o.headers).normalize();
let { responseType: d, onUploadProgress: b, onDownloadProgress: y } = o, m, E, I, M, C;
function P() {
M && M(), C && C(), o.cancelToken && o.cancelToken.unsubscribe(m), o.signal && o.signal.removeEventListener("abort", m);
}
let S = new XMLHttpRequest();
S.open(o.method.toUpperCase(), o.url, !0), S.timeout = o.timeout;
function B() {
if (!S)
return;
const J = Re.from(
"getAllResponseHeaders" in S && S.getAllResponseHeaders()
), q = {
data: !d || d === "text" || d === "json" ? S.responseText : S.response,
status: S.status,
statusText: S.statusText,
headers: J,
config: t,
request: S
};
ss(function(ce) {
r(ce), P();
}, function(ce) {
n(ce), P();
}, q), S = null;
}
"onloadend" in S ? S.onloadend = B : S.onreadystatechange = function() {
!S || S.readyState !== 4 || S.status === 0 && !(S.responseURL && S.responseURL.indexOf("file:") === 0) || setTimeout(B);
}, S.onabort = function() {
S && (n(new D("Request aborted", D.ECONNABORTED, t, S)), S = null);
}, S.onerror = function() {
n(new D("Network Error", D.ERR_NETWORK, t, S)), S = null;
}, S.ontimeout = function() {
let se = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
const q = o.transitional || ts;
o.timeoutErrorMessage && (se = o.timeoutErrorMessage), n(new D(
se,
q.clarifyTimeoutError ? D.ETIMEDOUT : D.ECONNABORTED,
t,
S
)), S = null;
}, i === void 0 && c.setContentType(null), "setRequestHeader" in S && p.forEach(c.toJSON(), function(se, q) {
S.setRequestHeader(q, se);
}), p.isUndefined(o.withCredentials) || (S.withCredentials = !!o.withCredentials), d && d !== "json" && (S.responseType = o.responseType), y && ([I, C] = Gt(y, !0), S.addEventListener("progress", I)), b && S.upload && ([E, M] = Gt(b), S.upload.addEventListener("progress", E), S.upload.addEventListener("loadend", M)), (o.cancelToken || o.signal) && (m = (J) => {
S && (n(!J || J.type ? new ut(null, t, S) : J), S.abort(), S = null);
}, o.cancelToken && o.cancelToken.subscribe(m), o.signal && (o.signal.aborted ? m() : o.signal.addEventListener("abort", m)));
const k = ei(o.url);
if (k && he.protocols.indexOf(k) === -1) {
n(new D("Unsupported protocol " + k + ":", D.ERR_BAD_REQUEST, t));
return;
}
S.send(i || null);
});
}, ci = (t, e) => {
const { length: r } = t = t ? t.filter(Boolean) : [];
if (e || r) {
let n = new AbortController(), o;
const i = function(y) {
if (!o) {
o = !0, d();
const m = y instanceof Error ? y : this.reason;
n.abort(m instanceof D ? m : new ut(m instanceof Error ? m.message : m));
}
};
let c = e && setTimeout(() => {
c = null, i(new D(`timeout ${e} of ms exceeded`, D.ETIMEDOUT));
}, e);
const d = () => {
t && (c && clearTimeout(c), c = null, t.forEach((y) => {
y.unsubscribe ? y.unsubscribe(i) : y.removeEventListener("abort", i);
}), t = null);
};
t.forEach((y) => y.addEventListener("abort", i));
const { signal: b } = n;
return b.unsubscribe = () => p.asap(d), b;
}
}, li = function* (t, e) {
let r = t.byteLength;
if (r < e) {
yield t;
return;
}
let n = 0, o;
for (; n < r; )
o = n + e, yield t.slice(n, o), n = o;
}, fi = async function* (t, e) {
for await (const r of di(t))
yield* li(r, e);
}, di = async function* (t) {
if (t[Symbol.asyncIterator]) {
yield* t;
return;
}
const e = t.getReader();
try {
for (; ; ) {
const { done: r, value: n } = await e.read();
if (r)
break;
yield n;
}
} finally {
await e.cancel();
}
}, _n = (t, e, r, n) => {
const o = fi(t, e);
let i = 0, c, d = (b) => {
c || (c = !0, n && n(b));
};
return new ReadableStream({
async pull(b) {
try {
const { done: y, value: m } = await o.next();
if (y) {
d(), b.close();
return;
}
let E = m.byteLength;
if (r) {
let I = i += E;
r(I);
}
b.enqueue(new Uint8Array(m));
} catch (y) {
throw d(y), y;
}
},
cancel(b) {
return d(b), o.return();
}
}, {
highWaterMark: 2
});
}, nr = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", as = nr && typeof ReadableStream == "function", pi = nr && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((t) => (e) => t.encode(e))(new TextEncoder()) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())), us = (t, ...e) => {
try {
return !!t(...e);
} catch {
return !1;
}
}, hi = as && us(() => {
let t = !1;
const e = new Request(he.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return t = !0, "half";
}
}).headers.has("Content-Type");
return t && !e;
}), On = 64 * 1024, Nr = as && us(() => p.isReadableStream(new Response("").body)), Xt = {
stream: Nr && ((t) => t.body)
};
nr && ((t) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
!Xt[e] && (Xt[e] = p.isFunction(t[e]) ? (r) => r[e]() : (r, n) => {
throw new D(`Response type '${e}' is not supported`, D.ERR_NOT_SUPPORT, n);
});
});
})(new Response());
const mi = async (t) => {
if (t == null)
return 0;
if (p.isBlob(t))
return t.size;
if (p.isSpecCompliantForm(t))
return (await new Request(he.origin, {
method: "POST",
body: t
}).arrayBuffer()).byteLength;
if (p.isArrayBufferView(t) || p.isArrayBuffer(t))
return t.byteLength;
if (p.isURLSearchParams(t) && (t = t + ""), p.isString(t))
return (await pi(t)).byteLength;
}, yi = async (t, e) => {
const r = p.toFiniteNumber(t.getContentLength());
return r ?? mi(e);
}, gi = nr && (async (t) => {
let {
url: e,
method: r,
data: n,
signal: o,
cancelToken: i,
timeout: c,
onDownloadProgress: d,
onUploadProgress: b,
responseType: y,
headers: m,
withCredentials: E = "same-origin",
fetchOptions: I
} = is(t);
y = y ? (y + "").toLowerCase() : "text";
let M = ci([o, i && i.toAbortSignal()], c), C;
const P = M && M.unsubscribe && (() => {
M.unsubscribe();
});
let S;
try {
if (b && hi && r !== "get" && r !== "head" && (S = await yi(m, n)) !== 0) {
let q = new Request(e, {
method: "POST",
body: n,
duplex: "half"
}), X;
if (p.isFormData(n) && (X = q.headers.get("content-type")) && m.setContentType(X), q.body) {
const [ce, me] = Sn(
S,
Gt(Cn(b))
);
n = _n(q.body, On, ce, me);
}
}
p.isString(E) || (E = E ? "include" : "omit");
const B = "credentials" in Request.prototype;
C = new Request(e, {
...I,
signal: M,
method: r.toUpperCase(),
headers: m.normalize().toJSON(),
body: n,
duplex: "half",
credentials: B ? E : void 0
});
let k = await fetch(C, I);
const J = Nr && (y === "stream" || y === "response");
if (Nr && (d || J && P)) {
const q = {};
["status", "statusText", "headers"].forEach((Te) => {
q[Te] = k[Te];
});
const X = p.toFiniteNumber(k.headers.get("content-length")), [ce, me] = d && Sn(
X,
Gt(Cn(d), !0)
) || [];
k = new Response(
_n(k.body, On, ce, () => {
me && me(), P && P();
}),
q
);
}
y = y || "text";
let se = await Xt[p.findKey(Xt, y) || "text"](k, t);
return !J && P && P(), await new Promise((q, X) => {
ss(q, X, {
data: se,
headers: Re.from(k.headers),
status: k.status,
statusText: k.statusText,
config: t,
request: C
});
});
} catch (B) {
throw P && P(), B && B.name === "TypeError" && /Load failed|fetch/i.test(B.message) ? Object.assign(
new D("Network Error", D.ERR_NETWORK, t, C),
{
cause: B.cause || B
}
) : D.from(B, B && B.code, t, C);
}
}), Ur = {
http: Do,
xhr: ui,
fetch: gi
};
p.forEach(Ur, (t, e) => {
if (t) {
try {
Object.defineProperty(t, "name", { value: e });
} catch {
}
Object.defineProperty(t, "adapterName", { value: e });
}
});
const xn = (t) => `- ${t}`, vi = (t) => p.isFunction(t) || t === null || t === !1, cs = {
getAdapter: (t) => {
t = p.isArray(t) ? t : [t];
const { length: e } = t;
let r, n;
const o = {};
for (let i = 0; i < e; i++) {
r = t[i];
let c;
if (n = r, !vi(r) && (n = Ur[(c = String(r)).toLowerCase()], n === void 0))
throw new D(`Unknown adapter '${c}'`);
if (n)
break;
o[c || "#" + i] = n;
}
if (!n) {
const i = Object.entries(o).map(
([d, b]) => `adapter ${d} ` + (b === !1 ? "is not supported by the environment" : "is not available in the build")
);
let c = e ? i.length > 1 ? `since :
` + i.map(xn).join(`
`) : " " + xn(i[0]) : "as no adapter specified";
throw new D(
"There is no suitable adapter to dispatch the request " + c,
"ERR_NOT_SUPPORT"
);
}
return n;
},
adapters: Ur
};
function Dr(t) {
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
throw new ut(null, t);
}
function Pn(t) {
return Dr(t), t.headers = Re.from(t.headers), t.data = kr.call(
t,
t.transformRequest
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), cs.getAdapter(t.adapter || Ot.adapter)(t).then(function(n) {
return Dr(t), n.data = kr.call(
t,
t.transformResponse,
n
), n.headers = Re.from(n.headers), n;
}, function(n) {
return ns(n) || (Dr(t), n && n.response && (n.response.data = kr.call(
t,
t.transformResponse,
n.response
), n.response.headers = Re.from(n.response.headers))), Promise.reject(n);
});
}
const ls = "1.11.0", sr = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
sr[t] = function(n) {
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
};
});
const An = {};
sr.transitional = function(e, r, n) {
function o(i, c) {
return "[Axios v" + ls + "] Transitional option '" + i + "'" + c + (n ? ". " + n : "");
}
return (i, c, d) => {
if (e === !1)
throw new D(
o(c, " has been removed" + (r ? " in " + r : "")),
D.ERR_DEPRECATED
);
return r && !An[c] && (An[c] = !0, console.warn(
o(
c,
" has been deprecated since v" + r + " and will be removed in the near future"
)
)), e ? e(i, c, d) : !0;
};
};
sr.spelling = function(e) {
return (r, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
};
function bi(t, e, r) {
if (typeof t != "object")
throw new D("options must be an object", D.ERR_BAD_OPTION_VALUE);
const n = Object.keys(t);
let o = n.length;
for (; o-- > 0; ) {
const i = n[o], c = e[i];
if (c) {
const d = t[i], b = d === void 0 || c(d, i, t);
if (b !== !0)
throw new D("option " + i + " must be " + b, D.ERR_BAD_OPTION_VALUE);
continue;
}
if (r !== !0)
throw new D("Unknown option " + i, D.ERR_BAD_OPTION);
}
}
const Yt = {
assertOptions: bi,
validators: sr
}, xe = Yt.validators;
let Ke = class {
constructor(e) {
this.defaults = e || {}, this.interceptors = {
request: new En(),
response: new En()
};
}
/**
* Dispatch a request
*
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
* @param {?Object} config
*
* @returns {Promise} The Promise to be fulfilled
*/
async request(e, r) {
try {
return await this._request(e, r);
} catch (n) {
if (n instanceof Error) {
let o = {};
Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
const i = o.stack ? o.stack.replace(/^.+\n/, "") : "";
try {
n.stack ? i && !String(n.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (n.stack += `
` + i) : n.stack = i;
} catch {
}
}
throw n;
}
}
_request(e, r) {
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = Je(this.defaults, r);
const { transitional: n, paramsSerializer: o, headers: i } = r;
n !== void 0 && Yt.assertOptions(n, {
silentJSONParsing: xe.transitional(xe.boolean),
forcedJSONParsing: xe.transitional(xe.boolean),
clarifyTimeoutError: xe.transitional(xe.boolean)
}, !1), o != null && (p.isFunction(o) ? r.paramsSerializer = {
serialize: o
} : Yt.assertOptions(o, {
encode: xe.function,
serialize: xe.function
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), Yt.assertOptions(r, {
baseUrl: xe.spelling("baseURL"),
withXsrfToken: xe.spelling("withXSRFToken")
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
let c = i && p.merge(
i.common,
i[r.method]
);
i && p.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(C) => {
delete i[C];
}
), r.headers = Re.concat(c, i);
const d = [];
let b = !0;
this.interceptors.request.forEach(function(P) {
typeof P.runWhen == "function" && P.runWhen(r) === !1 || (b = b && P.synchronous, d.unshift(P.fulfilled, P.rejected));
});
const y = [];
this.interceptors.response.forEach(function(P) {
y.push(P.fulfilled, P.rejected);
});
let m, E = 0, I;
if (!b) {
const C = [Pn.bind(this), void 0];
for (C.unshift(...d), C.push(...y), I = C.length, m = Promise.resolve(r); E < I; )
m = m.then(C[E++], C[E++]);
return m;
}
I = d.length;
let M = r;
for (E = 0; E < I; ) {
const C = d[E++], P = d[E++];
try {
M = C(M);
} catch (S) {
P.call(this, S);
break;
}
}
try {
m = Pn.call(this, M);
} catch (C) {
return Promise.reject(C);
}
for (E = 0, I = y.length; E < I; )
m = m.then(y[E++], y[E++]);
return m;
}
getUri(e) {
e = Je(this.defaults, e);
const r = os(e.baseURL, e.url, e.allowAbsoluteUrls);
return es(r, e.params, e.paramsSerializer);
}
};
p.forEach(["delete", "get", "head", "options"], function(e) {
Ke.prototype[e] = function(r, n) {
return this.request(Je(n || {}, {
method: e,
url: r,
data: (n || {}).data
}));
};
});
p.forEach(["post", "put", "patch"], function(e) {
function r(n) {
return function(i, c, d) {
return this.request(Je(d || {}, {
method: e,
headers: n ? {
"Content-Type": "multipart/form-data"
} : {},
url: i,
data: c
}));
};
}
Ke.prototype[e] = r(), Ke.prototype[e + "Form"] = r(!0);
});
let Ri = class fs {
constructor(e) {
if (typeof e != "function")
throw new TypeError("executor must be a function.");
let r;
this.promise = new Promise(function(i) {
r = i;
});
const n = this;
this.promise.then((o) => {
if (!n._listeners) return;
let i = n._listeners.length;
for (; i-- > 0; )
n._listeners[i](o);
n._listeners = null;
}), this.promise.then = (o) => {
let i;
const c = new Promise((d) => {
n.subscribe(d), i = d;
}).then(o);
return c.cancel = function() {
n.unsubscribe(i);
}, c;
}, e(function(i, c, d) {
n.reason || (n.reason = new ut(i, c, d), r(n.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason)
throw this.reason;
}
/**
* Subscribe to the cancel signal
*/
subscribe(e) {
if (this.reason) {
e(this.reason);
return;
}
this._listeners ? this._listeners.push(e) : this._listeners = [e];
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(e) {
if (!this._listeners)
return;
const r = this._listeners.indexOf(e);
r !== -1 && this._listeners.splice(r, 1);
}
toAbortSignal() {
const e = new AbortController(), r = (n) => {
e.abort(n);
};
return this.subscribe(r), e.signal.unsubscribe = () => this.unsubscribe(r), e.signal;
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let e;
return {
token: new fs(function(o) {
e = o;
}),
cancel: e
};
}
};
function Ei(t) {
return function(r) {
return t.apply(null, r);
};
}
function wi(t) {
return p.isObject(t) && t.isAxiosError === !0;
}
const qr = {
Continue: 100,
SwitchingProtocols: 101,
Processing: 102,
EarlyHints: 103,
Ok: 200,
Created: 201,
Accepted: 202,
NonAuthoritativeInformation: 203,
NoContent: 204,
ResetContent: 205,
PartialContent: 206,
MultiStatus: 207,
AlreadyReported: 208,
ImUsed: 226,
MultipleChoices: 300,
MovedPermanently: 301,
Found: 302,
SeeOther: 303,
NotModified: 304,
UseProxy: 305,
Unused: 306,
TemporaryRedirect: 307,
PermanentRedirect: 308,
BadRequest: 400,
Unauthorized: 401,
PaymentRequired: 402,
Forbidden: 403,
NotFound: 404,
MethodNotAllowed: 405,
NotAcceptable: 406,
ProxyAuthenticationRequired: 407,
RequestTimeout: 408,
Conflict: 409,
Gone: 410,
LengthRequired: 411,
PreconditionFailed: 412,
PayloadTooLarge: 413,
UriTooLong: 414,
UnsupportedMediaType: 415,
RangeNotSatisfiable: 416,
ExpectationFailed: 417,
ImATeapot: 418,
MisdirectedRequest: 421,
UnprocessableEntity: 422,
Locked: 423,
FailedDependency: 424,
TooEarly: 425,
UpgradeRequired: 426,
PreconditionRequired: 428,
TooManyRequests: 429,
RequestHeaderFieldsTooLarge: 431,
UnavailableForLegalReasons: 451,
InternalServerError: 500,
NotImplemented: 501,
BadGateway: 502,
ServiceUnavailable: 503,
GatewayTimeout: 504,
HttpVersionNotSupported: 505,
VariantAlsoNegotiates: 506,
InsufficientStorage: 507,
LoopDetected: 508,
NotExtended: 510,
NetworkAuthenticationRequired: 511
};
Object.entries(qr).forEach(([t, e]) => {
qr[e] = t;
});
function ds(t) {
const e = new Ke(t), r = Bn(Ke.prototype.request, e);
ret