@declarion/react 0.2.7 → 0.2.9

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.
@@ -1,4 +1,4 @@
1
- import { C as e, E as t, T as n, W as r, _ as i, b as a, c as o, d as s, f as c, g as l, h as u, i as d, k as f, l as p, m, n as h, o as g, p as _, r as v, t as y, u as b, v as x, w as S, x as ee, y as C } from "./value-qao1rdkR.js";
1
+ import { C as e, E as t, T as n, W as r, _ as i, b as a, c as o, d as s, f as c, g as l, h as u, i as d, k as f, l as p, m, n as h, o as g, p as _, r as v, t as y, u as b, v as x, w as S, x as ee, y as C } from "./value-CXFBdyeL.js";
2
2
  import { a as w, i as T, o as E, r as D, s as O, t as k } from "./rich-text-CaQ6-8Gx.js";
3
3
  import { Suspense as A, forwardRef as j, lazy as M, useCallback as N, useEffect as P, useLayoutEffect as F, useMemo as I, useRef as L, useState as R } from "react";
4
4
  import { useQuery as z } from "@tanstack/react-query";
@@ -232,6 +232,13 @@ var K = (e, t = {}) => ({ size: n = 14, cls: r = "", style: i = {} }) => /* @__P
232
232
  cy: "12",
233
233
  r: "9"
234
234
  }), /* @__PURE__ */ V("path", { d: "M12 7v5l3 2" })] })),
