@declarion/react 0.45.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist-lib/{DraggableChildrenTable-BDnJK0AU.js → DraggableChildrenTable-B6KjWkwD.js} +2 -2
  2. package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
  3. package/dist-lib/{Grid-CcCveEE7.js → Grid-OdquWJNX.js} +2 -2
  4. package/dist-lib/{LayoutRenderer-BReuhVdX.js → LayoutRenderer-CzAdhjNT.js} +525 -518
  5. package/dist-lib/{MarkdownRenderer-DPKDFR60.js → MarkdownRenderer-C6bhrAIe.js} +10 -10
  6. package/dist-lib/{RefreshControl-KddgOhUG.js → RefreshControl-F9Ib9asP.js} +18 -18
  7. package/dist-lib/{SmartDetailPage.impl-D_hMxiHy.js → SmartDetailPage.impl-DdSu3kmW.js} +305 -294
  8. package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-SkIp0_Rd.js} +165 -154
  9. package/dist-lib/api/agents.d.ts +39 -7
  10. package/dist-lib/components/agents/AgentChatPanel.d.ts +6 -1
  11. package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
  12. package/dist-lib/components/file-widgets/host.d.ts +1 -0
  13. package/dist-lib/components/list/QuickPeek.d.ts +1 -1
  14. package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
  15. package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
  16. package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
  17. package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
  18. package/dist-lib/hooks/useAgentConversation.d.ts +7 -19
  19. package/dist-lib/hooks/useFilters.d.ts +1 -0
  20. package/dist-lib/icons.js +1 -1
  21. package/dist-lib/index.d.ts +8 -1
  22. package/dist-lib/index.js +3031 -2674
  23. package/dist-lib/lib/actions.d.ts +1 -1
  24. package/dist-lib/lib/filter-evaluator.d.ts +16 -0
  25. package/dist-lib/lib/filters.d.ts +10 -4
  26. package/dist-lib/lib/messages.d.ts +1 -0
  27. package/dist-lib/lib/variants.d.ts +7 -0
  28. package/dist-lib/{registry-DJKp0yaV.js → registry-C2VD-5MD.js} +571 -347
  29. package/dist-lib/testing.js +1 -1
  30. package/dist-lib/types/schema.d.ts +26 -0
  31. package/dist-lib/{useCurrentScreen-A3xZDs7U.js → useCurrentScreen-ow4r-nWa.js} +721 -693
  32. package/dist-lib/{useProperties-TlltWwLv.js → useProperties-lEKfzm2X.js} +92 -61
  33. package/dist-lib/{value-CHY7LgZ-.js → value-CXohNH6a.js} +1 -1
  34. package/dist-lib/vite/index.js +23 -22
  35. package/package.json +12 -12
@@ -1,19 +1,19 @@
1
- import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
2
- import { $ as n, A as r, At as i, C as a, Cn as o, Ct as s, D as c, Dn as l, F as u, Fn as d, In as f, L as p, Ln as m, N as h, Q as g, Sn as _, Tn as v, Zn as y, _ as b, bn as x, bt as S, cr as C, dt as ee, gt as w, i as T, it as te, j as ne, jt as re, kn as ie, lr as ae, pt as oe, rr as se, un as ce, ur as E, wn as le, wt as D, xn as ue, yn as de } from "./useCurrentScreen-A3xZDs7U.js";
3
- import { E as fe, L as O, R as k, V as A, _ as j, b as pe, c as me, d as he, f as ge, m as _e, n as ve, o as ye, r as be, t as xe, w as Se } from "./RefreshControl-KddgOhUG.js";
4
- import { E as Ce, F as we, G as Te, I as Ee, J as De, K as Oe, M as ke, O as Ae, U as je, W as Me, Y as Ne, _ as Pe, a as Fe, i as Ie, it as Le, j as Re, k as ze, mt as Be, q as Ve, s as He, ut as Ue, w as We } from "./registry-DJKp0yaV.js";
5
- import { n as Ge, r as Ke, t as qe } from "./dataTableStyles-vwD1mVOP.js";
6
- import { n as Je, t as Ye } from "./LayoutRenderer-BReuhVdX.js";
7
- import { Fragment as Xe, useCallback as M, useEffect as N, useMemo as P, useRef as Ze, useState as F } from "react";
8
- import { useLocation as Qe, useParams as $e, useSearchParams as et } from "react-router";
9
- import { useQuery as I, useQueryClient as L } from "@tanstack/react-query";
10
- import { Fragment as tt, jsx as R, jsxs as z } from "react/jsx-runtime";
1
+ import { s as e, t } from "./DynamicIcon-Dc2j-rg_.js";
2
+ import { $ as n, A as r, At as i, C as a, Cn as o, Ct as s, D as c, Dn as l, F as u, Fn as d, In as f, L as p, Ln as m, N as h, Q as g, Sn as _, Tn as v, Zn as y, _ as b, bn as x, bt as S, cr as C, dt as ee, gt as w, i as T, it as te, j as ne, jt as re, kn as ie, lr as ae, pt as oe, rr as se, un as ce, ur as E, wn as le, wt as D, xn as ue, yn as de } from "./useCurrentScreen-ow4r-nWa.js";
3
+ import { E as fe, L as O, R as k, V as A, _ as j, b as pe, c as me, d as he, f as ge, m as _e, n as ve, o as ye, r as be, t as xe, w as Se } from "./RefreshControl-F9Ib9asP.js";
4
+ import { $ as Ce, A as we, D as Te, H as Ee, L as De, M as Oe, P as ke, Q as Ae, T as je, U as Me, X as Ne, Z as Pe, _t as Fe, a as Ie, dt as Le, et as Re, i as ze, k as Be, nt as Ve, s as He, tt as Ue, v as We, xt as Ge, z as Ke } from "./registry-C2VD-5MD.js";
5
+ import { n as qe, r as Je, t as M } from "./dataTableStyles-vwD1mVOP.js";
6
+ import { n as Ye, t as Xe } from "./LayoutRenderer-CzAdhjNT.js";
7
+ import { Fragment as Ze, useCallback as N, useEffect as P, useMemo as F, useRef as Qe, useState as I } from "react";
8
+ import { useLocation as $e, useParams as et, useSearchParams as tt } from "react-router";
9
+ import { useQuery as L, useQueryClient as nt } from "@tanstack/react-query";
10
+ import { Fragment as rt, jsx as R, jsxs as z } from "react/jsx-runtime";
11
11
  //#region src/components/shared/AssociationTabs.tsx
