@luminix/mui-cms 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mui-cms.js
CHANGED
|
@@ -5,12 +5,12 @@ import { config as se, collect as W, app as T, model as ye, App as wt, Model as
|
|
|
5
5
|
import { jsx as i, jsxs as w, Fragment as B } from "react/jsx-runtime";
|
|
6
6
|
import { Outlet as yr, useParams as wr, useNavigate as St, useSearchParams as K, Link as Re, Form as Sr } from "react-router-dom";
|
|
7
7
|
import { useCollection as mn, PaginationProvider as Ar, usePagination as Se, ModelForm as xr, useApplyReducers as At, Forms as Cr, LuminixProvider as Er } from "@luminix/react";
|
|
8
|
-
import { useMediaQuery as Ie, Dialog as xt, DialogTitle as Ct, DialogContent as Et, DialogContentText as kr, DialogActions as kt, Button as M, Snackbar as Tr, Alert as Dr, IconButton as q, AlertTitle as Or, Box as V, Unstable_Grid2 as
|
|
9
|
-
import
|
|
8
|
+
import { useMediaQuery as Ie, Dialog as xt, DialogTitle as Ct, DialogContent as Et, DialogContentText as kr, DialogActions as kt, Button as M, Snackbar as Tr, Alert as Dr, IconButton as q, AlertTitle as Or, Box as V, Unstable_Grid2 as X, Fab as Rr, SpeedDial as Pr, SpeedDialIcon as vr, SpeedDialAction as Fr, ButtonGroup as Br, Popper as Lr, Grow as Ir, Paper as Tt, ClickAwayListener as Mr, MenuList as Nr, MenuItem as oe, AppBar as gn, Toolbar as jr, Typography as $, Avatar as Ur, Drawer as bn, Divider as Pe, Autocomplete as qr, TextField as Ae, CircularProgress as _r, Switch as Hr, Stack as N, FormControl as ot, InputLabel as at, Select as ve, Badge as Dt, Popover as zr, Link as it, Collapse as yn, TableCell as Q, RadioGroup as Vt, FormControlLabel as $e, Radio as Ke, TableContainer as Wr, Table as Vr, TableHead as $r, TableRow as fe, Checkbox as Ot, TableSortLabel as Kr, Skeleton as $t, TableBody as Yr, TableFooter as Jr, Tabs as Gr, Tab as Kt, Breadcrumbs as Zr, List as Xr, ListItem as Qr, ListItemButton as es, ListItemIcon as wn, ListItemText as Sn, Menu as An, CssBaseline as ts } from "@mui/material";
|
|
9
|
+
import p, { useContext as xn, useMemo as ns } from "react";
|
|
10
10
|
import { useTranslation as L, initReactI18next as rs } from "react-i18next";
|
|
11
11
|
import { Close as Me, ArrowDropDown as Cn, ChevronLeft as Ne, ChevronRight as je, HighlightOffOutlined as lt, AddCircleOutline as En, FilterList as kn, Menu as Tn, LastPage as Dn, FirstPage as On, Search as ct, SwapVert as Rn, ArrowUpward as Pn, ArrowDownward as vn, MoreVert as Rt, ExpandLess as Fn, ExpandMore as Bn, Add as ss, CategoryOutlined as os, DashboardOutlined as as, PeopleOutlined as is } from "@mui/icons-material";
|
|
12
|
-
import { useTheme as Pt, styled as
|
|
13
|
-
import { Str as k, Obj as
|
|
12
|
+
import { useTheme as Pt, styled as G, createTheme as ls, ThemeProvider as cs } from "@mui/material/styles";
|
|
13
|
+
import { Str as k, Obj as ee, Query as Ln, DateTime as Yt, Func as us, MakeFacade as vt, Reducible as In, ServiceProvider as Mn } from "@luminix/support";
|
|
14
14
|
import Jt from "react-dom";
|
|
15
15
|
import J from "i18next";
|
|
16
16
|
const ds = {
|
|
@@ -28,12 +28,12 @@ const ds = {
|
|
|
28
28
|
showBackButton: !1,
|
|
29
29
|
setShowBackButton: () => {
|
|
30
30
|
}
|
|
31
|
-
},
|
|
32
|
-
const [t, n] =
|
|
31
|
+
}, Z = p.createContext(ds), Ye = document.title, fs = ({ children: e }) => {
|
|
32
|
+
const [t, n] = p.useState(!1), [r, s] = p.useState(""), [o, a] = p.useState(!1), [l, d] = p.useState(!1), c = se("luminix.cms.layout", {}), u = Ie((y) => y.breakpoints.up((c == null ? void 0 : c.breakpoint) || "md")), h = {
|
|
33
33
|
open: t,
|
|
34
34
|
setOpen: n,
|
|
35
|
-
layout:
|
|
36
|
-
isBreakpointUp:
|
|
35
|
+
layout: c,
|
|
36
|
+
isBreakpointUp: u,
|
|
37
37
|
currentPage: r,
|
|
38
38
|
setCurrentPage: s,
|
|
39
39
|
showSearch: o,
|
|
@@ -41,33 +41,33 @@ const ds = {
|
|
|
41
41
|
showBackButton: l,
|
|
42
42
|
setShowBackButton: d
|
|
43
43
|
};
|
|
44
|
-
return
|
|
44
|
+
return p.useEffect(() => (document.title = r ? `${r} | ${se("app.name", Ye)}` : se("app.name", Ye), () => {
|
|
45
45
|
document.title = Ye;
|
|
46
|
-
}), [r]), /* @__PURE__ */ i(
|
|
47
|
-
}, Nn =
|
|
46
|
+
}), [r]), /* @__PURE__ */ i(Z.Provider, { value: h, children: e });
|
|
47
|
+
}, Nn = p.createContext({
|
|
48
48
|
Model: null
|
|
49
|
-
}), Je = ({ Model: e, children: t }) => /* @__PURE__ */ i(Nn.Provider, { value: { Model: e }, children: t }), jn =
|
|
49
|
+
}), Je = ({ Model: e, children: t }) => /* @__PURE__ */ i(Nn.Provider, { value: { Model: e }, children: t }), jn = p.createContext({
|
|
50
50
|
isOpen: !1,
|
|
51
51
|
dialog: () => Promise.reject(new Error("Trying to access DialogContext outside of DialogProvider")),
|
|
52
52
|
dismissDialog: () => {
|
|
53
53
|
},
|
|
54
54
|
current: void 0
|
|
55
55
|
});
|
|
56
|
-
function
|
|
57
|
-
const [t, n] =
|
|
58
|
-
return
|
|
56
|
+
function hs(e) {
|
|
57
|
+
const [t, n] = p.useState(e);
|
|
58
|
+
return p.useEffect(() => {
|
|
59
59
|
e && n(e);
|
|
60
60
|
}, [e]), e || t;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const [{ current: n, resolve: r }, s] =
|
|
62
|
+
function ps({ children: e, ...t }) {
|
|
63
|
+
const [{ current: n, resolve: r }, s] = p.useState({}), o = hs(n), a = p.useCallback((u) => new Promise((h) => {
|
|
64
64
|
s({
|
|
65
|
-
current: typeof
|
|
66
|
-
resolve:
|
|
65
|
+
current: typeof u == "string" ? { message: u } : u,
|
|
66
|
+
resolve: h
|
|
67
67
|
});
|
|
68
68
|
}), []), { t: l } = L(), d = () => {
|
|
69
69
|
r && r(!1), s({});
|
|
70
|
-
},
|
|
70
|
+
}, c = () => {
|
|
71
71
|
r && r(!0), s({});
|
|
72
72
|
};
|
|
73
73
|
return /* @__PURE__ */ w(jn.Provider, { value: {
|
|
@@ -91,7 +91,7 @@ function hs({ children: e, ...t }) {
|
|
|
91
91
|
/* @__PURE__ */ w(kt, { children: [
|
|
92
92
|
(o == null ? void 0 : o.type) === "confirm" && /* @__PURE__ */ w(B, { children: [
|
|
93
93
|
/* @__PURE__ */ i(M, { onClick: d, children: (o == null ? void 0 : o.cancelText) ?? l("No") }),
|
|
94
|
-
/* @__PURE__ */ i(M, { onClick:
|
|
94
|
+
/* @__PURE__ */ i(M, { onClick: c, autoFocus: !0, children: (o == null ? void 0 : o.confirmText) ?? l("Yes") })
|
|
95
95
|
] }),
|
|
96
96
|
((o == null ? void 0 : o.type) ?? "alert") === "alert" && /* @__PURE__ */ i(M, { onClick: d, autoFocus: !0, children: (o == null ? void 0 : o.confirmText) ?? l("Ok") })
|
|
97
97
|
] })
|
|
@@ -101,10 +101,10 @@ function hs({ children: e, ...t }) {
|
|
|
101
101
|
] });
|
|
102
102
|
}
|
|
103
103
|
function v() {
|
|
104
|
-
const { isBreakpointUp: e } = xn(
|
|
104
|
+
const { isBreakpointUp: e } = xn(Z);
|
|
105
105
|
return e;
|
|
106
106
|
}
|
|
107
|
-
const Ft =
|
|
107
|
+
const Ft = p.createContext({
|
|
108
108
|
isOpen: !1,
|
|
109
109
|
notify: () => {
|
|
110
110
|
},
|
|
@@ -127,22 +127,22 @@ const Ft = h.createContext({
|
|
|
127
127
|
sx: s,
|
|
128
128
|
...o
|
|
129
129
|
}) => {
|
|
130
|
-
const a = mn(ut), l = v(),
|
|
131
|
-
x !== "clickaway" &&
|
|
130
|
+
const a = mn(ut), l = v(), c = Pt().spacing(l ? 3 : 1), [u, h] = p.useState(), [y, S] = p.useState(c), { vertical: b = "bottom" } = r || {}, m = (g, x) => {
|
|
131
|
+
x !== "clickaway" && h(void 0);
|
|
132
132
|
};
|
|
133
|
-
return
|
|
134
|
-
if (!
|
|
133
|
+
return p.useEffect(() => {
|
|
134
|
+
if (!u && a.isNotEmpty()) {
|
|
135
135
|
const g = setTimeout(() => {
|
|
136
|
-
|
|
136
|
+
h(ut.pull(0) ?? void 0);
|
|
137
137
|
}, 100);
|
|
138
138
|
return () => clearTimeout(g);
|
|
139
139
|
}
|
|
140
|
-
}, [
|
|
141
|
-
isOpen: !!
|
|
140
|
+
}, [u, a]), /* @__PURE__ */ w(Ft.Provider, { value: {
|
|
141
|
+
isOpen: !!u,
|
|
142
142
|
notify: ms,
|
|
143
143
|
dismissNotification: m,
|
|
144
144
|
notifications: a.all(),
|
|
145
|
-
current:
|
|
145
|
+
current: u,
|
|
146
146
|
displacement: y,
|
|
147
147
|
setDisplacement: S
|
|
148
148
|
}, children: [
|
|
@@ -150,7 +150,7 @@ const Ft = h.createContext({
|
|
|
150
150
|
/* @__PURE__ */ i(
|
|
151
151
|
Tr,
|
|
152
152
|
{
|
|
153
|
-
open: !!
|
|
153
|
+
open: !!u,
|
|
154
154
|
autoHideDuration: t,
|
|
155
155
|
anchorOrigin: r,
|
|
156
156
|
onClose: m,
|
|
@@ -159,15 +159,15 @@ const Ft = h.createContext({
|
|
|
159
159
|
[b]: `${y} !important`
|
|
160
160
|
},
|
|
161
161
|
...o,
|
|
162
|
-
children:
|
|
162
|
+
children: u && /* @__PURE__ */ w(
|
|
163
163
|
Dr,
|
|
164
164
|
{
|
|
165
165
|
onClose: m,
|
|
166
|
-
severity:
|
|
166
|
+
severity: u.severity,
|
|
167
167
|
variant: n,
|
|
168
168
|
sx: { width: "100%" },
|
|
169
|
-
action:
|
|
170
|
-
...
|
|
169
|
+
action: u.actions && [
|
|
170
|
+
...u.actions.map(({ label: g, callback: x }, A) => /* @__PURE__ */ i(
|
|
171
171
|
M,
|
|
172
172
|
{
|
|
173
173
|
color: "inherit",
|
|
@@ -180,8 +180,8 @@ const Ft = h.createContext({
|
|
|
180
180
|
/* @__PURE__ */ i(q, { "aria-label": "close", color: "inherit", size: "small", onClick: m, children: /* @__PURE__ */ i(Me, {}) }, "close")
|
|
181
181
|
],
|
|
182
182
|
children: [
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
u.title && /* @__PURE__ */ i(Or, { children: u.title }),
|
|
184
|
+
u.message
|
|
185
185
|
]
|
|
186
186
|
}
|
|
187
187
|
)
|
|
@@ -195,7 +195,7 @@ const Ft = h.createContext({
|
|
|
195
195
|
{
|
|
196
196
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
197
197
|
variant: t ? "standard" : "filled",
|
|
198
|
-
children: /* @__PURE__ */ i(
|
|
198
|
+
children: /* @__PURE__ */ i(ps, { children: /* @__PURE__ */ i(fs, { children: e }) })
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
201
|
}, ys = (e, {
|
|
@@ -237,8 +237,8 @@ const Ft = h.createContext({
|
|
|
237
237
|
}
|
|
238
238
|
];
|
|
239
239
|
function Bt(e) {
|
|
240
|
-
const { setCurrentPage: t } =
|
|
241
|
-
|
|
240
|
+
const { setCurrentPage: t } = p.useContext(Z);
|
|
241
|
+
p.useEffect(() => (t(e), () => {
|
|
242
242
|
t("");
|
|
243
243
|
}), [e, t]);
|
|
244
244
|
}
|
|
@@ -255,10 +255,10 @@ const ws = () => {
|
|
|
255
255
|
] }) })
|
|
256
256
|
] });
|
|
257
257
|
function H(e, t) {
|
|
258
|
-
const { layout: n } = xn(
|
|
259
|
-
return ns(() =>
|
|
258
|
+
const { layout: n } = xn(Z);
|
|
259
|
+
return ns(() => ee.get(n, e, t), [n, e, t]);
|
|
260
260
|
}
|
|
261
|
-
const As =
|
|
261
|
+
const As = G("div")(({ theme: e }) => ({
|
|
262
262
|
padding: e.spacing(0, 1),
|
|
263
263
|
// necessary for content to be below app bar
|
|
264
264
|
...e.mixins.toolbar
|
|
@@ -270,7 +270,7 @@ const As = Z("div")(({ theme: e }) => ({
|
|
|
270
270
|
} = T("cms").getComponents(), a = H("appBar.height"), {
|
|
271
271
|
AppBar: l,
|
|
272
272
|
Drawer: d,
|
|
273
|
-
main:
|
|
273
|
+
main: c
|
|
274
274
|
} = t || {};
|
|
275
275
|
return /* @__PURE__ */ w(V, { sx: { display: "flex" }, ...n, children: [
|
|
276
276
|
/* @__PURE__ */ i(
|
|
@@ -289,7 +289,7 @@ const As = Z("div")(({ theme: e }) => ({
|
|
|
289
289
|
flexGrow: 1
|
|
290
290
|
// p: { xs: 1, sm: 2, md: 3 },
|
|
291
291
|
},
|
|
292
|
-
...
|
|
292
|
+
...c,
|
|
293
293
|
children: [
|
|
294
294
|
/* @__PURE__ */ i(As, { style: { height: a } }),
|
|
295
295
|
/* @__PURE__ */ i(r, {}),
|
|
@@ -300,13 +300,13 @@ const As = Z("div")(({ theme: e }) => ({
|
|
|
300
300
|
] });
|
|
301
301
|
};
|
|
302
302
|
function Cs() {
|
|
303
|
-
const { setShowSearch: e } =
|
|
304
|
-
|
|
303
|
+
const { setShowSearch: e } = p.useContext(Z);
|
|
304
|
+
p.useEffect(() => (e(!0), () => {
|
|
305
305
|
e(!1);
|
|
306
306
|
}), [e]);
|
|
307
307
|
}
|
|
308
308
|
function te() {
|
|
309
|
-
const { Model: e } =
|
|
309
|
+
const { Model: e } = p.useContext(Nn);
|
|
310
310
|
return e;
|
|
311
311
|
}
|
|
312
312
|
const Es = () => {
|
|
@@ -321,16 +321,16 @@ const Es = () => {
|
|
|
321
321
|
["ModelIndex.Pagination"]: a,
|
|
322
322
|
["ModelIndex.StaticActions"]: l,
|
|
323
323
|
["ModelIndex.Table"]: d,
|
|
324
|
-
["ModelIndex.Table.TableBody"]:
|
|
325
|
-
["ModelIndex.Table.TableHead"]:
|
|
326
|
-
["ModelIndex.Table.TableFooter"]:
|
|
324
|
+
["ModelIndex.Table.TableBody"]: c,
|
|
325
|
+
["ModelIndex.Table.TableHead"]: u,
|
|
326
|
+
["ModelIndex.Table.TableFooter"]: h,
|
|
327
327
|
["ModelIndex.Table.TableToolbar"]: y,
|
|
328
328
|
["ModelIndex.Table.TableBody.TableRow"]: S,
|
|
329
329
|
["ModelIndex.Tabs"]: b
|
|
330
330
|
} = T("cms").getComponents();
|
|
331
|
-
return /* @__PURE__ */ w(
|
|
331
|
+
return /* @__PURE__ */ w(X, { container: !0, spacing: 2, children: [
|
|
332
332
|
/* @__PURE__ */ w(
|
|
333
|
-
|
|
333
|
+
X,
|
|
334
334
|
{
|
|
335
335
|
xs: 12,
|
|
336
336
|
display: "flex",
|
|
@@ -349,26 +349,26 @@ const Es = () => {
|
|
|
349
349
|
]
|
|
350
350
|
}
|
|
351
351
|
),
|
|
352
|
-
!s && /* @__PURE__ */ i(
|
|
353
|
-
/* @__PURE__ */ i(
|
|
354
|
-
/* @__PURE__ */ i(
|
|
352
|
+
!s && /* @__PURE__ */ i(X, { display: "flex", justifyContent: "center", xs: 12, children: /* @__PURE__ */ i(a, { variant: "compact" }) }),
|
|
353
|
+
/* @__PURE__ */ i(X, { xs: 12, sx: { pb: 0 }, children: /* @__PURE__ */ i(b, {}) }),
|
|
354
|
+
/* @__PURE__ */ i(X, { xs: 12, sx: { pt: 0 }, children: /* @__PURE__ */ w(
|
|
355
355
|
d,
|
|
356
356
|
{
|
|
357
357
|
items: t,
|
|
358
358
|
loading: r,
|
|
359
359
|
error: n,
|
|
360
360
|
children: [
|
|
361
|
-
/* @__PURE__ */ i(
|
|
362
|
-
/* @__PURE__ */ i(
|
|
363
|
-
/* @__PURE__ */ i(
|
|
361
|
+
/* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(y, {}) }),
|
|
362
|
+
/* @__PURE__ */ i(c, { children: (m) => /* @__PURE__ */ i(S, { item: m }, m.getKey()) }),
|
|
363
|
+
/* @__PURE__ */ i(h, {})
|
|
364
364
|
]
|
|
365
365
|
}
|
|
366
366
|
) })
|
|
367
367
|
] });
|
|
368
368
|
};
|
|
369
369
|
function ks() {
|
|
370
|
-
const { setShowBackButton: e } =
|
|
371
|
-
|
|
370
|
+
const { setShowBackButton: e } = p.useContext(Z);
|
|
371
|
+
p.useEffect(() => (e(!0), () => {
|
|
372
372
|
e(!1);
|
|
373
373
|
}), [e]);
|
|
374
374
|
}
|
|
@@ -380,7 +380,7 @@ function Un(e, t) {
|
|
|
380
380
|
const { toString: Ts } = Object.prototype, { getPrototypeOf: Lt } = Object, Ue = /* @__PURE__ */ ((e) => (t) => {
|
|
381
381
|
const n = Ts.call(t);
|
|
382
382
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
383
|
-
})(/* @__PURE__ */ Object.create(null)), Y = (e) => (e = e.toLowerCase(), (t) => Ue(t) === e), qe = (e) => (t) => typeof t === e, { isArray:
|
|
383
|
+
})(/* @__PURE__ */ Object.create(null)), Y = (e) => (e = e.toLowerCase(), (t) => Ue(t) === e), qe = (e) => (t) => typeof t === e, { isArray: he } = Array, we = qe("undefined");
|
|
384
384
|
function Ds(e) {
|
|
385
385
|
return e !== null && !we(e) && e.constructor !== null && !we(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
386
386
|
}
|
|
@@ -403,7 +403,7 @@ function xe(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
403
403
|
if (e === null || typeof e > "u")
|
|
404
404
|
return;
|
|
405
405
|
let r, s;
|
|
406
|
-
if (typeof e != "object" && (e = [e]),
|
|
406
|
+
if (typeof e != "object" && (e = [e]), he(e))
|
|
407
407
|
for (r = 0, s = e.length; r < s; r++)
|
|
408
408
|
t.call(null, e[r], r, e);
|
|
409
409
|
else {
|
|
@@ -426,7 +426,7 @@ const ie = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typ
|
|
|
426
426
|
function dt() {
|
|
427
427
|
const { caseless: e } = zn(this) && this || {}, t = {}, n = (r, s) => {
|
|
428
428
|
const o = e && Hn(t, s) || s;
|
|
429
|
-
Te(t[o]) && Te(r) ? t[o] = dt(t[o], r) : Te(r) ? t[o] = dt({}, r) :
|
|
429
|
+
Te(t[o]) && Te(r) ? t[o] = dt(t[o], r) : Te(r) ? t[o] = dt({}, r) : he(r) ? t[o] = r.slice() : t[o] = r;
|
|
430
430
|
};
|
|
431
431
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
432
432
|
arguments[r] && xe(arguments[r], n);
|
|
@@ -454,7 +454,7 @@ const zs = (e, t, n, { allOwnKeys: r } = {}) => (xe(t, (s, o) => {
|
|
|
454
454
|
return r !== -1 && r === n;
|
|
455
455
|
}, Ys = (e) => {
|
|
456
456
|
if (!e) return null;
|
|
457
|
-
if (
|
|
457
|
+
if (he(e)) return e;
|
|
458
458
|
let t = e.length;
|
|
459
459
|
if (!_n(t)) return null;
|
|
460
460
|
const n = new Array(t);
|
|
@@ -506,7 +506,7 @@ const zs = (e, t, n, { allOwnKeys: r } = {}) => (xe(t, (s, o) => {
|
|
|
506
506
|
n[o] = !0;
|
|
507
507
|
});
|
|
508
508
|
};
|
|
509
|
-
return
|
|
509
|
+
return he(e) ? r(e) : r(String(e).split(t)), n;
|
|
510
510
|
}, ro = () => {
|
|
511
511
|
}, so = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, Ge = "abcdefghijklmnopqrstuvwxyz", Zt = "0123456789", Vn = {
|
|
512
512
|
DIGIT: Zt,
|
|
@@ -529,7 +529,7 @@ const io = (e) => {
|
|
|
529
529
|
return;
|
|
530
530
|
if (!("toJSON" in r)) {
|
|
531
531
|
t[s] = r;
|
|
532
|
-
const o =
|
|
532
|
+
const o = he(r) ? [] : {};
|
|
533
533
|
return xe(r, (a, l) => {
|
|
534
534
|
const d = n(a, s + 1);
|
|
535
535
|
!we(d) && (o[l] = d);
|
|
@@ -546,8 +546,8 @@ const io = (e) => {
|
|
|
546
546
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
547
547
|
typeof setImmediate == "function",
|
|
548
548
|
_(ie.postMessage)
|
|
549
|
-
), uo = typeof queueMicrotask < "u" ? queueMicrotask.bind(ie) : typeof process < "u" && process.nextTick || $n,
|
|
550
|
-
isArray:
|
|
549
|
+
), uo = typeof queueMicrotask < "u" ? queueMicrotask.bind(ie) : typeof process < "u" && process.nextTick || $n, f = {
|
|
550
|
+
isArray: he,
|
|
551
551
|
isArrayBuffer: qn,
|
|
552
552
|
isBuffer: Ds,
|
|
553
553
|
isFormData: Ms,
|
|
@@ -609,7 +609,7 @@ const io = (e) => {
|
|
|
609
609
|
function C(e, t, n, r, s) {
|
|
610
610
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
|
|
611
611
|
}
|
|
612
|
-
|
|
612
|
+
f.inherits(C, Error, {
|
|
613
613
|
toJSON: function() {
|
|
614
614
|
return {
|
|
615
615
|
// Standard
|
|
@@ -624,7 +624,7 @@ p.inherits(C, Error, {
|
|
|
624
624
|
columnNumber: this.columnNumber,
|
|
625
625
|
stack: this.stack,
|
|
626
626
|
// Axios
|
|
627
|
-
config:
|
|
627
|
+
config: f.toJSONObject(this.config),
|
|
628
628
|
code: this.code,
|
|
629
629
|
status: this.status
|
|
630
630
|
};
|
|
@@ -652,86 +652,86 @@ Object.defineProperties(C, Yn);
|
|
|
652
652
|
Object.defineProperty(Kn, "isAxiosError", { value: !0 });
|
|
653
653
|
C.from = (e, t, n, r, s, o) => {
|
|
654
654
|
const a = Object.create(Kn);
|
|
655
|
-
return
|
|
655
|
+
return f.toFlatObject(e, a, function(d) {
|
|
656
656
|
return d !== Error.prototype;
|
|
657
657
|
}, (l) => l !== "isAxiosError"), C.call(a, e.message, t, n, r, s), a.cause = e, a.name = e.name, o && Object.assign(a, o), a;
|
|
658
658
|
};
|
|
659
659
|
const fo = null;
|
|
660
660
|
function ft(e) {
|
|
661
|
-
return
|
|
661
|
+
return f.isPlainObject(e) || f.isArray(e);
|
|
662
662
|
}
|
|
663
663
|
function Jn(e) {
|
|
664
|
-
return
|
|
664
|
+
return f.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
665
665
|
}
|
|
666
666
|
function Xt(e, t, n) {
|
|
667
667
|
return e ? e.concat(t).map(function(s, o) {
|
|
668
668
|
return s = Jn(s), !n && o ? "[" + s + "]" : s;
|
|
669
669
|
}).join(n ? "." : "") : t;
|
|
670
670
|
}
|
|
671
|
-
function
|
|
672
|
-
return
|
|
671
|
+
function ho(e) {
|
|
672
|
+
return f.isArray(e) && !e.some(ft);
|
|
673
673
|
}
|
|
674
|
-
const
|
|
674
|
+
const po = f.toFlatObject(f, {}, null, function(t) {
|
|
675
675
|
return /^is[A-Z]/.test(t);
|
|
676
676
|
});
|
|
677
677
|
function He(e, t, n) {
|
|
678
|
-
if (!
|
|
678
|
+
if (!f.isObject(e))
|
|
679
679
|
throw new TypeError("target must be an object");
|
|
680
|
-
t = t || new FormData(), n =
|
|
680
|
+
t = t || new FormData(), n = f.toFlatObject(n, {
|
|
681
681
|
metaTokens: !0,
|
|
682
682
|
dots: !1,
|
|
683
683
|
indexes: !1
|
|
684
684
|
}, !1, function(m, g) {
|
|
685
|
-
return !
|
|
685
|
+
return !f.isUndefined(g[m]);
|
|
686
686
|
});
|
|
687
|
-
const r = n.metaTokens, s = n.visitor ||
|
|
688
|
-
if (!
|
|
687
|
+
const r = n.metaTokens, s = n.visitor || u, o = n.dots, a = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && f.isSpecCompliantForm(t);
|
|
688
|
+
if (!f.isFunction(s))
|
|
689
689
|
throw new TypeError("visitor must be a function");
|
|
690
|
-
function
|
|
690
|
+
function c(b) {
|
|
691
691
|
if (b === null) return "";
|
|
692
|
-
if (
|
|
692
|
+
if (f.isDate(b))
|
|
693
693
|
return b.toISOString();
|
|
694
|
-
if (!d &&
|
|
694
|
+
if (!d && f.isBlob(b))
|
|
695
695
|
throw new C("Blob is not supported. Use a Buffer instead.");
|
|
696
|
-
return
|
|
696
|
+
return f.isArrayBuffer(b) || f.isTypedArray(b) ? d && typeof Blob == "function" ? new Blob([b]) : Buffer.from(b) : b;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function u(b, m, g) {
|
|
699
699
|
let x = b;
|
|
700
700
|
if (b && !g && typeof b == "object") {
|
|
701
|
-
if (
|
|
701
|
+
if (f.endsWith(m, "{}"))
|
|
702
702
|
m = r ? m : m.slice(0, -2), b = JSON.stringify(b);
|
|
703
|
-
else if (
|
|
703
|
+
else if (f.isArray(b) && ho(b) || (f.isFileList(b) || f.endsWith(m, "[]")) && (x = f.toArray(b)))
|
|
704
704
|
return m = Jn(m), x.forEach(function(E, P) {
|
|
705
|
-
!(
|
|
705
|
+
!(f.isUndefined(E) || E === null) && t.append(
|
|
706
706
|
// eslint-disable-next-line no-nested-ternary
|
|
707
707
|
a === !0 ? Xt([m], P, o) : a === null ? m : m + "[]",
|
|
708
|
-
|
|
708
|
+
c(E)
|
|
709
709
|
);
|
|
710
710
|
}), !1;
|
|
711
711
|
}
|
|
712
|
-
return ft(b) ? !0 : (t.append(Xt(g, m, o),
|
|
712
|
+
return ft(b) ? !0 : (t.append(Xt(g, m, o), c(b)), !1);
|
|
713
713
|
}
|
|
714
|
-
const
|
|
715
|
-
defaultVisitor:
|
|
716
|
-
convertValue:
|
|
714
|
+
const h = [], y = Object.assign(po, {
|
|
715
|
+
defaultVisitor: u,
|
|
716
|
+
convertValue: c,
|
|
717
717
|
isVisitable: ft
|
|
718
718
|
});
|
|
719
719
|
function S(b, m) {
|
|
720
|
-
if (!
|
|
721
|
-
if (
|
|
720
|
+
if (!f.isUndefined(b)) {
|
|
721
|
+
if (h.indexOf(b) !== -1)
|
|
722
722
|
throw Error("Circular reference detected in " + m.join("."));
|
|
723
|
-
|
|
724
|
-
(!(
|
|
723
|
+
h.push(b), f.forEach(b, function(x, A) {
|
|
724
|
+
(!(f.isUndefined(x) || x === null) && s.call(
|
|
725
725
|
t,
|
|
726
726
|
x,
|
|
727
|
-
|
|
727
|
+
f.isString(A) ? A.trim() : A,
|
|
728
728
|
m,
|
|
729
729
|
y
|
|
730
730
|
)) === !0 && S(x, m ? m.concat(A) : [A]);
|
|
731
|
-
}),
|
|
731
|
+
}), h.pop();
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
if (!
|
|
734
|
+
if (!f.isObject(e))
|
|
735
735
|
throw new TypeError("data must be an object");
|
|
736
736
|
return S(e), t;
|
|
737
737
|
}
|
|
@@ -772,7 +772,7 @@ function Zn(e, t, n) {
|
|
|
772
772
|
return e;
|
|
773
773
|
const r = n && n.encode || mo, s = n && n.serialize;
|
|
774
774
|
let o;
|
|
775
|
-
if (s ? o = s(t, n) : o =
|
|
775
|
+
if (s ? o = s(t, n) : o = f.isURLSearchParams(t) ? t.toString() : new It(t, n).toString(r), o) {
|
|
776
776
|
const a = e.indexOf("#");
|
|
777
777
|
a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
|
|
778
778
|
}
|
|
@@ -827,7 +827,7 @@ class en {
|
|
|
827
827
|
* @returns {void}
|
|
828
828
|
*/
|
|
829
829
|
forEach(t) {
|
|
830
|
-
|
|
830
|
+
f.forEach(this.handlers, function(r) {
|
|
831
831
|
r !== null && t(r);
|
|
832
832
|
});
|
|
833
833
|
}
|
|
@@ -844,13 +844,13 @@ const Xn = {
|
|
|
844
844
|
Blob: yo
|
|
845
845
|
},
|
|
846
846
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
847
|
-
}, Mt = typeof window < "u" && typeof document < "u",
|
|
847
|
+
}, Mt = typeof window < "u" && typeof document < "u", ht = typeof navigator == "object" && navigator || void 0, So = Mt && (!ht || ["ReactNative", "NativeScript", "NS"].indexOf(ht.product) < 0), Ao = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
848
848
|
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", xo = Mt && window.location.href || "http://localhost", Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
849
849
|
__proto__: null,
|
|
850
850
|
hasBrowserEnv: Mt,
|
|
851
851
|
hasStandardBrowserEnv: So,
|
|
852
852
|
hasStandardBrowserWebWorkerEnv: Ao,
|
|
853
|
-
navigator:
|
|
853
|
+
navigator: ht,
|
|
854
854
|
origin: xo
|
|
855
855
|
}, Symbol.toStringTag, { value: "Module" })), j = {
|
|
856
856
|
...Co,
|
|
@@ -859,12 +859,12 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", xo
|
|
|
859
859
|
function Eo(e, t) {
|
|
860
860
|
return He(e, new j.classes.URLSearchParams(), Object.assign({
|
|
861
861
|
visitor: function(n, r, s, o) {
|
|
862
|
-
return j.isNode &&
|
|
862
|
+
return j.isNode && f.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
863
863
|
}
|
|
864
864
|
}, t));
|
|
865
865
|
}
|
|
866
866
|
function ko(e) {
|
|
867
|
-
return
|
|
867
|
+
return f.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
868
868
|
}
|
|
869
869
|
function To(e) {
|
|
870
870
|
const t = {}, n = Object.keys(e);
|
|
@@ -880,20 +880,20 @@ function Qn(e) {
|
|
|
880
880
|
let a = n[o++];
|
|
881
881
|
if (a === "__proto__") return !0;
|
|
882
882
|
const l = Number.isFinite(+a), d = o >= n.length;
|
|
883
|
-
return a = !a &&
|
|
883
|
+
return a = !a && f.isArray(s) ? s.length : a, d ? (f.hasOwnProp(s, a) ? s[a] = [s[a], r] : s[a] = r, !l) : ((!s[a] || !f.isObject(s[a])) && (s[a] = []), t(n, r, s[a], o) && f.isArray(s[a]) && (s[a] = To(s[a])), !l);
|
|
884
884
|
}
|
|
885
|
-
if (
|
|
885
|
+
if (f.isFormData(e) && f.isFunction(e.entries)) {
|
|
886
886
|
const n = {};
|
|
887
|
-
return
|
|
887
|
+
return f.forEachEntry(e, (r, s) => {
|
|
888
888
|
t(ko(r), s, n, 0);
|
|
889
889
|
}), n;
|
|
890
890
|
}
|
|
891
891
|
return null;
|
|
892
892
|
}
|
|
893
893
|
function Do(e, t, n) {
|
|
894
|
-
if (
|
|
894
|
+
if (f.isString(e))
|
|
895
895
|
try {
|
|
896
|
-
return (t || JSON.parse)(e),
|
|
896
|
+
return (t || JSON.parse)(e), f.trim(e);
|
|
897
897
|
} catch (r) {
|
|
898
898
|
if (r.name !== "SyntaxError")
|
|
899
899
|
throw r;
|
|
@@ -904,20 +904,20 @@ const Ce = {
|
|
|
904
904
|
transitional: Xn,
|
|
905
905
|
adapter: ["xhr", "http", "fetch"],
|
|
906
906
|
transformRequest: [function(t, n) {
|
|
907
|
-
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o =
|
|
908
|
-
if (o &&
|
|
907
|
+
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = f.isObject(t);
|
|
908
|
+
if (o && f.isHTMLForm(t) && (t = new FormData(t)), f.isFormData(t))
|
|
909
909
|
return s ? JSON.stringify(Qn(t)) : t;
|
|
910
|
-
if (
|
|
910
|
+
if (f.isArrayBuffer(t) || f.isBuffer(t) || f.isStream(t) || f.isFile(t) || f.isBlob(t) || f.isReadableStream(t))
|
|
911
911
|
return t;
|
|
912
|
-
if (
|
|
912
|
+
if (f.isArrayBufferView(t))
|
|
913
913
|
return t.buffer;
|
|
914
|
-
if (
|
|
914
|
+
if (f.isURLSearchParams(t))
|
|
915
915
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
916
916
|
let l;
|
|
917
917
|
if (o) {
|
|
918
918
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
919
919
|
return Eo(t, this.formSerializer).toString();
|
|
920
|
-
if ((l =
|
|
920
|
+
if ((l = f.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
921
921
|
const d = this.env && this.env.FormData;
|
|
922
922
|
return He(
|
|
923
923
|
l ? { "files[]": t } : t,
|
|
@@ -930,9 +930,9 @@ const Ce = {
|
|
|
930
930
|
}],
|
|
931
931
|
transformResponse: [function(t) {
|
|
932
932
|
const n = this.transitional || Ce.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
933
|
-
if (
|
|
933
|
+
if (f.isResponse(t) || f.isReadableStream(t))
|
|
934
934
|
return t;
|
|
935
|
-
if (t &&
|
|
935
|
+
if (t && f.isString(t) && (r && !this.responseType || s)) {
|
|
936
936
|
const a = !(n && n.silentJSONParsing) && s;
|
|
937
937
|
try {
|
|
938
938
|
return JSON.parse(t);
|
|
@@ -966,10 +966,10 @@ const Ce = {
|
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
968
|
};
|
|
969
|
-
|
|
969
|
+
f.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
970
970
|
Ce.headers[e] = {};
|
|
971
971
|
});
|
|
972
|
-
const Oo =
|
|
972
|
+
const Oo = f.toObjectSet([
|
|
973
973
|
"age",
|
|
974
974
|
"authorization",
|
|
975
975
|
"content-length",
|
|
@@ -999,7 +999,7 @@ function ge(e) {
|
|
|
999
999
|
return e && String(e).trim().toLowerCase();
|
|
1000
1000
|
}
|
|
1001
1001
|
function De(e) {
|
|
1002
|
-
return e === !1 || e == null ? e :
|
|
1002
|
+
return e === !1 || e == null ? e : f.isArray(e) ? e.map(De) : String(e);
|
|
1003
1003
|
}
|
|
1004
1004
|
function Po(e) {
|
|
1005
1005
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -1010,12 +1010,12 @@ function Po(e) {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
const vo = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1012
1012
|
function Ze(e, t, n, r, s) {
|
|
1013
|
-
if (
|
|
1013
|
+
if (f.isFunction(r))
|
|
1014
1014
|
return r.call(this, t, n);
|
|
1015
|
-
if (s && (t = n), !!
|
|
1016
|
-
if (
|
|
1015
|
+
if (s && (t = n), !!f.isString(t)) {
|
|
1016
|
+
if (f.isString(r))
|
|
1017
1017
|
return t.indexOf(r) !== -1;
|
|
1018
|
-
if (
|
|
1018
|
+
if (f.isRegExp(r))
|
|
1019
1019
|
return r.test(t);
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
@@ -1023,7 +1023,7 @@ function Fo(e) {
|
|
|
1023
1023
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
1024
1024
|
}
|
|
1025
1025
|
function Bo(e, t) {
|
|
1026
|
-
const n =
|
|
1026
|
+
const n = f.toCamelCase(" " + t);
|
|
1027
1027
|
["get", "set", "has"].forEach((r) => {
|
|
1028
1028
|
Object.defineProperty(e, r + n, {
|
|
1029
1029
|
value: function(s, o, a) {
|
|
@@ -1039,19 +1039,19 @@ let U = class {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
set(t, n, r) {
|
|
1041
1041
|
const s = this;
|
|
1042
|
-
function o(l, d,
|
|
1043
|
-
const
|
|
1044
|
-
if (!
|
|
1042
|
+
function o(l, d, c) {
|
|
1043
|
+
const u = ge(d);
|
|
1044
|
+
if (!u)
|
|
1045
1045
|
throw new Error("header name must be a non-empty string");
|
|
1046
|
-
const
|
|
1047
|
-
(!
|
|
1046
|
+
const h = f.findKey(s, u);
|
|
1047
|
+
(!h || s[h] === void 0 || c === !0 || c === void 0 && s[h] !== !1) && (s[h || d] = De(l));
|
|
1048
1048
|
}
|
|
1049
|
-
const a = (l, d) =>
|
|
1050
|
-
if (
|
|
1049
|
+
const a = (l, d) => f.forEach(l, (c, u) => o(c, u, d));
|
|
1050
|
+
if (f.isPlainObject(t) || t instanceof this.constructor)
|
|
1051
1051
|
a(t, n);
|
|
1052
|
-
else if (
|
|
1052
|
+
else if (f.isString(t) && (t = t.trim()) && !vo(t))
|
|
1053
1053
|
a(Ro(t), n);
|
|
1054
|
-
else if (
|
|
1054
|
+
else if (f.isHeaders(t))
|
|
1055
1055
|
for (const [l, d] of t.entries())
|
|
1056
1056
|
o(d, l, r);
|
|
1057
1057
|
else
|
|
@@ -1060,16 +1060,16 @@ let U = class {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
get(t, n) {
|
|
1062
1062
|
if (t = ge(t), t) {
|
|
1063
|
-
const r =
|
|
1063
|
+
const r = f.findKey(this, t);
|
|
1064
1064
|
if (r) {
|
|
1065
1065
|
const s = this[r];
|
|
1066
1066
|
if (!n)
|
|
1067
1067
|
return s;
|
|
1068
1068
|
if (n === !0)
|
|
1069
1069
|
return Po(s);
|
|
1070
|
-
if (
|
|
1070
|
+
if (f.isFunction(n))
|
|
1071
1071
|
return n.call(this, s, r);
|
|
1072
|
-
if (
|
|
1072
|
+
if (f.isRegExp(n))
|
|
1073
1073
|
return n.exec(s);
|
|
1074
1074
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
1075
1075
|
}
|
|
@@ -1077,7 +1077,7 @@ let U = class {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
has(t, n) {
|
|
1079
1079
|
if (t = ge(t), t) {
|
|
1080
|
-
const r =
|
|
1080
|
+
const r = f.findKey(this, t);
|
|
1081
1081
|
return !!(r && this[r] !== void 0 && (!n || Ze(this, this[r], r, n)));
|
|
1082
1082
|
}
|
|
1083
1083
|
return !1;
|
|
@@ -1087,11 +1087,11 @@ let U = class {
|
|
|
1087
1087
|
let s = !1;
|
|
1088
1088
|
function o(a) {
|
|
1089
1089
|
if (a = ge(a), a) {
|
|
1090
|
-
const l =
|
|
1090
|
+
const l = f.findKey(r, a);
|
|
1091
1091
|
l && (!n || Ze(r, r[l], l, n)) && (delete r[l], s = !0);
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
|
-
return
|
|
1094
|
+
return f.isArray(t) ? t.forEach(o) : o(t), s;
|
|
1095
1095
|
}
|
|
1096
1096
|
clear(t) {
|
|
1097
1097
|
const n = Object.keys(this);
|
|
@@ -1104,8 +1104,8 @@ let U = class {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
normalize(t) {
|
|
1106
1106
|
const n = this, r = {};
|
|
1107
|
-
return
|
|
1108
|
-
const a =
|
|
1107
|
+
return f.forEach(this, (s, o) => {
|
|
1108
|
+
const a = f.findKey(r, o);
|
|
1109
1109
|
if (a) {
|
|
1110
1110
|
n[a] = De(s), delete n[o];
|
|
1111
1111
|
return;
|
|
@@ -1119,8 +1119,8 @@ let U = class {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
toJSON(t) {
|
|
1121
1121
|
const n = /* @__PURE__ */ Object.create(null);
|
|
1122
|
-
return
|
|
1123
|
-
r != null && r !== !1 && (n[s] = t &&
|
|
1122
|
+
return f.forEach(this, (r, s) => {
|
|
1123
|
+
r != null && r !== !1 && (n[s] = t && f.isArray(r) ? r.join(", ") : r);
|
|
1124
1124
|
}), n;
|
|
1125
1125
|
}
|
|
1126
1126
|
[Symbol.iterator]() {
|
|
@@ -1148,11 +1148,11 @@ let U = class {
|
|
|
1148
1148
|
const l = ge(a);
|
|
1149
1149
|
r[l] || (Bo(s, a), r[l] = !0);
|
|
1150
1150
|
}
|
|
1151
|
-
return
|
|
1151
|
+
return f.isArray(t) ? t.forEach(o) : o(t), this;
|
|
1152
1152
|
}
|
|
1153
1153
|
};
|
|
1154
1154
|
U.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1155
|
-
|
|
1155
|
+
f.reduceDescriptors(U.prototype, ({ value: e }, t) => {
|
|
1156
1156
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
1157
1157
|
return {
|
|
1158
1158
|
get: () => e,
|
|
@@ -1161,21 +1161,21 @@ p.reduceDescriptors(U.prototype, ({ value: e }, t) => {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
};
|
|
1163
1163
|
});
|
|
1164
|
-
|
|
1164
|
+
f.freezeMethods(U);
|
|
1165
1165
|
function Xe(e, t) {
|
|
1166
1166
|
const n = this || Ce, r = t || n, s = U.from(r.headers);
|
|
1167
1167
|
let o = r.data;
|
|
1168
|
-
return
|
|
1168
|
+
return f.forEach(e, function(l) {
|
|
1169
1169
|
o = l.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
1170
1170
|
}), s.normalize(), o;
|
|
1171
1171
|
}
|
|
1172
1172
|
function er(e) {
|
|
1173
1173
|
return !!(e && e.__CANCEL__);
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function pe(e, t, n) {
|
|
1176
1176
|
C.call(this, e ?? "canceled", C.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1177
1177
|
}
|
|
1178
|
-
|
|
1178
|
+
f.inherits(pe, C, {
|
|
1179
1179
|
__CANCEL__: !0
|
|
1180
1180
|
});
|
|
1181
1181
|
function tr(e, t, n) {
|
|
@@ -1197,47 +1197,47 @@ function Io(e, t) {
|
|
|
1197
1197
|
const n = new Array(e), r = new Array(e);
|
|
1198
1198
|
let s = 0, o = 0, a;
|
|
1199
1199
|
return t = t !== void 0 ? t : 1e3, function(d) {
|
|
1200
|
-
const
|
|
1201
|
-
a || (a =
|
|
1202
|
-
let
|
|
1203
|
-
for (;
|
|
1204
|
-
y += n[
|
|
1205
|
-
if (s = (s + 1) % e, s === o && (o = (o + 1) % e),
|
|
1200
|
+
const c = Date.now(), u = r[o];
|
|
1201
|
+
a || (a = c), n[s] = d, r[s] = c;
|
|
1202
|
+
let h = o, y = 0;
|
|
1203
|
+
for (; h !== s; )
|
|
1204
|
+
y += n[h++], h = h % e;
|
|
1205
|
+
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), c - a < t)
|
|
1206
1206
|
return;
|
|
1207
|
-
const S =
|
|
1207
|
+
const S = u && c - u;
|
|
1208
1208
|
return S ? Math.round(y * 1e3 / S) : void 0;
|
|
1209
1209
|
};
|
|
1210
1210
|
}
|
|
1211
1211
|
function Mo(e, t) {
|
|
1212
1212
|
let n = 0, r = 1e3 / t, s, o;
|
|
1213
|
-
const a = (
|
|
1214
|
-
n =
|
|
1213
|
+
const a = (c, u = Date.now()) => {
|
|
1214
|
+
n = u, s = null, o && (clearTimeout(o), o = null), e.apply(null, c);
|
|
1215
1215
|
};
|
|
1216
|
-
return [(...
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1216
|
+
return [(...c) => {
|
|
1217
|
+
const u = Date.now(), h = u - n;
|
|
1218
|
+
h >= r ? a(c, u) : (s = c, o || (o = setTimeout(() => {
|
|
1219
1219
|
o = null, a(s);
|
|
1220
|
-
}, r -
|
|
1220
|
+
}, r - h)));
|
|
1221
1221
|
}, () => s && a(s)];
|
|
1222
1222
|
}
|
|
1223
1223
|
const Fe = (e, t, n = 3) => {
|
|
1224
1224
|
let r = 0;
|
|
1225
1225
|
const s = Io(50, 250);
|
|
1226
1226
|
return Mo((o) => {
|
|
1227
|
-
const a = o.loaded, l = o.lengthComputable ? o.total : void 0, d = a - r,
|
|
1227
|
+
const a = o.loaded, l = o.lengthComputable ? o.total : void 0, d = a - r, c = s(d), u = a <= l;
|
|
1228
1228
|
r = a;
|
|
1229
|
-
const
|
|
1229
|
+
const h = {
|
|
1230
1230
|
loaded: a,
|
|
1231
1231
|
total: l,
|
|
1232
1232
|
progress: l ? a / l : void 0,
|
|
1233
1233
|
bytes: d,
|
|
1234
|
-
rate:
|
|
1235
|
-
estimated:
|
|
1234
|
+
rate: c || void 0,
|
|
1235
|
+
estimated: c && l && u ? (l - a) / c : void 0,
|
|
1236
1236
|
event: o,
|
|
1237
1237
|
lengthComputable: l != null,
|
|
1238
1238
|
[t ? "download" : "upload"]: !0
|
|
1239
1239
|
};
|
|
1240
|
-
e(
|
|
1240
|
+
e(h);
|
|
1241
1241
|
}, n);
|
|
1242
1242
|
}, nn = (e, t) => {
|
|
1243
1243
|
const n = e != null;
|
|
@@ -1246,7 +1246,7 @@ const Fe = (e, t, n = 3) => {
|
|
|
1246
1246
|
total: e,
|
|
1247
1247
|
loaded: r
|
|
1248
1248
|
}), t[1]];
|
|
1249
|
-
}, rn = (e) => (...t) =>
|
|
1249
|
+
}, rn = (e) => (...t) => f.asap(() => e(...t)), No = j.hasStandardBrowserEnv ? (
|
|
1250
1250
|
// Standard browser envs have full support of the APIs needed to test
|
|
1251
1251
|
// whether the request URL is of the same origin as current location.
|
|
1252
1252
|
function() {
|
|
@@ -1266,7 +1266,7 @@ const Fe = (e, t, n = 3) => {
|
|
|
1266
1266
|
};
|
|
1267
1267
|
}
|
|
1268
1268
|
return r = s(window.location.href), function(a) {
|
|
1269
|
-
const l =
|
|
1269
|
+
const l = f.isString(a) ? s(a) : a;
|
|
1270
1270
|
return l.protocol === r.protocol && l.host === r.host;
|
|
1271
1271
|
};
|
|
1272
1272
|
}()
|
|
@@ -1282,7 +1282,7 @@ const Fe = (e, t, n = 3) => {
|
|
|
1282
1282
|
{
|
|
1283
1283
|
write(e, t, n, r, s, o) {
|
|
1284
1284
|
const a = [e + "=" + encodeURIComponent(t)];
|
|
1285
|
-
|
|
1285
|
+
f.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()), f.isString(r) && a.push("path=" + r), f.isString(s) && a.push("domain=" + s), o === !0 && a.push("secure"), document.cookie = a.join("; ");
|
|
1286
1286
|
},
|
|
1287
1287
|
read(e) {
|
|
1288
1288
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1317,30 +1317,30 @@ const sn = (e) => e instanceof U ? { ...e } : e;
|
|
|
1317
1317
|
function ue(e, t) {
|
|
1318
1318
|
t = t || {};
|
|
1319
1319
|
const n = {};
|
|
1320
|
-
function r(
|
|
1321
|
-
return
|
|
1320
|
+
function r(c, u, h) {
|
|
1321
|
+
return f.isPlainObject(c) && f.isPlainObject(u) ? f.merge.call({ caseless: h }, c, u) : f.isPlainObject(u) ? f.merge({}, u) : f.isArray(u) ? u.slice() : u;
|
|
1322
1322
|
}
|
|
1323
|
-
function s(
|
|
1324
|
-
if (
|
|
1325
|
-
if (!
|
|
1326
|
-
return r(void 0,
|
|
1327
|
-
} else return r(
|
|
1323
|
+
function s(c, u, h) {
|
|
1324
|
+
if (f.isUndefined(u)) {
|
|
1325
|
+
if (!f.isUndefined(c))
|
|
1326
|
+
return r(void 0, c, h);
|
|
1327
|
+
} else return r(c, u, h);
|
|
1328
1328
|
}
|
|
1329
|
-
function o(
|
|
1330
|
-
if (!
|
|
1331
|
-
return r(void 0,
|
|
1329
|
+
function o(c, u) {
|
|
1330
|
+
if (!f.isUndefined(u))
|
|
1331
|
+
return r(void 0, u);
|
|
1332
1332
|
}
|
|
1333
|
-
function a(
|
|
1334
|
-
if (
|
|
1335
|
-
if (!
|
|
1336
|
-
return r(void 0,
|
|
1337
|
-
} else return r(void 0,
|
|
1333
|
+
function a(c, u) {
|
|
1334
|
+
if (f.isUndefined(u)) {
|
|
1335
|
+
if (!f.isUndefined(c))
|
|
1336
|
+
return r(void 0, c);
|
|
1337
|
+
} else return r(void 0, u);
|
|
1338
1338
|
}
|
|
1339
|
-
function l(
|
|
1340
|
-
if (
|
|
1341
|
-
return r(
|
|
1342
|
-
if (
|
|
1343
|
-
return r(void 0,
|
|
1339
|
+
function l(c, u, h) {
|
|
1340
|
+
if (h in t)
|
|
1341
|
+
return r(c, u);
|
|
1342
|
+
if (h in e)
|
|
1343
|
+
return r(void 0, c);
|
|
1344
1344
|
}
|
|
1345
1345
|
const d = {
|
|
1346
1346
|
url: o,
|
|
@@ -1371,11 +1371,11 @@ function ue(e, t) {
|
|
|
1371
1371
|
socketPath: a,
|
|
1372
1372
|
responseEncoding: a,
|
|
1373
1373
|
validateStatus: l,
|
|
1374
|
-
headers: (
|
|
1374
|
+
headers: (c, u) => s(sn(c), sn(u), !0)
|
|
1375
1375
|
};
|
|
1376
|
-
return
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1376
|
+
return f.forEach(Object.keys(Object.assign({}, e, t)), function(u) {
|
|
1377
|
+
const h = d[u] || s, y = h(e[u], t[u], u);
|
|
1378
|
+
f.isUndefined(y) && h !== l || (n[u] = y);
|
|
1379
1379
|
}), n;
|
|
1380
1380
|
}
|
|
1381
1381
|
const rr = (e) => {
|
|
@@ -1386,17 +1386,17 @@ const rr = (e) => {
|
|
|
1386
1386
|
"Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
|
|
1387
1387
|
);
|
|
1388
1388
|
let d;
|
|
1389
|
-
if (
|
|
1389
|
+
if (f.isFormData(n)) {
|
|
1390
1390
|
if (j.hasStandardBrowserEnv || j.hasStandardBrowserWebWorkerEnv)
|
|
1391
1391
|
a.setContentType(void 0);
|
|
1392
1392
|
else if ((d = a.getContentType()) !== !1) {
|
|
1393
|
-
const [
|
|
1394
|
-
a.setContentType([
|
|
1393
|
+
const [c, ...u] = d ? d.split(";").map((h) => h.trim()).filter(Boolean) : [];
|
|
1394
|
+
a.setContentType([c || "multipart/form-data", ...u].join("; "));
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
|
-
if (j.hasStandardBrowserEnv && (r &&
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1397
|
+
if (j.hasStandardBrowserEnv && (r && f.isFunction(r) && (r = r(t)), r || r !== !1 && No(t.url))) {
|
|
1398
|
+
const c = s && o && jo.read(o);
|
|
1399
|
+
c && a.set(s, c);
|
|
1400
1400
|
}
|
|
1401
1401
|
return t;
|
|
1402
1402
|
}, _o = typeof XMLHttpRequest < "u", Ho = _o && function(e) {
|
|
@@ -1404,9 +1404,9 @@ const rr = (e) => {
|
|
|
1404
1404
|
const s = rr(e);
|
|
1405
1405
|
let o = s.data;
|
|
1406
1406
|
const a = U.from(s.headers).normalize();
|
|
1407
|
-
let { responseType: l, onUploadProgress: d, onDownloadProgress:
|
|
1407
|
+
let { responseType: l, onUploadProgress: d, onDownloadProgress: c } = s, u, h, y, S, b;
|
|
1408
1408
|
function m() {
|
|
1409
|
-
S && S(), b && b(), s.cancelToken && s.cancelToken.unsubscribe(
|
|
1409
|
+
S && S(), b && b(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
|
|
1410
1410
|
}
|
|
1411
1411
|
let g = new XMLHttpRequest();
|
|
1412
1412
|
g.open(s.method.toUpperCase(), s.url, !0), g.timeout = s.timeout;
|
|
@@ -1444,11 +1444,11 @@ const rr = (e) => {
|
|
|
1444
1444
|
e,
|
|
1445
1445
|
g
|
|
1446
1446
|
)), g = null;
|
|
1447
|
-
}, o === void 0 && a.setContentType(null), "setRequestHeader" in g &&
|
|
1447
|
+
}, o === void 0 && a.setContentType(null), "setRequestHeader" in g && f.forEach(a.toJSON(), function(P, O) {
|
|
1448
1448
|
g.setRequestHeader(O, P);
|
|
1449
|
-
}),
|
|
1450
|
-
g && (r(!E || E.type ? new
|
|
1451
|
-
}, s.cancelToken && s.cancelToken.subscribe(
|
|
1449
|
+
}), f.isUndefined(s.withCredentials) || (g.withCredentials = !!s.withCredentials), l && l !== "json" && (g.responseType = s.responseType), c && ([y, b] = Fe(c, !0), g.addEventListener("progress", y)), d && g.upload && ([h, S] = Fe(d), g.upload.addEventListener("progress", h), g.upload.addEventListener("loadend", S)), (s.cancelToken || s.signal) && (u = (E) => {
|
|
1450
|
+
g && (r(!E || E.type ? new pe(null, e, g) : E), g.abort(), g = null);
|
|
1451
|
+
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
|
|
1452
1452
|
const A = Lo(s.url);
|
|
1453
1453
|
if (A && j.protocols.indexOf(A) === -1) {
|
|
1454
1454
|
r(new C("Unsupported protocol " + A + ":", C.ERR_BAD_REQUEST, e));
|
|
@@ -1460,24 +1460,24 @@ const rr = (e) => {
|
|
|
1460
1460
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1461
1461
|
if (t || n) {
|
|
1462
1462
|
let r = new AbortController(), s;
|
|
1463
|
-
const o = function(
|
|
1463
|
+
const o = function(c) {
|
|
1464
1464
|
if (!s) {
|
|
1465
1465
|
s = !0, l();
|
|
1466
|
-
const
|
|
1467
|
-
r.abort(
|
|
1466
|
+
const u = c instanceof Error ? c : this.reason;
|
|
1467
|
+
r.abort(u instanceof C ? u : new pe(u instanceof Error ? u.message : u));
|
|
1468
1468
|
}
|
|
1469
1469
|
};
|
|
1470
1470
|
let a = t && setTimeout(() => {
|
|
1471
1471
|
a = null, o(new C(`timeout ${t} of ms exceeded`, C.ETIMEDOUT));
|
|
1472
1472
|
}, t);
|
|
1473
1473
|
const l = () => {
|
|
1474
|
-
e && (a && clearTimeout(a), a = null, e.forEach((
|
|
1475
|
-
|
|
1474
|
+
e && (a && clearTimeout(a), a = null, e.forEach((c) => {
|
|
1475
|
+
c.unsubscribe ? c.unsubscribe(o) : c.removeEventListener("abort", o);
|
|
1476
1476
|
}), e = null);
|
|
1477
1477
|
};
|
|
1478
|
-
e.forEach((
|
|
1478
|
+
e.forEach((c) => c.addEventListener("abort", o));
|
|
1479
1479
|
const { signal: d } = r;
|
|
1480
|
-
return d.unsubscribe = () =>
|
|
1480
|
+
return d.unsubscribe = () => f.asap(l), d;
|
|
1481
1481
|
}
|
|
1482
1482
|
}, Wo = function* (e, t) {
|
|
1483
1483
|
let n = e.byteLength;
|
|
@@ -1515,19 +1515,19 @@ const rr = (e) => {
|
|
|
1515
1515
|
return new ReadableStream({
|
|
1516
1516
|
async pull(d) {
|
|
1517
1517
|
try {
|
|
1518
|
-
const { done:
|
|
1519
|
-
if (
|
|
1518
|
+
const { done: c, value: u } = await s.next();
|
|
1519
|
+
if (c) {
|
|
1520
1520
|
l(), d.close();
|
|
1521
1521
|
return;
|
|
1522
1522
|
}
|
|
1523
|
-
let
|
|
1523
|
+
let h = u.byteLength;
|
|
1524
1524
|
if (n) {
|
|
1525
|
-
let y = o +=
|
|
1525
|
+
let y = o += h;
|
|
1526
1526
|
n(y);
|
|
1527
1527
|
}
|
|
1528
|
-
d.enqueue(new Uint8Array(
|
|
1529
|
-
} catch (
|
|
1530
|
-
throw l(
|
|
1528
|
+
d.enqueue(new Uint8Array(u));
|
|
1529
|
+
} catch (c) {
|
|
1530
|
+
throw l(c), c;
|
|
1531
1531
|
}
|
|
1532
1532
|
},
|
|
1533
1533
|
cancel(d) {
|
|
@@ -1552,12 +1552,12 @@ const rr = (e) => {
|
|
|
1552
1552
|
}
|
|
1553
1553
|
}).headers.has("Content-Type");
|
|
1554
1554
|
return e && !t;
|
|
1555
|
-
}), an = 64 * 1024,
|
|
1556
|
-
stream:
|
|
1555
|
+
}), an = 64 * 1024, pt = sr && or(() => f.isReadableStream(new Response("").body)), Be = {
|
|
1556
|
+
stream: pt && ((e) => e.body)
|
|
1557
1557
|
};
|
|
1558
1558
|
ze && ((e) => {
|
|
1559
1559
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
1560
|
-
!Be[t] && (Be[t] =
|
|
1560
|
+
!Be[t] && (Be[t] = f.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
|
|
1561
1561
|
throw new C(`Response type '${t}' is not supported`, C.ERR_NOT_SUPPORT, r);
|
|
1562
1562
|
});
|
|
1563
1563
|
});
|
|
@@ -1565,19 +1565,19 @@ ze && ((e) => {
|
|
|
1565
1565
|
const Jo = async (e) => {
|
|
1566
1566
|
if (e == null)
|
|
1567
1567
|
return 0;
|
|
1568
|
-
if (
|
|
1568
|
+
if (f.isBlob(e))
|
|
1569
1569
|
return e.size;
|
|
1570
|
-
if (
|
|
1570
|
+
if (f.isSpecCompliantForm(e))
|
|
1571
1571
|
return (await new Request(j.origin, {
|
|
1572
1572
|
method: "POST",
|
|
1573
1573
|
body: e
|
|
1574
1574
|
}).arrayBuffer()).byteLength;
|
|
1575
|
-
if (
|
|
1575
|
+
if (f.isArrayBufferView(e) || f.isArrayBuffer(e))
|
|
1576
1576
|
return e.byteLength;
|
|
1577
|
-
if (
|
|
1577
|
+
if (f.isURLSearchParams(e) && (e = e + ""), f.isString(e))
|
|
1578
1578
|
return (await Ko(e)).byteLength;
|
|
1579
1579
|
}, Go = async (e, t) => {
|
|
1580
|
-
const n =
|
|
1580
|
+
const n = f.toFiniteNumber(e.getContentLength());
|
|
1581
1581
|
return n ?? Jo(t);
|
|
1582
1582
|
}, Zo = ze && (async (e) => {
|
|
1583
1583
|
let {
|
|
@@ -1589,25 +1589,25 @@ const Jo = async (e) => {
|
|
|
1589
1589
|
timeout: a,
|
|
1590
1590
|
onDownloadProgress: l,
|
|
1591
1591
|
onUploadProgress: d,
|
|
1592
|
-
responseType:
|
|
1593
|
-
headers:
|
|
1594
|
-
withCredentials:
|
|
1592
|
+
responseType: c,
|
|
1593
|
+
headers: u,
|
|
1594
|
+
withCredentials: h = "same-origin",
|
|
1595
1595
|
fetchOptions: y
|
|
1596
1596
|
} = rr(e);
|
|
1597
|
-
|
|
1597
|
+
c = c ? (c + "").toLowerCase() : "text";
|
|
1598
1598
|
let S = zo([s, o && o.toAbortSignal()], a), b;
|
|
1599
1599
|
const m = S && S.unsubscribe && (() => {
|
|
1600
1600
|
S.unsubscribe();
|
|
1601
1601
|
});
|
|
1602
1602
|
let g;
|
|
1603
1603
|
try {
|
|
1604
|
-
if (d && Yo && n !== "get" && n !== "head" && (g = await Go(
|
|
1604
|
+
if (d && Yo && n !== "get" && n !== "head" && (g = await Go(u, r)) !== 0) {
|
|
1605
1605
|
let O = new Request(t, {
|
|
1606
1606
|
method: "POST",
|
|
1607
1607
|
body: r,
|
|
1608
1608
|
duplex: "half"
|
|
1609
1609
|
}), R;
|
|
1610
|
-
if (
|
|
1610
|
+
if (f.isFormData(r) && (R = O.headers.get("content-type")) && u.setContentType(R), O.body) {
|
|
1611
1611
|
const [D, z] = nn(
|
|
1612
1612
|
g,
|
|
1613
1613
|
Fe(rn(d))
|
|
@@ -1615,25 +1615,25 @@ const Jo = async (e) => {
|
|
|
1615
1615
|
r = on(O.body, an, D, z);
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
1618
|
-
|
|
1618
|
+
f.isString(h) || (h = h ? "include" : "omit");
|
|
1619
1619
|
const x = "credentials" in Request.prototype;
|
|
1620
1620
|
b = new Request(t, {
|
|
1621
1621
|
...y,
|
|
1622
1622
|
signal: S,
|
|
1623
1623
|
method: n.toUpperCase(),
|
|
1624
|
-
headers:
|
|
1624
|
+
headers: u.normalize().toJSON(),
|
|
1625
1625
|
body: r,
|
|
1626
1626
|
duplex: "half",
|
|
1627
|
-
credentials: x ?
|
|
1627
|
+
credentials: x ? h : void 0
|
|
1628
1628
|
});
|
|
1629
1629
|
let A = await fetch(b);
|
|
1630
|
-
const E =
|
|
1631
|
-
if (
|
|
1630
|
+
const E = pt && (c === "stream" || c === "response");
|
|
1631
|
+
if (pt && (l || E && m)) {
|
|
1632
1632
|
const O = {};
|
|
1633
1633
|
["status", "statusText", "headers"].forEach((Ee) => {
|
|
1634
1634
|
O[Ee] = A[Ee];
|
|
1635
1635
|
});
|
|
1636
|
-
const R =
|
|
1636
|
+
const R = f.toFiniteNumber(A.headers.get("content-length")), [D, z] = l && nn(
|
|
1637
1637
|
R,
|
|
1638
1638
|
Fe(rn(l), !0)
|
|
1639
1639
|
) || [];
|
|
@@ -1644,8 +1644,8 @@ const Jo = async (e) => {
|
|
|
1644
1644
|
O
|
|
1645
1645
|
);
|
|
1646
1646
|
}
|
|
1647
|
-
|
|
1648
|
-
let P = await Be[
|
|
1647
|
+
c = c || "text";
|
|
1648
|
+
let P = await Be[f.findKey(Be, c) || "text"](A, e);
|
|
1649
1649
|
return !E && m && m(), await new Promise((O, R) => {
|
|
1650
1650
|
tr(O, R, {
|
|
1651
1651
|
data: P,
|
|
@@ -1669,7 +1669,7 @@ const Jo = async (e) => {
|
|
|
1669
1669
|
xhr: Ho,
|
|
1670
1670
|
fetch: Zo
|
|
1671
1671
|
};
|
|
1672
|
-
|
|
1672
|
+
f.forEach(mt, (e, t) => {
|
|
1673
1673
|
if (e) {
|
|
1674
1674
|
try {
|
|
1675
1675
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1678,9 +1678,9 @@ p.forEach(mt, (e, t) => {
|
|
|
1678
1678
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1679
1679
|
}
|
|
1680
1680
|
});
|
|
1681
|
-
const ln = (e) => `- ${e}`, Xo = (e) =>
|
|
1681
|
+
const ln = (e) => `- ${e}`, Xo = (e) => f.isFunction(e) || e === null || e === !1, ar = {
|
|
1682
1682
|
getAdapter: (e) => {
|
|
1683
|
-
e =
|
|
1683
|
+
e = f.isArray(e) ? e : [e];
|
|
1684
1684
|
const { length: t } = e;
|
|
1685
1685
|
let n, r;
|
|
1686
1686
|
const s = {};
|
|
@@ -1711,7 +1711,7 @@ const ln = (e) => `- ${e}`, Xo = (e) => p.isFunction(e) || e === null || e === !
|
|
|
1711
1711
|
};
|
|
1712
1712
|
function Qe(e) {
|
|
1713
1713
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1714
|
-
throw new
|
|
1714
|
+
throw new pe(null, e);
|
|
1715
1715
|
}
|
|
1716
1716
|
function cn(e) {
|
|
1717
1717
|
return Qe(e), e.headers = U.from(e.headers), e.data = Xe.call(
|
|
@@ -1816,17 +1816,17 @@ let le = class {
|
|
|
1816
1816
|
silentJSONParsing: ne.transitional(ne.boolean),
|
|
1817
1817
|
forcedJSONParsing: ne.transitional(ne.boolean),
|
|
1818
1818
|
clarifyTimeoutError: ne.transitional(ne.boolean)
|
|
1819
|
-
}, !1), s != null && (
|
|
1819
|
+
}, !1), s != null && (f.isFunction(s) ? n.paramsSerializer = {
|
|
1820
1820
|
serialize: s
|
|
1821
1821
|
} : gt.assertOptions(s, {
|
|
1822
1822
|
encode: ne.function,
|
|
1823
1823
|
serialize: ne.function
|
|
1824
1824
|
}, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1825
|
-
let a = o &&
|
|
1825
|
+
let a = o && f.merge(
|
|
1826
1826
|
o.common,
|
|
1827
1827
|
o[n.method]
|
|
1828
1828
|
);
|
|
1829
|
-
o &&
|
|
1829
|
+
o && f.forEach(
|
|
1830
1830
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1831
1831
|
(b) => {
|
|
1832
1832
|
delete o[b];
|
|
@@ -1837,21 +1837,21 @@ let le = class {
|
|
|
1837
1837
|
this.interceptors.request.forEach(function(m) {
|
|
1838
1838
|
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (d = d && m.synchronous, l.unshift(m.fulfilled, m.rejected));
|
|
1839
1839
|
});
|
|
1840
|
-
const
|
|
1840
|
+
const c = [];
|
|
1841
1841
|
this.interceptors.response.forEach(function(m) {
|
|
1842
|
-
|
|
1842
|
+
c.push(m.fulfilled, m.rejected);
|
|
1843
1843
|
});
|
|
1844
|
-
let
|
|
1844
|
+
let u, h = 0, y;
|
|
1845
1845
|
if (!d) {
|
|
1846
1846
|
const b = [cn.bind(this), void 0];
|
|
1847
|
-
for (b.unshift.apply(b, l), b.push.apply(b,
|
|
1848
|
-
|
|
1849
|
-
return
|
|
1847
|
+
for (b.unshift.apply(b, l), b.push.apply(b, c), y = b.length, u = Promise.resolve(n); h < y; )
|
|
1848
|
+
u = u.then(b[h++], b[h++]);
|
|
1849
|
+
return u;
|
|
1850
1850
|
}
|
|
1851
1851
|
y = l.length;
|
|
1852
1852
|
let S = n;
|
|
1853
|
-
for (
|
|
1854
|
-
const b = l[
|
|
1853
|
+
for (h = 0; h < y; ) {
|
|
1854
|
+
const b = l[h++], m = l[h++];
|
|
1855
1855
|
try {
|
|
1856
1856
|
S = b(S);
|
|
1857
1857
|
} catch (g) {
|
|
@@ -1860,13 +1860,13 @@ let le = class {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
1862
|
try {
|
|
1863
|
-
|
|
1863
|
+
u = cn.call(this, S);
|
|
1864
1864
|
} catch (b) {
|
|
1865
1865
|
return Promise.reject(b);
|
|
1866
1866
|
}
|
|
1867
|
-
for (
|
|
1868
|
-
|
|
1869
|
-
return
|
|
1867
|
+
for (h = 0, y = c.length; h < y; )
|
|
1868
|
+
u = u.then(c[h++], c[h++]);
|
|
1869
|
+
return u;
|
|
1870
1870
|
}
|
|
1871
1871
|
getUri(t) {
|
|
1872
1872
|
t = ue(this.defaults, t);
|
|
@@ -1874,7 +1874,7 @@ let le = class {
|
|
|
1874
1874
|
return Zn(n, t.params, t.paramsSerializer);
|
|
1875
1875
|
}
|
|
1876
1876
|
};
|
|
1877
|
-
|
|
1877
|
+
f.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1878
1878
|
le.prototype[t] = function(n, r) {
|
|
1879
1879
|
return this.request(ue(r || {}, {
|
|
1880
1880
|
method: t,
|
|
@@ -1883,7 +1883,7 @@ p.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1883
1883
|
}));
|
|
1884
1884
|
};
|
|
1885
1885
|
});
|
|
1886
|
-
|
|
1886
|
+
f.forEach(["post", "put", "patch"], function(t) {
|
|
1887
1887
|
function n(r) {
|
|
1888
1888
|
return function(o, a, l) {
|
|
1889
1889
|
return this.request(ue(l || {}, {
|
|
@@ -1922,7 +1922,7 @@ let ea = class lr {
|
|
|
1922
1922
|
r.unsubscribe(o);
|
|
1923
1923
|
}, a;
|
|
1924
1924
|
}, t(function(o, a, l) {
|
|
1925
|
-
r.reason || (r.reason = new
|
|
1925
|
+
r.reason || (r.reason = new pe(o, a, l), n(r.reason));
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
1928
1928
|
/**
|
|
@@ -1977,7 +1977,7 @@ function ta(e) {
|
|
|
1977
1977
|
};
|
|
1978
1978
|
}
|
|
1979
1979
|
function na(e) {
|
|
1980
|
-
return
|
|
1980
|
+
return f.isObject(e) && e.isAxiosError === !0;
|
|
1981
1981
|
}
|
|
1982
1982
|
const bt = {
|
|
1983
1983
|
Continue: 100,
|
|
@@ -2049,13 +2049,13 @@ Object.entries(bt).forEach(([e, t]) => {
|
|
|
2049
2049
|
});
|
|
2050
2050
|
function cr(e) {
|
|
2051
2051
|
const t = new le(e), n = Un(le.prototype.request, t);
|
|
2052
|
-
return
|
|
2052
|
+
return f.extend(n, le.prototype, t, { allOwnKeys: !0 }), f.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
2053
2053
|
return cr(ue(e, s));
|
|
2054
2054
|
}, n;
|
|
2055
2055
|
}
|
|
2056
2056
|
const F = cr(Ce);
|
|
2057
2057
|
F.Axios = le;
|
|
2058
|
-
F.CanceledError =
|
|
2058
|
+
F.CanceledError = pe;
|
|
2059
2059
|
F.CancelToken = ea;
|
|
2060
2060
|
F.isCancel = er;
|
|
2061
2061
|
F.VERSION = ir;
|
|
@@ -2069,7 +2069,7 @@ F.spread = ta;
|
|
|
2069
2069
|
F.isAxiosError = na;
|
|
2070
2070
|
F.mergeConfig = ue;
|
|
2071
2071
|
F.AxiosHeaders = U;
|
|
2072
|
-
F.formToJSON = (e) => Qn(
|
|
2072
|
+
F.formToJSON = (e) => Qn(f.isHTMLForm(e) ? new FormData(e) : e);
|
|
2073
2073
|
F.getAdapter = ar.getAdapter;
|
|
2074
2074
|
F.HttpStatusCode = bt;
|
|
2075
2075
|
F.default = F;
|
|
@@ -2103,29 +2103,29 @@ function ce(e) {
|
|
|
2103
2103
|
};
|
|
2104
2104
|
}
|
|
2105
2105
|
function jt() {
|
|
2106
|
-
return
|
|
2106
|
+
return p.useContext(Ft).notify;
|
|
2107
2107
|
}
|
|
2108
2108
|
function sa() {
|
|
2109
2109
|
const e = jt();
|
|
2110
|
-
return
|
|
2110
|
+
return p.useCallback((t) => {
|
|
2111
2111
|
ce(e)(t);
|
|
2112
2112
|
}, [e]);
|
|
2113
2113
|
}
|
|
2114
2114
|
const oa = ({ create: e = !1 }) => {
|
|
2115
|
-
const [t, n] =
|
|
2115
|
+
const [t, n] = p.useState(), { id: r } = wr(), { t: s } = L(), o = jt(), a = St(), l = te(), d = H("breakpoint", "md");
|
|
2116
2116
|
Bt(
|
|
2117
2117
|
t != null && t.exists ? s("Edit :model “:label“", { model: l.singular(), label: (t == null ? void 0 : t.getLabel()) || "..." }) : s("Create :model", { model: l.singular() })
|
|
2118
2118
|
), ks();
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2119
|
+
const c = T("cms").getComponent("Breadcrumbs");
|
|
2120
|
+
p.useEffect(() => {
|
|
2121
2121
|
e ? n(new l()) : l.find(r).then((S) => n(S ?? void 0));
|
|
2122
2122
|
}, [r, l, e]);
|
|
2123
|
-
const
|
|
2123
|
+
const u = p.useCallback(() => {
|
|
2124
2124
|
o(s(":model saved successfully", { model: l.singular() })), t != null && t.wasRecentlyCreated && a(`/${k.kebab(l.plural())}/${t.getKey()}`);
|
|
2125
|
-
}, [o, a, l, t, s]),
|
|
2126
|
-
return t ? /* @__PURE__ */ w(
|
|
2127
|
-
/* @__PURE__ */ i(
|
|
2128
|
-
|
|
2125
|
+
}, [o, a, l, t, s]), h = sa(), y = p.useMemo(() => T("cms").getModelFormProps(t), [t]);
|
|
2126
|
+
return t ? /* @__PURE__ */ w(X, { container: !0, children: [
|
|
2127
|
+
/* @__PURE__ */ i(X, { xs: 12, children: /* @__PURE__ */ i(
|
|
2128
|
+
c,
|
|
2129
2129
|
{
|
|
2130
2130
|
parts: [
|
|
2131
2131
|
{ name: l.plural(), href: "/" + k.kebab(l.plural()) },
|
|
@@ -2134,7 +2134,7 @@ const oa = ({ create: e = !1 }) => {
|
|
|
2134
2134
|
}
|
|
2135
2135
|
) }),
|
|
2136
2136
|
/* @__PURE__ */ i(
|
|
2137
|
-
|
|
2137
|
+
X,
|
|
2138
2138
|
{
|
|
2139
2139
|
xs: 12,
|
|
2140
2140
|
[d]: 6,
|
|
@@ -2144,8 +2144,8 @@ const oa = ({ create: e = !1 }) => {
|
|
|
2144
2144
|
submitText: "Save",
|
|
2145
2145
|
...y,
|
|
2146
2146
|
item: t,
|
|
2147
|
-
onSuccess:
|
|
2148
|
-
onError:
|
|
2147
|
+
onSuccess: u,
|
|
2148
|
+
onError: h
|
|
2149
2149
|
}
|
|
2150
2150
|
)
|
|
2151
2151
|
}
|
|
@@ -2155,46 +2155,46 @@ const oa = ({ create: e = !1 }) => {
|
|
|
2155
2155
|
function aa(e) {
|
|
2156
2156
|
const {
|
|
2157
2157
|
setDisplacement: t
|
|
2158
|
-
} =
|
|
2159
|
-
|
|
2158
|
+
} = p.useContext(Ft), n = Pt(), r = v(), s = n.spacing(r ? 3 : 1), o = e === !1 ? s : n.spacing(e);
|
|
2159
|
+
p.useEffect(() => (t(o), () => {
|
|
2160
2160
|
t(s);
|
|
2161
2161
|
}), [o, s, t]);
|
|
2162
2162
|
}
|
|
2163
2163
|
function ia() {
|
|
2164
|
-
return
|
|
2164
|
+
return p.useContext(jn).dialog;
|
|
2165
2165
|
}
|
|
2166
2166
|
function Ut() {
|
|
2167
2167
|
const e = St(), t = jt(), n = ia(), { t: r } = L(), { refresh: s } = Se();
|
|
2168
2168
|
return { navigate: e, notify: t, dialog: n, t: r, refresh: s };
|
|
2169
2169
|
}
|
|
2170
|
-
const la =
|
|
2170
|
+
const la = G(Rr)(({ theme: e }) => ({
|
|
2171
2171
|
position: "fixed",
|
|
2172
2172
|
bottom: e.spacing(2),
|
|
2173
2173
|
right: e.spacing(2)
|
|
2174
|
-
})), ca =
|
|
2174
|
+
})), ca = G(Pr)(({ theme: e }) => ({
|
|
2175
2175
|
position: "fixed",
|
|
2176
2176
|
bottom: e.spacing(2),
|
|
2177
2177
|
right: e.spacing(2)
|
|
2178
2178
|
})), ua = ({ variant: e = "default" }) => {
|
|
2179
|
-
const t = te(), n = v(), [r] = K(), s = r.get("tab") ?? "all", [o, a] =
|
|
2179
|
+
const t = te(), n = v(), [r] = K(), s = r.get("tab") ?? "all", [o, a] = p.useState(!1), l = p.useRef(null), [d, c] = p.useState(0), u = Ut(), h = p.useMemo(() => T("cms").getStaticActions(t, s), [t, s]);
|
|
2180
2180
|
if (aa(
|
|
2181
|
-
e === "fab" &&
|
|
2182
|
-
),
|
|
2181
|
+
e === "fab" && h.length > 0 ? n ? 12 : 10 : !1
|
|
2182
|
+
), h.length === 0)
|
|
2183
2183
|
return null;
|
|
2184
2184
|
const y = (m, g) => {
|
|
2185
|
-
|
|
2185
|
+
c(g), a(!1);
|
|
2186
2186
|
}, S = () => {
|
|
2187
2187
|
a((m) => !m);
|
|
2188
2188
|
}, b = (m) => {
|
|
2189
2189
|
l.current && l.current.contains(m.target) || a(!1);
|
|
2190
2190
|
};
|
|
2191
|
-
return e === "fab" ?
|
|
2191
|
+
return e === "fab" ? h.length === 1 ? Jt.createPortal(
|
|
2192
2192
|
/* @__PURE__ */ i(
|
|
2193
2193
|
la,
|
|
2194
2194
|
{
|
|
2195
2195
|
color: "primary",
|
|
2196
|
-
onClick: () =>
|
|
2197
|
-
children:
|
|
2196
|
+
onClick: () => h[0].callback(u),
|
|
2197
|
+
children: h[0].icon || h[0].label.charAt(0).toUpperCase()
|
|
2198
2198
|
}
|
|
2199
2199
|
),
|
|
2200
2200
|
document.body
|
|
@@ -2208,12 +2208,12 @@ const la = Z(Rr)(({ theme: e }) => ({
|
|
|
2208
2208
|
onClose: () => a(!1),
|
|
2209
2209
|
onOpen: () => a(!0),
|
|
2210
2210
|
open: o,
|
|
2211
|
-
children:
|
|
2211
|
+
children: h.map((m) => /* @__PURE__ */ i(
|
|
2212
2212
|
Fr,
|
|
2213
2213
|
{
|
|
2214
2214
|
icon: m.icon || m.label.charAt(0).toUpperCase(),
|
|
2215
2215
|
tooltipTitle: m.label,
|
|
2216
|
-
onClick: () => m.callback(
|
|
2216
|
+
onClick: () => m.callback(u)
|
|
2217
2217
|
},
|
|
2218
2218
|
m.label
|
|
2219
2219
|
))
|
|
@@ -2226,10 +2226,10 @@ const la = Z(Rr)(({ theme: e }) => ({
|
|
|
2226
2226
|
{
|
|
2227
2227
|
variant: "contained",
|
|
2228
2228
|
ref: l,
|
|
2229
|
-
"aria-label":
|
|
2229
|
+
"aria-label": h[d].label,
|
|
2230
2230
|
children: [
|
|
2231
|
-
/* @__PURE__ */ i(M, { onClick: () =>
|
|
2232
|
-
|
|
2231
|
+
/* @__PURE__ */ i(M, { onClick: () => h[d].callback(u), children: h[d].label }),
|
|
2232
|
+
h.length > 1 && /* @__PURE__ */ i(
|
|
2233
2233
|
M,
|
|
2234
2234
|
{
|
|
2235
2235
|
variant: "contained",
|
|
@@ -2259,7 +2259,7 @@ const la = Z(Rr)(({ theme: e }) => ({
|
|
|
2259
2259
|
style: {
|
|
2260
2260
|
transformOrigin: g === "bottom" ? "center top" : "center bottom"
|
|
2261
2261
|
},
|
|
2262
|
-
children: /* @__PURE__ */ i(Tt, { children: /* @__PURE__ */ i(Mr, { onClickAway: b, children: /* @__PURE__ */ i(Nr, { id: "split-button-menu", children:
|
|
2262
|
+
children: /* @__PURE__ */ i(Tt, { children: /* @__PURE__ */ i(Mr, { onClickAway: b, children: /* @__PURE__ */ i(Nr, { id: "split-button-menu", children: h.map((x, A) => /* @__PURE__ */ i(
|
|
2263
2263
|
oe,
|
|
2264
2264
|
{
|
|
2265
2265
|
selected: A === d,
|
|
@@ -2275,7 +2275,7 @@ const la = Z(Rr)(({ theme: e }) => ({
|
|
|
2275
2275
|
] });
|
|
2276
2276
|
};
|
|
2277
2277
|
function qt() {
|
|
2278
|
-
const { open: e, setOpen: t } =
|
|
2278
|
+
const { open: e, setOpen: t } = p.useContext(Z);
|
|
2279
2279
|
return {
|
|
2280
2280
|
open: e,
|
|
2281
2281
|
handleDrawerOpen: () => {
|
|
@@ -2290,19 +2290,19 @@ function qt() {
|
|
|
2290
2290
|
};
|
|
2291
2291
|
}
|
|
2292
2292
|
function ur() {
|
|
2293
|
-
const { currentPage: e } =
|
|
2293
|
+
const { currentPage: e } = p.useContext(Z);
|
|
2294
2294
|
return e;
|
|
2295
2295
|
}
|
|
2296
2296
|
function da() {
|
|
2297
|
-
const { showSearch: e } =
|
|
2297
|
+
const { showSearch: e } = p.useContext(Z);
|
|
2298
2298
|
return e;
|
|
2299
2299
|
}
|
|
2300
|
-
const fa = "data:image/png;base64,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",
|
|
2300
|
+
const fa = "data:image/png;base64,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", ha = "data:image/png;base64,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";
|
|
2301
2301
|
function dr() {
|
|
2302
|
-
const { showBackButton: e } =
|
|
2302
|
+
const { showBackButton: e } = p.useContext(Z);
|
|
2303
2303
|
return e;
|
|
2304
2304
|
}
|
|
2305
|
-
const
|
|
2305
|
+
const pa = G(
|
|
2306
2306
|
gn,
|
|
2307
2307
|
{ shouldForwardProp: (e) => !["open", "drawerWidth", "height"].includes(String(e)) }
|
|
2308
2308
|
)(({ theme: e, open: t, drawerWidth: n, height: r }) => ({
|
|
@@ -2320,15 +2320,15 @@ const ha = Z(
|
|
|
2320
2320
|
duration: e.transitions.duration.enteringScreen
|
|
2321
2321
|
})
|
|
2322
2322
|
}
|
|
2323
|
-
})), ma =
|
|
2323
|
+
})), ma = G(
|
|
2324
2324
|
gn,
|
|
2325
2325
|
{ shouldForwardProp: (e) => !["open", "drawerWidth", "height"].includes(String(e)) }
|
|
2326
2326
|
)(({ height: e }) => ({ height: e })), ga = ({ slots: e = {}, ...t }) => {
|
|
2327
|
-
const n = v(), r = Ie("(prefers-color-scheme: dark)"), s = n ?
|
|
2327
|
+
const n = v(), r = Ie("(prefers-color-scheme: dark)"), s = n ? pa : ma, {
|
|
2328
2328
|
["Layout.AppBar.MenuButton"]: o,
|
|
2329
2329
|
["Layout.SearchBar"]: a,
|
|
2330
2330
|
["Layout.BackButton"]: l
|
|
2331
|
-
} = T("cms").getComponents(), { open: d } = qt(),
|
|
2331
|
+
} = T("cms").getComponents(), { open: d } = qt(), c = da(), u = dr(), h = H("appBar.height"), y = H("drawer.width", 280), {
|
|
2332
2332
|
start: S = null,
|
|
2333
2333
|
//: title = config('app.name', document.title),
|
|
2334
2334
|
end: b = null
|
|
@@ -2337,12 +2337,12 @@ const ha = Z(
|
|
|
2337
2337
|
s,
|
|
2338
2338
|
{
|
|
2339
2339
|
open: d,
|
|
2340
|
-
height:
|
|
2340
|
+
height: h,
|
|
2341
2341
|
drawerWidth: y,
|
|
2342
2342
|
...t,
|
|
2343
2343
|
children: /* @__PURE__ */ w(jr, { children: [
|
|
2344
|
-
(n && !d || !n && !
|
|
2345
|
-
!n &&
|
|
2344
|
+
(n && !d || !n && !u) && /* @__PURE__ */ i(o, {}),
|
|
2345
|
+
!n && u && /* @__PURE__ */ i(l, {}),
|
|
2346
2346
|
n ? null : S,
|
|
2347
2347
|
/* @__PURE__ */ i(
|
|
2348
2348
|
$,
|
|
@@ -2361,17 +2361,17 @@ const ha = Z(
|
|
|
2361
2361
|
display: "flex",
|
|
2362
2362
|
alignItems: "center",
|
|
2363
2363
|
children: [
|
|
2364
|
-
|
|
2364
|
+
c && /* @__PURE__ */ i(a, {}),
|
|
2365
2365
|
b || /* @__PURE__ */ i(
|
|
2366
2366
|
Ur,
|
|
2367
2367
|
{
|
|
2368
|
-
src: r ? fa :
|
|
2368
|
+
src: r ? fa : ha,
|
|
2369
2369
|
alt: "Luminix",
|
|
2370
2370
|
variant: "square",
|
|
2371
2371
|
sx: {
|
|
2372
2372
|
width: 40,
|
|
2373
2373
|
height: 40,
|
|
2374
|
-
marginLeft:
|
|
2374
|
+
marginLeft: c ? 2 : 0
|
|
2375
2375
|
}
|
|
2376
2376
|
}
|
|
2377
2377
|
)
|
|
@@ -2411,7 +2411,7 @@ const dn = (e, t) => ({
|
|
|
2411
2411
|
overflowX: "hidden",
|
|
2412
2412
|
width: `calc(${e.spacing(9)} + 1px)`,
|
|
2413
2413
|
[e.breakpoints.up("sm")]: { width: `calc(${e.spacing(10)} + 1px)` }
|
|
2414
|
-
}), ya =
|
|
2414
|
+
}), ya = G(
|
|
2415
2415
|
bn,
|
|
2416
2416
|
{ shouldForwardProp: (e) => !["open", "width"].includes(String(e)) }
|
|
2417
2417
|
)(({ theme: e, open: t, width: n }) => ({
|
|
@@ -2426,10 +2426,10 @@ const dn = (e, t) => ({
|
|
|
2426
2426
|
...fn(e),
|
|
2427
2427
|
"& .MuiDrawer-paper": fn(e)
|
|
2428
2428
|
}
|
|
2429
|
-
})), wa =
|
|
2429
|
+
})), wa = G(
|
|
2430
2430
|
bn,
|
|
2431
2431
|
{ shouldForwardProp: (e) => e !== "width" }
|
|
2432
|
-
)(() => ({})), Sa =
|
|
2432
|
+
)(() => ({})), Sa = G("div")(({ theme: e }) => ({
|
|
2433
2433
|
display: "flex",
|
|
2434
2434
|
alignItems: "center",
|
|
2435
2435
|
justifyContent: "space-between",
|
|
@@ -2437,7 +2437,7 @@ const dn = (e, t) => ({
|
|
|
2437
2437
|
// necessary for content to be below app bar
|
|
2438
2438
|
...e.mixins.toolbar
|
|
2439
2439
|
})), Aa = (e) => {
|
|
2440
|
-
const t = Pt(), n = v(), { open: r, handleDrawerClose: s } = qt(), o = n ? ya : wa, a = H("drawer.width", 280), l = H("appBar.height"), d = T("cms").getComponent("RecursiveList"),
|
|
2440
|
+
const t = Pt(), n = v(), { open: r, handleDrawerClose: s } = qt(), o = n ? ya : wa, a = H("drawer.width", 280), l = H("appBar.height"), d = T("cms").getComponent("RecursiveList"), c = T("cms").getMenuItems();
|
|
2441
2441
|
return /* @__PURE__ */ w(
|
|
2442
2442
|
o,
|
|
2443
2443
|
{
|
|
@@ -2460,7 +2460,7 @@ const dn = (e, t) => ({
|
|
|
2460
2460
|
d,
|
|
2461
2461
|
{
|
|
2462
2462
|
collapsed: !r && n,
|
|
2463
|
-
items:
|
|
2463
|
+
items: c,
|
|
2464
2464
|
onClick: () => !n && s()
|
|
2465
2465
|
}
|
|
2466
2466
|
) })
|
|
@@ -2488,7 +2488,7 @@ const dn = (e, t) => ({
|
|
|
2488
2488
|
]
|
|
2489
2489
|
}
|
|
2490
2490
|
);
|
|
2491
|
-
}, _t =
|
|
2491
|
+
}, _t = p.createContext({
|
|
2492
2492
|
Model: null,
|
|
2493
2493
|
anchorEl: null,
|
|
2494
2494
|
setAnchorEl: () => {
|
|
@@ -2505,7 +2505,7 @@ const dn = (e, t) => ({
|
|
|
2505
2505
|
},
|
|
2506
2506
|
clearFilters: () => {
|
|
2507
2507
|
}
|
|
2508
|
-
}), me =
|
|
2508
|
+
}), me = p.createContext({
|
|
2509
2509
|
key: "",
|
|
2510
2510
|
type: "",
|
|
2511
2511
|
operator: "",
|
|
@@ -2526,12 +2526,12 @@ const dn = (e, t) => ({
|
|
|
2526
2526
|
if (!Array.isArray(e))
|
|
2527
2527
|
return e;
|
|
2528
2528
|
let t;
|
|
2529
|
-
return
|
|
2529
|
+
return ee.isEmpty(e) ? t = "" : t = e[0], t;
|
|
2530
2530
|
}, Ea = (e) => {
|
|
2531
2531
|
if (Array.isArray(e))
|
|
2532
2532
|
return e;
|
|
2533
2533
|
let t;
|
|
2534
|
-
return
|
|
2534
|
+
return ee.isEmpty(e) ? t = [] : t = [e, ""], t;
|
|
2535
2535
|
}, ka = async (e, t, n) => {
|
|
2536
2536
|
const r = e.getSchema().relations[t], s = ye().make(r.model), o = s.getSchema().primaryKey, a = [];
|
|
2537
2537
|
for (const l of n) {
|
|
@@ -2541,11 +2541,11 @@ const dn = (e, t) => ({
|
|
|
2541
2541
|
return a;
|
|
2542
2542
|
};
|
|
2543
2543
|
function Ta(e, t) {
|
|
2544
|
-
const n = T("filter"), { Model: r, setColumnsFilter: s } =
|
|
2544
|
+
const n = T("filter"), { Model: r, setColumnsFilter: s } = p.useContext(_t), [o, a] = p.useState(t.key), [l, d] = p.useState(t.operator), [c, u] = p.useState(t.type), [h, y] = p.useState(t.value), [S, b] = p.useState(t.nullable), [m, g] = p.useState(t.is_relation), x = p.useMemo(() => n.getFilterableColumns(r), [r]), A = (O) => () => {
|
|
2545
2545
|
s((R) => R.filter((D, z) => z !== O));
|
|
2546
2546
|
}, E = async (O) => {
|
|
2547
|
-
const R = O.target.value, D = x.find((
|
|
2548
|
-
Wt ? (d("relation"), y([])) : m && d("equals"), g(Wt), b(Ee), z !==
|
|
2547
|
+
const R = O.target.value, D = x.find((pr) => pr.key === R), z = (D == null ? void 0 : D.type) ?? "text", Ee = (D == null ? void 0 : D.nullable) ?? !1, Wt = (D == null ? void 0 : D.is_relation) ?? !1;
|
|
2548
|
+
Wt ? (d("relation"), y([])) : m && d("equals"), g(Wt), b(Ee), z !== c && (d("equals"), y(() => {
|
|
2549
2549
|
if (["between", "notBetween"].includes(l))
|
|
2550
2550
|
return [];
|
|
2551
2551
|
switch (n.getInputType(z)) {
|
|
@@ -2556,7 +2556,7 @@ function Ta(e, t) {
|
|
|
2556
2556
|
default:
|
|
2557
2557
|
return "";
|
|
2558
2558
|
}
|
|
2559
|
-
})), a(R),
|
|
2559
|
+
})), a(R), u(z);
|
|
2560
2560
|
}, P = async (O) => {
|
|
2561
2561
|
const R = O.target.value;
|
|
2562
2562
|
l !== R && y((D) => {
|
|
@@ -2572,25 +2572,25 @@ function Ta(e, t) {
|
|
|
2572
2572
|
}
|
|
2573
2573
|
}), d(R);
|
|
2574
2574
|
};
|
|
2575
|
-
return
|
|
2575
|
+
return p.useEffect(() => {
|
|
2576
2576
|
s((O) => O.map((D, z) => e === z ? {
|
|
2577
2577
|
...D,
|
|
2578
2578
|
key: o,
|
|
2579
2579
|
operator: l,
|
|
2580
|
-
type:
|
|
2581
|
-
value:
|
|
2580
|
+
type: c,
|
|
2581
|
+
value: h,
|
|
2582
2582
|
nullable: S,
|
|
2583
2583
|
is_relation: m
|
|
2584
2584
|
} : D));
|
|
2585
|
-
}, [o, l,
|
|
2585
|
+
}, [o, l, c, h, S, m]), {
|
|
2586
2586
|
columns: x,
|
|
2587
2587
|
key: o,
|
|
2588
2588
|
setKey: a,
|
|
2589
2589
|
operator: l,
|
|
2590
2590
|
setOperator: d,
|
|
2591
|
-
type:
|
|
2592
|
-
setType:
|
|
2593
|
-
value:
|
|
2591
|
+
type: c,
|
|
2592
|
+
setType: u,
|
|
2593
|
+
value: h,
|
|
2594
2594
|
setValue: y,
|
|
2595
2595
|
nullable: S,
|
|
2596
2596
|
setNullable: b,
|
|
@@ -2601,8 +2601,8 @@ function Ta(e, t) {
|
|
|
2601
2601
|
handleRemoveColumn: A
|
|
2602
2602
|
};
|
|
2603
2603
|
}
|
|
2604
|
-
const
|
|
2605
|
-
const r = e.getSchema().relations[t].model, { data: s } = await ye().make(r).get(), o = s.all().filter((
|
|
2604
|
+
const hn = async (e, t, n) => {
|
|
2605
|
+
const r = e.getSchema().relations[t].model, { data: s } = await ye().make(r).get(), o = s.all().filter((c) => !n.find((u) => u.getKey() === c.getKey())), a = o.length, l = n.length, d = 15;
|
|
2606
2606
|
return a + l > d ? W([...n, ...o.slice(0, d - l)]) : W([...n, ...o]);
|
|
2607
2607
|
}, Da = async (e, t, n = "", r) => {
|
|
2608
2608
|
const s = e.getSchema().relations[t], o = ye().make(s.model), a = o.getSchema().primaryKey, { data: l } = await o.searchBy(n).get();
|
|
@@ -2612,23 +2612,23 @@ const pn = async (e, t, n) => {
|
|
|
2612
2612
|
key: n,
|
|
2613
2613
|
value: r,
|
|
2614
2614
|
setValue: s
|
|
2615
|
-
} =
|
|
2616
|
-
() => o &&
|
|
2617
|
-
[o,
|
|
2615
|
+
} = p.useContext(me), [o, a] = p.useState(!1), [l, d] = p.useState(""), [c, u] = p.useState(W([])), [h, y] = p.useState([]), S = p.useMemo(
|
|
2616
|
+
() => o && c.count() === 0,
|
|
2617
|
+
[o, c]
|
|
2618
2618
|
), b = async (m, g) => {
|
|
2619
|
-
d(g),
|
|
2619
|
+
d(g), ee.isEmpty(g) || u(await Da(t, n, g, W(h)));
|
|
2620
2620
|
};
|
|
2621
|
-
return
|
|
2621
|
+
return p.useEffect(() => {
|
|
2622
2622
|
r.length > 0 && (async () => y(await ka(t, n, r)))();
|
|
2623
|
-
}, []),
|
|
2623
|
+
}, []), p.useEffect(() => {
|
|
2624
2624
|
let m = !0;
|
|
2625
2625
|
if (S)
|
|
2626
|
-
return (async () => m &&
|
|
2626
|
+
return (async () => m && u(await hn(t, n, h)))(), () => {
|
|
2627
2627
|
m = !1;
|
|
2628
2628
|
};
|
|
2629
|
-
}, [S]),
|
|
2630
|
-
s(
|
|
2631
|
-
}, [
|
|
2629
|
+
}, [S]), p.useEffect(() => {
|
|
2630
|
+
s(h.map((m) => m.getKey())), ee.isEmpty(l) ? (async () => u(await hn(t, n, h)))() : u(W([]));
|
|
2631
|
+
}, [h]), /* @__PURE__ */ i(
|
|
2632
2632
|
qr,
|
|
2633
2633
|
{
|
|
2634
2634
|
sx: { width: e ? 377 : "100%" },
|
|
@@ -2639,13 +2639,13 @@ const pn = async (e, t, n) => {
|
|
|
2639
2639
|
onClose: () => {
|
|
2640
2640
|
a(!1);
|
|
2641
2641
|
},
|
|
2642
|
-
value:
|
|
2642
|
+
value: h,
|
|
2643
2643
|
onChange: (m, g) => {
|
|
2644
2644
|
y(g);
|
|
2645
2645
|
},
|
|
2646
2646
|
inputValue: l,
|
|
2647
2647
|
onInputChange: b,
|
|
2648
|
-
options:
|
|
2648
|
+
options: c.all() || [],
|
|
2649
2649
|
getOptionLabel: (m) => m.getLabel(),
|
|
2650
2650
|
isOptionEqualToValue: (m, g) => m.getKey() === g.getKey(),
|
|
2651
2651
|
filterOptions: (m) => m,
|
|
@@ -2672,7 +2672,7 @@ const pn = async (e, t, n) => {
|
|
|
2672
2672
|
label: n("Value"),
|
|
2673
2673
|
InputProps: {
|
|
2674
2674
|
...e.InputProps,
|
|
2675
|
-
endAdornment: /* @__PURE__ */ w(
|
|
2675
|
+
endAdornment: /* @__PURE__ */ w(p.Fragment, { children: [
|
|
2676
2676
|
t ? /* @__PURE__ */ i(_r, { color: "inherit", size: 20 }) : null,
|
|
2677
2677
|
e.InputProps.endAdornment
|
|
2678
2678
|
] })
|
|
@@ -2684,10 +2684,10 @@ const pn = async (e, t, n) => {
|
|
|
2684
2684
|
type: s,
|
|
2685
2685
|
value: o,
|
|
2686
2686
|
setValue: a
|
|
2687
|
-
} =
|
|
2687
|
+
} = p.useContext(me), d = r.getInputType(s) === "datetime-local" ? 230 : 167.5, c = e !== null ? `${t("Date")} ${e + 1}` : `${t("Date")}`, u = p.useMemo(
|
|
2688
2688
|
() => e !== null ? o[e] : o,
|
|
2689
2689
|
[o]
|
|
2690
|
-
),
|
|
2690
|
+
), h = (y) => {
|
|
2691
2691
|
a(typeof e == "number" ? (S) => {
|
|
2692
2692
|
const b = S;
|
|
2693
2693
|
return b[e] = y.target.value, [...b];
|
|
@@ -2697,15 +2697,15 @@ const pn = async (e, t, n) => {
|
|
|
2697
2697
|
Ae,
|
|
2698
2698
|
{
|
|
2699
2699
|
type: r.getInputType(s),
|
|
2700
|
-
label:
|
|
2701
|
-
value:
|
|
2702
|
-
onChange:
|
|
2700
|
+
label: c,
|
|
2701
|
+
value: u || /* @__PURE__ */ new Date(),
|
|
2702
|
+
onChange: h,
|
|
2703
2703
|
size: "small",
|
|
2704
2704
|
sx: { width: n ? d : "100%" }
|
|
2705
2705
|
}
|
|
2706
2706
|
);
|
|
2707
2707
|
}, Pa = () => {
|
|
2708
|
-
const e = v(), { value: t, setValue: n } =
|
|
2708
|
+
const e = v(), { value: t, setValue: n } = p.useContext(me);
|
|
2709
2709
|
return /* @__PURE__ */ w(B, { children: [
|
|
2710
2710
|
/* @__PURE__ */ i(
|
|
2711
2711
|
Hr,
|
|
@@ -2726,14 +2726,14 @@ const pn = async (e, t, n) => {
|
|
|
2726
2726
|
type: s,
|
|
2727
2727
|
value: o,
|
|
2728
2728
|
setValue: a
|
|
2729
|
-
} =
|
|
2729
|
+
} = p.useContext(me), l = e !== null ? `${t("Value")} ${e + 1}` : `${t("Value")}`, d = p.useMemo(
|
|
2730
2730
|
() => e !== null ? o[e] : o,
|
|
2731
2731
|
[o]
|
|
2732
|
-
),
|
|
2733
|
-
a(typeof e == "number" ? (
|
|
2734
|
-
const y =
|
|
2735
|
-
return y[e] =
|
|
2736
|
-
} :
|
|
2732
|
+
), c = (u) => {
|
|
2733
|
+
a(typeof e == "number" ? (h) => {
|
|
2734
|
+
const y = h;
|
|
2735
|
+
return y[e] = u.target.value, [...y];
|
|
2736
|
+
} : u.target.value);
|
|
2737
2737
|
};
|
|
2738
2738
|
return /* @__PURE__ */ i(
|
|
2739
2739
|
Ae,
|
|
@@ -2741,13 +2741,13 @@ const pn = async (e, t, n) => {
|
|
|
2741
2741
|
type: r.getInputType(s),
|
|
2742
2742
|
label: l,
|
|
2743
2743
|
value: d || "",
|
|
2744
|
-
onChange:
|
|
2744
|
+
onChange: c,
|
|
2745
2745
|
sx: { width: n ? 167.5 : "100%" },
|
|
2746
2746
|
size: "small"
|
|
2747
2747
|
}
|
|
2748
2748
|
);
|
|
2749
2749
|
}, nt = () => {
|
|
2750
|
-
const e = v(), t = T("filter"), { type: n, operator: r } =
|
|
2750
|
+
const e = v(), t = T("filter"), { type: n, operator: r } = p.useContext(me), s = p.useMemo(
|
|
2751
2751
|
() => ["between", "notBetween"].includes(r),
|
|
2752
2752
|
[r]
|
|
2753
2753
|
);
|
|
@@ -2779,12 +2779,12 @@ const pn = async (e, t, n) => {
|
|
|
2779
2779
|
return /* @__PURE__ */ i(tt, {});
|
|
2780
2780
|
}
|
|
2781
2781
|
}, va = ({ index: e, column: t }) => {
|
|
2782
|
-
const { t: n } = L(), r = v(), s = H("breakpoint", "md"), o = T("filter"), a =
|
|
2782
|
+
const { t: n } = L(), r = v(), s = H("breakpoint", "md"), o = T("filter"), a = p.useMemo(() => o.getMatchingOperators(t), [t]), {
|
|
2783
2783
|
columns: l,
|
|
2784
2784
|
key: d,
|
|
2785
|
-
setKey:
|
|
2786
|
-
operator:
|
|
2787
|
-
setOperator:
|
|
2785
|
+
setKey: c,
|
|
2786
|
+
operator: u,
|
|
2787
|
+
setOperator: h,
|
|
2788
2788
|
type: y,
|
|
2789
2789
|
setType: S,
|
|
2790
2790
|
value: b,
|
|
@@ -2800,18 +2800,18 @@ const pn = async (e, t, n) => {
|
|
|
2800
2800
|
{
|
|
2801
2801
|
value: {
|
|
2802
2802
|
key: d,
|
|
2803
|
-
setKey:
|
|
2803
|
+
setKey: c,
|
|
2804
2804
|
type: y,
|
|
2805
2805
|
setType: S,
|
|
2806
|
-
operator:
|
|
2807
|
-
setOperator:
|
|
2806
|
+
operator: u,
|
|
2807
|
+
setOperator: h,
|
|
2808
2808
|
value: b,
|
|
2809
2809
|
setValue: m,
|
|
2810
2810
|
isRelation: g,
|
|
2811
2811
|
setIsRelation: x
|
|
2812
2812
|
},
|
|
2813
2813
|
children: /* @__PURE__ */ w(
|
|
2814
|
-
|
|
2814
|
+
X,
|
|
2815
2815
|
{
|
|
2816
2816
|
container: !0,
|
|
2817
2817
|
display: "flex",
|
|
@@ -2916,7 +2916,7 @@ const pn = async (e, t, n) => {
|
|
|
2916
2916
|
{
|
|
2917
2917
|
labelId: "filter-operator-select-label",
|
|
2918
2918
|
id: "filter-operator-select",
|
|
2919
|
-
value:
|
|
2919
|
+
value: u,
|
|
2920
2920
|
label: n("Operator"),
|
|
2921
2921
|
onChange: E,
|
|
2922
2922
|
size: "small",
|
|
@@ -2949,15 +2949,15 @@ const pn = async (e, t, n) => {
|
|
|
2949
2949
|
)
|
|
2950
2950
|
}
|
|
2951
2951
|
);
|
|
2952
|
-
},
|
|
2952
|
+
}, pn = ({ dialog: e = !1 }) => {
|
|
2953
2953
|
const { t } = L(), n = v(), r = H("breakpoint", "md"), s = T("filter"), {
|
|
2954
2954
|
columnsFilter: o,
|
|
2955
2955
|
setColumnsFilter: a,
|
|
2956
2956
|
handleApplyFilters: l,
|
|
2957
2957
|
clearFilters: d
|
|
2958
|
-
} =
|
|
2959
|
-
a((
|
|
2960
|
-
...
|
|
2958
|
+
} = p.useContext(_t), c = () => {
|
|
2959
|
+
a((u) => [
|
|
2960
|
+
...u,
|
|
2961
2961
|
{
|
|
2962
2962
|
key: "",
|
|
2963
2963
|
operator: "equals",
|
|
@@ -2977,16 +2977,16 @@ const pn = async (e, t, n) => {
|
|
|
2977
2977
|
p: e ? 0 : 2
|
|
2978
2978
|
},
|
|
2979
2979
|
children: [
|
|
2980
|
-
/* @__PURE__ */ i(N, { children: o.map((
|
|
2981
|
-
const S =
|
|
2980
|
+
/* @__PURE__ */ i(N, { children: o.map((u, h, y) => {
|
|
2981
|
+
const S = h == y.length - 1;
|
|
2982
2982
|
return /* @__PURE__ */ w(B, { children: [
|
|
2983
2983
|
/* @__PURE__ */ i(
|
|
2984
2984
|
va,
|
|
2985
2985
|
{
|
|
2986
|
-
index:
|
|
2987
|
-
column:
|
|
2986
|
+
index: h,
|
|
2987
|
+
column: u
|
|
2988
2988
|
},
|
|
2989
|
-
`row_${
|
|
2989
|
+
`row_${u.key}`
|
|
2990
2990
|
),
|
|
2991
2991
|
!n && /* @__PURE__ */ i(Pe, { sx: {
|
|
2992
2992
|
mt: S ? 0.625 : 1.25,
|
|
@@ -3007,7 +3007,7 @@ const pn = async (e, t, n) => {
|
|
|
3007
3007
|
M,
|
|
3008
3008
|
{
|
|
3009
3009
|
variant: "outlined",
|
|
3010
|
-
onClick:
|
|
3010
|
+
onClick: c,
|
|
3011
3011
|
fullWidth: !0,
|
|
3012
3012
|
sx: { mt: 0.75 },
|
|
3013
3013
|
children: `+ ${t("Add Column")}`
|
|
@@ -3015,7 +3015,7 @@ const pn = async (e, t, n) => {
|
|
|
3015
3015
|
) : /* @__PURE__ */ i(
|
|
3016
3016
|
q,
|
|
3017
3017
|
{
|
|
3018
|
-
onClick:
|
|
3018
|
+
onClick: c,
|
|
3019
3019
|
color: "primary",
|
|
3020
3020
|
sx: { fontSize: 32 },
|
|
3021
3021
|
children: /* @__PURE__ */ i(En, { fontSize: "inherit" })
|
|
@@ -3046,85 +3046,77 @@ const pn = async (e, t, n) => {
|
|
|
3046
3046
|
]
|
|
3047
3047
|
}
|
|
3048
3048
|
);
|
|
3049
|
-
}
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
o.push({
|
|
3081
|
-
key: u.key,
|
|
3082
|
-
operator: c,
|
|
3083
|
-
type: u.type,
|
|
3084
|
-
value: f,
|
|
3085
|
-
nullable: u.nullable,
|
|
3086
|
-
is_relation: u.is_relation
|
|
3087
|
-
});
|
|
3088
|
-
});
|
|
3049
|
+
};
|
|
3050
|
+
function Fa(e, t) {
|
|
3051
|
+
const n = [], r = Ln.toObject(t);
|
|
3052
|
+
return !("where" in r) || ee.isEmpty(r.where) ? [] : (Object.entries(r.where).forEach(([s, o]) => {
|
|
3053
|
+
let [a, l = "equals"] = s.split(":");
|
|
3054
|
+
const d = e.find((u) => u.key === a);
|
|
3055
|
+
if (!d)
|
|
3056
|
+
return;
|
|
3057
|
+
l === "equals" && d.is_relation && (l = "relation");
|
|
3058
|
+
let c = o;
|
|
3059
|
+
switch (d.type) {
|
|
3060
|
+
case "text": {
|
|
3061
|
+
Array.isArray(o) && (c = o.join(","));
|
|
3062
|
+
break;
|
|
3063
|
+
}
|
|
3064
|
+
case "datetime-local": {
|
|
3065
|
+
Array.isArray(o) ? c = o.map((u) => Yt.toDateTimeLocal(u)) : c = Yt.toDateTimeLocal(o);
|
|
3066
|
+
break;
|
|
3067
|
+
}
|
|
3068
|
+
case "boolean": {
|
|
3069
|
+
c = Number(o);
|
|
3070
|
+
break;
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
n.push({
|
|
3074
|
+
key: d.key,
|
|
3075
|
+
operator: l,
|
|
3076
|
+
type: d.type,
|
|
3077
|
+
value: c,
|
|
3078
|
+
nullable: d.nullable,
|
|
3079
|
+
is_relation: d.is_relation
|
|
3089
3080
|
});
|
|
3090
|
-
}),
|
|
3091
|
-
}
|
|
3081
|
+
}), n);
|
|
3082
|
+
}
|
|
3083
|
+
const Ba = (e) => {
|
|
3092
3084
|
const t = T("filter"), n = new URLSearchParams();
|
|
3093
3085
|
return e.forEach((r) => {
|
|
3094
3086
|
const { key: s, operator: o, value: a, type: l } = r;
|
|
3095
|
-
let d = o
|
|
3096
|
-
if (["equals"].includes(
|
|
3097
|
-
a.forEach((
|
|
3098
|
-
let
|
|
3087
|
+
let d = `:${o}`;
|
|
3088
|
+
if (["equals"].includes(o) && (d = ""), Array.isArray(a))
|
|
3089
|
+
a.forEach((c, u) => {
|
|
3090
|
+
let h = c;
|
|
3099
3091
|
switch (t.getInputType(l)) {
|
|
3100
3092
|
case "datetime-local": {
|
|
3101
|
-
|
|
3093
|
+
h = new Date(c).toISOString();
|
|
3102
3094
|
break;
|
|
3103
3095
|
}
|
|
3104
3096
|
}
|
|
3105
|
-
n.set(`where[${
|
|
3097
|
+
n.set(`where[${s}${d}][${u}]`, h);
|
|
3106
3098
|
});
|
|
3107
3099
|
else {
|
|
3108
|
-
let
|
|
3100
|
+
let c = a;
|
|
3109
3101
|
switch (t.getInputType(l)) {
|
|
3110
3102
|
case "datetime-local": {
|
|
3111
|
-
|
|
3103
|
+
c = new Date(a).toISOString();
|
|
3112
3104
|
break;
|
|
3113
3105
|
}
|
|
3114
3106
|
}
|
|
3115
|
-
n.set(`where[${
|
|
3107
|
+
n.set(`where[${s}${d}]`, c);
|
|
3116
3108
|
}
|
|
3117
3109
|
}), n;
|
|
3118
3110
|
}, La = () => {
|
|
3119
|
-
const { t: e } = L(), t = T("filter"), n = v(), r = te(), [s, o] = K(), a =
|
|
3111
|
+
const { t: e } = L(), t = T("filter"), n = v(), r = te(), [s, o] = K(), a = p.useMemo(() => "where" in Ln.toObject(s), [s]), [l, d] = p.useState(null), [c, u] = p.useState([]), h = !!l, y = p.useMemo(() => t.getFilterableColumns(r), [r]), S = (A) => {
|
|
3120
3112
|
d(A.currentTarget);
|
|
3121
3113
|
}, b = () => {
|
|
3122
3114
|
d(null), setTimeout(() => {
|
|
3123
|
-
|
|
3115
|
+
u([]);
|
|
3124
3116
|
}, 300);
|
|
3125
3117
|
}, m = () => {
|
|
3126
3118
|
g();
|
|
3127
|
-
const A = Ba(
|
|
3119
|
+
const A = Ba(c);
|
|
3128
3120
|
o(A, { replace: !0 }), b();
|
|
3129
3121
|
}, g = () => {
|
|
3130
3122
|
o((A) => {
|
|
@@ -3135,12 +3127,12 @@ const pn = async (e, t, n) => {
|
|
|
3135
3127
|
});
|
|
3136
3128
|
}, x = () => {
|
|
3137
3129
|
g(), b(), setTimeout(() => {
|
|
3138
|
-
|
|
3130
|
+
u([]);
|
|
3139
3131
|
}, 300);
|
|
3140
3132
|
};
|
|
3141
|
-
return
|
|
3133
|
+
return p.useEffect(() => {
|
|
3142
3134
|
const A = Fa(y, s);
|
|
3143
|
-
|
|
3135
|
+
u(A);
|
|
3144
3136
|
}, [y, s, l]), /* @__PURE__ */ w(
|
|
3145
3137
|
_t.Provider,
|
|
3146
3138
|
{
|
|
@@ -3148,8 +3140,8 @@ const pn = async (e, t, n) => {
|
|
|
3148
3140
|
Model: r,
|
|
3149
3141
|
anchorEl: l,
|
|
3150
3142
|
setAnchorEl: d,
|
|
3151
|
-
columnsFilter:
|
|
3152
|
-
setColumnsFilter:
|
|
3143
|
+
columnsFilter: c,
|
|
3144
|
+
setColumnsFilter: u,
|
|
3153
3145
|
searchParams: s,
|
|
3154
3146
|
setSearchParams: o,
|
|
3155
3147
|
handleApplyFilters: m,
|
|
@@ -3178,19 +3170,19 @@ const pn = async (e, t, n) => {
|
|
|
3178
3170
|
zr,
|
|
3179
3171
|
{
|
|
3180
3172
|
id: "model-filter-popover",
|
|
3181
|
-
open:
|
|
3173
|
+
open: h,
|
|
3182
3174
|
anchorEl: l,
|
|
3183
3175
|
onClose: b,
|
|
3184
3176
|
anchorOrigin: {
|
|
3185
3177
|
vertical: "bottom",
|
|
3186
3178
|
horizontal: "left"
|
|
3187
3179
|
},
|
|
3188
|
-
children: /* @__PURE__ */ i(
|
|
3180
|
+
children: /* @__PURE__ */ i(pn, {})
|
|
3189
3181
|
}
|
|
3190
3182
|
) : /* @__PURE__ */ w(
|
|
3191
3183
|
xt,
|
|
3192
3184
|
{
|
|
3193
|
-
open:
|
|
3185
|
+
open: h,
|
|
3194
3186
|
onClose: b,
|
|
3195
3187
|
fullWidth: !0,
|
|
3196
3188
|
children: [
|
|
@@ -3205,7 +3197,7 @@ const pn = async (e, t, n) => {
|
|
|
3205
3197
|
}
|
|
3206
3198
|
)
|
|
3207
3199
|
] }),
|
|
3208
|
-
/* @__PURE__ */ i(Et, { dividers: !0, children: /* @__PURE__ */ i(
|
|
3200
|
+
/* @__PURE__ */ i(Et, { dividers: !0, children: /* @__PURE__ */ i(pn, { dialog: !0 }) }),
|
|
3209
3201
|
/* @__PURE__ */ w(kt, { children: [
|
|
3210
3202
|
/* @__PURE__ */ i(
|
|
3211
3203
|
M,
|
|
@@ -3220,7 +3212,7 @@ const pn = async (e, t, n) => {
|
|
|
3220
3212
|
{
|
|
3221
3213
|
variant: "contained",
|
|
3222
3214
|
onClick: m,
|
|
3223
|
-
disabled: t.checkIfCanApplyFilters(
|
|
3215
|
+
disabled: t.checkIfCanApplyFilters(c),
|
|
3224
3216
|
children: e("Apply")
|
|
3225
3217
|
}
|
|
3226
3218
|
)
|
|
@@ -3231,7 +3223,7 @@ const pn = async (e, t, n) => {
|
|
|
3231
3223
|
]
|
|
3232
3224
|
}
|
|
3233
3225
|
);
|
|
3234
|
-
}, Ht =
|
|
3226
|
+
}, Ht = p.createContext({
|
|
3235
3227
|
columns: [],
|
|
3236
3228
|
columnCount: 0,
|
|
3237
3229
|
selected: W([]),
|
|
@@ -3244,15 +3236,15 @@ function zt() {
|
|
|
3244
3236
|
const {
|
|
3245
3237
|
selected: e,
|
|
3246
3238
|
items: t
|
|
3247
|
-
} =
|
|
3239
|
+
} = p.useContext(Ht), n = mn(e), r = () => {
|
|
3248
3240
|
e.splice(0, e.count());
|
|
3249
|
-
}, s = (
|
|
3250
|
-
const
|
|
3251
|
-
if (
|
|
3252
|
-
e.pull(
|
|
3241
|
+
}, s = (c) => {
|
|
3242
|
+
const u = e.search(c);
|
|
3243
|
+
if (u !== !1) {
|
|
3244
|
+
e.pull(u);
|
|
3253
3245
|
return;
|
|
3254
3246
|
}
|
|
3255
|
-
e.push(
|
|
3247
|
+
e.push(c);
|
|
3256
3248
|
}, o = () => {
|
|
3257
3249
|
if (t) {
|
|
3258
3250
|
if (e.count() === t.count()) {
|
|
@@ -3261,7 +3253,7 @@ function zt() {
|
|
|
3261
3253
|
}
|
|
3262
3254
|
e.splice(0, e.count(), ...t);
|
|
3263
3255
|
}
|
|
3264
|
-
}, a = (
|
|
3256
|
+
}, a = (c) => n.contains(c), l = t ? n.count() > 0 && n.count() < t.count() : !1, d = t && t.count() ? n.count() === t.count() : !1;
|
|
3265
3257
|
return {
|
|
3266
3258
|
selected: n,
|
|
3267
3259
|
indeterminate: l,
|
|
@@ -3273,13 +3265,13 @@ function zt() {
|
|
|
3273
3265
|
};
|
|
3274
3266
|
}
|
|
3275
3267
|
function ae() {
|
|
3276
|
-
return
|
|
3268
|
+
return p.useContext(Ht);
|
|
3277
3269
|
}
|
|
3278
3270
|
function Ia(e) {
|
|
3279
|
-
const [t, n] =
|
|
3280
|
-
n(
|
|
3271
|
+
const [t, n] = p.useState(""), { selected: r } = zt(), { t: s } = L(), o = Ut(), { massActions: a } = ae(), l = (c) => {
|
|
3272
|
+
n(c.target.value);
|
|
3281
3273
|
};
|
|
3282
|
-
if (
|
|
3274
|
+
if (p.useEffect(() => {
|
|
3283
3275
|
r.isEmpty() && n("");
|
|
3284
3276
|
}, [r]), a.length === 0)
|
|
3285
3277
|
return null;
|
|
@@ -3309,13 +3301,13 @@ function Ia(e) {
|
|
|
3309
3301
|
disabled: r.isEmpty(),
|
|
3310
3302
|
children: [
|
|
3311
3303
|
/* @__PURE__ */ i(oe, { value: "", children: /* @__PURE__ */ i("em", { children: s("None") }) }),
|
|
3312
|
-
a.map((
|
|
3304
|
+
a.map((c) => /* @__PURE__ */ i(
|
|
3313
3305
|
oe,
|
|
3314
3306
|
{
|
|
3315
|
-
value:
|
|
3316
|
-
children:
|
|
3307
|
+
value: c.key,
|
|
3308
|
+
children: c.label
|
|
3317
3309
|
},
|
|
3318
|
-
|
|
3310
|
+
c.key
|
|
3319
3311
|
))
|
|
3320
3312
|
]
|
|
3321
3313
|
}
|
|
@@ -3329,8 +3321,8 @@ function Ia(e) {
|
|
|
3329
3321
|
size: "small",
|
|
3330
3322
|
disabled: r.isEmpty() || !t,
|
|
3331
3323
|
onClick: () => {
|
|
3332
|
-
var
|
|
3333
|
-
(
|
|
3324
|
+
var c;
|
|
3325
|
+
(c = a.find((u) => u.key === t)) == null || c.callback({
|
|
3334
3326
|
selected: r,
|
|
3335
3327
|
...o
|
|
3336
3328
|
});
|
|
@@ -3355,7 +3347,7 @@ const Ma = () => {
|
|
|
3355
3347
|
children: /* @__PURE__ */ i(Tn, {})
|
|
3356
3348
|
}
|
|
3357
3349
|
);
|
|
3358
|
-
}, We =
|
|
3350
|
+
}, We = p.forwardRef(({ to: e, children: t, ...n }, r) => /* @__PURE__ */ i(
|
|
3359
3351
|
it,
|
|
3360
3352
|
{
|
|
3361
3353
|
component: Re,
|
|
@@ -3373,22 +3365,22 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3373
3365
|
"Last »": /* @__PURE__ */ i(Dn, {}),
|
|
3374
3366
|
"« First": /* @__PURE__ */ i(On, {})
|
|
3375
3367
|
}[e] || e }) : /* @__PURE__ */ i(B, { children: e }), ja = ({ variant: e = "default", ...t }) => {
|
|
3376
|
-
const n = e === "default", [r, s] = K(), [o, a] =
|
|
3368
|
+
const n = e === "default", [r, s] = K(), [o, a] = p.useState(r.get("page") || "1"), {
|
|
3377
3369
|
links: l,
|
|
3378
3370
|
meta: {
|
|
3379
3371
|
current_page: d = 1,
|
|
3380
|
-
links:
|
|
3381
|
-
last_page:
|
|
3372
|
+
links: c = [],
|
|
3373
|
+
last_page: u = 1
|
|
3382
3374
|
} = {}
|
|
3383
3375
|
} = Se(), {
|
|
3384
|
-
first:
|
|
3376
|
+
first: h,
|
|
3385
3377
|
prev: y,
|
|
3386
3378
|
next: S,
|
|
3387
3379
|
last: b
|
|
3388
3380
|
} = l || {}, m = (x) => {
|
|
3389
3381
|
x.preventDefault(), s((A) => (A.set("page", o || "1"), A));
|
|
3390
3382
|
}, g = [
|
|
3391
|
-
{ url: d > 1 ?
|
|
3383
|
+
{ url: d > 1 ? h : null, label: "« First", active: !1 },
|
|
3392
3384
|
{ url: y, label: "« Previous", active: !1 },
|
|
3393
3385
|
{
|
|
3394
3386
|
element: /* @__PURE__ */ i(
|
|
@@ -3413,15 +3405,15 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3413
3405
|
}
|
|
3414
3406
|
},
|
|
3415
3407
|
value: o,
|
|
3416
|
-
error: Number(o) >
|
|
3417
|
-
helperText: Number(o) >
|
|
3408
|
+
error: Number(o) > u,
|
|
3409
|
+
helperText: Number(o) > u ? `Max ${u}` : void 0,
|
|
3418
3410
|
onChange: (x) => {
|
|
3419
3411
|
!Number.isNaN(Number(x.target.value)) && Number(x.target.value) > 0 && a(x.target.value), x.target.value === "" && a("");
|
|
3420
3412
|
},
|
|
3421
3413
|
onBlur: (x) => {
|
|
3422
3414
|
s((A) => (A.set("page", x.target.value || "1"), A), { replace: !0 });
|
|
3423
3415
|
},
|
|
3424
|
-
disabled:
|
|
3416
|
+
disabled: u === 1,
|
|
3425
3417
|
"aria-label": "Page number"
|
|
3426
3418
|
}
|
|
3427
3419
|
)
|
|
@@ -3430,9 +3422,9 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3430
3422
|
)
|
|
3431
3423
|
},
|
|
3432
3424
|
{ url: S, label: "Next »", active: !1 },
|
|
3433
|
-
{ url: d <
|
|
3425
|
+
{ url: d < u ? b : null, label: "Last »", active: !1 }
|
|
3434
3426
|
];
|
|
3435
|
-
return
|
|
3427
|
+
return p.useEffect(() => {
|
|
3436
3428
|
d && a(String(d));
|
|
3437
3429
|
}, [d]), /* @__PURE__ */ i(
|
|
3438
3430
|
N,
|
|
@@ -3442,7 +3434,7 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3442
3434
|
justifyContent: "center",
|
|
3443
3435
|
alignItems: "center",
|
|
3444
3436
|
...t,
|
|
3445
|
-
children: (n ?
|
|
3437
|
+
children: (n ? c : g).map((x, A) => x.element || /* @__PURE__ */ i(
|
|
3446
3438
|
M,
|
|
3447
3439
|
{
|
|
3448
3440
|
variant: x.active ? "contained" : "text",
|
|
@@ -3536,8 +3528,8 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3536
3528
|
);
|
|
3537
3529
|
};
|
|
3538
3530
|
function _a(e, t) {
|
|
3539
|
-
const [n, r] =
|
|
3540
|
-
return
|
|
3531
|
+
const [n, r] = p.useState(!1);
|
|
3532
|
+
return p.useEffect(() => {
|
|
3541
3533
|
const s = /* @__PURE__ */ new Set(), o = (l) => {
|
|
3542
3534
|
s.add(l.key), e.every((d) => s.has(d)) && (r(!0), t && t());
|
|
3543
3535
|
}, a = (l) => {
|
|
@@ -3548,7 +3540,7 @@ function _a(e, t) {
|
|
|
3548
3540
|
};
|
|
3549
3541
|
}, [e, t]), n;
|
|
3550
3542
|
}
|
|
3551
|
-
const Ha =
|
|
3543
|
+
const Ha = G(Ae)(({ theme: e }) => ({
|
|
3552
3544
|
"& .MuiInputBase-root": {
|
|
3553
3545
|
backgroundColor: e.palette.background.paper
|
|
3554
3546
|
}
|
|
@@ -3559,19 +3551,19 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3559
3551
|
return e ? r.set("q", e) : r.delete("q"), r;
|
|
3560
3552
|
});
|
|
3561
3553
|
}, 500), Wa = () => {
|
|
3562
|
-
const [e, t] = K(), n = e.get("q") || "", [r, s] =
|
|
3563
|
-
|
|
3554
|
+
const [e, t] = K(), n = e.get("q") || "", [r, s] = p.useState(n), [o, a] = p.useState(!1), l = p.useRef(null), { t: d } = L();
|
|
3555
|
+
p.useEffect(() => {
|
|
3564
3556
|
s(n);
|
|
3565
3557
|
}, [n]);
|
|
3566
|
-
const
|
|
3558
|
+
const c = (y) => {
|
|
3567
3559
|
s(y.target.value), za(y.target.value, t);
|
|
3568
|
-
},
|
|
3560
|
+
}, u = v();
|
|
3569
3561
|
_a(["Control", "/"], () => {
|
|
3570
3562
|
l.current.focus();
|
|
3571
3563
|
});
|
|
3572
|
-
const
|
|
3564
|
+
const h = u ? 300 : "calc(100vw - 58px)";
|
|
3573
3565
|
return /* @__PURE__ */ w(B, { children: [
|
|
3574
|
-
!
|
|
3566
|
+
!u && !o && /* @__PURE__ */ i(q, { color: "inherit", onClick: () => a(!0), children: /* @__PURE__ */ i(
|
|
3575
3567
|
Dt,
|
|
3576
3568
|
{
|
|
3577
3569
|
variant: "dot",
|
|
@@ -3588,16 +3580,16 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3588
3580
|
yn,
|
|
3589
3581
|
{
|
|
3590
3582
|
orientation: "horizontal",
|
|
3591
|
-
in:
|
|
3583
|
+
in: u || o,
|
|
3592
3584
|
addEndListener: () => {
|
|
3593
3585
|
var y;
|
|
3594
|
-
!
|
|
3586
|
+
!u && o && ((y = l.current) == null || y.focus());
|
|
3595
3587
|
},
|
|
3596
3588
|
unmountOnExit: !1,
|
|
3597
3589
|
children: /* @__PURE__ */ i(
|
|
3598
3590
|
Ha,
|
|
3599
3591
|
{
|
|
3600
|
-
placeholder:
|
|
3592
|
+
placeholder: u ? `(Ctrl + /) ${d("Search...")}` : `${d("Search...")}`,
|
|
3601
3593
|
value: r,
|
|
3602
3594
|
InputProps: {
|
|
3603
3595
|
endAdornment: /* @__PURE__ */ i(ct, {})
|
|
@@ -3605,9 +3597,9 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3605
3597
|
inputProps: {
|
|
3606
3598
|
ref: l
|
|
3607
3599
|
},
|
|
3608
|
-
onChange:
|
|
3600
|
+
onChange: c,
|
|
3609
3601
|
onBlur: () => a(!1),
|
|
3610
|
-
sx: { width:
|
|
3602
|
+
sx: { width: h },
|
|
3611
3603
|
size: "small"
|
|
3612
3604
|
}
|
|
3613
3605
|
)
|
|
@@ -3615,7 +3607,7 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3615
3607
|
)
|
|
3616
3608
|
] });
|
|
3617
3609
|
}, Va = ({ children: e, ...t }) => /* @__PURE__ */ i(
|
|
3618
|
-
|
|
3610
|
+
Q,
|
|
3619
3611
|
{
|
|
3620
3612
|
sx: { width: "1px" },
|
|
3621
3613
|
padding: "checkbox",
|
|
@@ -3626,24 +3618,24 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3626
3618
|
const { t: e } = L(), [t, n] = K(), {
|
|
3627
3619
|
columns: r,
|
|
3628
3620
|
Model: s
|
|
3629
|
-
} = ae(), o = t.get("order_by") || "", [a = "", l = ""] = o.split(":"), [d,
|
|
3621
|
+
} = ae(), o = t.get("order_by") || "", [a = "", l = ""] = o.split(":"), [d, c] = p.useState(a), [u, h] = p.useState(l), [y, S] = p.useState(!1), b = () => {
|
|
3630
3622
|
S(!0);
|
|
3631
3623
|
}, m = () => {
|
|
3632
|
-
S(!1),
|
|
3624
|
+
S(!1), c(a), h(l);
|
|
3633
3625
|
}, g = () => {
|
|
3634
|
-
if (!d || !
|
|
3626
|
+
if (!d || !u) {
|
|
3635
3627
|
S(!1);
|
|
3636
3628
|
return;
|
|
3637
3629
|
}
|
|
3638
3630
|
n((A) => {
|
|
3639
3631
|
const E = new URLSearchParams(A);
|
|
3640
|
-
return E.set("order_by", `${d}:${
|
|
3632
|
+
return E.set("order_by", `${d}:${u}`), E;
|
|
3641
3633
|
}), S(!1);
|
|
3642
3634
|
}, x = () => {
|
|
3643
3635
|
n((A) => {
|
|
3644
3636
|
const E = new URLSearchParams(A);
|
|
3645
3637
|
return E.delete("order_by"), E;
|
|
3646
|
-
}), S(!1),
|
|
3638
|
+
}), S(!1), c(""), h("");
|
|
3647
3639
|
};
|
|
3648
3640
|
return /* @__PURE__ */ w(B, { children: [
|
|
3649
3641
|
/* @__PURE__ */ i(q, { onClick: b, children: /* @__PURE__ */ i(
|
|
@@ -3673,7 +3665,7 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3673
3665
|
{
|
|
3674
3666
|
value: d,
|
|
3675
3667
|
onChange: (A) => {
|
|
3676
|
-
|
|
3668
|
+
c(A.target.value), u || h("asc");
|
|
3677
3669
|
},
|
|
3678
3670
|
children: [
|
|
3679
3671
|
/* @__PURE__ */ i($, { variant: "caption", children: e("Column") }),
|
|
@@ -3695,8 +3687,8 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3695
3687
|
/* @__PURE__ */ w(
|
|
3696
3688
|
Vt,
|
|
3697
3689
|
{
|
|
3698
|
-
value:
|
|
3699
|
-
onChange: (A) =>
|
|
3690
|
+
value: u,
|
|
3691
|
+
onChange: (A) => h(A.target.value),
|
|
3700
3692
|
children: [
|
|
3701
3693
|
/* @__PURE__ */ i(
|
|
3702
3694
|
$e,
|
|
@@ -3731,19 +3723,19 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3731
3723
|
] })
|
|
3732
3724
|
] });
|
|
3733
3725
|
}, Ka = ({ items: e, loading: t, children: n, error: r }) => {
|
|
3734
|
-
const s = te(), o =
|
|
3726
|
+
const s = te(), o = p.useMemo(() => W([]), [s, e]), [a] = K(), l = a.get("tab") ?? "all", d = p.useMemo(() => [
|
|
3735
3727
|
{
|
|
3736
3728
|
key: s.getSchema().labeledBy,
|
|
3737
3729
|
label: k.human(s.getSchema().labeledBy)
|
|
3738
3730
|
}
|
|
3739
|
-
], [s]),
|
|
3731
|
+
], [s]), c = v(), u = p.useMemo(() => T("cms").getMassActions(s, l), [s, l]), h = At(
|
|
3740
3732
|
T("cms"),
|
|
3741
3733
|
`model${k.studly(s.getSchemaName())}Columns`,
|
|
3742
3734
|
d
|
|
3743
|
-
), S = (
|
|
3744
|
-
columns:
|
|
3735
|
+
), S = (c ? h.length : 1) + (u.length > 0 ? 2 : 1), b = {
|
|
3736
|
+
columns: h,
|
|
3745
3737
|
columnCount: S,
|
|
3746
|
-
massActions:
|
|
3738
|
+
massActions: u,
|
|
3747
3739
|
items: e,
|
|
3748
3740
|
loading: t,
|
|
3749
3741
|
selected: o,
|
|
@@ -3772,10 +3764,10 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3772
3764
|
items: s
|
|
3773
3765
|
} = ae(), o = v(), [a, l] = K(), {
|
|
3774
3766
|
indeterminate: d,
|
|
3775
|
-
allSelected:
|
|
3776
|
-
handleSelectToggleAll:
|
|
3767
|
+
allSelected: c,
|
|
3768
|
+
handleSelectToggleAll: u
|
|
3777
3769
|
} = zt(), {
|
|
3778
|
-
["ModelIndex.Table.ShrinkedCell"]:
|
|
3770
|
+
["ModelIndex.Table.ShrinkedCell"]: h
|
|
3779
3771
|
} = T("cms").getComponents(), y = a.get("order_by") || "", [S, b] = y.split(":"), m = (g) => () => {
|
|
3780
3772
|
l(S === g ? (x) => {
|
|
3781
3773
|
const A = new URLSearchParams(x);
|
|
@@ -3788,17 +3780,17 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3788
3780
|
return /* @__PURE__ */ w($r, { ...t, children: [
|
|
3789
3781
|
e,
|
|
3790
3782
|
o && /* @__PURE__ */ w(fe, { children: [
|
|
3791
|
-
n.length > 0 && /* @__PURE__ */ i(
|
|
3783
|
+
n.length > 0 && /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
3792
3784
|
Ot,
|
|
3793
3785
|
{
|
|
3794
3786
|
indeterminate: d,
|
|
3795
|
-
checked:
|
|
3796
|
-
onChange:
|
|
3787
|
+
checked: c,
|
|
3788
|
+
onChange: u,
|
|
3797
3789
|
disabled: s && s.count() === 0
|
|
3798
3790
|
}
|
|
3799
3791
|
) }),
|
|
3800
3792
|
r.map(({ key: g, label: x, sortable: A = !0, ...E }) => /* @__PURE__ */ i(
|
|
3801
|
-
|
|
3793
|
+
Q,
|
|
3802
3794
|
{
|
|
3803
3795
|
sortDirection: A && S === g && b || !1,
|
|
3804
3796
|
...E,
|
|
@@ -3817,7 +3809,7 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3817
3809
|
},
|
|
3818
3810
|
g
|
|
3819
3811
|
)),
|
|
3820
|
-
/* @__PURE__ */ i(
|
|
3812
|
+
/* @__PURE__ */ i(h, {})
|
|
3821
3813
|
] })
|
|
3822
3814
|
] });
|
|
3823
3815
|
}, Ga = () => {
|
|
@@ -3829,21 +3821,21 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3829
3821
|
} = T("cms").getComponents(), [s] = K(), o = parseInt(s.get("per_page") || "15");
|
|
3830
3822
|
return /* @__PURE__ */ i(B, { children: Array.from({ length: o }).map((a, l) => /* @__PURE__ */ w(fe, { children: [
|
|
3831
3823
|
e.length > 0 && /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(Ot, {}) }),
|
|
3832
|
-
n && t.map(({ key: d, label:
|
|
3824
|
+
n && t.map(({ key: d, label: c, sortable: u, ...h }, y) => /* @__PURE__ */ i(Q, { ...h, children: /* @__PURE__ */ i(
|
|
3833
3825
|
$t,
|
|
3834
3826
|
{
|
|
3835
3827
|
variant: "text",
|
|
3836
3828
|
height: 24
|
|
3837
3829
|
}
|
|
3838
3830
|
) }, y)),
|
|
3839
|
-
!n && /* @__PURE__ */ i(
|
|
3831
|
+
!n && /* @__PURE__ */ i(Q, { sx: { px: 0 }, children: Array.from({ length: t.length }).map((d, c) => /* @__PURE__ */ i(
|
|
3840
3832
|
$t,
|
|
3841
3833
|
{
|
|
3842
3834
|
variant: "text",
|
|
3843
3835
|
width: "100%",
|
|
3844
3836
|
height: 24
|
|
3845
3837
|
},
|
|
3846
|
-
|
|
3838
|
+
c
|
|
3847
3839
|
)) }),
|
|
3848
3840
|
/* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(q, { children: /* @__PURE__ */ i(Rt, {}) }) })
|
|
3849
3841
|
] }, l)) });
|
|
@@ -3854,11 +3846,11 @@ const Ha = Z(Ae)(({ theme: e }) => ({
|
|
|
3854
3846
|
columnCount: a
|
|
3855
3847
|
} = ae(), {
|
|
3856
3848
|
["ModelIndex.StaticActions"]: l
|
|
3857
|
-
} = T("cms").getComponents(), d =
|
|
3849
|
+
} = T("cms").getComponents(), d = p.isValidElement(e) ? e : (s || W([])).map(e);
|
|
3858
3850
|
return /* @__PURE__ */ w(Yr, { ...t, children: [
|
|
3859
3851
|
o && /* @__PURE__ */ i(Ga, {}),
|
|
3860
3852
|
d,
|
|
3861
|
-
s && !s.count() && /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ w(
|
|
3853
|
+
s && !s.count() && /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ w(Q, { colSpan: a, sx: { textAlign: "center", py: 10 }, children: [
|
|
3862
3854
|
/* @__PURE__ */ i($, { children: r("No :model found", {
|
|
3863
3855
|
model: n.plural().toLocaleLowerCase()
|
|
3864
3856
|
}) }),
|
|
@@ -3872,14 +3864,14 @@ class Xa {
|
|
|
3872
3864
|
return "cms";
|
|
3873
3865
|
}
|
|
3874
3866
|
}
|
|
3875
|
-
const I = vt(Xa, wt), de =
|
|
3867
|
+
const I = vt(Xa, wt), de = G($)(() => ({
|
|
3876
3868
|
whiteSpace: "nowrap",
|
|
3877
3869
|
overflow: "hidden",
|
|
3878
3870
|
textOverflow: "ellipsis",
|
|
3879
3871
|
"& label": {
|
|
3880
3872
|
fontWeight: "bold"
|
|
3881
3873
|
}
|
|
3882
|
-
})), Qa = ({ content: e }) => ["string", "number"].includes(typeof e) ? /* @__PURE__ */ i(de, { children: e }) : e instanceof Date ? /* @__PURE__ */ i(de, { children: e.toLocaleString(se("app.locale", "en")) }) : typeof e == "object" && !
|
|
3874
|
+
})), Qa = ({ content: e }) => ["string", "number"].includes(typeof e) ? /* @__PURE__ */ i(de, { children: e }) : e instanceof Date ? /* @__PURE__ */ i(de, { children: e.toLocaleString(se("app.locale", "en")) }) : typeof e == "object" && !p.isValidElement(e) ? /* @__PURE__ */ i(de, { children: JSON.stringify(e) }) : /* @__PURE__ */ i(p.Fragment, { children: e }), ei = ({ label: e, content: t }) => ["string", "number"].includes(typeof t) ? /* @__PURE__ */ w(de, { children: [
|
|
3883
3875
|
/* @__PURE__ */ w("label", { children: [
|
|
3884
3876
|
e,
|
|
3885
3877
|
":"
|
|
@@ -3892,14 +3884,14 @@ const I = vt(Xa, wt), de = Z($)(() => ({
|
|
|
3892
3884
|
":"
|
|
3893
3885
|
] }),
|
|
3894
3886
|
t.toLocaleString(se("app.locale", "en"))
|
|
3895
|
-
] }) : typeof t == "object" && !
|
|
3887
|
+
] }) : typeof t == "object" && !p.isValidElement(t) ? /* @__PURE__ */ w(de, { children: [
|
|
3896
3888
|
/* @__PURE__ */ w("label", { children: [
|
|
3897
3889
|
e,
|
|
3898
3890
|
":"
|
|
3899
3891
|
] }),
|
|
3900
3892
|
" ",
|
|
3901
3893
|
JSON.stringify(t)
|
|
3902
|
-
] }) : /* @__PURE__ */ w(
|
|
3894
|
+
] }) : /* @__PURE__ */ w(p.Fragment, { children: [
|
|
3903
3895
|
/* @__PURE__ */ i($, { sx: { display: "inline" }, children: /* @__PURE__ */ w("b", { children: [
|
|
3904
3896
|
e,
|
|
3905
3897
|
":"
|
|
@@ -3907,33 +3899,33 @@ const I = vt(Xa, wt), de = Z($)(() => ({
|
|
|
3907
3899
|
" ",
|
|
3908
3900
|
t
|
|
3909
3901
|
] }), ti = ({ item: e, ...t }) => {
|
|
3910
|
-
const n = v(), r = St(), s = te(), { massActions: o, columns: a } = ae(), l =
|
|
3902
|
+
const n = v(), r = St(), s = te(), { massActions: o, columns: a } = ae(), l = p.useMemo(() => a.map((y) => ({
|
|
3911
3903
|
...y,
|
|
3912
3904
|
content: I[`model${k.studly(e.getType())}Get${k.studly(y.key)}Content`](e.getAttribute(y.key), e)
|
|
3913
3905
|
})), [a, e]), {
|
|
3914
3906
|
["ModelIndex.Table.ShrinkedCell"]: d,
|
|
3915
|
-
["ModelIndex.InstanceActions"]:
|
|
3907
|
+
["ModelIndex.InstanceActions"]: c
|
|
3916
3908
|
} = I.getComponents(), {
|
|
3917
|
-
isSelected:
|
|
3918
|
-
handleSelectToggle:
|
|
3909
|
+
isSelected: u,
|
|
3910
|
+
handleSelectToggle: h
|
|
3919
3911
|
} = zt();
|
|
3920
3912
|
return /* @__PURE__ */ w(
|
|
3921
3913
|
fe,
|
|
3922
3914
|
{
|
|
3923
3915
|
...t,
|
|
3924
3916
|
sx: { cursor: e.deletedAt ? "default" : "pointer" },
|
|
3925
|
-
selected:
|
|
3917
|
+
selected: u(e),
|
|
3926
3918
|
hover: !e.deletedAt,
|
|
3927
3919
|
children: [
|
|
3928
3920
|
o.length > 0 && /* @__PURE__ */ i(d, { children: /* @__PURE__ */ i(
|
|
3929
3921
|
Ot,
|
|
3930
3922
|
{
|
|
3931
|
-
checked:
|
|
3932
|
-
onChange: () =>
|
|
3923
|
+
checked: u(e),
|
|
3924
|
+
onChange: () => h(e)
|
|
3933
3925
|
}
|
|
3934
3926
|
) }),
|
|
3935
3927
|
n && l.map(({ key: y, label: S, sortable: b, content: m, ...g }) => /* @__PURE__ */ i(
|
|
3936
|
-
|
|
3928
|
+
Q,
|
|
3937
3929
|
{
|
|
3938
3930
|
...g,
|
|
3939
3931
|
onClick: () => {
|
|
@@ -3950,7 +3942,7 @@ const I = vt(Xa, wt), de = Z($)(() => ({
|
|
|
3950
3942
|
y
|
|
3951
3943
|
)),
|
|
3952
3944
|
!n && /* @__PURE__ */ i(
|
|
3953
|
-
|
|
3945
|
+
Q,
|
|
3954
3946
|
{
|
|
3955
3947
|
sx: { maxWidth: 0, px: 0 },
|
|
3956
3948
|
onClick: () => {
|
|
@@ -3959,7 +3951,7 @@ const I = vt(Xa, wt), de = Z($)(() => ({
|
|
|
3959
3951
|
children: l.map(({ key: y, ...S }) => /* @__PURE__ */ i(ei, { ...S }, y))
|
|
3960
3952
|
}
|
|
3961
3953
|
),
|
|
3962
|
-
/* @__PURE__ */ i(d, { children: /* @__PURE__ */ i(
|
|
3954
|
+
/* @__PURE__ */ i(d, { children: /* @__PURE__ */ i(c, { item: e }) })
|
|
3963
3955
|
]
|
|
3964
3956
|
}
|
|
3965
3957
|
);
|
|
@@ -3972,7 +3964,7 @@ const I = vt(Xa, wt), de = Z($)(() => ({
|
|
|
3972
3964
|
["ModelIndex.PerPageSwitch"]: l
|
|
3973
3965
|
} = T("cms").getComponents();
|
|
3974
3966
|
return /* @__PURE__ */ w(Jr, { ...t, children: [
|
|
3975
|
-
/* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(
|
|
3967
|
+
/* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(Q, { colSpan: n, children: /* @__PURE__ */ w(
|
|
3976
3968
|
N,
|
|
3977
3969
|
{
|
|
3978
3970
|
direction: r ? "row" : "column-reverse",
|
|
@@ -4016,7 +4008,7 @@ const I = vt(Xa, wt), de = Z($)(() => ({
|
|
|
4016
4008
|
["ModelIndex.Pagination"]: s
|
|
4017
4009
|
// ['ModelIndex.PaginationDetails']: PaginationDetails,
|
|
4018
4010
|
} = T("cms").getComponents(), o = v(), a = H("breakpoint", "md");
|
|
4019
|
-
return /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(
|
|
4011
|
+
return /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(Q, { colSpan: e, sx: { p: 1 }, children: /* @__PURE__ */ w(
|
|
4020
4012
|
N,
|
|
4021
4013
|
{
|
|
4022
4014
|
direction: { xs: "column", [a]: "row" },
|
|
@@ -4057,12 +4049,12 @@ const I = vt(Xa, wt), de = Z($)(() => ({
|
|
|
4057
4049
|
) }) });
|
|
4058
4050
|
};
|
|
4059
4051
|
function si() {
|
|
4060
|
-
const e = te(), { t } = L(), [n, r] = K(), s = n.get("tab") || "all", o = (d,
|
|
4052
|
+
const e = te(), { t } = L(), [n, r] = K(), s = n.get("tab") || "all", o = (d, c) => {
|
|
4061
4053
|
r(() => {
|
|
4062
|
-
const
|
|
4063
|
-
return
|
|
4054
|
+
const u = new URLSearchParams();
|
|
4055
|
+
return c !== "all" && u.set("tab", c), u;
|
|
4064
4056
|
});
|
|
4065
|
-
}, a =
|
|
4057
|
+
}, a = p.useMemo(() => e.getSchema().softDeletes ? [{ label: t("Trashed"), value: "trashed" }] : [], [e, t]), l = At(
|
|
4066
4058
|
T("cms"),
|
|
4067
4059
|
`model${k.studly(e.getSchemaName())}Tabs`,
|
|
4068
4060
|
a
|
|
@@ -4145,7 +4137,7 @@ const fr = ({
|
|
|
4145
4137
|
onClick: n,
|
|
4146
4138
|
...r
|
|
4147
4139
|
}) => {
|
|
4148
|
-
const [s, o] =
|
|
4140
|
+
const [s, o] = p.useState(null), [a, l] = p.useState(null), [d, c] = p.useState({}), u = H("drawer.width", 280), h = T("cms").getComponent("RecursiveMenu");
|
|
4149
4141
|
return /* @__PURE__ */ w(Xr, { ...r, children: [
|
|
4150
4142
|
t.map((y) => {
|
|
4151
4143
|
const {
|
|
@@ -4177,7 +4169,7 @@ const fr = ({
|
|
|
4177
4169
|
l(() => (o(P.currentTarget), x));
|
|
4178
4170
|
return;
|
|
4179
4171
|
}
|
|
4180
|
-
|
|
4172
|
+
c({
|
|
4181
4173
|
...d,
|
|
4182
4174
|
[g]: !d[g]
|
|
4183
4175
|
});
|
|
@@ -4239,7 +4231,7 @@ const fr = ({
|
|
|
4239
4231
|
);
|
|
4240
4232
|
}),
|
|
4241
4233
|
e && /* @__PURE__ */ i(
|
|
4242
|
-
|
|
4234
|
+
h,
|
|
4243
4235
|
{
|
|
4244
4236
|
items: a || [],
|
|
4245
4237
|
onClick: n,
|
|
@@ -4251,36 +4243,36 @@ const fr = ({
|
|
|
4251
4243
|
o(null), l(null);
|
|
4252
4244
|
},
|
|
4253
4245
|
open: !!s,
|
|
4254
|
-
slotProps: { paper: { sx: { minWidth:
|
|
4246
|
+
slotProps: { paper: { sx: { minWidth: u } } }
|
|
4255
4247
|
}
|
|
4256
4248
|
)
|
|
4257
4249
|
] });
|
|
4258
|
-
},
|
|
4250
|
+
}, hr = ({
|
|
4259
4251
|
collapsed: e = !1,
|
|
4260
4252
|
items: t,
|
|
4261
4253
|
onClick: n,
|
|
4262
4254
|
...r
|
|
4263
4255
|
}) => {
|
|
4264
|
-
const [s, o] =
|
|
4256
|
+
const [s, o] = p.useState({}), a = H("drawer.width", 280);
|
|
4265
4257
|
return /* @__PURE__ */ w(B, { children: [
|
|
4266
4258
|
/* @__PURE__ */ i(An, { ...r, children: t.map((l) => {
|
|
4267
4259
|
const {
|
|
4268
4260
|
text: d,
|
|
4269
|
-
icon:
|
|
4270
|
-
element:
|
|
4271
|
-
key:
|
|
4261
|
+
icon: c,
|
|
4262
|
+
element: u = null,
|
|
4263
|
+
key: h,
|
|
4272
4264
|
children: y,
|
|
4273
4265
|
onClick: S,
|
|
4274
4266
|
to: b
|
|
4275
4267
|
} = l;
|
|
4276
|
-
return
|
|
4268
|
+
return u || /* @__PURE__ */ w(
|
|
4277
4269
|
oe,
|
|
4278
4270
|
{
|
|
4279
4271
|
onClick: (m) => {
|
|
4280
4272
|
if (S && S(m), y) {
|
|
4281
4273
|
o({
|
|
4282
4274
|
...s,
|
|
4283
|
-
[
|
|
4275
|
+
[h]: s[h] ? null : m.currentTarget
|
|
4284
4276
|
});
|
|
4285
4277
|
return;
|
|
4286
4278
|
}
|
|
@@ -4292,7 +4284,7 @@ const fr = ({
|
|
|
4292
4284
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4293
4285
|
} : {},
|
|
4294
4286
|
children: [
|
|
4295
|
-
|
|
4287
|
+
c && /* @__PURE__ */ i(
|
|
4296
4288
|
wn,
|
|
4297
4289
|
{
|
|
4298
4290
|
sx: {
|
|
@@ -4301,22 +4293,22 @@ const fr = ({
|
|
|
4301
4293
|
justifyContent: "center",
|
|
4302
4294
|
color: "inherit"
|
|
4303
4295
|
},
|
|
4304
|
-
children:
|
|
4296
|
+
children: c
|
|
4305
4297
|
}
|
|
4306
4298
|
),
|
|
4307
4299
|
/* @__PURE__ */ i(Sn, { sx: { opacity: e ? 0 : 1 }, children: d }),
|
|
4308
4300
|
!e && y && /* @__PURE__ */ i(je, {})
|
|
4309
4301
|
]
|
|
4310
4302
|
},
|
|
4311
|
-
|
|
4303
|
+
h
|
|
4312
4304
|
);
|
|
4313
4305
|
}) }),
|
|
4314
4306
|
t.map((l) => {
|
|
4315
|
-
const { key: d, children:
|
|
4316
|
-
return
|
|
4317
|
-
|
|
4307
|
+
const { key: d, children: c } = l;
|
|
4308
|
+
return c ? /* @__PURE__ */ i(
|
|
4309
|
+
hr,
|
|
4318
4310
|
{
|
|
4319
|
-
items:
|
|
4311
|
+
items: c,
|
|
4320
4312
|
onClick: n,
|
|
4321
4313
|
collapsed: e,
|
|
4322
4314
|
sx: { pl: e ? 0 : 2, pb: 0 },
|
|
@@ -4346,8 +4338,8 @@ const fr = ({
|
|
|
4346
4338
|
count: t.count(),
|
|
4347
4339
|
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4348
4340
|
})), s();
|
|
4349
|
-
} catch (
|
|
4350
|
-
ce(n)(
|
|
4341
|
+
} catch (c) {
|
|
4342
|
+
ce(n)(c);
|
|
4351
4343
|
}
|
|
4352
4344
|
},
|
|
4353
4345
|
restore: (e) => async ({ selected: t, notify: n, dialog: r, refresh: s, t: o }) => {
|
|
@@ -4402,8 +4394,8 @@ const fr = ({
|
|
|
4402
4394
|
model: e.singular(),
|
|
4403
4395
|
label: t.getLabel()
|
|
4404
4396
|
})), s();
|
|
4405
|
-
} catch (
|
|
4406
|
-
ce(n)(
|
|
4397
|
+
} catch (c) {
|
|
4398
|
+
ce(n)(c);
|
|
4407
4399
|
}
|
|
4408
4400
|
},
|
|
4409
4401
|
restore: (e) => async ({ item: t, notify: n, dialog: r, refresh: s, t: o }) => {
|
|
@@ -4447,9 +4439,9 @@ const fr = ({
|
|
|
4447
4439
|
t(`/${k.kebab(e.plural())}/create`);
|
|
4448
4440
|
}
|
|
4449
4441
|
}, ii = ({ item: e }) => {
|
|
4450
|
-
const t = Ut(), [n] = K(), r = n.get("tab") ?? "all", s =
|
|
4451
|
-
a(
|
|
4452
|
-
},
|
|
4442
|
+
const t = Ut(), [n] = K(), r = n.get("tab") ?? "all", s = p.useMemo(() => T("cms").getInstanceActions(e.constructor, r), [e, r]), [o, a] = p.useState(null), l = !!o, d = (u) => {
|
|
4443
|
+
a(u.currentTarget);
|
|
4444
|
+
}, c = () => {
|
|
4453
4445
|
a(null);
|
|
4454
4446
|
};
|
|
4455
4447
|
return /* @__PURE__ */ w(B, { children: [
|
|
@@ -4468,26 +4460,26 @@ const fr = ({
|
|
|
4468
4460
|
id: "model-item-actions",
|
|
4469
4461
|
anchorEl: o,
|
|
4470
4462
|
open: l,
|
|
4471
|
-
onClose:
|
|
4463
|
+
onClose: c,
|
|
4472
4464
|
MenuListProps: {
|
|
4473
4465
|
"aria-labelledby": "model-item-action"
|
|
4474
4466
|
},
|
|
4475
|
-
children: s.map((
|
|
4467
|
+
children: s.map((u) => /* @__PURE__ */ w(
|
|
4476
4468
|
oe,
|
|
4477
4469
|
{
|
|
4478
4470
|
onClick: () => {
|
|
4479
|
-
|
|
4471
|
+
u.callback({
|
|
4480
4472
|
item: e,
|
|
4481
4473
|
...t
|
|
4482
|
-
}),
|
|
4474
|
+
}), c();
|
|
4483
4475
|
},
|
|
4484
4476
|
sx: { px: 1, gap: 0.75 },
|
|
4485
4477
|
children: [
|
|
4486
|
-
|
|
4487
|
-
|
|
4478
|
+
u.icon,
|
|
4479
|
+
u.label
|
|
4488
4480
|
]
|
|
4489
4481
|
},
|
|
4490
|
-
|
|
4482
|
+
u.label
|
|
4491
4483
|
))
|
|
4492
4484
|
}
|
|
4493
4485
|
)
|
|
@@ -4533,7 +4525,7 @@ class li {
|
|
|
4533
4525
|
);
|
|
4534
4526
|
}
|
|
4535
4527
|
}
|
|
4536
|
-
const ci = In(li), be = (e) => !(typeof e > "u" || e === null ||
|
|
4528
|
+
const ci = In(li), be = (e) => !(typeof e > "u" || e === null || ee.isEmpty(e));
|
|
4537
4529
|
class ui {
|
|
4538
4530
|
getInputType(t) {
|
|
4539
4531
|
switch (t) {
|
|
@@ -4602,7 +4594,7 @@ class ui {
|
|
|
4602
4594
|
return [
|
|
4603
4595
|
...n.filter((s) => !s.hidden && !s.appended).map((s) => {
|
|
4604
4596
|
let o = s.phpType ?? "string";
|
|
4605
|
-
return s.cast !== null && !
|
|
4597
|
+
return s.cast !== null && !ee.isEmpty(s.cast) && (o = s.cast), {
|
|
4606
4598
|
key: s.name,
|
|
4607
4599
|
label: k.human(s.name),
|
|
4608
4600
|
type: o,
|
|
@@ -4628,7 +4620,7 @@ class ui {
|
|
|
4628
4620
|
if (!be(r.key) || !be(r.operator))
|
|
4629
4621
|
return !0;
|
|
4630
4622
|
if (["boolean"].includes(this.getInputType(r.type))) {
|
|
4631
|
-
if (typeof r.value > "u" ||
|
|
4623
|
+
if (typeof r.value > "u" || ee.isNull(r.value))
|
|
4632
4624
|
return !0;
|
|
4633
4625
|
} else if (!be(r.value))
|
|
4634
4626
|
return !0;
|
|
@@ -4675,13 +4667,16 @@ class fi {
|
|
|
4675
4667
|
const r = this.make(t);
|
|
4676
4668
|
return r ? /* @__PURE__ */ i(r, { ...n }) : null;
|
|
4677
4669
|
}
|
|
4670
|
+
all() {
|
|
4671
|
+
return this.icons.map((t) => t.name);
|
|
4672
|
+
}
|
|
4678
4673
|
}
|
|
4679
|
-
class
|
|
4674
|
+
class hi {
|
|
4680
4675
|
getFacadeAccessor() {
|
|
4681
4676
|
return "icon";
|
|
4682
4677
|
}
|
|
4683
4678
|
}
|
|
4684
|
-
const ke = vt(
|
|
4679
|
+
const ke = vt(hi, wt), Le = class Le extends Mn {
|
|
4685
4680
|
register() {
|
|
4686
4681
|
this.app.singleton("cms", () => new ci()), this.app.singleton("filter", () => new di()), this.app.singleton("icon", () => new fi()), this.registerIcons();
|
|
4687
4682
|
}
|
|
@@ -4744,7 +4739,7 @@ const ke = vt(pi, wt), Le = class Le extends Mn {
|
|
|
4744
4739
|
Error: Ss,
|
|
4745
4740
|
DesktopPageTitle: xa,
|
|
4746
4741
|
RecursiveList: fr,
|
|
4747
|
-
RecursiveMenu:
|
|
4742
|
+
RecursiveMenu: hr,
|
|
4748
4743
|
Breadcrumbs: oi,
|
|
4749
4744
|
"Layout.AppBar": ga,
|
|
4750
4745
|
"Layout.Drawer": Aa,
|
|
@@ -4865,7 +4860,7 @@ const ke = vt(pi, wt), Le = class Le extends Mn {
|
|
|
4865
4860
|
};
|
|
4866
4861
|
Ve(Le, "applyUserDefaults", !0);
|
|
4867
4862
|
let yt = Le;
|
|
4868
|
-
class
|
|
4863
|
+
class pi extends Mn {
|
|
4869
4864
|
register() {
|
|
4870
4865
|
this.app.once("booting", () => {
|
|
4871
4866
|
this.initI18Next(), this.translateModelNames();
|
|
@@ -4987,15 +4982,15 @@ const mi = {
|
|
|
4987
4982
|
providers: n,
|
|
4988
4983
|
...r
|
|
4989
4984
|
}) => {
|
|
4990
|
-
const s = Ie("(prefers-color-scheme: dark)"), o =
|
|
4985
|
+
const s = Ie("(prefers-color-scheme: dark)"), o = p.useMemo(() => ls({
|
|
4991
4986
|
...e,
|
|
4992
4987
|
palette: {
|
|
4993
4988
|
...e.palette,
|
|
4994
4989
|
mode: s ? "dark" : "light"
|
|
4995
4990
|
}
|
|
4996
|
-
}, ...t ?? []), [e, s, t]), a =
|
|
4991
|
+
}, ...t ?? []), [e, s, t]), a = p.useMemo(() => [
|
|
4997
4992
|
yt,
|
|
4998
|
-
|
|
4993
|
+
pi,
|
|
4999
4994
|
...n || []
|
|
5000
4995
|
], [n]);
|
|
5001
4996
|
return /* @__PURE__ */ w(cs, { theme: o, children: [
|
|
@@ -5019,7 +5014,7 @@ const Ji = vt(bi, wt);
|
|
|
5019
5014
|
export {
|
|
5020
5015
|
I as Cms,
|
|
5021
5016
|
yt as CmsServiceProvider,
|
|
5022
|
-
|
|
5017
|
+
ps as DialogProvider,
|
|
5023
5018
|
Ji as Filter,
|
|
5024
5019
|
ke as Icon,
|
|
5025
5020
|
fs as LayoutProvider,
|
|
@@ -5027,7 +5022,7 @@ export {
|
|
|
5027
5022
|
Yi as LuminixCms,
|
|
5028
5023
|
Je as ModelProvider,
|
|
5029
5024
|
gs as NotificationProvider,
|
|
5030
|
-
|
|
5025
|
+
pi as i18NextServiceProvider,
|
|
5031
5026
|
Ut as useActionEvent,
|
|
5032
5027
|
ks as useBackButton,
|
|
5033
5028
|
te as useCurrentModel,
|