@declarion/react 0.57.0 → 0.59.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 (165) hide show
  1. package/README.md +0 -2
  2. package/dist-lib/AgentChatPanel.impl-DBH1Ff4G.js +1200 -0
  3. package/dist-lib/DetailAuditStrip-GNRA_eP5.js +289 -0
  4. package/dist-lib/{DraggableChildrenTable-BV5sb8Uo.js → DraggableChildrenTable-4RZC351U.js} +87 -86
  5. package/dist-lib/Grid-CQabaBLx.js +405 -0
  6. package/dist-lib/{LayoutRenderer-C9AH9cXf.js → LayoutRenderer-DGKWZKpW.js} +1000 -1114
  7. package/dist-lib/{ListCardsBody-DXcDg536.js → ListCardsBody-DfGmyNIu.js} +84 -84
  8. package/dist-lib/MarkdownRenderer-BDbzDv_y.js +87 -0
  9. package/dist-lib/{RefreshControl-CNtN8zSl.js → RefreshControl-Bhoib0ZA.js} +126 -155
  10. package/dist-lib/SmartDetailPage.impl-Ds2RGg6K.js +1565 -0
  11. package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +3046 -0
  12. package/dist-lib/{SmartRecordListPage.impl-Bkl9aZJ8.js → SmartRecordListPage.impl-C1FJLr80.js} +281 -280
  13. package/dist-lib/SortHeaderMenu-Cijxk4cX.js +107 -0
  14. package/dist-lib/action-dispatch-DY0c8U81.js +1967 -0
  15. package/dist-lib/api/client.d.ts +5 -0
  16. package/dist-lib/api/data.d.ts +2 -4
  17. package/dist-lib/api/entities.d.ts +8 -15
  18. package/dist-lib/api/events.d.ts +3 -3
  19. package/dist-lib/cardProjection-Bkl2SSYz.js +499 -0
  20. package/dist-lib/components/actions/ResponsiveActionBar.d.ts +17 -16
  21. package/dist-lib/components/agents/AgentChatPanel.d.ts +3 -13
  22. package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +14 -0
  23. package/dist-lib/components/agents/AgentPicker.d.ts +1 -2
  24. package/dist-lib/components/chrome/PageShell.d.ts +7 -0
  25. package/dist-lib/components/chrome/RecordHeader.d.ts +1 -2
  26. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -2
  27. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -2
  28. package/dist-lib/components/detail-layout/blockMeta.d.ts +2 -1
  29. package/dist-lib/components/fields/BoolField.d.ts +1 -1
  30. package/dist-lib/components/fields/EnumField.d.ts +1 -1
  31. package/dist-lib/components/fields/IntArrayField.d.ts +1 -1
  32. package/dist-lib/components/fields/MultilangArrayField.d.ts +2 -0
  33. package/dist-lib/components/fields/MultilangField.d.ts +1 -1
  34. package/dist-lib/components/fields/MultilangTextField.d.ts +1 -1
  35. package/dist-lib/components/fields/NumberField.d.ts +1 -1
  36. package/dist-lib/components/fields/PasswordField.d.ts +1 -1
  37. package/dist-lib/components/fields/RefCombobox.d.ts +1 -1
  38. package/dist-lib/components/fields/SecretField.d.ts +1 -1
  39. package/dist-lib/components/fields/StringArrayField.d.ts +1 -1
  40. package/dist-lib/components/fields/TimestampField.d.ts +1 -1
  41. package/dist-lib/components/fields/cells/registry.d.ts +2 -1
  42. package/dist-lib/components/fields/index.d.ts +2 -1
  43. package/dist-lib/components/fields/langMap.d.ts +2 -0
  44. package/dist-lib/components/fields/secretValue.d.ts +2 -0
  45. package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +3 -0
  46. package/dist-lib/components/file-widgets/UploadFailureText.d.ts +4 -0
  47. package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
  48. package/dist-lib/components/file-widgets/host.d.ts +4 -3
  49. package/dist-lib/components/file-widgets/types.d.ts +1 -0
  50. package/dist-lib/components/file-widgets/upload.d.ts +18 -3
  51. package/dist-lib/components/filters/filter-op-label.d.ts +3 -0
  52. package/dist-lib/components/layout/ImpersonationBanner.d.ts +1 -1
  53. package/dist-lib/components/layout/ImpersonationFrame.d.ts +1 -1
  54. package/dist-lib/components/layout/Layout.d.ts +2 -1
  55. package/dist-lib/components/layout/Sidebar.d.ts +2 -1
  56. package/dist-lib/components/layout/TenantChip.d.ts +1 -1
  57. package/dist-lib/components/list/ViewSwitcher.d.ts +4 -2
  58. package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -2
  59. package/dist-lib/components/pages/ExportMenu.d.ts +3 -5
  60. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -2
  61. package/dist-lib/components/pages/auth/AuthShell.d.ts +4 -31
  62. package/dist-lib/components/pages/exportRequest.d.ts +4 -6
  63. package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +8 -0
  64. package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -2
  65. package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -1
  66. package/dist-lib/components/pages/list/ListFloatbar.d.ts +2 -2
  67. package/dist-lib/components/pages/list/ListHeader.d.ts +2 -2
  68. package/dist-lib/components/pages/list/ListNoRows.d.ts +4 -5
  69. package/dist-lib/components/pages/list/ListToolbar.d.ts +3 -2
  70. package/dist-lib/components/pages/list/ListUrlBanner.d.ts +10 -0
  71. package/dist-lib/components/pages/list/RowActionsCell.d.ts +2 -4
  72. package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -2
  73. package/dist-lib/components/pages/list/columns.d.ts +2 -1
  74. package/dist-lib/components/pages/list/filter-meta.d.ts +2 -1
  75. package/dist-lib/components/pages/list/useActiveView.d.ts +38 -0
  76. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +6 -5
  77. package/dist-lib/components/pages/list/useListQuery.d.ts +4 -4
  78. package/dist-lib/components/pages/list/useListSort.d.ts +5 -4
  79. package/dist-lib/components/pages/list/useListViews.d.ts +18 -8
  80. package/dist-lib/components/pages/list/useRowMenu.d.ts +2 -3
  81. package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
  82. package/dist-lib/components/params/ParamsBlock.d.ts +1 -13
  83. package/dist-lib/components/params/param-editors.d.ts +3 -11
  84. package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -2
  85. package/dist-lib/components/shared/DynamicIcon.d.ts +2 -2
  86. package/dist-lib/components/shared/LoadingSkeleton.d.ts +1 -0
  87. package/dist-lib/components/shared/LucideIcon.d.ts +1 -1
  88. package/dist-lib/components/shared/useOwnRefresh.d.ts +1 -1
  89. package/dist-lib/declarion-react.css +1 -1
  90. package/dist-lib/embed/theme.d.ts +1 -1
  91. package/dist-lib/embed/useEmbedNavigate.d.ts +1 -1
  92. package/dist-lib/failure-v-uGSpbX.js +158 -0
  93. package/dist-lib/{field-classification-D6xQYn-h.js → field-classification-C28XE-_P.js} +514 -307
  94. package/dist-lib/format-count-DA4wmmWR.js +1771 -0
  95. package/dist-lib/hooks/useEntityData.d.ts +1 -1
  96. package/dist-lib/hooks/useFilters.d.ts +7 -5
  97. package/dist-lib/hooks/useLanguage.d.ts +4 -0
  98. package/dist-lib/hooks/useParams.d.ts +4 -51
  99. package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
  100. package/dist-lib/hooks/useSSE.d.ts +3 -3
  101. package/dist-lib/hooks/useTabTitle.d.ts +2 -0
  102. package/dist-lib/hooks/useText.d.ts +3 -3
  103. package/dist-lib/hooks/useVersionWatcher.d.ts +1 -1
  104. package/dist-lib/hooks/useViews.d.ts +20 -0
  105. package/dist-lib/index.d.ts +8 -7
  106. package/dist-lib/index.js +2716 -5795
  107. package/dist-lib/lib/action-dispatch.d.ts +2 -1
  108. package/dist-lib/lib/actions.d.ts +30 -42
  109. package/dist-lib/lib/anchor.d.ts +3 -4
  110. package/dist-lib/lib/decimal-text.d.ts +1 -0
  111. package/dist-lib/lib/document-templates.d.ts +1 -2
  112. package/dist-lib/lib/download.d.ts +2 -1
  113. package/dist-lib/lib/evidence-verdict.d.ts +2 -1
  114. package/dist-lib/lib/failure.d.ts +2 -0
  115. package/dist-lib/lib/field-classification.d.ts +3 -3
  116. package/dist-lib/lib/filters.d.ts +18 -2
  117. package/dist-lib/lib/format-count.d.ts +8 -7
  118. package/dist-lib/lib/language.d.ts +19 -0
  119. package/dist-lib/lib/mass-edit.d.ts +2 -1
  120. package/dist-lib/lib/realtime-query-keys.d.ts +1 -1
  121. package/dist-lib/lib/realtime-reconcile.d.ts +3 -4
  122. package/dist-lib/lib/screen-back.d.ts +4 -6
  123. package/dist-lib/lib/sort.d.ts +9 -9
  124. package/dist-lib/lib/timestamp.d.ts +5 -7
  125. package/dist-lib/lib/ui-actions.d.ts +2 -1
  126. package/dist-lib/peekDraftStore-D-cTbiIr.js +199 -0
  127. package/dist-lib/registry-Cb3W-czW.js +1950 -0
  128. package/dist-lib/safe-url-oSJw5pzO.js +34 -0
  129. package/dist-lib/stores/icon-registry.d.ts +2 -2
  130. package/dist-lib/stores/list-layout.d.ts +3 -4
  131. package/dist-lib/stores/realtime.d.ts +1 -1
  132. package/dist-lib/stores/tabs.d.ts +3 -2
  133. package/dist-lib/testing.d.ts +6 -0
  134. package/dist-lib/testing.js +98 -76
  135. package/dist-lib/types/api.d.ts +7 -8
  136. package/dist-lib/types/fieldType.d.ts +1 -1
  137. package/dist-lib/types/files.d.ts +4 -4
  138. package/dist-lib/types/schema.d.ts +44 -50
  139. package/dist-lib/useAgentConversation-D97IqE-J.js +623 -0
  140. package/dist-lib/{useCurrentScreen-CzwzQpoW.js → useCurrentScreen-BL5NZFCw.js} +2777 -3768
  141. package/dist-lib/useListQuery-BG1GyKtJ.js +103 -0
  142. package/dist-lib/useProperties-4Lg3odrt.js +83 -0
  143. package/dist-lib/{useTabSearchMirror-C39U85cg.js → useTabSearchMirror-ZVLlINBX.js} +49 -51
  144. package/dist-lib/useText-BFDCTUSo.js +952 -0
  145. package/dist-lib/{value-Bo8C8WMU.js → value-By1-WJ8J.js} +74 -76
  146. package/dist-lib/vite/fingerprint-plugin.d.ts +2 -3
  147. package/package.json +9 -9
  148. package/dist-lib/Grid-DWgUPuZ3.js +0 -404
  149. package/dist-lib/MarkdownRenderer-CcSFc2N3.js +0 -85
  150. package/dist-lib/RecordIdBadge-CGxPR-8q.js +0 -24
  151. package/dist-lib/SmartDetailPage.impl-lskCd-WG.js +0 -1846
  152. package/dist-lib/SmartListPage.impl-CrGbdzyK.js +0 -2854
  153. package/dist-lib/SortHeaderMenu-SYSAaqQJ.js +0 -106
  154. package/dist-lib/action-dispatch-CR4ajBtT.js +0 -1985
  155. package/dist-lib/cardProjection-CW5RIMko.js +0 -699
  156. package/dist-lib/components/pages/home/HomeStub.d.ts +0 -6
  157. package/dist-lib/components/pages/jobs/Jobs.d.ts +0 -1
  158. package/dist-lib/components/pages/pipeline/Pipeline.d.ts +0 -1
  159. package/dist-lib/format-count-Dobmi-Ji.js +0 -1551
  160. package/dist-lib/hooks/useUserLocale.d.ts +0 -1
  161. package/dist-lib/lib/messages.d.ts +0 -12
  162. package/dist-lib/peekDraftStore-5wQ7lq_V.js +0 -194
  163. package/dist-lib/registry-CjgUaF7C.js +0 -1768
  164. package/dist-lib/useListQuery-D7Hr5WM1.js +0 -96
  165. package/dist-lib/useProperties-CqtCzFCr.js +0 -81
@@ -1,20 +1,21 @@
1
1
  import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
2
- import { $n as n, $t as r, Br as i, Cr as a, D as o, Gn as s, I as c, Ir as l, Mr as u, O as d, Or as f, Qn as p, Qt as m, St as h, Vr as g, Zn as _, Zt as v, b as y, cr as b, et as x, ir as S, jt as C, ln as w, mr as T, nr as E, nt as D, pr as O, rr as k, sr as A, tr as j, tt as M, wn as ee, xt as N, zr as P } from "./useCurrentScreen-CzwzQpoW.js";
3
- import { c as F, d as I, f as L, l as R, o as z, r as B, s as V, t as H } from "./registry-CjgUaF7C.js";
4
- import { C as te, O as ne, c as re, n as ie, t as ae, x as oe } from "./field-classification-D6xQYn-h.js";
5
- import { m as se, p as ce } from "./action-dispatch-CR4ajBtT.js";
6
- import { o as le } from "./cardProjection-CW5RIMko.js";
7
- import { n as ue, r as de, t as fe } from "./dataTableStyles-vwD1mVOP.js";
8
- import { Suspense as pe, createContext as me, lazy as he, useCallback as U, useContext as ge, useEffect as W, useId as _e, useLayoutEffect as ve, useMemo as G, useRef as K, useState as q } from "react";
9
- import { useInfiniteQuery as ye, useMutation as be, useQueryClient as xe } from "@tanstack/react-query";
2
+ import { An as n, D as r, Et as i, In as a, Ln as o, Nn as s, O as c, Rn as l, Tn as u, Zt as d, _n as f, b as p, bn as m, gn as h, hn as g, it as _, jn as v, kt as y, ln as b, nn as x, on as S, rt as C, wn as w, xn as T, yn as E, z as D } from "./useCurrentScreen-BL5NZFCw.js";
3
+ import { M as O, d as k, t as A } from "./useText-BFDCTUSo.js";
4
+ import { a as j, d as M, f as N, h as P, i as ee, l as F, m as I, o as L, r as R, t as z, u as B } from "./registry-Cb3W-czW.js";
5
+ import { c as V, o as H, s as te, t as U, y as ne } from "./failure-v-uGSpbX.js";
6
+ import { E as re, N as ie, c as ae, d as oe, n as se, t as ce, w as le } from "./field-classification-C28XE-_P.js";
7
+ import { m as ue, p as de } from "./action-dispatch-DY0c8U81.js";
8
+ import { n as fe, r as pe, t as me } from "./dataTableStyles-vwD1mVOP.js";
9
+ import { Suspense as he, lazy as ge, useCallback as W, useEffect as G, useId as _e, useLayoutEffect as ve, useMemo as ye, useRef as K, useState as q } from "react";
10
+ import { useInfiniteQuery as be, useMutation as xe, useQueryClient as Se } from "@tanstack/react-query";
10
11
  import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
11
12
  //#region src/lib/size-value.ts
