epic-designer-gold
Version:
基于vue3的设计器,可视化开发页面表单
1,883 lines • 54.1 kB
JavaScript
function We(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: mt } = Object.prototype, { getPrototypeOf: we } = Object, { iterator: re, toStringTag: Ke } = Symbol, se = /* @__PURE__ */ ((e) => (t) => {
const n = mt.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), F = (e) => (e = e.toLowerCase(), (t) => se(t) === e), oe = (e) => (t) => typeof t === e, { isArray: M } = Array, H = oe("undefined");
function J(e) {
return e !== null && !H(e) && e.constructor !== null && !H(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const ve = F("ArrayBuffer");
function yt(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && ve(e.buffer), t;
}
const bt = oe("string"), A = oe("function"), Xe = oe("number"), V = (e) => e !== null && typeof e == "object", wt = (e) => e === !0 || e === !1, Y = (e) => {
if (se(e) !== "object")
return !1;
const t = we(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Ke in e) && !(re in e);
}, Rt = (e) => {
if (!V(e) || J(e))
return !1;
try {
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
} catch {
return !1;
}
}, Et = F("Date"), gt = F("File"), St = (e) => !!(e && typeof e.uri < "u"), Ot = (e) => e && typeof e.getParts < "u", Tt = F("Blob"), At = F("FileList"), Ct = (e) => V(e) && A(e.pipe);
function xt() {
return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
}
const Ne = xt(), Pe = typeof Ne.FormData < "u" ? Ne.FormData : void 0, _t = (e) => {
let t;
return e && (Pe && e instanceof Pe || A(e.append) && ((t = se(e)) === "formdata" || // detect form-data instance
t === "object" && A(e.toString) && e.toString() === "[object FormData]"));
}, Nt = F("URLSearchParams"), [Pt, Ft, Ut, Lt] = [
"ReadableStream",
"Request",
"Response",
"Headers"
].map(F), Dt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function W(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, s;
if (typeof e != "object" && (e = [e]), M(e))
for (r = 0, s = e.length; r < s; r++)
t.call(null, e[r], r, e);
else {
if (J(e))
return;
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
let c;
for (r = 0; r < i; r++)
c = o[r], t.call(null, e[c], c, e);
}
}
function Ge(e, t) {
if (J(e))
return null;
t = t.toLowerCase();
const n = Object.keys(e);
let r = n.length, s;
for (; r-- > 0; )
if (s = n[r], t === s.toLowerCase())
return s;
return null;
}
const k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Qe = (e) => !H(e) && e !== k;
function he() {
const { caseless: e, skipUndefined: t } = Qe(this) && this || {}, n = {}, r = (s, o) => {
if (o === "__proto__" || o === "constructor" || o === "prototype")
return;
const i = e && Ge(n, o) || o;
Y(n[i]) && Y(s) ? n[i] = he(n[i], s) : Y(s) ? n[i] = he({}, s) : M(s) ? n[i] = s.slice() : (!t || !H(s)) && (n[i] = s);
};
for (let s = 0, o = arguments.length; s < o; s++)
arguments[s] && W(arguments[s], r);
return n;
}
const Bt = (e, t, n, { allOwnKeys: r } = {}) => (W(
t,
(s, o) => {
n && A(s) ? Object.defineProperty(e, o, {
value: We(s, n),
writable: !0,
enumerable: !0,
configurable: !0
}) : Object.defineProperty(e, o, {
value: s,
writable: !0,
enumerable: !0,
configurable: !0
});
},
{ allOwnKeys: r }
), e), kt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), jt = (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);
}, qt = (e, t, n, r) => {
let s, o, i;
const c = {};
if (t = t || {}, e == null) return t;
do {
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
i = s[o], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
e = n !== !1 && we(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, It = (e, t, n) => {
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
const r = e.indexOf(t, n);
return r !== -1 && r === n;
}, Ht = (e) => {
if (!e) return null;
if (M(e)) return e;
let t = e.length;
if (!Xe(t)) return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, Mt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && we(Uint8Array)), $t = (e, t) => {
const r = (e && e[re]).call(e);
let s;
for (; (s = r.next()) && !s.done; ) {
const o = s.value;
t.call(e, o[0], o[1]);
}
}, zt = (e, t) => {
let n;
const r = [];
for (; (n = e.exec(t)) !== null; )
r.push(n);
return r;
}, Jt = F("HTMLFormElement"), Vt = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, s) {
return r.toUpperCase() + s;
}), Fe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Wt = F("RegExp"), Ze = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
W(n, (s, o) => {
let i;
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
}), Object.defineProperties(e, r);
}, Kt = (e) => {
Ze(e, (t, n) => {
if (A(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const r = e[n];
if (A(r)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + n + "'");
});
}
});
}, vt = (e, t) => {
const n = {}, r = (s) => {
s.forEach((o) => {
n[o] = !0;
});
};
return M(e) ? r(e) : r(String(e).split(t)), n;
}, Xt = () => {
}, Gt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function Qt(e) {
return !!(e && A(e.append) && e[Ke] === "FormData" && e[re]);
}
const Zt = (e) => {
const t = new Array(10), n = (r, s) => {
if (V(r)) {
if (t.indexOf(r) >= 0)
return;
if (J(r))
return r;
if (!("toJSON" in r)) {
t[s] = r;
const o = M(r) ? [] : {};
return W(r, (i, c) => {
const p = n(i, s + 1);
!H(p) && (o[c] = p);
}), t[s] = void 0, o;
}
}
return r;
};
return n(e, 0);
}, Yt = F("AsyncFunction"), en = (e) => e && (V(e) || A(e)) && A(e.then) && A(e.catch), Ye = ((e, t) => e ? setImmediate : t ? ((n, r) => (k.addEventListener(
"message",
({ source: s, data: o }) => {
s === k && o === n && r.length && r.shift()();
},
!1
), (s) => {
r.push(s), k.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", A(k.postMessage)), tn = typeof queueMicrotask < "u" ? queueMicrotask.bind(k) : typeof process < "u" && process.nextTick || Ye, nn = (e) => e != null && A(e[re]), a = {
isArray: M,
isArrayBuffer: ve,
isBuffer: J,
isFormData: _t,
isArrayBufferView: yt,
isString: bt,
isNumber: Xe,
isBoolean: wt,
isObject: V,
isPlainObject: Y,
isEmptyObject: Rt,
isReadableStream: Pt,
isRequest: Ft,
isResponse: Ut,
isHeaders: Lt,
isUndefined: H,
isDate: Et,
isFile: gt,
isReactNativeBlob: St,
isReactNative: Ot,
isBlob: Tt,
isRegExp: Wt,
isFunction: A,
isStream: Ct,
isURLSearchParams: Nt,
isTypedArray: Mt,
isFileList: At,
forEach: W,
merge: he,
extend: Bt,
trim: Dt,
stripBOM: kt,
inherits: jt,
toFlatObject: qt,
kindOf: se,
kindOfTest: F,
endsWith: It,
toArray: Ht,
forEachEntry: $t,
matchAll: zt,
isHTMLForm: Jt,
hasOwnProperty: Fe,
hasOwnProp: Fe,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Ze,
freezeMethods: Kt,
toObjectSet: vt,
toCamelCase: Vt,
noop: Xt,
toFiniteNumber: Gt,
findKey: Ge,
global: k,
isContextDefined: Qe,
isSpecCompliantForm: Qt,
toJSONObject: Zt,
isAsyncFn: Yt,
isThenable: en,
setImmediate: Ye,
asap: tn,
isIterable: nn
};
let y = class et extends Error {
static from(t, n, r, s, o, i) {
const c = new et(t.message, n || t.code, r, s, o);
return c.cause = t, c.name = t.name, t.status != null && c.status == null && (c.status = t.status), i && Object.assign(c, i), c;
}
/**
* Create an Error with the specified message, config, error code, request and response.
*
* @param {string} message The error message.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
* @param {Object} [config] The config.
* @param {Object} [request] The request.
* @param {Object} [response] The response.
*
* @returns {Error} The created error.
*/
constructor(t, n, r, s, o) {
super(t), Object.defineProperty(this, "message", {
value: t,
enumerable: !0,
writable: !0,
configurable: !0
}), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), r && (this.config = r), s && (this.request = s), o && (this.response = o, this.status = o.status);
}
toJSON() {
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: a.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
};
y.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
y.ERR_BAD_OPTION = "ERR_BAD_OPTION";
y.ECONNABORTED = "ECONNABORTED";
y.ETIMEDOUT = "ETIMEDOUT";
y.ERR_NETWORK = "ERR_NETWORK";
y.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
y.ERR_DEPRECATED = "ERR_DEPRECATED";
y.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
y.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
y.ERR_CANCELED = "ERR_CANCELED";
y.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
y.ERR_INVALID_URL = "ERR_INVALID_URL";
const rn = null;
function me(e) {
return a.isPlainObject(e) || a.isArray(e);
}
function tt(e) {
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function ue(e, t, n) {
return e ? e.concat(t).map(function(s, o) {
return s = tt(s), !n && o ? "[" + s + "]" : s;
}).join(n ? "." : "") : t;
}
function sn(e) {
return a.isArray(e) && !e.some(me);
}
const on = a.toFlatObject(a, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function ie(e, t, n) {
if (!a.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = a.toFlatObject(
n,
{
metaTokens: !0,
dots: !1,
indexes: !1
},
!1,
function(m, d) {
return !a.isUndefined(d[m]);
}
);
const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, p = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
if (!a.isFunction(s))
throw new TypeError("visitor must be a function");
function f(u) {
if (u === null) return "";
if (a.isDate(u))
return u.toISOString();
if (a.isBoolean(u))
return u.toString();
if (!p && a.isBlob(u))
throw new y("Blob is not supported. Use a Buffer instead.");
return a.isArrayBuffer(u) || a.isTypedArray(u) ? p && typeof Blob == "function" ? new Blob([u]) : Buffer.from(u) : u;
}
function l(u, m, d) {
let w = u;
if (a.isReactNative(t) && a.isReactNativeBlob(u))
return t.append(ue(d, m, o), f(u)), !1;
if (u && !d && typeof u == "object") {
if (a.endsWith(m, "{}"))
m = r ? m : m.slice(0, -2), u = JSON.stringify(u);
else if (a.isArray(u) && sn(u) || (a.isFileList(u) || a.endsWith(m, "[]")) && (w = a.toArray(u)))
return m = tt(m), w.forEach(function(E, O) {
!(a.isUndefined(E) || E === null) && t.append(
// eslint-disable-next-line no-nested-ternary
i === !0 ? ue([m], O, o) : i === null ? m : m + "[]",
f(E)
);
}), !1;
}
return me(u) ? !0 : (t.append(ue(d, m, o), f(u)), !1);
}
const h = [], b = Object.assign(on, {
defaultVisitor: l,
convertValue: f,
isVisitable: me
});
function g(u, m) {
if (!a.isUndefined(u)) {
if (h.indexOf(u) !== -1)
throw Error("Circular reference detected in " + m.join("."));
h.push(u), a.forEach(u, function(w, x) {
(!(a.isUndefined(w) || w === null) && s.call(t, w, a.isString(x) ? x.trim() : x, m, b)) === !0 && g(w, m ? m.concat(x) : [x]);
}), h.pop();
}
}
if (!a.isObject(e))
throw new TypeError("data must be an object");
return g(e), t;
}
function Ue(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
return t[r];
});
}
function Re(e, t) {
this._pairs = [], e && ie(e, this, t);
}
const nt = Re.prototype;
nt.append = function(t, n) {
this._pairs.push([t, n]);
};
nt.toString = function(t) {
const n = t ? function(r) {
return t.call(this, r, Ue);
} : Ue;
return this._pairs.map(function(s) {
return n(s[0]) + "=" + n(s[1]);
}, "").join("&");
};
function an(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
}
function rt(e, t, n) {
if (!t)
return e;
const r = n && n.encode || an, s = a.isFunction(n) ? {
serialize: n
} : n, o = s && s.serialize;
let i;
if (o ? i = o(t, s) : i = a.isURLSearchParams(t) ? t.toString() : new Re(t, s).toString(r), i) {
const c = e.indexOf("#");
c !== -1 && (e = e.slice(0, c)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
}
return e;
}
class Le {
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`
* @param {Object} options The options for the interceptor, synchronous and runWhen
*
* @return {Number} An ID used to remove interceptor later
*/
use(t, n, r) {
return this.handlers.push({
fulfilled: t,
rejected: n,
synchronous: r ? r.synchronous : !1,
runWhen: r ? r.runWhen : null
}), this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {void}
*/
eject(t) {
this.handlers[t] && (this.handlers[t] = 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(t) {
a.forEach(this.handlers, function(r) {
r !== null && t(r);
});
}
}
const Ee = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1,
legacyInterceptorReqResOrdering: !0
}, cn = typeof URLSearchParams < "u" ? URLSearchParams : Re, ln = typeof FormData < "u" ? FormData : null, un = typeof Blob < "u" ? Blob : null, fn = {
isBrowser: !0,
classes: {
URLSearchParams: cn,
FormData: ln,
Blob: un
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, ge = typeof window < "u" && typeof document < "u", ye = typeof navigator == "object" && navigator || void 0, dn = ge && (!ye || ["ReactNative", "NativeScript", "NS"].indexOf(ye.product) < 0), pn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", hn = ge && window.location.href || "http://localhost", mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: ge,
hasStandardBrowserEnv: dn,
hasStandardBrowserWebWorkerEnv: pn,
navigator: ye,
origin: hn
}, Symbol.toStringTag, { value: "Module" })), S = {
...mn,
...fn
};
function yn(e, t) {
return ie(e, new S.classes.URLSearchParams(), {
visitor: function(n, r, s, o) {
return S.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
},
...t
});
}
function bn(e) {
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function wn(e) {
const t = {}, n = Object.keys(e);
let r;
const s = n.length;
let o;
for (r = 0; r < s; r++)
o = n[r], t[o] = e[o];
return t;
}
function st(e) {
function t(n, r, s, o) {
let i = n[o++];
if (i === "__proto__") return !0;
const c = Number.isFinite(+i), p = o >= n.length;
return i = !i && a.isArray(s) ? s.length : i, p ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = wn(s[i])), !c);
}
if (a.isFormData(e) && a.isFunction(e.entries)) {
const n = {};
return a.forEachEntry(e, (r, s) => {
t(bn(r), s, n, 0);
}), n;
}
return null;
}
function Rn(e, t, n) {
if (a.isString(e))
try {
return (t || JSON.parse)(e), a.trim(e);
} catch (r) {
if (r.name !== "SyntaxError")
throw r;
}
return (n || JSON.stringify)(e);
}
const K = {
transitional: Ee,
adapter: ["xhr", "http", "fetch"],
transformRequest: [
function(t, n) {
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
return s ? JSON.stringify(st(t)) : t;
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
return t;
if (a.isArrayBufferView(t))
return t.buffer;
if (a.isURLSearchParams(t))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let c;
if (o) {
if (r.indexOf("application/x-www-form-urlencoded") > -1)
return yn(t, this.formSerializer).toString();
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
const p = this.env && this.env.FormData;
return ie(
c ? { "files[]": t } : t,
p && new p(),
this.formSerializer
);
}
}
return o || s ? (n.setContentType("application/json", !1), Rn(t)) : t;
}
],
transformResponse: [
function(t) {
const n = this.transitional || K.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
if (a.isResponse(t) || a.isReadableStream(t))
return t;
if (t && a.isString(t) && (r && !this.responseType || s)) {
const i = !(n && n.silentJSONParsing) && s;
try {
return JSON.parse(t, this.parseReviver);
} catch (c) {
if (i)
throw c.name === "SyntaxError" ? y.from(c, y.ERR_BAD_RESPONSE, this, null, this.response) : c;
}
}
return t;
}
],
/**
* 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: S.classes.FormData,
Blob: S.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
K.headers[e] = {};
});
const En = a.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"
]), gn = (e) => {
const t = {};
let n, r, s;
return e && e.split(`
`).forEach(function(i) {
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && En[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, De = Symbol("internals");
function z(e) {
return e && String(e).trim().toLowerCase();
}
function ee(e) {
return e === !1 || e == null ? e : a.isArray(e) ? e.map(ee) : String(e);
}
function Sn(e) {
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let r;
for (; r = n.exec(e); )
t[r[1]] = r[2];
return t;
}
const On = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function fe(e, t, n, r, s) {
if (a.isFunction(r))
return r.call(this, t, n);
if (s && (t = n), !!a.isString(t)) {
if (a.isString(r))
return t.indexOf(r) !== -1;
if (a.isRegExp(r))
return r.test(t);
}
}
function Tn(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function An(e, t) {
const n = a.toCamelCase(" " + t);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(e, r + n, {
value: function(s, o, i) {
return this[r].call(this, t, s, o, i);
},
configurable: !0
});
});
}
let C = class {
constructor(t) {
t && this.set(t);
}
set(t, n, r) {
const s = this;
function o(c, p, f) {
const l = z(p);
if (!l)
throw new Error("header name must be a non-empty string");
const h = a.findKey(s, l);
(!h || s[h] === void 0 || f === !0 || f === void 0 && s[h] !== !1) && (s[h || p] = ee(c));
}
const i = (c, p) => a.forEach(c, (f, l) => o(f, l, p));
if (a.isPlainObject(t) || t instanceof this.constructor)
i(t, n);
else if (a.isString(t) && (t = t.trim()) && !On(t))
i(gn(t), n);
else if (a.isObject(t) && a.isIterable(t)) {
let c = {}, p, f;
for (const l of t) {
if (!a.isArray(l))
throw TypeError("Object iterator must return a key-value pair");
c[f = l[0]] = (p = c[f]) ? a.isArray(p) ? [...p, l[1]] : [p, l[1]] : l[1];
}
i(c, n);
} else
t != null && o(n, t, r);
return this;
}
get(t, n) {
if (t = z(t), t) {
const r = a.findKey(this, t);
if (r) {
const s = this[r];
if (!n)
return s;
if (n === !0)
return Sn(s);
if (a.isFunction(n))
return n.call(this, s, r);
if (a.isRegExp(n))
return n.exec(s);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, n) {
if (t = z(t), t) {
const r = a.findKey(this, t);
return !!(r && this[r] !== void 0 && (!n || fe(this, this[r], r, n)));
}
return !1;
}
delete(t, n) {
const r = this;
let s = !1;
function o(i) {
if (i = z(i), i) {
const c = a.findKey(r, i);
c && (!n || fe(r, r[c], c, n)) && (delete r[c], s = !0);
}
}
return a.isArray(t) ? t.forEach(o) : o(t), s;
}
clear(t) {
const n = Object.keys(this);
let r = n.length, s = !1;
for (; r--; ) {
const o = n[r];
(!t || fe(this, this[o], o, t, !0)) && (delete this[o], s = !0);
}
return s;
}
normalize(t) {
const n = this, r = {};
return a.forEach(this, (s, o) => {
const i = a.findKey(r, o);
if (i) {
n[i] = ee(s), delete n[o];
return;
}
const c = t ? Tn(o) : String(o).trim();
c !== o && delete n[o], n[c] = ee(s), r[c] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const n = /* @__PURE__ */ Object.create(null);
return a.forEach(this, (r, s) => {
r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
}), n;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
`);
}
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(t) {
return t instanceof this ? t : new this(t);
}
static concat(t, ...n) {
const r = new this(t);
return n.forEach((s) => r.set(s)), r;
}
static accessor(t) {
const r = (this[De] = this[De] = {
accessors: {}
}).accessors, s = this.prototype;
function o(i) {
const c = z(i);
r[c] || (An(s, i), r[c] = !0);
}
return a.isArray(t) ? t.forEach(o) : o(t), this;
}
};
C.accessor([
"Content-Type",
"Content-Length",
"Accept",
"Accept-Encoding",
"User-Agent",
"Authorization"
]);
a.reduceDescriptors(C.prototype, ({ value: e }, t) => {
let n = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(r) {
this[n] = r;
}
};
});
a.freezeMethods(C);
function de(e, t) {
const n = this || K, r = t || n, s = C.from(r.headers);
let o = r.data;
return a.forEach(e, function(c) {
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
}), s.normalize(), o;
}
function ot(e) {
return !!(e && e.__CANCEL__);
}
let v = class extends y {
/**
* A `CanceledError` is an object that is thrown when an operation is canceled.
*
* @param {string=} message The message.
* @param {Object=} config The config.
* @param {Object=} request The request.
*
* @returns {CanceledError} The created error.
*/
constructor(t, n, r) {
super(t ?? "canceled", y.ERR_CANCELED, n, r), this.name = "CanceledError", this.__CANCEL__ = !0;
}
};
function it(e, t, n) {
const r = n.config.validateStatus;
!n.status || !r || r(n.status) ? e(n) : t(
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 Cn(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function xn(e, t) {
e = e || 10;
const n = new Array(e), r = new Array(e);
let s = 0, o = 0, i;
return t = t !== void 0 ? t : 1e3, function(p) {
const f = Date.now(), l = r[o];
i || (i = f), n[s] = p, r[s] = f;
let h = o, b = 0;
for (; h !== s; )
b += n[h++], h = h % e;
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), f - i < t)
return;
const g = l && f - l;
return g ? Math.round(b * 1e3 / g) : void 0;
};
}
function _n(e, t) {
let n = 0, r = 1e3 / t, s, o;
const i = (f, l = Date.now()) => {
n = l, s = null, o && (clearTimeout(o), o = null), e(...f);
};
return [(...f) => {
const l = Date.now(), h = l - n;
h >= r ? i(f, l) : (s = f, o || (o = setTimeout(() => {
o = null, i(s);
}, r - h)));
}, () => s && i(s)];
}
const ne = (e, t, n = 3) => {
let r = 0;
const s = xn(50, 250);
return _n((o) => {
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, p = i - r, f = s(p), l = i <= c;
r = i;
const h = {
loaded: i,
total: c,
progress: c ? i / c : void 0,
bytes: p,
rate: f || void 0,
estimated: f && c && l ? (c - i) / f : void 0,
event: o,
lengthComputable: c != null,
[t ? "download" : "upload"]: !0
};
e(h);
}, n);
}, Be = (e, t) => {
const n = e != null;
return [
(r) => t[0]({
lengthComputable: n,
total: e,
loaded: r
}),
t[1]
];
}, ke = (e) => (...t) => a.asap(() => e(...t)), Nn = S.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, S.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
new URL(S.origin),
S.navigator && /(msie|trident)/i.test(S.navigator.userAgent)
) : () => !0, Pn = S.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, n, r, s, o, i) {
if (typeof document > "u") return;
const c = [`${e}=${encodeURIComponent(t)}`];
a.isNumber(n) && c.push(`expires=${new Date(n).toUTCString()}`), a.isString(r) && c.push(`path=${r}`), a.isString(s) && c.push(`domain=${s}`), o === !0 && c.push("secure"), a.isString(i) && c.push(`SameSite=${i}`), document.cookie = c.join("; ");
},
read(e) {
if (typeof document > "u") return null;
const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
return t ? decodeURIComponent(t[1]) : null;
},
remove(e) {
this.write(e, "", Date.now() - 864e5, "/");
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function Fn(e) {
return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function Un(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function at(e, t, n) {
let r = !Fn(t);
return e && (r || n == !1) ? Un(e, t) : t;
}
const je = (e) => e instanceof C ? { ...e } : e;
function q(e, t) {
t = t || {};
const n = {};
function r(f, l, h, b) {
return a.isPlainObject(f) && a.isPlainObject(l) ? a.merge.call({ caseless: b }, f, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
}
function s(f, l, h, b) {
if (a.isUndefined(l)) {
if (!a.isUndefined(f))
return r(void 0, f, h, b);
} else return r(f, l, h, b);
}
function o(f, l) {
if (!a.isUndefined(l))
return r(void 0, l);
}
function i(f, l) {
if (a.isUndefined(l)) {
if (!a.isUndefined(f))
return r(void 0, f);
} else return r(void 0, l);
}
function c(f, l, h) {
if (h in t)
return r(f, l);
if (h in e)
return r(void 0, f);
}
const p = {
url: o,
method: o,
data: o,
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,
responseEncoding: i,
validateStatus: c,
headers: (f, l, h) => s(je(f), je(l), h, !0)
};
return a.forEach(Object.keys({ ...e, ...t }), function(l) {
if (l === "__proto__" || l === "constructor" || l === "prototype") return;
const h = a.hasOwnProp(p, l) ? p[l] : s, b = h(e[l], t[l], l);
a.isUndefined(b) && h !== c || (n[l] = b);
}), n;
}
const ct = (e) => {
const t = q({}, e);
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
if (t.headers = i = C.from(i), t.url = rt(
at(t.baseURL, t.url, t.allowAbsoluteUrls),
e.params,
e.paramsSerializer
), c && i.set(
"Authorization",
"Basic " + btoa(
(c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : "")
)
), a.isFormData(n)) {
if (S.hasStandardBrowserEnv || S.hasStandardBrowserWebWorkerEnv)
i.setContentType(void 0);
else if (a.isFunction(n.getHeaders)) {
const p = n.getHeaders(), f = ["content-type", "content-length"];
Object.entries(p).forEach(([l, h]) => {
f.includes(l.toLowerCase()) && i.set(l, h);
});
}
}
if (S.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Nn(t.url))) {
const p = s && o && Pn.read(o);
p && i.set(s, p);
}
return t;
}, Ln = typeof XMLHttpRequest < "u", Dn = Ln && function(e) {
return new Promise(function(n, r) {
const s = ct(e);
let o = s.data;
const i = C.from(s.headers).normalize();
let { responseType: c, onUploadProgress: p, onDownloadProgress: f } = s, l, h, b, g, u;
function m() {
g && g(), u && u(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
}
let d = new XMLHttpRequest();
d.open(s.method.toUpperCase(), s.url, !0), d.timeout = s.timeout;
function w() {
if (!d)
return;
const E = C.from(
"getAllResponseHeaders" in d && d.getAllResponseHeaders()
), P = {
data: !c || c === "text" || c === "json" ? d.responseText : d.response,
status: d.status,
statusText: d.statusText,
headers: E,
config: e,
request: d
};
it(
function(_) {
n(_), m();
},
function(_) {
r(_), m();
},
P
), d = null;
}
"onloadend" in d ? d.onloadend = w : d.onreadystatechange = function() {
!d || d.readyState !== 4 || d.status === 0 && !(d.responseURL && d.responseURL.indexOf("file:") === 0) || setTimeout(w);
}, d.onabort = function() {
d && (r(new y("Request aborted", y.ECONNABORTED, e, d)), d = null);
}, d.onerror = function(O) {
const P = O && O.message ? O.message : "Network Error", D = new y(P, y.ERR_NETWORK, e, d);
D.event = O || null, r(D), d = null;
}, d.ontimeout = function() {
let O = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
const P = s.transitional || Ee;
s.timeoutErrorMessage && (O = s.timeoutErrorMessage), r(
new y(
O,
P.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
e,
d
)
), d = null;
}, o === void 0 && i.setContentType(null), "setRequestHeader" in d && a.forEach(i.toJSON(), function(O, P) {
d.setRequestHeader(P, O);
}), a.isUndefined(s.withCredentials) || (d.withCredentials = !!s.withCredentials), c && c !== "json" && (d.responseType = s.responseType), f && ([b, u] = ne(f, !0), d.addEventListener("progress", b)), p && d.upload && ([h, g] = ne(p), d.upload.addEventListener("progress", h), d.upload.addEventListener("loadend", g)), (s.cancelToken || s.signal) && (l = (E) => {
d && (r(!E || E.type ? new v(null, e, d) : E), d.abort(), d = null);
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
const x = Cn(s.url);
if (x && S.protocols.indexOf(x) === -1) {
r(
new y(
"Unsupported protocol " + x + ":",
y.ERR_BAD_REQUEST,
e
)
);
return;
}
d.send(o || null);
});
}, Bn = (e, t) => {
const { length: n } = e = e ? e.filter(Boolean) : [];
if (t || n) {
let r = new AbortController(), s;
const o = function(f) {
if (!s) {
s = !0, c();
const l = f instanceof Error ? f : this.reason;
r.abort(
l instanceof y ? l : new v(l instanceof Error ? l.message : l)
);
}
};
let i = t && setTimeout(() => {
i = null, o(new y(`timeout of ${t}ms exceeded`, y.ETIMEDOUT));
}, t);
const c = () => {
e && (i && clearTimeout(i), i = null, e.forEach((f) => {
f.unsubscribe ? f.unsubscribe(o) : f.removeEventListener("abort", o);
}), e = null);
};
e.forEach((f) => f.addEventListener("abort", o));
const { signal: p } = r;
return p.unsubscribe = () => a.asap(c), p;
}
}, kn = function* (e, t) {
let n = e.byteLength;
if (n < t) {
yield e;
return;
}
let r = 0, s;
for (; r < n; )
s = r + t, yield e.slice(r, s), r = s;
}, jn = async function* (e, t) {
for await (const n of qn(e))
yield* kn(n, t);
}, qn = async function* (e) {
if (e[Symbol.asyncIterator]) {
yield* e;
return;
}
const t = e.getReader();
try {
for (; ; ) {
const { done: n, value: r } = await t.read();
if (n)
break;
yield r;
}
} finally {
await t.cancel();
}
}, qe = (e, t, n, r) => {
const s = jn(e, t);
let o = 0, i, c = (p) => {
i || (i = !0, r && r(p));
};
return new ReadableStream(
{
async pull(p) {
try {
const { done: f, value: l } = await s.next();
if (f) {
c(), p.close();
return;
}
let h = l.byteLength;
if (n) {
let b = o += h;
n(b);
}
p.enqueue(new Uint8Array(l));
} catch (f) {
throw c(f), f;
}
},
cancel(p) {
return c(p), s.return();
}
},
{
highWaterMark: 2
}
);
}, Ie = 64 * 1024, { isFunction: Z } = a, In = (({ Request: e, Response: t }) => ({
Request: e,
Response: t
}))(a.global), { ReadableStream: He, TextEncoder: Me } = a.global, $e = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, Hn = (e) => {
e = a.merge.call(
{
skipUndefined: !0
},
In,
e
);
const { fetch: t, Request: n, Response: r } = e, s = t ? Z(t) : typeof fetch == "function", o = Z(n), i = Z(r);
if (!s)
return !1;
const c = s && Z(He), p = s && (typeof Me == "function" ? /* @__PURE__ */ ((u) => (m) => u.encode(m))(new Me()) : async (u) => new Uint8Array(await new n(u).arrayBuffer())), f = o && c && $e(() => {
let u = !1;
const m = new n(S.origin, {
body: new He(),
method: "POST",
get duplex() {
return u = !0, "half";
}
}).headers.has("Content-Type");
return u && !m;
}), l = i && c && $e(() => a.isReadableStream(new r("").body)), h = {
stream: l && ((u) => u.body)
};
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((u) => {
!h[u] && (h[u] = (m, d) => {
let w = m && m[u];
if (w)
return w.call(m);
throw new y(
`Response type '${u}' is not supported`,
y.ERR_NOT_SUPPORT,
d
);
});
});
const b = async (u) => {
if (u == null)
return 0;
if (a.isBlob(u))
return u.size;
if (a.isSpecCompliantForm(u))
return (await new n(S.origin, {
method: "POST",
body: u
}).arrayBuffer()).byteLength;
if (a.isArrayBufferView(u) || a.isArrayBuffer(u))
return u.byteLength;
if (a.isURLSearchParams(u) && (u = u + ""), a.isString(u))
return (await p(u)).byteLength;
}, g = async (u, m) => {
const d = a.toFiniteNumber(u.getContentLength());
return d ?? b(m);
};
return async (u) => {
let {
url: m,
method: d,
data: w,
signal: x,
cancelToken: E,
timeout: O,
onDownloadProgress: P,
onUploadProgress: D,
responseType: _,
headers: ce,
withCredentials: X = "same-origin",
fetchOptions: Oe
} = ct(u), Te = t || fetch;
_ = _ ? (_ + "").toLowerCase() : "text";
let G = Bn(
[x, E && E.toAbortSignal()],
O
), $ = null;
const B = G && G.unsubscribe && (() => {
G.unsubscribe();
});
let Ae;
try {
if (D && f && d !== "get" && d !== "head" && (Ae = await g(ce, w)) !== 0) {
let L = new n(m, {
method: "POST",
body: w,
duplex: "half"
}), I;
if (a.isFormData(w) && (I = L.headers.get("content-type")) && ce.setContentType(I), L.body) {
const [le, Q] = Be(
Ae,
ne(ke(D))
);
w = qe(L.body, Ie, le, Q);
}
}
a.isString(X) || (X = X ? "include" : "omit");
const T = o && "credentials" in n.prototype, Ce = {
...Oe,
signal: G,
method: d.toUpperCase(),
headers: ce.normalize().toJSON(),
body: w,
duplex: "half",
credentials: T ? X : void 0
};
$ = o && new n(m, Ce);
let U = await (o ? Te($, Oe) : Te(m, Ce));
const xe = l && (_ === "stream" || _ === "response");
if (l && (P || xe && B)) {
const L = {};
["status", "statusText", "headers"].forEach((_e) => {
L[_e] = U[_e];
});
const I = a.toFiniteNumber(U.headers.get("content-length")), [le, Q] = P && Be(
I,
ne(ke(P), !0)
) || [];
U = new r(
qe(U.body, Ie, le, () => {
Q && Q(), B && B();
}),
L
);
}
_ = _ || "text";
let ht = await h[a.findKey(h, _) || "text"](
U,
u
);
return !xe && B && B(), await new Promise((L, I) => {
it(L, I, {
data: ht,
headers: C.from(U.headers),
status: U.status,
statusText: U.statusText,
config: u,
request: $
});
});
} catch (T) {
throw B && B(), T && T.name === "TypeError" && /Load failed|fetch/i.test(T.message) ? Object.assign(
new y(
"Network Error",
y.ERR_NETWORK,
u,
$,
T && T.response
),
{
cause: T.cause || T
}
) : y.from(T, T && T.code, u, $, T && T.response);
}
};
}, Mn = /* @__PURE__ */ new Map(), lt = (e) => {
let t = e && e.env || {};
const { fetch: n, Request: r, Response: s } = t, o = [r, s, n];
let i = o.length, c = i, p, f, l = Mn;
for (; c--; )
p = o[c], f = l.get(p), f === void 0 && l.set(p, f = c ? /* @__PURE__ */ new Map() : Hn(t)), l = f;
return f;
};
lt();
const Se = {
http: rn,
xhr: Dn,
fetch: {
get: lt
}
};
a.forEach(Se, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const ze = (e) => `- ${e}`, $n = (e) => a.isFunction(e) || e === null || e === !1;
function zn(e, t) {
e = a.isArray(e) ? e : [e];
const { length: n } = e;
let r, s;
const o = {};
for (let i = 0; i < n; i++) {
r = e[i];
let c;
if (s = r, !$n(r) && (s = Se[(c = String(r)).toLowerCase()], s === void 0))
throw new y(`Unknown adapter '${c}'`);
if (s && (a.isFunction(s) || (s = s.get(t))))
break;
o[c || "#" + i] = s;
}
if (!s) {
const i = Object.entries(o).map(
([p, f]) => `adapter ${p} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
);
let c = n ? i.length > 1 ? `since :
` + i.map(ze).join(`
`) : " " + ze(i[0]) : "as no adapter specified";
throw new y(
"There is no suitable adapter to dispatch the request " + c,
"ERR_NOT_SUPPORT"
);
}
return s;
}
const ut = {
/**
* Resolve an adapter from a list of adapter names or functions.
* @type {Function}
*/
getAdapter: zn,
/**
* Exposes all known adapters
* @type {Object<string, Function|Object>}
*/
adapters: Se
};
function pe(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new v(null, e);
}
function Je(e) {
return pe(e), e.headers = C.from(e.headers), e.data = de.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), ut.getAdapter(e.adapter || K.adapter, e)(e).then(
function(r) {
return pe(e), r.data = de.call(e, e.transformResponse, r), r.headers = C.from(r.headers), r;
},
function(r) {
return ot(r) || (pe(e), r && r.response && (r.response.data = de.call(
e,
e.transformResponse,
r.response
), r.response.headers = C.from(r.response.headers))), Promise.reject(r);
}
);
}
const ft = "1.13.6", ae = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
ae[e] = function(r) {
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
};
});
const Ve = {};
ae.transitional = function(t, n, r) {
function s(o, i) {
return "[Axios v" + ft + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
}
return (o, i, c) => {
if (t === !1)
throw new y(
s(i, " has been removed" + (n ? " in " + n : "")),
y.ERR_DEPRECATED
);
return n && !Ve[i] && (Ve[i] = !0, console.warn(
s(
i,
" has been deprecated since v" + n + " and will be removed in the near future"
)
)), t ? t(o, i, c) : !0;
};
};
ae.spelling = function(t) {
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
};
function Jn(e, t, n) {
if (typeof e != "object")
throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
const r = Object.keys(e);
let s = r.length;
for (; s-- > 0; ) {
const o = r[s], i = t[o];
if (i) {
const c = e[o], p = c === void 0 || i(c, o, e);
if (p !== !0)
throw new y(
"option " + o + " must be " + p,
y.ERR_BAD_OPTION_VALUE
);
continue;
}
if (n !== !0)
throw new y("Unknown option " + o, y.ERR_BAD_OPTION);
}
}
const te = {
assertOptions: Jn,
validators: ae
}, N = te.validators;
let j = class {
constructor(t) {
this.defaults = t || {}, this.interceptors = {
request: new Le(),
response: new Le()
};
}
/**
* 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(t, n) {
try {
return await this._request(t, n);
} catch (r) {
if (r instanceof Error) {
let s = {};
Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
try {
r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
` + o) : r.stack = o;
} catch {
}
}
throw r;
}
}
_request(t, n) {
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = q(this.defaults, n);
const { transitional: r, paramsSerializer: s, headers: o } = n;
r !== void 0 && te.assertOptions(
r,
{
silentJSONParsing: N.transitional(N.boolean),
forcedJSONParsing: N.transitional(N.boolean),
clarifyTimeoutError: N.transitional(N.boolean),
legacyInterceptorReqResOrdering: N.transitional(N.boolean)
},
!1
), s != null && (a.isFunction(s) ? n.paramsSerializer = {
serialize: s
} : te.assertOptions(
s,
{
encode: N.function,
serialize: N.function
},
!0
)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), te.assertOptions(
n,
{
baseUrl: N.spelling("baseURL"),
withXsrfToken: N.spelling("withXSRFToken")
},
!0
), n.method = (n.method || this.defaults.method || "get").toLowerCase();
let i = o && a.merge(o.common, o[n.method]);
o && a.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (u) => {
delete o[u];
}), n.headers = C.concat(i, o);
const c = [];
let p = !0;
this.interceptors.request.forEach(function(m) {
if (typeof m.runWhen == "function" && m.runWhen(n) === !1)
return;
p = p && m.synchronous;
const d = n.transitional || Ee;
d && d.legacyInterceptorReqResOrdering ? c.unshift(m.fulfilled, m.rejected) : c.push(m.fulfilled, m.rejected);
});
const f = [];
this.interceptors.response.forEach(function(m) {
f.push(m.fulfilled, m.rejected);
});
let l, h = 0, b;
if (!p) {
const u = [Je.bind(this), void 0];
for (u.unshift(...c), u.push(...f), b = u.length, l = Promise.resolve(n); h < b; )
l = l.then(u[h++], u[h++]);
return l;
}
b = c.length;
let g = n;
for (; h < b; ) {
const u = c[h++], m = c[h++];
try {
g = u(g);
} catch (d) {
m.call(this, d);
break;
}
}
try {
l = Je.call(this, g);
} catch (u) {
return Promise.reject(u);
}
for (h = 0, b = f.length; h < b; )
l = l.then(f[h++], f[h++]);
return l;
}
getUri(t) {
t = q(this.defaults, t);
const n = at(t.baseURL, t.url, t.allowAbsoluteUrls);
return rt(n, t.params, t.paramsSerializer);
}
};
a.forEach(["delete", "get", "head", "options"], function(t) {
j.prototype[t] = function(n, r) {
return this.request(
q(r || {}, {
method: t,
url: n,
data: (r || {}).data
})
);
};
});
a.forEach(["post", "put", "patch"], function(t) {
function n(r) {
return function(o, i, c) {
return this.request(
q(c || {}, {
method: t,
headers: r ? {
"Content-Type": "multipart/form-data"
} : {},
url: o,
data: i
})
);
};
}
j.prototype[t] = n(), j.prototype[t + "Form"] = n(!0);
});
let Vn = class dt {
constructor(t) {
if (typeof t != "function")
throw new TypeError("executor must be a function.");
let n;
this.promise = new Promise(function(o) {
n = o;
});
const r = this;
this.promise.then((s) => {
if (!r._listeners) return;
let o = r._listeners.length;
for (; o-- > 0; )
r._listeners[o](s);
r._listeners = null;
}), this.promise.then = (s) => {
let o;
const i = new Promise((c) => {
r.subscribe(c), o = c;
}).then(s);
return i.cancel = function() {
r.unsubscribe(o);
}, i;
}, t(function(o, i, c) {
r.reason || (r.reason = new v(o, i, c), n(r.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason)
throw this.reason;
}
/**
* Subscribe to the cancel signal
*/
subscribe(t) {
if (this.reason) {
t(this.reason);
return;
}
this._listeners ? this._listeners.push(t) : this._listeners = [t];
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(t) {
if (!this._listeners)
return;
const n = this._listeners.indexOf(t);
n !== -1 && this._listeners.splice(n, 1);
}
toAbortSignal() {
const t = new AbortController(), n = (r) => {
t.abort(r);
};
return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let t;
return {
token: new dt(function(s) {
t = s;
}),
cancel: t
};
}
};
function Wn(e) {
return function(n) {
return e.apply(null, n);
};
}
function Kn(e) {
return a.isObject(e) && e.isAxiosError === !0;
}
const be = {
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(be).forEach(([e, t]) => {
be[t] = e;
});
function pt(e) {
const t = new j(e), n = We(j.prototype.request, t);
return a.extend(n, j.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
return pt(q(e, s));
}, n;
}
const R = pt(K);
R.Axios = j;
R.CanceledError = v;
R.CancelToken = Vn;
R.isCancel = ot;
R.VERSION = ft;
R.toFormData = ie;
R.AxiosError = y;
R.Cancel = R.CanceledError;
R.all = function(t) {
return Promise.all(t);
};
R.spread = Wn;
R.isAxiosError = Kn;
R.mergeConfig = q;
R.AxiosHeaders = C;
R.formToJSON = (e) => st(a.isHTMLForm(e) ? new FormData(e) : e);
R.getAdapter = ut.getAdapter;
R.HttpStatusCode = be;
R.default = R;
const {
Axios: Qn,
AxiosError: Zn,
CanceledError: Yn,
isCancel: er,
CancelToken: tr,
VERSION: nr,
all: rr,
Cancel: sr,
isAxiosError: or,
spread: ir,
toFormData: ar,
AxiosHeaders: cr,
HttpStatusCode: lr,
formToJSON: ur,
getAdapter: fr,
mergeConfig: dr
} = R;
export {
R as a
};