ez-axios
Version:
3,604 lines • 119 kB
JavaScript
const kn = {
baseURL: "",
mark: "",
timeout: 3e4,
briefly: !0,
loading: !0,
headers: {},
error: No,
success: () => {
}
};
let te = kn;
const Wi = (e) => {
te = Object.assign(kn, e);
};
function No(e) {
switch (e) {
case 404:
console.error("网络请求不存在");
break;
case 401:
console.error("401 未授权");
break;
case 500:
console.error("服务器遇到错误,无法完成请求");
break;
default:
console.error("通用错误");
}
}
class Gi {
/**
* @description 设置全局基础地址
* @param baseURL
*/
static baseURL(t) {
te.baseURL = t;
}
/**
* @description 设置全局代理标记
* @param mark
*/
static mark(t) {
te.mark = t;
}
/**
* @description 设置全局请求超时时间
* @param timeout
*/
static timeout(t) {
te.timeout = t;
}
/**
* @description 设置全局简要数据结构
* @param briefly
*/
static briefly(t) {
te.briefly = !!t;
}
/**
* @description 设置全局加载动画
* @param loading
*/
static loading(t) {
te.loading = !!t;
}
/**
* @description 设置全局请求头
* @param headers
*/
static header(t) {
if (Object.prototype.toString.call(t) == "[object Object]")
for (const r in t)
typeof t[r] == "string" ? te.headers[r] = t[r] : (te.headers[r] = t[r] + "", console.warn("ezAxios: header 参数类型错误,已为您强制类型转换,但这可能不是你想要的。")), te.headers[r] || delete te.headers[r];
else
console.error("ezAxios: header 参数类型错误");
}
/**
* @description 设置全局错误处理
* @param error
*/
static error(t) {
te.error = t;
}
/**
* @description 设置全局请求拦截
* @param success
*/
static success(t) {
te.success = t;
}
}
function Mn(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: _o } = Object.prototype, { getPrototypeOf: gr } = Object, { iterator: et, toStringTag: jn } = Symbol, tt = /* @__PURE__ */ ((e) => (t) => {
const r = _o.call(t);
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), ue = (e) => (e = e.toLowerCase(), (t) => tt(t) === e), rt = (e) => (t) => typeof t === e, { isArray: De } = Array, Me = rt("undefined");
function je(e) {
return e !== null && !Me(e) && e.constructor !== null && !Me(e.constructor) && Q(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const zn = ue("ArrayBuffer");
function qo(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && zn(e.buffer), t;
}
const Do = rt("string"), Q = rt("function"), Hn = rt("number"), ze = (e) => e !== null && typeof e == "object", Lo = (e) => e === !0 || e === !1, Ke = (e) => {
if (tt(e) !== "object")
return !1;
const t = gr(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(jn in e) && !(et in e);
}, Io = (e) => {
if (!ze(e) || je(e))
return !1;
try {
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
} catch {
return !1;
}
}, Bo = ue("Date"), $o = ue("File"), Uo = ue("Blob"), ko = ue("FileList"), Mo = (e) => ze(e) && Q(e.pipe), jo = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || Q(e.append) && ((t = tt(e)) === "formdata" || // detect form-data instance
t === "object" && Q(e.toString) && e.toString() === "[object FormData]"));
}, zo = ue("URLSearchParams"), [Ho, Wo, Go, Jo] = ["ReadableStream", "Request", "Response", "Headers"].map(ue), Vo = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function He(e, t, { allOwnKeys: r = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let n, o;
if (typeof e != "object" && (e = [e]), De(e))
for (n = 0, o = e.length; n < o; n++)
t.call(null, e[n], n, e);
else {
if (je(e))
return;
const i = r ? Object.getOwnPropertyNames(e) : Object.keys(e), a = i.length;
let s;
for (n = 0; n < a; n++)
s = i[n], t.call(null, e[s], s, e);
}
}
function Wn(e, t) {
if (je(e))
return null;
t = t.toLowerCase();
const r = Object.keys(e);
let n = r.length, o;
for (; n-- > 0; )
if (o = r[n], t === o.toLowerCase())
return o;
return null;
}
const Re = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Gn = (e) => !Me(e) && e !== Re;
function fr() {
const { caseless: e } = Gn(this) && this || {}, t = {}, r = (n, o) => {
const i = e && Wn(t, o) || o;
Ke(t[i]) && Ke(n) ? t[i] = fr(t[i], n) : Ke(n) ? t[i] = fr({}, n) : De(n) ? t[i] = n.slice() : t[i] = n;
};
for (let n = 0, o = arguments.length; n < o; n++)
arguments[n] && He(arguments[n], r);
return t;
}
const Ko = (e, t, r, { allOwnKeys: n } = {}) => (He(t, (o, i) => {
r && Q(o) ? e[i] = Mn(o, r) : e[i] = o;
}, { allOwnKeys: n }), e), Qo = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Xo = (e, t, r, n) => {
e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), r && Object.assign(e.prototype, r);
}, Zo = (e, t, r, n) => {
let o, i, a;
const s = {};
if (t = t || {}, e == null) return t;
do {
for (o = Object.getOwnPropertyNames(e), i = o.length; i-- > 0; )
a = o[i], (!n || n(a, e, t)) && !s[a] && (t[a] = e[a], s[a] = !0);
e = r !== !1 && gr(e);
} while (e && (!r || r(e, t)) && e !== Object.prototype);
return t;
}, Yo = (e, t, r) => {
e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
const n = e.indexOf(t, r);
return n !== -1 && n === r;
}, ea = (e) => {
if (!e) return null;
if (De(e)) return e;
let t = e.length;
if (!Hn(t)) return null;
const r = new Array(t);
for (; t-- > 0; )
r[t] = e[t];
return r;
}, ta = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && gr(Uint8Array)), ra = (e, t) => {
const n = (e && e[et]).call(e);
let o;
for (; (o = n.next()) && !o.done; ) {
const i = o.value;
t.call(e, i[0], i[1]);
}
}, na = (e, t) => {
let r;
const n = [];
for (; (r = e.exec(t)) !== null; )
n.push(r);
return n;
}, oa = ue("HTMLFormElement"), aa = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(r, n, o) {
return n.toUpperCase() + o;
}
), qr = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), ia = ue("RegExp"), Jn = (e, t) => {
const r = Object.getOwnPropertyDescriptors(e), n = {};
He(r, (o, i) => {
let a;
(a = t(o, i, e)) !== !1 && (n[i] = a || o);
}), Object.defineProperties(e, n);
}, sa = (e) => {
Jn(e, (t, r) => {
if (Q(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
return !1;
const n = e[r];
if (Q(n)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + r + "'");
});
}
});
}, la = (e, t) => {
const r = {}, n = (o) => {
o.forEach((i) => {
r[i] = !0;
});
};
return De(e) ? n(e) : n(String(e).split(t)), r;
}, ua = () => {
}, ca = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function fa(e) {
return !!(e && Q(e.append) && e[jn] === "FormData" && e[et]);
}
const pa = (e) => {
const t = new Array(10), r = (n, o) => {
if (ze(n)) {
if (t.indexOf(n) >= 0)
return;
if (je(n))
return n;
if (!("toJSON" in n)) {
t[o] = n;
const i = De(n) ? [] : {};
return He(n, (a, s) => {
const p = r(a, o + 1);
!Me(p) && (i[s] = p);
}), t[o] = void 0, i;
}
}
return n;
};
return r(e, 0);
}, da = ue("AsyncFunction"), ya = (e) => e && (ze(e) || Q(e)) && Q(e.then) && Q(e.catch), Vn = ((e, t) => e ? setImmediate : t ? ((r, n) => (Re.addEventListener("message", ({ source: o, data: i }) => {
o === Re && i === r && n.length && n.shift()();
}, !1), (o) => {
n.push(o), Re.postMessage(r, "*");
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
typeof setImmediate == "function",
Q(Re.postMessage)
), ha = typeof queueMicrotask < "u" ? queueMicrotask.bind(Re) : typeof process < "u" && process.nextTick || Vn, ma = (e) => e != null && Q(e[et]), h = {
isArray: De,
isArrayBuffer: zn,
isBuffer: je,
isFormData: jo,
isArrayBufferView: qo,
isString: Do,
isNumber: Hn,
isBoolean: Lo,
isObject: ze,
isPlainObject: Ke,
isEmptyObject: Io,
isReadableStream: Ho,
isRequest: Wo,
isResponse: Go,
isHeaders: Jo,
isUndefined: Me,
isDate: Bo,
isFile: $o,
isBlob: Uo,
isRegExp: ia,
isFunction: Q,
isStream: Mo,
isURLSearchParams: zo,
isTypedArray: ta,
isFileList: ko,
forEach: He,
merge: fr,
extend: Ko,
trim: Vo,
stripBOM: Qo,
inherits: Xo,
toFlatObject: Zo,
kindOf: tt,
kindOfTest: ue,
endsWith: Yo,
toArray: ea,
forEachEntry: ra,
matchAll: na,
isHTMLForm: oa,
hasOwnProperty: qr,
hasOwnProp: qr,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Jn,
freezeMethods: sa,
toObjectSet: la,
toCamelCase: aa,
noop: ua,
toFiniteNumber: ca,
findKey: Wn,
global: Re,
isContextDefined: Gn,
isSpecCompliantForm: fa,
toJSONObject: pa,
isAsyncFn: da,
isThenable: ya,
setImmediate: Vn,
asap: ha,
isIterable: ma
};
function C(e, t, r, n, o) {
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), r && (this.config = r), n && (this.request = n), o && (this.response = o, this.status = o.status ? o.status : null);
}
h.inherits(C, 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: h.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const Kn = C.prototype, Qn = {};
[
"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((e) => {
Qn[e] = { value: e };
});
Object.defineProperties(C, Qn);
Object.defineProperty(Kn, "isAxiosError", { value: !0 });
C.from = (e, t, r, n, o, i) => {
const a = Object.create(Kn);
return h.toFlatObject(e, a, function(p) {
return p !== Error.prototype;
}, (s) => s !== "isAxiosError"), C.call(a, e.message, t, r, n, o), a.cause = e, a.name = e.name, i && Object.assign(a, i), a;
};
const ga = null;
function pr(e) {
return h.isPlainObject(e) || h.isArray(e);
}
function Xn(e) {
return h.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Dr(e, t, r) {
return e ? e.concat(t).map(function(o, i) {
return o = Xn(o), !r && i ? "[" + o + "]" : o;
}).join(r ? "." : "") : t;
}
function va(e) {
return h.isArray(e) && !e.some(pr);
}
const ba = h.toFlatObject(h, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function nt(e, t, r) {
if (!h.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), r = h.toFlatObject(r, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(w, u) {
return !h.isUndefined(u[w]);
});
const n = r.metaTokens, o = r.visitor || c, i = r.dots, a = r.indexes, p = (r.Blob || typeof Blob < "u" && Blob) && h.isSpecCompliantForm(t);
if (!h.isFunction(o))
throw new TypeError("visitor must be a function");
function l(y) {
if (y === null) return "";
if (h.isDate(y))
return y.toISOString();
if (h.isBoolean(y))
return y.toString();
if (!p && h.isBlob(y))
throw new C("Blob is not supported. Use a Buffer instead.");
return h.isArrayBuffer(y) || h.isTypedArray(y) ? p && typeof Blob == "function" ? new Blob([y]) : Buffer.from(y) : y;
}
function c(y, w, u) {
let m = y;
if (y && !u && typeof y == "object") {
if (h.endsWith(w, "{}"))
w = n ? w : w.slice(0, -2), y = JSON.stringify(y);
else if (h.isArray(y) && va(y) || (h.isFileList(y) || h.endsWith(w, "[]")) && (m = h.toArray(y)))
return w = Xn(w), m.forEach(function(E, O) {
!(h.isUndefined(E) || E === null) && t.append(
// eslint-disable-next-line no-nested-ternary
a === !0 ? Dr([w], O, i) : a === null ? w : w + "[]",
l(E)
);
}), !1;
}
return pr(y) ? !0 : (t.append(Dr(u, w, i), l(y)), !1);
}
const v = [], S = Object.assign(ba, {
defaultVisitor: c,
convertValue: l,
isVisitable: pr
});
function b(y, w) {
if (!h.isUndefined(y)) {
if (v.indexOf(y) !== -1)
throw Error("Circular reference detected in " + w.join("."));
v.push(y), h.forEach(y, function(m, g) {
(!(h.isUndefined(m) || m === null) && o.call(
t,
m,
h.isString(g) ? g.trim() : g,
w,
S
)) === !0 && b(m, w ? w.concat(g) : [g]);
}), v.pop();
}
}
if (!h.isObject(e))
throw new TypeError("data must be an object");
return b(e), t;
}
function Lr(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
return t[n];
});
}
function vr(e, t) {
this._pairs = [], e && nt(e, this, t);
}
const Zn = vr.prototype;
Zn.append = function(t, r) {
this._pairs.push([t, r]);
};
Zn.toString = function(t) {
const r = t ? function(n) {
return t.call(this, n, Lr);
} : Lr;
return this._pairs.map(function(o) {
return r(o[0]) + "=" + r(o[1]);
}, "").join("&");
};
function wa(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function Yn(e, t, r) {
if (!t)
return e;
const n = r && r.encode || wa;
h.isFunction(r) && (r = {
serialize: r
});
const o = r && r.serialize;
let i;
if (o ? i = o(t, r) : i = h.isURLSearchParams(t) ? t.toString() : new vr(t, r).toString(n), i) {
const a = e.indexOf("#");
a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
}
return e;
}
class Ir {
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(t, r, n) {
return this.handlers.push({
fulfilled: t,
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(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) {
h.forEach(this.handlers, function(n) {
n !== null && t(n);
});
}
}
const eo = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, Sa = typeof URLSearchParams < "u" ? URLSearchParams : vr, Ea = typeof FormData < "u" ? FormData : null, Oa = typeof Blob < "u" ? Blob : null, Aa = {
isBrowser: !0,
classes: {
URLSearchParams: Sa,
FormData: Ea,
Blob: Oa
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, br = typeof window < "u" && typeof document < "u", dr = typeof navigator == "object" && navigator || void 0, Ra = br && (!dr || ["ReactNative", "NativeScript", "NS"].indexOf(dr.product) < 0), Pa = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", xa = br && window.location.href || "http://localhost", Ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: br,
hasStandardBrowserEnv: Ra,
hasStandardBrowserWebWorkerEnv: Pa,
navigator: dr,
origin: xa
}, Symbol.toStringTag, { value: "Module" })), V = {
...Ta,
...Aa
};
function Ca(e, t) {
return nt(e, new V.classes.URLSearchParams(), {
visitor: function(r, n, o, i) {
return V.isNode && h.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
},
...t
});
}
function Fa(e) {
return h.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function Na(e) {
const t = {}, r = Object.keys(e);
let n;
const o = r.length;
let i;
for (n = 0; n < o; n++)
i = r[n], t[i] = e[i];
return t;
}
function to(e) {
function t(r, n, o, i) {
let a = r[i++];
if (a === "__proto__") return !0;
const s = Number.isFinite(+a), p = i >= r.length;
return a = !a && h.isArray(o) ? o.length : a, p ? (h.hasOwnProp(o, a) ? o[a] = [o[a], n] : o[a] = n, !s) : ((!o[a] || !h.isObject(o[a])) && (o[a] = []), t(r, n, o[a], i) && h.isArray(o[a]) && (o[a] = Na(o[a])), !s);
}
if (h.isFormData(e) && h.isFunction(e.entries)) {
const r = {};
return h.forEachEntry(e, (n, o) => {
t(Fa(n), o, r, 0);
}), r;
}
return null;
}
function _a(e, t, r) {
if (h.isString(e))
try {
return (t || JSON.parse)(e), h.trim(e);
} catch (n) {
if (n.name !== "SyntaxError")
throw n;
}
return (r || JSON.stringify)(e);
}
const We = {
transitional: eo,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, r) {
const n = r.getContentType() || "", o = n.indexOf("application/json") > -1, i = h.isObject(t);
if (i && h.isHTMLForm(t) && (t = new FormData(t)), h.isFormData(t))
return o ? JSON.stringify(to(t)) : t;
if (h.isArrayBuffer(t) || h.isBuffer(t) || h.isStream(t) || h.isFile(t) || h.isBlob(t) || h.isReadableStream(t))
return t;
if (h.isArrayBufferView(t))
return t.buffer;
if (h.isURLSearchParams(t))
return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let s;
if (i) {
if (n.indexOf("application/x-www-form-urlencoded") > -1)
return Ca(t, this.formSerializer).toString();
if ((s = h.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
const p = this.env && this.env.FormData;
return nt(
s ? { "files[]": t } : t,
p && new p(),
this.formSerializer
);
}
}
return i || o ? (r.setContentType("application/json", !1), _a(t)) : t;
}],
transformResponse: [function(t) {
const r = this.transitional || We.transitional, n = r && r.forcedJSONParsing, o = this.responseType === "json";
if (h.isResponse(t) || h.isReadableStream(t))
return t;
if (t && h.isString(t) && (n && !this.responseType || o)) {
const a = !(r && r.silentJSONParsing) && o;
try {
return JSON.parse(t);
} catch (s) {
if (a)
throw s.name === "SyntaxError" ? C.from(s, C.ERR_BAD_RESPONSE, this, null, this.response) : s;
}
}
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: V.classes.FormData,
Blob: V.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
h.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
We.headers[e] = {};
});
const qa = h.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"
]), Da = (e) => {
const t = {};
let r, n, o;
return e && e.split(`
`).forEach(function(a) {
o = a.indexOf(":"), r = a.substring(0, o).trim().toLowerCase(), n = a.substring(o + 1).trim(), !(!r || t[r] && qa[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
}), t;
}, Br = Symbol("internals");
function Ue(e) {
return e && String(e).trim().toLowerCase();
}
function Qe(e) {
return e === !1 || e == null ? e : h.isArray(e) ? e.map(Qe) : String(e);
}
function La(e) {
const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let n;
for (; n = r.exec(e); )
t[n[1]] = n[2];
return t;
}
const Ia = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function gt(e, t, r, n, o) {
if (h.isFunction(n))
return n.call(this, t, r);
if (o && (t = r), !!h.isString(t)) {
if (h.isString(n))
return t.indexOf(n) !== -1;
if (h.isRegExp(n))
return n.test(t);
}
}
function Ba(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n);
}
function $a(e, t) {
const r = h.toCamelCase(" " + t);
["get", "set", "has"].forEach((n) => {
Object.defineProperty(e, n + r, {
value: function(o, i, a) {
return this[n].call(this, t, o, i, a);
},
configurable: !0
});
});
}
let X = class {
constructor(t) {
t && this.set(t);
}
set(t, r, n) {
const o = this;
function i(s, p, l) {
const c = Ue(p);
if (!c)
throw new Error("header name must be a non-empty string");
const v = h.findKey(o, c);
(!v || o[v] === void 0 || l === !0 || l === void 0 && o[v] !== !1) && (o[v || p] = Qe(s));
}
const a = (s, p) => h.forEach(s, (l, c) => i(l, c, p));
if (h.isPlainObject(t) || t instanceof this.constructor)
a(t, r);
else if (h.isString(t) && (t = t.trim()) && !Ia(t))
a(Da(t), r);
else if (h.isObject(t) && h.isIterable(t)) {
let s = {}, p, l;
for (const c of t) {
if (!h.isArray(c))
throw TypeError("Object iterator must return a key-value pair");
s[l = c[0]] = (p = s[l]) ? h.isArray(p) ? [...p, c[1]] : [p, c[1]] : c[1];
}
a(s, r);
} else
t != null && i(r, t, n);
return this;
}
get(t, r) {
if (t = Ue(t), t) {
const n = h.findKey(this, t);
if (n) {
const o = this[n];
if (!r)
return o;
if (r === !0)
return La(o);
if (h.isFunction(r))
return r.call(this, o, n);
if (h.isRegExp(r))
return r.exec(o);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, r) {
if (t = Ue(t), t) {
const n = h.findKey(this, t);
return !!(n && this[n] !== void 0 && (!r || gt(this, this[n], n, r)));
}
return !1;
}
delete(t, r) {
const n = this;
let o = !1;
function i(a) {
if (a = Ue(a), a) {
const s = h.findKey(n, a);
s && (!r || gt(n, n[s], s, r)) && (delete n[s], o = !0);
}
}
return h.isArray(t) ? t.forEach(i) : i(t), o;
}
clear(t) {
const r = Object.keys(this);
let n = r.length, o = !1;
for (; n--; ) {
const i = r[n];
(!t || gt(this, this[i], i, t, !0)) && (delete this[i], o = !0);
}
return o;
}
normalize(t) {
const r = this, n = {};
return h.forEach(this, (o, i) => {
const a = h.findKey(n, i);
if (a) {
r[a] = Qe(o), delete r[i];
return;
}
const s = t ? Ba(i) : String(i).trim();
s !== i && delete r[i], r[s] = Qe(o), n[s] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const r = /* @__PURE__ */ Object.create(null);
return h.forEach(this, (n, o) => {
n != null && n !== !1 && (r[o] = t && h.isArray(n) ? n.join(", ") : n);
}), r;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).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, ...r) {
const n = new this(t);
return r.forEach((o) => n.set(o)), n;
}
static accessor(t) {
const n = (this[Br] = this[Br] = {
accessors: {}
}).accessors, o = this.prototype;
function i(a) {
const s = Ue(a);
n[s] || ($a(o, a), n[s] = !0);
}
return h.isArray(t) ? t.forEach(i) : i(t), this;
}
};
X.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
h.reduceDescriptors(X.prototype, ({ value: e }, t) => {
let r = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(n) {
this[r] = n;
}
};
});
h.freezeMethods(X);
function vt(e, t) {
const r = this || We, n = t || r, o = X.from(n.headers);
let i = n.data;
return h.forEach(e, function(s) {
i = s.call(r, i, o.normalize(), t ? t.status : void 0);
}), o.normalize(), i;
}
function ro(e) {
return !!(e && e.__CANCEL__);
}
function Le(e, t, r) {
C.call(this, e ?? "canceled", C.ERR_CANCELED, t, r), this.name = "CanceledError";
}
h.inherits(Le, C, {
__CANCEL__: !0
});
function no(e, t, r) {
const n = r.config.validateStatus;
!r.status || !n || n(r.status) ? e(r) : t(new C(
"Request failed with status code " + r.status,
[C.ERR_BAD_REQUEST, C.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
r.config,
r.request,
r
));
}
function Ua(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function ka(e, t) {
e = e || 10;
const r = new Array(e), n = new Array(e);
let o = 0, i = 0, a;
return t = t !== void 0 ? t : 1e3, function(p) {
const l = Date.now(), c = n[i];
a || (a = l), r[o] = p, n[o] = l;
let v = i, S = 0;
for (; v !== o; )
S += r[v++], v = v % e;
if (o = (o + 1) % e, o === i && (i = (i + 1) % e), l - a < t)
return;
const b = c && l - c;
return b ? Math.round(S * 1e3 / b) : void 0;
};
}
function Ma(e, t) {
let r = 0, n = 1e3 / t, o, i;
const a = (l, c = Date.now()) => {
r = c, o = null, i && (clearTimeout(i), i = null), e(...l);
};
return [(...l) => {
const c = Date.now(), v = c - r;
v >= n ? a(l, c) : (o = l, i || (i = setTimeout(() => {
i = null, a(o);
}, n - v)));
}, () => o && a(o)];
}
const Ze = (e, t, r = 3) => {
let n = 0;
const o = ka(50, 250);
return Ma((i) => {
const a = i.loaded, s = i.lengthComputable ? i.total : void 0, p = a - n, l = o(p), c = a <= s;
n = a;
const v = {
loaded: a,
total: s,
progress: s ? a / s : void 0,
bytes: p,
rate: l || void 0,
estimated: l && s && c ? (s - a) / l : void 0,
event: i,
lengthComputable: s != null,
[t ? "download" : "upload"]: !0
};
e(v);
}, r);
}, $r = (e, t) => {
const r = e != null;
return [(n) => t[0]({
lengthComputable: r,
total: e,
loaded: n
}), t[1]];
}, Ur = (e) => (...t) => h.asap(() => e(...t)), ja = V.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, V.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
new URL(V.origin),
V.navigator && /(msie|trident)/i.test(V.navigator.userAgent)
) : () => !0, za = V.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, r, n, o, i) {
const a = [e + "=" + encodeURIComponent(t)];
h.isNumber(r) && a.push("expires=" + new Date(r).toGMTString()), h.isString(n) && a.push("path=" + n), h.isString(o) && a.push("domain=" + o), i === !0 && a.push("secure"), document.cookie = a.join("; ");
},
read(e) {
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
return t ? decodeURIComponent(t[3]) : 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 Ha(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function Wa(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function oo(e, t, r) {
let n = !Ha(t);
return e && (n || r == !1) ? Wa(e, t) : t;
}
const kr = (e) => e instanceof X ? { ...e } : e;
function xe(e, t) {
t = t || {};
const r = {};
function n(l, c, v, S) {
return h.isPlainObject(l) && h.isPlainObject(c) ? h.merge.call({ caseless: S }, l, c) : h.isPlainObject(c) ? h.merge({}, c) : h.isArray(c) ? c.slice() : c;
}
function o(l, c, v, S) {
if (h.isUndefined(c)) {
if (!h.isUndefined(l))
return n(void 0, l, v, S);
} else return n(l, c, v, S);
}
function i(l, c) {
if (!h.isUndefined(c))
return n(void 0, c);
}
function a(l, c) {
if (h.isUndefined(c)) {
if (!h.isUndefined(l))
return n(void 0, l);
} else return n(void 0, c);
}
function s(l, c, v) {
if (v in t)
return n(l, c);
if (v in e)
return n(void 0, l);
}
const p = {
url: i,
method: i,
data: i,
baseURL: a,
transformRequest: a,
transformResponse: a,
paramsSerializer: a,
timeout: a,
timeoutMessage: a,
withCredentials: a,
withXSRFToken: a,
adapter: a,
responseType: a,
xsrfCookieName: a,
xsrfHeaderName: a,
onUploadProgress: a,
onDownloadProgress: a,
decompress: a,
maxContentLength: a,
maxBodyLength: a,
beforeRedirect: a,
transport: a,
httpAgent: a,
httpsAgent: a,
cancelToken: a,
socketPath: a,
responseEncoding: a,
validateStatus: s,
headers: (l, c, v) => o(kr(l), kr(c), v, !0)
};
return h.forEach(Object.keys({ ...e, ...t }), function(c) {
const v = p[c] || o, S = v(e[c], t[c], c);
h.isUndefined(S) && v !== s || (r[c] = S);
}), r;
}
const ao = (e) => {
const t = xe({}, e);
let { data: r, withXSRFToken: n, xsrfHeaderName: o, xsrfCookieName: i, headers: a, auth: s } = t;
t.headers = a = X.from(a), t.url = Yn(oo(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), s && a.set(
"Authorization",
"Basic " + btoa((s.username || "") + ":" + (s.password ? unescape(encodeURIComponent(s.password)) : ""))
);
let p;
if (h.isFormData(r)) {
if (V.hasStandardBrowserEnv || V.hasStandardBrowserWebWorkerEnv)
a.setContentType(void 0);
else if ((p = a.getContentType()) !== !1) {
const [l, ...c] = p ? p.split(";").map((v) => v.trim()).filter(Boolean) : [];
a.setContentType([l || "multipart/form-data", ...c].join("; "));
}
}
if (V.hasStandardBrowserEnv && (n && h.isFunction(n) && (n = n(t)), n || n !== !1 && ja(t.url))) {
const l = o && i && za.read(i);
l && a.set(o, l);
}
return t;
}, Ga = typeof XMLHttpRequest < "u", Ja = Ga && function(e) {
return new Promise(function(r, n) {
const o = ao(e);
let i = o.data;
const a = X.from(o.headers).normalize();
let { responseType: s, onUploadProgress: p, onDownloadProgress: l } = o, c, v, S, b, y;
function w() {
b && b(), y && y(), o.cancelToken && o.cancelToken.unsubscribe(c), o.signal && o.signal.removeEventListener("abort", c);
}
let u = new XMLHttpRequest();
u.open(o.method.toUpperCase(), o.url, !0), u.timeout = o.timeout;
function m() {
if (!u)
return;
const E = X.from(
"getAllResponseHeaders" in u && u.getAllResponseHeaders()
), A = {
data: !s || s === "text" || s === "json" ? u.responseText : u.response,
status: u.status,
statusText: u.statusText,
headers: E,
config: e,
request: u
};
no(function(P) {
r(P), w();
}, function(P) {
n(P), w();
}, A), u = null;
}
"onloadend" in u ? u.onloadend = m : u.onreadystatechange = function() {
!u || u.readyState !== 4 || u.status === 0 && !(u.responseURL && u.responseURL.indexOf("file:") === 0) || setTimeout(m);
}, u.onabort = function() {
u && (n(new C("Request aborted", C.ECONNABORTED, e, u)), u = null);
}, u.onerror = function() {
n(new C("Network Error", C.ERR_NETWORK, e, u)), u = null;
}, u.ontimeout = function() {
let O = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
const A = o.transitional || eo;
o.timeoutErrorMessage && (O = o.timeoutErrorMessage), n(new C(
O,
A.clarifyTimeoutError ? C.ETIMEDOUT : C.ECONNABORTED,
e,
u
)), u = null;
}, i === void 0 && a.setContentType(null), "setRequestHeader" in u && h.forEach(a.toJSON(), function(O, A) {
u.setRequestHeader(A, O);
}), h.isUndefined(o.withCredentials) || (u.withCredentials = !!o.withCredentials), s && s !== "json" && (u.responseType = o.responseType), l && ([S, y] = Ze(l, !0), u.addEventListener("progress", S)), p && u.upload && ([v, b] = Ze(p), u.upload.addEventListener("progress", v), u.upload.addEventListener("loadend", b)), (o.cancelToken || o.signal) && (c = (E) => {
u && (n(!E || E.type ? new Le(null, e, u) : E), u.abort(), u = null);
}, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
const g = Ua(o.url);
if (g && V.protocols.indexOf(g) === -1) {
n(new C("Unsupported protocol " + g + ":", C.ERR_BAD_REQUEST, e));
return;
}
u.send(i || null);
});
}, Va = (e, t) => {
const { length: r } = e = e ? e.filter(Boolean) : [];
if (t || r) {
let n = new AbortController(), o;
const i = function(l) {
if (!o) {
o = !0, s();
const c = l instanceof Error ? l : this.reason;
n.abort(c instanceof C ? c : new Le(c instanceof Error ? c.message : c));
}
};
let a = t && setTimeout(() => {
a = null, i(new C(`timeout ${t} of ms exceeded`, C.ETIMEDOUT));
}, t);
const s = () => {
e && (a && clearTimeout(a), a = null, e.forEach((l) => {
l.unsubscribe ? l.unsubscribe(i) : l.removeEventListener("abort", i);
}), e = null);
};
e.forEach((l) => l.addEventListener("abort", i));
const { signal: p } = n;
return p.unsubscribe = () => h.asap(s), p;
}
}, Ka = function* (e, t) {
let r = e.byteLength;
if (r < t) {
yield e;
return;
}
let n = 0, o;
for (; n < r; )
o = n + t, yield e.slice(n, o), n = o;
}, Qa = async function* (e, t) {
for await (const r of Xa(e))
yield* Ka(r, t);
}, Xa = async function* (e) {
if (e[Symbol.asyncIterator]) {
yield* e;
return;
}
const t = e.getReader();
try {
for (; ; ) {
const { done: r, value: n } = await t.read();
if (r)
break;
yield n;
}
} finally {
await t.cancel();
}
}, Mr = (e, t, r, n) => {
const o = Qa(e, t);
let i = 0, a, s = (p) => {
a || (a = !0, n && n(p));
};
return new ReadableStream({
async pull(p) {
try {
const { done: l, value: c } = await o.next();
if (l) {
s(), p.close();
return;
}
let v = c.byteLength;
if (r) {
let S = i += v;
r(S);
}
p.enqueue(new Uint8Array(c));
} catch (l) {
throw s(l), l;
}
},
cancel(p) {
return s(p), o.return();
}
}, {
highWaterMark: 2
});
}, ot = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", io = ot && typeof ReadableStream == "function", Za = ot && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), so = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, Ya = io && so(() => {
let e = !1;
const t = new Request(V.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return e = !0, "half";
}
}).headers.has("Content-Type");
return e && !t;
}), jr = 64 * 1024, yr = io && so(() => h.isReadableStream(new Response("").body)), Ye = {
stream: yr && ((e) => e.body)
};
ot && ((e) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
!Ye[t] && (Ye[t] = h.isFunction(e[t]) ? (r) => r[t]() : (r, n) => {
throw new C(`Response type '${t}' is not supported`, C.ERR_NOT_SUPPORT, n);
});
});
})(new Response());
const ei = async (e) => {
if (e == null)
return 0;
if (h.isBlob(e))
return e.size;
if (h.isSpecCompliantForm(e))
return (await new Request(V.origin, {
method: "POST",
body: e
}).arrayBuffer()).byteLength;
if (h.isArrayBufferView(e) || h.isArrayBuffer(e))
return e.byteLength;
if (h.isURLSearchParams(e) && (e = e + ""), h.isString(e))
return (await Za(e)).byteLength;
}, ti = async (e, t) => {
const r = h.toFiniteNumber(e.getContentLength());
return r ?? ei(t);
}, ri = ot && (async (e) => {
let {
url: t,
method: r,
data: n,
signal: o,
cancelToken: i,
timeout: a,
onDownloadProgress: s,
onUploadProgress: p,
responseType: l,
headers: c,
withCredentials: v = "same-origin",
fetchOptions: S
} = ao(e);
l = l ? (l + "").toLowerCase() : "text";
let b = Va([o, i && i.toAbortSignal()], a), y;
const w = b && b.unsubscribe && (() => {
b.unsubscribe();
});
let u;
try {
if (p && Ya && r !== "get" && r !== "head" && (u = await ti(c, n)) !== 0) {
let A = new Request(t, {
method: "POST",
body: n,
duplex: "half"
}), R;
if (h.isFormData(n) && (R = A.headers.get("content-type")) && c.setContentType(R), A.body) {
const [P, T] = $r(
u,
Ze(Ur(p))
);
n = Mr(A.body, jr, P, T);
}
}
h.isString(v) || (v = v ? "include" : "omit");
const m = "credentials" in Request.prototype;
y = new Request(t, {
...S,
signal: b,
method: r.toUpperCase(),
headers: c.normalize().toJSON(),
body: n,
duplex: "half",
credentials: m ? v : void 0
});
let g = await fetch(y, S);
const E = yr && (l === "stream" || l === "response");
if (yr && (s || E && w)) {
const A = {};
["status", "statusText", "headers"].forEach((q) => {
A[q] = g[q];
});
const R = h.toFiniteNumber(g.headers.get("content-length")), [P, T] = s && $r(
R,
Ze(Ur(s), !0)
) || [];
g = new Response(
Mr(g.body, jr, P, () => {
T && T(), w && w();
}),
A
);
}
l = l || "text";
let O = await Ye[h.findKey(Ye, l) || "text"](g, e);
return !E && w && w(), await new Promise((A, R) => {
no(A, R, {
data: O,
headers: X.from(g.headers),
status: g.status,
statusText: g.statusText,
config: e,
request: y
});
});
} catch (m) {
throw w && w(), m && m.name === "TypeError" && /Load failed|fetch/i.test(m.message) ? Object.assign(
new C("Network Error", C.ERR_NETWORK, e, y),
{
cause: m.cause || m
}
) : C.from(m, m && m.code, e, y);
}
}), hr = {
http: ga,
xhr: Ja,
fetch: ri
};
h.forEach(hr, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const zr = (e) => `- ${e}`, ni = (e) => h.isFunction(e) || e === null || e === !1, lo = {
getAdapter: (e) => {
e = h.isArray(e) ? e : [e];
const { length: t } = e;
let r, n;
const o = {};
for (let i = 0; i < t; i++) {
r = e[i];
let a;
if (n = r, !ni(r) && (n = hr[(a = String(r)).toLowerCase()], n === void 0))
throw new C(`Unknown adapter '${a}'`);
if (n)
break;
o[a || "#" + i] = n;
}
if (!n) {
const i = Object.entries(o).map(
([s, p]) => `adapter ${s} ` + (p === !1 ? "is not supported by the environment" : "is not available in the build")
);
let a = t ? i.length > 1 ? `since :
` + i.map(zr).join(`
`) : " " + zr(i[0]) : "as no adapter specified";
throw new C(
"There is no suitable adapter to dispatch the request " + a,
"ERR_NOT_SUPPORT"
);
}
return n;
},
adapters: hr
};
function bt(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new Le(null, e);
}
function Hr(e) {
return bt(e), e.headers = X.from(e.headers), e.data = vt.call(
e,
e.transformRequest
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), lo.getAdapter(e.adapter || We.adapter)(e).then(function(n) {
return bt(e), n.data = vt.call(
e,
e.transformResponse,
n
), n.headers = X.from(n.headers), n;
}, function(n) {
return ro(n) || (bt(e), n && n.response && (n.response.data = vt.call(
e,
e.transformResponse,
n.response
), n.response.headers = X.from(n.response.headers))), Promise.reject(n);
});
}
const uo = "1.11.0", at = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
at[e] = function(n) {
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
};
});
const Wr = {};
at.transitional = function(t, r, n) {
function o(i, a) {
return "[Axios v" + uo + "] Transitional option '" + i + "'" + a + (n ? ". " + n : "");
}
return (i, a, s) => {
if (t === !1)
throw new C(
o(a, " has been removed" + (r ? " in " + r : "")),
C.ERR_DEPRECATED
);
return r && !Wr[a] && (Wr[a] = !0, console.warn(
o(
a,
" has been deprecated since v" + r + " and will be removed in the near future"
)
)), t ? t(i, a, s) : !0;
};
};
at.spelling = function(t) {
return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
};
function oi(e, t, r) {
if (typeof e != "object")
throw new C("options must be an object", C.ERR_BAD_OPTION_VALUE);
const n = Object.keys(e);
let o = n.length;
for (; o-- > 0; ) {
const i = n[o], a = t[i];
if (a) {
const s = e[i], p = s === void 0 || a(s, i, e);
if (p !== !0)
throw new C("option " + i + " must be " + p, C.ERR_BAD_OPTION_VALUE);
continue;
}
if (r !== !0)
throw new C("Unknown option " + i, C.ERR_BAD_OPTION);
}
}
const Xe = {
assertOptions: oi,
validators: at
}, ce = Xe.validators;
let Pe = class {
constructor(t) {
this.defaults = t || {}, this.interceptors = {
request: new Ir(),
response: new Ir()
};
}
/**
* 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, r) {
try {
return await this._request(t, 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(t, r) {
typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = xe(this.defaults, r);
const { transitional: n, paramsSerializer: o, headers: i } = r;
n !== void 0 && Xe.assertOptions(n, {
silentJSONParsing: ce.transitional(ce.boolean),
forcedJSONParsing: ce.transitional(ce.boolean),
clarifyTimeoutError: ce.transitional(ce.boolean)
}, !1), o != null && (h.isFunction(o) ? r.paramsSerializer = {
serialize: o
} : Xe.assertOptions(o, {
encode: ce.function,
serialize: ce.function
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), Xe.assertOptions(r, {
baseUrl: ce.spelling("baseURL"),
withXsrfToken: ce.spelling("withXSRFToken")
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
let a = i && h.merge(
i.common,
i[r.method]
);
i && h.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(y) => {
delete i[y];
}
), r.headers = X.concat(a, i);
const s = [];
let p = !0;
this.interceptors.request.forEach(function(w) {
typeof w.runWhen == "function" && w.runWhen(r) === !1 || (p = p && w.synchronous, s.unshift(w.fulfilled, w.rejected));
});
const l = [];
this.interceptors.response.forEach(function(w) {
l.push(w.fulfilled, w.rejected);
});
let c, v = 0, S;
if (!p) {
const y = [Hr.bind(this), void 0];
for (y.unshift(...s), y.push(...l), S = y.length, c = Promise.resolve(r); v < S; )
c = c.then(y[v++], y[v++]);
return c;
}
S = s.length;
let b = r;
for (v = 0; v < S; ) {
const y = s[v++], w = s[v++];
try {
b = y(b);
} catch (u) {
w.call(this, u);
break;
}
}
try {
c = Hr.call(this, b);
} catch (y) {
return Promise.reject(y);
}
for (v = 0, S = l.length; v < S; )
c = c.then(l[v++], l[v++]);
return c;
}
getUri(t) {
t = xe(this.defaults, t);
const r = oo(t.baseURL, t.url, t.allowAbsoluteUrls);
return Yn(r, t.params, t.paramsSerializer);
}
};
h.forEach(["delete", "get", "head", "options"], function(t) {
Pe.prototype[t] = function(r, n) {
return this.request(xe(n || {}, {
method: t,
url: r,
data: (n || {}).data
}));
};
});
h.forEach(["post", "put", "patch"], function(t) {
function r(n) {
return function(i, a, s) {
return this.request(xe(s || {}, {
method: t,
headers: n ? {
"Content-Type": "multipart/form-data"
} : {},
url: i,
data: a
}));
};
}
Pe.prototype[t] = r(), Pe.prototype[t + "Form"] = r(!0);
});
let ai = class co {
constructor(t) {
if (typeof t != "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 a = new Promise((s) => {
n.subscribe(s), i = s;
}).then(o);
return a.cancel = function() {
n.unsubscribe(i);
}, a;
}, t(function(i, a, s) {
n.reason || (n.reason = new Le(i, a, s), r(n.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 r = this._listeners.indexOf(t);
r !== -1 && this._listeners.splice(r, 1);
}
toAbortSignal() {
const t = new AbortController(), r = (n) => {
t.abort(n);
};
return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), 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 co(function(o) {
t = o;
}),
cancel: t
};
}
};
function ii(e) {
return function(r) {
return e.apply(null, r);
};
}
function si(e) {
return h.isObject(e) && e.isAxiosError === !0;
}
const mr = {
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(mr).forEach(([e, t]) => {
mr[t] = e;
});
function fo(e) {
const t = new Pe(e), r = Mn(Pe.prototype.request, t);
return h.extend(r, Pe.prototype, t, { allOwnKeys: !0 }), h.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(o) {
return fo(xe(e, o));
}, r;
}
const k = fo(We);
k.Axios = Pe;
k.CanceledError = Le;
k.CancelToken = ai;
k.isCancel = ro;
k.VERSION = uo;
k.toFormData = nt;
k.AxiosError = C;
k.Cancel = k.CanceledError;
k.all = function(t) {
return Promise.all(t);
};
k.spread = ii;
k.isAxiosError = si;
k.mergeConfig = xe;
k.AxiosHeaders = X;
k.formToJSON = (e) => to(h.isHTMLForm(e) ? new FormData(e) : e);
k.getAdapter = lo.getAdapter;
k.HttpStatusCode = mr;
k.default = k;
const {
Axios: Ki,
AxiosError: Qi,
CanceledError: Xi,
isCancel: Zi,
CancelToken: Yi,
VERSION: es,
all: ts,
Cancel: rs,
isAxiosError: ns,
spread: os,
toFormData: as,
AxiosHeaders: is,
HttpStatusCode: ss,
formToJSON: ls,
getAdapter: us,
mergeConfig: cs
} = k;
class se {
static loadingDom = null;
constructor() {
}
static show(t = 0.8, r = 999) {
if (se.loadingDom) return;
const n = document.createElement("div");
n.innerHTML = `
<div style="width:42px;height:42px">
<svg width="100" height="100" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="20" stroke="#3498db" stroke-width="5" fill="none" stroke-dasharray="31.4 31.4">
<animateTransform
attributeName="transform"
type="rotate"
from="0 50 50"
to="360 50 50"
dur="1s"
repeatCount="indefinite"/>
</circle>
</svg>
</div>
`, n.style.position = "fixed", n.style.top = "0", n.style.left = "0", n.style.background = `rgba(122, 122, 122, ${t})`, n.style.width = "100%", n.style.height = "100%", n.style.display = "flex", n.style.alignItems = "center", n.style.justifyContent = "center", n.style.zIndex = r.toString(), se.loadingDom = n, document.body.appendChild(n);
}
static close() {
se.loadingDom && se.loadingDom.parentNode && (se.loadingDom.parentNode.removeChild(se.loadingDom), se.loadingDom = null);
}
}
const ke = /* @__PURE__ */ new Map();
function le(e) {
const t = Object.assign(te, e), r = k.create({
timeout: t.timeout,
baseURL: t.baseURL
});
return r.interceptors.request.use(
(n) => {
if (t.loading && se.show(), Gr(n), li(n), t.mark && n.url) {
const o = n.url;
if (typeof t.mark == "string")
o.startsWith(`/${t.mark}`) && (n.url = o.replace(`/${t.mark}`, ""));
else if (Array.isArray(t.mark))
for (let i = 0; i < t.mark.length; i++)
typeof t.mark[i] == "string" ? o.startsWith(`/${t.mark[i]}`) && (n.url = o.replace(`/${t.mark[i]}`, "")) : console.warn("ezAxios: mark 存在无法解析类型,已忽略");
else
console.error("ezAxios: mark 参数类型错误,请传入字符串或数组");
}
for (const o in t.headers)
n.headers[o] = t.headers[o];
return n;
},
(n) => Promise.reject(n)
), r.interceptors.response.use(
(n) => (se.close(), Gr(n.config), t.success && t.success(n), Promise.resolve(t.briefly ? n.data : n)),
(n) => {
if (se.close(), !!n)
return k.isCancel(n) ? n.message == "canceled" ? Promise.reject(`ezAxios: 请求:${n.config.url} 已取消`) : Promise.reject(`ezAxios: 连续的重复请求,已取消
错误信息:${n.message}`) : n.response ? (t.error && t.error(n.response.status), Promise.reject(n.response)) : Promise.reject(n.message);
}
), r;
}
function li(e) {
const t = po(e);
e.cancelToken = e.cancelToken || new k.CancelToken((r) => {
ke.has(t) || ke.set(t, r);
});
}
function Gr(e) {
const t = po(e);
ke.has(t) && (ke.get(t)(t), ke.delete(t));
}
function po(e) {
const { url: t, method: r, params: n } = e;
let { data: o } = e;
try {
JSON.parse(o), o = JSON.parse(o);
} catch {
}
return [t, r, JSON.stringify(n), JSON.stringify(o)].join("&");
}
function fs(e, ...t) {
let r = null, n = "json", o = null;
return t.length && t.forEach((i, a) => {
a === 0 ? typeof i == "object" ? r = i : typeof i == "string" ? i.toLowerCase() === "blob" ? n = "blob" : console.error("ezAxios: 请求参数仅支持 Object、Array类型") : r && console.error("ezAxios: 请求参数仅支持 Object、Array类型") : a < 3 ? i && (Object.prototype.toString.call(i) == "[object Object]" ? o = i : typeof i == "string" && i.toLowerCase() === "blob" ? n = "blob" : console.warn("ezAxios: 存在无法处理的参数类型,这可能会影响您的程序")) : console.warn("ezAxios: 接收到多余参数,已忽略");
}), new Promise((i, a) => {
le(o).get(e, { params: r, responseType: n, signal: o?.signal }).then((s) => {
i(s);
}).catch((s) => {
a(s);
});
});
}
var Jr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function ui(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function ci(e) {
if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
var t = e.default;
if (typeof t == "function") {
var r = function n() {
var o = !1;
try {
o = this instanceof n;
} catch {
}
return o ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
};
r.prototype = t.prototype;
} else r = {};
return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(n) {
var o = Object.getOwnPropertyDescriptor(e, n);
Object.defineProperty(r, n, o.get ? o : {
enumerable: !0,
get: function() {
return e[n];
}
});
}), r;
}
var wt, Vr;
function Ie() {
return Vr || (Vr = 1, wt = TypeError), wt;
}
const fi = {}, pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: fi
}, Symbol.toStringTag, { value: "Module" })), di = /* @__PURE__ */ ci(pi);
var St, Kr;
function it() {
if (Kr) return St;
Kr = 1;
var e = typeof Map == "function" && Map.prototype, t = Object.getOwnPropertyDescriptor && e ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, r = e && t && typeof t.get == "function" ? t.get : null, n = e && Map.prototype.forEach, o = typeof Set == "function" && Set.prototype, i = Object.getOwnPropertyDescriptor && o ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, a = o && i && typeof i.get == "function" ? i.get : null, s = o && Set.prototype.forEach, p = typeof WeakMap == "function" && WeakMap.prototype, l = p ? WeakMap.prototype.has : null, c = typeof WeakSet == "function" && WeakSet.prototype, v = c ? WeakSet.prototype.has : null, S = typeof WeakRef == "function" && WeakRef.prototype, b = S ? WeakRef.prototype.deref : null, y = Boolean.prototype.valueOf, w = Object.prototype.toString, u = Function.prototype.toString, m = String.prototype.match, g = String.prototype.slice, E = String.prototype.replace, O = String.prototype.toUpperCase, A = String.prototype.toLowerCase, R = RegExp.prototype.test, P = Array.prototype.concat, T = Array.prototype.join, q = Array.prototype.slice, F = Math.floor, I = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, x = Object.getOwnPropertySymbols, W = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, j = typeof Symbol == "function" && typeof Symbol.iterator == "object", Z = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === j || !0) ? Symbol.toStringTag : null, fe = Object.prototype.propertyIsEnumerable, pe = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(f) {
return f.__proto__;
} : null);
function _(f, d) {
if (f === 1 / 0 || f === -1 / 0 || f !== f || f && f > -1e3 && f < 1e3 || R.call(/e/, d))
return d;
var L = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
if (typeof f == "number") {
var $ = f < 0 ? -F(-f) : F(f);
if ($ !== f) {
var U = String($), N = g.call(d, U.length + 1);
return E.call(U, L, "$&_") + "." + E.call(E.call(N, /([0-9]{3})/g, "$&_"), /_$/, "");
}
}
return E.call(d, L, "$&_");
}
var Y = di, de = Y.custom, Oe = G(de) ? de : null, he = {
__proto__: null,
double: '"',
single: "'"
}, me = {
__proto__: null,
double: /(["\\])/g,
single: /(['\\])/g
};
St = function f(d, L, $, U) {
var N = L || {};
if (K(N, "quoteStyle") && !K(he, N.quoteStyle))
throw new TypeError('option "quoteStyle" must be "single" or "double"');
if (K(N, "maxStringLength") && (typeof N.maxStringLength == "number" ? N.maxStringLength < 0 && N.maxStringLength !== 1 / 0 : N.maxStringLength !== null))
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
var Se = K(N, "customInspect") ? N.customInspect : !0;
if (typeof Se != "boolean" && Se !== "symbol")
throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
if (K(N, "indent") && N.indent !== null && N.indent !== " " && !(parseInt(N.indent, 10) === N.indent && N.indent > 0))
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
if (K(N, "numericSeparator") && typeof N.numericSeparator != "boolean")
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
var Ae = N.numericSeparator;
if (typeof d > "u")
return "undefined";
if (d === null)
return "null";
if (typeof d == "boolean")
return d ? "true" : "false";
if (typeof d == "string")
return Or(d, N);
if (typeof d == "number") {
if (d === 0)
return 1 / 0 / d > 0 ? "0" : "-0";
var ee = String(d);
return Ae ? _(d, ee) : ee;
}
if (typeof d == "bigint") {
var Ee = String(d) + "n";
return Ae ? _(d, Ee) : Ee;
}
var ct = typeof N.depth > "u" ? 5 : N.depth;
if (typeof $ > "u" && ($ = 0), $ >= ct && ct > 0 && typeof d == "object")
return ve(d) ? "[Array]" : "[Object]";
var _e = To(N, $);
if (typeof U > "u")
U = [];
else if (we(U, d) >= 0)
return "[Circular]";
function ie(qe, Ve, Fo) {
if (Ve && (U = q.call(U), U.push(Ve)), Fo) {
var _r = {
depth: N.depth
};
return K(N, "quoteStyle") && (_r.quoteStyle = N.quoteStyle), f(qe, _r, $ + 1, U);
}
return f(qe, N, $ + 1, U);
}
if (typeof d == "function" && !H(d)) {
var Rr = Te(d), Pr = Ge(d, ie);
return "[Function" + (Rr ? ": " + Rr : " (anonymous)") + "]" + (Pr.length > 0 ? " { " + T.call(Pr, ", ") + " }" : "");
}
if (G(d)) {
var xr = j ? E.call(String(d), /^(Symbol\(.*\))_[^)]*$/, "$1") : W.call(d);
return typeof d == "object" && !j ? Be(xr) : xr;
}
if (Ro(d)) {
for (var $e = "<" + A.call(String(d.nodeName)), ft = d.attributes || [], Je = 0; Je < ft.length; Je++)
$e += " " + ft[Je].name + "=" + ge(ye(ft[Je].value), "double", N);
return $e += ">", d.childNodes && d.childNodes.length && ($e += "..."), $e += "</" + A.call(String(d.nodeName)) + ">", $e;
}
if (ve(d)) {
if (d.length === 0)
return "[]";
var pt = Ge(d, ie);
return _e && !xo(pt) ? "[" + ut(pt, _e) + "]" : "[ " + T.call(pt, ", ") + " ]";
}
if (D(d)) {
var dt = Ge(d, ie);
return !("cause" in Error.prototype) && "cause" in d && !fe.call(d, "cause") ? "{ [" + String(d) + "] " + T.call(P.call("[cause]: " + ie(d.cause), dt), ", ") + " }" : dt.length === 0 ? "[" + String(d) + "]" : "{ [" + String(d) + "] " + T.call(dt, ", ") + " }";
}
if (typeof d == "object" && Se) {
if (Oe && typeof d[Oe] == "function" && Y)
return Y(d, { depth: ct - $ });
if (Se !== "symbol" && typeof d.inspect == "function")
return d.inspect();
}
if (ae(d)) {
var Tr = [];
return n && n.call(d, function(qe, Ve) {
Tr.push(ie(Ve, d, !0) + " => " + ie(qe, d));
}), Ar("Map", r.call(d), Tr, _e);
}
if (Ne(d)) {
var Cr = [];
return s && s.call(d, function(qe) {
Cr.push(ie(qe, d));
}), Ar("Set", a.call(d), Cr, _e);
}
if (Ce(d))
return lt("WeakMap");
if (Ao(d))
return lt("WeakSet");
if (Fe(d))
return lt("WeakRef");
if (B(d))
return Be(ie(Number(d)));
if (ne(d))
return Be(ie(I.call(d)));
if (z(d))
return Be(y.call(d));
if (M(d))
return Be(ie(String(d)));
if (typeof window < "u" && d === window)
return "{ [object Window] }";
if (typeof globalThis < "u" && d === globalThis || typeof Jr < "u" && d === Jr)
return "{ [object globalThis] }";
if (!be(d) && !H(d)) {
var yt = Ge(d, ie), Fr = pe ? pe(d) === Object.prototype : d instanceof Object || d.constructor === Object, ht = d instanceof Object ? "" : "null prototype", Nr = !Fr && Z && Object(d) === d && Z in d ? g.call(oe(d), 8, -1) : ht ? "Object" : "", Co = Fr || typeof d.constructor != "function" ? "" : d.constructor.name ? d.constructor.name + " " : "", mt = Co + (Nr || ht ? "[" + T.call(P.call([], Nr || [], ht || []), ": ") + "] " : "");
return yt.length === 0 ? mt + "{}" : _e ? mt + "{" + ut(yt, _e) + "}" : mt + "{ " + T.call(yt, ", ") + " }";
}
return String(d);
};
function ge(f, d, L) {
var $ = L.quoteStyle || d, U = he[$];
return U + f + U;
}
function ye(f) {
return E.call(String(f), /"/g, """);
}
function re(f) {
return !Z || !(typeof f == "object" && (Z in f || typeof f[Z] < "u"));
}
function ve(f) {
return oe(f) === "[object Array]" && re(f);
}
function be(f) {
return oe(f) === "[object Date]" && re(f);
}
function H(f) {
return oe(f) === "[object RegExp]" && re(f);
}
function D(f) {
return oe(f) === "[object Error]" && re(f);
}
function M(f) {
return oe(f) === "[object String]" && re(f);
}
function B(f) {
return oe(f) === "[object Number]" && re(f);
}
function z(f) {
return oe(f) === "[object Boolean]" && re(f);
}
function G(f) {
if (j)
return f && typeof f == "object" && f instanceof Symbol;
if (typeof f == "symbol")
return !0;
if (!f || typeof f != "object" || !W)
return !1;
try {
return W.call(f), !0;
} catch {
}
return !1;
}
function ne(f) {
if (!f || typeof f != "object" || !I)
return !1;
try {
return I.call(f), !0;
} catch {
}
return !1;
}
var J = Object.prototype.hasOwnProperty || function(f) {
return f in this;
};
function K(f, d) {
return J.call(f, d);
}
function oe(f) {
return w.call(f);
}
function Te(f) {
if (f.name)
return f.name;
var d = m.call(u.call(f), /^function\s*([\w$]+)/);
return d ? d[1] : null;
}
function we(f, d) {
if (f.indexOf)
return f.indexOf(d);
for (var L = 0, $ = f.length; L < $; L++)
if (f[L] === d)
return L;
return -1;
}
function ae(f) {
if (!r || !f || typeof f != "object")
return !1;
try {
r.call(f);
try {
a.call(f);
} catch {
return !0;
}
return f instanceof Map;
} catch {
}
return !1;
}
function Ce(f) {
if (!l || !f || typeof f != "object")
return !1;
try {
l.call(f, l);
try {
v.call(f, v);
} catch {
return !0;
}
return f instanceof WeakMap;
} catch {
}
return !1;
}
function Fe(f) {
if (!b || !f || typeof f != "object")
return !1;
try {
return b.call(f), !0;
} catch {
}
return !1;
}
function Ne(f) {
if (!a || !f || typeof f != "object")
return !1;
try {
a.call(f);
try {
r.call(f);
} catch {
return !0;
}
return f instanceof Set;
} catch {
}
return !1;
}
function Ao(f) {
if (!v || !f || typeof f != "object")
return !1;
try {
v.call(f, v);
try {
l.call(f, l);
} catch {
return !0;
}
return f instanceof WeakSet;
} catch {
}
return !1;
}
function Ro(f) {
return !f || typeof f != "object" ? !1 : typeof HTMLElement < "u" && f instanceof HTMLElement ? !0 : typeof f.nodeName == "string" && typeof f.getAttribute == "function";
}
function Or(f, d) {
if (f.length > d.maxStringLength) {
var L = f.length - d.maxStringLength, $ = "... " + L + " more character" + (L > 1 ? "s" : "");
return Or(g.call(f, 0, d.maxStringLength), d) + $;
}
var U = me[d.quoteStyle || "single"];
U.lastIndex = 0;
var N = E.call(E.call(f, U, "\\$1"), /[\x00-\x1f]/g, Po);
return ge(N, "single", d);
}
function Po(f) {
var d = f.charCodeAt(0), L = {
8: "b",
9: "t",
10: "n",
12: "f",
13: "r"
}[d];
return L ? "\\" + L : "\\x" + (d < 16 ? "0" : "") + O.call(d.toString(16));
}
function Be(f) {
return "Object(" + f + ")";
}
function lt(f) {
return f + " { ? }";
}
function Ar(f, d, L, $) {
var U = $ ? ut(L, $) : T.call(L, ", ");
return f + " (" + d + ") {" + U + "}";
}
function xo(f) {
for (var d = 0; d < f.length; d++)
if (we(f[d], `
`) >= 0)
return !1;
return !0;
}
function To(f, d) {
var L;
if (f.indent === " ")
L = " ";
else if (typeof f.indent == "number" && f.indent > 0)
L = T.call(Array(f.indent + 1), " ");
else
return null;
return {
base: L,
prev: T.call(Array(d + 1), L)
};
}
function ut(f, d) {
if (f.length === 0)
return "";
var L = `
` + d.prev + d.base;
return L + T.call(f, "," + L) + `
` + d.prev;
}
function Ge(f, d) {
var L = ve(f), $ = [];
if (L) {
$.length = f.length;
for (var U = 0; U < f.length; U++)
$[U] = K(f, U) ? d(f[U], f) : "";
}
var N = typeof x == "function" ? x(f) : [], Se;
if (j) {
Se = {};
for (var Ae = 0; Ae < N.length; Ae++)
Se["$" + N[Ae]] = N[Ae];
}
for (var ee in f)
K(f, ee) && (L && String(Number(ee)) === ee && ee < f.length || j && Se["$" + ee] instanceof Symbol || (R.call(/[^\w$]/, ee) ? $.push(d(ee, f) + ": " + d(f[ee], f)) : $.push(ee + ": " + d(f[ee], f))));
if (typeof x == "function")
for (var Ee = 0; Ee < N.length; Ee++)
fe.call(f, N[Ee]) && $.push("[" + d(N[Ee]) + "]: " + d(f[N[Ee]], f));
return $;
}
return St;
}
var Et, Qr;
function yi() {
if (Qr) return Et;
Qr = 1;
var e = /* @__PURE__ */ it(), t = /* @__PURE__ */ Ie(), r = function(s, p, l) {
for (var c = s, v; (v = c.next) != null; c = v)
if (v.key === p)
return c.next = v.next, l || (v.next = /** @type {NonNullable<typeof list.next>} */
s.next, s.next = v), v;
}, n = function(s, p) {
if (s) {
var l = r(s, p);
return l && l.value;
}
}, o = function(s, p, l) {
var c = r(s, p);
c ? c.value = l : s.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
{
// eslint-disable-line no-param-reassign, no-extra-parens
key: p,
next: s.next,
value: l
};
}, i = function(s, p) {
return s ? !!r(s, p) : !1;
}, a = function(s, p) {
if (s)
return r(s, p, !0);
};
return Et = function() {
var p, l = {
assert: function(c) {
if (!l.has(c))
throw new t("Side channel does not contain " + e(c));
},
delete: function(c) {
var v = p && p.next, S = a(p, c);
return S && v && v === S && (p = void 0), !!S;
},
get: function(c) {
return n(p, c);
},
has: function(c) {
return i(p, c);
},
set: function(c, v) {
p || (p = {
next: void 0
}), o(
/** @type {NonNullable<typeof $o>} */
p,
c,
v
);
}
};
return l;
}, Et;
}
var Ot, Xr;
function yo() {
return Xr || (Xr = 1, Ot = Object), Ot;
}
var At, Zr;
function hi() {
return Zr || (Zr = 1, At = Error), At;
}
var Rt, Yr;
function mi() {
return Yr || (Yr = 1, Rt = EvalError), Rt;
}
var Pt, en;
function gi() {
return en || (en = 1, Pt = RangeError), Pt;
}
var xt, tn;
function vi() {
return tn || (tn = 1, xt = ReferenceError), xt;
}
var Tt, rn;
function bi() {
return rn || (rn = 1, Tt = SyntaxError), Tt;
}
var Ct, nn;
function wi() {
return nn || (nn = 1, Ct = URIError), Ct;
}
var Ft, on;
function Si() {
return on || (on = 1, Ft = Math.abs), Ft;
}
var Nt, an;
function Ei() {
return an || (an = 1, Nt = Math.floor), Nt;
}
var _t, sn;
function Oi() {
return sn || (sn = 1, _t = Math.max), _t;
}
var qt, ln;
function Ai() {
return ln || (ln = 1, qt = Math.min), qt;
}
var Dt, un;
function Ri() {
return un || (un = 1, Dt = Math.pow), Dt;
}
var Lt, cn;
function Pi() {
return cn || (cn = 1, Lt = Math.round), Lt;
}
var It, fn;
function xi() {
return fn || (fn = 1, It = Number.isNaN || function(t) {
return t !== t;
}), It;
}
var Bt, pn;
function Ti() {
if (pn) return Bt;
pn = 1;
var e = /* @__PURE__ */ xi();
return Bt = function(r) {
return e(r) || r === 0 ? r : r < 0 ? -1 : 1;
}, Bt;
}
var $t, dn;
function Ci() {
return dn || (dn = 1, $t = Object.getOwnPropertyDescriptor), $t;
}
var Ut, yn;
function ho() {
if (yn) return Ut;
yn = 1;
var e = /* @__PURE__ */ Ci();
if (e)
try {
e([], "length");
} catch {
e = null;
}
return Ut = e, Ut;
}
var kt, hn;
function Fi() {
if (hn) return kt;
hn = 1;
var e = Object.defineProperty || !1;
if (e)
try {
e({}, "a", { value: 1 });
} catch {
e = !1;
}
return kt = e, kt;
}
var Mt, mn;
function Ni() {
return mn || (mn = 1, Mt = function() {
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
return !1;
if (typeof Symbol.iterator == "symbol")
return !0;
var t = {}, r = Symbol("test"), n = Object(r);
if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
return !1;
var o = 42;
t[r] = o;
for (var i in t)
return !1;
if (typeof Object.keys == "function" && Object.keys(t).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(t).length !== 0)
return !1;
var a = Object.getOwnPropertySymbols(t);
if (a.length !== 1 || a[0] !== r || !Object.prototype.propertyIsEnumerable.call(t, r))
return !1;
if (typeof Object.getOwnPropertyDescriptor == "function") {
var s = (
/** @type {PropertyDescriptor} */
Object.getOwnPropertyDescriptor(t, r)
);
if (s.value !== o || s.enumerable !== !0)
return !1;
}
return !0;
}), Mt;
}
var jt, gn;
function _i() {
if (gn) return jt;
gn = 1;
var e = typeof Symbol < "u" && Symbol, t = Ni();
return jt = function() {
return typeof e != "function" || typeof Symbol != "function" || typeof e("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : t();
}, jt;
}
var zt, vn;
function mo() {
return vn || (vn = 1, zt = typeof Reflect < "u" && Reflect.getPrototypeOf || null), zt;
}
var Ht, bn;
function go() {
if (bn) return Ht;
bn = 1;
var e = /* @__PURE__ */ yo();
return Ht = e.getPrototypeOf || null, Ht;
}
var Wt, wn;
function qi() {
if (wn) return Wt;
wn = 1;
var e = "Function.prototype.bind called on incompatible ", t = Object.prototype.toString, r = Math.max, n = "[object Function]", o = function(p, l) {
for (var c = [], v = 0; v < p.length; v += 1)
c[v] = p[v];
for (var S = 0; S < l.length; S += 1)
c[S + p.length] = l[S];
return c;
}, i = function(p, l) {
for (var c = [], v = l, S = 0; v < p.length; v += 1, S += 1)
c[S] = p[v];
return c;
}, a = function(s, p) {
for (var l = "", c = 0; c < s.length; c += 1)
l += s[c], c + 1 < s.length && (l += p);
return l;
};
return Wt = function(p) {
var l = this;
if (typeof l != "function" || t.apply(l) !== n)
throw new TypeError(e + l);
for (var c = i(arguments, 1), v, S = function() {
if (this instanceof v) {
var m = l.apply(
this,
o(c, arguments)
);
return Object(m) === m ? m : this;
}
return l.apply(
p,
o(c, arguments)
);
}, b = r(0, l.length - c.length), y = [], w = 0; w < b; w++)
y[w] = "$" + w;
if (v = Function("binder", "return function (" + a(y, ",") + "){ return binder.apply(this,arguments); }")(S), l.prototype) {
var u = function() {
};
u.prototype = l.prototype, v.prototype = new u(), u.prototype = null;
}
return v;
}, Wt;
}
var Gt, Sn;
function st() {
if (Sn) return Gt;
Sn = 1;
var e = qi();
return Gt = Function.prototype.bind || e, Gt;
}
var Jt, En;
function wr() {
return En || (En = 1, Jt = Function.prototype.call), Jt;
}
var Vt, On;
function vo() {
return On || (On = 1, Vt = Function.prototype.apply), Vt;
}
var Kt, An;
function Di() {
return An || (An = 1, Kt = typeof Reflect < "u" && Reflect && Reflect.apply), Kt;
}
var Qt, Rn;
function Li() {
if (Rn) return Qt;
Rn = 1;
var e = st(), t = vo(), r = wr(), n = Di();
return Qt = n || e.call(r, t), Qt;
}
var Xt, Pn;
function bo() {
if (Pn) return Xt;
Pn = 1;
var e = st(), t = /* @__PURE__ */ Ie(), r = wr(), n = Li();
return Xt = function(i) {
if (i.length < 1 || typeof i[0] != "function")
throw new t("a function is required");
return n(e, r, i);
}, Xt;
}
var Zt, xn;
function Ii() {
if (xn) return Zt;
xn = 1;
var e = bo(), t = /* @__PURE__ */ ho(), r;
try {
r = /** @type {{ __proto__?: typeof Array.prototype }} */
[].__proto__ === Array.prototype;
} catch (a) {
if (!a || typeof a != "object" || !("code" in a) || a.code !== "ERR_PROTO_ACCESS")
throw a;
}
var n = !!r && t && t(
Object.prototype,
/** @type {keyof typeof Object.prototype} */
"__proto__"
), o = Object, i = o.getPrototypeOf;
return Zt = n && typeof n.get == "function" ? e([n.get]) : typeof i == "function" ? (
/** @type {import('./get')} */
function(s) {
return i(s == null ? s : o(s));
}
) : !1, Zt;
}
var Yt, Tn;
function Bi() {
if (Tn) return Yt;
Tn = 1;
var e = mo(), t = go(), r = /* @__PURE__ */ Ii();
return Yt = e ? function(o) {
return e(o);
} : t ? function(o) {
if (!o || typeof o != "object" && typeof o != "function")
throw new TypeError("getProto: not an object");
return t(o);
} : r ? function(o) {
return r(o);
} : null, Yt;
}
var er, Cn;
function $i() {
if (Cn) return er;
Cn = 1;
var e = Function.prototype.call, t = Object.prototype.hasOwnProperty, r = st();
return er = r.call(e, t), er;
}
var tr, Fn;
function Sr() {
if (Fn) return tr;
Fn = 1;
var e, t = /* @__PURE__ */ yo(), r = /* @__PURE__ */ hi(), n = /* @__PURE__ */ mi(), o = /* @__PURE__ */ gi(), i = /* @__PURE__ */ vi(), a = /* @__PURE__ */ bi(), s = /* @__PURE__ */ Ie(), p = /* @__PURE__ */ wi(), l = /* @__PURE__ */ Si(), c = /* @__PURE__ */ Ei(), v = /* @__PURE__ */ Oi(), S = /* @__PURE__ */ Ai(), b = /* @__PURE__ */ Ri(), y = /* @__PURE__ */ Pi(), w = /* @__PURE__ */ Ti(), u = Function, m = function(H) {
try {
return u('"use strict"; return (' + H + ").constructor;")();
} catch {
}
}, g = /* @__PURE__ */ ho(), E = /* @__PURE__ */ Fi(), O = function() {
throw new s();
}, A = g ? function() {
try {
return arguments.callee, O;
} catch {
try {
return g(arguments, "callee").get;
} catch {
return O;
}
}
}() : O, R = _i()(), P = Bi(), T = go(), q = mo(), F = vo(), I = wr(), x = {}, W = typeof Uint8Array > "u" || !P ? e : P(Uint8Array), j = {
__proto__: null,
"%AggregateError%": typeof AggregateError > "u" ? e : AggregateError,
"%Array%": Array,
"%ArrayBuffer%": typeof ArrayBuffer > "u" ? e : ArrayBuffer,
"%ArrayIteratorPrototype%": R && P ? P([][Symbol.iterator]()) : e,
"%AsyncFromSyncIteratorPrototype%": e,
"%AsyncFunction%": x,
"%AsyncGenerator%": x,
"%AsyncGeneratorFunction%": x,
"%AsyncIteratorPrototype%": x,
"%Atomics%": typeof Atomics > "u" ? e : Atomics,
"%BigInt%": typeof BigInt > "u" ? e : BigInt,
"%BigInt64Array%": typeof BigInt64Array > "u" ? e : BigInt64Array,
"%BigUint64Array%": typeof BigUint64Array > "u" ? e : BigUint64Array,
"%Boolean%": Boolean,
"%DataView%": typeof DataView > "u" ? e : DataView,
"%Date%": Date,
"%decodeURI%": decodeURI,
"%decodeURIComponent%": decodeURIComponent,
"%encodeURI%": encodeURI,
"%encodeURIComponent%": encodeURIComponent,
"%Error%": r,
"%eval%": eval,
// eslint-disable-line no-eval
"%EvalError%": n,
"%Float16Array%": typeof Float16Array > "u" ? e : Float16Array,
"%Float32Array%": typeof Float32Array > "u" ? e : Float32Array,
"%Float64Array%": typeof Float64Array > "u" ? e : Float64Array,
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? e : FinalizationRegistry,
"%Function%": u,
"%GeneratorFunction%": x,
"%Int8Array%": typeof Int8Array > "u" ? e : Int8Array,
"%Int16Array%": typeof Int16Array > "u" ? e : Int16Array,
"%Int32Array%": typeof Int32Array > "u" ? e : Int32Array,
"%isFinite%": isFinite,
"%isNaN%": isNaN,
"%IteratorPrototype%": R && P ? P(P([][Symbol.iterator]())) : e,
"%JSON%": typeof JSON == "object" ? JSON : e,
"%Map%": typeof Map > "u" ? e : Map,
"%MapIteratorPrototype%": typeof Map > "u" || !R || !P ? e : P((/* @__PURE__ */ new Map())[Symbol.iterator]()),
"%Math%": Math,
"%Number%": Number,
"%Object%": t,
"%Object.getOwnPropertyDescriptor%": g,
"%parseFloat%": parseFloat,
"%parseInt%": parseInt,
"%Promise%": typeof Promise > "u" ? e : Promise,
"%Proxy%": typeof Proxy > "u" ? e : Proxy,
"%RangeError%": o,
"%ReferenceError%": i,
"%Reflect%": typeof Reflect > "u" ? e : Reflect,
"%RegExp%": RegExp,
"%Set%": typeof Set > "u" ? e : Set,
"%SetIteratorPrototype%": typeof Set > "u" || !R || !P ? e : P((/* @__PURE__ */ new Set())[Symbol.iterator]()),
"%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? e : SharedArrayBuffer,
"%String%": String,
"%StringIteratorPrototype%": R && P ? P(""[Symbol.iterator]()) : e,
"%Symbol%": R ? Symbol : e,
"%SyntaxError%": a,
"%ThrowTypeError%": A,
"%TypedArray%": W,
"%TypeError%": s,
"%Uint8Array%": typeof Uint8Array > "u" ? e : Uint8Array,
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? e : Uint8ClampedArray,
"%Uint16Array%": typeof Uint16Array > "u" ? e : Uint16Array,
"%Uint32Array%": typeof Uint32Array > "u" ? e : Uint32Array,
"%URIError%": p,
"%WeakMap%": typeof WeakMap > "u" ? e : WeakMap,
"%WeakRef%": typeof WeakRef > "u" ? e : WeakRef,
"%WeakSet%": typeof WeakSet > "u" ? e : WeakSet,
"%Function.prototype.call%": I,
"%Function.prototype.apply%": F,
"%Object.defineProperty%": E,
"%Object.getPrototypeOf%": T,
"%Math.abs%": l,
"%Math.floor%": c,
"%Math.max%": v,
"%Math.min%": S,
"%Math.pow%": b,
"%Math.round%": y,
"%Math.sign%": w,
"%Reflect.getPrototypeOf%": q
};
if (P)
try {
null.error;
} catch (H) {
var Z = P(P(H));
j["%Error.prototype%"] = Z;
}
var fe = function H(D) {
var M;
if (D === "%AsyncFunction%")
M = m("async function () {}");
else if (D === "%GeneratorFunction%")
M = m("function* () {}");
else if (D === "%AsyncGeneratorFunction%")
M = m("async function* () {}");
else if (D === "%AsyncGenerator%") {
var B = H("%AsyncGeneratorFunction%");
B && (M = B.prototype);
} else if (D === "%AsyncIteratorPrototype%") {
var z = H("%AsyncGenerator%");
z && P && (M = P(z.prototype));
}
return j[D] = M, M;
}, pe = {
__proto__: null,
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
"%ArrayPrototype%": ["Array", "prototype"],
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
"%ArrayProto_values%": ["Array", "prototype", "values"],
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
"%BooleanPrototype%": ["Boolean", "prototype"],
"%DataViewPrototype%": ["DataView", "prototype"],
"%DatePrototype%": ["Date", "prototype"],
"%ErrorPrototype%": ["Error", "prototype"],
"%EvalErrorPrototype%": ["EvalError", "prototype"],
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
"%FunctionPrototype%": ["Function", "prototype"],
"%Generator%": ["GeneratorFunction", "prototype"],
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
"%JSONParse%": ["JSON", "parse"],
"%JSONStringify%": ["JSON", "stringify"],
"%MapPrototype%": ["Map", "prototype"],
"%NumberPrototype%": ["Number", "prototype"],
"%ObjectPrototype%": ["Object", "prototype"],
"%ObjProto_toString%": ["Object", "prototype", "toString"],
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
"%PromisePrototype%": ["Promise", "prototype"],
"%PromiseProto_then%": ["Promise", "prototype", "then"],
"%Promise_all%": ["Promise", "all"],
"%Promise_reject%": ["Promise", "reject"],
"%Promise_resolve%": ["Promise", "resolve"],
"%RangeErrorPrototype%": ["RangeError", "prototype"],
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
"%RegExpPrototype%": ["RegExp", "prototype"],
"%SetPrototype%": ["Set", "prototype"],
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
"%StringPrototype%": ["String", "prototype"],
"%SymbolPrototype%": ["Symbol", "prototype"],
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
"%TypeErrorPrototype%": ["TypeError", "prototype"],
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
"%URIErrorPrototype%": ["URIError", "prototype"],
"%WeakMapPrototype%": ["WeakMap", "prototype"],
"%WeakSetPrototype%": ["WeakSet", "prototype"]
}, _ = st(), Y = /* @__PURE__ */ $i(), de = _.call(I, Array.prototype.concat), Oe = _.call(F, Array.prototype.splice), he = _.call(I, String.prototype.replace), me = _.call(I, String.prototype.slice), ge = _.call(I, RegExp.prototype.exec), ye = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, re = /\\(\\)?/g, ve = function(D) {
var M = me(D, 0, 1), B = me(D, -1);
if (M === "%" && B !== "%")
throw new a("invalid intrinsic syntax, expected closing `%`");
if (B === "%" && M !== "%")
throw new a("invalid intrinsic syntax, expected opening `%`");
var z = [];
return he(D, ye, function(G, ne, J, K) {
z[z.length] = J ? he(K, re, "$1") : ne || G;
}), z;
}, be = function(D, M) {
var B = D, z;
if (Y(pe, B) && (z = pe[B], B = "%" + z[0] + "%"), Y(j, B)) {
var G = j[B];
if (G === x && (G = fe(B)), typeof G > "u" && !M)
throw new s("intrinsic " + D + " exists, but is not available. Please file an issue!");
return {
alias: z,
name: B,
value: G
};
}
throw new a("intrinsic " + D + " does not exist!");
};
return tr = function(D, M) {
if (typeof D != "string" || D.length === 0)
throw new s("intrinsic name must be a non-empty string");
if (arguments.length > 1 && typeof M != "boolean")
throw new s('"allowMissing" argument must be a boolean');
if (ge(/^%?[^%]*%?$/, D) === null)
throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
var B = ve(D), z = B.length > 0 ? B[0] : "", G = be("%" + z + "%", M), ne = G.name, J = G.value, K = !1, oe = G.alias;
oe && (z = oe[0], Oe(B, de([0, 1], oe)));
for (var Te = 1, we = !0; Te < B.length; Te += 1) {
var ae = B[Te], Ce = me(ae, 0, 1), Fe = me(ae, -1);
if ((Ce === '"' || Ce === "'" || Ce === "`" || Fe === '"' || Fe === "'" || Fe === "`") && Ce !== Fe)
throw new a("property names with quotes must have matching quotes");
if ((ae === "constructor" || !we) && (K = !0), z += "." + ae, ne = "%" + z + "%", Y(j, ne))
J = j[ne];
else if (J != null) {
if (!(ae in J)) {
if (!M)
throw new s("base intrinsic for " + D + " exists, but the property is not available.");
return;
}
if (g && Te + 1 >= B.length) {
var Ne = g(J, ae);
we = !!Ne, we && "get" in Ne && !("originalValue" in Ne.get) ? J = Ne.get : J = J[ae];
} else
we = Y(J, ae), J = J[ae];
we && !K && (j[ne] = J);
}
}
return J;
}, tr;
}
var rr, Nn;
function wo() {
if (Nn) return rr;
Nn = 1;
var e = /* @__PURE__ */ Sr(), t = bo(), r = t([e("%String.prototype.indexOf%")]);
return rr = function(o, i) {
var a = (
/** @type {(this: unknown, ...args: unknown[]) => unknown} */
e(o, !!i)
);
return typeof a == "function" && r(o, ".prototype.") > -1 ? t(
/** @type {const} */
[a]
) : a;
}, rr;
}
var nr, _n;
function So() {
if (_n) return nr;
_n = 1;
var e = /* @__PURE__ */ Sr(), t = /* @__PURE__ */ wo(), r = /* @__PURE__ */ it(), n = /* @__PURE__ */ Ie(), o = e("%Map%", !0), i = t("Map.prototype.get", !0), a = t("Map.prototype.set", !0), s = t("Map.prototype.has", !0), p = t("Map.prototype.delete", !0), l = t("Map.prototype.size", !0);
return nr = !!o && /** @type {Exclude<import('.'), false>} */
function() {
var v, S = {
assert: function(b) {
if (!S.has(b))
throw new n("Side channel does not contain " + r(b));
},
delete: function(b) {
if (v) {
var y = p(v, b);
return l(v) === 0 && (v = void 0), y;
}
return !1;
},
get: function(b) {
if (v)
return i(v, b);
},
has: function(b) {
return v ? s(v, b) : !1;
},
set: function(b, y) {
v || (v = new o()), a(v, b, y);
}
};
return S;
}, nr;
}
var or, qn;
function Ui() {
if (qn) return or;
qn = 1;
var e = /* @__PURE__ */ Sr(), t = /* @__PURE__ */ wo(), r = /* @__PURE__ */ it(), n = So(), o = /* @__PURE__ */ Ie(), i = e("%WeakMap%", !0), a = t("WeakMap.prototype.get", !0), s = t("WeakMap.prototype.set", !0), p = t("WeakMap.prototype.has", !0), l = t("WeakMap.prototype.delete", !0);
return or = i ? (
/** @type {Exclude<import('.'), false>} */
function() {
var v, S, b = {
assert: function(y) {
if (!b.has(y))
throw new o("Side channel does not contain " + r(y));
},
delete: function(y) {
if (i && y && (typeof y == "object" || typeof y == "function")) {
if (v)
return l(v, y);
} else if (n && S)
return S.delete(y);
return !1;
},
get: function(y) {
return i && y && (typeof y == "object" || typeof y == "function") && v ? a(v, y) : S && S.get(y);
},
has: function(y) {
return i && y && (typeof y == "object" || typeof y == "function") && v ? p(v, y) : !!S && S.has(y);
},
set: function(y, w) {
i && y && (typeof y == "object" || typeof y == "function") ? (v || (v = new i()), s(v, y, w)) : n && (S || (S = n()), S.set(y, w));
}
};
return b;
}
) : n, or;
}
var ar, Dn;
function ki() {
if (Dn) return ar;
Dn = 1;
var e = /* @__PURE__ */ Ie(), t = /* @__PURE__ */ it(), r = yi(), n = So(), o = Ui(), i = o || n || r;
return ar = function() {
var s, p = {
assert: function(l) {
if (!p.has(l))
throw new e("Side channel does not contain " + t(l));
},
delete: function(l) {
return !!s && s.delete(l);
},
get: function(l) {
return s && s.get(l);
},
has: function(l) {
return !!s && s.has(l);
},
set: function(l, c) {
s || (s = i()), s.set(l, c);
}
};
return p;
}, ar;
}
var ir, Ln;
function Er() {
if (Ln) return ir;
Ln = 1;
var e = String.prototype.replace, t = /%20/g, r = {
RFC1738: "RFC1738",
RFC3986: "RFC3986"
};
return ir = {
default: r.RFC3986,
formatters: {
RFC1738: function(n) {
return e.call(n, t, "+");
},
RFC3986: function(n) {
return String(n);
}
},
RFC1738: r.RFC1738,
RFC3986: r.RFC3986
}, ir;
}
var sr, In;
function Eo() {
if (In) return sr;
In = 1;
var e = /* @__PURE__ */ Er(), t = Object.prototype.hasOwnProperty, r = Array.isArray, n = function() {
for (var u = [], m = 0; m < 256; ++m)
u.push("%" + ((m < 16 ? "0" : "") + m.toString(16)).toUpperCase());
return u;
}(), o = function(m) {
for (; m.length > 1; ) {
var g = m.pop(), E = g.obj[g.prop];
if (r(E)) {
for (var O = [], A = 0; A < E.length; ++A)
typeof E[A] < "u" && O.push(E[A]);
g.obj[g.prop] = O;
}
}
}, i = function(m, g) {
for (var E = g && g.plainObjects ? { __proto__: null } : {}, O = 0; O < m.length; ++O)
typeof m[O] < "u" && (E[O] = m[O]);
return E;
}, a = function u(m, g, E) {
if (!g)
return m;
if (typeof g != "object" && typeof g != "function") {
if (r(m))
m.push(g);
else if (m && typeof m == "object")
(E && (E.plainObjects || E.allowPrototypes) || !t.call(Object.prototype, g)) && (m[g] = !0);
else
return [m, g];
return m;
}
if (!m || typeof m != "object")
return [m].concat(g);
var O = m;
return r(m) && !r(g) && (O = i(m, E)), r(m) && r(g) ? (g.forEach(function(A, R) {
if (t.call(m, R)) {
var P = m[R];
P && typeof P == "object" && A && typeof A == "object" ? m[R] = u(P, A, E) : m.push(A);
} else
m[R] = A;
}), m) : Object.keys(g).reduce(function(A, R) {
var P = g[R];
return t.call(A, R) ? A[R] = u(A[R], P, E) : A[R] = P, A;
}, O);
}, s = function(m, g) {
return Object.keys(g).reduce(function(E, O) {
return E[O] = g[O], E;
}, m);
}, p = function(u, m, g) {
var E = u.replace(/\+/g, " ");
if (g === "iso-8859-1")
return E.replace(/%[0-9a-f]{2}/gi, unescape);
try {
return decodeURIComponent(E);
} catch {
return E;
}
}, l = 1024, c = function(m, g, E, O, A) {
if (m.length === 0)
return m;
var R = m;
if (typeof m == "symbol" ? R = Symbol.prototype.toString.call(m) : typeof m != "string" && (R = String(m)), E === "iso-8859-1")
return escape(R).replace(/%u[0-9a-f]{4}/gi, function(W) {
return "%26%23" + parseInt(W.slice(2), 16) + "%3B";
});
for (var P = "", T = 0; T < R.length; T += l) {
for (var q = R.length >= l ? R.slice(T, T + l) : R, F = [], I = 0; I < q.length; ++I) {
var x = q.charCodeAt(I);
if (x === 45 || x === 46 || x === 95 || x === 126 || x >= 48 && x <= 57 || x >= 65 && x <= 90 || x >= 97 && x <= 122 || A === e.RFC1738 && (x === 40 || x === 41)) {
F[F.length] = q.charAt(I);
continue;
}
if (x < 128) {
F[F.length] = n[x];
continue;
}
if (x < 2048) {
F[F.length] = n[192 | x >> 6] + n[128 | x & 63];
continue;
}
if (x < 55296 || x >= 57344) {
F[F.length] = n[224 | x >> 12] + n[128 | x >> 6 & 63] + n[128 | x & 63];
continue;
}
I += 1, x = 65536 + ((x & 1023) << 10 | q.charCodeAt(I) & 1023), F[F.length] = n[240 | x >> 18] + n[128 | x >> 12 & 63] + n[128 | x >> 6 & 63] + n[128 | x & 63];
}
P += F.join("");
}
return P;
}, v = function(m) {
for (var g = [{ obj: { o: m }, prop: "o" }], E = [], O = 0; O < g.length; ++O)
for (var A = g[O], R = A.obj[A.prop], P = Object.keys(R), T = 0; T < P.length; ++T) {
var q = P[T], F = R[q];
typeof F == "object" && F !== null && E.indexOf(F) === -1 && (g.push({ obj: R, prop: q }), E.push(F));
}
return o(g), m;
}, S = function(m) {
return Object.prototype.toString.call(m) === "[object RegExp]";
}, b = function(m) {
return !m || typeof m != "object" ? !1 : !!(m.constructor && m.constructor.isBuffer && m.constructor.isBuffer(m));
}, y = function(m, g) {
return [].concat(m, g);
}, w = function(m, g) {
if (r(m)) {
for (var E = [], O = 0; O < m.length; O += 1)
E.push(g(m[O]));
return E;
}
return g(m);
};
return sr = {
arrayToObject: i,
assign: s,
combine: y,
compact: v,
decode: p,
encode: c,
isBuffer: b,
isRegExp: S,
maybeMap: w,
merge: a
}, sr;
}
var lr, Bn;
function Mi() {
if (Bn) return lr;
Bn = 1;
var e = ki(), t = /* @__PURE__ */ Eo(), r = /* @__PURE__ */ Er(), n = Object.prototype.hasOwnProperty, o = {
brackets: function(u) {
return u + "[]";
},
comma: "comma",
indices: function(u, m) {
return u + "[" + m + "]";
},
repeat: function(u) {
return u;
}
}, i = Array.isArray, a = Array.prototype.push, s = function(w, u) {
a.apply(w, i(u) ? u : [u]);
}, p = Date.prototype.toISOString, l = r.default, c = {
addQueryPrefix: !1,
allowDots: !1,
allowEmptyArrays: !1,
arrayFormat: "indices",
charset: "utf-8",
charsetSentinel: !1,
commaRoundTrip: !1,
delimiter: "&",
encode: !0,
encodeDotInKeys: !1,
encoder: t.encode,
encodeValuesOnly: !1,
filter: void 0,
format: l,
formatter: r.formatters[l],
// deprecated
indices: !1,
serializeDate: function(u) {
return p.call(u);
},
skipNulls: !1,
strictNullHandling: !1
}, v = function(u) {
return typeof u == "string" || typeof u == "number" || typeof u == "boolean" || typeof u == "symbol" || typeof u == "bigint";
}, S = {}, b = function w(u, m, g, E, O, A, R, P, T, q, F, I, x, W, j, Z, fe, pe) {
for (var _ = u, Y = pe, de = 0, Oe = !1; (Y = Y.get(S)) !== void 0 && !Oe; ) {
var he = Y.get(u);
if (de += 1, typeof he < "u") {
if (he === de)
throw new RangeError("Cyclic object value");
Oe = !0;
}
typeof Y.get(S) > "u" && (de = 0);
}
if (typeof q == "function" ? _ = q(m, _) : _ instanceof Date ? _ = x(_) : g === "comma" && i(_) && (_ = t.maybeMap(_, function(ne) {
return ne instanceof Date ? x(ne) : ne;
})), _ === null) {
if (A)
return T && !Z ? T(m, c.encoder, fe, "key", W) : m;
_ = "";
}
if (v(_) || t.isBuffer(_)) {
if (T) {
var me = Z ? m : T(m, c.encoder, fe, "key", W);
return [j(me) + "=" + j(T(_, c.encoder, fe, "value", W))];
}
return [j(m) + "=" + j(String(_))];
}
var ge = [];
if (typeof _ > "u")
return ge;
var ye;
if (g === "comma" && i(_))
Z && T && (_ = t.maybeMap(_, T)), ye = [{ value: _.length > 0 ? _.join(",") || null : void 0 }];
else if (i(q))
ye = q;
else {
var re = Object.keys(_);
ye = F ? re.sort(F) : re;
}
var ve = P ? String(m).replace(/\./g, "%2E") : String(m), be = E && i(_) && _.length === 1 ? ve + "[]" : ve;
if (O && i(_) && _.length === 0)
return be + "[]";
for (var H = 0; H < ye.length; ++H) {
var D = ye[H], M = typeof D == "object" && D && typeof D.value < "u" ? D.value : _[D];
if (!(R && M === null)) {
var B = I && P ? String(D).replace(/\./g, "%2E") : String(D), z = i(_) ? typeof g == "function" ? g(be, B) : be : be + (I ? "." + B : "[" + B + "]");
pe.set(u, de);
var G = e();
G.set(S, pe), s(ge, w(
M,
z,
g,
E,
O,
A,
R,
P,
g === "comma" && Z && i(_) ? null : T,
q,
F,
I,
x,
W,
j,
Z,
fe,
G
));
}
}
return ge;
}, y = function(u) {
if (!u)
return c;
if (typeof u.allowEmptyArrays < "u" && typeof u.allowEmptyArrays != "boolean")
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
if (typeof u.encodeDotInKeys < "u" && typeof u.encodeDotInKeys != "boolean")
throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
if (u.encoder !== null && typeof u.encoder < "u" && typeof u.encoder != "function")
throw new TypeError("Encoder has to be a function.");
var m = u.charset || c.charset;
if (typeof u.charset < "u" && u.charset !== "utf-8" && u.charset !== "iso-8859-1")
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
var g = r.default;
if (typeof u.format < "u") {
if (!n.call(r.formatters, u.format))
throw new TypeError("Unknown format option provided.");
g = u.format;
}
var E = r.formatters[g], O = c.filter;
(typeof u.filter == "function" || i(u.filter)) && (O = u.filter);
var A;
if (u.arrayFormat in o ? A = u.arrayFormat : "indices" in u ? A = u.indices ? "indices" : "repeat" : A = c.arrayFormat, "commaRoundTrip" in u && typeof u.commaRoundTrip != "boolean")
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
var R = typeof u.allowDots > "u" ? u.encodeDotInKeys === !0 ? !0 : c.allowDots : !!u.allowDots;
return {
addQueryPrefix: typeof u.addQueryPrefix == "boolean" ? u.addQueryPrefix : c.addQueryPrefix,
allowDots: R,
allowEmptyArrays: typeof u.allowEmptyArrays == "boolean" ? !!u.allowEmptyArrays : c.allowEmptyArrays,
arrayFormat: A,
charset: m,
charsetSentinel: typeof u.charsetSentinel == "boolean" ? u.charsetSentinel : c.charsetSentinel,
commaRoundTrip: !!u.commaRoundTrip,
delimiter: typeof u.delimiter > "u" ? c.delimiter : u.delimiter,
encode: typeof u.encode == "boolean" ? u.encode : c.encode,
encodeDotInKeys: typeof u.encodeDotInKeys == "boolean" ? u.encodeDotInKeys : c.encodeDotInKeys,
encoder: typeof u.encoder == "function" ? u.encoder : c.encoder,
encodeValuesOnly: typeof u.encodeValuesOnly == "boolean" ? u.encodeValuesOnly : c.encodeValuesOnly,
filter: O,
format: g,
formatter: E,
serializeDate: typeof u.serializeDate == "function" ? u.serializeDate : c.serializeDate,
skipNulls: typeof u.skipNulls == "boolean" ? u.skipNulls : c.skipNulls,
sort: typeof u.sort == "function" ? u.sort : null,
strictNullHandling: typeof u.strictNullHandling == "boolean" ? u.strictNullHandling : c.strictNullHandling
};
};
return lr = function(w, u) {
var m = w, g = y(u), E, O;
typeof g.filter == "function" ? (O = g.filter, m = O("", m)) : i(g.filter) && (O = g.filter, E = O);
var A = [];
if (typeof m != "object" || m === null)
return "";
var R = o[g.arrayFormat], P = R === "comma" && g.commaRoundTrip;
E || (E = Object.keys(m)), g.sort && E.sort(g.sort);
for (var T = e(), q = 0; q < E.length; ++q) {
var F = E[q], I = m[F];
g.skipNulls && I === null || s(A, b(
I,
F,
R,
P,
g.allowEmptyArrays,
g.strictNullHandling,
g.skipNulls,
g.encodeDotInKeys,
g.encode ? g.encoder : null,
g.filter,
g.sort,
g.allowDots,
g.serializeDate,
g.format,
g.formatter,
g.encodeValuesOnly,
g.charset,
T
));
}
var x = A.join(g.delimiter), W = g.addQueryPrefix === !0 ? "?" : "";
return g.charsetSentinel && (g.charset === "iso-8859-1" ? W += "utf8=%26%2310003%3B&" : W += "utf8=%E2%9C%93&"), x.length > 0 ? W + x : "";
}, lr;
}
var ur, $n;
function ji() {
if ($n) return ur;
$n = 1;
var e = /* @__PURE__ */ Eo(), t = Object.prototype.hasOwnProperty, r = Array.isArray, n = {
allowDots: !1,
allowEmptyArrays: !1,
allowPrototypes: !1,
allowSparse: !1,
arrayLimit: 20,
charset: "utf-8",
charsetSentinel: !1,
comma: !1,
decodeDotInKeys: !1,
decoder: e.decode,
delimiter: "&",
depth: 5,
duplicates: "combine",
ignoreQueryPrefix: !1,
interpretNumericEntities: !1,
parameterLimit: 1e3,
parseArrays: !0,
plainObjects: !1,
strictDepth: !1,
strictNullHandling: !1,
throwOnLimitExceeded: !1
}, o = function(S) {
return S.replace(/&#(\d+);/g, function(b, y) {
return String.fromCharCode(parseInt(y, 10));
});
}, i = function(S, b, y) {
if (S && typeof S == "string" && b.comma && S.indexOf(",") > -1)
return S.split(",");
if (b.throwOnLimitExceeded && y >= b.arrayLimit)
throw new RangeError("Array limit exceeded. Only " + b.arrayLimit + " element" + (b.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
return S;
}, a = "utf8=%26%2310003%3B", s = "utf8=%E2%9C%93", p = function(b, y) {
var w = { __proto__: null }, u = y.ignoreQueryPrefix ? b.replace(/^\?/, "") : b;
u = u.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
var m = y.parameterLimit === 1 / 0 ? void 0 : y.parameterLimit, g = u.split(
y.delimiter,
y.throwOnLimitExceeded ? m + 1 : m
);
if (y.throwOnLimitExceeded && g.length > m)
throw new RangeError("Parameter limit exceeded. Only " + m + " parameter" + (m === 1 ? "" : "s") + " allowed.");
var E = -1, O, A = y.charset;
if (y.charsetSentinel)
for (O = 0; O < g.length; ++O)
g[O].indexOf("utf8=") === 0 && (g[O] === s ? A = "utf-8" : g[O] === a && (A = "iso-8859-1"), E = O, O = g.length);
for (O = 0; O < g.length; ++O)
if (O !== E) {
var R = g[O], P = R.indexOf("]="), T = P === -1 ? R.indexOf("=") : P + 1, q, F;
T === -1 ? (q = y.decoder(R, n.decoder, A, "key"), F = y.strictNullHandling ? null : "") : (q = y.decoder(R.slice(0, T), n.decoder, A, "key"), F = e.maybeMap(
i(
R.slice(T + 1),
y,
r(w[q]) ? w[q].length : 0
),
function(x) {
return y.decoder(x, n.decoder, A, "value");
}
)), F && y.interpretNumericEntities && A === "iso-8859-1" && (F = o(String(F))), R.indexOf("[]=") > -1 && (F = r(F) ? [F] : F);
var I = t.call(w, q);
I && y.duplicates === "combine" ? w[q] = e.combine(w[q], F) : (!I || y.duplicates === "last") && (w[q] = F);
}
return w;
}, l = function(S, b, y, w) {
var u = 0;
if (S.length > 0 && S[S.length - 1] === "[]") {
var m = S.slice(0, -1).join("");
u = Array.isArray(b) && b[m] ? b[m].length : 0;
}
for (var g = w ? b : i(b, y, u), E = S.length - 1; E >= 0; --E) {
var O, A = S[E];
if (A === "[]" && y.parseArrays)
O = y.allowEmptyArrays && (g === "" || y.strictNullHandling && g === null) ? [] : e.combine([], g);
else {
O = y.plainObjects ? { __proto__: null } : {};
var R = A.charAt(0) === "[" && A.charAt(A.length - 1) === "]" ? A.slice(1, -1) : A, P = y.decodeDotInKeys ? R.replace(/%2E/g, ".") : R, T = parseInt(P, 10);
!y.parseArrays && P === "" ? O = { 0: g } : !isNaN(T) && A !== P && String(T) === P && T >= 0 && y.parseArrays && T <= y.arrayLimit ? (O = [], O[T] = g) : P !== "__proto__" && (O[P] = g);
}
g = O;
}
return g;
}, c = function(b, y, w, u) {
if (b) {
var m = w.allowDots ? b.replace(/\.([^.[]+)/g, "[$1]") : b, g = /(\[[^[\]]*])/, E = /(\[[^[\]]*])/g, O = w.depth > 0 && g.exec(m), A = O ? m.slice(0, O.index) : m, R = [];
if (A) {
if (!w.plainObjects && t.call(Object.prototype, A) && !w.allowPrototypes)
return;
R.push(A);
}
for (var P = 0; w.depth > 0 && (O = E.exec(m)) !== null && P < w.depth; ) {
if (P += 1, !w.plainObjects && t.call(Object.prototype, O[1].slice(1, -1)) && !w.allowPrototypes)
return;
R.push(O[1]);
}
if (O) {
if (w.strictDepth === !0)
throw new RangeError("Input depth exceeded depth option of " + w.depth + " and strictDepth is true");
R.push("[" + m.slice(O.index) + "]");
}
return l(R, y, w, u);
}
}, v = function(b) {
if (!b)
return n;
if (typeof b.allowEmptyArrays < "u" && typeof b.allowEmptyArrays != "boolean")
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
if (typeof b.decodeDotInKeys < "u" && typeof b.decodeDotInKeys != "boolean")
throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
if (b.decoder !== null && typeof b.decoder < "u" && typeof b.decoder != "function")
throw new TypeError("Decoder has to be a function.");
if (typeof b.charset < "u" && b.charset !== "utf-8" && b.charset !== "iso-8859-1")
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
if (typeof b.throwOnLimitExceeded < "u" && typeof b.throwOnLimitExceeded != "boolean")
throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
var y = typeof b.charset > "u" ? n.charset : b.charset, w = typeof b.duplicates > "u" ? n.duplicates : b.duplicates;
if (w !== "combine" && w !== "first" && w !== "last")
throw new TypeError("The duplicates option must be either combine, first, or last");
var u = typeof b.allowDots > "u" ? b.decodeDotInKeys === !0 ? !0 : n.allowDots : !!b.allowDots;
return {
allowDots: u,
allowEmptyArrays: typeof b.allowEmptyArrays == "boolean" ? !!b.allowEmptyArrays : n.allowEmptyArrays,
allowPrototypes: typeof b.allowPrototypes == "boolean" ? b.allowPrototypes : n.allowPrototypes,
allowSparse: typeof b.allowSparse == "boolean" ? b.allowSparse : n.allowSparse,
arrayLimit: typeof b.arrayLimit == "number" ? b.arrayLimit : n.arrayLimit,
charset: y,
charsetSentinel: typeof b.charsetSentinel == "boolean" ? b.charsetSentinel : n.charsetSentinel,
comma: typeof b.comma == "boolean" ? b.comma : n.comma,
decodeDotInKeys: typeof b.decodeDotInKeys == "boolean" ? b.decodeDotInKeys : n.decodeDotInKeys,
decoder: typeof b.decoder == "function" ? b.decoder : n.decoder,
delimiter: typeof b.delimiter == "string" || e.isRegExp(b.delimiter) ? b.delimiter : n.delimiter,
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
depth: typeof b.depth == "number" || b.depth === !1 ? +b.depth : n.depth,
duplicates: w,
ignoreQueryPrefix: b.ignoreQueryPrefix === !0,
interpretNumericEntities: typeof b.interpretNumericEntities == "boolean" ? b.interpretNumericEntities : n.interpretNumericEntities,
parameterLimit: typeof b.parameterLimit == "number" ? b.parameterLimit : n.parameterLimit,
parseArrays: b.parseArrays !== !1,
plainObjects: typeof b.plainObjects == "boolean" ? b.plainObjects : n.plainObjects,
strictDepth: typeof b.strictDepth == "boolean" ? !!b.strictDepth : n.strictDepth,
strictNullHandling: typeof b.strictNullHandling == "boolean" ? b.strictNullHandling : n.strictNullHandling,
throwOnLimitExceeded: typeof b.throwOnLimitExceeded == "boolean" ? b.throwOnLimitExceeded : !1
};
};
return ur = function(S, b) {
var y = v(b);
if (S === "" || S === null || typeof S > "u")
return y.plainObjects ? { __proto__: null } : {};
for (var w = typeof S == "string" ? p(S, y) : S, u = y.plainObjects ? { __proto__: null } : {}, m = Object.keys(w), g = 0; g < m.length; ++g) {
var E = m[g], O = c(E, w[E], y, typeof S == "string");
u = e.merge(u, O, y);
}
return y.allowSparse === !0 ? u : e.compact(u);
}, ur;
}
var cr, Un;
function zi() {
if (Un) return cr;
Un = 1;
var e = /* @__PURE__ */ Mi(), t = /* @__PURE__ */ ji(), r = /* @__PURE__ */ Er();
return cr = {
formats: r,
parse: t,
stringify: e
}, cr;
}
var Hi = /* @__PURE__ */ zi();
const Oo = /* @__PURE__ */ ui(Hi);
function ps(e, ...t) {
let r = null, n = null, o = "json", i = null;
return t.length && (t.forEach((a, s) => {
s === 0 ? typeof a == "object" ? r = a : typeof a == "string" ? a.toLowerCase() === "blob" ? o = "blob" : a.toLowerCase() === "json" || a.toLowerCase() === "query" || a.toLowerCase() === "file" || a.toLowerCase() === "data" || a.toLowerCase() === "form-data" || a.toLowerCase() === "formdata" ? n = a.toLowerCase() : console.error("ezAxios: 请求参数仅支持 Object、Array、File 类型") : r && console.error("ezAxios: 请求参数仅支持 Object、Array、File 类型") : s < 4 ? a && (Object.prototype.toString.call(a) == "[object Object]" ? i = a : typeof a == "string" ? a.toLowerCase() === "blob" ? o = "blob" : a.toLowerCase() === "json" || a.toLowerCase() === "query" || a.toLowerCase() === "file" || a.toLowerCase() === "data" || a.toLowerCase() === "form-data" || a.toLowerCase() === "formdata" ? n = a.toLowerCase() : console.warn("ezAxios: 存在无法处理的参数类型,这可能会影响您的程序") : console.warn(`ezAxios: 存在无法处理的参数类型 ${a},这可能会影响您的程序`)) : console.warn("ezAxios: 接收到多余参数,已忽略");
}), o != "json" && n == "query" && console.warn("ezAxios: 请参数类型为query时,设置返回值类型无效")), new Promise((a, s) => {
if (n === "query")
le(i).post(e, null, { params: r, signal: i?.signal }).then((p) => {
a(p);
}).catch((p) => {
s(p);
});
else if (n === "file") {
const p = new FormData();
if (r instanceof File)
p.append("file", r);
else
for (const l in r)
if (r[l] instanceof File)
p.append(`${l}`, r[l]);
else if (Object.prototype.toString.call(r[l]) == "[object Array]") {
const c = r[l].filter((v) => v instanceof File);
c.length && c.length <= r[l].length ? (c.forEach((v, S) => {
p.append(`${l}[${S}]`, v);
}), c.length < r[l].length && console.warn(`ezAxios: 数组${l}存在非文件类型对象,已被忽略`)) : p.append(`${l}`, JSON.stringify(r[l]));
} else typeof r[l] == "string" ? p.append(`${l}`, r[l]) : p.append(`${l}`, JSON.stringify(r[l]));
le(i).post(e, p, { responseType: o, signal: i?.signal }).then((l) => {
a(l);
}).catch((l) => {
s(l);
});
} else n === "data" || n === "form-data" || n === "formdata" ? le(i).post(e, Oo.stringify(r), { responseType: o, signal: i?.signal }).then((p) => {
a(p);
}).catch((p) => {
s(p);
}) : le(i).post(e, r, { responseType: o, signal: i?.signal }).then((p) => {
a(p);
}).catch((p) => {
s(p);
});
});
}
function ds(e, ...t) {
let r = null, n = null, o = "json", i = null;
return t.length && (t.forEach((a, s) => {
s === 0 ? typeof a == "object" ? r = a : typeof a == "string" ? a.toLowerCase() === "blob" ? o = "blob" : a.toLowerCase() === "json" || a.toLowerCase() === "query" || a.toLowerCase() === "file" || a.toLowerCase() === "data" || a.toLowerCase() === "form-data" || a.toLowerCase() === "formdata" ? n = a.toLowerCase() : console.error("ezAxios: 请求参数仅支持 Object、Array、File 类型") : r && console.error("ezAxios: 请求参数仅支持 Object、Array、File 类型") : s < 4 ? a && (Object.prototype.toString.call(a) == "[object Object]" ? i = a : typeof a == "string" ? a.toLowerCase() === "blob" ? o = "blob" : a.toLowerCase() === "json" || a.toLowerCase() === "query" || a.toLowerCase() === "file" || a.toLowerCase() === "data" || a.toLowerCase() === "form-data" || a.toLowerCase() === "formdata" ? n = a.toLowerCase() : console.warn("ezAxios: 存在无法处理的参数类型,这可能会影响您的程序") : console.warn("ezAxios: 存在无法处理的参数类型,这可能会影响您的程序")) : console.warn("ezAxios: 接收到多余参数,已忽略");
}), o != "json" && n == "query" && console.warn("ezAxios: 请参数类型为query时,设置返回值类型无效")), new Promise((a, s) => {
if (n === "query")
le(i).put(e, null, { params: r, signal: i?.signal }).then((p) => {
a(p);
}).catch((p) => {
s(p);
});
else if (n === "file") {
const p = new FormData();
if (r instanceof File)
p.append("file", r);
else
for (const l in r)
if (r[l] instanceof File)
p.append(`${l}`, r[l]);
else if (Object.prototype.toString.call(r[l]) == "[object Array]") {
const c = r[l].filter((v) => v instanceof File);
c.length && c.length <= r[l].length ? (c.forEach((v, S) => {
p.append(`${l}[${S}]`, v);
}), c.length < r[l].length && console.warn(`ezAxios: 数组${l}存在非文件类型对象,已被忽略`)) : p.append(`${l}`, JSON.stringify(r[l]));
} else typeof r[l] == "string" ? p.append(`${l}`, r[l]) : p.append(`${l}`, JSON.stringify(r[l]));
le(i).put(e, p, { responseType: o, signal: i?.signal }).then((l) => {
a(l);
}).catch((l) => {
s(l);
});
} else n === "data" || n === "form-data" || n === "formdata" ? le(i).put(e, Oo.stringify(r), { responseType: o, signal: i?.signal }).then((p) => {
a(p);
}).catch((p) => {
s(p);
}) : le(i).put(e, r, { responseType: o, signal: i?.signal }).then((p) => {
a(p);
}).catch((p) => {
s(p);
});
});
}
function ys(e, ...t) {
let r = null, n = null, o = null;
return t.length && t.forEach((i, a) => {
a === 0 ? typeof i == "object" ? r = i : typeof i == "string" ? i.toLowerCase() === "query" || i.toLowerCase() === "json" ? n = i.toLowerCase() : console.error("ezAxios: 请求参数仅支持 Object、Array 类型") : r && console.error("ezAxios: 请求参数仅支持 Object、Array 类型") : a < 3 ? i && (Object.prototype.toString.call(i) == "[object Object]" ? o = i : typeof i == "string" && (i.toLowerCase() === "query" || i.toLowerCase() === "json") ? n = i.toLowerCase() : console.warn("ezAxios: 存在无法处理的参数类型,这可能会影响您的程序")) : console.warn("ezAxios: 接收到多余参数,已忽略");
}), new Promise((i, a) => {
n === "query" ? le(o).delete(e, { params: r, signal: o?.signal }).then((s) => {
i(s);
}).catch((s) => {
a(s);
}) : le(o).delete(e, { data: r, signal: o?.signal }).then((s) => {
i(s);
}).catch((s) => {
a(s);
});
});
}
export {
Gi as AloneSet,
se as Loading,
Wi as default,
ys as del,
fs as get,
ps as post,
ds as put
};