diff --git a/dist/button.js b/dist/button.js index 63e4ddd..b10f0ce 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { am as s, al as u, an as e } from "./common/main-uvtyIdqt.js"; +import { am as s, al as u, an as e } from "./common/main-DcvZ_VrN.js"; export { s as auth, u as default, diff --git a/dist/common/main-uvtyIdqt.js b/dist/common/main-DcvZ_VrN.js similarity index 93% rename from dist/common/main-uvtyIdqt.js rename to dist/common/main-DcvZ_VrN.js index 015ae42..854e90d 100644 --- a/dist/common/main-uvtyIdqt.js +++ b/dist/common/main-DcvZ_VrN.js @@ -14,7 +14,7 @@ import { useNotification as Fi } from "rc-notification"; import w from "lodash"; import { useMountedState as ji, useDeepCompareEffect as Gt, useUpdateEffect as Yt, usePrevious as Fn } from "react-use"; import re, { Field as Xt, FieldContext as jn } from "rc-field-form"; -import { _ as wn, C as Qt, L as Ii, M as Rt, N as Xe, b as Le, o as Vt, c as Ai, S as Li } from "./vender-C5RbewOc.js"; +import { _ as wn, C as Qt, L as Ii, M as Rt, N as Xe, b as Le, s as Vt, c as Ai, S as Li } from "./vender-CIG7ep61.js"; import Vi from "rc-util/lib/hooks/useMergedState"; import In from "immutability-helper"; import { Space as Mt, Form as ft, Input as Mi, Button as wt, Pagination as Di, Tree as zi, Breadcrumb as Ui, Empty as Dt, Table as bn, Popover as Bi, Popconfirm as Wi, Tooltip as qi, Divider as _i } from "antd"; @@ -230,14 +230,14 @@ const ir = (t) => function(e) { if (l === 2) { const m = w.get(c, "__PARENT_ID__", ""), g = w.get(c, n, w.get(c, [i, n], "")), f = w.findIndex(a.current, ["__PARENT_ID__", m]), y = w.findIndex(f > -1 ? w.get(a.current, [f, "children"]) : a.current, [n, g]); if (y === -1) return (p = t.onReload) == null ? void 0 : p.call(t); - Promise.all([z.get(`/api/${e}/detail/${g}`), z.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([S, b]) => { + Promise.all([z.get(`/api/${e}/detail/${g}`), z.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([k, b]) => { const E = w.get(a.current, f > -1 ? [f, "children", y, "children"] : [y, "children"]); - a.current = In(a.current, f > -1 ? { [f]: { children: { $splice: [[y, 1, { ...S, children: E }]] } } } : { $splice: [[y, 1, { ...S, children: E }]] }); - const k = new Map(b); + a.current = In(a.current, f > -1 ? { [f]: { children: { $splice: [[y, 1, { ...k, children: E }]] } } } : { $splice: [[y, 1, { ...k, children: E }]] }); + const S = new Map(b); s.current.forEach(($, F) => { var I; - (I = k.get(F)) != null && I.some((T) => T == g) || s.current.set(F, $.filter((T) => T !== g)); - }), k.forEach(($, F) => { + (I = S.get(F)) != null && I.some((T) => T == g) || s.current.set(F, $.filter((T) => T !== g)); + }), S.forEach(($, F) => { s.current.has(F) ? s.current.set(F, w.uniq([...s.current.get(F) || [], ...$])) : s.current.set(F, $); }); }).then(() => { @@ -247,8 +247,8 @@ const ir = (t) => function(e) { }]; }, lr = (t, e) => { const n = Pt(), i = H(e), r = H(/* @__PURE__ */ new Map()), o = H([]), a = w.throttle((l) => { - o.current = [], z.list(t, w.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: m, sider: g, page: f, pageSize: y, operationsAccess: S, dataSource: b }) => { - i.current = { tab: m, condition: u, sider: g, keyword: c, total: p, pageSize: y, page: b != null && b.length ? f : 1 }, o.current = b, r.current = new Map(S), n(); + o.current = [], z.list(t, w.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: m, sider: g, page: f, pageSize: y, operationsAccess: k, dataSource: b }) => { + i.current = { tab: m, condition: u, sider: g, keyword: c, total: p, pageSize: y, page: b != null && b.length ? f : 1 }, o.current = b, r.current = new Map(k), n(); }); }, 380, { leading: !1, trailing: !0 }); vt(() => { @@ -256,12 +256,12 @@ const ir = (t) => function(e) { }, [t, e]); const s = B(() => w.pick(i.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword", "primaryKey"]), [i.current]); return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, c) => a({ page: l, pageSize: c }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, c) => a({ keyword: c, condition: In(i.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => a({ sider: l, page: 1 }), onKeywordChange: (l) => a({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: o.current, onReload: a, payload: e == null ? void 0 : e.payload }); -}, cr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, isPaginate: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, itemGridLayout: g, $setting: f, tabs: y, isConditionFormLayout: S, isTreeSider: b, treeSiderConfig: E, rowSelection: k }) => { +}, cr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, isPaginate: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, itemGridLayout: g, $setting: f, tabs: y, isConditionFormLayout: k, isTreeSider: b, treeSiderConfig: E, rowSelection: S }) => { const { classNames: $, onClickCallback: F } = de(oe), I = w.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), T = f == null ? void 0 : f.isMarkSelected, N = Un(l, c, p, u), M = J((P, V, D) => h(dr, { isMarkSelected: T, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? N(V) : [], data: u ? { [u]: V } : V, children: P, onClickCallback: F }), [T, u, p, o, F, l, c]); - return A("div", { className: j("ff-data-list-framework", e), children: [h(n.sider, { isTreeSider: b, ...E }), A("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: S }), h(n.toolbar, { title: m, tabs: y }), h(Er, { ...g, ...I, rowSelection: k, empty: h(n.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: M, dataSource: i }), h(n.footer, { isPaginate: r, isOperations: a, operations: s })] })] }); -}, dr = ({ className: t, operations: e, children: n, data: i, onClickCallback: r, onSelect: o, isMarkSelected: a, isSelected: s, selectionType: l }) => A("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": a, "is-selected": s, "is-selectable": !!l }, t), onClick: o, children: [h("div", { className: "data-list-grid-layout-item-container", children: n }), !!(e != null && e.length) && h("div", { className: "data-list-grid-layout-item-actions", children: e.map((c) => h("span", { className: "data-list-grid-layout-item-action", children: h(R.Link, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, data: i, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (r == null ? void 0 : r(c.isRefresh, i)) }, c.uuid || Lt()) }, (c == null ? void 0 : c.uuid) || Lt())) })] }), ur = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, columns: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, tabs: g, isPaginate: f, rowSelection: y, isTreeSider: S, treeSiderConfig: b, isConditionFormLayout: E, ...k }) => { + return A("div", { className: j("ff-data-list-framework", e), children: [h(n.sider, { isTreeSider: b, ...E }), A("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: k }), h(n.toolbar, { title: m, tabs: y }), h(Er, { ...g, ...I, rowSelection: S, empty: h(n.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: M, dataSource: i }), h(n.footer, { isPaginate: r, isOperations: a, operations: s })] })] }); +}, dr = ({ className: t, operations: e, children: n, data: i, onClickCallback: r, onSelect: o, isMarkSelected: a, isSelected: s, selectionType: l }) => A("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": a, "is-selected": s, "is-selectable": !!l }, t), onClick: o, children: [h("div", { className: "data-list-grid-layout-item-container", children: n }), !!(e != null && e.length) && h("div", { className: "data-list-grid-layout-item-actions", children: e.map((c) => h("span", { className: "data-list-grid-layout-item-action", children: h(R.Link, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, data: i, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (r == null ? void 0 : r(c.isRefresh, i)) }, c.uuid || Lt()) }, (c == null ? void 0 : c.uuid) || Lt())) })] }), ur = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, columns: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, tabs: g, isPaginate: f, rowSelection: y, isTreeSider: k, treeSiderConfig: b, isConditionFormLayout: E, ...S }) => { const { classNames: $, onClickCallback: F } = de(oe), I = Un(l, c, p, u), T = Bt(l, c, i, p, u); - return A("div", { className: j("ff-data-table-framework", e), children: [h(n.sider, { isTreeSider: S, ...b }), A("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: E }), h(n.toolbar, { title: m, tabs: g }), h(wr, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, rowSelection: y, operationRender: T ? (N) => { + return A("div", { className: j("ff-data-table-framework", e), children: [h(n.sider, { isTreeSider: k, ...b }), A("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: E }), h(n.toolbar, { title: m, tabs: g }), h(wr, { ...S, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, rowSelection: y, operationRender: T ? (N) => { var M; return h("div", { className: "ff-data-table-actions", children: (M = I(N)) == null ? void 0 : M.map((P, V) => h(R, { size: "small", uuid: P.uuid, type: P.type, name: P.name, widget: P.widget, widgetType: P.widgetType, widgetProps: P.widgetProps, widgetData: P.widgetData, widgetSetting: P.widgetSetting, widgetContainerProps: P.widgetContainerSetting, data: N, confirm: P.confirm, onAfterClick: (D) => D !== !1 && (F == null ? void 0 : F(P.isRefresh, N)) }, P.uuid || V)) }); } : null }), h(n.footer, { isPaginate: f, isOperations: a, operations: s })] })] }); @@ -275,8 +275,8 @@ const ir = (t) => function(e) { var m, g; const [n, i] = L({}), { listCode: r, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = x.useContext(oe), { keyword: c, condition: u } = (s == null ? void 0 : s()) || {}, [p] = ft.useForm(); return W(() => { - r && e && z.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: S, rowHeight: b, cols: E, fields: k }) => { - i({ resource: f, itemMargin: [y, S], rowHeight: b, cols: E, fields: k }); + r && e && z.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: k, rowHeight: b, cols: E, fields: S }) => { + i({ resource: f, itemMargin: [y, k], rowHeight: b, cols: E, fields: S }); }).catch(() => i({})); }, [r, e]), W(() => { p.setFieldsValue({ keyword: c, ...u }); @@ -301,13 +301,13 @@ const gr = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => }, fr = ({ className: t, title: e, tabs: n }) => { const { getBase62params: i, onTabChange: r, onReload: o, classNames: a } = de(oe), { tab: s } = (i == null ? void 0 : i()) || {}, [l, c] = Ki((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); return A("div", { className: j("ff-data-list-toolbar", a.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(Ui, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: m }) => h("span", { onClick: () => c(m ?? p), className: j("ff-data-list-tab", { active: (m ?? p) == l }), children: u }), items: n }), A("div", { className: "ff-data-list-actions", children: [h(R.Link, { icon: "icon-reload", widget: () => o() }), h(R.Link, { icon: "icon-setting" })] })] }); -}, yr = ({ className: t, ...e }) => h(Dt, { className: j(t, "ff-data-list-empty"), image: Dt.PRESENTED_IMAGE_SIMPLE, ...e }), _n = ({ isItemGridLayout: t, theme: e, themeProps: n, onClickCallback: i, onReload: r, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: m, keyword: g, onKeywordChange: f, condition: y, onConditionChange: S, sider: b, onSiderChange: E, layouts: k, classNames: $ = {}, payload: F = {}, dataSource: I = [], rowSelection: T, getSelectedRows: N, primaryKey: M, ...P }) => { +}, yr = ({ className: t, ...e }) => h(Dt, { className: j(t, "ff-data-list-empty"), image: Dt.PRESENTED_IMAGE_SIMPLE, ...e }), _n = ({ isItemGridLayout: t, theme: e, themeProps: n, onClickCallback: i, onReload: r, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: m, keyword: g, onKeywordChange: f, condition: y, onConditionChange: k, sider: b, onSiderChange: E, layouts: S, classNames: $ = {}, payload: F = {}, dataSource: I = [], rowSelection: T, getSelectedRows: N, primaryKey: M, ...P }) => { const [V, D] = L(), U = N ?? (() => I), X = J((q, ae) => { const K = { tab: p, page: s, pageSize: c, keyword: g, sider: b, condition: y, total: a, payload: F }; return q && q != "init" ? w.get(K, q, ae) : K; }, [JSON.stringify(y), JSON.stringify(F), p, s, c, g, b, a]), xe = B(() => { let q = { sider: mr, filter: qn, footer: gr, toolbar: fr, empty: yr }; - k === !1 ? q = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : w.isPlainObject(k) && (q = Object.assign({}, q, k)); + S === !1 ? q = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : w.isPlainObject(S) && (q = Object.assign({}, q, S)); for (const ae in q) if (q[ae]) { if (Oi(q[ae])) { const K = q[ae]; @@ -315,13 +315,13 @@ const gr = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => } } else q[ae] = () => h(x.Fragment, {}); return q; - }, [k]); + }, [S]); return W(() => { e ? ne.getWidgetComponent(e).then((q) => { if (!q) throw `${e} not found`; return q; }).catch((q) => ({ default: () => `${q}` })).then((q) => D(x.createElement(q.default, { ...P, layouts: xe, $setting: n }))) : D(h(t ? cr : ur, { ...P, layouts: xe, $setting: n })); - }, [e, n]), h(oe.Provider, { value: { classNames: $, listCode: o, onClickCallback: i, onReload: r, getBase62params: X, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: f, onConditionChange: S, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: f, setCondition: S, getSelectedRows: U }, children: V && x.cloneElement(V, { dataSource: I, primaryKey: M, rowSelection: T, ...P }) }); + }, [e, n]), h(oe.Provider, { value: { classNames: $, listCode: o, onClickCallback: i, onReload: r, getBase62params: X, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: f, onConditionChange: k, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: f, setCondition: k, getSelectedRows: U }, children: V && x.cloneElement(V, { dataSource: I, primaryKey: M, rowSelection: T, ...P }) }); }; _n.propTypes = { classNames: C.exact({ sider: C.string, filter: C.string, footer: C.string, toolbar: C.string, container: C.string, content: C.string, item: C.string, empty: C.string }), layouts: C.oneOfType([C.exact({ sider: C.oneOfType([C.elementType, C.element]), filter: C.oneOfType([C.elementType, C.element]), footer: C.oneOfType([C.elementType, C.element]), toolbar: C.oneOfType([C.elementType, C.element]), empty: C.oneOfType([C.elementType, C.element]) }), C.bool]) }; var Re, $e, De, xt; @@ -349,7 +349,7 @@ const he = class he { Re = new WeakMap(), $e = new WeakMap(), De = new WeakMap(), xt = new WeakMap(), v(he, Re, null), O(he, "getInstance", () => (d(he, Re) || _(he, Re, new he()), d(he, Re))); let Wt = he; const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, className: n, theme: i, themeProps: r, layouts: o, classNames: a, rowSelection: s = null, onDataSourceChange: l }, c) => { - const [{ resource: u, primaryKey: p, batchOperations: m = [], itemOperations: g = [], columns: f = [], isConditionFormLayout: y = !1, isTreeSider: S, treeSiderConfig: b, theme: E, themeConfig: k, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...I } = {}, title: T, isPaginate: N, tabs: M, selectionType: P }, V] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: D = P, selectedRowKeys: U, defaultSelectedRowKeys: X, onChange: xe, ...q } = s ?? {}, ae = lr(t, e), [{ dataSource: K, itemOperationsAccess: ht, condition: li, tab: ci, keyword: di, page: sn, total: ln, pageSize: cn, sider: ui, onConditionChange: pi, onTabChange: gi, onKeywordChange: hi, onPageChange: mi, onPageSizeChange: fi, onSiderChange: yi, onReload: Tt, payload: wi }, dn] = sr(ae, t, p, u), bi = wn(l); + const [{ resource: u, primaryKey: p, batchOperations: m = [], itemOperations: g = [], columns: f = [], isConditionFormLayout: y = !1, isTreeSider: k, treeSiderConfig: b, theme: E, themeConfig: S, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...I } = {}, title: T, isPaginate: N, tabs: M, selectionType: P }, V] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: D = P, selectedRowKeys: U, defaultSelectedRowKeys: X, onChange: xe, ...q } = s ?? {}, ae = lr(t, e), [{ dataSource: K, itemOperationsAccess: ht, condition: li, tab: ci, keyword: di, page: sn, total: ln, pageSize: cn, sider: ui, onConditionChange: pi, onTabChange: gi, onKeywordChange: hi, onPageChange: mi, onPageSizeChange: fi, onSiderChange: yi, onReload: Tt, payload: wi }, dn] = sr(ae, t, p, u), bi = wn(l); Yt(() => { bi(K, { primaryKey: p, page: sn, pageSize: cn, total: ln }); }, [K]); @@ -365,32 +365,32 @@ const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, const mn = new Map(Ot.map((se) => [se == null ? void 0 : se[p], se])); return Ae.forEach((se) => mn.set(se == null ? void 0 : se[p], se)), Q.map((se) => mn.get(se)).filter(Boolean); }), Ci(Q), xe == null || xe(Q, Ae); - }), Ei = B(() => D ? { columnWidth: 80, ...q, type: D, selectedRowKeys: un, onChange: hn } : void 0, [D, un, hn, s]), $i = B(() => w.merge({}, k, r), [k, r]), Pi = B(() => g == null ? void 0 : g.map((Q) => w.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), [g]), vi = B(() => ({ ...I, themeProps: F }), [I, F]); - return h(_n, { listCode: t, title: T, classNames: a, layouts: o, resource: u, primaryKey: p, theme: i || E, themeProps: $i, isTreeSider: S, treeSiderConfig: b, isPaginate: N, rowSelection: Ei, getSelectedRows: gn, tabs: M, isItemOperations: Si, itemOperations: Pi, isBatchOperations: xi, batchOperations: m, isItemGridLayout: $, columns: f, itemGridLayout: vi, isConditionFormLayout: y, itemOperationsAccess: ht, dataSource: K, onConditionChange: pi, onTabChange: gi, onKeywordChange: hi, onPageChange: mi, onPageSizeChange: fi, onSiderChange: yi, condition: li, tab: ci, keyword: di, page: sn, total: ln, pageSize: cn, sider: ui, payload: wi, className: j("ff-data-list-helper", n), onReload: Tt, onClickCallback: dn }); + }), Ei = B(() => D ? { columnWidth: 80, ...q, type: D, selectedRowKeys: un, onChange: hn } : void 0, [D, un, hn, s]), $i = B(() => w.merge({}, S, r), [S, r]), Pi = B(() => g == null ? void 0 : g.map((Q) => w.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), [g]), vi = B(() => ({ ...I, themeProps: F }), [I, F]); + return h(_n, { listCode: t, title: T, classNames: a, layouts: o, resource: u, primaryKey: p, theme: i || E, themeProps: $i, isTreeSider: k, treeSiderConfig: b, isPaginate: N, rowSelection: Ei, getSelectedRows: gn, tabs: M, isItemOperations: Si, itemOperations: Pi, isBatchOperations: xi, batchOperations: m, isItemGridLayout: $, columns: f, itemGridLayout: vi, isConditionFormLayout: y, itemOperationsAccess: ht, dataSource: K, onConditionChange: pi, onTabChange: gi, onKeywordChange: hi, onPageChange: mi, onPageSizeChange: fi, onSiderChange: yi, condition: li, tab: ci, keyword: di, page: sn, total: ln, pageSize: cn, sider: ui, payload: wi, className: j("ff-data-list-helper", n), onReload: Tt, onClickCallback: dn }); }), Hn = (t, e, n = !0) => n !== !0 && n-- <= 0 ? [] : w.isArray(t) && !w.isEmpty(t) ? t.reduce((i, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && i.push(r[e]), Reflect.has(r, "children") && !w.isEmpty(r.children) ? i.concat(Hn(r.children, e, n)) : i), []) : [], wr = ({ className: t, primaryKey: e, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { const { classNames: c } = de(oe), u = H(null), p = H(null), [m, g] = L([]), [f, y] = L({ width: 0, height: 0 }); W(() => { g(Hn(i, e)); }, [i, e]), Ri(() => { - const k = new ResizeObserver(() => { + const S = new ResizeObserver(() => { var $; y({ width: (($ = u.current) == null ? void 0 : $.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); }); - return p.current && k.observe(p.current), () => { - p.current && k.unobserve(p.current); + return p.current && S.observe(p.current), () => { + p.current && S.unobserve(p.current); }; }, []); - const S = B(() => { + const k = B(() => { if (!(f != null && f.width) || !(n != null && n.length)) return n; - const k = (s ? s.columnWidth ?? 32 : 0) + (r ? o : 0), $ = n.reduce((T, N) => T + (N != null && N.isWidthFixed && N.width ? N.width : 0), 0), F = n.filter((T) => !(T != null && T.isWidthFixed)).reduce((T, N) => T + ((N == null ? void 0 : N.width) ?? 100), 0); - if ($ + F + k >= f.width) return n; - const I = f.width - $ - k; + const S = (s ? s.columnWidth ?? 32 : 0) + (r ? o : 0), $ = n.reduce((T, N) => T + (N != null && N.isWidthFixed && N.width ? N.width : 0), 0), F = n.filter((T) => !(T != null && T.isWidthFixed)).reduce((T, N) => T + ((N == null ? void 0 : N.width) ?? 100), 0); + if ($ + F + S >= f.width) return n; + const I = f.width - $ - S; return n.map((T) => T != null && T.isWidthFixed ? T : { ...T, width: Math.floor(I * ((T == null ? void 0 : T.width) ?? 100) / F) }); - }, [n, f.width, s, r, o]), b = or(S), E = ar(a); - return h("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: f.height ? h(bn, { bordered: !0, ...l, components: E, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { + }, [n, f.width, s, r, o]), b = or(k), E = ar(a); + return h("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: f.height ? h(bn, { bordered: !0, ...l, components: E, ref: u, rowKey: (S) => (S == null ? void 0 : S[e]) ?? Math.random(), rowSelection: s, columns: (() => { var $, F; - const k = [...b ?? []]; - return s && k.splice((F = ($ = k[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, bn.SELECTION_COLUMN), r && k.push({ title: "操作", align: "center", fixed: "right", className: "ff-data-list-table-operations", width: `${Math.ceil(o / f.width * 100).toFixed(2)}%`, render: (I, T, N) => r(T, N) }), k; + const S = [...b ?? []]; + return s && S.splice((F = ($ = S[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, bn.SELECTION_COLUMN), r && S.push({ title: "操作", align: "center", fixed: "right", className: "ff-data-list-table-operations", width: `${Math.ceil(o / f.width * 100).toFixed(2)}%`, render: (I, T, N) => r(T, N) }), S; })(), dataSource: i, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: m } }) : null }); }, br = "RC_FORM_INTERNAL_HOOKS", Cr = (t) => { const [e, n] = x.useState({ items: [] }); @@ -399,7 +399,7 @@ const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, }, [t]), e; }, kr = (t, { initialValue: e, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: o = "string" }, a = null) => { const s = H(!1), l = de(jn), [c, u] = L(), [p, m] = L(n != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(br) || {}; - return W(() => g == null ? void 0 : g((f, y, S) => { + return W(() => g == null ? void 0 : g((f, y, k) => { if (!s.current) return; const b = w.get(y, t); w.isEqual(b, p) || m(ce(b, o)); @@ -413,7 +413,7 @@ const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, }, To = (t, e, n = null) => B(() => en(t, e, n), [t]), Jn = (t, e, n = {}, i = {}, r = {}, o = null) => { const a = de(jn), s = Pt(), l = H(!0), c = H([]), [u, p] = L(e), [m, g] = L(), f = re.useWatch((y) => JSON.stringify(w.pick(y, c.current)), a) || "{}"; return vt(() => { - t && Be.exec(t, n, { ...i, getFieldValueForBasicForm: (y) => r ? r.getFieldValue(y) : null, getFieldValue: w.wrap(a.getFieldValue, (y, S) => (c.current.some((b) => w.isEqual(b, S)) || (c.current.push(S), s()), y == null ? void 0 : y(S))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((y) => { + t && Be.exec(t, n, { ...i, getFieldValueForBasicForm: (y) => r ? r.getFieldValue(y) : null, getFieldValue: w.wrap(a.getFieldValue, (y, k) => (c.current.some((b) => w.isEqual(b, k)) || (c.current.push(k), s()), y == null ? void 0 : y(k))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((y) => { l.current && (p(y), g(null)); }).catch((y) => { l.current && (p(e), g(y)); @@ -425,10 +425,10 @@ const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, r && ne.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: xr(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(x.createElement(s.default, i))); }, [r]), o; }, xr = (t, e = {}, n = null) => (i) => { - const { code: r, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: m, ...g } = w.merge({}, e, i), [f, y] = kr(s ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, n), S = B(() => { - const k = Object.keys((e == null ? void 0 : e.extras) || {}); - return w.over([w.partialRight(w.pick, k), w.partialRight(w.omit, k)]); - }, [e == null ? void 0 : e.extras]), [b, E] = S(g); + const { code: r, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: m, ...g } = w.merge({}, e, i), [f, y] = kr(s ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, n), k = B(() => { + const S = Object.keys((e == null ? void 0 : e.extras) || {}); + return w.over([w.partialRight(w.pick, S), w.partialRight(w.omit, S)]); + }, [e == null ? void 0 : e.extras]), [b, E] = k(g); return h(t, { ...E, value: f, rawValue: y, $setting: Object.assign({}, a, b) }); }, Gn = ({ theme: t, basicForm: e, items: n = [{ key: "default", label: "默认" }], fields: i = [], itemRender: r, chunks: o = [], children: a, $setting: s = {}, ...l }) => { const [c, u] = L(); @@ -440,28 +440,28 @@ const Kn = Wt.getInstance(), tn = x.forwardRef(({ listCode: t, base62params: e, }, [t]); const p = B(() => n == null ? void 0 : n.map((m) => ({ ...m, children: r(m, i == null ? void 0 : i.filter((g) => !(g != null && g.group) && m.key == "default" || g.group == m.key), m.key == "default" ? a : null) })).concat(o), [n, a, o]); return c && x.cloneElement(c, { items: p, basicForm: e, $setting: { ...s, ...l } }); -}, Yn = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: m, theme: g, themeProps: f = {}, groups: y = [{ key: "default", label: "默认" }], children: S, ...b }) => { - const [E] = re.useForm(e), k = B(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); +}, Yn = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: m, theme: g, themeProps: f = {}, groups: y = [{ key: "default", label: "默认" }], children: k, ...b }) => { + const [E] = re.useForm(e), S = B(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); pt(() => (E.setFieldsValue(m), () => E.resetFields()), [m]); const $ = (F, I, T) => { const N = en(I, Sr, n), M = Wn(b); return A("div", { ...M, className: j("ff-grid-layout", r), style: { ...i, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [N, T && x.cloneElement(T, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: I, basicForm: n })] }); }; - return h(re, { ...b, fields: k, form: E, component: !1, children: g ? h(Gn, { ...f, items: y, theme: g, itemRender: $, fields: p, children: S, basicForm: n }) : $(0, p, S) }); + return h(re, { ...b, fields: S, form: E, component: !1, children: g ? h(Gn, { ...f, items: y, theme: g, itemRender: $, fields: p, children: k, basicForm: n }) : $(0, p, k) }); }, Oo = /* @__PURE__ */ ((t) => function({ code: e, data: n, ...i }) { const { uuid: r, resource: o, items: a, hides: s, rowHeight: l, marginX: c, marginY: u, cols: p, theme: m, themeProps: g, groups: f } = Cr(e) || {}, y = B(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, o]); return o && h(t, { name: e, theme: m, themeProps: g, groups: f, ...i, fields: a, formFields: y, rowHeight: l, cols: p, itemMargin: [c, u], data: o ? { [o]: n } : n }); -})(Yn), Er = ({ column: t = 0, colWidth: e = 0, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, primaryKey: s, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: m = ($, F, I) => $, empty: g = h(Dt, { description: null }), className: f, style: y = {}, theme: S, themeProps: b = {}, groups: E = [{ key: "default", label: "默认" }], rowSelection: k }) => { +})(Yn), Er = ({ column: t = 0, colWidth: e = 0, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, primaryKey: s, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: m = ($, F, I) => $, empty: g = h(Dt, { description: null }), className: f, style: y = {}, theme: k, themeProps: b = {}, groups: E = [{ key: "default", label: "默认" }], rowSelection: S }) => { const { classNames: $ } = de(oe), F = J((N) => { - if (!k) return; - const { selectedRowKeys: M = [], onChange: P, type: V = "checkbox" } = k, D = N == null ? void 0 : N[s]; + if (!S) return; + const { selectedRowKeys: M = [], onChange: P, type: V = "checkbox" } = S, D = N == null ? void 0 : N[s]; let U; U = V === "radio" ? [D] : M.includes(D) ? M.filter((X) => X !== D) : [...M, D], P == null || P(U, l.filter((X) => U.includes(X == null ? void 0 : X[s]))); - }, [k, s, l]), I = B(() => h(Yn, { groups: E, theme: S, themeProps: b, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, className: p }), [a, n, i, r, o, E, S, b]), T = w.isEmpty(l); + }, [S, s, l]), I = B(() => h(Yn, { groups: E, theme: k, themeProps: b, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, className: p }), [a, n, i, r, o, E, k, b]), T = w.isEmpty(l); return A("div", { className: j("ff-data-list-content", $.content, f), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), T ? g : l.map((N, M) => { var U; const P = (N == null ? void 0 : N[s]) ?? M, V = `${P}-${Tr(N)}`, D = m(x.cloneElement(I, { data: N }), N, M); - return x.cloneElement(D, { key: V, ...k && { isSelected: (U = k == null ? void 0 : k.selectedRowKeys) == null ? void 0 : U.includes(P), selectionType: k.type ?? "checkbox", onSelect: () => F(N) } }); + return x.cloneElement(D, { key: V, ...S && { isSelected: (U = S == null ? void 0 : S.selectedRowKeys) == null ? void 0 : U.includes(P), selectionType: S.type ?? "checkbox", onSelect: () => F(N) } }); }), u == null ? void 0 : u(l)] }); }, $r = ({ component: t, $props: e }) => { const { base62params: n } = $t(e, {}); @@ -546,8 +546,8 @@ const me = class me { if (d(this, ye)) return d(this, ye); const n = Ue.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = Ue.get(ne.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, o = (s, l) => () => Promise.all([ne.getWidgetComponent(s), $t(l)]).then(([c, u]) => [c.default || function() { return `${s}`; - }, u]).then(([c, u]) => ({ Component: () => x.createElement(Ln, {}, x.createElement(c, { $setting: u })) })), a = Array.from(d(this, le).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: f, isLogin: y, isLayout: S, extra: b }) => { - let E = {}, k = 0; + }, u]).then(([c, u]) => ({ Component: () => x.createElement(Ln, {}, x.createElement(c, { $setting: u })) })), a = Array.from(d(this, le).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: f, isLogin: y, isLayout: k, extra: b }) => { + let E = {}, S = 0; switch (p) { case "list": E.element = x.createElement($r, { component: m, $props: f }); @@ -559,9 +559,9 @@ const me = class me { if ($) { const F = (b == null ? void 0 : b.themeProps) ?? (b == null ? void 0 : b.layoutProps); if (!r[$]) return r[$] = s.length, [...s, { path: "/", lazy: o($, F), children: [{ path: c, ...E }] }]; - k = r[$]; + S = r[$]; } - return S && k > -1 ? (s[k].children.push({ path: c, ...E }), s) : [...s, { path: c, ...E }]; + return k && S > -1 ? (s[S].children.push({ path: c, ...E }), s) : [...s, { path: c, ...E }]; }, [{ path: "/", lazy: o(n, {}), children: [] }]); return a.push({ index: !0, element: x.createElement(vr, { to: i, replace: !0 }) }), _(this, ye, Yi(a, e)); }); @@ -738,9 +738,9 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb }, Ir = (t) => { const [e, n] = x.useState({ items: [], hides: [] }); return x.useEffect(() => { - t && z.get(`/api/_/${t}`).then(({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: m, listenChangeFieldsFunc: g, fields: f, theme: y, themeSetting: S, groups: b }) => ({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: y, themeProps: S, groups: b, listenChangeFields: m, listenChangeFieldsFunc: g, ...f.reduce((E, k) => { + t && z.get(`/api/_/${t}`).then(({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: m, listenChangeFieldsFunc: g, fields: f, theme: y, themeSetting: k, groups: b }) => ({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: y, themeProps: k, groups: b, listenChangeFields: m, listenChangeFieldsFunc: g, ...f.reduce((E, S) => { var $; - return ($ = k == null ? void 0 : k.field) != null && $.hidden ? E.hides.push(k == null ? void 0 : k.field) : E.items.push(k), E; + return ($ = S == null ? void 0 : S.field) != null && $.hidden ? E.hides.push(S == null ? void 0 : S.field) : E.items.push(S), E; }, { items: [], hides: [] }) })).then(n); }, [t]), e; }, Ar = ({ max: t = 0, min: e = 0, type: n = "", message: i, pattern: r, required: o = !1, validator: a } = {}, s, l) => { @@ -829,22 +829,22 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb s && ne.getWidgetComponent(s).then(({ defaultProps: p = {}, default: m }) => ({ default: zr(m, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(x.createElement(p.default, o))); }, [s]), c && x.cloneElement(c, { ...o, ...l }); }, zr = (t, e = {}, n = null) => (i) => { - const { type: r, code: o, label: a, noStyle: s, style: l, placeholder: c, required: u = !1, extras: p, validators: m, help: g, isVirtual: f, $isReserved: y, initialValue: S, initialValueLanguage: b, ...E } = w.omit(w.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Ar(Object.assign({}, m, u ? { required: !0 } : {}), o, r), $ = B(() => { + const { type: r, code: o, label: a, noStyle: s, style: l, placeholder: c, required: u = !1, extras: p, validators: m, help: g, isVirtual: f, $isReserved: y, initialValue: k, initialValueLanguage: b, ...E } = w.omit(w.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), S = Ar(Object.assign({}, m, u ? { required: !0 } : {}), o, r), $ = B(() => { const M = Object.keys((e == null ? void 0 : e.extras) || {}); return w.over([w.partialRight(w.pick, M), w.partialRight(w.omit, M)]); }, [e == null ? void 0 : e.extras]), [F, I] = $(E), T = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, N = J((M) => M == null ? void 0 : ce(M, r), [r]); - return h(Xt, { name: o, rules: k, initialValue: N(S), normalize: N, children: (M, P, V) => { + return h(Xt, { name: o, rules: S, initialValue: N(k), normalize: N, children: (M, P, V) => { var D; - return h(t, { type: r, rcform: V, basicForm: n, itemProps: { validateStatus: P.errors.length > 0 ? "error" : "success", tooltip: g || null, help: P.errors.length > 0 ? P.errors.join("、") : null, required: ((D = k == null ? void 0 : k[0]) == null ? void 0 : D.required) || !1, ...T }, fieldProps: { placeholder: c, ...I, ...M }, $setting: Object.assign({}, p, F) }); + return h(t, { type: r, rcform: V, basicForm: n, itemProps: { validateStatus: P.errors.length > 0 ? "error" : "success", tooltip: g || null, help: P.errors.length > 0 ? P.errors.join("、") : null, required: ((D = S == null ? void 0 : S[0]) == null ? void 0 : D.required) || !1, ...T }, fieldProps: { placeholder: c, ...I, ...M }, $setting: Object.assign({}, p, F) }); } }); -}, rn = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: m = {}, formFields: g = [], listenChangeFields: f, listenChangeFieldsFunc: y, onValuesChange: S, theme: b, themeProps: E = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...F }) => { +}, rn = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: m = {}, formFields: g = [], listenChangeFields: f, listenChangeFieldsFunc: y, onValuesChange: k, theme: b, themeProps: E = {}, groups: S = [{ key: "default", label: "默认" }], children: $, ...F }) => { const [I] = re.useForm(e), T = J((P, V) => { - S == null || S(P, V), y && Array.isArray(f) && Be.exec(y, { changedValues: P, allValues: V }, { getFieldValue: I.getFieldValue, setFieldValue: I.setFieldValue, setFieldsValue: I.setFieldsValue, isFieldTouched: I.isFieldTouched, isFieldsTouched: I.isFieldsTouched }).catch((D) => console.error("onFormValuesChange", t, D)); - }, [t, I, S, f, y]), N = B(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), M = (P, V, D) => { + k == null || k(P, V), y && Array.isArray(f) && Be.exec(y, { changedValues: P, allValues: V }, { getFieldValue: I.getFieldValue, setFieldValue: I.setFieldValue, setFieldsValue: I.setFieldsValue, isFieldTouched: I.isFieldTouched, isFieldsTouched: I.isFieldsTouched }).catch((D) => console.error("onFormValuesChange", t, D)); + }, [t, I, k, f, y]), N = B(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), M = (P, V, D) => { const U = en(V, nn, n), X = Wn(F); return A("div", { ...X, className: j("ff-grid-layout-form", r), style: { ...i, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [U, D && x.cloneElement(D, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: V, basicForm: n })] }); }; - return A(re, { ...F, form: I, fields: N, onValuesChange: T, children: [b ? h(Gn, { ...E, items: k, theme: b, itemRender: M, fields: c, children: $, basicForm: n }) : M(0, c, $), u == null ? void 0 : u.map((P) => { + return A(re, { ...F, form: I, fields: N, onValuesChange: T, children: [b ? h(Gn, { ...E, items: S, theme: b, itemRender: M, fields: c, children: $, basicForm: n }) : M(0, c, $), u == null ? void 0 : u.map((P) => { var V; return h(Xt, { name: P.code, children: h(Ur, { form: I, basicForm: n, name: P.code, type: P.type, initialValue: P.initialValue, initialValueLanguage: (V = P.extras) == null ? void 0 : V.initialValueLanguage }) }, JSON.stringify(P.code)); })] }); @@ -856,8 +856,8 @@ const En = { null2json: (t) => Object.create(), null2array: (t) => [], null2numb }; rn.propTypes = { fields: C.array, hides: C.array }; const Br = /* @__PURE__ */ ((t) => ({ code: e, isPreview: n = !1, ...i }) => { - const { align: r, autoComplete: o, resource: a, items: s, hides: l, rowHeight: c, marginX: u, marginY: p, cols: m, listenChangeFields: g, listenChangeFieldsFunc: f, pk: y, uuid: S, theme: b, themeProps: E, groups: k } = Ir(e), $ = B(() => [{ name: "__PK__", value: y }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: S }], [y, e, S, a]); - return h(t, { name: e, autoComplete: o, theme: b, themeProps: E, groups: k, ...i, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: f, fields: s, hides: l, cols: m, rowHeight: c, itemMargin: [u, p] }); + const { align: r, autoComplete: o, resource: a, items: s, hides: l, rowHeight: c, marginX: u, marginY: p, cols: m, listenChangeFields: g, listenChangeFieldsFunc: f, pk: y, uuid: k, theme: b, themeProps: E, groups: S } = Ir(e), $ = B(() => [{ name: "__PK__", value: y }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: k }], [y, e, k, a]); + return h(t, { name: e, autoComplete: o, theme: b, themeProps: E, groups: S, ...i, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: f, fields: s, hides: l, cols: m, rowHeight: c, itemMargin: [u, p] }); })(rn), ii = ({ $setting: t, $close: e, extras: n, code: i, primaryKey: r, ...o }) => { const [a] = re.useForm(), s = Mr(a, i, r, t); return h(te, { actions: A(x.Fragment, { children: [h(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), h(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: n, children: h(Br, { form: a, code: i, primaryKey: r, ...o }) }); @@ -907,10 +907,10 @@ const Wr = (t, e, n, i) => ke.redirect(n, e, i), qr = (t, e = {}, n, i = {}) => if (w.isFunction(t)) return [w.partialRight(vn, (r == null ? void 0 : r.code) || t, { status: c, setStatus: u }), null]; } return [(...y) => console.error("useButton unknown widgetType", e, ...y), null]; - }, [t, e, r, o, l.getBase62params, l.getSelectedRows]), f = w.debounce((y) => (s == null || s(y), Promise.resolve($t(i, y, { list: l })).then((S) => { - const b = m(y, { ...n, ...S }); - return b != null && b.update && g && (p.current = (E, k) => b.update(g(E), k)), b; - }).then((S) => a == null ? void 0 : a(S)).catch(console.error)), 300, { leading: !0, trailing: !1 }); + }, [t, e, r, o, l.getBase62params, l.getSelectedRows]), f = w.debounce((y) => (s == null || s(y), Promise.resolve($t(i, y, { list: l })).then((k) => { + const b = m(y, { ...n, ...k }); + return b != null && b.update && g && (p.current = (E, S) => b.update(g(E), S)), b; + }).then((k) => a == null ? void 0 : a(k)).catch(console.error)), 300, { leading: !0, trailing: !1 }); return Yt(() => { var y; (y = p.current) == null || y.call(p, r, o); @@ -919,26 +919,26 @@ const Wr = (t, e, n, i) => ke.redirect(n, e, i), qr = (t, e = {}, n, i = {}) => const s = { type: "primary", className: j("ff-button", n), iconPosition: r, size: o }; return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), a === "link" || a === "dashed" ? (s.type = a, t === "default" && (s.className = j(s.className, "ff-default"))) : a !== "circle" && a !== "round" || (s.shape = a), i && (s.icon = h(Ct, { type: i })), e && (s.children = e), s; }, [a, t, n, i, r]), Nt = ({ data: t, widget: e, widgetType: n = "fsdpf-component", widgetData: i, widgetProps: r, widgetSetting: o, widgetContainerProps: a, onAfterClick: s, onBeforeClick: l, children: c, extras: u }) => { - const p = de(oe), [m, g] = L(!1), [f, y] = L("hover"), [S, b] = ni(r, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, k] = L(), { placement: $, align: F, zIndex: I, arrow: T = { pointAtCenter: !0 }, getPopupContainer: N, isPopupMountBodyContainer: M = !0, ...P } = a || {}; + const p = de(oe), [m, g] = L(!1), [f, y] = L("hover"), [k, b] = ni(r, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, S] = L(), { placement: $, align: F, zIndex: I, arrow: T = { pointAtCenter: !0 }, getPopupContainer: N, isPopupMountBodyContainer: M = !0, ...P } = a || {}; W(() => { - n == "grid-layout-form" ? k(x.createElement(ii, { ...i, $setting: o, code: e })) : n == "data-list" ? k(x.createElement(tn, { base62params: t, $setting: o, listCode: e })) : w.isString(e) ? ne.getWidgetComponent(e).then(({ default: U }) => { - k(x.createElement(U, { ...i, $setting: o })); - }).catch((U) => k(U.toString())) : x.isValidElement(e) ? k(x.cloneElement(e, { ...i, $setting: o })) : (si(e) || w.isFunction(e) && ["component", "fsdpf-component"].includes(n)) && k(x.createElement(e, { ...i, $setting: o })); + n == "grid-layout-form" ? S(x.createElement(ii, { ...i, $setting: o, code: e })) : n == "data-list" ? S(x.createElement(tn, { base62params: t, $setting: o, listCode: e })) : w.isString(e) ? ne.getWidgetComponent(e).then(({ default: U }) => { + S(x.createElement(U, { ...i, $setting: o })); + }).catch((U) => S(U.toString())) : x.isValidElement(e) ? S(x.cloneElement(e, { ...i, $setting: o })) : (si(e) || w.isFunction(e) && ["component", "fsdpf-component"].includes(n)) && S(x.createElement(e, { ...i, $setting: o })); }, [e, n, i]); - const V = (U, X = !1) => (g(U), !U && y("hover"), U ? l == null ? void 0 : l(S) : s == null ? void 0 : s(X)), D = (U) => { + const V = (U, X = !1) => (g(U), !U && y("hover"), U ? l == null ? void 0 : l(k) : s == null ? void 0 : s(X)), D = (U) => { g(!0), y("click"); }; - return h(Bi, { zIndex: I, placement: $, onPopupClick: D, onClick: D, open: m, align: F, arrow: T, trigger: f, getPopupContainer: N || M ? void 0 : (U) => U, content: h(Jr, { ...P, extras: u, children: E && x.cloneElement(E, { ...S, $setProps: b, $close: (U) => V(!1, U) }) }), children: c, onOpenChange: V }); -}, Jr = ({ title: t, className: e, classNames: n, children: i, extras: r, width: o, height: a, ...s }) => { - const [l, c] = L({}), u = J((f, y) => c((S) => ({ ...S, [f]: y })), []), p = J((f) => c((y) => ({ ...y, [f]: void 0 })), []), m = t ? x.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = r ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, r); - return h(ut.Provider, { value: { ele: l, mount: u, unmount: p }, children: A("div", { className: j("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [A("div", { className: j("ff-popup-header", "ff-popover-header", n == null ? void 0 : n.header), children: [m, l == null ? void 0 : l["sub-title"]] }), h("div", { className: j("ff-popup-body", "ff-popover-body", n == null ? void 0 : n.body), children: i }), A("div", { className: j("ff-popup-footer", "ff-popover-footer", n == null ? void 0 : n.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); + return h(Bi, { zIndex: I, placement: $, onPopupClick: D, onClick: D, open: m, align: F, arrow: T, trigger: f, getPopupContainer: N || M ? void 0 : (U) => U, content: h(Jr, { ...P, extras: u, children: E && x.cloneElement(E, { ...k, $setProps: b, $close: (U) => V(!1, U) }) }), children: c, onOpenChange: V }); +}, Jr = ({ title: t, className: e, classNames: n, children: i, extras: r, width: o, height: a, style: s, ...l }) => { + const [c, u] = L({}), p = J((y, k) => u((b) => ({ ...b, [y]: k })), []), m = J((y) => u((k) => ({ ...k, [y]: void 0 })), []), g = t ? x.createElement("div", { className: "ff-popup-title" }, t) : c == null ? void 0 : c.title, f = r ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, r); + return h(ut.Provider, { value: { ele: c, mount: p, unmount: m }, children: A("div", { className: j("ff-popup ff-popover", e, c.rootClassName), style: { ...s, width: o ?? 260, height: a }, ...l, children: [A("div", { className: j("ff-popup-header", "ff-popover-header", n == null ? void 0 : n.header), children: [g, c == null ? void 0 : c["sub-title"]] }), h("div", { className: j("ff-popup-body", "ff-popover-body", n == null ? void 0 : n.body), children: i }), A("div", { className: j("ff-popup-footer", "ff-popover-footer", n == null ? void 0 : n.footer), children: [f, c == null ? void 0 : c.extras, c == null ? void 0 : c.actions] })] }) }); }; Nt.propTypes = { widgetType: C.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; -const gt = (t) => function({ className: e, variant: n, children: i, name: r, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: m, disabled: g, tooltip: f, confirm: y, widget: S = () => { -}, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: F, ...I }) { +const gt = (t) => function({ className: e, variant: n, children: i, name: r, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: m, disabled: g, tooltip: f, confirm: y, widget: k = () => { +}, widgetType: b, widgetData: E, widgetProps: S, widgetSetting: $, widgetContainerProps: F, ...I }) { const { mode: T, ...N } = F || {}, M = ri({ className: e, name: r, type: a, icon: o, iconPosition: s }, n ?? t), P = h(wt, { ...M, ...I, children: i || r }); - if (T === "popover" && !["destroy", "redirect", "func"].includes(b)) return h(Nt, { data: p, widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: N, onAfterClick: c, onBeforeClick: u, children: P }); - const V = w.isEmpty(f) || !f.enabled ? {} : f, D = w.isEmpty(y) ? { enabled: !1 } : Object.assign({ enabled: !0 }, y), [U, X] = L(!1), [xe, { disabled: q, loading: ae }] = Hr({ widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: N }, { onAfterClick: c, onBeforeClick: u }); + if (T === "popover" && !["destroy", "redirect", "func"].includes(b)) return h(Nt, { data: p, widget: k, widgetType: b, widgetData: E, widgetProps: S, widgetSetting: $, widgetContainerProps: N, onAfterClick: c, onBeforeClick: u, children: P }); + const V = w.isEmpty(f) || !f.enabled ? {} : f, D = w.isEmpty(y) ? { enabled: !1 } : Object.assign({ enabled: !0 }, y), [U, X] = L(!1), [xe, { disabled: q, loading: ae }] = Hr({ widget: k, widgetType: b, widgetData: E, widgetProps: S, widgetSetting: $, widgetContainerProps: N }, { onAfterClick: c, onBeforeClick: u }); return h(Wi, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...D, disabled: q || g, open: U, onOpenChange: (K) => { if (!K) return X(K); D.enabled ? X(K) : xe(p); @@ -955,13 +955,13 @@ const Gr = gt("link"), Yr = gt("circle"), Xr = gt("round"), Qr = gt("dashed"), T if (w.isEmpty(t)) return p; l ?? (l = o), s ?? (s = r); const [g, f] = B(() => (t || []).reduce((b, E) => { - const k = e.indexOf(E.widgetType); - return k === -1 ? b[1].push(E) : b[0] ? k < e.indexOf(b[0].widgetType) ? (b[1].push(b[0]), b[0] = E) : b[1].push(E) : b[0] = E, b; + const S = e.indexOf(E.widgetType); + return S === -1 ? b[1].push(E) : b[0] ? S < e.indexOf(b[0].widgetType) ? (b[1].push(b[0]), b[0] = E) : b[1].push(E) : b[0] = E, b; }, [null, []]), [t, e]); a ? p = a(g, m) || p : p || (p = h(wt, { ...ri(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), r) })); const y = f.map((b) => c(Object.assign({ uuid: b.uuid, type: b.type, name: b.name, widget: b.widget, widgetType: b.widgetType, widgetProps: b.widgetProps, widgetData: b.widgetData, widgetSetting: b.widgetSetting, widgetContainerProps: b.widgetContainerSetting, confirm: b.confirm, onAfterClick: w.partialRight(n, b, m), onBeforeClick: w.partialRight(i, b, m) }, { size: l, variant: s }), m)); - let S = y; - return (y == null ? void 0 : y.length) > 1 && (S = s == "link" ? h(Mt, { split: h(_i, { type: "vertical" }), size: l, children: y }) : h(Mt.Compact, { size: l, children: y })), g ? h(Nt, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, u, g == null ? void 0 : g.widgetContainerProps), data: m, widgetData: g == null ? void 0 : g.widgetData, extras: S, onAfterClick: w.partialRight(n, g, m), onBeforeClick: w.partialRight(i, g, m), children: p }) : S; + let k = y; + return (y == null ? void 0 : y.length) > 1 && (k = s == "link" ? h(Mt, { split: h(_i, { type: "vertical" }), size: l, children: y }) : h(Mt.Compact, { size: l, children: y })), g ? h(Nt, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, u, g == null ? void 0 : g.widgetContainerProps), data: m, widgetData: g == null ? void 0 : g.widgetData, extras: k, onAfterClick: w.partialRight(n, g, m), onBeforeClick: w.partialRight(i, g, m), children: p }) : k; }; Tn.propTypes = { triggerWeights: C.array, options: C.arrayOf(C.shape({ ...R.propTypes, widgetType: R.propTypes.widgetType.isRequired })), btnSize: R.propTypes.size, btnRender: C.func, btnVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: C.func, labelSize: R.propTypes.size, onAfterClick: C.func, onBeforeClick: C.func, widgetContainerProps: R.propTypes.widgetContainerProps, data: R.propTypes.data }, R.Link = Gr, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = Yr, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = Xr, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = Qr, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = Nt, R.GroupPopover = Tn; const Zr = ({ fields: t, formProps: e, $close: n }) => { @@ -969,13 +969,13 @@ const Zr = ({ fields: t, formProps: e, $close: n }) => { return h(te, { actions: A(x.Fragment, { children: [h(R, { name: "取消", widget: () => n(!1) }), h(R, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: h(re, { fields: r, form: i, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => h(nn, { code: o, ...a }, o)) }) }); }, eo = ({ className: t, classNames: e, $close: n, children: i, title: r, subTitle: o, actions: a, extras: s, ...l }) => A(Qi, { ...l, prefixCls: "ff-drawer", className: j("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [A("div", { className: j("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(Zt, { type: "close" }) }), r, o] }), h("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: i }), A("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), to = ({ className: t, classNames: e, $close: n, $event: i, children: r, title: o, subTitle: a, actions: s, extras: l, placement: c, ...u }) => { const { style: p, rest: m } = ((f, y = ["height", "width", "style"]) => { - const S = { ...f }, b = {}; - for (const E of y) E === "style" ? Object.assign(b, S.style) : S[E] !== void 0 && (b[E] = S[E]), delete S[E]; - return { style: b, rest: S }; + const k = { ...f }, b = {}; + for (const E of y) E === "style" ? Object.assign(b, k.style) : k[E] !== void 0 && (b[E] = k[E]), delete k[E]; + return { style: b, rest: k }; })(u), g = (i == null ? void 0 : i.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: i == null ? void 0 : i.pageX, y: i == null ? void 0 : i.pageY } }; return h(Zi, { ...m, ...g, prefixCls: "ff-modal", className: j("ff-popup", t), modalRender: () => A(x.Fragment, { children: [h("button", { className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: m.onClose, children: h(Zt, { type: "close" }) }), A("div", { className: j("ff-modal-content"), style: p, children: [A("div", { className: j("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [o, a] }), h("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), A("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] })] }) }); }, oi = ({ placement: t, $close: e, $event: n, children: i, title: r, ...o }) => { - const [a, s] = L({}), [l, c] = L(!0), u = J((f, y) => s((S) => ({ ...S, [f]: y })), []), p = J((f) => s((y) => ({ ...y, [f]: void 0 })), []); + const [a, s] = L({}), [l, c] = L(!0), u = J((f, y) => s((k) => ({ ...k, [f]: y })), []), p = J((f) => s((y) => ({ ...y, [f]: void 0 })), []); let m = { ...o, className: a.rootClassName, title: a.title || r && x.createElement("div", { className: j("ff-popup-title") }, r), subTitle: a["sub-title"], actions: a.actions, extras: a.extras, children: i, $close: e, $event: n, onClose: () => c(!1) }; const g = () => { e(!1); @@ -1010,13 +1010,13 @@ const no = ({ widget: t, widgetProps: e, $close: n, onSetProps: i }) => { }); return c.update = l, c; }, r = ([o, a], s, l = {}, c = {}) => { - const u = Y.$index++, p = (f) => ((y, S) => (Y.$popups.delete(y), n(), S == null ? void 0 : S()))(u, () => o(f)); + const u = Y.$index++, p = (f) => ((y, k) => (Y.$popups.delete(y), n(), k == null ? void 0 : k()))(u, () => o(f)); if (s === Vn) return t.open({ ...c, key: u, content: x.createElement(s, { ...l, $close: () => t.close(u) }), onClose: () => p() }), () => { }; const { $setProps: m, ...g } = l; return Y.$popups.set(u, { widget: s, widgetProps: g, widgetContainerProps: c, $close: p, onSetProps: m }), n(), (f, y) => { - const S = Y.$popups.get(u); - S && (Y.$popups.set(u, { ...S, widgetProps: f ? { ...S.widgetProps, ...f } : S.widgetProps, widgetContainerProps: y ? { ...S.widgetContainerProps, ...y } : S.widgetContainerProps }), n()); + const k = Y.$popups.get(u); + k && (Y.$popups.set(u, { ...k, widgetProps: f ? { ...k.widgetProps, ...f } : k.widgetProps, widgetContainerProps: y ? { ...k.widgetContainerProps, ...y } : k.widgetContainerProps }), n()); }; }; return A(x.Fragment, { children: [Array.from(Y.$popups).map(([o, { widget: a, widgetProps: s, widgetContainerProps: l, $close: c, onSetProps: u }]) => h(oi, { maskClosable: !1, $event: s == null ? void 0 : s.$event, ...l, $close: c, children: h(no, { widget: a, widgetProps: s, $close: c, onSetProps: u }) }, o)), e] }); diff --git a/dist/common/vender-C5RbewOc.js b/dist/common/vender-CIG7ep61.js similarity index 79% rename from dist/common/vender-C5RbewOc.js rename to dist/common/vender-CIG7ep61.js index 2a22577..46e2e39 100644 --- a/dist/common/vender-C5RbewOc.js +++ b/dist/common/vender-CIG7ep61.js @@ -1,19 +1,19 @@ -import ze from "react"; -function Ve(t, e) { +import He from "react"; +function Je(t, e) { return function() { return t.apply(e, arguments); }; } -const { toString: _r } = Object.prototype, { getPrototypeOf: ne } = Object, vt = (xt = /* @__PURE__ */ Object.create(null), (t) => { - const e = _r.call(t); +const { toString: xr } = Object.prototype, { getPrototypeOf: ee } = Object, vt = (xt = /* @__PURE__ */ Object.create(null), (t) => { + const e = xr.call(t); return xt[e] || (xt[e] = e.slice(8, -1).toLowerCase()); }); var xt; -const D = (t) => (t = t.toLowerCase(), (e) => vt(e) === t), St = (t) => (e) => typeof e === t, { isArray: Z } = Array, st = St("undefined"), ce = D("ArrayBuffer"), Pr = St("string"), U = St("function"), ue = St("number"), ft = (t) => t !== null && typeof t == "object", ht = (t) => { +const D = (t) => (t = t.toLowerCase(), (e) => vt(e) === t), St = (t) => (e) => typeof e === t, { isArray: Z } = Array, st = St("undefined"), ie = D("ArrayBuffer"), Tr = St("string"), U = St("function"), ae = St("number"), ft = (t) => t !== null && typeof t == "object", ht = (t) => { if (vt(t) !== "object") return !1; - const e = ne(t); + const e = ee(t); return !(e !== null && e !== Object.prototype && Object.getPrototypeOf(e) !== null || Symbol.toStringTag in t || Symbol.iterator in t); -}, kr = D("Date"), jr = D("File"), Nr = D("Blob"), Mr = D("FileList"), Ur = D("URLSearchParams"), [Br, Lr, Dr, Fr] = ["ReadableStream", "Request", "Response", "Headers"].map(D); +}, _r = D("Date"), Pr = D("File"), jr = D("Blob"), kr = D("FileList"), Nr = D("URLSearchParams"), [Mr, Ur, Br, Lr] = ["ReadableStream", "Request", "Response", "Headers"].map(D); function it(t, e, { allOwnKeys: r = !1 } = {}) { if (t == null) return; let n, o; @@ -24,38 +24,38 @@ function it(t, e, { allOwnKeys: r = !1 } = {}) { for (n = 0; n < a; n++) g = c[n], e.call(null, t[g], g, t); } } -function le(t, e) { +function ce(t, e) { e = e.toLowerCase(); const r = Object.keys(t); let n, o = r.length; for (; o-- > 0; ) if (n = r[o], e === n.toLowerCase()) return n; return null; } -const Ke = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, fe = (t) => !st(t) && t !== Ke, Ir = (Tt = typeof Uint8Array < "u" && ne(Uint8Array), (t) => Tt && t instanceof Tt); +const ze = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ue = (t) => !st(t) && t !== ze, Dr = (Tt = typeof Uint8Array < "u" && ee(Uint8Array), (t) => Tt && t instanceof Tt); var Tt; -const qr = D("HTMLFormElement"), he = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Wr = D("RegExp"), de = (t, e) => { +const Fr = D("HTMLFormElement"), le = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Ir = D("RegExp"), fe = (t, e) => { const r = Object.getOwnPropertyDescriptors(t), n = {}; it(r, (o, c) => { let a; (a = e(o, c, t)) !== !1 && (n[c] = a || o); }), Object.defineProperties(t, n); -}, _t = "abcdefghijklmnopqrstuvwxyz", pe = "0123456789", ye = { DIGIT: pe, ALPHA: _t, ALPHA_DIGIT: _t + _t.toUpperCase() + pe }, $r = D("AsyncFunction"), v = { isArray: Z, isArrayBuffer: ce, isBuffer: function(t) { +}, _t = "abcdefghijklmnopqrstuvwxyz", he = "0123456789", de = { DIGIT: he, ALPHA: _t, ALPHA_DIGIT: _t + _t.toUpperCase() + he }, qr = D("AsyncFunction"), v = { isArray: Z, isArrayBuffer: ie, isBuffer: function(t) { return t !== null && !st(t) && t.constructor !== null && !st(t.constructor) && U(t.constructor.isBuffer) && t.constructor.isBuffer(t); }, isFormData: (t) => { let e; return t && (typeof FormData == "function" && t instanceof FormData || U(t.append) && ((e = vt(t)) === "formdata" || e === "object" && U(t.toString) && t.toString() === "[object FormData]")); }, isArrayBufferView: function(t) { let e; - return e = typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(t) : t && t.buffer && ce(t.buffer), e; -}, isString: Pr, isNumber: ue, isBoolean: (t) => t === !0 || t === !1, isObject: ft, isPlainObject: ht, isReadableStream: Br, isRequest: Lr, isResponse: Dr, isHeaders: Fr, isUndefined: st, isDate: kr, isFile: jr, isBlob: Nr, isRegExp: Wr, isFunction: U, isStream: (t) => ft(t) && U(t.pipe), isURLSearchParams: Ur, isTypedArray: Ir, isFileList: Mr, forEach: it, merge: function t() { - const { caseless: e } = fe(this) && this || {}, r = {}, n = (o, c) => { - const a = e && le(r, c) || c; + return e = typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(t) : t && t.buffer && ie(t.buffer), e; +}, isString: Tr, isNumber: ae, isBoolean: (t) => t === !0 || t === !1, isObject: ft, isPlainObject: ht, isReadableStream: Mr, isRequest: Ur, isResponse: Br, isHeaders: Lr, isUndefined: st, isDate: _r, isFile: Pr, isBlob: jr, isRegExp: Ir, isFunction: U, isStream: (t) => ft(t) && U(t.pipe), isURLSearchParams: Nr, isTypedArray: Dr, isFileList: kr, forEach: it, merge: function t() { + const { caseless: e } = ue(this) && this || {}, r = {}, n = (o, c) => { + const a = e && ce(r, c) || c; ht(r[a]) && ht(o) ? r[a] = t(r[a], o) : ht(o) ? r[a] = t({}, o) : Z(o) ? r[a] = o.slice() : r[a] = o; }; for (let o = 0, c = arguments.length; o < c; o++) arguments[o] && it(arguments[o], n); return r; }, extend: (t, e, r, { allOwnKeys: n } = {}) => (it(e, (o, c) => { - r && U(o) ? t[c] = Ve(o, r) : t[c] = o; + r && U(o) ? t[c] = Je(o, r) : t[c] = o; }, { allOwnKeys: n }), t), trim: (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), stripBOM: (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), inherits: (t, e, r, n) => { t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", { value: e.prototype }), r && Object.assign(t.prototype, r); }, toFlatObject: (t, e, r, n) => { @@ -64,7 +64,7 @@ const qr = D("HTMLFormElement"), he = (({ hasOwnProperty: t }) => (e, r) => t.ca if (e = e || {}, t == null) return e; do { for (o = Object.getOwnPropertyNames(t), c = o.length; c-- > 0; ) a = o[c], n && !n(a, t, e) || g[a] || (e[a] = t[a], g[a] = !0); - t = r !== !1 && ne(t); + t = r !== !1 && ee(t); } while (t && (!r || r(t, e)) && t !== Object.prototype); return e; }, kindOf: vt, kindOfTest: D, endsWith: (t, e, r) => { @@ -75,7 +75,7 @@ const qr = D("HTMLFormElement"), he = (({ hasOwnProperty: t }) => (e, r) => t.ca if (!t) return null; if (Z(t)) return t; let e = t.length; - if (!ue(e)) return null; + if (!ae(e)) return null; const r = new Array(e); for (; e-- > 0; ) r[e] = t[e]; return r; @@ -91,8 +91,8 @@ const qr = D("HTMLFormElement"), he = (({ hasOwnProperty: t }) => (e, r) => t.ca const n = []; for (; (r = t.exec(e)) !== null; ) n.push(r); return n; -}, isHTMLForm: qr, hasOwnProperty: he, hasOwnProp: he, reduceDescriptors: de, freezeMethods: (t) => { - de(t, (e, r) => { +}, isHTMLForm: Fr, hasOwnProperty: le, hasOwnProp: le, reduceDescriptors: fe, freezeMethods: (t) => { + fe(t, (e, r) => { if (U(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1) return !1; const n = t[r]; U(n) && (e.enumerable = !1, "writable" in e ? e.writable = !1 : e.set || (e.set = () => { @@ -109,7 +109,7 @@ const qr = D("HTMLFormElement"), he = (({ hasOwnProperty: t }) => (e, r) => t.ca }, toCamelCase: (t) => t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(e, r, n) { return r.toUpperCase() + n; }), noop: () => { -}, toFiniteNumber: (t, e) => t != null && Number.isFinite(t = +t) ? t : e, findKey: le, global: Ke, isContextDefined: fe, ALPHABET: ye, generateString: (t = 16, e = ye.ALPHA_DIGIT) => { +}, toFiniteNumber: (t, e) => t != null && Number.isFinite(t = +t) ? t : e, findKey: ce, global: ze, isContextDefined: ue, ALPHABET: de, generateString: (t = 16, e = de.ALPHA_DIGIT) => { let r = ""; const { length: n } = e; for (; t--; ) r += e[Math.random() * n | 0]; @@ -132,18 +132,18 @@ const qr = D("HTMLFormElement"), he = (({ hasOwnProperty: t }) => (e, r) => t.ca return n; }; return r(t, 0); -}, isAsyncFn: $r, isThenable: (t) => t && (ft(t) || U(t)) && U(t.then) && U(t.catch) }; +}, isAsyncFn: qr, isThenable: (t) => t && (ft(t) || U(t)) && U(t.then) && U(t.catch) }; function R(t, e, r, n, o) { Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), n && (this.request = n), o && (this.response = o); } v.inherits(R, Error, { toJSON: function() { return { message: this.message, name: this.name, description: this.description, number: this.number, fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, config: v.toJSONObject(this.config), code: this.code, status: this.response && this.response.status ? this.response.status : null }; } }); -const me = R.prototype, ge = {}; +const pe = R.prototype, ye = {}; ["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"].forEach((t) => { - ge[t] = { value: t }; -}), Object.defineProperties(R, ge), Object.defineProperty(me, "isAxiosError", { value: !0 }), R.from = (t, e, r, n, o, c) => { - const a = Object.create(me); + ye[t] = { value: t }; +}), Object.defineProperties(R, ye), Object.defineProperty(pe, "isAxiosError", { value: !0 }), R.from = (t, e, r, n, o, c) => { + const a = Object.create(pe); return v.toFlatObject(t, a, function(g) { return g !== Error.prototype; }, (g) => g !== "isAxiosError"), R.call(a, t.message, e, r, n, o), a.cause = t, a.name = t.name, c && Object.assign(a, c), a; @@ -151,22 +151,22 @@ const me = R.prototype, ge = {}; function Pt(t) { return v.isPlainObject(t) || v.isArray(t); } -function Ge(t) { +function Ve(t) { return v.endsWith(t, "[]") ? t.slice(0, -2) : t; } -function be(t, e, r) { +function me(t, e, r) { return t ? t.concat(e).map(function(n, o) { - return n = Ge(n), !r && o ? "[" + n + "]" : n; + return n = Ve(n), !r && o ? "[" + n + "]" : n; }).join(r ? "." : "") : e; } -const Hr = v.toFlatObject(v, {}, null, function(t) { +const Wr = v.toFlatObject(v, {}, null, function(t) { return /^is[A-Z]/.test(t); }); -function Ot(t, e, r) { +function Et(t, e, r) { if (!v.isObject(t)) throw new TypeError("target must be an object"); e = e || new FormData(); - const n = (r = v.toFlatObject(r, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(w, O) { - return !v.isUndefined(O[w]); + const n = (r = v.toFlatObject(r, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(w, E) { + return !v.isUndefined(E[w]); })).metaTokens, o = r.visitor || y, c = r.dots, a = r.indexes, g = (r.Blob || typeof Blob < "u" && Blob) && v.isSpecCompliantForm(e); if (!v.isFunction(o)) throw new TypeError("visitor must be a function"); function b(w) { @@ -175,63 +175,63 @@ function Ot(t, e, r) { if (!g && v.isBlob(w)) throw new R("Blob is not supported. Use a Buffer instead."); return v.isArrayBuffer(w) || v.isTypedArray(w) ? g && typeof Blob == "function" ? new Blob([w]) : Buffer.from(w) : w; } - function y(w, O, m) { + function y(w, E, m) { let f = w; if (w && !m && typeof w == "object") { - if (v.endsWith(O, "{}")) O = n ? O : O.slice(0, -2), w = JSON.stringify(w); + if (v.endsWith(E, "{}")) E = n ? E : E.slice(0, -2), w = JSON.stringify(w); else if (v.isArray(w) && function(i) { return v.isArray(i) && !i.some(Pt); - }(w) || (v.isFileList(w) || v.endsWith(O, "[]")) && (f = v.toArray(w))) return O = Ge(O), f.forEach(function(i, u) { - !v.isUndefined(i) && i !== null && e.append(a === !0 ? be([O], u, c) : a === null ? O : O + "[]", b(i)); + }(w) || (v.isFileList(w) || v.endsWith(E, "[]")) && (f = v.toArray(w))) return E = Ve(E), f.forEach(function(i, u) { + !v.isUndefined(i) && i !== null && e.append(a === !0 ? me([E], u, c) : a === null ? E : E + "[]", b(i)); }), !1; } - return !!Pt(w) || (e.append(be(m, O, c), b(w)), !1); + return !!Pt(w) || (e.append(me(m, E, c), b(w)), !1); } - const s = [], d = Object.assign(Hr, { defaultVisitor: y, convertValue: b, isVisitable: Pt }); + const s = [], d = Object.assign(Wr, { defaultVisitor: y, convertValue: b, isVisitable: Pt }); if (!v.isObject(t)) throw new TypeError("data must be an object"); - return function w(O, m) { - if (!v.isUndefined(O)) { - if (s.indexOf(O) !== -1) throw Error("Circular reference detected in " + m.join(".")); - s.push(O), v.forEach(O, function(f, i) { + return function w(E, m) { + if (!v.isUndefined(E)) { + if (s.indexOf(E) !== -1) throw Error("Circular reference detected in " + m.join(".")); + s.push(E), v.forEach(E, function(f, i) { (!(v.isUndefined(f) || f === null) && o.call(e, f, v.isString(i) ? i.trim() : i, m, d)) === !0 && w(f, m ? m.concat(i) : [i]); }), s.pop(); } }(t), e; } -function we(t) { +function ge(t) { const e = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) { return e[r]; }); } -function oe(t, e) { - this._pairs = [], t && Ot(t, this, e); +function re(t, e) { + this._pairs = [], t && Et(t, this, e); } -const ve = oe.prototype; -function Jr(t) { +const be = re.prototype; +function $r(t) { return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } -function Qe(t, e, r) { +function Ke(t, e, r) { if (!e) return t; - const n = r && r.encode || Jr, o = r && r.serialize; + const n = r && r.encode || $r, o = r && r.serialize; let c; - if (c = o ? o(e, r) : v.isURLSearchParams(e) ? e.toString() : new oe(e, r).toString(n), c) { + if (c = o ? o(e, r) : v.isURLSearchParams(e) ? e.toString() : new re(e, r).toString(n), c) { const a = t.indexOf("#"); a !== -1 && (t = t.slice(0, a)), t += (t.indexOf("?") === -1 ? "?" : "&") + c; } return t; } -ve.append = function(t, e) { +be.append = function(t, e) { this._pairs.push([t, e]); -}, ve.toString = function(t) { +}, be.toString = function(t) { const e = t ? function(r) { - return t.call(this, r, we); - } : we; + return t.call(this, r, ge); + } : ge; return this._pairs.map(function(r) { return e(r[0]) + "=" + e(r[1]); }, "").join("&"); }; -class Oe { +class we { constructor() { this.handlers = []; } @@ -250,10 +250,10 @@ class Oe { }); } } -const Xe = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, zr = { isBrowser: !0, classes: { URLSearchParams: typeof URLSearchParams < "u" ? URLSearchParams : oe, FormData: typeof FormData < "u" ? FormData : null, Blob: typeof Blob < "u" ? Blob : null }, protocols: ["http", "https", "file", "blob", "url", "data"] }, se = typeof window < "u" && typeof document < "u", Vr = (Ee = typeof navigator < "u" && navigator.product, se && ["ReactNative", "NativeScript", "NS"].indexOf(Ee) < 0); -var Ee; -const Kr = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Gr = se && window.location.href || "http://localhost", L = { ...Object.freeze(Object.defineProperty({ __proto__: null, hasBrowserEnv: se, hasStandardBrowserEnv: Vr, hasStandardBrowserWebWorkerEnv: Kr, origin: Gr }, Symbol.toStringTag, { value: "Module" })), ...zr }; -function Ze(t) { +const Ge = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, Hr = { isBrowser: !0, classes: { URLSearchParams: typeof URLSearchParams < "u" ? URLSearchParams : re, FormData: typeof FormData < "u" ? FormData : null, Blob: typeof Blob < "u" ? Blob : null }, protocols: ["http", "https", "file", "blob", "url", "data"] }, ne = typeof window < "u" && typeof document < "u", Jr = (ve = typeof navigator < "u" && navigator.product, ne && ["ReactNative", "NativeScript", "NS"].indexOf(ve) < 0); +var ve; +const zr = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Vr = ne && window.location.href || "http://localhost", L = { ...Object.freeze(Object.defineProperty({ __proto__: null, hasBrowserEnv: ne, hasStandardBrowserEnv: Jr, hasStandardBrowserWebWorkerEnv: zr, origin: Vr }, Symbol.toStringTag, { value: "Module" })), ...Hr }; +function Qe(t) { function e(r, n, o, c) { let a = r[c++]; if (a === "__proto__") return !0; @@ -261,9 +261,9 @@ function Ze(t) { return a = !a && v.isArray(o) ? o.length : a, b ? (v.hasOwnProp(o, a) ? o[a] = [o[a], n] : o[a] = n, !g) : (o[a] && v.isObject(o[a]) || (o[a] = []), e(r, n, o[a], c) && v.isArray(o[a]) && (o[a] = function(y) { const s = {}, d = Object.keys(y); let w; - const O = d.length; + const E = d.length; let m; - for (w = 0; w < O; w++) m = d[w], s[m] = y[m]; + for (w = 0; w < E; w++) m = d[w], s[m] = y[m]; return s; }(o[a])), !g); } @@ -277,22 +277,22 @@ function Ze(t) { } return null; } -const ut = { transitional: Xe, adapter: ["xhr", "http", "fetch"], transformRequest: [function(t, e) { +const ut = { transitional: Ge, adapter: ["xhr", "http", "fetch"], transformRequest: [function(t, e) { const r = e.getContentType() || "", n = r.indexOf("application/json") > -1, o = v.isObject(t); - if (o && v.isHTMLForm(t) && (t = new FormData(t)), v.isFormData(t)) return n ? JSON.stringify(Ze(t)) : t; + if (o && v.isHTMLForm(t) && (t = new FormData(t)), v.isFormData(t)) return n ? JSON.stringify(Qe(t)) : t; if (v.isArrayBuffer(t) || v.isBuffer(t) || v.isStream(t) || v.isFile(t) || v.isBlob(t) || v.isReadableStream(t)) return t; if (v.isArrayBufferView(t)) return t.buffer; if (v.isURLSearchParams(t)) return e.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 function(a, g) { - return Ot(a, new L.classes.URLSearchParams(), Object.assign({ visitor: function(b, y, s, d) { + return Et(a, new L.classes.URLSearchParams(), Object.assign({ visitor: function(b, y, s, d) { return L.isNode && v.isBuffer(b) ? (this.append(y, b.toString("base64")), !1) : d.defaultVisitor.apply(this, arguments); } }, g)); }(t, this.formSerializer).toString(); if ((c = v.isFileList(t)) || r.indexOf("multipart/form-data") > -1) { const a = this.env && this.env.FormData; - return Ot(c ? { "files[]": t } : t, a && new a(), this.formSerializer); + return Et(c ? { "files[]": t } : t, a && new a(), this.formSerializer); } } return o || n ? (e.setContentType("application/json", !1), function(a, g, b) { @@ -322,14 +322,14 @@ const ut = { transitional: Xe, adapter: ["xhr", "http", "fetch"], transformReque v.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => { ut.headers[t] = {}; }); -const Qr = v.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"]), Ae = Symbol("internals"); +const Kr = v.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"]), Ee = Symbol("internals"); function nt(t) { return t && String(t).trim().toLowerCase(); } function dt(t) { return t === !1 || t == null ? t : v.isArray(t) ? t.map(dt) : String(t); } -function kt(t, e, r, n, o) { +function jt(t, e, r, n, o) { return v.isFunction(n) ? n.call(this, e, r) : (o && (e = r), v.isString(e) ? v.isString(n) ? e.indexOf(n) !== -1 : v.isRegExp(n) ? n.test(e) : void 0 : void 0); } let M = class { @@ -351,7 +351,7 @@ let M = class { let b, y, s; return a && a.split(` `).forEach(function(d) { - s = d.indexOf(":"), b = d.substring(0, s).trim().toLowerCase(), y = d.substring(s + 1).trim(), !b || g[b] && Qr[b] || (b === "set-cookie" ? g[b] ? g[b].push(y) : g[b] = [y] : g[b] = g[b] ? g[b] + ", " + y : y); + s = d.indexOf(":"), b = d.substring(0, s).trim().toLowerCase(), y = d.substring(s + 1).trim(), !b || g[b] && Kr[b] || (b === "set-cookie" ? g[b] ? g[b].push(y) : g[b] = [y] : g[b] = g[b] ? g[b] + ", " + y : y); }), g; })(t), e); else if (v.isHeaders(t)) for (const [a, g] of t.entries()) o(g, a, r); @@ -379,7 +379,7 @@ let M = class { has(t, e) { if (t = nt(t)) { const r = v.findKey(this, t); - return !(!r || this[r] === void 0 || e && !kt(0, this[r], r, e)); + return !(!r || this[r] === void 0 || e && !jt(0, this[r], r, e)); } return !1; } @@ -389,7 +389,7 @@ let M = class { function o(c) { if (c = nt(c)) { const a = v.findKey(r, c); - !a || e && !kt(0, r[a], a, e) || (delete r[a], n = !0); + !a || e && !jt(0, r[a], a, e) || (delete r[a], n = !0); } } return v.isArray(t) ? t.forEach(o) : o(t), n; @@ -399,7 +399,7 @@ let M = class { let r = e.length, n = !1; for (; r--; ) { const o = e[r]; - t && !kt(0, this[o], o, t, !0) || (delete this[o], n = !0); + t && !jt(0, this[o], o, t, !0) || (delete this[o], n = !0); } return n; } @@ -441,7 +441,7 @@ let M = class { return e.forEach((n) => r.set(n)), r; } static accessor(t) { - const e = (this[Ae] = this[Ae] = { accessors: {} }).accessors, r = this.prototype; + const e = (this[Ee] = this[Ee] = { accessors: {} }).accessors, r = this.prototype; function n(o) { const c = nt(o); e[c] || (function(a, g) { @@ -456,20 +456,20 @@ let M = class { return v.isArray(t) ? t.forEach(n) : n(t), this; } }; -function jt(t, e) { +function kt(t, e) { const r = this || ut, n = e || r, o = M.from(n.headers); let c = n.data; return v.forEach(t, function(a) { c = a.call(r, c, o.normalize(), e ? e.status : void 0); }), o.normalize(), c; } -function Ye(t) { +function Xe(t) { return !(!t || !t.__CANCEL__); } function rt(t, e, r) { R.call(this, t ?? "canceled", R.ERR_CANCELED, e, r), this.name = "CanceledError"; } -function tr(t, e, r) { +function Ze(t, e, r) { const n = r.config.validateStatus; r.status && n && !n(r.status) ? e(new R("Request failed with status code " + r.status, [R.ERR_BAD_REQUEST, R.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4], r.config, r.request, r)) : t(r); } @@ -479,19 +479,19 @@ M.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User this[r] = n; } }; }), v.freezeMethods(M), v.inherits(rt, R, { __CANCEL__: !0 }); -const Et = (t, e, r = 3) => { +const Ot = (t, e, r = 3) => { let n = 0; const o = function(c, a) { c = c || 10; const g = new Array(c), b = new Array(c); let y, s = 0, d = 0; return a = a !== void 0 ? a : 1e3, function(w) { - const O = Date.now(), m = b[d]; - y || (y = O), g[s] = w, b[s] = O; + const E = Date.now(), m = b[d]; + y || (y = E), g[s] = w, b[s] = E; let f = d, i = 0; for (; f !== s; ) i += g[f++], f %= c; - if (s = (s + 1) % c, s === d && (d = (d + 1) % c), O - y < a) return; - const u = m && O - m; + if (s = (s + 1) % c, s === d && (d = (d + 1) % c), E - y < a) return; + const u = m && E - m; return u ? Math.round(1e3 * i / u) : void 0; }; }(50, 250); @@ -510,7 +510,7 @@ const Et = (t, e, r = 3) => { const s = { loaded: a, total: g, progress: g ? a / g : void 0, bytes: b, rate: y || void 0, estimated: y && g && a <= g ? (g - a) / y : void 0, event: c, lengthComputable: g != null }; s[e ? "download" : "upload"] = !0, t(s); }, r); -}, Xr = L.hasStandardBrowserEnv ? function() { +}, Gr = L.hasStandardBrowserEnv ? function() { const t = /(msie|trident)/i.test(navigator.userAgent), e = document.createElement("a"); let r; function n(o) { @@ -523,7 +523,7 @@ const Et = (t, e, r = 3) => { }; }() : function() { return !0; -}, Zr = L.hasStandardBrowserEnv ? { write(t, e, r, n, o, c) { +}, Qr = L.hasStandardBrowserEnv ? { write(t, e, r, n, o, c) { const a = [t + "=" + encodeURIComponent(e)]; v.isNumber(r) && a.push("expires=" + new Date(r).toGMTString()), v.isString(n) && a.push("path=" + n), v.isString(o) && a.push("domain=" + o), c === !0 && a.push("secure"), document.cookie = a.join("; "); }, read(t) { @@ -534,12 +534,12 @@ const Et = (t, e, r = 3) => { } } : { write() { }, read: () => null, remove() { } }; -function er(t, e) { +function Ye(t, e) { return t && !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e) ? function(r, n) { return n ? r.replace(/\/?\/$/, "") + "/" + n.replace(/^\/+/, "") : r; }(t, e) : e; } -const Se = (t) => t instanceof M ? { ...t } : t; +const Oe = (t) => t instanceof M ? { ...t } : t; function X(t, e) { e = e || {}; const r = {}; @@ -558,30 +558,30 @@ function X(t, e) { function g(y, s, d) { return d in e ? n(y, s) : d in t ? n(void 0, y) : void 0; } - const b = { url: c, method: c, data: c, 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: g, headers: (y, s) => o(Se(y), Se(s), !0) }; + const b = { url: c, method: c, data: c, 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: g, headers: (y, s) => o(Oe(y), Oe(s), !0) }; return v.forEach(Object.keys(Object.assign({}, t, e)), function(y) { const s = b[y] || o, d = s(t[y], e[y], y); v.isUndefined(d) && s !== g || (r[y] = d); }), r; } -const rr = (t) => { +const tr = (t) => { const e = X({}, t); let r, { data: n, withXSRFToken: o, xsrfHeaderName: c, xsrfCookieName: a, headers: g, auth: b } = e; - if (e.headers = g = M.from(g), e.url = Qe(er(e.baseURL, e.url), t.params, t.paramsSerializer), b && g.set("Authorization", "Basic " + btoa((b.username || "") + ":" + (b.password ? unescape(encodeURIComponent(b.password)) : ""))), v.isFormData(n)) { + if (e.headers = g = M.from(g), e.url = Ke(Ye(e.baseURL, e.url), t.params, t.paramsSerializer), b && g.set("Authorization", "Basic " + btoa((b.username || "") + ":" + (b.password ? unescape(encodeURIComponent(b.password)) : ""))), v.isFormData(n)) { if (L.hasStandardBrowserEnv || L.hasStandardBrowserWebWorkerEnv) g.setContentType(void 0); else if ((r = g.getContentType()) !== !1) { const [y, ...s] = r ? r.split(";").map((d) => d.trim()).filter(Boolean) : []; g.setContentType([y || "multipart/form-data", ...s].join("; ")); } } - if (L.hasStandardBrowserEnv && (o && v.isFunction(o) && (o = o(e)), o || o !== !1 && Xr(e.url))) { - const y = c && a && Zr.read(a); + if (L.hasStandardBrowserEnv && (o && v.isFunction(o) && (o = o(e)), o || o !== !1 && Gr(e.url))) { + const y = c && a && Qr.read(a); y && g.set(c, y); } return e; -}, Yr = typeof XMLHttpRequest < "u" && function(t) { +}, Xr = typeof XMLHttpRequest < "u" && function(t) { return new Promise(function(e, r) { - const n = rr(t); + const n = tr(t); let o = n.data; const c = M.from(n.headers).normalize(); let a, { responseType: g } = n; @@ -592,10 +592,10 @@ const rr = (t) => { function s() { if (!y) return; const w = M.from("getAllResponseHeaders" in y && y.getAllResponseHeaders()); - tr(function(O) { - e(O), b(); - }, function(O) { - r(O), b(); + Ze(function(E) { + e(E), b(); + }, function(E) { + r(E), b(); }, { data: g && g !== "text" && g !== "json" ? y.response : y.responseText, status: y.status, statusText: y.statusText, headers: w, config: t, request: y }), y = null; } y.open(n.method.toUpperCase(), n.url, !0), y.timeout = n.timeout, "onloadend" in y ? y.onloadend = s : y.onreadystatechange = function() { @@ -606,20 +606,20 @@ const rr = (t) => { r(new R("Network Error", R.ERR_NETWORK, n, y)), y = null; }, y.ontimeout = function() { let w = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded"; - const O = n.transitional || Xe; - n.timeoutErrorMessage && (w = n.timeoutErrorMessage), r(new R(w, O.clarifyTimeoutError ? R.ETIMEDOUT : R.ECONNABORTED, n, y)), y = null; - }, o === void 0 && c.setContentType(null), "setRequestHeader" in y && v.forEach(c.toJSON(), function(w, O) { - y.setRequestHeader(O, w); - }), v.isUndefined(n.withCredentials) || (y.withCredentials = !!n.withCredentials), g && g !== "json" && (y.responseType = n.responseType), typeof n.onDownloadProgress == "function" && y.addEventListener("progress", Et(n.onDownloadProgress, !0)), typeof n.onUploadProgress == "function" && y.upload && y.upload.addEventListener("progress", Et(n.onUploadProgress)), (n.cancelToken || n.signal) && (a = (w) => { + const E = n.transitional || Ge; + n.timeoutErrorMessage && (w = n.timeoutErrorMessage), r(new R(w, E.clarifyTimeoutError ? R.ETIMEDOUT : R.ECONNABORTED, n, y)), y = null; + }, o === void 0 && c.setContentType(null), "setRequestHeader" in y && v.forEach(c.toJSON(), function(w, E) { + y.setRequestHeader(E, w); + }), v.isUndefined(n.withCredentials) || (y.withCredentials = !!n.withCredentials), g && g !== "json" && (y.responseType = n.responseType), typeof n.onDownloadProgress == "function" && y.addEventListener("progress", Ot(n.onDownloadProgress, !0)), typeof n.onUploadProgress == "function" && y.upload && y.upload.addEventListener("progress", Ot(n.onUploadProgress)), (n.cancelToken || n.signal) && (a = (w) => { y && (r(!w || w.type ? new rt(null, t, y) : w), y.abort(), y = null); }, n.cancelToken && n.cancelToken.subscribe(a), n.signal && (n.signal.aborted ? a() : n.signal.addEventListener("abort", a))); const d = function(w) { - const O = /^([-+\w]{1,25})(:?\/\/|:)/.exec(w); - return O && O[1] || ""; + const E = /^([-+\w]{1,25})(:?\/\/|:)/.exec(w); + return E && E[1] || ""; }(n.url); d && L.protocols.indexOf(d) === -1 ? r(new R("Unsupported protocol " + d + ":", R.ERR_BAD_REQUEST, t)) : y.send(o || null); }); -}, tn = (t, e) => { +}, Zr = (t, e) => { let r, n = new AbortController(); const o = function(b) { if (!r) { @@ -641,14 +641,14 @@ const rr = (t) => { return g.unsubscribe = a, [g, () => { c && clearTimeout(c), c = null; }]; -}, en = function* (t, e) { +}, Yr = function* (t, e) { let r = t.byteLength; if (!e || r < e) return void (yield t); let n, o = 0; for (; o < r; ) n = o + e, yield t.slice(o, n), o = n; -}, Ce = (t, e, r, n, o) => { +}, Ae = (t, e, r, n, o) => { const c = async function* (g, b, y) { - for await (const s of g) yield* en(ArrayBuffer.isView(s) ? s : await y(String(s)), b); + for await (const s of g) yield* Yr(ArrayBuffer.isView(s) ? s : await y(String(s)), b); }(t, e, o); let a = 0; return new ReadableStream({ type: "bytes", async pull(g) { @@ -657,68 +657,68 @@ const rr = (t) => { let s = y.byteLength; r && r(a += s), g.enqueue(new Uint8Array(y)); }, cancel: (g) => (n(g), c.return()) }, { highWaterMark: 2 }); -}, Re = (t, e) => { +}, Se = (t, e) => { const r = t != null; return (n) => setTimeout(() => e({ lengthComputable: r, total: t, loaded: n })); -}, Ct = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", nr = Ct && typeof ReadableStream == "function", It = Ct && (typeof TextEncoder == "function" ? (xe = new TextEncoder(), (t) => xe.encode(t)) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())); -var xe; -const rn = nr && (() => { +}, Ct = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", er = Ct && typeof ReadableStream == "function", It = Ct && (typeof TextEncoder == "function" ? (Ce = new TextEncoder(), (t) => Ce.encode(t)) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())); +var Ce; +const tn = er && (() => { let t = !1; const e = new Request(L.origin, { body: new ReadableStream(), method: "POST", get duplex() { return t = !0, "half"; } }).headers.has("Content-Type"); return t && !e; -})(), qt = nr && !!(() => { +})(), qt = er && !!(() => { try { return v.isReadableStream(new Response("").body); } catch { } })(), At = { stream: qt && ((t) => t.body) }; -var Te; -Ct && (Te = new Response(), ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => { - !At[t] && (At[t] = v.isFunction(Te[t]) ? (e) => e[t]() : (e, r) => { +var Re; +Ct && (Re = new Response(), ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => { + !At[t] && (At[t] = v.isFunction(Re[t]) ? (e) => e[t]() : (e, r) => { throw new R(`Response type '${t}' is not supported`, R.ERR_NOT_SUPPORT, r); }); })); -const nn = async (t, e) => { +const en = async (t, e) => { const r = v.toFiniteNumber(t.getContentLength()); return r ?? (async (n) => n == null ? 0 : v.isBlob(n) ? n.size : v.isSpecCompliantForm(n) ? (await new Request(n).arrayBuffer()).byteLength : v.isArrayBufferView(n) ? n.byteLength : (v.isURLSearchParams(n) && (n += ""), v.isString(n) ? (await It(n)).byteLength : void 0))(e); -}, or = { http: null, xhr: Yr, fetch: Ct && (async (t) => { - let { url: e, method: r, data: n, signal: o, cancelToken: c, timeout: a, onDownloadProgress: g, onUploadProgress: b, responseType: y, headers: s, withCredentials: d = "same-origin", fetchOptions: w } = rr(t); +}, rr = { http: null, xhr: Xr, fetch: Ct && (async (t) => { + let { url: e, method: r, data: n, signal: o, cancelToken: c, timeout: a, onDownloadProgress: g, onUploadProgress: b, responseType: y, headers: s, withCredentials: d = "same-origin", fetchOptions: w } = tr(t); y = y ? (y + "").toLowerCase() : "text"; - let O, m, [f, i] = o || c || a ? tn([o, c], a) : []; + let E, m, [f, i] = o || c || a ? Zr([o, c], a) : []; const u = () => { - !O && setTimeout(() => { + !E && setTimeout(() => { f && f.unsubscribe(); - }), O = !0; + }), E = !0; }; let l; try { - if (b && rn && r !== "get" && r !== "head" && (l = await nn(s, n)) !== 0) { + if (b && tn && r !== "get" && r !== "head" && (l = await en(s, n)) !== 0) { let S, C = new Request(e, { method: "POST", body: n, duplex: "half" }); - v.isFormData(n) && (S = C.headers.get("content-type")) && s.setContentType(S), C.body && (n = Ce(C.body, 65536, Re(l, Et(b)), null, It)); + v.isFormData(n) && (S = C.headers.get("content-type")) && s.setContentType(S), C.body && (n = Ae(C.body, 65536, Se(l, Ot(b)), null, It)); } v.isString(d) || (d = d ? "cors" : "omit"), m = new Request(e, { ...w, signal: f, method: r.toUpperCase(), headers: s.normalize().toJSON(), body: n, duplex: "half", withCredentials: d }); let p = await fetch(m); const h = qt && (y === "stream" || y === "response"); if (qt && (g || h)) { const S = {}; - ["status", "statusText", "headers"].forEach((j) => { - S[j] = p[j]; + ["status", "statusText", "headers"].forEach((k) => { + S[k] = p[k]; }); const C = v.toFiniteNumber(p.headers.get("content-length")); - p = new Response(Ce(p.body, 65536, g && Re(C, Et(g, !0)), h && u, It), S); + p = new Response(Ae(p.body, 65536, g && Se(C, Ot(g, !0)), h && u, It), S); } y = y || "text"; - let E = await At[v.findKey(At, y) || "text"](p, t); + let O = await At[v.findKey(At, y) || "text"](p, t); return !h && u(), i && i(), await new Promise((S, C) => { - tr(S, C, { data: E, headers: M.from(p.headers), status: p.status, statusText: p.statusText, config: t, request: m }); + Ze(S, C, { data: O, headers: M.from(p.headers), status: p.status, statusText: p.statusText, config: t, request: m }); }); } catch (p) { throw u(), p && p.name === "TypeError" && /fetch/i.test(p.message) ? Object.assign(new R("Network Error", R.ERR_NETWORK, t, m), { cause: p.cause || p }) : R.from(p, p && p.code, t, m); } }) }; -v.forEach(or, (t, e) => { +v.forEach(rr, (t, e) => { if (t) { try { Object.defineProperty(t, "name", { value: e }); @@ -727,49 +727,49 @@ v.forEach(or, (t, e) => { Object.defineProperty(t, "adapterName", { value: e }); } }); -const _e = (t) => `- ${t}`, on = (t) => v.isFunction(t) || t === null || t === !1, sr = (t) => { +const xe = (t) => `- ${t}`, rn = (t) => v.isFunction(t) || t === null || t === !1, nr = (t) => { t = v.isArray(t) ? t : [t]; const { length: e } = t; let r, n; const o = {}; for (let c = 0; c < e; c++) { let a; - if (r = t[c], n = r, !on(r) && (n = or[(a = String(r)).toLowerCase()], n === void 0)) throw new R(`Unknown adapter '${a}'`); + if (r = t[c], n = r, !rn(r) && (n = rr[(a = String(r)).toLowerCase()], n === void 0)) throw new R(`Unknown adapter '${a}'`); if (n) break; o[a || "#" + c] = n; } if (!n) { const c = Object.entries(o).map(([a, g]) => `adapter ${a} ` + (g === !1 ? "is not supported by the environment" : "is not available in the build")); throw new R("There is no suitable adapter to dispatch the request " + (e ? c.length > 1 ? `since : -` + c.map(_e).join(` -`) : " " + _e(c[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT"); +` + c.map(xe).join(` +`) : " " + xe(c[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT"); } return n; }; function Nt(t) { if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted) throw new rt(null, t); } -function Pe(t) { - return Nt(t), t.headers = M.from(t.headers), t.data = jt.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), sr(t.adapter || ut.adapter)(t).then(function(e) { - return Nt(t), e.data = jt.call(t, t.transformResponse, e), e.headers = M.from(e.headers), e; +function Te(t) { + return Nt(t), t.headers = M.from(t.headers), t.data = kt.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), nr(t.adapter || ut.adapter)(t).then(function(e) { + return Nt(t), e.data = kt.call(t, t.transformResponse, e), e.headers = M.from(e.headers), e; }, function(e) { - return Ye(e) || (Nt(t), e && e.response && (e.response.data = jt.call(t, t.transformResponse, e.response), e.response.headers = M.from(e.response.headers))), Promise.reject(e); + return Xe(e) || (Nt(t), e && e.response && (e.response.data = kt.call(t, t.transformResponse, e.response), e.response.headers = M.from(e.response.headers))), Promise.reject(e); }); } -const sn = "1.7.2", ie = {}; +const nn = "1.7.2", oe = {}; ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => { - ie[t] = function(r) { + oe[t] = function(r) { return typeof r === t || "a" + (e < 1 ? "n " : " ") + t; }; }); -const ke = {}; -ie.transitional = function(t, e, r) { +const _e = {}; +oe.transitional = function(t, e, r) { function n(o, c) { return "[Axios v1.7.2] Transitional option '" + o + "'" + c + (r ? ". " + r : ""); } return (o, c, a) => { if (t === !1) throw new R(n(c, " has been removed" + (e ? " in " + e : "")), R.ERR_DEPRECATED); - return e && !ke[c] && (ke[c] = !0, console.warn(n(c, " has been deprecated since v" + e + " and will be removed in the near future"))), !t || t(o, c, a); + return e && !_e[c] && (_e[c] = !0, console.warn(n(c, " has been deprecated since v" + e + " and will be removed in the near future"))), !t || t(o, c, a); }; }; const Wt = { assertOptions: function(t, e, r) { @@ -783,10 +783,10 @@ const Wt = { assertOptions: function(t, e, r) { if (b !== !0) throw new R("option " + c + " must be " + b, R.ERR_BAD_OPTION_VALUE); } else if (r !== !0) throw new R("Unknown option " + c, R.ERR_BAD_OPTION); } -}, validators: ie }, $ = Wt.validators; +}, validators: oe }, $ = Wt.validators; let Q = class { constructor(t) { - this.defaults = t, this.interceptors = { request: new Oe(), response: new Oe() }; + this.defaults = t, this.interceptors = { request: new we(), response: new we() }; } async request(t, e) { try { @@ -810,46 +810,46 @@ let Q = class { const { transitional: r, paramsSerializer: n, headers: o } = e; r !== void 0 && Wt.assertOptions(r, { silentJSONParsing: $.transitional($.boolean), forcedJSONParsing: $.transitional($.boolean), clarifyTimeoutError: $.transitional($.boolean) }, !1), n != null && (v.isFunction(n) ? e.paramsSerializer = { serialize: n } : Wt.assertOptions(n, { encode: $.function, serialize: $.function }, !0)), e.method = (e.method || this.defaults.method || "get").toLowerCase(); let c = o && v.merge(o.common, o[e.method]); - o && v.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (O) => { - delete o[O]; + o && v.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (E) => { + delete o[E]; }), e.headers = M.concat(c, o); const a = []; let g = !0; - this.interceptors.request.forEach(function(O) { - typeof O.runWhen == "function" && O.runWhen(e) === !1 || (g = g && O.synchronous, a.unshift(O.fulfilled, O.rejected)); + this.interceptors.request.forEach(function(E) { + typeof E.runWhen == "function" && E.runWhen(e) === !1 || (g = g && E.synchronous, a.unshift(E.fulfilled, E.rejected)); }); const b = []; let y; - this.interceptors.response.forEach(function(O) { - b.push(O.fulfilled, O.rejected); + this.interceptors.response.forEach(function(E) { + b.push(E.fulfilled, E.rejected); }); let s, d = 0; if (!g) { - const O = [Pe.bind(this), void 0]; - for (O.unshift.apply(O, a), O.push.apply(O, b), s = O.length, y = Promise.resolve(e); d < s; ) y = y.then(O[d++], O[d++]); + const E = [Te.bind(this), void 0]; + for (E.unshift.apply(E, a), E.push.apply(E, b), s = E.length, y = Promise.resolve(e); d < s; ) y = y.then(E[d++], E[d++]); return y; } s = a.length; let w = e; for (d = 0; d < s; ) { - const O = a[d++], m = a[d++]; + const E = a[d++], m = a[d++]; try { - w = O(w); + w = E(w); } catch (f) { m.call(this, f); break; } } try { - y = Pe.call(this, w); - } catch (O) { - return Promise.reject(O); + y = Te.call(this, w); + } catch (E) { + return Promise.reject(E); } for (d = 0, s = b.length; d < s; ) y = y.then(b[d++], b[d++]); return y; } getUri(t) { - return Qe(er((t = X(this.defaults, t)).baseURL, t.url), t.params, t.paramsSerializer); + return Ke(Ye((t = X(this.defaults, t)).baseURL, t.url), t.params, t.paramsSerializer); } }; v.forEach(["delete", "get", "head", "options"], function(t) { @@ -869,12 +869,12 @@ Object.entries($t).forEach(([t, e]) => { $t[e] = t; }); const _ = function t(e) { - const r = new Q(e), n = Ve(Q.prototype.request, r); + const r = new Q(e), n = Je(Q.prototype.request, r); return v.extend(n, Q.prototype, r, { allOwnKeys: !0 }), v.extend(n, r, null, { allOwnKeys: !0 }), n.create = function(o) { return t(X(e, o)); }, n; }(ut); -_.Axios = Q, _.CanceledError = rt, _.CancelToken = class ir { +_.Axios = Q, _.CanceledError = rt, _.CancelToken = class or { constructor(e) { if (typeof e != "function") throw new TypeError("executor must be a function."); let r; @@ -912,11 +912,11 @@ _.Axios = Q, _.CanceledError = rt, _.CancelToken = class ir { } static source() { let e; - return { token: new ir(function(n) { + return { token: new or(function(n) { e = n; }), cancel: e }; } -}, _.isCancel = Ye, _.VERSION = sn, _.toFormData = Ot, _.AxiosError = R, _.Cancel = _.CanceledError, _.all = function(t) { +}, _.isCancel = Xe, _.VERSION = nn, _.toFormData = Et, _.AxiosError = R, _.Cancel = _.CanceledError, _.all = function(t) { return Promise.all(t); }, _.spread = function(t) { return function(e) { @@ -924,12 +924,12 @@ _.Axios = Q, _.CanceledError = rt, _.CancelToken = class ir { }; }, _.isAxiosError = function(t) { return v.isObject(t) && t.isAxiosError === !0; -}, _.mergeConfig = X, _.AxiosHeaders = M, _.formToJSON = (t) => Ze(v.isHTMLForm(t) ? new FormData(t) : t), _.getAdapter = sr, _.HttpStatusCode = $t, _.default = _; -const { Axios: an, AxiosError: cn, CanceledError: un, isCancel: ln, CancelToken: fn, VERSION: hn, all: dn, Cancel: pn, isAxiosError: yn, spread: mn, toFormData: gn, AxiosHeaders: bn, HttpStatusCode: wn, formToJSON: vn, getAdapter: On, mergeConfig: En } = _, An = Object.freeze(Object.defineProperty({ __proto__: null, Axios: an, AxiosError: cn, AxiosHeaders: bn, Cancel: pn, CancelToken: fn, CanceledError: un, HttpStatusCode: wn, VERSION: hn, all: dn, default: _, formToJSON: vn, getAdapter: On, isAxiosError: yn, isCancel: ln, mergeConfig: En, spread: mn, toFormData: gn }, Symbol.toStringTag, { value: "Module" })); +}, _.mergeConfig = X, _.AxiosHeaders = M, _.formToJSON = (t) => Qe(v.isHTMLForm(t) ? new FormData(t) : t), _.getAdapter = nr, _.HttpStatusCode = $t, _.default = _; +const { Axios: on, AxiosError: sn, CanceledError: an, isCancel: cn, CancelToken: un, VERSION: ln, all: fn, Cancel: hn, isAxiosError: dn, spread: pn, toFormData: yn, AxiosHeaders: mn, HttpStatusCode: gn, formToJSON: bn, getAdapter: wn, mergeConfig: vn } = _, En = Object.freeze(Object.defineProperty({ __proto__: null, Axios: on, AxiosError: sn, AxiosHeaders: mn, Cancel: hn, CancelToken: un, CanceledError: an, HttpStatusCode: gn, VERSION: ln, all: fn, default: _, formToJSON: bn, getAdapter: wn, isAxiosError: dn, isCancel: cn, mergeConfig: vn, spread: pn, toFormData: yn }, Symbol.toStringTag, { value: "Module" })); function Rt(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } -function Sn(t) { +function On(t) { if (t.__esModule) return t; var e = t.default; if (typeof e == "function") { @@ -946,7 +946,7 @@ function Sn(t) { }), r; } var Ht = { exports: {} }; -const je = Sn(An), ar = function t(e, r) { +const Pe = On(En), sr = function t(e, r) { if (e === r) return !0; if (e && r && typeof e == "object" && typeof r == "object") { if (e.constructor !== r.constructor) return !1; @@ -968,9 +968,9 @@ const je = Sn(An), ar = function t(e, r) { return !0; } return e != e && r != r; -}, cr = function(t) { +}, ir = function(t) { return t != null && t.constructor != null && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t); -}, ur = ( +}, ar = ( /*! * MIT License * @@ -992,29 +992,29 @@ const je = Sn(An), ar = function t(e, r) { function(t) { return typeof Blob < "u" && (t instanceof Blob || Object.prototype.toString.call(t) === "[object Blob]"); } -), lr = Object.prototype.toString; -function Ne(t, e) { +), cr = Object.prototype.toString; +function je(t, e) { const r = t.length; for (let n = 0; n < r; n++) { const o = t[n]; if (e(o)) return o; } } -function ae(t) { +function se(t) { return t !== null && typeof t == "object"; } -function Cn(t) { - return ae(t) && function(e) { - return lr.call(e) === "[object Function]"; +function An(t) { + return se(t) && function(e) { + return cr.call(e) === "[object Function]"; }(t.pipe); } -function Me(t, e) { +function ke(t, e) { return t ? `${t.replace(/\/+$/, "")}/${e.replace(/^\/+/, "")}` : e; } -function Ue(t, e) { +function Ne(t, e) { return (t[0] === "/" ? t.substr(1) : t) === (e[0] === "/" ? e.substr(1) : e); } -function Be(t, e, r) { +function Me(t, e, r) { return Jt(e, r.params) && function(n, o) { if (o === void 0) return !0; let c; @@ -1026,23 +1026,23 @@ function Be(t, e, r) { }(t, r.data); } function Jt(t, e) { - return e === void 0 || (typeof e.asymmetricMatch == "function" ? e.asymmetricMatch(t) : ar(t, e)); + return e === void 0 || (typeof e.asymmetricMatch == "function" ? e.asymmetricMatch(t) : sr(t, e)); } -function Rn(t) { - return e = t, lr.call(e) === "[object ArrayBuffer]" || cr(t) || Cn(t) || ur(t) ? t : ae(t) ? JSON.parse(JSON.stringify(t)) : t; +function Sn(t) { + return e = t, cr.call(e) === "[object ArrayBuffer]" || ir(t) || An(t) || ar(t) ? t : se(t) ? JSON.parse(JSON.stringify(t)) : t; var e; } -function Le(t, e, r, n) { - if (typeof je.AxiosError == "function") return je.AxiosError.from(new Error(t), n, e, null, r); +function Ue(t, e, r, n) { + if (typeof Pe.AxiosError == "function") return Pe.AxiosError.from(new Error(t), n, e, null, r); const o = new Error(t); return o.isAxiosError = !0, o.config = e, r !== void 0 && (o.response = r), n !== void 0 && (o.code = n), o.toJSON = function() { return { message: this.message, name: this.name, description: this.description, number: this.number, fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, config: this.config, code: this.code }; }, o; } -var fr = { find: Ne, findHandler: function(t, e, r, n, o, c, a) { - return Ne(t[e.toLowerCase()], function(g) { +var ur = { find: je, findHandler: function(t, e, r, n, o, c, a) { + return je(t[e.toLowerCase()], function(g) { let b = !1; - return typeof g.url == "string" ? b = Ue(r, g.url) || Ue(Me(a, r), g.url) : g.url instanceof RegExp && (b = g.url.test(r) || g.url.test(Me(a, r))), b && Be(n, o, g) && Jt(c, g.headers); + return typeof g.url == "string" ? b = Ne(r, g.url) || Ne(ke(a, r), g.url) : g.url instanceof RegExp && (b = g.url.test(r) || g.url.test(ke(a, r))), b && Me(n, o, g) && Jt(c, g.headers); }); }, purgeIfReplyOnce: function(t, e) { const r = t.handlers.indexOf(e); @@ -1051,40 +1051,40 @@ var fr = { find: Ne, findHandler: function(t, e, r, n, o, c, a) { r > 0 && await new Promise((o) => setTimeout(o, r)); const n = await async function(o, c) { typeof o == "function" && (o = await o(c)); - const a = o.status || o[0], g = Rn(o.data || o[1]), b = o.headers || o[2]; + const a = o.status || o[0], g = Sn(o.data || o[1]), b = o.headers || o[2]; return o.config && (c = o.config), { status: a, data: g, headers: b, config: c, request: { responseURL: c.url } }; }(e, t); if (!n.config.validateStatus || n.config.validateStatus(n.status)) return n; - throw Le(`Request failed with status code ${n.status}`, n.config, n); -}, isObjectOrArray: ae, isBuffer: cr, isBlob: ur, isBodyOrParametersMatching: Be, isEqual: ar, createAxiosError: Le, createCouldNotFindMockError: function(t) { + throw Ue(`Request failed with status code ${n.status}`, n.config, n); +}, isObjectOrArray: se, isBuffer: ir, isBlob: ar, isBodyOrParametersMatching: Me, isEqual: sr, createAxiosError: Ue, createCouldNotFindMockError: function(t) { const e = `Could not find mock for: ${JSON.stringify({ method: t.method, url: t.url, params: t.params, headers: t.headers }, null, 2)}`, r = new Error(e); return r.isCouldNotFindMockError = !0, r.url = t.url, r.method = t.method, r; } }; -const ot = fr; -function De(t, e) { +const ot = ur; +function Be(t, e) { let r = e.baseURL; return r && !/^https?:/.test(r) && (r = void 0), typeof t.originalAdapter == "function" ? t.originalAdapter(e) : t.axiosInstanceWithoutInterceptors(Object.assign({}, e, { baseURL: r, adapter: t.originalAdapter, transformRequest: [], transformResponse: [] })); } -const xn = async function(t, e) { +const Cn = async function(t, e) { let r = e.url || ""; e.baseURL && r.substr(0, e.baseURL.length) === e.baseURL && (r = r.slice(e.baseURL.length)), delete e.adapter, t.history.push(e); const n = ot.findHandler(t.handlers, e.method, r, e.data, e.params, e.headers && e.headers.constructor.name === "AxiosHeaders" ? Object.assign({}, e.headers.toJSON()) : e.headers, e.baseURL); - if (n) return n.replyOnce && ot.purgeIfReplyOnce(t, n), n.passThrough ? De(t, e) : ot.settle(e, n.response, function(o, c) { + if (n) return n.replyOnce && ot.purgeIfReplyOnce(t, n), n.passThrough ? Be(t, e) : ot.settle(e, n.response, function(o, c) { return typeof c.delay == "number" ? c.delay : o.delayResponse; }(t, n)); switch (t.onNoMatch) { case "passthrough": - return De(t, e); + return Be(t, e); case "throwException": throw ot.createCouldNotFindMockError(e); default: return ot.settle(e, { status: 404 }, t.delayResponse); } -}, W = fr, hr = ["get", "post", "head", "delete", "patch", "put", "options", "list", "link", "unlink"]; -function Fe() { +}, W = ur, lr = ["get", "post", "head", "delete", "patch", "put", "options", "list", "link", "unlink"]; +function Le() { const t = []; - return hr.forEach(function(e) { + return lr.forEach(function(e) { Object.defineProperty(t, e, { get: () => t.filter(function(r) { return !r.method || r.method === e; }) }); @@ -1096,7 +1096,7 @@ class Mt { this.axiosInstance = e, this.axiosInstanceWithoutInterceptors = e.create ? e.create() : void 0, this.originalAdapter = e.defaults.adapter, this.delayResponse = r.delayResponse > 0 ? r.delayResponse : null, this.onNoMatch = r.onNoMatch || null, e.defaults.adapter = this.adapter(); } adapter() { - return (e) => xn(this, e); + return (e) => Cn(this, e); } restore() { this.axiosInstance && (this.axiosInstance.defaults.adapter = this.originalAdapter, this.axiosInstance = void 0); @@ -1105,18 +1105,18 @@ class Mt { this.resetHandlers(), this.resetHistory(); } resetHandlers() { - this.handlers ? this.handlers.length = 0 : this.handlers = Fe(); + this.handlers ? this.handlers.length = 0 : this.handlers = Le(); } resetHistory() { - this.history ? this.history.length = 0 : this.history = Fe(); + this.history ? this.history.length = 0 : this.history = Le(); } } -const Tn = ["any", "get", "delete", "head", "options"], _n = ["headers", "params", "data"]; -function Ie(t, e) { - for (const r in e) if (!_n.includes(r)) throw new Error(`Invalid config property ${JSON.stringify(r)} provided to ${dr(t)}. Config: ${JSON.stringify(e)}`); +const Rn = ["any", "get", "delete", "head", "options"], xn = ["headers", "params", "data"]; +function De(t, e) { + for (const r in e) if (!xn.includes(r)) throw new Error(`Invalid config property ${JSON.stringify(r)} provided to ${fr(t)}. Config: ${JSON.stringify(e)}`); return e; } -function dr(t) { +function fr(t) { return `on${t.charAt(0).toUpperCase()}${t.slice(1)}`; } function Ut(t, e, r) { @@ -1133,21 +1133,21 @@ function Ut(t, e, r) { n > -1 && !r.replyOnce ? e.splice(n, 1, r) : e.push(r); } } -hr.concat("any").forEach(function(t) { - Mt.prototype[dr(t)] = function(e, r, n) { +lr.concat("any").forEach(function(t) { + Mt.prototype[fr(t)] = function(e, r, n) { const o = this; let c; e = e === void 0 ? /.*/ : e; const a = function(s, d, w) { - return Tn.includes(s) ? Ie(s, d || {}) : Ie(s, Object.assign({}, w, { data: d })); + return Rn.includes(s) ? De(s, d || {}) : De(s, Object.assign({}, w, { data: d })); }(t, r, n); function g(s, d, w) { - const O = { url: e, method: t === "any" ? void 0 : t, params: a.params, data: a.data, headers: a.headers, replyOnce: !1, delay: c, response: typeof s == "function" ? s : [s, d, w] }; - return Ut(t, o.handlers, O), o; + const E = { url: e, method: t === "any" ? void 0 : t, params: a.params, data: a.data, headers: a.headers, replyOnce: !1, delay: c, response: typeof s == "function" ? s : [s, d, w] }; + return Ut(t, o.handlers, E), o; } function b(s, d, w) { - const O = { url: e, method: t === "any" ? void 0 : t, params: a.params, data: a.data, headers: a.headers, replyOnce: !0, delay: c, response: typeof s == "function" ? s : [s, d, w] }; - return Ut(t, o.handlers, O), o; + const E = { url: e, method: t === "any" ? void 0 : t, params: a.params, data: a.data, headers: a.headers, replyOnce: !0, delay: c, response: typeof s == "function" ? s : [s, d, w] }; + return Ut(t, o.handlers, E), o; } const y = { reply: g, replyOnce: b, withDelayInMs: function(s) { c = s; @@ -1172,14 +1172,14 @@ hr.concat("any").forEach(function(t) { return y; }; }), Ht.exports = Mt, Ht.exports.default = Mt; -const $n = Rt(Ht.exports); -var Pn = Object.defineProperty, pr = (t) => { +const qn = Rt(Ht.exports); +var Tn = Object.defineProperty, hr = (t) => { throw TypeError(t); -}, T = (t, e, r) => ((n, o, c) => o in n ? Pn(n, o, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[o] = c)(t, typeof e != "symbol" ? e + "" : e, r), yr = (t, e, r) => e.has(t) || pr("Cannot " + r), A = (t, e, r) => (yr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), P = (t, e, r) => e.has(t) ? pr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), F = (t, e, r, n) => (yr(t, e, "write to private field"), e.set(t, r), r); -function kn(t) { +}, T = (t, e, r) => ((n, o, c) => o in n ? Tn(n, o, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[o] = c)(t, typeof e != "symbol" ? e + "" : e, r), dr = (t, e, r) => e.has(t) || hr("Cannot " + r), A = (t, e, r) => (dr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), j = (t, e, r) => e.has(t) ? hr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), F = (t, e, r, n) => (dr(t, e, "write to private field"), e.set(t, r), r); +function _n(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } -var mr = {}; +var pr = {}; (function(t) { (function(e, r) { var n = r(); @@ -1228,8 +1228,8 @@ var mr = {}; throw new Error("Unexpected argument of type " + typeof f); }(a), d = y.strings.length, w = y.integers.length; y.floats.length, b && console.log("Parsing the dictionary"); - var O = y.strings.join("|"); - return O += "^" + y.integers.join("|"), O += "^" + y.floats.join("|"), b && console.log("Parsing the structure"), O += "^" + function m(f) { + var E = y.strings.join("|"); + return E += "^" + y.integers.join("|"), E += "^" + y.floats.join("|"), b && console.log("Parsing the structure"), E += "^" + function m(f) { if (b && console.log("Calling a recursiveParser with " + this.JSON.stringify(f)), f instanceof Array) { var i = f.shift(); for (var u in f) f.hasOwnProperty(u) && (i += m(f[u]) + "|"); @@ -1244,7 +1244,7 @@ var mr = {}; if (l === "undefined") return -5; if (l === "empty") return -4; throw new TypeError("The item is alien!"); - }(s), b && console.log("Ending parser"), g.debug ? { dictionary: y, ast: s, packed: O } : O; + }(s), b && console.log("Ending parser"), g.debug ? { dictionary: y, ast: s, packed: E } : E; }, unpack: function(a, g) { g = g || {}; var b = a.split("^"); @@ -1257,92 +1257,99 @@ var mr = {}; if ((s = b[1]) !== "") for (s = s.split("|"), g.verbose && console.log("Parse the integers dictionary"), d = 0, w = s.length; d < w; d++) y.push(o(s[d])); if ((s = b[2]) !== "") for (s = s.split("|"), g.verbose && console.log("Parse the floats dictionary"), d = 0, w = s.length; d < w; d++) y.push(parseFloat(s[d])); s = null, g.verbose && console.log("Tokenizing the structure"); - var O = "", m = [], f = b[3].length; + var E = "", m = [], f = b[3].length; for (d = 0; d < f; d++) { var i = b[3].charAt(d); - i === "|" || i === "$" || i === "@" || i === "]" ? (O && (m.push(o(O)), O = ""), i !== "|" && m.push(i)) : O += i; + i === "|" || i === "$" || i === "@" || i === "]" ? (E && (m.push(o(E)), E = ""), i !== "|" && m.push(i)) : E += i; } var u = m.length, l = 0; return g.verbose && console.log("Starting recursive parser"), function p() { var h = m[l++]; if (g.verbose && console.log("Reading collection type " + (h === "$" ? "object" : "Array")), h === "@") { - for (var E = []; l < u; l++) { + for (var O = []; l < u; l++) { var S = m[l]; - if (g.verbose && console.log("Read " + S + " symbol"), S === "]") return E; - if (S === "@" || S === "$") E.push(p()); + if (g.verbose && console.log("Read " + S + " symbol"), S === "]") return O; + if (S === "@" || S === "$") O.push(p()); else switch (S) { case -1: - E.push(!0); + O.push(!0); break; case -2: - E.push(!1); + O.push(!1); break; case -3: - E.push(null); + O.push(null); break; case -5: - E.push(void 0); + O.push(void 0); break; case -4: - E.push(""); + O.push(""); break; default: - E.push(y[S]); + O.push(y[S]); } } - return g.verbose && console.log("Parsed " + this.JSON.stringify(E)), E; + return g.verbose && console.log("Parsed " + this.JSON.stringify(O)), O; } if (h === "$") { - for (E = {}; l < u; l++) { + for (O = {}; l < u; l++) { var C = m[l]; - if (C === "]") return E; - if (C = C === -4 ? "" : y[C], (S = m[++l]) === "@" || S === "$") E[C] = p(); + if (C === "]") return O; + if (C = C === -4 ? "" : y[C], (S = m[++l]) === "@" || S === "$") O[C] = p(); else switch (S) { case -1: - E[C] = !0; + O[C] = !0; break; case -2: - E[C] = !1; + O[C] = !1; break; case -3: - E[C] = null; + O[C] = null; break; case -5: - E[C] = void 0; + O[C] = void 0; break; case -4: - E[C] = ""; + O[C] = ""; break; default: - E[C] = y[S]; + O[C] = y[S]; } } - return g.verbose && console.log("Parsed " + this.JSON.stringify(E)), E; + return g.verbose && console.log("Parsed " + this.JSON.stringify(O)), O; } throw new TypeError("Bad token " + h + " isn't a type"); }(); } }; }); -})(mr); -const qe = kn(mr); -var I, pt, z, V, zt, Vt, yt, Kt, Gt, Qt, Xt; -const jn = class gr { +})(pr); +const Fe = _n(pr); +var I, pt, z, V, zt, yt, Vt, Kt, Gt; +const Pn = class yr { constructor(e, r, n, o, c) { - return T(this, "code", 0), T(this, "message", "操作成功"), T(this, "data", null), T(this, "url", ""), T(this, "res", ""), P(this, I), P(this, pt, !0), P(this, z, !0), P(this, V, { get: (a, g) => A(this, zt).call(this, g), set: (a, g) => { - throw new TypeError(`HttpResponse 是只读的,不能设置属性 "${g}"`); - }, ownKeys: () => Object.keys(A(this, V).getPrototypeOf() || {}), getPrototypeOf: () => A(this, pt) ? this : this.data, getOwnPropertyDescriptor: () => ({ configurable: !0, enumerable: !0, writable: !0, value: A(this, V).getPrototypeOf() }) }), P(this, zt, (a) => a === "$echoMsg" ? A(this, yt) : a === "msg" ? A(this, Vt) : a === "then" ? (F(this, z, !0), A(this, Kt)) : a === "resp" ? (F(this, z, !0), A(this, Gt)) : a === "catch" ? A(this, Qt) : a === "finally" ? A(this, Xt) : a === "IS_ECHO_MSG" ? A(this, z) : Reflect.get(this, a)), P(this, Vt, (a = (b) => b, g = !1) => (A(this, yt).call(this), F(this, pt, g), Promise.resolve(a == null ? void 0 : a(A(this, V).getPrototypeOf())))), T(this, "toJSON", () => ({ code: this.code, message: this.message, data: this.data, url: this.url, res: this.res })), T(this, "toString", () => this.message), P(this, yt, () => { - A(this, z) && (F(this, z, !1), te.onMsg(this.code, this.message)); - }), P(this, Kt, (a, g) => [0, 1].includes(this.code) ? Promise.resolve(a == null ? void 0 : a(this.data)) : g ? Promise.resolve(g(A(this, I))) : Promise.reject(A(this, I))), P(this, Gt, (a, g) => [0, 1].includes(this.code) ? Promise.resolve(a == null ? void 0 : a(this)) : g ? Promise.resolve(g(A(this, I))) : Promise.reject(A(this, I))), P(this, Qt, (a) => Promise.resolve(a(A(this, I)))), P(this, Xt, (a) => (a == null || a(), [0, 1].includes(this.code) ? Promise.resolve(A(this, V).getPrototypeOf()) : Promise.reject(A(this, I)))), this.code = e, this.message = r, this.data = n, this.url = o, this.res = c, F(this, I, new Proxy(this, A(this, V))); + return T(this, "code", 0), T(this, "message", "操作成功"), T(this, "data", null), T(this, "url", ""), T(this, "res", ""), j(this, I), j(this, pt, !0), j(this, z, !0), j(this, V, { get: (a, g) => A(this, zt).call(this, g), set: (a, g, b) => { + throw new TypeError(`HttpResponse 是只读的,不能设置属性 "${String(g)}"`); + }, ownKeys: () => Object.keys(A(this, V).getPrototypeOf() || {}), getPrototypeOf: () => A(this, pt) ? this : this.data, getOwnPropertyDescriptor: () => ({ configurable: !0, enumerable: !0, writable: !0, value: A(this, V).getPrototypeOf() }) }), j(this, zt, (a) => a === "$echoMsg" ? A(this, yt) : a === "then" ? (F(this, z, !0), A(this, Vt)) : a === "catch" ? A(this, Kt) : a === "finally" ? A(this, Gt) : a === "IS_ECHO_MSG" ? A(this, z) : Reflect.get(this, a)), T(this, "msg", (a = (b) => b, g = !1) => { + A(this, yt).call(this), F(this, pt, g); + try { + return Promise.resolve(a == null ? void 0 : a(A(this, V).getPrototypeOf())); + } catch (b) { + return Promise.reject(b); + } + }), T(this, "resp", (a, g) => (F(this, z, !0), [0, 1].includes(this.code) ? Promise.resolve(a == null ? void 0 : a(this)) : g ? Promise.resolve(g(A(this, I))) : Promise.reject(A(this, I)))), T(this, "toJSON", () => ({ code: this.code, message: this.message, data: this.data, url: this.url, res: this.res })), T(this, "toString", () => this.message), j(this, yt, () => { + A(this, z) && (F(this, z, !1), Zt.onMsg(this.code, this.message)); + }), j(this, Vt, (a, g) => [0, 1].includes(this.code) ? Promise.resolve(a == null ? void 0 : a(this.data)) : g ? Promise.resolve(g(A(this, I))) : Promise.reject(A(this, I))), j(this, Kt, (a) => Promise.resolve(a(A(this, I)))), j(this, Gt, (a) => (a == null || a(), [0, 1].includes(this.code) ? Promise.resolve(A(this, V).getPrototypeOf()) : Promise.reject(A(this, I)))), this.code = e, this.message = r, this.data = n, this.url = o, this.res = c, F(this, I, new Proxy(this, A(this, V))); } static [Symbol.hasInstance](e) { - return (e == null ? void 0 : e.constructor) === gr || (e == null ? void 0 : e[Symbol.for("HttpResponse")]) === !0; + return (e == null ? void 0 : e.constructor) === yr || (e == null ? void 0 : e[Symbol.for("HttpResponse")]) === !0; } }; -I = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(); -let ct = jn; +I = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(); +let ct = Pn; const Bt = (t, e, r, n = "/", o = "") => new ct(t, e, r, n, o); -var We = ["utf8", "utf-8", "unicode-1-1-utf-8"], br = { TextEncoder: function(t) { - if (We.indexOf(t) < 0 && typeof t < "u" && t != null) throw new RangeError("Invalid encoding type. Only utf-8 is supported"); +var Ie = ["utf8", "utf-8", "unicode-1-1-utf-8"], mr = { TextEncoder: function(t) { + if (Ie.indexOf(t) < 0 && typeof t < "u" && t != null) throw new RangeError("Invalid encoding type. Only utf-8 is supported"); this.encoding = "utf-8", this.encode = function(e) { if (typeof e != "string") throw new TypeError("passed argument must be of tye string"); var r = unescape(encodeURIComponent(e)), n = new Uint8Array(r.length); @@ -1351,7 +1358,7 @@ var We = ["utf8", "utf-8", "unicode-1-1-utf-8"], br = { TextEncoder: function(t) return n; }; }, TextDecoder: function(t) { - if (We.indexOf(t) < 0 && typeof t < "u" && t != null) throw new RangeError("Invalid encoding type. Only utf-8 is supported"); + if (Ie.indexOf(t) < 0 && typeof t < "u" && t != null) throw new RangeError("Invalid encoding type. Only utf-8 is supported"); this.encoding = "utf-8", this.decode = function(e, r) { if (typeof e > "u") return ""; var n = typeof r < "u" && n in r && r.stream; @@ -1364,9 +1371,9 @@ var We = ["utf8", "utf-8", "unicode-1-1-utf-8"], br = { TextEncoder: function(t) throw new TypeError("passed argument must be an array buffer view"); }; } }; -const Nn = new br.TextEncoder("utf8"); -new br.TextDecoder("utf8"); -class Mn { +const jn = new mr.TextEncoder("utf8"); +new mr.TextDecoder("utf8"); +class kn { constructor(e) { if (T(this, "encodeTable", []), T(this, "decodeMap", new Uint8Array(256).fill(255)), e.length !== 62) throw new Error("Encoding alphabet must be 62 characters long"); if (e.includes(` @@ -1376,19 +1383,19 @@ class Mn { } encode(e) { if (!e || e.length === 0) return ""; - const r = new Un(this).encodeV2(e); + const r = new Nn(this).encodeV2(e); return String.fromCharCode(...r); } decode(e) { if (!e || e.length === 0) return ""; - const r = new Bn(this).decode(e); + const r = new Mn(this).decode(e); return new TextDecoder().decode(r); } } -var mt, gt, Y, K, Zt, q, H, tt, Yt, bt; -class Un { +var mt, gt, Y, K, Qt, q, H, tt, Xt, bt; +class Nn { constructor(e) { - P(this, mt), T(this, "src", new Uint8Array()), T(this, "pos", 0), F(this, mt, e); + j(this, mt), T(this, "src", new Uint8Array()), T(this, "pos", 0), F(this, mt, e); } get6bits() { let e = 7 & this.pos, r = this.pos >> 3; @@ -1398,7 +1405,7 @@ class Un { } encodeV2(e) { this.src = function(n) { - return Nn.encode(n || ""); + return jn.encode(n || ""); }(e), this.pos = 8 * this.src.length; const r = []; for (; this.pos > 0; ) { @@ -1409,9 +1416,9 @@ class Un { } } mt = /* @__PURE__ */ new WeakMap(); -class Bn { +class Mn { constructor(e) { - P(this, gt), F(this, gt, e); + j(this, gt), F(this, gt, e); } decode(e) { const r = new Uint8Array(Math.ceil(6 * e.length / 8) + 1); @@ -1430,13 +1437,13 @@ gt = /* @__PURE__ */ new WeakMap(), Promise.withResolvers || (Promise.withResolv t = r, e = n; }), resolve: t, reject: e }; }); -class te { +class Zt { constructor(e, r, n) { - P(this, Y), P(this, K), P(this, Zt), P(this, q, { "#": /* @__PURE__ */ new Map(), $: /* @__PURE__ */ new Map() }), P(this, H, /* @__PURE__ */ new Map()), P(this, tt, /* @__PURE__ */ new Set()), T(this, "init", (o, c, a) => { - o && F(this, Zt, o), a && F(this, Y, a), c && F(this, K, new Mn(c)), A(this, Yt).call(this); - }), P(this, Yt, () => { + j(this, Y), j(this, K), j(this, Qt), j(this, q, { "#": /* @__PURE__ */ new Map(), $: /* @__PURE__ */ new Map() }), j(this, H, /* @__PURE__ */ new Map()), j(this, tt, /* @__PURE__ */ new Set()), T(this, "init", (o, c, a) => { + o && F(this, Qt, o), a && F(this, Y, a), c && F(this, K, new kn(c)), A(this, Xt).call(this); + }), j(this, Xt, () => { !A(this, tt).size || !A(this, Y) || (A(this, tt).forEach((o) => A(this, bt).call(this, ...o)), A(this, tt).clear()); - }), P(this, bt, (o, c, a, g = !1) => { + }), j(this, bt, (o, c, a, g = !1) => { if (A(this, Y)) { const { url: b, method: y, ...s } = a || {}; A(this, Y).call(this, { url: b, method: y, ...s }).then((d) => { @@ -1449,13 +1456,13 @@ class te { }, 300), w; }).then((d) => { var w; - return (w = A(this, H).get(o)) == null ? void 0 : w.forEach((O, m, f) => { - O && O[0](d), delete f[m]; + return (w = A(this, H).get(o)) == null ? void 0 : w.forEach((E, m, f) => { + E && E[0](d), delete f[m]; }); }).catch((d) => { var w; - A(this, q)[c].delete(o), (w = A(this, H).get(o)) == null || w.forEach((O, m, f) => { - O && O[1](d instanceof ct ? d : Bt(-1, d, null, b)), delete f[m]; + A(this, q)[c].delete(o), (w = A(this, H).get(o)) == null || w.forEach((E, m, f) => { + E && E[1](d instanceof ct ? d : Bt(-1, d, null, b)), delete f[m]; }); }).finally(() => A(this, H).delete(o)); } else A(this, tt).add([o, c, a, g]); @@ -1468,11 +1475,13 @@ class te { let u = 5381; for (let l = 0; l < i.length; l++) u = 33 * u ^ i.charCodeAt(l); return (u >>> 0).toString(16); - }(JSON.stringify([o, s, a])), w = (b = o == null ? void 0 : o.includes) != null && b.call(o, "/_/") ? "#" : "$", { promise: O, resolve: m, reject: f } = Promise.withResolvers(); - return A(this, q)[w].has(d) ? (console.log("cache", o), m(A(this, q)[w].get(d))) : A(this, H).has(d) ? (y = A(this, H).get(d)) == null || y.push([m, f]) : (A(this, H).set(d, [[m, f]]), A(this, bt).call(this, d, w, { url: o, method: s, ...a }, g)), new Proxy(O, { get: (i, u) => u === Symbol.for("HttpResponse") || ((...l) => i.then((p) => Bt(...p)[u](...l)).catch((p) => { + }(JSON.stringify([o, s, a])), w = (b = o == null ? void 0 : o.includes) != null && b.call(o, "/_/") ? "#" : "$", { promise: E, resolve: m, reject: f } = Promise.withResolvers(); + return A(this, q)[w].has(d) ? (console.log("cache", o), m(A(this, q)[w].get(d))) : A(this, H).has(d) ? (y = A(this, H).get(d)) == null || y.push([m, f]) : (A(this, H).set(d, [[m, f]]), A(this, bt).call(this, d, w, { url: o, method: s, ...a }, g)), new Proxy(E, { get: (i, u) => u === Symbol.for("HttpResponse") || ((...l) => i.then((p) => Bt(...p)[u](...l)).catch((p) => { if (!(p instanceof ct)) throw p; return typeof p[u] == "function" ? p[u](...l) : p[u]; - })) }); + })), set: (i, u) => { + throw new TypeError(`request() 返回值是只读的,不能设置属性 "${String(u)}"`); + } }); }), T(this, "get", (o, c = {}) => this.request({ url: o, method: "GET", params: c })), T(this, "post", (o, c = {}, a = {}) => this.request({ url: o, method: "POST", data: c, params: a })), T(this, "put", (o, c = {}, a = {}) => this.request({ url: o, method: "PUT", data: c, params: a })), T(this, "del", (o, c = {}, a = {}) => this.request({ url: o, method: "DELETE", data: c, params: a })), T(this, "download", (o, c) => { }), T(this, "cache", (o, c = {}) => this.request({ url: o, method: "GET", params: c }, !0)), T(this, "list", (o, c = {}) => this.get(`/api/${o}/${this.encode(c)}`)), T(this, "getAppInfo", () => { }), T(this, "refreshCache", (o = !1) => { @@ -1482,26 +1491,26 @@ class te { try { if (!A(this, K)) throw new Error("未初始化 appSecret,请先通过 init 设置 appSecret"); const a = A(this, K).decode(o); - return qe.unpack(a); + return Fe.unpack(a); } catch { return console.warn("core.decode", o), c; } }), T(this, "encode", (o = {}) => { if (!A(this, K)) throw new Error("未初始化 appSecret,请先通过 init 设置 appSecret"); const c = JSON.stringify(o, (a, g) => g === void 0 ? null : g); - return A(this, K).encode(qe.pack(c)); + return A(this, K).encode(Fe.pack(c)); }), this.init(e, r, n); } } -Y = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), te.onUnhandledRejection = (t) => { +Y = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), Zt.onUnhandledRejection = (t) => { var e; const r = t instanceof ct ? t : (t == null ? void 0 : t.reason) instanceof ct ? t.reason : null; r != null && r.IS_ECHO_MSG && (r.$echoMsg(), (e = t == null ? void 0 : t.preventDefault) == null || e.call(t)); -}, te.onMsg = (t, e) => [0, 1].includes(t) ? console.log(e) : console.warn(e); -var wr = { exports: {} }; +}, Zt.onMsg = (t, e) => [0, 1].includes(t) ? console.log(e) : console.warn(e); +var gr = { exports: {} }; /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */ -wr.exports = function() { +gr.exports = function() { var t, e, r = { version: "0.2.0" }, n = r.settings = { minimum: 0.08, easing: "ease", positionUsing: "", speed: 200, trickle: !0, trickleRate: 0.02, trickleSpeed: 800, showSpinner: !0, barSelector: '[role="bar"]', spinnerSelector: '[role="spinner"]', parent: "body", template: '