235
+ lock: K(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("rect", {
236
+ x: "5",
237
+ y: "11",
238
+ width: "14",
239
+ height: "9",
240
+ rx: "2"
241
+ }), /* @__PURE__ */ V("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })] })),
235
242
  email: K(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("rect", {
236
243
  x: "3",
237
244
  y: "5",
@@ -1431,8 +1438,19 @@ function De({ size: e = 14 }) {
1431
1438
  });
1432
1439
  }
1433
1440
  //#endregion
1441
+ //#region src/components/primitives/ClassifiedFieldLocked.tsx
1442
+ function Oe({ tier: e, tierDef: t, requiredPermission: n, locale: r = "en", variant: i = "value" }) {
1443
+ let a = t?.name?.[r] ?? t?.name?.en ?? e, o = n ? `Locked: requires permission "${n}". Ask your administrator to grant it to your role.` : `Locked: ${a} classification — requires explicit grant.`;
1444
+ return /* @__PURE__ */ H("span", {
1445
+ title: o,
1446
+ "aria-label": o,
1447
+ className: `inline-flex items-center gap-1 text-muted-foreground italic select-none ${i === "input" ? "border border-divider rounded-md px-2 py-1 bg-surface" : ""}`,
1448
+ children: [/* @__PURE__ */ V(q.lock, { size: 12 }), /* @__PURE__ */ V("span", { children: a })]
1449
+ });
1450
+ }
1451
+ //#endregion
1434
1452
  //#region src/components/primitives/Fields.tsx
1435
- var Oe = ({ children: e, required: t, hint: n }) => /* @__PURE__ */ H("div", {
1453
+ var ke = ({ children: e, required: t, hint: n }) => /* @__PURE__ */ H("div", {
1436
1454
  style: {
1437
1455
  display: "flex",
1438
1456
  alignItems: "center",
@@ -1460,7 +1478,7 @@ var Oe = ({ children: e, required: t, hint: n }) => /* @__PURE__ */ H("div", {
1460
1478
  children: /* @__PURE__ */ V(q.info, { size: 11 })
1461
1479
  })
1462
1480
  ]
1463
- }), ke = {
1481
+ }), Ae = {
1464
1482
  width: "100%",
1465
1483
  height: 30,
1466
1484
  padding: "0 10px",
@@ -1480,7 +1498,7 @@ function Z({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
1480
1498
  display: "flex",
1481
1499
  alignItems: "center",
1482
1500
  gap: 6,
1483
- ...ke,
1501
+ ...Ae,
1484
1502
  padding: r || i ? "0 8px" : "0 10px",
1485
1503
  borderColor: s ? "var(--accent)" : "var(--border)",
1486
1504
  boxShadow: s ? "0 0 0 3px var(--accent-ring)" : "none",
@@ -1522,7 +1540,7 @@ function Z({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
1522
1540
  ]
1523
1541
  });
1524
1542
  }
1525
- function Ae({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a, name: o, ariaRequired: s }) {
1543
+ function je({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a, name: o, ariaRequired: s }) {
1526
1544
  let [c, l] = R(!1), u = i ? {
1527
1545
  flex: 1,
1528
1546
  height: "100%",
@@ -1543,7 +1561,7 @@ function Ae({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
1543
1561
  onFocus: () => l(!0),
1544
1562
  onBlur: () => l(!1),
1545
1563
  style: {
1546
- ...ke,
1564
+ ...Ae,
1547
1565
  padding: "8px 10px",
1548
1566
  lineHeight: 1.5,
1549
1567
  ...u,
@@ -1553,14 +1571,14 @@ function Ae({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
1553
1571
  }
1554
1572
  });
1555
1573
  }
1556
- var je = 20, Me = 100;
1557
- function Ne(e) {
1574
+ var Me = 20, Ne = 100;
1575
+ function Pe(e) {
1558
1576
  return typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value;
1559
1577
  }
1560
- function Pe({ value: e, options: t, onChange: n, placeholder: r = "Select...", ...i }) {
1561
- let [a, o] = R(!1), [s, c] = R(""), l = L(null), u = t.find((t) => t.value === e), d = t.length > je, f = I(() => {
1578
+ function Fe({ value: e, options: t, onChange: n, placeholder: r = "Select...", ...i }) {
1579
+ let [a, o] = R(!1), [s, c] = R(""), l = L(null), u = t.find((t) => t.value === e), d = t.length > Me, f = I(() => {
1562
1580
  let e = s.trim().toLowerCase();
1563
- return e ? t.filter((t) => Ne(t).toLowerCase().includes(e)).slice(0, Me) : t.slice(0, Me);
1581
+ return e ? t.filter((t) => Pe(t).toLowerCase().includes(e)).slice(0, Ne) : t.slice(0, Ne);
1564
1582
  }, [t, s]);
1565
1583
  return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("button", {
1566
1584
  type: "button",
@@ -1570,7 +1588,7 @@ function Pe({ value: e, options: t, onChange: n, placeholder: r = "Select...", .
1570
1588
  },
1571
1589
  ...i,
1572
1590
  style: {
1573
- ...ke,
1591
+ ...Ae,
1574
1592
  display: "flex",
1575
1593
  alignItems: "center",
1576
1594
  justifyContent: "space-between",
@@ -1637,7 +1655,7 @@ function Pe({ value: e, options: t, onChange: n, placeholder: r = "Select...", .
1637
1655
  ]
1638
1656
  })] });
1639
1657
  }
1640
- function Fe({ value: e, onChange: t }) {
1658
+ function Ie({ value: e, onChange: t }) {
1641
1659
  return /* @__PURE__ */ V(Z, {
1642
1660
  value: e || "",
1643
1661
  onChange: t,
@@ -1645,26 +1663,26 @@ function Fe({ value: e, onChange: t }) {
1645
1663
  prefix: /* @__PURE__ */ V(q.calendar, { size: 13 })
1646
1664
  });
1647
1665
  }
1648
- function Ie(e) {
1666
+ function Le(e) {
1649
1667
  if (!e) return 0;
1650
1668
  let t = 0;
1651
1669
  return e.length >= 8 && t++, e.length >= 12 && t++, /[A-Z]/.test(e) && /[a-z]/.test(e) && t++, /\d/.test(e) && t++, /[^A-Za-z0-9]/.test(e) && t++, Math.min(4, t);
1652
1670
  }
1653
- var Le = [
1671
+ var Re = [
1654
1672
  "Too short",
1655
1673
  "Weak",
1656
1674
  "Fair",
1657
1675
  "Good",
1658
1676
  "Strong"
1659
- ], Re = [
1677
+ ], ze = [
1660
1678
  "var(--danger)",
1661
1679
  "var(--danger)",
1662
1680
  "var(--warning, #B45309)",
1663
1681
  "var(--accent)",
1664
1682
  "var(--success, #3FBF8F)"
1665
1683
  ];
1666
- function ze({ value: e, onChange: t, placeholder: n = "Enter password", showStrength: r, id: i, name: a, ariaRequired: o }) {
1667
- let [s, c] = R(!1), l = e || "", u = Ie(l);
1684
+ function Be({ value: e, onChange: t, placeholder: n = "Enter password", showStrength: r, id: i, name: a, ariaRequired: o }) {
1685
+ let [s, c] = R(!1), l = e || "", u = Le(l);
1668
1686
  return /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(Z, {
1669
1687
  id: i,
1670
1688
  name: a,
@@ -1709,7 +1727,7 @@ function ze({ value: e, onChange: t, placeholder: n = "Enter password", showStre
1709
1727
  flex: 1,
1710
1728
  height: 3,
1711
1729
  borderRadius: 999,
1712
- background: e < u ? Re[u] : "var(--surface-3)",
1730
+ background: e < u ? ze[u] : "var(--surface-3)",
1713
1731
  transition: "background .15s"
1714
1732
  } }, e))
1715
1733
  }), /* @__PURE__ */ V("span", {
@@ -1719,15 +1737,15 @@ function ze({ value: e, onChange: t, placeholder: n = "Enter password", showStre
1719
1737
  minWidth: 54,
1720
1738
  textAlign: "right"
1721
1739
  },
1722
- children: l ? Le[u] : ""
1740
+ children: l ? Re[u] : ""
1723
1741
  })]
1724
1742
  })] });
1725
1743
  }
1726
- function Be({ value: e = [], onChange: t }) {
1744
+ function Ve({ value: e = [], onChange: t }) {
1727
1745
  let [n, r] = R("");
1728
1746
  return /* @__PURE__ */ H("div", {
1729
1747
  style: {
1730
- ...ke,
1748
+ ...Ae,
1731
1749
  height: "auto",
1732
1750
  minHeight: 30,
1733
1751
  display: "flex",
@@ -1759,7 +1777,7 @@ function Be({ value: e = [], onChange: t }) {
1759
1777
  })]
1760
1778
  });
1761
1779
  }
1762
- function Ve({ value: e, onChange: t }) {
1780
+ function He({ value: e, onChange: t }) {
1763
1781
  return /* @__PURE__ */ H("div", {
1764
1782
  style: {
1765
1783
  border: "1px solid var(--border)",
@@ -1818,7 +1836,7 @@ function Ve({ value: e, onChange: t }) {
1818
1836
  })]
1819
1837
  });
1820
1838
  }
1821
- function He({ value: e, entity: t = "company", onChange: n, items: r = [], id: i, ariaLabelledby: a, ariaRequired: o }) {
1839
+ function Ue({ value: e, entity: t = "company", onChange: n, items: r = [], id: i, ariaLabelledby: a, ariaRequired: o }) {
1822
1840
  let [s, c] = R(!1), l = L(null);
1823
1841
  return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("button", {
1824
1842
  type: "button",
@@ -1828,7 +1846,7 @@ function He({ value: e, entity: t = "company", onChange: n, items: r = [], id: i
1828
1846
  ref: l,
1829
1847
  onClick: () => c(!0),
1830
1848
  style: {
1831
- ...ke,
1849
+ ...Ae,
1832
1850
  display: "flex",
1833
1851
  alignItems: "center",
1834
1852
  justifyContent: "space-between",
@@ -1884,7 +1902,7 @@ function He({ value: e, entity: t = "company", onChange: n, items: r = [], id: i
1884
1902
  }, e.id))]
1885
1903
  })] });
1886
1904
  }
1887
- function Ue({ label: e, children: t, mono: n, wide: r, empty: i }) {
1905
+ function We({ label: e, children: t, mono: n, wide: r, empty: i }) {
1888
1906
  return /* @__PURE__ */ H("div", {
1889
1907
  style: {
1890
1908
  display: "flex",
@@ -1917,7 +1935,7 @@ function Ue({ label: e, children: t, mono: n, wide: r, empty: i }) {
1917
1935
  })]
1918
1936
  });
1919
1937
  }
1920
- function We({ value: e, onChange: t, type: n = "text", options: r }) {
1938
+ function Ge({ value: e, onChange: t, type: n = "text", options: r }) {
1921
1939
  let [i, a] = R(!1), [o, s] = R(e), c = () => {
1922
1940
  t && o !== void 0 && t(o), a(!1);
1923
1941
  }, l = () => {
@@ -1932,7 +1950,7 @@ function We({ value: e, onChange: t, type: n = "text", options: r }) {
1932
1950
  onKeyDown: (e) => {
1933
1951
  e.key === "Enter" && c(), e.key === "Escape" && l();
1934
1952
  },
1935
- children: [n === "select" ? /* @__PURE__ */ V(Pe, {
1953
+ children: [n === "select" ? /* @__PURE__ */ V(Fe, {
1936
1954
  value: o,
1937
1955
  options: r || [],
1938
1956
  onChange: (e) => {
@@ -1986,7 +2004,7 @@ function We({ value: e, onChange: t, type: n = "text", options: r }) {
1986
2004
  }
1987
2005
  //#endregion
1988
2006
  //#region src/types/ordmap.ts
1989
- var Ge = class e {
2007
+ var Ke = class e {
1990
2008
  #e;
1991
2009
  #t;
1992
2010
  constructor(e) {
@@ -2030,18 +2048,18 @@ var Ge = class e {
2030
2048
  function Q(e, t = "en") {
2031
2049
  return e ? e[t] ?? Object.values(e)[0] ?? "" : "";
2032
2050
  }
2033
- var Ke = "$display";
2034
- function qe(e, t) {
2051
+ var qe = "$display";
2052
+ function Je(e, t) {
2035
2053
  if (!e) return;
2036
- let n = e[Ke];
2054
+ let n = e[qe];
2037
2055
  if (typeof n == "string" && n !== "") return n;
2038
2056
  let r = t?.display?.display_field;
2039
2057
  if (!r) return;
2040
2058
  let i = e[r];
2041
2059
  if (i != null) return typeof i == "object" && !Array.isArray(i) ? Q(i) || void 0 : String(i);
2042
2060
  }
2043
- function Je(e, t, n) {
2044
- let r = e[Ke];
2061
+ function Ye(e, t, n) {
2062
+ let r = e[qe];
2045
2063
  if (typeof r == "string" && r !== "") return r;
2046
2064
  if (t) {
2047
2065
  let r = e[t];
@@ -2049,11 +2067,11 @@ function Je(e, t, n) {
2049
2067
  }
2050
2068
  return n;
2051
2069
  }
2052
- function Ye(e) {
2070
+ function Xe(e) {
2053
2071
  let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
2054
2072
  return RegExp("^" + t.join("/") + "$");
2055
2073
  }
2056
- function Xe(e) {
2074
+ function Ze(e) {
2057
2075
  let t = (() => {
2058
2076
  try {
2059
2077
  return decodeURIComponent(e);
@@ -2063,17 +2081,17 @@ function Xe(e) {
2063
2081
  })().split("-")[0];
2064
2082
  return t.length > 8 ? t.slice(0, 8) : t;
2065
2083
  }
2066
- function Ze(e, t, n) {
2084
+ function Qe(e, t, n) {
2067
2085
  if (!t) return;
2068
2086
  let r = e.replace(/\/+$/, "") || "/", i;
2069
2087
  for (let e of Object.values(t)) {
2070
- if (!e.route || !Ye(e.route).test(r)) continue;
2088
+ if (!e.route || !Xe(e.route).test(r)) continue;
2071
2089
  let t = e.route.includes("/:"), a = Q(e.display?.name);
2072
2090
  if (!a && t && n && e.entity) {
2073
2091
  let t = Q(n[e.entity]?.display?.name);
2074
2092
  if (t) {
2075
2093
  let e = r.slice(r.lastIndexOf("/") + 1);
2076
- a = e ? `${t} ${Xe(e)}` : t;
2094
+ a = e ? `${t} ${Ze(e)}` : t;
2077
2095
  }
2078
2096
  }
2079
2097
  if (!a) continue;
@@ -2086,7 +2104,7 @@ function Ze(e, t, n) {
2086
2104
  }
2087
2105
  return i;
2088
2106
  }
2089
- function Qe(e, t, n) {
2107
+ function $e(e, t, n) {
2090
2108
  let r = Q(e.display?.name);
2091
2109
  if (r) return r;
2092
2110
  if (e.type === "ref" && e.ref?.entity && n) {
@@ -2098,7 +2116,7 @@ function Qe(e, t, n) {
2098
2116
  }
2099
2117
  return t;
2100
2118
  }
2101
- function $e(e) {
2119
+ function et(e) {
2102
2120
  let t = e.name, n = e.display ? {
2103
2121
  ...e.display,
2104
2122
  name: e.display.name ?? t
@@ -2111,29 +2129,29 @@ function $e(e) {
2111
2129
  structure: e.structure
2112
2130
  };
2113
2131
  }
2114
- function et(e, t) {
2132
+ function tt(e, t) {
2115
2133
  return !e || e.readonly ? !1 : e.mutations?.[t] ?? !0;
2116
2134
  }
2117
- function tt(e) {
2135
+ function nt(e) {
2118
2136
  if (e.primary_key && e.primary_key.length > 0) return e.primary_key;
2119
2137
  for (let [t, n] of e.fields) if (n.primary) return [t];
2120
2138
  return ["id"];
2121
2139
  }
2122
- function nt(e, t) {
2123
- let n = tt(e), r = {};
2140
+ function rt(e, t) {
2141
+ let n = nt(e), r = {};
2124
2142
  for (let e of n) r[e] = String(t[e] ?? "");
2125
2143
  return r;
2126
2144
  }
2127
- function rt(e) {
2128
- return e.length === 1 ? e[0] : JSON.stringify(e);
2129
- }
2130
2145
  function it(e) {
2131
- return rt(Object.values(e));
2146
+ return e.length === 1 ? e[0] : JSON.stringify(e);
2132
2147
  }
2133
- function at(e, t) {
2134
- return rt(tt(e).map((e) => t[e] ?? ""));
2148
+ function at(e) {
2149
+ return it(Object.values(e));
2135
2150
  }
2136
2151
  function ot(e, t) {
2152
+ return it(nt(e).map((e) => t[e] ?? ""));
2153
+ }
2154
+ function st(e, t) {
2137
2155
  if (t <= 1) return [e];
2138
2156
  try {
2139
2157
  let n = JSON.parse(e);
@@ -2143,64 +2161,64 @@ function ot(e, t) {
2143
2161
  }
2144
2162
  return null;
2145
2163
  }
2146
- function st(e, t, n) {
2164
+ function ct(e, t, n) {
2147
2165
  if (e?.detail_screen === "none") return null;
2148
2166
  let r = e?.detail_screen ?? t?.detail_screen;
2149
2167
  return r ? n?.[r]?.route ?? null : null;
2150
2168
  }
2151
- function ct(e, t, n, r) {
2169
+ function lt(e, t, n, r) {
2152
2170
  if (!t) return null;
2153
- let i = st(e, n, r);
2171
+ let i = ct(e, n, r);
2154
2172
  return i ? i.replace(":id", encodeURIComponent(t)) : null;
2155
2173
  }
2156
- function lt(e, t, n, r) {
2157
- return !t || tt(t).some((e) => !r[e]) ? null : ct(e, at(t, r), t, n);
2158
- }
2159
2174
  function ut(e, t, n, r) {
2160
- return t ? lt(e, t, n, nt(t, r)) : null;
2175
+ return !t || nt(t).some((e) => !r[e]) ? null : lt(e, ot(t, r), t, n);
2161
2176
  }
2162
- function dt(e) {
2163
- return tt(e).length > 1;
2177
+ function dt(e, t, n, r) {
2178
+ return t ? ut(e, t, n, rt(t, r)) : null;
2179
+ }
2180
+ function ft(e) {
2181
+ return nt(e).length > 1;
2164
2182
  }
2165
2183
  //#endregion
2166
2184
  //#region src/api/schema.ts
2167
- function ft(e) {
2185
+ function pt(e) {
2168
2186
  return {
2169
2187
  ...e,
2170
- params: e.params ? Ge.fromObject(e.params) : void 0
2188
+ params: e.params ? Ke.fromObject(e.params) : void 0
2171
2189
  };
2172
2190
  }
2173
- function pt(e) {
2191
+ function mt(e) {
2174
2192
  return {
2175
2193
  ...e,
2176
- resolved_params: e.resolved_params ? Ge.fromObject(e.resolved_params) : void 0
2194
+ resolved_params: e.resolved_params ? Ke.fromObject(e.resolved_params) : void 0
2177
2195
  };
2178
2196
  }
2179
- function mt(e) {
2197
+ function ht(e) {
2180
2198
  let t = {};
2181
- if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = ft(r);
2199
+ if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = pt(r);
2182
2200
  let n = {};
2183
- if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = pt(r);
2201
+ if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = mt(r);
2184
2202
  return {
2185
2203
  ...e,
2186
- fields: Ge.fromObject(e.fields),
2187
- files: e.files ? Ge.fromObject(e.files) : void 0,
2204
+ fields: Ke.fromObject(e.fields),
2205
+ files: e.files ? Ke.fromObject(e.files) : void 0,
2188
2206
  handlers: e.handlers ? t : void 0,
2189
2207
  actions: e.actions ? n : void 0
2190
2208
  };
2191
2209
  }
2192
- function ht(e) {
2210
+ function gt(e) {
2193
2211
  let t = {};
2194
- if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = mt(r);
2212
+ if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = ht(r);
2195
2213
  let n = {};
2196
2214
  if (e.structures) for (let [t, r] of Object.entries(e.structures)) n[t] = {
2197
2215
  ...r,
2198
- fields: Ge.fromObject(r.fields)
2216
+ fields: Ke.fromObject(r.fields)
2199
2217
  };
2200
2218
  let r = {};
2201
- if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = ft(n);
2219
+ if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = pt(n);
2202
2220
  let i = {};
2203
- if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] = pt(n);
2221
+ if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] = mt(n);
2204
2222
  return {
2205
2223
  ...e,
2206
2224
  entities: t,
@@ -2209,22 +2227,23 @@ function ht(e) {
2209
2227
  actions: i
2210
2228
  };
2211
2229
  }
2212
- async function gt() {
2213
- return ht(await e("/api/schema"));
2230
+ async function _t() {
2231
+ return gt(await e("/api/schema"));
2214
2232
  }
2215
2233
  //#endregion
2216
2234
  //#region src/api/auth.ts
2217
- async function _t() {
2235
+ async function vt() {
2218
2236
  return n("auth.check_setup");
2219
2237
  }
2220
- async function vt(e, t) {
2221
- let r = await n("auth.login", {
2238
+ async function yt(e, t, r = !0) {
2239
+ let i = await n("auth.login", {
2222
2240
  email: e,
2223
- password: t
2241
+ password: t,
2242
+ remember: r
2224
2243
  });
2225
- return f(r.expires_at), r;
2244
+ return f(i.expires_at), i;
2226
2245
  }
2227
- async function yt(e, t, r) {
2246
+ async function bt(e, t, r) {
2228
2247
  let i = await n("auth.signup", {
2229
2248
  email: e,
2230
2249
  password: t,
@@ -2232,42 +2251,42 @@ async function yt(e, t, r) {
2232
2251
  });
2233
2252
  return f(i.expires_at), i;
2234
2253
  }
2235
- async function bt() {
2254
+ async function xt() {
2236
2255
  return n("auth.me");
2237
2256
  }
2238
- async function xt() {
2257
+ async function St() {
2239
2258
  return (await n("auth.list_tenants")).tenants;
2240
2259
  }
2241
- async function St(e) {
2260
+ async function Ct(e) {
2242
2261
  let t = await n("auth.switch_tenant", { tenant_id: e });
2243
2262
  return f(t.expires_at), t;
2244
2263
  }
2245
- async function Ct() {
2264
+ async function wt() {
2246
2265
  await n("auth.logout");
2247
2266
  }
2248
- async function wt(e) {
2267
+ async function Tt(e) {
2249
2268
  return (await n("sso_provider.list", e ? { tenant_code: e } : {})).providers;
2250
2269
  }
2251
- function Tt(e, t, n) {
2270
+ function Et(e, t, n) {
2252
2271
  let r = new URLSearchParams();
2253
2272
  t && r.set("tenant", t), n && r.set("redirect", n);
2254
2273
  let i = r.toString();
2255
2274
  return `/api/auth/sso/authorize/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
2256
2275
  }
2257
- async function Et(e, t, r) {
2276
+ async function Dt(e, t, r) {
2258
2277
  let i = {
2259
2278
  target_user_id: e,
2260
2279
  reason: t
2261
2280
  };
2262
2281
  return r != null && (i.duration_minutes = r), n("impersonation.start", i);
2263
2282
  }
2264
- async function Dt() {
2283
+ async function Ot() {
2265
2284
  return n("impersonation.stop");
2266
2285
  }
2267
- async function Ot(e) {
2286
+ async function kt(e) {
2268
2287
  await n("impersonation.revoke", { session_id: e });
2269
2288
  }
2270
- async function kt(e, t) {
2289
+ async function At(e, t) {
2271
2290
  await n("auth.change_password", {
2272
2291
  current_password: e,
2273
2292
  new_password: t
@@ -2275,7 +2294,7 @@ async function kt(e, t) {
2275
2294
  }
2276
2295
  //#endregion
2277
2296
  //#region src/stores/auth.ts
2278
- var At = W((e) => ({
2297
+ var jt = W((e) => ({
2279
2298
  user: null,
2280
2299
  isAuthenticated: !1,
2281
2300
  isLoading: !0,
@@ -2283,9 +2302,9 @@ var At = W((e) => ({
2283
2302
  tenants: [],
2284
2303
  initialize: async () => {
2285
2304
  try {
2286
- let t = await bt(), n = t.tenant ?? null, r = [];
2305
+ let t = await xt(), n = t.tenant ?? null, r = [];
2287
2306
  try {
2288
- r = await xt();
2307
+ r = await St();
2289
2308
  } catch {}
2290
2309
  e({
2291
2310
  user: t,
@@ -2304,7 +2323,7 @@ var At = W((e) => ({
2304
2323
  },
2305
2324
  refreshMe: async () => {
2306
2325
  try {
2307
- let t = await bt();
2326
+ let t = await xt();
2308
2327
  e({
2309
2328
  user: t,
2310
2329
  activeTenant: t.tenant ?? null
@@ -2328,7 +2347,7 @@ var At = W((e) => ({
2328
2347
  logout: async () => {
2329
2348
  t();
2330
2349
  try {
2331
- await Ct();
2350
+ await wt();
2332
2351
  } catch {}
2333
2352
  e({
2334
2353
  user: null,
@@ -2340,18 +2359,18 @@ var At = W((e) => ({
2340
2359
  }));
2341
2360
  //#endregion
2342
2361
  //#region src/hooks/useSchema.ts
2343
- function jt() {
2344
- let e = At((e) => e.isAuthenticated);
2362
+ function Mt() {
2363
+ let e = jt((e) => e.isAuthenticated);
2345
2364
  return z({
2346
2365
  queryKey: ["schema", e],
2347
- queryFn: gt,
2366
+ queryFn: _t,
2348
2367
  staleTime: Infinity,
2349
2368
  enabled: e
2350
2369
  });
2351
2370
  }
2352
2371
  //#endregion
2353
2372
  //#region src/stores/appearance.ts
2354
- var Mt = {
2373
+ var Nt = {
2355
2374
  theme: "light",
2356
2375
  accent: "violet",
2357
2376
  density: "compact",
@@ -2364,26 +2383,26 @@ var Mt = {
2364
2383
  aiSurface: "both",
2365
2384
  faviconSource: "google",
2366
2385
  toastPosition: "bottom-right"
2367
- }, Nt = ["light", "dark"], Pt = [
2386
+ }, Pt = ["light", "dark"], Ft = [
2368
2387
  "violet",
2369
2388
  "blue",
2370
2389
  "teal",
2371
2390
  "amber",
2372
2391
  "rose"
2373
- ], Ft = [
2392
+ ], It = [
2374
2393
  "compact",
2375
2394
  "comfortable",
2376
2395
  "cozy"
2377
- ], It = ["wide", "collapsed"], Lt = ["top", "bottom"], Rt = [
2396
+ ], Lt = ["wide", "collapsed"], Rt = ["top", "bottom"], zt = [
2378
2397
  "command",
2379
2398
  "panel",
2380
2399
  "both",
2381
2400
  "off"
2382
- ], zt = [
2401
+ ], Bt = [
2383
2402
  "google",
2384
2403
  "direct",
2385
2404
  "none"
2386
- ], Bt = [
2405
+ ], Vt = [
2387
2406
  "top-left",
2388
2407
  "top-center",
2389
2408
  "top-right",
@@ -2391,48 +2410,48 @@ var Mt = {
2391
2410
  "bottom-center",
2392
2411
  "bottom-right"
2393
2412
  ];
2394
- function Vt(e, t) {
2413
+ function Ht(e, t) {
2395
2414
  return typeof t == "string" && e.includes(t) ? t : void 0;
2396
2415
  }
2397
- function Ht(e) {
2398
- let t = {}, n = Vt(Nt, e.theme);
2416
+ function Ut(e) {
2417
+ let t = {}, n = Ht(Pt, e.theme);
2399
2418
  n && (t.theme = n);
2400
- let r = Vt(Pt, e.accent);
2419
+ let r = Ht(Ft, e.accent);
2401
2420
  r && (t.accent = r);
2402
- let i = Vt(Ft, e.density);
2421
+ let i = Ht(It, e.density);
2403
2422
  i && (t.density = i);
2404
- let a = Vt(It, e.sidebar);
2423
+ let a = Ht(Lt, e.sidebar);
2405
2424
  a && (t.sidebar = a);
2406
- let o = Vt(Lt, e.tabsPosition);
2425
+ let o = Ht(Rt, e.tabsPosition);
2407
2426
  o && (t.tabsPosition = o);
2408
- let s = Vt(Rt, e.aiSurface);
2427
+ let s = Ht(zt, e.aiSurface);
2409
2428
  s && (t.aiSurface = s);
2410
- let c = Vt(zt, e.faviconSource);
2429
+ let c = Ht(Bt, e.faviconSource);
2411
2430
  c && (t.faviconSource = c);
2412
- let l = Vt(Bt, e.toastPosition);
2431
+ let l = Ht(Vt, e.toastPosition);
2413
2432
  return l && (t.toastPosition = l), typeof e.tabsMaxOpen == "number" && e.tabsMaxOpen > 0 && (t.tabsMaxOpen = e.tabsMaxOpen), typeof e.radius == "number" && e.radius >= 0 && e.radius <= 32 && (t.radius = e.radius), typeof e.zebra == "boolean" && (t.zebra = e.zebra), typeof e.tabsPersist == "boolean" && (t.tabsPersist = e.tabsPersist), t;
2414
2433
  }
2415
- var Ut = "declarion-appearance";
2416
- function Wt() {
2434
+ var Wt = "declarion-appearance";
2435
+ function Gt() {
2417
2436
  if (typeof window > "u") return null;
2418
2437
  try {
2419
- let e = localStorage.getItem(Ut);
2438
+ let e = localStorage.getItem(Wt);
2420
2439
  return e ? JSON.parse(e) : null;
2421
2440
  } catch {
2422
2441
  return null;
2423
2442
  }
2424
2443
  }
2425
- function Gt(e) {
2444
+ function Kt(e) {
2426
2445
  if (!(typeof window > "u")) try {
2427
- localStorage.setItem(Ut, JSON.stringify(e));
2446
+ localStorage.setItem(Wt, JSON.stringify(e));
2428
2447
  } catch {}
2429
2448
  }
2430
- function Kt(e) {
2449
+ function qt(e) {
2431
2450
  if (typeof document > "u") return;
2432
2451
  let t = document.documentElement;
2433
2452
  t.dataset.theme = e.theme, t.dataset.accent = e.accent, t.dataset.density = e.density, t.dataset.sidebar = e.sidebar, t.dataset.tabbar = e.tabsPosition, t.dataset.zebra = e.zebra ? "on" : "off", t.dataset.ai = e.aiSurface, t.style.setProperty("--radius-md", `${e.radius}px`), t.style.setProperty("--radius-lg", `${e.radius + 3}px`);
2434
2453
  }
2435
- var qt = {
2454
+ var Jt = {
2436
2455
  ui_theme: "theme",
2437
2456
  ui_accent: "accent",
2438
2457
  ui_density: "density",
@@ -2445,54 +2464,54 @@ var qt = {
2445
2464
  ui_ai_surface: "aiSurface",
2446
2465
  ui_favicon_source: "faviconSource",
2447
2466
  ui_toast_position: "toastPosition"
2448
- }, Jt = Wt(), Yt = Jt ? new Set(Object.keys(Jt)) : /* @__PURE__ */ new Set(), Xt = {
2449
- ...Mt,
2450
- ...Jt ? Ht(Jt) : {}
2467
+ }, Yt = Gt(), Xt = Yt ? new Set(Object.keys(Yt)) : /* @__PURE__ */ new Set(), Zt = {
2468
+ ...Nt,
2469
+ ...Yt ? Ut(Yt) : {}
2451
2470
  };
2452
- typeof window < "u" && Kt(Xt);
2453
- var Zt = W((e, t) => ({
2454
- ...Xt,
2471
+ typeof window < "u" && qt(Zt);
2472
+ var Qt = W((e, t) => ({
2473
+ ...Zt,
2455
2474
  set: (n, r) => {
2456
- let i = Ht({ [n]: r });
2475
+ let i = Ut({ [n]: r });
2457
2476
  if (i[n] === void 0) return;
2458
2477
  let a = {
2459
2478
  ...t(),
2460
2479
  ...i
2461
2480
  };
2462
- Kt(a), Gt(a), Yt.add(n), e(i);
2481
+ qt(a), Kt(a), Xt.add(n), e(i);
2463
2482
  },
2464
2483
  setMany: (n) => {
2465
- let r = Ht(n);
2484
+ let r = Ut(n);
2466
2485
  if (!Object.keys(r).length) return;
2467
2486
  let i = {
2468
2487
  ...t(),
2469
2488
  ...r
2470
2489
  };
2471
- Kt(i), Gt(i);
2472
- for (let e of Object.keys(r)) Yt.add(e);
2490
+ qt(i), Kt(i);
2491
+ for (let e of Object.keys(r)) Xt.add(e);
2473
2492
  e(r);
2474
2493
  },
2475
2494
  hydrateFromParams: (t) => {
2476
2495
  let n = {};
2477
- for (let [e, r] of Object.entries(qt)) Yt.has(r) || t[e] !== void 0 && (n[r] = t[e]);
2478
- let r = Ht(n);
2479
- Object.keys(r).length && (Kt({
2480
- ...Zt.getState(),
2496
+ for (let [e, r] of Object.entries(Jt)) Xt.has(r) || t[e] !== void 0 && (n[r] = t[e]);
2497
+ let r = Ut(n);
2498
+ Object.keys(r).length && (qt({
2499
+ ...Qt.getState(),
2481
2500
  ...r
2482
2501
  }), e(r));
2483
2502
  }
2484
2503
  }));
2485
2504
  //#endregion
2486
2505
  //#region src/lib/utils.ts
2487
- function Qt(...e) {
2506
+ function $t(...e) {
2488
2507
  return G(te(e));
2489
2508
  }
2490
- function $t(e) {
2509
+ function en(e) {
2491
2510
  return e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0;
2492
2511
  }
2493
2512
  //#endregion
2494
2513
  //#region src/components/shared/DynamicIcon.tsx
2495
- function en({ name: e, size: t, className: n, style: r }) {
2514
+ function tn({ name: e, size: t, className: n, style: r }) {
2496
2515
  return /* @__PURE__ */ V(q[e] ?? q.folder, {
2497
2516
  size: typeof t == "number" ? t : typeof t == "string" ? parseFloat(t) : void 0,
2498
2517
  cls: n,
@@ -2501,61 +2520,61 @@ function en({ name: e, size: t, className: n, style: r }) {
2501
2520
  }
2502
2521
  //#endregion
2503
2522
  //#region src/components/shared/Markdown.tsx
2504
- var tn = M(() => import("./MarkdownRenderer-Dl3GDuY9.js").then((e) => ({ default: e.MarkdownRenderer })));
2505
- function nn() {
2523
+ var nn = M(() => import("./MarkdownRenderer-bs52XQ7M.js").then((e) => ({ default: e.MarkdownRenderer })));
2524
+ function rn() {
2506
2525
  return /* @__PURE__ */ V("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
2507
2526
  }
2508
- function rn(e) {
2527
+ function an(e) {
2509
2528
  return /* @__PURE__ */ V(A, {
2510
- fallback: /* @__PURE__ */ V(nn, {}),
2511
- children: /* @__PURE__ */ V(tn, { ...e })
2529
+ fallback: /* @__PURE__ */ V(rn, {}),
2530
+ children: /* @__PURE__ */ V(nn, { ...e })
2512
2531
  });
2513
2532
  }
2514
2533
  //#endregion
2515
2534
  //#region src/api/data.ts
2516
- function an(e, t) {
2535
+ function on(e, t) {
2517
2536
  let n = new URL(`/api/data/${e}`, window.location.origin);
2518
2537
  if (t.page && n.searchParams.set("page", String(t.page)), t.per_page && n.searchParams.set("per_page", String(t.per_page)), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.expand) for (let e of t.expand) n.searchParams.append("expand", e);
2519
2538
  return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.screen && n.searchParams.set("screen", t.screen), t.preview && n.searchParams.set("preview", "true"), t.count && n.searchParams.set("count", t.count), n.pathname + n.search;
2520
2539
  }
2521
- async function on(t, n = {}, r = {}) {
2522
- return e(an(t, n), { signal: r.signal });
2540
+ async function sn(t, n = {}, r = {}) {
2541
+ return e(on(t, n), { signal: r.signal });
2523
2542
  }
2524
- async function sn(t, n) {
2543
+ async function cn(t, n) {
2525
2544
  let r = new URLSearchParams();
2526
2545
  if (typeof n == "string") r.set("id", n);
2527
2546
  else for (let [e, t] of Object.entries(n)) r.set(e, t);
2528
2547
  return e(`/api/data/${t}?${r.toString()}`);
2529
2548
  }
2530
- async function cn(t, n) {
2549
+ async function ln(t, n) {
2531
2550
  return { data: (await e(`/api/data/${t}`, {
2532
2551
  method: "POST",
2533
2552
  body: JSON.stringify([n])
2534
2553
  }))[0] };
2535
2554
  }
2536
- async function ln(e, t, n) {
2555
+ async function un(e, t, n) {
2537
2556
  let r = typeof t == "string" ? { id: t } : t;
2538
- return { data: ((await _n(`${e}.__update`, { items: [{
2557
+ return { data: ((await vn(`${e}.__update`, { items: [{
2539
2558
  ...r,
2540
2559
  ...n
2541
2560
  }] })).result?.rows ?? [])[0] };
2542
2561
  }
2543
- async function un(e, t) {
2544
- let n = typeof t == "string" ? t : dn(t);
2545
- await _n(`${e}.__delete`, gn(void 0, [n]));
2562
+ async function dn(e, t) {
2563
+ let n = typeof t == "string" ? t : fn(t);
2564
+ await vn(`${e}.__delete`, _n(void 0, [n]));
2546
2565
  }
2547
- function dn(e) {
2566
+ function fn(e) {
2548
2567
  let t = Object.values(e);
2549
2568
  return t.length === 1 ? t[0] : t.join("");
2550
2569
  }
2551
- async function fn(t, n) {
2570
+ async function pn(t, n) {
2552
2571
  let r = typeof n == "string" ? { id: n } : n;
2553
2572
  await e(`/api/data/${t}/restore`, {
2554
2573
  method: "POST",
2555
2574
  body: JSON.stringify([r])
2556
2575
  });
2557
2576
  }
2558
- async function pn(e, t) {
2577
+ async function mn(e, t) {
2559
2578
  let n = await S(`/api/data/${e}/export`, {
2560
2579
  method: "POST",
2561
2580
  body: JSON.stringify(t)
@@ -2565,7 +2584,7 @@ async function pn(e, t) {
2565
2584
  filename: n.filename
2566
2585
  };
2567
2586
  }
2568
- var mn = class extends Error {
2587
+ var hn = class extends Error {
2569
2588
  status;
2570
2589
  response;
2571
2590
  constructor(e, t) {
@@ -2573,36 +2592,36 @@ var mn = class extends Error {
2573
2592
  super(n || "Action failed"), this.name = "ActionBatchError", this.status = e, this.response = t;
2574
2593
  }
2575
2594
  };
2576
- function hn(e) {
2595
+ function gn(e) {
2577
2596
  if (!e || typeof e != "object") return !1;
2578
2597
  let t = e;
2579
2598
  return typeof t.status == "string" && Array.isArray(t.errors);
2580
2599
  }
2581
- function gn(e, t) {
2600
+ function _n(e, t) {
2582
2601
  let n = { ...e ?? {} };
2583
2602
  if ("_ids" in n) throw Error("handler param \"_ids\" collides with reserved key");
2584
2603
  return t !== void 0 && (n._ids = t), n;
2585
2604
  }
2586
- async function _n(t, n) {
2605
+ async function vn(t, n) {
2587
2606
  try {
2588
2607
  return await e(`/api/actions/${t}`, {
2589
2608
  method: "POST",
2590
2609
  body: JSON.stringify(n)
2591
2610
  });
2592
2611
  } catch (e) {
2593
- throw e instanceof r && hn(e.raw) ? new mn(e.status, e.raw) : e;
2612
+ throw e instanceof r && gn(e.raw) ? new hn(e.status, e.raw) : e;
2594
2613
  }
2595
2614
  }
2596
- async function vn(t, n) {
2615
+ async function yn(t, n) {
2597
2616
  let r = new URLSearchParams();
2598
2617
  return r.set("ids", n.join(",")), e(`/api/associations/${t}?${r.toString()}`);
2599
2618
  }
2600
2619
  //#endregion
2601
2620
  //#region src/types/fieldType.ts
2602
- var yn = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
2621
+ var bn = /* @__PURE__ */ "bool.bytes.date.decimal.email.enum.float.int.int_array.json.multilang.multilang_text.password.phone.ref.rich_text.secret.string.string_array.structure.tags.text.time.timestamp.url.uuid.uuid_array".split(".");
2603
2622
  //#endregion
2604
2623
  //#region src/components/shared/CopyButton.tsx
2605
- function bn({ value: e, title: t, size: n = "icon" }) {
2624
+ function xn({ value: e, title: t, size: n = "icon" }) {
2606
2625
  let [r, i] = R(!1), a = N(async (t) => {
2607
2626
  t.stopPropagation(), t.preventDefault();
2608
2627
  try {
@@ -2621,7 +2640,7 @@ function bn({ value: e, title: t, size: n = "icon" }) {
2621
2640
  }
2622
2641
  //#endregion
2623
2642
  //#region src/components/fields/StringField.tsx
2624
- function xn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2643
+ function Sn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2625
2644
  if (r === "display") {
2626
2645
  let t = String(n ?? "");
2627
2646
  return e.copyable && t ? /* @__PURE__ */ H("span", {
@@ -2633,7 +2652,7 @@ function xn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2633
2652
  children: [/* @__PURE__ */ V("span", {
2634
2653
  style: { fontSize: 12.5 },
2635
2654
  children: t
2636
- }), /* @__PURE__ */ V(bn, {
2655
+ }), /* @__PURE__ */ V(xn, {
2637
2656
  value: t,
2638
2657
  size: "sm"
2639
2658
  })]
@@ -2655,7 +2674,7 @@ function xn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2655
2674
  }
2656
2675
  //#endregion
2657
2676
  //#region src/components/fields/TextField.tsx
2658
- function Sn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
2677
+ function Cn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
2659
2678
  let c = e.display?.widget;
2660
2679
  if (r === "display") {
2661
2680
  let t = String(n ?? "");
@@ -2666,7 +2685,7 @@ function Sn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2666
2685
  },
2667
2686
  children: "—"
2668
2687
  });
2669
- let r = c === "markdown" ? /* @__PURE__ */ V(rn, { content: t }) : c === "code" ? /* @__PURE__ */ V("pre", {
2688
+ let r = c === "markdown" ? /* @__PURE__ */ V(an, { content: t }) : c === "code" ? /* @__PURE__ */ V("pre", {
2670
2689
  className: "mono",
2671
2690
  style: {
2672
2691
  fontSize: 12,
@@ -2698,7 +2717,7 @@ function Sn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2698
2717
  top: 0,
2699
2718
  right: 0
2700
2719
  },
2701
- children: /* @__PURE__ */ V(bn, {
2720
+ children: /* @__PURE__ */ V(xn, {
2702
2721
  value: t,
2703
2722
  size: "sm"
2704
2723
  })
@@ -2713,7 +2732,7 @@ function Sn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2713
2732
  onChange: (e) => i?.(e)
2714
2733
  });
2715
2734
  let l = c === "markdown" || c === "code" ? 10 : 4;
2716
- return /* @__PURE__ */ V(Ae, {
2735
+ return /* @__PURE__ */ V(je, {
2717
2736
  id: s,
2718
2737
  name: t,
2719
2738
  ariaRequired: e.required,
@@ -2725,8 +2744,8 @@ function Sn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2725
2744
  }
2726
2745
  //#endregion
2727
2746
  //#region src/components/fields/EnumField.tsx
2728
- var Cn = "__declarion_enum_null__";
2729
- function wn({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
2747
+ var wn = "__declarion_enum_null__";
2748
+ function Tn({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
2730
2749
  let o = e.values ?? [], s = o.find((e) => e.code === t);
2731
2750
  if (n === "display") return s ? /* @__PURE__ */ V(X, {
2732
2751
  tone: s.color ?? "slate",
@@ -2739,26 +2758,26 @@ function wn({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
2739
2758
  },
2740
2759
  children: "—"
2741
2760
  });
2742
- let c = !e.required, l = t != null && t !== "" ? String(t) : Cn, u = [...c ? [{
2743
- value: Cn,
2761
+ let c = !e.required, l = t != null && t !== "" ? String(t) : wn, u = [...c ? [{
2762
+ value: wn,
2744
2763
  label: "— None —"
2745
2764
  }] : [], ...o.map((e) => ({
2746
2765
  value: e.code,
2747
2766
  label: Q(e.name) || e.code
2748
2767
  }))];
2749
- return /* @__PURE__ */ V(Pe, {
2768
+ return /* @__PURE__ */ V(Fe, {
2750
2769
  id: i,
2751
2770
  "aria-labelledby": a,
2752
2771
  "aria-required": e.required || void 0,
2753
2772
  value: l,
2754
2773
  options: u,
2755
- onChange: (e) => r?.(e === Cn ? null : e),
2774
+ onChange: (e) => r?.(e === wn ? null : e),
2756
2775
  placeholder: "Select…"
2757
2776
  });
2758
2777
  }
2759
2778
  //#endregion
2760
2779
  //#region src/components/fields/EmailField.tsx
2761
- function Tn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2780
+ function En({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2762
2781
  return /* @__PURE__ */ V(Z, {
2763
2782
  id: i,
2764
2783
  name: t,
@@ -2770,7 +2789,7 @@ function Tn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2770
2789
  }
2771
2790
  //#endregion
2772
2791
  //#region src/components/fields/UrlField.tsx
2773
- function En({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2792
+ function Dn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2774
2793
  return /* @__PURE__ */ V(Z, {
2775
2794
  id: i,
2776
2795
  name: t,
@@ -2783,7 +2802,7 @@ function En({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2783
2802
  }
2784
2803
  //#endregion
2785
2804
  //#region src/components/fields/PhoneField.tsx
2786
- function Dn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2805
+ function On({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2787
2806
  return /* @__PURE__ */ V(Z, {
2788
2807
  id: i,
2789
2808
  name: t,
@@ -2796,10 +2815,10 @@ function Dn({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2796
2815
  }
2797
2816
  //#endregion
2798
2817
  //#region src/lib/timestamp.ts
2799
- function On(e = /* @__PURE__ */ new Date()) {
2818
+ function kn(e = /* @__PURE__ */ new Date()) {
2800
2819
  return ie(e);
2801
2820
  }
2802
- function kn(e) {
2821
+ function An(e) {
2803
2822
  let t = e.match(/([+-]\d{2}:\d{2})$/), n = e.endsWith("Z");
2804
2823
  if (t || n) {
2805
2824
  let r = new Date(e);
@@ -2832,7 +2851,7 @@ function kn(e) {
2832
2851
  timeStyle: "short"
2833
2852
  }).format(r);
2834
2853
  }
2835
- function An(e, t = /* @__PURE__ */ new Date()) {
2854
+ function jn(e, t = /* @__PURE__ */ new Date()) {
2836
2855
  if (e == null || e === "") return {
2837
2856
  text: "—",
2838
2857
  absolute: ""
@@ -2845,7 +2864,7 @@ function An(e, t = /* @__PURE__ */ new Date()) {
2845
2864
  absolute: t
2846
2865
  };
2847
2866
  }
2848
- let r = kn(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
2867
+ let r = An(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
2849
2868
  return Math.abs(i) > 720 * 60 * 60 * 1e3 ? {
2850
2869
  text: ie(n, { representation: "date" }),
2851
2870
  absolute: r
@@ -2856,7 +2875,7 @@ function An(e, t = /* @__PURE__ */ new Date()) {
2856
2875
  }
2857
2876
  //#endregion
2858
2877
  //#region src/components/fields/TimestampField.tsx
2859
- function jn(e, t) {
2878
+ function Mn(e, t) {
2860
2879
  if (t) {
2861
2880
  let t = /* @__PURE__ */ new Date(e + "T00:00:00");
2862
2881
  return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
@@ -2902,7 +2921,7 @@ function jn(e, t) {
2902
2921
  minute: "2-digit"
2903
2922
  }).format(i);
2904
2923
  }
2905
- function Mn(e, t) {
2924
+ function Nn(e, t) {
2906
2925
  if (t) {
2907
2926
  let t = /* @__PURE__ */ new Date(e + "T00:00:00");
2908
2927
  return isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(void 0, {
@@ -2920,14 +2939,14 @@ function Mn(e, t) {
2920
2939
  minute: "2-digit"
2921
2940
  }).format(n);
2922
2941
  }
2923
- function Nn(e) {
2942
+ function Pn(e) {
2924
2943
  if (e.endsWith("Z")) return "UTC";
2925
2944
  let t = e.match(/([+-]\d{2}:\d{2})$/);
2926
2945
  if (!t) return null;
2927
2946
  let n = t[1].charAt(0), r = parseInt(t[1].substring(1, 3), 10), i = parseInt(t[1].substring(4, 6), 10);
2928
2947
  return r === 0 && i === 0 ? "UTC" : `UTC${n}${r}${i > 0 ? `:${String(i).padStart(2, "0")}` : ""}`;
2929
2948
  }
2930
- function Pn(e, t) {
2949
+ function Fn(e, t) {
2931
2950
  let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
2932
2951
  if (isNaN(i.getTime())) return "";
2933
2952
  if (r) {
@@ -2940,13 +2959,13 @@ function Pn(e, t) {
2940
2959
  }
2941
2960
  return t ? e.slice(0, 10) : e.slice(0, 16);
2942
2961
  }
2943
- function Fn(e, t) {
2962
+ function In(e, t) {
2944
2963
  let n = new Date(e);
2945
2964
  if (isNaN(n.getTime())) return "";
2946
2965
  let r = n.getFullYear(), i = String(n.getMonth() + 1).padStart(2, "0"), a = String(n.getDate()).padStart(2, "0");
2947
2966
  return t ? `${r}-${i}-${a}` : `${r}-${i}-${a}T${String(n.getHours()).padStart(2, "0")}:${String(n.getMinutes()).padStart(2, "0")}`;
2948
2967
  }
2949
- function In({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2968
+ function Ln({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2950
2969
  let o = e.type === "date", s = !!e.timezone;
2951
2970
  if (r === "display") {
2952
2971
  if (!n) return /* @__PURE__ */ V("span", {
@@ -2956,7 +2975,7 @@ function In({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2956
2975
  },
2957
2976
  children: "—"
2958
2977
  });
2959
- let e = String(n), t = s ? jn(e, o) : Mn(e, o), r = s && !o ? Nn(e) : null;
2978
+ let e = String(n), t = s ? Mn(e, o) : Nn(e, o), r = s && !o ? Pn(e) : null;
2960
2979
  return /* @__PURE__ */ H("span", {
2961
2980
  style: { fontSize: 12.5 },
2962
2981
  children: [t, r && /* @__PURE__ */ V("span", {
@@ -2968,7 +2987,7 @@ function In({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2968
2987
  })]
2969
2988
  });
2970
2989
  }
2971
- let c = n ? s ? Pn(String(n), o) : Fn(String(n), o) : "";
2990
+ let c = n ? s ? Fn(String(n), o) : In(String(n), o) : "";
2972
2991
  return /* @__PURE__ */ V(Z, {
2973
2992
  id: a,
2974
2993
  name: t,
@@ -2989,13 +3008,13 @@ function In({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2989
3008
  i?.(e);
2990
3009
  return;
2991
3010
  }
2992
- i?.(On(t));
3011
+ i?.(kn(t));
2993
3012
  }
2994
3013
  });
2995
3014
  }
2996
3015
  //#endregion
2997
3016
  //#region src/components/fields/BoolField.tsx
2998
- function Ln({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
3017
+ function Rn({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
2999
3018
  let a = !!e;
3000
3019
  return t === "display" ? /* @__PURE__ */ H("span", {
3001
3020
  style: {
@@ -3020,7 +3039,7 @@ function Ln({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
3020
3039
  }
3021
3040
  //#endregion
3022
3041
  //#region src/components/fields/NumberField.tsx
3023
- function Rn(e) {
3042
+ function zn(e) {
3024
3043
  let t = e.trim();
3025
3044
  if (t === "" || t === "-") return t;
3026
3045
  let n = t.startsWith("-"), [r, i] = (n ? t.slice(1) : t).split("."), a;
@@ -3032,8 +3051,8 @@ function Rn(e) {
3032
3051
  let o = n ? `-${a}` : a;
3033
3052
  return i !== void 0 && (o += `.${i}`), o;
3034
3053
  }
3035
- var zn = new Intl.NumberFormat();
3036
- function Bn({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3054
+ var Bn = new Intl.NumberFormat();
3055
+ function Vn({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3037
3056
  let s = e.display?.widget === "money", c = e.type === "decimal" || s, l = a?.$units?.[t], u = !l && e.unit ? e.unit.display || e.unit.storage : void 0, d = l || (u && !u.startsWith("$") ? u : void 0);
3038
3057
  if (r === "display") {
3039
3058
  if (n == null) return /* @__PURE__ */ V("span", {
@@ -3044,10 +3063,10 @@ function Bn({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3044
3063
  children: "—"
3045
3064
  });
3046
3065
  let e;
3047
- if (c && typeof n == "string") e = Rn(n);
3066
+ if (c && typeof n == "string") e = zn(n);
3048
3067
  else {
3049
3068
  let t = Number(n);
3050
- e = isNaN(t) ? null : zn.format(t);
3069
+ e = isNaN(t) ? null : Bn.format(t);
3051
3070
  }
3052
3071
  return e == null ? /* @__PURE__ */ V("span", {
3053
3072
  style: { fontSize: 12.5 },
@@ -3092,7 +3111,7 @@ function Bn({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3092
3111
  }
3093
3112
  //#endregion
3094
3113
  //#region src/hooks/useEntityData.ts
3095
- function Vn(e, t) {
3114
+ function Hn(e, t) {
3096
3115
  let n = {
3097
3116
  ...t,
3098
3117
  count: "window"
@@ -3103,12 +3122,12 @@ function Vn(e, t) {
3103
3122
  e,
3104
3123
  n
3105
3124
  ],
3106
- queryFn: ({ signal: t }) => on(e, n, { signal: t }),
3125
+ queryFn: ({ signal: t }) => sn(e, n, { signal: t }),
3107
3126
  enabled: !!e,
3108
3127
  placeholderData: (t, n) => n?.queryKey?.[1] === e ? t : void 0
3109
3128
  });
3110
3129
  }
3111
- function Hn(e, t) {
3130
+ function Un(e, t) {
3112
3131
  let n = {
3113
3132
  ...t,
3114
3133
  count: "only",
@@ -3124,7 +3143,7 @@ function Hn(e, t) {
3124
3143
  e,
3125
3144
  n
3126
3145
  ],
3127
- queryFn: ({ signal: t }) => on(e, n, { signal: t }),
3146
+ queryFn: ({ signal: t }) => sn(e, n, { signal: t }),
3128
3147
  enabled: !!e,
3129
3148
  retry: 1,
3130
3149
  staleTime: 3e4,
@@ -3133,14 +3152,14 @@ function Hn(e, t) {
3133
3152
  }
3134
3153
  //#endregion
3135
3154
  //#region src/hooks/useEntity.ts
3136
- function Un(e) {
3137
- let { data: t } = jt();
3155
+ function Wn(e) {
3156
+ let { data: t } = Mt();
3138
3157
  if (!(!t || !e)) return t.entities[e];
3139
3158
  }
3140
3159
  //#endregion
3141
3160
  //#region src/components/fields/RefField.tsx
3142
- function Wn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
3143
- let s = e.ref?.entity, c = Un(s), l = e.display?.ref_display_field ?? e.ref?.display?.field ?? c?.display?.display_field, u = I(() => c ? [...c.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [c]), { data: d, isLoading: f } = Vn(n === "edit" ? s : void 0, {
3161
+ function Gn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
3162
+ let s = e.ref?.entity, c = Wn(s), l = e.display?.ref_display_field ?? e.ref?.display?.field ?? c?.display?.display_field, u = I(() => c ? [...c.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [c]), { data: d, isLoading: f } = Hn(n === "edit" ? s : void 0, {
3144
3163
  per_page: 200,
3145
3164
  sort: l ? `${l}:asc` : void 0
3146
3165
  }), p = I(() => d?.data ?? [], [d?.data]), m = I(() => {
@@ -3150,12 +3169,12 @@ function Wn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
3150
3169
  let t = i[s];
3151
3170
  if (t) {
3152
3171
  let n = t[e];
3153
- if (n) return Je(n, l, e);
3172
+ if (n) return Ye(n, l, e);
3154
3173
  }
3155
3174
  }
3156
3175
  if (p.length > 0) {
3157
3176
  let n = p.find((t) => String(t[u]) === e);
3158
- if (n) return Je(n, l, String(t));
3177
+ if (n) return Ye(n, l, String(t));
3159
3178
  }
3160
3179
  return e;
3161
3180
  }, [
@@ -3187,11 +3206,11 @@ function Wn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
3187
3206
  let t = String(e[u]);
3188
3207
  return {
3189
3208
  value: t,
3190
- label: Je(e, l, t)
3209
+ label: Ye(e, l, t)
3191
3210
  };
3192
3211
  })
3193
3212
  ];
3194
- return /* @__PURE__ */ V(Pe, {
3213
+ return /* @__PURE__ */ V(Fe, {
3195
3214
  id: a,
3196
3215
  "aria-labelledby": o,
3197
3216
  "aria-required": e.required || void 0,
@@ -3203,29 +3222,29 @@ function Wn({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
3203
3222
  }
3204
3223
  //#endregion
3205
3224
  //#region src/components/fields/JsonField.tsx
3206
- var Gn = M(() => import("./JsonEditor-CexL5HXN.js").then((e) => ({ default: e.JsonEditor })));
3207
- function Kn() {
3225
+ var Kn = M(() => import("./JsonEditor-CexL5HXN.js").then((e) => ({ default: e.JsonEditor })));
3226
+ function qn() {
3208
3227
  return /* @__PURE__ */ V("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
3209
3228
  }
3210
- function qn(e) {
3229
+ function Jn(e) {
3211
3230
  return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1;
3212
3231
  }
3213
- function Jn({ value: e, mode: t, onChange: n, fieldId: r }) {
3214
- return t === "display" ? qn(e) ? /* @__PURE__ */ V("span", {
3232
+ function Yn({ value: e, mode: t, onChange: n, fieldId: r }) {
3233
+ return t === "display" ? Jn(e) ? /* @__PURE__ */ V("span", {
3215
3234
  style: {
3216
3235
  fontSize: 12.5,
3217
3236
  color: "var(--text-4)"
3218
3237
  },
3219
3238
  children: "—"
3220
3239
  }) : /* @__PURE__ */ V(A, {
3221
- fallback: /* @__PURE__ */ V(Kn, {}),
3222
- children: /* @__PURE__ */ V(Gn, {
3240
+ fallback: /* @__PURE__ */ V(qn, {}),
3241
+ children: /* @__PURE__ */ V(Kn, {
3223
3242
  value: e,
3224
3243
  readOnly: !0
3225
3244
  })
3226
3245
  }) : /* @__PURE__ */ V(A, {
3227
- fallback: /* @__PURE__ */ V(Kn, {}),
3228
- children: /* @__PURE__ */ V(Gn, {
3246
+ fallback: /* @__PURE__ */ V(qn, {}),
3247
+ children: /* @__PURE__ */ V(Kn, {
3229
3248
  value: e,
3230
3249
  onChange: n,
3231
3250
  id: r
@@ -3234,14 +3253,14 @@ function Jn({ value: e, mode: t, onChange: n, fieldId: r }) {
3234
3253
  }
3235
3254
  //#endregion
3236
3255
  //#region src/components/fields/MultilangField.tsx
3237
- function Yn(e) {
3256
+ function Xn(e) {
3238
3257
  return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
3239
3258
  }
3240
- function Xn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3241
- let { data: o } = jt(), s = o?.languages?.length ? o.languages : [{
3259
+ function Zn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3260
+ let { data: o } = Mt(), s = o?.languages?.length ? o.languages : [{
3242
3261
  code: "en",
3243
3262
  name: { en: "English" }
3244
- }], c = Yn(n);
3263
+ }], c = Xn(n);
3245
3264
  if (r === "display") return /* @__PURE__ */ V("span", {
3246
3265
  style: { fontSize: 12.5 },
3247
3266
  children: Object.values(c)[0] ?? "—"
@@ -3297,14 +3316,14 @@ function Xn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3297
3316
  }
3298
3317
  //#endregion
3299
3318
  //#region src/components/fields/MultilangTextField.tsx
3300
- function Zn(e) {
3319
+ function Qn(e) {
3301
3320
  return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
3302
3321
  }
3303
- function Qn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3304
- let { data: o } = jt(), s = o?.languages?.length ? o.languages : [{
3322
+ function $n({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3323
+ let { data: o } = Mt(), s = o?.languages?.length ? o.languages : [{
3305
3324
  code: "en",
3306
3325
  name: { en: "English" }
3307
- }], c = Zn(n);
3326
+ }], c = Qn(n);
3308
3327
  if (r === "display") return /* @__PURE__ */ V("p", {
3309
3328
  style: {
3310
3329
  fontSize: 12.5,
@@ -3345,7 +3364,7 @@ function Qn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3345
3364
  fontWeight: 500
3346
3365
  },
3347
3366
  children: n.code
3348
- }), /* @__PURE__ */ V(Ae, {
3367
+ }), /* @__PURE__ */ V(je, {
3349
3368
  id: i,
3350
3369
  name: t ? `${t}.${n.code}` : void 0,
3351
3370
  ariaRequired: e.required && r === 0,
@@ -3360,25 +3379,25 @@ function Qn({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3360
3379
  }
3361
3380
  //#endregion
3362
3381
  //#region src/components/fields/StructureField.tsx
3363
- function $n(e) {
3364
- let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = jt(), c = t.structure ? s?.structures?.[t.structure] : void 0;
3365
- return c ? t.array ? /* @__PURE__ */ V(tr, {
3382
+ function er(e) {
3383
+ let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = Mt(), c = t.structure ? s?.structures?.[t.structure] : void 0;
3384
+ return c ? t.array ? /* @__PURE__ */ V(nr, {
3366
3385
  structDef: c,
3367
3386
  value: n,
3368
3387
  mode: r,
3369
3388
  onChange: i,
3370
3389
  locale: a,
3371
3390
  fieldId: o
3372
- }) : /* @__PURE__ */ V(er, {
3391
+ }) : /* @__PURE__ */ V(tr, {
3373
3392
  structDef: c,
3374
3393
  value: n,
3375
3394
  mode: r,
3376
3395
  onChange: i,
3377
3396
  locale: a,
3378
3397
  fieldId: o
3379
- }) : /* @__PURE__ */ V(Jn, { ...e });
3398
+ }) : /* @__PURE__ */ V(Yn, { ...e });
3380
3399
  }
3381
- function er({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3400
+ function tr({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3382
3401
  let o = typeof t == "object" && t && !Array.isArray(t) ? t : {}, s = e.fields.names(), c = {
3383
3402
  display: "flex",
3384
3403
  flexDirection: "column",
@@ -3414,13 +3433,13 @@ function er({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3414
3433
  minWidth: 0,
3415
3434
  flex: 1
3416
3435
  },
3417
- children: n.type === "structure" && n.structure ? /* @__PURE__ */ V($n, {
3436
+ children: n.type === "structure" && n.structure ? /* @__PURE__ */ V(er, {
3418
3437
  field: n,
3419
3438
  fieldName: t,
3420
3439
  value: r,
3421
3440
  mode: "display",
3422
3441
  locale: i
3423
- }) : Wa({
3442
+ }) : Ga({
3424
3443
  field: n,
3425
3444
  fieldName: t,
3426
3445
  value: r,
@@ -3455,17 +3474,17 @@ function er({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3455
3474
  flexDirection: "column",
3456
3475
  gap: 2
3457
3476
  },
3458
- children: [/* @__PURE__ */ V(Oe, {
3477
+ children: [/* @__PURE__ */ V(ke, {
3459
3478
  required: n.required,
3460
3479
  children: n.display ? Q(n.display.name) : t
3461
- }), n.type === "structure" && n.structure ? /* @__PURE__ */ V($n, {
3480
+ }), n.type === "structure" && n.structure ? /* @__PURE__ */ V(er, {
3462
3481
  field: n,
3463
3482
  fieldName: t,
3464
3483
  value: o[t],
3465
3484
  mode: "edit",
3466
3485
  onChange: l(t),
3467
3486
  locale: i
3468
- }) : Wa({
3487
+ }) : Ga({
3469
3488
  field: n,
3470
3489
  fieldName: t,
3471
3490
  value: o[t],
@@ -3477,7 +3496,7 @@ function er({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3477
3496
  })
3478
3497
  });
3479
3498
  }
3480
- function tr({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3499
+ function nr({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3481
3500
  let o = Array.isArray(t) ? t : [];
3482
3501
  if (n === "display") return o.length === 0 ? /* @__PURE__ */ V("span", {
3483
3502
  style: {
@@ -3491,7 +3510,7 @@ function tr({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3491
3510
  flexDirection: "column",
3492
3511
  gap: 8
3493
3512
  },
3494
- children: o.map((t, n) => /* @__PURE__ */ V(er, {
3513
+ children: o.map((t, n) => /* @__PURE__ */ V(tr, {
3495
3514
  structDef: e,
3496
3515
  value: t,
3497
3516
  mode: "display",
@@ -3517,7 +3536,7 @@ function tr({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3517
3536
  role: "group",
3518
3537
  children: [o.map((t, n) => /* @__PURE__ */ H("div", {
3519
3538
  style: { position: "relative" },
3520
- children: [/* @__PURE__ */ V(er, {
3539
+ children: [/* @__PURE__ */ V(tr, {
3521
3540
  structDef: e,
3522
3541
  value: t,
3523
3542
  mode: "edit",
@@ -3545,16 +3564,16 @@ function tr({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3545
3564
  }
3546
3565
  //#endregion
3547
3566
  //#region src/components/fields/SecretField.tsx
3548
- var nr = "[SET]";
3549
- function rr({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3550
- let [s, c] = R(""), l = a !== void 0, u = n === nr || typeof n == "string" && n !== "";
3567
+ var rr = "[SET]";
3568
+ function ir({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3569
+ let [s, c] = R(""), l = a !== void 0, u = n === rr || typeof n == "string" && n !== "";
3551
3570
  return r === "display" ? u ? /* @__PURE__ */ V("span", {
3552
3571
  className: "mono",
3553
3572
  style: {
3554
3573
  fontSize: 12.5,
3555
3574
  color: "var(--text-3)"
3556
3575
  },
3557
- children: nr
3576
+ children: rr
3558
3577
  }) : /* @__PURE__ */ V("span", {
3559
3578
  style: {
3560
3579
  fontSize: 12.5,
@@ -3562,29 +3581,29 @@ function rr({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3562
3581
  fontStyle: "italic"
3563
3582
  },
3564
3583
  children: "Not set"
3565
- }) : /* @__PURE__ */ V(ze, {
3584
+ }) : /* @__PURE__ */ V(Be, {
3566
3585
  id: o,
3567
3586
  name: t,
3568
3587
  ariaRequired: e.required,
3569
3588
  value: s,
3570
3589
  onChange: (e) => {
3571
- c(e), l && e === "" ? i?.(u ? nr : "") : i?.(e);
3590
+ c(e), l && e === "" ? i?.(u ? rr : "") : i?.(e);
3572
3591
  },
3573
3592
  placeholder: l ? "Leave blank to keep existing value" : "Enter value"
3574
3593
  });
3575
3594
  }
3576
3595
  //#endregion
3577
3596
  //#region src/components/fields/PasswordField.tsx
3578
- var ir = "[SET]";
3579
- function ar({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3580
- let [s, c] = R(""), l = a !== void 0, u = n === ir || typeof n == "string" && n !== "";
3597
+ var ar = "[SET]";
3598
+ function or({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3599
+ let [s, c] = R(""), l = a !== void 0, u = n === ar || typeof n == "string" && n !== "";
3581
3600
  return r === "display" ? u ? /* @__PURE__ */ V("span", {
3582
3601
  className: "mono",
3583
3602
  style: {
3584
3603
  fontSize: 12.5,
3585
3604
  color: "var(--text-3)"
3586
3605
  },
3587
- children: ir
3606
+ children: ar
3588
3607
  }) : /* @__PURE__ */ V("span", {
3589
3608
  style: {
3590
3609
  fontSize: 12.5,
@@ -3592,24 +3611,24 @@ function ar({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3592
3611
  fontStyle: "italic"
3593
3612
  },
3594
3613
  children: "Not set"
3595
- }) : /* @__PURE__ */ V(ze, {
3614
+ }) : /* @__PURE__ */ V(Be, {
3596
3615
  id: o,
3597
3616
  name: t,
3598
3617
  ariaRequired: e.required,
3599
3618
  value: s,
3600
3619
  onChange: (e) => {
3601
- c(e), l && e === "" ? i?.(u ? ir : "") : i?.(e);
3620
+ c(e), l && e === "" ? i?.(u ? ar : "") : i?.(e);
3602
3621
  },
3603
3622
  placeholder: l ? "Leave blank to keep existing value" : "Enter password"
3604
3623
  });
3605
3624
  }
3606
3625
  //#endregion
3607
3626
  //#region src/components/fields/StringArrayField.tsx
3608
- function or(e) {
3627
+ function sr(e) {
3609
3628
  return Array.isArray(e) ? e.filter((e) => e != null).map(String) : [];
3610
3629
  }
3611
- function sr({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3612
- let o = or(n), [s, c] = R("");
3630
+ function cr({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3631
+ let o = sr(n), [s, c] = R("");
3613
3632
  if (r === "display") return o.length === 0 ? /* @__PURE__ */ V("span", {
3614
3633
  style: {
3615
3634
  fontSize: 12.5,
@@ -3678,11 +3697,11 @@ function sr({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3678
3697
  }
3679
3698
  //#endregion
3680
3699
  //#region src/components/fields/IntArrayField.tsx
3681
- function cr(e) {
3700
+ function lr(e) {
3682
3701
  return Array.isArray(e) ? e.filter((e) => e != null).map(Number).filter((e) => !isNaN(e)) : [];
3683
3702
  }
3684
- function lr({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3685
- let o = cr(n), [s, c] = R("");
3703
+ function ur({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3704
+ let o = lr(n), [s, c] = R("");
3686
3705
  if (r === "display") return o.length === 0 ? /* @__PURE__ */ V("span", {
3687
3706
  style: {
3688
3707
  fontSize: 12.5,
@@ -3754,38 +3773,38 @@ function lr({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3754
3773
  }
3755
3774
  //#endregion
3756
3775
  //#region src/components/file-widgets/registry.ts
3757
- var ur = /* @__PURE__ */ new Map();
3758
- function dr(e, t) {
3759
- ur.set(e, t);
3760
- }
3761
- function fr(e) {
3762
- return ur.get(e);
3776
+ var dr = /* @__PURE__ */ new Map();
3777
+ function fr(e, t) {
3778
+ dr.set(e, t);
3763
3779
  }
3764
3780
  function pr(e) {
3765
- return ur.has(e);
3781
+ return dr.get(e);
3782
+ }
3783
+ function mr(e) {
3784
+ return dr.has(e);
3766
3785
  }
3767
3786
  //#endregion
3768
3787
  //#region src/components/file-widgets/cropper.ts
3769
- var mr = async ({ file: e }) => ({
3788
+ var hr = async ({ file: e }) => ({
3770
3789
  blob: e,
3771
3790
  filename: e.name
3772
- }), hr = mr;
3773
- function gr(e) {
3774
- hr = e ?? mr;
3791
+ }), gr = hr;
3792
+ function _r(e) {
3793
+ gr = e ?? hr;
3775
3794
  }
3776
- function _r() {
3777
- return hr;
3795
+ function vr() {
3796
+ return gr;
3778
3797
  }
3779
3798
  //#endregion
3780
3799
  //#region src/components/file-widgets/ImageWidget.tsx
3781
- function vr(e, t) {
3800
+ function yr(e, t) {
3782
3801
  return s(e, t);
3783
3802
  }
3784
- function yr(e) {
3803
+ function br(e) {
3785
3804
  let t = e.trim().split(/\s+/).filter(Boolean);
3786
3805
  return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
3787
3806
  }
3788
- function br(e) {
3807
+ function xr(e) {
3789
3808
  let { field: t, fieldName: n, value: r, onChange: o, mode: s, alt: f, disabled: p, visual: _, uploadFieldCode: v, uploadSlotCode: y } = e, S = h(r), [C, w] = R("idle"), [T, E] = R(null), [D, O] = R(null), [k, A] = R(null), [j, M] = R(!1), F = L(null), z = L(!1), B = L(null), { register: U, unregister: W, isDraft: te } = g();
3790
3809
  P(() => () => {
3791
3810
  F.current && F.current.abort();
@@ -3803,9 +3822,9 @@ function br(e) {
3803
3822
  }
3804
3823
  let c = r;
3805
3824
  if (t.display?.crop_on_upload) try {
3806
- let { blob: e, filename: n } = await _r()({
3825
+ let { blob: e, filename: n } = await vr()({
3807
3826
  file: r,
3808
- aspectRatio: wr(t.display.aspect_ratio)
3827
+ aspectRatio: Tr(t.display.aspect_ratio)
3809
3828
  });
3810
3829
  c = new File([e], n, { type: e.type || r.type });
3811
3830
  } catch (e) {
@@ -3903,10 +3922,10 @@ function br(e) {
3903
3922
  }, [p, re]), oe = N((e) => {
3904
3923
  let t = e.target.files?.[0];
3905
3924
  e.target.value = "", t && re(t);
3906
- }, [re]), se = _.aspectRatio ?? Cr(_.shape, t.display?.aspect_ratio), ce = m(S), le = {
3925
+ }, [re]), se = _.aspectRatio ?? wr(_.shape, t.display?.aspect_ratio), ce = m(S), le = {
3907
3926
  aspectRatio: se,
3908
3927
  width: _.width ?? (_.shape === "wide" ? "100%" : "120px")
3909
- }, ue = !!S, de = vr(S, t.display?.listable_thumbnail), fe = c(S, t.display?.listable_thumbnail), pe = d(S?.id, fe, de), me = s === "display", he = N((e) => {
3928
+ }, ue = !!S, de = yr(S, t.display?.listable_thumbnail), fe = c(S, t.display?.listable_thumbnail), pe = d(S?.id, fe, de), me = s === "display", he = N((e) => {
3910
3929
  e.stopPropagation(), M((e) => !e);
3911
3930
  }, []), ge = N((e) => {
3912
3931
  if (!S || !j) return;
@@ -3922,22 +3941,22 @@ function br(e) {
3922
3941
  o
3923
3942
  ]);
3924
3943
  return me ? /* @__PURE__ */ V("div", {
3925
- className: xr(_.shape, !1),
3944
+ className: Sr(_.shape, !1),
3926
3945
  style: le,
3927
3946
  "aria-label": G,
3928
3947
  children: ue && pe ? /* @__PURE__ */ V("img", {
3929
3948
  src: pe,
3930
3949
  alt: G,
3931
- className: Sr(_.shape),
3950
+ className: Cr(_.shape),
3932
3951
  style: { objectPosition: b(ce) },
3933
3952
  loading: "lazy"
3934
- }) : /* @__PURE__ */ V(Tr, {
3953
+ }) : /* @__PURE__ */ V(Er, {
3935
3954
  shape: _.shape,
3936
3955
  label: G,
3937
3956
  placeholder: t.display?.placeholder
3938
3957
  })
3939
3958
  }) : /* @__PURE__ */ H("div", {
3940
- className: xr(_.shape, !p),
3959
+ className: Sr(_.shape, !p),
3941
3960
  style: le,
3942
3961
  tabIndex: p ? -1 : 0,
3943
3962
  role: "button",
@@ -3963,15 +3982,15 @@ function br(e) {
3963
3982
  ue && pe ? /* @__PURE__ */ V("img", {
3964
3983
  src: pe,
3965
3984
  alt: G,
3966
- className: Sr(_.shape),
3985
+ className: Cr(_.shape),
3967
3986
  style: { objectPosition: b(ce) },
3968
3987
  loading: "lazy"
3969
- }) : C === "uploading" ? null : /* @__PURE__ */ V(Tr, {
3988
+ }) : C === "uploading" ? null : /* @__PURE__ */ V(Er, {
3970
3989
  shape: _.shape,
3971
3990
  label: G,
3972
3991
  placeholder: t.display?.placeholder
3973
3992
  }),
3974
- C === "uploading" && /* @__PURE__ */ V(Er, { pct: T?.pct ?? 0 }),
3993
+ C === "uploading" && /* @__PURE__ */ V(Dr, { pct: T?.pct ?? 0 }),
3975
3994
  k && /* @__PURE__ */ V("span", {
3976
3995
  className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
3977
3996
  "aria-hidden": "true",
@@ -4042,32 +4061,32 @@ function br(e) {
4042
4061
  ]
4043
4062
  });
4044
4063
  }
4045
- function xr(e, t) {
4064
+ function Sr(e, t) {
4046
4065
  return [
4047
4066
  "relative overflow-hidden border border-border bg-surface-2",
4048
4067
  e === "circle" ? "rounded-full" : "rounded-md",
4049
4068
  t ? "cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent" : ""
4050
4069
  ].filter(Boolean).join(" ");
4051
4070
  }
4052
- function Sr(e) {
4071
+ function Cr(e) {
4053
4072
  return "h-full w-full object-cover";
4054
4073
  }
4055
- function Cr(e, t) {
4074
+ function wr(e, t) {
4056
4075
  return t ? t.replace(":", " / ") : e === "wide" ? "16 / 9" : "1 / 1";
4057
4076
  }
4058
- function wr(e) {
4077
+ function Tr(e) {
4059
4078
  if (!e) return;
4060
4079
  let t = e.replace(/\s/g, "").match(/^(\d+(?:\.\d+)?)[:/](\d+(?:\.\d+)?)$/);
4061
4080
  if (!t) return;
4062
4081
  let n = Number(t[1]), r = Number(t[2]);
4063
4082
  if (!(!n || !r)) return n / r;
4064
4083
  }
4065
- function Tr({ shape: e, label: t, placeholder: n }) {
4084
+ function Er({ shape: e, label: t, placeholder: n }) {
4066
4085
  return n === "initials" ? /* @__PURE__ */ V("div", {
4067
4086
  className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-3",
4068
4087
  children: /* @__PURE__ */ V("span", {
4069
4088
  className: e === "circle" ? "text-lg font-medium" : "text-base font-medium",
4070
- children: yr(t)
4089
+ children: br(t)
4071
4090
  })
4072
4091
  }) : /* @__PURE__ */ V("div", {
4073
4092
  className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-4",
@@ -4077,7 +4096,7 @@ function Tr({ shape: e, label: t, placeholder: n }) {
4077
4096
  })
4078
4097
  });
4079
4098
  }
4080
- function Er({ pct: e }) {
4099
+ function Dr({ pct: e }) {
4081
4100
  let t = 2 * Math.PI * 18, n = t - Math.max(0, Math.min(100, e)) / 100 * t;
4082
4101
  return /* @__PURE__ */ H("div", {
4083
4102
  className: "absolute inset-0 flex items-center justify-center bg-black/30",
@@ -4121,49 +4140,49 @@ function Er({ pct: e }) {
4121
4140
  }
4122
4141
  //#endregion
4123
4142
  //#region src/components/file-widgets/SquareImage.tsx
4124
- function Dr(e) {
4125
- return /* @__PURE__ */ V(br, {
4143
+ function Or(e) {
4144
+ return /* @__PURE__ */ V(xr, {
4126
4145
  ...e,
4127
4146
  visual: { shape: "square" }
4128
4147
  });
4129
4148
  }
4130
4149
  //#endregion
4131
4150
  //#region src/components/file-widgets/CircleImage.tsx
4132
- function Or(e) {
4133
- return /* @__PURE__ */ V(br, {
4151
+ function kr(e) {
4152
+ return /* @__PURE__ */ V(xr, {
4134
4153
  ...e,
4135
4154
  visual: { shape: "circle" }
4136
4155
  });
4137
4156
  }
4138
4157
  //#endregion
4139
4158
  //#region src/components/file-widgets/WideBanner.tsx
4140
- function kr(e) {
4141
- return /* @__PURE__ */ V(br, {
4159
+ function Ar(e) {
4160
+ return /* @__PURE__ */ V(xr, {
4142
4161
  ...e,
4143
4162
  visual: { shape: "wide" }
4144
4163
  });
4145
4164
  }
4146
4165
  //#endregion
4147
4166
  //#region src/components/file-widgets/GridLazy.tsx
4148
- var Ar = M(() => import("./Grid-pE2-dvug.js").then((e) => ({ default: e.Grid })));
4149
- function jr() {
4167
+ var jr = M(() => import("./Grid-POpRhlPk.js").then((e) => ({ default: e.Grid })));
4168
+ function Mr() {
4150
4169
  return /* @__PURE__ */ V("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
4151
4170
  }
4152
- function Mr(e) {
4171
+ function Nr(e) {
4153
4172
  return /* @__PURE__ */ V(A, {
4154
- fallback: /* @__PURE__ */ V(jr, {}),
4155
- children: /* @__PURE__ */ V(Ar, { ...e })
4173
+ fallback: /* @__PURE__ */ V(Mr, {}),
4174
+ children: /* @__PURE__ */ V(jr, { ...e })
4156
4175
  });
4157
4176
  }
4158
4177
  //#endregion
4159
4178
  //#region src/components/file-widgets/DocumentCard.tsx
4160
- function Nr({ contentType: e }) {
4179
+ function Pr({ contentType: e }) {
4161
4180
  return /* @__PURE__ */ V("div", {
4162
4181
  className: "flex h-16 w-16 flex-none items-center justify-center rounded-md border border-border bg-surface-3 text-xs font-medium text-muted-foreground",
4163
4182
  children: e ? e.includes("pdf") ? "PDF" : e.includes("word") ? "DOC" : e.includes("sheet") || e.includes("excel") ? "XLS" : e.startsWith("image/") ? "IMG" : e.split("/")[1]?.slice(0, 4).toUpperCase() ?? "FILE" : "FILE"
4164
4183
  });
4165
4184
  }
4166
- function Pr(e) {
4185
+ function Fr(e) {
4167
4186
  let { field: t, fieldName: n, value: r, onChange: s, mode: c, disabled: l, uploadFieldCode: u, uploadSlotCode: d } = e, f = h(r), [m, y] = R("idle"), [b, S] = R(null), [w, T] = R(null), [E, D] = R(!1), [O, k] = R(f?.filename ?? ""), A = L(null), j = L(!1), M = L(null), { register: F, unregister: I, isDraft: z } = g(), { open: U } = v();
4168
4187
  P(() => () => {
4169
4188
  A.current && A.current.abort();
@@ -4276,7 +4295,7 @@ function Pr(e) {
4276
4295
  "data-testid": `file-widget-${n}`,
4277
4296
  className: "flex items-center gap-3 rounded-md border border-dashed border-border bg-surface p-3",
4278
4297
  children: [
4279
- /* @__PURE__ */ V(Nr, {}),
4298
+ /* @__PURE__ */ V(Pr, {}),
4280
4299
  /* @__PURE__ */ H("div", {
4281
4300
  className: "flex flex-col gap-1",
4282
4301
  children: [/* @__PURE__ */ V("span", {
@@ -4311,7 +4330,7 @@ function Pr(e) {
4311
4330
  "aria-busy": m === "uploading" || void 0,
4312
4331
  "aria-invalid": m === "error" || void 0,
4313
4332
  children: [
4314
- /* @__PURE__ */ V(Nr, { contentType: f?.content_type }),
4333
+ /* @__PURE__ */ V(Pr, { contentType: f?.content_type }),
4315
4334
  /* @__PURE__ */ H("div", {
4316
4335
  className: "flex min-w-0 flex-1 flex-col gap-1",
4317
4336
  children: [
@@ -4340,7 +4359,7 @@ function Pr(e) {
4340
4359
  children: [
4341
4360
  f && /* @__PURE__ */ V("span", { children: C(f.size_bytes) }),
4342
4361
  f?.page_count != null && /* @__PURE__ */ H("span", { children: [f.page_count, " pages"] }),
4343
- f?.uploaded_at && /* @__PURE__ */ V("span", { children: Fr(f.uploaded_at) }),
4362
+ f?.uploaded_at && /* @__PURE__ */ V("span", { children: Ir(f.uploaded_at) }),
4344
4363
  f?.uploaded_by && /* @__PURE__ */ H("span", { children: ["by ", f.uploaded_by] }),
4345
4364
  f?.version?.number != null && /* @__PURE__ */ H("span", {
4346
4365
  "data-testid": "version-badge",
@@ -4421,16 +4440,16 @@ function Pr(e) {
4421
4440
  ]
4422
4441
  });
4423
4442
  }
4424
- function Fr(e) {
4443
+ function Ir(e) {
4425
4444
  let t = new Date(e);
4426
4445
  return isNaN(t.getTime()) ? e : t.toISOString().slice(0, 10);
4427
4446
  }
4428
4447
  //#endregion
4429
4448
  //#region src/components/file-widgets/FileList.tsx
4430
- function Ir(e) {
4449
+ function Lr(e) {
4431
4450
  return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
4432
4451
  }
4433
- function Lr(e) {
4452
+ function Rr(e) {
4434
4453
  let { field: t, fieldName: n, value: r, onChange: o, mode: s, disabled: c } = e, l = y(r), [u, d] = R([]), { register: f, unregister: m, isDraft: h } = g(), _ = L(l);
4435
4454
  _.current = l;
4436
4455
  let b = L(null), S = L(/* @__PURE__ */ new Set()), w = L([]);
@@ -4550,7 +4569,7 @@ function Lr(e) {
4550
4569
  children: [
4551
4570
  /* @__PURE__ */ V("span", {
4552
4571
  className: "flex-none rounded-sm border border-border bg-surface-3 px-1.5 py-0.5 text-[10px] text-muted-foreground",
4553
- children: Ir(e.content_type)
4572
+ children: Lr(e.content_type)
4554
4573
  }),
4555
4574
  /* @__PURE__ */ V("button", {
4556
4575
  type: "button",
@@ -4635,16 +4654,16 @@ function Lr(e) {
4635
4654
  }
4636
4655
  //#endregion
4637
4656
  //#region src/components/file-widgets/LabeledSlots.tsx
4638
- function Rr(e) {
4657
+ function zr(e) {
4639
4658
  return !e || Array.isArray(e) || typeof e != "object" ? {} : e;
4640
4659
  }
4641
- function zr(e) {
4660
+ function Br(e) {
4642
4661
  return e.split("_").filter(Boolean).map((e) => e.slice(0, 1).toUpperCase() + e.slice(1)).join(" ");
4643
4662
  }
4644
- function Br(e, t) {
4663
+ function Vr(e, t) {
4645
4664
  return t?.content_type?.startsWith("image/") ? !0 : (e?.accepts ?? []).some((e) => e === "image/*" || e.startsWith("image/"));
4646
4665
  }
4647
- function Vr(e, t, n, r) {
4666
+ function Hr(e, t, n, r) {
4648
4667
  return {
4649
4668
  ...e,
4650
4669
  name: `${e.name}.${t}`,
@@ -4654,14 +4673,14 @@ function Vr(e, t, n, r) {
4654
4673
  slots: void 0,
4655
4674
  display: {
4656
4675
  ...e.display ?? { widget: "document_card" },
4657
- widget: Br(n, r) ? "square_image" : "document_card",
4676
+ widget: Vr(n, r) ? "square_image" : "document_card",
4658
4677
  aspect_ratio: n?.aspect_ratio ?? e.display?.aspect_ratio,
4659
- placeholder: e.display?.placeholder ?? zr(t)
4678
+ placeholder: e.display?.placeholder ?? Br(t)
4660
4679
  }
4661
4680
  };
4662
4681
  }
4663
- function Hr(e) {
4664
- let { field: t, fieldName: n, entityCode: r, value: i, onChange: a, mode: o, disabled: s } = e, c = Object.entries(t.slots ?? {}), l = Rr(i);
4682
+ function Ur(e) {
4683
+ let { field: t, fieldName: n, entityCode: r, value: i, onChange: a, mode: o, disabled: s } = e, c = Object.entries(t.slots ?? {}), l = zr(i);
4665
4684
  return c.length === 0 ? /* @__PURE__ */ V("span", {
4666
4685
  className: "text-sm text-muted-foreground",
4667
4686
  children: "No slots configured"
@@ -4671,7 +4690,7 @@ function Hr(e) {
4671
4690
  gap: 12
4672
4691
  },
4673
4692
  children: c.map(([e, i]) => {
4674
- let c = l[e] ?? null, u = Vr(t, e, i, c), d = u.display?.widget ?? "document_card", f = fr(d);
4693
+ let c = l[e] ?? null, u = Hr(t, e, i, c), d = u.display?.widget ?? "document_card", f = pr(d);
4675
4694
  return f ? /* @__PURE__ */ H("div", {
4676
4695
  style: {
4677
4696
  display: "grid",
@@ -4683,7 +4702,7 @@ function Hr(e) {
4683
4702
  fontWeight: 600,
4684
4703
  color: "var(--text-2)"
4685
4704
  },
4686
- children: zr(e)
4705
+ children: Br(e)
4687
4706
  }), /* @__PURE__ */ V(f, {
4688
4707
  field: u,
4689
4708
  fieldName: e,
@@ -4711,7 +4730,7 @@ function Hr(e) {
4711
4730
  fontWeight: 600,
4712
4731
  color: "var(--text-2)"
4713
4732
  },
4714
- children: zr(e)
4733
+ children: Br(e)
4715
4734
  }), /* @__PURE__ */ V("span", {
4716
4735
  className: "text-sm text-muted-foreground",
4717
4736
  children: `Unknown file widget: ${d}`
@@ -4722,43 +4741,43 @@ function Hr(e) {
4722
4741
  }
4723
4742
  //#endregion
4724
4743
  //#region src/components/file-widgets/builtins.ts
4725
- var Ur = !1;
4726
- function Wr() {
4727
- Ur ||= (dr("square_image", Dr), dr("circle_image", Or), dr("wide_banner", kr), dr("grid", Mr), dr("document_card", Pr), dr("file_list", Lr), dr("labeled_slots", Hr), !0);
4744
+ var Wr = !1;
4745
+ function Gr() {
4746
+ Wr ||= (fr("square_image", Or), fr("circle_image", kr), fr("wide_banner", Ar), fr("grid", Nr), fr("document_card", Fr), fr("file_list", Rr), fr("labeled_slots", Ur), !0);
4728
4747
  }
4729
4748
  //#endregion
4730
4749
  //#region src/components/file-widgets/host.tsx
4731
- Wr();
4732
- function Gr(e, t) {
4750
+ Gr();
4751
+ function Kr(e, t) {
4733
4752
  return e.files?.get(t);
4734
4753
  }
4735
- function Kr(e, t) {
4754
+ function qr(e, t) {
4736
4755
  return Object.prototype.hasOwnProperty.call(e, t) ? e[t] ?? null : e.$files?.[t] ?? null;
4737
4756
  }
4738
- function qr(e, t, n) {
4739
- if (Gr(e, n)) return Kr(t, n);
4757
+ function Jr(e, t, n) {
4758
+ if (Kr(e, n)) return qr(t, n);
4740
4759
  let r = e.fields.get(n);
4741
- return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? k(t[n], Kr(t, n)) : t[n];
4760
+ return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? k(t[n], qr(t, n)) : t[n];
4742
4761
  }
4743
- function Jr(e, t, n) {
4762
+ function Yr(e, t, n) {
4744
4763
  let r = e.fields.get(t);
4745
4764
  return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? T(n) : n;
4746
4765
  }
4747
- function Yr(e, t, n) {
4748
- let r = Gr(e, t);
4766
+ function Xr(e, t, n) {
4767
+ let r = Kr(e, t);
4749
4768
  if (r) return r.name || t;
4750
4769
  let i = e.fields.get(t);
4751
- return i ? Qe(i, t, n) : t;
4770
+ return i ? $e(i, t, n) : t;
4752
4771
  }
4753
- function Xr(e) {
4754
- let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, navigate: f, locale: p, fieldId: m, labelId: h } = e, g = Gr(t, r);
4772
+ function Zr(e) {
4773
+ let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, navigate: f, locale: p, fieldId: m, labelId: h } = e, g = Kr(t, r);
4755
4774
  if (g) {
4756
- let e = g.display?.widget ?? "", t = fr(e);
4775
+ let e = g.display?.widget ?? "", t = pr(e);
4757
4776
  return t ? /* @__PURE__ */ V(t, {
4758
4777
  field: g,
4759
4778
  fieldName: r,
4760
4779
  entityCode: n,
4761
- value: Kr(i, r),
4780
+ value: qr(i, r),
4762
4781
  mode: a,
4763
4782
  onChange: o,
4764
4783
  disabled: c,
@@ -4769,11 +4788,11 @@ function Xr(e) {
4769
4788
  });
4770
4789
  }
4771
4790
  let _ = t.fields.get(r);
4772
- return _ ? Wa({
4791
+ return _ ? Ga({
4773
4792
  field: _,
4774
4793
  entityCode: n,
4775
4794
  fieldName: r,
4776
- value: qr(t, i, r),
4795
+ value: Jr(t, i, r),
4777
4796
  mode: a,
4778
4797
  onChange: o,
4779
4798
  record: i,
@@ -4790,80 +4809,80 @@ function Xr(e) {
4790
4809
  }
4791
4810
  //#endregion
4792
4811
  //#region src/components/file-widgets/payload.ts
4793
- function Zr(e) {
4812
+ function Qr(e) {
4794
4813
  return !e || Array.isArray(e) ? null : e;
4795
4814
  }
4796
- function Qr(e) {
4815
+ function $r(e) {
4797
4816
  return Array.isArray(e) ? e : [];
4798
4817
  }
4799
- function $r(e) {
4818
+ function ei(e) {
4800
4819
  return !e || Array.isArray(e) || typeof e != "object" ? {} : e;
4801
4820
  }
4802
- function ei(e, t) {
4803
- return e.mode === "array" ? Qr(t) : e.mode === "named_map" ? $r(t) : Zr(t);
4821
+ function ti(e, t) {
4822
+ return e.mode === "array" ? $r(t) : e.mode === "named_map" ? ei(t) : Qr(t);
4804
4823
  }
4805
- function ti(e, t, n, r) {
4824
+ function ni(e, t, n, r) {
4806
4825
  let i = {
4807
4826
  file_id: e.id,
4808
4827
  filename: e.filename
4809
4828
  };
4810
4829
  return r && (i.slot = r), n && (i.position = t), e.metadata !== void 0 && (i.metadata = e.metadata), i;
4811
4830
  }
4812
- function ni(e, t) {
4831
+ function ri(e, t) {
4813
4832
  if (e.mode === "array") {
4814
- let e = Qr(t);
4815
- return e.length === 0 ? { clear: !0 } : { set: e.map((e, t) => ti(e, t, !0)) };
4833
+ let e = $r(t);
4834
+ return e.length === 0 ? { clear: !0 } : { set: e.map((e, t) => ni(e, t, !0)) };
4816
4835
  }
4817
4836
  if (e.mode === "named_map") {
4818
- let e = $r(t), n = Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => ti(t, 0, !1, e));
4837
+ let e = ei(t), n = Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => ni(t, 0, !1, e));
4819
4838
  return n.length === 0 ? { clear: !0 } : { set: n };
4820
4839
  }
4821
- let n = Zr(t);
4822
- return n ? { set: [ti(n, 0, !0)] } : { clear: !0 };
4840
+ let n = Qr(t);
4841
+ return n ? { set: [ni(n, 0, !0)] } : { clear: !0 };
4823
4842
  }
4824
- function ri(e) {
4843
+ function ii(e) {
4825
4844
  return JSON.stringify(e);
4826
4845
  }
4827
- function ii(e) {
4846
+ function ai(e) {
4828
4847
  let { entity: t, formData: n, record: r, isNew: i } = e, a = {};
4829
4848
  for (let e of t.files?.names() ?? []) {
4830
4849
  if (!Object.prototype.hasOwnProperty.call(n, e)) continue;
4831
- let o = Gr(t, e);
4850
+ let o = Kr(t, e);
4832
4851
  if (!o) continue;
4833
- let s = ei(o, n[e]);
4852
+ let s = ti(o, n[e]);
4834
4853
  if (i) {
4835
- if (o.mode === "array" ? Qr(s).length === 0 : o.mode === "named_map" ? Object.values($r(s)).every((e) => e == null) : Zr(s) == null) continue;
4836
- a[e] = ni(o, s);
4854
+ if (o.mode === "array" ? $r(s).length === 0 : o.mode === "named_map" ? Object.values(ei(s)).every((e) => e == null) : Qr(s) == null) continue;
4855
+ a[e] = ri(o, s);
4837
4856
  continue;
4838
4857
  }
4839
- let c = ei(o, r ? Kr(r, e) : null), l = ni(o, s), u = ni(o, c);
4840
- ri(l) !== ri(u) && (a[e] = l);
4858
+ let c = ti(o, r ? qr(r, e) : null), l = ri(o, s), u = ri(o, c);
4859
+ ii(l) !== ii(u) && (a[e] = l);
4841
4860
  }
4842
4861
  let o = t.fields;
4843
4862
  if (!o) return a;
4844
4863
  for (let e of o.names()) {
4845
4864
  let s = o.get(e)?.files;
4846
4865
  if (!s || s.mode !== "rich_text_inline" || !Object.prototype.hasOwnProperty.call(n, e)) continue;
4847
- let c = oi(s, n[e]);
4866
+ let c = si(s, n[e]);
4848
4867
  if (i) {
4849
4868
  if (c.clear) continue;
4850
4869
  a[e] = c;
4851
4870
  continue;
4852
4871
  }
4853
- let l = oi(s, r ? qr({
4872
+ let l = si(s, r ? Jr({
4854
4873
  ...t,
4855
4874
  fields: o
4856
4875
  }, r, e) : null);
4857
- ri(c) !== ri(l) && (a[e] = c);
4876
+ ii(c) !== ii(l) && (a[e] = c);
4858
4877
  }
4859
4878
  return a;
4860
4879
  }
4861
- function ai(e) {
4880
+ function oi(e) {
4862
4881
  let t = [];
4863
4882
  for (let n of Object.values(e)) for (let e of n.set ?? []) t.push(e.file_id);
4864
4883
  return t;
4865
4884
  }
4866
- function oi(e, t) {
4885
+ function si(e, t) {
4867
4886
  if (e.mode !== "rich_text_inline") return { clear: !0 };
4868
4887
  let n = D(T(t));
4869
4888
  return n.length === 0 ? { clear: !0 } : { set: n.map((e, t) => ({
@@ -4873,10 +4892,10 @@ function oi(e, t) {
4873
4892
  }
4874
4893
  //#endregion
4875
4894
  //#region src/components/file-widgets/index.ts
4876
- Wr();
4895
+ Gr();
4877
4896
  //#endregion
4878
4897
  //#region src/components/fields/RichTextField.tsx
4879
- function si(e) {
4898
+ function ci(e) {
4880
4899
  let { field: t, entityCode: n, fieldName: r, value: o, mode: s, onChange: c, record: l, compact: u, fieldId: d } = e, f = L(null), p = L(null), m = L(/* @__PURE__ */ new Map()), h = L(/* @__PURE__ */ new Set()), [_, v] = R(0), [y, b] = R(null), { register: S, unregister: C } = g(), T = l?.$files?.[r], A = I(() => k(o, T), [T, o]), j = A.markdown, M = t.files?.accepts, N = t.files?.max_size_bytes, P = (e, t = A.files) => {
4881
4900
  let n = new Set(D(e)), r = [];
4882
4901
  for (let e of h.current) n.has(e) || r.push(e);
@@ -4925,15 +4944,15 @@ function si(e) {
4925
4944
  fieldCode: r
4926
4945
  }), i = e.type.startsWith("image/") ? URL.createObjectURL(e) : void 0;
4927
4946
  i && m.current.set(t.id, i);
4928
- let c = li(t, i);
4947
+ let c = ui(t, i);
4929
4948
  if (S(t.id, () => x(t.id)), h.current.add(t.id), o.length === 1) {
4930
- let e = ci(s.markdown, w(c));
4949
+ let e = li(s.markdown, w(c));
4931
4950
  F(s, e, c), s = E({
4932
4951
  markdown: `${s.markdown}${e}`,
4933
4952
  files: s.files
4934
4953
  }, c);
4935
4954
  } else {
4936
- let e = ci(s.markdown, w(c));
4955
+ let e = li(s.markdown, w(c));
4937
4956
  s = E({
4938
4957
  markdown: `${s.markdown}${e}`,
4939
4958
  files: s.files
@@ -4946,7 +4965,7 @@ function si(e) {
4946
4965
  }
4947
4966
  }
4948
4967
  };
4949
- return s === "display" ? j ? /* @__PURE__ */ V(rn, {
4968
+ return s === "display" ? j ? /* @__PURE__ */ V(an, {
4950
4969
  content: j,
4951
4970
  files: A.files
4952
4971
  }) : /* @__PURE__ */ V("span", {
@@ -5061,7 +5080,7 @@ function si(e) {
5061
5080
  marginBottom: 8
5062
5081
  },
5063
5082
  children: "Preview"
5064
- }), j ? /* @__PURE__ */ V(rn, {
5083
+ }), j ? /* @__PURE__ */ V(an, {
5065
5084
  content: j,
5066
5085
  files: A.files
5067
5086
  }) : /* @__PURE__ */ V("span", {
@@ -5075,10 +5094,10 @@ function si(e) {
5075
5094
  ]
5076
5095
  });
5077
5096
  }
5078
- function ci(e, t) {
5097
+ function li(e, t) {
5079
5098
  return e ? e.endsWith("\n\n") ? t : e.endsWith("\n") ? `\n${t}` : `\n\n${t}` : `${t}\n`;
5080
5099
  }
5081
- function li(e, t) {
5100
+ function ui(e, t) {
5082
5101
  return {
5083
5102
  id: e.id,
5084
5103
  filename: e.filename,
@@ -5093,7 +5112,7 @@ function li(e, t) {
5093
5112
  }
5094
5113
  //#endregion
5095
5114
  //#region src/components/fields/cells/factories/text.ts
5096
- var ui = () => (e) => {
5115
+ var di = () => (e) => {
5097
5116
  if (e == null || e === "") return "—";
5098
5117
  if (typeof e == "object") try {
5099
5118
  return JSON.stringify(e);
@@ -5101,8 +5120,8 @@ var ui = () => (e) => {
5101
5120
  return String(e);
5102
5121
  }
5103
5122
  return String(e);
5104
- }, di = (e) => {
5105
- let { field: t, fieldName: n, locale: r = "en" } = e, i = fi(t, n, r);
5123
+ }, fi = (e) => {
5124
+ let { field: t, fieldName: n, locale: r = "en" } = e, i = pi(t, n, r);
5106
5125
  return (e) => {
5107
5126
  if (e == null) return "—";
5108
5127
  let t = !!e;
@@ -5113,7 +5132,7 @@ var ui = () => (e) => {
5113
5132
  });
5114
5133
  };
5115
5134
  };
5116
- function fi(e, t, n) {
5135
+ function pi(e, t, n) {
5117
5136
  if (e.display?.bool_labels) return {
5118
5137
  trueLabel: Q(e.display.bool_labels.true, n) || "Yes",
5119
5138
  falseLabel: Q(e.display.bool_labels.false, n) || "No"
@@ -5134,14 +5153,14 @@ function fi(e, t, n) {
5134
5153
  };
5135
5154
  }
5136
5155
  if (t.startsWith("is_")) {
5137
- let e = pi(t.slice(3));
5156
+ let e = mi(t.slice(3));
5138
5157
  return {
5139
5158
  trueLabel: e,
5140
5159
  falseLabel: `Not ${e}`
5141
5160
  };
5142
5161
  }
5143
5162
  if (t.startsWith("has_")) {
5144
- let e = pi(t.slice(4));
5163
+ let e = mi(t.slice(4));
5145
5164
  return {
5146
5165
  trueLabel: e,
5147
5166
  falseLabel: `No ${e}`
@@ -5152,12 +5171,12 @@ function fi(e, t, n) {
5152
5171
  falseLabel: "No"
5153
5172
  };
5154
5173
  }
5155
- function pi(e) {
5174
+ function mi(e) {
5156
5175
  return e.split("_").map((e) => e && e[0].toUpperCase() + e.slice(1)).join(" ");
5157
5176
  }
5158
5177
  //#endregion
5159
5178
  //#region src/components/fields/cells/factories/badge.tsx
5160
- var mi = new Set([
5179
+ var hi = new Set([
5161
5180
  "indigo",
5162
5181
  "emerald",
5163
5182
  "amber",
@@ -5167,17 +5186,17 @@ var mi = new Set([
5167
5186
  "slate",
5168
5187
  "teal"
5169
5188
  ]);
5170
- function hi(e) {
5171
- return e && mi.has(e) ? e : "slate";
5189
+ function gi(e) {
5190
+ return e && hi.has(e) ? e : "slate";
5172
5191
  }
5173
- var gi = (e) => {
5192
+ var _i = (e) => {
5174
5193
  let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
5175
5194
  if (t.values) for (let e of t.values) r.set(e.code, {
5176
- tone: hi(e.color),
5195
+ tone: gi(e.color),
5177
5196
  label: Q(e.name, n) || e.code
5178
5197
  });
5179
5198
  if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) {
5180
- let t = r.get(e), a = i.color ? hi(i.color) : t?.tone ?? "slate", o = (i.label ? Q(i.label, n) : "") || t?.label || e;
5199
+ let t = r.get(e), a = i.color ? gi(i.color) : t?.tone ?? "slate", o = (i.label ? Q(i.label, n) : "") || t?.label || e;
5181
5200
  r.set(e, {
5182
5201
  tone: a,
5183
5202
  label: o
@@ -5192,7 +5211,7 @@ var gi = (e) => {
5192
5211
  children: n?.label ?? t
5193
5212
  });
5194
5213
  };
5195
- }, _i = new Set([
5214
+ }, vi = new Set([
5196
5215
  "indigo",
5197
5216
  "emerald",
5198
5217
  "amber",
@@ -5202,13 +5221,13 @@ var gi = (e) => {
5202
5221
  "slate",
5203
5222
  "teal"
5204
5223
  ]);
5205
- function vi(e) {
5206
- return e && _i.has(e) ? e : "slate";
5224
+ function yi(e) {
5225
+ return e && vi.has(e) ? e : "slate";
5207
5226
  }
5208
- var yi = (e) => {
5227
+ var bi = (e) => {
5209
5228
  let { entity: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
5210
5229
  if (t?.status_groups) for (let e of Object.values(t.status_groups)) for (let t of e.statuses) r.set(t.code, {
5211
- tone: vi(t.color),
5230
+ tone: yi(t.color),
5212
5231
  label: Q(t.name, n) || t.code
5213
5232
  });
5214
5233
  return (e) => {
@@ -5220,7 +5239,7 @@ var yi = (e) => {
5220
5239
  children: n?.label ?? t
5221
5240
  });
5222
5241
  };
5223
- }, bi = new Set([
5242
+ }, xi = new Set([
5224
5243
  "indigo",
5225
5244
  "emerald",
5226
5245
  "amber",
@@ -5230,14 +5249,14 @@ var yi = (e) => {
5230
5249
  "slate",
5231
5250
  "teal"
5232
5251
  ]);
5233
- function xi(e) {
5234
- return e && bi.has(e) ? e : null;
5252
+ function Si(e) {
5253
+ return e && xi.has(e) ? e : null;
5235
5254
  }
5236
- var Si = (e) => {
5255
+ var Ci = (e) => {
5237
5256
  let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
5238
5257
  if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) r.set(e, {
5239
5258
  label: i.label && Q(i.label, n) || e,
5240
- tone: xi(i.color)
5259
+ tone: Si(i.color)
5241
5260
  });
5242
5261
  return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ V("span", {
5243
5262
  style: {
@@ -5254,23 +5273,23 @@ var Si = (e) => {
5254
5273
  }, `${n}-${t}`) : /* @__PURE__ */ V(_e, { children: i?.label ?? n }, `${n}-${t}`);
5255
5274
  })
5256
5275
  });
5257
- }, Ci = () => (e) => {
5276
+ }, wi = () => (e) => {
5258
5277
  if (e == null || e === "") return "—";
5259
- let { text: t, absolute: n } = An(typeof e == "string" ? e : String(e));
5278
+ let { text: t, absolute: n } = jn(typeof e == "string" ? e : String(e));
5260
5279
  return /* @__PURE__ */ V("span", {
5261
5280
  title: n,
5262
5281
  children: t
5263
5282
  });
5264
- }, wi = () => (e) => e == null || e === "" ? "—" : kn(typeof e == "string" ? e : String(e)), Ti = 60 * 1e3, Ei = 300 * 1e3, Di = () => (e) => {
5283
+ }, Ti = () => (e) => e == null || e === "" ? "—" : An(typeof e == "string" ? e : String(e)), Ei = 60 * 1e3, Di = 300 * 1e3, Oi = () => (e) => {
5265
5284
  if (e == null || e === "") return "—";
5266
5285
  let t = typeof e == "string" ? e : String(e), n = new Date(t);
5267
5286
  if (isNaN(n.getTime())) return t;
5268
- let r = kn(t), i = Date.now() - n.getTime();
5287
+ let r = An(t), i = Date.now() - n.getTime();
5269
5288
  if (i <= 0) return /* @__PURE__ */ H("span", {
5270
5289
  title: r,
5271
5290
  children: ["in ", ne(n, /* @__PURE__ */ new Date(), { addSuffix: !1 })]
5272
5291
  });
5273
- if (i <= Ti) return /* @__PURE__ */ V("span", {
5292
+ if (i <= Ei) return /* @__PURE__ */ V("span", {
5274
5293
  title: r,
5275
5294
  children: /* @__PURE__ */ V(X, {
5276
5295
  tone: "slate",
@@ -5282,13 +5301,13 @@ var Si = (e) => {
5282
5301
  return /* @__PURE__ */ V("span", {
5283
5302
  title: r,
5284
5303
  children: /* @__PURE__ */ H(X, {
5285
- tone: i <= Ei ? "amber" : "rose",
5304
+ tone: i <= Di ? "amber" : "rose",
5286
5305
  size: "xs",
5287
5306
  children: ["overdue ", a]
5288
5307
  })
5289
5308
  });
5290
- }, Oi = (e) => {
5291
- let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a = ki(t.display?.currency_display), o = Ai(typeof t.scale == "number" ? t.scale : 2, 0, 6), s = /* @__PURE__ */ new Map();
5309
+ }, ki = (e) => {
5310
+ let { field: t, locale: n = "en" } = e, r = t.display?.currency || "USD", i = t.display?.currency_field, a = Ai(t.display?.currency_display), o = ji(typeof t.scale == "number" ? t.scale : 2, 0, 6), s = /* @__PURE__ */ new Map();
5292
5311
  return (e, t = {}) => {
5293
5312
  if (e == null || e === "") return "—";
5294
5313
  let c = typeof e == "number" ? e : Number(e);
@@ -5303,7 +5322,7 @@ var Si = (e) => {
5303
5322
  }), s.set(d, f)), f.format(c);
5304
5323
  };
5305
5324
  };
5306
- function ki(e) {
5325
+ function Ai(e) {
5307
5326
  switch (e) {
5308
5327
  case "narrow_symbol": return "narrowSymbol";
5309
5328
  case "code":
@@ -5312,18 +5331,18 @@ function ki(e) {
5312
5331
  default: return "symbol";
5313
5332
  }
5314
5333
  }
5315
- function Ai(e, t, n) {
5334
+ function ji(e, t, n) {
5316
5335
  return e < t ? t : e > n ? n : e;
5317
5336
  }
5318
5337
  //#endregion
5319
5338
  //#region src/components/fields/cells/factories/refLink.tsx
5320
- var ji = (e) => {
5339
+ var Mi = (e) => {
5321
5340
  let { field: t, entities: n, screens: r, refs: i, navigate: a, surface: o } = e, s = t.ref?.entity, c = s ? n?.[s] : void 0, l = typeof i == "function" ? i : () => i, u = o === "detail", d = c?.display?.icon, f = t.display?.ref_display_field ?? t.ref?.display?.field ?? c?.display?.display_field, p = c?.detail_screen, m = (p ? r?.[p] : void 0)?.route, h = (e) => (t) => {
5322
- t.stopPropagation(), !$t(t) && (t.preventDefault(), a?.(e));
5341
+ t.stopPropagation(), !en(t) && (t.preventDefault(), a?.(e));
5323
5342
  };
5324
5343
  return (e, t) => {
5325
5344
  if (e == null || e === "") return "—";
5326
- let n = String(e), r = Mi(n, s, l(), f), i = m ? m.replace(":id", encodeURIComponent(n)) : void 0;
5345
+ let n = String(e), r = Ni(n, s, l(), f), i = m ? m.replace(":id", encodeURIComponent(n)) : void 0;
5327
5346
  if (u) {
5328
5347
  let e = /* @__PURE__ */ H(B, { children: [d && /* @__PURE__ */ V("span", {
5329
5348
  style: {
@@ -5331,7 +5350,7 @@ var ji = (e) => {
5331
5350
  display: "flex",
5332
5351
  flexShrink: 0
5333
5352
  },
5334
- children: /* @__PURE__ */ V(en, {
5353
+ children: /* @__PURE__ */ V(tn, {
5335
5354
  name: d,
5336
5355
  size: 13
5337
5356
  })
@@ -5381,29 +5400,29 @@ var ji = (e) => {
5381
5400
  }) : r;
5382
5401
  };
5383
5402
  };
5384
- function Mi(e, t, n, r) {
5403
+ function Ni(e, t, n, r) {
5385
5404
  let i = t && n ? n[t]?.[e] : void 0;
5386
- return i ? Je(i, r, e) : e;
5405
+ return i ? Ye(i, r, e) : e;
5387
5406
  }
5388
5407
  //#endregion
5389
5408
  //#region src/components/fields/cells/factories/url-helpers.ts
5390
- var Ni = /^(https?|ftps?|ssh|mailto|tel):/i, Pi = /^(info|name|tech|site|cloud|online|store|shop|blog|space|world|link|live|page|zone|life|team|work|host|land|news|wiki|mobi|coop|aero|asia)$/i;
5391
- function Fi(e) {
5392
- return /^[a-z]{2,3}$/i.test(e) || Pi.test(e);
5393
- }
5409
+ var Pi = /^(https?|ftps?|ssh|mailto|tel):/i, Fi = /^(info|name|tech|site|cloud|online|store|shop|blog|space|world|link|live|page|zone|life|team|work|host|land|news|wiki|mobi|coop|aero|asia)$/i;
5394
5410
  function Ii(e) {
5411
+ return /^[a-z]{2,3}$/i.test(e) || Fi.test(e);
5412
+ }
5413
+ function Li(e) {
5395
5414
  if (!e.includes(".")) return !1;
5396
5415
  let t = e.split(".");
5397
5416
  if (t.length < 3) return !0;
5398
5417
  let n = t[0].toLowerCase();
5399
- return /^(com|org|net|edu|gov)$/.test(n) ? !1 : /^(io|app|dev)$/.test(n) ? Fi(t[t.length - 1]) : !0;
5418
+ return /^(com|org|net|edu|gov)$/.test(n) ? !1 : /^(io|app|dev)$/.test(n) ? Ii(t[t.length - 1]) : !0;
5400
5419
  }
5401
- function Li(e) {
5402
- if (Ni.test(e)) return e;
5420
+ function Ri(e) {
5421
+ if (Pi.test(e)) return e;
5403
5422
  let t = e.match(/^([a-z][a-z0-9+.-]*):/i);
5404
5423
  if (t) {
5405
5424
  let n = t[1], r = e.slice(t[0].length);
5406
- if (/^\d+([/?#]|$)/.test(r) && Ii(n)) {
5425
+ if (/^\d+([/?#]|$)/.test(r) && Li(n)) {
5407
5426
  let t = parseInt(r, 10);
5408
5427
  if (t >= 1 && t <= 65535) return `https://${e}`;
5409
5428
  }
@@ -5411,14 +5430,14 @@ function Li(e) {
5411
5430
  }
5412
5431
  return `https://${e}`;
5413
5432
  }
5414
- function Ri(e) {
5433
+ function zi(e) {
5415
5434
  try {
5416
5435
  return new URL(e).hostname.replace(/^www\./i, "") || null;
5417
5436
  } catch {
5418
5437
  return null;
5419
5438
  }
5420
5439
  }
5421
- function zi(e, t) {
5440
+ function Bi(e, t) {
5422
5441
  if (t !== "linkedin.com") return null;
5423
5442
  try {
5424
5443
  let t = new URL(e).pathname.match(/^\/(in|company|school)\/([^/]+)/i);
@@ -5426,7 +5445,7 @@ function zi(e, t) {
5426
5445
  } catch {}
5427
5446
  return null;
5428
5447
  }
5429
- function Bi(e) {
5448
+ function Vi(e) {
5430
5449
  try {
5431
5450
  return new URL(e), !0;
5432
5451
  } catch {
@@ -5435,7 +5454,7 @@ function Bi(e) {
5435
5454
  }
5436
5455
  //#endregion
5437
5456
  //#region src/components/fields/cells/factories/host-icons.tsx
5438
- function Vi(e, t = "0 0 24 24") {
5457
+ function Hi(e, t = "0 0 24 24") {
5439
5458
  return (n) => /* @__PURE__ */ V("svg", {
5440
5459
  width: 16,
5441
5460
  height: 16,
@@ -5451,11 +5470,11 @@ function Vi(e, t = "0 0 24 24") {
5451
5470
  children: e
5452
5471
  });
5453
5472
  }
5454
- var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5473
+ var Ui = Hi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5455
5474
  cx: "12",
5456
5475
  cy: "12",
5457
5476
  r: "9"
5458
- }), /* @__PURE__ */ V("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), Ui = (e) => /* @__PURE__ */ V("svg", {
5477
+ }), /* @__PURE__ */ V("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), Wi = (e) => /* @__PURE__ */ V("svg", {
5459
5478
  width: 16,
5460
5479
  height: 16,
5461
5480
  viewBox: "0 0 24 24",
@@ -5464,7 +5483,7 @@ var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5464
5483
  style: { flexShrink: 0 },
5465
5484
  ...e,
5466
5485
  children: /* @__PURE__ */ V("path", { d: "M20.45 20.45h-3.55v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.13 1.45-2.13 2.94v5.67H9.36V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.12 2.06 2.06 0 0 1 0 4.12zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z" })
5467
- }), Wi = (e) => /* @__PURE__ */ V("svg", {
5486
+ }), Gi = (e) => /* @__PURE__ */ V("svg", {
5468
5487
  width: 16,
5469
5488
  height: 16,
5470
5489
  viewBox: "0 0 24 24",
@@ -5473,7 +5492,7 @@ var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5473
5492
  style: { flexShrink: 0 },
5474
5493
  ...e,
5475
5494
  children: /* @__PURE__ */ V("path", { d: "M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.21.7-3.89-1.55-3.89-1.55-.52-1.34-1.28-1.7-1.28-1.7-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.2 1.77 1.2 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.26-1.28-5.26-5.71 0-1.26.45-2.3 1.19-3.11-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.19a11.05 11.05 0 0 1 5.79 0c2.21-1.5 3.18-1.19 3.18-1.19.63 1.59.23 2.76.11 3.05.74.81 1.19 1.85 1.19 3.11 0 4.44-2.71 5.42-5.29 5.7.41.36.78 1.07.78 2.16 0 1.56-.01 2.81-.01 3.19 0 .31.21.68.8.56A11.5 11.5 0 0 0 12 .5z" })
5476
- }), Gi = (e) => /* @__PURE__ */ V("svg", {
5495
+ }), Ki = (e) => /* @__PURE__ */ V("svg", {
5477
5496
  width: 16,
5478
5497
  height: 16,
5479
5498
  viewBox: "0 0 24 24",
@@ -5482,7 +5501,7 @@ var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5482
5501
  style: { flexShrink: 0 },
5483
5502
  ...e,
5484
5503
  children: /* @__PURE__ */ V("path", { d: "M18.244 2H21.5l-7.62 8.71L23 22h-7.05l-5.52-7.21L4.07 22H.81l8.18-9.34L1 2h7.22l5 6.59L18.244 2zm-2.47 18h1.95L7.32 4h-2.1l10.55 16z" })
5485
- }), Ki = (e) => /* @__PURE__ */ V("svg", {
5504
+ }), qi = (e) => /* @__PURE__ */ V("svg", {
5486
5505
  width: 16,
5487
5506
  height: 16,
5488
5507
  viewBox: "0 0 24 24",
@@ -5491,7 +5510,7 @@ var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5491
5510
  style: { flexShrink: 0 },
5492
5511
  ...e,
5493
5512
  children: /* @__PURE__ */ V("path", { d: "M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2C0 8.1 0 12 0 12s0 3.9.5 5.8a3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1c.5-1.9.5-5.8.5-5.8s0-3.9-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z" })
5494
- }), qi = (e) => /* @__PURE__ */ V("svg", {
5513
+ }), Ji = (e) => /* @__PURE__ */ V("svg", {
5495
5514
  width: 16,
5496
5515
  height: 16,
5497
5516
  viewBox: "0 0 24 24",
@@ -5500,7 +5519,7 @@ var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5500
5519
  style: { flexShrink: 0 },
5501
5520
  ...e,
5502
5521
  children: /* @__PURE__ */ V("path", { d: "M24 5.45v13.1A1.45 1.45 0 0 1 22.55 20H19.5V9.27L12 14.7 4.5 9.27V20H1.45A1.45 1.45 0 0 1 0 18.55V5.45A1.45 1.45 0 0 1 1.45 4h.5l10.05 7.27L22.05 4h.5A1.45 1.45 0 0 1 24 5.45z" })
5503
- }), Ji = (e) => /* @__PURE__ */ H("svg", {
5522
+ }), Yi = (e) => /* @__PURE__ */ H("svg", {
5504
5523
  width: 16,
5505
5524
  height: 16,
5506
5525
  viewBox: "0 0 24 24",
@@ -5525,7 +5544,7 @@ var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5525
5544
  d: "M15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zm0-1.27a2.52 2.52 0 1 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"
5526
5545
  })
5527
5546
  ]
5528
- }), Yi = (e) => /* @__PURE__ */ V("svg", {
5547
+ }), Xi = (e) => /* @__PURE__ */ V("svg", {
5529
5548
  width: 16,
5530
5549
  height: 16,
5531
5550
  viewBox: "0 0 24 24",
@@ -5534,39 +5553,39 @@ var Hi = Vi(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
5534
5553
  style: { flexShrink: 0 },
5535
5554
  ...e,
5536
5555
  children: /* @__PURE__ */ V("path", { d: "M4.46 3.83 14.94 3a3.7 3.7 0 0 1 2.5.62l3 2.16a1.4 1.4 0 0 1 .56 1.31v13.06a1.7 1.7 0 0 1-1.66 1.7l-12.5.78a2.4 2.4 0 0 1-1.85-.62L2.5 19.7a1.7 1.7 0 0 1-.5-1.2V5.16c0-.74.6-1.27 1.46-1.33l1-.01zm.46 1.86c-.31 0-.46.16-.46.47v12.25c0 .31.16.47.46.47l11.62-.7c.31 0 .46-.16.46-.47V6c0-.32-.16-.47-.46-.47L4.92 5.7zm5.57 2.32c.16 0 .31.16.31.31v.46l3.7.23c.31 0 .46.16.46.47v8.32c0 .31-.16.47-.46.47l-3.7.23c-.31 0-.46-.16-.46-.47V8.78c0-.16.15-.32.15-.46l-.04-.31z" })
5537
- }), Xi = {
5538
- "linkedin.com": Ui,
5539
- "github.com": Wi,
5540
- "x.com": Gi,
5541
- "twitter.com": Gi,
5542
- "youtube.com": Ki,
5543
- "youtu.be": Ki,
5544
- "gmail.com": qi,
5545
- "mail.google.com": qi,
5546
- "slack.com": Ji,
5547
- "notion.so": Yi,
5548
- "notion.com": Yi
5556
+ }), Zi = {
5557
+ "linkedin.com": Wi,
5558
+ "github.com": Gi,
5559
+ "x.com": Ki,
5560
+ "twitter.com": Ki,
5561
+ "youtube.com": qi,
5562
+ "youtu.be": qi,
5563
+ "gmail.com": Ji,
5564
+ "mail.google.com": Ji,
5565
+ "slack.com": Yi,
5566
+ "notion.so": Xi,
5567
+ "notion.com": Xi
5549
5568
  };
5550
- function Zi(e, t) {
5569
+ function Qi(e, t) {
5551
5570
  return !e || t === "none" ? null : t === "google" ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=32` : `https://${e}/favicon.ico`;
5552
5571
  }
5553
- var Qi = {
5572
+ var $i = {
5554
5573
  width: 16,
5555
5574
  height: 16,
5556
5575
  flexShrink: 0,
5557
5576
  objectFit: "contain"
5558
5577
  };
5559
- function $i({ domain: e }) {
5560
- let t = Zt((e) => e.faviconSource), n = e ? e.toLowerCase() : "", r = n ? Xi[n] : void 0;
5578
+ function ea({ domain: e }) {
5579
+ let t = Qt((e) => e.faviconSource), n = e ? e.toLowerCase() : "", r = n ? Zi[n] : void 0;
5561
5580
  if (r) return /* @__PURE__ */ V(r, {});
5562
- let i = Zi(n, t);
5563
- return i ? /* @__PURE__ */ V(ea, { src: i }) : /* @__PURE__ */ V(Hi, {});
5581
+ let i = Qi(n, t);
5582
+ return i ? /* @__PURE__ */ V(ta, { src: i }) : /* @__PURE__ */ V(Ui, {});
5564
5583
  }
5565
- function ea({ src: e }) {
5584
+ function ta({ src: e }) {
5566
5585
  let [t, n] = R(!1);
5567
5586
  return P(() => {
5568
5587
  n(!1);
5569
- }, [e]), t ? /* @__PURE__ */ V(Hi, {}) : /* @__PURE__ */ V("img", {
5588
+ }, [e]), t ? /* @__PURE__ */ V(Ui, {}) : /* @__PURE__ */ V("img", {
5570
5589
  src: e,
5571
5590
  alt: "",
5572
5591
  width: 16,
@@ -5574,7 +5593,7 @@ function ea({ src: e }) {
5574
5593
  loading: "lazy",
5575
5594
  decoding: "async",
5576
5595
  referrerPolicy: "no-referrer",
5577
- style: Qi,
5596
+ style: $i,
5578
5597
  onError: () => n(!0)
5579
5598
  });
5580
5599
  }
@@ -5584,72 +5603,72 @@ var $ = /* @__PURE__ */ V("span", {
5584
5603
  color: "var(--text-4)"
5585
5604
  },
5586
5605
  children: "—"
5587
- }), ta = {
5606
+ }), na = {
5588
5607
  display: "inline-flex",
5589
5608
  alignItems: "center",
5590
5609
  gap: 4,
5591
5610
  fontSize: 12.5,
5592
5611
  color: "var(--accent)",
5593
5612
  textDecoration: "none"
5594
- }, na = { fontSize: 12.5 }, ra = () => (e) => {
5613
+ }, ra = { fontSize: 12.5 }, ia = () => (e) => {
5595
5614
  let t = e == null ? "" : String(e);
5596
5615
  if (!t) return $;
5597
- let n = Li(t);
5598
- if (n == null || !Bi(n)) return /* @__PURE__ */ V("span", {
5599
- style: na,
5616
+ let n = Ri(t);
5617
+ if (n == null || !Vi(n)) return /* @__PURE__ */ V("span", {
5618
+ style: ra,
5600
5619
  children: t
5601
5620
  });
5602
- let r = Ri(n), i = zi(n, r ?? "") ?? r ?? t;
5621
+ let r = zi(n), i = Bi(n, r ?? "") ?? r ?? t;
5603
5622
  return /* @__PURE__ */ H("a", {
5604
5623
  href: n,
5605
5624
  target: "_blank",
5606
5625
  rel: "noopener noreferrer",
5607
5626
  title: t,
5608
5627
  className: "mono",
5609
- style: ta,
5628
+ style: na,
5610
5629
  children: [
5611
- /* @__PURE__ */ V($i, { domain: r }),
5630
+ /* @__PURE__ */ V(ea, { domain: r }),
5612
5631
  i,
5613
5632
  /* @__PURE__ */ V(q.external, { size: 11 })
5614
5633
  ]
5615
5634
  });
5616
- }, ia = {
5635
+ }, aa = {
5617
5636
  fontSize: 12.5,
5618
5637
  color: "var(--accent)",
5619
5638
  textDecoration: "none"
5620
- }, aa = () => (e) => {
5639
+ }, oa = () => (e) => {
5621
5640
  let t = e == null ? "" : String(e);
5622
5641
  return t ? /* @__PURE__ */ V("a", {
5623
5642
  href: `mailto:${t}`,
5624
5643
  className: "mono",
5625
- style: ia,
5644
+ style: aa,
5626
5645
  children: t
5627
5646
  }) : $;
5628
- }, oa = {
5647
+ }, sa = {
5629
5648
  fontSize: 12.5,
5630
5649
  color: "var(--accent)",
5631
5650
  textDecoration: "none"
5632
- }, sa = { fontSize: 12.5 }, ca = /^[+()\-.\s\d]+$/, la = () => (e) => {
5651
+ }, ca = { fontSize: 12.5 }, la = /^[+()\-.\s\d]+$/, ua = () => (e) => {
5633
5652
  let t = e == null ? "" : String(e);
5634
5653
  if (!t) return $;
5635
5654
  let n = t.trim();
5636
- return ca.test(n) ? /* @__PURE__ */ V("a", {
5655
+ return la.test(n) ? /* @__PURE__ */ V("a", {
5637
5656
  href: `tel:${n.replace(/\s+/g, "")}`,
5638
5657
  className: "mono",
5639
- style: oa,
5658
+ style: sa,
5640
5659
  children: t
5641
5660
  }) : /* @__PURE__ */ V("span", {
5642
- style: sa,
5661
+ style: ca,
5643
5662
  children: t
5644
5663
  });
5645
- }, ua = {
5664
+ }, da = {
5646
5665
  fontSize: 12.5,
5647
5666
  fontVariantNumeric: "tabular-nums"
5648
- }, da = {
5667
+ }, fa = {
5649
5668
  color: "var(--text-3)",
5650
5669
  marginLeft: 4
5651
- }, fa = { fontSize: 12.5 };
5652
- function pa(e, t) {
5670
+ }, pa = { fontSize: 12.5 };
5671
+ function ma(e, t) {
5653
5672
  let n = e.trim();
5654
5673
  if (n === "" || n === "-") return n;
5655
5674
  let r = n.startsWith("-"), [i, a] = (r ? n.slice(1) : n).split("."), o;
@@ -5661,45 +5680,45 @@ function pa(e, t) {
5661
5680
  let s = r ? `-${o}` : o;
5662
5681
  return a !== void 0 && (s += `.${a}`), s;
5663
5682
  }
5664
- var ma = (e) => {
5683
+ var ha = (e) => {
5665
5684
  let { field: t, fieldName: n, locale: r = "en" } = e, i = new Intl.NumberFormat(r), a = t.type === "decimal", o = t.unit ? t.unit.display || t.unit.storage : void 0;
5666
5685
  return (e, t) => {
5667
5686
  if (e == null) return $;
5668
5687
  let r = t.$units?.[n] || (o && !o.startsWith("$") ? o : void 0), s;
5669
- if (a && typeof e == "string") s = pa(e, i);
5688
+ if (a && typeof e == "string") s = ma(e, i);
5670
5689
  else {
5671
5690
  let t = typeof e == "number" ? e : Number(e);
5672
5691
  s = Number.isFinite(t) ? i.format(t) : null;
5673
5692
  }
5674
5693
  return s == null ? /* @__PURE__ */ V("span", {
5675
- style: fa,
5694
+ style: pa,
5676
5695
  children: "—"
5677
5696
  }) : /* @__PURE__ */ H("span", {
5678
5697
  className: "num",
5679
- style: ua,
5698
+ style: da,
5680
5699
  children: [s, r && /* @__PURE__ */ V("span", {
5681
- style: da,
5700
+ style: fa,
5682
5701
  children: r
5683
5702
  })]
5684
5703
  });
5685
5704
  };
5686
- }, ha = { fontSize: 12.5 }, ga = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ V("code", {
5705
+ }, ga = { fontSize: 12.5 }, _a = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ V("code", {
5687
5706
  className: "mono",
5688
- style: ha,
5707
+ style: ga,
5689
5708
  children: String(e)
5690
- }), _a = {
5709
+ }), va = {
5691
5710
  display: "inline-flex",
5692
5711
  alignItems: "center",
5693
5712
  gap: 4,
5694
5713
  fontSize: 12.5,
5695
5714
  color: "var(--accent)",
5696
5715
  textDecoration: "none"
5697
- }, va = { fontSize: 12.5 }, ya = () => (e) => {
5716
+ }, ya = { fontSize: 12.5 }, ba = () => (e) => {
5698
5717
  let t = e == null ? "" : String(e);
5699
5718
  if (!t) return $;
5700
- let n = Li(t);
5701
- return n == null || !Bi(n) ? /* @__PURE__ */ V("span", {
5702
- style: va,
5719
+ let n = Ri(t);
5720
+ return n == null || !Vi(n) ? /* @__PURE__ */ V("span", {
5721
+ style: ya,
5703
5722
  children: t
5704
5723
  }) : /* @__PURE__ */ H("a", {
5705
5724
  href: n,
@@ -5707,21 +5726,21 @@ var ma = (e) => {
5707
5726
  rel: "noopener noreferrer",
5708
5727
  title: t,
5709
5728
  className: "mono",
5710
- style: _a,
5729
+ style: va,
5711
5730
  children: [t, /* @__PURE__ */ V(q.external, { size: 11 })]
5712
5731
  });
5713
- }, ba = 400, xa = 2e3;
5714
- function Sa(e) {
5715
- return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) : ba, xa));
5732
+ }, xa = 400, Sa = 2e3;
5733
+ function Ca(e) {
5734
+ return Math.max(1, Math.min(typeof e == "number" && Number.isFinite(e) ? Math.floor(e) : xa, Sa));
5716
5735
  }
5717
- function Ca(e, t) {
5736
+ function wa(e, t) {
5718
5737
  return e.length <= t ? e : `${e.slice(0, t)}...`;
5719
5738
  }
5720
- function wa(e, t, n, r = 0) {
5739
+ function Ta(e, t, n, r = 0) {
5721
5740
  if (e == null || e === "") return "";
5722
- if (typeof e == "string") return Ca(e, t);
5741
+ if (typeof e == "string") return wa(e, t);
5723
5742
  if (typeof e == "number" || typeof e == "boolean") return String(e);
5724
- if (typeof e != "object") return Ca(String(e), t);
5743
+ if (typeof e != "object") return wa(String(e), t);
5725
5744
  if (n.has(e)) return "[Circular]";
5726
5745
  if (r >= 3) return Array.isArray(e) ? "[...]" : "{...}";
5727
5746
  n.add(e);
@@ -5732,30 +5751,30 @@ function wa(e, t, n, r = 0) {
5732
5751
  a.push(a.length > 1 ? ",..." : "...");
5733
5752
  break;
5734
5753
  }
5735
- let f = wa(c, d, n, r + 1);
5754
+ let f = Ta(c, d, n, r + 1);
5736
5755
  if (a.push(u, f), a.join("").length >= t) {
5737
5756
  a.push(",...");
5738
5757
  break;
5739
5758
  }
5740
5759
  }
5741
- return a.push(i), n.delete(e), Ca(a.join(""), t);
5760
+ return a.push(i), n.delete(e), wa(a.join(""), t);
5742
5761
  }
5743
- function Ta(e, t) {
5744
- return wa(e, t, /* @__PURE__ */ new WeakSet());
5762
+ function Ea(e, t) {
5763
+ return Ta(e, t, /* @__PURE__ */ new WeakSet());
5745
5764
  }
5746
- var Ea = (e) => {
5747
- let t = e.surface ?? "detail", n = Sa(e.field.display?.list_preview?.max_chars);
5765
+ var Da = (e) => {
5766
+ let t = e.surface ?? "detail", n = Ca(e.field.display?.list_preview?.max_chars);
5748
5767
  return (r) => {
5749
- if (qn(r)) return $;
5768
+ if (Jn(r)) return $;
5750
5769
  if (t === "list") {
5751
- let e = Ta(r, n);
5770
+ let e = Ea(r, n);
5752
5771
  return /* @__PURE__ */ V("span", {
5753
5772
  className: "font-mono text-xs text-muted-foreground",
5754
5773
  title: e,
5755
5774
  children: e
5756
5775
  });
5757
5776
  }
5758
- return /* @__PURE__ */ V(Jn, {
5777
+ return /* @__PURE__ */ V(Yn, {
5759
5778
  field: e.field,
5760
5779
  fieldName: e.fieldName,
5761
5780
  value: r,
@@ -5763,7 +5782,7 @@ var Ea = (e) => {
5763
5782
  locale: e.locale
5764
5783
  });
5765
5784
  };
5766
- }, Da = [
5785
+ }, Oa = [
5767
5786
  {
5768
5787
  pattern: /```[^\n]*\n?([\s\S]*?)```/g,
5769
5788
  replacement: "$1"
@@ -5826,13 +5845,13 @@ var Ea = (e) => {
5826
5845
  replacement: ""
5827
5846
  }
5828
5847
  ];
5829
- function Oa(e) {
5848
+ function ka(e) {
5830
5849
  if (!e) return {
5831
5850
  text: "",
5832
5851
  isPlain: !0
5833
5852
  };
5834
5853
  let t = e, n = !1;
5835
- for (let e of Da) {
5854
+ for (let e of Oa) {
5836
5855
  let r = t.replace(e.pattern, e.replacement);
5837
5856
  r !== t && e.structural !== !1 && (n = !0), t = r;
5838
5857
  }
@@ -5843,123 +5862,123 @@ function Oa(e) {
5843
5862
  }
5844
5863
  //#endregion
5845
5864
  //#region src/components/fields/cells/factories/markdown.tsx
5846
- function ka(e) {
5847
- return /* @__PURE__ */ V(rn, { content: e });
5865
+ function Aa(e) {
5866
+ return /* @__PURE__ */ V(an, { content: e });
5848
5867
  }
5849
- var Aa = (e) => {
5868
+ var ja = (e) => {
5850
5869
  let t = e.surface === "list";
5851
5870
  return (e) => {
5852
5871
  let n = e == null ? "" : String(e);
5853
5872
  if (!n) return $;
5854
- if (!t) return ka(n);
5855
- let { text: r, isPlain: i } = Oa(n);
5873
+ if (!t) return Aa(n);
5874
+ let { text: r, isPlain: i } = ka(n);
5856
5875
  return i ? /* @__PURE__ */ V("span", {
5857
5876
  title: r,
5858
5877
  children: r
5859
5878
  }) : /* @__PURE__ */ V(ge, {
5860
- content: ka(n),
5879
+ content: Aa(n),
5861
5880
  children: /* @__PURE__ */ V("span", {
5862
5881
  title: r,
5863
5882
  children: r
5864
5883
  })
5865
5884
  });
5866
5885
  };
5867
- }, ja = "[SET]", Ma = {
5886
+ }, Ma = "[SET]", Na = {
5868
5887
  fontSize: 12.5,
5869
5888
  color: "var(--text-3)"
5870
- }, Na = {
5889
+ }, Pa = {
5871
5890
  fontSize: 12.5,
5872
5891
  color: "var(--text-4)",
5873
5892
  fontStyle: "italic"
5874
- }, Pa = () => (e) => e === ja || typeof e == "string" && e !== "" ? /* @__PURE__ */ V("span", {
5893
+ }, Fa = () => (e) => e === Ma || typeof e == "string" && e !== "" ? /* @__PURE__ */ V("span", {
5875
5894
  className: "mono",
5876
- style: Ma,
5877
- children: ja
5878
- }) : /* @__PURE__ */ V("span", {
5879
5895
  style: Na,
5896
+ children: Ma
5897
+ }) : /* @__PURE__ */ V("span", {
5898
+ style: Pa,
5880
5899
  children: "Not set"
5881
5900
  });
5882
5901
  //#endregion
5883
5902
  //#region src/components/fields/cells/factories/richTextPreview.tsx
5884
- function Fa(e, t) {
5885
- return /* @__PURE__ */ V(rn, {
5903
+ function Ia(e, t) {
5904
+ return /* @__PURE__ */ V(an, {
5886
5905
  content: e,
5887
5906
  files: t
5888
5907
  });
5889
5908
  }
5890
- var Ia = (e) => {
5909
+ var La = (e) => {
5891
5910
  let { fieldName: t } = e, n = e.surface === "list";
5892
5911
  return (e, r) => {
5893
5912
  let i = r?.$files?.[t], a = k(e, i);
5894
5913
  if (!a.markdown) return $;
5895
- if (!n) return Fa(a.markdown, a.files);
5896
- let { text: o, isPlain: s } = Oa(a.markdown);
5914
+ if (!n) return Ia(a.markdown, a.files);
5915
+ let { text: o, isPlain: s } = ka(a.markdown);
5897
5916
  return s ? /* @__PURE__ */ V("span", {
5898
5917
  title: o,
5899
5918
  children: o
5900
5919
  }) : /* @__PURE__ */ V(ge, {
5901
- content: Fa(a.markdown, a.files),
5920
+ content: Ia(a.markdown, a.files),
5902
5921
  children: /* @__PURE__ */ V("span", {
5903
5922
  title: o,
5904
5923
  children: o
5905
5924
  })
5906
5925
  });
5907
5926
  };
5908
- }, La = { fontSize: 12.5 }, Ra = {
5927
+ }, Ra = { fontSize: 12.5 }, za = {
5909
5928
  fontSize: 12.5,
5910
5929
  whiteSpace: "pre-wrap",
5911
5930
  margin: 0
5912
5931
  };
5913
- function za(e) {
5932
+ function Ba(e) {
5914
5933
  return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
5915
5934
  }
5916
- function Ba(e, t) {
5935
+ function Va(e, t) {
5917
5936
  if (t && typeof e[t] == "string" && e[t] !== "") return [t, e[t]];
5918
5937
  for (let [t, n] of Object.entries(e)) if (typeof n == "string" && n !== "") return [t, n];
5919
5938
  return null;
5920
5939
  }
5921
5940
  //#endregion
5922
5941
  //#region src/components/fields/cells/registry.ts
5923
- var Va = {
5924
- text: ui,
5925
- bool_pill: di,
5926
- badge: gi,
5927
- status_pill: yi,
5928
- tag_list: Si,
5929
- time_ago: Ci,
5930
- timestamp_full: wi,
5931
- next_run: Di,
5932
- money: Oi,
5933
- ref_link: ji,
5934
- url: ra,
5935
- email: aa,
5936
- phone: la,
5937
- number: ma,
5938
- code: ga,
5939
- link: ya,
5940
- json: Ea,
5941
- markdown: Aa,
5942
- password_mask: Pa,
5943
- rich_text_preview: Ia,
5942
+ var Ha = {
5943
+ text: di,
5944
+ bool_pill: fi,
5945
+ badge: _i,
5946
+ status_pill: bi,
5947
+ tag_list: Ci,
5948
+ time_ago: wi,
5949
+ timestamp_full: Ti,
5950
+ next_run: Oi,
5951
+ money: ki,
5952
+ ref_link: Mi,
5953
+ url: ia,
5954
+ email: oa,
5955
+ phone: ua,
5956
+ number: ha,
5957
+ code: _a,
5958
+ link: ba,
5959
+ json: Da,
5960
+ markdown: ja,
5961
+ password_mask: Fa,
5962
+ rich_text_preview: La,
5944
5963
  multilang_inline: (e) => {
5945
5964
  let { field: t, locale: n } = e, r = t.type === "multilang_text";
5946
5965
  return (e) => {
5947
- let t = Ba(za(e), n);
5966
+ let t = Va(Ba(e), n);
5948
5967
  if (!t) return r ? /* @__PURE__ */ V("p", {
5949
- style: Ra,
5968
+ style: za,
5950
5969
  children: "—"
5951
5970
  }) : /* @__PURE__ */ V("span", {
5952
- style: La,
5971
+ style: Ra,
5953
5972
  children: "—"
5954
5973
  });
5955
5974
  let [i, a] = t;
5956
5975
  return r ? /* @__PURE__ */ V("p", {
5957
- style: Ra,
5976
+ style: za,
5958
5977
  lang: i,
5959
5978
  dir: "auto",
5960
5979
  children: a
5961
5980
  }) : /* @__PURE__ */ V("span", {
5962
- style: La,
5981
+ style: Ra,
5963
5982
  lang: i,
5964
5983
  dir: "auto",
5965
5984
  children: a
@@ -5967,53 +5986,53 @@ var Va = {
5967
5986
  };
5968
5987
  }
5969
5988
  };
5970
- Object.keys(Va).sort();
5971
- function Ha(e) {
5972
- let t = e.field.display?.widget ?? "text", n = Va[t];
5989
+ Object.keys(Ha).sort();
5990
+ function Ua(e) {
5991
+ let t = e.field.display?.widget ?? "text", n = Ha[t];
5973
5992
  if (!n) throw Error(`resolveCellRenderer: no factory registered for widget "${t}" (field "${e.fieldName}"). The engine must stamp a smart default at YAML-load time; an unknown widget here indicates an out-of-sync allow-list.`);
5974
5993
  return n(e);
5975
5994
  }
5976
5995
  //#endregion
5977
5996
  //#region src/components/fields/index.tsx
5978
- var Ua = {
5979
- string: xn,
5980
- text: Sn,
5981
- rich_text: si,
5982
- int: Bn,
5983
- float: Bn,
5984
- decimal: Bn,
5985
- bool: Ln,
5986
- timestamp: In,
5987
- date: In,
5988
- time: In,
5989
- enum: wn,
5990
- email: Tn,
5991
- url: En,
5992
- phone: Dn,
5993
- uuid: xn,
5994
- bytes: xn,
5995
- ref: Wn,
5996
- json: Jn,
5997
- tags: xn,
5998
- string_array: sr,
5999
- int_array: lr,
6000
- uuid_array: sr,
6001
- multilang: Xn,
6002
- multilang_text: Qn,
6003
- structure: $n,
6004
- secret: rr,
6005
- password: ar
5997
+ var Wa = {
5998
+ string: Sn,
5999
+ text: Cn,
6000
+ rich_text: ci,
6001
+ int: Vn,
6002
+ float: Vn,
6003
+ decimal: Vn,
6004
+ bool: Rn,
6005
+ timestamp: Ln,
6006
+ date: Ln,
6007
+ time: Ln,
6008
+ enum: Tn,
6009
+ email: En,
6010
+ url: Dn,
6011
+ phone: On,
6012
+ uuid: Sn,
6013
+ bytes: Sn,
6014
+ ref: Gn,
6015
+ json: Yn,
6016
+ tags: Sn,
6017
+ string_array: cr,
6018
+ int_array: ur,
6019
+ uuid_array: cr,
6020
+ multilang: Zn,
6021
+ multilang_text: $n,
6022
+ structure: er,
6023
+ secret: ir,
6024
+ password: or
6006
6025
  };
6007
- for (let e of yn) if (!Ua[e]) throw Error(`editRegistry: missing entry for FieldType "${e}". The TS union (types/fieldType.ts) and editRegistry must stay in sync with golang/internal/engine/types.go.`);
6008
- function Wa(e) {
6009
- if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ V($n, { ...e });
6026
+ for (let e of bn) if (!Wa[e]) throw Error(`editRegistry: missing entry for FieldType "${e}". The TS union (types/fieldType.ts) and editRegistry must stay in sync with golang/internal/engine/types.go.`);
6027
+ function Ga(e) {
6028
+ if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ V(er, { ...e });
6010
6029
  if (e.mode === "edit") {
6011
- let t = Ua[e.field.type];
6030
+ let t = Wa[e.field.type];
6012
6031
  if (!t) throw Error(`renderField: no edit-mode renderer for FieldType "${e.field.type}" (field "${e.fieldName}"). editRegistry must be total over FieldType; check types/fieldType.ts and components/fields/index.tsx.`);
6013
6032
  return /* @__PURE__ */ V(t, { ...e });
6014
6033
  }
6015
6034
  if (!e.field.display?.widget) throw Error(`renderField: display mode requires a non-empty field.display.widget (field "${e.fieldName}", type "${e.field.type}"). The engine must stamp a smart default; an empty widget here means the field bypassed ResolveDefaultWidgets.`);
6016
- return Ha({
6035
+ return Ua({
6017
6036
  field: e.field,
6018
6037
  fieldName: e.fieldName,
6019
6038
  surface: e.surface ?? "detail",
@@ -6027,26 +6046,26 @@ function Wa(e) {
6027
6046
  }
6028
6047
  //#endregion
6029
6048
  //#region src/hooks/useUserLocale.ts
6030
- var Ga = "en";
6031
- function Ka() {
6049
+ var Ka = "en";
6050
+ function qa() {
6032
6051
  if (typeof navigator > "u") return;
6033
6052
  let e = navigator.language;
6034
6053
  if (e) return e.split("-")[0] || void 0;
6035
6054
  }
6036
- function qa() {
6037
- let e = At((e) => e.user), { data: t } = jt(), n = e?.language;
6055
+ function Ja() {
6056
+ let e = jt((e) => e.user), { data: t } = Mt(), n = e?.language;
6038
6057
  if (n && n.trim()) return n;
6039
6058
  let r = t?.languages?.[0]?.code;
6040
- return r && r.trim() ? r : Ka() || Ga;
6059
+ return r && r.trim() ? r : qa() || Ka;
6041
6060
  }
6042
6061
  //#endregion
6043
6062
  //#region src/components/primitives/dataTableStyles.ts
6044
- var Ja = {
6063
+ var Ya = {
6045
6064
  width: "100%",
6046
6065
  fontSize: 12.5,
6047
6066
  borderCollapse: "separate",
6048
6067
  borderSpacing: 0
6049
- }, Ya = {
6068
+ }, Xa = {
6050
6069
  height: 30,
6051
6070
  padding: "0 12px",
6052
6071
  textAlign: "left",
@@ -6054,13 +6073,13 @@ var Ja = {
6054
6073
  fontSize: 11,
6055
6074
  color: "var(--text-3)",
6056
6075
  borderBottom: "1px solid var(--divider)"
6057
- }, Xa = {
6076
+ }, Za = {
6058
6077
  padding: "6px 12px",
6059
6078
  borderBottom: "1px solid var(--divider)",
6060
6079
  color: "var(--text-2)",
6061
6080
  verticalAlign: "middle"
6062
6081
  };
6063
6082
  //#endregion
6064
- export { Dt as $, ae as $t, cn as A, He as At, rn as B, Ce as Bt, Hn as C, Ze as Ct, bn as D, Ve as Dt, On as E, Oe as Et, sn as F, Ue as Ft, Zt as G, le as Gt, Qt as H, ye as Ht, on as I, De as It, kt as J, oe as Jt, jt as K, ce as Kt, vn as L, Ee as Lt, dn as M, Be as Mt, _n as N, Ae as Nt, mn as O, ze as Ot, pn as P, Z as Pt, Et as Q, q as Qt, fn as R, Te as Rt, Un as S, st as St, kn as T, Fe as Tt, $t as U, _e as Ut, en as V, Se as Vt, Kt as W, ge as Wt, bt as X, Y as Xt, _t as Y, X as Yt, Ot as Z, J as Zt, _r as _, rt as _t, Wa as a, St as at, pr as b, it as bt, ai as c, lt as ct, Xr as d, nt as dt, wt as et, Yr as f, Qe as ft, Dr as g, Q as gt, Or as h, dt as ht, qa as i, Tt as it, un as j, Pe as jt, gn as k, We as kt, Gr as l, ut as lt, kr as m, tt as mt, Ya as n, vt as nt, Ha as o, Ke as ot, Jr as p, qe as pt, At as q, se as qt, Ja as r, yt as rt, ii as s, ct as st, Xa as t, xt as tt, qr as u, et as ut, gr as v, ot as vt, Vn as w, Ge as wt, dr as x, $e as xt, fr as y, at as yt, ln as z, we as zt };
6083
+ export { Ot as $, q as $t, ln as A, Ue as At, an as B, we as Bt, Un as C, Qe as Ct, xn as D, He as Dt, kn as E, ke as Et, cn as F, We as Ft, Qt as G, ge as Gt, $t as H, Se as Ht, sn as I, Oe as It, At as J, se as Jt, Mt as K, le as Kt, yn as L, De as Lt, fn as M, Ve as Mt, vn as N, je as Nt, hn as O, Be as Ot, mn as P, Z as Pt, Dt as Q, J as Qt, pn as R, Ee as Rt, Wn as S, ct as St, An as T, Ie as Tt, en as U, ye as Ut, tn as V, Ce as Vt, qt as W, _e as Wt, xt as X, X as Xt, vt as Y, oe as Yt, kt as Z, Y as Zt, vr as _, it as _t, Ga as a, Ct as at, mr as b, at as bt, oi as c, ut as ct, Zr as d, rt as dt, ae as en, Tt as et, Xr as f, $e as ft, Or as g, Q as gt, kr as h, ft as ht, Ja as i, Et as it, dn as j, Fe as jt, _n as k, Ge as kt, Kr as l, dt as lt, Ar as m, nt as mt, Xa as n, yt as nt, Ua as o, qe as ot, Yr as p, Je as pt, jt as q, ce as qt, Ya as r, bt as rt, ai as s, lt as st, Za as t, St as tt, Jr as u, tt as ut, _r as v, st as vt, Hn as w, Ke as wt, fr as x, et as xt, pr as y, ot as yt, un as z, Te as zt };
6065
6084
 
6066
- //# sourceMappingURL=dataTableStyles-4q9A0Djy.js.map
6085
+ //# sourceMappingURL=dataTableStyles-DctG2tMU.js.map