12
- function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
13
- let a = P(() => Object.entries(r), [r]), [o, s] = F(0);
12
+ function it({ entityCode: e, recordId: n, associations: r, schema: i }) {
13
+ let a = F(() => Object.entries(r), [r]), [o, s] = I(0);
14
14
  if (a.length === 0) return null;
15
15
  let [c, l] = a[o];
16
- return /* @__PURE__ */ R(Be, {
16
+ return /* @__PURE__ */ R(Ge, {
17
17
  title: /* @__PURE__ */ R("div", {
18
18
  style: {
19
19
  display: "flex",
@@ -52,7 +52,7 @@ function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
52
52
  }),
53
53
  collapsible: !1,
54
54
  padding: "0",
55
- children: /* @__PURE__ */ R(rt, {
55
+ children: /* @__PURE__ */ R(B, {
56
56
  entityCode: e,
57
57
  recordId: n,
58
58
  assocKey: c,
@@ -61,15 +61,15 @@ function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
61
61
  })
62
62
  });
63
63
  }
64
- function rt({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c }) {
65
- let l = Le(), u = r(), d = `${t}.${i}`, { data: f, isLoading: p } = I({
64
+ function B({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c }) {
65
+ let l = Le(), u = r(), d = `${t}.${i}`, { data: f, isLoading: p } = L({
66
66
  queryKey: [
67
67
  "association",
68
68
  d,
69
69
  n
70
70
  ],
71
71
  queryFn: () => D(d, [n])
72
- }), m = f?.target_entity ?? o.target, h = c.entities[m], g = P(() => f?.ids ?? [], [f?.ids]), y = P(() => h?.fields.names().find((e) => h.fields.get(e)?.primary) ?? "id", [h]), b = P(() => g.slice(0, 50), [g]), { data: x, isLoading: S } = I({
72
+ }), m = f?.target_entity ?? o.target, h = c.entities[m], g = F(() => f?.ids ?? [], [f?.ids]), y = F(() => h?.fields.names().find((e) => h.fields.get(e)?.primary) ?? "id", [h]), b = F(() => g.slice(0, 50), [g]), { data: x, isLoading: S } = L({
73
73
  queryKey: [
74
74
  "association-records",
75
75
  m,
@@ -84,7 +84,7 @@ function rt({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c
84
84
  }]
85
85
  }),
86
86
  enabled: b.length > 0 && !!h
87
- }), C = x?.data ?? [], ee = x?.$refs, w = P(() => h ? h.fields.names().filter((e) => {
87
+ }), C = x?.data ?? [], ee = x?.$refs, w = F(() => h ? h.fields.names().filter((e) => {
88
88
  let t = h.fields.get(e);
89
89
  return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
90
90
  }).slice(0, 6) : [], [h]), T = () => {
@@ -122,14 +122,14 @@ function rt({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c
122
122
  style: { padding: "8px 0" },
123
123
  children: [
124
124
  /* @__PURE__ */ z("table", {
125
- style: Ke,
125
+ style: Je,
126
126
  children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ R("tr", { children: w.map((e) => /* @__PURE__ */ R("th", {
127
- style: Ge,
127
+ style: qe,
128
128
  children: _(h.fields.get(e), e, c.entities)
129
129
  }, e)) }) }), /* @__PURE__ */ R("tbody", { children: C.map((e, t) => /* @__PURE__ */ R("tr", { children: w.map((t) => {
130
130
  let n = h.fields.get(t);
131
131
  return n ? /* @__PURE__ */ R("td", {
132
- style: qe,
132
+ style: M,
133
133
  children: ne({
134
134
  field: n,
135
135
  fieldName: t,
@@ -174,12 +174,12 @@ function rt({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c
174
174
  }
175
175
  //#endregion
176
176
  //#region src/components/pages/RecordDocumentsPanel.tsx
177
- var B = 4e3;
178
- function V(e) {
179
- return e?.some((e) => e.status === "pending") ? B : !1;
177
+ var V = 4e3;
178
+ function H(e) {
179
+ return e?.some((e) => e.status === "pending") ? V : !1;
180
180
  }
181
- function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
182
- let { data: a, isLoading: o, error: s } = I({
181
+ function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
182
+ let { data: a, isLoading: o, error: s } = L({
183
183
  queryKey: [
184
184
  j,
185
185
  t,
@@ -190,22 +190,22 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
190
190
  object_id: n
191
191
  })).result?.documents ?? [],
192
192
  enabled: !!(t && n) && (!!r || !!i),
193
- refetchInterval: (e) => V(e.state.data)
193
+ refetchInterval: (e) => H(e.state.data)
194
194
  }), c = (a?.length ?? 0) > 0;
195
- return !r && !c ? null : /* @__PURE__ */ z(Be, {
196
- title: /* @__PURE__ */ R(H, {}),
195
+ return !r && !c ? null : /* @__PURE__ */ z(Ge, {
196
+ title: /* @__PURE__ */ R(ot, {}),
197
197
  collapsible: !1,
198
198
  padding: "0",
199
199
  children: [
200
- o && /* @__PURE__ */ R(U, {
200
+ o && /* @__PURE__ */ R(W, {
201
201
  icon: /* @__PURE__ */ R(e.loader, { size: 14 }),
202
202
  text: "Loading documents..."
203
203
  }),
204
- s && /* @__PURE__ */ R(U, {
204
+ s && /* @__PURE__ */ R(W, {
205
205
  icon: /* @__PURE__ */ R(e.warning, { size: 14 }),
206
206
  text: s instanceof Error ? s.message : String(s)
207
207
  }),
208
- !o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ R(U, {
208
+ !o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ R(W, {
209
209
  icon: /* @__PURE__ */ R(e.file, { size: 14 }),
210
210
  text: "No generated documents"
211
211
  }),
@@ -214,7 +214,7 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
214
214
  display: "flex",
215
215
  flexDirection: "column"
216
216
  },
217
- children: a.map((e) => /* @__PURE__ */ R(at, {
217
+ children: a.map((e) => /* @__PURE__ */ R(U, {
218
218
  entityCode: t,
219
219
  objectId: n,
220
220
  doc: e
@@ -223,7 +223,7 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
223
223
  ]
224
224
  });
225
225
  }
226
- function H() {
226
+ function ot() {
227
227
  return /* @__PURE__ */ z("div", {
228
228
  style: {
229
229
  display: "flex",
@@ -238,8 +238,8 @@ function H() {
238
238
  children: [/* @__PURE__ */ R(e.file, { size: 13 }), "Documents"]
239
239
  });
240
240
  }
241
- function at({ entityCode: t, objectId: r, doc: i }) {
242
- let a = L(), [o, s] = F(!1), [c, l] = F(!1), [u, d] = F(!1), [f, p] = F(!1), [m, h] = F(null), _ = v(i.title) || i.filename || i.template_code, y = i.status === "ready" && i.download_url && !f;
241
+ function U({ entityCode: t, objectId: r, doc: i }) {
242
+ let a = nt(), [o, s] = I(!1), [c, l] = I(!1), [u, d] = I(!1), [f, p] = I(!1), [m, h] = I(null), _ = v(i.title) || i.filename || i.template_code, y = i.status === "ready" && i.download_url && !f;
243
243
  async function b() {
244
244
  s(!0), h(null);
245
245
  try {
@@ -375,7 +375,7 @@ function at({ entityCode: t, objectId: r, doc: i }) {
375
375
  })]
376
376
  });
377
377
  }
378
- function U({ icon: e, text: t }) {
378
+ function W({ icon: e, text: t }) {
379
379
  return /* @__PURE__ */ z("div", {
380
380
  style: {
381
381
  display: "flex",
@@ -390,7 +390,7 @@ function U({ icon: e, text: t }) {
390
390
  }
391
391
  //#endregion
392
392
  //#region src/components/detail-layout/ErrorSummary.tsx
393
- function ot({ errors: t, onJump: n }) {
393
+ function st({ errors: t, onJump: n }) {
394
394
  if (t.length === 0) return null;
395
395
  let r = t.length !== 1;
396
396
  return /* @__PURE__ */ z("div", {
@@ -477,7 +477,7 @@ function ot({ errors: t, onJump: n }) {
477
477
  }
478
478
  //#endregion
479
479
  //#region src/components/shared/HighlightsStrip.tsx
480
- function W({ items: e }) {
480
+ function ct({ items: e }) {
481
481
  return e.length === 0 ? null : /* @__PURE__ */ R("div", {
482
482
  style: {
483
483
  display: "flex",
@@ -486,7 +486,7 @@ function W({ items: e }) {
486
486
  gap: "6px 0",
487
487
  fontSize: 12
488
488
  },
489
- children: e.map((e, t) => /* @__PURE__ */ z(Xe, { children: [t > 0 && /* @__PURE__ */ R("span", { style: {
489
+ children: e.map((e, t) => /* @__PURE__ */ z(Ze, { children: [t > 0 && /* @__PURE__ */ R("span", { style: {
490
490
  width: 1,
491
491
  height: 12,
492
492
  background: "var(--divider)",
@@ -513,7 +513,7 @@ function W({ items: e }) {
513
513
  }
514
514
  //#endregion
515
515
  //#region src/components/detail-layout/DetailHighlights.tsx
516
- function st({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
516
+ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
517
517
  let c = e.highlights;
518
518
  if (!c || c.length === 0) return null;
519
519
  let l = [];
@@ -535,7 +535,7 @@ function st({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
535
535
  continue;
536
536
  }
537
537
  if (t.fields.get(e) || t.files?.get(e)) {
538
- let a = Ve({
538
+ let a = Re({
539
539
  entity: t,
540
540
  entityCode: n,
541
541
  fieldName: e,
@@ -548,21 +548,21 @@ function st({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
548
548
  locale: s
549
549
  });
550
550
  l.push({
551
- label: De(t, e, o.entities),
551
+ label: Ue(t, e, o.entities),
552
552
  value: a
553
553
  });
554
554
  continue;
555
555
  }
556
556
  }
557
- return l.length === 0 ? null : /* @__PURE__ */ R(W, { items: l });
557
+ return l.length === 0 ? null : /* @__PURE__ */ R(ct, { items: l });
558
558
  }
559
559
  //#endregion
560
560
  //#region src/components/shared/AuditMetaStrip.tsx
561
- function ct(e) {
561
+ function ut(e) {
562
562
  return e.by != null || e.at != null;
563
563
  }
564
- function lt({ lines: e }) {
565
- let t = e.filter(ct);
564
+ function dt({ lines: e }) {
565
+ let t = e.filter(ut);
566
566
  return t.length === 0 ? null : /* @__PURE__ */ R("div", {
567
567
  style: {
568
568
  display: "flex",
@@ -575,10 +575,10 @@ function lt({ lines: e }) {
575
575
  fontSize: 11.5,
576
576
  color: "var(--text-3)"
577
577
  },
578
- children: t.map((e, t) => /* @__PURE__ */ R(ut, { line: e }, t))
578
+ children: t.map((e, t) => /* @__PURE__ */ R(G, { line: e }, t))
579
579
  });
580
580
  }
581
- function ut({ line: e }) {
581
+ function G({ line: e }) {
582
582
  return /* @__PURE__ */ z("div", {
583
583
  style: {
584
584
  display: "flex",
@@ -620,13 +620,13 @@ function ut({ line: e }) {
620
620
  }
621
621
  //#endregion
622
622
  //#region src/components/detail-layout/DetailAuditStrip.tsx
623
- function dt({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a, locale: o }) {
623
+ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a, locale: o }) {
624
624
  let s = e.audit;
625
625
  if (s?.enabled === !1) return null;
626
626
  let c = (e) => {
627
627
  if (!e || !t.fields.get(e)) return;
628
628
  let s = r[e];
629
- if (!(s == null || s === "")) return Ve({
629
+ if (s != null && s !== "") return Re({
630
630
  entity: t,
631
631
  entityCode: n,
632
632
  fieldName: e,
@@ -638,8 +638,7 @@ function dt({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
638
638
  surface: "list",
639
639
  locale: o
640
640
  });
641
- };
642
- return /* @__PURE__ */ R(lt, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
641
+ }, l = s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
643
642
  label: v(e.label),
644
643
  at: c(e.at),
645
644
  by: c(e.by)
@@ -651,17 +650,18 @@ function dt({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
651
650
  label: "Updated",
652
651
  at: c("updated_at"),
653
652
  by: c("updated_by")
654
- }] });
653
+ }];
654
+ return /* @__PURE__ */ R(dt, { lines: l });
655
655
  }
656
656
  //#endregion
657
657
  //#region src/components/detail-layout/EvidenceBlock.tsx
658
- function G(e) {
658
+ function pt(e) {
659
659
  if (!e) return;
660
660
  let t = new Date(e);
661
661
  if (!Number.isNaN(t.getTime())) return t.toLocaleString();
662
662
  }
663
- function ft({ evidence: e }) {
664
- let t = e?.verdict ?? "unverified", n = G(e?.verified_at), r = [];
663
+ function mt({ evidence: e }) {
664
+ let t = e?.verdict ?? "unverified", n = pt(e?.verified_at), r = [];
665
665
  return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */ z("div", {
666
666
  style: {
667
667
  display: "flex",
@@ -709,7 +709,7 @@ function ft({ evidence: e }) {
709
709
  }
710
710
  //#endregion
711
711
  //#region src/components/shared/RecordHeader.tsx
712
- function pt({ icon: t, avatarName: n, title: r, recordId: i, description: a, highlights: o, mode: s, dirty: c = !1, showBack: l = !1, onBack: u, right: d, identityControls: f, showTitle: p = !0 }) {
712
+ function ht({ icon: t, avatarName: n, title: r, recordId: i, description: a, highlights: o, mode: s, dirty: c = !1, showBack: l = !1, onBack: u, right: d, identityControls: f, showTitle: p = !0 }) {
713
713
  let m = se(), h = m.category === "phone" || m.width <= 520;
714
714
  return /* @__PURE__ */ z("div", {
715
715
  style: {
@@ -836,7 +836,7 @@ function pt({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
836
836
  }
837
837
  //#endregion
838
838
  //#region src/lib/children-validation.ts
839
- function mt(e, t, n) {
839
+ function gt(e, t, n) {
840
840
  let r = [];
841
841
  for (let [i, a] of e.fields) {
842
842
  if (!a.required || a.auto || n && a.primary || e.tenant_key && i === e.tenant_key || a.default !== void 0 && a.default !== null) continue;
@@ -845,17 +845,17 @@ function mt(e, t, n) {
845
845
  }
846
846
  return r;
847
847
  }
848
- var ht = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
849
- function gt(e, t) {
848
+ var _t = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
849
+ function vt(e, t) {
850
850
  let n = [];
851
851
  for (let [r, i] of e.fields) {
852
852
  if (i.type !== "email") continue;
853
853
  let e = t[r];
854
- typeof e == "string" && e !== "" && !ht.test(e) && n.push(r);
854
+ typeof e == "string" && e !== "" && !_t.test(e) && n.push(r);
855
855
  }
856
856
  return n;
857
857
  }
858
- function _t(e, t) {
858
+ function K(e, t) {
859
859
  let n = /* @__PURE__ */ new Set();
860
860
  for (let r of Object.values(t.entities)) if (r.children) {
861
861
  for (let t of r.children) if (t.entity === e && t.foreign_key) {
@@ -865,13 +865,13 @@ function _t(e, t) {
865
865
  }
866
866
  return n;
867
867
  }
868
- function vt(e, t) {
868
+ function yt(e, t) {
869
869
  if (!e || !t) return {};
870
870
  let n = {};
871
871
  for (let [r, i] of Object.entries(e)) {
872
872
  let e = t.entities[r];
873
873
  if (!e) continue;
874
- let a = _t(r, t), o = [];
874
+ let a = K(r, t), o = [];
875
875
  for (let [t, n] of e.fields) e.tenant_key && t === e.tenant_key || n.required && !n.auto && !n.primary && !a.has(t) && o.push(t);
876
876
  if (o.length !== 0) for (let e of i) {
877
877
  if (e._deleted) continue;
@@ -887,29 +887,29 @@ function vt(e, t) {
887
887
  }
888
888
  //#endregion
889
889
  //#region src/components/pages/SmartDetailPage.impl.tsx
890
- var yt = () => {};
891
- function bt(e, t) {
890
+ var bt = () => {};
891
+ function xt(e, t) {
892
892
  return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
893
893
  }
894
- function xt(e, t) {
894
+ function St(e, t) {
895
895
  if (e) {
896
- let n = ie(ue(e, t));
897
- if (n.replace(/^\|+|\|+$/g, "")) return n;
896
+ let n = ue(e, t), r = ie(n);
897
+ if (r.replace(/^\|+|\|+$/g, "")) return r;
898
898
  }
899
899
  return t.id == null ? crypto.randomUUID() : m(t.id);
900
900
  }
901
- function K({ screenCode: e }) {
902
- return /* @__PURE__ */ R(h, { children: /* @__PURE__ */ R(q, { screenCode: e }) });
901
+ function q({ screenCode: e }) {
902
+ return /* @__PURE__ */ R(h, { children: /* @__PURE__ */ R(Ct, { screenCode: e }) });
903
903
  }
904
- function q({ screenCode: t }) {
905
- let { id: n } = $e(), a = te(), [s, c] = et(), { data: m } = i(), h = re((e) => e.user), g = u(), y = se(), b = m?.screens[t], S = b?.entity ? m?.entities[b.entity] : void 0, C = b?.entity, w = x(S, "create"), T = x(S, "update"), ne = x(S, "restore"), E = (() => {
904
+ function Ct({ screenCode: t }) {
905
+ let { id: n } = et(), a = te(), [s, c] = tt(), { data: m } = i(), h = re((e) => e.user), g = u(), y = se(), b = m?.screens[t], S = b?.entity ? m?.entities[b.entity] : void 0, C = b?.entity, w = x(S, "create"), T = x(S, "update"), ne = x(S, "restore"), E = (() => {
906
906
  if (!S || !S.singleton || !S.prefilter) return;
907
907
  let e = le(S);
908
908
  if (e.length !== 1) return;
909
909
  let t = S.prefilter[e[0]];
910
910
  if (t === "$caller.user_id") return h?.id;
911
911
  if (t === "$caller.tenant_id") return h?.tenant?.id;
912
- })(), D = E !== void 0, O = D ? E : n, k = !D && O === "new", A = P(() => {
912
+ })(), D = E !== void 0, O = D ? E : n, k = !D && O === "new", A = F(() => {
913
913
  if (!O || k) return;
914
914
  if (!S) return O;
915
915
  let e = le(S);
@@ -923,16 +923,16 @@ function q({ screenCode: t }) {
923
923
  O,
924
924
  k,
925
925
  S
926
- ]), j = P(() => {
926
+ ]), j = F(() => {
927
927
  if (A) return typeof A == "string" ? A : ie(A);
928
- }, [A]), ge = Fe(C, A), { data: _e, isLoading: ve, error: be } = ge, xe = Ee((e) => e.degradedEntities), De = C ? we(S?.realtime, xe, C) : !1;
929
- pe(Ie(C, A), !k);
930
- let ke = Ce(C ?? ""), Le = ze(C ?? ""), Re = Ae(C ?? ""), Be = Object.keys(S?.status_groups ?? {}).length > 0, Ve = _e?.data, Ge = Ve?.$statuses, Ke = Ve?.$properties, qe = s.get("edit") === "true", [Xe, I] = F(k || qe), [L, rt] = F({}), [B, V] = F({}), [H, at] = F({}), [U, W] = F(void 0), [ct, lt] = F(!1), [ut, G] = F(void 0), [pt, ht] = F(!1), _t = k ? w : T, K = Xe && _t, q = oe();
928
+ }, [A]), ge = Ie(C, A), { data: _e, isLoading: ve, error: be } = ge, xe = Me((e) => e.degradedEntities), De = C ? Ee(S?.realtime, xe, C) : !1;
929
+ pe(ze(C, A), !k);
930
+ let Oe = Te(C ?? ""), Le = we(C ?? ""), Re = Be(C ?? ""), Ue = Object.keys(S?.status_groups ?? {}).length > 0, Ge = _e?.data, Ke = Ge?.$statuses, qe = Ge?.$properties, Je = s.get("edit") === "true", [M, Ze] = I(k || Je), [L, nt] = I({}), [B, V] = I({}), [H, ot] = I({}), [U, W] = I(void 0), [ct, ut] = I(!1), [dt, G] = I(void 0), [pt, ht] = I(!1), _t = k ? w : T, K = M && _t, q = oe();
931
931
  ee(K && !k, q.enabled);
932
- let [Ct, wt] = F(() => {
932
+ let [Ct, Tt] = I(() => {
933
933
  let e = parseInt(b?.sidebar_width || "380", 10);
934
934
  return isNaN(e) ? 380 : e;
935
- }), Et = Ze(null), J = Ze(null), Dt = M((e) => {
935
+ }), Et = Qe(null), J = Qe(null), Ot = N((e) => {
936
936
  e.preventDefault();
937
937
  let t = Et.current;
938
938
  if (!t) return;
@@ -946,28 +946,33 @@ function q({ screenCode: t }) {
946
946
  let n = J.current.startX - e.clientX, r = Math.max(280, Math.min(800, J.current.startW + n));
947
947
  t.style.width = `${r}px`;
948
948
  }, i = () => {
949
- J.current && t && wt(parseInt(t.style.width, 10) || J.current.startW), J.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
949
+ J.current && t && Tt(parseInt(t.style.width, 10) || J.current.startW), J.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
950
950
  };
951
951
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
952
- }, []), Y = _e?.data, X = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, Ot = Y?.$refs, kt = Ze(X);
953
- N(() => {
954
- if (!X) return;
955
- let e = kt.current;
956
- kt.current = X, e && e !== X && Xe && lt(!0);
957
- }, [Xe, X]);
958
- let At = !!S?.soft_delete && Y != null && Y[S.soft_delete] != null, Z = Qe(), jt = Ze(null);
959
- me({ scrollElementRef: jt });
960
- let Mt = !k && be instanceof ce && be.status === 404, Nt = k && !de(S), Pt = Ze(null);
961
- N(() => {
962
- if (!Mt) return;
963
- let e = Se(Z);
964
- Pt.current !== e && (Pt.current = e, fe.getState().kill(e));
965
- }, [Mt, Z]);
966
- let { openTab: Ft, updateTabTitle: It, findTabByPathname: Lt } = Ue();
967
- N(() => {
952
+ }, []), Y = _e?.data, X = ke(S, b, Y ?? {});
953
+ P(() => {
954
+ let e = parseInt(X?.sidebar_width || "380", 10);
955
+ Tt(Number.isNaN(e) ? 380 : e);
956
+ }, [X?.sidebar_width]);
957
+ let Z = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, kt = Y?.$refs, At = Qe(Z);
958
+ P(() => {
959
+ if (!Z) return;
960
+ let e = At.current;
961
+ At.current = Z, e && e !== Z && M && ut(!0);
962
+ }, [M, Z]);
963
+ let jt = !!S?.soft_delete && Y != null && Y[S.soft_delete] != null, Mt = $e(), Nt = Qe(null);
964
+ me({ scrollElementRef: Nt });
965
+ let Pt = !k && be instanceof ce && be.status === 404, Ft = k && !de(S), It = Qe(null);
966
+ P(() => {
967
+ if (!Pt) return;
968
+ let e = Se(Mt);
969
+ It.current !== e && (It.current = e, fe.getState().kill(e));
970
+ }, [Pt, Mt]);
971
+ let { openTab: Lt, updateTabTitle: Rt, findTabByPathname: zt } = Fe();
972
+ P(() => {
968
973
  if (!S || D || q.enabled) return;
969
- let e = Z.pathname, t = v(b?.display?.name) || v(S.display.name), n = b?.display?.icon || S.display.icon;
970
- Lt(e) || Ft({
974
+ let e = Mt.pathname, t = v(X?.display?.name) || v(S.display.name), n = X?.display?.icon || S.display.icon;
975
+ zt(e) || Lt({
971
976
  pathname: e,
972
977
  search: "",
973
978
  title: k ? `New ${t}` : t,
@@ -975,61 +980,64 @@ function q({ screenCode: t }) {
975
980
  closable: !0
976
981
  });
977
982
  }, [
978
- Z.pathname,
979
- b?.display?.name?.en,
983
+ Mt.pathname,
984
+ X?.display?.name?.en,
980
985
  S?.display.name?.en,
981
- b?.display?.icon,
986
+ X?.display?.icon,
982
987
  S?.display.icon,
983
988
  k,
984
989
  D,
985
990
  q.enabled
986
- ]), N(() => {
991
+ ]), P(() => {
987
992
  if (!Y || !S || D || q.enabled) return;
988
- let e = Lt(Z.pathname);
993
+ let e = zt(Mt.pathname);
989
994
  if (e) {
990
- let t = v(b?.display?.name) || v(S.display.name), n = o(Y, S), r = n && !String(n).startsWith("/") ? String(n) : t;
991
- It(e.id, r);
995
+ let t = v(X?.display?.name) || v(S.display.name), n = o(Y, S), r = n && !String(n).startsWith("/") ? String(n) : t;
996
+ Rt(e.id, r);
992
997
  }
993
998
  }, [
994
999
  Y,
995
1000
  S?.display.name?.en,
996
1001
  S?.display.display_field,
997
- Z.pathname,
1002
+ Mt.pathname,
998
1003
  D,
999
1004
  q.enabled
1000
1005
  ]);
1001
- let Rt = P(() => {
1006
+ let Bt = F(() => {
1002
1007
  if (!S || !_t) return /* @__PURE__ */ new Set();
1003
1008
  let e = /* @__PURE__ */ new Set();
1004
1009
  for (let [t, n] of S.fields) !n.auto && !n.primary && e.add(t);
1005
1010
  for (let [t] of S.files ?? []) e.add(t);
1006
1011
  return e;
1007
1012
  }, [S, _t]);
1008
- N(() => {
1009
- if (!(!qe || !Y || !S || !T)) {
1010
- if (Xe || I(!0), Object.keys(L).length === 0) {
1013
+ P(() => {
1014
+ if (!(!Je || !Y || !S || !T)) {
1015
+ if (M || Ze(!0), Object.keys(L).length === 0) {
1011
1016
  let e = O ? ye(O) : null;
1012
- e && Me(je({
1013
- entity: S,
1014
- formData: e,
1015
- record: void 0,
1016
- isNew: !0
1017
- })).forEach((e) => {
1018
- g.registerDraft({
1019
- fileId: e,
1020
- discard: () => p(e)
1017
+ if (e) {
1018
+ let t = Ne({
1019
+ entity: S,
1020
+ formData: e,
1021
+ record: void 0,
1022
+ isNew: !0
1023
+ });
1024
+ Pe(t).forEach((e) => {
1025
+ g.registerDraft({
1026
+ fileId: e,
1027
+ discard: () => p(e)
1028
+ });
1021
1029
  });
1022
- });
1030
+ }
1023
1031
  let t = {};
1024
- Rt.forEach((n) => {
1032
+ Bt.forEach((n) => {
1025
1033
  let r = e ? e[n] : void 0;
1026
1034
  if (r !== void 0) {
1027
1035
  t[n] = r;
1028
1036
  return;
1029
1037
  }
1030
- let i = Oe(S, Y, n);
1031
- t[n] = Te(S, n) ? i ?? null : i ?? "";
1032
- }), rt(t);
1038
+ let i = Ce(S, Y, n);
1039
+ t[n] = Ae(S, n) ? i ?? null : i ?? "";
1040
+ }), nt(t);
1033
1041
  }
1034
1042
  if (S.children !== void 0 && S.children.length > 0 && U === void 0) {
1035
1043
  let e = Y.$children;
@@ -1039,7 +1047,7 @@ function q({ screenCode: t }) {
1039
1047
  let e = m?.entities[n];
1040
1048
  t[n] = r.map((t) => ({
1041
1049
  ...t,
1042
- _key: xt(e, t)
1050
+ _key: St(e, t)
1043
1051
  }));
1044
1052
  }
1045
1053
  W(t), G(e);
@@ -1051,82 +1059,82 @@ function q({ screenCode: t }) {
1051
1059
  }, { replace: !0 });
1052
1060
  }
1053
1061
  }, [
1054
- qe,
1062
+ Je,
1055
1063
  Y,
1056
- Rt,
1064
+ Bt,
1057
1065
  T,
1058
1066
  S,
1059
1067
  U,
1060
1068
  m
1061
- ]), N(() => {
1069
+ ]), P(() => {
1062
1070
  !k || !w || !S?.children || S.children.length === 0 || U === void 0 && (W({}), G({}));
1063
1071
  }, [
1064
1072
  k,
1065
1073
  w,
1066
1074
  S?.children
1067
1075
  ]);
1068
- let zt = M(async () => {
1076
+ let Vt = N(async () => {
1069
1077
  if (await g.flushAllDrafts(), k) {
1070
- let e = b?.route?.replace("/:id", "") ?? "/";
1078
+ let e = X?.route?.replace("/:id", "") ?? "/";
1071
1079
  a(e);
1072
- } else I(!1), rt({}), V({}), at({}), W(void 0), G(void 0), ht(!1);
1080
+ } else Ze(!1), nt({}), V({}), ot({}), W(void 0), G(void 0), ht(!1);
1073
1081
  }, [
1074
1082
  g,
1075
1083
  k,
1076
- b,
1084
+ X,
1077
1085
  a
1078
- ]), Bt = M((e, t) => {
1079
- rt((n) => ({
1086
+ ]), Ht = N((e, t) => {
1087
+ nt((n) => ({
1080
1088
  ...n,
1081
1089
  [e]: t
1082
1090
  }));
1083
- }, []), Q = P(() => {
1084
- if (!b?.route) return "/";
1085
- let e = b.route.split("/");
1091
+ }, []), Q = F(() => {
1092
+ if (!X?.route) return "/";
1093
+ let e = X.route.split("/");
1086
1094
  return e.pop(), e.join("/") || "/";
1087
- }, [b]), Vt = P(() => !m?.screens || !Q || Q === "/" ? !1 : Object.values(m.screens).some((e) => e.route === Q), [m, Q]), Ht = Pe({ fallback: M(() => {
1088
- if (!Vt) {
1095
+ }, [X]), Ut = F(() => !m?.screens || !Q || Q === "/" ? !1 : Object.values(m.screens).some((e) => e.route === Q), [m, Q]), Wt = N(() => {
1096
+ if (!Ut) {
1089
1097
  a("/");
1090
1098
  return;
1091
1099
  }
1092
- let e = Lt(Q)?.search ?? "";
1100
+ let e = zt(Q)?.search ?? "";
1093
1101
  a(e ? `${Q}?${e}` : Q);
1094
1102
  }, [
1095
- Vt,
1103
+ Ut,
1096
1104
  Q,
1097
- Lt,
1105
+ zt,
1098
1106
  a
1099
- ]) }), Ut = !D && (Ht.hasOriginBack || Ht.allowFallbackBack && !!Vt), Wt = r(), Gt = P(() => {
1107
+ ]), Gt = We({ fallback: Wt }), Kt = !D && (Gt.hasOriginBack || Gt.allowFallbackBack && !!Ut), qt = r(), Jt = F(() => {
1100
1108
  if (!S) return {};
1101
1109
  let e = {};
1102
- for (let t of mt(S, L, k)) Rt.has(t) && (e[t] = "Required");
1103
- for (let t of gt(S, L)) Rt.has(t) && (e[t] = "Invalid email address");
1110
+ for (let t of gt(S, L, k)) Bt.has(t) && (e[t] = "Required");
1111
+ for (let t of vt(S, L)) Bt.has(t) && (e[t] = "Invalid email address");
1104
1112
  return e;
1105
1113
  }, [
1106
1114
  S,
1107
1115
  L,
1108
1116
  k,
1109
- Rt
1110
- ]), Kt = Object.keys(Gt).length > 0, qt = M(() => {
1111
- if (!C || !S || k && !w || !k && !T || (ht(!0), Kt)) return;
1112
- let e = {}, t = je({
1117
+ Bt
1118
+ ]), Yt = Object.keys(Jt).length > 0, Xt = N(() => {
1119
+ if (!C || !S || k && !w || !k && !T || (ht(!0), Yt)) return;
1120
+ let e = {}, t = Ne({
1113
1121
  entity: S,
1114
1122
  formData: L,
1115
1123
  record: Y,
1116
1124
  isNew: k
1117
- }), n = Me(t);
1125
+ }), n = Pe(t);
1118
1126
  if (k) for (let [t, n] of Object.entries(L)) {
1119
1127
  if (S.files?.has(t)) continue;
1120
- let r = Ne(S, t, n);
1128
+ let r = Ve(S, t, n);
1121
1129
  r !== "" && r != null && (e[t] = r);
1122
1130
  }
1123
1131
  else {
1124
1132
  for (let [t, n] of Object.entries(L)) {
1125
1133
  if (S.files?.has(t)) continue;
1126
- let r = Y ? Oe(S, Y, t) : void 0, i = Ne(S, t, n), a = Ne(S, t, r);
1134
+ let r = Y ? Ce(S, Y, t) : void 0, i = Ve(S, t, n), a = Ve(S, t, r);
1127
1135
  (i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
1128
1136
  }
1129
- X && (e.$row_version = X);
1137
+ Z && (e.$row_version = Z);
1130
1138
  }
1131
1139
  if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(B).length > 0 && (e.$statuses = Object.entries(B).map(([e, t]) => ({
1132
1140
  status_group_code: e,
@@ -1140,22 +1148,22 @@ function q({ screenCode: t }) {
1140
1148
  let r = n.filter((e) => !e._deleted).map((e) => {
1141
1149
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
1142
1150
  return i;
1143
- }), i = ut?.[e] ?? [];
1144
- (k || !bt(r, i)) && (t[e] = r);
1151
+ }), i = dt?.[e] ?? [];
1152
+ (k || !xt(r, i)) && (t[e] = r);
1145
1153
  }
1146
1154
  Object.keys(t).length > 0 && (e.$children = t);
1147
1155
  }
1148
1156
  if (!k && Object.keys(e).length === 0) {
1149
- I(!1), V({}), at({}), W(void 0), G(void 0), ht(!1);
1157
+ Ze(!1), V({}), ot({}), W(void 0), G(void 0), ht(!1);
1150
1158
  return;
1151
1159
  }
1152
1160
  let r = () => {
1153
- I(!1), lt(!1), ht(!1), V({}), at({}), W(void 0), G(void 0);
1161
+ Ze(!1), ut(!1), ht(!1), V({}), ot({}), W(void 0), G(void 0);
1154
1162
  };
1155
- k ? ke.mutate(e, { onSuccess: (e) => {
1163
+ k ? Oe.mutate(e, { onSuccess: (e) => {
1156
1164
  n.forEach((e) => g.markCommitted(e));
1157
- let t = e.data, i = ie(S ? ue(S, t) : {});
1158
- a(i ? `${Q}/${encodeURIComponent(i)}` : Q, { replace: !0 }), r();
1165
+ let t = e.data, i = S ? ue(S, t) : {}, o = ie(i);
1166
+ a(o ? `${Q}/${encodeURIComponent(o)}` : Q, { replace: !0 }), r();
1159
1167
  } }) : A && Le.mutate({
1160
1168
  pkValues: A,
1161
1169
  data: e
@@ -1164,7 +1172,7 @@ function q({ screenCode: t }) {
1164
1172
  n.forEach((e) => g.markCommitted(e)), r();
1165
1173
  },
1166
1174
  onError: (e) => {
1167
- e instanceof ce && e.code === "STALE_OBJECT" && lt(!0);
1175
+ e instanceof ce && e.code === "STALE_OBJECT" && ut(!0);
1168
1176
  }
1169
1177
  });
1170
1178
  }, [
@@ -1174,35 +1182,35 @@ function q({ screenCode: t }) {
1174
1182
  T,
1175
1183
  C,
1176
1184
  L,
1177
- Kt,
1185
+ Yt,
1178
1186
  B,
1179
1187
  H,
1180
1188
  U,
1181
- ut,
1182
- ke,
1189
+ dt,
1190
+ Oe,
1183
1191
  Le,
1184
1192
  S,
1185
1193
  a,
1186
1194
  Q,
1187
1195
  Y,
1188
- X,
1196
+ Z,
1189
1197
  A
1190
- ]), Jt = M((e, t) => {
1198
+ ]), Zt = N((e, t) => {
1191
1199
  W((n) => ({
1192
1200
  ...n ?? {},
1193
1201
  [e]: t
1194
1202
  }));
1195
- }, []), Yt = M(() => {
1203
+ }, []), Qt = N(() => {
1196
1204
  !A || k || !ne || Re.mutate(A);
1197
1205
  }, [
1198
1206
  A,
1199
1207
  k,
1200
1208
  ne,
1201
1209
  Re
1202
- ]), Xt = P(() => vt(U, m), [U, m]), Zt = Object.keys(Xt).length > 0;
1203
- if (!b || !S) return null;
1204
- if (!k && ve) return /* @__PURE__ */ R(We, {});
1205
- if (Nt) return /* @__PURE__ */ z("div", {
1210
+ ]), $t = F(() => yt(U, m), [U, m]), en = Object.keys($t).length > 0;
1211
+ if (!X || !S) return null;
1212
+ if (!k && ve) return /* @__PURE__ */ R(je, {});
1213
+ if (Ft) return /* @__PURE__ */ z("div", {
1206
1214
  style: { padding: 24 },
1207
1215
  children: [/* @__PURE__ */ z("div", {
1208
1216
  style: {
@@ -1211,9 +1219,9 @@ function q({ screenCode: t }) {
1211
1219
  gap: 8,
1212
1220
  marginBottom: 8
1213
1221
  },
1214
- children: [Ut && /* @__PURE__ */ R(ae, {
1222
+ children: [Kt && /* @__PURE__ */ R(ae, {
1215
1223
  icon: /* @__PURE__ */ R(e.back, { size: 14 }),
1216
- onClick: Ht.goBack,
1224
+ onClick: Gt.goBack,
1217
1225
  title: "Back"
1218
1226
  }), /* @__PURE__ */ R("h1", {
1219
1227
  style: {
@@ -1229,7 +1237,7 @@ function q({ screenCode: t }) {
1229
1237
  children: "This record type is not created from a form."
1230
1238
  })]
1231
1239
  });
1232
- if (!k && !Y || Mt) return /* @__PURE__ */ z("div", {
1240
+ if (!k && !Y || Pt) return /* @__PURE__ */ z("div", {
1233
1241
  style: { padding: 24 },
1234
1242
  children: [/* @__PURE__ */ z("div", {
1235
1243
  style: {
@@ -1238,9 +1246,9 @@ function q({ screenCode: t }) {
1238
1246
  gap: 8,
1239
1247
  marginBottom: 8
1240
1248
  },
1241
- children: [Ut && /* @__PURE__ */ R(ae, {
1249
+ children: [Kt && /* @__PURE__ */ R(ae, {
1242
1250
  icon: /* @__PURE__ */ R(e.back, { size: 14 }),
1243
- onClick: Ht.goBack,
1251
+ onClick: Gt.goBack,
1244
1252
  title: "Back"
1245
1253
  }), /* @__PURE__ */ R("h1", {
1246
1254
  style: {
@@ -1256,9 +1264,9 @@ function q({ screenCode: t }) {
1256
1264
  children: "Record not found."
1257
1265
  })]
1258
1266
  });
1259
- let Qt = S.display, $t = v(b.display?.name) || v(Qt.name), en = o(Y, S), tn = k ? `New ${$t}` : en ? String(en) : $t, nn = ke.isPending || Le.isPending, rn = b.responsive?.[y.category]?.layout, an = rn?.tabs ?? (y.isPhone ? "sections" : void 0), on = rn?.header_card === !0 ? He({
1267
+ let tn = S.display, nn = v(X.display?.name) || v(tn.name), rn = o(Y, S), an = k ? `New ${nn}` : rn ? String(rn) : nn, on = Oe.isPending || Le.isPending, sn = X.responsive?.[y.category]?.layout, cn = sn?.tabs ?? (y.isPhone ? "sections" : void 0), ln = sn?.header_card === !0 ? He({
1260
1268
  entity: S,
1261
- screen: b
1269
+ screen: X
1262
1270
  }) : void 0, $ = {
1263
1271
  schema: m,
1264
1272
  entity: S,
@@ -1270,10 +1278,10 @@ function q({ screenCode: t }) {
1270
1278
  } : Y ?? {},
1271
1279
  isNew: k,
1272
1280
  mode: K ? "edit" : "display",
1273
- onFieldChange: K ? Bt : void 0,
1274
- refs: Ot,
1281
+ onFieldChange: K ? Ht : void 0,
1282
+ refs: kt,
1275
1283
  objectProperties: (() => {
1276
- let e = Ke ?? [];
1284
+ let e = qe ?? [];
1277
1285
  if (!K || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
1278
1286
  let t = e.map((e) => H[e.property_code] === void 0 ? e : {
1279
1287
  ...e,
@@ -1287,13 +1295,13 @@ function q({ screenCode: t }) {
1287
1295
  });
1288
1296
  return t;
1289
1297
  })(),
1290
- onSetProperty: k || !T ? void 0 : K ? (e, t) => at((n) => ({
1298
+ onSetProperty: k || !T ? void 0 : K ? (e, t) => ot((n) => ({
1291
1299
  ...n,
1292
1300
  [e]: t
1293
1301
  })) : void 0,
1294
1302
  isPropertyPending: !1,
1295
1303
  objectStatuses: (() => {
1296
- let e = Ge ?? [];
1304
+ let e = Ke ?? [];
1297
1305
  if (!K || Object.keys(B).length === 0) return e.length > 0 ? e : void 0;
1298
1306
  let t = e.map((e) => B[e.group_code] === void 0 ? e : {
1299
1307
  ...e,
@@ -1313,45 +1321,45 @@ function q({ screenCode: t }) {
1313
1321
  })) : void 0,
1314
1322
  isStatusPending: !1,
1315
1323
  pendingChildren: K ? U : void 0,
1316
- onChildrenChange: K ? Jt : void 0,
1317
- childValidationErrors: K ? Xt : void 0,
1318
- fieldErrors: K && pt ? Gt : void 0,
1319
- detailTabsPresentation: an,
1320
- relatedRecordsPresentation: rn?.related_records
1321
- }, sn = !!b.sidebar && b.sidebar.length > 0, cn = rn?.sidebar === "hidden", ln = sn && !cn && !y.isDesktop, un = sn && !cn && y.isDesktop, dn = !k && Y ? /* @__PURE__ */ R(st, {
1322
- screen: b,
1324
+ onChildrenChange: K ? Zt : void 0,
1325
+ childValidationErrors: K ? $t : void 0,
1326
+ fieldErrors: K && pt ? Jt : void 0,
1327
+ detailTabsPresentation: cn,
1328
+ relatedRecordsPresentation: sn?.related_records
1329
+ }, un = !!X.sidebar && X.sidebar.length > 0, dn = sn?.sidebar === "hidden", fn = un && !dn && !y.isDesktop, pn = un && !dn && y.isDesktop, mn = !k && Y ? /* @__PURE__ */ R(lt, {
1330
+ screen: X,
1323
1331
  entity: S,
1324
1332
  entityCode: C,
1325
1333
  record: Y,
1326
- refs: Ot,
1327
- objectStatuses: Ge,
1334
+ refs: kt,
1335
+ objectStatuses: Ke,
1328
1336
  schema: m,
1329
- locale: Wt
1330
- }) : void 0, fn = /* @__PURE__ */ R(Tt, {
1331
- title: tn,
1337
+ locale: qt
1338
+ }) : void 0, hn = /* @__PURE__ */ R(Dt, {
1339
+ title: an,
1332
1340
  recordId: O,
1333
1341
  editing: K,
1334
1342
  isNew: k,
1335
- isRecordDeleted: At,
1336
- dirty: Xe,
1337
- isSaving: nn,
1338
- hasChildErrors: Zt,
1339
- hasFieldErrors: pt && Kt,
1343
+ isRecordDeleted: jt,
1344
+ dirty: M,
1345
+ isSaving: on,
1346
+ hasChildErrors: en,
1347
+ hasFieldErrors: pt && Yt,
1340
1348
  canRestore: ne,
1341
1349
  entity: S,
1342
- screen: b,
1350
+ screen: X,
1343
1351
  globalActions: m?.actions,
1344
1352
  entityCode: C,
1345
1353
  record: Y,
1346
1354
  id: O,
1347
1355
  listRoute: Q,
1348
- listRouteExists: !!Vt,
1349
- highlights: dn,
1350
- showBack: Ut,
1351
- onBack: Ht.goBack,
1352
- onCancelEdit: zt,
1353
- onSave: qt,
1354
- onRestore: Yt,
1356
+ listRouteExists: !!Ut,
1357
+ highlights: mn,
1358
+ showBack: Kt,
1359
+ onBack: Gt.goBack,
1360
+ onCancelEdit: Vt,
1361
+ onSave: Xt,
1362
+ onRestore: Qt,
1355
1363
  isRestoring: Re.isPending,
1356
1364
  refreshControl: {
1357
1365
  refetch: ge.refetch,
@@ -1361,7 +1369,7 @@ function q({ screenCode: t }) {
1361
1369
  },
1362
1370
  isRealtimeEntity: S?.realtime === !0,
1363
1371
  canManageTemplates: he(m)
1364
- }), pn = At && /* @__PURE__ */ z("div", {
1372
+ }), gn = jt && /* @__PURE__ */ z("div", {
1365
1373
  style: {
1366
1374
  display: "flex",
1367
1375
  alignItems: "center",
@@ -1375,7 +1383,7 @@ function q({ screenCode: t }) {
1375
1383
  fontSize: 12.5
1376
1384
  },
1377
1385
  children: [/* @__PURE__ */ R(e.warning, { size: 14 }), /* @__PURE__ */ z("span", { children: ["This record was deleted on ", d(String(Y[S.soft_delete]))] })]
1378
- }), mn = ct && /* @__PURE__ */ z("div", {
1386
+ }), _n = ct && /* @__PURE__ */ z("div", {
1379
1387
  style: {
1380
1388
  display: "flex",
1381
1389
  alignItems: "center",
@@ -1389,8 +1397,8 @@ function q({ screenCode: t }) {
1389
1397
  fontSize: 12.5
1390
1398
  },
1391
1399
  children: [/* @__PURE__ */ R(e.warning, { size: 14 }), /* @__PURE__ */ R("span", { children: "This record changed on the server while you were viewing or editing it." })]
1392
- }), hn = K && pt && Kt && /* @__PURE__ */ R(ot, {
1393
- errors: Object.entries(Gt).map(([e, t]) => {
1400
+ }), vn = K && pt && Yt && /* @__PURE__ */ R(st, {
1401
+ errors: Object.entries(Jt).map(([e, t]) => {
1394
1402
  let n = S.fields.get(e);
1395
1403
  return {
1396
1404
  name: e,
@@ -1405,56 +1413,56 @@ function q({ screenCode: t }) {
1405
1413
  behavior: "smooth"
1406
1414
  }), t.focus?.());
1407
1415
  }
1408
- }), gn = Be && !k && !(b.items && b.items.length > 0) && /* @__PURE__ */ R("div", {
1416
+ }), yn = Ue && !k && !(X.items && X.items.length > 0) && /* @__PURE__ */ R("div", {
1409
1417
  className: "mb-4",
1410
- children: /* @__PURE__ */ R(Je, {
1418
+ children: /* @__PURE__ */ R(Ye, {
1411
1419
  statusGroups: S.status_groups ?? {},
1412
1420
  objectStatuses: $.objectStatuses,
1413
1421
  onSetStatus: T && K ? (e, t) => V((n) => ({
1414
1422
  ...n,
1415
1423
  [e]: t
1416
- })) : yt,
1424
+ })) : bt,
1417
1425
  isPending: !1,
1418
1426
  mode: K ? "edit" : "display"
1419
1427
  })
1420
- }), _n = S.evidence_covered && !k && Y && /* @__PURE__ */ R("div", {
1428
+ }), bn = S.evidence_covered && !k && Y && /* @__PURE__ */ R("div", {
1421
1429
  className: "mb-4",
1422
- children: /* @__PURE__ */ R(ft, { evidence: Y.$evidence })
1423
- }), vn = /* @__PURE__ */ z(tt, { children: [
1424
- on && (Y || k) && /* @__PURE__ */ R(St, {
1425
- card: on,
1430
+ children: /* @__PURE__ */ R(mt, { evidence: Y.$evidence })
1431
+ }), xn = /* @__PURE__ */ z(rt, { children: [
1432
+ ln && (Y || k) && /* @__PURE__ */ R(wt, {
1433
+ card: ln,
1426
1434
  entity: S,
1427
1435
  record: $.record,
1428
1436
  objectStatuses: $.objectStatuses,
1429
1437
  objectProperties: $.objectProperties
1430
1438
  }),
1431
- b.items && b.items.length > 0 && (Y || k) && m && /* @__PURE__ */ R(Ye, {
1432
- nodes: b.items,
1439
+ X.items && X.items.length > 0 && (Y || k) && m && /* @__PURE__ */ R(Xe, {
1440
+ nodes: X.items,
1433
1441
  ctx: $
1434
1442
  }),
1435
- !k && O && C && S.associations && Object.keys(S.associations).length > 0 && m && /* @__PURE__ */ R(nt, {
1443
+ !k && O && C && S.associations && Object.keys(S.associations).length > 0 && m && /* @__PURE__ */ R(it, {
1436
1444
  entityCode: C,
1437
1445
  recordId: j ?? O ?? "",
1438
1446
  associations: S.associations,
1439
1447
  schema: m
1440
1448
  }),
1441
- !k && O && C && /* @__PURE__ */ R(it, {
1449
+ !k && O && C && /* @__PURE__ */ R(at, {
1442
1450
  entityCode: C,
1443
1451
  objectId: j ?? O,
1444
1452
  canGenerateOne: !!S?.documents?.generate_one,
1445
1453
  canManageTemplates: he(m)
1446
1454
  }),
1447
- !k && Y && m && /* @__PURE__ */ R(dt, {
1448
- screen: b,
1455
+ !k && Y && m && /* @__PURE__ */ R(ft, {
1456
+ screen: X,
1449
1457
  entity: S,
1450
1458
  entityCode: C,
1451
1459
  record: Y,
1452
- refs: Ot,
1460
+ refs: kt,
1453
1461
  schema: m,
1454
- locale: Wt
1462
+ locale: qt
1455
1463
  })
1456
1464
  ] });
1457
- if (un) return /* @__PURE__ */ z("div", {
1465
+ if (pn) return /* @__PURE__ */ z("div", {
1458
1466
  style: {
1459
1467
  height: "100%",
1460
1468
  display: "flex",
@@ -1476,15 +1484,15 @@ function q({ screenCode: t }) {
1476
1484
  padding: "14px 20px 8px"
1477
1485
  },
1478
1486
  children: [
1479
- fn,
1480
- mn,
1481
- pn,
1482
1487
  hn,
1488
+ _n,
1483
1489
  gn,
1484
- _n
1490
+ vn,
1491
+ yn,
1492
+ bn
1485
1493
  ]
1486
1494
  }), /* @__PURE__ */ R("div", {
1487
- ref: jt,
1495
+ ref: Nt,
1488
1496
  style: {
1489
1497
  flex: 1,
1490
1498
  minHeight: 0,
@@ -1494,12 +1502,12 @@ function q({ screenCode: t }) {
1494
1502
  flexDirection: "column",
1495
1503
  gap: 16
1496
1504
  },
1497
- children: vn
1505
+ children: xn
1498
1506
  })]
1499
1507
  }),
1500
1508
  /* @__PURE__ */ R("div", {
1501
1509
  className: "detail-resize-handle",
1502
- onMouseDown: Dt,
1510
+ onMouseDown: Ot,
1503
1511
  title: "Drag to resize",
1504
1512
  children: /* @__PURE__ */ R("div", { style: {
1505
1513
  position: "absolute",
@@ -1518,14 +1526,14 @@ function q({ screenCode: t }) {
1518
1526
  height: "100%",
1519
1527
  width: `${Ct}px`
1520
1528
  },
1521
- children: (Y || k) && m && /* @__PURE__ */ R(Ye, {
1522
- nodes: b.sidebar,
1529
+ children: (Y || k) && m && /* @__PURE__ */ R(Xe, {
1530
+ nodes: X.sidebar,
1523
1531
  ctx: $
1524
1532
  })
1525
1533
  })
1526
1534
  ]
1527
1535
  });
1528
- let yn = y.isPhone ? 12 : 24;
1536
+ let Sn = y.isPhone ? 12 : 24;
1529
1537
  return /* @__PURE__ */ z("div", {
1530
1538
  style: {
1531
1539
  height: "100%",
@@ -1540,27 +1548,27 @@ function q({ screenCode: t }) {
1540
1548
  padding: y.isPhone ? "14px 12px 8px" : "24px 24px 8px"
1541
1549
  },
1542
1550
  children: [
1543
- fn,
1544
- mn,
1545
- pn,
1546
1551
  hn,
1552
+ _n,
1547
1553
  gn,
1548
- _n
1554
+ vn,
1555
+ yn,
1556
+ bn
1549
1557
  ]
1550
1558
  }), /* @__PURE__ */ z("div", {
1551
- ref: jt,
1559
+ ref: Nt,
1552
1560
  style: {
1553
1561
  flex: 1,
1554
1562
  minHeight: 0,
1555
1563
  overflowY: "auto",
1556
- padding: `4px ${yn}px calc(24px + var(--safe-area-bottom, 0px))`,
1564
+ padding: `4px ${Sn}px calc(24px + var(--safe-area-bottom, 0px))`,
1557
1565
  display: "flex",
1558
1566
  flexDirection: "column",
1559
1567
  gap: 16,
1560
1568
  minWidth: 0,
1561
1569
  WebkitOverflowScrolling: "touch"
1562
1570
  },
1563
- children: [vn, ln && (Y || k) && m && /* @__PURE__ */ R("div", {
1571
+ children: [xn, fn && (Y || k) && m && /* @__PURE__ */ R("div", {
1564
1572
  "data-testid": "detail-sidebar-inline",
1565
1573
  style: {
1566
1574
  display: "flex",
@@ -1568,22 +1576,25 @@ function q({ screenCode: t }) {
1568
1576
  gap: 16,
1569
1577
  minWidth: 0
1570
1578
  },
1571
- children: /* @__PURE__ */ R(Ye, {
1572
- nodes: b.sidebar,
1579
+ children: /* @__PURE__ */ R(Xe, {
1580
+ nodes: X.sidebar,
1573
1581
  ctx: $
1574
1582
  })
1575
1583
  })]
1576
1584
  })]
1577
1585
  });
1578
1586
  }
1579
- function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1587
+ function wt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1580
1588
  let a = (e) => {
1581
- let a = Ct(t, e, n, r, i);
1589
+ let a = Tt(t, e, n, r, i);
1582
1590
  return a != null && m(a) !== "";
1583
- }, s = (e) => m(Ct(t, e, n, r, i)) || /* @__PURE__ */ R("span", {
1584
- style: { color: "var(--text-3)" },
1585
- children: "-"
1586
- }), c = m(e.titleUsesDisplay ? o(n, t) : e.titleField ? Ct(t, e.titleField, n, r, i) : void 0) || v(t.display?.name) || "Record", l = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), u = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), d = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
1591
+ }, s = (e) => {
1592
+ let a = Tt(t, e, n, r, i);
1593
+ return m(a) || /* @__PURE__ */ R("span", {
1594
+ style: { color: "var(--text-3)" },
1595
+ children: "-"
1596
+ });
1597
+ }, c = e.titleUsesDisplay ? o(n, t) : e.titleField ? Tt(t, e.titleField, n, r, i) : void 0, l = m(c) || v(t.display?.name) || "Record", u = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), d = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), f = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
1587
1598
  return /* @__PURE__ */ z("section", {
1588
1599
  "data-testid": "detail-header-card",
1589
1600
  style: {
@@ -1607,7 +1618,7 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1607
1618
  color: "var(--text)",
1608
1619
  overflowWrap: "anywhere"
1609
1620
  },
1610
- children: c
1621
+ children: l
1611
1622
  }), e.subtitleField && /* @__PURE__ */ R("div", {
1612
1623
  style: {
1613
1624
  marginTop: 4,
@@ -1619,14 +1630,14 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1619
1630
  children: s(e.subtitleField)
1620
1631
  })]
1621
1632
  }),
1622
- l.length > 0 && /* @__PURE__ */ R("div", {
1633
+ u.length > 0 && /* @__PURE__ */ R("div", {
1623
1634
  style: {
1624
1635
  display: "flex",
1625
1636
  flexWrap: "wrap",
1626
1637
  gap: 6,
1627
1638
  marginTop: 10
1628
1639
  },
1629
- children: l.map((e) => /* @__PURE__ */ R("span", {
1640
+ children: u.map((e) => /* @__PURE__ */ R("span", {
1630
1641
  style: {
1631
1642
  minWidth: 0,
1632
1643
  maxWidth: "100%",
@@ -1641,7 +1652,7 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1641
1652
  children: s(e)
1642
1653
  }, e))
1643
1654
  }),
1644
- u.length > 0 && /* @__PURE__ */ R("dl", {
1655
+ d.length > 0 && /* @__PURE__ */ R("dl", {
1645
1656
  style: {
1646
1657
  display: "grid",
1647
1658
  gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
@@ -1650,11 +1661,11 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1650
1661
  fontSize: 12.5,
1651
1662
  lineHeight: 1.35
1652
1663
  },
1653
- children: u.map((e) => /* @__PURE__ */ z("div", {
1664
+ children: d.map((e) => /* @__PURE__ */ z("div", {
1654
1665
  style: { display: "contents" },
1655
1666
  children: [/* @__PURE__ */ R("dt", {
1656
1667
  style: { color: "var(--text-3)" },
1657
- children: wt(t, e)
1668
+ children: Et(t, e)
1658
1669
  }), /* @__PURE__ */ R("dd", {
1659
1670
  style: {
1660
1671
  margin: 0,
@@ -1666,7 +1677,7 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1666
1677
  })]
1667
1678
  }, e))
1668
1679
  }),
1669
- d.length > 0 && /* @__PURE__ */ R("div", {
1680
+ f.length > 0 && /* @__PURE__ */ R("div", {
1670
1681
  style: {
1671
1682
  display: "flex",
1672
1683
  flexWrap: "wrap",
@@ -1675,13 +1686,13 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1675
1686
  color: "var(--text-3)",
1676
1687
  fontSize: 11.5
1677
1688
  },
1678
- children: d.map((e) => /* @__PURE__ */ z("span", {
1689
+ children: f.map((e) => /* @__PURE__ */ z("span", {
1679
1690
  style: {
1680
1691
  minWidth: 0,
1681
1692
  overflowWrap: "anywhere"
1682
1693
  },
1683
1694
  children: [
1684
- wt(t, e),
1695
+ Et(t, e),
1685
1696
  ": ",
1686
1697
  s(e)
1687
1698
  ]
@@ -1690,7 +1701,7 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1690
1701
  ]
1691
1702
  });
1692
1703
  }
1693
- function Ct(e, t, n, r, i) {
1704
+ function Tt(e, t, n, r, i) {
1694
1705
  if (t.startsWith("$status.")) {
1695
1706
  let e = t.slice(8), n = r?.find((t) => t.group_code === e);
1696
1707
  return v(n?.status_name) || n?.status_code;
@@ -1699,16 +1710,16 @@ function Ct(e, t, n, r, i) {
1699
1710
  let e = t.slice(10);
1700
1711
  return i?.find((t) => t.property_code === e)?.value;
1701
1712
  }
1702
- return Oe(e, n, t);
1713
+ return Ce(e, n, t);
1703
1714
  }
1704
- function wt(e, t) {
1715
+ function Et(e, t) {
1705
1716
  if (t.startsWith("$status.")) return t.slice(8);
1706
1717
  if (t.startsWith("$property.")) return t.slice(10);
1707
1718
  let n = e.fields.get(t);
1708
1719
  return n ? _(n, t) : t;
1709
1720
  }
1710
- function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: f, canRestore: p, entity: m, screen: h, globalActions: g, entityCode: _, record: x, id: C, listRoute: ee, listRouteExists: ne, highlights: re, showBack: ie, onBack: ae, onCancelEdit: oe, onSave: se, onRestore: ce, isRestoring: le, refreshControl: D, isRealtimeEntity: ue, canManageTemplates: de }) {
1711
- let { run: O } = T(), k = _e("detail"), A = Le(), j = te(), pe = r(), me = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail_toolbar"), he = b(c(h?.action_layout, m?.action_layout, m?.actions, g, "detail"), m?.actions, g, x ?? {}, []), ve = b(me, m?.actions, g, x ?? {}, []), ye = P(() => {
1721
+ function Dt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: f, canRestore: p, entity: m, screen: h, globalActions: g, entityCode: _, record: x, id: C, listRoute: ee, listRouteExists: ne, highlights: re, showBack: ie, onBack: ae, onCancelEdit: oe, onSave: se, onRestore: ce, isRestoring: le, refreshControl: D, isRealtimeEntity: ue, canManageTemplates: de }) {
1722
+ let { run: O } = T(), k = _e("detail"), A = Le(), j = te(), pe = r(), me = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail_toolbar"), he = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail"), ve = b(he, m?.actions, g, x ?? {}, [], De(m, x ?? {})), ye = b(me, m?.actions, g, x ?? {}, [], De(m, x ?? {})), be = F(() => {
1712
1723
  if (!m) return;
1713
1724
  let e = C ? [C] : [];
1714
1725
  return {
@@ -1734,8 +1745,8 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
1734
1745
  x,
1735
1746
  pe,
1736
1747
  A
1737
- ]), be = (e, t) => {
1738
- let n = Re(e, t, { row: x ?? void 0 });
1748
+ ]), Ce = (e, t) => {
1749
+ let n = Oe(e, t, { row: x ?? void 0 });
1739
1750
  if (n === null) return;
1740
1751
  let r = C ? [C] : [], i = e === "__delete" && ne ? ee : null;
1741
1752
  return O({
@@ -1747,20 +1758,20 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
1747
1758
  fe.getState().kill(Se(location)), j(i, { replace: !0 });
1748
1759
  } : void 0
1749
1760
  });
1750
- }, Ce = k.isVisible("show_actions") && !o && C && he.length > 0 ? /* @__PURE__ */ R(ke, {
1751
- layout: he,
1761
+ }, we = k.isVisible("show_actions") && !o && C && ve.length > 0 ? /* @__PURE__ */ R(Ke, {
1762
+ layout: ve,
1752
1763
  row: x,
1753
- onRun: be,
1764
+ onRun: Ce,
1754
1765
  kind: "detail",
1755
1766
  entityActions: m?.actions,
1756
1767
  globalActions: g,
1757
1768
  reservedRightWidth: 0,
1758
- widgetContext: ye,
1769
+ widgetContext: be,
1759
1770
  constrain: !1
1760
- }) : null, we = !o && C ? /* @__PURE__ */ R(xe, {
1771
+ }) : null, Te = !o && C ? /* @__PURE__ */ R(xe, {
1761
1772
  liveObject: D,
1762
1773
  realtime: ue
1763
- }) : null, Te = k.isVisible("show_actions") && !o && C && ve.length > 0 ? /* @__PURE__ */ z("div", {
1774
+ }) : null, Ee = k.isVisible("show_actions") && !o && C && ye.length > 0 ? /* @__PURE__ */ z("div", {
1764
1775
  style: {
1765
1776
  display: "flex",
1766
1777
  justifyContent: "flex-end",
@@ -1768,30 +1779,30 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
1768
1779
  gap: 8,
1769
1780
  marginTop: 10
1770
1781
  },
1771
- children: [Ce ? null : we, /* @__PURE__ */ R(ke, {
1772
- layout: ve,
1782
+ children: [we ? null : Te, /* @__PURE__ */ R(Ke, {
1783
+ layout: ye,
1773
1784
  row: x,
1774
- onRun: be,
1785
+ onRun: Ce,
1775
1786
  kind: "detail",
1776
1787
  entityActions: m?.actions,
1777
1788
  globalActions: g,
1778
1789
  reservedRightWidth: 0,
1779
- widgetContext: ye,
1780
- ariaLabel: Ce ? "Detail toolbar actions" : "Page actions"
1790
+ widgetContext: be,
1791
+ ariaLabel: we ? "Detail toolbar actions" : "Page actions"
1781
1792
  })]
1782
- }) : null, Ee = k.isVisible("show_actions") && !o && C && _ ? /* @__PURE__ */ R(ge, {
1793
+ }) : null, ke = k.isVisible("show_actions") && !o && C && _ ? /* @__PURE__ */ R(ge, {
1783
1794
  entityCode: _,
1784
1795
  scope: "detail",
1785
1796
  objectIds: [C],
1786
1797
  capability: m?.documents,
1787
1798
  canManageTemplates: de
1788
- }) : null, De = s ? p ? /* @__PURE__ */ R(E, {
1799
+ }) : null, Ae = s ? p ? /* @__PURE__ */ R(E, {
1789
1800
  kind: "primary",
1790
1801
  icon: R(le ? y : e.refresh, { size: 13 }),
1791
1802
  onClick: ce,
1792
1803
  disabled: le,
1793
1804
  children: le ? "Restoring…" : "Restore"
1794
- }) : null : a ? /* @__PURE__ */ z(tt, { children: [/* @__PURE__ */ R(E, {
1805
+ }) : null : a ? /* @__PURE__ */ z(rt, { children: [/* @__PURE__ */ R(E, {
1795
1806
  icon: /* @__PURE__ */ R(e.x, { size: 13 }),
1796
1807
  onClick: oe,
1797
1808
  disabled: u,
@@ -1803,11 +1814,11 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
1803
1814
  disabled: u || d || f,
1804
1815
  title: d ? "Fix errors in child rows" : f ? "Fix the highlighted fields" : void 0,
1805
1816
  children: u ? "Saving…" : "Save"
1806
- })] }) : !o && C ? Ce ? /* @__PURE__ */ z("span", {
1817
+ })] }) : !o && C ? we ? /* @__PURE__ */ z("span", {
1807
1818
  style: { display: "contents" },
1808
- children: [Ee, Ce]
1809
- }) : Ee : null;
1810
- return /* @__PURE__ */ z(tt, { children: [/* @__PURE__ */ R(pt, {
1819
+ children: [ke, we]
1820
+ }) : ke : null;
1821
+ return /* @__PURE__ */ z(rt, { children: [/* @__PURE__ */ R(ht, {
1811
1822
  icon: m?.display.icon ? /* @__PURE__ */ R(t, {
1812
1823
  name: m.display.icon,
1813
1824
  size: 16
@@ -1816,14 +1827,14 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
1816
1827
  description: v(h?.display?.description) || v(m?.display?.description),
1817
1828
  recordId: i,
1818
1829
  highlights: re,
1819
- identityControls: !s && !a && !o ? we : null,
1830
+ identityControls: !s && !a && !o ? Te : null,
1820
1831
  mode: o ? "create" : a ? "edit" : "display",
1821
1832
  dirty: l,
1822
1833
  showBack: ie,
1823
1834
  onBack: ae,
1824
- right: De,
1835
+ right: Ae,
1825
1836
  showTitle: k.isVisible("show_title")
1826
- }), Te] });
1837
+ }), Ee] });
1827
1838
  }
1828
1839
  //#endregion
1829
- export { K as SmartDetailPage };
1840
+ export { q as SmartDetailPage };