Files
ff-dist/dist/common/main-D3Yt2diy.js
2026-05-03 22:09:21 +08:00

1512 lines
106 KiB
JavaScript

var bn = Object.defineProperty;
var hi = (t) => {
throw TypeError(t);
};
var Cn = (t, e, i) => e in t ? bn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
var N = (t, e, i) => Cn(t, typeof e != "symbol" ? e + "" : e, i), gi = (t, e, i) => e.has(t) || hi("Cannot " + i);
var c = (t, e, i) => (gi(t, e, "read from private field"), i ? i.call(t) : e.get(t)), x = (t, e, i) => e.has(t) ? hi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), B = (t, e, i, n) => (gi(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i);
var mi = (t, e, i, n) => ({
set _(r) {
B(t, e, r, i);
},
get _() {
return c(t, e, n);
}
});
import { jsx as g, jsxs as A } from "react/jsx-runtime";
import E, { useEffect as V, useState as L, useCallback as Y, useRef as H, useContext as pe, useMemo as _, useId as Mt, isValidElement as kn, useLayoutEffect as Sn } from "react";
import ge from "pathe";
import b from "prop-types";
import O from "classnames";
import * as fi from "react-is";
import { useNotification as En } from "rc-notification";
import m from "lodash";
import re, { Field as Xt, FieldContext as Oi } from "rc-field-form";
import { M as At, _ as $n, N as Ze, a as Me, s as Dt, b as vn, S as xn } from "./vender-DTKG7Nf1.js";
import Ri from "immutability-helper";
import { Space as Nn, Form as wt, Input as Pn, Button as Ct, Pagination as Tn, Tree as On, Breadcrumb as Rn, Empty as zt, Table as yi, Popover as Fn, Popconfirm as jn, Tooltip as An } from "antd";
import Ln from "rc-util/lib/hooks/useMergedState";
import { useMergedState as In } from "rc-util";
import { generatePath as Vn, useInRouterContext as Fi, useParams as Mn, useLocation as Dn, createBrowserRouter as zn, Navigate as Wn } from "react-router-dom";
import Bn from "rc-drawer";
import Un from "rc-dialog";
var Ke, tt, _e, Ee, De, ze;
class ji {
constructor(e, i) {
x(this, Ke, /* @__PURE__ */ new Map());
x(this, tt, !0);
x(this, _e, []);
x(this, Ee);
x(this, De, () => c(this, Ee));
x(this, ze, () => Promise.resolve());
N(this, "get", (...e) => new Promise((i, n) => {
const r = JSON.stringify(e);
if (c(this, Ke).has(r)) return i(c(this, ze).call(this, c(this, Ee), ...e));
if (c(this, Ee) === void 0) c(this, _e).push([e, i, n]), c(this, tt) && (B(this, tt, !1), Promise.resolve(typeof c(this, De) == "function" ? c(this, De).call(this) : c(this, De)).then((o) => B(this, Ee, o || null)).finally(() => {
c(this, _e).forEach(([o, a, s]) => {
try {
const l = c(this, ze).call(this, c(this, Ee), ...o);
c(this, Ke).set(JSON.stringify(o), l), a(l);
} catch (l) {
s(l);
}
}), c(this, _e).length = 0;
}));
else {
const o = c(this, ze).call(this, c(this, Ee), ...e);
c(this, Ke).set(r, o), i(o);
}
}));
B(this, ze, i), B(this, De, e);
}
}
Ke = new WeakMap(), tt = new WeakMap(), _e = new WeakMap(), Ee = new WeakMap(), De = new WeakMap(), ze = new WeakMap();
const po = () => g("div", { children: "Empty" }), pt = E.createContext({ ele: {}, mount: () => {
}, unmount: () => {
} }), ee = ({ rootClassName: t, className: e, children: i, actions: n, title: r, subTitle: o, extras: a, style: s = {} }) => {
const { mount: l, unmount: d } = E.useContext(pt);
return ee.Action({ children: n }), ee.Title({ children: r }), ee.SubTitle({ children: o }), ee.Extra({ children: a }), V(() => (l("rootClassName", t), () => d(t)), [t]), g("div", { className: O("ff-container", e), style: s, children: i });
}, yt = (t) => ({ children: e, className: i }) => {
const { mount: n, unmount: r } = E.useContext(pt);
return V(() => (e && n(t, E.createElement("div", { key: `ff-${t}`, className: O(`ff-popup-${t}`, i) }, e)), () => r(t)), [i, e]), null;
};
ee.Action = yt("actions"), ee.Title = yt("title"), ee.SubTitle = yt("sub-title"), ee.Extra = yt("extras"), ee.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any };
const ho = () => g(ee, { className: "ff-loading", children: A("div", { className: "loader", children: [A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] })] }) }), go = () => g("div", { children: "NotFound" }), Ai = ({ children: t }) => {
const [e, i] = L({}), n = Y((o, a) => i((s) => ({ ...s, [o]: a })), []), r = Y((o) => i((a) => ({ ...a, [o]: void 0 })), []);
return typeof (t == null ? void 0 : t.type) == "string" ? t : g(pt.Provider, { value: { ele: e, mount: n, unmount: r }, children: E.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) });
};
Ai.propTypes = { children: b.element.isRequired };
const wi = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Qt = ({ type: t, props: e }) => g("i", { ...e, children: g("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (wi[t] || wi.info).map((i, n) => g("path", { d: i }, n)) }) }), Li = ({ className: t, content: e, icon: i, $close: n }) => A(E.Fragment, { children: [i && g("div", { className: O("ff-notification-icon", t), children: g(Qt, { type: i }) }), e] }), qn = ({}) => g(ee, { children: "Confirm" });
var Pe, He;
const me = class me {
constructor() {
x(this, He, /* @__PURE__ */ new Map());
N(this, "init", (e) => B(this, He, new Map(e)));
N(this, "check", (e) => !c(this, He).has(e) || c(this, He).get(e));
if (c(me, Pe)) return c(me, Pe);
}
};
Pe = new WeakMap(), He = new WeakMap(), x(me, Pe, null), N(me, "getInstance", () => (c(me, Pe) || B(me, Pe, new me()), c(me, Pe)));
let Wt = me;
const Ii = Wt.getInstance(), Kn = (t, e, i = "children") => {
if (m.isEmpty(t)) return {};
const n = m.find(t, ["value", e]);
if (!m.isEmpty(n)) return n;
const r = t.length;
for (let o = 0; o < r; o++) {
const { [i]: a } = t[o], s = Kn(a, e, i);
if (!m.isEmpty(s)) return s;
}
return {};
}, Vi = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`;
var Te, it;
const fe = class fe {
constructor() {
x(this, it, null);
N(this, "init", (e) => B(this, it, e));
N(this, "get", (e, i) => m.get(c(this, it), e, i));
if (c(fe, Te)) return c(fe, Te);
}
};
Te = new WeakMap(), it = new WeakMap(), x(fe, Te, null), N(fe, "getInstance", () => (c(fe, Te) || B(fe, Te, new fe()), c(fe, Te)));
let Bt = fe;
const Ue = Bt.getInstance(), bi = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => {
switch (`${t}`.toLowerCase()) {
case "0":
case "false":
case "[]":
case "{}":
return !1;
}
return !!t;
}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, de = (t, e) => {
let i = "string";
i = Array.isArray(t) ? "array" : typeof t, m.isObject(t) && (i = "json");
const n = `${i}2${e}`;
return Reflect.has(bi, n) ? bi[n](t) : t;
}, _n = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, ht = (t = {}, e = {}, i = {}, n = "") => Mi(t, (r, o) => o === "type" && r === "code") ? Di(t, e, i, n) : zi(t, e, n), Mi = (t, e = () => !1) => m.some(t, (i) => !!m.some(i, e) || (m.isEmpty(i) || !m.isPlainObject(i) && !m.isArray(i) ? void 0 : Mi(i, e))), Di = async (t = {}, e = {}, i = {}, n = "") => {
let r = /* @__PURE__ */ Object.create(null);
for (let o in t) {
let a;
if (Reflect.has(t[o], "type") && ["code", "field", "router", "query", "string"].includes(t[o].type)) {
const { type: s, value: l = "", default: d = n } = t[o];
switch (s) {
case "code":
try {
a = await Ie.exec(l, e, i);
} catch (u) {
console.error("getWidgetPropsData", u);
}
break;
case "field":
a = m.get(e, l) ?? m.get(e, l.substring(l.indexOf(".") + 1));
break;
case "router":
case "query":
a = Ne.getPageParams(l);
break;
case "string":
a = l;
}
a ?? (a = d);
} else a = await Di(t[o], e, i, n);
m.set(r, o, a);
}
return r;
}, zi = (t = {}, e = {}, i = "") => Object.keys(t || {}).reduce((n, r) => {
if (m.isPlainObject(t[r])) {
let o;
if (Reflect.has(t[r], "type") && ["field", "router", "query", "string"].includes(t[r].type)) {
const { type: a, value: s = "", default: l = i } = t[r];
switch (a) {
case "field":
o = m.get(e, s) ?? m.get(e, s.substring(s.indexOf(".") + 1));
break;
case "router":
case "query":
o = Ne.getPageParams(s);
break;
case "string":
o = s;
}
o ?? (o = l);
} else o = zi(t[r], e, i);
m.set(n, r, o);
}
return n;
}, {}), Lt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((i) => Lt(i, e)) : Object.keys(t).reduce((i, n) => (e[n] ? i[e[n]] = Lt(t[n], e) : i[n] = Lt(t[n], e), i), {}) : t, mo = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
const e = 16 * Math.random() | 0;
return (t === "x" ? e : 3 & e | 8).toString(16);
}), fo = (t) => {
var e, i;
return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?<name>[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.name : "";
}, yo = (t) => {
var e, i;
return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?<category>[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.category : "";
}, wo = (t) => {
var e, i;
return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?<owner>[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.owner : "";
}, Hn = (t, e = 32, i = "auto") => {
const n = Ut(t), r = i === "auto" ? "x64" : i;
if (e === 32) return At.x86.hash32(n).toString();
if (e === 128) return r === "x64" ? At.x64.hash128(n) : At.x86.hash128(n);
throw new Error("bits 只能是 32 或 128");
}, Ut = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(Ut).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Ut(t[e])}`).join(",") + "}" : String(t), Jn = () => {
let t = 1;
const e = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Map();
return (...n) => n.length === 0 ? "" : n.map((r) => {
return String((o = r) === null || typeof o != "object" && typeof o != "function" ? (i.has(o) || i.set(o, t++), i.get(o)) : (e.has(o) || e.set(o, t++), e.get(o)));
var o;
}).join("::");
}, Gn = (t) => {
if (!t || typeof t != "string" || t.startsWith("/") || t.startsWith("./") || t.startsWith("../")) return !1;
try {
let e = t.startsWith("//") ? `http:${t}` : t;
return e.includes("://") || e.startsWith("//") || (e = `http://${e}`), !!new URL(e).hostname;
} catch {
return !1;
}
}, bo = (t, e = "") => {
if (!t || typeof t != "string" || Gn(t)) return t;
let i = e;
return !i && typeof window < "u" && window.location && (i = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? i ? `${i}${t}` : t : i ? `${i}/${t}` : t;
};
var Et, nt, rt, $t;
const vt = class vt {
constructor(...e) {
x(this, nt, []);
x(this, rt, (e) => {
var i;
for (let n of e) Array.isArray(n[0]) ? c(this, rt).call(this, n) : c(this, nt).push(c(i = vt, Et).call(i, n[0], n[1]));
});
N(this, "toValue", async (e, i = null) => {
const n = { getValue: () => e, getRecord: () => i };
let r = e;
for (const o of c(this, nt)) try {
const a = await o;
if (typeof a != "function") {
console.warn("middleware is not a function, skip:", a);
continue;
}
r = await a.call(n, r);
} catch (a) {
console.error("middleware error, skip:", a);
}
return r;
});
N(this, "toRender", (e, i, n = null) => E.createElement(c(this, $t), { value: e, record: i }, n));
x(this, $t, ({ value: e, record: i, children: n }) => {
const [r, o] = L(n);
return mt(() => {
let a = !1;
return o(n), this.toValue(e, i).then((s) => !a && o(s)).catch((s) => !a && o(`${s}`)), () => a = !0;
}, [e, i]), r;
});
c(this, rt).call(this, e);
}
};
Et = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), $t = new WeakMap(), x(vt, Et, m.memoize((e, i) => {
if (typeof e == "function") return e(i);
if (typeof e == "string") return ue.getWidgetComponent(e).then((n) => {
var r;
return ((r = n.default) == null ? void 0 : r.call(n, i)) || ((o) => o);
});
throw new TypeError("middleware must be a string or a function");
}, Jn()));
let kt = vt;
const ae = E.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => {
}, getSelectedRows: () => [], onReload: () => {
}, onClickCallback: () => {
}, onConditionChange: () => {
}, onTabChange: () => {
}, onSiderChange: () => {
}, onKeywordChange: () => {
}, onPageChange: () => {
}, onPageSizeChange: () => {
}, reload: () => {
}, setPage: () => {
}, setPageSize: () => {
}, setTab: () => {
}, setSider: () => {
}, setKeyword: () => {
}, setCondition: () => {
} }), Ci = ({ className: t, record: e, column: i, ...n }) => {
if (i != null && i.editableByJs && (i != null && i.uuid)) {
const { formSetting: r = { primaryKey: "id" }, widgetSetting: o = {}, widgetContainerSetting: a = {} } = (i == null ? void 0 : i.editableByJsSetting) || {};
return g(P.Popover, { widget: Yn, widgetData: { record: e, column: i }, widgetSetting: { widgetSetting: o, formSetting: r }, widgetContainerProps: { title: i != null && i.title ? `${i.title} - 编辑` : "编辑", ...a, width: (a == null ? void 0 : a.width) || 260, arrow: !0 }, children: g("td", { className: O("ff-data-list-cell-editable", t), ...n }) });
}
return g("td", { className: t, ...n });
}, Yn = ({ record: t, column: e, $close: i, $setting: n }) => {
const r = H(_n(m.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = pe(ae), [s] = re.useForm(), { formSetting: l, widgetSetting: d } = n, u = (l == null ? void 0 : l.primaryKey) || "id", p = () => {
s.setFieldsValue({ value: m.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t });
};
return mt(() => p(), [t, e == null ? void 0 : e.dataIndex, o]), g(ee, { actions: A(E.Fragment, { children: [g(P, { size: "small", onClick: p, children: "重置" }), A(Nn.Compact, { block: !0, children: [g(P, { size: "small", widget: i, children: "取消" }), g(P, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => {
const h = m.get(t, u.substring(u.indexOf(".") + 1));
if (!h) throw "获取更新主键失败!";
I.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${h}`, { value: f }).msg(() => a(2, t)).then(i);
}).catch(console.warn), children: "保存" })] })] }), children: A(re, { form: s, children: [g(ti, { label: "", type: r.current, code: "value", widget: e == null ? void 0 : e.editableByJs, extras: d }), g(Xt, { noStyle: !0, name: ["__PROPS__"], children: () => {
} })] }) });
}, Xn = (t) => function(e) {
return t(e, getRecord());
}, Qn = (t, e = {}) => _(() => {
var i;
return (i = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : i.map(({ widgetByJs: n, widgetByJsSetting: r, ...o }, a) => {
const s = (d) => ({ record: d, column: o });
let l = [];
return n && l.push([n, r]), l.length > 0 ? (o != null && o.render && l.push([Xn, o.render]), { ...o, onCell: s, render: (d, u) => new kt(l).toRender(d, u, "-") }) : { ...o, onCell: s };
});
}, [t, e]), Zn = (t = {}) => _(() => {
var e;
return t.body ?? (t.body = { cell: Ci }), (e = t.body).cell ?? (e.cell = Ci), t;
}, [t]), Co = (t) => {
const [e, i] = L({});
return V(() => {
let n = !1;
return t && I.get(`/api/_/${t}`).then((r) => m.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((r) => !n && i(r)), () => n = !0;
}, [t]), e;
}, ko = (t, e = {}) => {
const [i, n] = L({ dataSource: [] });
return gt(() => {
let r = !1;
return t && I.get(`/api/${t}/${I.encode({ page: 1, ...e })}`).then((o) => !r && n(o)), () => r = !0;
}, [t, e]), i;
}, Wi = (t = [], e = /* @__PURE__ */ new Map(), i = "id", n) => {
const r = Y(n ? (o) => m.get(o, i, m.get(o, [n, i])) : (o) => m.get(o, i), [i, n]);
return Y((o) => t == null ? void 0 : t.filter((a) => !a.uuid || !e.has(a.uuid) || e.get(a.uuid).some((s) => s == r(o))), [t, e, r]);
}, qt = (t = [], e = /* @__PURE__ */ new Map(), i = [], n = "id", r) => {
const o = Y(r ? (a) => m.get(a, n, m.get(a, [r, n])) : (a) => m.get(a, n), [n, r]);
return _(() => {
if (m.isEmpty(t) || !t.some(({ uuid: s }) => Ii.check(s))) return !1;
if (m.isEmpty(e) || m.isEmpty(i)) return !0;
const a = i.map((s) => o(s));
return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => a.some((d) => d == l)));
}, [t, i, e, o]);
}, er = (t, e, i = "id", n = null) => {
const r = Tt(), o = H(!1), a = H(t.dataSource), s = H(t.itemOperationsAccess);
return V(() => (a.current = t.dataSource, s.current = t.itemOperationsAccess, () => o.current = !1), [t.dataSource, t.itemOperationsAccess]), o.current && (t.dataSource = a.current, t.itemOperationsAccess = s.current), [t, (l = 0, d = null) => {
var u, p;
if (o.current = !1, l === 1) return (u = t.onReload) == null ? void 0 : u.call(t);
if (l === 2) {
const f = m.get(d, "__PARENT_ID__", ""), h = m.get(d, i, m.get(d, [n, i], "")), y = m.findIndex(a.current, ["__PARENT_ID__", f]), w = m.findIndex(y > -1 ? m.get(a.current, [y, "children"]) : a.current, [i, h]);
if (w === -1) return (p = t.onReload) == null ? void 0 : p.call(t);
Promise.all([I.get(`/api/${e}/detail/${h}`), I.post(`/api/${e}/list-operations-access`, { ids: h })]).then(([C, S]) => {
const v = m.get(a.current, y > -1 ? [y, "children", w, "children"] : [w, "children"]);
a.current = Ri(a.current, y > -1 ? { [y]: { children: { $splice: [[w, 1, { ...C, children: v }]] } } } : { $splice: [[w, 1, { ...C, children: v }]] });
const k = new Map(S);
s.current.forEach(($, T) => {
var j;
(j = k.get(T)) != null && j.some((F) => F == h) || s.current.set(T, $.filter((F) => F !== h));
}), k.forEach(($, T) => {
s.current.has(T) ? s.current.set(T, m.uniq([...s.current.get(T) || [], ...$])) : s.current.set(T, $);
});
}).then(() => {
o.current = !0, r();
});
}
}];
}, tr = (t, e) => {
const i = Tt(), n = H(e), r = H(/* @__PURE__ */ new Map()), o = H([]), a = m.throttle((l) => {
o.current = [], I.list(t, m.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: u, total: p, tab: f, sider: h, page: y, pageSize: w, operationsAccess: C, dataSource: S }) => {
n.current = { tab: f, condition: u, sider: h, keyword: d, total: p, pageSize: w, page: S != null && S.length ? y : 1 }, o.current = S, r.current = new Map(C), i();
});
}, 380, { leading: !1, trailing: !0 });
mt(() => {
o.current = [], t && a(e);
}, [t, e]);
const s = _(() => m.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]);
return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, d) => a({ page: l, pageSize: d }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, d) => a({ keyword: d, condition: Ri(n.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 });
}, ir = ({ listCode: t, className: e, layouts: i = {}, dataSource: n, isPaginate: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: u, primaryKey: p, title: f, itemGridLayout: h, $setting: y, tabs: w, isConditionFormLayout: C, isTreeSider: S, treeSiderConfig: v }) => {
const { classNames: k, onClickCallback: $ } = pe(ae), T = m.pick(y, ["column", "colWidth", "beforeRender", "afterRender", "style"]), j = Wi(l, d, p, u), F = Y((M, D, R) => g(nr, { className: O("ff-data-list-framework-item", k == null ? void 0 : k.item), operations: o ? j(D) : [], data: u ? { [u]: D } : D, children: M, onClickCallback: $ }), [u, p, o, $, l, d]);
return A("div", { className: O("ff-data-list-framework", e), children: [g(i.sider, { isTreeSider: S, ...v }), A("div", { className: O("ff-data-list-container", k == null ? void 0 : k.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: f, tabs: w }), g(yr, { ...T, ...h, empty: g(i.empty, { className: k == null ? void 0 : k.empty }), primaryKey: p, itemRender: F, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: a, operations: s })] })] });
}, nr = ({ className: t, operations: e, children: i, data: n, onClickCallback: r }) => A("div", { className: O("data-list-grid-layout-item", t), children: [g("div", { className: "data-list-grid-layout-item-container", children: i }), !!(e != null && e.length) && g("div", { className: "data-list-grid-layout-item-actions", children: e.map((o) => g("span", { className: "data-list-grid-layout-item-action", children: g(P.Link, { uuid: o.uuid, type: o.type, name: o.name, widget: o.widget, widgetType: o.widgetType, widgetProps: o.widgetProps, widgetSetting: o.widgetSetting, widgetContainerProps: o.widgetContainerSetting, data: n, confirm: o.confirm, onAfterClick: (a) => a !== !1 && (r == null ? void 0 : r(o.isRefresh, n)) }, o.uuid || Mt()) }, (o == null ? void 0 : o.uuid) || Mt())) })] }), rr = ({ listCode: t, className: e, layouts: i = {}, dataSource: n, columns: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: u, primaryKey: p, title: f, tabs: h, isPaginate: y, rowSelection: w, isTreeSider: C, treeSiderConfig: S, isConditionFormLayout: v, ...k }) => {
const { classNames: $, onClickCallback: T } = pe(ae), j = Wi(l, d, p, u), F = qt(l, d, n, p, u);
return A("div", { className: O("ff-data-table-framework", e), children: [g(i.sider, { isTreeSider: C, ...S }), A("div", { className: O("ff-data-table-container", $ == null ? void 0 : $.container), children: [g(i.filter, { isConditionFormLayout: v }), g(i.toolbar, { title: f, tabs: h }), g(ur, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: n, rowSelection: w, operationRender: F ? (M) => {
var D;
return g("div", { className: "ff-data-table-actions", children: (D = j(M)) == null ? void 0 : D.map((R, W) => g(P.Link, { size: "small", uuid: R.uuid, type: R.type, name: R.name, widget: R.widget, widgetType: R.widgetType, widgetProps: R.widgetProps, widgetData: R.widgetData, widgetSetting: R.widgetSetting, widgetContainerProps: R.widgetContainerSetting, data: M, confirm: R.confirm, onAfterClick: (U) => U !== !1 && (T == null ? void 0 : T(R.isRefresh, M)) }, R.uuid || W)) });
} : null }), g(i.footer, { isPaginate: y, isOperations: a, operations: s })] })] });
}, Zt = (t = [], e, i = null) => {
var n;
return (n = m.sortBy(t, ["y", "x"])) == null ? void 0 : n.map(({ i: r, x: o, y: a, w: s, h: l, field: { boxStyle: d, ...u } = {} }, p) => g("div", { className: "grid-layout-item", style: Bi(o, a, s, l, d), children: g(e, { ...u, basicForm: i }) }, r ?? p));
}, Bi = (t, e, i, n, r = {}, o = 0) => {
const a = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${i}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" };
return r != null && r.autoHeight ? a.height = "fit-content" : a["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (a["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (a["--grid-layout-box-justify-content"] = r.justifyContent), a["--grid-layout-box-margin"] = ki(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), a["--grid-layout-box-padding"] = ki(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), o && (a.height = `${o}px`), a;
}, ki = (t, e, i, n) => `${t || 0}px ${e || 0}px ${i || 0}px ${n || 0}px`, So = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Ui = (t) => Object.keys(t).reduce((e, i) => (/^on[A-Z]/.test(i) && (e[i] = t[i]), e), {}), qi = ({ className: t, isConditionFormLayout: e }) => {
var f, h;
const [i, n] = L({}), { listCode: r, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = E.useContext(ae), { keyword: d, condition: u } = (s == null ? void 0 : s()) || {}, [p] = wt.useForm();
return V(() => {
r && e && I.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: y, marginX: w, marginY: C, rowHeight: S, cols: v, fields: k }) => {
n({ resource: y, itemMargin: [w, C], rowHeight: S, cols: v, fields: k });
}).catch(() => n({}));
}, [r, e]), V(() => {
p.setFieldsValue({ keyword: d, ...u });
}, [JSON.stringify([d, u])]), g("div", { className: O("ff-data-list-filter", l.filter, t), children: g(wt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = i.fields) == null ? void 0 : f.length) > 1 ? (y) => a({ [i.resource]: y[i.resource] }, y.keyword) : () => {
}, onValuesChange: (y) => {
m.isEmpty(m.omit(y, ["keyword"])) || p.submit();
}, children: ((h = i.fields) == null ? void 0 : h.length) > 1 ? g(ii, { ...i, children: g(or, { onReset: () => {
const { keyword: y, condition: w } = s("init") || {};
p.setFieldsValue({ keyword: y, ...w });
} }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: Bi(20, 0, 5, 2), children: g(wt.Item, { name: ["keyword"], children: g(Pn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (y) => o(y) }) }) }) }) }) });
}, or = ({ cols: t, fields: e, onReset: i }) => {
const [n, r] = L(!1), o = _(() => e == null ? void 0 : e.toReversed().some((a) => a.y > 1 || a.x + a.w >= t - 5), [t, e]);
return A(wt.Item, { label: " ", style: { "--item-span": 5 }, className: O("ff-data-list-filter-actions", { expanded: n }), children: [g(Ct, { onClick: i, children: "重置" }), g(Ct, { type: "primary", htmlType: "submit", children: "查询" }), o && g(P.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((a) => !a), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] });
};
qi.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }];
const ar = ({ className: t, operations: e, isOperations: i, isPaginate: n }) => {
const { onPageChange: r, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = E.useContext(ae), { total: l, page: d, pageSize: u } = (s == null ? void 0 : s()) || {};
return i && !m.isEmpty(e) || n ? A("div", { className: O("ff-data-list-footer", t), children: [g("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, f) => g(P, { 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, onAfterClick: (h) => h !== !1 && (a == null ? void 0 : a(p.isRefresh, null)) }, p.uuid || f)) }), n && g(Tn, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `${d} 页 / 总共 ${p}`, onChange: r, onShowSizeChange: o })] }) : null;
}, sr = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: g("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], lr = ({ className: t, width: e = 280, isTreeSider: i }) => {
const { classNames: n } = pe(ae);
return i ? g(On.DirectoryTree, { className: O("ff-data-list-sider", n.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: sr }) : null;
}, cr = ({ className: t, title: e, tabs: i }) => {
const { getBase62params: n, onTabChange: r, onReload: o, classNames: a } = pe(ae), { tab: s } = (n == null ? void 0 : n()) || {}, [l, d] = In((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r });
return A("div", { className: O("ff-data-list-toolbar", a.toolbar, t), children: [g("div", { className: "ff-data-list-title", children: e }), g(Rn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: f }) => g("span", { onClick: () => d(f ?? p), className: O("ff-data-list-tab", { active: (f ?? p) == l }), children: u }), items: i }), A("div", { className: "ff-data-list-actions", children: [g(P.Link, { icon: "icon-reload", widget: () => o() }), g(P.Link, { icon: "icon-setting" })] })] });
}, dr = ({ className: t, ...e }) => g(zt, { className: O(t, "ff-data-list-empty"), image: zt.PRESENTED_IMAGE_SIMPLE, ...e }), Ki = ({ isItemGridLayout: t, theme: e, themeProps: i, onClickCallback: n, onReload: r, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: u, tab: p, onTabChange: f, keyword: h, onKeywordChange: y, condition: w, onConditionChange: C, sider: S, onSiderChange: v, layouts: k, classNames: $ = {}, payload: T = {}, dataSource: j = [], rowSelection: F, getSelectedRows: M, primaryKey: D, ...R }) => {
const [W, U] = L(), q = M ?? (() => j), he = Y((z, se) => {
const J = { tab: p, page: s, pageSize: d, keyword: h, sider: S, condition: w, total: a, payload: T };
return z && z != "init" ? m.get(J, z, se) : J;
}, [JSON.stringify(w), JSON.stringify(T), p, s, d, h, S, a]), oe = _(() => {
let z = { sider: lr, filter: qi, footer: ar, toolbar: cr, empty: dr };
k === !1 ? z = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : m.isPlainObject(k) && (z = Object.assign({}, z, k));
for (const se in z) if (z[se]) {
if (kn(z[se])) {
const J = z[se];
z[se] = (Rt) => E.cloneElement(J, Rt);
}
} else z[se] = () => g(E.Fragment, {});
return z;
}, [k]);
return V(() => {
e ? ue.getWidgetComponent(e).then((z) => {
if (!z) throw `${e} not found`;
return z;
}).catch((z) => ({ default: () => `${z}` })).then((z) => U(E.createElement(z.default, { ...R, layouts: oe, $setting: i }))) : U(g(t ? ir : rr, { ...R, layouts: oe, $setting: i }));
}, [e, i]), g(ae.Provider, { value: { classNames: $, listCode: o, onClickCallback: n, onReload: r, getBase62params: he, onPageChange: l, onPageSizeChange: u, onTabChange: f, onSiderChange: v, onKeywordChange: y, onConditionChange: C, setPage: l, setPageSize: u, setTab: f, setSider: v, setKeyword: y, setCondition: C, getSelectedRows: q }, children: W && E.cloneElement(W, { dataSource: j, primaryKey: D, rowSelection: F, ...R }) });
};
Ki.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string, empty: b.string }), layouts: b.oneOfType([b.exact({ sider: b.oneOfType([b.elementType, b.element]), filter: b.oneOfType([b.elementType, b.element]), footer: b.oneOfType([b.elementType, b.element]), toolbar: b.oneOfType([b.elementType, b.element]), empty: b.oneOfType([b.elementType, b.element]) }), b.bool]) };
var Oe, $e, We, xt;
const ye = class ye {
constructor() {
x(this, $e, null);
x(this, We, /* @__PURE__ */ new Map());
x(this, xt, () => {
if (c(this, $e)) return c(this, $e).port.postMessage({ command: "status", data: [] });
B(this, $e, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), c(this, $e).port.onmessage = (e) => {
var i, n;
(i = e.data) != null && i.uuid ? c(this, We).forEach((r, o) => {
var a;
(r == "*" || (a = r == null ? void 0 : r.includes) != null && a.call(r, e.data.uuid)) && o(e.data);
}) : ((n = e.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && I.get("/api/user-api-token").then(({ token: r, expire_at: o }) => {
c(this, $e).port.postMessage({ command: "initWs", data: [`ws${m.trimStart(I.appUrl, "http")}api/user-resource-status-ws?token=${r}`] });
});
}, c(this, $e).port.postMessage({ command: "status", data: [] });
});
N(this, "subscribe", (e, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", c(this, We).set(e, i), c(this, We).size == 1 && c(this, xt).call(this), () => this.unsubscribe(e)));
N(this, "unsubscribe", (e) => c(this, We).delete(e));
if (c(ye, Oe)) return c(ye, Oe);
}
};
Oe = new WeakMap(), $e = new WeakMap(), We = new WeakMap(), xt = new WeakMap(), x(ye, Oe, null), N(ye, "getInstance", () => (c(ye, Oe) || B(ye, Oe, new ye()), c(ye, Oe)));
let Kt = ye;
const _i = Kt.getInstance(), ei = E.forwardRef(({ listCode: t, base62params: e, className: i, theme: n, themeProps: r, layouts: o, classNames: a, onSelectionChange: s, defaultSelectedRowKeys: l, selectedRowKeys: d, onDataSourceChange: u }, p) => {
const [{ resource: f, primaryKey: h, batchOperations: y = [], itemOperations: w = [], columns: C = [], themeConfig: S, theme: v, isConditionFormLayout: k = !1, isTreeSider: $, treeSiderConfig: T, isItemGridLayout: j, itemGridLayout: { themeConfig: F, ...M } = {}, title: D, isPaginate: R, tabs: W, selectionType: U }, q] = L({ isItemGridLayout: !1, itemGridLayout: {} }), he = tr(t, e), [{ dataSource: oe, itemOperationsAccess: z, condition: se, tab: J, keyword: Rt, page: ai, total: si, pageSize: li, sider: rn, onConditionChange: on, onTabChange: an, onKeywordChange: sn, onPageChange: ln, onPageSizeChange: cn, onSiderChange: dn, onReload: Ft, payload: un }, ci] = er(he, t, h, f), pn = $n(u);
V(() => {
pn(oe, { page: ai, pageSize: li, total: si });
}, [oe]);
const [hn, gn] = Ln([], { defaultValue: l ?? [], value: d }), [di, mn] = L([]), ui = Y(() => U ? di : oe, [U, di, oe]), fn = qt(w, z, oe, h), yn = qt(y);
V(() => {
let X = null;
return t && I.get(`/api/_/${t}`).resp(({ data: Ve, res: jt }) => {
Ve != null && Ve.isDynamicRefresh && (X = _i.subscribe(() => Ft(), jt)), q(Ve);
}).catch(() => q({})), () => X == null ? void 0 : X();
}, [t]), E.useImperativeHandle(p, () => ({ onReload: Ft, onClickCallback: ci, getSelectedRows: ui }));
const wn = { listCode: t, title: D, classNames: a, layouts: o, resource: f, primaryKey: h, theme: n || v, themeProps: r || S, isTreeSider: $, treeSiderConfig: T, isPaginate: R, rowSelection: U ? { type: U, columnWidth: 80, selectedRowKeys: hn, onChange: (X, Ve) => {
mn((jt) => {
const pi = new Map(jt.map((le) => [le == null ? void 0 : le[h], le]));
return Ve.forEach((le) => pi.set(le == null ? void 0 : le[h], le)), X.map((le) => pi.get(le)).filter(Boolean);
}), gn(X), s == null || s(X, Ve);
} } : void 0, getSelectedRows: ui, tabs: W, isItemOperations: fn, itemOperations: w == null ? void 0 : w.map((X) => m.isEmpty(X == null ? void 0 : X.confirm) ? X : { ...X, confirm: Object.assign({}, X.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: yn, batchOperations: y, isItemGridLayout: j, columns: C, itemGridLayout: { ...M, themeProps: F }, isConditionFormLayout: k, itemOperationsAccess: z, dataSource: oe, onConditionChange: on, onTabChange: an, onKeywordChange: sn, onPageChange: ln, onPageSizeChange: cn, onSiderChange: dn, condition: se, tab: J, keyword: Rt, page: ai, total: si, pageSize: li, sider: rn, payload: un };
return g(Ki, { ...wn, className: O("ff-data-list-helper", i), onReload: Ft, onClickCallback: ci });
}), Hi = (t, e, i = !0) => i !== !0 && i-- <= 0 ? [] : m.isArray(t) && !m.isEmpty(t) ? t.reduce((n, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && n.push(r[e]), Reflect.has(r, "children") && !m.isEmpty(r.children) ? n.concat(Hi(r.children, e, i)) : n), []) : [], ur = ({ className: t, primaryKey: e, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => {
const { classNames: d } = pe(ae), u = H(null), p = H(null), [f, h] = L([]), [y, w] = L({ width: 0, height: 0 });
V(() => {
h(Hi(n, e));
}, [n, e]), Sn(() => {
const k = new ResizeObserver(() => {
var $;
w({ 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);
};
}, []);
const C = _(() => {
if (!(y != null && y.width) || !(i != null && i.length)) return i;
const k = (s ? s.columnWidth ?? 32 : 0) + (r ? o : 0), $ = i.reduce((F, M) => F + (M.isWidthFixed && M.width ? M.width : 0), 0), T = i.filter((F) => !F.isWidthFixed).reduce((F, M) => F + (M.width ?? 100), 0);
if ($ + T + k >= y.width) return i;
const j = y.width - $ - k;
return i.map((F) => F.isWidthFixed ? F : { ...F, width: Math.floor(j * (F.width ?? 100) / T) });
}, [i, y.width, s, r, o]), S = Qn(C), v = Zn(a);
return g("div", { ref: p, className: O("ff-data-list-table", d.content, t), children: y.height ? g(yi, { bordered: !0, ...l, components: v, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => {
var $, T;
const k = [...S ?? []];
return s && k.splice((T = ($ = k[0]) == null ? void 0 : $.key) != null && T.startsWith("__") ? 1 : 0, 0, yi.SELECTION_COLUMN), r && k.push({ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(o / y.width * 100).toFixed(2)}%`, render: (j, F, M) => r(F, M) }), k;
})(), dataSource: n, size: "middle", scroll: { x: "max-content", y: y.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: h, expandedRowKeys: f } }) : null });
}, pr = "RC_FORM_INTERNAL_HOOKS", hr = (t) => {
const [e, i] = E.useState({ items: [] });
return V(() => {
t && I.get(`/api/_/${t}`).then(({ uuid: n, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: d, cols: u, rowHeight: p, fields: f, theme: h, themeSetting: y, groups: w }) => ({ uuid: n, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: d, cols: u, rowHeight: p, theme: h, themeProps: y, groups: w, items: f })).then(i);
}, [t]), e;
}, gr = (t, { initialValue: e, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: o = "string" }, a = null) => {
const s = H(!1), l = pe(Oi), [d, u] = L(), [p, f] = L(i != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: h } = l.getInternalHooks(pr) || {};
return V(() => h == null ? void 0 : h((y, w, C) => {
if (!s.current) return;
const S = m.get(w, t);
m.isEqual(S, p) || f(de(S, o));
}), [p]), V(() => {
i == "javascript" && e ? Ie.exec(e, {}, { getFieldValueForBasicForm: (y) => a ? a.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => f(de(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => s.current = !0) : (e && f(de(e ?? l.getFieldValue(t), o)), s.current = !0);
}, [e, i]), gt(() => {
s.current && n && new kt([n, r]).toValue(p, l.getFieldsValue(!0)).then(u).catch((y) => {
u(y), console.error("布局数据转换错误: ", y, n);
});
}, [p, n, r]), [d ?? p, p];
}, Eo = (t, e, i = null) => _(() => Zt(t, e, i), [t]), Ji = (t, e, i = {}, n = {}, r = {}, o = null) => {
const a = pe(Oi), s = Tt(), l = H(!0), d = H([]), [u, p] = L(e), [f, h] = L(), y = re.useWatch((w) => JSON.stringify(m.pick(w, d.current)), a) || "{}";
return mt(() => {
t && Ie.exec(t, i, { ...n, getFieldValueForBasicForm: (w) => r ? r.getFieldValue(w) : null, getFieldValue: m.wrap(a.getFieldValue, (w, C) => (d.current.some((S) => m.isEqual(S, C)) || (d.current.push(C), s()), w == null ? void 0 : w(C))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((w) => {
l.current && (p(w), h(null));
}).catch((w) => {
l.current && (p(e), h(w));
});
}, [t, y, a, i, n]), V(() => () => l.current = !1, []), t ? [o ? de(u, o) : u, f] : [o ? de(e, o) : e, null];
}, mr = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: i, ...n }) => {
const r = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, a] = L();
return V(() => {
r && ue.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: fr(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(E.createElement(s.default, n)));
}, [r]), o;
}, fr = (t, e = {}, i = null) => (n) => {
const { code: r, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: u, convertJsSetting: p, value: f, ...h } = m.merge({}, e, n), [y, w] = gr(s ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: u, convertJsSetting: p, type: (h == null ? void 0 : h.type) || "string" }, i), C = _(() => {
const k = Object.keys((e == null ? void 0 : e.extras) || {});
return m.over([m.partialRight(m.pick, k), m.partialRight(m.omit, k)]);
}, [e == null ? void 0 : e.extras]), [S, v] = C(h);
return g(t, { ...v, value: y, rawValue: w, $setting: Object.assign({}, a, S) });
}, Gi = ({ theme: t, basicForm: e, items: i = [{ key: "default", label: "默认" }], fields: n = [], itemRender: r, chunks: o = [], children: a, $setting: s = {}, ...l }) => {
const [d, u] = L();
V(() => {
t ? ue.getWidgetComponent(t).then((f) => {
if (!(f != null && f.default)) throw "not found";
return f;
}).catch((f) => ({ default: () => `${t} ${f}` })).then((f) => u(E.createElement(f.default, {}))) : u(null);
}, [t]);
const p = _(() => i == null ? void 0 : i.map((f) => ({ ...f, children: r(f, n == null ? void 0 : n.filter((h) => !(h != null && h.group) && f.key == "default" || h.group == f.key), f.key == "default" ? a : null) })).concat(o), [i, a, o]);
return d && E.cloneElement(d, { items: p, basicForm: e, $setting: { ...s, ...l } });
}, Yi = ({ name: t, form: e = null, basicForm: i = null, style: n = {}, className: r, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: d = {}, formFields: u = [], fields: p = [], data: f, theme: h, themeProps: y = {}, groups: w = [{ key: "default", label: "默认" }], children: C, ...S }) => {
const [v] = re.useForm(e), k = _(() => [{ name: "__PROPS__", value: d }].concat(u), [d, u]);
gt(() => (v.setFieldsValue(f), () => v.resetFields()), [f]);
const $ = (T, j, F) => {
const M = Zt(j, mr, i), D = Ui(S);
return A("div", { ...D, className: O("ff-grid-layout", r), style: { ...n, "--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: [M, F && E.cloneElement(F, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: j, basicForm: i })] });
};
return g(re, { ...S, fields: k, form: v, component: !1, children: h ? g(Gi, { ...y, items: w, theme: h, itemRender: $, fields: p, children: C, basicForm: i }) : $(0, p, C) });
}, $o = /* @__PURE__ */ ((t) => function({ code: e, data: i, ...n }) {
const { uuid: r, resource: o, items: a, hides: s, rowHeight: l, marginX: d, marginY: u, cols: p, theme: f, themeProps: h, groups: y } = hr(e) || {}, w = _(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, o]);
return o && g(t, { name: e, theme: f, themeProps: h, groups: y, ...n, fields: a, formFields: w, rowHeight: l, cols: p, itemMargin: [d, u], data: o ? { [o]: i } : i });
})(Yi), yr = ({ column: t = 0, colWidth: e = 0, cols: i, rowHeight: n, itemMargin: r, fields: o, primaryKey: a, dataSource: s, beforeRender: l = null, afterRender: d = null, itemClassName: u, itemRender: p = (v, k, $) => v, empty: f = g(zt, { description: null }), className: h, style: y = {}, theme: w, themeProps: C = {}, groups: S = [{ key: "default", label: "默认" }] }) => {
const { classNames: v } = pe(ae), k = _(() => g(Yi, { groups: S, theme: w, themeProps: C, cols: i, rowHeight: n, itemMargin: r, fields: o, className: u }), [o, i, n, r, S, w, C]), $ = m.isEmpty(s);
return A("div", { className: O("ff-data-list-content", v.content, h), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [l == null ? void 0 : l(s), $ ? f : s.map((T, j) => {
const F = p(E.cloneElement(k, { data: T }), T, j);
return E.cloneElement(F, { key: `${(T == null ? void 0 : T[a]) ?? j}-${Hn(T)}` });
}), d == null ? void 0 : d(s)] });
}, wr = ({ component: t, $props: e }) => {
const { base62params: i } = ht(e, {});
return g(ee, { children: g(ei, { listCode: t, base62params: I.decode(i) }) });
}, vo = () => g(Xi, {}), Xi = () => "Empty", br = ({ component: t, $setting: e, $props: i }) => {
const [n, r] = L();
V(() => {
if (!t) return r(g(Xi, { description: null }));
ue.getWidgetComponent(t).catch((a) => ({ default: () => `${a}` })).then((a) => E.createElement(a.default, { $setting: e })).then(r);
}, [t]);
const o = ht(i, {});
return n ? E.cloneElement(n, o) : null;
}, xo = () => "NotFoundPage";
var Re, ce, Fe, je, ot, at;
const we = class we {
constructor() {
x(this, ce, /* @__PURE__ */ new Map());
x(this, Fe, {});
x(this, je, null);
N(this, "init", (e, i) => {
B(this, ce, e), B(this, Fe, i);
});
N(this, "get", (e) => (c(this, ce).has(e) || (e = Array.from(c(this, ce).keys()).find((i) => c(this, ce).get(i).uri === e)), c(this, ce).get(e) || {}));
N(this, "redirect", (e, i, n = {}) => {
const { uri: r, type: o, widgetProps: a } = this.get(e) || {}, { router: s, query: l, ...d } = i || {}, u = Object.assign({}, d, s), p = Object.assign({}, d, l);
o == "list" && (u.base62params = I.encode(u != null && u.base62params ? u.base62params : u));
let f = Vn(r || e, u);
const h = new URLSearchParams();
for (const y in a || {}) (a == null ? void 0 : a.type) == "query" && Object.has(p, y) && h.append(y, JSON.stringify(p[y]));
return h.size > 0 && (f = `${f}?${h.toString()}`), n != null && n.isOpenWindow ? window.open(f) : c(this, je).navigate(f, { replace: !!(n != null && n.isReplaceRouteHistory) });
});
N(this, "getMenus", (e) => {
var i;
return ((i = c(this, Fe)) == null ? void 0 : i[e]) || [];
});
N(this, "findMenuPathByUuid", (e) => {
let i = [];
for (const n in c(this, Fe)) if (i = c(this, ot).call(this, c(this, Fe)[n], e, [n]), i.length > 1) return i;
return i;
});
N(this, "getMenusByRouteUuid", (e) => c(this, at).call(this, e, Object.values(c(this, Fe)).flat()));
x(this, ot, (e, i, n = []) => {
if (m.isEmpty(e)) return n;
for (const { uuid: r, children: o } of e) {
if (r == i) return n.concat(r);
if (!m.isEmpty(o)) return n.concat(r, c(this, ot).call(this, o, i));
}
return n;
});
x(this, at, (e, i) => {
var r;
let n = [];
for (const o of i) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? n.push(o) : (r = o.children) != null && r.length && (n = n.concat(c(this, at).call(this, e, o.children))));
return n;
});
N(this, "getCurrentMenu", () => {
const { uuid: e } = this.getCurrentRoute() || {};
if (!e) return;
const i = this.getMenusByRouteUuid(e);
return m.isEmpty(i) ? void 0 : i[0];
});
N(this, "getCurrentRoute", (e = 0) => {
var n;
const i = (n = c(this, je).state.matches[c(this, je).state.matches.length - 1 - e]) == null ? void 0 : n.route;
if (!i) return null;
for (let [r, o] of c(this, ce)) if (o.uri === i.path) return o;
return null;
});
N(this, "getPageParams", (e) => {
var r, o, a;
let i = "", n = {};
if (Fi()) n = Mn(), i = (r = Dn()) == null ? void 0 : r.search;
else {
const { location: s = {}, matches: l = [] } = ((o = c(this, je)) == null ? void 0 : o.state) || {};
n = ((a = l[l.length - 1]) == null ? void 0 : a.params) || {}, i = s.search;
}
return i && new URLSearchParams(i).forEach((s, l) => {
n[l] = s;
}), e ? m.get(n, e) : n;
});
N(this, "createBrowserRouter", (e = {}) => {
if (c(this, ce).size == 0) return null;
const i = Ue.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ue.get(ue.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, o = (s, l) => () => Promise.all([ue.getWidgetComponent(s), ht(l)]).then(([d, u]) => [d.default || function() {
return `${s}`;
}, u]).then(([d, u]) => ({ Component: () => E.createElement(Ai, {}, E.createElement(d, { $setting: u })) })), a = Array.from(c(this, ce).values()).reduce((s, { uuid: l, uri: d, name: u, type: p, component: f, widgetSetting: h, widgetProps: y, isLogin: w, isLayout: C, extra: S }) => {
let v = {}, k = 0;
switch (p) {
case "list":
v.element = E.createElement(wr, { component: f, $props: y });
break;
case "fsdpf-component":
v.element = E.createElement(br, { key: f, component: f, $setting: h, $props: y });
}
const $ = (S == null ? void 0 : S.theme) ?? (S == null ? void 0 : S.layout);
if ($) {
const T = (S == null ? void 0 : S.themeProps) ?? (S == null ? void 0 : S.layoutProps);
if (!r[$]) return r[$] = s.length, [...s, { path: "/", lazy: o($, T), children: [{ path: d, ...v }] }];
k = r[$];
}
return C && k > -1 ? (s[k].children.push({ path: d, ...v }), s) : [...s, { path: d, ...v }];
}, [{ path: "/", lazy: o(i, {}), children: [] }]);
return a.push({ index: !0, element: E.createElement(Cr, { to: n, replace: !0 }) }), B(this, je, zn(a, e));
});
if (c(we, Re)) return c(we, Re);
}
};
Re = new WeakMap(), ce = new WeakMap(), Fe = new WeakMap(), je = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), x(we, Re, null), N(we, "getInstance", () => (c(we, Re) || B(we, Re, new we()), c(we, Re)));
let _t = we;
const Cr = ({ to: t, replace: e }) => Fi() ? E.createElement(Wn, { to: t, replace: e }) : (window.document.location = t, "redirect"), Ne = _t.getInstance(), qe = new Worker(new URL("/ff-worker/index.js", self.location)), Si = { getConfigure: (t) => Ue.get(t), route: { redirect: (...t) => Ne.redirect(...t), getPageParams: (...t) => Ne.getPageParams(...t), getCurrentRoute: () => Ne.getCurrentRoute() }, popup: { notification: (...t) => ne.notification(...t), success: (...t) => ne.success(...t), error: (...t) => ne.error(...t), form: (...t) => ne.form(...t), modal: (...t) => ne.modal(...t), confirm: (...t) => ne.confirm(...t) } };
var Nt, Je, Ae;
const K = class K {
constructor() {
N(this, "exec", (e, i = {}, n = {}, r = "") => new Promise((o, a) => {
if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return o();
const s = mi(K, Nt)._++;
c(K, Je).set(s, n), K.mQueue.set(s, [o, a]), qe.postMessage({ id: s, session: r, category: "eval", method: e, args: i });
}));
N(this, "clear", (e) => qe.postMessage({ session: e, category: "clear" }));
if (c(K, Ae)) return c(K, Ae);
Promise.resolve().then(() => _r).then((e) => {
Si.http = e.http;
}), qe.addEventListener("message", ({ data: { id: e, task_id: i, method: n, args: r, category: o, data: a, error: s, session: l } }) => {
if (o === "eval" && K.mQueue.has(e)) s !== null ? K.mQueue.get(e)[1](s) : K.mQueue.get(e)[0](a), c(K, Je).delete(e), K.mQueue.delete(e);
else if (o === "util") try {
const d = m.get(Si, n.split("/")) || m.get(c(K, Je).get(i), n.split("/"));
if (!m.isFunction(d)) throw `${n} not found`;
Promise.resolve(Reflect.apply(d, void 0, r)).then((u) => {
qe.postMessage({ id: e, task_id: i, category: o, method: n, args: r, session: l, data: u, error: null });
}).catch((u) => {
qe.postMessage({ id: e, task_id: i, category: o, method: n, args: r, session: l, data: null, error: u });
});
} catch (d) {
qe.postMessage({ id: e, task_id: i, category: o, method: n, args: r, session: l, data: null, error: d });
}
}, !1);
}
};
Nt = new WeakMap(), Je = new WeakMap(), Ae = new WeakMap(), N(K, "mQueue", /* @__PURE__ */ new Map()), x(K, Nt, 0), x(K, Je, /* @__PURE__ */ new Map()), x(K, Ae, null), N(K, "getInstance", () => (c(K, Ae) || B(K, Ae, new K()), c(K, Ae)));
let Ht = K;
const Ie = Ht.getInstance(), Tt = () => {
const t = H(!0), [, e] = E.useReducer((i) => i + 1, 0);
return V(() => () => t.current = !1, []), () => t.current && e();
}, No = (t) => {
const e = H();
return V(() => {
e.current = t;
}, [t]), e.current;
}, Po = (t) => {
const [e, i] = L(t), n = H(null), r = Y((o, a) => {
n.current = a, i(o);
}, []);
return V(() => {
n.current && (n.current(e), n.current = null);
}, [e]), [e, r];
}, gt = (t = (n) => {
}, e, i = m.isEqual) => {
const n = E.useRef();
i(e, n.current) || (n.current = m.cloneDeep(e)), E.useEffect(t, [n.current]);
}, mt = gt, Qi = (t, e = "string") => {
var i;
if (!Array.isArray(t)) return t;
for (let n = 0; n < t.length; n++) t[n].value = de((i = t[n]) == null ? void 0 : i.value, e), t[n] && Reflect.has(t[n], "children") && (t[n].children = Qi(t[n].children, e));
return t;
}, To = (t, e = "json", i = "string", n, r = null) => {
const [o] = re.useForm(n), [a, s] = L([{ label: "无", value: "", disabled: !0 }]), l = H([]), d = re.useWatch((u) => l.current.length === 0 ? null : m.pick(u, l.current), o) || null;
return V(() => {
Array.isArray(t) ? s(t) : e === "javascript" && t ? Ie.exec(t, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), o.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : o.getFieldValue(u)) }).then((u) => {
s(de(u, "array"));
}).catch((u) => console.error("useOptions", u)) : t && s(de(t, "array"));
}, [t, e, d]), Qi(a, i);
}, Oo = (t) => {
const [e, i] = L(), n = { type: "GET" };
if (typeof t == "string" ? n.url = t : m.isPlainObject(t) && Object.assign(n, t), !(n != null && n.url)) throw "url is required";
const r = (o) => I.request(n, !1).resp((a) => (console.log("useSubscribeRequest", o), i(a), a));
return gt(() => {
let o = null;
return r().then((a) => {
o = _i.subscribe(m.throttle(r, 180, { leading: !1, trailing: !0 }), a.res);
}), () => o == null ? void 0 : o();
}, n), e;
}, kr = (t) => {
const [e, i] = E.useState({ items: [], hides: [] });
return E.useEffect(() => {
t && I.get(`/api/_/${t}`).then(({ pk: n, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: d, marginX: u, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: h, fields: y, theme: w, themeSetting: C, groups: S }) => ({ pk: n, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: d, marginX: u, marginY: p, theme: w, themeProps: C, groups: S, listenChangeFields: f, listenChangeFieldsFunc: h, ...y.reduce((v, k) => {
var $;
return ($ = k == null ? void 0 : k.field) != null && $.hidden ? v.hides.push(k == null ? void 0 : k.field) : v.items.push(k), v;
}, { items: [], hides: [] }) })).then(i);
}, [t]), e;
}, Sr = ({ max: t = 0, min: e = 0, type: i = "", message: n, pattern: r, required: o = !1, validator: a } = {}, s, l) => {
const [d, u] = L([]);
return V(() => {
const p = [];
if (o) {
let f = l;
switch (l) {
case "number":
case "string":
case "array":
break;
case "bool":
f = "boolean";
break;
case "json":
f = "object";
}
p.push({ type: f, required: !0, whitespace: !0, message: "该项必填" });
}
switch (i) {
case "string":
p.push({ type: i, max: t, min: e, message: n || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) });
break;
case "pattern":
p.push({ type: "string", pattern: r, message: n });
break;
case "validator":
a && p.push(({ getFieldValue: f }) => ({ validator: async (h, y) => {
const w = await Ie.exec(a, { value: y, fieldName: s }, { getFieldValue: f });
return m.isString(w) && w ? Promise.reject(w) : m.isBoolean(w) && !w ? Promise.reject(n) : Promise.resolve();
} }));
}
u(p);
}, [t, e, i, n, r, o, a]), d;
}, Er = (t, e, i) => {
const [n, r] = L(null);
return V(() => {
const { initDataUri: o = `/api/${t}`, initDataMethod: a = "GET" } = i || {};
e && I.request({ method: a, url: m.trimEnd(`${o}/${e}`, "/") }).then((s) => {
r(s);
});
}, [t, e, i]), n;
}, $r = (t, e, i) => Y((n, r = { serialize: (o) => o, onSuccess: () => {
}, onFail: (o) => (o == null ? void 0 : o.errorFields) && ne.error("请先完善表单信息", { duration: 2e3 }) }) => {
const o = n.getFieldValue("__RESOURCE__"), { submitDataUri: a = `/api/${t}`, submitDataMethod: s = "POST" } = i || {};
return n.validateFields().then((l) => o ? m.pick(l, [o]) : l).then(r.serialize).then((l) => I.request({ method: s, url: m.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail);
}, [t, e, i]), vr = (t, e, i, n) => {
const r = Er(e, i, n);
V(() => {
r ? t.setFieldsValue(r) : t.resetFields();
}, [t, r]);
const o = $r(e, i, n);
return m.partial(o, t);
}, xr = (t, e, i = [], n = {}) => {
const r = H({}), o = H(), a = m.debounce(Tt(), 180), s = ["disabled", "required"], l = (f, h) => {
s.includes(f) && (r.current[f] = h), a();
}, d = _(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [u, p] = Ji(e, -1, {}, d, n);
if (!p && o.current != u && (u >= 0 || !m.isEmpty(i == null ? void 0 : i[u]))) {
o.current = u;
const { widget: f, widgetPrefix: h, props: y } = i == null ? void 0 : i[u];
t = Vi(f, h), r.current = m.merge(y, m.pick(r.current, s));
}
return [t, r.current];
}, Ei = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Ro = ({ value: t, onChange: e }, i = null) => {
const n = H(), [r] = re.useForm(i), o = H({});
return mt(() => {
m.isEqual(n.current, t) || r.setFieldsValue(t);
}, [t]), V(() => () => r.resetFields(), []), [_(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (a) => (s) => {
const l = Ei(a);
s ? o.current[l] = s : delete o.current[l];
} }, scrollToField: (a, s = {}) => {
console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form");
}, focusField: (a) => {
console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form");
}, getFieldInstance: (a) => {
const s = Ei(a);
return o.current[s];
} }, [r]), (a, s) => {
n.current = s, e == null || e(s);
}];
}, ti = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: n = [], basicForm: r, ...o }) => {
const a = Vi(t, e), [s, l] = xr(a, i, n, r), [d, u] = L();
return V(() => {
s && ue.getWidgetComponent(s).then(({ defaultProps: p = {}, default: f }) => ({ default: Nr(f, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(E.createElement(p.default, o)));
}, [s]), d && E.cloneElement(d, { ...o, ...l });
}, Nr = (t, e = {}, i = null) => (n) => {
const { type: r, code: o, label: a, noStyle: s, style: l, placeholder: d, required: u = !1, extras: p, validators: f, help: h, isVirtual: y, $isReserved: w, initialValue: C, initialValueLanguage: S, ...v } = m.omit(m.merge({}, e, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Sr(Object.assign({}, f, u ? { required: !0 } : {}), o, r), $ = _(() => {
const D = Object.keys((e == null ? void 0 : e.extras) || {});
return m.over([m.partialRight(m.pick, D), m.partialRight(m.omit, D)]);
}, [e == null ? void 0 : e.extras]), [T, j] = $(v), F = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, M = Y((D) => D == null ? void 0 : de(D, r), [r]);
return g(Xt, { name: o, rules: k, initialValue: M(C), normalize: M, children: (D, R, W) => {
var U;
return g(t, { type: r, rcform: W, basicForm: i, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: h || null, help: R.errors.length > 0 ? R.errors.join("、") : null, required: ((U = k == null ? void 0 : k[0]) == null ? void 0 : U.required) || !1, ...F }, fieldProps: { placeholder: d, ...j, ...D }, $setting: Object.assign({}, p, T) });
} });
}, ii = ({ name: t, form: e = null, basicForm: i = null, style: n = {}, className: r, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: d = [], hides: u = [], primaryKey: p = 0, formProps: f = {}, formFields: h = [], listenChangeFields: y, listenChangeFieldsFunc: w, onValuesChange: C, theme: S, themeProps: v = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...T }) => {
const [j] = re.useForm(e), F = Y((R, W) => {
C == null || C(R, W), w && Array.isArray(y) && Ie.exec(w, { changedValues: R, allValues: W }, { getFieldValue: j.getFieldValue, setFieldValue: j.setFieldValue, setFieldsValue: j.setFieldsValue, isFieldTouched: j.isFieldTouched, isFieldsTouched: j.isFieldsTouched }).catch((U) => console.error("onFormValuesChange", t, U));
}, [t, j, C, y, w]), M = _(() => [{ name: "__PROPS__", value: f }, { name: "__PRIMARY_KEY__", value: p }].concat(h), [p, f, h]), D = (R, W, U) => {
const q = Zt(W, ti, i), he = Ui(T);
return A("div", { ...he, className: O("ff-grid-layout-form", r), style: { ...n, "--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: [q, U && E.cloneElement(U, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: W, basicForm: i })] });
};
return A(re, { ...T, form: j, fields: M, onValuesChange: F, children: [S ? g(Gi, { ...v, items: k, theme: S, itemRender: D, fields: d, children: $, basicForm: i }) : D(0, d, $), u == null ? void 0 : u.map((R) => {
var W;
return g(Xt, { name: R.code, children: g(Pr, { form: j, basicForm: i, name: R.code, type: R.type, initialValue: R.initialValue, initialValueLanguage: (W = R.extras) == null ? void 0 : W.initialValueLanguage }) }, JSON.stringify(R.code));
})] });
}, Pr = ({ type: t, initialValue: e, initialValueLanguage: i, onChange: n, basicForm: r }) => {
const [o, a] = Ji(i == "javascript" && e, i == "javascript" ? void 0 : e, {}, {}, r);
return V(() => {
i == "javascript" ? n(de(o, t)) : e && n(de(e, t));
}, [t, e, o]), null;
};
ii.propTypes = { fields: b.array, hides: b.array };
const Tr = /* @__PURE__ */ ((t) => ({ code: e, isPreview: i = !1, ...n }) => {
const { align: r, autoComplete: o, resource: a, items: s, hides: l, rowHeight: d, marginX: u, marginY: p, cols: f, listenChangeFields: h, listenChangeFieldsFunc: y, pk: w, uuid: C, theme: S, themeProps: v, groups: k } = kr(e), $ = _(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: C }], [w, e, C, a]);
return g(t, { name: e, autoComplete: o, theme: S, themeProps: v, groups: k, ...n, formFields: $, listenChangeFields: h, listenChangeFieldsFunc: y, fields: s, hides: l, cols: f, rowHeight: d, itemMargin: [u, p] });
})(ii), Zi = ({ $setting: t, $close: e, extras: i, code: n, primaryKey: r, ...o }) => {
const [a] = re.useForm(), s = vr(a, n, r, t);
return g(ee, { actions: A(E.Fragment, { children: [g(P, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), g(P, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: i, children: g(Tr, { form: a, code: n, primaryKey: r, ...o }) });
}, $i = /* @__PURE__ */ new Set(), Jt = (t = [], e = 0) => {
const i = t[e];
if (i.length && !$i.has(i)) {
const n = document.createElement("script");
n.setAttribute("src", i), n.setAttribute("data-namespace", i), t.length > e + 1 && (n.onload = () => {
Jt(t, e + 1);
}, n.onerror = () => {
Jt(t, e + 1);
}), $i.add(i), document.body.appendChild(n);
}
}, St = ({ className: t, type: e, style: i = {}, ...n }) => g("span", { role: "img", className: O("ff-iconfont", t), style: i, ...n, children: g("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: g("use", { xlinkHref: `#${e}` }) }) });
St.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, St.init = Jt;
const Or = (t, e, i, n) => Ne.redirect(i, e, n), Rr = (t, e = {}, i, n = {}) => {
var o;
const r = (o = n.router) == null ? void 0 : o.reduce((a, [s, l, d]) => {
const u = m.get(e, ["router", s]);
if (!u && u !== 0 && l) throw `请传入 ${d}`;
return `${a}/${u}`;
}, `/api/${i}`);
return I.del(r, e.param).msg();
}, vi = (t, e, i, { status: { loading: n, disabled: r }, setStatus: o, listFn: a }) => {
const s = { loading: (l) => l === void 0 ? n : o((d) => ({ ...d, loading: l })), disabled: (l) => l === void 0 ? r : o((d) => ({ ...d, disabled: l })), list: a };
return m.isFunction(i) ? i.call(null, e, s) : m.isString(i) && i ? Ie.exec(i, e, s) : null;
}, xi = (t, e, i, n, r) => m.isString(i) && i ? ue.getWidgetComponent(i).then(({ default: o }) => ne.modal(o, { ...e, $setting: n }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r)).catch((o) => {
ne.error(i, { content: o.toString() });
}) : ne.modal(i, { ...e, $setting: n }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), Fr = (t, e, i, n, r) => ne.modal(Zi, { ...e, $setting: n, code: i }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), jr = (t, e, i, n, r) => ne.modal(ei, { base62params: e, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), Ar = ({ widget: t, widgetType: e, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => {
const l = pe(ae), [d, u] = L({ leading: !0, trailing: !1 }), p = _(() => {
switch (e) {
case "redirect":
return m.partialRight(Or, t, r);
case "func":
return m.partialRight(vi, (r == null ? void 0 : r.code) ?? t, { status: d, setStatus: u, listFn: l });
case "component":
case "fsdpf-component":
return m.partialRight(xi, t, r, o);
case "grid-layout-form":
return m.partialRight(Fr, t, r, o);
case "data-list":
return m.partialRight(jr, t, r, o);
case "destroy":
return m.partialRight(Rr, t, r, o);
default:
if (ri(t) || E.isValidElement(t)) return m.partialRight(xi, t, r, o);
if (m.isFunction(t)) return m.partialRight(vi, (r == null ? void 0 : r.code) || t, { status: d, setStatus: u });
}
return (...f) => console.error("useButton unknown widgetType", e, ...f);
}, [t, e, l.getBase62params, l.getSelectedRows]);
return [m.debounce((f) => (s == null || s(f), Promise.resolve(ht(n, f, { list: l })).then((h) => p(f, { ...i, ...h })).then((h) => a == null ? void 0 : a(h)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d];
}, en = ({ type: t, name: e, className: i, icon: n, iconPosition: r, size: o }, a = "default") => _(() => {
const s = { type: "primary", className: O("ff-button", i), 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 = O(s.className, "ff-default"))) : a !== "circle" && a !== "round" || (s.shape = a), n && (s.icon = g(St, { type: n })), e && (s.children = e), s;
}, [a, t, i, n, r]), Ot = ({ data: t, widget: e, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: o, widgetContainerProps: a, onAfterClick: s, onBeforeClick: l, children: d, extras: u }) => {
const p = pe(ae), [f, h] = L(!1), [y, w] = L("hover"), [C, S] = L({}), [v, k] = L(), { placement: $, align: T, zIndex: j, arrow: F = { pointAtCenter: !0 }, getPopupContainer: M, isPopupMountBodyContainer: D = !0, ...R } = a || {};
V(() => {
i == "grid-layout-form" ? k(E.createElement(Zi, { ...n, $setting: o, code: e })) : i == "data-list" ? k(E.createElement(ei, { base62params: t, $setting: o, listCode: e })) : m.isString(e) ? ue.getWidgetComponent(e).then(({ default: q }) => {
k(E.createElement(q, { ...n, $setting: o }));
}).catch((q) => k(q.toString())) : ri(e) ? k(E.createElement(e, { ...n, $setting: o })) : E.isValidElement(e) && k(E.cloneElement(e, { ...n, $setting: o }));
}, [e, i, n]), V(() => {
Promise.resolve(ht(r, t, { list: p })).then(S);
}, [r, t, p.getBase62params, p.getSelectedRows]);
const W = (q, he = !1) => (h(q), !q && w("hover"), q ? l == null ? void 0 : l(C) : s == null ? void 0 : s(he)), U = (q) => {
h(!0), w("click");
};
return g(Fn, { zIndex: j, placement: $, onPopupClick: U, onClick: U, open: f, align: T, arrow: F, trigger: y, getPopupContainer: M || D ? void 0 : (q) => q, content: g(Lr, { ...R, extras: u, children: v && E.cloneElement(v, { ...C, $close: (q) => W(!1, q) }) }), children: d, onOpenChange: W });
}, Lr = ({ title: t, className: e, classNames: i, children: n, extras: r, width: o, height: a, ...s }) => {
const [l, d] = L({}), u = Y((y, w) => d((C) => ({ ...C, [y]: w })), []), p = Y((y) => d((w) => ({ ...w, [y]: void 0 })), []), f = t ? E.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, h = r ?? E.createElement("div", { className: "ff-popup-reserved-extras" }, r);
return g(pt.Provider, { value: { ele: l, mount: u, unmount: p }, children: A("div", { className: O("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [A("div", { className: O("ff-popup-header", "ff-popover-header", i == null ? void 0 : i.header), children: [f, l == null ? void 0 : l["sub-title"]] }), g("div", { className: O("ff-popup-body", "ff-popover-body", i == null ? void 0 : i.body), children: n }), A("div", { className: O("ff-popup-footer", "ff-popover-footer", i == null ? void 0 : i.footer), children: [h, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) });
};
Ot.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) };
const ft = (t) => function({ className: e, variant: i, children: n, name: r, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: u, data: p, loading: f, disabled: h, tooltip: y, confirm: w, widget: C = () => {
}, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: T, ...j }) {
const { mode: F, ...M } = T || {}, D = en({ className: e, name: r, type: a, icon: o, iconPosition: s }, i ?? t), R = g(Ct, { ...D, ...j, children: n || r });
if (F === "popover" && !["destroy", "redirect", "func"].includes(S)) return g(Ot, { data: p, widget: C, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: M, onAfterClick: d, onBeforeClick: u, children: R });
const W = m.isEmpty(y) || !y.enabled ? {} : y, U = m.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [q, he] = L(!1), [oe, { disabled: z, loading: se }] = Ar({ widget: C, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: M }, { onAfterClick: d, onBeforeClick: u });
return g(jn, { okText: "确定", cancelText: "取消", getPopupContainer: (J) => J, ...U, disabled: z || h, open: q, onOpenChange: (J) => {
if (!J) return he(J);
U.enabled ? he(J) : oe(p);
}, onConfirm: (J) => {
oe(p, J);
}, onClick: (J) => {
J.stopPropagation();
}, children: g(An, { getPopupContainer: (J) => J, ...W, title: q ? null : W == null ? void 0 : W.title, trigger: ["hover", "click"], children: E.cloneElement(R, { loading: se || f, disabled: z || h }) }) });
}, P = ft("default");
P.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), size: b.oneOf(["large", "middle", "small"]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) };
const Ir = ft("link"), Vr = ft("circle"), Mr = ft("round"), Dr = ft("dashed"), Ni = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (h, y, w) => {
}, onBeforeClick: n = (h, y, w) => {
}, labelVariant: r = "link", labelSize: o, labelRender: a, btnVariant: s, btnSize: l, btnRender: d = (h, y) => g(P, { ...h, data: y }, h.uuid || Mt()), widgetContainerProps: u = {}, children: p, data: f }) => {
if (m.isEmpty(t)) return p;
const [h, y] = _(() => (t || []).reduce((C, S) => {
const v = e.indexOf(S.widgetType);
return v === -1 ? C[1].push(S) : C[0] ? v < e.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = S) : C[1].push(S) : C[0] = S, C;
}, [null, []]), [t, e]);
a ? p = a(h, f) || p : p || (p = g(Ct, { ...en(Object.assign(h != null && h.name || h != null && h.icon ? {} : { icon: "icon-location" }, h, { size: o }), r) }));
const w = y.map((C) => d(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: m.partialRight(i, C, f), onBeforeClick: m.partialRight(n, C, f) }, { size: l, variant: s }), f));
return g(Ot, { widget: h == null ? void 0 : h.widget, widgetType: h == null ? void 0 : h.widgetType, widgetProps: h == null ? void 0 : h.widgetProps, widgetSetting: h == null ? void 0 : h.widgetSetting, widgetContainerProps: Object.assign({}, u, h == null ? void 0 : h.widgetContainerProps), data: f, widgetData: h == null ? void 0 : h.widgetData, extras: w, onAfterClick: m.partialRight(i, h, f), onBeforeClick: m.partialRight(n, h, f), children: p });
};
Ni.propTypes = { triggerWeights: b.array, options: b.arrayOf(b.shape({ ...P.propTypes, widgetType: P.propTypes.widgetType.isRequired })), btnSize: P.propTypes.size, btnRender: b.func, btnVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: b.func, labelSize: P.propTypes.size, onAfterClick: b.func, onBeforeClick: b.func, widgetContainerProps: P.propTypes.widgetContainerProps, data: P.propTypes.data }, P.Link = Ir, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = Vr, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Mr, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = Dr, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = Ot, P.GroupPopover = Ni;
const zr = ({ fields: t, formProps: e, $close: i }) => {
const [n] = re.useForm(), r = _(() => [{ name: "__PROPS__", value: e }], [e]);
return g(ee, { actions: A(E.Fragment, { children: [g(P, { name: "取消", widget: () => i(!1) }), g(P, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: g(re, { fields: r, form: n, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => g(ti, { code: o, ...a }, o)) }) });
}, Wr = ({ className: t, classNames: e, $close: i, children: n, title: r, subTitle: o, actions: a, extras: s, ...l }) => A(Bn, { ...l, prefixCls: "ff-drawer", className: O("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [A("div", { className: O("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [g("button", { "aria-label": "Close", className: O("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: g(Qt, { type: "close" }) }), r, o] }), g("div", { className: O("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: n }), A("div", { className: O("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), Br = ({ className: t, classNames: e, $close: i, $event: n, children: r, title: o, subTitle: a, actions: s, extras: l, placement: d, ...u }) => {
const p = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } };
return g(Un, { ...u, ...p, prefixCls: "ff-modal", modalRender: () => A("div", { className: O("ff-modal-content ff-popup", t), children: [A("div", { className: O("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [g("button", { "aria-label": "Close", className: O("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: u.onClose, children: g(Qt, { type: "close" }) }), o, a] }), g("div", { className: O("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), A("div", { className: O("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] }) });
}, tn = ({ placement: t, $close: e, $event: i, children: n, title: r, ...o }) => {
const [a, s] = L({}), [l, d] = L(!0), u = Y((y, w) => s((C) => ({ ...C, [y]: w })), []), p = Y((y) => s((w) => ({ ...w, [y]: void 0 })), []);
let f = { ...o, className: a.rootClassName, title: a.title || r && E.createElement("div", { className: O("ff-popup-title") }, r), subTitle: a["sub-title"], actions: a.actions, extras: a.extras, children: n, $close: e, $event: i, onClose: () => d(!1) };
const h = () => {
e(!1);
};
return g(pt.Provider, { value: { ele: a, mount: u, unmount: p }, children: t && t !== "center" ? g(Wr, { ...f, placement: t, open: l, afterOpenChange: (y) => !y && h() }) : g(Br, { ...f, visible: l, afterClose: h }) });
};
tn.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) };
const ie = () => {
const [t, e] = En({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (o) => {
const { offsetHeight: a } = o;
return { height: a };
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, i] = E.useReducer((o) => o + 1, 0);
V(() => {
ie.$onClick = n, ie.$queue.forEach(([o, a, s], l, d) => {
r([a, s], ...o), delete d[l];
});
}, []);
const n = (o, a = {}, s = {}) => new Promise((l, d) => r([l, d], o, a, s)), r = ([o, a], s, l = {}, d = {}) => {
const u = ie.$index++, p = (f) => ((h, y) => (ie.$popups.delete(h), i(), y == null ? void 0 : y()))(u, () => o(f));
if (s === Li) return t.open({ ...d, key: u, content: E.createElement(s, { ...l, $close: () => t.close(u) }) });
ie.$popups.set(u, E.createElement(tn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: u, $close: p }, E.isValidElement(s) ? E.cloneElement(s, { ...l, $close: p }) : s != null && s.name || fi.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === fi.ForwardRef ? E.createElement(s, { ...l, $close: p }) : s)), i();
};
return A(E.Fragment, { children: [Array.from(ie.$popups).map(([o, a]) => a), e] });
};
ie.$popups = /* @__PURE__ */ new Map(), ie.$index = 0, ie.$queue = [], ie.$onClick = (...t) => new Promise((e, i) => {
ie.$queue.push([t, e, i]);
});
const Pi = (t, e, i = {}) => ie.$onClick(t, e, i), It = (t, { showProgress: e, duration: i, ...n } = { duration: 1.5 }) => ie.$onClick(Li, { content: t, ...n }, { showProgress: e, duration: i }), ne = { modal: Pi, confirm: (t, e = {}) => ie.$onClick(qn, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, i = {}) => Pi(zr, { formProps: i, fields: t }, { placement: "center", ...e }).then((n) => {
if (n === !1) throw !1;
return n;
}), notification: It, success: (t, e = { duration: 1.5 }) => It(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => It(t, { ...e, className: "ff-notification-error", icon: "close" }) };
Ze.configure({ showSpinner: !1 });
const nn = () => {
const t = window.localStorage.getItem(bt);
return Object.freeze({ Platform: "web", SaaS: window.localStorage.getItem("SaaS"), Authorization: t ? `Bearer ${t} ` : void 0 });
};
Me.interceptors.request.use((t) => (Object.assign(t.headers, nn()), Ze.inc(), t), (t) => (Ze.done(), Promise.reject({ code: -1, msg: t }))), Me.interceptors.response.use(({ data: t, headers: e }) => (Ze.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) {
return Ze.done(), Promise.reject(t.message);
}), window.addEventListener("unhandledrejection", Dt.onUnhandledRejection), Dt.onMsg = (t, e) => ne[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && Ne.redirect(Ue.get("Common.WEBSITE_LOGIN_PAGE")));
var Ge, Be, Ye;
const Q = class Q {
constructor() {
N(this, "appUrl", "");
x(this, Ge, null);
return c(Q, Be) || (B(Q, Ye, new Dt()), B(Q, Be, new Proxy(this, { get(e, i) {
if (i in e) {
const n = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), i);
return n != null && n.get ? Reflect.get(e, i, e) : typeof e[i] == "function" ? e[i].bind(e) : e[i];
}
return c(Q, Ye)[i];
} }))), c(Q, Be);
}
init(e, i, n) {
Me.defaults.baseURL = this.appUrl = n, Me.defaults.timeout = 15e3, c(Q, Ye).init(e, i, Me);
}
get driver() {
return Me;
}
get headers() {
return nn();
}
mock(e = {}) {
return c(this, Ge) ?? B(this, Ge, new vn(Me, { onNoMatch: "passthrough", ...e }));
}
unmock() {
var e;
(e = c(this, Ge)) == null || e.restore(), B(this, Ge, null);
}
};
Ge = new WeakMap(), Be = new WeakMap(), Ye = new WeakMap(), x(Q, Be), x(Q, Ye), N(Q, "getInstance", () => c(Q, Be) ?? B(Q, Be, new Q()));
let Gt = Q;
const I = Gt.getInstance();
class ni extends Error {
constructor(e, i) {
super(i), Error.captureStackTrace && Error.captureStackTrace(this, ni), !i instanceof et && (this.name = `${e} Error Runtime`);
}
}
class et extends Error {
constructor(e, ...i) {
super(...i), Error.captureStackTrace && Error.captureStackTrace(this, et), this.name = `${e} Not Found`;
}
}
const Vt = "mine", bt = "token";
var Le, Xe;
const be = class be {
constructor() {
x(this, Xe, /* @__PURE__ */ new Map());
N(this, "setVendor", (e, i) => c(this, Xe).set(e, new ji(i, async (n, r) => {
var a, s;
if (!(n != null && n.default)) throw "@pkg not found";
let o = () => r;
switch ("function") {
case typeof (o = (a = n.default) == null ? void 0 : a[`./${r}/index.jsx`]):
case typeof (o = (s = n.default) == null ? void 0 : s[`./${r}/index.js`]):
return o();
}
throw new et(r);
})));
N(this, "getWidgetComponent", async (e) => {
if (!e) throw "getWidgetComponent widget is required";
if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e);
const [, i] = e == null ? void 0 : e.split("@pkg/");
if (!i) throw new et(e);
try {
return c(this, Xe).has("pkg") ? await c(this, Xe).get("pkg").get(i) : await import(`${I.appUrl}/api/pkg-import/web?name=${e}`);
} catch (n) {
throw new ni(e, n);
}
});
N(this, "getRoutes", () => I.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: i, ...n }) => [i, { uuid: i, ...n }])).then((e) => new Map(e)));
N(this, "getMenus", () => I.get("/api/my-menu"));
N(this, "getConfigure", () => I.get("api/init-configure"));
N(this, "getWidgetOperationAuth", () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((i, { uuid: n, auth: r }) => [...i, [n, r]], [])));
N(this, "getPhoneNumber", (e) => I.get(`/api/user-wx-phone-number/${e}`));
N(this, "getUserToken", () => {
const e = window.localStorage.getItem(bt);
if (!e) return "";
const i = e.split(".");
if (!Array.isArray(i) || i.length !== 3) throw "登录令牌无效!";
const { iat: n } = JSON.parse(window.atob(i[1]));
if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > 2592e3) throw "登录令牌已过期, 请重新登录!";
return e;
});
N(this, "checkUserToken", () => {
try {
return !!this.getUserToken();
} catch {
return !1;
}
});
N(this, "getUserInfo", (e = !0) => {
var i;
try {
const n = this.getUserToken();
if (!n) return Promise.resolve(null);
const { iat: r } = JSON.parse(window.atob((i = n == null ? void 0 : n.split(".")) == null ? void 0 : i[1])), { iat: o, ...a } = I.decode(window.localStorage.getItem(Vt) || "", {});
return o === r ? Promise.resolve(a) : I.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Vt, I.encode({ ...s, iat: r })), s));
} catch (n) {
console.error(n), e && ne.error("请登录").then(this.logout);
}
return Promise.resolve(null);
});
N(this, "login", (e, i, n = {}) => I.post("/api/user-token", { username: e, passwd: xn.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(bt, r), r)).then(async (r) => (await this.initAppEnv(), r)));
N(this, "logout", (e) => (window.localStorage.removeItem(Vt), window.localStorage.removeItem(bt), e == null ? void 0 : e()));
N(this, "initAppEnv", async () => {
const [e, i, n, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]);
return Ii.init(e), Ue.init(r), Ne.init(i, n), St.init(Ue.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: i, menus: n, configures: r };
});
if (c(be, Le)) return c(be, Le);
}
};
Le = new WeakMap(), Xe = new WeakMap(), x(be, Le, null), N(be, "getInstance", () => (c(be, Le) || B(be, Le, new be()), c(be, Le)));
let Yt = be;
const ue = Yt.getInstance(), Ur = E.createContext({ user: {}, initUser: () => {
}, initUserComplete: !1 }), qr = E.createContext({ set: () => {
}, get: () => {
}, assign: () => {
}, currentRoute: () => {
} }), ri = (t) => !!(t != null && t.name) && (t.prototype instanceof E.Component || /^[A-Z]/.test(t.name)), Kr = (t, e) => {
if (!t || typeof window > "u") return;
let i = document.querySelector(`style[ff-style-token="${e}"]`);
return i ? (i.innerHTML = t, t) : (i = document.createElement("style"), i.setAttribute("ff-style-token", e), i.setAttribute("type", "text/css"), i.innerHTML = t, document.head.appendChild(i), t);
}, _r = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Ur, AppGlobalParamsContext: qr, cache: ji, configure: Ue, default: ue, func: Ie, http: I, insertStyle: Kr, isReactComponent: ri, route: Ne }, Symbol.toStringTag, { value: "Module" }));
var ve, Qe, xe, Ce, ke, te, Z, G, Se, st, lt, ct, dt, Pt, ut;
const oi = class oi {
constructor(e, i = "/") {
x(this, ve, "/");
x(this, Qe, /* @__PURE__ */ new Set());
x(this, xe, (e) => {
for (const i of c(this, Qe)) try {
i(e);
} catch (n) {
console.error("Error in VirtualFS event listener:", n);
}
});
x(this, Ce, (e) => {
const i = Date.now();
if (e && (e.lastModified = i), c(this, ve) != "/") {
const n = c(this, G).call(this, c(this, ve));
n && (n.lastModified = i);
}
this.root.lastModified = i;
});
x(this, ke, (e) => {
let i = ge.normalize(e);
return i.startsWith("/") || (i = "/" + i), i.length > 1 && i.endsWith("/") && (i = i.slice(0, -1)), i;
});
x(this, te, (e) => {
const i = ge.join(c(this, ve), e);
return c(this, ke).call(this, i);
});
x(this, Z, (e) => {
if (!e || typeof e != "string") return !1;
const i = c(this, ke).call(this, e);
return !i.includes("..") && i.startsWith("/");
});
x(this, G, (e) => {
var o;
const i = c(this, ke).call(this, e);
if (i === "/") return this.root;
const n = i.split("/").filter((a) => a);
let r = this.root;
for (const a of n) {
if (r.type !== "dir") return null;
const s = (o = r.children) == null ? void 0 : o.find((l) => l.name === a);
if (!s) return null;
r = s;
}
return r;
});
x(this, Se, (e) => {
const i = c(this, ke).call(this, e), n = ge.basename(i), r = ge.dirname(i);
return { parent: c(this, G).call(this, r), name: n };
});
x(this, st, (e, i, n) => n === !1 ? e : n === "root" ? e.map((r) => ge.join(i, r)) : n === !0 || n === "working" ? e.map((r) => ge.relative(c(this, ve), ge.join(i, r))) : e);
x(this, lt, async (e, i, n, r = "") => {
const o = [], a = c(this, G).call(this, e);
if (!a || a.type !== "dir") return o;
const s = a.children;
for (const l of s) {
const d = l.name, u = e === "/" ? `/${d}` : `${e}/${d}`, p = r ? `${r}/${d}` : d;
try {
if (l.type === "file") i(n ? p : d) && o.push(p);
else if (l.type === "dir" && n) {
const f = await c(this, lt).call(this, u, i, n, p);
o.push(...f);
}
} catch {
continue;
}
}
return o;
});
x(this, ct, async (e, i, n, r = "") => {
const o = [], a = Array.isArray(i) ? i : [i], s = c(this, G).call(this, e);
if (!s || s.type !== "dir") return o;
if (!n) {
for (const d of a) if (c(this, dt).call(this, d)) {
const u = await c(this, Pt).call(this, e, d);
o.push(...u);
} else {
const u = ge.join(e, d), p = c(this, ke).call(this, u);
c(this, G).call(this, p) && o.push(d);
}
return o;
}
const l = s.children;
for (const d of l) {
const u = d.name, p = e === "/" ? `/${u}` : `${e}/${u}`, f = r ? `${r}/${u}` : u;
try {
if (d.type === "file") for (const h of a) {
let y = !1;
if (y = c(this, dt).call(this, h) ? c(this, ut).call(this, u, h) : u === h, y) {
o.push(f);
break;
}
}
else if (d.type === "dir") {
const h = await c(this, ct).call(this, p, i, n, f);
o.push(...h);
}
} catch {
continue;
}
}
return o;
});
x(this, dt, (e) => /[*?[\]{}]/.test(e));
x(this, Pt, async (e, i) => {
const n = [], r = c(this, G).call(this, e);
if (!r || r.type !== "dir") return n;
const o = r.children.map((a) => a.name);
for (const a of o) c(this, ut).call(this, a, i) && n.push(a);
return n;
});
x(this, ut, (e, i) => {
const n = i.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (r, o) => "(" + o.split(",").join("|") + ")");
return new RegExp(`^${n}$`).test(e);
});
var n, r, o;
B(this, ve, i), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (n = this.root).name ?? (n.name = "/"), (r = this.root).children ?? (r.children = []), (o = this.root).lastModified ?? (o.lastModified = Date.now())));
}
async stat(e) {
const i = c(this, te).call(this, e);
if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`);
const n = c(this, G).call(this, i);
if (!n) throw new Error(`ENOENT: no such file or directory, stat '${e}'`);
return { isFile: () => n.type === "file", isDirectory: () => n.type === "dir", lastModified: n.lastModified };
}
async dir(e) {
const i = c(this, te).call(this, e);
if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`);
const n = c(this, G).call(this, i);
if (!n) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);
if (n.type !== "dir") throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);
return n.children.map((r) => r.name);
}
async readFile(e) {
const i = c(this, te).call(this, e);
if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`);
const n = c(this, G).call(this, i);
if (!n) throw new Error(`ENOENT: no such file or directory, open '${e}'`);
if (n.type !== "file") throw new Error("EISDIR: illegal operation on a directory, read");
return n.content || "";
}
async writeFile(e, i) {
const n = c(this, te).call(this, e);
if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`);
const { parent: r, name: o } = c(this, Se).call(this, n);
if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`);
if (r.type !== "dir") throw new Error("ENOTDIR: not a directory");
const a = r.children.findIndex((d) => d.name === o), s = a >= 0, l = { name: o, type: "file", content: i, lastModified: Date.now() };
s ? r.children[a] = l : r.children.push(l), c(this, Ce).call(this, r), c(this, xe).call(this, { action: s ? "update" : "create", path: n, type: "file", timestamp: Date.now() });
}
async mkdir(e, i = {}) {
const n = c(this, te).call(this, e);
if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`);
const { recursive: r } = i;
if (r) {
const o = n.split("/").filter((s) => s);
let a = "/";
for (const s of o)
if (a = ge.join(a, s), !c(this, G).call(this, a)) {
const { parent: l, name: d } = c(this, Se).call(this, a);
if (l && l.type === "dir") {
const u = { name: d, type: "dir", children: [], lastModified: Date.now() };
l.children.push(u), c(this, Ce).call(this, l), c(this, xe).call(this, { action: "create", path: c(this, ke).call(this, a), type: "dir", timestamp: Date.now() });
}
}
} else {
const { parent: o, name: a } = c(this, Se).call(this, n);
if (!o) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`);
if (o.type !== "dir") throw new Error("ENOTDIR: not a directory");
if (o.children.find((l) => l.name === a)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`);
const s = { name: a, type: "dir", children: [], lastModified: Date.now() };
o.children.push(s), c(this, Ce).call(this, o), c(this, xe).call(this, { action: "create", path: n, type: "dir", timestamp: Date.now() });
}
}
async unlink(e) {
const i = c(this, te).call(this, e);
if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`);
const { parent: n, name: r } = c(this, Se).call(this, i);
if (!n) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`);
const o = n.children.findIndex((a) => a.name === r);
if (o < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`);
if (n.children[o].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`);
n.children.splice(o, 1), c(this, Ce).call(this, n), c(this, xe).call(this, { action: "delete", path: i, type: "file", timestamp: Date.now() });
}
async rmdir(e, i = {}) {
const n = c(this, te).call(this, e);
if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`);
const { parent: r, name: o } = c(this, Se).call(this, n);
if (!r) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`);
const a = r.children.findIndex((l) => l.name === o);
if (a < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`);
const s = r.children[a];
if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`);
if (!i.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`);
r.children.splice(a, 1), c(this, Ce).call(this, r), c(this, xe).call(this, { action: "delete", path: n, type: "dir", timestamp: Date.now() });
}
async rename(e, i) {
const n = c(this, te).call(this, e), r = c(this, te).call(this, i);
if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`);
if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${i}'`);
if (!c(this, G).call(this, n)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`);
const { parent: o, name: a } = c(this, Se).call(this, n), { parent: s, name: l } = c(this, Se).call(this, r);
if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`);
if (c(this, G).call(this, r)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${i}'`);
const d = o.children.findIndex((p) => p.name === a), u = { ...o.children[d], name: l, lastModified: Date.now() };
o.children.splice(d, 1), s.children.push(u), c(this, Ce).call(this, o), o !== s && c(this, Ce).call(this, s), c(this, xe).call(this, { action: "rename", path: r, oldPath: n, type: u.type, timestamp: Date.now() });
}
async exists(e) {
const i = c(this, te).call(this, e);
return c(this, Z).call(this, i) ? c(this, G).call(this, i) !== null : !1;
}
getLastModified() {
return this.root.lastModified;
}
subscribe(e) {
if (typeof e != "function") throw new Error("Callback must be a function");
return c(this, Qe).add(e), () => {
c(this, Qe).delete(e);
};
}
getWorkingDirectory() {
return c(this, ve);
}
scope(e = "/") {
const i = c(this, ke).call(this, e);
if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`);
const n = c(this, G).call(this, i);
if (!n) throw new Error(`ENOENT: no such file or directory '${e}'`);
if (n.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`);
return n.children ?? (n.children = []), n.lastModified ?? (n.lastModified = Date.now()), new oi(this.root, i);
}
async findFiles(e, i, n = {}) {
const r = c(this, te).call(this, e);
if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`);
const o = c(this, G).call(this, r);
if (!o) throw new Error(`ENOENT: no such file or directory '${e}'`);
if (o.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`);
const { recursive: a = !1, fullPath: s = !1 } = n;
if (typeof i == "function") {
const d = await c(this, lt).call(this, r, i, a);
return c(this, st).call(this, d, r, s);
}
const l = await c(this, ct).call(this, r, i, a);
return c(this, st).call(this, l, r, s);
}
};
ve = new WeakMap(), Qe = new WeakMap(), xe = new WeakMap(), Ce = new WeakMap(), ke = new WeakMap(), te = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Se = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), Pt = new WeakMap(), ut = new WeakMap();
let Ti = oi;
const Hr = async (t, e = "/", i = "") => {
try {
const n = await t.stat(e), r = e === "/" ? "/" : ge.basename(e), o = { title: r, key: i ? `${i}${e}` : e, isLeaf: n.isFile() };
if (n.isDirectory()) {
const a = await t.dir(e);
if (a.length > 0) {
o.children = [];
const s = [], l = [];
for (const d of a) {
const u = e === "/" ? `/${d}` : `${e}/${d}`;
try {
(await t.stat(u)).isDirectory() ? s.push(d) : l.push(d);
} catch (p) {
console.warn(`Failed to stat ${u}:`, p.message);
}
}
s.sort(), l.sort();
for (const d of [...s, ...l]) {
const u = e === "/" ? `/${d}` : `${e}/${d}`;
try {
const p = await Hr(t, u, i);
o.children.push(p);
} catch (p) {
console.warn(`Failed to process ${u}:`, p.message);
}
}
}
}
return o;
} catch {
return null;
}
};
export {
xo as $,
Ji as A,
Ki as B,
qi as C,
kt as D,
cr as E,
lr as F,
$o as G,
pr as H,
ar as I,
ei as J,
ae as K,
ur as L,
yr as M,
ir as N,
rr as O,
Qn as P,
Zn as Q,
_i as R,
Co as S,
ko as T,
Wi as U,
qt as V,
er as W,
tr as X,
wr as Y,
br as Z,
vo as _,
Vi as a,
Tt as a0,
No as a1,
Po as a2,
gt as a3,
mt as a4,
To as a5,
Oo as a6,
Tr as a7,
ii as a8,
ti as a9,
Ie as aA,
Ne as aB,
Ur as aC,
qr as aD,
Ti as aE,
Hr as aF,
Zi as aa,
kr as ab,
Sr as ac,
Er as ad,
$r as ae,
vr as af,
xr as ag,
Ro as ah,
St as ai,
P as aj,
Ii as ak,
Ar as al,
ee as am,
pt as an,
Ai as ao,
ie as ap,
ne as aq,
po as ar,
ho as as,
go as at,
ue as au,
ri as av,
Kr as aw,
I as ax,
ji as ay,
Ue as az,
_n as b,
ht as c,
Mi as d,
fo as e,
yo as f,
Kn as g,
wo as h,
Hn as i,
Gn as j,
bo as k,
Bi as l,
Jn as m,
So as n,
Ui as o,
Zt as p,
Hi as q,
Lt as r,
Yi as s,
de as t,
mo as u,
mr as v,
Gi as w,
hr as x,
gr as y,
Eo as z
};