@sumcode/svgify
Version:
A lightweight React component designed to dynamically render and style SVG icons.
1,633 lines • 61.8 kB
JavaScript
"use client";
import xt, { createContext as Pt, useContext as Ct } from "react";
var xe = { exports: {} }, te = {};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ve;
function Nt() {
if (ve) return te;
ve = 1;
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
function n(r, s, o) {
var i = null;
if (o !== void 0 && (i = "" + o), s.key !== void 0 && (i = "" + s.key), "key" in s) {
o = {};
for (var c in s)
c !== "key" && (o[c] = s[c]);
} else o = s;
return s = o.ref, {
$$typeof: e,
type: r,
key: i,
ref: s !== void 0 ? s : null,
props: o
};
}
return te.Fragment = t, te.jsx = n, te.jsxs = n, te;
}
var ne = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Be;
function kt() {
return Be || (Be = 1, process.env.NODE_ENV !== "production" && function() {
function e(l) {
if (l == null) return null;
if (typeof l == "function")
return l.$$typeof === le ? null : l.displayName || l.name || null;
if (typeof l == "string") return l;
switch (l) {
case h:
return "Fragment";
case C:
return "Profiler";
case O:
return "StrictMode";
case B:
return "Suspense";
case N:
return "SuspenseList";
case ce:
return "Activity";
}
if (typeof l == "object")
switch (typeof l.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), l.$$typeof) {
case b:
return "Portal";
case x:
return l.displayName || "Context";
case T:
return (l._context.displayName || "Context") + ".Consumer";
case j:
var y = l.render;
return l = l.displayName, l || (l = y.displayName || y.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
case Z:
return y = l.displayName || null, y !== null ? y : e(l.type) || "Memo";
case I:
y = l._payload, l = l._init;
try {
return e(l(y));
} catch {
}
}
return null;
}
function t(l) {
return "" + l;
}
function n(l) {
try {
t(l);
var y = !1;
} catch {
y = !0;
}
if (y) {
y = console;
var R = y.error, g = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
return R.call(
y,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
g
), t(l);
}
}
function r(l) {
if (l === h) return "<>";
if (typeof l == "object" && l !== null && l.$$typeof === I)
return "<...>";
try {
var y = e(l);
return y ? "<" + y + ">" : "<...>";
} catch {
return "<...>";
}
}
function s() {
var l = M.A;
return l === null ? null : l.getOwner();
}
function o() {
return Error("react-stack-top-frame");
}
function i(l) {
if ($.call(l, "key")) {
var y = Object.getOwnPropertyDescriptor(l, "key").get;
if (y && y.isReactWarning) return !1;
}
return l.key !== void 0;
}
function c(l, y) {
function R() {
U || (U = !0, console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
y
));
}
R.isReactWarning = !0, Object.defineProperty(l, "key", {
get: R,
configurable: !0
});
}
function p() {
var l = e(this.type);
return Q[l] || (Q[l] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), l = this.props.ref, l !== void 0 ? l : null;
}
function f(l, y, R, g, H, ge) {
var _ = R.ref;
return l = {
$$typeof: d,
type: l,
key: y,
props: R,
_owner: g
}, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(l, "ref", {
enumerable: !1,
get: p
}) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(l, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.defineProperty(l, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: H
}), Object.defineProperty(l, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: ge
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
}
function u(l, y, R, g, H, ge) {
var _ = y.children;
if (_ !== void 0)
if (g)
if (q(_)) {
for (g = 0; g < _.length; g++)
m(_[g]);
Object.freeze && Object.freeze(_);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else m(_);
if ($.call(y, "key")) {
_ = e(l);
var Y = Object.keys(y).filter(function(_t) {
return _t !== "key";
});
g = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ue[_ + g] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,
g,
_,
Y,
_
), ue[_ + g] = !0);
}
if (_ = null, R !== void 0 && (n(R), _ = "" + R), i(y) && (n(y.key), _ = "" + y.key), "key" in y) {
R = {};
for (var Se in y)
Se !== "key" && (R[Se] = y[Se]);
} else R = y;
return _ && c(
R,
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
), f(
l,
_,
R,
s(),
H,
ge
);
}
function m(l) {
w(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === I && (l._payload.status === "fulfilled" ? w(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
}
function w(l) {
return typeof l == "object" && l !== null && l.$$typeof === d;
}
var S = xt, d = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), x = Symbol.for("react.context"), j = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), N = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), ce = Symbol.for("react.activity"), le = Symbol.for("react.client.reference"), M = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, q = Array.isArray, V = console.createTask ? console.createTask : function() {
return null;
};
S = {
react_stack_bottom_frame: function(l) {
return l();
}
};
var U, Q = {}, L = S.react_stack_bottom_frame.bind(
S,
o
)(), ee = V(r(o)), ue = {};
ne.Fragment = h, ne.jsx = function(l, y, R) {
var g = 1e4 > M.recentlyCreatedOwnerStacks++;
return u(
l,
y,
R,
!1,
g ? Error("react-stack-top-frame") : L,
g ? V(r(l)) : ee
);
}, ne.jsxs = function(l, y, R) {
var g = 1e4 > M.recentlyCreatedOwnerStacks++;
return u(
l,
y,
R,
!0,
g ? Error("react-stack-top-frame") : L,
g ? V(r(l)) : ee
);
};
}()), ne;
}
process.env.NODE_ENV === "production" ? xe.exports = Nt() : xe.exports = kt();
var Ft = xe.exports;
function nt(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: jt } = Object.prototype, { getPrototypeOf: Fe } = Object, { iterator: be, toStringTag: rt } = Symbol, ye = /* @__PURE__ */ ((e) => (t) => {
const n = jt.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), D = (e) => (e = e.toLowerCase(), (t) => ye(t) === e), Ee = (e) => (t) => typeof t === e, { isArray: X } = Array, K = Ee("undefined");
function se(e) {
return e !== null && !K(e) && e.constructor !== null && !K(e.constructor) && k(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const st = D("ArrayBuffer");
function Ut(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && st(e.buffer), t;
}
const Lt = Ee("string"), k = Ee("function"), ot = Ee("number"), oe = (e) => e !== null && typeof e == "object", Dt = (e) => e === !0 || e === !1, de = (e) => {
if (ye(e) !== "object")
return !1;
const t = Fe(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(rt in e) && !(be in e);
}, vt = (e) => {
if (!oe(e) || se(e))
return !1;
try {
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
} catch {
return !1;
}
}, Bt = D("Date"), qt = D("File"), It = D("Blob"), Mt = D("FileList"), $t = (e) => oe(e) && k(e.pipe), Ht = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || k(e.append) && ((t = ye(e)) === "formdata" || // detect form-data instance
t === "object" && k(e.toString) && e.toString() === "[object FormData]"));
}, zt = D("URLSearchParams"), [Jt, Wt, Vt, Yt] = ["ReadableStream", "Request", "Response", "Headers"].map(D), Kt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function ie(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, s;
if (typeof e != "object" && (e = [e]), X(e))
for (r = 0, s = e.length; r < s; r++)
t.call(null, e[r], r, e);
else {
if (se(e))
return;
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
let c;
for (r = 0; r < i; r++)
c = o[r], t.call(null, e[c], c, e);
}
}
function it(e, t) {
if (se(e))
return null;
t = t.toLowerCase();
const n = Object.keys(e);
let r = n.length, s;
for (; r-- > 0; )
if (s = n[r], t === s.toLowerCase())
return s;
return null;
}
const z = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, at = (e) => !K(e) && e !== z;
function Pe() {
const { caseless: e, skipUndefined: t } = at(this) && this || {}, n = {}, r = (s, o) => {
const i = e && it(n, o) || o;
de(n[i]) && de(s) ? n[i] = Pe(n[i], s) : de(s) ? n[i] = Pe({}, s) : X(s) ? n[i] = s.slice() : (!t || !K(s)) && (n[i] = s);
};
for (let s = 0, o = arguments.length; s < o; s++)
arguments[s] && ie(arguments[s], r);
return n;
}
const Xt = (e, t, n, { allOwnKeys: r } = {}) => (ie(t, (s, o) => {
n && k(s) ? e[o] = nt(s, n) : e[o] = s;
}, { allOwnKeys: r }), e), Gt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Zt = (e, t, n, r) => {
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), n && Object.assign(e.prototype, n);
}, Qt = (e, t, n, r) => {
let s, o, i;
const c = {};
if (t = t || {}, e == null) return t;
do {
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
i = s[o], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
e = n !== !1 && Fe(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, en = (e, t, n) => {
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
const r = e.indexOf(t, n);
return r !== -1 && r === n;
}, tn = (e) => {
if (!e) return null;
if (X(e)) return e;
let t = e.length;
if (!ot(t)) return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, nn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Fe(Uint8Array)), rn = (e, t) => {
const r = (e && e[be]).call(e);
let s;
for (; (s = r.next()) && !s.done; ) {
const o = s.value;
t.call(e, o[0], o[1]);
}
}, sn = (e, t) => {
let n;
const r = [];
for (; (n = e.exec(t)) !== null; )
r.push(n);
return r;
}, on = D("HTMLFormElement"), an = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, r, s) {
return r.toUpperCase() + s;
}
), qe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), cn = D("RegExp"), ct = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
ie(n, (s, o) => {
let i;
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
}), Object.defineProperties(e, r);
}, ln = (e) => {
ct(e, (t, n) => {
if (k(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const r = e[n];
if (k(r)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + n + "'");
});
}
});
}, un = (e, t) => {
const n = {}, r = (s) => {
s.forEach((o) => {
n[o] = !0;
});
};
return X(e) ? r(e) : r(String(e).split(t)), n;
}, fn = () => {
}, dn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function pn(e) {
return !!(e && k(e.append) && e[rt] === "FormData" && e[be]);
}
const hn = (e) => {
const t = new Array(10), n = (r, s) => {
if (oe(r)) {
if (t.indexOf(r) >= 0)
return;
if (se(r))
return r;
if (!("toJSON" in r)) {
t[s] = r;
const o = X(r) ? [] : {};
return ie(r, (i, c) => {
const p = n(i, s + 1);
!K(p) && (o[c] = p);
}), t[s] = void 0, o;
}
}
return r;
};
return n(e, 0);
}, mn = D("AsyncFunction"), bn = (e) => e && (oe(e) || k(e)) && k(e.then) && k(e.catch), lt = ((e, t) => e ? setImmediate : t ? ((n, r) => (z.addEventListener("message", ({ source: s, data: o }) => {
s === z && o === n && r.length && r.shift()();
}, !1), (s) => {
r.push(s), z.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
k(z.postMessage)
), yn = typeof queueMicrotask < "u" ? queueMicrotask.bind(z) : typeof process < "u" && process.nextTick || lt, En = (e) => e != null && k(e[be]), a = {
isArray: X,
isArrayBuffer: st,
isBuffer: se,
isFormData: Ht,
isArrayBufferView: Ut,
isString: Lt,
isNumber: ot,
isBoolean: Dt,
isObject: oe,
isPlainObject: de,
isEmptyObject: vt,
isReadableStream: Jt,
isRequest: Wt,
isResponse: Vt,
isHeaders: Yt,
isUndefined: K,
isDate: Bt,
isFile: qt,
isBlob: It,
isRegExp: cn,
isFunction: k,
isStream: $t,
isURLSearchParams: zt,
isTypedArray: nn,
isFileList: Mt,
forEach: ie,
merge: Pe,
extend: Xt,
trim: Kt,
stripBOM: Gt,
inherits: Zt,
toFlatObject: Qt,
kindOf: ye,
kindOfTest: D,
endsWith: en,
toArray: tn,
forEachEntry: rn,
matchAll: sn,
isHTMLForm: on,
hasOwnProperty: qe,
hasOwnProp: qe,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: ct,
freezeMethods: ln,
toObjectSet: un,
toCamelCase: an,
noop: fn,
toFiniteNumber: dn,
findKey: it,
global: z,
isContextDefined: at,
isSpecCompliantForm: pn,
toJSONObject: hn,
isAsyncFn: mn,
isThenable: bn,
setImmediate: lt,
asap: yn,
isIterable: En
};
function E(e, t, n, r, s) {
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), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
}
a.inherits(E, 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: a.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const ut = E.prototype, ft = {};
[
"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) => {
ft[e] = { value: e };
});
Object.defineProperties(E, ft);
Object.defineProperty(ut, "isAxiosError", { value: !0 });
E.from = (e, t, n, r, s, o) => {
const i = Object.create(ut);
a.toFlatObject(e, i, function(u) {
return u !== Error.prototype;
}, (f) => f !== "isAxiosError");
const c = e && e.message ? e.message : "Error", p = t == null && e ? e.code : t;
return E.call(i, c, p, n, r, s), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", o && Object.assign(i, o), i;
};
const wn = null;
function Ce(e) {
return a.isPlainObject(e) || a.isArray(e);
}
function dt(e) {
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Ie(e, t, n) {
return e ? e.concat(t).map(function(s, o) {
return s = dt(s), !n && o ? "[" + s + "]" : s;
}).join(n ? "." : "") : t;
}
function Rn(e) {
return a.isArray(e) && !e.some(Ce);
}
const gn = a.toFlatObject(a, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function we(e, t, n) {
if (!a.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = a.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(b, h) {
return !a.isUndefined(h[b]);
});
const r = n.metaTokens, s = n.visitor || u, o = n.dots, i = n.indexes, p = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
if (!a.isFunction(s))
throw new TypeError("visitor must be a function");
function f(d) {
if (d === null) return "";
if (a.isDate(d))
return d.toISOString();
if (a.isBoolean(d))
return d.toString();
if (!p && a.isBlob(d))
throw new E("Blob is not supported. Use a Buffer instead.");
return a.isArrayBuffer(d) || a.isTypedArray(d) ? p && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
}
function u(d, b, h) {
let O = d;
if (d && !h && typeof d == "object") {
if (a.endsWith(b, "{}"))
b = r ? b : b.slice(0, -2), d = JSON.stringify(d);
else if (a.isArray(d) && Rn(d) || (a.isFileList(d) || a.endsWith(b, "[]")) && (O = a.toArray(d)))
return b = dt(b), O.forEach(function(T, x) {
!(a.isUndefined(T) || T === null) && t.append(
// eslint-disable-next-line no-nested-ternary
i === !0 ? Ie([b], x, o) : i === null ? b : b + "[]",
f(T)
);
}), !1;
}
return Ce(d) ? !0 : (t.append(Ie(h, b, o), f(d)), !1);
}
const m = [], w = Object.assign(gn, {
defaultVisitor: u,
convertValue: f,
isVisitable: Ce
});
function S(d, b) {
if (!a.isUndefined(d)) {
if (m.indexOf(d) !== -1)
throw Error("Circular reference detected in " + b.join("."));
m.push(d), a.forEach(d, function(O, C) {
(!(a.isUndefined(O) || O === null) && s.call(
t,
O,
a.isString(C) ? C.trim() : C,
b,
w
)) === !0 && S(O, b ? b.concat(C) : [C]);
}), m.pop();
}
}
if (!a.isObject(e))
throw new TypeError("data must be an object");
return S(e), t;
}
function Me(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
return t[r];
});
}
function je(e, t) {
this._pairs = [], e && we(e, this, t);
}
const pt = je.prototype;
pt.append = function(t, n) {
this._pairs.push([t, n]);
};
pt.toString = function(t) {
const n = t ? function(r) {
return t.call(this, r, Me);
} : Me;
return this._pairs.map(function(s) {
return n(s[0]) + "=" + n(s[1]);
}, "").join("&");
};
function Sn(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
}
function ht(e, t, n) {
if (!t)
return e;
const r = n && n.encode || Sn;
a.isFunction(n) && (n = {
serialize: n
});
const s = n && n.serialize;
let o;
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new je(t, n).toString(r), o) {
const i = e.indexOf("#");
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
}
return e;
}
class $e {
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, n, r) {
return this.handlers.push({
fulfilled: t,
rejected: n,
synchronous: r ? r.synchronous : !1,
runWhen: r ? r.runWhen : null
}), this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {void}
*/
eject(t) {
this.handlers[t] && (this.handlers[t] = null);
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
this.handlers && (this.handlers = []);
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(t) {
a.forEach(this.handlers, function(r) {
r !== null && t(r);
});
}
}
const mt = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, On = typeof URLSearchParams < "u" ? URLSearchParams : je, Tn = typeof FormData < "u" ? FormData : null, An = typeof Blob < "u" ? Blob : null, _n = {
isBrowser: !0,
classes: {
URLSearchParams: On,
FormData: Tn,
Blob: An
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, Ue = typeof window < "u" && typeof document < "u", Ne = typeof navigator == "object" && navigator || void 0, xn = Ue && (!Ne || ["ReactNative", "NativeScript", "NS"].indexOf(Ne.product) < 0), Pn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Cn = Ue && window.location.href || "http://localhost", Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: Ue,
hasStandardBrowserEnv: xn,
hasStandardBrowserWebWorkerEnv: Pn,
navigator: Ne,
origin: Cn
}, Symbol.toStringTag, { value: "Module" })), P = {
...Nn,
..._n
};
function kn(e, t) {
return we(e, new P.classes.URLSearchParams(), {
visitor: function(n, r, s, o) {
return P.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
},
...t
});
}
function Fn(e) {
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function jn(e) {
const t = {}, n = Object.keys(e);
let r;
const s = n.length;
let o;
for (r = 0; r < s; r++)
o = n[r], t[o] = e[o];
return t;
}
function bt(e) {
function t(n, r, s, o) {
let i = n[o++];
if (i === "__proto__") return !0;
const c = Number.isFinite(+i), p = o >= n.length;
return i = !i && a.isArray(s) ? s.length : i, p ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = jn(s[i])), !c);
}
if (a.isFormData(e) && a.isFunction(e.entries)) {
const n = {};
return a.forEachEntry(e, (r, s) => {
t(Fn(r), s, n, 0);
}), n;
}
return null;
}
function Un(e, t, n) {
if (a.isString(e))
try {
return (t || JSON.parse)(e), a.trim(e);
} catch (r) {
if (r.name !== "SyntaxError")
throw r;
}
return (0, JSON.stringify)(e);
}
const ae = {
transitional: mt,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, n) {
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
return s ? JSON.stringify(bt(t)) : t;
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
return t;
if (a.isArrayBufferView(t))
return t.buffer;
if (a.isURLSearchParams(t))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let c;
if (o) {
if (r.indexOf("application/x-www-form-urlencoded") > -1)
return kn(t, this.formSerializer).toString();
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
const p = this.env && this.env.FormData;
return we(
c ? { "files[]": t } : t,
p && new p(),
this.formSerializer
);
}
}
return o || s ? (n.setContentType("application/json", !1), Un(t)) : t;
}],
transformResponse: [function(t) {
const n = this.transitional || ae.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
if (a.isResponse(t) || a.isReadableStream(t))
return t;
if (t && a.isString(t) && (r && !this.responseType || s)) {
const i = !(n && n.silentJSONParsing) && s;
try {
return JSON.parse(t, this.parseReviver);
} catch (c) {
if (i)
throw c.name === "SyntaxError" ? E.from(c, E.ERR_BAD_RESPONSE, this, null, this.response) : c;
}
}
return t;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: P.classes.FormData,
Blob: P.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
ae.headers[e] = {};
});
const Ln = a.toObjectSet([
"age",
"authorization",
"content-length",
"content-type",
"etag",
"expires",
"from",
"host",
"if-modified-since",
"if-unmodified-since",
"last-modified",
"location",
"max-forwards",
"proxy-authorization",
"referer",
"retry-after",
"user-agent"
]), Dn = (e) => {
const t = {};
let n, r, s;
return e && e.split(`
`).forEach(function(i) {
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Ln[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, He = Symbol("internals");
function re(e) {
return e && String(e).trim().toLowerCase();
}
function pe(e) {
return e === !1 || e == null ? e : a.isArray(e) ? e.map(pe) : String(e);
}
function vn(e) {
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let r;
for (; r = n.exec(e); )
t[r[1]] = r[2];
return t;
}
const Bn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function Oe(e, t, n, r, s) {
if (a.isFunction(r))
return r.call(this, t, n);
if (s && (t = n), !!a.isString(t)) {
if (a.isString(r))
return t.indexOf(r) !== -1;
if (a.isRegExp(r))
return r.test(t);
}
}
function qn(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function In(e, t) {
const n = a.toCamelCase(" " + t);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(e, r + n, {
value: function(s, o, i) {
return this[r].call(this, t, s, o, i);
},
configurable: !0
});
});
}
class F {
constructor(t) {
t && this.set(t);
}
set(t, n, r) {
const s = this;
function o(c, p, f) {
const u = re(p);
if (!u)
throw new Error("header name must be a non-empty string");
const m = a.findKey(s, u);
(!m || s[m] === void 0 || f === !0 || f === void 0 && s[m] !== !1) && (s[m || p] = pe(c));
}
const i = (c, p) => a.forEach(c, (f, u) => o(f, u, p));
if (a.isPlainObject(t) || t instanceof this.constructor)
i(t, n);
else if (a.isString(t) && (t = t.trim()) && !Bn(t))
i(Dn(t), n);
else if (a.isObject(t) && a.isIterable(t)) {
let c = {}, p, f;
for (const u of t) {
if (!a.isArray(u))
throw TypeError("Object iterator must return a key-value pair");
c[f = u[0]] = (p = c[f]) ? a.isArray(p) ? [...p, u[1]] : [p, u[1]] : u[1];
}
i(c, n);
} else
t != null && o(n, t, r);
return this;
}
get(t, n) {
if (t = re(t), t) {
const r = a.findKey(this, t);
if (r) {
const s = this[r];
if (!n)
return s;
if (n === !0)
return vn(s);
if (a.isFunction(n))
return n.call(this, s, r);
if (a.isRegExp(n))
return n.exec(s);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, n) {
if (t = re(t), t) {
const r = a.findKey(this, t);
return !!(r && this[r] !== void 0 && (!n || Oe(this, this[r], r, n)));
}
return !1;
}
delete(t, n) {
const r = this;
let s = !1;
function o(i) {
if (i = re(i), i) {
const c = a.findKey(r, i);
c && (!n || Oe(r, r[c], c, n)) && (delete r[c], s = !0);
}
}
return a.isArray(t) ? t.forEach(o) : o(t), s;
}
clear(t) {
const n = Object.keys(this);
let r = n.length, s = !1;
for (; r--; ) {
const o = n[r];
(!t || Oe(this, this[o], o, t, !0)) && (delete this[o], s = !0);
}
return s;
}
normalize(t) {
const n = this, r = {};
return a.forEach(this, (s, o) => {
const i = a.findKey(r, o);
if (i) {
n[i] = pe(s), delete n[o];
return;
}
const c = t ? qn(o) : String(o).trim();
c !== o && delete n[o], n[c] = pe(s), r[c] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const n = /* @__PURE__ */ Object.create(null);
return a.forEach(this, (r, s) => {
r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
}), n;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
`);
}
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(t) {
return t instanceof this ? t : new this(t);
}
static concat(t, ...n) {
const r = new this(t);
return n.forEach((s) => r.set(s)), r;
}
static accessor(t) {
const r = (this[He] = this[He] = {
accessors: {}
}).accessors, s = this.prototype;
function o(i) {
const c = re(i);
r[c] || (In(s, i), r[c] = !0);
}
return a.isArray(t) ? t.forEach(o) : o(t), this;
}
}
F.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
a.reduceDescriptors(F.prototype, ({ value: e }, t) => {
let n = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(r) {
this[n] = r;
}
};
});
a.freezeMethods(F);
function Te(e, t) {
const n = this || ae, r = t || n, s = F.from(r.headers);
let o = r.data;
return a.forEach(e, function(c) {
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
}), s.normalize(), o;
}
function yt(e) {
return !!(e && e.__CANCEL__);
}
function G(e, t, n) {
E.call(this, e ?? "canceled", E.ERR_CANCELED, t, n), this.name = "CanceledError";
}
a.inherits(G, E, {
__CANCEL__: !0
});
function Et(e, t, n) {
const r = n.config.validateStatus;
!n.status || !r || r(n.status) ? e(n) : t(new E(
"Request failed with status code " + n.status,
[E.ERR_BAD_REQUEST, E.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
n.config,
n.request,
n
));
}
function Mn(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function $n(e, t) {
e = e || 10;
const n = new Array(e), r = new Array(e);
let s = 0, o = 0, i;
return t = t !== void 0 ? t : 1e3, function(p) {
const f = Date.now(), u = r[o];
i || (i = f), n[s] = p, r[s] = f;
let m = o, w = 0;
for (; m !== s; )
w += n[m++], m = m % e;
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), f - i < t)
return;
const S = u && f - u;
return S ? Math.round(w * 1e3 / S) : void 0;
};
}
function Hn(e, t) {
let n = 0, r = 1e3 / t, s, o;
const i = (f, u = Date.now()) => {
n = u, s = null, o && (clearTimeout(o), o = null), e(...f);
};
return [(...f) => {
const u = Date.now(), m = u - n;
m >= r ? i(f, u) : (s = f, o || (o = setTimeout(() => {
o = null, i(s);
}, r - m)));
}, () => s && i(s)];
}
const me = (e, t, n = 3) => {
let r = 0;
const s = $n(50, 250);
return Hn((o) => {
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, p = i - r, f = s(p), u = i <= c;
r = i;
const m = {
loaded: i,
total: c,
progress: c ? i / c : void 0,
bytes: p,
rate: f || void 0,
estimated: f && c && u ? (c - i) / f : void 0,
event: o,
lengthComputable: c != null,
[t ? "download" : "upload"]: !0
};
e(m);
}, n);
}, ze = (e, t) => {
const n = e != null;
return [(r) => t[0]({
lengthComputable: n,
total: e,
loaded: r
}), t[1]];
}, Je = (e) => (...t) => a.asap(() => e(...t)), zn = P.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, P.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
new URL(P.origin),
P.navigator && /(msie|trident)/i.test(P.navigator.userAgent)
) : () => !0, Jn = P.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, n, r, s, o, i) {
if (typeof document > "u") return;
const c = [`${e}=${encodeURIComponent(t)}`];
a.isNumber(n) && c.push(`expires=${new Date(n).toUTCString()}`), a.isString(r) && c.push(`path=${r}`), a.isString(s) && c.push(`domain=${s}`), o === !0 && c.push("secure"), a.isString(i) && c.push(`SameSite=${i}`), document.cookie = c.join("; ");
},
read(e) {
if (typeof document > "u") return null;
const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
return t ? decodeURIComponent(t[1]) : null;
},
remove(e) {
this.write(e, "", Date.now() - 864e5, "/");
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function Wn(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function Vn(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function wt(e, t, n) {
let r = !Wn(t);
return e && (r || n == !1) ? Vn(e, t) : t;
}
const We = (e) => e instanceof F ? { ...e } : e;
function W(e, t) {
t = t || {};
const n = {};
function r(f, u, m, w) {
return a.isPlainObject(f) && a.isPlainObject(u) ? a.merge.call({ caseless: w }, f, u) : a.isPlainObject(u) ? a.merge({}, u) : a.isArray(u) ? u.slice() : u;
}
function s(f, u, m, w) {
if (a.isUndefined(u)) {
if (!a.isUndefined(f))
return r(void 0, f, m, w);
} else return r(f, u, m, w);
}
function o(f, u) {
if (!a.isUndefined(u))
return r(void 0, u);
}
function i(f, u) {
if (a.isUndefined(u)) {
if (!a.isUndefined(f))
return r(void 0, f);
} else return r(void 0, u);
}
function c(f, u, m) {
if (m in t)
return r(f, u);
if (m in e)
return r(void 0, f);
}
const p = {
url: o,
method: o,
data: o,
baseURL: i,
transformRequest: i,
transformResponse: i,
paramsSerializer: i,
timeout: i,
timeoutMessage: i,
withCredentials: i,
withXSRFToken: i,
adapter: i,
responseType: i,
xsrfCookieName: i,
xsrfHeaderName: i,
onUploadProgress: i,
onDownloadProgress: i,
decompress: i,
maxContentLength: i,
maxBodyLength: i,
beforeRedirect: i,
transport: i,
httpAgent: i,
httpsAgent: i,
cancelToken: i,
socketPath: i,
responseEncoding: i,
validateStatus: c,
headers: (f, u, m) => s(We(f), We(u), m, !0)
};
return a.forEach(Object.keys({ ...e, ...t }), function(u) {
const m = p[u] || s, w = m(e[u], t[u], u);
a.isUndefined(w) && m !== c || (n[u] = w);
}), n;
}
const Rt = (e) => {
const t = W({}, e);
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
if (t.headers = i = F.from(i), t.url = ht(wt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
"Authorization",
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
), a.isFormData(n)) {
if (P.hasStandardBrowserEnv || P.hasStandardBrowserWebWorkerEnv)
i.setContentType(void 0);
else if (a.isFunction(n.getHeaders)) {
const p = n.getHeaders(), f = ["content-type", "content-length"];
Object.entries(p).forEach(([u, m]) => {
f.includes(u.toLowerCase()) && i.set(u, m);
});
}
}
if (P.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && zn(t.url))) {
const p = s && o && Jn.read(o);
p && i.set(s, p);
}
return t;
}, Yn = typeof XMLHttpRequest < "u", Kn = Yn && function(e) {
return new Promise(function(n, r) {
const s = Rt(e);
let o = s.data;
const i = F.from(s.headers).normalize();
let { responseType: c, onUploadProgress: p, onDownloadProgress: f } = s, u, m, w, S, d;
function b() {
S && S(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
}
let h = new XMLHttpRequest();
h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
function O() {
if (!h)
return;
const T = F.from(
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
), j = {
data: !c || c === "text" || c === "json" ? h.responseText : h.response,
status: h.status,
statusText: h.statusText,
headers: T,
config: e,
request: h
};
Et(function(N) {
n(N), b();
}, function(N) {
r(N), b();
}, j), h = null;
}
"onloadend" in h ? h.onloadend = O : h.onreadystatechange = function() {
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(O);
}, h.onabort = function() {
h && (r(new E("Request aborted", E.ECONNABORTED, e, h)), h = null);
}, h.onerror = function(x) {
const j = x && x.message ? x.message : "Network Error", B = new E(j, E.ERR_NETWORK, e, h);
B.event = x || null, r(B), h = null;
}, h.ontimeout = function() {
let x = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
const j = s.transitional || mt;
s.timeoutErrorMessage && (x = s.timeoutErrorMessage), r(new E(
x,
j.clarifyTimeoutError ? E.ETIMEDOUT : E.ECONNABORTED,
e,
h
)), h = null;
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(x, j) {
h.setRequestHeader(j, x);
}), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), f && ([w, d] = me(f, !0), h.addEventListener("progress", w)), p && h.upload && ([m, S] = me(p), h.upload.addEventListener("progress", m), h.upload.addEventListener("loadend", S)), (s.cancelToken || s.signal) && (u = (T) => {
h && (r(!T || T.type ? new G(null, e, h) : T), h.abort(), h = null);
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
const C = Mn(s.url);
if (C && P.protocols.indexOf(C) === -1) {
r(new E("Unsupported protocol " + C + ":", E.ERR_BAD_REQUEST, e));
return;
}
h.send(o || null);
});
}, Xn = (e, t) => {
const { length: n } = e = e ? e.filter(Boolean) : [];
if (t || n) {
let r = new AbortController(), s;
const o = function(f) {
if (!s) {
s = !0, c();
const u = f instanceof Error ? f : this.reason;
r.abort(u instanceof E ? u : new G(u instanceof Error ? u.message : u));
}
};
let i = t && setTimeout(() => {
i = null, o(new E(`timeout ${t} of ms exceeded`, E.ETIMEDOUT));
}, t);
const c = () => {
e && (i && clearTimeout(i), i = null, e.forEach((f) => {
f.unsubscribe ? f.unsubscribe(o) : f.removeEventListener("abort", o);
}), e = null);
};
e.forEach((f) => f.addEventListener("abort", o));
const { signal: p } = r;
return p.unsubscribe = () => a.asap(c), p;
}
}, Gn = function* (e, t) {
let n = e.byteLength;
if (n < t) {
yield e;
return;
}
let r = 0, s;
for (; r < n; )
s = r + t, yield e.slice(r, s), r = s;
}, Zn = async function* (e, t) {
for await (const n of Qn(e))
yield* Gn(n, t);
}, Qn = async function* (e) {
if (e[Symbol.asyncIterator]) {
yield* e;
return;
}
const t = e.getReader();
try {
for (; ; ) {
const { done: n, value: r } = await t.read();
if (n)
break;
yield r;
}
} finally {
await t.cancel();
}
}, Ve = (e, t, n, r) => {
const s = Zn(e, t);
let o = 0, i, c = (p) => {
i || (i = !0, r && r(p));
};
return new ReadableStream({
async pull(p) {
try {
const { done: f, value: u } = await s.next();
if (f) {
c(), p.close();
return;
}
let m = u.byteLength;
if (n) {
let w = o += m;
n(w);
}
p.enqueue(new Uint8Array(u));
} catch (f) {
throw c(f), f;
}
},
cancel(p) {
return c(p), s.return();
}
}, {
highWaterMark: 2
});
}, Ye = 64 * 1024, { isFunction: fe } = a, er = (({ Request: e, Response: t }) => ({
Request: e,
Response: t
}))(a.global), {
ReadableStream: Ke,
TextEncoder: Xe
} = a.global, Ge = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, tr = (e) => {
e = a.merge.call({
skipUndefined: !0
}, er, e);
const { fetch: t, Request: n, Response: r } = e, s = t ? fe(t) : typeof fetch == "function", o = fe(n), i = fe(r);
if (!s)
return !1;
const c = s && fe(Ke), p = s && (typeof Xe == "function" ? /* @__PURE__ */ ((d) => (b) => d.encode(b))(new Xe()) : async (d) => new Uint8Array(await new n(d).arrayBuffer())), f = o && c && Ge(() => {
let d = !1;
const b = new n(P.origin, {
body: new Ke(),
method: "POST",
get duplex() {
return d = !0, "half";
}
}).headers.has("Content-Type");
return d && !b;
}), u = i && c && Ge(() => a.isReadableStream(new r("").body)), m = {
stream: u && ((d) => d.body)
};
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
!m[d] && (m[d] = (b, h) => {
let O = b && b[d];
if (O)
return O.call(b);
throw new E(`Response type '${d}' is not supported`, E.ERR_NOT_SUPPORT, h);
});
});
const w = async (d) => {
if (d == null)
return 0;
if (a.isBlob(d))
return d.size;
if (a.isSpecCompliantForm(d))
return (await new n(P.origin, {
method: "POST",
body: d
}).arrayBuffer()).byteLength;
if (a.isArrayBufferView(d) || a.isArrayBuffer(d))
return d.byteLength;
if (a.isURLSearchParams(d) && (d = d + ""), a.isString(d))
return (await p(d)).byteLength;
}, S = async (d, b) => {
const h = a.toFiniteNumber(d.getContentLength());
return h ?? w(b);
};
return async (d) => {
let {
url: b,
method: h,
data: O,
signal: C,
cancelToken: T,
timeout: x,
onDownloadProgress: j,
onUploadProgress: B,
responseType: N,
headers: Z,
withCredentials: I = "same-origin",
fetchOptions: ce
} = Rt(d), le = t || fetch;
N = N ? (N + "").toLowerCase() : "text";
let M = Xn([C, T && T.toAbortSignal()], x), $ = null;
const q = M && M.unsubscribe && (() => {
M.unsubscribe();
});
let V;
try {
if (B && f && h !== "get" && h !== "head" && (V = await S(Z, O)) !== 0) {
let l = new n(b, {
method: "POST",
body: O,
duplex: "half"
}), y;
if (a.isFormData(O) && (y = l.headers.get("content-type")) && Z.setContentType(y), l.body) {
const [R, g] = ze(
V,
me(Je(B))
);
O = Ve(l.body, Ye, R, g);
}
}
a.isString(I) || (I = I ? "include" : "omit");
const U = o && "credentials" in n.prototype, Q = {
...ce,
signal: M,
method: h.toUpperCase(),
headers: Z.normalize().toJSON(),
body: O,
duplex: "half",
credentials: U ? I : void 0
};
$ = o && new n(b, Q);
let L = await (o ? le($, ce) : le(b, Q));
const ee = u && (N === "stream" || N === "response");
if (u && (j || ee && q)) {
const l = {};
["status", "statusText", "headers"].forEach((H) => {
l[H] = L[H];
});
const y = a.toFiniteNumber(L.headers.get("content-length")), [R, g] = j && ze(
y,
me(Je(j), !0)
) || [];
L = new r(
Ve(L.body, Ye, R, () => {
g && g(), q && q();
}),
l
);
}
N = N || "text";
let ue = await m[a.findKey(m, N) || "text"](L, d);
return !ee && q && q(), await new Promise((l, y) => {
Et(l, y, {
data: ue,
headers: F.from(L.headers),
status: L.status,
statusText: L.statusText,
config: d,
request: $
});
});
} catch (U) {
throw q && q(), U && U.name === "TypeError" && /Load failed|fetch/i.test(U.message) ? Object.assign(
new E("Network Error", E.ERR_NETWORK, d, $),
{
cause: U.cause || U
}
) : E.from(U, U && U.code, d, $);
}
};
}, nr = /* @__PURE__ */ new Map(), gt = (e) => {
let t = e && e.env || {};
const { fetch: n, Request: r, Response: s } = t, o = [
r,
s,
n
];
let i = o.length, c = i, p, f, u = nr;
for (; c--; )
p = o[c], f = u.get(p), f === void 0 && u.set(p, f = c ? /* @__PURE__ */ new Map() : tr(t)), u = f;
return f;
};
gt();
const Le = {
http: wn,
xhr: Kn,
fetch: {
get: gt
}
};
a.forEach(Le, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const Ze = (e) => `- ${e}`, rr = (e) => a.isFunction(e) || e === null || e === !1;
function sr(e, t) {
e = a.isArray(e) ? e : [e];
const { length: n } = e;
let r, s;
const o = {};
for (let i = 0; i < n; i++) {
r = e[i];
let c;
if (s = r, !rr(r) && (s = Le[(c = String(r)).toLowerCase()], s === void 0))
throw new E(`Unknown adapter '${c}'`);
if (s && (a.isFunction(s) || (s = s.get(t))))
break;
o[c || "#" + i] = s;
}
if (!s) {
const i = Object.entries(o).map(
([p, f]) => `adapter ${p} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
);
let c = n ? i.length > 1 ? `since :
` + i.map(Ze).join(`
`) : " " + Ze(i[0]) : "as no ada