ding-react-admin 2.2.2 → 2.4.0

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/index.js CHANGED
@@ -1832,7 +1832,10 @@ function Dr(e, t = !0) {
1832
1832
  }
1833
1833
  //#endregion
1834
1834
  //#region src/crud/utils/toFormData.ts
1835
- function Or(e, t, n, r) {
1835
+ function Or(e, t) {
1836
+ return /\[[0-9]+\]$/.test(e) ? `${e}${t}` : `${e}.${t}`;
1837
+ }
1838
+ function kr(e, t, n, r) {
1836
1839
  if (n !== void 0) {
1837
1840
  if (n === null) {
1838
1841
  e.append(t, "");
@@ -1853,80 +1856,80 @@ function Or(e, t, n, r) {
1853
1856
  }
1854
1857
  if (Array.isArray(n)) {
1855
1858
  n.forEach((n, i) => {
1856
- Or(e, `${t}[${i}]`, n, r);
1859
+ kr(e, `${t}[${i}]`, n, r);
1857
1860
  });
1858
1861
  return;
1859
1862
  }
1860
1863
  if (typeof n == "object") {
1861
- for (let [i, a] of Object.entries(n)) Or(e, `${t}[${i}]`, a, r);
1864
+ for (let [i, a] of Object.entries(n)) kr(e, Or(t, i), a, r);
1862
1865
  return;
1863
1866
  }
1864
1867
  e.append(t, String(n));
1865
1868
  }
1866
1869
  }
1867
- function kr(e, t) {
1870
+ function Ar(e, t) {
1868
1871
  let n = { skipExistingUploadUrls: t?.skipExistingUploadUrls ?? !0 }, r = new FormData();
1869
- for (let [t, i] of Object.entries(e)) Or(r, t, i, n);
1872
+ for (let [t, i] of Object.entries(e)) kr(r, t, i, n);
1870
1873
  return r;
1871
1874
  }
1872
1875
  //#endregion
1873
1876
  //#region src/crud/utils/prepareFormSubmitBody.ts
1874
- function Ar(e, t) {
1877
+ function jr(e, t) {
1875
1878
  let n = t?.skipExistingUploadUrls ?? !0;
1876
- return wr(e) ? kr(e, t) : Dr(e, n);
1879
+ return wr(e) ? Ar(e, t) : Dr(e, n);
1877
1880
  }
1878
1881
  //#endregion
1879
1882
  //#region src/crud/utils/buildResourceFormSubmitBody.ts
1880
- function jr(e, t, n, r) {
1883
+ function Mr(e, t, n, r) {
1881
1884
  let i = Sr(e, t);
1882
1885
  if (n) for (let t of n) {
1883
1886
  let n = e[t.field], r = t.payloadKey ?? t.field;
1884
1887
  i[r] = Cr(n, t.sources, { transformRows: t.transformRows });
1885
1888
  }
1886
- return Ar(i, r);
1889
+ return jr(i, r);
1887
1890
  }
1888
1891
  //#endregion
1889
1892
  //#region src/crud/utils/formErrors.ts
1890
- function Mr(e) {
1893
+ function Nr(e) {
1891
1894
  return e ? Array.isArray(e) ? e : [e] : [];
1892
1895
  }
1893
- function Nr(e) {
1896
+ function Pr(e) {
1894
1897
  return Array.isArray(e) ? e.join(", ") : e;
1895
1898
  }
1896
- function Pr(e, t, n) {
1899
+ function Fr(e, t, n) {
1897
1900
  if (t.has(e)) return !0;
1898
1901
  let r = e.match(/^([^.]+)\.(\d+)\.([^.]+)$/);
1899
1902
  if (!r) return !1;
1900
1903
  let [, i, , a] = r;
1901
1904
  return n.get(i)?.sources.includes(a) ?? !1;
1902
1905
  }
1903
- function Fr(e, t, n) {
1904
- let r = {}, i = [...Mr(e.global)];
1905
- for (let [a, o] of Object.entries(e.fields ?? {})) Pr(a, t, n) ? r[a] = o : i.push(Nr(o));
1906
+ function Ir(e, t, n) {
1907
+ let r = {}, i = [...Nr(e.global)];
1908
+ for (let [a, o] of Object.entries(e.fields ?? {})) Fr(a, t, n) ? r[a] = o : i.push(Pr(o));
1906
1909
  return {
1907
1910
  fieldErrors: r,
1908
1911
  globalErrors: i
1909
1912
  };
1910
1913
  }
1911
- function Ir(e, t) {
1914
+ function Lr(e, t) {
1912
1915
  for (let [n, r] of Object.entries(t)) e.setError(n, {
1913
1916
  type: "server",
1914
- message: Nr(r)
1917
+ message: Pr(r)
1915
1918
  });
1916
1919
  }
1917
- function Lr(e) {
1920
+ function Rr(e) {
1918
1921
  let t = ln(e);
1919
1922
  if (t && !/application\/json/i.test(t)) return `non-JSON response (Content-Type: ${t})`;
1920
1923
  }
1921
- async function Rr(e, t, n, r, i) {
1924
+ async function zr(e, t, n, r, i) {
1922
1925
  let a = await fn(n);
1923
1926
  if (a != null) {
1924
1927
  let n = e.parseFormError?.({ body: a }, r);
1925
1928
  if (n) {
1926
1929
  let e = new Set(i.payloadFields), r = /* @__PURE__ */ new Map();
1927
1930
  for (let e of i.inlineRegistry) r.set(e.field, e);
1928
- let { fieldErrors: a, globalErrors: o } = Fr(n, e, r);
1929
- if (Object.keys(a).length || o.length) return Ir(t, a), {
1931
+ let { fieldErrors: a, globalErrors: o } = Ir(n, e, r);
1932
+ if (Object.keys(a).length || o.length) return Lr(t, a), {
1930
1933
  handled: !0,
1931
1934
  globalErrors: o
1932
1935
  };
@@ -1941,12 +1944,12 @@ async function Rr(e, t, n, r, i) {
1941
1944
  globalErrors: []
1942
1945
  } : {
1943
1946
  handled: !0,
1944
- globalErrors: [sn(null, { hint: Lr(n) })]
1947
+ globalErrors: [sn(null, { hint: Rr(n) })]
1945
1948
  };
1946
1949
  }
1947
1950
  //#endregion
1948
1951
  //#region src/crud/utils/useAbortableEffect.ts
1949
- function zr(e, t) {
1952
+ function Br(e, t) {
1950
1953
  s(() => {
1951
1954
  let t = new AbortController();
1952
1955
  return e(t.signal), () => t.abort();
@@ -1954,7 +1957,7 @@ function zr(e, t) {
1954
1957
  }
1955
1958
  //#endregion
1956
1959
  //#region src/crud/utils/useFormRecord.ts
1957
- function Br({ dp: e, resource: t, id: n, isNew: r, form: i, message: o, defaultValues: s, enabled: c = !0 }) {
1960
+ function Vr({ dp: e, resource: t, id: n, isNew: r, form: i, message: o, defaultValues: s, enabled: c = !0 }) {
1958
1961
  let [l, u] = d(!r), [f, p] = d(0), m = a(async (a) => {
1959
1962
  if (r || !n) {
1960
1963
  s ? i.reset({ ...s }) : i.reset({}), u(!1);
@@ -1979,20 +1982,20 @@ function Br({ dp: e, resource: t, id: n, isNew: r, form: i, message: o, defaultV
1979
1982
  o,
1980
1983
  s
1981
1984
  ]);
1982
- return zr((e) => {
1985
+ return Br((e) => {
1983
1986
  if (c) return m(e);
1984
1987
  }, [c, m]), {
1985
1988
  loading: l,
1986
1989
  formVersion: f
1987
1990
  };
1988
1991
  }
1989
- function Vr({ dp: e, resource: t, id: n, isNew: r, form: i, message: o, payloadFieldsRef: s, inlineRegistryRef: c, setGlobalErrors: l, onSuccess: u }) {
1992
+ function Hr({ dp: e, resource: t, id: n, isNew: r, form: i, message: o, payloadFieldsRef: s, inlineRegistryRef: c, setGlobalErrors: l, onSuccess: u }) {
1990
1993
  let [f, p] = d(!1);
1991
1994
  return {
1992
1995
  onSubmit: a(async (a) => {
1993
1996
  l([]), p(!0);
1994
1997
  try {
1995
- let i = jr(a, Array.from(s.current), c.current.values()), l;
1998
+ let i = Mr(a, Array.from(s.current), c.current.values()), l;
1996
1999
  if (r) l = (await e.create(t, i)).data, o.success("Created");
1997
2000
  else if (n) l = (await e.update(t, {
1998
2001
  id: n,
@@ -2001,7 +2004,7 @@ function Vr({ dp: e, resource: t, id: n, isNew: r, form: i, message: o, payloadF
2001
2004
  else return;
2002
2005
  u?.(l);
2003
2006
  } catch (n) {
2004
- let { handled: a, globalErrors: u } = await Rr(e, i, n, {
2007
+ let { handled: a, globalErrors: u } = await zr(e, i, n, {
2005
2008
  resource: t,
2006
2009
  mutation: r ? "create" : "update",
2007
2010
  inlineFieldPaths: Array.from(c.current.keys())
@@ -2030,8 +2033,8 @@ function Vr({ dp: e, resource: t, id: n, isNew: r, form: i, message: o, payloadF
2030
2033
  }
2031
2034
  //#endregion
2032
2035
  //#region src/crud/ResourceRecordForm.tsx
2033
- function Hr({ resource: e, id: t, children: r, defaultValues: i, enabled: a = !0, canSave: o = !0, onCancel: s, cancelHref: c, onSuccess: l, loadingMode: p = "overlay" }) {
2034
- let m = t === "new" || !t, h = m ? void 0 : t, g = Yt(), { message: _ } = S.useApp(), v = u(/* @__PURE__ */ new Set()), y = u(/* @__PURE__ */ new Map()), [b, x] = d([]), C = Ae({ defaultValues: i }), { loading: T, formVersion: E } = Br({
2036
+ function Ur({ resource: e, id: t, children: r, defaultValues: i, enabled: a = !0, canSave: o = !0, onCancel: s, cancelHref: c, onSuccess: l, loadingMode: p = "overlay" }) {
2037
+ let m = t === "new" || !t, h = m ? void 0 : t, g = Yt(), { message: _ } = S.useApp(), v = u(/* @__PURE__ */ new Set()), y = u(/* @__PURE__ */ new Map()), [b, x] = d([]), C = Ae({ defaultValues: i }), { loading: T, formVersion: E } = Vr({
2035
2038
  dp: g,
2036
2039
  resource: e,
2037
2040
  id: h,
@@ -2040,7 +2043,7 @@ function Hr({ resource: e, id: t, children: r, defaultValues: i, enabled: a = !0
2040
2043
  message: _,
2041
2044
  defaultValues: i,
2042
2045
  enabled: a
2043
- }), { onSubmit: D, saving: O } = Vr({
2046
+ }), { onSubmit: D, saving: O } = Hr({
2044
2047
  dp: g,
2045
2048
  resource: e,
2046
2049
  id: h,
@@ -2117,7 +2120,7 @@ function Hr({ resource: e, id: t, children: r, defaultValues: i, enabled: a = !0
2117
2120
  }
2118
2121
  //#endregion
2119
2122
  //#region src/crud/ResourceFormModal.tsx
2120
- function Ur({ resource: e, editId: t, onClose: n, children: r, title: i, permissions: a, defaultValues: o, width: s = 560, onSuccess: c }) {
2123
+ function Wr({ resource: e, editId: t, onClose: n, children: r, title: i, permissions: a, defaultValues: o, width: s = 560, onSuccess: c }) {
2121
2124
  let l = t === "new", u = t != null, d = mt(), f = i ?? (l ? `New ${e}` : `Edit ${e}`), p = a ? Z(d, a, l ? "add" : "change") : !0;
2122
2125
  return /* @__PURE__ */ J(te, {
2123
2126
  open: u,
@@ -2127,7 +2130,7 @@ function Ur({ resource: e, editId: t, onClose: n, children: r, title: i, permiss
2127
2130
  destroyOnHidden: !0,
2128
2131
  width: s,
2129
2132
  maskClosable: !1,
2130
- children: /* @__PURE__ */ J(S, { children: /* @__PURE__ */ J(Hr, {
2133
+ children: /* @__PURE__ */ J(S, { children: /* @__PURE__ */ J(Ur, {
2131
2134
  resource: e,
2132
2135
  id: t ?? void 0,
2133
2136
  enabled: u,
@@ -2144,7 +2147,7 @@ function Ur({ resource: e, editId: t, onClose: n, children: r, title: i, permiss
2144
2147
  }
2145
2148
  //#endregion
2146
2149
  //#region src/crud/ListActionsBar.tsx
2147
- function Wr({ selectedCount: e, total: t, allPageSelected: n, allMatchingSelected: r, onSelectAllMatching: i, onClearSelection: o, actions: s, onExecute: c, selectedIds: u, running: f = !1 }) {
2150
+ function Gr({ selectedCount: e, total: t, allPageSelected: n, allMatchingSelected: r, onSelectAllMatching: i, onClearSelection: o, actions: s, onExecute: c, selectedIds: u, running: f = !1 }) {
2148
2151
  let [p, m] = d(), h = l(() => s.map((e) => ({
2149
2152
  value: e.key,
2150
2153
  label: e.label
@@ -2228,14 +2231,14 @@ function Wr({ selectedCount: e, total: t, allPageSelected: n, allMatchingSelecte
2228
2231
  }
2229
2232
  //#endregion
2230
2233
  //#region src/crud/types.ts
2231
- var Gr = new Set([
2234
+ var Kr = new Set([
2232
2235
  "page",
2233
2236
  "perPage",
2234
2237
  "sort",
2235
2238
  "create",
2236
2239
  "edit"
2237
- ]), Kr = 1, qr = 10;
2238
- function Jr(e) {
2240
+ ]), qr = 1, Jr = 10;
2241
+ function Yr(e) {
2239
2242
  if (e.includes(",")) {
2240
2243
  let t = e.split(",").map((e) => e.trim()), n = t.map(Number);
2241
2244
  return n.every((e) => Number.isFinite(e)) ? n : t;
@@ -2243,16 +2246,16 @@ function Jr(e) {
2243
2246
  let t = Number(e);
2244
2247
  return e !== "" && Number.isFinite(t) && String(t) === e ? t : e === "true" ? !0 : e === "false" ? !1 : e;
2245
2248
  }
2246
- function Yr(e) {
2249
+ function Xr(e) {
2247
2250
  return e == null || e === "" ? null : Array.isArray(e) ? e.length === 0 ? null : e.map(String).join(",") : String(e);
2248
2251
  }
2249
- function Xr(e) {
2252
+ function Zr(e) {
2250
2253
  let [t, n] = b(), r = l(() => {
2251
- let n = t.get("page"), r = t.get("perPage"), i = n ? Math.max(1, Number(n) || Kr) : Kr, a = r ? Math.max(1, Number(r) || qr) : qr, o = t.getAll("sort"), s = o.length > 0 ? o.flatMap((e) => Hn(e)) : Hn(t.get("sort")), c = { ...e };
2254
+ let n = t.get("page"), r = t.get("perPage"), i = n ? Math.max(1, Number(n) || qr) : qr, a = r ? Math.max(1, Number(r) || Jr) : Jr, o = t.getAll("sort"), s = o.length > 0 ? o.flatMap((e) => Hn(e)) : Hn(t.get("sort")), c = { ...e };
2252
2255
  return t.forEach((e, n) => {
2253
- if (Gr.has(n)) return;
2256
+ if (Kr.has(n)) return;
2254
2257
  let r = c[n];
2255
- r === void 0 ? t.getAll(n).length > 1 ? c[n] = t.getAll(n).map(Jr) : c[n] = Jr(e) : c[n] = [...Array.isArray(r) ? r : [r], Jr(e)];
2258
+ r === void 0 ? t.getAll(n).length > 1 ? c[n] = t.getAll(n).map(Yr) : c[n] = Yr(e) : c[n] = [...Array.isArray(r) ? r : [r], Yr(e)];
2256
2259
  }), {
2257
2260
  page: i,
2258
2261
  perPage: a,
@@ -2275,7 +2278,7 @@ function Xr(e) {
2275
2278
  },
2276
2279
  setPerPage: (e) => {
2277
2280
  i((t) => {
2278
- e === qr ? t.delete("perPage") : t.set("perPage", String(e)), t.delete("page");
2281
+ e === Jr ? t.delete("perPage") : t.set("perPage", String(e)), t.delete("page");
2279
2282
  });
2280
2283
  },
2281
2284
  setSort: (e) => {
@@ -2302,15 +2305,15 @@ function Xr(e) {
2302
2305
  setFilter: (e, t) => {
2303
2306
  i((n) => {
2304
2307
  n.delete(e);
2305
- let r = Yr(t);
2308
+ let r = Xr(t);
2306
2309
  r != null && n.set(e, r), n.delete("page");
2307
2310
  });
2308
2311
  },
2309
2312
  setFilters: (e) => {
2310
2313
  i((t) => {
2311
- for (let e of [...t.keys()]) Gr.has(e) || t.delete(e);
2314
+ for (let e of [...t.keys()]) Kr.has(e) || t.delete(e);
2312
2315
  for (let [n, r] of Object.entries(e)) {
2313
- let e = Yr(r);
2316
+ let e = Xr(r);
2314
2317
  e != null && t.set(n, e);
2315
2318
  }
2316
2319
  t.delete("page");
@@ -2335,20 +2338,20 @@ function Xr(e) {
2335
2338
  }
2336
2339
  //#endregion
2337
2340
  //#region src/crud/ResourceList.tsx
2338
- var Zr = t(null);
2339
- function Qr() {
2340
- return o(Zr);
2341
+ var Qr = t(null);
2342
+ function $r() {
2343
+ return o(Qr);
2341
2344
  }
2342
- function $r(e) {
2345
+ function ei(e) {
2343
2346
  return e == null || e === "" ? "—" : String(e);
2344
2347
  }
2345
- function ei(e, t) {
2348
+ function ti(e, t) {
2346
2349
  if (e.length === 0 || !t.showEdit && !t.showQuickEdit) return e;
2347
2350
  let [n, ...r] = e, i = n.render;
2348
2351
  return [{
2349
2352
  ...n,
2350
2353
  render: (e, n, r) => {
2351
- let a = i ? i(e, n, r) : $r(e);
2354
+ let a = i ? i(e, n, r) : ei(e);
2352
2355
  return t.showEdit ? /* @__PURE__ */ J(f, {
2353
2356
  to: `${t.pathPrefix}/${String(n.id)}`,
2354
2357
  className: "ding-admin-row-edit-link",
@@ -2368,7 +2371,7 @@ function ei(e, t) {
2368
2371
  }
2369
2372
  }, ...r];
2370
2373
  }
2371
- function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "page", formChildren: o, actions: s, rowActions: p, headerExtra: m, bulkActions: h, bulkDelete: g = !0, bulkActionsEnabled: _ = !0, permissions: v, queryState: y, queryActions: b }) {
2374
+ function ni({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "page", formChildren: o, actions: s, rowActions: p, headerExtra: m, bulkActions: h, bulkDelete: g = !0, bulkActionsEnabled: _ = !0, permissions: v, queryState: y, queryActions: b }) {
2372
2375
  let x = Yt(), C = mt(), { message: E, modal: D } = S.useApp(), { token: O } = K.useToken(), { columns: k, sortOrders: A, sortPriorities: j } = qn(), M = u(null), [N, P] = d(), [F, I] = d(!1), [L, ee] = d([]), [R, te] = d(0), [re, z] = d(() => /* @__PURE__ */ new Set()), [ie, B] = d(!1), ae = r ?? `${n}/new`, H = Z(C, v, "add"), oe = Z(C, v, "change"), U = Z(C, v, "delete"), ce = oe && (i === "page" || i === "both") && s?.edit !== !1, W = oe && (i === "modal" || i === "both") && s?.quickEdit !== !1, le = U && s?.delete !== !1, ue = ce || W || le || p, pe = a(() => {
2373
2376
  z(/* @__PURE__ */ new Set());
2374
2377
  }, []), me = l(() => {
@@ -2496,7 +2499,7 @@ function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "p
2496
2499
  Ce,
2497
2500
  E
2498
2501
  ]);
2499
- zr((e) => X(e), [X]);
2502
+ Br((e) => X(e), [X]);
2500
2503
  let we = l(() => ({
2501
2504
  reload: () => void X(),
2502
2505
  clearSelection: pe
@@ -2525,7 +2528,14 @@ function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "p
2525
2528
  D,
2526
2529
  E
2527
2530
  ]), Ee = a(async (t) => {
2528
- if (U) try {
2531
+ if (U && await new Promise((e) => {
2532
+ D.confirm({
2533
+ title: "Delete this item? This cannot be undone.",
2534
+ okType: "danger",
2535
+ onOk: () => e(!0),
2536
+ onCancel: () => e(!1)
2537
+ });
2538
+ })) try {
2529
2539
  await x.delete(e, t.id), E.success("Deleted"), X();
2530
2540
  } catch (e) {
2531
2541
  E.error(e instanceof Error ? e.message : "Delete failed");
@@ -2535,7 +2545,8 @@ function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "p
2535
2545
  x,
2536
2546
  e,
2537
2547
  X,
2538
- E
2548
+ E,
2549
+ D
2539
2550
  ]), De = l(() => {
2540
2551
  let e = k.map((e) => {
2541
2552
  let t = e.buildColumn();
@@ -2568,7 +2579,7 @@ function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "p
2568
2579
  }
2569
2580
  return t;
2570
2581
  });
2571
- if (!ue) return ei(e, {
2582
+ if (!ue) return ti(e, {
2572
2583
  showEdit: ce,
2573
2584
  showQuickEdit: W,
2574
2585
  pathPrefix: n,
@@ -2608,7 +2619,7 @@ function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "p
2608
2619
  ]
2609
2620
  })
2610
2621
  };
2611
- return ei([...e, r], {
2622
+ return ti([...e, r], {
2612
2623
  showEdit: ce,
2613
2624
  showQuickEdit: W,
2614
2625
  pathPrefix: n,
@@ -2659,7 +2670,7 @@ function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "p
2659
2670
  children: "New"
2660
2671
  })
2661
2672
  }) : null] }) : null,
2662
- children: [he ? /* @__PURE__ */ J(Wr, {
2673
+ children: [he ? /* @__PURE__ */ J(Gr, {
2663
2674
  selectedCount: ge,
2664
2675
  total: R,
2665
2676
  allPageSelected: _e,
@@ -2706,7 +2717,7 @@ function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "p
2706
2717
  })
2707
2718
  })]
2708
2719
  })]
2709
- }), ke ? /* @__PURE__ */ J(Ur, {
2720
+ }), ke ? /* @__PURE__ */ J(Wr, {
2710
2721
  resource: e,
2711
2722
  editId: y.createModal ? "new" : y.editId,
2712
2723
  onClose: () => {
@@ -2715,8 +2726,8 @@ function ti({ resource: e, title: t, pathPrefix: n, newPath: r, editMode: i = "p
2715
2726
  children: o
2716
2727
  }) : null] });
2717
2728
  }
2718
- function ni({ resource: e, title: t, pathPrefix: n, newPath: r, staticFilter: i, textFilterDebounceMs: o, editMode: s = "page", syncQueryParams: c = !0, children: u, formChildren: d, actions: f, rowActions: p, headerExtra: m, bulkActions: h, bulkDelete: g, bulkActionsEnabled: _, permissions: v }) {
2719
- let [y, b] = Xr(i), x = l(() => {
2729
+ function ri({ resource: e, title: t, pathPrefix: n, newPath: r, staticFilter: i, textFilterDebounceMs: o, editMode: s = "page", syncQueryParams: c = !0, children: u, formChildren: d, actions: f, rowActions: p, headerExtra: m, bulkActions: h, bulkDelete: g, bulkActionsEnabled: _, permissions: v }) {
2730
+ let [y, b] = Zr(i), x = l(() => {
2720
2731
  if (!c) return i ?? {};
2721
2732
  let e = {};
2722
2733
  for (let [t, n] of Object.entries(y.filter)) i && t in i || (e[t] = n);
@@ -2731,7 +2742,7 @@ function ni({ resource: e, title: t, pathPrefix: n, newPath: r, staticFilter: i,
2731
2742
  filterValues: x,
2732
2743
  setFilterValue: S
2733
2744
  }), [x, S]);
2734
- return /* @__PURE__ */ J(Zr.Provider, {
2745
+ return /* @__PURE__ */ J(Qr.Provider, {
2735
2746
  value: C,
2736
2747
  children: /* @__PURE__ */ J(tr, {
2737
2748
  values: x,
@@ -2742,7 +2753,7 @@ function ni({ resource: e, title: t, pathPrefix: n, newPath: r, staticFilter: i,
2742
2753
  sort: y.sort,
2743
2754
  children: /* @__PURE__ */ Y("div", {
2744
2755
  className: "ding-admin-resource-list-root",
2745
- children: [u, /* @__PURE__ */ J(ti, {
2756
+ children: [u, /* @__PURE__ */ J(ni, {
2746
2757
  resource: e,
2747
2758
  title: t,
2748
2759
  pathPrefix: n,
@@ -2766,7 +2777,7 @@ function ni({ resource: e, title: t, pathPrefix: n, newPath: r, staticFilter: i,
2766
2777
  }
2767
2778
  //#endregion
2768
2779
  //#region src/crud/FilterBar.tsx
2769
- function ri() {
2780
+ function ii() {
2770
2781
  let e = nr();
2771
2782
  return !e || e.filters.length === 0 ? null : /* @__PURE__ */ J(V, {
2772
2783
  wrap: !0,
@@ -2786,12 +2797,12 @@ function ri() {
2786
2797
  }, t.key))
2787
2798
  });
2788
2799
  }
2789
- function ii({ children: e }) {
2790
- return /* @__PURE__ */ Y(q, { children: [e, /* @__PURE__ */ J(ri, {})] });
2800
+ function ai({ children: e }) {
2801
+ return /* @__PURE__ */ Y(q, { children: [e, /* @__PURE__ */ J(ii, {})] });
2791
2802
  }
2792
2803
  //#endregion
2793
2804
  //#region src/crud/ResourceForm.tsx
2794
- function ai({ resource: e, title: t, listPath: n, children: r, defaultValues: i, onSaved: a, stayOnPage: o, permissions: c }) {
2805
+ function oi({ resource: e, title: t, listPath: n, children: r, defaultValues: i, onSaved: a, stayOnPage: o, permissions: c }) {
2795
2806
  let { id: l } = y(), u = l === "new" || !l, d = mt(), p = v(), { token: m } = K.useToken();
2796
2807
  s(() => {
2797
2808
  c && (Z(d, c, u ? "add" : "change") || p(n, { replace: !0 }));
@@ -2813,7 +2824,7 @@ function ai({ resource: e, title: t, listPath: n, children: r, defaultValues: i,
2813
2824
  style: { margin: 0 },
2814
2825
  children: t
2815
2826
  })] }),
2816
- children: /* @__PURE__ */ J(Hr, {
2827
+ children: /* @__PURE__ */ J(Ur, {
2817
2828
  resource: e,
2818
2829
  id: l,
2819
2830
  defaultValues: i,
@@ -2829,17 +2840,17 @@ function ai({ resource: e, title: t, listPath: n, children: r, defaultValues: i,
2829
2840
  }
2830
2841
  //#endregion
2831
2842
  //#region src/crud/utils/nestedFieldPath.ts
2832
- function oi(e, t, n) {
2843
+ function si(e, t, n) {
2833
2844
  return `${e}.${t}.${n}`;
2834
2845
  }
2835
2846
  //#endregion
2836
2847
  //#region src/crud/InlineFormSet.tsx
2837
- function si(e, t) {
2848
+ function ci(e, t) {
2838
2849
  let n = {};
2839
2850
  for (let r of e) n[r] = t?.[r] ?? void 0;
2840
2851
  return n;
2841
2852
  }
2842
- function ci(e, t, n) {
2853
+ function li(e, t, n) {
2843
2854
  let { control: r } = je(), { fields: i, append: a, remove: o } = ke({
2844
2855
  control: r,
2845
2856
  name: e,
@@ -2848,11 +2859,11 @@ function ci(e, t, n) {
2848
2859
  return {
2849
2860
  fields: i,
2850
2861
  remove: o,
2851
- appendEmpty: () => a(si(t, n))
2862
+ appendEmpty: () => a(ci(t, n))
2852
2863
  };
2853
2864
  }
2854
- function li({ field: e, label: t, payloadKey: n, transformRows: r, columns: i, defaultRow: a }) {
2855
- let o = l(() => i.map((e) => e.source), [i]), { fields: s, remove: c, appendEmpty: u } = ci(e, o, a);
2865
+ function ui({ field: e, label: t, payloadKey: n, transformRows: r, columns: i, defaultRow: a }) {
2866
+ let o = l(() => i.map((e) => e.source), [i]), { fields: s, remove: c, appendEmpty: u } = li(e, o, a);
2856
2867
  pr(e), vr(e, o, n, r);
2857
2868
  let d = l(() => i.map((t) => ({
2858
2869
  title: t.label ?? t.source,
@@ -2861,7 +2872,7 @@ function li({ field: e, label: t, payloadKey: n, transformRows: r, columns: i, d
2861
2872
  onHeaderCell: () => t.minWidth == null ? {} : { style: { minWidth: t.minWidth } },
2862
2873
  onCell: () => t.minWidth == null ? {} : { style: { minWidth: t.minWidth } },
2863
2874
  render: (n, r, i) => t.cell({
2864
- name: oi(e, i, t.source),
2875
+ name: si(e, i, t.source),
2865
2876
  index: i,
2866
2877
  field: e
2867
2878
  })
@@ -2903,8 +2914,8 @@ function li({ field: e, label: t, payloadKey: n, transformRows: r, columns: i, d
2903
2914
  ]
2904
2915
  });
2905
2916
  }
2906
- function ui({ field: e, label: t, payloadKey: n, transformRows: r, sources: i, renderRow: a, getCardTitle: o, footer: s, defaultRow: c }) {
2907
- let { fields: l, remove: u, appendEmpty: d } = ci(e, i, c);
2917
+ function di({ field: e, label: t, payloadKey: n, transformRows: r, sources: i, renderRow: a, getCardTitle: o, footer: s, defaultRow: c }) {
2918
+ let { fields: l, remove: u, appendEmpty: d } = li(e, i, c);
2908
2919
  return pr(e), vr(e, i, n, r), /* @__PURE__ */ Y("div", {
2909
2920
  style: { marginTop: 24 },
2910
2921
  children: [
@@ -2920,7 +2931,7 @@ function ui({ field: e, label: t, payloadKey: n, transformRows: r, sources: i, r
2920
2931
  let r = {
2921
2932
  field: e,
2922
2933
  index: n,
2923
- name: (t) => oi(e, n, t)
2934
+ name: (t) => si(e, n, t)
2924
2935
  };
2925
2936
  return /* @__PURE__ */ J(T, {
2926
2937
  size: "small",
@@ -2948,22 +2959,22 @@ function ui({ field: e, label: t, payloadKey: n, transformRows: r, sources: i, r
2948
2959
  }
2949
2960
  //#endregion
2950
2961
  //#region src/crud/utils/formSectionErrors.ts
2951
- function di(e, t, n) {
2962
+ function fi(e, t, n) {
2952
2963
  for (let r of e) if (t(r, n).invalid) return !0;
2953
2964
  return !1;
2954
2965
  }
2955
- function fi(e) {
2966
+ function pi(e) {
2956
2967
  let t = u([]);
2957
2968
  for (; t.current.length < e;) t.current.push({ current: /* @__PURE__ */ new Set() });
2958
2969
  return t.current.length > e && (t.current.length = e), t.current;
2959
2970
  }
2960
- function pi(e, t) {
2971
+ function mi(e, t) {
2961
2972
  let { control: n, getFieldState: r, setFocus: i } = je(), a = Me({ control: n }), o = u(0), c = u(0);
2962
2973
  s(() => {
2963
2974
  if (a.submitCount === 0) return;
2964
2975
  let n = Object.keys(a.errors).length, s = a.submitCount !== o.current, l = !s && n > 0 && c.current === 0;
2965
2976
  if (o.current = a.submitCount, c.current = n, !s && !l || n === 0) return;
2966
- let u = e.findIndex((e) => di(e.current, r, a));
2977
+ let u = e.findIndex((e) => fi(e.current, r, a));
2967
2978
  if (u < 0) return;
2968
2979
  t(u);
2969
2980
  let d = [...e[u].current].find((e) => r(e, a).invalid);
@@ -2982,22 +2993,22 @@ function pi(e, t) {
2982
2993
  }
2983
2994
  //#endregion
2984
2995
  //#region src/crud/FormTabs.tsx
2985
- function mi(e) {
2996
+ function hi(e) {
2986
2997
  return null;
2987
2998
  }
2988
- function hi(e) {
2989
- return i(e) && e.type === mi;
2999
+ function gi(e) {
3000
+ return i(e) && e.type === hi;
2990
3001
  }
2991
- function gi({ children: t, defaultActiveKey: n, activeKey: r, onChange: i, ...o }) {
2992
- let { token: s } = K.useToken(), c = l(() => e.toArray(t).filter(hi).map((e, t) => ({
3002
+ function _i({ children: t, defaultActiveKey: n, activeKey: r, onChange: i, ...o }) {
3003
+ let { token: s } = K.useToken(), c = l(() => e.toArray(t).filter(gi).map((e, t) => ({
2993
3004
  key: e.key ?? String(t),
2994
3005
  label: e.props.label,
2995
3006
  disabled: e.props.disabled,
2996
3007
  children: e.props.children
2997
- })), [t]), u = fi(c.length), f = r !== void 0, [p, m] = d(() => n ?? c[0]?.key ?? "0"), h = f ? r : p, g = a((e) => {
3008
+ })), [t]), u = pi(c.length), f = r !== void 0, [p, m] = d(() => n ?? c[0]?.key ?? "0"), h = f ? r : p, g = a((e) => {
2998
3009
  f || m(e), i?.(e);
2999
3010
  }, [f, i]);
3000
- pi(u, a((e) => {
3011
+ mi(u, a((e) => {
3001
3012
  let t = c[e]?.key;
3002
3013
  t != null && g(t);
3003
3014
  }, [g, c]));
@@ -3005,7 +3016,7 @@ function gi({ children: t, defaultActiveKey: n, activeKey: r, onChange: i, ...o
3005
3016
  return /* @__PURE__ */ J(U, {
3006
3017
  destroyOnHidden: !1,
3007
3018
  items: l(() => c.map((e, t) => {
3008
- let n = di(u[t].current, v, y);
3019
+ let n = fi(u[t].current, v, y);
3009
3020
  return {
3010
3021
  key: e.key,
3011
3022
  label: n ? /* @__PURE__ */ J("span", {
@@ -3032,17 +3043,17 @@ function gi({ children: t, defaultActiveKey: n, activeKey: r, onChange: i, ...o
3032
3043
  }
3033
3044
  //#endregion
3034
3045
  //#region src/crud/FormSteps.tsx
3035
- function _i(e) {
3046
+ function vi(e) {
3036
3047
  return null;
3037
3048
  }
3038
- function vi(e) {
3039
- return i(e) && e.type === _i;
3049
+ function yi(e) {
3050
+ return i(e) && e.type === vi;
3040
3051
  }
3041
- function yi({ children: t, initialStep: n = 0, showNavigation: r = !0, allowStepSelect: i = !1, stepsStyle: o, navigationStyle: s, size: c, direction: u, type: f, status: p }) {
3042
- let m = l(() => e.toArray(t).filter(vi), [t]), h = fi(m.length), [g, _] = d(n), v = m.length - 1;
3043
- pi(h, _);
3052
+ function bi({ children: t, initialStep: n = 0, showNavigation: r = !0, allowStepSelect: i = !1, stepsStyle: o, navigationStyle: s, size: c, direction: u, type: f, status: p }) {
3053
+ let m = l(() => e.toArray(t).filter(yi), [t]), h = pi(m.length), [g, _] = d(n), v = m.length - 1;
3054
+ mi(h, _);
3044
3055
  let { control: y, getFieldState: b } = je(), x = Me({ control: y }), S = l(() => m.map((e, t) => {
3045
- let n = di(h[t].current, b, x);
3056
+ let n = fi(h[t].current, b, x);
3046
3057
  return {
3047
3058
  title: e.props.title,
3048
3059
  description: e.props.description,
@@ -3124,7 +3135,7 @@ function $({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a,
3124
3135
  }
3125
3136
  //#endregion
3126
3137
  //#region src/crud/fields/TextField.tsx
3127
- function bi({ source: e, name: t, label: n, required: r, rules: i, placeholder: a, inputStyle: o, hideLabel: s }) {
3138
+ function xi({ source: e, name: t, label: n, required: r, rules: i, placeholder: a, inputStyle: o, hideLabel: s }) {
3128
3139
  return /* @__PURE__ */ J($, {
3129
3140
  source: e,
3130
3141
  name: t,
@@ -3144,7 +3155,7 @@ function bi({ source: e, name: t, label: n, required: r, rules: i, placeholder:
3144
3155
  }
3145
3156
  //#endregion
3146
3157
  //#region src/crud/fields/TextAreaField.tsx
3147
- function xi({ source: e, name: t, label: n, required: r, rules: i, placeholder: a, inputStyle: o, hideLabel: s, rows: c = 4, maxLength: l, showCount: u, autoSize: d }) {
3158
+ function Si({ source: e, name: t, label: n, required: r, rules: i, placeholder: a, inputStyle: o, hideLabel: s, rows: c = 4, maxLength: l, showCount: u, autoSize: d }) {
3148
3159
  return /* @__PURE__ */ J($, {
3149
3160
  source: e,
3150
3161
  name: t,
@@ -3168,7 +3179,7 @@ function xi({ source: e, name: t, label: n, required: r, rules: i, placeholder:
3168
3179
  }
3169
3180
  //#endregion
3170
3181
  //#region src/crud/fields/NumberField.tsx
3171
- function Si({ source: e, name: t, label: n, required: r, rules: i, min: a, max: o, step: s, inputStyle: c, hideLabel: l }) {
3182
+ function Ci({ source: e, name: t, label: n, required: r, rules: i, min: a, max: o, step: s, inputStyle: c, hideLabel: l }) {
3172
3183
  return /* @__PURE__ */ J($, {
3173
3184
  source: e,
3174
3185
  name: t,
@@ -3193,7 +3204,7 @@ function Si({ source: e, name: t, label: n, required: r, rules: i, min: a, max:
3193
3204
  }
3194
3205
  //#endregion
3195
3206
  //#region src/crud/fields/BooleanField.tsx
3196
- function Ci({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a, disabled: o }) {
3207
+ function wi({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a, disabled: o }) {
3197
3208
  return /* @__PURE__ */ J($, {
3198
3209
  source: e,
3199
3210
  name: t,
@@ -3210,7 +3221,7 @@ function Ci({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a,
3210
3221
  }
3211
3222
  //#endregion
3212
3223
  //#region src/crud/utils/parseDayjsValue.ts
3213
- var wi = /* @__PURE__ */ Ue((/* @__PURE__ */ Ve(((e, t) => {
3224
+ var Ti = /* @__PURE__ */ Ue((/* @__PURE__ */ Ve(((e, t) => {
3214
3225
  (function(n, r) {
3215
3226
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_customParseFormat = r();
3216
3227
  })(e, (function() {
@@ -3367,8 +3378,8 @@ var wi = /* @__PURE__ */ Ue((/* @__PURE__ */ Ve(((e, t) => {
3367
3378
  };
3368
3379
  }));
3369
3380
  })))(), 1);
3370
- Pe.extend(wi.default);
3371
- function Ti(e, t) {
3381
+ Pe.extend(Ti.default);
3382
+ function Ei(e, t) {
3372
3383
  if (e == null || e === "") return null;
3373
3384
  if (Pe.isDayjs(e)) return e;
3374
3385
  let n = Pe(String(e), t, !0);
@@ -3376,13 +3387,13 @@ function Ti(e, t) {
3376
3387
  }
3377
3388
  //#endregion
3378
3389
  //#region src/crud/fields/DateField.tsx
3379
- var Ei = "YYYY-MM-DD", Di = `${Ei} HH:mm:ss`, Oi = [
3380
- Ei,
3390
+ var Di = "YYYY-MM-DD", Oi = `${Di} HH:mm:ss`, ki = [
3381
3391
  Di,
3392
+ Oi,
3382
3393
  "YYYY-MM-DDTHH:mm:ss",
3383
3394
  "YYYY-MM-DDTHH:mm:ssZ"
3384
3395
  ];
3385
- function ki({ source: e, name: t, label: n, required: r, rules: i, showTime: a, hideLabel: o }) {
3396
+ function Ai({ source: e, name: t, label: n, required: r, rules: i, showTime: a, hideLabel: o }) {
3386
3397
  return /* @__PURE__ */ J($, {
3387
3398
  source: e,
3388
3399
  name: t,
@@ -3391,33 +3402,33 @@ function ki({ source: e, name: t, label: n, required: r, rules: i, showTime: a,
3391
3402
  rules: i,
3392
3403
  hideLabel: o,
3393
3404
  children: ({ value: e, onChange: t, onBlur: n, disabled: r }) => /* @__PURE__ */ J(O, {
3394
- value: Ti(e, a ? [...Oi, Di] : Oi),
3395
- onChange: (e) => t(e ? e.format(a ? Di : Ei) : null),
3405
+ value: Ei(e, a ? [...ki, Oi] : ki),
3406
+ onChange: (e) => t(e ? e.format(a ? Oi : Di) : null),
3396
3407
  onBlur: n,
3397
3408
  showTime: a,
3398
3409
  disabled: r,
3399
- format: a ? Di : Ei,
3410
+ format: a ? Oi : Di,
3400
3411
  style: { width: "100%" }
3401
3412
  })
3402
3413
  });
3403
3414
  }
3404
3415
  //#endregion
3405
3416
  //#region src/crud/fields/DateTimeField.tsx
3406
- function Ai(e) {
3407
- return /* @__PURE__ */ J(ki, {
3417
+ function ji(e) {
3418
+ return /* @__PURE__ */ J(Ai, {
3408
3419
  showTime: !0,
3409
3420
  ...e
3410
3421
  });
3411
3422
  }
3412
3423
  //#endregion
3413
3424
  //#region src/crud/fields/TimeField.tsx
3414
- var ji = "HH:mm:ss", Mi = [
3415
- ji,
3425
+ var Mi = "HH:mm:ss", Ni = [
3426
+ Mi,
3416
3427
  "HH:mm",
3417
3428
  "H:mm:ss",
3418
3429
  "H:mm"
3419
3430
  ];
3420
- function Ni({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a, format: o = ji }) {
3431
+ function Pi({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a, format: o = Mi }) {
3421
3432
  return /* @__PURE__ */ J($, {
3422
3433
  source: e,
3423
3434
  name: t,
@@ -3426,7 +3437,7 @@ function Ni({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a,
3426
3437
  rules: i,
3427
3438
  hideLabel: a,
3428
3439
  children: ({ value: e, onChange: t, onBlur: n, disabled: r }) => /* @__PURE__ */ J(ce, {
3429
- value: Ti(e, Mi),
3440
+ value: Ei(e, Ni),
3430
3441
  onChange: (e) => t(e ? e.format(o) : null),
3431
3442
  onBlur: n,
3432
3443
  disabled: r,
@@ -3437,7 +3448,7 @@ function Ni({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a,
3437
3448
  }
3438
3449
  //#endregion
3439
3450
  //#region src/crud/fields/SelectField.tsx
3440
- function Pi({ source: e, name: t, label: n, required: r, rules: i, choices: a, mode: o, allowClear: s, hideLabel: c }) {
3451
+ function Fi({ source: e, name: t, label: n, required: r, rules: i, choices: a, mode: o, allowClear: s, hideLabel: c }) {
3441
3452
  return /* @__PURE__ */ J($, {
3442
3453
  source: e,
3443
3454
  name: t,
@@ -3458,7 +3469,7 @@ function Pi({ source: e, name: t, label: n, required: r, rules: i, choices: a, m
3458
3469
  }
3459
3470
  //#endregion
3460
3471
  //#region src/crud/fields/PasswordField.tsx
3461
- function Fi({ source: e, name: t, label: n, required: r, rules: i, autoComplete: a, hideLabel: o }) {
3472
+ function Ii({ source: e, name: t, label: n, required: r, rules: i, autoComplete: a, hideLabel: o }) {
3462
3473
  return /* @__PURE__ */ J($, {
3463
3474
  source: e,
3464
3475
  name: t,
@@ -3475,12 +3486,12 @@ function Fi({ source: e, name: t, label: n, required: r, rules: i, autoComplete:
3475
3486
  })
3476
3487
  });
3477
3488
  }
3478
- function Ii({ source: e, name: t, label: n, required: r, rules: i, confirmSource: a, confirmLabel: o = "Confirm password", autoComplete: s = "new-password", hideLabel: c }) {
3489
+ function Li({ source: e, name: t, label: n, required: r, rules: i, confirmSource: a, confirmLabel: o = "Confirm password", autoComplete: s = "new-password", hideLabel: c }) {
3479
3490
  let l = Ne({
3480
3491
  name: t ?? e,
3481
3492
  disabled: !a
3482
3493
  });
3483
- return a ? /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(Fi, {
3494
+ return a ? /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(Ii, {
3484
3495
  source: e,
3485
3496
  name: t,
3486
3497
  label: n,
@@ -3488,14 +3499,14 @@ function Ii({ source: e, name: t, label: n, required: r, rules: i, confirmSource
3488
3499
  rules: i,
3489
3500
  autoComplete: s,
3490
3501
  hideLabel: c
3491
- }), /* @__PURE__ */ J(Fi, {
3502
+ }), /* @__PURE__ */ J(Ii, {
3492
3503
  source: a,
3493
3504
  label: o,
3494
3505
  required: r,
3495
3506
  autoComplete: s,
3496
3507
  hideLabel: c,
3497
3508
  rules: { validate: (e) => !l || e === l || "Passwords do not match" }
3498
- })] }) : /* @__PURE__ */ J(Fi, {
3509
+ })] }) : /* @__PURE__ */ J(Ii, {
3499
3510
  source: e,
3500
3511
  name: t,
3501
3512
  label: n,
@@ -3507,54 +3518,54 @@ function Ii({ source: e, name: t, label: n, required: r, rules: i, confirmSource
3507
3518
  }
3508
3519
  //#endregion
3509
3520
  //#region src/crud/utils/choiceSelectionUtils.ts
3510
- function Li(e, t) {
3521
+ function Ri(e, t) {
3511
3522
  return typeof e == "object" && !!e && !Array.isArray(e) && t in e;
3512
3523
  }
3513
- function Ri(e, t) {
3524
+ function zi(e, t) {
3514
3525
  if (!(e == null || e === "")) {
3515
- if (Li(e, t)) {
3526
+ if (Ri(e, t)) {
3516
3527
  let n = e[t];
3517
3528
  return typeof n == "string" || typeof n == "number" ? n : void 0;
3518
3529
  }
3519
3530
  if (typeof e == "string" || typeof e == "number") return e;
3520
3531
  }
3521
3532
  }
3522
- function zi(e, t) {
3523
- return Array.isArray(e) ? e.map((e) => Ri(e, t)).filter((e) => e != null) : [];
3524
- }
3525
3533
  function Bi(e, t) {
3526
- return e == null ? [] : (Array.isArray(e) ? e : [e]).filter((e) => e != null && e !== "").map((e) => Li(e, t) ? e[t] : e);
3534
+ return Array.isArray(e) ? e.map((e) => zi(e, t)).filter((e) => e != null) : [];
3535
+ }
3536
+ function Vi(e, t) {
3537
+ return e == null ? [] : (Array.isArray(e) ? e : [e]).filter((e) => e != null && e !== "").map((e) => Ri(e, t) ? e[t] : e);
3527
3538
  }
3528
- function Vi(e, t, n) {
3539
+ function Hi(e, t, n) {
3529
3540
  let r = [];
3530
- if (t != null && (Array.isArray(t) ? r.push(...t.filter((e) => Li(e, n))) : Li(t, n) && r.push(t)), e == null) return r;
3541
+ if (t != null && (Array.isArray(t) ? r.push(...t.filter((e) => Ri(e, n))) : Ri(t, n) && r.push(t)), e == null) return r;
3531
3542
  let i = Array.isArray(e) ? e : [e];
3532
- for (let e of i) Li(e, n) && r.push(e);
3543
+ for (let e of i) Ri(e, n) && r.push(e);
3533
3544
  return r;
3534
3545
  }
3535
- function Hi(e, t) {
3546
+ function Ui(e, t) {
3536
3547
  return typeof t == "function" ? t(e) : String(e[t] ?? "");
3537
3548
  }
3538
- function Ui(e, t, n) {
3549
+ function Wi(e, t, n) {
3539
3550
  return e.map((e) => ({
3540
- label: Hi(e, t),
3551
+ label: Ui(e, t),
3541
3552
  value: e[n],
3542
3553
  record: e
3543
3554
  }));
3544
3555
  }
3545
- function Wi(e, t) {
3556
+ function Gi(e, t) {
3546
3557
  let n = /* @__PURE__ */ new Map();
3547
3558
  for (let t of e) n.set(t.value, t);
3548
3559
  for (let e of t) n.set(e.value, e);
3549
3560
  return Array.from(n.values());
3550
3561
  }
3551
- function Gi(e, t) {
3562
+ function Ki(e, t) {
3552
3563
  return e.filter((e) => !t.some((t) => t.value === e));
3553
3564
  }
3554
- function Ki(e, t, n = []) {
3555
- return Wi(n, e.filter((e) => t.some((t) => e.value === t)));
3565
+ function qi(e, t, n = []) {
3566
+ return Gi(n, e.filter((e) => t.some((t) => e.value === t)));
3556
3567
  }
3557
- function qi(e = {}) {
3568
+ function Ji(e = {}) {
3558
3569
  let t = e.popupMatchSelectWidth ?? !1;
3559
3570
  return t === !1 ? {
3560
3571
  popupMatchSelectWidth: !1,
@@ -3563,27 +3574,27 @@ function qi(e = {}) {
3563
3574
  }
3564
3575
  //#endregion
3565
3576
  //#region src/crud/utils/referenceSelectNotFoundContent.tsx
3566
- function Ji(e) {
3577
+ function Yi(e) {
3567
3578
  return e ? /* @__PURE__ */ J(ae, { size: "small" }) : void 0;
3568
3579
  }
3569
3580
  //#endregion
3570
3581
  //#region src/crud/utils/referenceSelectSelectedProps.ts
3571
- function Yi(e, t, n) {
3582
+ function Xi(e, t, n) {
3572
3583
  return {
3573
3584
  loading: e || t,
3574
3585
  disabled: !!(n || t)
3575
3586
  };
3576
3587
  }
3577
- function Xi(e, t, n) {
3588
+ function Zi(e, t, n) {
3578
3589
  return e ? n : t;
3579
3590
  }
3580
3591
  //#endregion
3581
3592
  //#region src/crud/utils/useChoices.ts
3582
- var Zi = /* @__PURE__ */ new Map(), Qi = /* @__PURE__ */ new Map();
3583
- function $i(e, t) {
3593
+ var Qi = /* @__PURE__ */ new Map(), $i = /* @__PURE__ */ new Map();
3594
+ function ea(e, t) {
3584
3595
  return typeof e == "function" ? `fn:${t ?? ""}` : Array.isArray(e) ? `static:${e.length}` : `res:${e.resource}:${JSON.stringify(e.filter ?? {})}:${t ?? ""}`;
3585
3596
  }
3586
- async function ea(e, t, n, r, i) {
3597
+ async function ta(e, t, n, r, i) {
3587
3598
  return typeof e == "function" ? e({
3588
3599
  dataProvider: t,
3589
3600
  search: i
@@ -3597,25 +3608,25 @@ async function ea(e, t, n, r, i) {
3597
3608
  perPage: 500
3598
3609
  }
3599
3610
  })).data.map((e) => ({
3600
- label: Hi(e, n),
3611
+ label: Ui(e, n),
3601
3612
  value: e[r],
3602
3613
  record: e
3603
3614
  }));
3604
3615
  }
3605
- function ta(e, t, n, r, i, a) {
3606
- let o = $i(e, i);
3616
+ function na(e, t, n, r, i, a) {
3617
+ let o = ea(e, i);
3607
3618
  if (a) {
3608
- let e = Zi.get(o);
3619
+ let e = Qi.get(o);
3609
3620
  if (e && !i) return Promise.resolve(e);
3610
3621
  }
3611
- let s = Qi.get(o);
3622
+ let s = $i.get(o);
3612
3623
  if (s) return s;
3613
- let c = ea(e, t, n, r, i).then((e) => (a && !i && Zi.set(o, e), e)).finally(() => {
3614
- Qi.delete(o);
3624
+ let c = ta(e, t, n, r, i).then((e) => (a && !i && Qi.set(o, e), e)).finally(() => {
3625
+ $i.delete(o);
3615
3626
  });
3616
- return Qi.set(o, c), c;
3627
+ return $i.set(o, c), c;
3617
3628
  }
3618
- function na(e, t, n = "name", r = "id", i, o = {}) {
3629
+ function ra(e, t, n = "name", r = "id", i, o = {}) {
3619
3630
  let { lazy: c = !1, active: f = !1, selectedValues: p, selectedRecords: m, fetchSelected: h = !0, cache: g } = o, _ = g ?? !c, v = Yt(), y = l(() => {
3620
3631
  if (e) return e;
3621
3632
  if (t) return {
@@ -3626,16 +3637,16 @@ function na(e, t, n = "name", r = "id", i, o = {}) {
3626
3637
  e,
3627
3638
  t,
3628
3639
  i
3629
- ]), b = y ? $i(y, i) : void 0, x = l(() => Bi(p, r), [p, r]), S = l(() => Ui(Vi(p, m, r), n, r), [
3640
+ ]), b = y ? ea(y, i) : void 0, x = l(() => Vi(p, r), [p, r]), S = l(() => Wi(Hi(p, m, r), n, r), [
3630
3641
  p,
3631
3642
  m,
3632
3643
  n,
3633
3644
  r
3634
- ]), C = !!(y && (!c || f || Array.isArray(y))), [w, T] = d(() => S.length ? S : !b || i || c || !_ ? [] : Zi.get(b) ?? []), [E, D] = d(() => C ? !_ || !b || i ? !!y : !Zi.has(b) : !1), [O, k] = d(() => !!(h && t && Gi(x, S).length)), A = u(w);
3645
+ ]), C = !!(y && (!c || f || Array.isArray(y))), [w, T] = d(() => S.length ? S : !b || i || c || !_ ? [] : Qi.get(b) ?? []), [E, D] = d(() => C ? !_ || !b || i ? !!y : !Qi.has(b) : !1), [O, k] = d(() => !!(h && t && Ki(x, S).length)), A = u(w);
3635
3646
  A.current = w;
3636
3647
  let j = u(x);
3637
3648
  j.current = x, s(() => {
3638
- S.length && T((e) => Wi(e, S));
3649
+ S.length && T((e) => Gi(e, S));
3639
3650
  }, [S]);
3640
3651
  let M = a(async () => {
3641
3652
  if (!y || !C) {
@@ -3643,18 +3654,18 @@ function na(e, t, n = "name", r = "id", i, o = {}) {
3643
3654
  return;
3644
3655
  }
3645
3656
  if (_) {
3646
- let e = $i(y, i), t = Zi.get(e);
3657
+ let e = ea(y, i), t = Qi.get(e);
3647
3658
  if (t && !i) {
3648
- T((e) => Wi(Ki(e, j.current, S), t)), D(!1);
3659
+ T((e) => Gi(qi(e, j.current, S), t)), D(!1);
3649
3660
  return;
3650
3661
  }
3651
3662
  }
3652
- D(!0), c && T((e) => Ki(e, j.current, S));
3663
+ D(!0), c && T((e) => qi(e, j.current, S));
3653
3664
  try {
3654
- let e = await ta(y, v, n, r, i, _);
3655
- T((t) => Wi(Ki(t, j.current, S), e));
3665
+ let e = await na(y, v, n, r, i, _);
3666
+ T((t) => Gi(qi(t, j.current, S), e));
3656
3667
  } catch {
3657
- !x.length && !S.length ? T([]) : c && T((e) => Ki(e, j.current, S));
3668
+ !x.length && !S.length ? T([]) : c && T((e) => qi(e, j.current, S));
3658
3669
  } finally {
3659
3670
  D(!1);
3660
3671
  }
@@ -3673,7 +3684,7 @@ function na(e, t, n = "name", r = "id", i, o = {}) {
3673
3684
  s(() => {
3674
3685
  M();
3675
3686
  }, [M]), s(() => {
3676
- c && !f && !i && (T((e) => Ki(e, x, S)), D(!1));
3687
+ c && !f && !i && (T((e) => qi(e, x, S)), D(!1));
3677
3688
  }, [
3678
3689
  c,
3679
3690
  f,
@@ -3685,7 +3696,7 @@ function na(e, t, n = "name", r = "id", i, o = {}) {
3685
3696
  k(!1);
3686
3697
  return;
3687
3698
  }
3688
- let e = Gi(x, Wi(S, A.current));
3699
+ let e = Ki(x, Gi(S, A.current));
3689
3700
  if (!e.length) {
3690
3701
  k(!1);
3691
3702
  return;
@@ -3696,7 +3707,7 @@ function na(e, t, n = "name", r = "id", i, o = {}) {
3696
3707
  for (let i of e) try {
3697
3708
  let e = (await v.getOne(t, i)).data;
3698
3709
  a.push({
3699
- label: Hi(e, n),
3710
+ label: Ui(e, n),
3700
3711
  value: e[r],
3701
3712
  record: e
3702
3713
  });
@@ -3708,7 +3719,7 @@ function na(e, t, n = "name", r = "id", i, o = {}) {
3708
3719
  }
3709
3720
  i || (a.length && T((e) => {
3710
3721
  let t = a.filter((t) => !e.some((e) => e.value === t.value));
3711
- return t.length ? Wi(e, t) : e;
3722
+ return t.length ? Gi(e, t) : e;
3712
3723
  }), k(!1));
3713
3724
  })(), () => {
3714
3725
  i = !0;
@@ -3735,7 +3746,7 @@ function na(e, t, n = "name", r = "id", i, o = {}) {
3735
3746
  }
3736
3747
  //#endregion
3737
3748
  //#region src/crud/fields/ReferenceInputActions.tsx
3738
- function ra({ reference: e, referenceForm: t, referencePermissions: n, referenceTitle: r, referenceDefaultValues: i, referenceModalWidth: a, selectedId: o, disabled: s, onCreated: c, onUpdated: l }) {
3749
+ function ia({ reference: e, referenceForm: t, referencePermissions: n, referenceTitle: r, referenceDefaultValues: i, referenceModalWidth: a, selectedId: o, disabled: s, onCreated: c, onUpdated: l }) {
3739
3750
  let u = mt(), f = r ?? e, p = !!(e && t) && Z(u, n, "add"), m = !!(e && t && o != null && o !== "") && Z(u, n, "change"), [h, g] = d(null);
3740
3751
  return !p && !m ? null : /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y(V, {
3741
3752
  size: 4,
@@ -3758,7 +3769,7 @@ function ra({ reference: e, referenceForm: t, referencePermissions: n, reference
3758
3769
  onClick: () => g(String(o))
3759
3770
  })
3760
3771
  }) : null]
3761
- }), e && t && h != null ? /* @__PURE__ */ J(Ur, {
3772
+ }), e && t && h != null ? /* @__PURE__ */ J(Wr, {
3762
3773
  resource: e,
3763
3774
  editId: h,
3764
3775
  onClose: () => g(null),
@@ -3775,35 +3786,35 @@ function ra({ reference: e, referenceForm: t, referencePermissions: n, reference
3775
3786
  }
3776
3787
  //#endregion
3777
3788
  //#region src/crud/fields/ReferenceField.tsx
3778
- function ia({ reference: e, choices: t, optionLabel: n = "name", optionValue: r = "id", search: i, allowClear: a, disabled: o, inputStyle: s, onValueChange: c, lazy: u = !0, fetchSelected: f = !0, value: p, onChange: m, fieldName: h, selectedRecords: g, referenceForm: _, referencePermissions: v, referenceTitle: y, referenceDefaultValues: b, referenceModalWidth: x, referenceActions: S = !0, popupMatchSelectWidth: C, popupMinWidth: w }) {
3779
- let [T, E] = d(), [D, O] = d(!1), k = D || !!T, A = Ri(p, r), { options: j, loading: M, selectedLoading: N, optionForValue: P, reload: F } = na(t, e, n, r, i ? T : void 0, {
3789
+ function aa({ reference: e, choices: t, optionLabel: n = "name", optionValue: r = "id", search: i, allowClear: a, disabled: o, inputStyle: s, onValueChange: c, lazy: u = !0, fetchSelected: f = !0, value: p, onChange: m, fieldName: h, selectedRecords: g, referenceForm: _, referencePermissions: v, referenceTitle: y, referenceDefaultValues: b, referenceModalWidth: x, referenceActions: S = !0, popupMatchSelectWidth: C, popupMinWidth: w }) {
3790
+ let [T, E] = d(), [D, O] = d(!1), k = D || !!T, A = zi(p, r), { options: j, loading: M, selectedLoading: N, optionForValue: P, reload: F } = ra(t, e, n, r, i ? T : void 0, {
3780
3791
  lazy: u,
3781
3792
  active: k,
3782
3793
  selectedValues: p,
3783
3794
  selectedRecords: g,
3784
3795
  fetchSelected: f
3785
- }), I = Yi(M, N, o), L = l(() => j.map((e) => ({
3796
+ }), I = Xi(M, N, o), L = l(() => j.map((e) => ({
3786
3797
  label: e.label,
3787
3798
  value: e.value
3788
3799
  })), [j]), ee = (e) => {
3789
3800
  let t = e[r];
3790
3801
  m(t), c?.(t, {
3791
- label: Hi(e, n),
3802
+ label: Ui(e, n),
3792
3803
  value: t,
3793
3804
  record: e
3794
3805
  }, { name: h }), F();
3795
3806
  }, R = /* @__PURE__ */ J(B, {
3796
- ...qi({
3807
+ ...Ji({
3797
3808
  popupMatchSelectWidth: C,
3798
3809
  popupMinWidth: w
3799
3810
  }),
3800
- value: Xi(N, A, void 0),
3811
+ value: Zi(N, A, void 0),
3801
3812
  onChange: (e) => {
3802
3813
  m(e), c?.(e, P(e), { name: h });
3803
3814
  },
3804
3815
  options: L,
3805
3816
  loading: I.loading,
3806
- notFoundContent: Ji(I.loading),
3817
+ notFoundContent: Yi(I.loading),
3807
3818
  showSearch: i,
3808
3819
  filterOption: i ? !1 : void 0,
3809
3820
  onSearch: i ? E : void 0,
@@ -3832,7 +3843,7 @@ function ia({ reference: e, choices: t, optionLabel: n = "name", optionValue: r
3832
3843
  minWidth: 0
3833
3844
  },
3834
3845
  children: R
3835
- }), /* @__PURE__ */ J(ra, {
3846
+ }), /* @__PURE__ */ J(ia, {
3836
3847
  reference: e,
3837
3848
  referenceForm: _,
3838
3849
  referencePermissions: v,
@@ -3846,7 +3857,7 @@ function ia({ reference: e, choices: t, optionLabel: n = "name", optionValue: r
3846
3857
  })]
3847
3858
  }) : R;
3848
3859
  }
3849
- function aa({ source: e, name: t, label: n, reference: r, choices: i, optionLabel: a = "name", optionValue: o = "id", required: s, rules: c, search: l, allowClear: u, disabled: d, hideLabel: f, inputStyle: p, onValueChange: m, lazy: h = !0, recordSource: g, fetchSelected: _ = !0, referenceForm: v, referencePermissions: y, referenceTitle: b, referenceDefaultValues: x, referenceModalWidth: S, referenceActions: C = !0, popupMatchSelectWidth: w, popupMinWidth: T }) {
3860
+ function oa({ source: e, name: t, label: n, reference: r, choices: i, optionLabel: a = "name", optionValue: o = "id", required: s, rules: c, search: l, allowClear: u, disabled: d, hideLabel: f, inputStyle: p, onValueChange: m, lazy: h = !0, recordSource: g, fetchSelected: _ = !0, referenceForm: v, referencePermissions: y, referenceTitle: b, referenceDefaultValues: x, referenceModalWidth: S, referenceActions: C = !0, popupMatchSelectWidth: w, popupMinWidth: T }) {
3850
3861
  let E = Ne({
3851
3862
  name: g ?? "",
3852
3863
  disabled: !g
@@ -3858,7 +3869,7 @@ function aa({ source: e, name: t, label: n, reference: r, choices: i, optionLabe
3858
3869
  required: s,
3859
3870
  rules: c,
3860
3871
  hideLabel: f,
3861
- children: ({ value: e, onChange: t, disabled: n, name: s }) => /* @__PURE__ */ J(ia, {
3872
+ children: ({ value: e, onChange: t, disabled: n, name: s }) => /* @__PURE__ */ J(aa, {
3862
3873
  reference: r,
3863
3874
  choices: i,
3864
3875
  optionLabel: a,
@@ -3887,27 +3898,27 @@ function aa({ source: e, name: t, label: n, reference: r, choices: i, optionLabe
3887
3898
  }
3888
3899
  //#endregion
3889
3900
  //#region src/crud/fields/ReferenceManyField.tsx
3890
- function oa({ reference: e, choices: t, optionLabel: n = "name", optionValue: r = "id", search: i, allowClear: a = !0, lazy: o = !0, fetchSelected: s = !0, value: c, onChange: u, disabled: f, selectedRecords: p, referenceForm: m, referencePermissions: h, referenceTitle: g, referenceDefaultValues: _, referenceModalWidth: v, referenceActions: y = !0, popupMatchSelectWidth: b, popupMinWidth: x }) {
3891
- let [S, C] = d(), [w, T] = d(!1), E = w || !!S, D = zi(c, r), { options: O, loading: k, selectedLoading: A, reload: j } = na(t, e, n, r, i ? S : void 0, {
3901
+ function sa({ reference: e, choices: t, optionLabel: n = "name", optionValue: r = "id", search: i, allowClear: a = !0, lazy: o = !0, fetchSelected: s = !0, value: c, onChange: u, disabled: f, selectedRecords: p, referenceForm: m, referencePermissions: h, referenceTitle: g, referenceDefaultValues: _, referenceModalWidth: v, referenceActions: y = !0, popupMatchSelectWidth: b, popupMinWidth: x }) {
3902
+ let [S, C] = d(), [w, T] = d(!1), E = w || !!S, D = Bi(c, r), { options: O, loading: k, selectedLoading: A, reload: j } = ra(t, e, n, r, i ? S : void 0, {
3892
3903
  lazy: o,
3893
3904
  active: E,
3894
3905
  selectedValues: c,
3895
3906
  selectedRecords: p,
3896
3907
  fetchSelected: s
3897
- }), M = Yi(k, A, f), N = l(() => O.map((e) => ({
3908
+ }), M = Xi(k, A, f), N = l(() => O.map((e) => ({
3898
3909
  label: e.label,
3899
3910
  value: e.value
3900
3911
  })), [O]), P = /* @__PURE__ */ J(B, {
3901
- ...qi({
3912
+ ...Ji({
3902
3913
  popupMatchSelectWidth: b,
3903
3914
  popupMinWidth: x
3904
3915
  }),
3905
3916
  mode: "multiple",
3906
- value: Xi(A, D, []),
3917
+ value: Zi(A, D, []),
3907
3918
  onChange: u,
3908
3919
  options: N,
3909
3920
  loading: M.loading,
3910
- notFoundContent: Ji(M.loading),
3921
+ notFoundContent: Yi(M.loading),
3911
3922
  showSearch: i,
3912
3923
  filterOption: i ? !1 : void 0,
3913
3924
  onSearch: i ? C : void 0,
@@ -3932,7 +3943,7 @@ function oa({ reference: e, choices: t, optionLabel: n = "name", optionValue: r
3932
3943
  minWidth: 0
3933
3944
  },
3934
3945
  children: P
3935
- }), /* @__PURE__ */ J(ra, {
3946
+ }), /* @__PURE__ */ J(ia, {
3936
3947
  reference: e,
3937
3948
  referenceForm: m,
3938
3949
  referencePermissions: h,
@@ -3951,7 +3962,7 @@ function oa({ reference: e, choices: t, optionLabel: n = "name", optionValue: r
3951
3962
  })]
3952
3963
  }) : P;
3953
3964
  }
3954
- function sa({ source: e, name: t, label: n, reference: r, choices: i, optionLabel: a = "name", optionValue: o = "id", required: s, rules: c, search: l, allowClear: u = !0, hideLabel: d, disabled: f, lazy: p = !0, recordSource: m, fetchSelected: h = !0, referenceForm: g, referencePermissions: _, referenceTitle: v, referenceDefaultValues: y, referenceModalWidth: b, referenceActions: x = !0, popupMatchSelectWidth: S, popupMinWidth: C }) {
3965
+ function ca({ source: e, name: t, label: n, reference: r, choices: i, optionLabel: a = "name", optionValue: o = "id", required: s, rules: c, search: l, allowClear: u = !0, hideLabel: d, disabled: f, lazy: p = !0, recordSource: m, fetchSelected: h = !0, referenceForm: g, referencePermissions: _, referenceTitle: v, referenceDefaultValues: y, referenceModalWidth: b, referenceActions: x = !0, popupMatchSelectWidth: S, popupMinWidth: C }) {
3955
3966
  let w = Ne({
3956
3967
  name: m ?? "",
3957
3968
  disabled: !m
@@ -3963,7 +3974,7 @@ function sa({ source: e, name: t, label: n, reference: r, choices: i, optionLabe
3963
3974
  required: s,
3964
3975
  rules: c,
3965
3976
  hideLabel: d,
3966
- children: ({ value: e, onChange: t, disabled: n }) => /* @__PURE__ */ J(oa, {
3977
+ children: ({ value: e, onChange: t, disabled: n }) => /* @__PURE__ */ J(sa, {
3967
3978
  reference: r,
3968
3979
  choices: i,
3969
3980
  optionLabel: a,
@@ -3989,10 +4000,10 @@ function sa({ source: e, name: t, label: n, reference: r, choices: i, optionLabe
3989
4000
  }
3990
4001
  //#endregion
3991
4002
  //#region src/crud/fields/uploadFieldUtils.ts
3992
- function ca(e) {
4003
+ function la(e) {
3993
4004
  return e instanceof File ? !0 : typeof e == "string" && e.length > 0;
3994
4005
  }
3995
- function la(e) {
4006
+ function ua(e) {
3996
4007
  if (e instanceof File) return e.name;
3997
4008
  if (typeof e == "string" && e.length > 0) try {
3998
4009
  return new URL(e, "http://local").pathname.split("/").filter(Boolean).pop() || e;
@@ -4002,7 +4013,7 @@ function la(e) {
4002
4013
  }
4003
4014
  //#endregion
4004
4015
  //#region src/crud/fields/useUploadPreviewUrl.ts
4005
- function ua(e) {
4016
+ function da(e) {
4006
4017
  let [t, n] = d();
4007
4018
  if (s(() => {
4008
4019
  if (e instanceof File) {
@@ -4015,8 +4026,8 @@ function ua(e) {
4015
4026
  }
4016
4027
  //#endregion
4017
4028
  //#region src/crud/fields/ImageField.tsx
4018
- function da({ value: e, onChange: t, disabled: n, clearable: r, accept: i = "image/*", previewWidth: a = 200 }) {
4019
- let o = u(null), s = ua(e), c = r && ca(e);
4029
+ function fa({ value: e, onChange: t, disabled: n, clearable: r, accept: i = "image/*", previewWidth: a = 200 }) {
4030
+ let o = u(null), s = da(e), c = r && la(e);
4020
4031
  return /* @__PURE__ */ Y(V, {
4021
4032
  direction: "vertical",
4022
4033
  size: "middle",
@@ -4063,7 +4074,7 @@ function da({ value: e, onChange: t, disabled: n, clearable: r, accept: i = "ima
4063
4074
  ]
4064
4075
  });
4065
4076
  }
4066
- function fa({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a, clearable: o, accept: s, previewWidth: c }) {
4077
+ function pa({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a, clearable: o, accept: s, previewWidth: c }) {
4067
4078
  return /* @__PURE__ */ J($, {
4068
4079
  source: e,
4069
4080
  name: t,
@@ -4071,7 +4082,7 @@ function fa({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a,
4071
4082
  required: r,
4072
4083
  rules: i,
4073
4084
  hideLabel: a,
4074
- children: ({ value: e, onChange: t, disabled: n }) => /* @__PURE__ */ J(da, {
4085
+ children: ({ value: e, onChange: t, disabled: n }) => /* @__PURE__ */ J(fa, {
4075
4086
  value: e,
4076
4087
  onChange: t,
4077
4088
  disabled: n,
@@ -4083,8 +4094,8 @@ function fa({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a,
4083
4094
  }
4084
4095
  //#endregion
4085
4096
  //#region src/crud/fields/FileField.tsx
4086
- function pa({ value: e, onChange: t, disabled: n, clearable: r, accept: i }) {
4087
- let a = u(null), o = la(e), s = typeof e == "string" && e.length > 0 ? e : void 0, c = r && ca(e);
4097
+ function ma({ value: e, onChange: t, disabled: n, clearable: r, accept: i }) {
4098
+ let a = u(null), o = ua(e), s = typeof e == "string" && e.length > 0 ? e : void 0, c = r && la(e);
4088
4099
  return /* @__PURE__ */ Y(V, {
4089
4100
  direction: "vertical",
4090
4101
  size: "middle",
@@ -4128,7 +4139,7 @@ function pa({ value: e, onChange: t, disabled: n, clearable: r, accept: i }) {
4128
4139
  ]
4129
4140
  });
4130
4141
  }
4131
- function ma({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a, clearable: o, accept: s }) {
4142
+ function ha({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a, clearable: o, accept: s }) {
4132
4143
  return /* @__PURE__ */ J($, {
4133
4144
  source: e,
4134
4145
  name: t,
@@ -4136,7 +4147,7 @@ function ma({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a,
4136
4147
  required: r,
4137
4148
  rules: i,
4138
4149
  hideLabel: a,
4139
- children: ({ value: e, onChange: t, disabled: n }) => /* @__PURE__ */ J(pa, {
4150
+ children: ({ value: e, onChange: t, disabled: n }) => /* @__PURE__ */ J(ma, {
4140
4151
  value: e,
4141
4152
  onChange: t,
4142
4153
  disabled: n,
@@ -4147,7 +4158,7 @@ function ma({ source: e, name: t, label: n, required: r, rules: i, hideLabel: a,
4147
4158
  }
4148
4159
  //#endregion
4149
4160
  //#region src/crud/columns/TextColumn.tsx
4150
- function ha({ source: e, label: t, sortable: n = !0 }) {
4161
+ function ga({ source: e, label: t, sortable: n = !0 }) {
4151
4162
  return Jn(l(() => ({
4152
4163
  key: e,
4153
4164
  source: e,
@@ -4165,12 +4176,12 @@ function ha({ source: e, label: t, sortable: n = !0 }) {
4165
4176
  n
4166
4177
  ])), null;
4167
4178
  }
4168
- function ga(e, t, n) {
4179
+ function _a(e, t, n) {
4169
4180
  return typeof n == "function" ? n(e) : n ? br(e, n) : e[t];
4170
4181
  }
4171
4182
  //#endregion
4172
4183
  //#region src/crud/columns/NumberColumn.tsx
4173
- function _a({ source: e, label: t, sortable: n = !0 }) {
4184
+ function va({ source: e, label: t, sortable: n = !0 }) {
4174
4185
  return Jn(l(() => ({
4175
4186
  key: e,
4176
4187
  source: e,
@@ -4190,7 +4201,7 @@ function _a({ source: e, label: t, sortable: n = !0 }) {
4190
4201
  }
4191
4202
  //#endregion
4192
4203
  //#region src/crud/columns/BooleanColumn.tsx
4193
- function va({ source: e, label: t, sortable: n = !0 }) {
4204
+ function ya({ source: e, label: t, sortable: n = !0 }) {
4194
4205
  return Jn(l(() => ({
4195
4206
  key: e,
4196
4207
  source: e,
@@ -4211,7 +4222,7 @@ function va({ source: e, label: t, sortable: n = !0 }) {
4211
4222
  }
4212
4223
  //#endregion
4213
4224
  //#region src/crud/columns/DateColumn.tsx
4214
- function ya({ source: e, label: t, sortable: n = !0 }) {
4225
+ function ba({ source: e, label: t, sortable: n = !0 }) {
4215
4226
  return Jn(l(() => ({
4216
4227
  key: e,
4217
4228
  source: e,
@@ -4232,16 +4243,16 @@ function ya({ source: e, label: t, sortable: n = !0 }) {
4232
4243
  }
4233
4244
  //#endregion
4234
4245
  //#region src/crud/columns/ReferenceColumn.tsx
4235
- function ba({ record: e, source: t, display: n, reference: r, choices: i, optionLabel: a, optionValue: o }) {
4236
- let { labelForValue: s } = na(i, r, a, o), c = e[t];
4246
+ function xa({ record: e, source: t, display: n, reference: r, choices: i, optionLabel: a, optionValue: o }) {
4247
+ let { labelForValue: s } = ra(i, r, a, o), c = e[t];
4237
4248
  if (typeof n == "function") return /* @__PURE__ */ J(q, { children: n(e) });
4238
4249
  if (n && n !== t) {
4239
- let r = ga(e, t, n);
4250
+ let r = _a(e, t, n);
4240
4251
  return /* @__PURE__ */ J(q, { children: r == null ? "—" : String(r) });
4241
4252
  }
4242
4253
  return /* @__PURE__ */ J(q, { children: s(c) });
4243
4254
  }
4244
- function xa({ source: e, label: t, reference: n, choices: r, optionLabel: i = "name", optionValue: a = "id", display: o, sortable: s = !0 }) {
4255
+ function Sa({ source: e, label: t, reference: n, choices: r, optionLabel: i = "name", optionValue: a = "id", display: o, sortable: s = !0 }) {
4245
4256
  return Jn(l(() => ({
4246
4257
  key: e,
4247
4258
  source: e,
@@ -4252,7 +4263,7 @@ function xa({ source: e, label: t, reference: n, choices: r, optionLabel: i = "n
4252
4263
  dataIndex: e,
4253
4264
  key: e,
4254
4265
  sorter: s ? !0 : void 0,
4255
- render: (s, c) => /* @__PURE__ */ J(ba, {
4266
+ render: (s, c) => /* @__PURE__ */ J(xa, {
4256
4267
  record: c,
4257
4268
  source: e,
4258
4269
  label: t,
@@ -4276,11 +4287,11 @@ function xa({ source: e, label: t, reference: n, choices: r, optionLabel: i = "n
4276
4287
  }
4277
4288
  //#endregion
4278
4289
  //#region src/crud/columns/ReferenceManyColumn.tsx
4279
- function Sa({ record: e, source: t, reference: n, choices: r, optionLabel: i, optionValue: a }) {
4280
- let { labelsForValues: o } = na(r, n, i, a), s = e[t];
4290
+ function Ca({ record: e, source: t, reference: n, choices: r, optionLabel: i, optionValue: a }) {
4291
+ let { labelsForValues: o } = ra(r, n, i, a), s = e[t];
4281
4292
  return /* @__PURE__ */ J(q, { children: o(Array.isArray(s) ? s : []) });
4282
4293
  }
4283
- function Ca({ source: e, label: t, reference: n, choices: r, optionLabel: i = "name", optionValue: a = "id", sortable: o = !1 }) {
4294
+ function wa({ source: e, label: t, reference: n, choices: r, optionLabel: i = "name", optionValue: a = "id", sortable: o = !1 }) {
4284
4295
  return Jn(l(() => ({
4285
4296
  key: e,
4286
4297
  source: e,
@@ -4291,7 +4302,7 @@ function Ca({ source: e, label: t, reference: n, choices: r, optionLabel: i = "n
4291
4302
  dataIndex: e,
4292
4303
  key: e,
4293
4304
  sorter: o ? !0 : void 0,
4294
- render: (t, o) => /* @__PURE__ */ J(Sa, {
4305
+ render: (t, o) => /* @__PURE__ */ J(Ca, {
4295
4306
  record: o,
4296
4307
  source: e,
4297
4308
  reference: n,
@@ -4312,7 +4323,7 @@ function Ca({ source: e, label: t, reference: n, choices: r, optionLabel: i = "n
4312
4323
  }
4313
4324
  //#endregion
4314
4325
  //#region src/crud/columns/ImageColumn.tsx
4315
- function wa({ source: e, label: t, sortable: n = !1, width: r = 40, height: i = 40, objectFit: a = "cover", borderRadius: o = 4, alt: s = "" }) {
4326
+ function Ta({ source: e, label: t, sortable: n = !1, width: r = 40, height: i = 40, objectFit: a = "cover", borderRadius: o = 4, alt: s = "" }) {
4316
4327
  return Jn(l(() => ({
4317
4328
  key: e,
4318
4329
  source: e,
@@ -4347,7 +4358,7 @@ function wa({ source: e, label: t, sortable: n = !1, width: r = 40, height: i =
4347
4358
  }
4348
4359
  //#endregion
4349
4360
  //#region src/crud/columns/CustomColumn.tsx
4350
- function Ta({ source: e, label: t, sortable: n = !1, render: r }) {
4361
+ function Ea({ source: e, label: t, sortable: n = !1, render: r }) {
4351
4362
  return Jn(l(() => ({
4352
4363
  key: e,
4353
4364
  source: e,
@@ -4367,7 +4378,7 @@ function Ta({ source: e, label: t, sortable: n = !1, render: r }) {
4367
4378
  }
4368
4379
  //#endregion
4369
4380
  //#region src/crud/filters/NumberFilter.tsx
4370
- function Ea({ source: e, label: t }) {
4381
+ function Da({ source: e, label: t }) {
4371
4382
  return rr(l(() => ({
4372
4383
  key: e,
4373
4384
  source: e,
@@ -4382,7 +4393,7 @@ function Ea({ source: e, label: t }) {
4382
4393
  }
4383
4394
  //#endregion
4384
4395
  //#region src/crud/filters/BooleanFilter.tsx
4385
- function Da({ source: e, label: t }) {
4396
+ function Oa({ source: e, label: t }) {
4386
4397
  return rr(l(() => ({
4387
4398
  key: e,
4388
4399
  source: e,
@@ -4405,7 +4416,7 @@ function Da({ source: e, label: t }) {
4405
4416
  }
4406
4417
  //#endregion
4407
4418
  //#region src/crud/filters/DateFilter.tsx
4408
- function Oa({ source: e, label: t }) {
4419
+ function ka({ source: e, label: t }) {
4409
4420
  return rr(l(() => ({
4410
4421
  key: e,
4411
4422
  source: e,
@@ -4421,7 +4432,7 @@ function Oa({ source: e, label: t }) {
4421
4432
  }
4422
4433
  //#endregion
4423
4434
  //#region src/crud/filters/SelectFilter.tsx
4424
- function ka({ source: e, label: t, choices: n, multiple: r }) {
4435
+ function Aa({ source: e, label: t, choices: n, multiple: r }) {
4425
4436
  return rr(l(() => ({
4426
4437
  key: e,
4427
4438
  source: e,
@@ -4444,22 +4455,22 @@ function ka({ source: e, label: t, choices: n, multiple: r }) {
4444
4455
  }
4445
4456
  //#endregion
4446
4457
  //#region src/crud/filters/ReferenceFilter.tsx
4447
- function Aa({ source: e, label: t, reference: n, choices: r, optionLabel: i, optionValue: a, multiple: o, search: s, lazy: c = !0, fetchSelected: l = !0, popupMatchSelectWidth: u, popupMinWidth: f, value: p, onChange: m }) {
4448
- let [h, g] = d(), [_, v] = d(!1), { options: y, loading: b, selectedLoading: x } = na(r, n, i, a, s ? h : void 0, {
4458
+ function ja({ source: e, label: t, reference: n, choices: r, optionLabel: i, optionValue: a, multiple: o, search: s, lazy: c = !0, fetchSelected: l = !0, popupMatchSelectWidth: u, popupMinWidth: f, value: p, onChange: m }) {
4459
+ let [h, g] = d(), [_, v] = d(!1), { options: y, loading: b, selectedLoading: x } = ra(r, n, i, a, s ? h : void 0, {
4449
4460
  lazy: c,
4450
4461
  active: _ || !!h,
4451
4462
  selectedValues: p,
4452
4463
  fetchSelected: l
4453
- }), S = Yi(b, x), C = p;
4464
+ }), S = Xi(b, x), C = p;
4454
4465
  return /* @__PURE__ */ J(B, {
4455
- ...qi({
4466
+ ...Ji({
4456
4467
  popupMatchSelectWidth: u,
4457
4468
  popupMinWidth: f
4458
4469
  }),
4459
4470
  allowClear: !0,
4460
4471
  mode: o ? "multiple" : void 0,
4461
4472
  placeholder: t ?? e,
4462
- value: Xi(x, C, o ? [] : void 0),
4473
+ value: Zi(x, C, o ? [] : void 0),
4463
4474
  onChange: m,
4464
4475
  options: y.map((e) => ({
4465
4476
  label: e.label,
@@ -4467,7 +4478,7 @@ function Aa({ source: e, label: t, reference: n, choices: r, optionLabel: i, opt
4467
4478
  })),
4468
4479
  loading: S.loading,
4469
4480
  disabled: S.disabled,
4470
- notFoundContent: Ji(S.loading),
4481
+ notFoundContent: Yi(S.loading),
4471
4482
  showSearch: s,
4472
4483
  filterOption: s ? !1 : void 0,
4473
4484
  onSearch: s ? g : void 0,
@@ -4478,12 +4489,12 @@ function Aa({ source: e, label: t, reference: n, choices: r, optionLabel: i, opt
4478
4489
  style: { minWidth: 180 }
4479
4490
  });
4480
4491
  }
4481
- function ja({ source: e, label: t, reference: n, choices: r, optionLabel: i = "name", optionValue: a = "id", multiple: o, search: s, lazy: c = !0, fetchSelected: u = !0, popupMatchSelectWidth: d, popupMinWidth: f }) {
4492
+ function Ma({ source: e, label: t, reference: n, choices: r, optionLabel: i = "name", optionValue: a = "id", multiple: o, search: s, lazy: c = !0, fetchSelected: u = !0, popupMatchSelectWidth: d, popupMinWidth: f }) {
4482
4493
  return rr(l(() => ({
4483
4494
  key: e,
4484
4495
  source: e,
4485
4496
  label: t,
4486
- render: ({ value: l, onChange: p }) => /* @__PURE__ */ J(Aa, {
4497
+ render: ({ value: l, onChange: p }) => /* @__PURE__ */ J(ja, {
4487
4498
  source: e,
4488
4499
  label: t,
4489
4500
  reference: n,
@@ -4514,11 +4525,11 @@ function ja({ source: e, label: t, reference: n, choices: r, optionLabel: i = "n
4514
4525
  f
4515
4526
  ])), null;
4516
4527
  }
4517
- function Ma(e) {
4518
- return /* @__PURE__ */ J(ja, {
4528
+ function Na(e) {
4529
+ return /* @__PURE__ */ J(Ma, {
4519
4530
  ...e,
4520
4531
  multiple: !0
4521
4532
  });
4522
4533
  }
4523
4534
  //#endregion
4524
- export { Kt as AdminApp, Pt as AdminLayout, Bn as AppHub, Vn as AppLauncherButton, Xe as AppThemeProvider, In as AuthAlternateLink, Ln as AuthPageLayout, ct as AuthProvider, va as BooleanColumn, Ci as BooleanField, Da as BooleanFilter, Ta as CustomColumn, Xn as DEFAULT_TEXT_FILTER_DEBOUNCE_MS, Jt as DataProvider, ya as DateColumn, ki as DateField, Oa as DateFilter, Ai as DateTimeField, $e as DensitySwitch, en as EXPECTED_VALIDATION_BODY_HINT, $ as FieldWrapper, ma as FileField, ii as FilterBar, _i as FormStep, yi as FormSteps, mi as FormTab, gi as FormTabs, Ft as Guard, Lt as GuestOnly, wa as ImageColumn, fa as ImageField, li as InlineFormSet, ui as InlineFormSetStacked, Rn as LoginPage, _a as NumberColumn, Si as NumberField, Ea as NumberFilter, Ii as PasswordField, pt as PermissionsProvider, zn as PlaceholderPage, It as Protected, xa as ReferenceColumn, aa as ReferenceField, ja as ReferenceFilter, Ca as ReferenceManyColumn, sa as ReferenceManyField, Ma as ReferenceManyFilter, Rt as RequirePermission, ai as ResourceForm, Ur as ResourceFormModal, ni as ResourceList, Pi as SelectField, ka as SelectFilter, xi as TextAreaField, ha as TextColumn, bi as TextField, $n as TextFilter, tt as ThemeSwitch, nt as ThemeToolbar, Ni as TimeField, kn as applyInMemoryListParams, Q as asStringMessages, Sr as buildFormPayload, Cr as buildInlineRowsPayload, jr as buildResourceFormSubmitBody, Qt as combineResourceHandlers, Gt as createAdminRouter, An as createMemoryResourceHandlers, ht as createPermissionsChecker, jn as createRestResourceHandlers, dt as createSessionStorageAuthAdapter, Ut as deriveAuthPaths, sn as describeNonStandardValidationBody, bt as filterFlatNavItems, wt as filterNavByPermission, vt as filterNavItems, Dn as filterRows, hn as finalizeFormErrors, yt as flattenNavLeaves, mn as flattenNestedArrayErrors, un as getErrorBody, br as getFormValue, _t as getNavItemLabel, zt as getRouteAccess, wn as getRowById, wr as hasUploadValues, $t as isAbortError, oi as nestedFieldPath, vn as parseDjangoDRFFormErrors, yn as parseDotNetFormErrors, bn as parseNodeFormErrors, Bt as partitionAdminRoutes, Ar as prepareFormSubmitBody, fn as resolveErrorBody, xr as setFormValue, Nn as toDjangoRestOrdering, kr as toFormData, Fn as toJsonApiSort, Pn as toODataOrderBy, zr as useAbortableEffect, lt as useAuth, gt as useCan, na as useChoices, Yt as useDataProvider, Xr as useListQueryState, mt as usePermissions, pr as useRegisterPayloadField, mr as useRegisterSectionField, Qr as useResourceListContext, Ze as useThemeMode };
4535
+ export { Kt as AdminApp, Pt as AdminLayout, Bn as AppHub, Vn as AppLauncherButton, Xe as AppThemeProvider, In as AuthAlternateLink, Ln as AuthPageLayout, ct as AuthProvider, ya as BooleanColumn, wi as BooleanField, Oa as BooleanFilter, Ea as CustomColumn, Xn as DEFAULT_TEXT_FILTER_DEBOUNCE_MS, Jt as DataProvider, ba as DateColumn, Ai as DateField, ka as DateFilter, ji as DateTimeField, $e as DensitySwitch, en as EXPECTED_VALIDATION_BODY_HINT, $ as FieldWrapper, ha as FileField, ai as FilterBar, vi as FormStep, bi as FormSteps, hi as FormTab, _i as FormTabs, Ft as Guard, Lt as GuestOnly, Ta as ImageColumn, pa as ImageField, ui as InlineFormSet, di as InlineFormSetStacked, Rn as LoginPage, va as NumberColumn, Ci as NumberField, Da as NumberFilter, Li as PasswordField, pt as PermissionsProvider, zn as PlaceholderPage, It as Protected, Sa as ReferenceColumn, oa as ReferenceField, Ma as ReferenceFilter, wa as ReferenceManyColumn, ca as ReferenceManyField, Na as ReferenceManyFilter, Rt as RequirePermission, oi as ResourceForm, Wr as ResourceFormModal, ri as ResourceList, Fi as SelectField, Aa as SelectFilter, Si as TextAreaField, ga as TextColumn, xi as TextField, $n as TextFilter, tt as ThemeSwitch, nt as ThemeToolbar, Pi as TimeField, kn as applyInMemoryListParams, Q as asStringMessages, Sr as buildFormPayload, Cr as buildInlineRowsPayload, Mr as buildResourceFormSubmitBody, Qt as combineResourceHandlers, Gt as createAdminRouter, An as createMemoryResourceHandlers, ht as createPermissionsChecker, jn as createRestResourceHandlers, dt as createSessionStorageAuthAdapter, Ut as deriveAuthPaths, sn as describeNonStandardValidationBody, bt as filterFlatNavItems, wt as filterNavByPermission, vt as filterNavItems, Dn as filterRows, hn as finalizeFormErrors, yt as flattenNavLeaves, mn as flattenNestedArrayErrors, un as getErrorBody, br as getFormValue, _t as getNavItemLabel, zt as getRouteAccess, wn as getRowById, wr as hasUploadValues, $t as isAbortError, si as nestedFieldPath, vn as parseDjangoDRFFormErrors, yn as parseDotNetFormErrors, bn as parseNodeFormErrors, Bt as partitionAdminRoutes, jr as prepareFormSubmitBody, fn as resolveErrorBody, xr as setFormValue, Nn as toDjangoRestOrdering, Ar as toFormData, Fn as toJsonApiSort, Pn as toODataOrderBy, Br as useAbortableEffect, lt as useAuth, gt as useCan, ra as useChoices, Yt as useDataProvider, Zr as useListQueryState, mt as usePermissions, pr as useRegisterPayloadField, mr as useRegisterSectionField, $r as useResourceListContext, Ze as useThemeMode };