UNPKG

@mussnad/frappe-react-query

Version:
1,482 lines (1,480 loc) 118 kB
var Rn = Object.defineProperty; var _n = (o, d, h) => d in o ? Rn(o, d, { enumerable: !0, configurable: !0, writable: !0, value: h }) : o[d] = h; var Ne = (o, d, h) => _n(o, typeof d != "symbol" ? d + "" : d, h); import Tn, { createContext as Sn, useMemo as Bt, useContext as H, useState as je, useCallback as X, useEffect as ot } from "react"; import { QueryClient as xn, QueryClientProvider as On, useQueryClient as St, useQuery as _e, useMutation as Ue } from "@tanstack/react-query"; import Cn from "socket.io-client"; var An = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Tt = { exports: {} }, Xe = {}; /** * @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 dr; function Fn() { if (dr) return Xe; dr = 1; var o = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment"); function h(f, i, l) { var y = null; if (l !== void 0 && (y = "" + l), i.key !== void 0 && (y = "" + i.key), "key" in i) { l = {}; for (var c in i) c !== "key" && (l[c] = i[c]); } else l = i; return i = l.ref, { $$typeof: o, type: f, key: y, ref: i !== void 0 ? i : null, props: l }; } return Xe.Fragment = d, Xe.jsx = h, Xe.jsxs = h, Xe; } var Ze = {}; /** * @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 pr; function qn() { return pr || (pr = 1, process.env.NODE_ENV !== "production" && function() { function o(a) { if (a == null) return null; if (typeof a == "function") return a.$$typeof === He ? null : a.displayName || a.name || null; if (typeof a == "string") return a; switch (a) { case me: return "Fragment"; case ue: return "Portal"; case Se: return "Profiler"; case Te: return "StrictMode"; case we: return "Suspense"; case ne: return "SuspenseList"; } if (typeof a == "object") switch (typeof a.tag == "number" && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), a.$$typeof) { case Oe: return (a.displayName || "Context") + ".Provider"; case xe: return (a._context.displayName || "Context") + ".Consumer"; case ye: var u = a.render; return a = a.displayName, a || (a = u.displayName || u.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a; case de: return u = a.displayName || null, u !== null ? u : o(a.type) || "Memo"; case oe: u = a._payload, a = a._init; try { return o(a(u)); } catch { } } return null; } function d(a) { return "" + a; } function h(a) { try { d(a); var u = !1; } catch { u = !0; } if (u) { u = console; var b = u.error, L = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object"; return b.call( u, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", L ), d(a); } } function f() { } function i() { if (Fe === 0) { st = console.log, it = console.info, at = console.warn, ut = console.error, ze = console.group, lt = console.groupCollapsed, We = console.groupEnd; var a = { configurable: !0, enumerable: !0, value: f, writable: !0 }; Object.defineProperties(console, { info: a, log: a, warn: a, error: a, group: a, groupCollapsed: a, groupEnd: a }); } Fe++; } function l() { if (Fe--, Fe === 0) { var a = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: Z({}, a, { value: st }), info: Z({}, a, { value: it }), warn: Z({}, a, { value: at }), error: Z({}, a, { value: ut }), group: Z({}, a, { value: ze }), groupCollapsed: Z({}, a, { value: lt }), groupEnd: Z({}, a, { value: We }) }); } 0 > Fe && console.error( "disabledDepth fell below zero. This is a bug in React. Please file an issue." ); } function y(a) { if (Ve === void 0) try { throw Error(); } catch (b) { var u = b.stack.trim().match(/\n( *(at )?)/); Ve = u && u[1] || "", ct = -1 < b.stack.indexOf(` at`) ? " (<anonymous>)" : -1 < b.stack.indexOf("@") ? "@unknown:0:0" : ""; } return ` ` + Ve + a + ct; } function c(a, u) { if (!a || Ke) return ""; var b = Ge.get(a); if (b !== void 0) return b; Ke = !0, b = Error.prepareStackTrace, Error.prepareStackTrace = void 0; var L = null; L = se.H, se.H = null, i(); try { var V = { DetermineComponentFrameRoot: function() { try { if (u) { var le = function() { throw Error(); }; if (Object.defineProperty(le.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(le, []); } catch (ae) { var Ce = ae; } Reflect.construct(a, [], le); } else { try { le.call(); } catch (ae) { Ce = ae; } a.call(le.prototype); } } else { try { throw Error(); } catch (ae) { Ce = ae; } (le = a()) && typeof le.catch == "function" && le.catch(function() { }); } } catch (ae) { if (ae && Ce && typeof ae.stack == "string") return [ae.stack, Ce.stack]; } return [null, null]; } }; V.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot"; var $ = Object.getOwnPropertyDescriptor( V.DetermineComponentFrameRoot, "name" ); $ && $.configurable && Object.defineProperty( V.DetermineComponentFrameRoot, "name", { value: "DetermineComponentFrameRoot" } ); var k = V.DetermineComponentFrameRoot(), ie = k[0], be = k[1]; if (ie && be) { var Q = ie.split(` `), ve = be.split(` `); for (k = $ = 0; $ < Q.length && !Q[$].includes( "DetermineComponentFrameRoot" ); ) $++; for (; k < ve.length && !ve[k].includes( "DetermineComponentFrameRoot" ); ) k++; if ($ === Q.length || k === ve.length) for ($ = Q.length - 1, k = ve.length - 1; 1 <= $ && 0 <= k && Q[$] !== ve[k]; ) k--; for (; 1 <= $ && 0 <= k; $--, k--) if (Q[$] !== ve[k]) { if ($ !== 1 || k !== 1) do if ($--, k--, 0 > k || Q[$] !== ve[k]) { var pe = ` ` + Q[$].replace( " at new ", " at " ); return a.displayName && pe.includes("<anonymous>") && (pe = pe.replace("<anonymous>", a.displayName)), typeof a == "function" && Ge.set(a, pe), pe; } while (1 <= $ && 0 <= k); break; } } } finally { Ke = !1, se.H = L, l(), Error.prepareStackTrace = b; } return Q = (Q = a ? a.displayName || a.name : "") ? y(Q) : "", typeof a == "function" && Ge.set(a, Q), Q; } function w(a) { if (a == null) return ""; if (typeof a == "function") { var u = a.prototype; return c( a, !(!u || !u.isReactComponent) ); } if (typeof a == "string") return y(a); switch (a) { case we: return y("Suspense"); case ne: return y("SuspenseList"); } if (typeof a == "object") switch (a.$$typeof) { case ye: return a = c(a.render, !1), a; case de: return w(a.type); case oe: u = a._payload, a = a._init; try { return w(a(u)); } catch { } } return ""; } function R() { var a = se.A; return a === null ? null : a.getOwner(); } function g(a) { if (Be.call(a, "key")) { var u = Object.getOwnPropertyDescriptor(a, "key").get; if (u && u.isReactWarning) return !1; } return a.key !== void 0; } function x(a, u) { function b() { ft || (ft = !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)", u )); } b.isReactWarning = !0, Object.defineProperty(a, "key", { get: b, configurable: !0 }); } function S() { var a = o(this.type); return dt[a] || (dt[a] = !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." )), a = this.props.ref, a !== void 0 ? a : null; } function P(a, u, b, L, V, $) { return b = $.ref, a = { $$typeof: B, type: a, key: u, props: $, _owner: V }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(a, "ref", { enumerable: !1, get: S }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: 0 }), Object.defineProperty(a, "_debugInfo", { configurable: !1, enumerable: !1, writable: !0, value: null }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a; } function E(a, u, b, L, V, $) { if (typeof a == "string" || typeof a == "function" || a === me || a === Se || a === Te || a === we || a === ne || a === Me || typeof a == "object" && a !== null && (a.$$typeof === oe || a.$$typeof === de || a.$$typeof === Oe || a.$$typeof === xe || a.$$typeof === ye || a.$$typeof === xt || a.getModuleId !== void 0)) { var k = u.children; if (k !== void 0) if (L) if (Je(k)) { for (L = 0; L < k.length; L++) O(k[L], a); Object.freeze && Object.freeze(k); } 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 O(k, a); } else k = "", (a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), a === null ? L = "null" : Je(a) ? L = "array" : a !== void 0 && a.$$typeof === B ? (L = "<" + (o(a.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : L = typeof a, console.error( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", L, k ); if (Be.call(u, "key")) { k = o(a); var ie = Object.keys(u).filter(function(Q) { return Q !== "key"; }); L = 0 < ie.length ? "{key: someKey, " + ie.join(": ..., ") + ": ...}" : "{key: someKey}", pt[k + L] || (ie = 0 < ie.length ? "{" + ie.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} />`, L, k, ie, k ), pt[k + L] = !0); } if (k = null, b !== void 0 && (h(b), k = "" + b), g(u) && (h(u.key), k = "" + u.key), "key" in u) { b = {}; for (var be in u) be !== "key" && (b[be] = u[be]); } else b = u; return k && x( b, typeof a == "function" ? a.displayName || a.name || "Unknown" : a ), P(a, k, $, V, R(), b); } function O(a, u) { if (typeof a == "object" && a && a.$$typeof !== Ot) { if (Je(a)) for (var b = 0; b < a.length; b++) { var L = a[b]; N(L) && U(L, u); } else if (N(a)) a._store && (a._store.validated = 1); else if (a === null || typeof a != "object" ? b = null : (b = ge && a[ge] || a["@@iterator"], b = typeof b == "function" ? b : null), typeof b == "function" && b !== a.entries && (b = b.call(a), b !== a)) for (; !(a = b.next()).done; ) N(a.value) && U(a.value, u); } } function N(a) { return typeof a == "object" && a !== null && a.$$typeof === B; } function U(a, u) { if (a._store && !a._store.validated && a.key == null && (a._store.validated = 1, u = W(u), !Ye[u])) { Ye[u] = !0; var b = ""; a && a._owner != null && a._owner !== R() && (b = null, typeof a._owner.tag == "number" ? b = o(a._owner.type) : typeof a._owner.name == "string" && (b = a._owner.name), b = " It was passed a child from " + b + "."); var L = se.getCurrentStack; se.getCurrentStack = function() { var V = w(a.type); return L && (V += L() || ""), V; }, console.error( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', u, b ), se.getCurrentStack = L; } } function W(a) { var u = "", b = R(); return b && (b = o(b.type)) && (u = ` Check the render method of \`` + b + "`."), u || (a = o(a)) && (u = ` Check the top-level render call using <` + a + ">."), u; } var D = Tn, B = Symbol.for("react.transitional.element"), ue = Symbol.for("react.portal"), me = Symbol.for("react.fragment"), Te = Symbol.for("react.strict_mode"), Se = Symbol.for("react.profiler"), xe = Symbol.for("react.consumer"), Oe = Symbol.for("react.context"), ye = Symbol.for("react.forward_ref"), we = Symbol.for("react.suspense"), ne = Symbol.for("react.suspense_list"), de = Symbol.for("react.memo"), oe = Symbol.for("react.lazy"), Me = Symbol.for("react.offscreen"), ge = Symbol.iterator, He = Symbol.for("react.client.reference"), se = D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Be = Object.prototype.hasOwnProperty, Z = Object.assign, xt = Symbol.for("react.client.reference"), Je = Array.isArray, Fe = 0, st, it, at, ut, ze, lt, We; f.__reactDisabledLog = !0; var Ve, ct, Ke = !1, Ge = new (typeof WeakMap == "function" ? WeakMap : Map)(), Ot = Symbol.for("react.client.reference"), ft, dt = {}, pt = {}, Ye = {}; Ze.Fragment = me, Ze.jsx = function(a, u, b, L, V) { return E(a, u, b, !1, L, V); }, Ze.jsxs = function(a, u, b, L, V) { return E(a, u, b, !0, L, V); }; }()), Ze; } var hr; function Pn() { return hr || (hr = 1, process.env.NODE_ENV === "production" ? Tt.exports = Fn() : Tt.exports = qn()), Tt.exports; } var mr = Pn(), De = {}, et = {}, tt = {}, re = {}; /*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */ var Mt, yr; function Nn() { if (yr) return Mt; yr = 1; function o(e, t) { return function() { return e.apply(t, arguments); }; } const { toString: d } = Object.prototype, { getPrototypeOf: h } = Object, f = /* @__PURE__ */ ((e) => (t) => { const r = d.call(t); return e[r] || (e[r] = r.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)), i = (e) => (e = e.toLowerCase(), (t) => f(t) === e), l = (e) => (t) => typeof t === e, { isArray: y } = Array, c = l("undefined"); function w(e) { return e !== null && !c(e) && e.constructor !== null && !c(e.constructor) && S(e.constructor.isBuffer) && e.constructor.isBuffer(e); } const R = i("ArrayBuffer"); function g(e) { let t; return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && R(e.buffer), t; } const x = l("string"), S = l("function"), P = l("number"), E = (e) => e !== null && typeof e == "object", O = (e) => e === !0 || e === !1, N = (e) => { if (f(e) !== "object") return !1; const t = h(e); return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e); }, U = i("Date"), W = i("File"), D = i("Blob"), B = i("FileList"), ue = (e) => E(e) && S(e.pipe), me = (e) => { let t; return e && (typeof FormData == "function" && e instanceof FormData || S(e.append) && ((t = f(e)) === "formdata" || // detect form-data instance t === "object" && S(e.toString) && e.toString() === "[object FormData]")); }, Te = i("URLSearchParams"), [Se, xe, Oe, ye] = ["ReadableStream", "Request", "Response", "Headers"].map(i), we = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function ne(e, t, { allOwnKeys: r = !1 } = {}) { if (e === null || typeof e > "u") return; let n, s; if (typeof e != "object" && (e = [e]), y(e)) for (n = 0, s = e.length; n < s; n++) t.call(null, e[n], n, e); else { const p = r ? Object.getOwnPropertyNames(e) : Object.keys(e), m = p.length; let v; for (n = 0; n < m; n++) v = p[n], t.call(null, e[v], v, e); } } function de(e, t) { t = t.toLowerCase(); const r = Object.keys(e); let n = r.length, s; for (; n-- > 0; ) if (s = r[n], t === s.toLowerCase()) return s; return null; } const oe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : An, Me = (e) => !c(e) && e !== oe; function ge() { const { caseless: e } = Me(this) && this || {}, t = {}, r = (n, s) => { const p = e && de(t, s) || s; N(t[p]) && N(n) ? t[p] = ge(t[p], n) : N(n) ? t[p] = ge({}, n) : y(n) ? t[p] = n.slice() : t[p] = n; }; for (let n = 0, s = arguments.length; n < s; n++) arguments[n] && ne(arguments[n], r); return t; } const He = (e, t, r, { allOwnKeys: n } = {}) => (ne(t, (s, p) => { r && S(s) ? e[p] = o(s, r) : e[p] = s; }, { allOwnKeys: n }), e), se = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Be = (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); }, Z = (e, t, r, n) => { let s, p, m; const v = {}; if (t = t || {}, e == null) return t; do { for (s = Object.getOwnPropertyNames(e), p = s.length; p-- > 0; ) m = s[p], (!n || n(m, e, t)) && !v[m] && (t[m] = e[m], v[m] = !0); e = r !== !1 && h(e); } while (e && (!r || r(e, t)) && e !== Object.prototype); return t; }, xt = (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; }, Je = (e) => { if (!e) return null; if (y(e)) return e; let t = e.length; if (!P(t)) return null; const r = new Array(t); for (; t-- > 0; ) r[t] = e[t]; return r; }, Fe = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && h(Uint8Array)), st = (e, t) => { const n = (e && e[Symbol.iterator]).call(e); let s; for (; (s = n.next()) && !s.done; ) { const p = s.value; t.call(e, p[0], p[1]); } }, it = (e, t) => { let r; const n = []; for (; (r = e.exec(t)) !== null; ) n.push(r); return n; }, at = i("HTMLFormElement"), ut = (e) => e.toLowerCase().replace( /[-_\s]([a-z\d])(\w*)/g, function(r, n, s) { return n.toUpperCase() + s; } ), ze = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), lt = i("RegExp"), We = (e, t) => { const r = Object.getOwnPropertyDescriptors(e), n = {}; ne(r, (s, p) => { let m; (m = t(s, p, e)) !== !1 && (n[p] = m || s); }), Object.defineProperties(e, n); }, Ve = (e) => { We(e, (t, r) => { if (S(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1) return !1; const n = e[r]; if (S(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 + "'"); }); } }); }, ct = (e, t) => { const r = {}, n = (s) => { s.forEach((p) => { r[p] = !0; }); }; return y(e) ? n(e) : n(String(e).split(t)), r; }, Ke = () => { }, Ge = (e, t) => e != null && Number.isFinite(e = +e) ? e : t; function Ot(e) { return !!(e && S(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]); } const ft = (e) => { const t = new Array(10), r = (n, s) => { if (E(n)) { if (t.indexOf(n) >= 0) return; if (!("toJSON" in n)) { t[s] = n; const p = y(n) ? [] : {}; return ne(n, (m, v) => { const C = r(m, s + 1); !c(C) && (p[v] = C); }), t[s] = void 0, p; } } return n; }; return r(e, 0); }, dt = i("AsyncFunction"), pt = (e) => e && (E(e) || S(e)) && S(e.then) && S(e.catch), Ye = ((e, t) => e ? setImmediate : t ? ((r, n) => (oe.addEventListener("message", ({ source: s, data: p }) => { s === oe && p === r && n.length && n.shift()(); }, !1), (s) => { n.push(s), oe.postMessage(r, "*"); }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))( typeof setImmediate == "function", S(oe.postMessage) ), a = typeof queueMicrotask < "u" ? queueMicrotask.bind(oe) : typeof process < "u" && process.nextTick || Ye; var u = { isArray: y, isArrayBuffer: R, isBuffer: w, isFormData: me, isArrayBufferView: g, isString: x, isNumber: P, isBoolean: O, isObject: E, isPlainObject: N, isReadableStream: Se, isRequest: xe, isResponse: Oe, isHeaders: ye, isUndefined: c, isDate: U, isFile: W, isBlob: D, isRegExp: lt, isFunction: S, isStream: ue, isURLSearchParams: Te, isTypedArray: Fe, isFileList: B, forEach: ne, merge: ge, extend: He, trim: we, stripBOM: se, inherits: Be, toFlatObject: Z, kindOf: f, kindOfTest: i, endsWith: xt, toArray: Je, forEachEntry: st, matchAll: it, isHTMLForm: at, hasOwnProperty: ze, hasOwnProp: ze, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors: We, freezeMethods: Ve, toObjectSet: ct, toCamelCase: ut, noop: Ke, toFiniteNumber: Ge, findKey: de, global: oe, isContextDefined: Me, isSpecCompliantForm: Ot, toJSONObject: ft, isAsyncFn: dt, isThenable: pt, setImmediate: Ye, asap: a }; function b(e, t, r, n, 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), r && (this.config = r), n && (this.request = n), s && (this.response = s, this.status = s.status ? s.status : null); } u.inherits(b, 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: u.toJSONObject(this.config), code: this.code, status: this.status }; } }); const L = b.prototype, V = {}; [ "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) => { V[e] = { value: e }; }), Object.defineProperties(b, V), Object.defineProperty(L, "isAxiosError", { value: !0 }), b.from = (e, t, r, n, s, p) => { const m = Object.create(L); return u.toFlatObject(e, m, function(C) { return C !== Error.prototype; }, (v) => v !== "isAxiosError"), b.call(m, e.message, t, r, n, s), m.cause = e, m.name = e.name, p && Object.assign(m, p), m; }; var $ = null; function k(e) { return u.isPlainObject(e) || u.isArray(e); } function ie(e) { return u.endsWith(e, "[]") ? e.slice(0, -2) : e; } function be(e, t, r) { return e ? e.concat(t).map(function(s, p) { return s = ie(s), !r && p ? "[" + s + "]" : s; }).join(r ? "." : "") : t; } function Q(e) { return u.isArray(e) && !e.some(k); } const ve = u.toFlatObject(u, {}, null, function(t) { return /^is[A-Z]/.test(t); }); function pe(e, t, r) { if (!u.isObject(e)) throw new TypeError("target must be an object"); t = t || new FormData(), r = u.toFlatObject(r, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(j, q) { return !u.isUndefined(q[j]); }); const n = r.metaTokens, s = r.visitor || T, p = r.dots, m = r.indexes, C = (r.Blob || typeof Blob < "u" && Blob) && u.isSpecCompliantForm(t); if (!u.isFunction(s)) throw new TypeError("visitor must be a function"); function _(F) { if (F === null) return ""; if (u.isDate(F)) return F.toISOString(); if (!C && u.isBlob(F)) throw new b("Blob is not supported. Use a Buffer instead."); return u.isArrayBuffer(F) || u.isTypedArray(F) ? C && typeof Blob == "function" ? new Blob([F]) : Buffer.from(F) : F; } function T(F, j, q) { let J = F; if (F && !q && typeof F == "object") { if (u.endsWith(j, "{}")) j = n ? j : j.slice(0, -2), F = JSON.stringify(F); else if (u.isArray(F) && Q(F) || (u.isFileList(F) || u.endsWith(j, "[]")) && (J = u.toArray(F))) return j = ie(j), J.forEach(function(Y, Ee) { !(u.isUndefined(Y) || Y === null) && t.append( // eslint-disable-next-line no-nested-ternary m === !0 ? be([j], Ee, p) : m === null ? j : j + "[]", _(Y) ); }), !1; } return k(F) ? !0 : (t.append(be(q, j, p), _(F)), !1); } const A = [], M = Object.assign(ve, { defaultVisitor: T, convertValue: _, isVisitable: k }); function K(F, j) { if (!u.isUndefined(F)) { if (A.indexOf(F) !== -1) throw Error("Circular reference detected in " + j.join(".")); A.push(F), u.forEach(F, function(J, G) { (!(u.isUndefined(J) || J === null) && s.call( t, J, u.isString(G) ? G.trim() : G, j, M )) === !0 && K(J, j ? j.concat(G) : [G]); }), A.pop(); } } if (!u.isObject(e)) throw new TypeError("data must be an object"); return K(e), t; } function le(e) { const t = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) { return t[n]; }); } function Ce(e, t) { this._pairs = [], e && pe(e, this, t); } const ae = Ce.prototype; ae.append = function(t, r) { this._pairs.push([t, r]); }, ae.toString = function(t) { const r = t ? function(n) { return t.call(this, n, le); } : le; return this._pairs.map(function(s) { return r(s[0]) + "=" + r(s[1]); }, "").join("&"); }; function Pr(e) { return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } function Ht(e, t, r) { if (!t) return e; const n = r && r.encode || Pr; u.isFunction(r) && (r = { serialize: r }); const s = r && r.serialize; let p; if (s ? p = s(t, r) : p = u.isURLSearchParams(t) ? t.toString() : new Ce(t, r).toString(n), p) { const m = e.indexOf("#"); m !== -1 && (e = e.slice(0, m)), e += (e.indexOf("?") === -1 ? "?" : "&") + p; } return e; } class Nr { 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) { u.forEach(this.handlers, function(n) { n !== null && t(n); }); } } var Jt = Nr, zt = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, Dr = typeof URLSearchParams < "u" ? URLSearchParams : Ce, kr = typeof FormData < "u" ? FormData : null, jr = typeof Blob < "u" ? Blob : null, Ur = { isBrowser: !0, classes: { URLSearchParams: Dr, FormData: kr, Blob: jr }, protocols: ["http", "https", "file", "blob", "url", "data"] }; const Ct = typeof window < "u" && typeof document < "u", At = typeof navigator == "object" && navigator || void 0, Lr = Ct && (!At || ["ReactNative", "NativeScript", "NS"].indexOf(At.product) < 0), Mr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Br = Ct && window.location.href || "http://localhost"; var $r = /* @__PURE__ */ Object.freeze({ __proto__: null, hasBrowserEnv: Ct, hasStandardBrowserWebWorkerEnv: Mr, hasStandardBrowserEnv: Lr, navigator: At, origin: Br }), ee = { ...$r, ...Ur }; function Ir(e, t) { return pe(e, new ee.classes.URLSearchParams(), Object.assign({ visitor: function(r, n, s, p) { return ee.isNode && u.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : p.defaultVisitor.apply(this, arguments); } }, t)); } function Hr(e) { return u.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]); } function Jr(e) { const t = {}, r = Object.keys(e); let n; const s = r.length; let p; for (n = 0; n < s; n++) p = r[n], t[p] = e[p]; return t; } function Wt(e) { function t(r, n, s, p) { let m = r[p++]; if (m === "__proto__") return !0; const v = Number.isFinite(+m), C = p >= r.length; return m = !m && u.isArray(s) ? s.length : m, C ? (u.hasOwnProp(s, m) ? s[m] = [s[m], n] : s[m] = n, !v) : ((!s[m] || !u.isObject(s[m])) && (s[m] = []), t(r, n, s[m], p) && u.isArray(s[m]) && (s[m] = Jr(s[m])), !v); } if (u.isFormData(e) && u.isFunction(e.entries)) { const r = {}; return u.forEachEntry(e, (n, s) => { t(Hr(n), s, r, 0); }), r; } return null; } function zr(e, t, r) { if (u.isString(e)) try { return (t || JSON.parse)(e), u.trim(e); } catch (n) { if (n.name !== "SyntaxError") throw n; } return (r || JSON.stringify)(e); } const Ft = { transitional: zt, adapter: ["xhr", "http", "fetch"], transformRequest: [function(t, r) { const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, p = u.isObject(t); if (p && u.isHTMLForm(t) && (t = new FormData(t)), u.isFormData(t)) return s ? JSON.stringify(Wt(t)) : t; if (u.isArrayBuffer(t) || u.isBuffer(t) || u.isStream(t) || u.isFile(t) || u.isBlob(t) || u.isReadableStream(t)) return t; if (u.isArrayBufferView(t)) return t.buffer; if (u.isURLSearchParams(t)) return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString(); let v; if (p) { if (n.indexOf("application/x-www-form-urlencoded") > -1) return Ir(t, this.formSerializer).toString(); if ((v = u.isFileList(t)) || n.indexOf("multipart/form-data") > -1) { const C = this.env && this.env.FormData; return pe( v ? { "files[]": t } : t, C && new C(), this.formSerializer ); } } return p || s ? (r.setContentType("application/json", !1), zr(t)) : t; }], transformResponse: [function(t) { const r = this.transitional || Ft.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json"; if (u.isResponse(t) || u.isReadableStream(t)) return t; if (t && u.isString(t) && (n && !this.responseType || s)) { const m = !(r && r.silentJSONParsing) && s; try { return JSON.parse(t); } catch (v) { if (m) throw v.name === "SyntaxError" ? b.from(v, b.ERR_BAD_RESPONSE, this, null, this.response) : v; } } 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: ee.classes.FormData, Blob: ee.classes.Blob }, validateStatus: function(t) { return t >= 200 && t < 300; }, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; u.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => { Ft.headers[e] = {}; }); var qt = Ft; const Wr = u.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" ]); var Vr = (e) => { const t = {}; let r, n, s; return e && e.split(` `).forEach(function(m) { s = m.indexOf(":"), r = m.substring(0, s).trim().toLowerCase(), n = m.substring(s + 1).trim(), !(!r || t[r] && Wr[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n); }), t; }; const Vt = Symbol("internals"); function Qe(e) { return e && String(e).trim().toLowerCase(); } function ht(e) { return e === !1 || e == null ? e : u.isArray(e) ? e.map(ht) : String(e); } function Kr(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 Gr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()); function Pt(e, t, r, n, s) { if (u.isFunction(n)) return n.call(this, t, r); if (s && (t = r), !!u.isString(t)) { if (u.isString(n)) return t.indexOf(n) !== -1; if (u.isRegExp(n)) return n.test(t); } } function Yr(e) { return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n); } function Qr(e, t) { const r = u.toCamelCase(" " + t); ["get", "set", "has"].forEach((n) => { Object.defineProperty(e, n + r, { value: function(s, p, m) { return this[n].call(this, t, s, p, m); }, configurable: !0 }); }); } class mt { constructor(t) { t && this.set(t); } set(t, r, n) { const s = this; function p(v, C, _) { const T = Qe(C); if (!T) throw new Error("header name must be a non-empty string"); const A = u.findKey(s, T); (!A || s[A] === void 0 || _ === !0 || _ === void 0 && s[A] !== !1) && (s[A || C] = ht(v)); } const m = (v, C) => u.forEach(v, (_, T) => p(_, T, C)); if (u.isPlainObject(t) || t instanceof this.constructor) m(t, r); else if (u.isString(t) && (t = t.trim()) && !Gr(t)) m(Vr(t), r); else if (u.isHeaders(t)) for (const [v, C] of t.entries()) p(C, v, n); else t != null && p(r, t, n); return this; } get(t, r) { if (t = Qe(t), t) { const n = u.findKey(this, t); if (n) { const s = this[n]; if (!r) return s; if (r === !0) return Kr(s); if (u.isFunction(r)) return r.call(this, s, n); if (u.isRegExp(r)) return r.exec(s); throw new TypeError("parser must be boolean|regexp|function"); } } } has(t, r) { if (t = Qe(t), t) { const n = u.findKey(this, t); return !!(n && this[n] !== void 0 && (!r || Pt(this, this[n], n, r))); } return !1; } delete(t, r) { const n = this; let s = !1; function p(m) { if (m = Qe(m), m) { const v = u.findKey(n, m); v && (!r || Pt(n, n[v], v, r)) && (delete n[v], s = !0); } } return u.isArray(t) ? t.forEach(p) : p(t), s; } clear(t) { const r = Object.keys(this); let n = r.length, s = !1; for (; n--; ) { const p = r[n]; (!t || Pt(this, this[p], p, t, !0)) && (delete this[p], s = !0); } return s; } normalize(t) { const r = this, n = {}; return u.forEach(this, (s, p) => { const m = u.findKey(n, p); if (m) { r[m] = ht(s), delete r[p]; return; } const v = t ? Yr(p) : String(p).trim(); v !== p && delete r[p], r[v] = ht(s), n[v] = !0; }), this; } concat(...t) { return this.constructor.concat(this, ...t); } toJSON(t) { const r = /* @__PURE__ */ Object.create(null); return u.forEach(this, (n, s) => { n != null && n !== !1 && (r[s] = t && u.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(` `); } 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((s) => n.set(s)), n; } static accessor(t) { const n = (this[Vt] = this[Vt] = { accessors: {} }).accessors, s = this.prototype; function p(m) { const v = Qe(m); n[v] || (Qr(s, m), n[v] = !0); } return u.isArray(t) ? t.forEach(p) : p(t), this; } } mt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]), u.reduceDescriptors(mt.prototype, ({ value: e }, t) => { let r = t[0].toUpperCase() + t.slice(1); return { get: () => e, set(n) { this[r] = n; } }; }), u.freezeMethods(mt); var ce = mt; function Nt(e, t) { const r = this || qt, n = t || r, s = ce.from(n.headers); let p = n.data; return u.forEach(e, function(v) { p = v.call(r, p, s.normalize(), t ? t.status : void 0); }), s.normalize(), p; } function Kt(e) { return !!(e && e.__CANCEL__); } function $e(e, t, r) { b.call(this, e ?? "canceled", b.ERR_CANCELED, t, r), this.name = "CanceledError"; } u.inherits($e, b, { __CANCEL__: !0 }); function Gt(e, t, r) { const n = r.config.validateStatus; !r.status || !n || n(r.status) ? e(r) : t(new b( "Request failed with status code " + r.status, [b.ERR_BAD_REQUEST, b.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4], r.config, r.request, r )); } function Xr(e) { const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e); return t && t[1] || ""; } function Zr(e, t) { e = e || 10; const r = new Array(e), n = new Array(e); let s = 0, p = 0, m; return t = t !== void 0 ? t : 1e3, function(C) { const _ = Date.now(), T = n[p]; m || (m = _), r[s] = C, n[s] = _; let A = p, M = 0; for (; A !== s; ) M += r[A++], A = A % e; if (s = (s + 1) % e, s === p && (p = (p + 1) % e), _ - m < t) return; const K = T && _ - T; return K ? Math.round(M * 1e3 / K) : void 0; }; } function en(e, t) { let r = 0, n = 1e3 / t, s, p; const m = (_, T = Date.now()) => { r = T, s = null, p && (clearTimeout(p), p = null), e.apply(null, _); }; return [(..._) => { const T = Date.now(), A = T - r; A >= n ? m(_, T) : (s = _, p || (p = setTimeout(() => { p = null, m(s); }, n - A))); }, () => s && m(s)]; } const yt = (e, t, r = 3) => { let n = 0; const s = Zr(50, 250); return en((p) => { const m = p.loaded, v = p.lengthComputable ? p.total : void 0, C = m - n, _ = s(C), T = m <= v; n = m; const A = { loaded: m, total: v, progress: v ? m / v : void 0, bytes: C, rate: _ || void 0, estimated: _ && v && T ? (v - m) / _ : void 0, event: p, lengthComputable: v != null, [t ? "download" : "upload"]: !0 }; e(A); }, r); }, Yt = (e, t) => { const r = e != null; return [(n) => t[0]({ lengthComputable: r, total: e, loaded: n }), t[1]]; }, Qt = (e) => (...t) => u.asap(() => e(...t)); var tn = ee.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, ee.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))( new URL(ee.origin), ee.navigator && /(msie|trident)/i.test(ee.navigator.userAgent) ) : () => !0, rn = ee.hasStandardBrowserEnv ? ( // Standard browser envs support document.cookie { write(e, t, r, n, s, p) { const m = [e + "=" + encodeURIComponent(t)]; u.isNumber(r) && m.push("expires=" + new Date(r).toGMTString()), u.isString(n) && m.push("path=" + n), u.isString(s) && m.push("domain=" + s), p === !0 && m.push("secure"), document.cookie = m.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 nn(e) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e); } function on(e, t) { return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e; } function Xt(e, t, r) { let n = !nn(t); return e && (n || r == !1) ? on(e, t) : t; } const Zt = (e) => e instanceof ce ? { ...e } : e; function qe(e, t) { t = t || {}; const r = {}; function n(_, T, A, M) { return u.isPlainObject(_) && u.isPlainObject(T) ? u.merge.call({ caseless: M }, _, T) : u.isPlainObject(T) ? u.merge({}, T) : u.isArray(T) ? T.slice() : T; } function s(_, T, A, M) { if (u.isUndefined(T)) { if (!u.isUndefined(_)) return n(void 0, _, A, M); } else return n(_, T, A, M); } function p(_, T) { if (!u.isUndefined(T)) return n(void 0, T); } function m(_, T) { if (u.isUndefined(T)) { if (!u.isUndefined(_)) return n(void 0, _); } else return n(void 0, T); } function v(_, T, A) { if (A in t) return n(_, T); if (A in e) return n(void 0, _); } const C = { url: p, method: p, data: p, baseURL: m, transformRequest: m, transformResponse: m, paramsSerializer: m, timeout: m, timeoutMessage: m, withCredentials: m, withXSRFToken: m, adapter: m, responseType: m, xsrfCookieName: m, xsrfHeaderName: m, onUploadProgress: m, onDownloadProgress: m, decompress: m, maxContentLength: m, maxBodyLength: m, beforeRedirect: m, transport: m, httpAgent: m, httpsAgent: m, cancelToken: m, socketPath: m, responseEncoding: m, validateStatus: v, headers: (_, T, A) => s(Zt(_), Zt(T), A, !0) }; return u.forEach(Object.keys(Object.assign({}, e, t)), function(T) { const A = C[T] || s, M = A(e[T], t[T], T); u.isUndefined(M) && A !== v || (r[T] = M); }), r; } var er = (e) => { const t = qe({}, e); let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: p, headers: m, auth: v } = t; t.headers = m = ce.from(m), t.url = Ht(Xt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), v && m.set( "Authorization", "Basic " + btoa((v.username || "") + ":" + (v.password ? unescape(encodeURIComponent(v.password)) : "")) ); let C; if (u.isFormData(r)) { if (ee.hasStandardBrowserEnv || ee.hasStandardBrowserWebWorkerEnv) m.setContentType(void 0); else if ((C = m.getContentType()) !== !1) { const [_, ...T] = C ? C.split(";").map((A) => A.trim()).filter(Boolean) : []; m.setContentType([_ || "multipart/form-data", ...T].join("; ")); } } if (ee.hasStandardBrowserEnv && (n && u.isFunction(n) && (n = n(t)), n || n !== !1 && tn(t.url))) { const _ = s && p && rn.read(p); _ && m.set(s, _); } return t; }, sn = typeof XMLHttpRequest < "u" && function(e) { return new Promise(function(r, n) { const s = er(e); let p = s.data; const m = ce.from(s.headers).normalize(); let { responseType: v, onUploadProgress: C, onDownloadProgress: _ } = s, T, A, M, K, F; function j() { K && K(), F && F(), s.cancelToken && s.cancelToken.unsubscribe(T), s.signal && s.signal.removeEventListener("abort", T); } let q = new XMLHttpRequest(); q.open(s.method.toUpperCase(), s.url, !0), q.timeout = s.timeout; function J() { if (!q) return; const Y = ce.from( "getAllResponseHeaders" in q && q.getAllResponseHeaders() ), te = { data: !v || v === "text" || v === "json" ? q.responseText : q.response, status: q.status, statusText: q.statusText, headers: Y, config: e, request: q }; Gt(function(Pe) { r(Pe), j(); }, function(Pe) { n(Pe), j(); }, te), q = null; } "onloadend" in q ? q.onloadend = J : q.onreadystatechange = function() { !q || q.readyState !== 4 || q.status === 0 && !(q.responseURL && q.responseURL.indexOf("file:") === 0) || setTimeout(J); }, q.onabort = function() { q && (n(new b("Request aborted", b.ECONNABORTED, e, q)), q = null); }, q.onerror = function() { n(new b("Network Error", b.