12
- var Se = /^(\d+)px$/;
13
- function Ce(e) {
13
+ var Ce = /^(\d+)px$/;
14
+ function we(e) {
14
15
  if (e == null || e === "") return null;
15
16
  if (e === "auto") return { kind: "auto" };
16
17
  if (e === "fill") return { kind: "fill" };
17
- let t = Se.exec(e);
18
+ let t = Ce.exec(e);
18
19
  if (t) {
19
20
  let e = parseInt(t[1], 10);
20
21
  return e > 0 ? {
@@ -30,9 +31,9 @@ function Ce(e) {
30
31
  }
31
32
  //#endregion
32
33
  //#region src/components/detail-layout/LayoutRow.tsx
33
- function we({ config: e, ctx: t }) {
34
+ function Te({ config: e, ctx: t }) {
34
35
  let { items: n, gap: r = 0, resizable: i = !1, stack_below: a } = e, o = a === "never" ? 0 : a ?? 768, [s, c] = q(!1), l = K(null);
35
- W(() => {
36
+ G(() => {
36
37
  if (o === 0) return;
37
38
  let e = l.current;
38
39
  if (!e) return;
@@ -41,10 +42,10 @@ function we({ config: e, ctx: t }) {
41
42
  });
42
43
  return t.observe(e), () => t.disconnect();
43
44
  }, [o]);
44
- let [u, d] = q(null), f = K(null), p = U(() => n.map((t) => {
45
- let n = Ce(t.width ?? t.column?.width ?? t.row?.width ?? e.width);
45
+ let [u, d] = q(null), f = K(null), p = W(() => n.map((t) => {
46
+ let n = we(t.width ?? t.column?.width ?? t.row?.width ?? e.width);
46
47
  return n && n.kind === "weight" ? n.value : 1;
47
- }), [n, e.width]), m = U((e, t) => {
48
+ }), [n, e.width]), m = W((e, t) => {
48
49
  t.preventDefault();
49
50
  let n = u ?? p();
50
51
  f.current = {
@@ -61,20 +62,20 @@ function we({ config: e, ctx: t }) {
61
62
  f.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
62
63
  };
63
64
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
64
- }, [u, p]), h = u ?? p(), g = e.height ? Ee(e.height) : void 0;
65
+ }, [u, p]), h = u ?? p(), g = e.height ? De(e.height) : void 0;
65
66
  return /* @__PURE__ */ Y("div", {
66
67
  ref: l,
67
- className: R("flex", s && "flex-col"),
68
+ className: N("flex", s && "flex-col"),
68
69
  style: {
69
70
  gap: r ? `${r}px` : void 0,
70
71
  ...g
71
72
  },
72
73
  children: n.map((r, a) => /* @__PURE__ */ X("div", {
73
- className: R("min-w-0 flex items-stretch", s && "w-full"),
74
- style: s ? void 0 : Te(r.width ?? r.column?.width ?? r.row?.width ?? e.width, h[a], r.min_width, r.max_width),
74
+ className: N("min-w-0 flex items-stretch", s && "w-full"),
75
+ style: s ? void 0 : Ee(r.width ?? r.column?.width ?? r.row?.width ?? e.width, h[a], r.min_width, r.max_width),
75
76
  children: [/* @__PURE__ */ Y("div", {
76
- className: R("flex-1 min-w-0 flex flex-col", g && "overflow-y-auto overflow-x-hidden"),
77
- children: /* @__PURE__ */ Y(gn, {
77
+ className: N("flex-1 min-w-0 flex flex-col", g && "overflow-y-auto overflow-x-hidden"),
78
+ children: /* @__PURE__ */ Y(ln, {
78
79
  node: r,
79
80
  ctx: t
80
81
  })
@@ -85,17 +86,17 @@ function we({ config: e, ctx: t }) {
85
86
  }, a))
86
87
  });
87
88
  }
88
- function Te(e, t, n, r) {
89
- let i = Ce(e), a;
89
+ function Ee(e, t, n, r) {
90
+ let i = we(e), a;
90
91
  return a = !i || i.kind === "weight" ? `${t} 1 0%` : i.kind === "px" ? `0 0 ${i.value}px` : i.kind === "fill" ? "1 1 0%" : "0 0 auto", {
91
92
  flex: a,
92
93
  minWidth: n,
93
94
  maxWidth: r
94
95
  };
95
96
  }
96
- function Ee(e) {
97
+ function De(e) {
97
98
  if (!e) return;
98
- let t = Ce(e);
99
+ let t = we(e);
99
100
  if (t?.kind === "px") return {
100
101
  height: `${t.value}px`,
101
102
  overflow: "hidden"
@@ -107,12 +108,12 @@ function Ee(e) {
107
108
  }
108
109
  //#endregion
109
110
  //#region src/components/detail-layout/LayoutColumn.tsx
110
- function De({ config: e, ctx: t }) {
111
+ function Oe({ config: e, ctx: t }) {
111
112
  let { items: n, gap: r = 12 } = e;
112
113
  return /* @__PURE__ */ Y("div", {
113
114
  className: "flex flex-col h-full",
114
115
  style: { gap: r ? `${r}px` : void 0 },
115
- children: n.map((e, n) => /* @__PURE__ */ Y(gn, {
116
+ children: n.map((e, n) => /* @__PURE__ */ Y(ln, {
116
117
  node: e,
117
118
  ctx: t
118
119
  }, n))
@@ -120,23 +121,23 @@ function De({ config: e, ctx: t }) {
120
121
  }
121
122
  //#endregion
122
123
  //#region src/components/detail-layout/blockMeta.ts
123
- function Oe(e) {
124
+ function ke(e) {
124
125
  return e.children ?? e.associated;
125
126
  }
126
- function ke(e, t) {
127
- let n = Oe(e);
128
- if (n) {
129
- if (e.label) return E(e.label);
130
- let r = t.entity.children?.find((e) => e.entity === n);
131
- if (r?.display?.name) return E(r.display.name);
132
- let i = t.schema.entities[n];
133
- return i && (E(i.display.name_plural) || E(i.display.name)) || n;
127
+ function Ae(e, t, n) {
128
+ let r = ke(e);
129
+ if (r) {
130
+ if (e.label) return n(e.label);
131
+ let i = t.entity.children?.find((e) => e.entity === r);
132
+ if (i?.display?.name) return n(i.display.name);
133
+ let a = t.schema.entities[r];
134
+ return a && (n(a.display.name_plural) || n(a.display.name)) || r;
134
135
  }
135
- return e.section ? E(e.section.name) : "Tab";
136
+ return e.section ? n(e.section.name) : n("record.tabs.fallback", "Tab");
136
137
  }
137
- function Ae(e, t) {
138
+ function je(e, t) {
138
139
  if (e.icon) return e.icon;
139
- let n = Oe(e);
140
+ let n = ke(e);
140
141
  if (n) {
141
142
  let e = t.entity.children?.find((e) => e.entity === n);
142
143
  if (e?.display?.icon) return e.display.icon;
@@ -146,11 +147,11 @@ function Ae(e, t) {
146
147
  }
147
148
  //#endregion
148
149
  //#region src/components/detail-layout/LayoutTabs.tsx
149
- function je({ config: e, ctx: n }) {
150
- let { items: r } = e, [i, a] = q(0), o = u(), s = n.detailTabsPresentation ?? (o.isPhone ? "sections" : "scroll");
151
- if (r.length === 0) return null;
152
- if (s === "sections") {
153
- let e = r.map((e, t) => `detail-tab-section-${t}`);
150
+ function Me({ config: e, ctx: n }) {
151
+ let r = A(), { items: i } = e, [a, o] = q(0), s = S(), c = n.detailTabsPresentation ?? (s.isPhone ? "sections" : "scroll");
152
+ if (i.length === 0) return null;
153
+ if (c === "sections") {
154
+ let e = i.map((e, t) => `detail-tab-section-${t}`);
154
155
  return /* @__PURE__ */ X("div", {
155
156
  style: {
156
157
  display: "flex",
@@ -158,8 +159,8 @@ function je({ config: e, ctx: n }) {
158
159
  gap: 10,
159
160
  minWidth: 0
160
161
  },
161
- children: [r.length > 1 && /* @__PURE__ */ Y("nav", {
162
- "aria-label": "Detail sections",
162
+ children: [i.length > 1 && /* @__PURE__ */ Y("nav", {
163
+ "aria-label": r("record.tabs.sections", "Detail sections"),
163
164
  style: {
164
165
  display: "flex",
165
166
  gap: 6,
@@ -167,11 +168,11 @@ function je({ config: e, ctx: n }) {
167
168
  padding: "0 2px 2px",
168
169
  WebkitOverflowScrolling: "touch"
169
170
  },
170
- children: r.map((r, i) => {
171
- let a = ke(r, n), o = Ae(r, n);
171
+ children: i.map((i, a) => {
172
+ let o = Ae(i, n, r), s = je(i, n);
172
173
  return /* @__PURE__ */ X("button", {
173
174
  type: "button",
174
- onClick: () => document.getElementById(e[i])?.scrollIntoView({
175
+ onClick: () => document.getElementById(e[a])?.scrollIntoView({
175
176
  block: "start",
176
177
  behavior: "smooth"
177
178
  }),
@@ -191,22 +192,22 @@ function je({ config: e, ctx: n }) {
191
192
  whiteSpace: "nowrap",
192
193
  cursor: "pointer"
193
194
  },
194
- children: [o && /* @__PURE__ */ Y(t, {
195
- name: o,
195
+ children: [s && /* @__PURE__ */ Y(t, {
196
+ name: s,
196
197
  size: 13
197
198
  }), /* @__PURE__ */ Y("span", {
198
199
  style: {
199
200
  overflow: "hidden",
200
201
  textOverflow: "ellipsis"
201
202
  },
202
- children: a
203
+ children: o
203
204
  })]
204
- }, i);
205
+ }, a);
205
206
  })
206
- }), r.map((r, i) => {
207
- let a = ke(r, n), o = Ae(r, n);
207
+ }), i.map((i, a) => {
208
+ let o = Ae(i, n, r), s = je(i, n);
208
209
  return /* @__PURE__ */ X("section", {
209
- id: e[i],
210
+ id: e[a],
210
211
  style: {
211
212
  background: "var(--surface)",
212
213
  border: "1px solid var(--border)",
@@ -227,27 +228,27 @@ function je({ config: e, ctx: n }) {
227
228
  fontSize: 13,
228
229
  fontWeight: 700
229
230
  },
230
- children: [o && /* @__PURE__ */ Y(t, {
231
- name: o,
231
+ children: [s && /* @__PURE__ */ Y(t, {
232
+ name: s,
232
233
  size: 14
233
234
  }), /* @__PURE__ */ Y("span", {
234
235
  style: { overflowWrap: "anywhere" },
235
- children: a
236
+ children: o
236
237
  })]
237
238
  }), /* @__PURE__ */ Y("div", {
238
239
  style: {
239
240
  padding: 14,
240
241
  minWidth: 0
241
242
  },
242
- children: /* @__PURE__ */ Y(gn, {
243
- node: r,
243
+ children: /* @__PURE__ */ Y(ln, {
244
+ node: i,
244
245
  ctx: {
245
246
  ...n,
246
247
  withinCard: !0
247
248
  }
248
249
  })
249
250
  })]
250
- }, i);
251
+ }, a);
251
252
  })]
252
253
  });
253
254
  }
@@ -270,13 +271,13 @@ function je({ config: e, ctx: n }) {
270
271
  padding: "6px 10px 0 10px",
271
272
  overflowX: "auto"
272
273
  },
273
- children: r.map((e, r) => {
274
- let o = ke(e, n), s = Ae(e, n), c = r === i;
274
+ children: i.map((e, i) => {
275
+ let s = Ae(e, n, r), c = je(e, n), l = i === a;
275
276
  return /* @__PURE__ */ X("button", {
276
277
  role: "tab",
277
- "aria-selected": c,
278
+ "aria-selected": l,
278
279
  onClick: (e) => {
279
- e.stopPropagation(), a(r);
280
+ e.stopPropagation(), o(i);
280
281
  },
281
282
  style: {
282
283
  position: "relative",
@@ -290,23 +291,23 @@ function je({ config: e, ctx: n }) {
290
291
  fontSize: 12.5,
291
292
  fontWeight: 500,
292
293
  fontFamily: "inherit",
293
- color: c ? "var(--text)" : "var(--text-3)",
294
+ color: l ? "var(--text)" : "var(--text-3)",
294
295
  whiteSpace: "nowrap",
295
296
  transition: "color .12s"
296
297
  },
297
298
  onMouseEnter: (e) => {
298
- c || (e.currentTarget.style.color = "var(--text-2)");
299
+ l || (e.currentTarget.style.color = "var(--text-2)");
299
300
  },
300
301
  onMouseLeave: (e) => {
301
- c || (e.currentTarget.style.color = "var(--text-3)");
302
+ l || (e.currentTarget.style.color = "var(--text-3)");
302
303
  },
303
304
  children: [
304
- s && /* @__PURE__ */ Y(t, {
305
- name: s,
305
+ c && /* @__PURE__ */ Y(t, {
306
+ name: c,
306
307
  size: 13
307
308
  }),
308
- o,
309
- c && /* @__PURE__ */ Y("span", { style: {
309
+ s,
310
+ l && /* @__PURE__ */ Y("span", { style: {
310
311
  position: "absolute",
311
312
  left: 4,
312
313
  right: 4,
@@ -316,67 +317,67 @@ function je({ config: e, ctx: n }) {
316
317
  borderRadius: 2
317
318
  } })
318
319
  ]
319
- }, r);
320
+ }, i);
320
321
  })
321
322
  }), /* @__PURE__ */ Y("div", {
322
323
  role: "tabpanel",
323
324
  style: { padding: 14 },
324
- children: /* @__PURE__ */ Y(gn, {
325
- node: r[i],
325
+ children: /* @__PURE__ */ Y(ln, {
326
+ node: i[a],
326
327
  ctx: {
327
328
  ...n,
328
329
  withinCard: !0
329
330
  }
330
- }, i)
331
+ }, a)
331
332
  })]
332
333
  });
333
334
  }
334
335
  //#endregion
335
336
  //#region src/components/detail-layout/SectionBlock.tsx
336
- function Me({ config: e, ctx: n }) {
337
- let { name: r, items: i, collapsed: a = !1, columns: o, icon: s, badge: c, emphasis: l } = e, u = {
337
+ function Ne({ config: e, ctx: n }) {
338
+ let r = A(), { name: i, items: a, collapsed: o = !1, columns: s, icon: c, badge: l, emphasis: u } = e, d = {
338
339
  ...n,
339
340
  withinCard: !0,
340
- ...o ? { columns: o } : null
341
- }, d = s ? /* @__PURE__ */ Y(t, {
342
- name: s,
341
+ ...s ? { columns: s } : null
342
+ }, f = c ? /* @__PURE__ */ Y(t, {
343
+ name: c,
343
344
  size: 14
344
- }) : void 0, f = c ? {
345
- text: E(c.text),
346
- tone: c.tone,
347
- dot: c.dot
345
+ }) : void 0, p = l ? {
346
+ text: r(l.text),
347
+ tone: l.tone,
348
+ dot: l.dot
348
349
  } : void 0;
349
- return /* @__PURE__ */ Y(L, {
350
- title: E(r),
351
- defaultOpen: !a,
352
- icon: d,
353
- badge: f,
354
- emphasis: l,
350
+ return /* @__PURE__ */ Y(P, {
351
+ title: r(i),
352
+ defaultOpen: !o,
353
+ icon: f,
354
+ badge: p,
355
+ emphasis: u,
355
356
  headingLevel: n.withinCard ? 3 : 2,
356
- children: /* @__PURE__ */ Y(hn, {
357
- nodes: i,
358
- ctx: u
357
+ children: /* @__PURE__ */ Y(cn, {
358
+ nodes: a,
359
+ ctx: d
359
360
  })
360
361
  });
361
362
  }
362
363
  //#endregion
363
364
  //#region src/lib/child-config.ts
364
- function Ne(e, t, n) {
365
+ function Pe(e, t, n) {
365
366
  let r = e.display, i = Z(n?.mode, r?.mode, "table"), a = i === "timeline" ? 50 : 20, o = {
366
367
  entity: e.entity,
367
368
  foreign_key: e.foreign_key,
368
- name: Z(n?.label, r?.name, Fe(t)),
369
+ name: Z(n?.label, r?.name, Ie(t)),
369
370
  icon: Z(n?.icon, r?.icon, t.display.icon) ?? "",
370
371
  mode: i,
371
- columns: Z(n?.columns, r?.columns, Le(t, e.foreign_key)),
372
- sort: Z(n?.sort, r?.sort, Ie(t)),
372
+ columns: Z(n?.columns, r?.columns, Re(t, e.foreign_key)),
373
+ sort: Z(n?.sort, r?.sort, Le(t)),
373
374
  limit: Z(n?.limit, r?.limit, a),
374
375
  editable: Z(n?.editable, r?.editable, !0),
375
- interaction: Z(n?.interaction, r?.interaction, Pe(t))
376
+ interaction: Z(n?.interaction, r?.interaction, Fe(t))
376
377
  }, s = Z(n?.position_field, r?.position_field, void 0);
377
378
  s && (o.position_field = s, o.sort = s + ":asc");
378
379
  let c = n?.timeline ?? r?.timeline;
379
- o.mode === "timeline" ? o.timeline = Re(c ?? {}, t) : c && (o.timeline = c);
380
+ o.mode === "timeline" ? o.timeline = ze(c ?? {}, t) : c && (o.timeline = c);
380
381
  let l = n?.cards ?? r?.cards;
381
382
  l && (o.cards = l);
382
383
  let u = n?.quick_add ?? e.quick_add;
@@ -385,13 +386,13 @@ function Ne(e, t, n) {
385
386
  function Z(e, t, n) {
386
387
  return e ?? t ?? n;
387
388
  }
388
- function Pe(e) {
389
- return _(e, "update") ? "inline_edit" : "readonly";
390
- }
391
389
  function Fe(e) {
392
- return e.display.name_plural && Object.keys(e.display.name_plural).length > 0 ? e.display.name_plural : e.display.name;
390
+ return g(e, "update") ? "inline_edit" : "readonly";
393
391
  }
394
392
  function Ie(e) {
393
+ return e.display.name_plural && Object.keys(e.display.name_plural).length > 0 ? e.display.name_plural : e.display.name;
394
+ }
395
+ function Le(e) {
395
396
  if (e.fields.get("created_at")?.type === "timestamp") return "created_at:desc";
396
397
  if (e.fields.get("updated_at")?.type === "timestamp") return "updated_at:desc";
397
398
  for (let t of e.fields.names()) {
@@ -402,10 +403,10 @@ function Ie(e) {
402
403
  let n = e.fields.get(t);
403
404
  if (n && n.type === "date") return t + ":desc";
404
405
  }
405
- let t = We(e);
406
+ let t = Ge(e);
406
407
  return t ? t + ":asc" : "";
407
408
  }
408
- function Le(e, t) {
409
+ function Re(e, t) {
409
410
  let n = new Set(Array.isArray(t) ? t : [t]), r = [];
410
411
  for (let t of e.fields.names()) {
411
412
  if (r.length >= 6) break;
@@ -414,11 +415,11 @@ function Le(e, t) {
414
415
  }
415
416
  return r;
416
417
  }
417
- function Re(e, t) {
418
+ function ze(e, t) {
418
419
  let n = { ...e };
419
- return n.time_field ||= Ve(t), n.type_field ||= He(t, "enum"), n.summary_field ||= Ue(t, "string", "text", "rich_text"), n.content_field ||= Ue(t, "rich_text", "text"), n.summary_field && n.content_field && n.summary_field === n.content_field && (n.summary_field = void 0), n.author_field || t.fields.get("created_by") && (n.author_field = "created_by"), n.direction_field ||= ze(t), n.intent_field ||= Be(t), n;
420
+ return n.time_field ||= He(t), n.type_field ||= Ue(t, "enum"), n.summary_field ||= We(t, "string", "text", "rich_text"), n.content_field ||= We(t, "rich_text", "text"), n.summary_field && n.content_field && n.summary_field === n.content_field && (n.summary_field = void 0), n.author_field || t.fields.get("created_by") && (n.author_field = "created_by"), n.direction_field ||= Be(t), n.intent_field ||= Ve(t), n;
420
421
  }
421
- function ze(e) {
422
+ function Be(e) {
422
423
  let t = e.fields.get("direction");
423
424
  if (t && t.type === "enum") return "direction";
424
425
  for (let t of [
@@ -431,11 +432,11 @@ function ze(e) {
431
432
  if (n && n.type === "bool") return t;
432
433
  }
433
434
  }
434
- function Be(e) {
435
+ function Ve(e) {
435
436
  let t = e.fields.get("intent");
436
437
  if (t && t.type === "enum") return "intent";
437
438
  }
438
- function Ve(e) {
439
+ function He(e) {
439
440
  for (let t of e.fields.names()) {
440
441
  let n = e.fields.get(t);
441
442
  if (n && n.type === "timestamp" && !n.auto) return t;
@@ -447,13 +448,13 @@ function Ve(e) {
447
448
  if (n && n.type === "timestamp") return t;
448
449
  }
449
450
  }
450
- function He(e, t) {
451
+ function Ue(e, t) {
451
452
  for (let n of e.fields.names()) {
452
453
  let r = e.fields.get(n);
453
454
  if (r && r.type === t) return n;
454
455
  }
455
456
  }
456
- function Ue(e, ...t) {
457
+ function We(e, ...t) {
457
458
  for (let n of e.fields.names()) {
458
459
  let r = e.fields.get(n);
459
460
  if (r) {
@@ -461,28 +462,28 @@ function Ue(e, ...t) {
461
462
  }
462
463
  }
463
464
  }
464
- function We(e) {
465
- let t = j(e);
465
+ function Ge(e) {
466
+ let t = E(e);
466
467
  return t.length > 0 ? t[0] : void 0;
467
468
  }
468
- function Ge(e, t) {
469
+ function Ke(e, t) {
469
470
  return e.children?.find((e) => e.entity === t);
470
471
  }
471
472
  //#endregion
472
473
  //#region src/lib/quick-add.ts
473
- function Ke(e, t, n, r) {
474
+ function qe(e, t, n, r) {
474
475
  let i = {
475
476
  ...t ?? {},
476
477
  ...e
477
478
  };
478
479
  if (Array.isArray(n)) {
479
- let e = Array.isArray(r) ? r.map(String) : S(String(r), n.length);
480
+ let e = Array.isArray(r) ? r.map(String) : T(String(r), n.length);
480
481
  if (!e || e.length !== n.length) throw Error("invalid composite parent id");
481
482
  for (let t = 0; t < n.length; t++) i[n[t]] = e[t];
482
483
  } else i[n] = Array.isArray(r) ? r[0] : r;
483
484
  return i;
484
485
  }
485
- function qe(e, t) {
486
+ function Je(e, t) {
486
487
  for (let n of t) {
487
488
  let t = e[n];
488
489
  if (t == null || t === "") return !1;
@@ -491,27 +492,27 @@ function qe(e, t) {
491
492
  }
492
493
  //#endregion
493
494
  //#region src/components/detail-layout/useQuickAdd.ts
494
- function Je(e, t, n, r) {
495
- let [i, a] = q(() => {
496
- let t = e.quick_add, n = r.entities[e.entity], i = {};
497
- if (t?.fields) for (let e of t.fields) t.defaults?.[e] == null ? n?.fields.get(e)?.type === "timestamp" && (i[e] = O()) : i[e] = t.defaults[e];
495
+ function Ye(e, t, i, a) {
496
+ let [o, s] = q(() => {
497
+ let t = e.quick_add, r = a.entities[e.entity], i = {};
498
+ if (t?.fields) for (let e of t.fields) t.defaults?.[e] == null ? r?.fields.get(e)?.type === "timestamp" && (i[e] = n()) : i[e] = t.defaults[e];
498
499
  return i;
499
- }), s = xe(), { mutate: c, isPending: l, error: u, reset: d } = be({
500
- mutationFn: (t) => v(e.entity, t),
501
- onMutate: async (r) => {
502
- let i = Array.isArray(n) ? k(n.map(String)) : n, a = [
503
- o,
500
+ }), c = Se(), { mutate: l, isPending: u, error: d, reset: f } = xe({
501
+ mutationFn: (t) => H(e.entity, t),
502
+ onMutate: async (n) => {
503
+ let a = Array.isArray(i) ? m(i.map(String)) : i, o = [
504
+ r,
504
505
  t,
505
- i,
506
+ a,
506
507
  e.entity
507
508
  ];
508
- await s.cancelQueries({ queryKey: a });
509
- let c = s.getQueriesData({ queryKey: a }), l = {
510
- ...r,
509
+ await c.cancelQueries({ queryKey: o });
510
+ let s = c.getQueriesData({ queryKey: o }), l = {
511
+ ...n,
511
512
  id: `__optimistic_${crypto.randomUUID()}`,
512
513
  __optimistic: !0
513
514
  };
514
- return s.setQueriesData({ queryKey: a }, (e) => {
515
+ return c.setQueriesData({ queryKey: o }, (e) => {
515
516
  if (!e || typeof e != "object") return e;
516
517
  if ("pages" in e && Array.isArray(e.pages) && e.pages.length > 0) {
517
518
  let t = e, [n, ...r] = t.pages;
@@ -524,54 +525,54 @@ function Je(e, t, n, r) {
524
525
  };
525
526
  }
526
527
  return e;
527
- }), { snapshots: c };
528
+ }), { snapshots: s };
528
529
  },
529
530
  onError: (e, t, n) => {
530
- if (n?.snapshots) for (let [e, t] of n.snapshots) s.setQueryData(e, t);
531
+ if (n?.snapshots) for (let [e, t] of n.snapshots) c.setQueryData(e, t);
531
532
  },
532
533
  onSuccess: () => {
533
- let t = e.quick_add, n = r.entities[e.entity], i = {};
534
- if (t?.fields) for (let e of t.fields) i[e] = t?.defaults?.[e] == null ? n?.fields.get(e)?.type === "timestamp" ? O() : "" : t.defaults[e];
535
- a(i);
534
+ let t = e.quick_add, r = a.entities[e.entity], i = {};
535
+ if (t?.fields) for (let e of t.fields) i[e] = t?.defaults?.[e] == null ? r?.fields.get(e)?.type === "timestamp" ? n() : "" : t.defaults[e];
536
+ s(i);
536
537
  },
537
538
  onSettled: () => {
538
- let r = Array.isArray(n) ? k(n.map(String)) : n;
539
- s.invalidateQueries({ queryKey: [
540
- o,
541
- t,
539
+ let n = Array.isArray(i) ? m(i.map(String)) : i;
540
+ c.invalidateQueries({ queryKey: [
542
541
  r,
542
+ t,
543
+ n,
543
544
  e.entity
544
545
  ] });
545
546
  }
546
- }), f = e.quick_add, p = r.entities[e.entity], m = qe(i, f?.fields.filter((e) => p?.fields.get(e)?.required) ?? []);
547
- function h(t) {
548
- if (t.preventDefault(), !f) return;
549
- let r = Ke(i, f.defaults, e.foreign_key, n);
550
- c(r);
547
+ }), p = e.quick_add, h = a.entities[e.entity], g = Je(o, p?.fields.filter((e) => h?.fields.get(e)?.required) ?? []);
548
+ function _(t) {
549
+ if (t.preventDefault(), !p) return;
550
+ let n = qe(o, p.defaults, e.foreign_key, i);
551
+ l(n);
551
552
  }
552
- function g(e, t) {
553
- u && d(), a((n) => ({
553
+ function v(e, t) {
554
+ d && f(), s((n) => ({
554
555
  ...n,
555
556
  [e]: t
556
557
  }));
557
558
  }
558
559
  return {
559
- values: i,
560
- quickAdd: f,
561
- childEntity: p,
562
- isPending: l,
563
- error: u,
564
- isReady: m,
565
- handleSubmit: h,
566
- handleFieldChange: g
560
+ values: o,
561
+ quickAdd: p,
562
+ childEntity: h,
563
+ isPending: u,
564
+ error: d,
565
+ isReady: g,
566
+ handleSubmit: _,
567
+ handleFieldChange: v
567
568
  };
568
569
  }
569
570
  //#endregion
570
571
  //#region src/components/detail-layout/QuickAddForm.tsx
571
- function Ye({ config: t, parentEntity: r, parentId: i, schema: a }) {
572
- let { values: o, quickAdd: s, childEntity: c, isPending: l, error: d, isReady: f, handleSubmit: p, handleFieldChange: m } = Je(t, r, i, a), h = x(), _ = u(), v = _e();
573
- return !s || s.fields.length === 0 || !c ? null : /* @__PURE__ */ X("form", {
574
- onSubmit: p,
572
+ function Xe({ config: t, parentEntity: n, parentId: r, schema: i }) {
573
+ let a = A(), o = A("errors"), { values: s, quickAdd: c, childEntity: u, isPending: d, error: p, isReady: m, handleSubmit: h, handleFieldChange: g } = Ye(t, n, r, i), _ = S(), v = _e();
574
+ return !c || c.fields.length === 0 || !u ? null : /* @__PURE__ */ X("form", {
575
+ onSubmit: h,
575
576
  style: {
576
577
  display: "flex",
577
578
  flexDirection: _.isPhone ? "column" : "row",
@@ -581,10 +582,10 @@ function Ye({ config: t, parentEntity: r, parentId: i, schema: a }) {
581
582
  borderBottom: "1px solid var(--divider)"
582
583
  },
583
584
  children: [
584
- s.fields.map((e) => {
585
- let r = c.fields.get(e);
586
- if (!r) return null;
587
- let i = `${v}-quick-add-${t.entity}-${e}`, s = `${i}-label`;
585
+ c.fields.map((e) => {
586
+ let n = u.fields.get(e);
587
+ if (!n) return null;
588
+ let r = `${v}-quick-add-${t.entity}-${e}`, o = `${r}-label`;
588
589
  return /* @__PURE__ */ X("div", {
589
590
  style: {
590
591
  flex: 1,
@@ -592,8 +593,8 @@ function Ye({ config: t, parentEntity: r, parentId: i, schema: a }) {
592
593
  width: _.isPhone ? "100%" : void 0
593
594
  },
594
595
  children: [/* @__PURE__ */ Y("label", {
595
- id: s,
596
- htmlFor: i,
596
+ id: o,
597
+ htmlFor: r,
597
598
  style: {
598
599
  fontSize: 11,
599
600
  color: "var(--text-3)",
@@ -601,56 +602,56 @@ function Ye({ config: t, parentEntity: r, parentId: i, schema: a }) {
601
602
  display: "block",
602
603
  fontWeight: 500
603
604
  },
604
- children: n(r, e, a.entities)
605
- }), M({
606
- field: r,
605
+ children: f(a, n, e, i.entities)
606
+ }), C({
607
+ field: n,
607
608
  fieldName: e,
608
- value: o[e] ?? "",
609
+ value: s[e] ?? "",
609
610
  mode: "edit",
610
- onChange: (t) => m(e, t),
611
- record: o,
612
- fieldId: i,
613
- labelId: s,
614
- locale: h
611
+ onChange: (t) => g(e, t),
612
+ record: s,
613
+ fieldId: r,
614
+ labelId: o,
615
+ t: a
615
616
  })]
616
617
  }, e);
617
618
  }),
618
- /* @__PURE__ */ Y(g, {
619
+ /* @__PURE__ */ Y(l, {
619
620
  type: "submit",
620
621
  kind: "primary",
621
622
  size: _.isPhone ? "md" : "sm",
622
623
  icon: /* @__PURE__ */ Y(e.plus, { size: 12 }),
623
- disabled: l || !f,
624
+ disabled: d || !m,
624
625
  style: _.isPhone ? { alignSelf: "flex-end" } : void 0,
625
- children: "Add"
626
+ children: a("record.related.add", "Add")
626
627
  }),
627
- d != null && /* @__PURE__ */ Y("span", {
628
+ p != null && /* @__PURE__ */ Y("span", {
628
629
  style: {
629
630
  fontSize: 11,
630
631
  color: "var(--danger)",
631
632
  alignSelf: "flex-end",
632
633
  marginBottom: 4
633
634
  },
634
- children: d.message
635
+ children: U(o, p)
635
636
  })
636
637
  ]
637
638
  });
638
639
  }
639
640
  //#endregion
640
641
  //#region src/components/detail-layout/useManualColumnResize.tsx
641
- function Xe(e, t, n) {
642
+ function Ze(e, t, n) {
642
643
  return `${e}::child::${t}.${n}`;
643
644
  }
644
- function Ze(e) {
645
- return Math.min(oe, Math.max(60, Math.round(e)));
646
- }
647
645
  function Qe(e) {
648
- let { widths: t, setWidths: n, resetWidths: r } = te(e), [i, a] = q({}), o = K(null);
649
- W(() => {
646
+ return Math.min(le, Math.max(60, Math.round(e)));
647
+ }
648
+ function $e(e) {
649
+ let { widths: t, setWidths: n, resetWidths: r } = re(e), [i, a] = q({}), o = K(null);
650
+ G(() => {
650
651
  let e = (e) => {
651
652
  let t = o.current;
652
653
  if (!t) return;
653
- let n = Ze(t.startWidth + (e.clientX - t.startX));
654
+ let n = Qe(t.startWidth + (e.clientX - t.startX));
654
655
  t.current = n, a({ [t.colId]: n });
655
656
  }, t = () => {
656
657
  let e = o.current;
@@ -660,7 +661,7 @@ function Qe(e) {
660
661
  window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t);
661
662
  };
662
663
  }, [n]);
663
- let s = U((e, n) => {
664
+ let s = W((e, n) => {
664
665
  n.preventDefault(), n.stopPropagation();
665
666
  let r = n.currentTarget.closest("th")?.getBoundingClientRect().width, i = t[e] ?? (r && r > 0 ? r : 150);
666
667
  o.current = {
@@ -671,7 +672,7 @@ function Qe(e) {
671
672
  };
672
673
  }, [t]);
673
674
  return {
674
- headerStyle: U((e, n) => {
675
+ headerStyle: W((e, n) => {
675
676
  let r = i[e] ?? t[e];
676
677
  return r == null ? {
677
678
  ...n,
@@ -684,7 +685,7 @@ function Qe(e) {
684
685
  maxWidth: r
685
686
  };
686
687
  }, [i, t]),
687
- cellStyle: U((e, n) => {
688
+ cellStyle: W((e, n) => {
688
689
  let r = i[e] ?? t[e];
689
690
  return r == null ? n : {
690
691
  ...n,
@@ -700,7 +701,7 @@ function Qe(e) {
700
701
  resetWidths: r
701
702
  };
702
703
  }
703
- function $e({ colId: e, onMouseDown: t }) {
704
+ function et({ colId: e, onMouseDown: t }) {
704
705
  return /* @__PURE__ */ Y("span", {
705
706
  "data-testid": "col-resize-handle",
706
707
  "aria-hidden": "true",
@@ -728,47 +729,47 @@ function $e({ colId: e, onMouseDown: t }) {
728
729
  }
729
730
  //#endregion
730
731
  //#region src/components/detail-layout/ChildrenTable.tsx
731
- function et({ config: t, parentEntity: r, parentId: a, schema: o }) {
732
- let s = o.entities[t.entity], c = Array.isArray(t.foreign_key) ? t.foreign_key.join(",") : t.foreign_key, l = Qe(Xe(r, t.entity, c)), u = x(), p = y(s?.realtime, t.entity), { data: m, isLoading: h, isError: g, refetch: _ } = d(r, a, t.entity, t.foreign_key, t.sort, t.limit), { refreshing: v, refresh: S } = re(_), C = m?.data ?? [], w = m?.$refs, E = K(w);
733
- E.current = w;
734
- let O = t.columns, k = t.interaction === "navigate", A = O[0], j = k && s ? b(void 0, s, o.screens) : null, M = s ? We(s) : void 0, ee = G(() => {
732
+ function tt({ config: t, parentEntity: n, parentId: r, schema: i }) {
733
+ let s = A(), l = A("errors"), d = i.entities[t.entity], m = Array.isArray(t.foreign_key) ? t.foreign_key.join(",") : t.foreign_key, h = $e(Ze(n, t.entity, m)), g = p(d?.realtime, t.entity), { data: y, isLoading: b, isError: S, refetch: C } = c(n, r, t.entity, t.foreign_key, t.sort, t.limit), { refreshing: w, refresh: T } = ae(C), E = y?.data ?? [], D = y?.$refs, O = K(D);
734
+ O.current = D;
735
+ let k = t.columns, j = t.interaction === "navigate", M = k[0], N = j && d ? u(void 0, d, i.screens) : null, P = d ? Ge(d) : void 0, ee = ye(() => {
735
736
  let e = /* @__PURE__ */ new Map();
736
- if (!s) return e;
737
- for (let t of O) {
738
- let n = s.fields.get(t);
739
- n && e.set(t, D({
737
+ if (!d) return e;
738
+ for (let t of k) {
739
+ let n = d.fields.get(t);
740
+ n && e.set(t, _({
740
741
  field: n,
741
742
  fieldName: t,
742
743
  surface: "list",
743
- entity: s,
744
- entities: o.entities,
745
- screens: o.screens,
746
- refs: () => E.current,
747
- locale: u
744
+ entity: d,
745
+ entities: i.entities,
746
+ screens: i.screens,
747
+ refs: () => O.current,
748
+ t: s
748
749
  }));
749
750
  }
750
751
  return e;
751
752
  }, [
752
- s,
753
- O,
754
- o.entities,
755
- o.screens,
756
- u
753
+ d,
754
+ k,
755
+ i.entities,
756
+ i.screens,
757
+ s
757
758
  ]);
758
- if (!s) return /* @__PURE__ */ Y("div", {
759
+ if (!d) return /* @__PURE__ */ Y("div", {
759
760
  style: {
760
761
  fontSize: 12.5,
761
762
  color: "var(--text-3)",
762
763
  padding: "8px 0"
763
764
  },
764
- children: "Entity not found."
765
+ children: l("record.related_entity_not_found", "The related record type is not declared in this deployment.")
765
766
  });
766
- let N = /* @__PURE__ */ Y(Ye, {
767
+ let F = /* @__PURE__ */ Y(Xe, {
767
768
  config: t,
768
- parentEntity: r,
769
- parentId: a,
770
- schema: o
771
- }), F = /* @__PURE__ */ X("div", {
769
+ parentEntity: n,
770
+ parentId: r,
771
+ schema: i
772
+ }), I = g ? s("record.related.live", "Live") : s("record.related.paused", "Updates paused"), L = /* @__PURE__ */ X("div", {
772
773
  style: {
773
774
  display: "flex",
774
775
  alignItems: "center",
@@ -777,51 +778,55 @@ function et({ config: t, parentEntity: r, parentId: a, schema: o }) {
777
778
  justifyContent: "flex-end"
778
779
  },
779
780
  children: [
780
- l.hasWidths && /* @__PURE__ */ Y(i, {
781
+ h.hasWidths && /* @__PURE__ */ Y(o, {
781
782
  icon: /* @__PURE__ */ Y(e.columns, { size: 13 }),
782
- title: "Reset column widths (this device)",
783
+ title: s("record.related.reset_widths", "Reset column widths (this device)"),
783
784
  size: 24,
784
- onClick: l.resetWidths
785
+ onClick: h.resetWidths
785
786
  }),
786
- s.realtime === !0 && /* @__PURE__ */ Y("span", {
787
+ d.realtime === !0 && /* @__PURE__ */ Y("span", {
787
788
  "data-testid": "children-live-indicator",
788
789
  role: "status",
789
- "aria-label": p ? "Live" : "Updates paused",
790
- title: p ? "This table updates automatically in realtime." : "Realtime updates are paused. Refresh manually to load the latest data.",
791
- children: /* @__PURE__ */ Y(P, {
792
- tone: p ? "emerald" : "amber",
790
+ "aria-label": I,
791
+ title: g ? s("record.related.live_hint", "This table updates automatically in realtime.") : s("record.related.paused_hint", "Realtime updates are paused. Refresh manually to load the latest data."),
792
+ children: /* @__PURE__ */ Y(a, {
793
+ tone: g ? "emerald" : "amber",
793
794
  size: "xs",
794
795
  dot: !0,
795
- children: p ? "Live" : "Updates paused"
796
+ children: I
796
797
  })
797
798
  }),
798
- /* @__PURE__ */ Y(i, {
799
- icon: v ? /* @__PURE__ */ Y("span", {
799
+ /* @__PURE__ */ Y(o, {
800
+ icon: w ? /* @__PURE__ */ Y("span", {
800
801
  "data-testid": "children-refresh-spinner",
801
802
  style: { display: "inline-flex" },
802
- children: /* @__PURE__ */ Y(f, { size: 13 })
803
+ children: /* @__PURE__ */ Y(x, { size: 13 })
803
804
  }) : /* @__PURE__ */ Y(e.refresh, { size: 13 }),
804
- title: "Refresh",
805
+ title: s("record.related.refresh", "Refresh"),
805
806
  size: 24,
806
- disabled: v,
807
- onClick: S
807
+ disabled: w,
808
+ onClick: T
808
809
  })
809
810
  ]
810
811
  });
811
- return g ? /* @__PURE__ */ X("div", { children: [
812
- N,
812
+ return S ? /* @__PURE__ */ X("div", { children: [
813
813
  F,
814
- /* @__PURE__ */ Y("div", {
814
+ L,
815
+ /* @__PURE__ */ X("div", {
815
816
  style: {
816
817
  fontSize: 12.5,
817
818
  color: "var(--danger)",
818
819
  padding: "8px 0"
819
820
  },
820
- children: "Failed to load. Try again."
821
+ children: [
822
+ l("record.related_rows_unreadable", "The related records could not be loaded."),
823
+ " ",
824
+ s("record.related.try_again", "Try again.")
825
+ ]
821
826
  })
822
- ] }) : h ? /* @__PURE__ */ X("div", { children: [
823
- N,
827
+ ] }) : b ? /* @__PURE__ */ X("div", { children: [
824
828
  F,
829
+ L,
825
830
  /* @__PURE__ */ Y("div", {
826
831
  style: {
827
832
  display: "flex",
@@ -839,40 +844,40 @@ function et({ config: t, parentEntity: r, parentId: a, schema: o }) {
839
844
  borderRadius: 4
840
845
  } }, e))
841
846
  })
842
- ] }) : C.length === 0 ? /* @__PURE__ */ X("div", { children: [
843
- N,
847
+ ] }) : E.length === 0 ? /* @__PURE__ */ X("div", { children: [
844
848
  F,
849
+ L,
845
850
  /* @__PURE__ */ Y("div", {
846
851
  style: {
847
852
  fontSize: 12.5,
848
853
  color: "var(--text-3)",
849
854
  padding: "12px 0"
850
855
  },
851
- children: "No records yet."
856
+ children: s("record.related.empty", "No records yet.")
852
857
  })
853
858
  ] }) : /* @__PURE__ */ X("div", { children: [
854
- N,
855
859
  F,
860
+ L,
856
861
  /* @__PURE__ */ Y("div", {
857
862
  style: { overflowX: "auto" },
858
863
  children: /* @__PURE__ */ X("table", {
859
- style: de,
860
- children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children: O.map((e) => {
861
- let t = s.fields.get(e);
864
+ style: pe,
865
+ children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children: k.map((e) => {
866
+ let t = d.fields.get(e);
862
867
  return /* @__PURE__ */ X("th", {
863
- style: l.headerStyle(e, ue),
864
- children: [t ? n(t, e, o.entities) : e, /* @__PURE__ */ Y($e, {
868
+ style: h.headerStyle(e, fe),
869
+ children: [t ? f(s, t, e, i.entities) : e, /* @__PURE__ */ Y(et, {
865
870
  colId: e,
866
- onMouseDown: l.onHandleMouseDown
871
+ onMouseDown: h.onHandleMouseDown
867
872
  })]
868
873
  }, e);
869
- }) }) }), /* @__PURE__ */ Y("tbody", { children: C.map((e, t) => {
870
- let n = M ? T(e[M]) : "", r = k && j && n ? j.replace(/:\w+/, n) : void 0;
871
- return /* @__PURE__ */ Y("tr", { children: O.map((t) => {
872
- let n = t === A, i = ee.get(t), a = i ? i(e[t], e) : T(e[t]);
874
+ }) }) }), /* @__PURE__ */ Y("tbody", { children: E.map((e, t) => {
875
+ let n = P ? v(e[P]) : "", r = j && N && n ? N.replace(/:\w+/, n) : void 0;
876
+ return /* @__PURE__ */ Y("tr", { children: k.map((t) => {
877
+ let n = t === M, i = ee.get(t), a = i ? i(e[t], e) : v(e[t]);
873
878
  return /* @__PURE__ */ Y("td", {
874
879
  title: typeof a == "string" ? a : void 0,
875
- style: l.cellStyle(t, fe),
880
+ style: h.cellStyle(t, me),
876
881
  children: n && r ? /* @__PURE__ */ Y("a", {
877
882
  href: r,
878
883
  style: {
@@ -885,7 +890,7 @@ function et({ config: t, parentEntity: r, parentId: a, schema: o }) {
885
890
  children: a
886
891
  }) : a
887
892
  }, t);
888
- }) }, T(e.id ?? t));
893
+ }) }, v(e.id ?? t));
889
894
  }) })]
890
895
  })
891
896
  })
@@ -893,31 +898,35 @@ function et({ config: t, parentEntity: r, parentId: a, schema: o }) {
893
898
  }
894
899
  //#endregion
895
900
  //#region src/components/detail-layout/ChildrenList.tsx
896
- function tt({ config: e, parentEntity: t, parentId: n, schema: r }) {
897
- let i = r.entities[e.entity], a = x(), { data: o, isLoading: c, isError: l } = d(t, n, e.entity, e.foreign_key, e.sort, e.limit), u = o?.data ?? [], f = o?.$refs, p = e.columns;
901
+ function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
902
+ let i = r.entities[e.entity], a = A(), o = A("errors"), { data: s, isLoading: l, isError: u } = c(t, n, e.entity, e.foreign_key, e.sort, e.limit), d = s?.data ?? [], f = s?.$refs, p = e.columns;
898
903
  if (!i) return /* @__PURE__ */ Y("div", {
899
904
  style: {
900
905
  fontSize: 12.5,
901
906
  color: "var(--text-3)",
902
907
  padding: "8px 0"
903
908
  },
904
- children: "Entity not found."
909
+ children: o("record.related_entity_not_found", "The related record type is not declared in this deployment.")
905
910
  });
906
- let m = /* @__PURE__ */ Y(Ye, {
911
+ let m = /* @__PURE__ */ Y(Xe, {
907
912
  config: e,
908
913
  parentEntity: t,
909
914
  parentId: n,
910
915
  schema: r
911
916
  });
912
- if (l) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ Y("div", {
917
+ if (u) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ X("div", {
913
918
  style: {
914
919
  fontSize: 12.5,
915
920
  color: "var(--danger)",
916
921
  padding: "8px 0"
917
922
  },
918
- children: "Failed to load. Try again."
923
+ children: [
924
+ o("record.related_rows_unreadable", "The related records could not be loaded."),
925
+ " ",
926
+ a("record.related.try_again", "Try again.")
927
+ ]
919
928
  })] });
920
- if (c) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ X("div", {
929
+ if (l) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ X("div", {
921
930
  style: {
922
931
  display: "flex",
923
932
  flexDirection: "column",
@@ -943,13 +952,13 @@ function tt({ config: e, parentEntity: t, parentId: n, schema: r }) {
943
952
  } })
944
953
  ]
945
954
  })] });
946
- if (u.length === 0) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ Y("div", {
955
+ if (d.length === 0) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ Y("div", {
947
956
  style: {
948
957
  fontSize: 12.5,
949
958
  color: "var(--text-3)",
950
959
  padding: "12px 0"
951
960
  },
952
- children: "No records yet."
961
+ children: a("record.related.empty", "No records yet.")
953
962
  })] });
954
963
  let h = p.length > 0 ? i.display.display_field ?? p[0] : i.display.display_field;
955
964
  return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ Y("div", {
@@ -957,8 +966,8 @@ function tt({ config: e, parentEntity: t, parentId: n, schema: r }) {
957
966
  display: "flex",
958
967
  flexDirection: "column"
959
968
  },
960
- children: u.map((e, t) => {
961
- let n = typeof e.$display == "string" ? e[s] : "";
969
+ children: d.map((e, t) => {
970
+ let n = typeof e.$display == "string" ? e[b] : "";
962
971
  return /* @__PURE__ */ Y("div", {
963
972
  style: {
964
973
  display: "flex",
@@ -979,15 +988,15 @@ function tt({ config: e, parentEntity: t, parentId: n, schema: r }) {
979
988
  textOverflow: "ellipsis",
980
989
  whiteSpace: "nowrap"
981
990
  },
982
- children: n || (h && i.fields.get(h) ? M({
991
+ children: n || (h && i.fields.get(h) ? C({
983
992
  field: i.fields.get(h),
984
993
  fieldName: h,
985
994
  value: e[h],
986
995
  mode: "display",
987
996
  record: e,
988
997
  refs: f,
989
- locale: a
990
- }) : h && e[h] != null ? T(e[h]) : null)
998
+ t: a
999
+ }) : h && e[h] != null ? v(e[h]) : null)
991
1000
  }), p.length > 1 && (() => {
992
1001
  let t = p.slice(1, 3).filter((t) => e[t] != null);
993
1002
  return t.length === 0 ? null : /* @__PURE__ */ Y("div", {
@@ -998,54 +1007,58 @@ function tt({ config: e, parentEntity: t, parentId: n, schema: r }) {
998
1007
  textOverflow: "ellipsis",
999
1008
  whiteSpace: "nowrap"
1000
1009
  },
1001
- children: t.map((t, n) => /* @__PURE__ */ X("span", { children: [n > 0 && " · ", i.fields.get(t) ? M({
1010
+ children: t.map((t, n) => /* @__PURE__ */ X("span", { children: [n > 0 && " · ", i.fields.get(t) ? C({
1002
1011
  field: i.fields.get(t),
1003
1012
  fieldName: t,
1004
1013
  value: e[t],
1005
1014
  mode: "display",
1006
1015
  record: e,
1007
1016
  refs: f,
1008
- locale: a
1017
+ t: a
1009
1018
  }) : String(e[t])] }, t))
1010
1019
  });
1011
1020
  })()]
1012
1021
  })
1013
- }, T(e.id ?? t));
1022
+ }, v(e.id ?? t));
1014
1023
  })
1015
1024
  })] });
1016
1025
  }
1017
1026
  //#endregion
1018
1027
  //#region src/components/detail-layout/ChildrenCards.tsx
1019
- function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1020
- let i = r.entities[e.entity], a = x(), { data: o, isLoading: s, isError: c } = d(t, n, e.entity, e.foreign_key, e.sort, e.limit), l = o?.data ?? [], u = o?.$refs, f = e.columns, p = e.cards, m = p?.header_field ?? f[0], h = p?.badge_field, g = p?.columns_count ?? 3;
1028
+ function rt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1029
+ let i = r.entities[e.entity], o = A(), s = A("errors"), { data: l, isLoading: u, isError: d } = c(t, n, e.entity, e.foreign_key, e.sort, e.limit), p = l?.data ?? [], m = l?.$refs, h = e.columns, g = e.cards, _ = g?.header_field ?? h[0], y = g?.badge_field, b = g?.columns_count ?? 3;
1021
1030
  if (!i) return /* @__PURE__ */ Y("div", {
1022
1031
  style: {
1023
1032
  fontSize: 12.5,
1024
1033
  color: "var(--text-3)",
1025
1034
  padding: "8px 0"
1026
1035
  },
1027
- children: "Entity not found."
1036
+ children: s("record.related_entity_not_found", "The related record type is not declared in this deployment.")
1028
1037
  });
1029
- let _ = {
1038
+ let x = {
1030
1039
  display: "grid",
1031
- gridTemplateColumns: `repeat(auto-fill, minmax(${g >= 4 ? 180 : 240}px, 1fr))`,
1040
+ gridTemplateColumns: `repeat(auto-fill, minmax(${b >= 4 ? 180 : 240}px, 1fr))`,
1032
1041
  gap: 12
1033
- }, v = /* @__PURE__ */ Y(Ye, {
1042
+ }, S = /* @__PURE__ */ Y(Xe, {
1034
1043
  config: e,
1035
1044
  parentEntity: t,
1036
1045
  parentId: n,
1037
1046
  schema: r
1038
1047
  });
1039
- if (c) return /* @__PURE__ */ X("div", { children: [v, /* @__PURE__ */ Y("div", {
1048
+ if (d) return /* @__PURE__ */ X("div", { children: [S, /* @__PURE__ */ X("div", {
1040
1049
  style: {
1041
1050
  fontSize: 12.5,
1042
1051
  color: "var(--danger)",
1043
1052
  padding: "8px 0"
1044
1053
  },
1045
- children: "Failed to load. Try again."
1054
+ children: [
1055
+ s("record.related_rows_unreadable", "The related records could not be loaded."),
1056
+ " ",
1057
+ o("record.related.try_again", "Try again.")
1058
+ ]
1046
1059
  })] });
1047
- if (s) return /* @__PURE__ */ X("div", { children: [v, /* @__PURE__ */ Y("div", {
1048
- style: _,
1060
+ if (u) return /* @__PURE__ */ X("div", { children: [S, /* @__PURE__ */ Y("div", {
1061
+ style: x,
1049
1062
  children: [
1050
1063
  0,
1051
1064
  1,
@@ -1056,18 +1069,18 @@ function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1056
1069
  borderRadius: 10
1057
1070
  } }, e))
1058
1071
  })] });
1059
- if (l.length === 0) return /* @__PURE__ */ X("div", { children: [v, /* @__PURE__ */ Y("div", {
1072
+ if (p.length === 0) return /* @__PURE__ */ X("div", { children: [S, /* @__PURE__ */ Y("div", {
1060
1073
  style: {
1061
1074
  fontSize: 12.5,
1062
1075
  color: "var(--text-3)",
1063
1076
  padding: "12px 0"
1064
1077
  },
1065
- children: "No records yet."
1078
+ children: o("record.related.empty", "No records yet.")
1066
1079
  })] });
1067
- let y = f.filter((e) => e !== m && e !== h);
1068
- return /* @__PURE__ */ X("div", { children: [v, /* @__PURE__ */ Y("div", {
1069
- style: _,
1070
- children: l.map((t, n) => /* @__PURE__ */ X("div", {
1080
+ let w = h.filter((e) => e !== _ && e !== y);
1081
+ return /* @__PURE__ */ X("div", { children: [S, /* @__PURE__ */ Y("div", {
1082
+ style: x,
1083
+ children: p.map((e, t) => /* @__PURE__ */ X("div", {
1071
1084
  style: {
1072
1085
  background: "var(--surface)",
1073
1086
  border: "1px solid var(--border)",
@@ -1081,7 +1094,7 @@ function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1081
1094
  alignItems: "center",
1082
1095
  justifyContent: "space-between",
1083
1096
  gap: 8,
1084
- borderBottom: y.length > 0 ? "1px solid var(--divider)" : "none"
1097
+ borderBottom: w.length > 0 ? "1px solid var(--divider)" : "none"
1085
1098
  },
1086
1099
  children: [/* @__PURE__ */ Y("div", {
1087
1100
  style: {
@@ -1091,38 +1104,38 @@ function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1091
1104
  textOverflow: "ellipsis",
1092
1105
  whiteSpace: "nowrap"
1093
1106
  },
1094
- children: m && i.fields.get(m) ? M({
1095
- field: i.fields.get(m),
1096
- fieldName: m,
1097
- value: t[m],
1107
+ children: _ && i.fields.get(_) ? C({
1108
+ field: i.fields.get(_),
1109
+ fieldName: _,
1110
+ value: e[_],
1098
1111
  mode: "display",
1099
- record: t,
1100
- refs: u,
1101
- locale: a
1102
- }) : `Record ${n + 1}`
1103
- }), h && t[h] != null && /* @__PURE__ */ Y(P, {
1112
+ record: e,
1113
+ refs: m,
1114
+ t: o
1115
+ }) : o("record.related.card_title", "Record {number}", { number: t + 1 })
1116
+ }), y && e[y] != null && /* @__PURE__ */ Y(a, {
1104
1117
  tone: "slate",
1105
1118
  size: "xs",
1106
- children: i.fields.get(h) ? M({
1107
- field: i.fields.get(h),
1108
- fieldName: h,
1109
- value: t[h],
1119
+ children: i.fields.get(y) ? C({
1120
+ field: i.fields.get(y),
1121
+ fieldName: y,
1122
+ value: e[y],
1110
1123
  mode: "display",
1111
- record: t,
1112
- refs: u,
1113
- locale: a
1114
- }) : T(t[h])
1124
+ record: e,
1125
+ refs: m,
1126
+ t: o
1127
+ }) : v(e[y])
1115
1128
  })]
1116
- }), y.length > 0 && /* @__PURE__ */ Y("div", {
1129
+ }), w.length > 0 && /* @__PURE__ */ Y("div", {
1117
1130
  style: {
1118
1131
  padding: "10px 14px",
1119
1132
  display: "flex",
1120
1133
  flexDirection: "column",
1121
1134
  gap: 4
1122
1135
  },
1123
- children: y.slice(0, 4).map((n) => {
1124
- let o = i.fields.get(n);
1125
- return o ? /* @__PURE__ */ X("div", {
1136
+ children: w.slice(0, 4).map((t) => {
1137
+ let n = i.fields.get(t);
1138
+ return n ? /* @__PURE__ */ X("div", {
1126
1139
  style: {
1127
1140
  display: "flex",
1128
1141
  alignItems: "baseline",
@@ -1134,41 +1147,41 @@ function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1134
1147
  color: "var(--text-3)",
1135
1148
  flexShrink: 0
1136
1149
  },
1137
- children: [r.entities[e.entity]?.fields.get(n)?.display?.name ? Object.values(r.entities[e.entity].fields.get(n).display.name)[0] : n, ":"]
1150
+ children: [f(o, n, t, r.entities), ":"]
1138
1151
  }), /* @__PURE__ */ Y("span", {
1139
1152
  style: {
1140
1153
  overflow: "hidden",
1141
1154
  textOverflow: "ellipsis",
1142
1155
  whiteSpace: "nowrap"
1143
1156
  },
1144
- children: M({
1145
- field: o,
1146
- fieldName: n,
1147
- value: t[n],
1157
+ children: C({
1158
+ field: n,
1159
+ fieldName: t,
1160
+ value: e[t],
1148
1161
  mode: "display",
1149
- record: t,
1150
- refs: u,
1151
- locale: a
1162
+ record: e,
1163
+ refs: m,
1164
+ t: o
1152
1165
  })
1153
1166
  })]
1154
- }, n) : null;
1167
+ }, t) : null;
1155
1168
  })
1156
1169
  })]
1157
- }, T(t.id ?? n)))
1170
+ }, v(e.id ?? t)))
1158
1171
  })] });
1159
1172
  }
1160
1173
  //#endregion
1161
1174
  //#region src/hooks/useTimelineData.ts
1162
- var rt = 50;
1163
- function it(e, t, n, r, i, a) {
1164
- let s = Array.isArray(r) ? r : [r], c = Array.isArray(r) ? S(t, s.length) : [t], l = a ?? rt, u = ye({
1175
+ var it = 50;
1176
+ function at(e, t, n, i, a, o) {
1177
+ let s = Array.isArray(i) ? i : [i], c = Array.isArray(i) ? T(t, s.length) : [t], l = o ?? it, u = be({
1165
1178
  queryKey: [
1166
- o,
1179
+ r,
1167
1180
  e,
1168
1181
  t,
1169
1182
  n,
1170
1183
  "timeline",
1171
- i,
1184
+ a,
1172
1185
  l
1173
1186
  ],
1174
1187
  queryFn: ({ pageParam: e }) => {
@@ -1179,14 +1192,14 @@ function it(e, t, n, r, i, a) {
1179
1192
  op: "eq",
1180
1193
  value: c[t]
1181
1194
  }));
1182
- return t.set("filters", JSON.stringify(r)), i ? t.set("sort", `${i}:desc`) : typeof console < "u" && console.warn(`[useTimelineData] no time_field for ${n}; fetch order falls back to API default`), t.set("limit", String(l)), e && t.set("after", e), ee(`/api/data/${n}?${t.toString()}`);
1195
+ return t.set("filters", JSON.stringify(r)), a ? t.set("sort", `${a}:desc`) : typeof console < "u" && console.warn(`[useTimelineData] no time_field for ${n}; fetch order falls back to API default`), t.set("limit", String(l)), e && t.set("after", e), O(`/api/data/${n}?${t.toString()}`);
1183
1196
  },
1184
1197
  getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
1185
1198
  initialPageParam: void 0,
1186
- enabled: !!e && !!t && !!n && !!r && c !== null
1199
+ enabled: !!e && !!t && !!n && !!i && c !== null
1187
1200
  });
1188
1201
  return {
1189
- rows: G(() => u.data?.pages.flatMap((e) => e.data) ?? [], [u.data?.pages]),
1202
+ rows: ye(() => u.data?.pages.flatMap((e) => e.data) ?? [], [u.data?.pages]),
1190
1203
  refs: u.data?.pages[0]?.$refs,
1191
1204
  fetchNextPage: u.fetchNextPage,
1192
1205
  hasOlder: !!u.hasNextPage,
@@ -1197,28 +1210,28 @@ function it(e, t, n, r, i, a) {
1197
1210
  }
1198
1211
  //#endregion
1199
1212
  //#region src/components/detail-layout/TimelineComposer.tsx
1200
- var at = "quick_entry", ot = 100, st = 240, ct = 800, lt = 80;
1201
- function ut({ config: t, parentEntity: n, parentId: r, schema: i }) {
1202
- let { values: a, quickAdd: o, childEntity: s, isPending: l, error: u, isReady: d, handleSubmit: f, handleFieldChange: p } = Je(t, n, r, i), m = x(), [h, _] = q(st), v = K(null), y = K(null), [b, S] = q(ct);
1203
- W(() => {
1213
+ var ot = "quick_entry", st = 100, ct = 240, lt = 800, ut = 80;
1214
+ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
1215
+ let { values: a, quickAdd: o, childEntity: s, isPending: c, error: u, isReady: d, handleSubmit: f, handleFieldChange: p } = Ye(t, n, r, i), m = A(), h = A("errors"), [g, _] = q(ct), v = K(null), y = K(null), [b, x] = q(lt);
1216
+ G(() => {
1204
1217
  let e = y.current?.parentElement;
1205
1218
  if (!e) return;
1206
1219
  let t = () => {
1207
- let t = Math.max(ot, e.clientHeight - lt);
1208
- S(Math.min(ct, t));
1220
+ let t = Math.max(st, e.clientHeight - ut);
1221
+ x(Math.min(lt, t));
1209
1222
  };
1210
1223
  t();
1211
1224
  let n = new ResizeObserver(t);
1212
1225
  return n.observe(e), () => n.disconnect();
1213
- }, []), W(() => {
1226
+ }, []), G(() => {
1214
1227
  _((e) => Math.min(e, b));
1215
1228
  }, [b]);
1216
- let C = K(a);
1217
- C.current = a;
1229
+ let S = K(a);
1230
+ S.current = a;
1218
1231
  let w = K(p);
1219
1232
  w.current = p;
1220
- let T = K({}), E = G(() => ({
1221
- getField: (e) => C.current[e],
1233
+ let T = K({}), E = ye(() => ({
1234
+ getField: (e) => S.current[e],
1222
1235
  setField: (e, t) => {
1223
1236
  w.current(e, t);
1224
1237
  },
@@ -1227,45 +1240,45 @@ function ut({ config: t, parentEntity: n, parentId: r, schema: i }) {
1227
1240
  t && (t.querySelector("textarea, input, select, [contenteditable]") ?? t).focus();
1228
1241
  }
1229
1242
  }), []);
1230
- W(() => c(at, E), [E]);
1231
- let D = U((e) => {
1243
+ G(() => D(ot, E), [E]);
1244
+ let O = W((e) => {
1232
1245
  e.preventDefault(), v.current = {
1233
1246
  startY: e.clientY,
1234
- startHeight: h
1247
+ startHeight: g
1235
1248
  };
1236
1249
  let t = (e) => {
1237
1250
  if (!v.current) return;
1238
- let t = v.current.startY - e.clientY, n = Math.min(b, Math.max(ot, v.current.startHeight + t));
1251
+ let t = v.current.startY - e.clientY, n = Math.min(b, Math.max(st, v.current.startHeight + t));
1239
1252
  _(n);
1240
1253
  }, n = () => {
1241
1254
  v.current = null, document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
1242
1255
  };
1243
1256
  document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
1244
- }, [h, b]);
1257
+ }, [g, b]);
1245
1258
  if (!o || o.fields.length === 0 || !s) return null;
1246
- let O = o.fields.find((e) => {
1259
+ let j = o.fields.find((e) => {
1247
1260
  let t = s.fields.get(e);
1248
1261
  return t && (t.type === "text" || t.type === "string");
1249
- }), k = [], A = [];
1262
+ }), M = [], N = [];
1250
1263
  for (let e of o.fields) {
1251
- if (e === O) continue;
1264
+ if (e === j) continue;
1252
1265
  let t = s.fields.get(e);
1253
- t && (t.type === "enum" ? k.push(e) : A.push(e));
1266
+ t && (t.type === "enum" ? M.push(e) : N.push(e));
1254
1267
  }
1255
- let j = (e) => {
1268
+ let P = (e) => {
1256
1269
  let t = s.fields.get(e);
1257
1270
  return t ? /* @__PURE__ */ Y("div", {
1258
1271
  ref: (t) => {
1259
1272
  T.current[e] = t;
1260
1273
  },
1261
- children: M({
1274
+ children: C({
1262
1275
  field: t,
1263
1276
  fieldName: e,
1264
1277
  value: a[e] ?? "",
1265
1278
  mode: "edit",
1266
1279
  onChange: (t) => p(e, t),
1267
1280
  record: a,
1268
- locale: m
1281
+ t: m
1269
1282
  })
1270
1283
  }, e) : null;
1271
1284
  };
@@ -1277,11 +1290,11 @@ function ut({ config: t, parentEntity: n, parentId: r, schema: i }) {
1277
1290
  background: "var(--surface)",
1278
1291
  display: "flex",
1279
1292
  flexDirection: "column",
1280
- height: `${h}px`
1293
+ height: `${g}px`
1281
1294
  },
1282
1295
  children: [/* @__PURE__ */ Y("div", {
1283
- onMouseDown: D,
1284
- title: "Drag to resize",
1296
+ onMouseDown: O,
1297
+ title: m("record.layout.drag_to_resize", "Drag to resize"),
1285
1298
  style: {
1286
1299
  height: 12,
1287
1300
  cursor: "row-resize",
@@ -1310,7 +1323,7 @@ function ut({ config: t, parentEntity: n, parentId: r, schema: i }) {
1310
1323
  padding: "0 12px 8px"
1311
1324
  },
1312
1325
  children: [
1313
- k.length > 0 && /* @__PURE__ */ Y("div", {
1326
+ M.length > 0 && /* @__PURE__ */ Y("div", {
1314
1327
  style: {
1315
1328
  display: "flex",
1316
1329
  flexWrap: "wrap",
@@ -1318,26 +1331,26 @@ function ut({ config: t, parentEntity: n, parentId: r, schema: i }) {
1318
1331
  gap: 6,
1319
1332
  flexShrink: 0
1320
1333
  },
1321
- children: k.map(j)
1334
+ children: M.map(P)
1322
1335
  }),
1323
- O && s.fields.get(O) && /* @__PURE__ */ Y("div", {
1336
+ j && s.fields.get(j) && /* @__PURE__ */ Y("div", {
1324
1337
  style: {
1325
1338
  flex: 1,
1326
1339
  minHeight: 0,
1327
1340
  display: "flex"
1328
1341
  },
1329
1342
  ref: (e) => {
1330
- T.current[O] = e;
1343
+ T.current[j] = e;
1331
1344
  },
1332
- children: M({
1333
- field: s.fields.get(O),
1334
- fieldName: O,
1335
- value: a[O] ?? "",
1345
+ children: C({
1346
+ field: s.fields.get(j),
1347
+ fieldName: j,
1348
+ value: a[j] ?? "",
1336
1349
  mode: "edit",
1337
- onChange: (e) => p(O, e),
1350
+ onChange: (e) => p(j, e),
1338
1351
  record: a,
1339
1352
  fill: !0,
1340
- locale: m
1353
+ t: m
1341
1354
  })
1342
1355
  }),
1343
1356
  /* @__PURE__ */ X("div", {
@@ -1348,35 +1361,31 @@ function ut({ config: t, parentEntity: n, parentId: r, schema: i }) {
1348
1361
  gap: 6,
1349
1362
  flexShrink: 0
1350
1363
  },
1351
- children: [A.map(j), /* @__PURE__ */ X("div", {
1364
+ children: [N.map(P), /* @__PURE__ */ X("div", {
1352
1365
  style: {
1353
1366
  marginLeft: "auto",
1354
1367
  display: "flex",
1355
1368
  alignItems: "center",
1356
1369
  gap: 8
1357
1370
  },
1358
- children: [/* @__PURE__ */ X("span", {
1371
+ children: [/* @__PURE__ */ Y("span", {
1359
1372
  style: {
1360
1373
  fontSize: 10.5,
1361
1374
  color: "var(--text-4)"
1362
1375
  },
1363
- children: [
1364
- /* @__PURE__ */ Y("span", {
1365
- className: "mono",
1366
- children: "⌘"
1367
- }),
1368
- /* @__PURE__ */ Y("span", {
1369
- className: "mono",
1370
- children: "↵"
1371
- }),
1372
- " to add"
1373
- ]
1374
- }), /* @__PURE__ */ Y(g, {
1376
+ children: k(m("record.related.shortcut_to_add", "{keys} to add"), { keys: /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
1377
+ className: "mono",
1378
+ children: "⌘"
1379
+ }), /* @__PURE__ */ Y("span", {
1380
+ className: "mono",
1381
+ children: "↵"
1382
+ })] }) })
1383
+ }), /* @__PURE__ */ Y(l, {
1375
1384
  type: "submit",
1376
1385
  kind: "primary",
1377
1386
  icon: /* @__PURE__ */ Y(e.plus, { size: 13 }),
1378
- disabled: l || !d,
1379
- children: "Add"
1387
+ disabled: c || !d,
1388
+ children: m("record.related.add", "Add")
1380
1389
  })]
1381
1390
  })]
1382
1391
  }),
@@ -1387,7 +1396,7 @@ function ut({ config: t, parentEntity: n, parentId: r, schema: i }) {
1387
1396
  margin: 0,
1388
1397
  flexShrink: 0
1389
1398
  },
1390
- children: u.message
1399
+ children: U(h, u)
1391
1400
  })
1392
1401
  ]
1393
1402
  })]
@@ -1395,107 +1404,107 @@ function ut({ config: t, parentEntity: n, parentId: r, schema: i }) {
1395
1404
  }
1396
1405
  //#endregion
1397
1406
  //#region src/components/detail-layout/ChildrenTimeline.tsx
1398
- var dt = 80, ft = 200, pt = 6, mt = 2e4, ht = 280;
1399
- function gt(e) {
1400
- if (e.length > ht) return !0;
1407
+ var ft = 80, pt = 200, mt = 6, ht = 2e4, gt = 280;
1408
+ function _t(e) {
1409
+ if (e.length > gt) return !0;
1401
1410
  let t = 0;
1402
- for (let n of e) if (n === "\n" && ++t >= pt) return !0;
1411
+ for (let n of e) if (n === "\n" && ++t >= mt) return !0;
1403
1412
  return !1;
1404
1413
  }
1405
- function _t(e, t) {
1406
- if (vt(t)) {
1414
+ function vt(e, t) {
1415
+ if (yt(t)) {
1407
1416
  let e = t.id;
1408
- return e == null ? "" : T(e);
1417
+ return e == null ? "" : v(e);
1409
1418
  }
1410
- return r(p(e, t));
1419
+ return V(h(e, t));
1411
1420
  }
1412
- function vt(e) {
1421
+ function yt(e) {
1413
1422
  return e.__optimistic === !0;
1414
1423
  }
1415
- function yt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1416
- let i = r.entities[e.entity], { rows: a, refs: o, fetchNextPage: s, hasOlder: c, isFetchingOlder: l, isLoading: u, isError: d } = it(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), p = e.timeline, m = p?.scroll ?? !1, h = (e.sort ?? "").endsWith(":asc"), _ = G(() => h ? [...a].reverse() : a, [a, h]), v = p?.auto_scroll ?? "none", y = K(null), b = K(null), x = K(!1), S = K(0), C = K(null), w = K(null), T = K(!0), D = K(null);
1417
- W(() => {
1418
- x.current = !1, S.current = 0, C.current = null, w.current = null, T.current = !0, D.current = null;
1424
+ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1425
+ let i = A(), a = A("errors"), o = r.entities[e.entity], { rows: s, refs: c, fetchNextPage: u, hasOlder: d, isFetchingOlder: f, isLoading: p, isError: m } = at(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), h = e.timeline, g = h?.scroll ?? !1, _ = (e.sort ?? "").endsWith(":asc"), v = ye(() => _ ? [...s].reverse() : s, [s, _]), y = h?.auto_scroll ?? "none", b = K(null), S = K(null), C = K(!1), w = K(0), T = K(null), E = K(null), D = K(!0), O = K(null);
1426
+ G(() => {
1427
+ C.current = !1, w.current = 0, T.current = null, E.current = null, D.current = !0, O.current = null;
1419
1428
  }, [n]), ve(() => {
1420
- l && y.current && (D.current = {
1421
- scrollHeight: y.current.scrollHeight,
1422
- scrollTop: y.current.scrollTop
1429
+ f && b.current && (O.current = {
1430
+ scrollHeight: b.current.scrollHeight,
1431
+ scrollTop: b.current.scrollTop
1423
1432
  });
1424
- }, [l]), ve(() => {
1425
- let e = y.current;
1426
- if (!e || _.length === 0 || !i) {
1427
- S.current = _.length;
1433
+ }, [f]), ve(() => {
1434
+ let e = b.current;
1435
+ if (!e || v.length === 0 || !o) {
1436
+ w.current = v.length;
1428
1437
  return;
1429
1438
  }
1430
- let t = _t(i, _[0]), n = _t(i, _[_.length - 1]), r = !x.current, a = _.length > S.current && S.current > 0, o = a && (h && t !== C.current && n === w.current || !h && n !== w.current && t === C.current), s = a && !o;
1431
- if (r) h && v === "bottom" && (e.scrollTop = e.scrollHeight), x.current = !0;
1432
- else if (o && D.current) {
1433
- let t = D.current;
1434
- h && (e.scrollTop = t.scrollTop + (e.scrollHeight - t.scrollHeight)), D.current = null;
1435
- } else s && h && T.current && (e.scrollTop = e.scrollHeight);
1436
- S.current = _.length, C.current = t, w.current = n;
1439
+ let t = vt(o, v[0]), n = vt(o, v[v.length - 1]), r = !C.current, i = v.length > w.current && w.current > 0, a = i && (_ && t !== T.current && n === E.current || !_ && n !== E.current && t === T.current), s = i && !a;
1440
+ if (r) _ && y === "bottom" && (e.scrollTop = e.scrollHeight), C.current = !0;
1441
+ else if (a && O.current) {
1442
+ let t = O.current;
1443
+ _ && (e.scrollTop = t.scrollTop + (e.scrollHeight - t.scrollHeight)), O.current = null;
1444
+ } else s && _ && D.current && (e.scrollTop = e.scrollHeight);
1445
+ w.current = v.length, T.current = t, E.current = n;
1437
1446
  }, [
1438
- _,
1439
1447
  v,
1440
- h,
1441
- i
1448
+ y,
1449
+ _,
1450
+ o
1442
1451
  ]);
1443
- let O = U(() => {
1444
- let e = y.current;
1445
- e && (T.current = e.scrollHeight - e.scrollTop - e.clientHeight < dt);
1446
- }, []);
1447
- W(() => {
1452
+ let k = W(() => {
1448
1453
  let e = b.current;
1454
+ e && (D.current = e.scrollHeight - e.scrollTop - e.clientHeight < ft);
1455
+ }, []);
1456
+ G(() => {
1457
+ let e = S.current;
1449
1458
  if (!e || typeof IntersectionObserver > "u") return;
1450
1459
  let t = new IntersectionObserver((e) => {
1451
- for (let t of e) t.isIntersecting && c && !l && s();
1460
+ for (let t of e) t.isIntersecting && d && !f && u();
1452
1461
  }, {
1453
- root: y.current ?? null,
1454
- rootMargin: `${ft}px 0px 0px 0px`,
1462
+ root: b.current ?? null,
1463
+ rootMargin: `${pt}px 0px 0px 0px`,
1455
1464
  threshold: 0
1456
1465
  });
1457
1466
  return t.observe(e), () => t.disconnect();
1458
1467
  }, [
1459
- c,
1460
- l,
1461
- s
1468
+ d,
1469
+ f,
1470
+ u
1462
1471
  ]);
1463
- let [k, A] = q(null);
1464
- if (!i) return /* @__PURE__ */ Y("div", {
1472
+ let [j, M] = q(null);
1473
+ if (!o) return /* @__PURE__ */ Y("div", {
1465
1474
  style: {
1466
1475
  fontSize: 12.5,
1467
1476
  color: "var(--text-3)",
1468
1477
  padding: "8px 0"
1469
1478
  },
1470
- children: "Entity not found."
1479
+ children: a("record.related_entity_not_found", "The related record type is not declared in this deployment.")
1471
1480
  });
1472
- let j = e.quick_add?.fields ?? [p?.content_field].filter(Boolean), M = E(i.display?.name_plural) || E(i.display?.name) || e.entity, ee = c ? /* @__PURE__ */ Y("div", {
1481
+ let N = e.quick_add?.fields ?? [h?.content_field].filter(Boolean), P = i(o.display?.name_plural) || i(o.display?.name) || e.entity, ee = d ? /* @__PURE__ */ Y("div", {
1473
1482
  style: {
1474
1483
  display: "flex",
1475
1484
  justifyContent: "center",
1476
1485
  padding: "6px 0"
1477
1486
  },
1478
- children: /* @__PURE__ */ Y(g, {
1487
+ children: /* @__PURE__ */ Y(l, {
1479
1488
  size: "xs",
1480
- onClick: () => s(),
1481
- disabled: l,
1482
- icon: l ? /* @__PURE__ */ Y(f, { size: 11 }) : void 0,
1483
- children: l ? "Loading…" : "Load older"
1489
+ onClick: () => u(),
1490
+ disabled: f,
1491
+ icon: f ? /* @__PURE__ */ Y(x, { size: 11 }) : void 0,
1492
+ children: f ? i("record.loading", "Loading…") : i("record.timeline.load_older", "Load older")
1484
1493
  })
1485
- }) : null, N = /* @__PURE__ */ Y("div", {
1486
- ref: b,
1494
+ }) : null, F = /* @__PURE__ */ Y("div", {
1495
+ ref: S,
1487
1496
  "aria-hidden": "true",
1488
1497
  style: { height: 1 }
1489
- }), P;
1490
- if (d) P = /* @__PURE__ */ Y("div", {
1498
+ }), I;
1499
+ if (m) I = /* @__PURE__ */ Y("div", {
1491
1500
  style: {
1492
1501
  fontSize: 12.5,
1493
1502
  color: "var(--danger)",
1494
1503
  padding: 12
1495
1504
  },
1496
- children: "Failed to load."
1505
+ children: a("record.related_rows_unreadable", "The related records could not be loaded.")
1497
1506
  });
1498
- else if (u) P = /* @__PURE__ */ X("div", {
1507
+ else if (p) I = /* @__PURE__ */ X("div", {
1499
1508
  style: {
1500
1509
  display: "flex",
1501
1510
  flexDirection: "column",
@@ -1512,69 +1521,69 @@ function yt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1512
1521
  borderRadius: 8
1513
1522
  } })]
1514
1523
  });
1515
- else if (_.length === 0) P = /* @__PURE__ */ X(J, { children: [N, /* @__PURE__ */ Y("div", {
1524
+ else if (v.length === 0) I = /* @__PURE__ */ X(J, { children: [F, /* @__PURE__ */ Y("div", {
1516
1525
  style: {
1517
1526
  fontSize: 12.5,
1518
1527
  color: "var(--text-3)",
1519
1528
  padding: 12
1520
1529
  },
1521
- children: "No activity yet."
1530
+ children: i("record.timeline.empty", "No activity yet.")
1522
1531
  })] });
1523
1532
  else {
1524
- let a = (a, s) => {
1525
- let c = _t(i, a) || String(s);
1526
- return /* @__PURE__ */ Y(bt, {
1527
- row: a,
1528
- rowId: c,
1529
- childEntity: i,
1533
+ let a = (i, a) => {
1534
+ let s = vt(o, i) || String(a);
1535
+ return /* @__PURE__ */ Y(xt, {
1536
+ row: i,
1537
+ rowId: s,
1538
+ childEntity: o,
1530
1539
  entityCode: e.entity,
1531
1540
  parentEntity: t,
1532
1541
  parentId: n,
1533
- timeline: p,
1534
- editableFields: j,
1535
- refs: o,
1536
- isEditing: k === c,
1537
- onStartEdit: () => A(c),
1538
- onCancelEdit: () => A(null),
1539
- onSaved: () => A(null),
1542
+ timeline: h,
1543
+ editableFields: N,
1544
+ refs: c,
1545
+ isEditing: j === s,
1546
+ onStartEdit: () => M(s),
1547
+ onCancelEdit: () => M(null),
1548
+ onSaved: () => M(null),
1540
1549
  schema: r,
1541
- optimistic: vt(a)
1542
- }, c);
1543
- }, s = p?.time_field, c;
1550
+ optimistic: yt(i)
1551
+ }, s);
1552
+ }, s = h?.time_field, l;
1544
1553
  if (s) {
1545
1554
  let e = [];
1546
- _.forEach((t, n) => {
1547
- let r = t[s], i = St(r), a = e[e.length - 1];
1548
- !a || a.key !== i ? e.push({
1549
- key: i,
1550
- label: Ct(r),
1555
+ v.forEach((t, n) => {
1556
+ let r = t[s], a = Ct(r), o = e[e.length - 1];
1557
+ !o || o.key !== a ? e.push({
1558
+ key: a,
1559
+ label: wt(i, r),
1551
1560
  rows: [{
1552
1561
  row: t,
1553
1562
  idx: n
1554
1563
  }]
1555
- }) : a.rows.push({
1564
+ }) : o.rows.push({
1556
1565
  row: t,
1557
1566
  idx: n
1558
1567
  });
1559
- }), c = e.map((e) => /* @__PURE__ */ X("div", {
1568
+ }), l = e.map((e) => /* @__PURE__ */ X("div", {
1560
1569
  style: {
1561
1570
  display: "flex",
1562
1571
  flexDirection: "column",
1563
1572
  gap: 8
1564
1573
  },
1565
- children: [/* @__PURE__ */ Y(wt, {
1574
+ children: [/* @__PURE__ */ Y(Tt, {
1566
1575
  label: e.label,
1567
1576
  count: e.rows.length
1568
1577
  }), e.rows.map(({ row: e, idx: t }) => a(e, t))]
1569
1578
  }, `day-${e.key}`));
1570
- } else c = _.map((e, t) => a(e, t));
1571
- P = /* @__PURE__ */ X(J, { children: [
1572
- N,
1579
+ } else l = v.map((e, t) => a(e, t));
1580
+ I = /* @__PURE__ */ X(J, { children: [
1581
+ F,
1573
1582
  ee,
1574
- c
1583
+ l
1575
1584
  ] });
1576
1585
  }
1577
- return m ? /* @__PURE__ */ X("div", {
1586
+ return g ? /* @__PURE__ */ X("div", {
1578
1587
  style: {
1579
1588
  display: "flex",
1580
1589
  flexDirection: "column",
@@ -1596,12 +1605,12 @@ function yt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1596
1605
  fontSize: 12.5,
1597
1606
  fontWeight: 600
1598
1607
  },
1599
- children: M
1608
+ children: P
1600
1609
  })
1601
1610
  }),
1602
1611
  /* @__PURE__ */ Y("div", {
1603
- ref: y,
1604
- onScroll: O,
1612
+ ref: b,
1613
+ onScroll: k,
1605
1614
  style: {
1606
1615
  flex: 1,
1607
1616
  overflowY: "auto",
@@ -1610,9 +1619,9 @@ function yt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1610
1619
  flexDirection: "column",
1611
1620
  gap: 8
1612
1621
  },
1613
- children: P
1622
+ children: I
1614
1623
  }),
1615
- /* @__PURE__ */ Y(ut, {
1624
+ /* @__PURE__ */ Y(dt, {
1616
1625
  config: e,
1617
1626
  parentEntity: t,
1618
1627
  parentId: n,
@@ -1625,59 +1634,59 @@ function yt({ config: e, parentEntity: t, parentId: n, schema: r }) {
1625
1634
  flexDirection: "column",
1626
1635
  gap: 8
1627
1636
  },
1628
- children: P
1629
- }), /* @__PURE__ */ Y(ut, {
1637
+ children: I
1638
+ }), /* @__PURE__ */ Y(dt, {
1630
1639
  config: e,
1631
1640
  parentEntity: t,
1632
1641
  parentId: n,
1633
1642
  schema: r
1634
1643
  })] });
1635
1644
  }
1636
- function bt({ row: t, rowId: r, childEntity: a, entityCode: s, parentEntity: c, parentId: l, timeline: u, editableFields: d, refs: p, isEditing: h, onStartEdit: _, onCancelEdit: v, onSaved: y, schema: b, optimistic: S = !1 }) {
1637
- let E = xe(), D = x(), [O, k] = q({}), A = U(() => {
1638
- E.invalidateQueries({ queryKey: [
1639
- o,
1645
+ function xt({ row: t, rowId: n, childEntity: i, entityCode: s, parentEntity: c, parentId: u, timeline: d, editableFields: p, refs: m, isEditing: h, onStartEdit: g, onCancelEdit: _, onSaved: b, schema: S, optimistic: w = !1 }) {
1646
+ let T = A(), E = A("errors"), D = Se(), [O, j] = q({}), M = W(() => {
1647
+ D.invalidateQueries({ queryKey: [
1648
+ r,
1640
1649
  c,
1641
- l,
1650
+ u,
1642
1651
  s
1643
1652
  ] });
1644
1653
  }, [
1645
- E,
1654
+ D,
1646
1655
  c,
1647
- l,
1656
+ u,
1648
1657
  s
1649
- ]), j = be({
1658
+ ]), N = xe({
1650
1659
  mutationFn: (e) => {
1651
- let n = t.$row_version, i = typeof n == "string" && n !== "" ? {
1660
+ let r = t.$row_version, i = typeof r == "string" && r !== "" ? {
1652
1661
  ...e,
1653
- $row_version: n
1662
+ $row_version: r
1654
1663
  } : e;
1655
- return w(s, r, i);
1664
+ return ne(s, n, i);
1656
1665
  },
1657
1666
  onSuccess: () => {
1658
- A(), C.success("Updated"), y();
1667
+ M(), y.success(T("record.timeline.updated", "Updated")), b();
1659
1668
  },
1660
- onError: (e) => C.error(e.message)
1661
- }), ee = be({
1662
- mutationFn: () => m(s, r),
1669
+ onError: (e) => y.error(U(E, e))
1670
+ }), P = xe({
1671
+ mutationFn: () => te(s, n),
1663
1672
  onSuccess: () => {
1664
- A(), C.success("Deleted");
1673
+ M(), y.success(T("record.timeline.deleted", "Deleted"));
1665
1674
  },
1666
- onError: (e) => C.error(e.message)
1667
- }), N = U(() => {
1675
+ onError: (e) => y.error(U(E, e))
1676
+ }), ee = W(() => {
1668
1677
  let e = {};
1669
- for (let n of d) e[n] = t[n] ?? "";
1670
- k(e), _();
1678
+ for (let n of p) e[n] = t[n] ?? "";
1679
+ j(e), g();
1671
1680
  }, [
1672
1681
  t,
1673
- d,
1674
- _
1675
- ]), F = U((e, t) => {
1676
- k((n) => ({
1682
+ p,
1683
+ g
1684
+ ]), F = W((e, t) => {
1685
+ j((n) => ({
1677
1686
  ...n,
1678
1687
  [e]: t
1679
1688
  }));
1680
- }, []), I = u?.time_field, L = u?.type_field, R = u?.summary_field, z = u?.content_field, B = u?.author_field, V = u?.direction_field, H = u?.intent_field;
1689
+ }, []), I = d?.time_field, L = d?.type_field, R = d?.summary_field, z = d?.content_field, B = d?.author_field, V = d?.direction_field, H = d?.intent_field;
1681
1690
  return h ? /* @__PURE__ */ X("div", {
1682
1691
  style: {
1683
1692
  borderRadius: 10,
@@ -1688,8 +1697,8 @@ function bt({ row: t, rowId: r, childEntity: a, entityCode: s, parentEntity: c,
1688
1697
  flexDirection: "column",
1689
1698
  gap: 8
1690
1699
  },
1691
- children: [d.map((e) => {
1692
- let t = a.fields.get(e);
1700
+ children: [p.map((e) => {
1701
+ let t = i.fields.get(e);
1693
1702
  return t ? /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("label", {
1694
1703
  style: {
1695
1704
  fontSize: 11,
@@ -1697,15 +1706,15 @@ function bt({ row: t, rowId: r, childEntity: a, entityCode: s, parentEntity: c,
1697
1706
  marginBottom: 4,
1698
1707
  display: "block"
1699
1708
  },
1700
- children: n(t, e, b.entities)
1701
- }), M({
1709
+ children: f(T, t, e, S.entities)
1710
+ }), C({
1702
1711
  field: t,
1703
1712
  fieldName: e,
1704
1713
  value: O[e] ?? "",
1705
1714
  mode: "edit",
1706
1715
  onChange: (t) => F(e, t),
1707
1716
  record: O,
1708
- locale: D
1717
+ t: T
1709
1718
  })] }, e) : null;
1710
1719
  }), /* @__PURE__ */ X("div", {
1711
1720
  style: {
@@ -1714,33 +1723,33 @@ function bt({ row: t, rowId: r, childEntity: a, entityCode: s, parentEntity: c,
1714
1723
  gap: 6,
1715
1724
  paddingTop: 4
1716
1725
  },
1717
- children: [/* @__PURE__ */ Y(g, {
1726
+ children: [/* @__PURE__ */ Y(l, {
1718
1727
  kind: "primary",
1719
1728
  size: "xs",
1720
- icon: j.isPending ? /* @__PURE__ */ Y(f, { size: 12 }) : /* @__PURE__ */ Y(e.check, { size: 12 }),
1721
- onClick: () => j.mutate(O),
1722
- disabled: j.isPending,
1723
- children: j.isPending ? "Saving…" : "Save"
1724
- }), /* @__PURE__ */ Y(g, {
1729
+ icon: N.isPending ? /* @__PURE__ */ Y(x, { size: 12 }) : /* @__PURE__ */ Y(e.check, { size: 12 }),
1730
+ onClick: () => N.mutate(O),
1731
+ disabled: N.isPending,
1732
+ children: N.isPending ? T("dialog.saving", "Saving…") : T("dialog.save", "Save")
1733
+ }), /* @__PURE__ */ Y(l, {
1725
1734
  size: "xs",
1726
1735
  icon: /* @__PURE__ */ Y(e.x, { size: 12 }),
1727
1736
  onClick: () => {
1728
- k({}), v();
1737
+ j({}), _();
1729
1738
  },
1730
- disabled: j.isPending,
1731
- children: "Cancel"
1739
+ disabled: N.isPending,
1740
+ children: T("dialog.cancel", "Cancel")
1732
1741
  })]
1733
1742
  })]
1734
1743
  }) : /* @__PURE__ */ X("div", {
1735
1744
  className: "group",
1736
- "data-optimistic": S || void 0,
1745
+ "data-optimistic": w || void 0,
1737
1746
  style: {
1738
1747
  borderRadius: 10,
1739
1748
  border: "1px solid var(--border)",
1740
1749
  background: "var(--surface)",
1741
1750
  padding: 12,
1742
1751
  transition: "border-color .12s",
1743
- opacity: S ? .6 : 1
1752
+ opacity: w ? .6 : 1
1744
1753
  },
1745
1754
  onMouseEnter: (e) => e.currentTarget.style.borderColor = "var(--border-strong)",
1746
1755
  onMouseLeave: (e) => e.currentTarget.style.borderColor = "var(--border)",
@@ -1755,135 +1764,131 @@ function bt({ row: t, rowId: r, childEntity: a, entityCode: s, parentEntity: c,
1755
1764
  color: "var(--text-3)"
1756
1765
  },
1757
1766
  children: [
1758
- I && t[I] != null && a.fields.get(I) && /* @__PURE__ */ Y("span", {
1767
+ I && t[I] != null && i.fields.get(I) && /* @__PURE__ */ Y("span", {
1759
1768
  style: { fontWeight: 500 },
1760
- children: M({
1761
- field: a.fields.get(I),
1769
+ children: C({
1770
+ field: i.fields.get(I),
1762
1771
  fieldName: I,
1763
1772
  value: t[I],
1764
1773
  mode: "display",
1765
1774
  record: t,
1766
- refs: p,
1767
- locale: D
1775
+ refs: m,
1776
+ t: T
1768
1777
  })
1769
1778
  }),
1770
- L && t[L] != null && a.fields.get(L) && /* @__PURE__ */ Y(P, {
1779
+ L && t[L] != null && i.fields.get(L) && /* @__PURE__ */ Y(a, {
1771
1780
  tone: "slate",
1772
1781
  size: "xs",
1773
- children: M({
1774
- field: a.fields.get(L),
1782
+ children: C({
1783
+ field: i.fields.get(L),
1775
1784
  fieldName: L,
1776
1785
  value: t[L],
1777
1786
  mode: "display",
1778
1787
  record: t,
1779
- refs: p,
1780
- locale: D
1788
+ refs: m,
1789
+ t: T
1781
1790
  })
1782
1791
  }),
1783
- V && t[V] != null && a.fields.get(V) && /* @__PURE__ */ Y(Tt, {
1792
+ V && t[V] != null && i.fields.get(V) && /* @__PURE__ */ Y(Et, {
1784
1793
  value: t[V],
1785
- field: a.fields.get(V)
1794
+ field: i.fields.get(V)
1786
1795
  }),
1787
- H && t[H] != null && a.fields.get(H) && /* @__PURE__ */ Y(P, {
1796
+ H && t[H] != null && i.fields.get(H) && /* @__PURE__ */ Y(a, {
1788
1797
  tone: "slate",
1789
1798
  size: "xs",
1790
- children: M({
1791
- field: a.fields.get(H),
1799
+ children: C({
1800
+ field: i.fields.get(H),
1792
1801
  fieldName: H,
1793
1802
  value: t[H],
1794
1803
  mode: "display",
1795
1804
  record: t,
1796
- refs: p,
1797
- locale: D
1805
+ refs: m,
1806
+ t: T
1798
1807
  })
1799
1808
  }),
1800
- B && t[B] != null && a.fields.get(B) && /* @__PURE__ */ X("span", { children: [
1801
- "by",
1802
- " ",
1803
- M({
1804
- field: a.fields.get(B),
1805
- fieldName: B,
1806
- value: t[B],
1807
- mode: "display",
1808
- record: t,
1809
- refs: p,
1810
- locale: D
1811
- })
1812
- ] }),
1813
- !S && /* @__PURE__ */ X("div", {
1809
+ B && t[B] != null && i.fields.get(B) && /* @__PURE__ */ Y("span", { children: k(T("record.timeline.by_author", "by {author}"), { author: C({
1810
+ field: i.fields.get(B),
1811
+ fieldName: B,
1812
+ value: t[B],
1813
+ mode: "display",
1814
+ record: t,
1815
+ refs: m,
1816
+ t: T
1817
+ }) }) }),
1818
+ !w && /* @__PURE__ */ X("div", {
1814
1819
  style: {
1815
1820
  marginLeft: "auto",
1816
1821
  display: "flex",
1817
1822
  alignItems: "center",
1818
1823
  gap: 2
1819
1824
  },
1820
- children: [/* @__PURE__ */ Y(i, {
1825
+ children: [/* @__PURE__ */ Y(o, {
1821
1826
  size: 22,
1822
1827
  icon: /* @__PURE__ */ Y(e.edit, { size: 11 }),
1823
- onClick: N,
1824
- title: "Edit"
1825
- }), /* @__PURE__ */ Y(i, {
1828
+ onClick: ee,
1829
+ title: T("record.action.edit", "Edit")
1830
+ }), /* @__PURE__ */ Y(o, {
1826
1831
  size: 22,
1827
1832
  icon: /* @__PURE__ */ Y(e.trash, { size: 11 }),
1828
- onClick: () => ee.mutate(),
1829
- title: "Delete"
1833
+ onClick: () => P.mutate(),
1834
+ title: T("record.action.delete", "Delete")
1830
1835
  })]
1831
1836
  })
1832
1837
  ]
1833
1838
  }),
1834
- R && t[R] != null && a.fields.get(R) && /* @__PURE__ */ Y("div", {
1839
+ R && t[R] != null && i.fields.get(R) && /* @__PURE__ */ Y("div", {
1835
1840
  style: {
1836
1841
  fontSize: 12.5,
1837
1842
  fontWeight: 500,
1838
1843
  marginTop: 6
1839
1844
  },
1840
- children: M({
1841
- field: a.fields.get(R),
1845
+ children: C({
1846
+ field: i.fields.get(R),
1842
1847
  fieldName: R,
1843
1848
  value: t[R],
1844
1849
  mode: "display",
1845
1850
  record: t,
1846
- refs: p,
1847
- locale: D
1851
+ refs: m,
1852
+ t: T
1848
1853
  })
1849
1854
  }),
1850
- z && t[z] != null && z !== R && a.fields.get(z) && /* @__PURE__ */ Y(xt, {
1851
- rendered: M({
1852
- field: a.fields.get(z),
1855
+ z && t[z] != null && z !== R && i.fields.get(z) && /* @__PURE__ */ Y(St, {
1856
+ rendered: C({
1857
+ field: i.fields.get(z),
1853
1858
  fieldName: z,
1854
1859
  value: t[z],
1855
1860
  mode: "display",
1856
1861
  record: t,
1857
- refs: p,
1858
- locale: D
1862
+ refs: m,
1863
+ t: T
1859
1864
  }),
1860
- text: T(t[z])
1865
+ text: v(t[z])
1861
1866
  })
1862
1867
  ]
1863
1868
  });
1864
1869
  }
1865
- function xt({ rendered: e, text: t }) {
1866
- let n = {
1870
+ function St({ rendered: e, text: t }) {
1871
+ let n = A(), r = {
1867
1872
  fontSize: 12.5,
1868
1873
  fontWeight: 400,
1869
1874
  marginTop: 6
1870
1875
  };
1871
- if (!gt(t)) return /* @__PURE__ */ Y("div", {
1872
- style: n,
1876
+ if (!_t(t)) return /* @__PURE__ */ Y("div", {
1877
+ style: r,
1873
1878
  children: e
1874
1879
  });
1875
- let r = t.length > mt, i = r ? t.slice(0, mt) : t;
1880
+ let i = t.length > ht, a = i ? t.slice(0, ht) : t;
1876
1881
  return /* @__PURE__ */ Y("div", {
1877
1882
  style: {
1878
- ...n,
1883
+ ...r,
1879
1884
  display: "-webkit-box",
1880
1885
  WebkitBoxOrient: "vertical",
1881
- WebkitLineClamp: pt,
1886
+ WebkitLineClamp: mt,
1882
1887
  overflow: "hidden",
1883
1888
  whiteSpace: "pre-wrap",
1884
1889
  overflowWrap: "anywhere"
1885
1890
  },
1886
- children: /* @__PURE__ */ Y(l, {
1891
+ children: /* @__PURE__ */ Y(s, {
1887
1892
  width: 380,
1888
1893
  content: /* @__PURE__ */ X("div", {
1889
1894
  style: {
@@ -1891,38 +1896,38 @@ function xt({ rendered: e, text: t }) {
1891
1896
  whiteSpace: "pre-wrap",
1892
1897
  overflowWrap: "anywhere"
1893
1898
  },
1894
- children: [i, r && /* @__PURE__ */ Y("div", {
1899
+ children: [a, i && /* @__PURE__ */ Y("div", {
1895
1900
  style: {
1896
1901
  marginTop: 8,
1897
1902
  fontSize: 11,
1898
1903
  color: "var(--text-3)"
1899
1904
  },
1900
- children: "Truncated for display - open the record for the full text."
1905
+ children: n("record.timeline.truncated", "Truncated for display - open the record for the full text.")
1901
1906
  })]
1902
1907
  }),
1903
1908
  children: e
1904
1909
  })
1905
1910
  });
1906
1911
  }
1907
- function St(e) {
1912
+ function Ct(e) {
1908
1913
  if (e == null) return "";
1909
- let t = new Date(T(e));
1914
+ let t = new Date(v(e));
1910
1915
  return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`;
1911
1916
  }
1912
- function Ct(e) {
1913
- if (e == null) return "—";
1914
- let t = new Date(T(e));
1915
- if (Number.isNaN(t.getTime())) return "—";
1916
- let n = /* @__PURE__ */ new Date(), r = /* @__PURE__ */ new Date();
1917
- r.setDate(n.getDate() - 1);
1918
- let i = (e, t) => e.toDateString() === t.toDateString();
1919
- return i(t, n) ? "Today" : i(t, r) ? "Yesterday" : t.toLocaleDateString(void 0, {
1917
+ function wt(e, t) {
1918
+ if (t == null) return "—";
1919
+ let n = new Date(v(t));
1920
+ if (Number.isNaN(n.getTime())) return "—";
1921
+ let r = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
1922
+ i.setDate(r.getDate() - 1);
1923
+ let a = (e, t) => e.toDateString() === t.toDateString();
1924
+ return a(n, r) ? e("record.timeline.today", "Today") : a(n, i) ? e("record.timeline.yesterday", "Yesterday") : n.toLocaleDateString(e.language, {
1920
1925
  weekday: "short",
1921
1926
  month: "short",
1922
1927
  day: "numeric"
1923
1928
  });
1924
1929
  }
1925
- function wt({ label: e, count: t }) {
1930
+ function Tt({ label: e, count: t }) {
1926
1931
  return /* @__PURE__ */ X("div", {
1927
1932
  style: {
1928
1933
  position: "sticky",
@@ -1959,9 +1964,9 @@ function wt({ label: e, count: t }) {
1959
1964
  ]
1960
1965
  });
1961
1966
  }
1962
- function Tt({ value: t, field: n }) {
1963
- let r = Et(t, n);
1964
- return r === null ? null : /* @__PURE__ */ X("span", {
1967
+ function Et({ value: t, field: n }) {
1968
+ let r = A(), i = Dt(t, n);
1969
+ return i === null ? null : /* @__PURE__ */ X("span", {
1965
1970
  style: {
1966
1971
  display: "inline-flex",
1967
1972
  alignItems: "center",
@@ -1970,13 +1975,13 @@ function Tt({ value: t, field: n }) {
1970
1975
  borderRadius: 999,
1971
1976
  fontSize: 10.5,
1972
1977
  fontWeight: 600,
1973
- background: r ? "var(--accent-soft)" : "var(--info-soft)",
1974
- color: r ? "var(--accent)" : "var(--info)"
1978
+ background: i ? "var(--accent-soft)" : "var(--info-soft)",
1979
+ color: i ? "var(--accent)" : "var(--info)"
1975
1980
  },
1976
- children: [Y(r ? e.arrowUp : e.arrowDown, { size: 10 }), r ? "Out" : "In"]
1981
+ children: [Y(i ? e.arrowUp : e.arrowDown, { size: 10 }), i ? r("record.timeline.outbound", "Out") : r("record.timeline.inbound", "In")]
1977
1982
  });
1978
1983
  }
1979
- function Et(e, t) {
1984
+ function Dt(e, t) {
1980
1985
  if (t.type === "bool") return e === !0;
1981
1986
  if (typeof e == "string") {
1982
1987
  let t = e.toLowerCase();
@@ -1987,71 +1992,71 @@ function Et(e, t) {
1987
1992
  }
1988
1993
  //#endregion
1989
1994
  //#region src/components/detail-layout/EditableChildrenTable.tsx
1990
- function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, validationErrors: c, refs: l, forceTablePresentation: d = !1 }) {
1991
- let f = x(), p = u(), m = K(null), h = t.columns, _ = t.position_field, v = new Set(Array.isArray(t.foreign_key) ? t.foreign_key : [t.foreign_key]), y = h.filter((e) => {
1992
- if (v.has(e) || t.position_field && e === t.position_field) return !1;
1993
- let n = r.fields.get(e);
1994
- return !(!n || n.auto || n.primary || n.source);
1995
+ function Ot({ config: t, childEntity: n, schema: r, rows: i, onChange: a, validationErrors: s, refs: c, forceTablePresentation: u = !1 }) {
1996
+ let d = A(), p = S(), m = K(null), h = t.columns, g = t.position_field, _ = new Set(Array.isArray(t.foreign_key) ? t.foreign_key : [t.foreign_key]), y = h.filter((e) => {
1997
+ if (_.has(e) || t.position_field && e === t.position_field) return !1;
1998
+ let r = n.fields.get(e);
1999
+ return !(!r || r.auto || r.primary || r.source);
1995
2000
  }), b = new Set(h.filter((e) => {
1996
2001
  if (t.position_field && e === t.position_field) return !0;
1997
- let n = r.fields.get(e);
1998
- return n && (n.auto || n.primary || n.source);
1999
- })), S = U((e, t, n) => {
2000
- s(o.map((r) => r._key === e ? {
2002
+ let r = n.fields.get(e);
2003
+ return r && (r.auto || r.primary || r.source);
2004
+ })), x = W((e, t, n) => {
2005
+ a(i.map((r) => r._key === e ? {
2001
2006
  ...r,
2002
2007
  [t]: n,
2003
2008
  _dirty: !0
2004
2009
  } : r));
2005
- }, [o, s]), C = U(() => {
2010
+ }, [i, a]), w = W(() => {
2006
2011
  let e = {
2007
2012
  _key: crypto.randomUUID(),
2008
2013
  _dirty: !0
2009
2014
  };
2010
- if (_) {
2011
- let t = o.filter((e) => !e._deleted).reduce((e, t) => {
2012
- let n = typeof t[_] == "number" ? t[_] : -1;
2015
+ if (g) {
2016
+ let t = i.filter((e) => !e._deleted).reduce((e, t) => {
2017
+ let n = typeof t[g] == "number" ? t[g] : -1;
2013
2018
  return Math.max(e, n);
2014
2019
  }, -1);
2015
- e[_] = t + 1;
2020
+ e[g] = t + 1;
2016
2021
  }
2017
- let n = t.quick_add?.defaults ?? {};
2022
+ let r = t.quick_add?.defaults ?? {};
2018
2023
  for (let t of y) {
2019
- let i = r.fields.get(t);
2020
- i && (n[t] === void 0 ? i.default === void 0 ? i.type === "bool" && (e[t] = !1) : e[t] = i.default : e[t] = n[t]);
2024
+ let i = n.fields.get(t);
2025
+ i && (r[t] === void 0 ? i.default === void 0 ? i.type === "bool" && (e[t] = !1) : e[t] = i.default : e[t] = r[t]);
2021
2026
  }
2022
- s([...o, e]);
2027
+ a([...i, e]);
2023
2028
  }, [
2024
- o,
2025
- s,
2029
+ i,
2030
+ a,
2026
2031
  y,
2027
- r,
2032
+ n,
2028
2033
  t.quick_add?.defaults,
2029
- _
2030
- ]), w = U((e) => {
2031
- s(o.map((t) => t._key === e ? {
2034
+ g
2035
+ ]), T = W((e) => {
2036
+ a(i.map((t) => t._key === e ? {
2032
2037
  ...t,
2033
2038
  _deleted: !0
2034
2039
  } : t));
2035
- }, [o, s]), E = U((e) => {
2036
- s(o.map((t) => t._key === e ? {
2040
+ }, [i, a]), E = W((e) => {
2041
+ a(i.map((t) => t._key === e ? {
2037
2042
  ...t,
2038
2043
  _deleted: !1
2039
2044
  } : t));
2040
- }, [o, s]), D = U((e, t) => {
2041
- if (!_) return;
2042
- let n = o.filter((e) => !e._deleted), r = o.filter((e) => e._deleted), i = n.findIndex((t) => t._key === e), a = i + t;
2043
- if (i < 0 || a < 0 || a >= n.length) return;
2044
- let c = [...n], [l] = c.splice(i, 1);
2045
- c.splice(a, 0, l), s([...c.map((e, t) => ({
2045
+ }, [i, a]), D = W((e, t) => {
2046
+ if (!g) return;
2047
+ let n = i.filter((e) => !e._deleted), r = i.filter((e) => e._deleted), o = n.findIndex((t) => t._key === e), s = o + t;
2048
+ if (o < 0 || s < 0 || s >= n.length) return;
2049
+ let c = [...n], [l] = c.splice(o, 1);
2050
+ c.splice(s, 0, l), a([...c.map((e, t) => ({
2046
2051
  ...e,
2047
- [_]: t,
2048
- _dirty: e[_] !== t || e._dirty
2052
+ [g]: t,
2053
+ _dirty: e[g] !== t || e._dirty
2049
2054
  })), ...r]);
2050
2055
  }, [
2051
- o,
2052
- s,
2053
- _
2054
- ]), O = U((e) => {
2056
+ i,
2057
+ a,
2058
+ g
2059
+ ]), O = W((e) => {
2055
2060
  let t = e.target, n = t.closest("td");
2056
2061
  if (!n) return;
2057
2062
  let r = n.closest("tr");
@@ -2075,7 +2080,7 @@ function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, valida
2075
2080
  if (o < t.length - 1) {
2076
2081
  let e = t[o + 1].cells[a]?.querySelector("input, select, textarea, [tabindex]");
2077
2082
  e && e.focus();
2078
- } else C(), requestAnimationFrame(() => {
2083
+ } else w(), requestAnimationFrame(() => {
2079
2084
  let e = i.querySelectorAll("tr"), t = e[e.length - 1];
2080
2085
  if (t) {
2081
2086
  let e = t.querySelector("input, select, textarea, [tabindex]");
@@ -2083,21 +2088,21 @@ function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, valida
2083
2088
  }
2084
2089
  });
2085
2090
  } else e.key === "Escape" && t.blur?.();
2086
- }, [C]), k = ue;
2087
- return p.isPhone && !d ? /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("div", {
2091
+ }, [w]), k = fe;
2092
+ return p.isPhone && !u ? /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("div", {
2088
2093
  style: {
2089
2094
  display: "flex",
2090
2095
  flexDirection: "column",
2091
2096
  gap: 10
2092
2097
  },
2093
- children: o.map((t, s) => {
2094
- let u = !!t._deleted, d = c?.[t._key], p = _ ? o.filter((e) => !e._deleted) : [], m = _ ? p.findIndex((e) => e._key === t._key) : -1;
2098
+ children: i.map((t, a) => {
2099
+ let l = !!t._deleted, u = s?.[t._key], p = g ? i.filter((e) => !e._deleted) : [], m = g ? p.findIndex((e) => e._key === t._key) : -1;
2095
2100
  return /* @__PURE__ */ X("div", {
2096
2101
  style: {
2097
2102
  border: "1px solid var(--border)",
2098
2103
  borderRadius: 8,
2099
2104
  background: "var(--surface)",
2100
- opacity: u ? .58 : 1,
2105
+ opacity: l ? .58 : 1,
2101
2106
  overflow: "hidden"
2102
2107
  },
2103
2108
  children: [/* @__PURE__ */ X("div", {
@@ -2110,41 +2115,41 @@ function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, valida
2110
2115
  justifyContent: "space-between",
2111
2116
  gap: 8
2112
2117
  },
2113
- children: [/* @__PURE__ */ X("div", {
2118
+ children: [/* @__PURE__ */ Y("div", {
2114
2119
  style: {
2115
2120
  fontSize: 12,
2116
2121
  fontWeight: 600,
2117
2122
  color: "var(--text-2)"
2118
2123
  },
2119
- children: ["Row ", s + 1]
2124
+ children: d("record.row.number", "Row {number}", { number: a + 1 })
2120
2125
  }), /* @__PURE__ */ X("div", {
2121
2126
  style: {
2122
2127
  display: "flex",
2123
2128
  alignItems: "center",
2124
2129
  gap: 4
2125
2130
  },
2126
- children: [_ && !u && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(i, {
2131
+ children: [g && !l && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(o, {
2127
2132
  size: 32,
2128
2133
  icon: /* @__PURE__ */ Y(e.up, { size: 14 }),
2129
2134
  onClick: () => D(t._key, -1),
2130
2135
  disabled: m <= 0,
2131
- title: "Move row up"
2132
- }), /* @__PURE__ */ Y(i, {
2136
+ title: d("record.row.move_up", "Move row up")
2137
+ }), /* @__PURE__ */ Y(o, {
2133
2138
  size: 32,
2134
2139
  icon: /* @__PURE__ */ Y(e.down, { size: 14 }),
2135
2140
  onClick: () => D(t._key, 1),
2136
2141
  disabled: m === -1 || m >= p.length - 1,
2137
- title: "Move row down"
2138
- })] }), u ? /* @__PURE__ */ Y(i, {
2142
+ title: d("record.row.move_down", "Move row down")
2143
+ })] }), l ? /* @__PURE__ */ Y(o, {
2139
2144
  size: 32,
2140
2145
  icon: /* @__PURE__ */ Y(e.refresh, { size: 14 }),
2141
2146
  onClick: () => E(t._key),
2142
- title: "Undo delete"
2143
- }) : /* @__PURE__ */ Y(i, {
2147
+ title: d("record.row.undo_delete", "Undo delete")
2148
+ }) : /* @__PURE__ */ Y(o, {
2144
2149
  size: 32,
2145
2150
  icon: /* @__PURE__ */ Y(e.trash, { size: 14 }),
2146
- onClick: () => w(t._key),
2147
- title: "Delete row"
2151
+ onClick: () => T(t._key),
2152
+ title: d("record.row.delete", "Delete row")
2148
2153
  })]
2149
2154
  })]
2150
2155
  }), /* @__PURE__ */ Y("div", {
@@ -2155,58 +2160,58 @@ function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, valida
2155
2160
  gap: 12
2156
2161
  },
2157
2162
  children: h.map((e) => {
2158
- let i = r.fields.get(e), o = d?.includes(e), s = b.has(e), c = i ? n(i, e, a.entities) : e, p = `child-${t._key}-${e}`, m = `${p}-label`, h = {
2159
- outline: o ? "1px solid var(--danger)" : "none",
2163
+ let i = n.fields.get(e), a = u?.includes(e), o = b.has(e), s = i ? f(d, i, e, r.entities) : e, p = `child-${t._key}-${e}`, m = `${p}-label`, h = {
2164
+ outline: a ? "1px solid var(--danger)" : "none",
2160
2165
  outlineOffset: 3,
2161
- borderRadius: o ? 5 : 0
2166
+ borderRadius: a ? 5 : 0
2162
2167
  }, g = {
2163
2168
  fontSize: 11.5,
2164
2169
  fontWeight: 600,
2165
2170
  color: "var(--text-3)"
2166
- }, _ = !u && !s && !!i;
2171
+ }, _ = !l && !o && !!i;
2167
2172
  return /* @__PURE__ */ X("div", {
2168
2173
  style: {
2169
2174
  display: "flex",
2170
2175
  flexDirection: "column",
2171
2176
  gap: 5,
2172
2177
  minWidth: 0,
2173
- textDecoration: u ? "line-through" : "none"
2178
+ textDecoration: l ? "line-through" : "none"
2174
2179
  },
2175
- title: o ? `${e} is required` : void 0,
2180
+ title: a ? d("record.row.field_required", "{field} is required", { field: e }) : void 0,
2176
2181
  children: [_ ? /* @__PURE__ */ Y("label", {
2177
2182
  id: m,
2178
2183
  htmlFor: p,
2179
2184
  style: g,
2180
- children: c
2185
+ children: s
2181
2186
  }) : /* @__PURE__ */ Y("div", {
2182
2187
  id: m,
2183
2188
  style: g,
2184
- children: c
2189
+ children: s
2185
2190
  }), /* @__PURE__ */ Y("div", {
2186
2191
  style: h,
2187
- children: u || s ? i ? M({
2192
+ children: l || o ? i ? C({
2188
2193
  field: i,
2189
2194
  fieldName: e,
2190
2195
  value: t[e],
2191
2196
  mode: "display",
2192
2197
  record: t,
2193
- refs: l,
2198
+ refs: c,
2194
2199
  fieldId: p,
2195
2200
  labelId: m,
2196
- locale: f
2197
- }) : T(t[e]) : i ? M({
2201
+ t: d
2202
+ }) : v(t[e]) : i ? C({
2198
2203
  field: i,
2199
2204
  fieldName: e,
2200
2205
  value: t[e],
2201
2206
  mode: "edit",
2202
- onChange: (n) => S(t._key, e, n),
2207
+ onChange: (n) => x(t._key, e, n),
2203
2208
  record: t,
2204
- refs: l,
2209
+ refs: c,
2205
2210
  compact: !0,
2206
2211
  fieldId: p,
2207
2212
  labelId: m,
2208
- locale: f
2209
- }) : T(t[e])
2213
+ t: d
2214
+ }) : v(t[e])
2210
2215
  })]
2211
2216
  }, e);
2212
2217
  })
@@ -2215,51 +2220,51 @@ function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, valida
2215
2220
  })
2216
2221
  }), /* @__PURE__ */ Y("div", {
2217
2222
  style: { marginTop: 10 },
2218
- children: /* @__PURE__ */ Y(g, {
2223
+ children: /* @__PURE__ */ Y(l, {
2219
2224
  kind: "ghost",
2220
2225
  size: "sm",
2221
2226
  icon: /* @__PURE__ */ Y(e.plus, { size: 14 }),
2222
- onClick: C,
2223
- children: "Add row"
2227
+ onClick: w,
2228
+ children: d("record.row.add", "Add row")
2224
2229
  })
2225
2230
  })] }) : /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("div", {
2226
2231
  style: { overflowX: "auto" },
2227
2232
  children: /* @__PURE__ */ X("table", {
2228
2233
  ref: m,
2229
- style: de,
2234
+ style: pe,
2230
2235
  onKeyDown: O,
2231
2236
  children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ X("tr", { children: [h.map((e) => {
2232
- let t = r.fields.get(e);
2237
+ let t = n.fields.get(e);
2233
2238
  return /* @__PURE__ */ Y("th", {
2234
2239
  style: k,
2235
- children: t ? n(t, e, a.entities) : e
2240
+ children: t ? f(d, t, e, r.entities) : e
2236
2241
  }, e);
2237
2242
  }), /* @__PURE__ */ Y("th", { style: {
2238
2243
  ...k,
2239
2244
  width: 40
2240
- } })] }) }), /* @__PURE__ */ Y("tbody", { children: o.map((t) => {
2241
- let n = !!t._deleted, a = c?.[t._key];
2245
+ } })] }) }), /* @__PURE__ */ Y("tbody", { children: i.map((t) => {
2246
+ let r = !!t._deleted, i = s?.[t._key];
2242
2247
  return /* @__PURE__ */ X("tr", {
2243
- style: { opacity: n ? .5 : 1 },
2248
+ style: { opacity: r ? .5 : 1 },
2244
2249
  children: [h.map((e) => {
2245
- let i = r.fields.get(e), o = a?.includes(e), s = b.has(e);
2246
- return n || s ? /* @__PURE__ */ Y("td", {
2250
+ let a = n.fields.get(e), o = i?.includes(e), s = b.has(e);
2251
+ return r || s ? /* @__PURE__ */ Y("td", {
2247
2252
  style: {
2248
2253
  padding: "6px 12px",
2249
2254
  borderBottom: "1px solid var(--divider)",
2250
2255
  verticalAlign: "middle",
2251
- textDecoration: n ? "line-through" : "none",
2256
+ textDecoration: r ? "line-through" : "none",
2252
2257
  color: "var(--text-2)"
2253
2258
  },
2254
- children: i ? M({
2255
- field: i,
2259
+ children: a ? C({
2260
+ field: a,
2256
2261
  fieldName: e,
2257
2262
  value: t[e],
2258
2263
  mode: "display",
2259
2264
  record: t,
2260
- refs: l,
2261
- locale: f
2262
- }) : T(t[e])
2265
+ refs: c,
2266
+ t: d
2267
+ }) : v(t[e])
2263
2268
  }, e) : /* @__PURE__ */ Y("td", {
2264
2269
  style: {
2265
2270
  padding: "4px 4px",
@@ -2269,18 +2274,18 @@ function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, valida
2269
2274
  outlineOffset: -1,
2270
2275
  borderRadius: o ? 4 : 0
2271
2276
  },
2272
- title: o ? `${e} is required` : void 0,
2273
- children: i ? M({
2274
- field: i,
2277
+ title: o ? d("record.row.field_required", "{field} is required", { field: e }) : void 0,
2278
+ children: a ? C({
2279
+ field: a,
2275
2280
  fieldName: e,
2276
2281
  value: t[e],
2277
2282
  mode: "edit",
2278
- onChange: (n) => S(t._key, e, n),
2283
+ onChange: (n) => x(t._key, e, n),
2279
2284
  record: t,
2280
- refs: l,
2285
+ refs: c,
2281
2286
  compact: !0,
2282
- locale: f
2283
- }) : T(t[e])
2287
+ t: d
2288
+ }) : v(t[e])
2284
2289
  }, e);
2285
2290
  }), /* @__PURE__ */ Y("td", {
2286
2291
  style: {
@@ -2288,16 +2293,16 @@ function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, valida
2288
2293
  borderBottom: "1px solid var(--divider)",
2289
2294
  verticalAlign: "middle"
2290
2295
  },
2291
- children: n ? /* @__PURE__ */ Y(i, {
2296
+ children: r ? /* @__PURE__ */ Y(o, {
2292
2297
  size: 24,
2293
2298
  icon: /* @__PURE__ */ Y(e.refresh, { size: 12 }),
2294
2299
  onClick: () => E(t._key),
2295
- title: "Undo delete"
2296
- }) : /* @__PURE__ */ Y(i, {
2300
+ title: d("record.row.undo_delete", "Undo delete")
2301
+ }) : /* @__PURE__ */ Y(o, {
2297
2302
  size: 24,
2298
2303
  icon: /* @__PURE__ */ Y(e.trash, { size: 12 }),
2299
- onClick: () => w(t._key),
2300
- title: "Delete row"
2304
+ onClick: () => T(t._key),
2305
+ title: d("record.row.delete", "Delete row")
2301
2306
  })
2302
2307
  })]
2303
2308
  }, t._key);
@@ -2305,285 +2310,148 @@ function Dt({ config: t, childEntity: r, schema: a, rows: o, onChange: s, valida
2305
2310
  })
2306
2311
  }), /* @__PURE__ */ Y("div", {
2307
2312
  style: { marginTop: 8 },
2308
- children: /* @__PURE__ */ Y(g, {
2313
+ children: /* @__PURE__ */ Y(l, {
2309
2314
  kind: "ghost",
2310
2315
  size: "xs",
2311
2316
  icon: /* @__PURE__ */ Y(e.plus, { size: 12 }),
2312
- onClick: C,
2313
- children: "Add row"
2317
+ onClick: w,
2318
+ children: d("record.row.add", "Add row")
2314
2319
  })
2315
2320
  })] });
2316
2321
  }
2317
2322
  //#endregion
2318
2323
  //#region src/components/detail-layout/ChildrenBlock.tsx
2319
- var Ot = he(() => import("./DraggableChildrenTable-BV5sb8Uo.js").then((e) => ({ default: e.DraggableChildrenTable })));
2320
- function kt({ node: e, ctx: n }) {
2321
- let r = u(), i = e.children;
2322
- if (!i) return null;
2323
- let a = r.isPhone && n.relatedRecordsPresentation === "table";
2324
+ var kt = ge(() => import("./DraggableChildrenTable-4RZC351U.js").then((e) => ({ default: e.DraggableChildrenTable })));
2325
+ function At({ node: e, ctx: n }) {
2326
+ let r = A(), i = A("errors"), a = S(), o = e.children;
2327
+ if (!o) return null;
2328
+ let s = a.isPhone && n.relatedRecordsPresentation === "table";
2324
2329
  if (n.isNew && n.mode !== "edit") return null;
2325
- let o = Ge(n.entity, i);
2326
- if (!o) return /* @__PURE__ */ X("div", {
2330
+ let c = Ke(n.entity, o);
2331
+ if (!c) return /* @__PURE__ */ X("div", {
2327
2332
  className: "text-sm text-muted-foreground py-2",
2328
- children: ["Unknown child relation: ", i]
2333
+ children: [
2334
+ i("record.child_relation_unknown", "This record type has no child relation by that name."),
2335
+ " ",
2336
+ /* @__PURE__ */ Y("code", { children: o })
2337
+ ]
2329
2338
  });
2330
- let s = n.schema.entities[o.entity];
2331
- if (!s) return /* @__PURE__ */ X("div", {
2339
+ let l = n.schema.entities[c.entity];
2340
+ if (!l) return /* @__PURE__ */ X("div", {
2332
2341
  className: "text-sm text-muted-foreground py-2",
2333
- children: ["Entity not found: ", o.entity]
2342
+ children: [
2343
+ i("record.related_entity_not_found", "The related record type is not declared in this deployment."),
2344
+ " ",
2345
+ /* @__PURE__ */ Y("code", { children: c.entity })
2346
+ ]
2334
2347
  });
2335
- let c = Ne(o, s, e), l = ke(e, n), d = Ae(e, n), f = (e) => c.mode === "timeline" || n.withinCard ? e : /* @__PURE__ */ Y(L, {
2336
- title: l,
2337
- icon: d ? /* @__PURE__ */ Y(t, {
2338
- name: d,
2348
+ let u = Pe(c, l, e), d = Ae(e, n, r), f = je(e, n), p = (e) => u.mode === "timeline" || n.withinCard ? e : /* @__PURE__ */ Y(P, {
2349
+ title: d,
2350
+ icon: f ? /* @__PURE__ */ Y(t, {
2351
+ name: f,
2339
2352
  size: 14
2340
2353
  }) : void 0,
2341
2354
  children: e
2342
2355
  });
2343
- if (n.mode === "edit" && c.editable && c.interaction !== "navigate" && c.interaction !== "readonly" && _(s, "update") && c.mode === "table" && n.pendingChildren !== void 0 && n.onChildrenChange) {
2344
- let e = n.pendingChildren[i] ?? [], t = n.childValidationErrors?.[i], o = c.position_field ? r.isPhone && !a ? Dt : Ot : Dt;
2345
- return f(/* @__PURE__ */ Y(pe, {
2346
- fallback: /* @__PURE__ */ Y(le, {}),
2347
- children: /* @__PURE__ */ Y(o, {
2348
- config: c,
2349
- childEntity: s,
2356
+ if (n.mode === "edit" && u.editable && u.interaction !== "navigate" && u.interaction !== "readonly" && g(l, "update") && u.mode === "table" && n.pendingChildren !== void 0 && n.onChildrenChange) {
2357
+ let e = n.pendingChildren[o] ?? [], t = n.childValidationErrors?.[o], r = u.position_field ? a.isPhone && !s ? Ot : kt : Ot;
2358
+ return p(/* @__PURE__ */ Y(he, {
2359
+ fallback: /* @__PURE__ */ Y(oe, {}),
2360
+ children: /* @__PURE__ */ Y(r, {
2361
+ config: u,
2362
+ childEntity: l,
2350
2363
  schema: n.schema,
2351
2364
  rows: e,
2352
- onChange: (e) => n.onChildrenChange(i, e),
2365
+ onChange: (e) => n.onChildrenChange(o, e),
2353
2366
  validationErrors: t,
2354
2367
  refs: n.refs,
2355
- forceTablePresentation: a
2368
+ forceTablePresentation: s
2356
2369
  })
2357
2370
  }));
2358
2371
  }
2359
2372
  if (n.isNew) return null;
2360
- let p = {
2361
- config: c,
2373
+ let m = {
2374
+ config: u,
2362
2375
  parentEntity: n.entityCode,
2363
2376
  parentId: n.recordId,
2364
2377
  schema: n.schema
2365
2378
  };
2366
- switch (c.mode) {
2367
- case "list": return f(/* @__PURE__ */ Y(tt, { ...p }));
2368
- case "cards": return f(/* @__PURE__ */ Y(nt, { ...p }));
2369
- case "timeline": return f(/* @__PURE__ */ Y(yt, { ...p }));
2370
- default: return r.isPhone && !a ? f(/* @__PURE__ */ Y(nt, { ...p })) : f(/* @__PURE__ */ Y(et, { ...p }));
2379
+ switch (u.mode) {
2380
+ case "list": return p(/* @__PURE__ */ Y(nt, { ...m }));
2381
+ case "cards": return p(/* @__PURE__ */ Y(rt, { ...m }));
2382
+ case "timeline": return p(/* @__PURE__ */ Y(bt, { ...m }));
2383
+ default: return a.isPhone && !s ? p(/* @__PURE__ */ Y(rt, { ...m })) : p(/* @__PURE__ */ Y(tt, { ...m }));
2371
2384
  }
2372
2385
  }
2373
2386
  //#endregion
2374
- //#region src/components/detail-layout/FieldRow.tsx
2375
- var At = 150, jt = 560, Mt = 270, Nt = "20px", Pt = 4, Ft = /* @__PURE__ */ new Set([
2376
- "text",
2377
- "rich_text",
2378
- "json",
2379
- "structure",
2380
- "multilang_text"
2381
- ]), It = me({
2382
- columns: 2,
2383
- stackPairs: !1
2384
- });
2385
- function Lt({ columns: e = 2, children: t }) {
2386
- let n = K(null), [r, i] = q(null);
2387
- W(() => {
2388
- let e = n.current;
2389
- if (!e || typeof ResizeObserver > "u") return;
2390
- let t = new ResizeObserver(([e]) => {
2391
- i(e.contentRect.width);
2392
- });
2393
- return t.observe(e), () => t.disconnect();
2394
- }, []);
2395
- let a = e === 1 || r !== null && r < jt ? 1 : e, o = r === null ? null : (r - (a - 1) * 24) / a, s = o !== null && o < Mt;
2396
- return /* @__PURE__ */ Y(It.Provider, {
2397
- value: {
2398
- columns: a,
2399
- stackPairs: s
2400
- },
2401
- children: /* @__PURE__ */ Y("div", {
2402
- ref: n,
2403
- style: {
2404
- display: "grid",
2405
- gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))`,
2406
- columnGap: 24,
2407
- rowGap: 2
2408
- },
2409
- children: t
2410
- })
2411
- });
2412
- }
2413
- function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint: o, actions: s, copyValue: c, mode: l = "display", htmlFor: u, labelId: d, labelTitle: f, "data-testid": p }) {
2414
- let m = ge(It), g = r || m.stackPairs, _ = !!a;
2415
- return /* @__PURE__ */ X("div", {
2416
- className: "detail-row",
2417
- "data-error": _ || void 0,
2418
- "data-testid": p,
2419
- style: {
2420
- display: "flex",
2421
- flexDirection: g ? "column" : "row",
2422
- gap: g ? 4 : 16,
2423
- alignItems: g ? "stretch" : "flex-start",
2424
- padding: "6px 0",
2425
- ...r ? { gridColumn: "1 / -1" } : null
2426
- },
2427
- children: [/* @__PURE__ */ X("div", {
2428
- style: {
2429
- width: g ? "auto" : At,
2430
- flexShrink: 0,
2431
- paddingTop: g ? 0 : Pt,
2432
- fontSize: 12,
2433
- lineHeight: Nt,
2434
- fontWeight: 500,
2435
- color: "var(--text-3)",
2436
- display: "flex",
2437
- alignItems: "flex-start",
2438
- gap: 2
2439
- },
2440
- children: [u ? /* @__PURE__ */ Y("label", {
2441
- id: d,
2442
- htmlFor: u,
2443
- title: f || void 0,
2444
- children: t
2445
- }) : /* @__PURE__ */ Y("span", {
2446
- id: d,
2447
- title: f || void 0,
2448
- children: t
2449
- }), i && l === "edit" && /* @__PURE__ */ Y("span", {
2450
- "aria-hidden": "true",
2451
- style: {
2452
- color: "var(--danger)",
2453
- marginLeft: 2
2454
- },
2455
- children: "*"
2456
- })]
2457
- }), /* @__PURE__ */ X("div", {
2458
- style: {
2459
- flex: 1,
2460
- minWidth: 0,
2461
- display: "flex",
2462
- flexDirection: "column",
2463
- gap: 3
2464
- },
2465
- children: [/* @__PURE__ */ X("div", {
2466
- style: {
2467
- display: "flex",
2468
- alignItems: "flex-start",
2469
- gap: 6,
2470
- minHeight: 24
2471
- },
2472
- children: [/* @__PURE__ */ Y("div", {
2473
- style: {
2474
- flex: 1,
2475
- minWidth: 0,
2476
- fontSize: 13,
2477
- lineHeight: Nt,
2478
- color: "var(--text)",
2479
- overflowWrap: "anywhere",
2480
- paddingTop: l === "display" && !g ? Pt : 0
2481
- },
2482
- children: _ && l === "edit" ? /* @__PURE__ */ Y("div", {
2483
- style: {
2484
- borderRadius: 6,
2485
- boxShadow: "0 0 0 1.5px var(--danger)"
2486
- },
2487
- children: n
2488
- }) : n
2489
- }), (c || s) && /* @__PURE__ */ X("div", {
2490
- className: "detail-row-action",
2491
- style: {
2492
- display: "flex",
2493
- gap: 2,
2494
- flexShrink: 0,
2495
- marginTop: -2
2496
- },
2497
- children: [c && /* @__PURE__ */ Y(h, {
2498
- value: c,
2499
- size: "sm",
2500
- title: "Copy value"
2501
- }), s]
2502
- })]
2503
- }), (_ || o != null) && /* @__PURE__ */ X("div", {
2504
- style: {
2505
- fontSize: 11.5,
2506
- lineHeight: 1.4,
2507
- color: _ ? "var(--danger)" : "var(--text-3)",
2508
- display: "flex",
2509
- alignItems: "center",
2510
- gap: 4
2511
- },
2512
- children: [_ && /* @__PURE__ */ Y(e.warning, { size: 11 }), /* @__PURE__ */ Y("span", { children: _ ? a : o })]
2513
- })]
2514
- })]
2515
- });
2516
- }
2517
- //#endregion
2518
2387
  //#region src/components/detail-layout/FieldsBlock.tsx
2519
- function zt({ fields: e, ctx: t }) {
2520
- let { entity: n, entityCode: r, record: i, mode: a, onFieldChange: o, schema: s } = t, c = x(), l = t.columns ?? 2, u = l === 1 && e.length === 1;
2521
- return /* @__PURE__ */ Y(Lt, {
2388
+ function jt({ fields: e, ctx: t }) {
2389
+ let n = A(), { entity: r, entityCode: i, record: a, mode: o, onFieldChange: s, schema: c } = t, l = t.columns ?? 2, u = l === 1 && e.length === 1;
2390
+ return /* @__PURE__ */ Y(B, {
2522
2391
  columns: l,
2523
2392
  children: e.map((e) => {
2524
- let l = e.code, d = `${r ?? "field"}-${l}`, f = `${d}-label`, p = n.fields.get(l), m = !!(p?.auto || p?.readonly || p?.source), h = ie(n, l), g = h?.read === "denied", _ = h?.write === "denied", v = a === "display" ? g : _ || g, y = m || a === "edit" && _ ? "display" : a, b = v ? /* @__PURE__ */ Y(I, {
2393
+ let l = e.code, d = `${i ?? "field"}-${l}`, f = `${d}-label`, p = r.fields.get(l), m = !!(p?.auto || p?.readonly || p?.source), h = se(r, l), g = h?.read === "denied", _ = h?.write === "denied", y = o === "display" ? g : _ || g, b = m || o === "edit" && _ ? "display" : o, x = y ? /* @__PURE__ */ Y(I, {
2525
2394
  tier: h.classification,
2526
- tierDef: ae(s, n, l),
2395
+ tierDef: ce(c, r, l),
2527
2396
  requiredPermission: h?.required_permission,
2528
- locale: c,
2529
- variant: y === "edit" ? "input" : "value"
2530
- }) : ce({
2531
- entity: n,
2532
- entityCode: r,
2397
+ variant: b === "edit" ? "input" : "value"
2398
+ }) : de({
2399
+ entity: r,
2400
+ entityCode: i,
2533
2401
  fieldName: l,
2534
- record: i,
2535
- mode: y,
2536
- onChange: o && !m ? (e) => o(l, e) : void 0,
2402
+ record: a,
2403
+ mode: b,
2404
+ onChange: s && !m ? (e) => s(l, e) : void 0,
2537
2405
  refs: t.refs,
2538
- entities: s?.entities,
2539
- screens: s?.screens,
2540
- locale: c,
2406
+ entities: c?.entities,
2407
+ screens: c?.screens,
2408
+ t: n,
2541
2409
  fieldId: d,
2542
2410
  labelId: f,
2543
2411
  structure: e.structure,
2544
2412
  detailScreen: e.detail_screen
2545
2413
  });
2546
- if (!b) return null;
2547
- let x = a === "display" && e.actions && e.actions.length > 0 ? /* @__PURE__ */ Y(J, { children: e.actions.map((e, t) => /* @__PURE__ */ Y(F, {
2414
+ if (!x) return null;
2415
+ let S = o === "display" && e.actions && e.actions.length > 0 ? /* @__PURE__ */ Y(J, { children: e.actions.map((e, t) => /* @__PURE__ */ Y(L, {
2548
2416
  actionCode: `${l}.action[${t}]`,
2549
2417
  action: e,
2550
- entityCode: r,
2551
- row: i,
2418
+ entityCode: i,
2419
+ row: a,
2552
2420
  variant: "ghost",
2553
2421
  size: "icon"
2554
- }, t)) }) : void 0, S = !!p && Ft.has(p.type), C = i?.[l], w = y === "display" && (p?.copyable || p?.type === "uuid") && C != null && C !== "" ? T(C) : void 0, D = E(p?.display?.description);
2422
+ }, t)) }) : void 0, C = !!p && M.has(p.type), w = a?.[l], T = b === "display" && (p?.copyable || p?.type === "uuid") && w != null && w !== "" ? v(w) : void 0, E = n(p?.display?.description);
2555
2423
  return u ? /* @__PURE__ */ X("div", {
2556
2424
  style: { gridColumn: "1 / -1" },
2557
- children: [b, y === "edit" && D && /* @__PURE__ */ Y("div", {
2425
+ children: [x, b === "edit" && E && /* @__PURE__ */ Y("div", {
2558
2426
  style: {
2559
2427
  fontSize: 11.5,
2560
2428
  lineHeight: 1.4,
2561
2429
  color: "var(--text-3)",
2562
2430
  marginTop: 3
2563
2431
  },
2564
- children: D
2432
+ children: E
2565
2433
  })]
2566
- }, l) : /* @__PURE__ */ Y(Rt, {
2434
+ }, l) : /* @__PURE__ */ Y(F, {
2567
2435
  "data-testid": `field-${l}`,
2568
- label: se(n, l, s.entities),
2569
- htmlFor: y === "edit" ? d : void 0,
2436
+ label: ue(n, r, l, c.entities),
2437
+ htmlFor: b === "edit" ? d : void 0,
2570
2438
  labelId: f,
2571
- labelTitle: D || void 0,
2439
+ labelTitle: E || void 0,
2572
2440
  required: p?.required ?? !1,
2573
- mode: y,
2574
- span: S,
2441
+ mode: b,
2442
+ span: C,
2575
2443
  error: t.fieldErrors?.[l],
2576
- hint: y === "edit" && D ? D : void 0,
2577
- actions: x,
2578
- copyValue: w,
2579
- children: b
2444
+ hint: b === "edit" && E ? E : void 0,
2445
+ actions: S,
2446
+ copyValue: T,
2447
+ children: x
2580
2448
  }, l);
2581
2449
  })
2582
2450
  });
2583
2451
  }
2584
2452
  //#endregion
2585
2453
  //#region src/components/detail-layout/PropertiesBlock.tsx
2586
- var Bt = /* @__PURE__ */ new Set([
2454
+ var Mt = /* @__PURE__ */ new Set([
2587
2455
  "string",
2588
2456
  "text",
2589
2457
  "int",
@@ -2591,16 +2459,16 @@ var Bt = /* @__PURE__ */ new Set([
2591
2459
  "decimal",
2592
2460
  "email",
2593
2461
  "url"
2594
- ]), Vt = 500;
2595
- function Ht({ node: e, ctx: t }) {
2462
+ ]), Nt = 500;
2463
+ function Pt({ node: e, ctx: t }) {
2596
2464
  let { entity: n, objectProperties: r, onSetProperty: i, isNew: a, mode: o, refs: s } = t, c = n.properties ?? {};
2597
2465
  if (a) return null;
2598
2466
  let l = e.properties === !0 || e.properties, u = l === !0 ? Object.entries(c).sort(([e], [t]) => e.localeCompare(t)) : l.filter((e) => c[e] != null).map((e) => [e, c[e]]);
2599
- return u.length === 0 ? null : /* @__PURE__ */ Y(Lt, {
2467
+ return u.length === 0 ? null : /* @__PURE__ */ Y(B, {
2600
2468
  columns: 2,
2601
2469
  children: u.map(([e, a]) => {
2602
- let c = r?.find((t) => t.property_code === e), l = A(a), u = a.readonly || !i ? "display" : o;
2603
- return /* @__PURE__ */ Y(Ut, {
2470
+ let c = r?.find((t) => t.property_code === e), l = w(a), u = a.readonly || !i ? "display" : o;
2471
+ return /* @__PURE__ */ Y(Ft, {
2604
2472
  propCode: e,
2605
2473
  prop: a,
2606
2474
  field: l,
@@ -2614,42 +2482,41 @@ function Ht({ node: e, ctx: t }) {
2614
2482
  })
2615
2483
  });
2616
2484
  }
2617
- function Ut({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty: a, refs: o, entity: s, schema: c }) {
2618
- let l = x(), u = K(null);
2619
- W(() => () => {
2485
+ function Ft({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty: a, refs: o, entity: s, schema: c }) {
2486
+ let l = A(), u = K(null);
2487
+ G(() => () => {
2620
2488
  u.current && clearTimeout(u.current);
2621
2489
  }, []);
2622
- let d = U((n) => {
2623
- a && (Bt.has(t.type) ? (u.current && clearTimeout(u.current), u.current = setTimeout(() => a(e, n), Vt)) : a(e, n));
2490
+ let d = W((n) => {
2491
+ a && (Mt.has(t.type) ? (u.current && clearTimeout(u.current), u.current = setTimeout(() => a(e, n), Nt)) : a(e, n));
2624
2492
  }, [
2625
2493
  e,
2626
2494
  t.type,
2627
2495
  a
2628
- ]), f = ie(s, e), p = f?.read === "denied", m = f?.write === "denied", h = i === "display" ? p : m || p, g = i === "edit" && m ? "display" : i;
2629
- return /* @__PURE__ */ Y(Rt, {
2630
- label: E(t.display?.name ?? t.name),
2496
+ ]), f = se(s, e), p = f?.read === "denied", m = f?.write === "denied", h = i === "display" ? p : m || p, g = i === "edit" && m ? "display" : i;
2497
+ return /* @__PURE__ */ Y(F, {
2498
+ label: l(t.display?.name ?? t.name),
2631
2499
  mode: g,
2632
- span: Ft.has(t.type),
2500
+ span: M.has(t.type),
2633
2501
  children: h ? /* @__PURE__ */ Y(I, {
2634
2502
  tier: f.classification,
2635
- tierDef: ae(c, s, e),
2503
+ tierDef: ce(c, s, e),
2636
2504
  requiredPermission: f?.required_permission,
2637
- locale: l,
2638
2505
  variant: g === "edit" ? "input" : "value"
2639
- }) : M({
2506
+ }) : C({
2640
2507
  field: n,
2641
2508
  fieldName: e,
2642
2509
  value: r,
2643
2510
  mode: g,
2644
2511
  onChange: g === "edit" ? d : void 0,
2645
2512
  refs: o,
2646
- locale: l
2513
+ t: l
2647
2514
  })
2648
2515
  });
2649
2516
  }
2650
2517
  //#endregion
2651
2518
  //#region src/components/shared/StatusStepper.tsx
2652
- function Wt({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1 }) {
2519
+ function It({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1 }) {
2653
2520
  let o = t.findIndex((e) => e.code === n);
2654
2521
  return /* @__PURE__ */ Y("div", {
2655
2522
  role: "list",
@@ -2716,7 +2583,8 @@ function Wt({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1
2716
2583
  }
2717
2584
  //#endregion
2718
2585
  //#region src/components/shared/StatusGroupsDisplay.tsx
2719
- function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
2586
+ function Lt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
2587
+ let o = A();
2720
2588
  return /* @__PURE__ */ Y("div", {
2721
2589
  style: {
2722
2590
  display: "flex",
@@ -2724,10 +2592,10 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
2724
2592
  alignItems: "center",
2725
2593
  gap: 16
2726
2594
  },
2727
- children: Object.entries(e).map(([e, o]) => {
2728
- let s = t?.find((t) => t.group_code === e)?.status_code, c = s ? o.statuses.find((e) => e.code === s) : void 0;
2729
- if (o.display_mode === "stepper") {
2730
- let t = i === "edit", a = t ? o.transitions && s ? /* @__PURE__ */ new Set([s, ...o.transitions[s] ?? []]) : new Set(o.statuses.map((e) => e.code)) : void 0;
2595
+ children: Object.entries(e).map(([e, s]) => {
2596
+ let c = t?.find((t) => t.group_code === e)?.status_code, l = c ? s.statuses.find((e) => e.code === c) : void 0;
2597
+ if (s.display_mode === "stepper") {
2598
+ let t = i === "edit", a = t ? s.transitions && c ? /* @__PURE__ */ new Set([c, ...s.transitions[c] ?? []]) : new Set(s.statuses.map((e) => e.code)) : void 0;
2731
2599
  return /* @__PURE__ */ X("div", {
2732
2600
  style: {
2733
2601
  display: "flex",
@@ -2741,19 +2609,19 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
2741
2609
  color: "var(--text-3)",
2742
2610
  flexShrink: 0
2743
2611
  },
2744
- children: [E(o.name), ":"]
2612
+ children: [o(s.name), ":"]
2745
2613
  }), /* @__PURE__ */ Y("div", {
2746
2614
  style: {
2747
2615
  minWidth: 240,
2748
2616
  opacity: r ? .6 : 1,
2749
2617
  pointerEvents: r ? "none" : "auto"
2750
2618
  },
2751
- children: /* @__PURE__ */ Y(Wt, {
2752
- stages: o.statuses.map((e) => ({
2619
+ children: /* @__PURE__ */ Y(It, {
2620
+ stages: s.statuses.map((e) => ({
2753
2621
  code: e.code,
2754
- label: E(e.name)
2622
+ label: o(e.name)
2755
2623
  })),
2756
- current: s,
2624
+ current: c,
2757
2625
  selectable: a,
2758
2626
  onSelect: t ? (t) => n(e, t) : void 0,
2759
2627
  compact: !0
@@ -2772,11 +2640,11 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
2772
2640
  fontSize: 12,
2773
2641
  color: "var(--text-3)"
2774
2642
  },
2775
- children: [E(o.name), ":"]
2776
- }), c ? /* @__PURE__ */ Y(P, {
2777
- tone: c.color ?? "slate",
2643
+ children: [o(s.name), ":"]
2644
+ }), l ? /* @__PURE__ */ Y(a, {
2645
+ tone: l.color ?? "slate",
2778
2646
  size: "xs",
2779
- children: E(c.name)
2647
+ children: o(l.name)
2780
2648
  }) : /* @__PURE__ */ Y("span", {
2781
2649
  style: {
2782
2650
  fontSize: 12.5,
@@ -2785,7 +2653,7 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
2785
2653
  children: "—"
2786
2654
  })]
2787
2655
  }, e);
2788
- let l = (o.transitions && s ? o.statuses.filter((e) => e.code === s || (o.transitions[s]?.includes(e.code) ?? !1)) : o.statuses).map((e) => ({
2656
+ let u = (s.transitions && c ? s.statuses.filter((e) => e.code === c || (s.transitions[c]?.includes(e.code) ?? !1)) : s.statuses).map((e) => ({
2789
2657
  value: e.code,
2790
2658
  label: /* @__PURE__ */ X("span", {
2791
2659
  style: {
@@ -2799,7 +2667,7 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
2799
2667
  borderRadius: 999,
2800
2668
  background: `var(--pill-${e.color}, ${e.color})`,
2801
2669
  display: "inline-block"
2802
- } }), E(e.name)]
2670
+ } }), o(e.name)]
2803
2671
  })
2804
2672
  }));
2805
2673
  return /* @__PURE__ */ X("div", {
@@ -2813,18 +2681,17 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
2813
2681
  fontSize: 12,
2814
2682
  color: "var(--text-3)"
2815
2683
  },
2816
- children: [E(o.name), ":"]
2684
+ children: [o(s.name), ":"]
2817
2685
  }), /* @__PURE__ */ Y("div", {
2818
2686
  style: {
2819
2687
  minWidth: 180,
2820
2688
  opacity: r ? .6 : 1,
2821
2689
  pointerEvents: r ? "none" : "auto"
2822
2690
  },
2823
- children: /* @__PURE__ */ Y(a, {
2824
- value: s ?? "",
2825
- options: l,
2826
- onChange: (t) => n(e, t),
2827
- placeholder: "Select…"
2691
+ children: /* @__PURE__ */ Y(d, {
2692
+ value: c ?? "",
2693
+ options: u,
2694
+ onChange: (t) => n(e, t)
2828
2695
  })
2829
2696
  })]
2830
2697
  }, e);
@@ -2833,31 +2700,31 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
2833
2700
  }
2834
2701
  //#endregion
2835
2702
  //#region src/components/detail-layout/StatusesBlock.tsx
2836
- var Kt = () => {};
2837
- function qt({ node: e, ctx: t }) {
2703
+ var Rt = () => {};
2704
+ function zt({ node: e, ctx: t }) {
2838
2705
  let { entity: n, objectStatuses: r, onSetStatus: i, isStatusPending: a, isNew: o } = t, s = n.status_groups ?? {};
2839
2706
  if (o) return null;
2840
2707
  let c = e.statuses === !0 || e.statuses, l = Object.fromEntries(Object.entries(s).filter(([e]) => c === !0 || c.includes(e)));
2841
- return Object.keys(l).length === 0 ? null : /* @__PURE__ */ Y(Gt, {
2708
+ return Object.keys(l).length === 0 ? null : /* @__PURE__ */ Y(Lt, {
2842
2709
  statusGroups: l,
2843
2710
  objectStatuses: r,
2844
- onSetStatus: i ?? Kt,
2711
+ onSetStatus: i ?? Rt,
2845
2712
  isPending: a ?? !1,
2846
2713
  mode: t.mode
2847
2714
  });
2848
2715
  }
2849
2716
  //#endregion
2850
2717
  //#region src/components/detail-layout/widgets/canonicalizeJson.ts
2851
- function Jt(e) {
2852
- if (Array.isArray(e)) return e.map(Jt);
2718
+ function Bt(e) {
2719
+ if (Array.isArray(e)) return e.map(Bt);
2853
2720
  if (typeof e == "object" && e) {
2854
2721
  let t = e, n = {};
2855
- for (let e of Object.keys(t).sort()) n[e] = Jt(t[e]);
2722
+ for (let e of Object.keys(t).sort()) n[e] = Bt(t[e]);
2856
2723
  return n;
2857
2724
  }
2858
2725
  return e;
2859
2726
  }
2860
- function Yt(e) {
2727
+ function Vt(e) {
2861
2728
  switch (typeof e) {
2862
2729
  case "string": return e;
2863
2730
  case "number":
@@ -2869,39 +2736,44 @@ function Yt(e) {
2869
2736
  default: return "";
2870
2737
  }
2871
2738
  }
2872
- function Xt(e) {
2739
+ function Ht(e) {
2873
2740
  if (e == null) return "";
2874
2741
  try {
2875
- return JSON.stringify(Jt(e), null, 2) ?? Yt(e);
2742
+ return JSON.stringify(Bt(e), null, 2) ?? Vt(e);
2876
2743
  } catch {
2877
- return Yt(e);
2744
+ return Vt(e);
2878
2745
  }
2879
2746
  }
2880
2747
  //#endregion
2881
2748
  //#region src/components/detail-layout/widgets/JsonDiffWidget.tsx
2882
- var Zt = "Audit change diff", Qt = he(() => import("./MonacoJson-BG3S3GHX.js").then((e) => ({ default: e.MonacoJsonDiff }))), $t = he(() => import("./MonacoJson-BG3S3GHX.js").then((e) => ({ default: e.MonacoJsonSource }))), en = he(() => import("./JsonEditor-Dz1PQHC8.js").then((e) => ({ default: e.JsonEditor })));
2883
- function tn() {
2749
+ function Ut(e) {
2750
+ return e("record.diff.editor", "Audit change diff");
2751
+ }
2752
+ var Wt = ge(() => import("./MonacoJson-BG3S3GHX.js").then((e) => ({ default: e.MonacoJsonDiff }))), Gt = ge(() => import("./MonacoJson-BG3S3GHX.js").then((e) => ({ default: e.MonacoJsonSource }))), Kt = ge(() => import("./JsonEditor-Dz1PQHC8.js").then((e) => ({ default: e.JsonEditor })));
2753
+ function qt() {
2754
+ let e = A();
2884
2755
  return /* @__PURE__ */ Y("div", {
2885
2756
  className: "flex h-full w-full items-center justify-center text-sm text-muted-foreground",
2886
- children: "Loading editor…"
2757
+ children: e("record.diff.loading_editor", "Loading editor…")
2887
2758
  });
2888
2759
  }
2889
- function nn({ before: e, after: t }) {
2890
- return /* @__PURE__ */ Y(pe, {
2891
- fallback: /* @__PURE__ */ Y(tn, {}),
2760
+ function Jt({ before: e, after: t }) {
2761
+ let n = A();
2762
+ return /* @__PURE__ */ Y(he, {
2763
+ fallback: /* @__PURE__ */ Y(qt, {}),
2892
2764
  children: /* @__PURE__ */ X("div", {
2893
2765
  className: "flex h-full w-full gap-2",
2894
2766
  role: "group",
2895
- "aria-label": Zt,
2767
+ "aria-label": Ut(n),
2896
2768
  children: [/* @__PURE__ */ Y("div", {
2897
2769
  className: "min-w-0 flex-1",
2898
- children: /* @__PURE__ */ Y(en, {
2770
+ children: /* @__PURE__ */ Y(Kt, {
2899
2771
  value: e,
2900
2772
  readOnly: !0
2901
2773
  })
2902
2774
  }), /* @__PURE__ */ Y("div", {
2903
2775
  className: "min-w-0 flex-1",
2904
- children: /* @__PURE__ */ Y(en, {
2776
+ children: /* @__PURE__ */ Y(Kt, {
2905
2777
  value: t,
2906
2778
  readOnly: !0
2907
2779
  })
@@ -2909,62 +2781,63 @@ function nn({ before: e, after: t }) {
2909
2781
  })
2910
2782
  });
2911
2783
  }
2912
- function rn({ mode: e, onChange: t }) {
2784
+ function Yt({ mode: e, onChange: t }) {
2785
+ let n = A();
2913
2786
  return /* @__PURE__ */ X("div", {
2914
2787
  className: "inline-flex gap-1",
2915
2788
  role: "group",
2916
- "aria-label": "Diff view mode",
2789
+ "aria-label": n("record.diff.view_mode", "Diff view mode"),
2917
2790
  children: [/* @__PURE__ */ Y("button", {
2918
2791
  type: "button",
2919
2792
  "aria-pressed": e === "diff",
2920
2793
  onClick: () => t("diff"),
2921
2794
  className: `rounded px-2 py-0.5 text-xs ${e === "diff" ? "bg-accent text-accent-foreground" : "text-muted-foreground"}`,
2922
- children: "Diff"
2795
+ children: n("record.diff.diff", "Diff")
2923
2796
  }), /* @__PURE__ */ Y("button", {
2924
2797
  type: "button",
2925
2798
  "aria-pressed": e === "source",
2926
2799
  onClick: () => t("source"),
2927
2800
  className: `rounded px-2 py-0.5 text-xs ${e === "source" ? "bg-accent text-accent-foreground" : "text-muted-foreground"}`,
2928
- children: "Source"
2801
+ children: n("record.diff.source", "Source")
2929
2802
  })]
2930
2803
  });
2931
2804
  }
2932
- function an({ values: e, options: t }) {
2933
- let n = e.before, r = e.after, i = t?.default_mode === "source" ? "source" : "diff", [a, o] = q(i), s = Xt(n), c = Xt(r);
2805
+ function Xt({ values: e, options: t }) {
2806
+ let n = A(), r = e.before, i = e.after, a = t?.default_mode === "source" ? "source" : "diff", [o, s] = q(a), c = Ht(r), l = Ht(i);
2934
2807
  return /* @__PURE__ */ X("div", {
2935
2808
  className: "flex flex-col gap-2",
2936
2809
  children: [/* @__PURE__ */ X("div", {
2937
2810
  className: "flex items-center justify-between",
2938
- children: [/* @__PURE__ */ Y(rn, {
2939
- mode: a,
2940
- onChange: o
2941
- }), s === c && /* @__PURE__ */ Y("span", {
2811
+ children: [/* @__PURE__ */ Y(Yt, {
2812
+ mode: o,
2813
+ onChange: s
2814
+ }), c === l && /* @__PURE__ */ Y("span", {
2942
2815
  className: "text-xs text-muted-foreground",
2943
2816
  role: "status",
2944
- children: "No field changes"
2817
+ children: n("record.diff.no_changes", "No field changes")
2945
2818
  })]
2946
2819
  }), /* @__PURE__ */ Y("div", {
2947
2820
  className: "h-[480px] w-full overflow-hidden rounded border",
2948
2821
  role: "group",
2949
- "aria-label": Zt,
2950
- children: /* @__PURE__ */ Y(z, {
2951
- fallback: /* @__PURE__ */ Y(nn, {
2952
- before: n,
2953
- after: r
2822
+ "aria-label": Ut(n),
2823
+ children: /* @__PURE__ */ Y(ee, {
2824
+ fallback: /* @__PURE__ */ Y(Jt, {
2825
+ before: r,
2826
+ after: i
2954
2827
  }),
2955
- children: /* @__PURE__ */ Y(pe, {
2956
- fallback: /* @__PURE__ */ Y(tn, {}),
2957
- children: a === "diff" ? /* @__PURE__ */ Y(Qt, {
2958
- before: s,
2959
- after: c
2828
+ children: /* @__PURE__ */ Y(he, {
2829
+ fallback: /* @__PURE__ */ Y(qt, {}),
2830
+ children: o === "diff" ? /* @__PURE__ */ Y(Wt, {
2831
+ before: c,
2832
+ after: l
2960
2833
  }) : /* @__PURE__ */ X("div", {
2961
2834
  className: "flex h-full w-full gap-2",
2962
2835
  children: [/* @__PURE__ */ Y("div", {
2963
2836
  className: "min-w-0 flex-1",
2964
- children: /* @__PURE__ */ Y($t, { value: s })
2837
+ children: /* @__PURE__ */ Y(Gt, { value: c })
2965
2838
  }), /* @__PURE__ */ Y("div", {
2966
2839
  className: "min-w-0 flex-1",
2967
- children: /* @__PURE__ */ Y($t, { value: c })
2840
+ children: /* @__PURE__ */ Y(Gt, { value: l })
2968
2841
  })]
2969
2842
  })
2970
2843
  })
@@ -2983,7 +2856,7 @@ function $(e) {
2983
2856
  let n = Object.entries(t).filter((e) => typeof e[1] == "string");
2984
2857
  return n.length > 0 ? Object.fromEntries(n) : void 0;
2985
2858
  }
2986
- function on(e) {
2859
+ function Zt(e) {
2987
2860
  return Array.isArray(e) ? e.flatMap((e) => {
2988
2861
  let t = Q(e);
2989
2862
  return !t || typeof t.field != "string" ? [] : [{
@@ -2993,7 +2866,7 @@ function on(e) {
2993
2866
  }];
2994
2867
  }) : [];
2995
2868
  }
2996
- function sn(e) {
2869
+ function Qt(e) {
2997
2870
  if (!e || typeof e.entity != "string" || typeof e.scope_field != "string" || typeof e.window_field != "string") return;
2998
2871
  let t = Array.isArray(e.windows) ? e.windows.flatMap((e) => {
2999
2872
  let t = Q(e);
@@ -3028,7 +2901,7 @@ function sn(e) {
3028
2901
  filter_label: $(r.filter_label),
3029
2902
  all_label: $(r.all_label),
3030
2903
  empty_label: $(r.empty_label),
3031
- columns: on(r.columns),
2904
+ columns: Zt(r.columns),
3032
2905
  sort: typeof r.sort == "string" ? r.sort : void 0,
3033
2906
  limit: typeof r.limit == "number" ? Math.min(500, Math.max(1, r.limit)) : 200
3034
2907
  } : void 0, a = Q(e.drillthrough), o = a && typeof a.route == "string" && typeof a.scope_field == "string" && typeof a.window_field == "string" ? {
@@ -3053,134 +2926,143 @@ function sn(e) {
3053
2926
  drillthrough: o
3054
2927
  };
3055
2928
  }
3056
- function cn(e, t, n) {
3057
- if (e == null || e === "") return "N/A";
3058
- if (t === "number") return new Intl.NumberFormat(n).format(Number(e));
3059
- if (t === "percent_ratio") return new Intl.NumberFormat(n, {
2929
+ function $t(e, t) {
2930
+ let n = (e, n) => new Intl.NumberFormat(t, {
2931
+ style: "unit",
2932
+ unit: e,
2933
+ unitDisplay: "narrow"
2934
+ }).format(n);
2935
+ return e >= 86400 ? n("day", Math.floor(e / 86400)) : e >= 3600 ? n("hour", Math.floor(e / 3600)) : e >= 60 ? n("minute", Math.floor(e / 60)) : n("second", Math.max(0, Math.floor(e)));
2936
+ }
2937
+ function en(e, t, n) {
2938
+ let r = e("record.scorecard.not_available", "N/A"), i = e.language;
2939
+ if (t == null || t === "") return r;
2940
+ if (n === "number") return new Intl.NumberFormat(i).format(Number(t));
2941
+ if (n === "percent_ratio") return new Intl.NumberFormat(i, {
3060
2942
  style: "percent",
3061
2943
  maximumFractionDigits: 2
3062
- }).format(Number(e));
3063
- if (t === "duration_seconds") {
3064
- let t = Number(e);
3065
- return Number.isFinite(t) ? t >= 86400 ? `${Math.floor(t / 86400)}d` : t >= 3600 ? `${Math.floor(t / 3600)}h` : t >= 60 ? `${Math.floor(t / 60)}m` : `${Math.max(0, Math.floor(t))}s` : "N/A";
2944
+ }).format(Number(t));
2945
+ if (n === "duration_seconds") {
2946
+ let e = Number(t);
2947
+ return Number.isFinite(e) ? $t(e, i) : r;
3066
2948
  }
3067
- if (t === "timestamp") {
3068
- if (typeof e != "string" && typeof e != "number" && !(e instanceof Date)) return "N/A";
3069
- let t = new Date(e);
3070
- return Number.isNaN(t.getTime()) ? "N/A" : t.toLocaleString(n, { timeZoneName: "short" });
2949
+ if (n === "timestamp") {
2950
+ if (typeof t != "string" && typeof t != "number" && !(t instanceof Date)) return r;
2951
+ let e = new Date(t);
2952
+ return Number.isNaN(e.getTime()) ? r : e.toLocaleString(i, { timeZoneName: "short" });
3071
2953
  }
3072
- return typeof e == "string" ? e : typeof e == "number" || typeof e == "bigint" || typeof e == "boolean" ? String(e) : "N/A";
2954
+ return typeof t == "string" ? t : typeof t == "number" || typeof t == "bigint" || typeof t == "boolean" ? String(t) : r;
3073
2955
  }
3074
- function ln(e, t) {
2956
+ function tn(e, t) {
3075
2957
  return typeof e.id == "string" || typeof e.id == "number" ? String(e.id) : `row-${t}`;
3076
2958
  }
3077
- function un(e, t) {
2959
+ function nn(e, t) {
3078
2960
  return !t || Object.entries(t).every(([t, n]) => e[t] === n);
3079
2961
  }
3080
- function dn({ values: e, options: t }) {
3081
- let n = G(() => sn(t), [t]), r = x(), i = ne(), a = e.scope, o = n?.windows.some((e) => e.code === n.default_window) ? n.default_window : n?.windows[0]?.code ?? "", [s, c] = q(o), [l, u] = q("");
3082
- W(() => {
3083
- c(o);
3084
- }, [o]), W(() => {
3085
- u("");
3086
- }, [s]);
3087
- let d = n ? [{
3088
- field: n.scope_field,
2962
+ function rn({ values: e, options: t }) {
2963
+ let n = A(), r = A("errors"), a = ye(() => Qt(t), [t]), o = ie(), s = e.scope, c = a?.windows.some((e) => e.code === a.default_window) ? a.default_window : a?.windows[0]?.code ?? "", [l, u] = q(c), [d, f] = q("");
2964
+ G(() => {
2965
+ u(c);
2966
+ }, [c]), G(() => {
2967
+ f("");
2968
+ }, [l]);
2969
+ let p = a ? [{
2970
+ field: a.scope_field,
3089
2971
  op: "eq",
3090
- value: a
2972
+ value: s
3091
2973
  }, {
3092
- field: n.window_field,
2974
+ field: a.window_field,
3093
2975
  op: "eq",
3094
- value: s
3095
- }] : [], f = N(n?.entity, {
2976
+ value: l
2977
+ }] : [], m = i(a?.entity, {
3096
2978
  per_page: 1,
3097
- filters: d
3098
- }, !!(n && a && s)), p = n?.breakdown, m = p ? [{
3099
- field: p.scope_field,
2979
+ filters: p
2980
+ }, !!(a && s && l)), h = a?.breakdown, g = h ? [{
2981
+ field: h.scope_field,
3100
2982
  op: "eq",
3101
- value: a
2983
+ value: s
3102
2984
  }, {
3103
- field: p.window_field,
2985
+ field: h.window_field,
3104
2986
  op: "eq",
3105
- value: s
3106
- }] : [], h = N(p?.entity, {
3107
- per_page: p?.limit ?? 200,
3108
- sort: p?.sort,
3109
- filters: m
3110
- }, !!(p && a && s));
3111
- if (!n || !a) return /* @__PURE__ */ Y("div", {
2987
+ value: l
2988
+ }] : [], _ = i(h?.entity, {
2989
+ per_page: h?.limit ?? 200,
2990
+ sort: h?.sort,
2991
+ filters: g
2992
+ }, !!(h && s && l));
2993
+ if (!a || !s) return /* @__PURE__ */ Y("div", {
3112
2994
  role: "alert",
3113
2995
  className: "rounded border border-destructive p-3 text-sm text-destructive",
3114
- children: "Invalid entity_scorecard configuration."
2996
+ children: r("record.scorecard_config_invalid", "Invalid entity_scorecard configuration.")
3115
2997
  });
3116
- let g = f.data?.data?.[0], _ = h.data?.data ?? [], v = p?.filter_field ? Array.from(new Set(_.map((e) => e[p.filter_field]).filter((e) => typeof e == "string" && e !== ""))).sort() : [], y = l && p?.filter_field ? _.filter((e) => e[p.filter_field] === l) : _, b = (e) => !l || !e.filtered || !p?.filter_field ? g?.[e.field] : _.find((t) => t[p.filter_field] === l && un(t, e.filtered?.where))?.[e.filtered.field], S = (e) => {
3117
- let t = n.drillthrough;
2998
+ let v = m.data?.data?.[0], y = _.data?.data ?? [], b = h?.filter_field ? Array.from(new Set(y.map((e) => e[h.filter_field]).filter((e) => typeof e == "string" && e !== ""))).sort() : [], x = d && h?.filter_field ? y.filter((e) => e[h.filter_field] === d) : y, S = (e) => !d || !e.filtered || !h?.filter_field ? v?.[e.field] : y.find((t) => t[h.filter_field] === d && nn(t, e.filtered?.where))?.[e.filtered.field], C = (e) => {
2999
+ let t = a.drillthrough;
3118
3000
  if (!t || !e.drillthrough_value) return;
3119
- let r = [{
3001
+ let n = [{
3120
3002
  field: t.scope_field,
3121
3003
  op: "eq",
3122
- value: a
3004
+ value: s
3123
3005
  }, {
3124
3006
  field: t.window_field,
3125
3007
  op: "eq",
3126
- value: s
3008
+ value: l
3127
3009
  }];
3128
- t.filter_field && l && e.drillthrough_filter !== !1 && r.push({
3010
+ t.filter_field && d && e.drillthrough_filter !== !1 && n.push({
3129
3011
  field: t.filter_field,
3130
3012
  op: "eq",
3131
- value: l
3132
- }), t.metric_field && r.push({
3013
+ value: d
3014
+ }), t.metric_field && n.push({
3133
3015
  field: t.metric_field,
3134
3016
  op: "eq",
3135
3017
  value: e.drillthrough_value
3136
- }), i(t.route, { search: new URLSearchParams({ filters: JSON.stringify(r) }).toString() });
3137
- }, C = f.error ?? h.error;
3018
+ }), o(t.route, { search: new URLSearchParams({ filters: JSON.stringify(n) }).toString() });
3019
+ }, w = m.error ?? _.error, T = n(h?.filter_label) || n("record.scorecard.filter", "Filter");
3138
3020
  return /* @__PURE__ */ X("div", {
3139
3021
  className: "flex min-w-0 flex-col gap-4",
3140
- "aria-label": E(n.title, r) || "Scorecard",
3022
+ "aria-label": n(a.title) || n("record.scorecard.title", "Scorecard"),
3141
3023
  children: [
3142
3024
  /* @__PURE__ */ X("div", {
3143
3025
  className: "flex flex-wrap items-start justify-between gap-3",
3144
3026
  children: [/* @__PURE__ */ X("div", {
3145
3027
  className: "min-w-0",
3146
3028
  children: [
3147
- n.title && /* @__PURE__ */ Y("h3", {
3029
+ a.title && /* @__PURE__ */ Y("h3", {
3148
3030
  className: "text-base font-semibold text-foreground",
3149
- children: E(n.title, r)
3031
+ children: n(a.title)
3150
3032
  }),
3151
- n.description && /* @__PURE__ */ Y("p", {
3033
+ a.description && /* @__PURE__ */ Y("p", {
3152
3034
  className: "mt-1 text-sm text-muted-foreground",
3153
- children: E(n.description, r)
3035
+ children: n(a.description)
3154
3036
  }),
3155
- n.intended_note && /* @__PURE__ */ Y("p", {
3037
+ a.intended_note && /* @__PURE__ */ Y("p", {
3156
3038
  className: "mt-1 text-xs text-muted-foreground",
3157
- children: E(n.intended_note, r)
3039
+ children: n(a.intended_note)
3158
3040
  })
3159
3041
  ]
3160
3042
  }), /* @__PURE__ */ X("div", {
3161
3043
  className: "flex flex-wrap items-center gap-2",
3162
3044
  children: [/* @__PURE__ */ Y("div", {
3163
3045
  role: "group",
3164
- "aria-label": "Scorecard window",
3046
+ "aria-label": n("record.scorecard.window", "Scorecard window"),
3165
3047
  className: "inline-flex rounded border border-border p-1",
3166
- children: n.windows.map((e) => /* @__PURE__ */ Y("button", {
3048
+ children: a.windows.map((e) => /* @__PURE__ */ Y("button", {
3167
3049
  type: "button",
3168
- "aria-pressed": s === e.code,
3169
- onClick: () => c(e.code),
3170
- className: `rounded px-3 py-1.5 text-xs font-medium ${s === e.code ? "bg-accent text-accent-foreground" : "text-muted-foreground"}`,
3171
- children: E(e.label, r) || e.code
3050
+ "aria-pressed": l === e.code,
3051
+ onClick: () => u(e.code),
3052
+ className: `rounded px-3 py-1.5 text-xs font-medium ${l === e.code ? "bg-accent text-accent-foreground" : "text-muted-foreground"}`,
3053
+ children: n(e.label) || e.code
3172
3054
  }, e.code))
3173
- }), p?.filter_field && /* @__PURE__ */ X("label", {
3055
+ }), h?.filter_field && /* @__PURE__ */ X("label", {
3174
3056
  className: "flex items-center gap-2 text-xs text-muted-foreground",
3175
- children: [E(p.filter_label, r) || "Filter", /* @__PURE__ */ X("select", {
3176
- "aria-label": E(p.filter_label, r) || "Filter",
3177
- value: l,
3178
- onChange: (e) => u(e.target.value),
3057
+ children: [T, /* @__PURE__ */ X("select", {
3058
+ "aria-label": T,
3059
+ value: d,
3060
+ onChange: (e) => f(e.target.value),
3179
3061
  className: "rounded border border-border bg-background px-2 py-1.5 text-foreground",
3180
3062
  children: [/* @__PURE__ */ Y("option", {
3181
3063
  value: "",
3182
- children: E(p.all_label, r) || "All"
3183
- }), v.map((e) => /* @__PURE__ */ Y("option", {
3064
+ children: n(h.all_label) || n("record.scorecard.all", "All")
3065
+ }), b.map((e) => /* @__PURE__ */ Y("option", {
3184
3066
  value: e,
3185
3067
  children: e
3186
3068
  }, e))]
@@ -3188,63 +3070,63 @@ function dn({ values: e, options: t }) {
3188
3070
  })]
3189
3071
  })]
3190
3072
  }),
3191
- C && /* @__PURE__ */ Y("div", {
3073
+ w && /* @__PURE__ */ Y("div", {
3192
3074
  role: "alert",
3193
3075
  className: "rounded border border-destructive p-3 text-sm text-destructive",
3194
- children: C instanceof Error ? C.message : "Scorecard data could not be loaded."
3076
+ children: U(r, w)
3195
3077
  }),
3196
- !C && !f.isLoading && !g && /* @__PURE__ */ Y("div", {
3078
+ !w && !m.isLoading && !v && /* @__PURE__ */ Y("div", {
3197
3079
  className: "rounded border border-border p-6 text-center text-sm text-muted-foreground",
3198
- children: E(n.empty_label, r) || "No scorecard data."
3080
+ children: n(a.empty_label) || n("record.scorecard.empty", "No scorecard data.")
3199
3081
  }),
3200
- g && /* @__PURE__ */ Y("div", {
3082
+ v && /* @__PURE__ */ Y("div", {
3201
3083
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
3202
- children: n.metrics.map((e) => {
3203
- let t = b(e), i = !!(n.drillthrough && e.drillthrough_value), a = /* @__PURE__ */ X(J, { children: [
3084
+ children: a.metrics.map((e) => {
3085
+ let t = S(e), r = !!(a.drillthrough && e.drillthrough_value), i = /* @__PURE__ */ X(J, { children: [
3204
3086
  /* @__PURE__ */ Y("span", {
3205
3087
  className: "text-xs font-medium text-muted-foreground",
3206
- children: E(e.label, r) || e.field
3088
+ children: n(e.label) || e.field
3207
3089
  }),
3208
3090
  /* @__PURE__ */ Y("strong", {
3209
3091
  className: `mt-2 block text-2xl font-semibold ${e.attention && Number(t) > 0 ? "text-destructive" : "text-foreground"}`,
3210
- children: cn(t, e.format, r)
3092
+ children: en(n, t, e.format)
3211
3093
  }),
3212
3094
  e.help && /* @__PURE__ */ Y("span", {
3213
3095
  className: "mt-1 block text-xs text-muted-foreground",
3214
- children: E(e.help, r)
3096
+ children: n(e.help)
3215
3097
  })
3216
3098
  ] });
3217
- return i ? /* @__PURE__ */ Y("button", {
3099
+ return r ? /* @__PURE__ */ Y("button", {
3218
3100
  type: "button",
3219
- onClick: () => S(e),
3101
+ onClick: () => C(e),
3220
3102
  className: "rounded border border-border bg-card p-3 text-left hover:bg-surface",
3221
- children: a
3103
+ children: i
3222
3104
  }, e.field) : /* @__PURE__ */ Y("article", {
3223
3105
  className: "rounded border border-border bg-card p-3",
3224
- children: a
3106
+ children: i
3225
3107
  }, e.field);
3226
3108
  })
3227
3109
  }),
3228
- p && /* @__PURE__ */ Y("div", {
3110
+ h && /* @__PURE__ */ Y("div", {
3229
3111
  className: "min-w-0 overflow-x-auto rounded border border-border",
3230
3112
  children: /* @__PURE__ */ X("table", {
3231
3113
  className: "w-full border-collapse text-sm",
3232
3114
  children: [/* @__PURE__ */ Y("thead", {
3233
3115
  className: "bg-surface text-left text-xs text-muted-foreground",
3234
- children: /* @__PURE__ */ Y("tr", { children: p.columns.map((e) => /* @__PURE__ */ Y("th", {
3116
+ children: /* @__PURE__ */ Y("tr", { children: h.columns.map((e) => /* @__PURE__ */ Y("th", {
3235
3117
  className: "border-b border-divider px-3 py-2 font-medium",
3236
- children: E(e.label, r) || e.field
3118
+ children: n(e.label) || e.field
3237
3119
  }, e.field)) })
3238
- }), /* @__PURE__ */ X("tbody", { children: [y.map((e, t) => /* @__PURE__ */ Y("tr", {
3120
+ }), /* @__PURE__ */ X("tbody", { children: [x.map((e, t) => /* @__PURE__ */ Y("tr", {
3239
3121
  className: "border-b border-divider last:border-0",
3240
- children: p.columns.map((t) => /* @__PURE__ */ Y("td", {
3122
+ children: h.columns.map((t) => /* @__PURE__ */ Y("td", {
3241
3123
  className: "px-3 py-2 text-foreground",
3242
- children: cn(e[t.field], t.format, r)
3124
+ children: en(n, e[t.field], t.format)
3243
3125
  }, t.field))
3244
- }, ln(e, t))), !h.isLoading && y.length === 0 && /* @__PURE__ */ Y("tr", { children: /* @__PURE__ */ Y("td", {
3245
- colSpan: Math.max(1, p.columns.length),
3126
+ }, tn(e, t))), !_.isLoading && x.length === 0 && /* @__PURE__ */ Y("tr", { children: /* @__PURE__ */ Y("td", {
3127
+ colSpan: Math.max(1, h.columns.length),
3246
3128
  className: "px-3 py-6 text-center text-muted-foreground",
3247
- children: E(p.empty_label, r) || "No breakdown rows."
3129
+ children: n(h.empty_label) || n("record.scorecard.breakdown_empty", "No breakdown rows.")
3248
3130
  }) })] })]
3249
3131
  })
3250
3132
  })
@@ -3253,21 +3135,25 @@ function dn({ values: e, options: t }) {
3253
3135
  }
3254
3136
  //#endregion
3255
3137
  //#region src/components/detail-layout/widgets/builtins.ts
3256
- var fn = !1;
3257
- function pn() {
3258
- fn ||= (B("json_diff", an), B("entity_scorecard", dn), !0);
3138
+ var an = !1;
3139
+ function on() {
3140
+ an ||= (R("json_diff", Xt), R("entity_scorecard", rn), !0);
3259
3141
  }
3260
3142
  //#endregion
3261
3143
  //#region src/components/detail-layout/widgets/WidgetHost.tsx
3262
- pn();
3263
- function mn({ config: e, ctx: t }) {
3264
- let n = H(e.type);
3265
- if (!n) return /* @__PURE__ */ Y("span", {
3144
+ on();
3145
+ function sn({ config: e, ctx: t }) {
3146
+ let n = A("errors"), r = z(e.type);
3147
+ if (!r) return /* @__PURE__ */ X("span", {
3266
3148
  className: "text-sm text-muted-foreground",
3267
- children: `unknown widget: ${e.type}`
3149
+ children: [
3150
+ n("record.widget_unknown", "This page names a widget this deployment does not have."),
3151
+ " ",
3152
+ /* @__PURE__ */ Y("code", { children: e.type })
3153
+ ]
3268
3154
  });
3269
- let r = e.inputs ?? {}, i = t.record, a = {};
3270
- for (let [e, t] of Object.entries(r)) a[e] = i[t];
3155
+ let i = e.inputs ?? {}, a = t.record, o = {};
3156
+ for (let [e, t] of Object.entries(i)) o[e] = a[t];
3271
3157
  return /* @__PURE__ */ Y("div", {
3272
3158
  style: {
3273
3159
  minWidth: 0,
@@ -3275,10 +3161,10 @@ function mn({ config: e, ctx: t }) {
3275
3161
  overflowX: "auto",
3276
3162
  WebkitOverflowScrolling: "touch"
3277
3163
  },
3278
- children: /* @__PURE__ */ Y(n, {
3279
- inputs: r,
3280
- values: a,
3281
- record: i,
3164
+ children: /* @__PURE__ */ Y(r, {
3165
+ inputs: i,
3166
+ values: o,
3167
+ record: a,
3282
3168
  options: e.options,
3283
3169
  ctx: t
3284
3170
  })
@@ -3286,45 +3172,45 @@ function mn({ config: e, ctx: t }) {
3286
3172
  }
3287
3173
  //#endregion
3288
3174
  //#region src/components/detail-layout/LayoutRenderer.tsx
3289
- function hn({ nodes: e, ctx: t }) {
3290
- return /* @__PURE__ */ Y(J, { children: e.map((e, n) => /* @__PURE__ */ Y(gn, {
3175
+ function cn({ nodes: e, ctx: t }) {
3176
+ return /* @__PURE__ */ Y(J, { children: e.map((e, n) => /* @__PURE__ */ Y(ln, {
3291
3177
  node: e,
3292
3178
  ctx: t
3293
3179
  }, n)) });
3294
3180
  }
3295
- function gn({ node: e, ctx: t }) {
3296
- return e.row ? /* @__PURE__ */ Y(we, {
3181
+ function ln({ node: e, ctx: t }) {
3182
+ return e.row ? /* @__PURE__ */ Y(Te, {
3297
3183
  config: e.row,
3298
3184
  ctx: t
3299
- }) : e.column ? /* @__PURE__ */ Y(De, {
3185
+ }) : e.column ? /* @__PURE__ */ Y(Oe, {
3300
3186
  config: e.column,
3301
3187
  node: e,
3302
3188
  ctx: t
3303
- }) : e.tabs ? /* @__PURE__ */ Y(je, {
3189
+ }) : e.tabs ? /* @__PURE__ */ Y(Me, {
3304
3190
  config: e.tabs,
3305
3191
  ctx: t
3306
- }) : e.section ? /* @__PURE__ */ Y(Me, {
3192
+ }) : e.section ? /* @__PURE__ */ Y(Ne, {
3307
3193
  config: e.section,
3308
3194
  ctx: t
3309
- }) : e.children ? /* @__PURE__ */ Y(kt, {
3195
+ }) : e.children ? /* @__PURE__ */ Y(At, {
3310
3196
  node: e,
3311
3197
  ctx: t
3312
- }) : e.associated ? /* @__PURE__ */ Y(V, {
3198
+ }) : e.associated ? /* @__PURE__ */ Y(j, {
3313
3199
  node: e,
3314
3200
  ctx: t
3315
- }) : e.fields ? /* @__PURE__ */ Y(zt, {
3201
+ }) : e.fields ? /* @__PURE__ */ Y(jt, {
3316
3202
  fields: e.fields,
3317
3203
  ctx: t
3318
- }) : e.properties == null ? e.statuses == null ? e.widget ? /* @__PURE__ */ Y(mn, {
3204
+ }) : e.properties == null ? e.statuses == null ? e.widget ? /* @__PURE__ */ Y(sn, {
3319
3205
  config: e.widget,
3320
3206
  ctx: t
3321
- }) : null : /* @__PURE__ */ Y(qt, {
3207
+ }) : null : /* @__PURE__ */ Y(zt, {
3322
3208
  node: e,
3323
3209
  ctx: t
3324
- }) : /* @__PURE__ */ Y(Ht, {
3210
+ }) : /* @__PURE__ */ Y(Pt, {
3325
3211
  node: e,
3326
3212
  ctx: t
3327
3213
  });
3328
3214
  }
3329
3215
  //#endregion
3330
- export { Gt as n, hn as t };
3216
+ export { Lt as n, cn as t };