@wdp-api/bim-api
Version:
51WORLD BIM/DCP Api is a JavaScript plugin for WdpApi, It provides a set of APIs for developers to integrate BIM/DCP into their own applications.
1,640 lines • 265 kB
JavaScript
var $i = Object.defineProperty;
var Vi = (o, r, n) => r in o ? $i(o, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[r] = n;
var se = (o, r, n) => Vi(o, typeof r != "symbol" ? r + "" : r, n);
class Bs {
constructor(r, n) {
se(this, "subject");
se(this, "level");
this.subject = r, this.level = n ?? 10;
}
log(r, n, ...s) {
if (typeof (s == null ? void 0 : s[0]) == "string" && s[0].match(/\%[sodif]?/gi)) {
const a = s.shift(), u = /* @__PURE__ */ new Date();
console.log(
`${n}%c[${u.toLocaleTimeString()}.${u.getMilliseconds()}]::: %c${a}`,
`color: ${r}`,
"color: unset",
...s
);
} else
for (const a of s) {
const u = /* @__PURE__ */ new Date();
console.log(`${n}%c[${u.toLocaleTimeString()}.${u.getMilliseconds()}]:::`, `color: ${r}`, a);
}
}
error(r, ...n) {
this.level !== 0 && (console.group(
`%c${this.subject} %c ${r}`,
"color: black; border-radius: 3px 0 0 3px; padding: 2px 2px 1px 10px; background: #ff4d4f",
"border-radius: 0 3px 3px 0; padding: 2px 10px 1px 2px; background: #ff4d4f20"
), this.log("#ff4d4f", "⭕", ...n), console.groupEnd());
}
info(r, ...n) {
console.groupCollapsed(
`%c${this.subject} %c ${r}`,
"color: black; border-radius: 3px 0 0 3px; padding: 2px 2px 1px 10px; background: #00dc82",
"border-radius: 0 3px 3px 0; padding: 2px 10px 1px 2px; background: #00dc8220"
), this.log("#00dc82", "🚀", ...n), console.groupEnd();
}
warn(r, ...n) {
console.group(
`%c${this.subject} %c ${r}`,
"color: black; border-radius: 3px 0 0 3px; padding: 2px 2px 1px 10px; background: #faad14",
"border-radius: 0 3px 3px 0; padding: 2px 10px 1px 2px; background: #faad1420"
), this.log("#faad14", "🔥", ...n), console.groupEnd();
}
lowLevel(r, ...n) {
this.level < 1 || this.info(r, ...n);
}
highLevel(r, ...n) {
this.level < 3 || this.warn(r, ...n);
}
}
const Wi = (o) => !!o && o.constructor === Symbol, wt = Array.isArray, Ji = (o) => !!o && o.constructor === Object, Ms = (o) => !!(o && o.constructor && o.call && o.apply), vr = (o) => {
try {
return Number(o) === o;
} catch {
return !1;
}
}, Xi = (o) => Object.prototype.toString.call(o) === "[object Date]", $ = (o) => {
if (o === !0 || o === !1 || o == null)
return !0;
if (vr(o))
return o === 0;
if (Xi(o))
return isNaN(o.getTime());
if (Ms(o) || Wi(o))
return !1;
const r = o.length;
if (vr(r))
return r === 0;
const n = o.size;
return vr(n) ? n === 0 : Object.keys(o).length === 0;
}, St = (o, r) => {
if (Object.is(o, r))
return !0;
if (o instanceof Date && r instanceof Date)
return o.getTime() === r.getTime();
if (o instanceof RegExp && r instanceof RegExp)
return o.toString() === r.toString();
if (typeof o != "object" || o === null || typeof r != "object" || r === null)
return !1;
const n = Reflect.ownKeys(o), s = Reflect.ownKeys(r);
if (n.length !== s.length)
return !1;
for (let a = 0; a < n.length; a++)
if (!Reflect.has(r, n[a]) || !St(o[n[a]], r[n[a]]))
return !1;
return !0;
};
function Yi(o, r) {
if (!o || !o.length)
return {};
const n = Ms(r) ? r : wt(r) ? (s, a) => r[a] : (s, a) => r;
return o.reduce((s, a, u) => (s[a] = n(a, u), s), {});
}
const Qi = (o, r, n) => o ? o.reduce((s, a, u) => (n(a, u) && s.push(r(a, u)), s), []) : [], Zi = (o, r) => {
const n = o.reduce((s, a) => {
const u = r(a);
return s[u] || (s[u] = a), s;
}, {});
return Object.values(n);
}, We = (o, r) => !o || !r ? o ?? r ?? {} : Object.entries({ ...o, ...r }).reduce(
(n, [s, a]) => ({
...n,
[s]: Ji(o[s]) ? We(o[s], a) : a
}),
{}
);
function Ls(o, r) {
return function() {
return o.apply(r, arguments);
};
}
const { toString: eo } = Object.prototype, { getPrototypeOf: Rr } = Object, Cn = /* @__PURE__ */ ((o) => (r) => {
const n = eo.call(r);
return o[n] || (o[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), ke = (o) => (o = o.toLowerCase(), (r) => Cn(r) === o), In = (o) => (r) => typeof r === o, { isArray: At } = Array, Kt = In("undefined");
function to(o) {
return o !== null && !Kt(o) && o.constructor !== null && !Kt(o.constructor) && Ie(o.constructor.isBuffer) && o.constructor.isBuffer(o);
}
const Fs = ke("ArrayBuffer");
function no(o) {
let r;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? r = ArrayBuffer.isView(o) : r = o && o.buffer && Fs(o.buffer), r;
}
const ro = In("string"), Ie = In("function"), Gs = In("number"), xn = (o) => o !== null && typeof o == "object", so = (o) => o === !0 || o === !1, Sn = (o) => {
if (Cn(o) !== "object")
return !1;
const r = Rr(o);
return (r === null || r === Object.prototype || Object.getPrototypeOf(r) === null) && !(Symbol.toStringTag in o) && !(Symbol.iterator in o);
}, io = ke("Date"), oo = ke("File"), ao = ke("Blob"), co = ke("FileList"), uo = (o) => xn(o) && Ie(o.pipe), lo = (o) => {
let r;
return o && (typeof FormData == "function" && o instanceof FormData || Ie(o.append) && ((r = Cn(o)) === "formdata" || // detect form-data instance
r === "object" && Ie(o.toString) && o.toString() === "[object FormData]"));
}, fo = ke("URLSearchParams"), [ho, po, mo, yo] = ["ReadableStream", "Request", "Response", "Headers"].map(ke), go = (o) => o.trim ? o.trim() : o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function qt(o, r, { allOwnKeys: n = !1 } = {}) {
if (o === null || typeof o > "u")
return;
let s, a;
if (typeof o != "object" && (o = [o]), At(o))
for (s = 0, a = o.length; s < a; s++)
r.call(null, o[s], s, o);
else {
const u = n ? Object.getOwnPropertyNames(o) : Object.keys(o), l = u.length;
let f;
for (s = 0; s < l; s++)
f = u[s], r.call(null, o[f], f, o);
}
}
function Ks(o, r) {
r = r.toLowerCase();
const n = Object.keys(o);
let s = n.length, a;
for (; s-- > 0; )
if (a = n[s], r === a.toLowerCase())
return a;
return null;
}
const ot = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, qs = (o) => !Kt(o) && o !== ot;
function Pr() {
const { caseless: o } = qs(this) && this || {}, r = {}, n = (s, a) => {
const u = o && Ks(r, a) || a;
Sn(r[u]) && Sn(s) ? r[u] = Pr(r[u], s) : Sn(s) ? r[u] = Pr({}, s) : At(s) ? r[u] = s.slice() : r[u] = s;
};
for (let s = 0, a = arguments.length; s < a; s++)
arguments[s] && qt(arguments[s], n);
return r;
}
const bo = (o, r, n, { allOwnKeys: s } = {}) => (qt(r, (a, u) => {
n && Ie(a) ? o[u] = Ls(a, n) : o[u] = a;
}, { allOwnKeys: s }), o), vo = (o) => (o.charCodeAt(0) === 65279 && (o = o.slice(1)), o), wo = (o, r, n, s) => {
o.prototype = Object.create(r.prototype, s), o.prototype.constructor = o, Object.defineProperty(o, "super", {
value: r.prototype
}), n && Object.assign(o.prototype, n);
}, So = (o, r, n, s) => {
let a, u, l;
const f = {};
if (r = r || {}, o == null) return r;
do {
for (a = Object.getOwnPropertyNames(o), u = a.length; u-- > 0; )
l = a[u], (!s || s(l, o, r)) && !f[l] && (r[l] = o[l], f[l] = !0);
o = n !== !1 && Rr(o);
} while (o && (!n || n(o, r)) && o !== Object.prototype);
return r;
}, Ao = (o, r, n) => {
o = String(o), (n === void 0 || n > o.length) && (n = o.length), n -= r.length;
const s = o.indexOf(r, n);
return s !== -1 && s === n;
}, _o = (o) => {
if (!o) return null;
if (At(o)) return o;
let r = o.length;
if (!Gs(r)) return null;
const n = new Array(r);
for (; r-- > 0; )
n[r] = o[r];
return n;
}, Eo = /* @__PURE__ */ ((o) => (r) => o && r instanceof o)(typeof Uint8Array < "u" && Rr(Uint8Array)), Po = (o, r) => {
const s = (o && o[Symbol.iterator]).call(o);
let a;
for (; (a = s.next()) && !a.done; ) {
const u = a.value;
r.call(o, u[0], u[1]);
}
}, Co = (o, r) => {
let n;
const s = [];
for (; (n = o.exec(r)) !== null; )
s.push(n);
return s;
}, Io = ke("HTMLFormElement"), xo = (o) => o.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, s, a) {
return s.toUpperCase() + a;
}
), bs = (({ hasOwnProperty: o }) => (r, n) => o.call(r, n))(Object.prototype), Oo = ke("RegExp"), Us = (o, r) => {
const n = Object.getOwnPropertyDescriptors(o), s = {};
qt(n, (a, u) => {
let l;
(l = r(a, u, o)) !== !1 && (s[u] = l || a);
}), Object.defineProperties(o, s);
}, ko = (o) => {
Us(o, (r, n) => {
if (Ie(o) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const s = o[n];
if (Ie(s)) {
if (r.enumerable = !1, "writable" in r) {
r.writable = !1;
return;
}
r.set || (r.set = () => {
throw Error("Can not rewrite read-only method '" + n + "'");
});
}
});
}, No = (o, r) => {
const n = {}, s = (a) => {
a.forEach((u) => {
n[u] = !0;
});
};
return At(o) ? s(o) : s(String(o).split(r)), n;
}, Do = () => {
}, Ro = (o, r) => o != null && Number.isFinite(o = +o) ? o : r, wr = "abcdefghijklmnopqrstuvwxyz", vs = "0123456789", Hs = {
DIGIT: vs,
ALPHA: wr,
ALPHA_DIGIT: wr + wr.toUpperCase() + vs
}, To = (o = 16, r = Hs.ALPHA_DIGIT) => {
let n = "";
const { length: s } = r;
for (; o--; )
n += r[Math.random() * s | 0];
return n;
};
function jo(o) {
return !!(o && Ie(o.append) && o[Symbol.toStringTag] === "FormData" && o[Symbol.iterator]);
}
const Bo = (o) => {
const r = new Array(10), n = (s, a) => {
if (xn(s)) {
if (r.indexOf(s) >= 0)
return;
if (!("toJSON" in s)) {
r[a] = s;
const u = At(s) ? [] : {};
return qt(s, (l, f) => {
const y = n(l, a + 1);
!Kt(y) && (u[f] = y);
}), r[a] = void 0, u;
}
}
return s;
};
return n(o, 0);
}, Mo = ke("AsyncFunction"), Lo = (o) => o && (xn(o) || Ie(o)) && Ie(o.then) && Ie(o.catch), zs = ((o, r) => o ? setImmediate : r ? ((n, s) => (ot.addEventListener("message", ({ source: a, data: u }) => {
a === ot && u === n && s.length && s.shift()();
}, !1), (a) => {
s.push(a), ot.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
Ie(ot.postMessage)
), Fo = typeof queueMicrotask < "u" ? queueMicrotask.bind(ot) : typeof process < "u" && process.nextTick || zs, D = {
isArray: At,
isArrayBuffer: Fs,
isBuffer: to,
isFormData: lo,
isArrayBufferView: no,
isString: ro,
isNumber: Gs,
isBoolean: so,
isObject: xn,
isPlainObject: Sn,
isReadableStream: ho,
isRequest: po,
isResponse: mo,
isHeaders: yo,
isUndefined: Kt,
isDate: io,
isFile: oo,
isBlob: ao,
isRegExp: Oo,
isFunction: Ie,
isStream: uo,
isURLSearchParams: fo,
isTypedArray: Eo,
isFileList: co,
forEach: qt,
merge: Pr,
extend: bo,
trim: go,
stripBOM: vo,
inherits: wo,
toFlatObject: So,
kindOf: Cn,
kindOfTest: ke,
endsWith: Ao,
toArray: _o,
forEachEntry: Po,
matchAll: Co,
isHTMLForm: Io,
hasOwnProperty: bs,
hasOwnProp: bs,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Us,
freezeMethods: ko,
toObjectSet: No,
toCamelCase: xo,
noop: Do,
toFiniteNumber: Ro,
findKey: Ks,
global: ot,
isContextDefined: qs,
ALPHABET: Hs,
generateString: To,
isSpecCompliantForm: jo,
toJSONObject: Bo,
isAsyncFn: Mo,
isThenable: Lo,
setImmediate: zs,
asap: Fo
};
function Y(o, r, n, s, a) {
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = o, this.name = "AxiosError", r && (this.code = r), n && (this.config = n), s && (this.request = s), a && (this.response = a, this.status = a.status ? a.status : null);
}
D.inherits(Y, 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: D.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const $s = Y.prototype, Vs = {};
[
"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((o) => {
Vs[o] = { value: o };
});
Object.defineProperties(Y, Vs);
Object.defineProperty($s, "isAxiosError", { value: !0 });
Y.from = (o, r, n, s, a, u) => {
const l = Object.create($s);
return D.toFlatObject(o, l, function(y) {
return y !== Error.prototype;
}, (f) => f !== "isAxiosError"), Y.call(l, o.message, r, n, s, a), l.cause = o, l.name = o.name, u && Object.assign(l, u), l;
};
const Go = null;
function Cr(o) {
return D.isPlainObject(o) || D.isArray(o);
}
function Ws(o) {
return D.endsWith(o, "[]") ? o.slice(0, -2) : o;
}
function ws(o, r, n) {
return o ? o.concat(r).map(function(a, u) {
return a = Ws(a), !n && u ? "[" + a + "]" : a;
}).join(n ? "." : "") : r;
}
function Ko(o) {
return D.isArray(o) && !o.some(Cr);
}
const qo = D.toFlatObject(D, {}, null, function(r) {
return /^is[A-Z]/.test(r);
});
function On(o, r, n) {
if (!D.isObject(o))
throw new TypeError("target must be an object");
r = r || new FormData(), n = D.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(U, H) {
return !D.isUndefined(H[U]);
});
const s = n.metaTokens, a = n.visitor || I, u = n.dots, l = n.indexes, y = (n.Blob || typeof Blob < "u" && Blob) && D.isSpecCompliantForm(r);
if (!D.isFunction(a))
throw new TypeError("visitor must be a function");
function b(M) {
if (M === null) return "";
if (D.isDate(M))
return M.toISOString();
if (!y && D.isBlob(M))
throw new Y("Blob is not supported. Use a Buffer instead.");
return D.isArrayBuffer(M) || D.isTypedArray(M) ? y && typeof Blob == "function" ? new Blob([M]) : Buffer.from(M) : M;
}
function I(M, U, H) {
let ee = M;
if (M && !H && typeof M == "object") {
if (D.endsWith(U, "{}"))
U = s ? U : U.slice(0, -2), M = JSON.stringify(M);
else if (D.isArray(M) && Ko(M) || (D.isFileList(M) || D.endsWith(U, "[]")) && (ee = D.toArray(M)))
return U = Ws(U), ee.forEach(function(le, _e) {
!(D.isUndefined(le) || le === null) && r.append(
// eslint-disable-next-line no-nested-ternary
l === !0 ? ws([U], _e, u) : l === null ? U : U + "[]",
b(le)
);
}), !1;
}
return Cr(M) ? !0 : (r.append(ws(H, U, u), b(M)), !1);
}
const O = [], j = Object.assign(qo, {
defaultVisitor: I,
convertValue: b,
isVisitable: Cr
});
function z(M, U) {
if (!D.isUndefined(M)) {
if (O.indexOf(M) !== -1)
throw Error("Circular reference detected in " + U.join("."));
O.push(M), D.forEach(M, function(ee, ae) {
(!(D.isUndefined(ee) || ee === null) && a.call(
r,
ee,
D.isString(ae) ? ae.trim() : ae,
U,
j
)) === !0 && z(ee, U ? U.concat(ae) : [ae]);
}), O.pop();
}
}
if (!D.isObject(o))
throw new TypeError("data must be an object");
return z(o), r;
}
function Ss(o) {
const r = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g, function(s) {
return r[s];
});
}
function Tr(o, r) {
this._pairs = [], o && On(o, this, r);
}
const Js = Tr.prototype;
Js.append = function(r, n) {
this._pairs.push([r, n]);
};
Js.toString = function(r) {
const n = r ? function(s) {
return r.call(this, s, Ss);
} : Ss;
return this._pairs.map(function(a) {
return n(a[0]) + "=" + n(a[1]);
}, "").join("&");
};
function Uo(o) {
return encodeURIComponent(o).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function Xs(o, r, n) {
if (!r)
return o;
const s = n && n.encode || Uo;
D.isFunction(n) && (n = {
serialize: n
});
const a = n && n.serialize;
let u;
if (a ? u = a(r, n) : u = D.isURLSearchParams(r) ? r.toString() : new Tr(r, n).toString(s), u) {
const l = o.indexOf("#");
l !== -1 && (o = o.slice(0, l)), o += (o.indexOf("?") === -1 ? "?" : "&") + u;
}
return o;
}
class As {
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(r, n, s) {
return this.handlers.push({
fulfilled: r,
rejected: n,
synchronous: s ? s.synchronous : !1,
runWhen: s ? s.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(r) {
this.handlers[r] && (this.handlers[r] = 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(r) {
D.forEach(this.handlers, function(s) {
s !== null && r(s);
});
}
}
const Ys = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, Ho = typeof URLSearchParams < "u" ? URLSearchParams : Tr, zo = typeof FormData < "u" ? FormData : null, $o = typeof Blob < "u" ? Blob : null, Vo = {
isBrowser: !0,
classes: {
URLSearchParams: Ho,
FormData: zo,
Blob: $o
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, jr = typeof window < "u" && typeof document < "u", Ir = typeof navigator == "object" && navigator || void 0, Wo = jr && (!Ir || ["ReactNative", "NativeScript", "NS"].indexOf(Ir.product) < 0), Jo = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Xo = jr && window.location.href || "http://localhost", Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, hasBrowserEnv: jr, hasStandardBrowserEnv: Wo, hasStandardBrowserWebWorkerEnv: Jo, navigator: Ir, origin: Xo }, Symbol.toStringTag, { value: "Module" })), Ae = {
...Yo,
...Vo
};
function Qo(o, r) {
return On(o, new Ae.classes.URLSearchParams(), Object.assign({
visitor: function(n, s, a, u) {
return Ae.isNode && D.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : u.defaultVisitor.apply(this, arguments);
}
}, r));
}
function Zo(o) {
return D.matchAll(/\w+|\[(\w*)]/g, o).map((r) => r[0] === "[]" ? "" : r[1] || r[0]);
}
function ea(o) {
const r = {}, n = Object.keys(o);
let s;
const a = n.length;
let u;
for (s = 0; s < a; s++)
u = n[s], r[u] = o[u];
return r;
}
function Qs(o) {
function r(n, s, a, u) {
let l = n[u++];
if (l === "__proto__") return !0;
const f = Number.isFinite(+l), y = u >= n.length;
return l = !l && D.isArray(a) ? a.length : l, y ? (D.hasOwnProp(a, l) ? a[l] = [a[l], s] : a[l] = s, !f) : ((!a[l] || !D.isObject(a[l])) && (a[l] = []), r(n, s, a[l], u) && D.isArray(a[l]) && (a[l] = ea(a[l])), !f);
}
if (D.isFormData(o) && D.isFunction(o.entries)) {
const n = {};
return D.forEachEntry(o, (s, a) => {
r(Zo(s), a, n, 0);
}), n;
}
return null;
}
function ta(o, r, n) {
if (D.isString(o))
try {
return (r || JSON.parse)(o), D.trim(o);
} catch (s) {
if (s.name !== "SyntaxError")
throw s;
}
return (0, JSON.stringify)(o);
}
const Ut = {
transitional: Ys,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(r, n) {
const s = n.getContentType() || "", a = s.indexOf("application/json") > -1, u = D.isObject(r);
if (u && D.isHTMLForm(r) && (r = new FormData(r)), D.isFormData(r))
return a ? JSON.stringify(Qs(r)) : r;
if (D.isArrayBuffer(r) || D.isBuffer(r) || D.isStream(r) || D.isFile(r) || D.isBlob(r) || D.isReadableStream(r))
return r;
if (D.isArrayBufferView(r))
return r.buffer;
if (D.isURLSearchParams(r))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), r.toString();
let f;
if (u) {
if (s.indexOf("application/x-www-form-urlencoded") > -1)
return Qo(r, this.formSerializer).toString();
if ((f = D.isFileList(r)) || s.indexOf("multipart/form-data") > -1) {
const y = this.env && this.env.FormData;
return On(
f ? { "files[]": r } : r,
y && new y(),
this.formSerializer
);
}
}
return u || a ? (n.setContentType("application/json", !1), ta(r)) : r;
}],
transformResponse: [function(r) {
const n = this.transitional || Ut.transitional, s = n && n.forcedJSONParsing, a = this.responseType === "json";
if (D.isResponse(r) || D.isReadableStream(r))
return r;
if (r && D.isString(r) && (s && !this.responseType || a)) {
const l = !(n && n.silentJSONParsing) && a;
try {
return JSON.parse(r);
} catch (f) {
if (l)
throw f.name === "SyntaxError" ? Y.from(f, Y.ERR_BAD_RESPONSE, this, null, this.response) : f;
}
}
return r;
}],
/**
* 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: Ae.classes.FormData,
Blob: Ae.classes.Blob
},
validateStatus: function(r) {
return r >= 200 && r < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
D.forEach(["delete", "get", "head", "post", "put", "patch"], (o) => {
Ut.headers[o] = {};
});
const na = D.toObjectSet([
"age",
"authorization",
"content-length",
"content-type",
"etag",
"expires",
"from",
"host",
"if-modified-since",
"if-unmodified-since",
"last-modified",
"location",
"max-forwards",
"proxy-authorization",
"referer",
"retry-after",
"user-agent"
]), ra = (o) => {
const r = {};
let n, s, a;
return o && o.split(`
`).forEach(function(l) {
a = l.indexOf(":"), n = l.substring(0, a).trim().toLowerCase(), s = l.substring(a + 1).trim(), !(!n || r[n] && na[n]) && (n === "set-cookie" ? r[n] ? r[n].push(s) : r[n] = [s] : r[n] = r[n] ? r[n] + ", " + s : s);
}), r;
}, _s = Symbol("internals");
function Gt(o) {
return o && String(o).trim().toLowerCase();
}
function An(o) {
return o === !1 || o == null ? o : D.isArray(o) ? o.map(An) : String(o);
}
function sa(o) {
const r = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let s;
for (; s = n.exec(o); )
r[s[1]] = s[2];
return r;
}
const ia = (o) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());
function Sr(o, r, n, s, a) {
if (D.isFunction(s))
return s.call(this, r, n);
if (a && (r = n), !!D.isString(r)) {
if (D.isString(s))
return r.indexOf(s) !== -1;
if (D.isRegExp(s))
return s.test(r);
}
}
function oa(o) {
return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (r, n, s) => n.toUpperCase() + s);
}
function aa(o, r) {
const n = D.toCamelCase(" " + r);
["get", "set", "has"].forEach((s) => {
Object.defineProperty(o, s + n, {
value: function(a, u, l) {
return this[s].call(this, r, a, u, l);
},
configurable: !0
});
});
}
let Pe = class {
constructor(r) {
r && this.set(r);
}
set(r, n, s) {
const a = this;
function u(f, y, b) {
const I = Gt(y);
if (!I)
throw new Error("header name must be a non-empty string");
const O = D.findKey(a, I);
(!O || a[O] === void 0 || b === !0 || b === void 0 && a[O] !== !1) && (a[O || y] = An(f));
}
const l = (f, y) => D.forEach(f, (b, I) => u(b, I, y));
if (D.isPlainObject(r) || r instanceof this.constructor)
l(r, n);
else if (D.isString(r) && (r = r.trim()) && !ia(r))
l(ra(r), n);
else if (D.isHeaders(r))
for (const [f, y] of r.entries())
u(y, f, s);
else
r != null && u(n, r, s);
return this;
}
get(r, n) {
if (r = Gt(r), r) {
const s = D.findKey(this, r);
if (s) {
const a = this[s];
if (!n)
return a;
if (n === !0)
return sa(a);
if (D.isFunction(n))
return n.call(this, a, s);
if (D.isRegExp(n))
return n.exec(a);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(r, n) {
if (r = Gt(r), r) {
const s = D.findKey(this, r);
return !!(s && this[s] !== void 0 && (!n || Sr(this, this[s], s, n)));
}
return !1;
}
delete(r, n) {
const s = this;
let a = !1;
function u(l) {
if (l = Gt(l), l) {
const f = D.findKey(s, l);
f && (!n || Sr(s, s[f], f, n)) && (delete s[f], a = !0);
}
}
return D.isArray(r) ? r.forEach(u) : u(r), a;
}
clear(r) {
const n = Object.keys(this);
let s = n.length, a = !1;
for (; s--; ) {
const u = n[s];
(!r || Sr(this, this[u], u, r, !0)) && (delete this[u], a = !0);
}
return a;
}
normalize(r) {
const n = this, s = {};
return D.forEach(this, (a, u) => {
const l = D.findKey(s, u);
if (l) {
n[l] = An(a), delete n[u];
return;
}
const f = r ? oa(u) : String(u).trim();
f !== u && delete n[u], n[f] = An(a), s[f] = !0;
}), this;
}
concat(...r) {
return this.constructor.concat(this, ...r);
}
toJSON(r) {
const n = /* @__PURE__ */ Object.create(null);
return D.forEach(this, (s, a) => {
s != null && s !== !1 && (n[a] = r && D.isArray(s) ? s.join(", ") : s);
}), n;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([r, n]) => r + ": " + n).join(`
`);
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(r) {
return r instanceof this ? r : new this(r);
}
static concat(r, ...n) {
const s = new this(r);
return n.forEach((a) => s.set(a)), s;
}
static accessor(r) {
const s = (this[_s] = this[_s] = {
accessors: {}
}).accessors, a = this.prototype;
function u(l) {
const f = Gt(l);
s[f] || (aa(a, l), s[f] = !0);
}
return D.isArray(r) ? r.forEach(u) : u(r), this;
}
};
Pe.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
D.reduceDescriptors(Pe.prototype, ({ value: o }, r) => {
let n = r[0].toUpperCase() + r.slice(1);
return {
get: () => o,
set(s) {
this[n] = s;
}
};
});
D.freezeMethods(Pe);
function Ar(o, r) {
const n = this || Ut, s = r || n, a = Pe.from(s.headers);
let u = s.data;
return D.forEach(o, function(f) {
u = f.call(n, u, a.normalize(), r ? r.status : void 0);
}), a.normalize(), u;
}
function Zs(o) {
return !!(o && o.__CANCEL__);
}
function _t(o, r, n) {
Y.call(this, o ?? "canceled", Y.ERR_CANCELED, r, n), this.name = "CanceledError";
}
D.inherits(_t, Y, {
__CANCEL__: !0
});
function ei(o, r, n) {
const s = n.config.validateStatus;
!n.status || !s || s(n.status) ? o(n) : r(new Y(
"Request failed with status code " + n.status,
[Y.ERR_BAD_REQUEST, Y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
n.config,
n.request,
n
));
}
function ca(o) {
const r = /^([-+\w]{1,25})(:?\/\/|:)/.exec(o);
return r && r[1] || "";
}
function ua(o, r) {
o = o || 10;
const n = new Array(o), s = new Array(o);
let a = 0, u = 0, l;
return r = r !== void 0 ? r : 1e3, function(y) {
const b = Date.now(), I = s[u];
l || (l = b), n[a] = y, s[a] = b;
let O = u, j = 0;
for (; O !== a; )
j += n[O++], O = O % o;
if (a = (a + 1) % o, a === u && (u = (u + 1) % o), b - l < r)
return;
const z = I && b - I;
return z ? Math.round(j * 1e3 / z) : void 0;
};
}
function la(o, r) {
let n = 0, s = 1e3 / r, a, u;
const l = (b, I = Date.now()) => {
n = I, a = null, u && (clearTimeout(u), u = null), o.apply(null, b);
};
return [(...b) => {
const I = Date.now(), O = I - n;
O >= s ? l(b, I) : (a = b, u || (u = setTimeout(() => {
u = null, l(a);
}, s - O)));
}, () => a && l(a)];
}
const En = (o, r, n = 3) => {
let s = 0;
const a = ua(50, 250);
return la((u) => {
const l = u.loaded, f = u.lengthComputable ? u.total : void 0, y = l - s, b = a(y), I = l <= f;
s = l;
const O = {
loaded: l,
total: f,
progress: f ? l / f : void 0,
bytes: y,
rate: b || void 0,
estimated: b && f && I ? (f - l) / b : void 0,
event: u,
lengthComputable: f != null,
[r ? "download" : "upload"]: !0
};
o(O);
}, n);
}, Es = (o, r) => {
const n = o != null;
return [(s) => r[0]({
lengthComputable: n,
total: o,
loaded: s
}), r[1]];
}, Ps = (o) => (...r) => D.asap(() => o(...r)), da = Ae.hasStandardBrowserEnv ? /* @__PURE__ */ ((o, r) => (n) => (n = new URL(n, Ae.origin), o.protocol === n.protocol && o.host === n.host && (r || o.port === n.port)))(
new URL(Ae.origin),
Ae.navigator && /(msie|trident)/i.test(Ae.navigator.userAgent)
) : () => !0, fa = Ae.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(o, r, n, s, a, u) {
const l = [o + "=" + encodeURIComponent(r)];
D.isNumber(n) && l.push("expires=" + new Date(n).toGMTString()), D.isString(s) && l.push("path=" + s), D.isString(a) && l.push("domain=" + a), u === !0 && l.push("secure"), document.cookie = l.join("; ");
},
read(o) {
const r = document.cookie.match(new RegExp("(^|;\\s*)(" + o + ")=([^;]*)"));
return r ? decodeURIComponent(r[3]) : null;
},
remove(o) {
this.write(o, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function ha(o) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(o);
}
function pa(o, r) {
return r ? o.replace(/\/?\/$/, "") + "/" + r.replace(/^\/+/, "") : o;
}
function ti(o, r) {
return o && !ha(r) ? pa(o, r) : r;
}
const Cs = (o) => o instanceof Pe ? { ...o } : o;
function ct(o, r) {
r = r || {};
const n = {};
function s(b, I, O, j) {
return D.isPlainObject(b) && D.isPlainObject(I) ? D.merge.call({ caseless: j }, b, I) : D.isPlainObject(I) ? D.merge({}, I) : D.isArray(I) ? I.slice() : I;
}
function a(b, I, O, j) {
if (D.isUndefined(I)) {
if (!D.isUndefined(b))
return s(void 0, b, O, j);
} else return s(b, I, O, j);
}
function u(b, I) {
if (!D.isUndefined(I))
return s(void 0, I);
}
function l(b, I) {
if (D.isUndefined(I)) {
if (!D.isUndefined(b))
return s(void 0, b);
} else return s(void 0, I);
}
function f(b, I, O) {
if (O in r)
return s(b, I);
if (O in o)
return s(void 0, b);
}
const y = {
url: u,
method: u,
data: u,
baseURL: l,
transformRequest: l,
transformResponse: l,
paramsSerializer: l,
timeout: l,
timeoutMessage: l,
withCredentials: l,
withXSRFToken: l,
adapter: l,
responseType: l,
xsrfCookieName: l,
xsrfHeaderName: l,
onUploadProgress: l,
onDownloadProgress: l,
decompress: l,
maxContentLength: l,
maxBodyLength: l,
beforeRedirect: l,
transport: l,
httpAgent: l,
httpsAgent: l,
cancelToken: l,
socketPath: l,
responseEncoding: l,
validateStatus: f,
headers: (b, I, O) => a(Cs(b), Cs(I), O, !0)
};
return D.forEach(Object.keys(Object.assign({}, o, r)), function(I) {
const O = y[I] || a, j = O(o[I], r[I], I);
D.isUndefined(j) && O !== f || (n[I] = j);
}), n;
}
const ni = (o) => {
const r = ct({}, o);
let { data: n, withXSRFToken: s, xsrfHeaderName: a, xsrfCookieName: u, headers: l, auth: f } = r;
r.headers = l = Pe.from(l), r.url = Xs(ti(r.baseURL, r.url), o.params, o.paramsSerializer), f && l.set(
"Authorization",
"Basic " + btoa((f.username || "") + ":" + (f.password ? unescape(encodeURIComponent(f.password)) : ""))
);
let y;
if (D.isFormData(n)) {
if (Ae.hasStandardBrowserEnv || Ae.hasStandardBrowserWebWorkerEnv)
l.setContentType(void 0);
else if ((y = l.getContentType()) !== !1) {
const [b, ...I] = y ? y.split(";").map((O) => O.trim()).filter(Boolean) : [];
l.setContentType([b || "multipart/form-data", ...I].join("; "));
}
}
if (Ae.hasStandardBrowserEnv && (s && D.isFunction(s) && (s = s(r)), s || s !== !1 && da(r.url))) {
const b = a && u && fa.read(u);
b && l.set(a, b);
}
return r;
}, ma = typeof XMLHttpRequest < "u", ya = ma && function(o) {
return new Promise(function(n, s) {
const a = ni(o);
let u = a.data;
const l = Pe.from(a.headers).normalize();
let { responseType: f, onUploadProgress: y, onDownloadProgress: b } = a, I, O, j, z, M;
function U() {
z && z(), M && M(), a.cancelToken && a.cancelToken.unsubscribe(I), a.signal && a.signal.removeEventListener("abort", I);
}
let H = new XMLHttpRequest();
H.open(a.method.toUpperCase(), a.url, !0), H.timeout = a.timeout;
function ee() {
if (!H)
return;
const le = Pe.from(
"getAllResponseHeaders" in H && H.getAllResponseHeaders()
), be = {
data: !f || f === "text" || f === "json" ? H.responseText : H.response,
status: H.status,
statusText: H.statusText,
headers: le,
config: o,
request: H
};
ei(function(de) {
n(de), U();
}, function(de) {
s(de), U();
}, be), H = null;
}
"onloadend" in H ? H.onloadend = ee : H.onreadystatechange = function() {
!H || H.readyState !== 4 || H.status === 0 && !(H.responseURL && H.responseURL.indexOf("file:") === 0) || setTimeout(ee);
}, H.onabort = function() {
H && (s(new Y("Request aborted", Y.ECONNABORTED, o, H)), H = null);
}, H.onerror = function() {
s(new Y("Network Error", Y.ERR_NETWORK, o, H)), H = null;
}, H.ontimeout = function() {
let _e = a.timeout ? "timeout of " + a.timeout + "ms exceeded" : "timeout exceeded";
const be = a.transitional || Ys;
a.timeoutErrorMessage && (_e = a.timeoutErrorMessage), s(new Y(
_e,
be.clarifyTimeoutError ? Y.ETIMEDOUT : Y.ECONNABORTED,
o,
H
)), H = null;
}, u === void 0 && l.setContentType(null), "setRequestHeader" in H && D.forEach(l.toJSON(), function(_e, be) {
H.setRequestHeader(be, _e);
}), D.isUndefined(a.withCredentials) || (H.withCredentials = !!a.withCredentials), f && f !== "json" && (H.responseType = a.responseType), b && ([j, M] = En(b, !0), H.addEventListener("progress", j)), y && H.upload && ([O, z] = En(y), H.upload.addEventListener("progress", O), H.upload.addEventListener("loadend", z)), (a.cancelToken || a.signal) && (I = (le) => {
H && (s(!le || le.type ? new _t(null, o, H) : le), H.abort(), H = null);
}, a.cancelToken && a.cancelToken.subscribe(I), a.signal && (a.signal.aborted ? I() : a.signal.addEventListener("abort", I)));
const ae = ca(a.url);
if (ae && Ae.protocols.indexOf(ae) === -1) {
s(new Y("Unsupported protocol " + ae + ":", Y.ERR_BAD_REQUEST, o));
return;
}
H.send(u || null);
});
}, ga = (o, r) => {
const { length: n } = o = o ? o.filter(Boolean) : [];
if (r || n) {
let s = new AbortController(), a;
const u = function(b) {
if (!a) {
a = !0, f();
const I = b instanceof Error ? b : this.reason;
s.abort(I instanceof Y ? I : new _t(I instanceof Error ? I.message : I));
}
};
let l = r && setTimeout(() => {
l = null, u(new Y(`timeout ${r} of ms exceeded`, Y.ETIMEDOUT));
}, r);
const f = () => {
o && (l && clearTimeout(l), l = null, o.forEach((b) => {
b.unsubscribe ? b.unsubscribe(u) : b.removeEventListener("abort", u);
}), o = null);
};
o.forEach((b) => b.addEventListener("abort", u));
const { signal: y } = s;
return y.unsubscribe = () => D.asap(f), y;
}
}, ba = function* (o, r) {
let n = o.byteLength;
if (n < r) {
yield o;
return;
}
let s = 0, a;
for (; s < n; )
a = s + r, yield o.slice(s, a), s = a;
}, va = async function* (o, r) {
for await (const n of wa(o))
yield* ba(n, r);
}, wa = async function* (o) {
if (o[Symbol.asyncIterator]) {
yield* o;
return;
}
const r = o.getReader();
try {
for (; ; ) {
const { done: n, value: s } = await r.read();
if (n)
break;
yield s;
}
} finally {
await r.cancel();
}
}, Is = (o, r, n, s) => {
const a = va(o, r);
let u = 0, l, f = (y) => {
l || (l = !0, s && s(y));
};
return new ReadableStream({
async pull(y) {
try {
const { done: b, value: I } = await a.next();
if (b) {
f(), y.close();
return;
}
let O = I.byteLength;
if (n) {
let j = u += O;
n(j);
}
y.enqueue(new Uint8Array(I));
} catch (b) {
throw f(b), b;
}
},
cancel(y) {
return f(y), a.return();
}
}, {
highWaterMark: 2
});
}, kn = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", ri = kn && typeof ReadableStream == "function", Sa = kn && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((o) => (r) => o.encode(r))(new TextEncoder()) : async (o) => new Uint8Array(await new Response(o).arrayBuffer())), si = (o, ...r) => {
try {
return !!o(...r);
} catch {
return !1;
}
}, Aa = ri && si(() => {
let o = !1;
const r = new Request(Ae.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return o = !0, "half";
}
}).headers.has("Content-Type");
return o && !r;
}), xs = 64 * 1024, xr = ri && si(() => D.isReadableStream(new Response("").body)), Pn = {
stream: xr && ((o) => o.body)
};
kn && ((o) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((r) => {
!Pn[r] && (Pn[r] = D.isFunction(o[r]) ? (n) => n[r]() : (n, s) => {
throw new Y(`Response type '${r}' is not supported`, Y.ERR_NOT_SUPPORT, s);
});
});
})(new Response());
const _a = async (o) => {
if (o == null)
return 0;
if (D.isBlob(o))
return o.size;
if (D.isSpecCompliantForm(o))
return (await new Request(Ae.origin, {
method: "POST",
body: o
}).arrayBuffer()).byteLength;
if (D.isArrayBufferView(o) || D.isArrayBuffer(o))
return o.byteLength;
if (D.isURLSearchParams(o) && (o = o + ""), D.isString(o))
return (await Sa(o)).byteLength;
}, Ea = async (o, r) => {
const n = D.toFiniteNumber(o.getContentLength());
return n ?? _a(r);
}, Pa = kn && (async (o) => {
let {
url: r,
method: n,
data: s,
signal: a,
cancelToken: u,
timeout: l,
onDownloadProgress: f,
onUploadProgress: y,
responseType: b,
headers: I,
withCredentials: O = "same-origin",
fetchOptions: j
} = ni(o);
b = b ? (b + "").toLowerCase() : "text";
let z = ga([a, u && u.toAbortSignal()], l), M;
const U = z && z.unsubscribe && (() => {
z.unsubscribe();
});
let H;
try {
if (y && Aa && n !== "get" && n !== "head" && (H = await Ea(I, s)) !== 0) {
let be = new Request(r, {
method: "POST",
body: s,
duplex: "half"
}), me;
if (D.isFormData(s) && (me = be.headers.get("content-type")) && I.setContentType(me), be.body) {
const [de, Je] = Es(
H,
En(Ps(y))
);
s = Is(be.body, xs, de, Je);
}
}
D.isString(O) || (O = O ? "include" : "omit");
const ee = "credentials" in Request.prototype;
M = new Request(r, {
...j,
signal: z,
method: n.toUpperCase(),
headers: I.normalize().toJSON(),
body: s,
duplex: "half",
credentials: ee ? O : void 0
});
let ae = await fetch(M);
const le = xr && (b === "stream" || b === "response");
if (xr && (f || le && U)) {
const be = {};
["status", "statusText", "headers"].forEach((zt) => {
be[zt] = ae[zt];
});
const me = D.toFiniteNumber(ae.headers.get("content-length")), [de, Je] = f && Es(
me,
En(Ps(f), !0)
) || [];
ae = new Response(
Is(ae.body, xs, de, () => {
Je && Je(), U && U();
}),
be
);
}
b = b || "text";
let _e = await Pn[D.findKey(Pn, b) || "text"](ae, o);
return !le && U && U(), await new Promise((be, me) => {
ei(be, me, {
data: _e,
headers: Pe.from(ae.headers),
status: ae.status,
statusText: ae.statusText,
config: o,
request: M
});
});
} catch (ee) {
throw U && U(), ee && ee.name === "TypeError" && /fetch/i.test(ee.message) ? Object.assign(
new Y("Network Error", Y.ERR_NETWORK, o, M),
{
cause: ee.cause || ee
}
) : Y.from(ee, ee && ee.code, o, M);
}
}), Or = {
http: Go,
xhr: ya,
fetch: Pa
};
D.forEach(Or, (o, r) => {
if (o) {
try {
Object.defineProperty(o, "name", { value: r });
} catch {
}
Object.defineProperty(o, "adapterName", { value: r });
}
});
const Os = (o) => `- ${o}`, Ca = (o) => D.isFunction(o) || o === null || o === !1, ii = {
getAdapter: (o) => {
o = D.isArray(o) ? o : [o];
const { length: r } = o;
let n, s;
const a = {};
for (let u = 0; u < r; u++) {
n = o[u];
let l;
if (s = n, !Ca(n) && (s = Or[(l = String(n)).toLowerCase()], s === void 0))
throw new Y(`Unknown adapter '${l}'`);
if (s)
break;
a[l || "#" + u] = s;
}
if (!s) {
const u = Object.entries(a).map(
([f, y]) => `adapter ${f} ` + (y === !1 ? "is not supported by the environment" : "is not available in the build")
);
let l = r ? u.length > 1 ? `since :
` + u.map(Os).join(`
`) : " " + Os(u[0]) : "as no adapter specified";
throw new Y(
"There is no suitable adapter to dispatch the request " + l,
"ERR_NOT_SUPPORT"
);
}
return s;
},
adapters: Or
};
function _r(o) {
if (o.cancelToken && o.cancelToken.throwIfRequested(), o.signal && o.signal.aborted)
throw new _t(null, o);
}
function ks(o) {
return _r(o), o.headers = Pe.from(o.headers), o.data = Ar.call(
o,
o.transformRequest
), ["post", "put", "patch"].indexOf(o.method) !== -1 && o.headers.setContentType("application/x-www-form-urlencoded", !1), ii.getAdapter(o.adapter || Ut.adapter)(o).then(function(s) {
return _r(o), s.data = Ar.call(
o,
o.transformResponse,
s
), s.headers = Pe.from(s.headers), s;
}, function(s) {
return Zs(s) || (_r(o), s && s.response && (s.response.data = Ar.call(
o,
o.transformResponse,
s.response
), s.response.headers = Pe.from(s.response.headers))), Promise.reject(s);
});
}
const oi = "1.7.9", Nn = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((o, r) => {
Nn[o] = function(s) {
return typeof s === o || "a" + (r < 1 ? "n " : " ") + o;
};
});
const Ns = {};
Nn.transitional = function(r, n, s) {
function a(u, l) {
return "[Axios v" + oi + "] Transitional option '" + u + "'" + l + (s ? ". " + s : "");
}
return (u, l, f) => {
if (r === !1)
throw new Y(
a(l, " has been removed" + (n ? " in " + n : "")),
Y.ERR_DEPRECATED
);
return n && !Ns[l] && (Ns[l] = !0, console.warn(
a(
l,
" has been deprecated since v" + n + " and will be removed in the near future"
)
)), r ? r(u, l, f) : !0;
};
};
Nn.spelling = function(r) {
return (n, s) => (console.warn(`${s} is likely a misspelling of ${r}`), !0);
};
function Ia(o, r, n) {
if (typeof o != "object")
throw new Y("options must be an object", Y.ERR_BAD_OPTION_VALUE);
const s = Object.keys(o);
let a = s.length;
for (; a-- > 0; ) {
const u = s[a], l = r[u];
if (l) {
const f = o[u], y = f === void 0 || l(f, u, o);
if (y !== !0)
throw new Y("option " + u + " must be " + y, Y.ERR_BAD_OPTION_VALUE);
continue;
}
if (n !== !0)
throw new Y("Unknown option " + u, Y.ERR_BAD_OPTION);
}
}
const _n = {
assertOptions: Ia,
validators: Nn
}, Te = _n.validators;
let at = class {
constructor(r) {
this.defaults = r, this.interceptors = {
request: new As(),
response: new As()
};
}
/**
* 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(r, n) {
try {
return await this._request(r, n);
} catch (s) {
if (s instanceof Error) {
let a = {};
Error.captureStackTrace ? Error.captureStackTrace(a) : a = new Error();
const u = a.stack ? a.stack.replace(/^.+\n/, "") : "";
try {
s.stack ? u && !String(s.stack).endsWith(u.replace(/^.+\n.+\n/, "")) && (s.stack += `
` + u) : s.stack = u;
} catch {
}
}
throw s;
}
}
_request(r, n) {
typeof r == "string" ? (n = n || {}, n.url = r) : n = r || {}, n = ct(this.defaults, n);
const { transitional: s, paramsSerializer: a, headers: u } = n;
s !== void 0 && _n.assertOptions(s, {
silentJSONParsing: Te.transitional(Te.boolean),
forcedJSONParsing: Te.transitional(Te.boolean),
clarifyTimeoutError: Te.transitional(Te.boolean)
}, !1), a != null && (D.isFunction(a) ? n.paramsSerializer = {
serialize: a
} : _n.assertOptions(a, {
encode: Te.function,
serialize: Te.function
}, !0)), _n.assertOptions(n, {
baseUrl: Te.spelling("baseURL"),
withXsrfToken: Te.spelling("withXSRFToken")
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
let l = u && D.merge(
u.common,
u[n.method]
);
u && D.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(M) => {
delete u[M];
}
), n.headers = Pe.concat(l, u);
const f = [];
let y = !0;
this.interceptors.request.forEach(function(U) {
typeof U.runWhen == "function" && U.runWhen(n) === !1 || (y = y && U.synchronous, f.unshift(U.fulfilled, U.rejected));
});
const b = [];
this.interceptors.response.forEach(function(U) {
b.push(U.fulfilled, U.rejected);
});
let I, O = 0, j;
if (!y) {
const M = [ks.bind(this), void 0];
for (M.unshift.apply(M, f), M.push.apply(M, b), j = M.length, I = Promise.resolve(n); O < j; )
I = I.then(M[O++], M[O++]);
return I;
}
j = f.length;
let z = n;
for (O = 0; O < j; ) {
const M = f[O++], U = f[O++];
try {
z = M(z);
} catch (H) {
U.call(this, H);
break;
}
}
try {
I = ks.call(this, z);
} catch (M) {
return Promise.reject(M);
}
for (O = 0, j = b.length; O < j; )
I = I.then(b[O++], b[O++]);
return I;
}
getUri(r) {
r = ct(this.defaults, r);
const n = ti(r.baseURL, r.url);
return Xs(n, r.params, r.paramsSerializer);
}
};
D.forEach(["delete", "get", "head", "options"], function(r) {
at.prototype[r] = function(n, s) {
return this.request(ct(s || {}, {
method: r,
url: n,
data: (s || {}).data
}));
};
});
D.forEach(["post", "put", "patch"], function(r) {
function n(s) {
return function(u, l, f) {
return this.request(ct(f || {}, {
method: r,
headers: s ? {
"Content-Type": "multipart/form-data"
} : {},
url: u,
data: l
}));
};
}
at.prototype[r] = n(), at.prototype[r + "Form"] = n(!0);
});
let xa = class ai {
constructor(r) {
if (typeof r != "function")
throw new TypeError("executor must be a function.");
let n;
this.promise = new Promise(function(u) {
n = u;
});
const s = this;
this.promise.then((a) => {
if (!s._listeners) return;
let u = s._listeners.length;
for (; u-- > 0; )
s._listeners[u](a);
s._listeners = null;
}), this.promise.then = (a) => {
let u;
const l = new Promise((f) => {
s.subscribe(f), u = f;
}).then(a);
return l.cancel = function() {
s.unsubscribe(u);
}, l;
}, r(function(u, l, f) {
s.reason || (s.reason = new _t(u, l, f), n(s.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequest