@declarion/react 0.38.1 → 0.38.5

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,14 +1,14 @@
1
1
  import { c as e, s as t, t as n } from "./DynamicIcon-DeRpAaXm.js";
2
2
  import { Suspense as r, createContext as i, forwardRef as a, lazy as o, useCallback as s, useContext as c, useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
3
3
  import { useLocation as m, useNavigate as h } from "react-router-dom";
4
- import { useQuery as g } from "@tanstack/react-query";
5
- import { toast as _ } from "sonner";
6
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
7
- import { createPortal as x } from "react-dom";
8
- import { create as S } from "zustand";
9
- import { formatDistanceStrict as C, formatDistanceToNowStrict as w, formatISO as T } from "date-fns";
4
+ import { useQuery as g, useQueryClient as _ } from "@tanstack/react-query";
5
+ import { toast as v } from "sonner";
6
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
7
+ import { createPortal as S } from "react-dom";
8
+ import { create as C } from "zustand";
9
+ import { formatDistanceStrict as w, formatDistanceToNowStrict as T, formatISO as E } from "date-fns";
10
10
  //#region src/components/primitives/Btn.tsx
11
- var E = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r, children: i, onClick: a, active: o, danger: s, style: c, disabled: l, type: u = "button", title: d, ...f }, p) {
11
+ var D = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r, children: i, onClick: a, active: o, danger: s, style: c, disabled: l, type: u = "button", title: d, ...f }, p) {
12
12
  let m = {
13
13
  display: "inline-flex",
14
14
  alignItems: "center",
@@ -49,7 +49,7 @@ var E = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r,
49
49
  })), l && Object.assign(m, {
50
50
  opacity: .5,
51
51
  pointerEvents: "none"
52
- }), Object.assign(m, c || {}), /* @__PURE__ */ b("button", {
52
+ }), Object.assign(m, c || {}), /* @__PURE__ */ x("button", {
53
53
  ref: p,
54
54
  type: u,
55
55
  onClick: a,
@@ -69,8 +69,8 @@ var E = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r,
69
69
  r
70
70
  ]
71
71
  });
72
- }), D = a(function({ icon: e, onClick: t, title: n, size: r = 28, active: i, disabled: a, style: o }, s) {
73
- return /* @__PURE__ */ y("button", {
72
+ }), O = a(function({ icon: e, onClick: t, title: n, size: r = 28, active: i, disabled: a, style: o }, s) {
73
+ return /* @__PURE__ */ b("button", {
74
74
  type: "button",
75
75
  ref: s,
76
76
  onClick: t,
@@ -103,9 +103,9 @@ var E = a(function({ kind: e = "default", size: t = "sm", icon: n, iconRight: r,
103
103
  });
104
104
  //#endregion
105
105
  //#region src/components/primitives/Pill.tsx
106
- function O({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style: i }) {
106
+ function k({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style: i }) {
107
107
  let a = `var(--pill-${e}-bg)`, o = `var(--pill-${e})`;
108
- return /* @__PURE__ */ b("span", {
108
+ return /* @__PURE__ */ x("span", {
109
109
  className: "num",
110
110
  style: {
111
111
  display: "inline-flex",
@@ -122,12 +122,12 @@ function O({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style:
122
122
  maxWidth: "100%",
123
123
  ...i
124
124
  },
125
- children: [r && /* @__PURE__ */ y("span", { style: {
125
+ children: [r && /* @__PURE__ */ b("span", { style: {
126
126
  width: 6,
127
127
  height: 6,
128
128
  borderRadius: 999,
129
129
  background: o
130
- } }), /* @__PURE__ */ y("span", {
130
+ } }), /* @__PURE__ */ b("span", {
131
131
  style: {
132
132
  minWidth: 0,
133
133
  overflow: "hidden",
@@ -140,8 +140,8 @@ function O({ tone: e = "slate", children: t, size: n = "sm", dot: r = !1, style:
140
140
  }
141
141
  //#endregion
142
142
  //#region src/components/primitives/Kbd.tsx
143
- function k({ children: e }) {
144
- return /* @__PURE__ */ y("span", {
143
+ function A({ children: e }) {
144
+ return /* @__PURE__ */ b("span", {
145
145
  className: "mono",
146
146
  style: {
147
147
  display: "inline-flex",
@@ -161,11 +161,11 @@ function k({ children: e }) {
161
161
  }
162
162
  //#endregion
163
163
  //#region src/components/primitives/Dropdown.tsx
164
- function A({ open: e, onClose: t, anchor: n, children: r, align: i = "start", width: a, style: o }) {
164
+ function j({ open: e, onClose: t, anchor: n, children: r, align: i = "start", width: a, style: o }) {
165
165
  let s = f(null), [c, d] = p(null);
166
166
  if (u(() => {
167
167
  if (!e || !n) return;
168
- let t = n.getBoundingClientRect(), r = ee(), o = s.current?.offsetHeight || 260, c = r - t.bottom < o + 12 && t.top > o + 12 ? "above" : "below", l = c === "below" ? t.bottom + 4 : t.top - 4 - o, u = typeof window < "u" ? window.innerWidth : 0, f = i === "end" ? t.right - (a || 200) : t.left;
168
+ let t = n.getBoundingClientRect(), r = M(), o = s.current?.offsetHeight || 260, c = r - t.bottom < o + 12 && t.top > o + 12 ? "above" : "below", l = c === "below" ? t.bottom + 4 : t.top - 4 - o, u = typeof window < "u" ? window.innerWidth : 0, f = i === "end" ? t.right - (a || 200) : t.left;
169
169
  u && (f = Math.max(8, Math.min(f, u - (a || 200) - 8))), d((e) => e && e.top === l && e.left === f && e.placement === c ? e : {
170
170
  top: l,
171
171
  left: f,
@@ -188,8 +188,8 @@ function A({ open: e, onClose: t, anchor: n, children: r, align: i = "start", wi
188
188
  n,
189
189
  t
190
190
  ]), !e || !c) return null;
191
- let m = c.placement === "below" ? `calc(var(--app-height) - ${c.top}px - 8px)` : `${Math.max(120, c.top - 8)}px`, h = j(o?.maxHeight), g = h ? `min(${m}, ${h})` : m;
192
- return x(/* @__PURE__ */ y("div", {
191
+ let m = c.placement === "below" ? `calc(var(--app-height) - ${c.top}px - 8px)` : `${Math.max(120, c.top - 8)}px`, h = ee(o?.maxHeight), g = h ? `min(${m}, ${h})` : m;
192
+ return S(/* @__PURE__ */ b("div", {
193
193
  ref: s,
194
194
  style: {
195
195
  position: "fixed",
@@ -211,7 +211,7 @@ function A({ open: e, onClose: t, anchor: n, children: r, align: i = "start", wi
211
211
  children: r
212
212
  }), document.body);
213
213
  }
214
- function ee() {
214
+ function M() {
215
215
  if (typeof window > "u" || typeof document > "u") return 0;
216
216
  let e = getComputedStyle(document.documentElement).getPropertyValue("--app-height").trim();
217
217
  if (e.endsWith("px")) {
@@ -221,14 +221,14 @@ function ee() {
221
221
  let t = window.visualViewport?.height;
222
222
  return Number.isFinite(t) && t && t > 0 ? t : window.innerHeight;
223
223
  }
224
- function j(e) {
224
+ function ee(e) {
225
225
  if (e != null) return typeof e == "number" ? `${e}px` : String(e);
226
226
  }
227
227
  //#endregion
228
228
  //#region src/components/primitives/HoverCard.tsx
229
229
  var te = 400, ne = 150, re = 320, ie = 240, ae = 4, oe = 4;
230
230
  function se({ content: e, children: t, width: n = re, align: r = "center", style: i }) {
231
- let a = f(null), o = f(null), c = f(null), u = f(null), [d, m] = p(!1), [h, g] = p(null), [_, S] = p(!1), C = s(() => {
231
+ let a = f(null), o = f(null), c = f(null), u = f(null), [d, m] = p(!1), [h, g] = p(null), [_, v] = p(!1), C = s(() => {
232
232
  let e = a.current;
233
233
  if (!e) return;
234
234
  let t = e.getBoundingClientRect(), i = typeof window < "u" ? window.visualViewport : void 0, s = i?.width ?? (typeof window < "u" ? window.innerWidth : 0), c = i?.height ?? (typeof window < "u" ? window.innerHeight : 0), l = i?.offsetLeft ?? 0, u = i?.offsetTop ?? 0, d = Math.min(n, Math.max(160, s - ae * 2)), f = o.current?.offsetHeight ?? ie, p = u + c - t.bottom < f + oe * 2 && t.top > f + oe * 2 ? "above" : "below", m = p === "below" ? t.bottom + oe : t.top - oe - f, h;
@@ -243,10 +243,10 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
243
243
  }, [r, n]), w = f(null), T = s((e) => {
244
244
  if (o.current = e, w.current &&= (w.current.disconnect(), null), e) if (typeof ResizeObserver < "u") {
245
245
  let t = new ResizeObserver(() => {
246
- C(), S(!0);
246
+ C(), v(!0);
247
247
  });
248
248
  t.observe(e), w.current = t;
249
- } else S(!0);
249
+ } else v(!0);
250
250
  }, [C]), E = s(() => {
251
251
  c.current !== null && (window.clearTimeout(c.current), c.current = null), u.current !== null && (window.clearTimeout(u.current), u.current = null);
252
252
  }, []), D = () => {
@@ -266,7 +266,7 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
266
266
  E(), w.current &&= (w.current.disconnect(), null);
267
267
  }, [E]), l(() => {
268
268
  if (!d) {
269
- S(!1);
269
+ v(!1);
270
270
  return;
271
271
  }
272
272
  return C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C), () => {
@@ -280,7 +280,7 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
280
280
  };
281
281
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
282
282
  }, [k, d]);
283
- let ee = d && h ? x(/* @__PURE__ */ y("div", {
283
+ let j = d && h ? S(/* @__PURE__ */ b("div", {
284
284
  ref: T,
285
285
  role: "tooltip",
286
286
  onMouseEnter: () => {
@@ -308,7 +308,7 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
308
308
  },
309
309
  children: e
310
310
  }), document.body) : null;
311
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("span", {
311
+ return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
312
312
  ref: a,
313
313
  tabIndex: 0,
314
314
  "aria-haspopup": "dialog",
@@ -334,12 +334,12 @@ function se({ content: e, children: t, width: n = re, align: r = "center", style
334
334
  outline: "none"
335
335
  },
336
336
  children: t
337
- }), ee] });
337
+ }), j] });
338
338
  }
339
339
  //#endregion
340
340
  //#region src/components/primitives/Chip.tsx
341
- function M({ icon: e, children: n, onRemove: r, onClick: i }) {
342
- return /* @__PURE__ */ b("span", {
341
+ function N({ icon: e, children: n, onRemove: r, onClick: i }) {
342
+ return /* @__PURE__ */ x("span", {
343
343
  onClick: i,
344
344
  style: {
345
345
  display: "inline-flex",
@@ -357,7 +357,7 @@ function M({ icon: e, children: n, onRemove: r, onClick: i }) {
357
357
  children: [
358
358
  e,
359
359
  n,
360
- r && /* @__PURE__ */ y("button", {
360
+ r && /* @__PURE__ */ b("button", {
361
361
  type: "button",
362
362
  onClick: (e) => {
363
363
  e.stopPropagation(), r();
@@ -371,7 +371,7 @@ function M({ icon: e, children: n, onRemove: r, onClick: i }) {
371
371
  cursor: "pointer",
372
372
  display: "flex"
373
373
  },
374
- children: /* @__PURE__ */ y(t.x, { size: 12 })
374
+ children: /* @__PURE__ */ b(t.x, { size: 12 })
375
375
  })
376
376
  ]
377
377
  });
@@ -457,7 +457,7 @@ function ve({ children: e, breakpoints: t = ue, viewportOverride: n, viewport: r
457
457
  isDesktop: o === "desktop",
458
458
  touch: i.touch ?? !1
459
459
  }), [o, i]);
460
- return /* @__PURE__ */ y(fe.Provider, {
460
+ return /* @__PURE__ */ b(fe.Provider, {
461
461
  value: s,
462
462
  children: e
463
463
  });
@@ -468,7 +468,7 @@ function ye() {
468
468
  //#endregion
469
469
  //#region src/components/primitives/BoolToggle.tsx
470
470
  function be({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
471
- return /* @__PURE__ */ y("button", {
471
+ return /* @__PURE__ */ b("button", {
472
472
  type: "button",
473
473
  id: n,
474
474
  "aria-labelledby": r,
@@ -486,7 +486,7 @@ function be({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
486
486
  cursor: "pointer",
487
487
  transition: "background .15s"
488
488
  },
489
- children: /* @__PURE__ */ y("span", { style: {
489
+ children: /* @__PURE__ */ b("span", { style: {
490
490
  display: "block",
491
491
  width: 14,
492
492
  height: 14,
@@ -501,14 +501,14 @@ function be({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
501
501
  //#endregion
502
502
  //#region src/components/primitives/MenuItem.tsx
503
503
  function xe({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, divider: o, disabled: s, title: c, "data-testid": l }) {
504
- return o ? /* @__PURE__ */ y("div", {
504
+ return o ? /* @__PURE__ */ b("div", {
505
505
  role: "separator",
506
506
  style: {
507
507
  height: 1,
508
508
  background: "var(--divider)",
509
509
  margin: "4px 0"
510
510
  }
511
- }) : /* @__PURE__ */ b("div", {
511
+ }) : /* @__PURE__ */ x("div", {
512
512
  role: "menuitem",
513
513
  tabIndex: s ? -1 : 0,
514
514
  onClick: s ? void 0 : n,
@@ -537,32 +537,32 @@ function xe({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, di
537
537
  e.currentTarget.style.background = a ? "var(--surface-3)" : "transparent";
538
538
  },
539
539
  children: [
540
- e && /* @__PURE__ */ y("span", {
540
+ e && /* @__PURE__ */ b("span", {
541
541
  style: {
542
542
  color: r ? "var(--danger)" : "var(--text-3)",
543
543
  display: "flex"
544
544
  },
545
545
  children: e
546
546
  }),
547
- /* @__PURE__ */ y("span", {
547
+ /* @__PURE__ */ b("span", {
548
548
  style: { flex: 1 },
549
549
  children: t
550
550
  }),
551
- i && /* @__PURE__ */ y(k, { children: i })
551
+ i && /* @__PURE__ */ b(A, { children: i })
552
552
  ]
553
553
  });
554
554
  }
555
555
  //#endregion
556
556
  //#region src/components/primitives/Spinner.tsx
557
557
  function Se({ size: e = 14 }) {
558
- return /* @__PURE__ */ b("svg", {
558
+ return /* @__PURE__ */ x("svg", {
559
559
  width: e,
560
560
  height: e,
561
561
  viewBox: "0 0 24 24",
562
562
  style: { animation: "spin 0.8s linear infinite" },
563
563
  children: [
564
- /* @__PURE__ */ y("style", { children: "@keyframes spin{to{transform:rotate(360deg);}}" }),
565
- /* @__PURE__ */ y("circle", {
564
+ /* @__PURE__ */ b("style", { children: "@keyframes spin{to{transform:rotate(360deg);}}" }),
565
+ /* @__PURE__ */ b("circle", {
566
566
  cx: "12",
567
567
  cy: "12",
568
568
  r: "9",
@@ -570,7 +570,7 @@ function Se({ size: e = 14 }) {
570
570
  strokeWidth: "2.5",
571
571
  fill: "none"
572
572
  }),
573
- /* @__PURE__ */ y("path", {
573
+ /* @__PURE__ */ b("path", {
574
574
  d: "M12 3a9 9 0 0 1 9 9",
575
575
  stroke: "var(--accent)",
576
576
  strokeWidth: "2.5",
@@ -582,7 +582,7 @@ function Se({ size: e = 14 }) {
582
582
  }
583
583
  //#endregion
584
584
  //#region src/components/primitives/Fields.tsx
585
- var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ b("div", {
585
+ var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ x("div", {
586
586
  style: {
587
587
  display: "flex",
588
588
  alignItems: "center",
@@ -594,20 +594,20 @@ var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ b("div", {
594
594
  letterSpacing: "0.01em"
595
595
  },
596
596
  children: [
597
- /* @__PURE__ */ y("span", { children: e }),
598
- n && /* @__PURE__ */ y("span", {
597
+ /* @__PURE__ */ b("span", { children: e }),
598
+ n && /* @__PURE__ */ b("span", {
599
599
  "aria-hidden": "true",
600
600
  style: { color: "var(--danger)" },
601
601
  children: "*"
602
602
  }),
603
- r && /* @__PURE__ */ y("span", {
603
+ r && /* @__PURE__ */ b("span", {
604
604
  title: r,
605
605
  style: {
606
606
  cursor: "help",
607
607
  color: "var(--text-4)",
608
608
  display: "flex"
609
609
  },
610
- children: /* @__PURE__ */ y(t.info, { size: 11 })
610
+ children: /* @__PURE__ */ b(t.info, { size: 11 })
611
611
  })
612
612
  ]
613
613
  }), we = {
@@ -623,9 +623,9 @@ var Ce = ({ children: e, required: n, hint: r }) => /* @__PURE__ */ b("div", {
623
623
  outline: "none",
624
624
  transition: "border-color .12s, box-shadow .12s"
625
625
  };
626
- function N({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style: a, ...o }) {
626
+ function P({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style: a, ...o }) {
627
627
  let [s, c] = p(!1);
628
- return /* @__PURE__ */ b("div", {
628
+ return /* @__PURE__ */ x("div", {
629
629
  style: {
630
630
  display: "flex",
631
631
  alignItems: "center",
@@ -637,14 +637,14 @@ function N({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
637
637
  ...a
638
638
  },
639
639
  children: [
640
- r && /* @__PURE__ */ y("span", {
640
+ r && /* @__PURE__ */ b("span", {
641
641
  style: {
642
642
  color: "var(--text-3)",
643
643
  display: "flex"
644
644
  },
645
645
  children: r
646
646
  }),
647
- /* @__PURE__ */ y("input", {
647
+ /* @__PURE__ */ b("input", {
648
648
  value: e ?? "",
649
649
  onChange: (e) => t?.(e.target.value),
650
650
  placeholder: n,
@@ -662,7 +662,7 @@ function N({ value: e, onChange: t, placeholder: n, prefix: r, suffix: i, style:
662
662
  },
663
663
  ...o
664
664
  }),
665
- i && /* @__PURE__ */ y("span", {
665
+ i && /* @__PURE__ */ b("span", {
666
666
  style: {
667
667
  color: "var(--text-3)",
668
668
  display: "flex"
@@ -682,7 +682,7 @@ function Te({ value: e, onChange: t, placeholder: n, rows: r = 4, fill: i, id: a
682
682
  height: "auto",
683
683
  resize: "vertical"
684
684
  };
685
- return /* @__PURE__ */ y("textarea", {
685
+ return /* @__PURE__ */ b("textarea", {
686
686
  id: a,
687
687
  name: o,
688
688
  "aria-required": s || void 0,
@@ -707,8 +707,8 @@ var Ee = 20, De = 100;
707
707
  function Oe(e) {
708
708
  return typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value;
709
709
  }
710
- function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", onSearchChange: a, ...o }) {
711
- let [s, c] = p(!1), [l, u] = p(""), m = f(null), h = n.find((t) => !t.heading && !t.divider && t.value === e), g = n.filter((e) => !e.heading && !e.divider).length, _ = !!a, x = _ || g > Ee, S = (e) => {
710
+ function F({ value: e, options: n, onChange: r, placeholder: i = "Select...", onSearchChange: a, ...o }) {
711
+ let [s, c] = p(!1), [l, u] = p(""), m = f(null), h = n.find((t) => !t.heading && !t.divider && t.value === e), g = n.filter((e) => !e.heading && !e.divider).length, _ = !!a, v = _ || g > Ee, S = (e) => {
712
712
  u(e), a?.(e);
713
713
  }, C = d(() => {
714
714
  if (_) return n.slice(0, De);
@@ -719,7 +719,7 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
719
719
  l,
720
720
  _
721
721
  ]);
722
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("button", {
722
+ return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("button", {
723
723
  ...o,
724
724
  type: "button",
725
725
  ref: m,
@@ -741,7 +741,7 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
741
741
  ...o.style,
742
742
  color: h ? "var(--text)" : "var(--text-placeholder)"
743
743
  },
744
- children: [/* @__PURE__ */ y("span", {
744
+ children: [/* @__PURE__ */ b("span", {
745
745
  style: {
746
746
  display: "flex",
747
747
  alignItems: "center",
@@ -750,12 +750,12 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
750
750
  textOverflow: "ellipsis"
751
751
  },
752
752
  children: h ? h.label : i
753
- }), /* @__PURE__ */ y(t.down, {
753
+ }), /* @__PURE__ */ b(t.down, {
754
754
  size: 12,
755
755
  cls: "",
756
756
  style: { color: "var(--text-3)" }
757
757
  })]
758
- }), /* @__PURE__ */ b(A, {
758
+ }), /* @__PURE__ */ x(j, {
759
759
  open: s,
760
760
  anchor: m.current,
761
761
  onClose: () => c(!1),
@@ -765,7 +765,7 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
765
765
  overflowY: "auto"
766
766
  },
767
767
  children: [
768
- x && /* @__PURE__ */ y("div", {
768
+ v && /* @__PURE__ */ b("div", {
769
769
  style: {
770
770
  padding: 6,
771
771
  position: "sticky",
@@ -773,18 +773,18 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
773
773
  background: "var(--surface)",
774
774
  zIndex: 1
775
775
  },
776
- children: /* @__PURE__ */ y(N, {
776
+ children: /* @__PURE__ */ b(P, {
777
777
  value: l,
778
778
  onChange: S,
779
779
  placeholder: "Search…",
780
- prefix: /* @__PURE__ */ y(t.search, { size: 12 }),
780
+ prefix: /* @__PURE__ */ b(t.search, { size: 12 }),
781
781
  autoFocus: !0
782
782
  })
783
783
  }),
784
- C.map((t, n) => t.divider ? /* @__PURE__ */ y("div", { style: {
784
+ C.map((t, n) => t.divider ? /* @__PURE__ */ b("div", { style: {
785
785
  borderTop: "1px solid var(--divider)",
786
786
  margin: "4px 0"
787
- } }, `divider-${n}`) : t.heading ? /* @__PURE__ */ y("div", {
787
+ } }, `divider-${n}`) : t.heading ? /* @__PURE__ */ b("div", {
788
788
  style: {
789
789
  padding: "6px 10px 2px",
790
790
  fontSize: 10.5,
@@ -794,14 +794,14 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
794
794
  letterSpacing: "0.06em"
795
795
  },
796
796
  children: t.label
797
- }, `heading-${n}`) : /* @__PURE__ */ y(xe, {
797
+ }, `heading-${n}`) : /* @__PURE__ */ b(xe, {
798
798
  onClick: () => {
799
799
  r(t.value), c(!1);
800
800
  },
801
801
  active: t.value === e,
802
802
  children: t.label
803
803
  }, t.value)),
804
- C.length === 0 && /* @__PURE__ */ y("div", {
804
+ C.length === 0 && /* @__PURE__ */ b("div", {
805
805
  style: {
806
806
  padding: "8px 10px",
807
807
  fontSize: 12.5,
@@ -813,11 +813,11 @@ function P({ value: e, options: n, onChange: r, placeholder: i = "Select...", on
813
813
  })] });
814
814
  }
815
815
  function ke({ value: e, onChange: n }) {
816
- return /* @__PURE__ */ y(N, {
816
+ return /* @__PURE__ */ b(P, {
817
817
  value: e || "",
818
818
  onChange: n,
819
819
  placeholder: "YYYY-MM-DD HH:mm",
820
- prefix: /* @__PURE__ */ y(t.calendar, { size: 13 })
820
+ prefix: /* @__PURE__ */ b(t.calendar, { size: 13 })
821
821
  });
822
822
  }
823
823
  function Ae(e) {
@@ -840,7 +840,7 @@ var je = [
840
840
  ];
841
841
  function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStrength: i, id: a, name: o, ariaRequired: s }) {
842
842
  let [c, l] = p(!1), u = e || "", d = Ae(u);
843
- return /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y(N, {
843
+ return /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(P, {
844
844
  id: a,
845
845
  name: o,
846
846
  "aria-required": s || void 0,
@@ -848,7 +848,7 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
848
848
  value: u,
849
849
  onChange: n,
850
850
  placeholder: r,
851
- suffix: /* @__PURE__ */ y("button", {
851
+ suffix: /* @__PURE__ */ b("button", {
852
852
  type: "button",
853
853
  "aria-label": c ? "Hide password" : "Show password",
854
854
  style: {
@@ -860,16 +860,16 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
860
860
  display: "flex"
861
861
  },
862
862
  onClick: () => l((e) => !e),
863
- children: y(c ? t.eyeOff : t.eye, { size: 14 })
863
+ children: b(c ? t.eyeOff : t.eye, { size: 14 })
864
864
  })
865
- }), i && /* @__PURE__ */ b("div", {
865
+ }), i && /* @__PURE__ */ x("div", {
866
866
  style: {
867
867
  marginTop: 6,
868
868
  display: "flex",
869
869
  alignItems: "center",
870
870
  gap: 8
871
871
  },
872
- children: [/* @__PURE__ */ y("div", {
872
+ children: [/* @__PURE__ */ b("div", {
873
873
  style: {
874
874
  display: "flex",
875
875
  gap: 3,
@@ -880,14 +880,14 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
880
880
  1,
881
881
  2,
882
882
  3
883
- ].map((e) => /* @__PURE__ */ y("span", { style: {
883
+ ].map((e) => /* @__PURE__ */ b("span", { style: {
884
884
  flex: 1,
885
885
  height: 3,
886
886
  borderRadius: 999,
887
887
  background: e < d ? Me[d] : "var(--surface-3)",
888
888
  transition: "background .15s"
889
889
  } }, e))
890
- }), /* @__PURE__ */ y("span", {
890
+ }), /* @__PURE__ */ b("span", {
891
891
  style: {
892
892
  fontSize: 10.5,
893
893
  color: "var(--text-3)",
@@ -900,7 +900,7 @@ function Ne({ value: e, onChange: n, placeholder: r = "Enter password", showStre
900
900
  }
901
901
  function Pe({ value: e = [], onChange: t }) {
902
902
  let [n, r] = p("");
903
- return /* @__PURE__ */ b("div", {
903
+ return /* @__PURE__ */ x("div", {
904
904
  style: {
905
905
  ...we,
906
906
  height: "auto",
@@ -911,11 +911,11 @@ function Pe({ value: e = [], onChange: t }) {
911
911
  padding: "4px 6px",
912
912
  alignItems: "center"
913
913
  },
914
- children: [e.map((n, r) => /* @__PURE__ */ y(M, {
914
+ children: [e.map((n, r) => /* @__PURE__ */ b(N, {
915
915
  tone: "slate",
916
916
  onRemove: () => t(e.filter((e, t) => t !== r)),
917
917
  children: n
918
- }, r)), /* @__PURE__ */ y("input", {
918
+ }, r)), /* @__PURE__ */ b("input", {
919
919
  value: n,
920
920
  onChange: (e) => r(e.target.value),
921
921
  onKeyDown: (i) => {
@@ -935,14 +935,14 @@ function Pe({ value: e = [], onChange: t }) {
935
935
  });
936
936
  }
937
937
  function Fe({ value: e, onChange: t }) {
938
- return /* @__PURE__ */ b("div", {
938
+ return /* @__PURE__ */ x("div", {
939
939
  style: {
940
940
  border: "1px solid var(--border)",
941
941
  borderRadius: 6,
942
942
  background: "var(--surface-2)",
943
943
  overflow: "hidden"
944
944
  },
945
- children: [/* @__PURE__ */ b("div", {
945
+ children: [/* @__PURE__ */ x("div", {
946
946
  style: {
947
947
  padding: "6px 10px",
948
948
  background: "var(--surface-3)",
@@ -952,7 +952,7 @@ function Fe({ value: e, onChange: t }) {
952
952
  gap: 8
953
953
  },
954
954
  children: [
955
- /* @__PURE__ */ y("span", {
955
+ /* @__PURE__ */ b("span", {
956
956
  className: "mono",
957
957
  style: {
958
958
  fontSize: 10.5,
@@ -962,19 +962,19 @@ function Fe({ value: e, onChange: t }) {
962
962
  },
963
963
  children: "JSON"
964
964
  }),
965
- /* @__PURE__ */ y("span", { style: { flex: 1 } }),
966
- /* @__PURE__ */ y(E, {
965
+ /* @__PURE__ */ b("span", { style: { flex: 1 } }),
966
+ /* @__PURE__ */ b(D, {
967
967
  size: "xs",
968
968
  kind: "ghost",
969
969
  children: "Format"
970
970
  }),
971
- /* @__PURE__ */ y(E, {
971
+ /* @__PURE__ */ b(D, {
972
972
  size: "xs",
973
973
  kind: "ghost",
974
974
  children: "Validate"
975
975
  })
976
976
  ]
977
- }), /* @__PURE__ */ y("textarea", {
977
+ }), /* @__PURE__ */ b("textarea", {
978
978
  className: "mono",
979
979
  value: e || "",
980
980
  onChange: (e) => t?.(e.target.value),
@@ -995,7 +995,7 @@ function Fe({ value: e, onChange: t }) {
995
995
  }
996
996
  function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a, ariaLabelledby: o, ariaRequired: s }) {
997
997
  let [c, l] = p(!1), u = f(null);
998
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("button", {
998
+ return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("button", {
999
999
  type: "button",
1000
1000
  id: a,
1001
1001
  "aria-labelledby": o,
@@ -1010,14 +1010,14 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
1010
1010
  textAlign: "left",
1011
1011
  cursor: "pointer"
1012
1012
  },
1013
- children: [/* @__PURE__ */ b("span", {
1013
+ children: [/* @__PURE__ */ x("span", {
1014
1014
  style: {
1015
1015
  display: "flex",
1016
1016
  alignItems: "center",
1017
1017
  gap: 8,
1018
1018
  overflow: "hidden"
1019
1019
  },
1020
- children: [/* @__PURE__ */ y("span", {
1020
+ children: [/* @__PURE__ */ b("span", {
1021
1021
  style: {
1022
1022
  width: 18,
1023
1023
  height: 18,
@@ -1028,30 +1028,30 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
1028
1028
  alignItems: "center",
1029
1029
  justifyContent: "center"
1030
1030
  },
1031
- children: /* @__PURE__ */ y(t.link, { size: 11 })
1032
- }), /* @__PURE__ */ y("span", {
1031
+ children: /* @__PURE__ */ b(t.link, { size: 11 })
1032
+ }), /* @__PURE__ */ b("span", {
1033
1033
  style: { color: e ? "var(--accent)" : "var(--text-placeholder)" },
1034
1034
  children: e || `Link to ${n}…`
1035
1035
  })]
1036
- }), /* @__PURE__ */ y(t.search, {
1036
+ }), /* @__PURE__ */ b(t.search, {
1037
1037
  size: 12,
1038
1038
  cls: "",
1039
1039
  style: { color: "var(--text-3)" }
1040
1040
  })]
1041
- }), /* @__PURE__ */ b(A, {
1041
+ }), /* @__PURE__ */ x(j, {
1042
1042
  open: c,
1043
1043
  anchor: u.current,
1044
1044
  onClose: () => l(!1),
1045
1045
  width: u.current?.offsetWidth,
1046
- children: [/* @__PURE__ */ y("div", {
1046
+ children: [/* @__PURE__ */ b("div", {
1047
1047
  style: { padding: 4 },
1048
- children: /* @__PURE__ */ y(N, {
1048
+ children: /* @__PURE__ */ b(P, {
1049
1049
  placeholder: `Search ${n}…`,
1050
- prefix: /* @__PURE__ */ y(t.search, { size: 12 }),
1050
+ prefix: /* @__PURE__ */ b(t.search, { size: 12 }),
1051
1051
  style: { marginBottom: 4 }
1052
1052
  })
1053
- }), i.slice(0, 6).map((e) => /* @__PURE__ */ y(xe, {
1054
- icon: /* @__PURE__ */ y(t.building, { size: 13 }),
1053
+ }), i.slice(0, 6).map((e) => /* @__PURE__ */ b(xe, {
1054
+ icon: /* @__PURE__ */ b(t.building, { size: 13 }),
1055
1055
  onClick: () => {
1056
1056
  r?.(e.name), l(!1);
1057
1057
  },
@@ -1060,7 +1060,7 @@ function Ie({ value: e, entity: n = "company", onChange: r, items: i = [], id: a
1060
1060
  })] });
1061
1061
  }
1062
1062
  function Le({ label: e, children: t, mono: n, wide: r, empty: i }) {
1063
- return /* @__PURE__ */ b("div", {
1063
+ return /* @__PURE__ */ x("div", {
1064
1064
  style: {
1065
1065
  display: "flex",
1066
1066
  flexDirection: r ? "column" : "row",
@@ -1068,7 +1068,7 @@ function Le({ label: e, children: t, mono: n, wide: r, empty: i }) {
1068
1068
  minHeight: 24,
1069
1069
  alignItems: "baseline"
1070
1070
  },
1071
- children: [/* @__PURE__ */ y("div", {
1071
+ children: [/* @__PURE__ */ b("div", {
1072
1072
  style: {
1073
1073
  width: r ? "auto" : 140,
1074
1074
  flexShrink: 0,
@@ -1078,7 +1078,7 @@ function Le({ label: e, children: t, mono: n, wide: r, empty: i }) {
1078
1078
  letterSpacing: "0.01em"
1079
1079
  },
1080
1080
  children: e
1081
- }), /* @__PURE__ */ y("div", {
1081
+ }), /* @__PURE__ */ b("div", {
1082
1082
  className: n ? "mono num" : "num",
1083
1083
  style: {
1084
1084
  flex: 1,
@@ -1098,7 +1098,7 @@ function Re({ value: e, onChange: n, type: r = "text", options: i }) {
1098
1098
  }, u = () => {
1099
1099
  c(e), o(!1);
1100
1100
  };
1101
- return a ? /* @__PURE__ */ b("div", {
1101
+ return a ? /* @__PURE__ */ x("div", {
1102
1102
  style: {
1103
1103
  display: "flex",
1104
1104
  alignItems: "center",
@@ -1107,34 +1107,34 @@ function Re({ value: e, onChange: n, type: r = "text", options: i }) {
1107
1107
  onKeyDown: (e) => {
1108
1108
  e.key === "Enter" && l(), e.key === "Escape" && u();
1109
1109
  },
1110
- children: [r === "select" ? /* @__PURE__ */ y(P, {
1110
+ children: [r === "select" ? /* @__PURE__ */ b(F, {
1111
1111
  value: s,
1112
1112
  options: i || [],
1113
1113
  onChange: (e) => {
1114
1114
  c(e), n?.(e), o(!1);
1115
1115
  }
1116
- }) : r === "bool" ? /* @__PURE__ */ y(be, {
1116
+ }) : r === "bool" ? /* @__PURE__ */ b(be, {
1117
1117
  value: s === "true",
1118
1118
  onChange: (e) => {
1119
1119
  let t = String(e);
1120
1120
  c(t), n?.(t), o(!1);
1121
1121
  }
1122
- }) : /* @__PURE__ */ y(N, {
1122
+ }) : /* @__PURE__ */ b(P, {
1123
1123
  value: s ?? "",
1124
1124
  onChange: c,
1125
1125
  autoFocus: !0
1126
- }), r !== "select" && r !== "bool" && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(D, {
1126
+ }), r !== "select" && r !== "bool" && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(O, {
1127
1127
  size: 24,
1128
- icon: /* @__PURE__ */ y(t.check, { size: 13 }),
1128
+ icon: /* @__PURE__ */ b(t.check, { size: 13 }),
1129
1129
  onClick: l,
1130
1130
  title: "Save"
1131
- }), /* @__PURE__ */ y(D, {
1131
+ }), /* @__PURE__ */ b(O, {
1132
1132
  size: 24,
1133
- icon: /* @__PURE__ */ y(t.x, { size: 13 }),
1133
+ icon: /* @__PURE__ */ b(t.x, { size: 13 }),
1134
1134
  onClick: u,
1135
1135
  title: "Cancel"
1136
1136
  })] })]
1137
- }) : /* @__PURE__ */ y("div", {
1137
+ }) : /* @__PURE__ */ b("div", {
1138
1138
  onClick: () => o(!0),
1139
1139
  style: {
1140
1140
  padding: "4px 6px",
@@ -1153,7 +1153,7 @@ function Re({ value: e, onChange: n, type: r = "text", options: i }) {
1153
1153
  onMouseLeave: (e) => {
1154
1154
  e.currentTarget.style.borderColor = "transparent";
1155
1155
  },
1156
- children: e || /* @__PURE__ */ y("span", {
1156
+ children: e || /* @__PURE__ */ b("span", {
1157
1157
  style: { color: "var(--text-4)" },
1158
1158
  children: "Click to edit"
1159
1159
  })
@@ -1204,7 +1204,7 @@ var ze = class e {
1204
1204
  };
1205
1205
  //#endregion
1206
1206
  //#region src/lib/display-value.ts
1207
- function F(e) {
1207
+ function I(e) {
1208
1208
  if (e == null) return "";
1209
1209
  switch (typeof e) {
1210
1210
  case "string": return e;
@@ -1220,7 +1220,7 @@ function F(e) {
1220
1220
  default: return "";
1221
1221
  }
1222
1222
  }
1223
- function I(e, t = "en") {
1223
+ function L(e, t = "en") {
1224
1224
  return e ? e[t] ?? Object.values(e)[0] ?? "" : "";
1225
1225
  }
1226
1226
  var Be = "$display";
@@ -1231,12 +1231,21 @@ function Ve(e, t) {
1231
1231
  let r = t?.display?.display_field;
1232
1232
  if (!r) return;
1233
1233
  let i = e[r];
1234
- if (i != null) return typeof i == "object" && !Array.isArray(i) ? I(i) || void 0 : F(i);
1234
+ if (i == null) return;
1235
+ let a = t?.fields?.get(r)?.values;
1236
+ if (a && (typeof i == "string" || typeof i == "number")) {
1237
+ let e = a.find((e) => e.code === String(i));
1238
+ if (e) {
1239
+ let t = L(e.name);
1240
+ if (t) return t;
1241
+ }
1242
+ }
1243
+ return typeof i == "object" && !Array.isArray(i) ? L(i) || void 0 : I(i);
1235
1244
  }
1236
- function L(e, t, n) {
1245
+ function R(e, t, n) {
1237
1246
  if (!t) return n;
1238
1247
  let r = e[t];
1239
- return r == null ? n : typeof r == "object" && !Array.isArray(r) ? I(r) || n : F(r);
1248
+ return r == null ? n : typeof r == "object" && !Array.isArray(r) ? L(r) || n : I(r);
1240
1249
  }
1241
1250
  function He(e) {
1242
1251
  let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
@@ -1257,9 +1266,9 @@ function We(e, t, n) {
1257
1266
  let r = e.replace(/\/+$/, "") || "/", i;
1258
1267
  for (let e of Object.values(t)) {
1259
1268
  if (!e.route || !He(e.route).test(r)) continue;
1260
- let t = e.route.includes("/:"), a = I(e.display?.name);
1269
+ let t = e.route.includes("/:"), a = L(e.display?.name);
1261
1270
  if (!a && t && n && e.entity) {
1262
- let t = I(n[e.entity]?.display?.name);
1271
+ let t = L(n[e.entity]?.display?.name);
1263
1272
  if (t) {
1264
1273
  let e = r.slice(r.lastIndexOf("/") + 1);
1265
1274
  a = e ? `${t} ${Ue(e)}` : t;
@@ -1276,12 +1285,12 @@ function We(e, t, n) {
1276
1285
  return i;
1277
1286
  }
1278
1287
  function Ge(e, t, n) {
1279
- let r = I(e.display?.name);
1288
+ let r = L(e.display?.name);
1280
1289
  if (r) return r;
1281
1290
  if (e.type === "ref" && e.ref?.entity && n) {
1282
1291
  let t = n[e.ref.entity];
1283
1292
  if (t) {
1284
- let e = I(t.display?.name);
1293
+ let e = L(t.display?.name);
1285
1294
  if (e) return e;
1286
1295
  }
1287
1296
  }
@@ -1315,14 +1324,14 @@ function Je(e) {
1315
1324
  function Ye(e, t) {
1316
1325
  return !e || e.readonly ? !1 : e.mutations?.[t] ?? !0;
1317
1326
  }
1318
- function R(e) {
1327
+ function z(e) {
1319
1328
  if (e.primary_key && e.primary_key.length > 0) return e.primary_key;
1320
1329
  for (let [t, n] of e.fields) if (n.primary) return [t];
1321
1330
  return ["id"];
1322
1331
  }
1323
1332
  function Xe(e, t) {
1324
- let n = R(e), r = {};
1325
- for (let e of n) r[e] = F(t[e]);
1333
+ let n = z(e), r = {};
1334
+ for (let e of n) r[e] = I(t[e]);
1326
1335
  return r;
1327
1336
  }
1328
1337
  function Ze(e) {
@@ -1332,10 +1341,10 @@ function Qe(e) {
1332
1341
  return Ze(Object.values(e));
1333
1342
  }
1334
1343
  function $e(e, t) {
1335
- return Ze(R(e).map((e) => t[e] ?? ""));
1344
+ return Ze(z(e).map((e) => t[e] ?? ""));
1336
1345
  }
1337
1346
  function et(e, t) {
1338
- let n = R(e);
1347
+ let n = z(e);
1339
1348
  if (n.length === 1) return { [n[0]]: t };
1340
1349
  }
1341
1350
  function tt(e, t) {
@@ -1359,17 +1368,17 @@ function rt(e, t, n, r) {
1359
1368
  return i ? i.replace(":id", encodeURIComponent(t)) : null;
1360
1369
  }
1361
1370
  function it(e, t, n, r) {
1362
- return !t || R(t).some((e) => !r[e]) ? null : rt(e, $e(t, r), t, n);
1371
+ return !t || z(t).some((e) => !r[e]) ? null : rt(e, $e(t, r), t, n);
1363
1372
  }
1364
1373
  function at(e, t, n, r) {
1365
1374
  return t ? it(e, t, n, Xe(t, r)) : null;
1366
1375
  }
1367
1376
  function ot(e) {
1368
- return R(e).length > 1;
1377
+ return z(e).length > 1;
1369
1378
  }
1370
1379
  //#endregion
1371
1380
  //#region src/types/api.ts
1372
- var z = class extends Error {
1381
+ var B = class extends Error {
1373
1382
  status;
1374
1383
  code;
1375
1384
  index;
@@ -1379,31 +1388,31 @@ var z = class extends Error {
1379
1388
  }
1380
1389
  }, st = "cursor_semantics_mismatch", ct = "cursor_locale_changed";
1381
1390
  function lt(e) {
1382
- return e instanceof z && (e.code === "cursor_semantics_mismatch" || e.code === "cursor_locale_changed" || e.code === "archive_cursor_invalid");
1391
+ return e instanceof B && (e.code === "cursor_semantics_mismatch" || e.code === "cursor_locale_changed" || e.code === "archive_cursor_invalid");
1383
1392
  }
1384
1393
  //#endregion
1385
1394
  //#region src/api/auth-redirect.ts
1386
- var B = "/", ut = "/login", dt = "/signup", ft = "https://declarion.local";
1395
+ var V = "/", ut = "/login", dt = "/signup", ft = "https://declarion.local";
1387
1396
  function pt(e) {
1388
1397
  let t = e.split(/[?#]/, 1)[0];
1389
1398
  return t === ut || t.startsWith(`${ut}/`) || t === dt || t.startsWith(`${dt}/`);
1390
1399
  }
1391
1400
  function mt(e) {
1392
- if (!e) return B;
1401
+ if (!e) return V;
1393
1402
  let t = e.toLowerCase();
1394
- if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return B;
1403
+ if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return V;
1395
1404
  try {
1396
1405
  let t = new URL(e, ft);
1397
- if (t.origin !== ft) return B;
1406
+ if (t.origin !== ft) return V;
1398
1407
  let n = `${t.pathname}${t.search}${t.hash}`;
1399
- return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ? B : n || B;
1408
+ return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ? V : n || V;
1400
1409
  } catch {
1401
- return B;
1410
+ return V;
1402
1411
  }
1403
1412
  }
1404
1413
  function ht(e) {
1405
1414
  let t = mt(e);
1406
- return t === B || pt(t) ? ut : `${ut}?next=${encodeURIComponent(t)}`;
1415
+ return t === V || pt(t) ? ut : `${ut}?next=${encodeURIComponent(t)}`;
1407
1416
  }
1408
1417
  function gt() {
1409
1418
  if (typeof window > "u") return ut;
@@ -1437,55 +1446,55 @@ function yt(e, t, n) {
1437
1446
  }
1438
1447
  //#endregion
1439
1448
  //#region src/embed/token.ts
1440
- var bt = 15e3, xt = 5e3, V = {
1449
+ var bt = 15e3, xt = 5e3, H = {
1441
1450
  active: !1,
1442
1451
  parentOrigin: null,
1443
1452
  current: null,
1444
1453
  pending: null
1445
1454
  };
1446
1455
  function St(e) {
1447
- V.active = !0, V.parentOrigin = e;
1456
+ H.active = !0, H.parentOrigin = e;
1448
1457
  }
1449
1458
  function Ct() {
1450
- return V.active;
1459
+ return H.active;
1451
1460
  }
1452
1461
  function wt() {
1453
- return V.current?.token ?? null;
1462
+ return H.current?.token ?? null;
1454
1463
  }
1455
1464
  function Tt() {
1456
- return V.parentOrigin;
1465
+ return H.parentOrigin;
1457
1466
  }
1458
1467
  function Et() {
1459
- return !V.current || Date.now() >= V.current.expiresAt - xt;
1468
+ return !H.current || Date.now() >= H.current.expiresAt - xt;
1460
1469
  }
1461
1470
  function Dt(e) {
1462
1471
  if (!e.token || typeof e.token != "string") return;
1463
1472
  let t = Date.parse(e.expires_at);
1464
- if (!Number.isNaN(t) && (V.current = {
1473
+ if (!Number.isNaN(t) && (H.current = {
1465
1474
  token: e.token,
1466
1475
  expiresAt: t
1467
- }, V.pending)) {
1468
- let t = V.pending;
1469
- V.pending = null, clearTimeout(t.timer), t.resolve(e.token);
1476
+ }, H.pending)) {
1477
+ let t = H.pending;
1478
+ H.pending = null, clearTimeout(t.timer), t.resolve(e.token);
1470
1479
  }
1471
1480
  }
1472
1481
  function Ot() {
1473
- V.current = null;
1482
+ H.current = null;
1474
1483
  }
1475
1484
  function kt() {
1476
- if (!Et() && V.current) return Promise.resolve(V.current.token);
1477
- if (V.pending) return V.pending.promise;
1485
+ if (!Et() && H.current) return Promise.resolve(H.current.token);
1486
+ if (H.pending) return H.pending.promise;
1478
1487
  let e, t, n = new Promise((n, r) => {
1479
1488
  e = n, t = r;
1480
1489
  }), r = setTimeout(() => {
1481
- V.pending && V.pending.promise === n && (V.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${bt}ms`));
1490
+ H.pending && H.pending.promise === n && (H.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${bt}ms`));
1482
1491
  }, bt);
1483
- return V.pending = {
1492
+ return H.pending = {
1484
1493
  promise: n,
1485
1494
  resolve: e,
1486
1495
  reject: t,
1487
1496
  timer: r
1488
- }, yt(V.parentOrigin, vt.tokenExpired, {}), n;
1497
+ }, yt(H.parentOrigin, vt.tokenExpired, {}), n;
1489
1498
  }
1490
1499
  //#endregion
1491
1500
  //#region src/lib/versionTracker.ts
@@ -1498,7 +1507,7 @@ function Mt() {
1498
1507
  return null;
1499
1508
  }
1500
1509
  }
1501
- var H = {
1510
+ var U = {
1502
1511
  firstSeen: null,
1503
1512
  firstComponents: null,
1504
1513
  hasReportedDrift: !1,
@@ -1507,11 +1516,11 @@ var H = {
1507
1516
  channel: null
1508
1517
  };
1509
1518
  function Nt() {
1510
- H.channel || typeof BroadcastChannel > "u" || (H.channel = Mt(), H.channel && H.channel.addEventListener("message", (e) => {
1519
+ U.channel || typeof BroadcastChannel > "u" || (U.channel = Mt(), U.channel && U.channel.addEventListener("message", (e) => {
1511
1520
  let t = e.data;
1512
- if (!(!t || t.type !== "drift" || !t.delta) && !H.hasReportedDrift) {
1513
- H.hasReportedDrift = !0;
1514
- for (let e of H.listeners) e(t.delta);
1521
+ if (!(!t || t.type !== "drift" || !t.delta) && !U.hasReportedDrift) {
1522
+ U.hasReportedDrift = !0;
1523
+ for (let e of U.listeners) e(t.delta);
1515
1524
  }
1516
1525
  }));
1517
1526
  }
@@ -1519,11 +1528,11 @@ function Pt(e) {
1519
1528
  if (Nt(), !e) return;
1520
1529
  let t = e.get(At);
1521
1530
  if (t) {
1522
- if (!H.firstSeen) {
1523
- H.firstSeen = t;
1531
+ if (!U.firstSeen) {
1532
+ U.firstSeen = t;
1524
1533
  return;
1525
1534
  }
1526
- t !== H.firstSeen && (H.hasReportedDrift || Ft().catch(() => {
1535
+ t !== U.firstSeen && (U.hasReportedDrift || Ft().catch(() => {
1527
1536
  Lt({
1528
1537
  kind: "unknown",
1529
1538
  observed: t
@@ -1536,7 +1545,7 @@ async function Ft() {
1536
1545
  let e;
1537
1546
  try {
1538
1547
  let t = {};
1539
- H.firstSeen && (t["If-None-Match"] = `"${H.firstSeen}"`), e = await fetch("/api/version", {
1548
+ U.firstSeen && (t["If-None-Match"] = `"${U.firstSeen}"`), e = await fetch("/api/version", {
1540
1549
  method: "GET",
1541
1550
  credentials: Ct() ? "omit" : "include",
1542
1551
  headers: t
@@ -1559,8 +1568,8 @@ async function Ft() {
1559
1568
  asset: t.asset_fingerprint,
1560
1569
  binary: t.binary_fingerprint
1561
1570
  } : void 0;
1562
- H.firstSeen ||= n, !H.firstComponents && r && n === H.firstSeen && (H.firstComponents = r), n !== H.firstSeen && Lt({
1563
- kind: It(H.firstComponents, r),
1571
+ U.firstSeen ||= n, !U.firstComponents && r && n === U.firstSeen && (U.firstComponents = r), n !== U.firstSeen && Lt({
1572
+ kind: It(U.firstComponents, r),
1564
1573
  observed: n,
1565
1574
  components: r
1566
1575
  });
@@ -1571,11 +1580,11 @@ function It(e, t) {
1571
1580
  return n && !r && !i ? "schema-only" : r || i ? "asset-or-binary" : "unknown";
1572
1581
  }
1573
1582
  function Lt(e) {
1574
- if (!H.hasReportedDrift) {
1575
- H.hasReportedDrift = !0, e.kind !== "schema-only" && (H.pendingReload = e);
1576
- for (let t of H.listeners) t(e);
1577
- if (H.channel) try {
1578
- H.channel.postMessage({
1583
+ if (!U.hasReportedDrift) {
1584
+ U.hasReportedDrift = !0, e.kind !== "schema-only" && (U.pendingReload = e);
1585
+ for (let t of U.listeners) t(e);
1586
+ if (U.channel) try {
1587
+ U.channel.postMessage({
1579
1588
  type: "drift",
1580
1589
  delta: e
1581
1590
  });
@@ -1584,20 +1593,20 @@ function Lt(e) {
1584
1593
  }
1585
1594
  }
1586
1595
  function Rt() {
1587
- return H.pendingReload;
1596
+ return U.pendingReload;
1588
1597
  }
1589
1598
  function zt(e) {
1590
- return H.listeners.add(e), () => {
1591
- H.listeners.delete(e);
1599
+ return U.listeners.add(e), () => {
1600
+ U.listeners.delete(e);
1592
1601
  };
1593
1602
  }
1594
1603
  //#endregion
1595
1604
  //#region src/api/client.ts
1596
- var Bt = (e) => JSON.stringify(e ?? {}), Vt = null, U = "declarion.auth.refresh.lock", Ht = "declarion.auth.refresh.result", Ut = "declarion.auth.refresh", Wt = 3e4, Gt = 100, Kt = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
1605
+ var Bt = (e) => JSON.stringify(e ?? {}), Vt = null, W = "declarion.auth.refresh.lock", Ht = "declarion.auth.refresh.result", Ut = "declarion.auth.refresh", Wt = 3e4, Gt = 100, Kt = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
1597
1606
  function qt() {
1598
1607
  if (typeof window > "u") return !1;
1599
1608
  try {
1600
- let e = window.localStorage, t = `${U}.probe`;
1609
+ let e = window.localStorage, t = `${W}.probe`;
1601
1610
  return e.setItem(t, "1"), e.removeItem(t), !0;
1602
1611
  } catch {
1603
1612
  return !1;
@@ -1638,19 +1647,19 @@ function Zt(e) {
1638
1647
  return !t || t.updated_at < e ? null : t;
1639
1648
  }
1640
1649
  function Qt(e) {
1641
- if (!e.ok) throw new W(e.status ?? 401);
1650
+ if (!e.ok) throw new G(e.status ?? 401);
1642
1651
  }
1643
1652
  function $t(e = Date.now()) {
1644
- let t = Yt(window.localStorage.getItem(U));
1653
+ let t = Yt(window.localStorage.getItem(W));
1645
1654
  if (t && t.expires_at > e && t.owner !== Kt) return !1;
1646
1655
  let n = {
1647
1656
  owner: Kt,
1648
1657
  expires_at: e + Wt
1649
1658
  };
1650
- return window.localStorage.setItem(U, JSON.stringify(n)), Yt(window.localStorage.getItem(U))?.owner === Kt;
1659
+ return window.localStorage.setItem(W, JSON.stringify(n)), Yt(window.localStorage.getItem(W))?.owner === Kt;
1651
1660
  }
1652
1661
  function en() {
1653
- Yt(window.localStorage.getItem(U))?.owner === Kt && window.localStorage.removeItem(U);
1662
+ Yt(window.localStorage.getItem(W))?.owner === Kt && window.localStorage.removeItem(W);
1654
1663
  }
1655
1664
  function tn(e) {
1656
1665
  let t = {
@@ -1665,14 +1674,14 @@ async function nn(e) {
1665
1674
  let r = !1, i = null, a = (e) => {
1666
1675
  r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), t(e));
1667
1676
  }, o = (e) => {
1668
- r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new W(e)));
1677
+ r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new G(e)));
1669
1678
  }, s = () => {
1670
1679
  let t = Xt(window.localStorage.getItem(Ht));
1671
1680
  if (t && t.updated_at >= e) {
1672
1681
  t.ok ? a("complete") : o(t.status ?? 401);
1673
1682
  return;
1674
1683
  }
1675
- let n = Yt(window.localStorage.getItem(U));
1684
+ let n = Yt(window.localStorage.getItem(W));
1676
1685
  if (!n) {
1677
1686
  a("complete");
1678
1687
  return;
@@ -1683,7 +1692,7 @@ async function nn(e) {
1683
1692
  }
1684
1693
  i = setTimeout(s, Gt);
1685
1694
  }, c = (e) => {
1686
- (e.key === U || e.key === Ht) && (i && clearTimeout(i), s());
1695
+ (e.key === W || e.key === Ht) && (i && clearTimeout(i), s());
1687
1696
  };
1688
1697
  window.addEventListener("storage", c), s();
1689
1698
  });
@@ -1699,7 +1708,7 @@ async function rn(e) {
1699
1708
  try {
1700
1709
  await mn(), qt() && tn({ ok: !0 });
1701
1710
  } catch (e) {
1702
- throw e instanceof W && qt() && tn({
1711
+ throw e instanceof G && qt() && tn({
1703
1712
  ok: !1,
1704
1713
  status: e.status
1705
1714
  }), e;
@@ -1717,7 +1726,7 @@ async function an() {
1717
1726
  await mn(), tn({ ok: !0 });
1718
1727
  return;
1719
1728
  } catch (e) {
1720
- throw e instanceof W && tn({
1729
+ throw e instanceof G && tn({
1721
1730
  ok: !1,
1722
1731
  status: e.status
1723
1732
  }), e;
@@ -1727,7 +1736,7 @@ async function an() {
1727
1736
  await nn(e) === "expired" && await an();
1728
1737
  }
1729
1738
  }
1730
- var W = class extends Error {
1739
+ var G = class extends Error {
1731
1740
  status;
1732
1741
  constructor(e) {
1733
1742
  super(`refresh failed terminally (${e})`), this.status = e, this.name = "RefreshDeadError";
@@ -1735,7 +1744,7 @@ var W = class extends Error {
1735
1744
  }, on = null, sn = null, cn = 3e4, ln = 5e3;
1736
1745
  function un() {
1737
1746
  hn().catch((e) => {
1738
- e instanceof W && G();
1747
+ e instanceof G && K();
1739
1748
  });
1740
1749
  }
1741
1750
  function dn(e) {
@@ -1771,11 +1780,11 @@ async function mn() {
1771
1780
  let n = parseInt(t.headers.get("Retry-After") || "1", 10);
1772
1781
  await new Promise((e) => setTimeout(e, n * 1e3));
1773
1782
  let r = await fetch("/api/actions/auth.refresh", e);
1774
- if (!r.ok) throw new W(r.status);
1783
+ if (!r.ok) throw new G(r.status);
1775
1784
  await pn(r);
1776
1785
  return;
1777
1786
  }
1778
- if (!t.ok) throw new W(t.status);
1787
+ if (!t.ok) throw new G(t.status);
1779
1788
  await pn(t);
1780
1789
  }
1781
1790
  async function hn() {
@@ -1783,17 +1792,17 @@ async function hn() {
1783
1792
  Vt = null;
1784
1793
  }), Vt);
1785
1794
  }
1786
- var G = () => {
1795
+ var K = () => {
1787
1796
  if (typeof window > "u") return;
1788
1797
  let { pathname: e } = window.location;
1789
1798
  e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = gt());
1790
1799
  };
1791
1800
  function gn(e) {
1792
- let t = G;
1793
- return G = e, t;
1801
+ let t = K;
1802
+ return K = e, t;
1794
1803
  }
1795
1804
  function _n() {
1796
- return G;
1805
+ return K;
1797
1806
  }
1798
1807
  var vn = ({ status: e, code: t, message: n }) => {
1799
1808
  console.error(`[API ${e}] ${t}: ${n}`);
@@ -1824,29 +1833,29 @@ async function bn(e, t, n, r) {
1824
1833
  credentials: a
1825
1834
  });
1826
1835
  if (!c.ok) {
1827
- G();
1836
+ K();
1828
1837
  let e = await c.json().catch(() => ({ error: {
1829
1838
  message: "Request failed",
1830
1839
  code: "UNKNOWN"
1831
1840
  } }));
1832
- throw new z(c.status, e.error.message, e.error.code, e.index);
1841
+ throw new B(c.status, e.error.message, e.error.code, e.index);
1833
1842
  }
1834
1843
  return r(c);
1835
1844
  } catch (e) {
1836
- throw e instanceof z ? e : (G(), new z(401, o, c, l));
1845
+ throw e instanceof B ? e : (K(), new B(401, o, c, l));
1837
1846
  }
1838
- throw s.status === 401 && G(), vn({
1847
+ throw s.status === 401 && K(), vn({
1839
1848
  status: s.status,
1840
1849
  code: c,
1841
1850
  message: o
1842
- }), new z(s.status, o, c, l, u);
1851
+ }), new B(s.status, o, c, l, u);
1843
1852
  }
1844
1853
  return r(s);
1845
1854
  }
1846
1855
  function xn(e) {
1847
1856
  return e.status === 204 ? Promise.resolve(void 0) : e.json();
1848
1857
  }
1849
- async function K(e, t = {}) {
1858
+ async function q(e, t = {}) {
1850
1859
  return bn(e, t, { setAccept: !1 }, xn);
1851
1860
  }
1852
1861
  async function Sn(e) {
@@ -1869,8 +1878,8 @@ function wn(e) {
1869
1878
  let r = t.match(/filename\s*=\s*("([^"]+)"|([^;]+))/i);
1870
1879
  return r ? (r[2] ?? r[3] ?? "").trim() : "";
1871
1880
  }
1872
- async function q(e, t = {}) {
1873
- return (await K(`/api/actions/${encodeURIComponent(e)}`, {
1881
+ async function J(e, t = {}) {
1882
+ return (await q(`/api/actions/${encodeURIComponent(e)}`, {
1874
1883
  method: "POST",
1875
1884
  body: Bt(t)
1876
1885
  })).result;
@@ -1923,15 +1932,15 @@ function On(e) {
1923
1932
  };
1924
1933
  }
1925
1934
  async function kn() {
1926
- return On(await K("/api/schema"));
1935
+ return On(await q("/api/schema"));
1927
1936
  }
1928
1937
  //#endregion
1929
1938
  //#region src/api/auth.ts
1930
1939
  async function An() {
1931
- return q("auth.check_setup");
1940
+ return J("auth.check_setup");
1932
1941
  }
1933
1942
  async function jn(e, t, n = !0) {
1934
- let r = await q("auth.login", {
1943
+ let r = await J("auth.login", {
1935
1944
  email: e,
1936
1945
  password: t,
1937
1946
  remember: n
@@ -1939,7 +1948,7 @@ async function jn(e, t, n = !0) {
1939
1948
  return dn(r.expires_at), r;
1940
1949
  }
1941
1950
  async function Mn(e, t, n) {
1942
- let r = await q("auth.signup", {
1951
+ let r = await J("auth.signup", {
1943
1952
  email: e,
1944
1953
  password: t,
1945
1954
  display_name: n
@@ -1947,20 +1956,20 @@ async function Mn(e, t, n) {
1947
1956
  return dn(r.expires_at), r;
1948
1957
  }
1949
1958
  async function Nn() {
1950
- return q("auth.me");
1959
+ return J("auth.me");
1951
1960
  }
1952
1961
  async function Pn() {
1953
- return (await q("auth.list_tenants")).tenants;
1962
+ return (await J("auth.list_tenants")).tenants;
1954
1963
  }
1955
1964
  async function Fn(e) {
1956
- let t = await q("auth.switch_tenant", { tenant_id: e });
1965
+ let t = await J("auth.switch_tenant", { tenant_id: e });
1957
1966
  return dn(t.expires_at), t;
1958
1967
  }
1959
1968
  async function In() {
1960
- await q("auth.logout");
1969
+ await J("auth.logout");
1961
1970
  }
1962
1971
  async function Ln(e) {
1963
- return (await q("sso_provider.list", e ? { tenant_code: e } : {})).providers;
1972
+ return (await J("sso_provider.list", e ? { tenant_code: e } : {})).providers;
1964
1973
  }
1965
1974
  function Rn(e, t, n) {
1966
1975
  let r = new URLSearchParams();
@@ -1973,23 +1982,23 @@ async function zn(e, t, n) {
1973
1982
  target_user_id: e,
1974
1983
  reason: t
1975
1984
  };
1976
- return n != null && (r.duration_minutes = n), q("impersonation.start", r);
1985
+ return n != null && (r.duration_minutes = n), J("impersonation.start", r);
1977
1986
  }
1978
1987
  async function Bn() {
1979
- return q("impersonation.stop");
1988
+ return J("impersonation.stop");
1980
1989
  }
1981
1990
  async function Vn(e) {
1982
- await q("impersonation.revoke", { session_id: e });
1991
+ await J("impersonation.revoke", { session_id: e });
1983
1992
  }
1984
1993
  async function Hn(e, t) {
1985
- await q("auth.change_password", {
1994
+ await J("auth.change_password", {
1986
1995
  current_password: e,
1987
1996
  new_password: t
1988
1997
  });
1989
1998
  }
1990
1999
  //#endregion
1991
2000
  //#region src/stores/auth.ts
1992
- var Un = S((e) => ({
2001
+ var Un = C((e) => ({
1993
2002
  user: null,
1994
2003
  isAuthenticated: !1,
1995
2004
  isLoading: !0,
@@ -2054,7 +2063,7 @@ var Un = S((e) => ({
2054
2063
  }));
2055
2064
  //#endregion
2056
2065
  //#region src/hooks/useSchema.ts
2057
- function J() {
2066
+ function Y() {
2058
2067
  let e = Un((e) => e.isAuthenticated);
2059
2068
  return g({
2060
2069
  queryKey: ["schema", e],
@@ -2075,7 +2084,7 @@ async function Gn(e, t = {}, n = {}) {
2075
2084
  let n = ir(e, t);
2076
2085
  if (n !== void 0) return n;
2077
2086
  }
2078
- return K(Wn(e, t), { signal: n.signal });
2087
+ return q(Wn(e, t), { signal: n.signal });
2079
2088
  }
2080
2089
  async function Kn(e, t) {
2081
2090
  if (ar) {
@@ -2085,7 +2094,7 @@ async function Kn(e, t) {
2085
2094
  let n = new URLSearchParams();
2086
2095
  if (typeof t == "string") n.set("id", t);
2087
2096
  else for (let [e, r] of Object.entries(t)) n.set(e, r);
2088
- return K(`/api/data/${e}?${n.toString()}`);
2097
+ return q(`/api/data/${e}?${n.toString()}`);
2089
2098
  }
2090
2099
  async function qn(e, t) {
2091
2100
  return { data: ((await cr(`${e}.__create`, {
@@ -2165,17 +2174,17 @@ function sr(e) {
2165
2174
  async function cr(e, t) {
2166
2175
  if (nr) return nr(e, t);
2167
2176
  try {
2168
- return await K(`/api/actions/${e}`, {
2177
+ return await q(`/api/actions/${e}`, {
2169
2178
  method: "POST",
2170
2179
  body: JSON.stringify(t)
2171
2180
  });
2172
2181
  } catch (e) {
2173
- throw e instanceof z && er(e.raw) ? new $n(e.status, e.raw) : e;
2182
+ throw e instanceof B && er(e.raw) ? new $n(e.status, e.raw) : e;
2174
2183
  }
2175
2184
  }
2176
2185
  async function lr(e, t) {
2177
2186
  let n = new URLSearchParams();
2178
- return n.set("ids", t.join(",")), K(`/api/associations/${e}?${n.toString()}`);
2187
+ return n.set("ids", t.join(",")), q(`/api/associations/${e}?${n.toString()}`);
2179
2188
  }
2180
2189
  //#endregion
2181
2190
  //#region src/embed/params.ts
@@ -2243,7 +2252,7 @@ function Sr({ children: e, query: t }) {
2243
2252
  let n = d(() => xr(vr(t ?? (typeof window < "u" ? window.location.search : ""))), [t]);
2244
2253
  return l(() => {
2245
2254
  le(n.enabled);
2246
- }, [n.enabled]), /* @__PURE__ */ y(br.Provider, {
2255
+ }, [n.enabled]), /* @__PURE__ */ b(br.Provider, {
2247
2256
  value: n,
2248
2257
  children: e
2249
2258
  });
@@ -2253,7 +2262,7 @@ function Cr() {
2253
2262
  }
2254
2263
  //#endregion
2255
2264
  //#region src/embed/embed-dirty.ts
2256
- var wr = S((e) => ({
2265
+ var wr = C((e) => ({
2257
2266
  isDirty: !1,
2258
2267
  setDirty: (t) => e((e) => e.isDirty === t ? e : { isDirty: t })
2259
2268
  }));
@@ -2271,7 +2280,7 @@ function Tr(e, t) {
2271
2280
  }
2272
2281
  //#endregion
2273
2282
  //#region src/embed/embed-nav-guard.ts
2274
- var Er = S((e, t) => ({
2283
+ var Er = C((e, t) => ({
2275
2284
  pendingNavigation: null,
2276
2285
  requestNavigation: (t) => e({ pendingNavigation: t }),
2277
2286
  confirmNavigation: () => {
@@ -2328,7 +2337,7 @@ function Ar(e) {
2328
2337
  return t === -1 ? e : e.slice(0, t);
2329
2338
  }
2330
2339
  function jr() {
2331
- let e = h(), t = m(), n = Cr(), { data: r } = J();
2340
+ let e = h(), t = m(), n = Cr(), { data: r } = Y();
2332
2341
  return s((i, a) => {
2333
2342
  if (!n.enabled) return e(i, a), !0;
2334
2343
  let o = r?.screens, s = Or(Ar(i), o), c = wr.getState().isDirty && Ar(i) !== t.pathname;
@@ -2407,31 +2416,31 @@ var Fr = {
2407
2416
  }, Ir = 200;
2408
2417
  function Lr({ type: e }) {
2409
2418
  let n = { display: "flex" };
2410
- return e === "loading" ? /* @__PURE__ */ y("span", {
2419
+ return e === "loading" ? /* @__PURE__ */ b("span", {
2411
2420
  style: {
2412
2421
  ...n,
2413
2422
  animation: "dz-toast-spin 0.9s linear infinite"
2414
2423
  },
2415
- children: /* @__PURE__ */ y(t.loader, { size: 11 })
2416
- }) : /* @__PURE__ */ y("span", {
2424
+ children: /* @__PURE__ */ b(t.loader, { size: 11 })
2425
+ }) : /* @__PURE__ */ b("span", {
2417
2426
  style: n,
2418
- children: /* @__PURE__ */ y(e === "success" ? t.check : e === "error" ? t.x : e === "warning" ? t.warning : t.info, { size: 11 })
2427
+ children: /* @__PURE__ */ b(e === "success" ? t.check : e === "error" ? t.x : e === "warning" ? t.warning : t.info, { size: 11 })
2419
2428
  });
2420
2429
  }
2421
2430
  function Rr({ model: e, onClose: n }) {
2422
- let r = Fr[e.type] ?? Fr.info, i = r.tone, [a, o] = p(!1), [c, u] = p(!1), [d, m] = p(!1), [h, g] = p(!1), [_, v] = p(1), x = f(e.duration), S = f(!1), C = !e.sticky && e.duration > 0, w = s(() => {
2431
+ let r = Fr[e.type] ?? Fr.info, i = r.tone, [a, o] = p(!1), [c, u] = p(!1), [d, m] = p(!1), [h, g] = p(!1), [_, v] = p(1), y = f(e.duration), S = f(!1), C = !e.sticky && e.duration > 0, w = s(() => {
2423
2432
  S.current || (S.current = !0, g(!0), window.setTimeout(n, Ir));
2424
2433
  }, [n]);
2425
2434
  l(() => {
2426
- x.current = e.duration, v(1);
2435
+ y.current = e.duration, v(1);
2427
2436
  }, [e.createdAt, e.duration]), l(() => {
2428
2437
  if (!C || a || h) return;
2429
- let t = Date.now(), n = window.setTimeout(w, x.current), r = 0, i = () => {
2430
- let n = x.current - (Date.now() - t);
2438
+ let t = Date.now(), n = window.setTimeout(w, y.current), r = 0, i = () => {
2439
+ let n = y.current - (Date.now() - t);
2431
2440
  v(Math.max(0, n) / e.duration), n > 0 && (r = requestAnimationFrame(i));
2432
2441
  };
2433
2442
  return r = requestAnimationFrame(i), () => {
2434
- window.clearTimeout(n), cancelAnimationFrame(r), x.current = Math.max(0, x.current - (Date.now() - t));
2443
+ window.clearTimeout(n), cancelAnimationFrame(r), y.current = Math.max(0, y.current - (Date.now() - t));
2435
2444
  };
2436
2445
  }, [
2437
2446
  C,
@@ -2455,7 +2464,7 @@ function Rr({ model: e, onClose: n }) {
2455
2464
  e.requestId,
2456
2465
  e.details
2457
2466
  ]), E = (e) => `var(--${i}${e})`, D = e.type === "error";
2458
- return /* @__PURE__ */ b("div", {
2467
+ return /* @__PURE__ */ x("div", {
2459
2468
  role: e.type === "error" ? "alert" : "status",
2460
2469
  "aria-live": e.type === "error" ? "assertive" : "polite",
2461
2470
  onMouseEnter: () => o(!0),
@@ -2471,14 +2480,14 @@ function Rr({ model: e, onClose: n }) {
2471
2480
  position: "relative",
2472
2481
  animation: h ? `dz-toast-out ${Ir}ms ease-in forwards` : "dz-toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1)"
2473
2482
  },
2474
- children: [/* @__PURE__ */ b("div", {
2483
+ children: [/* @__PURE__ */ x("div", {
2475
2484
  style: {
2476
2485
  display: "flex",
2477
2486
  padding: "10px 12px 11px 12px",
2478
2487
  gap: 10
2479
2488
  },
2480
2489
  children: [
2481
- /* @__PURE__ */ y("div", {
2490
+ /* @__PURE__ */ b("div", {
2482
2491
  style: {
2483
2492
  width: 18,
2484
2493
  height: 18,
@@ -2491,22 +2500,22 @@ function Rr({ model: e, onClose: n }) {
2491
2500
  justifyContent: "center",
2492
2501
  color: E("")
2493
2502
  },
2494
- children: /* @__PURE__ */ y(Lr, { type: e.type })
2503
+ children: /* @__PURE__ */ b(Lr, { type: e.type })
2495
2504
  }),
2496
- /* @__PURE__ */ b("div", {
2505
+ /* @__PURE__ */ x("div", {
2497
2506
  style: {
2498
2507
  flex: 1,
2499
2508
  minWidth: 0
2500
2509
  },
2501
2510
  children: [
2502
- /* @__PURE__ */ b("div", {
2511
+ /* @__PURE__ */ x("div", {
2503
2512
  style: {
2504
2513
  display: "flex",
2505
2514
  alignItems: "baseline",
2506
2515
  gap: 6
2507
2516
  },
2508
2517
  children: [
2509
- /* @__PURE__ */ y("div", {
2518
+ /* @__PURE__ */ b("div", {
2510
2519
  style: {
2511
2520
  fontSize: 12.5,
2512
2521
  fontWeight: 600,
@@ -2516,7 +2525,7 @@ function Rr({ model: e, onClose: n }) {
2516
2525
  },
2517
2526
  children: e.title || r.defaultTitle
2518
2527
  }),
2519
- (e.count ?? 0) > 1 && /* @__PURE__ */ b("span", {
2528
+ (e.count ?? 0) > 1 && /* @__PURE__ */ x("span", {
2520
2529
  style: {
2521
2530
  background: E("-soft"),
2522
2531
  color: E(""),
@@ -2528,7 +2537,7 @@ function Rr({ model: e, onClose: n }) {
2528
2537
  },
2529
2538
  children: ["×", e.count]
2530
2539
  }),
2531
- e.requestId && /* @__PURE__ */ y("span", {
2540
+ e.requestId && /* @__PURE__ */ b("span", {
2532
2541
  className: "mono",
2533
2542
  style: {
2534
2543
  fontSize: 10,
@@ -2540,7 +2549,7 @@ function Rr({ model: e, onClose: n }) {
2540
2549
  })
2541
2550
  ]
2542
2551
  }),
2543
- e.message && /* @__PURE__ */ y("div", {
2552
+ e.message && /* @__PURE__ */ b("div", {
2544
2553
  style: {
2545
2554
  fontSize: 12,
2546
2555
  color: "var(--text-2)",
@@ -2552,9 +2561,9 @@ function Rr({ model: e, onClose: n }) {
2552
2561
  },
2553
2562
  children: e.message
2554
2563
  }),
2555
- e.details && /* @__PURE__ */ b("div", {
2564
+ e.details && /* @__PURE__ */ x("div", {
2556
2565
  style: { marginTop: 6 },
2557
- children: [/* @__PURE__ */ b("button", {
2566
+ children: [/* @__PURE__ */ x("button", {
2558
2567
  type: "button",
2559
2568
  onClick: () => m((e) => !e),
2560
2569
  style: {
@@ -2569,14 +2578,14 @@ function Rr({ model: e, onClose: n }) {
2569
2578
  alignItems: "center",
2570
2579
  gap: 4
2571
2580
  },
2572
- children: [/* @__PURE__ */ y(t.down, {
2581
+ children: [/* @__PURE__ */ b(t.down, {
2573
2582
  size: 10,
2574
2583
  style: {
2575
2584
  transform: d ? "rotate(180deg)" : "none",
2576
2585
  transition: "transform .15s"
2577
2586
  }
2578
2587
  }), d ? "Hide details" : "Show details"]
2579
- }), d && /* @__PURE__ */ y("pre", {
2588
+ }), d && /* @__PURE__ */ b("pre", {
2580
2589
  className: "mono",
2581
2590
  style: {
2582
2591
  margin: "6px 0 0 0",
@@ -2596,14 +2605,14 @@ function Rr({ model: e, onClose: n }) {
2596
2605
  children: e.details
2597
2606
  })]
2598
2607
  }),
2599
- (e.action || D) && /* @__PURE__ */ b("div", {
2608
+ (e.action || D) && /* @__PURE__ */ x("div", {
2600
2609
  style: {
2601
2610
  display: "flex",
2602
2611
  alignItems: "center",
2603
2612
  gap: 6,
2604
2613
  marginTop: 8
2605
2614
  },
2606
- children: [e.action && /* @__PURE__ */ y("button", {
2615
+ children: [e.action && /* @__PURE__ */ b("button", {
2607
2616
  type: "button",
2608
2617
  onClick: () => {
2609
2618
  e.action?.onClick(), w();
@@ -2619,7 +2628,7 @@ function Rr({ model: e, onClose: n }) {
2619
2628
  cursor: "pointer"
2620
2629
  },
2621
2630
  children: e.action.label
2622
- }), D && /* @__PURE__ */ b("button", {
2631
+ }), D && /* @__PURE__ */ x("button", {
2623
2632
  type: "button",
2624
2633
  onClick: T,
2625
2634
  title: "Copy error message",
@@ -2637,12 +2646,12 @@ function Rr({ model: e, onClose: n }) {
2637
2646
  cursor: "pointer",
2638
2647
  fontWeight: 500
2639
2648
  },
2640
- children: [y(c ? t.check : t.copy, { size: 11 }), c ? "Copied" : "Copy"]
2649
+ children: [b(c ? t.check : t.copy, { size: 11 }), c ? "Copied" : "Copy"]
2641
2650
  })]
2642
2651
  })
2643
2652
  ]
2644
2653
  }),
2645
- /* @__PURE__ */ y("button", {
2654
+ /* @__PURE__ */ b("button", {
2646
2655
  type: "button",
2647
2656
  onClick: w,
2648
2657
  "aria-label": "Dismiss",
@@ -2661,10 +2670,10 @@ function Rr({ model: e, onClose: n }) {
2661
2670
  alignItems: "center",
2662
2671
  justifyContent: "center"
2663
2672
  },
2664
- children: /* @__PURE__ */ y(t.x, { size: 12 })
2673
+ children: /* @__PURE__ */ b(t.x, { size: 12 })
2665
2674
  })
2666
2675
  ]
2667
- }), C && /* @__PURE__ */ y("div", {
2676
+ }), C && /* @__PURE__ */ b("div", {
2668
2677
  style: {
2669
2678
  position: "absolute",
2670
2679
  left: 0,
@@ -2672,7 +2681,7 @@ function Rr({ model: e, onClose: n }) {
2672
2681
  bottom: 0,
2673
2682
  height: 2
2674
2683
  },
2675
- children: /* @__PURE__ */ y("div", { style: {
2684
+ children: /* @__PURE__ */ b("div", { style: {
2676
2685
  height: "100%",
2677
2686
  width: `${_ * 100}%`,
2678
2687
  background: E(""),
@@ -2690,31 +2699,31 @@ var zr = {
2690
2699
  warning: 8e3,
2691
2700
  error: 0,
2692
2701
  loading: 0
2693
- }, Y = /* @__PURE__ */ new Map(), Br = /* @__PURE__ */ new Map(), Vr = 0, Hr = () => `dz-${++Vr}`;
2702
+ }, X = /* @__PURE__ */ new Map(), Br = /* @__PURE__ */ new Map(), Vr = 0, Hr = () => `dz-${++Vr}`;
2694
2703
  function Ur(e) {
2695
- _.custom(() => /* @__PURE__ */ y(Rr, {
2704
+ v.custom(() => /* @__PURE__ */ b(Rr, {
2696
2705
  model: e,
2697
- onClose: () => _.dismiss(e.id)
2706
+ onClose: () => v.dismiss(e.id)
2698
2707
  }), {
2699
2708
  id: e.id,
2700
2709
  duration: Infinity,
2701
2710
  onDismiss: () => {
2702
- Y.delete(String(e.id)), e.group && Br.get(e.group) === e.id && Br.delete(e.group);
2711
+ X.delete(String(e.id)), e.group && Br.get(e.group) === e.id && Br.delete(e.group);
2703
2712
  }
2704
2713
  });
2705
2714
  }
2706
2715
  function Wr(e, t, n, r = {}) {
2707
2716
  if (r.group) {
2708
2717
  let e = Br.get(r.group);
2709
- if (e && Y.has(e)) {
2710
- let r = Y.get(e), i = {
2718
+ if (e && X.has(e)) {
2719
+ let r = X.get(e), i = {
2711
2720
  ...r,
2712
2721
  title: t,
2713
2722
  message: n,
2714
2723
  count: (r.count ?? 1) + 1,
2715
2724
  createdAt: Date.now()
2716
2725
  };
2717
- return Y.set(e, i), Ur(i), e;
2726
+ return X.set(e, i), Ur(i), e;
2718
2727
  }
2719
2728
  }
2720
2729
  let i = r.id ?? Hr(), a = r.duration ?? zr[e], o = {
@@ -2731,10 +2740,10 @@ function Wr(e, t, n, r = {}) {
2731
2740
  createdAt: Date.now(),
2732
2741
  group: r.group
2733
2742
  };
2734
- return Y.set(i, o), r.group && Br.set(r.group, i), Ur(o), i;
2743
+ return X.set(i, o), r.group && Br.set(r.group, i), Ur(o), i;
2735
2744
  }
2736
2745
  function Gr(e, t) {
2737
- let n = Y.get(e);
2746
+ let n = X.get(e);
2738
2747
  if (!n) return;
2739
2748
  let r = t.type ?? n.type, i = t.duration ?? (t.type ? zr[r] : n.duration), a = {
2740
2749
  ...n,
@@ -2744,25 +2753,25 @@ function Gr(e, t) {
2744
2753
  sticky: t.sticky ?? i === 0,
2745
2754
  createdAt: Date.now()
2746
2755
  };
2747
- Y.set(e, a), Ur(a);
2756
+ X.set(e, a), Ur(a);
2748
2757
  }
2749
- var X = {
2758
+ var Z = {
2750
2759
  success: (e, t, n) => Wr("success", e, t, n),
2751
2760
  info: (e, t, n) => Wr("info", e, t, n),
2752
2761
  warning: (e, t, n) => Wr("warning", e, t, n),
2753
2762
  error: (e, t, n) => Wr("error", e, t, n),
2754
2763
  loading: (e, t, n) => Wr("loading", e, t, n),
2755
2764
  update: Gr,
2756
- dismiss: (e) => _.dismiss(e),
2757
- dismissAll: () => _.dismiss()
2758
- }, Kr = o(() => import("./MarkdownRenderer-DNmOqp_M.js").then((e) => ({ default: e.MarkdownRenderer })));
2765
+ dismiss: (e) => v.dismiss(e),
2766
+ dismissAll: () => v.dismiss()
2767
+ }, Kr = o(() => import("./MarkdownRenderer-CSuODN70.js").then((e) => ({ default: e.MarkdownRenderer })));
2759
2768
  function qr() {
2760
- return /* @__PURE__ */ y("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
2769
+ return /* @__PURE__ */ b("div", { className: "h-4 w-2/3 rounded bg-muted animate-pulse" });
2761
2770
  }
2762
2771
  function Jr(e) {
2763
- return /* @__PURE__ */ y(r, {
2764
- fallback: /* @__PURE__ */ y(qr, {}),
2765
- children: /* @__PURE__ */ y(Kr, { ...e })
2772
+ return /* @__PURE__ */ b(r, {
2773
+ fallback: /* @__PURE__ */ b(qr, {}),
2774
+ children: /* @__PURE__ */ b(Kr, { ...e })
2766
2775
  });
2767
2776
  }
2768
2777
  //#endregion
@@ -2835,12 +2844,12 @@ function ri({ value: e, title: n, size: r = "icon" }) {
2835
2844
  await navigator.clipboard.writeText(e), a(!0), setTimeout(() => a(!1), 2e3);
2836
2845
  } catch {}
2837
2846
  }, [e]), c = r === "sm" ? 12 : 14;
2838
- return /* @__PURE__ */ y(D, {
2847
+ return /* @__PURE__ */ b(O, {
2839
2848
  size: r === "sm" ? 22 : 28,
2840
- icon: i ? /* @__PURE__ */ y(t.check, {
2849
+ icon: i ? /* @__PURE__ */ b(t.check, {
2841
2850
  size: c,
2842
2851
  style: { color: "var(--success)" }
2843
- }) : /* @__PURE__ */ y(t.copy, { size: c }),
2852
+ }) : /* @__PURE__ */ b(t.copy, { size: c }),
2844
2853
  onClick: o,
2845
2854
  title: n ?? "Copy to clipboard"
2846
2855
  });
@@ -2849,33 +2858,33 @@ function ri({ value: e, title: n, size: r = "icon" }) {
2849
2858
  //#region src/components/fields/StringField.tsx
2850
2859
  function ii({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
2851
2860
  if (r === "display") {
2852
- let t = F(n);
2853
- return e.copyable && t ? /* @__PURE__ */ b("span", {
2861
+ let t = I(n);
2862
+ return e.copyable && t ? /* @__PURE__ */ x("span", {
2854
2863
  style: {
2855
2864
  display: "inline-flex",
2856
2865
  alignItems: "center",
2857
2866
  gap: 4
2858
2867
  },
2859
- children: [/* @__PURE__ */ y("span", {
2868
+ children: [/* @__PURE__ */ b("span", {
2860
2869
  style: { fontSize: 12.5 },
2861
2870
  children: t
2862
- }), /* @__PURE__ */ y(ri, {
2871
+ }), /* @__PURE__ */ b(ri, {
2863
2872
  value: t,
2864
2873
  size: "sm"
2865
2874
  })]
2866
- }) : /* @__PURE__ */ y("span", {
2875
+ }) : /* @__PURE__ */ b("span", {
2867
2876
  style: { fontSize: 12.5 },
2868
- children: t || /* @__PURE__ */ y("span", {
2877
+ children: t || /* @__PURE__ */ b("span", {
2869
2878
  style: { color: "var(--text-4)" },
2870
2879
  children: "—"
2871
2880
  })
2872
2881
  });
2873
2882
  }
2874
- return /* @__PURE__ */ y(N, {
2883
+ return /* @__PURE__ */ b(P, {
2875
2884
  id: a,
2876
2885
  name: t,
2877
2886
  "aria-required": e.required || void 0,
2878
- value: F(n),
2887
+ value: I(n),
2879
2888
  onChange: (e) => i?.(e)
2880
2889
  });
2881
2890
  }
@@ -2884,15 +2893,15 @@ function ii({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
2884
2893
  function ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, compact: o, fieldId: s }) {
2885
2894
  let c = e.display?.widget;
2886
2895
  if (r === "display") {
2887
- let t = F(n);
2888
- if (!t) return /* @__PURE__ */ y("span", {
2896
+ let t = I(n);
2897
+ if (!t) return /* @__PURE__ */ b("span", {
2889
2898
  style: {
2890
2899
  fontSize: 12.5,
2891
2900
  color: "var(--text-4)"
2892
2901
  },
2893
2902
  children: "—"
2894
2903
  });
2895
- let r = c === "markdown" ? /* @__PURE__ */ y(Jr, { content: t }) : c === "code" ? /* @__PURE__ */ y("pre", {
2904
+ let r = c === "markdown" ? /* @__PURE__ */ b(Jr, { content: t }) : c === "code" ? /* @__PURE__ */ b("pre", {
2896
2905
  className: "mono",
2897
2906
  style: {
2898
2907
  fontSize: 12,
@@ -2907,7 +2916,7 @@ function ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2907
2916
  whiteSpace: "pre"
2908
2917
  },
2909
2918
  children: t
2910
- }) : /* @__PURE__ */ y("p", {
2919
+ }) : /* @__PURE__ */ b("p", {
2911
2920
  style: {
2912
2921
  fontSize: 12.5,
2913
2922
  whiteSpace: "pre-wrap",
@@ -2916,34 +2925,34 @@ function ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2916
2925
  },
2917
2926
  children: t
2918
2927
  });
2919
- return e.copyable ? /* @__PURE__ */ b("div", {
2928
+ return e.copyable ? /* @__PURE__ */ x("div", {
2920
2929
  style: { position: "relative" },
2921
- children: [r, /* @__PURE__ */ y("div", {
2930
+ children: [r, /* @__PURE__ */ b("div", {
2922
2931
  style: {
2923
2932
  position: "absolute",
2924
2933
  top: 0,
2925
2934
  right: 0
2926
2935
  },
2927
- children: /* @__PURE__ */ y(ri, {
2936
+ children: /* @__PURE__ */ b(ri, {
2928
2937
  value: t,
2929
2938
  size: "sm"
2930
2939
  })
2931
2940
  })]
2932
2941
  }) : r;
2933
2942
  }
2934
- if (o) return /* @__PURE__ */ y(N, {
2943
+ if (o) return /* @__PURE__ */ b(P, {
2935
2944
  id: s,
2936
2945
  name: t,
2937
2946
  "aria-required": e.required || void 0,
2938
- value: F(n),
2947
+ value: I(n),
2939
2948
  onChange: (e) => i?.(e)
2940
2949
  });
2941
2950
  let l = c === "markdown" || c === "code" ? 10 : 4;
2942
- return /* @__PURE__ */ y(Te, {
2951
+ return /* @__PURE__ */ b(Te, {
2943
2952
  id: s,
2944
2953
  name: t,
2945
2954
  ariaRequired: e.required,
2946
- value: F(n),
2955
+ value: I(n),
2947
2956
  onChange: (e) => i?.(e),
2948
2957
  rows: l,
2949
2958
  fill: a
@@ -2954,25 +2963,25 @@ function ai({ field: e, fieldName: t, value: n, mode: r, onChange: i, fill: a, c
2954
2963
  var oi = "__declarion_enum_null__";
2955
2964
  function si({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }) {
2956
2965
  let o = e.values ?? [], s = o.find((e) => e.code === t);
2957
- if (n === "display") return s ? /* @__PURE__ */ y(O, {
2966
+ if (n === "display") return s ? /* @__PURE__ */ b(k, {
2958
2967
  tone: s.color ?? "slate",
2959
2968
  size: "xs",
2960
- children: I(s.name)
2961
- }) : /* @__PURE__ */ y("span", {
2969
+ children: L(s.name)
2970
+ }) : /* @__PURE__ */ b("span", {
2962
2971
  style: {
2963
2972
  fontSize: 12.5,
2964
2973
  color: "var(--text-4)"
2965
2974
  },
2966
2975
  children: "—"
2967
2976
  });
2968
- let c = !e.required, l = t != null && t !== "" ? F(t) : oi, u = [...c ? [{
2977
+ let c = !e.required, l = t != null && t !== "" ? I(t) : oi, u = [...c ? [{
2969
2978
  value: oi,
2970
2979
  label: "— None —"
2971
2980
  }] : [], ...o.map((e) => ({
2972
2981
  value: e.code,
2973
- label: I(e.name) || e.code
2982
+ label: L(e.name) || e.code
2974
2983
  }))];
2975
- return /* @__PURE__ */ y(P, {
2984
+ return /* @__PURE__ */ b(F, {
2976
2985
  id: i,
2977
2986
  "aria-labelledby": a,
2978
2987
  "aria-required": e.required || void 0,
@@ -2985,24 +2994,24 @@ function si({ field: e, value: t, mode: n, onChange: r, fieldId: i, labelId: a }
2985
2994
  //#endregion
2986
2995
  //#region src/components/fields/EmailField.tsx
2987
2996
  function ci({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
2988
- return /* @__PURE__ */ y(N, {
2997
+ return /* @__PURE__ */ b(P, {
2989
2998
  id: i,
2990
2999
  name: t,
2991
3000
  "aria-required": e.required || void 0,
2992
3001
  type: "email",
2993
- value: F(n),
3002
+ value: I(n),
2994
3003
  onChange: (e) => r?.(e)
2995
3004
  });
2996
3005
  }
2997
3006
  //#endregion
2998
3007
  //#region src/components/fields/UrlField.tsx
2999
3008
  function li({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
3000
- return /* @__PURE__ */ y(N, {
3009
+ return /* @__PURE__ */ b(P, {
3001
3010
  id: i,
3002
3011
  name: t,
3003
3012
  "aria-required": e.required || void 0,
3004
3013
  type: "url",
3005
- value: F(n),
3014
+ value: I(n),
3006
3015
  onChange: (e) => r?.(e),
3007
3016
  placeholder: "https://"
3008
3017
  });
@@ -3010,12 +3019,12 @@ function li({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
3010
3019
  //#endregion
3011
3020
  //#region src/components/fields/PhoneField.tsx
3012
3021
  function ui({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
3013
- return /* @__PURE__ */ y(N, {
3022
+ return /* @__PURE__ */ b(P, {
3014
3023
  id: i,
3015
3024
  name: t,
3016
3025
  "aria-required": e.required || void 0,
3017
3026
  type: "tel",
3018
- value: F(n),
3027
+ value: I(n),
3019
3028
  onChange: (e) => r?.(e),
3020
3029
  placeholder: "+1 555 555 5555"
3021
3030
  });
@@ -3023,7 +3032,7 @@ function ui({ field: e, fieldName: t, value: n, onChange: r, fieldId: i }) {
3023
3032
  //#endregion
3024
3033
  //#region src/lib/timestamp.ts
3025
3034
  function di(e = /* @__PURE__ */ new Date()) {
3026
- return T(e);
3035
+ return E(e);
3027
3036
  }
3028
3037
  function fi(e, t) {
3029
3038
  let n = e.match(/([+-]\d{2}:\d{2})$/), r = e.endsWith("Z"), i = new Date(e);
@@ -3072,10 +3081,10 @@ function mi(e, t = /* @__PURE__ */ new Date()) {
3072
3081
  }
3073
3082
  let r = pi(typeof e == "string" ? e : n.toISOString()), i = t.getTime() - n.getTime();
3074
3083
  return Math.abs(i) > 720 * 60 * 60 * 1e3 ? {
3075
- text: T(n, { representation: "date" }),
3084
+ text: E(n, { representation: "date" }),
3076
3085
  absolute: r
3077
3086
  } : {
3078
- text: w(n, { addSuffix: !0 }),
3087
+ text: T(n, { addSuffix: !0 }),
3079
3088
  absolute: r
3080
3089
  };
3081
3090
  }
@@ -3144,17 +3153,17 @@ function xi(e, t) {
3144
3153
  function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3145
3154
  let o = e.type === "date", s = !!e.timezone;
3146
3155
  if (r === "display") {
3147
- if (!n) return /* @__PURE__ */ y("span", {
3156
+ if (!n) return /* @__PURE__ */ b("span", {
3148
3157
  style: {
3149
3158
  fontSize: 12.5,
3150
3159
  color: "var(--text-4)"
3151
3160
  },
3152
3161
  children: "—"
3153
3162
  });
3154
- let e = F(n), t = s ? _i(e, o) : vi(e, o), r = s && !o ? yi(e) : null;
3155
- return /* @__PURE__ */ b("span", {
3163
+ let e = I(n), t = s ? _i(e, o) : vi(e, o), r = s && !o ? yi(e) : null;
3164
+ return /* @__PURE__ */ x("span", {
3156
3165
  style: { fontSize: 12.5 },
3157
- children: [t, r && /* @__PURE__ */ y("span", {
3166
+ children: [t, r && /* @__PURE__ */ b("span", {
3158
3167
  style: {
3159
3168
  marginLeft: 4,
3160
3169
  color: "var(--text-3)"
@@ -3163,8 +3172,8 @@ function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3163
3172
  })]
3164
3173
  });
3165
3174
  }
3166
- let c = n ? s ? bi(F(n), o) : xi(F(n), o) : "";
3167
- return /* @__PURE__ */ y(N, {
3175
+ let c = n ? s ? bi(I(n), o) : xi(I(n), o) : "";
3176
+ return /* @__PURE__ */ b(P, {
3168
3177
  id: a,
3169
3178
  name: t,
3170
3179
  "aria-required": e.required || void 0,
@@ -3192,21 +3201,21 @@ function Si({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3192
3201
  //#region src/components/fields/BoolField.tsx
3193
3202
  function Ci({ value: e, mode: t, onChange: n, fieldId: r, labelId: i }) {
3194
3203
  let a = !!e;
3195
- return t === "display" ? /* @__PURE__ */ b("span", {
3204
+ return t === "display" ? /* @__PURE__ */ x("span", {
3196
3205
  style: {
3197
3206
  display: "inline-flex",
3198
3207
  alignItems: "center",
3199
3208
  gap: 6,
3200
3209
  fontSize: 12.5
3201
3210
  },
3202
- children: [/* @__PURE__ */ y("span", { style: {
3211
+ children: [/* @__PURE__ */ b("span", { style: {
3203
3212
  display: "inline-block",
3204
3213
  width: 6,
3205
3214
  height: 6,
3206
3215
  borderRadius: 999,
3207
3216
  background: a ? "var(--success)" : "var(--text-4)"
3208
3217
  } }), a ? "Yes" : "No"]
3209
- }) : /* @__PURE__ */ y(be, {
3218
+ }) : /* @__PURE__ */ b(be, {
3210
3219
  id: r,
3211
3220
  ariaLabelledby: i,
3212
3221
  value: a,
@@ -3231,7 +3240,7 @@ var Ti = new Intl.NumberFormat();
3231
3240
  function Ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3232
3241
  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);
3233
3242
  if (r === "display") {
3234
- if (n == null) return /* @__PURE__ */ y("span", {
3243
+ if (n == null) return /* @__PURE__ */ b("span", {
3235
3244
  style: {
3236
3245
  fontSize: 12.5,
3237
3246
  color: "var(--text-4)"
@@ -3244,16 +3253,16 @@ function Ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3244
3253
  let t = Number(n);
3245
3254
  e = isNaN(t) ? null : Ti.format(t);
3246
3255
  }
3247
- return e == null ? /* @__PURE__ */ y("span", {
3256
+ return e == null ? /* @__PURE__ */ b("span", {
3248
3257
  style: { fontSize: 12.5 },
3249
3258
  children: "—"
3250
- }) : /* @__PURE__ */ b("span", {
3259
+ }) : /* @__PURE__ */ x("span", {
3251
3260
  className: "num",
3252
3261
  style: {
3253
3262
  fontSize: 12.5,
3254
3263
  fontVariantNumeric: "tabular-nums"
3255
3264
  },
3256
- children: [e, d && /* @__PURE__ */ y("span", {
3265
+ children: [e, d && /* @__PURE__ */ b("span", {
3257
3266
  style: {
3258
3267
  color: "var(--text-3)",
3259
3268
  marginLeft: 4
@@ -3262,24 +3271,24 @@ function Ei({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3262
3271
  })]
3263
3272
  });
3264
3273
  }
3265
- return c ? /* @__PURE__ */ y(N, {
3274
+ return c ? /* @__PURE__ */ b(P, {
3266
3275
  id: o,
3267
3276
  name: t,
3268
3277
  "aria-required": e.required || void 0,
3269
3278
  type: "text",
3270
3279
  inputMode: "decimal",
3271
3280
  pattern: "-?\\d*\\.?\\d*",
3272
- value: n == null ? "" : F(n),
3281
+ value: n == null ? "" : I(n),
3273
3282
  onChange: (e) => {
3274
3283
  e === "" ? i?.(null) : i?.(e);
3275
3284
  }
3276
- }) : /* @__PURE__ */ y(N, {
3285
+ }) : /* @__PURE__ */ b(P, {
3277
3286
  id: o,
3278
3287
  name: t,
3279
3288
  "aria-required": e.required || void 0,
3280
3289
  type: "number",
3281
3290
  step: e.type === "float" ? "0.01" : "1",
3282
- value: n == null ? "" : F(n),
3291
+ value: n == null ? "" : I(n),
3283
3292
  onChange: (t) => {
3284
3293
  t === "" ? i?.(null) : i?.(e.type === "int" ? parseInt(t, 10) : parseFloat(t));
3285
3294
  }
@@ -3341,19 +3350,19 @@ function Ai(e, t) {
3341
3350
  //#endregion
3342
3351
  //#region src/hooks/useEntity.ts
3343
3352
  function ji(e) {
3344
- let { data: t } = J();
3353
+ let { data: t } = Y();
3345
3354
  if (!(!t || !e)) return t.entities[e];
3346
3355
  }
3347
3356
  //#endregion
3348
3357
  //#region src/components/fields/RefCombobox.tsx
3349
3358
  var Mi = 200;
3350
3359
  function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, id: a, labelId: o, ariaLabel: s, required: c, placeholder: l = "Select…", specialValues: u }) {
3351
- let m = e?.entity, h = ji(m), g = i ?? e?.display?.field ?? h?.display?.display_field ?? "$display", _ = d(() => h ? R(h)[0] ?? "id" : "id", [h]), v = e?.field || _, [b, x] = p(""), S = Ai(b, 300), { data: C, isLoading: w } = Oi(m, {
3360
+ let m = e?.entity, h = ji(m), g = i ?? e?.display?.field ?? h?.display?.display_field ?? "$display", _ = d(() => h ? z(h)[0] ?? "id" : "id", [h]), v = e?.field || _, [y, x] = p(""), S = Ai(y, 300), { data: C, isLoading: w } = Oi(m, {
3352
3361
  per_page: Mi,
3353
3362
  sort: g ? `${g}:asc` : void 0,
3354
3363
  search: S || void 0,
3355
3364
  filters: e?.options_filter
3356
- }), T = d(() => C?.data ?? [], [C?.data]), E = t == null ? "" : F(t), D = d(() => T.some((e) => String(e[v]) === E), [
3365
+ }), T = d(() => C?.data ?? [], [C?.data]), E = t == null ? "" : I(t), D = d(() => T.some((e) => String(e[v]) === E), [
3357
3366
  T,
3358
3367
  v,
3359
3368
  E
@@ -3364,19 +3373,19 @@ function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
3364
3373
  op: "eq",
3365
3374
  value: E
3366
3375
  }]
3367
- }), ee = f(null), j = d(() => {
3376
+ }), j = f(null), M = d(() => {
3368
3377
  if (!E) return "";
3369
3378
  let e;
3370
- if (O) e = L(O, g, E);
3379
+ if (O) e = R(O, g, E);
3371
3380
  else {
3372
3381
  let t = T.find((e) => String(e[v]) === E);
3373
- if (t) e = L(t, g, E);
3382
+ if (t) e = R(t, g, E);
3374
3383
  else {
3375
3384
  let t = A?.data?.find((e) => String(e[v]) === E);
3376
- t && (e = L(t, g, E));
3385
+ t && (e = R(t, g, E));
3377
3386
  }
3378
3387
  }
3379
- return e === void 0 ? ee.current?.value === E ? ee.current.label : E : (ee.current = {
3388
+ return e === void 0 ? j.current?.value === E ? j.current.label : E : (j.current = {
3380
3389
  value: E,
3381
3390
  label: e
3382
3391
  }, e);
@@ -3387,19 +3396,19 @@ function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
3387
3396
  v,
3388
3397
  g,
3389
3398
  A
3390
- ]), te = d(() => {
3399
+ ]), ee = d(() => {
3391
3400
  let e = (u ?? []).map((e) => ({
3392
3401
  value: e.code,
3393
- label: I(e.label) || e.code
3402
+ label: L(e.label) || e.code
3394
3403
  })), t = T.map((e) => {
3395
- let t = F(e[v]);
3404
+ let t = I(e[v]);
3396
3405
  return {
3397
3406
  value: t,
3398
- label: L(e, g, t)
3407
+ label: R(e, g, t)
3399
3408
  };
3400
3409
  }), n = E && !D && !k ? [{
3401
3410
  value: E,
3402
- label: j
3411
+ label: M
3403
3412
  }] : [], r = t.length > 0 || n.length > 0;
3404
3413
  return [
3405
3414
  {
@@ -3425,18 +3434,18 @@ function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
3425
3434
  E,
3426
3435
  D,
3427
3436
  k,
3428
- j,
3437
+ M,
3429
3438
  T,
3430
3439
  v,
3431
3440
  g
3432
3441
  ]);
3433
- return /* @__PURE__ */ y(P, {
3442
+ return /* @__PURE__ */ b(F, {
3434
3443
  id: a,
3435
3444
  "aria-label": s,
3436
3445
  "aria-labelledby": o,
3437
3446
  "aria-required": c || void 0,
3438
3447
  value: E,
3439
- options: te,
3448
+ options: ee,
3440
3449
  onChange: (e) => n(e || null),
3441
3450
  onSearchChange: x,
3442
3451
  placeholder: l
@@ -3447,10 +3456,10 @@ function Ni({ ref: e, value: t, onChange: n, refs: r, displayFieldOverride: i, i
3447
3456
  function Pi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, labelId: o }) {
3448
3457
  let s = e.ref?.entity, c = e.display?.ref_display_field || "$display", l = d(() => {
3449
3458
  if (t == null) return "—";
3450
- let e = F(t);
3459
+ let e = I(t);
3451
3460
  if (i && s) {
3452
3461
  let t = i[s]?.[e];
3453
- if (t) return L(t, c, e);
3462
+ if (t) return R(t, c, e);
3454
3463
  }
3455
3464
  return e;
3456
3465
  }, [
@@ -3459,10 +3468,10 @@ function Pi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
3459
3468
  s,
3460
3469
  c
3461
3470
  ]);
3462
- return n === "display" ? /* @__PURE__ */ y("span", {
3471
+ return n === "display" ? /* @__PURE__ */ b("span", {
3463
3472
  style: { fontSize: 12.5 },
3464
3473
  children: l
3465
- }) : /* @__PURE__ */ y(Ni, {
3474
+ }) : /* @__PURE__ */ b(Ni, {
3466
3475
  ref: e.ref,
3467
3476
  value: t,
3468
3477
  onChange: (e) => r?.(e),
@@ -3477,27 +3486,27 @@ function Pi({ field: e, value: t, mode: n, onChange: r, refs: i, fieldId: a, lab
3477
3486
  //#region src/components/fields/JsonField.tsx
3478
3487
  var Fi = o(() => import("./JsonEditor-DoNmyrYd.js").then((e) => ({ default: e.JsonEditor })));
3479
3488
  function Ii() {
3480
- return /* @__PURE__ */ y("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
3489
+ return /* @__PURE__ */ b("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
3481
3490
  }
3482
3491
  function Li(e) {
3483
3492
  return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
3484
3493
  }
3485
3494
  function Ri({ value: e, mode: t, onChange: n, fieldId: i }) {
3486
- return t === "display" ? Li(e) ? /* @__PURE__ */ y("span", {
3495
+ return t === "display" ? Li(e) ? /* @__PURE__ */ b("span", {
3487
3496
  style: {
3488
3497
  fontSize: 12.5,
3489
3498
  color: "var(--text-4)"
3490
3499
  },
3491
3500
  children: "—"
3492
- }) : /* @__PURE__ */ y(r, {
3493
- fallback: /* @__PURE__ */ y(Ii, {}),
3494
- children: /* @__PURE__ */ y(Fi, {
3501
+ }) : /* @__PURE__ */ b(r, {
3502
+ fallback: /* @__PURE__ */ b(Ii, {}),
3503
+ children: /* @__PURE__ */ b(Fi, {
3495
3504
  value: e,
3496
3505
  readOnly: !0
3497
3506
  })
3498
- }) : /* @__PURE__ */ y(r, {
3499
- fallback: /* @__PURE__ */ y(Ii, {}),
3500
- children: /* @__PURE__ */ y(Fi, {
3507
+ }) : /* @__PURE__ */ b(r, {
3508
+ fallback: /* @__PURE__ */ b(Ii, {}),
3509
+ children: /* @__PURE__ */ b(Fi, {
3501
3510
  value: e,
3502
3511
  onChange: n,
3503
3512
  id: i
@@ -3510,11 +3519,11 @@ function zi(e) {
3510
3519
  return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
3511
3520
  }
3512
3521
  function Bi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3513
- let { data: o } = J(), s = o?.languages?.length ? o.languages : [{
3522
+ let { data: o } = Y(), s = o?.languages?.length ? o.languages : [{
3514
3523
  code: "en",
3515
3524
  name: { en: "English" }
3516
3525
  }], c = zi(n);
3517
- if (r === "display") return /* @__PURE__ */ y("span", {
3526
+ if (r === "display") return /* @__PURE__ */ b("span", {
3518
3527
  style: { fontSize: 12.5 },
3519
3528
  children: Object.values(c)[0] ?? "—"
3520
3529
  });
@@ -3526,7 +3535,7 @@ function Bi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3526
3535
  for (let e of Object.keys(n)) n[e] || delete n[e];
3527
3536
  i?.(Object.keys(n).length > 0 ? n : null);
3528
3537
  };
3529
- return /* @__PURE__ */ y("div", {
3538
+ return /* @__PURE__ */ b("div", {
3530
3539
  style: {
3531
3540
  display: "flex",
3532
3541
  flexDirection: "column",
@@ -3534,13 +3543,13 @@ function Bi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3534
3543
  },
3535
3544
  children: s.map((n, r) => {
3536
3545
  let i = a ? r === 0 ? a : `${a}-${n.code}` : void 0;
3537
- return /* @__PURE__ */ b("div", {
3546
+ return /* @__PURE__ */ x("div", {
3538
3547
  style: {
3539
3548
  display: "flex",
3540
3549
  alignItems: "center",
3541
3550
  gap: 8
3542
3551
  },
3543
- children: [/* @__PURE__ */ y("label", {
3552
+ children: [/* @__PURE__ */ b("label", {
3544
3553
  htmlFor: i,
3545
3554
  style: {
3546
3555
  width: 24,
@@ -3552,9 +3561,9 @@ function Bi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3552
3561
  fontWeight: 500
3553
3562
  },
3554
3563
  children: n.code
3555
- }), /* @__PURE__ */ y("div", {
3564
+ }), /* @__PURE__ */ b("div", {
3556
3565
  style: { flex: 1 },
3557
- children: /* @__PURE__ */ y(N, {
3566
+ children: /* @__PURE__ */ b(P, {
3558
3567
  id: i,
3559
3568
  name: t ? `${t}.${n.code}` : void 0,
3560
3569
  "aria-required": e.required && r === 0 ? !0 : void 0,
@@ -3573,11 +3582,11 @@ function Vi(e) {
3573
3582
  return e == null ? {} : typeof e == "object" && !Array.isArray(e) ? e : typeof e == "string" ? { en: e } : {};
3574
3583
  }
3575
3584
  function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a }) {
3576
- let { data: o } = J(), s = o?.languages?.length ? o.languages : [{
3585
+ let { data: o } = Y(), s = o?.languages?.length ? o.languages : [{
3577
3586
  code: "en",
3578
3587
  name: { en: "English" }
3579
3588
  }], c = Vi(n);
3580
- if (r === "display") return /* @__PURE__ */ y("p", {
3589
+ if (r === "display") return /* @__PURE__ */ b("p", {
3581
3590
  style: {
3582
3591
  fontSize: 12.5,
3583
3592
  whiteSpace: "pre-wrap",
@@ -3593,7 +3602,7 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3593
3602
  for (let e of Object.keys(n)) n[e] || delete n[e];
3594
3603
  i?.(Object.keys(n).length > 0 ? n : null);
3595
3604
  };
3596
- return /* @__PURE__ */ y("div", {
3605
+ return /* @__PURE__ */ b("div", {
3597
3606
  style: {
3598
3607
  display: "flex",
3599
3608
  flexDirection: "column",
@@ -3601,13 +3610,13 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3601
3610
  },
3602
3611
  children: s.map((n, r) => {
3603
3612
  let i = a ? r === 0 ? a : `${a}-${n.code}` : void 0;
3604
- return /* @__PURE__ */ b("div", {
3613
+ return /* @__PURE__ */ x("div", {
3605
3614
  style: {
3606
3615
  display: "flex",
3607
3616
  flexDirection: "column",
3608
3617
  gap: 4
3609
3618
  },
3610
- children: [/* @__PURE__ */ y("label", {
3619
+ children: [/* @__PURE__ */ b("label", {
3611
3620
  htmlFor: i,
3612
3621
  style: {
3613
3622
  fontSize: 10.5,
@@ -3617,7 +3626,7 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3617
3626
  fontWeight: 500
3618
3627
  },
3619
3628
  children: n.code
3620
- }), /* @__PURE__ */ y(Te, {
3629
+ }), /* @__PURE__ */ b(Te, {
3621
3630
  id: i,
3622
3631
  name: t ? `${t}.${n.code}` : void 0,
3623
3632
  ariaRequired: e.required && r === 0,
@@ -3633,22 +3642,22 @@ function Hi({ field: e, fieldName: t, value: n, mode: r, onChange: i, fieldId: a
3633
3642
  //#endregion
3634
3643
  //#region src/components/fields/StructureField.tsx
3635
3644
  function Ui(e) {
3636
- let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = J(), c = t.structure ? s?.structures?.[t.structure] : void 0;
3637
- return c ? t.array ? /* @__PURE__ */ y(Gi, {
3645
+ let { field: t, value: n, mode: r, onChange: i, locale: a, fieldId: o } = e, { data: s } = Y(), c = t.structure ? s?.structures?.[t.structure] : void 0;
3646
+ return c ? t.array ? /* @__PURE__ */ b(Gi, {
3638
3647
  structDef: c,
3639
3648
  value: n,
3640
3649
  mode: r,
3641
3650
  onChange: i,
3642
3651
  locale: a,
3643
3652
  fieldId: o
3644
- }) : /* @__PURE__ */ y(Wi, {
3653
+ }) : /* @__PURE__ */ b(Wi, {
3645
3654
  structDef: c,
3646
3655
  value: n,
3647
3656
  mode: r,
3648
3657
  onChange: i,
3649
3658
  locale: a,
3650
3659
  fieldId: o
3651
- }) : /* @__PURE__ */ y(Ri, { ...e });
3660
+ }) : /* @__PURE__ */ b(Ri, { ...e });
3652
3661
  }
3653
3662
  function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId: a }) {
3654
3663
  let o = typeof t == "object" && t && !Array.isArray(t) ? t : {}, s = e.fields.names(), c = {
@@ -3660,19 +3669,19 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3660
3669
  padding: 12,
3661
3670
  background: "var(--surface-2)"
3662
3671
  };
3663
- if (n === "display") return s.some((e) => o[e] != null && o[e] !== "") ? /* @__PURE__ */ y("div", {
3672
+ if (n === "display") return s.some((e) => o[e] != null && o[e] !== "") ? /* @__PURE__ */ b("div", {
3664
3673
  style: c,
3665
3674
  children: s.map((t) => {
3666
3675
  let n = e.fields.get(t);
3667
3676
  if (!n) return null;
3668
3677
  let r = o[t];
3669
- return r == null ? null : /* @__PURE__ */ b("div", {
3678
+ return r == null ? null : /* @__PURE__ */ x("div", {
3670
3679
  style: {
3671
3680
  display: "flex",
3672
3681
  alignItems: "baseline",
3673
3682
  gap: 8
3674
3683
  },
3675
- children: [/* @__PURE__ */ y("span", {
3684
+ children: [/* @__PURE__ */ b("span", {
3676
3685
  style: {
3677
3686
  fontSize: 11.5,
3678
3687
  fontWeight: 500,
@@ -3680,13 +3689,13 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3680
3689
  minWidth: 100,
3681
3690
  flexShrink: 0
3682
3691
  },
3683
- children: n.display ? I(n.display.name) : t
3684
- }), /* @__PURE__ */ y("div", {
3692
+ children: n.display ? L(n.display.name) : t
3693
+ }), /* @__PURE__ */ b("div", {
3685
3694
  style: {
3686
3695
  minWidth: 0,
3687
3696
  flex: 1
3688
3697
  },
3689
- children: n.type === "structure" && n.structure ? /* @__PURE__ */ y(Ui, {
3698
+ children: n.type === "structure" && n.structure ? /* @__PURE__ */ b(Ui, {
3690
3699
  field: n,
3691
3700
  fieldName: t,
3692
3701
  value: r,
@@ -3702,7 +3711,7 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3702
3711
  })]
3703
3712
  }, t);
3704
3713
  })
3705
- }) : /* @__PURE__ */ y("span", {
3714
+ }) : /* @__PURE__ */ b("span", {
3706
3715
  style: {
3707
3716
  fontSize: 12.5,
3708
3717
  color: "var(--text-4)"
@@ -3715,22 +3724,22 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3715
3724
  [e]: t
3716
3725
  });
3717
3726
  };
3718
- return /* @__PURE__ */ y("div", {
3727
+ return /* @__PURE__ */ b("div", {
3719
3728
  style: c,
3720
3729
  id: a,
3721
3730
  role: "group",
3722
3731
  children: s.map((t) => {
3723
3732
  let n = e.fields.get(t);
3724
- return n ? /* @__PURE__ */ b("div", {
3733
+ return n ? /* @__PURE__ */ x("div", {
3725
3734
  style: {
3726
3735
  display: "flex",
3727
3736
  flexDirection: "column",
3728
3737
  gap: 2
3729
3738
  },
3730
- children: [/* @__PURE__ */ y(Ce, {
3739
+ children: [/* @__PURE__ */ b(Ce, {
3731
3740
  required: n.required,
3732
- children: n.display ? I(n.display.name) : t
3733
- }), n.type === "structure" && n.structure ? /* @__PURE__ */ y(Ui, {
3741
+ children: n.display ? L(n.display.name) : t
3742
+ }), n.type === "structure" && n.structure ? /* @__PURE__ */ b(Ui, {
3734
3743
  field: n,
3735
3744
  fieldName: t,
3736
3745
  value: o[t],
@@ -3751,19 +3760,19 @@ function Wi({ structDef: e, value: t, mode: n, onChange: r, locale: i, fieldId:
3751
3760
  }
3752
3761
  function Gi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId: o }) {
3753
3762
  let s = Array.isArray(n) ? n : [];
3754
- if (r === "display") return s.length === 0 ? /* @__PURE__ */ y("span", {
3763
+ if (r === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
3755
3764
  style: {
3756
3765
  fontSize: 12.5,
3757
3766
  color: "var(--text-4)"
3758
3767
  },
3759
3768
  children: "—"
3760
- }) : /* @__PURE__ */ y("div", {
3769
+ }) : /* @__PURE__ */ b("div", {
3761
3770
  style: {
3762
3771
  display: "flex",
3763
3772
  flexDirection: "column",
3764
3773
  gap: 8
3765
3774
  },
3766
- children: s.map((t, n) => /* @__PURE__ */ y(Wi, {
3775
+ children: s.map((t, n) => /* @__PURE__ */ b(Wi, {
3767
3776
  structDef: e,
3768
3777
  value: t,
3769
3778
  mode: "display",
@@ -3779,7 +3788,7 @@ function Gi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
3779
3788
  let t = s.filter((t, n) => n !== e);
3780
3789
  i?.(t);
3781
3790
  };
3782
- return /* @__PURE__ */ b("div", {
3791
+ return /* @__PURE__ */ x("div", {
3783
3792
  style: {
3784
3793
  display: "flex",
3785
3794
  flexDirection: "column",
@@ -3787,29 +3796,29 @@ function Gi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
3787
3796
  },
3788
3797
  id: o,
3789
3798
  role: "group",
3790
- children: [s.map((n, r) => /* @__PURE__ */ b("div", {
3799
+ children: [s.map((n, r) => /* @__PURE__ */ x("div", {
3791
3800
  style: { position: "relative" },
3792
- children: [/* @__PURE__ */ y(Wi, {
3801
+ children: [/* @__PURE__ */ b(Wi, {
3793
3802
  structDef: e,
3794
3803
  value: n,
3795
3804
  mode: "edit",
3796
3805
  onChange: c(r),
3797
3806
  locale: a
3798
- }), /* @__PURE__ */ y("div", {
3807
+ }), /* @__PURE__ */ b("div", {
3799
3808
  style: {
3800
3809
  position: "absolute",
3801
3810
  top: 6,
3802
3811
  right: 6
3803
3812
  },
3804
- children: /* @__PURE__ */ y(D, {
3813
+ children: /* @__PURE__ */ b(O, {
3805
3814
  size: 24,
3806
- icon: /* @__PURE__ */ y(t.trash, { size: 12 }),
3815
+ icon: /* @__PURE__ */ b(t.trash, { size: 12 }),
3807
3816
  onClick: u(r),
3808
3817
  title: "Remove"
3809
3818
  })
3810
3819
  })]
3811
- }, r)), /* @__PURE__ */ y("div", { children: /* @__PURE__ */ y(E, {
3812
- icon: /* @__PURE__ */ y(t.plus, { size: 13 }),
3820
+ }, r)), /* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(D, {
3821
+ icon: /* @__PURE__ */ b(t.plus, { size: 13 }),
3813
3822
  onClick: l,
3814
3823
  children: "Add"
3815
3824
  }) })]
@@ -3820,21 +3829,21 @@ function Gi({ structDef: e, value: n, mode: r, onChange: i, locale: a, fieldId:
3820
3829
  var Ki = "[SET]";
3821
3830
  function qi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3822
3831
  let [s, c] = p(""), l = a !== void 0, u = n === Ki || typeof n == "string" && n !== "";
3823
- return r === "display" ? u ? /* @__PURE__ */ y("span", {
3832
+ return r === "display" ? u ? /* @__PURE__ */ b("span", {
3824
3833
  className: "mono",
3825
3834
  style: {
3826
3835
  fontSize: 12.5,
3827
3836
  color: "var(--text-3)"
3828
3837
  },
3829
3838
  children: Ki
3830
- }) : /* @__PURE__ */ y("span", {
3839
+ }) : /* @__PURE__ */ b("span", {
3831
3840
  style: {
3832
3841
  fontSize: 12.5,
3833
3842
  color: "var(--text-4)",
3834
3843
  fontStyle: "italic"
3835
3844
  },
3836
3845
  children: "Not set"
3837
- }) : /* @__PURE__ */ y(Ne, {
3846
+ }) : /* @__PURE__ */ b(Ne, {
3838
3847
  id: o,
3839
3848
  name: t,
3840
3849
  ariaRequired: e.required,
@@ -3850,21 +3859,21 @@ function qi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a,
3850
3859
  var Ji = "[SET]";
3851
3860
  function Yi({ field: e, fieldName: t, value: n, mode: r, onChange: i, record: a, fieldId: o }) {
3852
3861
  let [s, c] = p(""), l = a !== void 0, u = n === Ji || typeof n == "string" && n !== "";
3853
- return r === "display" ? u ? /* @__PURE__ */ y("span", {
3862
+ return r === "display" ? u ? /* @__PURE__ */ b("span", {
3854
3863
  className: "mono",
3855
3864
  style: {
3856
3865
  fontSize: 12.5,
3857
3866
  color: "var(--text-3)"
3858
3867
  },
3859
3868
  children: Ji
3860
- }) : /* @__PURE__ */ y("span", {
3869
+ }) : /* @__PURE__ */ b("span", {
3861
3870
  style: {
3862
3871
  fontSize: 12.5,
3863
3872
  color: "var(--text-4)",
3864
3873
  fontStyle: "italic"
3865
3874
  },
3866
3875
  children: "Not set"
3867
- }) : /* @__PURE__ */ y(Ne, {
3876
+ }) : /* @__PURE__ */ b(Ne, {
3868
3877
  id: o,
3869
3878
  name: t,
3870
3879
  ariaRequired: e.required,
@@ -3882,19 +3891,19 @@ function Xi(e) {
3882
3891
  }
3883
3892
  function Zi({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
3884
3893
  let s = Xi(r), [c, l] = p("");
3885
- if (i === "display") return s.length === 0 ? /* @__PURE__ */ y("span", {
3894
+ if (i === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
3886
3895
  style: {
3887
3896
  fontSize: 12.5,
3888
3897
  color: "var(--text-4)"
3889
3898
  },
3890
3899
  children: "—"
3891
- }) : /* @__PURE__ */ y("div", {
3900
+ }) : /* @__PURE__ */ b("div", {
3892
3901
  style: {
3893
3902
  display: "flex",
3894
3903
  flexWrap: "wrap",
3895
3904
  gap: 4
3896
3905
  },
3897
- children: s.map((e, t) => /* @__PURE__ */ y(M, {
3906
+ children: s.map((e, t) => /* @__PURE__ */ b(N, {
3898
3907
  tone: "slate",
3899
3908
  children: e
3900
3909
  }, t))
@@ -3905,31 +3914,31 @@ function Zi({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
3905
3914
  }, d = (e) => {
3906
3915
  a?.(s.filter((t, n) => n !== e));
3907
3916
  };
3908
- return /* @__PURE__ */ b("div", {
3917
+ return /* @__PURE__ */ x("div", {
3909
3918
  style: {
3910
3919
  display: "flex",
3911
3920
  flexDirection: "column",
3912
3921
  gap: 6
3913
3922
  },
3914
- children: [s.length > 0 && /* @__PURE__ */ y("div", {
3923
+ children: [s.length > 0 && /* @__PURE__ */ b("div", {
3915
3924
  style: {
3916
3925
  display: "flex",
3917
3926
  flexWrap: "wrap",
3918
3927
  gap: 4
3919
3928
  },
3920
- children: s.map((e, t) => /* @__PURE__ */ y(M, {
3929
+ children: s.map((e, t) => /* @__PURE__ */ b(N, {
3921
3930
  tone: "slate",
3922
3931
  onRemove: () => d(t),
3923
3932
  children: e
3924
3933
  }, t))
3925
- }), /* @__PURE__ */ b("div", {
3934
+ }), /* @__PURE__ */ x("div", {
3926
3935
  style: {
3927
3936
  display: "flex",
3928
3937
  gap: 4
3929
3938
  },
3930
- children: [/* @__PURE__ */ y("div", {
3939
+ children: [/* @__PURE__ */ b("div", {
3931
3940
  style: { flex: 1 },
3932
- children: /* @__PURE__ */ y(N, {
3941
+ children: /* @__PURE__ */ b(P, {
3933
3942
  id: o,
3934
3943
  name: n,
3935
3944
  "aria-required": e.required || void 0,
@@ -3940,8 +3949,8 @@ function Zi({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
3940
3949
  },
3941
3950
  placeholder: "Add item…"
3942
3951
  })
3943
- }), /* @__PURE__ */ y(E, {
3944
- icon: /* @__PURE__ */ y(t.plus, { size: 13 }),
3952
+ }), /* @__PURE__ */ b(D, {
3953
+ icon: /* @__PURE__ */ b(t.plus, { size: 13 }),
3945
3954
  onClick: u,
3946
3955
  children: "Add"
3947
3956
  })]
@@ -3955,19 +3964,19 @@ function Qi(e) {
3955
3964
  }
3956
3965
  function $i({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o }) {
3957
3966
  let s = Qi(r), [c, l] = p("");
3958
- if (i === "display") return s.length === 0 ? /* @__PURE__ */ y("span", {
3967
+ if (i === "display") return s.length === 0 ? /* @__PURE__ */ b("span", {
3959
3968
  style: {
3960
3969
  fontSize: 12.5,
3961
3970
  color: "var(--text-4)"
3962
3971
  },
3963
3972
  children: "—"
3964
- }) : /* @__PURE__ */ y("div", {
3973
+ }) : /* @__PURE__ */ b("div", {
3965
3974
  style: {
3966
3975
  display: "flex",
3967
3976
  flexWrap: "wrap",
3968
3977
  gap: 4
3969
3978
  },
3970
- children: s.map((e, t) => /* @__PURE__ */ y(M, {
3979
+ children: s.map((e, t) => /* @__PURE__ */ b(N, {
3971
3980
  tone: "slate",
3972
3981
  children: e
3973
3982
  }, t))
@@ -3980,31 +3989,31 @@ function $i({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
3980
3989
  }, d = (e) => {
3981
3990
  a?.(s.filter((t, n) => n !== e));
3982
3991
  };
3983
- return /* @__PURE__ */ b("div", {
3992
+ return /* @__PURE__ */ x("div", {
3984
3993
  style: {
3985
3994
  display: "flex",
3986
3995
  flexDirection: "column",
3987
3996
  gap: 6
3988
3997
  },
3989
- children: [s.length > 0 && /* @__PURE__ */ y("div", {
3998
+ children: [s.length > 0 && /* @__PURE__ */ b("div", {
3990
3999
  style: {
3991
4000
  display: "flex",
3992
4001
  flexWrap: "wrap",
3993
4002
  gap: 4
3994
4003
  },
3995
- children: s.map((e, t) => /* @__PURE__ */ y(M, {
4004
+ children: s.map((e, t) => /* @__PURE__ */ b(N, {
3996
4005
  tone: "slate",
3997
4006
  onRemove: () => d(t),
3998
4007
  children: e
3999
4008
  }, t))
4000
- }), /* @__PURE__ */ b("div", {
4009
+ }), /* @__PURE__ */ x("div", {
4001
4010
  style: {
4002
4011
  display: "flex",
4003
4012
  gap: 4
4004
4013
  },
4005
- children: [/* @__PURE__ */ y("div", {
4014
+ children: [/* @__PURE__ */ b("div", {
4006
4015
  style: { flex: 1 },
4007
- children: /* @__PURE__ */ y(N, {
4016
+ children: /* @__PURE__ */ b(P, {
4008
4017
  id: o,
4009
4018
  name: n,
4010
4019
  "aria-required": e.required || void 0,
@@ -4016,8 +4025,8 @@ function $i({ field: e, fieldName: n, value: r, mode: i, onChange: a, fieldId: o
4016
4025
  },
4017
4026
  placeholder: "Add number…"
4018
4027
  })
4019
- }), /* @__PURE__ */ y(E, {
4020
- icon: /* @__PURE__ */ y(t.plus, { size: 13 }),
4028
+ }), /* @__PURE__ */ b(D, {
4029
+ icon: /* @__PURE__ */ b(t.plus, { size: 13 }),
4021
4030
  onClick: u,
4022
4031
  children: "Add"
4023
4032
  })]
@@ -4071,7 +4080,7 @@ function la(e) {
4071
4080
  }
4072
4081
  //#endregion
4073
4082
  //#region src/components/file-widgets/upload.ts
4074
- var Z = class extends Error {
4083
+ var Q = class extends Error {
4075
4084
  code;
4076
4085
  status;
4077
4086
  constructor(e, t, n) {
@@ -4083,7 +4092,7 @@ async function ua(e) {
4083
4092
  try {
4084
4093
  return await da(e, t ? await kt() : null);
4085
4094
  } catch (n) {
4086
- if (!(n instanceof Z && n.status === 401 && (n.code === "TOKEN_REFRESH_NEEDED" || n.code === "UNAUTHORIZED"))) throw n;
4095
+ if (!(n instanceof Q && n.status === 401 && (n.code === "TOKEN_REFRESH_NEEDED" || n.code === "UNAUTHORIZED"))) throw n;
4087
4096
  let r = null;
4088
4097
  try {
4089
4098
  t ? (Ot(), r = await kt()) : await hn();
@@ -4093,7 +4102,7 @@ async function ua(e) {
4093
4102
  try {
4094
4103
  return await da(e, r);
4095
4104
  } catch (e) {
4096
- throw e instanceof Z && e.status === 401 && _n()(), e;
4105
+ throw e instanceof Q && e.status === 401 && _n()(), e;
4097
4106
  }
4098
4107
  }
4099
4108
  }
@@ -4117,21 +4126,21 @@ function da(e, t) {
4117
4126
  if (l.status >= 200 && l.status < 300) {
4118
4127
  let t = pa(n);
4119
4128
  if (!t || !t.id) {
4120
- c(new Z(l.status, "BAD_RESPONSE", "Upload returned no file id"));
4129
+ c(new Q(l.status, "BAD_RESPONSE", "Upload returned no file id"));
4121
4130
  return;
4122
4131
  }
4123
4132
  e(t);
4124
4133
  return;
4125
4134
  }
4126
4135
  let r = n, i = r?.error?.code ?? "UPLOAD_FAILED", a = r?.error?.message ?? `Upload failed (${l.status})`;
4127
- c(new Z(l.status, i, a));
4136
+ c(new Q(l.status, i, a));
4128
4137
  }, l.onerror = () => {
4129
- c(new Z(0, "NETWORK_ERROR", "Network error during upload"));
4138
+ c(new Q(0, "NETWORK_ERROR", "Network error during upload"));
4130
4139
  }, l.onabort = () => {
4131
- c(new Z(0, "ABORTED", "Upload aborted"));
4140
+ c(new Q(0, "ABORTED", "Upload aborted"));
4132
4141
  }, s) {
4133
4142
  if (s.aborted) {
4134
- l.abort(), c(new Z(0, "ABORTED", "Upload aborted"));
4143
+ l.abort(), c(new Q(0, "ABORTED", "Upload aborted"));
4135
4144
  return;
4136
4145
  }
4137
4146
  s.addEventListener("abort", () => l.abort(), { once: !0 });
@@ -4173,7 +4182,7 @@ function va(e) {
4173
4182
  return typeof e == "boolean" ? e : void 0;
4174
4183
  }
4175
4184
  async function ya(e) {
4176
- await q("files.discard", { file_id: e });
4185
+ await J("files.discard", { file_id: e });
4177
4186
  }
4178
4187
  function ba(e, t, n) {
4179
4188
  if (n && e.size > n) return {
@@ -4237,7 +4246,7 @@ function wa({ children: e }) {
4237
4246
  t.current.clear(), await Promise.allSettled(e.map((e) => Promise.resolve(e.discard())));
4238
4247
  }
4239
4248
  }), []);
4240
- return /* @__PURE__ */ y(Ca.Provider, {
4249
+ return /* @__PURE__ */ b(Ca.Provider, {
4241
4250
  value: n,
4242
4251
  children: e
4243
4252
  });
@@ -4266,7 +4275,7 @@ function Ea() {
4266
4275
  //#endregion
4267
4276
  //#region src/components/fields/RichTextField.tsx
4268
4277
  function Da(e) {
4269
- let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: u } = e, m = f(null), h = f(null), g = f(/* @__PURE__ */ new Map()), _ = f(/* @__PURE__ */ new Set()), [v, x] = p(0), [S, C] = p(null), { register: w, unregister: T } = Ea(), D = c?.$files?.[i], O = d(() => na(a, D), [D, a]), k = O.markdown, A = n.files?.accepts, ee = n.files?.max_size_bytes, j = (e, t = O.files) => {
4278
+ let { field: n, entityCode: r, fieldName: i, value: a, mode: o, onChange: s, record: c, compact: l, fieldId: u } = e, m = f(null), h = f(null), g = f(/* @__PURE__ */ new Map()), _ = f(/* @__PURE__ */ new Set()), [v, y] = p(0), [S, C] = p(null), { register: w, unregister: T } = Ea(), E = c?.$files?.[i], O = d(() => na(a, E), [E, a]), k = O.markdown, A = n.files?.accepts, j = n.files?.max_size_bytes, M = (e, t = O.files) => {
4270
4279
  let n = new Set(oa(e)), r = [];
4271
4280
  for (let e of _.current) n.has(e) || r.push(e);
4272
4281
  if (r.length > 0) {
@@ -4285,26 +4294,26 @@ function Da(e) {
4285
4294
  markdown: e,
4286
4295
  files: t
4287
4296
  });
4288
- }, te = (e, t, n) => {
4297
+ }, ee = (e, t, n) => {
4289
4298
  let r = m.current, i = r?.selectionStart ?? e.markdown.length, a = r?.selectionEnd ?? e.markdown.length, o = `${e.markdown.slice(0, i)}${t}${e.markdown.slice(a)}`, s = n ? ra(e, n).files : e.files;
4290
- j(o, s), requestAnimationFrame(() => {
4299
+ M(o, s), requestAnimationFrame(() => {
4291
4300
  if (!r) return;
4292
4301
  let e = i + t.length;
4293
4302
  r.focus(), r.setSelectionRange(e, e);
4294
4303
  });
4295
- }, ne = async (e) => {
4304
+ }, te = async (e) => {
4296
4305
  if (!r || !n.files) return;
4297
4306
  let t = Array.from(e);
4298
4307
  if (t.length === 0) return;
4299
- C(null), x((e) => e + t.length);
4308
+ C(null), y((e) => e + t.length);
4300
4309
  let a = {
4301
4310
  markdown: k,
4302
4311
  files: O.files
4303
4312
  };
4304
4313
  for (let e of t) {
4305
- let n = ba(e, A, ee);
4314
+ let n = ba(e, A, j);
4306
4315
  if (n) {
4307
- C(n.message), x((e) => e - 1);
4316
+ C(n.message), y((e) => e - 1);
4308
4317
  continue;
4309
4318
  }
4310
4319
  try {
@@ -4317,7 +4326,7 @@ function Da(e) {
4317
4326
  let s = ka(n, o);
4318
4327
  if (w(n.id, () => ya(n.id)), _.current.add(n.id), t.length === 1) {
4319
4328
  let e = Oa(a.markdown, ca(s));
4320
- te(a, e, s), a = ra({
4329
+ ee(a, e, s), a = ra({
4321
4330
  markdown: `${a.markdown}${e}`,
4322
4331
  files: a.files
4323
4332
  }, s);
@@ -4326,38 +4335,38 @@ function Da(e) {
4326
4335
  a = ra({
4327
4336
  markdown: `${a.markdown}${e}`,
4328
4337
  files: a.files
4329
- }, s), j(a.markdown, a.files);
4338
+ }, s), M(a.markdown, a.files);
4330
4339
  }
4331
4340
  } catch (e) {
4332
- C(e instanceof Z ? e.message : "Upload failed");
4341
+ C(e instanceof Q ? e.message : "Upload failed");
4333
4342
  } finally {
4334
- x((e) => e - 1);
4343
+ y((e) => e - 1);
4335
4344
  }
4336
4345
  }
4337
4346
  };
4338
- return o === "display" ? k ? /* @__PURE__ */ y(Jr, {
4347
+ return o === "display" ? k ? /* @__PURE__ */ b(Jr, {
4339
4348
  content: k,
4340
4349
  files: O.files
4341
- }) : /* @__PURE__ */ y("span", {
4350
+ }) : /* @__PURE__ */ b("span", {
4342
4351
  style: {
4343
4352
  fontSize: 12.5,
4344
4353
  color: "var(--text-4)"
4345
4354
  },
4346
4355
  children: "—"
4347
- }) : l ? /* @__PURE__ */ y(N, {
4356
+ }) : l ? /* @__PURE__ */ b(P, {
4348
4357
  id: u,
4349
4358
  name: i,
4350
4359
  "aria-required": n.required || void 0,
4351
4360
  value: k,
4352
- onChange: (e) => j(e)
4353
- }) : /* @__PURE__ */ b("div", {
4361
+ onChange: (e) => M(e)
4362
+ }) : /* @__PURE__ */ x("div", {
4354
4363
  style: {
4355
4364
  display: "flex",
4356
4365
  flexDirection: "column",
4357
4366
  gap: 10
4358
4367
  },
4359
4368
  children: [
4360
- /* @__PURE__ */ b("div", {
4369
+ /* @__PURE__ */ x("div", {
4361
4370
  style: {
4362
4371
  display: "flex",
4363
4372
  alignItems: "center",
@@ -4365,22 +4374,22 @@ function Da(e) {
4365
4374
  flexWrap: "wrap"
4366
4375
  },
4367
4376
  children: [
4368
- /* @__PURE__ */ y(E, {
4377
+ /* @__PURE__ */ b(D, {
4369
4378
  kind: "ghost",
4370
4379
  size: "xs",
4371
- icon: y(v > 0 ? Se : t.plus, { size: 12 }),
4380
+ icon: b(v > 0 ? Se : t.plus, { size: 12 }),
4372
4381
  onClick: () => h.current?.click(),
4373
4382
  disabled: !r || !n.files || v > 0,
4374
4383
  children: v > 0 ? "Uploading…" : "Insert file"
4375
4384
  }),
4376
- /* @__PURE__ */ y("span", {
4385
+ /* @__PURE__ */ b("span", {
4377
4386
  style: {
4378
4387
  fontSize: 11.5,
4379
4388
  color: "var(--text-3)"
4380
4389
  },
4381
4390
  children: "Stores markdown with inline declarion://file/<id> refs."
4382
4391
  }),
4383
- !r && /* @__PURE__ */ y("span", {
4392
+ !r && /* @__PURE__ */ b("span", {
4384
4393
  style: {
4385
4394
  fontSize: 11.5,
4386
4395
  color: "var(--warn)"
@@ -4389,30 +4398,30 @@ function Da(e) {
4389
4398
  })
4390
4399
  ]
4391
4400
  }),
4392
- /* @__PURE__ */ y("input", {
4401
+ /* @__PURE__ */ b("input", {
4393
4402
  ref: h,
4394
4403
  type: "file",
4395
4404
  hidden: !0,
4396
4405
  accept: A?.join(","),
4397
4406
  multiple: !0,
4398
4407
  onChange: (e) => {
4399
- e.target.files && ne(e.target.files), e.target.value = "";
4408
+ e.target.files && te(e.target.files), e.target.value = "";
4400
4409
  }
4401
4410
  }),
4402
- /* @__PURE__ */ y("textarea", {
4411
+ /* @__PURE__ */ b("textarea", {
4403
4412
  ref: m,
4404
4413
  id: u,
4405
4414
  name: i,
4406
4415
  "aria-required": n.required || void 0,
4407
4416
  value: k,
4408
- onChange: (e) => j(e.target.value),
4417
+ onChange: (e) => M(e.target.value),
4409
4418
  onPaste: (e) => {
4410
4419
  let t = Array.from(e.clipboardData.files ?? []).filter((e) => e.size > 0);
4411
- t.length !== 0 && (e.preventDefault(), ne(t));
4420
+ t.length !== 0 && (e.preventDefault(), te(t));
4412
4421
  },
4413
4422
  onDrop: (e) => {
4414
4423
  let t = Array.from(e.dataTransfer.files ?? []).filter((e) => e.size > 0);
4415
- t.length !== 0 && (e.preventDefault(), ne(t));
4424
+ t.length !== 0 && (e.preventDefault(), te(t));
4416
4425
  },
4417
4426
  onDragOver: (e) => e.preventDefault(),
4418
4427
  rows: 12,
@@ -4430,31 +4439,31 @@ function Da(e) {
4430
4439
  color: "var(--text)"
4431
4440
  }
4432
4441
  }),
4433
- S && /* @__PURE__ */ y("div", {
4442
+ S && /* @__PURE__ */ b("div", {
4434
4443
  style: {
4435
4444
  fontSize: 12,
4436
4445
  color: "var(--danger)"
4437
4446
  },
4438
4447
  children: S
4439
4448
  }),
4440
- /* @__PURE__ */ b("div", {
4449
+ /* @__PURE__ */ x("div", {
4441
4450
  style: {
4442
4451
  border: "1px solid var(--border)",
4443
4452
  borderRadius: 8,
4444
4453
  padding: 12,
4445
4454
  background: "var(--surface-2)"
4446
4455
  },
4447
- children: [/* @__PURE__ */ y("div", {
4456
+ children: [/* @__PURE__ */ b("div", {
4448
4457
  style: {
4449
4458
  fontSize: 11.5,
4450
4459
  color: "var(--text-3)",
4451
4460
  marginBottom: 8
4452
4461
  },
4453
4462
  children: "Preview"
4454
- }), k ? /* @__PURE__ */ y(Jr, {
4463
+ }), k ? /* @__PURE__ */ b(Jr, {
4455
4464
  content: k,
4456
4465
  files: O.files
4457
- }) : /* @__PURE__ */ y("span", {
4466
+ }) : /* @__PURE__ */ b("span", {
4458
4467
  style: {
4459
4468
  fontSize: 12.5,
4460
4469
  color: "var(--text-4)"
@@ -4483,12 +4492,12 @@ function ka(e, t) {
4483
4492
  }
4484
4493
  //#endregion
4485
4494
  //#region src/components/fields/cells/factories/text.ts
4486
- var Aa = () => (e) => e == null || e === "" ? "—" : F(e), ja = (e) => {
4495
+ var Aa = () => (e) => e == null || e === "" ? "—" : I(e), ja = (e) => {
4487
4496
  let { field: t, fieldName: n, locale: r = "en" } = e, i = Ma(t, n, r);
4488
4497
  return (e) => {
4489
4498
  if (e == null) return "—";
4490
4499
  let t = !!e;
4491
- return /* @__PURE__ */ y(O, {
4500
+ return /* @__PURE__ */ b(k, {
4492
4501
  tone: t ? "emerald" : "slate",
4493
4502
  size: "xs",
4494
4503
  children: t ? i.trueLabel : i.falseLabel
@@ -4497,10 +4506,10 @@ var Aa = () => (e) => e == null || e === "" ? "—" : F(e), ja = (e) => {
4497
4506
  };
4498
4507
  function Ma(e, t, n) {
4499
4508
  if (e.display?.bool_labels) return {
4500
- trueLabel: I(e.display.bool_labels.true, n) || "Yes",
4501
- falseLabel: I(e.display.bool_labels.false, n) || "No"
4509
+ trueLabel: L(e.display.bool_labels.true, n) || "Yes",
4510
+ falseLabel: L(e.display.bool_labels.false, n) || "No"
4502
4511
  };
4503
- let r = e.display?.name ? I(e.display.name, n) : "";
4512
+ let r = e.display?.name ? L(e.display.name, n) : "";
4504
4513
  if (r.startsWith("Is ")) {
4505
4514
  let e = r.slice(3).trim();
4506
4515
  return {
@@ -4556,10 +4565,10 @@ var Ia = (e) => {
4556
4565
  let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
4557
4566
  if (t.values) for (let e of t.values) r.set(e.code, {
4558
4567
  tone: Fa(e.color),
4559
- label: I(e.name, n) || e.code
4568
+ label: L(e.name, n) || e.code
4560
4569
  });
4561
4570
  if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) {
4562
- let t = r.get(e), a = i.color ? Fa(i.color) : t?.tone ?? "slate", o = (i.label ? I(i.label, n) : "") || t?.label || e;
4571
+ let t = r.get(e), a = i.color ? Fa(i.color) : t?.tone ?? "slate", o = (i.label ? L(i.label, n) : "") || t?.label || e;
4563
4572
  r.set(e, {
4564
4573
  tone: a,
4565
4574
  label: o
@@ -4567,8 +4576,8 @@ var Ia = (e) => {
4567
4576
  }
4568
4577
  return (e) => {
4569
4578
  if (e == null || e === "") return "—";
4570
- let t = F(e), n = r.get(t);
4571
- return /* @__PURE__ */ y(O, {
4579
+ let t = I(e), n = r.get(t);
4580
+ return /* @__PURE__ */ b(k, {
4572
4581
  tone: n?.tone ?? "slate",
4573
4582
  size: "xs",
4574
4583
  children: n?.label ?? t
@@ -4591,12 +4600,12 @@ var za = (e) => {
4591
4600
  let { entity: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
4592
4601
  if (t?.status_groups) for (let e of Object.values(t.status_groups)) for (let t of e.statuses) r.set(t.code, {
4593
4602
  tone: Ra(t.color),
4594
- label: I(t.name, n) || t.code
4603
+ label: L(t.name, n) || t.code
4595
4604
  });
4596
4605
  return (e) => {
4597
4606
  if (e == null || e === "") return "—";
4598
- let t = F(e), n = r.get(t);
4599
- return /* @__PURE__ */ y(O, {
4607
+ let t = I(e), n = r.get(t);
4608
+ return /* @__PURE__ */ b(k, {
4600
4609
  tone: n?.tone ?? "slate",
4601
4610
  size: "xs",
4602
4611
  children: n?.label ?? t
@@ -4618,10 +4627,10 @@ function Va(e) {
4618
4627
  var Ha = (e) => {
4619
4628
  let { field: t, locale: n = "en" } = e, r = /* @__PURE__ */ new Map();
4620
4629
  if (t.display?.value_map) for (let [e, i] of Object.entries(t.display.value_map)) r.set(e, {
4621
- label: i.label && I(i.label, n) || e,
4630
+ label: i.label && L(i.label, n) || e,
4622
4631
  tone: Va(i.color)
4623
4632
  });
4624
- return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ y("span", {
4633
+ return (e) => !Array.isArray(e) || e.length === 0 ? "—" : /* @__PURE__ */ b("span", {
4625
4634
  style: {
4626
4635
  display: "inline-flex",
4627
4636
  gap: 4,
@@ -4629,41 +4638,41 @@ var Ha = (e) => {
4629
4638
  },
4630
4639
  children: e.map((e, t) => {
4631
4640
  let n = String(e), i = r.get(n);
4632
- return i?.tone ? /* @__PURE__ */ y(O, {
4641
+ return i?.tone ? /* @__PURE__ */ b(k, {
4633
4642
  tone: i.tone,
4634
4643
  size: "xs",
4635
4644
  children: i.label
4636
- }, `${n}-${t}`) : /* @__PURE__ */ y(M, { children: i?.label ?? n }, `${n}-${t}`);
4645
+ }, `${n}-${t}`) : /* @__PURE__ */ b(N, { children: i?.label ?? n }, `${n}-${t}`);
4637
4646
  })
4638
4647
  });
4639
4648
  }, Ua = () => (e) => {
4640
4649
  if (e == null || e === "") return "—";
4641
- let { text: t, absolute: n } = mi(typeof e == "string" ? e : F(e));
4642
- return /* @__PURE__ */ y("span", {
4650
+ let { text: t, absolute: n } = mi(typeof e == "string" ? e : I(e));
4651
+ return /* @__PURE__ */ b("span", {
4643
4652
  title: n,
4644
4653
  children: t
4645
4654
  });
4646
- }, Wa = () => (e) => e == null || e === "" ? "—" : pi(typeof e == "string" ? e : F(e)), Ga = 60 * 1e3, Ka = 300 * 1e3, qa = () => (e) => {
4655
+ }, Wa = () => (e) => e == null || e === "" ? "—" : pi(typeof e == "string" ? e : I(e)), Ga = 60 * 1e3, Ka = 300 * 1e3, qa = () => (e) => {
4647
4656
  if (e == null || e === "") return "—";
4648
- let t = typeof e == "string" ? e : F(e), n = new Date(t);
4657
+ let t = typeof e == "string" ? e : I(e), n = new Date(t);
4649
4658
  if (isNaN(n.getTime())) return t;
4650
4659
  let r = pi(t), i = Date.now() - n.getTime();
4651
- if (i <= 0) return /* @__PURE__ */ b("span", {
4660
+ if (i <= 0) return /* @__PURE__ */ x("span", {
4652
4661
  title: r,
4653
- children: ["in ", C(n, /* @__PURE__ */ new Date(), { addSuffix: !1 })]
4662
+ children: ["in ", w(n, /* @__PURE__ */ new Date(), { addSuffix: !1 })]
4654
4663
  });
4655
- if (i <= Ga) return /* @__PURE__ */ y("span", {
4664
+ if (i <= Ga) return /* @__PURE__ */ b("span", {
4656
4665
  title: r,
4657
- children: /* @__PURE__ */ y(O, {
4666
+ children: /* @__PURE__ */ b(k, {
4658
4667
  tone: "slate",
4659
4668
  size: "xs",
4660
4669
  children: "due"
4661
4670
  })
4662
4671
  });
4663
- let a = C(n, /* @__PURE__ */ new Date(), { addSuffix: !1 });
4664
- return /* @__PURE__ */ y("span", {
4672
+ let a = w(n, /* @__PURE__ */ new Date(), { addSuffix: !1 });
4673
+ return /* @__PURE__ */ b("span", {
4665
4674
  title: r,
4666
- children: /* @__PURE__ */ b(O, {
4675
+ children: /* @__PURE__ */ x(k, {
4667
4676
  tone: i <= Ka ? "amber" : "rose",
4668
4677
  size: "xs",
4669
4678
  children: ["overdue ", a]
@@ -4674,7 +4683,7 @@ var Ha = (e) => {
4674
4683
  return (e, t = {}) => {
4675
4684
  if (e == null || e === "") return "—";
4676
4685
  let c = typeof e == "number" ? e : Number(e);
4677
- if (!Number.isFinite(c)) return F(e);
4686
+ if (!Number.isFinite(c)) return I(e);
4678
4687
  let l = i ? t[i] : void 0, u = typeof l == "string" && l !== "" ? l : r, d = `${n}:${u}:${a}:${o}`, f = s.get(d);
4679
4688
  return f || (f = new Intl.NumberFormat(n, {
4680
4689
  style: "currency",
@@ -4703,19 +4712,19 @@ var Za = (e) => {
4703
4712
  let { field: t, entities: r, screens: i, refs: a, surface: o } = e, s = t.ref?.entity, c = s ? r?.[s] : void 0, l = typeof a == "function" ? a : () => a, u = o === "detail", d = c?.display?.icon, f = t.display?.ref_display_field || "$display", p = c?.detail_screen, m = (p ? i?.[p] : void 0)?.route;
4704
4713
  return (e, t) => {
4705
4714
  if (e == null || e === "") return "—";
4706
- let r = F(e), i = Qa(r, s, l(), f), a = m ? m.replace(":id", encodeURIComponent(r)) : void 0;
4715
+ let r = I(e), i = Qa(r, s, l(), f), a = m ? m.replace(":id", encodeURIComponent(r)) : void 0;
4707
4716
  if (u) {
4708
- let e = /* @__PURE__ */ b(v, { children: [d && /* @__PURE__ */ y("span", {
4717
+ let e = /* @__PURE__ */ x(y, { children: [d && /* @__PURE__ */ b("span", {
4709
4718
  style: {
4710
4719
  color: "var(--text-3)",
4711
4720
  display: "flex",
4712
4721
  flexShrink: 0
4713
4722
  },
4714
- children: /* @__PURE__ */ y(n, {
4723
+ children: /* @__PURE__ */ b(n, {
4715
4724
  name: d,
4716
4725
  size: 13
4717
4726
  })
4718
- }), /* @__PURE__ */ y("span", {
4727
+ }), /* @__PURE__ */ b("span", {
4719
4728
  style: {
4720
4729
  overflow: "hidden",
4721
4730
  textOverflow: "ellipsis",
@@ -4723,17 +4732,17 @@ var Za = (e) => {
4723
4732
  },
4724
4733
  children: i
4725
4734
  })] });
4726
- return a ? /* @__PURE__ */ y("a", {
4735
+ return a ? /* @__PURE__ */ b("a", {
4727
4736
  href: a,
4728
4737
  rel: "noopener noreferrer",
4729
4738
  className: "detail-ref-chip",
4730
4739
  children: e
4731
- }) : /* @__PURE__ */ y("span", {
4740
+ }) : /* @__PURE__ */ b("span", {
4732
4741
  className: "detail-ref-chip",
4733
4742
  children: e
4734
4743
  });
4735
4744
  }
4736
- return a ? /* @__PURE__ */ y("a", {
4745
+ return a ? /* @__PURE__ */ b("a", {
4737
4746
  href: a,
4738
4747
  rel: "noopener noreferrer",
4739
4748
  style: {
@@ -4747,7 +4756,7 @@ var Za = (e) => {
4747
4756
  };
4748
4757
  function Qa(e, t, n, r) {
4749
4758
  let i = t && n ? n[t]?.[e] : void 0;
4750
- return i ? L(i, r, e) : e;
4759
+ return i ? R(i, r, e) : e;
4751
4760
  }
4752
4761
  //#endregion
4753
4762
  //#region src/components/fields/cells/factories/url-helpers.ts
@@ -4800,7 +4809,7 @@ function oo(e) {
4800
4809
  //#endregion
4801
4810
  //#region src/components/fields/cells/factories/host-icons.tsx
4802
4811
  function so(e, t = "0 0 24 24") {
4803
- return (n) => /* @__PURE__ */ y("svg", {
4812
+ return (n) => /* @__PURE__ */ b("svg", {
4804
4813
  width: 16,
4805
4814
  height: 16,
4806
4815
  viewBox: t,
@@ -4815,17 +4824,17 @@ function so(e, t = "0 0 24 24") {
4815
4824
  children: e
4816
4825
  });
4817
4826
  }
4818
- var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
4827
+ var co = so(/* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("circle", {
4819
4828
  cx: "12",
4820
4829
  cy: "12",
4821
4830
  r: "9"
4822
- }), /* @__PURE__ */ y("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), lo = () => /* @__PURE__ */ y(e, {
4831
+ }), /* @__PURE__ */ b("path", { d: "M3 12h18M12 3c3 3 3 15 0 18-3-3-3-15 0-18" })] })), lo = () => /* @__PURE__ */ b(e, {
4823
4832
  size: 16,
4824
4833
  style: {
4825
4834
  flexShrink: 0,
4826
4835
  color: "#0A66C2"
4827
4836
  }
4828
- }), uo = (e) => /* @__PURE__ */ y("svg", {
4837
+ }), uo = (e) => /* @__PURE__ */ b("svg", {
4829
4838
  width: 16,
4830
4839
  height: 16,
4831
4840
  viewBox: "0 0 24 24",
@@ -4833,8 +4842,8 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
4833
4842
  "aria-hidden": "true",
4834
4843
  style: { flexShrink: 0 },
4835
4844
  ...e,
4836
- children: /* @__PURE__ */ y("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" })
4837
- }), fo = (e) => /* @__PURE__ */ y("svg", {
4845
+ children: /* @__PURE__ */ b("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" })
4846
+ }), fo = (e) => /* @__PURE__ */ b("svg", {
4838
4847
  width: 16,
4839
4848
  height: 16,
4840
4849
  viewBox: "0 0 24 24",
@@ -4842,8 +4851,8 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
4842
4851
  "aria-hidden": "true",
4843
4852
  style: { flexShrink: 0 },
4844
4853
  ...e,
4845
- children: /* @__PURE__ */ y("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" })
4846
- }), po = (e) => /* @__PURE__ */ y("svg", {
4854
+ children: /* @__PURE__ */ b("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" })
4855
+ }), po = (e) => /* @__PURE__ */ b("svg", {
4847
4856
  width: 16,
4848
4857
  height: 16,
4849
4858
  viewBox: "0 0 24 24",
@@ -4851,8 +4860,8 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
4851
4860
  "aria-hidden": "true",
4852
4861
  style: { flexShrink: 0 },
4853
4862
  ...e,
4854
- children: /* @__PURE__ */ y("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" })
4855
- }), mo = (e) => /* @__PURE__ */ y("svg", {
4863
+ children: /* @__PURE__ */ b("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" })
4864
+ }), mo = (e) => /* @__PURE__ */ b("svg", {
4856
4865
  width: 16,
4857
4866
  height: 16,
4858
4867
  viewBox: "0 0 24 24",
@@ -4860,8 +4869,8 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
4860
4869
  "aria-hidden": "true",
4861
4870
  style: { flexShrink: 0 },
4862
4871
  ...e,
4863
- children: /* @__PURE__ */ y("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" })
4864
- }), ho = (e) => /* @__PURE__ */ b("svg", {
4872
+ children: /* @__PURE__ */ b("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" })
4873
+ }), ho = (e) => /* @__PURE__ */ x("svg", {
4865
4874
  width: 16,
4866
4875
  height: 16,
4867
4876
  viewBox: "0 0 24 24",
@@ -4869,24 +4878,24 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
4869
4878
  style: { flexShrink: 0 },
4870
4879
  ...e,
4871
4880
  children: [
4872
- /* @__PURE__ */ y("path", {
4881
+ /* @__PURE__ */ b("path", {
4873
4882
  fill: "#E01E5A",
4874
4883
  d: "M5.04 15.12a2.52 2.52 0 1 1-2.52-2.52h2.52v2.52zm1.27 0a2.52 2.52 0 1 1 5.04 0v6.32a2.52 2.52 0 1 1-5.04 0v-6.32z"
4875
4884
  }),
4876
- /* @__PURE__ */ y("path", {
4885
+ /* @__PURE__ */ b("path", {
4877
4886
  fill: "#36C5F0",
4878
4887
  d: "M8.83 5.04a2.52 2.52 0 1 1 2.52-2.52v2.52H8.83zm0 1.27a2.52 2.52 0 1 1 0 5.04H2.52a2.52 2.52 0 1 1 0-5.04h6.31z"
4879
4888
  }),
4880
- /* @__PURE__ */ y("path", {
4889
+ /* @__PURE__ */ b("path", {
4881
4890
  fill: "#2EB67D",
4882
4891
  d: "M18.96 8.83a2.52 2.52 0 1 1 2.52 2.52h-2.52V8.83zm-1.27 0a2.52 2.52 0 1 1-5.04 0V2.52a2.52 2.52 0 1 1 5.04 0v6.31z"
4883
4892
  }),
4884
- /* @__PURE__ */ y("path", {
4893
+ /* @__PURE__ */ b("path", {
4885
4894
  fill: "#ECB22E",
4886
4895
  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"
4887
4896
  })
4888
4897
  ]
4889
- }), go = (e) => /* @__PURE__ */ y("svg", {
4898
+ }), go = (e) => /* @__PURE__ */ b("svg", {
4890
4899
  width: 16,
4891
4900
  height: 16,
4892
4901
  viewBox: "0 0 24 24",
@@ -4894,7 +4903,7 @@ var co = so(/* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("circle", {
4894
4903
  "aria-hidden": "true",
4895
4904
  style: { flexShrink: 0 },
4896
4905
  ...e,
4897
- children: /* @__PURE__ */ y("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" })
4906
+ children: /* @__PURE__ */ b("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" })
4898
4907
  }), _o = {
4899
4908
  "linkedin.com": lo,
4900
4909
  "github.com": uo,
@@ -4919,15 +4928,15 @@ var yo = {
4919
4928
  };
4920
4929
  function bo({ domain: e, source: t }) {
4921
4930
  let n = e ? e.toLowerCase() : "", r = n ? _o[n] : void 0;
4922
- if (r) return /* @__PURE__ */ y(r, {});
4931
+ if (r) return /* @__PURE__ */ b(r, {});
4923
4932
  let i = vo(n, t);
4924
- return i ? /* @__PURE__ */ y(xo, { src: i }) : /* @__PURE__ */ y(co, {});
4933
+ return i ? /* @__PURE__ */ b(xo, { src: i }) : /* @__PURE__ */ b(co, {});
4925
4934
  }
4926
4935
  function xo({ src: e }) {
4927
4936
  let [t, n] = p(!1);
4928
4937
  return l(() => {
4929
4938
  n(!1);
4930
- }, [e]), t ? /* @__PURE__ */ y(co, {}) : /* @__PURE__ */ y("img", {
4939
+ }, [e]), t ? /* @__PURE__ */ b(co, {}) : /* @__PURE__ */ b("img", {
4931
4940
  src: e,
4932
4941
  alt: "",
4933
4942
  width: 16,
@@ -4939,7 +4948,7 @@ function xo({ src: e }) {
4939
4948
  onError: () => n(!0)
4940
4949
  });
4941
4950
  }
4942
- var Q = /* @__PURE__ */ y("span", {
4951
+ var $ = /* @__PURE__ */ b("span", {
4943
4952
  style: {
4944
4953
  fontSize: 12.5,
4945
4954
  color: "var(--text-4)"
@@ -4955,15 +4964,15 @@ var Q = /* @__PURE__ */ y("span", {
4955
4964
  }, Co = { fontSize: 12.5 }, wo = (e) => {
4956
4965
  let n = e.field.display?.favicon_source ?? "google";
4957
4966
  return (e) => {
4958
- let r = e == null ? "" : F(e);
4959
- if (!r) return Q;
4967
+ let r = e == null ? "" : I(e);
4968
+ if (!r) return $;
4960
4969
  let i = ro(r);
4961
- if (i == null || !oo(i)) return /* @__PURE__ */ y("span", {
4970
+ if (i == null || !oo(i)) return /* @__PURE__ */ b("span", {
4962
4971
  style: Co,
4963
4972
  children: r
4964
4973
  });
4965
4974
  let a = io(i), o = ao(i, a ?? "") ?? a ?? r;
4966
- return /* @__PURE__ */ b("a", {
4975
+ return /* @__PURE__ */ x("a", {
4967
4976
  href: i,
4968
4977
  target: "_blank",
4969
4978
  rel: "noopener noreferrer",
@@ -4971,12 +4980,12 @@ var Q = /* @__PURE__ */ y("span", {
4971
4980
  className: "mono",
4972
4981
  style: So,
4973
4982
  children: [
4974
- /* @__PURE__ */ y(bo, {
4983
+ /* @__PURE__ */ b(bo, {
4975
4984
  domain: a,
4976
4985
  source: n
4977
4986
  }),
4978
4987
  o,
4979
- /* @__PURE__ */ y(t.external, { size: 11 })
4988
+ /* @__PURE__ */ b(t.external, { size: 11 })
4980
4989
  ]
4981
4990
  });
4982
4991
  };
@@ -4985,27 +4994,27 @@ var Q = /* @__PURE__ */ y("span", {
4985
4994
  color: "var(--accent)",
4986
4995
  textDecoration: "none"
4987
4996
  }, Eo = () => (e) => {
4988
- let t = e == null ? "" : F(e);
4989
- return t ? /* @__PURE__ */ y("a", {
4997
+ let t = e == null ? "" : I(e);
4998
+ return t ? /* @__PURE__ */ b("a", {
4990
4999
  href: `mailto:${t}`,
4991
5000
  className: "mono",
4992
5001
  style: To,
4993
5002
  children: t
4994
- }) : Q;
5003
+ }) : $;
4995
5004
  }, Do = {
4996
5005
  fontSize: 12.5,
4997
5006
  color: "var(--accent)",
4998
5007
  textDecoration: "none"
4999
5008
  }, Oo = { fontSize: 12.5 }, ko = /^[+()\-.\s\d]+$/, Ao = () => (e) => {
5000
- let t = e == null ? "" : F(e);
5001
- if (!t) return Q;
5009
+ let t = e == null ? "" : I(e);
5010
+ if (!t) return $;
5002
5011
  let n = t.trim();
5003
- return ko.test(n) ? /* @__PURE__ */ y("a", {
5012
+ return ko.test(n) ? /* @__PURE__ */ b("a", {
5004
5013
  href: `tel:${n.replace(/\s+/g, "")}`,
5005
5014
  className: "mono",
5006
5015
  style: Do,
5007
5016
  children: t
5008
- }) : /* @__PURE__ */ y("span", {
5017
+ }) : /* @__PURE__ */ b("span", {
5009
5018
  style: Oo,
5010
5019
  children: t
5011
5020
  });
@@ -5031,29 +5040,29 @@ function Po(e, t) {
5031
5040
  var Fo = (e) => {
5032
5041
  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;
5033
5042
  return (e, t) => {
5034
- if (e == null) return Q;
5043
+ if (e == null) return $;
5035
5044
  let r = t.$units?.[n] || (o && !o.startsWith("$") ? o : void 0), s;
5036
5045
  if (a && typeof e == "string") s = Po(e, i);
5037
5046
  else {
5038
5047
  let t = typeof e == "number" ? e : Number(e);
5039
5048
  s = Number.isFinite(t) ? i.format(t) : null;
5040
5049
  }
5041
- return s == null ? /* @__PURE__ */ y("span", {
5050
+ return s == null ? /* @__PURE__ */ b("span", {
5042
5051
  style: No,
5043
5052
  children: "—"
5044
- }) : /* @__PURE__ */ b("span", {
5053
+ }) : /* @__PURE__ */ x("span", {
5045
5054
  className: "num",
5046
5055
  style: jo,
5047
- children: [s, r && /* @__PURE__ */ y("span", {
5056
+ children: [s, r && /* @__PURE__ */ b("span", {
5048
5057
  style: Mo,
5049
5058
  children: r
5050
5059
  })]
5051
5060
  });
5052
5061
  };
5053
- }, Io = { fontSize: 12.5 }, Lo = () => (e) => e == null || e === "" ? Q : /* @__PURE__ */ y("code", {
5062
+ }, Io = { fontSize: 12.5 }, Lo = () => (e) => e == null || e === "" ? $ : /* @__PURE__ */ b("code", {
5054
5063
  className: "mono",
5055
5064
  style: Io,
5056
- children: F(e)
5065
+ children: I(e)
5057
5066
  }), Ro = {
5058
5067
  display: "inline-flex",
5059
5068
  alignItems: "center",
@@ -5062,20 +5071,20 @@ var Fo = (e) => {
5062
5071
  color: "var(--accent)",
5063
5072
  textDecoration: "none"
5064
5073
  }, zo = { fontSize: 12.5 }, Bo = () => (e) => {
5065
- let n = e == null ? "" : F(e);
5066
- if (!n) return Q;
5074
+ let n = e == null ? "" : I(e);
5075
+ if (!n) return $;
5067
5076
  let r = ro(n);
5068
- return r == null || !oo(r) ? /* @__PURE__ */ y("span", {
5077
+ return r == null || !oo(r) ? /* @__PURE__ */ b("span", {
5069
5078
  style: zo,
5070
5079
  children: n
5071
- }) : /* @__PURE__ */ b("a", {
5080
+ }) : /* @__PURE__ */ x("a", {
5072
5081
  href: r,
5073
5082
  target: "_blank",
5074
5083
  rel: "noopener noreferrer",
5075
5084
  title: n,
5076
5085
  className: "mono",
5077
5086
  style: Ro,
5078
- children: [n, /* @__PURE__ */ y(t.external, { size: 11 })]
5087
+ children: [n, /* @__PURE__ */ b(t.external, { size: 11 })]
5079
5088
  });
5080
5089
  }, Vo = 400, Ho = 2e3;
5081
5090
  function Uo(e) {
@@ -5088,7 +5097,7 @@ function Go(e, t, n, r = 0) {
5088
5097
  if (e == null || e === "") return "";
5089
5098
  if (typeof e == "string") return Wo(e, t);
5090
5099
  if (typeof e == "number" || typeof e == "boolean") return String(e);
5091
- if (typeof e != "object") return Wo(F(e), t);
5100
+ if (typeof e != "object") return Wo(I(e), t);
5092
5101
  if (n.has(e)) return "[Circular]";
5093
5102
  if (r >= 3) return Array.isArray(e) ? "[...]" : "{...}";
5094
5103
  n.add(e);
@@ -5113,16 +5122,16 @@ function Ko(e, t) {
5113
5122
  var qo = (e) => {
5114
5123
  let t = e.surface ?? "detail", n = Uo(e.field.display?.list_preview?.max_chars);
5115
5124
  return (r) => {
5116
- if (Li(r)) return Q;
5125
+ if (Li(r)) return $;
5117
5126
  if (t === "list") {
5118
5127
  let e = Ko(r, n);
5119
- return /* @__PURE__ */ y("span", {
5128
+ return /* @__PURE__ */ b("span", {
5120
5129
  className: "font-mono text-xs text-muted-foreground",
5121
5130
  title: e,
5122
5131
  children: e
5123
5132
  });
5124
5133
  }
5125
- return /* @__PURE__ */ y(Ri, {
5134
+ return /* @__PURE__ */ b(Ri, {
5126
5135
  field: e.field,
5127
5136
  fieldName: e.fieldName,
5128
5137
  value: r,
@@ -5211,21 +5220,21 @@ function Yo(e) {
5211
5220
  //#endregion
5212
5221
  //#region src/components/fields/cells/factories/markdown.tsx
5213
5222
  function Xo(e) {
5214
- return /* @__PURE__ */ y(Jr, { content: e });
5223
+ return /* @__PURE__ */ b(Jr, { content: e });
5215
5224
  }
5216
5225
  var Zo = (e) => {
5217
5226
  let t = e.surface === "list";
5218
5227
  return (e) => {
5219
- let n = e == null ? "" : F(e);
5220
- if (!n) return Q;
5228
+ let n = e == null ? "" : I(e);
5229
+ if (!n) return $;
5221
5230
  if (!t) return Xo(n);
5222
5231
  let { text: r, isPlain: i } = Yo(n);
5223
- return i ? /* @__PURE__ */ y("span", {
5232
+ return i ? /* @__PURE__ */ b("span", {
5224
5233
  title: r,
5225
5234
  children: r
5226
- }) : /* @__PURE__ */ y(se, {
5235
+ }) : /* @__PURE__ */ b(se, {
5227
5236
  content: Xo(n),
5228
- children: /* @__PURE__ */ y("span", {
5237
+ children: /* @__PURE__ */ b("span", {
5229
5238
  title: r,
5230
5239
  children: r
5231
5240
  })
@@ -5238,18 +5247,18 @@ var Zo = (e) => {
5238
5247
  fontSize: 12.5,
5239
5248
  color: "var(--text-4)",
5240
5249
  fontStyle: "italic"
5241
- }, ts = () => (e) => e === Qo || typeof e == "string" && e !== "" ? /* @__PURE__ */ y("span", {
5250
+ }, ts = () => (e) => e === Qo || typeof e == "string" && e !== "" ? /* @__PURE__ */ b("span", {
5242
5251
  className: "mono",
5243
5252
  style: $o,
5244
5253
  children: Qo
5245
- }) : /* @__PURE__ */ y("span", {
5254
+ }) : /* @__PURE__ */ b("span", {
5246
5255
  style: es,
5247
5256
  children: "Not set"
5248
5257
  });
5249
5258
  //#endregion
5250
5259
  //#region src/components/fields/cells/factories/richTextPreview.tsx
5251
5260
  function ns(e, t) {
5252
- return /* @__PURE__ */ y(Jr, {
5261
+ return /* @__PURE__ */ b(Jr, {
5253
5262
  content: e,
5254
5263
  files: t
5255
5264
  });
@@ -5258,15 +5267,15 @@ var rs = (e) => {
5258
5267
  let { fieldName: t } = e, n = e.surface === "list";
5259
5268
  return (e, r) => {
5260
5269
  let i = r?.$files?.[t], a = na(e, i);
5261
- if (!a.markdown) return Q;
5270
+ if (!a.markdown) return $;
5262
5271
  if (!n) return ns(a.markdown, a.files);
5263
5272
  let { text: o, isPlain: s } = Yo(a.markdown);
5264
- return s ? /* @__PURE__ */ y("span", {
5273
+ return s ? /* @__PURE__ */ b("span", {
5265
5274
  title: o,
5266
5275
  children: o
5267
- }) : /* @__PURE__ */ y(se, {
5276
+ }) : /* @__PURE__ */ b(se, {
5268
5277
  content: ns(a.markdown, a.files),
5269
- children: /* @__PURE__ */ y("span", {
5278
+ children: /* @__PURE__ */ b("span", {
5270
5279
  title: o,
5271
5280
  children: o
5272
5281
  })
@@ -5312,20 +5321,20 @@ var cs = {
5312
5321
  let { field: t, locale: n } = e, r = t.type === "multilang_text";
5313
5322
  return (e) => {
5314
5323
  let t = ss(os(e), n);
5315
- if (!t) return r ? /* @__PURE__ */ y("p", {
5324
+ if (!t) return r ? /* @__PURE__ */ b("p", {
5316
5325
  style: as,
5317
5326
  children: "—"
5318
- }) : /* @__PURE__ */ y("span", {
5327
+ }) : /* @__PURE__ */ b("span", {
5319
5328
  style: is,
5320
5329
  children: "—"
5321
5330
  });
5322
5331
  let [i, a] = t;
5323
- return r ? /* @__PURE__ */ y("p", {
5332
+ return r ? /* @__PURE__ */ b("p", {
5324
5333
  style: as,
5325
5334
  lang: i,
5326
5335
  dir: "auto",
5327
5336
  children: a
5328
- }) : /* @__PURE__ */ y("span", {
5337
+ }) : /* @__PURE__ */ b("span", {
5329
5338
  style: is,
5330
5339
  lang: i,
5331
5340
  dir: "auto",
@@ -5373,11 +5382,11 @@ var us = {
5373
5382
  };
5374
5383
  for (let e of ni) if (!us[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.`);
5375
5384
  function ds(e) {
5376
- if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ y(Ui, { ...e });
5385
+ if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ b(Ui, { ...e });
5377
5386
  if (e.mode === "edit") {
5378
5387
  let t = us[e.field.type];
5379
5388
  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.`);
5380
- return /* @__PURE__ */ y(t, { ...e });
5389
+ return /* @__PURE__ */ b(t, { ...e });
5381
5390
  }
5382
5391
  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.`);
5383
5392
  return ls({
@@ -5400,7 +5409,7 @@ function ps() {
5400
5409
  if (e) return e.split("-")[0] || void 0;
5401
5410
  }
5402
5411
  function ms() {
5403
- let e = Un((e) => e.user), { data: t } = J(), n = e?.language;
5412
+ let e = Un((e) => e.user), { data: t } = Y(), n = e?.language;
5404
5413
  if (n && n.trim()) return n;
5405
5414
  let r = t?.languages?.[0]?.code;
5406
5415
  return r && r.trim() ? r : ps() || fs;
@@ -5418,73 +5427,73 @@ function _s(e) {
5418
5427
  }
5419
5428
  //#endregion
5420
5429
  //#region src/lib/ui-actions.ts
5421
- var vs = /\$\{\s*([^}]+?)\s*\}/g, ys = /^\s*\$\{\s*([^}]+?)\s*\}\s*$/, $ = Symbol("unresolved");
5422
- function bs(e, t) {
5430
+ var vs = /\$\{\s*([^}]+?)\s*\}/g, ys = /^\s*\$\{\s*([^}]+?)\s*\}\s*$/, bs = Symbol("unresolved");
5431
+ function xs(e, t) {
5423
5432
  let n = e.match(ys);
5424
5433
  if (n) {
5425
- let r = xs(n[1], t);
5426
- return r === $ ? e : r;
5434
+ let r = Ss(n[1], t);
5435
+ return r === bs ? e : r;
5427
5436
  }
5428
5437
  return e.replace(vs, (e, n) => {
5429
- let r = xs(n, t);
5430
- return r === $ ? e : F(r);
5438
+ let r = Ss(n, t);
5439
+ return r === bs ? e : I(r);
5431
5440
  });
5432
5441
  }
5433
- function xs(e, t) {
5442
+ function Ss(e, t) {
5434
5443
  if (e === "now") return di();
5435
5444
  let [n, ...r] = e.split(".");
5436
- if (n === "row") return !t.row || r.length === 0 ? $ : Ss(t.row, r);
5445
+ if (n === "row") return !t.row || r.length === 0 ? bs : Cs(t.row, r);
5437
5446
  if (n === "field" && r.length >= 2) {
5438
5447
  let [e, t] = r, n = _s(e);
5439
- return n ? n.getField(t) : $;
5448
+ return n ? n.getField(t) : bs;
5440
5449
  }
5441
- return n === "params" ? !t.params || r.length === 0 ? $ : Ss(t.params, r) : $;
5450
+ return n === "params" ? !t.params || r.length === 0 ? bs : Cs(t.params, r) : bs;
5442
5451
  }
5443
- function Ss(e, t) {
5452
+ function Cs(e, t) {
5444
5453
  return t.reduce((e, t) => {
5445
5454
  if (e && typeof e == "object") return e[t];
5446
5455
  }, e);
5447
5456
  }
5448
- async function Cs(e, t) {
5457
+ async function ws(e, t) {
5449
5458
  for (let n of e) try {
5450
- await ws(n, t);
5459
+ await Ts(n, t);
5451
5460
  } catch (e) {
5452
5461
  let t = e instanceof Error ? e.message : String(e);
5453
- X.error(`ui_step failed: ${t}`);
5462
+ Z.error(`ui_step failed: ${t}`);
5454
5463
  return;
5455
5464
  }
5456
5465
  }
5457
- async function ws(e, t) {
5466
+ async function Ts(e, t) {
5458
5467
  if (e.copy_to_clipboard != null) {
5459
- let n = Es(e.copy_to_clipboard, t);
5468
+ let n = Ds(e.copy_to_clipboard, t);
5460
5469
  await navigator.clipboard.writeText(n);
5461
5470
  return;
5462
5471
  }
5463
5472
  if (e.set_field) {
5464
- let { target: n, value: r } = e.set_field, { region: i, field: a } = Ds(n), o = _s(i);
5473
+ let { target: n, value: r } = e.set_field, { region: i, field: a } = Os(n), o = _s(i);
5465
5474
  if (!o) throw Error(`region "${i}" not registered`);
5466
- o.setField(a, Ts(r, t));
5475
+ o.setField(a, Es(r, t));
5467
5476
  return;
5468
5477
  }
5469
5478
  if (e.focus_field) {
5470
- let { region: t, field: n } = Ds(e.focus_field), r = _s(t);
5479
+ let { region: t, field: n } = Os(e.focus_field), r = _s(t);
5471
5480
  if (!r) throw Error(`region "${t}" not registered`);
5472
5481
  r.focusField(n);
5473
5482
  return;
5474
5483
  }
5475
5484
  if (e.show_toast) {
5476
- let n = Es(e.show_toast.message, t), r = e.show_toast.kind ?? "info";
5477
- r === "success" ? X.success(n) : r === "error" ? X.error(n) : X.info(n);
5485
+ let n = Ds(e.show_toast.message, t), r = e.show_toast.kind ?? "info";
5486
+ r === "success" ? Z.success(n) : r === "error" ? Z.error(n) : Z.info(n);
5478
5487
  return;
5479
5488
  }
5480
5489
  }
5481
- function Ts(e, t) {
5482
- return typeof e == "string" ? bs(e, t) : e;
5483
- }
5484
5490
  function Es(e, t) {
5485
- return F(bs(e, t));
5491
+ return typeof e == "string" ? xs(e, t) : e;
5492
+ }
5493
+ function Ds(e, t) {
5494
+ return I(xs(e, t));
5486
5495
  }
5487
- function Ds(e) {
5496
+ function Os(e) {
5488
5497
  let t = e.indexOf(".");
5489
5498
  if (t <= 0) throw Error(`invalid path "${e}" (expected "region.field")`);
5490
5499
  return {
@@ -5492,12 +5501,12 @@ function Ds(e) {
5492
5501
  field: e.slice(t + 1)
5493
5502
  };
5494
5503
  }
5495
- function Os(e) {
5504
+ function ks(e) {
5496
5505
  return !e.handler && !!e.ui_steps && e.ui_steps.length > 0;
5497
5506
  }
5498
5507
  //#endregion
5499
5508
  //#region src/lib/mass-edit.ts
5500
- function ks(e) {
5509
+ function As(e) {
5501
5510
  if (!e) return [];
5502
5511
  let t = /* @__PURE__ */ new Set(), n = [];
5503
5512
  for (let r of e.split(",")) {
@@ -5506,17 +5515,17 @@ function ks(e) {
5506
5515
  }
5507
5516
  return n;
5508
5517
  }
5509
- function As(e, t) {
5518
+ function js(e, t) {
5510
5519
  if (!e || !Ye(e, "update")) return [];
5511
- let n = Array.isArray(t) ? t : ks(t), r = n.length > 0 ? new Set(n) : null, i = ot(e), a = new Set(R(e)), o = r ? n : js(e, i, a), s = [];
5520
+ let n = Array.isArray(t) ? t : As(t), r = n.length > 0 ? new Set(n) : null, i = ot(e), a = new Set(z(e)), o = r ? n : Ms(e, i, a), s = [];
5512
5521
  for (let t of o) {
5513
5522
  if (r && !r.has(t)) continue;
5514
- let n = Ms(e, t, i, a);
5523
+ let n = Ns(e, t, i, a);
5515
5524
  n && s.push(n);
5516
5525
  }
5517
5526
  return s;
5518
5527
  }
5519
- function js(e, t, n) {
5528
+ function Ms(e, t, n) {
5520
5529
  let r = [];
5521
5530
  for (let [t, i] of e.fields) n.has(t) || i.auto || r.push(t);
5522
5531
  if (!t) {
@@ -5525,7 +5534,7 @@ function js(e, t, n) {
5525
5534
  }
5526
5535
  return r;
5527
5536
  }
5528
- function Ms(e, t, n, r) {
5537
+ function Ns(e, t, n, r) {
5529
5538
  if (t.startsWith("$status.")) {
5530
5539
  if (n) return null;
5531
5540
  let r = t.slice(8), i = e.status_groups?.[r];
@@ -5533,7 +5542,7 @@ function Ms(e, t, n, r) {
5533
5542
  code: t,
5534
5543
  bare: r,
5535
5544
  kind: "status",
5536
- label: Ns(i.name, r),
5545
+ label: Ps(i.name, r),
5537
5546
  statusGroup: i
5538
5547
  } : null;
5539
5548
  }
@@ -5544,7 +5553,7 @@ function Ms(e, t, n, r) {
5544
5553
  code: t,
5545
5554
  bare: r,
5546
5555
  kind: "property",
5547
- label: Ns(i.name, r),
5556
+ label: Ps(i.name, r),
5548
5557
  property: i
5549
5558
  } : null;
5550
5559
  }
@@ -5554,18 +5563,18 @@ function Ms(e, t, n, r) {
5554
5563
  code: t,
5555
5564
  bare: t,
5556
5565
  kind: "field",
5557
- label: Ns(i.display?.name, t),
5566
+ label: Ps(i.display?.name, t),
5558
5567
  field: i
5559
5568
  };
5560
5569
  }
5561
- function Ns(e, t) {
5562
- return e && I(e) || t;
5570
+ function Ps(e, t) {
5571
+ return e && L(e) || t;
5563
5572
  }
5564
5573
  //#endregion
5565
5574
  //#region src/components/mass-edit/PropertyGridEditor.tsx
5566
- var Ps = Symbol.for("declarion.mass-edit.multiple");
5567
- function Fs({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange: i }) {
5568
- let a = d(() => As(e, t), [e, t]), o = d(() => Object.keys(r).map((e) => {
5575
+ var Fs = Symbol.for("declarion.mass-edit.multiple");
5576
+ function Is({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange: i }) {
5577
+ let a = d(() => js(e, t), [e, t]), o = d(() => Object.keys(r).map((e) => {
5569
5578
  let t = a.find((t) => t.code === e);
5570
5579
  return t ? {
5571
5580
  target: t,
@@ -5575,8 +5584,8 @@ function Fs({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
5575
5584
  let e = new Set(o.map((e) => e.target.code));
5576
5585
  return a.filter((t) => !e.has(t.code));
5577
5586
  }, [o, a]), l = s((e) => {
5578
- let t = Bs(e, n), a = { ...r };
5579
- a[e.code] = t === Ps ? void 0 : t, i(a);
5587
+ let t = Vs(e, n), a = { ...r };
5588
+ a[e.code] = t === Fs ? void 0 : t, i(a);
5580
5589
  }, [
5581
5590
  r,
5582
5591
  n,
@@ -5590,31 +5599,31 @@ function Fs({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
5590
5599
  let t = { ...r };
5591
5600
  delete t[e], i(t);
5592
5601
  }, [r, i]);
5593
- return e ? /* @__PURE__ */ b("div", {
5602
+ return e ? /* @__PURE__ */ x("div", {
5594
5603
  style: {
5595
5604
  display: "flex",
5596
5605
  flexDirection: "column",
5597
5606
  gap: 8
5598
5607
  },
5599
5608
  children: [
5600
- o.length === 0 && /* @__PURE__ */ y("div", {
5609
+ o.length === 0 && /* @__PURE__ */ b("div", {
5601
5610
  style: {
5602
5611
  fontSize: 12,
5603
5612
  color: "var(--text-3)"
5604
5613
  },
5605
5614
  children: "No targets selected. Add a field, status, or property to edit across all selected rows."
5606
5615
  }),
5607
- o.map((e) => /* @__PURE__ */ y(Is, {
5616
+ o.map((e) => /* @__PURE__ */ b(Ls, {
5608
5617
  row: e,
5609
5618
  onChange: (t) => u(e.target.code, t),
5610
5619
  onRemove: () => f(e.target.code)
5611
5620
  }, e.target.code)),
5612
- /* @__PURE__ */ y(zs, {
5621
+ /* @__PURE__ */ b(Bs, {
5613
5622
  targets: c,
5614
5623
  onPick: l
5615
5624
  })
5616
5625
  ]
5617
- }) : /* @__PURE__ */ y("div", {
5626
+ }) : /* @__PURE__ */ b("div", {
5618
5627
  style: {
5619
5628
  fontSize: 12,
5620
5629
  color: "var(--text-3)"
@@ -5622,9 +5631,9 @@ function Fs({ entity: e, filterTargets: t, selectedRows: n, value: r, onChange:
5622
5631
  children: "Entity schema unavailable. Mass edit requires an entity-bound action."
5623
5632
  });
5624
5633
  }
5625
- function Is({ row: e, onChange: n, onRemove: r }) {
5634
+ function Ls({ row: e, onChange: n, onRemove: r }) {
5626
5635
  let { target: i } = e;
5627
- return /* @__PURE__ */ b("div", {
5636
+ return /* @__PURE__ */ x("div", {
5628
5637
  "data-testid": "mass-edit-row",
5629
5638
  style: {
5630
5639
  display: "grid",
@@ -5633,7 +5642,7 @@ function Is({ row: e, onChange: n, onRemove: r }) {
5633
5642
  alignItems: "center"
5634
5643
  },
5635
5644
  children: [
5636
- /* @__PURE__ */ y("div", {
5645
+ /* @__PURE__ */ b("div", {
5637
5646
  style: {
5638
5647
  fontSize: 12.5,
5639
5648
  color: "var(--text-2)"
@@ -5641,28 +5650,28 @@ function Is({ row: e, onChange: n, onRemove: r }) {
5641
5650
  title: i.code,
5642
5651
  children: i.label
5643
5652
  }),
5644
- /* @__PURE__ */ y(Ls, {
5653
+ /* @__PURE__ */ b(Rs, {
5645
5654
  row: e,
5646
5655
  onChange: n
5647
5656
  }),
5648
- /* @__PURE__ */ y(D, {
5649
- icon: /* @__PURE__ */ y(t.x, { size: 12 }),
5657
+ /* @__PURE__ */ b(O, {
5658
+ icon: /* @__PURE__ */ b(t.x, { size: 12 }),
5650
5659
  onClick: r,
5651
5660
  title: "Remove target"
5652
5661
  })
5653
5662
  ]
5654
5663
  });
5655
5664
  }
5656
- function Ls({ row: e, onChange: t }) {
5657
- let { target: n } = e, r = ms(), i = e.value === Ps, a = i ? "<multiple values>" : void 0, o = i ? "" : e.value;
5665
+ function Rs({ row: e, onChange: t }) {
5666
+ let { target: n } = e, r = ms(), i = e.value === Fs, a = i ? "<multiple values>" : void 0, o = i ? "" : e.value;
5658
5667
  if (n.kind === "status" && n.statusGroup) {
5659
5668
  let e = n.statusGroup.statuses.map((e) => ({
5660
5669
  value: e.code,
5661
- label: I(e.name) || e.code
5670
+ label: L(e.name) || e.code
5662
5671
  }));
5663
- return /* @__PURE__ */ y("div", {
5672
+ return /* @__PURE__ */ b("div", {
5664
5673
  "data-testid": `value-${n.code}`,
5665
- children: /* @__PURE__ */ y(P, {
5674
+ children: /* @__PURE__ */ b(F, {
5666
5675
  value: typeof o == "string" ? o : "",
5667
5676
  options: e,
5668
5677
  onChange: t,
@@ -5670,8 +5679,8 @@ function Ls({ row: e, onChange: t }) {
5670
5679
  })
5671
5680
  });
5672
5681
  }
5673
- let s = Rs(n);
5674
- return /* @__PURE__ */ b("div", {
5682
+ let s = zs(n);
5683
+ return /* @__PURE__ */ x("div", {
5675
5684
  "data-testid": `value-${n.code}`,
5676
5685
  style: { position: "relative" },
5677
5686
  children: [ds({
@@ -5681,7 +5690,7 @@ function Ls({ row: e, onChange: t }) {
5681
5690
  mode: "edit",
5682
5691
  onChange: t,
5683
5692
  locale: r
5684
- }), a && /* @__PURE__ */ y("div", {
5693
+ }), a && /* @__PURE__ */ b("div", {
5685
5694
  "data-testid": `multiple-values-${n.code}`,
5686
5695
  style: {
5687
5696
  fontSize: 11,
@@ -5693,7 +5702,7 @@ function Ls({ row: e, onChange: t }) {
5693
5702
  })]
5694
5703
  });
5695
5704
  }
5696
- function Rs(e) {
5705
+ function zs(e) {
5697
5706
  if (e.kind === "field" && e.field) return e.field;
5698
5707
  if (e.kind === "property" && e.property) {
5699
5708
  let t = e.property;
@@ -5708,15 +5717,15 @@ function Rs(e) {
5708
5717
  }
5709
5718
  return { type: "string" };
5710
5719
  }
5711
- function zs({ targets: e, onPick: n }) {
5720
+ function Bs({ targets: e, onPick: n }) {
5712
5721
  let [r, i] = p(!1);
5713
- return e.length === 0 ? null : r ? /* @__PURE__ */ y("div", {
5722
+ return e.length === 0 ? null : r ? /* @__PURE__ */ b("div", {
5714
5723
  "data-testid": "mass-edit-target-picker",
5715
5724
  style: {
5716
5725
  alignSelf: "flex-start",
5717
5726
  minWidth: 220
5718
5727
  },
5719
- children: /* @__PURE__ */ y(P, {
5728
+ children: /* @__PURE__ */ b(F, {
5720
5729
  value: "",
5721
5730
  placeholder: "Select target...",
5722
5731
  options: e.map((e) => ({
@@ -5728,14 +5737,14 @@ function zs({ targets: e, onPick: n }) {
5728
5737
  r && n(r), i(!1);
5729
5738
  }
5730
5739
  })
5731
- }) : /* @__PURE__ */ b(E, {
5740
+ }) : /* @__PURE__ */ x(D, {
5732
5741
  kind: "ghost",
5733
5742
  onClick: () => i(!0),
5734
5743
  style: { alignSelf: "flex-start" },
5735
- children: [/* @__PURE__ */ y(t.plus, { size: 12 }), " Add target"]
5744
+ children: [/* @__PURE__ */ b(t.plus, { size: 12 }), " Add target"]
5736
5745
  });
5737
5746
  }
5738
- function Bs(e, t) {
5747
+ function Vs(e, t) {
5739
5748
  if (!t || t.length === 0 || e.kind !== "field") return;
5740
5749
  let n, r = !1;
5741
5750
  for (let i of t) {
@@ -5744,16 +5753,16 @@ function Bs(e, t) {
5744
5753
  n = t, r = !0;
5745
5754
  continue;
5746
5755
  }
5747
- if (n !== t) return Ps;
5756
+ if (n !== t) return Fs;
5748
5757
  }
5749
5758
  return n;
5750
5759
  }
5751
5760
  //#endregion
5752
5761
  //#region src/components/shared/ActionDialog.tsx
5753
- var Vs = /^\$row\.([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)$/;
5754
- function Hs(e, t) {
5762
+ var Hs = /^\$row\.([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)$/;
5763
+ function Us(e, t) {
5755
5764
  if (typeof e != "string") return e ?? "";
5756
- let n = e.match(Vs);
5765
+ let n = e.match(Hs);
5757
5766
  if (n) {
5758
5767
  let r = n[1].split("."), i = t;
5759
5768
  for (let e of r) {
@@ -5763,11 +5772,11 @@ function Hs(e, t) {
5763
5772
  }
5764
5773
  i = i[e];
5765
5774
  }
5766
- return i === void 0 ? (typeof console < "u" && console.warn && console.warn(`ActionDialog: prefill template ${e} could not be resolved; row is missing path '${r.join(".")}'`), "") : i ?? "";
5775
+ return i === void 0 ? ((t == null || !(r[0] in t)) && typeof console < "u" && console.warn && console.warn(`ActionDialog: prefill template ${e} could not be resolved; row is missing field '${r[0]}'`), "") : i ?? "";
5767
5776
  }
5768
- return bs(e, { row: t });
5777
+ return xs(e, { row: t });
5769
5778
  }
5770
- function Us(e) {
5779
+ function Ws(e) {
5771
5780
  return {
5772
5781
  type: e.type ?? "string",
5773
5782
  required: e.required,
@@ -5780,18 +5789,18 @@ function Us(e) {
5780
5789
  ref: Ke(e.ref)
5781
5790
  };
5782
5791
  }
5783
- function Ws(e, t) {
5792
+ function Gs(e, t) {
5784
5793
  if (!e.includes("${")) return e;
5785
- let n = bs(e, { params: t });
5786
- return n == null ? "" : F(n);
5794
+ let n = xs(e, { params: t });
5795
+ return n == null ? "" : I(n);
5787
5796
  }
5788
- var Gs = /\$\{\s*([^}]+?)\s*\}/g;
5789
- function Ks(e, t) {
5797
+ var Ks = /\$\{\s*([^}]+?)\s*\}/g;
5798
+ function qs(e, t) {
5790
5799
  let n = `params.${t}`;
5791
- for (let t of e.matchAll(Gs)) if (t[1] === n) return !0;
5800
+ for (let t of e.matchAll(Ks)) if (t[1] === n) return !0;
5792
5801
  return !1;
5793
5802
  }
5794
- function qs({ param: e, value: t, onChange: n, statusGroups: r }) {
5803
+ function Js({ param: e, value: t, onChange: n, statusGroups: r }) {
5795
5804
  let i = d(() => {
5796
5805
  let t = r ? Object.entries(r) : [];
5797
5806
  return [{
@@ -5799,22 +5808,22 @@ function qs({ param: e, value: t, onChange: n, statusGroups: r }) {
5799
5808
  label: e.required ? "Select status group…" : "—"
5800
5809
  }, ...t.map(([e, t]) => ({
5801
5810
  value: e,
5802
- label: I(t.name) || e
5811
+ label: L(t.name) || e
5803
5812
  }))];
5804
5813
  }, [r, e.required]);
5805
- return /* @__PURE__ */ y(P, {
5814
+ return /* @__PURE__ */ b(F, {
5806
5815
  value: typeof t == "string" ? t : "",
5807
5816
  options: i,
5808
5817
  onChange: (e) => n(e),
5809
5818
  placeholder: "Select status group…"
5810
5819
  });
5811
5820
  }
5812
- function Js({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
5821
+ function Ys({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
5813
5822
  let a = d(() => {
5814
5823
  if (!r) return [];
5815
5824
  let t = e.filter?.status_group;
5816
5825
  if (t) {
5817
- let e = Ws(t, i);
5826
+ let e = Gs(t, i);
5818
5827
  return e && r[e] ? r[e].statuses : [];
5819
5828
  }
5820
5829
  return Object.values(r).flatMap((e) => e.statuses);
@@ -5827,26 +5836,26 @@ function Js({ param: e, value: t, onChange: n, statusGroups: r, formData: i }) {
5827
5836
  label: a.length === 0 ? "Select status group first" : "Select status…"
5828
5837
  }, ...a.map((e) => ({
5829
5838
  value: e.code,
5830
- label: I(e.name) || e.code
5839
+ label: L(e.name) || e.code
5831
5840
  }))], [a]);
5832
- return /* @__PURE__ */ y(P, {
5841
+ return /* @__PURE__ */ b(F, {
5833
5842
  value: typeof t == "string" ? t : "",
5834
5843
  options: o,
5835
5844
  onChange: (e) => n(e),
5836
5845
  placeholder: "Select status…"
5837
5846
  });
5838
5847
  }
5839
- function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, isPending: o, row: c, bulkSelection: l }) {
5840
- let { data: u } = J(), f = ms(), m = r.resolved_params, h = r.resolved_hidden_defaults ?? {}, g = d(() => m ? Array.from(m) : [], [m]), _ = d(() => {
5848
+ function Xs({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, isPending: o, row: c, bulkSelection: l }) {
5849
+ let { data: u } = Y(), f = ms(), m = r.resolved_params, h = r.resolved_hidden_defaults ?? {}, g = d(() => m ? Array.from(m) : [], [m]), _ = d(() => {
5841
5850
  if (!(!r.entity || !u)) return u.entities[r.entity]?.status_groups;
5842
- }, [r.entity, u]), x = d(() => {
5851
+ }, [r.entity, u]), v = d(() => {
5843
5852
  if (!(!r.entity || !u)) return u.entities[r.entity];
5844
5853
  }, [r.entity, u]), S = d(() => {
5845
- if (x) {
5846
- for (let [e, t] of x.fields) if (t.primary) return e;
5847
- return x.primary_key?.[0];
5854
+ if (v) {
5855
+ for (let [e, t] of v.fields) if (t.primary) return e;
5856
+ return v.primary_key?.[0];
5848
5857
  }
5849
- }, [x]), [C, w] = p(s(() => {
5858
+ }, [v]), [C, w] = p(s(() => {
5850
5859
  let e = { ...h };
5851
5860
  for (let [t, n] of g) {
5852
5861
  if (n.type === "id_array") {
@@ -5858,11 +5867,11 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
5858
5867
  continue;
5859
5868
  }
5860
5869
  if (n.type === "bool") {
5861
- let r = Hs(n.default, c);
5870
+ let r = Us(n.default, c);
5862
5871
  e[t] = r === !0 || r === "true";
5863
5872
  continue;
5864
5873
  }
5865
- e[t] = Hs(n.default, c);
5874
+ e[t] = Us(n.default, c);
5866
5875
  }
5867
5876
  return e;
5868
5877
  }, [
@@ -5880,11 +5889,11 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
5880
5889
  for (let [t, n] of m) {
5881
5890
  if (n.type !== "status") continue;
5882
5891
  let i = n.filter?.status_group;
5883
- i && Ks(i, e) && (r[t] = "");
5892
+ i && qs(i, e) && (r[t] = "");
5884
5893
  }
5885
5894
  return r;
5886
5895
  });
5887
- }, [m]), O = s(() => {
5896
+ }, [m]), E = s(() => {
5888
5897
  let e = { ...C };
5889
5898
  for (let [t, n] of g) {
5890
5899
  let r = C[t], i = r == null || r === "";
@@ -5897,7 +5906,7 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
5897
5906
  g,
5898
5907
  a
5899
5908
  ]);
5900
- return e ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
5909
+ return e ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
5901
5910
  onClick: () => n(!1),
5902
5911
  style: {
5903
5912
  position: "fixed",
@@ -5906,7 +5915,7 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
5906
5915
  zIndex: 60,
5907
5916
  backdropFilter: "blur(2px)"
5908
5917
  }
5909
- }), /* @__PURE__ */ b("div", {
5918
+ }), /* @__PURE__ */ x("div", {
5910
5919
  "data-testid": "action-dialog",
5911
5920
  role: "dialog",
5912
5921
  "aria-modal": "true",
@@ -5930,7 +5939,7 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
5930
5939
  minWidth: 0
5931
5940
  },
5932
5941
  children: [
5933
- /* @__PURE__ */ b("div", {
5942
+ /* @__PURE__ */ x("div", {
5934
5943
  style: {
5935
5944
  padding: "14px 18px",
5936
5945
  display: "flex",
@@ -5938,7 +5947,7 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
5938
5947
  gap: 10
5939
5948
  },
5940
5949
  children: [
5941
- /* @__PURE__ */ y("span", {
5950
+ /* @__PURE__ */ b("span", {
5942
5951
  style: {
5943
5952
  width: 28,
5944
5953
  height: 28,
@@ -5950,36 +5959,36 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
5950
5959
  justifyContent: "center",
5951
5960
  flexShrink: 0
5952
5961
  },
5953
- children: /* @__PURE__ */ y(t.bolt, { size: 15 })
5962
+ children: /* @__PURE__ */ b(t.bolt, { size: 15 })
5954
5963
  }),
5955
- /* @__PURE__ */ b("div", {
5964
+ /* @__PURE__ */ x("div", {
5956
5965
  style: {
5957
5966
  flex: 1,
5958
5967
  minWidth: 0
5959
5968
  },
5960
- children: [/* @__PURE__ */ y("div", {
5969
+ children: [/* @__PURE__ */ b("div", {
5961
5970
  style: {
5962
5971
  fontSize: 14,
5963
5972
  fontWeight: 600,
5964
5973
  color: "var(--text)"
5965
5974
  },
5966
5975
  children: i
5967
- }), /* @__PURE__ */ y("div", {
5976
+ }), /* @__PURE__ */ b("div", {
5968
5977
  style: {
5969
5978
  fontSize: 11.5,
5970
5979
  color: "var(--text-3)",
5971
5980
  marginTop: 2
5972
5981
  },
5973
- children: I(r.display?.description) || "Fill in the parameters below to execute this action."
5982
+ children: L(r.display?.description) || "Fill in the parameters below to execute this action."
5974
5983
  })]
5975
5984
  }),
5976
- /* @__PURE__ */ y(D, {
5977
- icon: /* @__PURE__ */ y(t.x, { size: 14 }),
5985
+ /* @__PURE__ */ b(O, {
5986
+ icon: /* @__PURE__ */ b(t.x, { size: 14 }),
5978
5987
  onClick: () => n(!1)
5979
5988
  })
5980
5989
  ]
5981
5990
  }),
5982
- /* @__PURE__ */ y("div", {
5991
+ /* @__PURE__ */ b("div", {
5983
5992
  style: {
5984
5993
  padding: "12px 18px 16px",
5985
5994
  display: "flex",
@@ -5990,60 +5999,60 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
5990
5999
  minHeight: 0
5991
6000
  },
5992
6001
  children: g.map(([e, t]) => {
5993
- let n = I(t.display?.name) || e;
6002
+ let n = L(t.display?.name) || e;
5994
6003
  if (t.type === "id_array") return null;
5995
6004
  let r;
5996
6005
  if (t.type === "entity_patch") {
5997
6006
  let n = typeof t.filter?.targets == "string" ? t.filter.targets : void 0;
5998
- r = /* @__PURE__ */ y(Fs, {
5999
- entity: x,
6007
+ r = /* @__PURE__ */ b(Is, {
6008
+ entity: v,
6000
6009
  filterTargets: n,
6001
6010
  selectedRows: l,
6002
6011
  value: C[e] ?? {},
6003
6012
  onChange: (t) => T(e, t)
6004
6013
  });
6005
- } else r = t.type === "status_group" ? /* @__PURE__ */ y(qs, {
6014
+ } else r = t.type === "status_group" ? /* @__PURE__ */ b(Js, {
6006
6015
  param: t,
6007
6016
  value: C[e],
6008
6017
  onChange: (t) => T(e, t),
6009
6018
  statusGroups: _,
6010
6019
  formData: C
6011
- }) : t.type === "status" ? /* @__PURE__ */ y(Js, {
6020
+ }) : t.type === "status" ? /* @__PURE__ */ b(Ys, {
6012
6021
  param: t,
6013
6022
  value: C[e],
6014
6023
  onChange: (t) => T(e, t),
6015
6024
  statusGroups: _,
6016
6025
  formData: C
6017
6026
  }) : ds({
6018
- field: Us(t),
6027
+ field: Ws(t),
6019
6028
  fieldName: e,
6020
6029
  value: C[e],
6021
6030
  mode: "edit",
6022
6031
  onChange: (t) => T(e, t),
6023
6032
  locale: f
6024
6033
  });
6025
- return /* @__PURE__ */ b("div", {
6034
+ return /* @__PURE__ */ x("div", {
6026
6035
  style: { minWidth: 0 },
6027
6036
  children: [
6028
- /* @__PURE__ */ y(Ce, {
6037
+ /* @__PURE__ */ b(Ce, {
6029
6038
  required: t.required,
6030
6039
  children: n
6031
6040
  }),
6032
6041
  r,
6033
- t.display?.description && /* @__PURE__ */ y("p", {
6042
+ t.display?.description && /* @__PURE__ */ b("p", {
6034
6043
  style: {
6035
6044
  fontSize: 11,
6036
6045
  color: "var(--text-3)",
6037
6046
  marginTop: 4,
6038
6047
  marginBottom: 0
6039
6048
  },
6040
- children: I(t.display.description)
6049
+ children: L(t.display.description)
6041
6050
  })
6042
6051
  ]
6043
6052
  }, e);
6044
6053
  })
6045
6054
  }),
6046
- /* @__PURE__ */ b("div", {
6055
+ /* @__PURE__ */ x("div", {
6047
6056
  style: {
6048
6057
  padding: "10px 16px",
6049
6058
  borderTop: "1px solid var(--divider)",
@@ -6056,16 +6065,16 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
6056
6065
  minWidth: 0
6057
6066
  },
6058
6067
  children: [
6059
- /* @__PURE__ */ y("div", { style: { flex: 1 } }),
6060
- /* @__PURE__ */ y(E, {
6068
+ /* @__PURE__ */ b("div", { style: { flex: 1 } }),
6069
+ /* @__PURE__ */ b(D, {
6061
6070
  onClick: () => n(!1),
6062
6071
  disabled: o,
6063
6072
  children: "Cancel"
6064
6073
  }),
6065
- /* @__PURE__ */ y(E, {
6074
+ /* @__PURE__ */ b(D, {
6066
6075
  kind: "primary",
6067
- icon: y(o ? Se : t.bolt, { size: 13 }),
6068
- onClick: O,
6076
+ icon: b(o ? Se : t.bolt, { size: 13 }),
6077
+ onClick: E,
6069
6078
  disabled: o,
6070
6079
  children: o ? "Executing…" : "Execute"
6071
6080
  })
@@ -6076,17 +6085,17 @@ function Ys({ open: e, onOpenChange: n, action: r, actionName: i, onSubmit: a, i
6076
6085
  }
6077
6086
  //#endregion
6078
6087
  //#region src/components/shared/ActionResultDialog.tsx
6079
- function Xs({ open: e, onClose: n, display: r }) {
6088
+ function Zs({ open: e, onClose: n, display: r }) {
6080
6089
  let i = f(null);
6081
6090
  return l(() => {
6082
6091
  e && i.current?.focus();
6083
- }, [e]), e ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", { style: {
6092
+ }, [e]), e ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", { style: {
6084
6093
  position: "fixed",
6085
6094
  inset: 0,
6086
6095
  background: "var(--scrim)",
6087
6096
  zIndex: 60,
6088
6097
  backdropFilter: "blur(2px)"
6089
- } }), /* @__PURE__ */ b("div", {
6098
+ } }), /* @__PURE__ */ x("div", {
6090
6099
  ref: i,
6091
6100
  role: "dialog",
6092
6101
  "aria-modal": "true",
@@ -6114,7 +6123,7 @@ function Xs({ open: e, onClose: n, display: r }) {
6114
6123
  outline: "none"
6115
6124
  },
6116
6125
  children: [
6117
- /* @__PURE__ */ b("div", {
6126
+ /* @__PURE__ */ x("div", {
6118
6127
  style: {
6119
6128
  padding: "14px 18px",
6120
6129
  display: "flex",
@@ -6122,7 +6131,7 @@ function Xs({ open: e, onClose: n, display: r }) {
6122
6131
  gap: 10
6123
6132
  },
6124
6133
  children: [
6125
- /* @__PURE__ */ y("span", {
6134
+ /* @__PURE__ */ b("span", {
6126
6135
  style: {
6127
6136
  width: 28,
6128
6137
  height: 28,
@@ -6134,21 +6143,21 @@ function Xs({ open: e, onClose: n, display: r }) {
6134
6143
  justifyContent: "center",
6135
6144
  flexShrink: 0
6136
6145
  },
6137
- children: /* @__PURE__ */ y(t.check, { size: 15 })
6146
+ children: /* @__PURE__ */ b(t.check, { size: 15 })
6138
6147
  }),
6139
- /* @__PURE__ */ b("div", {
6148
+ /* @__PURE__ */ x("div", {
6140
6149
  style: {
6141
6150
  flex: 1,
6142
6151
  minWidth: 0
6143
6152
  },
6144
- children: [/* @__PURE__ */ y("div", {
6153
+ children: [/* @__PURE__ */ b("div", {
6145
6154
  style: {
6146
6155
  fontSize: 14,
6147
6156
  fontWeight: 600,
6148
6157
  color: "var(--text)"
6149
6158
  },
6150
6159
  children: r.title ?? "Action Result"
6151
- }), r.message && /* @__PURE__ */ y("div", {
6160
+ }), r.message && /* @__PURE__ */ b("div", {
6152
6161
  style: {
6153
6162
  fontSize: 11.5,
6154
6163
  color: "var(--text-3)",
@@ -6157,13 +6166,13 @@ function Xs({ open: e, onClose: n, display: r }) {
6157
6166
  children: r.message
6158
6167
  })]
6159
6168
  }),
6160
- /* @__PURE__ */ y(D, {
6161
- icon: /* @__PURE__ */ y(t.x, { size: 14 }),
6169
+ /* @__PURE__ */ b(O, {
6170
+ icon: /* @__PURE__ */ b(t.x, { size: 14 }),
6162
6171
  onClick: n
6163
6172
  })
6164
6173
  ]
6165
6174
  }),
6166
- r.fields && r.fields.length > 0 && /* @__PURE__ */ y("div", {
6175
+ r.fields && r.fields.length > 0 && /* @__PURE__ */ b("div", {
6167
6176
  style: {
6168
6177
  padding: "12px 18px 16px",
6169
6178
  display: "flex",
@@ -6171,9 +6180,9 @@ function Xs({ open: e, onClose: n, display: r }) {
6171
6180
  gap: 12,
6172
6181
  overflowY: "auto"
6173
6182
  },
6174
- children: r.fields.map((e, t) => /* @__PURE__ */ y(Zs, { field: e }, t))
6183
+ children: r.fields.map((e, t) => /* @__PURE__ */ b(Qs, { field: e }, t))
6175
6184
  }),
6176
- /* @__PURE__ */ b("div", {
6185
+ /* @__PURE__ */ x("div", {
6177
6186
  style: {
6178
6187
  padding: "10px 16px",
6179
6188
  borderTop: "1px solid var(--divider)",
@@ -6185,7 +6194,7 @@ function Xs({ open: e, onClose: n, display: r }) {
6185
6194
  background: "var(--surface-2)",
6186
6195
  flexShrink: 0
6187
6196
  },
6188
- children: [/* @__PURE__ */ y("div", { style: { flex: 1 } }), /* @__PURE__ */ y(E, {
6197
+ children: [/* @__PURE__ */ b("div", { style: { flex: 1 } }), /* @__PURE__ */ b(D, {
6189
6198
  kind: "primary",
6190
6199
  onClick: n,
6191
6200
  children: "Close"
@@ -6194,7 +6203,7 @@ function Xs({ open: e, onClose: n, display: r }) {
6194
6203
  ]
6195
6204
  })] }) : null;
6196
6205
  }
6197
- function Zs({ field: e }) {
6206
+ function Qs({ field: e }) {
6198
6207
  let n = e.href ?? e.download_url ?? e.value, r = e.type === "download", i = r || e.type === "link", a = n ? Zr(n) : void 0, [o, s] = p(!1), [c, l] = p(null);
6199
6208
  async function u() {
6200
6209
  if (a) {
@@ -6236,14 +6245,14 @@ function Zs({ field: e }) {
6236
6245
  fontSize: 12.5,
6237
6246
  lineHeight: 1.4
6238
6247
  };
6239
- return /* @__PURE__ */ b("div", {
6248
+ return /* @__PURE__ */ x("div", {
6240
6249
  style: {
6241
6250
  display: "flex",
6242
6251
  flexDirection: "column",
6243
6252
  gap: 4
6244
6253
  },
6245
6254
  children: [
6246
- /* @__PURE__ */ y("div", {
6255
+ /* @__PURE__ */ b("div", {
6247
6256
  style: {
6248
6257
  fontSize: 11.5,
6249
6258
  fontWeight: 500,
@@ -6251,7 +6260,7 @@ function Zs({ field: e }) {
6251
6260
  },
6252
6261
  children: e.label
6253
6262
  }),
6254
- r && a && /* @__PURE__ */ b("button", {
6263
+ r && a && /* @__PURE__ */ x("button", {
6255
6264
  type: "button",
6256
6265
  onClick: u,
6257
6266
  disabled: o,
@@ -6259,32 +6268,32 @@ function Zs({ field: e }) {
6259
6268
  ...d,
6260
6269
  cursor: o ? "default" : "pointer"
6261
6270
  },
6262
- children: [y(o ? t.loader : t.download, { size: 14 }), /* @__PURE__ */ y("span", { children: o ? "Downloading…" : "Download" })]
6271
+ children: [b(o ? t.loader : t.download, { size: 14 }), /* @__PURE__ */ b("span", { children: o ? "Downloading…" : "Download" })]
6263
6272
  }),
6264
- c && /* @__PURE__ */ y("div", {
6273
+ c && /* @__PURE__ */ b("div", {
6265
6274
  style: {
6266
6275
  fontSize: 11.5,
6267
6276
  color: "var(--danger)"
6268
6277
  },
6269
6278
  children: c
6270
6279
  }),
6271
- f && a ? /* @__PURE__ */ b("div", {
6280
+ f && a ? /* @__PURE__ */ x("div", {
6272
6281
  style: {
6273
6282
  display: "flex",
6274
6283
  alignItems: "center",
6275
6284
  gap: 8,
6276
6285
  minWidth: 0
6277
6286
  },
6278
- children: [/* @__PURE__ */ b("a", {
6287
+ children: [/* @__PURE__ */ x("a", {
6279
6288
  href: a,
6280
6289
  target: "_blank",
6281
6290
  rel: "noopener noreferrer",
6282
6291
  style: m,
6283
6292
  title: e.value,
6284
- children: [/* @__PURE__ */ y(t.link, {
6293
+ children: [/* @__PURE__ */ b(t.link, {
6285
6294
  size: 14,
6286
6295
  style: { flexShrink: 0 }
6287
- }), /* @__PURE__ */ y("span", {
6296
+ }), /* @__PURE__ */ b("span", {
6288
6297
  style: {
6289
6298
  overflow: "hidden",
6290
6299
  textOverflow: "ellipsis",
@@ -6292,13 +6301,13 @@ function Zs({ field: e }) {
6292
6301
  },
6293
6302
  children: e.value
6294
6303
  })]
6295
- }), e.copyable && /* @__PURE__ */ y(ri, { value: e.value })]
6296
- }) : /* @__PURE__ */ b("div", {
6304
+ }), e.copyable && /* @__PURE__ */ b(ri, { value: e.value })]
6305
+ }) : /* @__PURE__ */ x("div", {
6297
6306
  style: {
6298
6307
  position: "relative",
6299
6308
  width: "100%"
6300
6309
  },
6301
- children: [/* @__PURE__ */ y("div", {
6310
+ children: [/* @__PURE__ */ b("div", {
6302
6311
  className: e.monospace ? "mono" : void 0,
6303
6312
  style: {
6304
6313
  borderRadius: 6,
@@ -6310,13 +6319,13 @@ function Zs({ field: e }) {
6310
6319
  color: "var(--text)"
6311
6320
  },
6312
6321
  children: e.value
6313
- }), e.copyable && /* @__PURE__ */ y("div", {
6322
+ }), e.copyable && /* @__PURE__ */ b("div", {
6314
6323
  style: {
6315
6324
  position: "absolute",
6316
6325
  top: 4,
6317
6326
  right: 4
6318
6327
  },
6319
- children: /* @__PURE__ */ y(ri, { value: e.value })
6328
+ children: /* @__PURE__ */ b(ri, { value: e.value })
6320
6329
  })]
6321
6330
  })
6322
6331
  ]
@@ -6324,7 +6333,7 @@ function Zs({ field: e }) {
6324
6333
  }
6325
6334
  //#endregion
6326
6335
  //#region src/components/shared/ActionRunner.tsx
6327
- function Qs(e) {
6336
+ function $s(e) {
6328
6337
  if (!e || typeof e != "object") return { kind: "success" };
6329
6338
  let t = e, n = t.status, r = t.success?.length ?? 0, i = t.errors?.length ?? 0, a = t.skipped?.length ?? 0, o = t.errors?.[0]?.error;
6330
6339
  if (n === "partial") {
@@ -6339,15 +6348,15 @@ function Qs(e) {
6339
6348
  detail: "No items matched"
6340
6349
  } : n === "accepted" ? { kind: "accepted" } : { kind: "success" };
6341
6350
  }
6342
- function $s(e) {
6351
+ function ec(e) {
6343
6352
  if (!e || typeof e != "object") return null;
6344
6353
  let t = e.result;
6345
6354
  if (!t || typeof t != "object") return null;
6346
6355
  let n = t.$display;
6347
6356
  return !n || typeof n != "object" ? null : n;
6348
6357
  }
6349
- function ec(e) {
6350
- let t = $s(e)?.fields;
6358
+ function tc(e) {
6359
+ let t = ec(e)?.fields;
6351
6360
  if (!Array.isArray(t)) return null;
6352
6361
  for (let e of t) {
6353
6362
  if (e?.type !== "download") continue;
@@ -6359,12 +6368,12 @@ function ec(e) {
6359
6368
  }
6360
6369
  return null;
6361
6370
  }
6362
- function tc(e) {
6371
+ function nc(e) {
6363
6372
  if (!e || typeof e != "object") return;
6364
6373
  let t = e.result;
6365
6374
  !t || typeof t != "object" || "impersonation_session_id" in t && window.location.assign("/");
6366
6375
  }
6367
- function nc(e) {
6376
+ function rc(e) {
6368
6377
  if (e instanceof $n) {
6369
6378
  let t = e.response.errors ?? [];
6370
6379
  if (t.length === 1) return {
@@ -6377,7 +6386,7 @@ function nc(e) {
6377
6386
  detail: n ? `${t.length} failed · ${n}` : `${t.length} failed`
6378
6387
  };
6379
6388
  }
6380
- return e instanceof z ? {
6389
+ return e instanceof B ? {
6381
6390
  kind: "error",
6382
6391
  detail: e.message
6383
6392
  } : {
@@ -6385,56 +6394,69 @@ function nc(e) {
6385
6394
  detail: e instanceof Error ? e.message : String(e)
6386
6395
  };
6387
6396
  }
6388
- var rc = i(null);
6389
- function ic() {
6390
- let e = c(rc);
6397
+ var ic = i(null);
6398
+ function ac() {
6399
+ let e = c(ic);
6391
6400
  if (!e) throw Error("useActionRunner must be used within <ActionRunnerProvider>");
6392
6401
  return e;
6393
6402
  }
6394
- function ac(e) {
6403
+ function oc(e) {
6395
6404
  let t = {}, n = e.action?.resolved_hidden_defaults;
6396
6405
  if (n) for (let [e, r] of Object.entries(n)) r !== void 0 && (t[e] = r);
6397
6406
  return t;
6398
6407
  }
6399
- function oc({ children: e }) {
6400
- let t = Mr(), { data: n } = J(), [r, i] = p(null), [a, o] = p(0), [c, l] = p(null), u = s((e) => {
6408
+ function sc({ children: e }) {
6409
+ let t = Mr(), { data: n } = Y(), [r, i] = p(null), [a, o] = p(0), [c, l] = p(null), u = s((e) => {
6401
6410
  if (e?.progress_screen) return n?.screens[e.progress_screen]?.route;
6402
6411
  }, [n?.screens]), f = s((e, n, r, i, a) => {
6403
6412
  let o = () => {
6404
- let n = sc(a), i = u(r), o = n ? `Job ${n} queued` : "Running in background";
6405
- X.success(`${e} started`, o, i ? { action: {
6413
+ let n = cc(a), i = u(r), o = n ? `Job ${n} queued` : "Running in background";
6414
+ Z.success(`${e} started`, o, i ? { action: {
6406
6415
  label: "View",
6407
6416
  onClick: () => t(i)
6408
6417
  } } : void 0);
6409
6418
  };
6410
6419
  switch (i.kind) {
6411
6420
  case "success": {
6412
- let t = ec(a), r = t ? { action: {
6421
+ let t = tc(a), r = t ? { action: {
6413
6422
  label: "Download",
6414
6423
  onClick: () => {
6415
6424
  ei(t.url, t.filename).catch((e) => {
6416
- X.error("Download failed", e instanceof Error ? e.message : String(e));
6425
+ Z.error("Download failed", e instanceof Error ? e.message : String(e));
6417
6426
  });
6418
6427
  }
6419
6428
  } } : void 0;
6420
- n ? o() : X.success(`${e} complete`, void 0, r);
6429
+ n ? o() : Z.success(`${e} complete`, void 0, r);
6421
6430
  return;
6422
6431
  }
6423
6432
  case "accepted":
6424
6433
  o();
6425
6434
  return;
6426
6435
  case "skipped":
6427
- X.info(e, i.detail);
6436
+ Z.info(e, i.detail);
6428
6437
  return;
6429
6438
  case "partial":
6430
- X.warning(`${e} partially completed`, i.detail);
6439
+ Z.warning(`${e} partially completed`, i.detail);
6431
6440
  return;
6432
6441
  case "error":
6433
- X.error(`${e} failed`, i.detail);
6442
+ Z.error(`${e} failed`, i.detail);
6434
6443
  return;
6435
6444
  }
6436
- }, [t, u]), m = s((e) => {
6437
- let t = e.action, n = e.destructive ?? t?.destructive ?? !1, r = e.longRunning ?? t?.long_running ?? !1, a = e.title || I(t?.display?.name) || "Action";
6445
+ }, [t, u]), m = _(), h = s((e, t, n) => {
6446
+ if (t.kind === "success" || t.kind === "accepted" || t.kind === "partial") {
6447
+ let t = e.entity ?? e.action?.entity;
6448
+ if (t) for (let e of [
6449
+ "entity-data",
6450
+ "entity-count",
6451
+ "entity-item"
6452
+ ]) m.invalidateQueries({ queryKey: [e, t] });
6453
+ }
6454
+ if (t.kind !== "success" && t.kind !== "accepted") return;
6455
+ e.onSuccess?.(n);
6456
+ let r = ec(n);
6457
+ r && l(r), nc(n);
6458
+ }, [m]), g = s((e) => {
6459
+ let t = e.action, n = e.destructive ?? t?.destructive ?? !1, r = e.longRunning ?? t?.long_running ?? !1, a = e.title || L(t?.display?.name) || "Action";
6438
6460
  return t?.resolved_params && t.resolved_params.length > 0 ? (i({
6439
6461
  id: Symbol(),
6440
6462
  opts: e,
@@ -6450,22 +6472,18 @@ function oc({ children: e }) {
6450
6472
  }), Promise.resolve()) : (async (n) => {
6451
6473
  o((e) => e + 1);
6452
6474
  try {
6453
- let i = await e.execute(n), o = Qs(i);
6454
- if (f(a, r, t, o, i), o.kind === "success" || o.kind === "accepted") {
6455
- e.onSuccess?.(i);
6456
- let t = $s(i);
6457
- t && l(t), tc(i);
6458
- }
6475
+ let i = await e.execute(n), o = $s(i);
6476
+ f(a, r, t, o, i), h(e, o, i);
6459
6477
  } catch (e) {
6460
- f(a, r, t, nc(e));
6478
+ f(a, r, t, rc(e));
6461
6479
  } finally {
6462
6480
  o((e) => Math.max(0, e - 1));
6463
6481
  }
6464
- })(ac(e));
6465
- }, [f]), h = a > 0 || !!r?.pending, g = d(() => ({
6466
- run: m,
6467
- isRunning: h
6468
- }), [m, h]), _ = r?.opts.action, v = s(async (e) => {
6482
+ })(oc(e));
6483
+ }, [f, h]), v = a > 0 || !!r?.pending, y = d(() => ({
6484
+ run: g,
6485
+ isRunning: v
6486
+ }), [g, v]), S = r?.opts.action, C = s(async (e) => {
6469
6487
  if (!r) return;
6470
6488
  let t = r.id, n = r, a = n.opts.action, s = n.opts.longRunning ?? a?.long_running ?? !1;
6471
6489
  i((e) => e?.id === t ? {
@@ -6473,58 +6491,53 @@ function oc({ children: e }) {
6473
6491
  pending: !0
6474
6492
  } : e), o((e) => e + 1);
6475
6493
  try {
6476
- let r = await n.opts.execute(e), o = Qs(r);
6477
- if (f(n.title, s, a, o, r), o.kind === "success" || o.kind === "accepted") {
6478
- n.opts.onSuccess?.(r);
6479
- let e = $s(r);
6480
- e && l(e), tc(r);
6481
- }
6482
- o.kind !== "partial" && i((e) => e?.id === t ? null : e);
6494
+ let r = await n.opts.execute(e), o = $s(r);
6495
+ f(n.title, s, a, o, r), h(n.opts, o, r), o.kind !== "partial" && i((e) => e?.id === t ? null : e);
6483
6496
  } catch (e) {
6484
- f(n.title, s, a, nc(e));
6497
+ f(n.title, s, a, rc(e));
6485
6498
  } finally {
6486
6499
  o((e) => Math.max(0, e - 1)), i((e) => e?.id === t ? {
6487
6500
  ...e,
6488
6501
  pending: !1
6489
6502
  } : e);
6490
6503
  }
6491
- }, [r, f]);
6492
- return /* @__PURE__ */ b(rc.Provider, {
6493
- value: g,
6504
+ }, [
6505
+ r,
6506
+ f,
6507
+ h
6508
+ ]);
6509
+ return /* @__PURE__ */ x(ic.Provider, {
6510
+ value: y,
6494
6511
  children: [
6495
6512
  e,
6496
- c && /* @__PURE__ */ y(Xs, {
6513
+ c && /* @__PURE__ */ b(Zs, {
6497
6514
  open: !0,
6498
6515
  onClose: () => l(null),
6499
6516
  display: c
6500
6517
  }),
6501
- r?.kind === "params" && _ && /* @__PURE__ */ y(Ys, {
6518
+ r?.kind === "params" && S && /* @__PURE__ */ b(Xs, {
6502
6519
  open: !0,
6503
6520
  onOpenChange: (e) => {
6504
6521
  e || i(null);
6505
6522
  },
6506
- action: _,
6523
+ action: S,
6507
6524
  actionName: r.title,
6508
- onSubmit: v,
6525
+ onSubmit: C,
6509
6526
  isPending: r.pending,
6510
- bulkSelection: r.opts.bulkSelection
6527
+ bulkSelection: r.opts.bulkSelection,
6528
+ row: r.opts.row
6511
6529
  }),
6512
- r?.kind === "confirm" && /* @__PURE__ */ y(lc, {
6530
+ r?.kind === "confirm" && /* @__PURE__ */ b(uc, {
6513
6531
  state: r,
6514
6532
  onClose: () => i(null),
6515
6533
  onExecute: async (e) => {
6516
6534
  let t = r.id, n = r, a = n.opts.action, s = n.opts.longRunning ?? a?.long_running ?? !1, c = !1;
6517
6535
  o((e) => e + 1);
6518
6536
  try {
6519
- let t = await n.opts.execute(e), r = Qs(t);
6520
- if (f(n.title, s, a, r, t), r.kind === "success" || r.kind === "accepted") {
6521
- n.opts.onSuccess?.(t);
6522
- let e = $s(t);
6523
- e && l(e), tc(t);
6524
- }
6525
- c = r.kind === "partial";
6537
+ let t = await n.opts.execute(e), r = $s(t);
6538
+ f(n.title, s, a, r, t), h(n.opts, r, t), c = r.kind === "partial";
6526
6539
  } catch (e) {
6527
- f(n.title, s, a, nc(e));
6540
+ f(n.title, s, a, rc(e));
6528
6541
  } finally {
6529
6542
  o((e) => Math.max(0, e - 1)), c || i((e) => e?.id === t ? null : e);
6530
6543
  }
@@ -6533,17 +6546,17 @@ function oc({ children: e }) {
6533
6546
  ]
6534
6547
  });
6535
6548
  }
6536
- function sc(e) {
6537
- return cc(e) ?? cc(e?.result);
6538
- }
6539
6549
  function cc(e) {
6550
+ return lc(e) ?? lc(e?.result);
6551
+ }
6552
+ function lc(e) {
6540
6553
  if (!e || typeof e != "object") return;
6541
6554
  let t = e, n = t.job_id ?? t.id;
6542
6555
  return typeof n == "string" ? n : void 0;
6543
6556
  }
6544
- function lc({ state: e, onClose: n, onExecute: r }) {
6557
+ function uc({ state: e, onClose: n, onExecute: r }) {
6545
6558
  let { title: i, opts: a } = e, [o, s] = p(!1), c = a.action, l = a.destructive ?? c?.destructive ?? !1;
6546
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
6559
+ return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
6547
6560
  onClick: n,
6548
6561
  style: {
6549
6562
  position: "fixed",
@@ -6552,7 +6565,7 @@ function lc({ state: e, onClose: n, onExecute: r }) {
6552
6565
  zIndex: 60,
6553
6566
  backdropFilter: "blur(2px)"
6554
6567
  }
6555
- }), /* @__PURE__ */ b("div", {
6568
+ }), /* @__PURE__ */ x("div", {
6556
6569
  style: {
6557
6570
  position: "fixed",
6558
6571
  top: "50%",
@@ -6566,7 +6579,7 @@ function lc({ state: e, onClose: n, onExecute: r }) {
6566
6579
  border: "1px solid var(--border)",
6567
6580
  overflow: "hidden"
6568
6581
  },
6569
- children: [/* @__PURE__ */ b("div", {
6582
+ children: [/* @__PURE__ */ x("div", {
6570
6583
  style: {
6571
6584
  padding: "14px 18px 0",
6572
6585
  display: "flex",
@@ -6574,7 +6587,7 @@ function lc({ state: e, onClose: n, onExecute: r }) {
6574
6587
  gap: 10
6575
6588
  },
6576
6589
  children: [
6577
- /* @__PURE__ */ y("span", {
6590
+ /* @__PURE__ */ b("span", {
6578
6591
  style: {
6579
6592
  width: 28,
6580
6593
  height: 28,
@@ -6585,18 +6598,18 @@ function lc({ state: e, onClose: n, onExecute: r }) {
6585
6598
  alignItems: "center",
6586
6599
  justifyContent: "center"
6587
6600
  },
6588
- children: y(l ? t.trash : t.bolt, { size: 15 })
6601
+ children: b(l ? t.trash : t.bolt, { size: 15 })
6589
6602
  }),
6590
- /* @__PURE__ */ b("div", {
6603
+ /* @__PURE__ */ x("div", {
6591
6604
  style: { flex: 1 },
6592
- children: [/* @__PURE__ */ y("div", {
6605
+ children: [/* @__PURE__ */ b("div", {
6593
6606
  style: {
6594
6607
  fontSize: 14,
6595
6608
  fontWeight: 600,
6596
6609
  color: "var(--text)"
6597
6610
  },
6598
6611
  children: i
6599
- }), /* @__PURE__ */ y("div", {
6612
+ }), /* @__PURE__ */ b("div", {
6600
6613
  style: {
6601
6614
  fontSize: 11.5,
6602
6615
  color: "var(--text-3)"
@@ -6604,12 +6617,12 @@ function lc({ state: e, onClose: n, onExecute: r }) {
6604
6617
  children: "This cannot be undone. Confirm to proceed."
6605
6618
  })]
6606
6619
  }),
6607
- /* @__PURE__ */ y(D, {
6608
- icon: /* @__PURE__ */ y(t.x, { size: 14 }),
6620
+ /* @__PURE__ */ b(O, {
6621
+ icon: /* @__PURE__ */ b(t.x, { size: 14 }),
6609
6622
  onClick: n
6610
6623
  })
6611
6624
  ]
6612
- }), /* @__PURE__ */ b("div", {
6625
+ }), /* @__PURE__ */ x("div", {
6613
6626
  style: {
6614
6627
  padding: "10px 16px",
6615
6628
  borderTop: "1px solid var(--divider)",
@@ -6619,19 +6632,19 @@ function lc({ state: e, onClose: n, onExecute: r }) {
6619
6632
  background: "var(--surface-2)"
6620
6633
  },
6621
6634
  children: [
6622
- /* @__PURE__ */ y("div", { style: { flex: 1 } }),
6623
- /* @__PURE__ */ y(E, {
6635
+ /* @__PURE__ */ b("div", { style: { flex: 1 } }),
6636
+ /* @__PURE__ */ b(D, {
6624
6637
  onClick: n,
6625
6638
  children: "Cancel"
6626
6639
  }),
6627
- /* @__PURE__ */ y(E, {
6640
+ /* @__PURE__ */ b(D, {
6628
6641
  kind: "primary",
6629
6642
  danger: l,
6630
- icon: y(o ? Se : t.bolt, { size: 13 }),
6643
+ icon: b(o ? Se : t.bolt, { size: 13 }),
6631
6644
  onClick: async () => {
6632
6645
  s(!0);
6633
6646
  try {
6634
- await r(ac(a));
6647
+ await r(oc(a));
6635
6648
  } finally {
6636
6649
  s(!1);
6637
6650
  }
@@ -6644,19 +6657,19 @@ function lc({ state: e, onClose: n, onExecute: r }) {
6644
6657
  }
6645
6658
  //#endregion
6646
6659
  //#region src/hooks/useCurrentScreen.tsx
6647
- var uc = i(void 0);
6648
- function dc({ code: e, children: t }) {
6649
- let { data: n } = J(), r = d(() => ({
6660
+ var dc = i(void 0);
6661
+ function fc({ code: e, children: t }) {
6662
+ let { data: n } = Y(), r = d(() => ({
6650
6663
  code: e,
6651
6664
  screen: n?.screens[e]
6652
6665
  }), [e, n]);
6653
- return /* @__PURE__ */ y(uc.Provider, {
6666
+ return /* @__PURE__ */ b(dc.Provider, {
6654
6667
  value: r,
6655
6668
  children: t
6656
6669
  });
6657
6670
  }
6658
- function fc() {
6659
- return c(uc);
6671
+ function pc() {
6672
+ return c(dc);
6660
6673
  }
6661
6674
  //#endregion
6662
- export { Cr as $, lt as $t, Ni as A, Te as An, W as At, $r as B, M as Bn, Ot as Bt, Sa as C, Ce as Cn, Bn as Ct, sa as D, Ie as Dn, Mn as Dt, na as E, Re as En, jn as Et, Oi as F, be as Fn, gn as Ft, Pr as G, D as Gn, _t as Gt, Jr as H, A as Hn, St as Ht, pi as I, ue as In, Ft as It, kr as J, ht as Jt, Nr as K, E as Kn, vt as Kt, di as L, ve as Ln, Rt as Lt, Ai as M, Le as Mn, q as Mt, Di as N, Se as Nn, hn as Nt, oa as O, P as On, Rn as Ot, ki as P, xe as Pn, _n as Pt, Sr as Q, st as Qt, ri as R, pe as Rn, zt as Rt, ya as S, ke as Sn, zn as St, ba as T, Ne as Tn, Pn as Tt, X as U, k as Un, Ct as Ut, Zr as V, se as Vn, wt as Vt, Mr as W, O as Wn, Dt as Wt, wr as X, z as Xt, Er as Y, mt as Yt, Tr as Z, ct as Zt, ls as _, L as _n, Un as _t, Xs as a, Ye as an, Xn as at, Ta as b, F as bn, Nn as bt, Fs as c, Ve as cn, Kn as ct, ks as d, Ze as dn, Zn as dt, Be as en, mr as et, Cs as f, tt as fn, rr as ft, ds as g, nt as gn, J as gt, ms as h, Je as hn, Jn as ht, ic as i, qe as in, Yn as it, ji as j, N as jn, K as jt, ta as k, Pe as kn, Fn as kt, Bs as l, R as ln, Gn as lt, gs as m, Qe as mn, or as mt, fc as n, it as nn, tr as nt, Ys as o, Xe as on, cr as ot, Os as p, $e as pn, sr as pt, jr as q, yt as qt, oc as r, at as rn, qn as rt, Ps as s, Ge as sn, Qn as st, dc as t, rt as tn, $n as tt, As as u, I as un, lr as ut, wa as v, We as vn, Hn as vt, ua as w, Fe as wn, Ln as wt, Z as x, ze as xn, Vn as xt, Ea as y, et as yn, An as yt, ei as z, ye as zn, kt as zt };
6675
+ export { Cr as $, lt as $t, Ni as A, Te as An, G as At, $r as B, N as Bn, Ot as Bt, Sa as C, Ce as Cn, Bn as Ct, sa as D, Ie as Dn, Mn as Dt, na as E, Re as En, jn as Et, Oi as F, be as Fn, gn as Ft, Pr as G, O as Gn, _t as Gt, Jr as H, j as Hn, St as Ht, pi as I, ue as In, Ft as It, kr as J, ht as Jt, Nr as K, D as Kn, vt as Kt, di as L, ve as Ln, Rt as Lt, Ai as M, Le as Mn, J as Mt, Di as N, Se as Nn, hn as Nt, oa as O, F as On, Rn as Ot, ki as P, xe as Pn, _n as Pt, Sr as Q, st as Qt, ri as R, pe as Rn, zt as Rt, ya as S, ke as Sn, zn as St, ba as T, Ne as Tn, Pn as Tt, Z as U, A as Un, Ct as Ut, Zr as V, se as Vn, wt as Vt, Mr as W, k as Wn, Dt as Wt, wr as X, B as Xt, Er as Y, mt as Yt, Tr as Z, ct as Zt, ls as _, R as _n, Un as _t, Zs as a, Ye as an, Xn as at, Ta as b, I as bn, Nn as bt, Is as c, Ve as cn, Kn as ct, As as d, Ze as dn, Zn as dt, Be as en, mr as et, ws as f, tt as fn, rr as ft, ds as g, nt as gn, Y as gt, ms as h, Je as hn, Jn as ht, ac as i, qe as in, Yn as it, ji as j, P as jn, q as jt, ta as k, Pe as kn, Fn as kt, Vs as l, z as ln, Gn as lt, gs as m, Qe as mn, or as mt, pc as n, it as nn, tr as nt, Xs as o, Xe as on, cr as ot, ks as p, $e as pn, sr as pt, jr as q, yt as qt, sc as r, at as rn, qn as rt, Fs as s, Ge as sn, Qn as st, fc as t, rt as tn, $n as tt, js as u, L as un, lr as ut, wa as v, We as vn, Hn as vt, ua as w, Fe as wn, Ln as wt, Q as x, ze as xn, Vn as xt, Ea as y, et as yn, An as yt, ei as z, ye as zn, kt as zt };