@declarion/react 0.41.0 → 0.42.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.
@@ -1,20 +1,20 @@
1
1
  import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
2
- import { A as n, C as r, Cn as i, D as a, Dn as o, F as s, Fn as c, L as l, Mt as u, N as d, Q as f, Sn as p, Tn as m, Tt as h, Yn as g, Z as _, _ as v, _t as y, at as b, bn as x, cr as S, dn as C, et as w, ft as T, i as E, j as D, jt as ee, kn as O, mt as te, or as k, sr as ne, tr as re, tt as A, wn as ie, wt as ae, xn as oe, xt as j } from "./useCurrentScreen-D6LPBFOi.js";
3
- import { E as se, L as M, R as N, V as P, _ as F, b as ce, c as le, d as ue, f as de, m as fe, n as pe, o as me, r as he, t as ge, w as _e } from "./RefreshControl-Cxzbbj3F.js";
4
- import { E as ve, F as ye, G as be, I as xe, J as Se, K as Ce, M as we, O as Te, U as Ee, W as De, Y as Oe, _ as ke, a as Ae, i as je, it as Me, j as Ne, k as Pe, mt as Fe, q as Ie, s as Le, ut as Re, w as ze } from "./registry-DsZmw4hy.js";
5
- import { n as Be, r as Ve, t as He } from "./dataTableStyles-vwD1mVOP.js";
6
- import { n as Ue, t as We } from "./LayoutRenderer-Bxvllfdl.js";
7
- import { Fragment as Ge, useCallback as I, useEffect as Ke, useMemo as L, useRef as qe, useState as R } from "react";
8
- import { useLocation as Je, useParams as Ye, useSearchParams as Xe } from "react-router";
9
- import { useQuery as z, useQueryClient as B } from "@tanstack/react-query";
10
- import { Fragment as Ze, jsx as V, jsxs as H } from "react/jsx-runtime";
2
+ import { $ as n, A as r, At as i, C as a, Cn as o, Ct as s, D as c, En as l, F as u, Fn as d, In as f, L as p, N as m, On as h, Pn as g, Q as _, Sn as v, Xn as y, _ as b, bn as x, bt as S, cr as ee, dt as te, gt as C, i as w, it as ne, j as T, jt as re, lr as E, nr as ie, pt as ae, sr as oe, un as se, wn as D, wt as O, xn as ce, yn as le } from "./useCurrentScreen-CpQjVmrT.js";
3
+ import { E as ue, L as k, R as A, V as j, _ as M, b as de, c as fe, d as pe, f as me, m as he, n as ge, o as _e, r as ve, t as ye, w as be } from "./RefreshControl-DFh0-gCb.js";
4
+ import { E as xe, F as Se, G as Ce, I as we, J as Te, K as Ee, M as De, O as Oe, U as ke, W as Ae, Y as je, _ as Me, a as Ne, i as Pe, it as Fe, j as Ie, k as Le, mt as Re, q as ze, s as Be, ut as Ve, w as He } from "./registry-r4hiflwC.js";
5
+ import { n as Ue, r as We, t as Ge } from "./dataTableStyles-vwD1mVOP.js";
6
+ import { n as Ke, t as qe } from "./LayoutRenderer-DX8pFS5A.js";
7
+ import { Fragment as N, useCallback as P, useEffect as F, useMemo as I, useRef as Je, useState as L } from "react";
8
+ import { useLocation as Ye, useParams as Xe, useSearchParams as Ze } from "react-router";
9
+ import { useQuery as R, useQueryClient as z } from "@tanstack/react-query";
10
+ import { Fragment as Qe, jsx as B, jsxs as V } from "react/jsx-runtime";
11
11
  //#region src/components/shared/AssociationTabs.tsx
12
- function Qe({ entityCode: e, recordId: n, associations: r, schema: i }) {
13
- let a = L(() => Object.entries(r), [r]), [o, s] = R(0);
12
+ function $e({ entityCode: e, recordId: n, associations: r, schema: i }) {
13
+ let a = I(() => Object.entries(r), [r]), [o, s] = L(0);
14
14
  if (a.length === 0) return null;
15
15
  let [c, l] = a[o];
16
- return /* @__PURE__ */ V(Fe, {
17
- title: /* @__PURE__ */ V("div", {
16
+ return /* @__PURE__ */ B(Re, {
17
+ title: /* @__PURE__ */ B("div", {
18
18
  style: {
19
19
  display: "flex",
20
20
  alignItems: "center",
@@ -25,7 +25,7 @@ function Qe({ entityCode: e, recordId: n, associations: r, schema: i }) {
25
25
  },
26
26
  children: a.map(([e, n], r) => {
27
27
  let i = r === o;
28
- return /* @__PURE__ */ H("button", {
28
+ return /* @__PURE__ */ V("button", {
29
29
  onClick: (e) => {
30
30
  e.stopPropagation(), s(r);
31
31
  },
@@ -43,16 +43,16 @@ function Qe({ entityCode: e, recordId: n, associations: r, schema: i }) {
43
43
  cursor: "pointer",
44
44
  fontWeight: i ? 600 : 500
45
45
  },
46
- children: [n.display?.icon && /* @__PURE__ */ V(t, {
46
+ children: [n.display?.icon && /* @__PURE__ */ B(t, {
47
47
  name: n.display.icon,
48
48
  size: 13
49
- }), m(n.display?.name) || e]
49
+ }), D(n.display?.name) || e]
50
50
  }, e);
51
51
  })
52
52
  }),
53
53
  collapsible: !1,
54
54
  padding: "0",
55
- children: /* @__PURE__ */ V($e, {
55
+ children: /* @__PURE__ */ B(et, {
56
56
  entityCode: e,
57
57
  recordId: n,
58
58
  assocKey: c,
@@ -61,111 +61,111 @@ function Qe({ entityCode: e, recordId: n, associations: r, schema: i }) {
61
61
  })
62
62
  });
63
63
  }
64
- function $e({ entityCode: t, recordId: i, assocKey: a, association: o, schema: s }) {
65
- let c = Me(), l = n(), u = `${t}.${a}`, { data: d, isLoading: f } = z({
64
+ function et({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c }) {
65
+ let l = Fe(), u = r(), d = `${t}.${i}`, { data: f, isLoading: p } = R({
66
66
  queryKey: [
67
67
  "association",
68
- u,
69
- i
68
+ d,
69
+ n
70
70
  ],
71
- queryFn: () => h(u, [i])
72
- }), g = d?.target_entity ?? o.target, _ = s.entities[g], v = L(() => d?.ids ?? [], [d?.ids]), y = L(() => _?.fields.names().find((e) => _.fields.get(e)?.primary) ?? "id", [_]), b = L(() => v.slice(0, 50), [v]), { data: x, isLoading: C } = z({
71
+ queryFn: () => O(d, [n])
72
+ }), m = f?.target_entity ?? o.target, h = c.entities[m], g = I(() => f?.ids ?? [], [f?.ids]), _ = I(() => h?.fields.names().find((e) => h.fields.get(e)?.primary) ?? "id", [h]), v = I(() => g.slice(0, 50), [g]), { data: y, isLoading: b } = R({
73
73
  queryKey: [
74
74
  "association-records",
75
- g,
76
- b
75
+ m,
76
+ v
77
77
  ],
78
- queryFn: () => ae(g, {
78
+ queryFn: () => s(m, {
79
79
  per_page: 50,
80
80
  filters: [{
81
- field: y,
81
+ field: _,
82
82
  op: "in",
83
- value: b
83
+ value: v
84
84
  }]
85
85
  }),
86
- enabled: b.length > 0 && !!_
87
- }), w = x?.data ?? [], T = x?.$refs, E = L(() => _ ? _.fields.names().filter((e) => {
88
- let t = _.fields.get(e);
86
+ enabled: v.length > 0 && !!h
87
+ }), x = y?.data ?? [], S = y?.$refs, ee = I(() => h ? h.fields.names().filter((e) => {
88
+ let t = h.fields.get(e);
89
89
  return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
90
- }).slice(0, 6) : [], [_]), ee = () => {
91
- let e = r(s, g);
90
+ }).slice(0, 6) : [], [h]), te = () => {
91
+ let e = a(c, m);
92
92
  if (!e) return;
93
- let t = m(o.display?.name) || a, n = new URLSearchParams();
93
+ let t = D(o.display?.name) || i, n = new URLSearchParams();
94
94
  n.set("filters", JSON.stringify([{
95
- field: y,
95
+ field: _,
96
96
  op: "in",
97
- value: v
98
- }])), c(e.route, {
97
+ value: g
98
+ }])), l(e.route, {
99
99
  title: t,
100
100
  icon: o.display?.icon || e.icon,
101
101
  search: n.toString()
102
102
  });
103
- }, O = {
103
+ }, C = {
104
104
  fontSize: 12.5,
105
105
  color: "var(--text-3)",
106
106
  padding: "14px 16px"
107
107
  };
108
- if (f || C) return /* @__PURE__ */ V("div", {
109
- style: O,
108
+ if (p || b) return /* @__PURE__ */ B("div", {
109
+ style: C,
110
110
  children: "Loading…"
111
111
  });
112
- if (!_) return /* @__PURE__ */ V("div", {
113
- style: O,
112
+ if (!h) return /* @__PURE__ */ B("div", {
113
+ style: C,
114
114
  children: "Entity not found."
115
115
  });
116
- if (v.length === 0) return /* @__PURE__ */ V("div", {
117
- style: O,
116
+ if (g.length === 0) return /* @__PURE__ */ B("div", {
117
+ style: C,
118
118
  children: "No related records."
119
119
  });
120
- let te = r(s, g);
121
- return /* @__PURE__ */ H("div", {
120
+ let w = a(c, m);
121
+ return /* @__PURE__ */ V("div", {
122
122
  style: { padding: "8px 0" },
123
123
  children: [
124
- /* @__PURE__ */ H("table", {
125
- style: Ve,
126
- children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ V("tr", { children: E.map((e) => /* @__PURE__ */ V("th", {
127
- style: Be,
128
- children: p(_.fields.get(e), e, s.entities)
129
- }, e)) }) }), /* @__PURE__ */ V("tbody", { children: w.map((e, t) => /* @__PURE__ */ V("tr", { children: E.map((t) => {
130
- let n = _.fields.get(t);
131
- return n ? /* @__PURE__ */ V("td", {
132
- style: He,
133
- children: D({
124
+ /* @__PURE__ */ V("table", {
125
+ style: We,
126
+ children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: ee.map((e) => /* @__PURE__ */ B("th", {
127
+ style: Ue,
128
+ children: ce(h.fields.get(e), e, c.entities)
129
+ }, e)) }) }), /* @__PURE__ */ B("tbody", { children: x.map((e, t) => /* @__PURE__ */ B("tr", { children: ee.map((t) => {
130
+ let n = h.fields.get(t);
131
+ return n ? /* @__PURE__ */ B("td", {
132
+ style: Ge,
133
+ children: T({
134
134
  field: n,
135
135
  fieldName: t,
136
136
  value: e[t],
137
137
  mode: "display",
138
138
  record: e,
139
- refs: T,
140
- locale: l
139
+ refs: S,
140
+ locale: u
141
141
  })
142
- }, t) : /* @__PURE__ */ V("td", {}, t);
142
+ }, t) : /* @__PURE__ */ B("td", {}, t);
143
143
  }) }, t)) })]
144
144
  }),
145
- te && d && d.count > w.length && /* @__PURE__ */ V("div", {
145
+ w && f && f.count > x.length && /* @__PURE__ */ B("div", {
146
146
  style: {
147
147
  padding: "10px 16px",
148
148
  textAlign: "center"
149
149
  },
150
- children: /* @__PURE__ */ H(S, {
151
- icon: /* @__PURE__ */ V(e.external, { size: 12 }),
152
- onClick: ee,
150
+ children: /* @__PURE__ */ V(E, {
151
+ icon: /* @__PURE__ */ B(e.external, { size: 12 }),
152
+ onClick: te,
153
153
  children: [
154
154
  "View all ",
155
- d.count,
155
+ f.count,
156
156
  " records"
157
157
  ]
158
158
  })
159
159
  }),
160
- te && w.length > 0 && d && d.count <= w.length && /* @__PURE__ */ V("div", {
160
+ w && x.length > 0 && f && f.count <= x.length && /* @__PURE__ */ B("div", {
161
161
  style: {
162
162
  padding: "10px 16px",
163
163
  textAlign: "center"
164
164
  },
165
- children: /* @__PURE__ */ V(S, {
165
+ children: /* @__PURE__ */ B(E, {
166
166
  kind: "ghost",
167
- icon: /* @__PURE__ */ V(e.external, { size: 12 }),
168
- onClick: ee,
167
+ icon: /* @__PURE__ */ B(e.external, { size: 12 }),
168
+ onClick: te,
169
169
  children: "Open in list view"
170
170
  })
171
171
  })
@@ -174,47 +174,47 @@ function $e({ entityCode: t, recordId: i, assocKey: a, association: o, schema: s
174
174
  }
175
175
  //#endregion
176
176
  //#region src/components/pages/RecordDocumentsPanel.tsx
177
- var U = 4e3;
178
- function et(e) {
179
- return e?.some((e) => e.status === "pending") ? U : !1;
177
+ var H = 4e3;
178
+ function U(e) {
179
+ return e?.some((e) => e.status === "pending") ? H : !1;
180
180
  }
181
181
  function tt({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
182
- let { data: a, isLoading: o, error: s } = z({
182
+ let { data: a, isLoading: o, error: s } = R({
183
183
  queryKey: [
184
- F,
184
+ M,
185
185
  t,
186
186
  n
187
187
  ],
188
- queryFn: async () => (await j("document.object_links", {
188
+ queryFn: async () => (await S("document.object_links", {
189
189
  entity: t,
190
190
  object_id: n
191
191
  })).result?.documents ?? [],
192
192
  enabled: !!(t && n) && (!!r || !!i),
193
- refetchInterval: (e) => et(e.state.data)
193
+ refetchInterval: (e) => U(e.state.data)
194
194
  }), c = (a?.length ?? 0) > 0;
195
- return !r && !c ? null : /* @__PURE__ */ H(Fe, {
196
- title: /* @__PURE__ */ V(W, {}),
195
+ return !r && !c ? null : /* @__PURE__ */ V(Re, {
196
+ title: /* @__PURE__ */ B(W, {}),
197
197
  collapsible: !1,
198
198
  padding: "0",
199
199
  children: [
200
- o && /* @__PURE__ */ V(G, {
201
- icon: /* @__PURE__ */ V(e.loader, { size: 14 }),
200
+ o && /* @__PURE__ */ B(G, {
201
+ icon: /* @__PURE__ */ B(e.loader, { size: 14 }),
202
202
  text: "Loading documents..."
203
203
  }),
204
- s && /* @__PURE__ */ V(G, {
205
- icon: /* @__PURE__ */ V(e.warning, { size: 14 }),
204
+ s && /* @__PURE__ */ B(G, {
205
+ icon: /* @__PURE__ */ B(e.warning, { size: 14 }),
206
206
  text: s instanceof Error ? s.message : String(s)
207
207
  }),
208
- !o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ V(G, {
209
- icon: /* @__PURE__ */ V(e.file, { size: 14 }),
208
+ !o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ B(G, {
209
+ icon: /* @__PURE__ */ B(e.file, { size: 14 }),
210
210
  text: "No generated documents"
211
211
  }),
212
- !o && !s && a && a.length > 0 && /* @__PURE__ */ V("div", {
212
+ !o && !s && a && a.length > 0 && /* @__PURE__ */ B("div", {
213
213
  style: {
214
214
  display: "flex",
215
215
  flexDirection: "column"
216
216
  },
217
- children: a.map((e) => /* @__PURE__ */ V(nt, {
217
+ children: a.map((e) => /* @__PURE__ */ B(nt, {
218
218
  entityCode: t,
219
219
  objectId: n,
220
220
  doc: e
@@ -224,7 +224,7 @@ function tt({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
224
224
  });
225
225
  }
226
226
  function W() {
227
- return /* @__PURE__ */ H("div", {
227
+ return /* @__PURE__ */ V("div", {
228
228
  style: {
229
229
  display: "flex",
230
230
  alignItems: "center",
@@ -235,57 +235,57 @@ function W() {
235
235
  fontWeight: 600,
236
236
  color: "var(--text)"
237
237
  },
238
- children: [/* @__PURE__ */ V(e.file, { size: 13 }), "Documents"]
238
+ children: [/* @__PURE__ */ B(e.file, { size: 13 }), "Documents"]
239
239
  });
240
240
  }
241
- function nt({ entityCode: t, objectId: n, doc: r }) {
242
- let i = B(), [a, o] = R(!1), [s, c] = R(!1), [l, u] = R(!1), [d, f] = R(!1), [p, h] = R(null), g = m(r.title) || r.filename || r.template_code, _ = r.status === "ready" && r.download_url && !d;
243
- async function v() {
244
- o(!0), h(null);
241
+ function nt({ entityCode: t, objectId: r, doc: i }) {
242
+ let a = z(), [o, s] = L(!1), [c, l] = L(!1), [u, d] = L(!1), [f, p] = L(!1), [m, h] = L(null), g = D(i.title) || i.filename || i.template_code, v = i.status === "ready" && i.download_url && !f;
243
+ async function y() {
244
+ s(!0), h(null);
245
245
  try {
246
- let e = (await j("document.download_format", {
247
- generated_document_id: r.generated_document_id,
246
+ let e = (await S("document.download_format", {
247
+ generated_document_id: i.generated_document_id,
248
248
  format: "pdf"
249
249
  })).result;
250
- e?.download_url && await w(e.download_url, e.filename);
250
+ e?.download_url && await _(e.download_url, e.filename);
251
251
  } catch (e) {
252
- A(e) ? (f(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
252
+ n(e) ? (p(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
253
253
  } finally {
254
- o(!1);
254
+ s(!1);
255
255
  }
256
256
  }
257
- async function y() {
258
- if (r.download_url) {
259
- c(!0), h(null);
257
+ async function b() {
258
+ if (i.download_url) {
259
+ l(!0), h(null);
260
260
  try {
261
- await w(r.download_url, r.filename);
261
+ await _(i.download_url, i.filename);
262
262
  } catch (e) {
263
- A(e) ? (f(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
263
+ n(e) ? (p(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
264
264
  } finally {
265
- c(!1);
265
+ l(!1);
266
266
  }
267
267
  }
268
268
  }
269
- async function b() {
270
- u(!0), h(null);
269
+ async function x() {
270
+ d(!0), h(null);
271
271
  try {
272
- await j("document.generate", {
273
- ...r.input ?? {},
274
- template_code: r.template_code,
275
- template_source: r.template_source,
276
- output_format: r.output_format
277
- }), await i.invalidateQueries({ queryKey: [
278
- F,
272
+ await S("document.generate", {
273
+ ...i.input ?? {},
274
+ template_code: i.template_code,
275
+ template_source: i.template_source,
276
+ output_format: i.output_format
277
+ }), await a.invalidateQueries({ queryKey: [
278
+ M,
279
279
  t,
280
- n
280
+ r
281
281
  ] });
282
282
  } catch (e) {
283
283
  h(e instanceof Error ? e.message : String(e));
284
284
  } finally {
285
- u(!1);
285
+ d(!1);
286
286
  }
287
287
  }
288
- return /* @__PURE__ */ H("div", {
288
+ return /* @__PURE__ */ V("div", {
289
289
  style: {
290
290
  display: "grid",
291
291
  gridTemplateColumns: "minmax(0, 1fr) auto",
@@ -294,10 +294,10 @@ function nt({ entityCode: t, objectId: n, doc: r }) {
294
294
  padding: "11px 14px",
295
295
  borderTop: "1px solid var(--divider)"
296
296
  },
297
- children: [/* @__PURE__ */ H("div", {
297
+ children: [/* @__PURE__ */ V("div", {
298
298
  style: { minWidth: 0 },
299
299
  children: [
300
- /* @__PURE__ */ V("div", {
300
+ /* @__PURE__ */ B("div", {
301
301
  style: {
302
302
  fontSize: 13,
303
303
  fontWeight: 600,
@@ -308,7 +308,7 @@ function nt({ entityCode: t, objectId: n, doc: r }) {
308
308
  },
309
309
  children: g
310
310
  }),
311
- /* @__PURE__ */ H("div", {
311
+ /* @__PURE__ */ V("div", {
312
312
  style: {
313
313
  marginTop: 3,
314
314
  display: "flex",
@@ -318,65 +318,65 @@ function nt({ entityCode: t, objectId: n, doc: r }) {
318
318
  fontSize: 11.5
319
319
  },
320
320
  children: [
321
- /* @__PURE__ */ V("span", { children: r.output_format.toUpperCase() }),
322
- /* @__PURE__ */ V("span", { children: d ? "artifact unavailable" : r.status }),
323
- /* @__PURE__ */ V("span", { children: r.ready_at || r.created_at })
321
+ /* @__PURE__ */ B("span", { children: i.output_format.toUpperCase() }),
322
+ /* @__PURE__ */ B("span", { children: f ? "artifact unavailable" : i.status }),
323
+ /* @__PURE__ */ B("span", { children: i.ready_at || i.created_at })
324
324
  ]
325
325
  }),
326
- r.status === "failed" && r.error_text && /* @__PURE__ */ V("div", {
326
+ i.status === "failed" && i.error_text && /* @__PURE__ */ B("div", {
327
327
  style: {
328
328
  marginTop: 5,
329
329
  color: "var(--danger)",
330
330
  fontSize: 12
331
331
  },
332
- children: r.error_text
332
+ children: i.error_text
333
333
  }),
334
- p && /* @__PURE__ */ V("div", {
334
+ m && /* @__PURE__ */ B("div", {
335
335
  style: {
336
336
  marginTop: 5,
337
337
  color: "var(--danger)",
338
338
  fontSize: 12
339
339
  },
340
- children: p
340
+ children: m
341
341
  })
342
342
  ]
343
- }), _ ? /* @__PURE__ */ H("div", {
343
+ }), v ? /* @__PURE__ */ V("div", {
344
344
  style: {
345
345
  display: "flex",
346
346
  gap: 6
347
347
  },
348
- children: [/* @__PURE__ */ V(S, {
348
+ children: [/* @__PURE__ */ B(E, {
349
349
  kind: "ghost",
350
350
  size: "sm",
351
- icon: V(a ? e.loader : e.file, { size: 12 }),
352
- onClick: v,
353
- disabled: a,
351
+ icon: B(o ? e.loader : e.file, { size: 12 }),
352
+ onClick: y,
353
+ disabled: o,
354
354
  children: "PDF"
355
- }), /* @__PURE__ */ V(S, {
355
+ }), /* @__PURE__ */ B(E, {
356
356
  kind: "default",
357
357
  size: "sm",
358
- icon: V(s ? e.loader : e.download, { size: 12 }),
359
- onClick: y,
360
- disabled: s,
358
+ icon: B(c ? e.loader : e.download, { size: 12 }),
359
+ onClick: b,
360
+ disabled: c,
361
361
  children: "Download"
362
362
  })]
363
- }) : d ? /* @__PURE__ */ V(S, {
363
+ }) : f ? /* @__PURE__ */ B(E, {
364
364
  kind: "ghost",
365
365
  size: "sm",
366
- icon: V(l ? e.loader : e.file, { size: 12 }),
367
- onClick: b,
368
- disabled: l,
366
+ icon: B(u ? e.loader : e.file, { size: 12 }),
367
+ onClick: x,
368
+ disabled: u,
369
369
  children: "Regenerate"
370
- }) : /* @__PURE__ */ V(S, {
370
+ }) : /* @__PURE__ */ B(E, {
371
371
  kind: "ghost",
372
372
  size: "sm",
373
373
  disabled: !0,
374
- children: r.status === "pending" ? "Pending" : "Unavailable"
374
+ children: i.status === "pending" ? "Pending" : "Unavailable"
375
375
  })]
376
376
  });
377
377
  }
378
378
  function G({ icon: e, text: t }) {
379
- return /* @__PURE__ */ H("div", {
379
+ return /* @__PURE__ */ V("div", {
380
380
  style: {
381
381
  display: "flex",
382
382
  alignItems: "center",
@@ -393,7 +393,7 @@ function G({ icon: e, text: t }) {
393
393
  function rt({ errors: t, onJump: n }) {
394
394
  if (t.length === 0) return null;
395
395
  let r = t.length !== 1;
396
- return /* @__PURE__ */ H("div", {
396
+ return /* @__PURE__ */ V("div", {
397
397
  role: "alert",
398
398
  style: {
399
399
  display: "flex",
@@ -405,19 +405,19 @@ function rt({ errors: t, onJump: n }) {
405
405
  border: "1px solid var(--danger-border)",
406
406
  color: "var(--text)"
407
407
  },
408
- children: [/* @__PURE__ */ V("span", {
408
+ children: [/* @__PURE__ */ B("span", {
409
409
  style: {
410
410
  color: "var(--danger)",
411
411
  marginTop: 1,
412
412
  display: "flex"
413
413
  },
414
- children: /* @__PURE__ */ V(e.warning, { size: 14 })
415
- }), /* @__PURE__ */ H("div", {
414
+ children: /* @__PURE__ */ B(e.warning, { size: 14 })
415
+ }), /* @__PURE__ */ V("div", {
416
416
  style: {
417
417
  flex: 1,
418
418
  minWidth: 0
419
419
  },
420
- children: [/* @__PURE__ */ H("div", {
420
+ children: [/* @__PURE__ */ V("div", {
421
421
  style: {
422
422
  fontSize: 12.5,
423
423
  fontWeight: 600,
@@ -429,7 +429,7 @@ function rt({ errors: t, onJump: n }) {
429
429
  r ? "fields need" : "field needs",
430
430
  " attention"
431
431
  ]
432
- }), /* @__PURE__ */ V("ul", {
432
+ }), /* @__PURE__ */ B("ul", {
433
433
  style: {
434
434
  margin: 0,
435
435
  padding: 0,
@@ -438,7 +438,7 @@ function rt({ errors: t, onJump: n }) {
438
438
  flexDirection: "column",
439
439
  gap: 2
440
440
  },
441
- children: t.map((e) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H("button", {
441
+ children: t.map((e) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ V("button", {
442
442
  type: "button",
443
443
  onClick: n ? () => n(e.name) : void 0,
444
444
  style: {
@@ -451,21 +451,21 @@ function rt({ errors: t, onJump: n }) {
451
451
  fontFamily: "inherit"
452
452
  },
453
453
  children: [
454
- /* @__PURE__ */ V("span", {
454
+ /* @__PURE__ */ B("span", {
455
455
  style: {
456
456
  color: "var(--danger)",
457
457
  marginRight: 6
458
458
  },
459
459
  children: "•"
460
460
  }),
461
- /* @__PURE__ */ V("span", {
461
+ /* @__PURE__ */ B("span", {
462
462
  style: {
463
463
  fontWeight: 500,
464
464
  color: "var(--text-2)"
465
465
  },
466
466
  children: e.label
467
467
  }),
468
- /* @__PURE__ */ H("span", {
468
+ /* @__PURE__ */ V("span", {
469
469
  style: { color: "var(--text-3)" },
470
470
  children: [" - ", e.message]
471
471
  })
@@ -478,7 +478,7 @@ function rt({ errors: t, onJump: n }) {
478
478
  //#endregion
479
479
  //#region src/components/shared/HighlightsStrip.tsx
480
480
  function K({ items: e }) {
481
- return e.length === 0 ? null : /* @__PURE__ */ V("div", {
481
+ return e.length === 0 ? null : /* @__PURE__ */ B("div", {
482
482
  style: {
483
483
  display: "flex",
484
484
  alignItems: "center",
@@ -486,25 +486,25 @@ function K({ items: e }) {
486
486
  gap: "6px 0",
487
487
  fontSize: 12
488
488
  },
489
- children: e.map((e, t) => /* @__PURE__ */ H(Ge, { children: [t > 0 && /* @__PURE__ */ V("span", { style: {
489
+ children: e.map((e, t) => /* @__PURE__ */ V(N, { children: [t > 0 && /* @__PURE__ */ B("span", { style: {
490
490
  width: 1,
491
491
  height: 12,
492
492
  background: "var(--divider)",
493
493
  marginInline: 12
494
- } }), /* @__PURE__ */ H("span", {
494
+ } }), /* @__PURE__ */ V("span", {
495
495
  style: {
496
496
  display: "inline-flex",
497
497
  alignItems: "center",
498
498
  gap: 6,
499
499
  lineHeight: 1.3
500
500
  },
501
- children: [/* @__PURE__ */ V("span", {
501
+ children: [/* @__PURE__ */ B("span", {
502
502
  style: {
503
503
  color: "var(--text-3)",
504
504
  fontSize: 11.5
505
505
  },
506
506
  children: e.label
507
- }), /* @__PURE__ */ V("span", {
507
+ }), /* @__PURE__ */ B("span", {
508
508
  style: { color: "var(--text)" },
509
509
  children: e.value
510
510
  })]
@@ -522,12 +522,12 @@ function it({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
522
522
  if (c) {
523
523
  let t = a?.find((t) => t.group_code === e), n = t ? c.statuses.find((e) => e.code === t.status_code) : void 0;
524
524
  l.push({
525
- label: m(c.name),
526
- value: n ? /* @__PURE__ */ V(k, {
525
+ label: D(c.name),
526
+ value: n ? /* @__PURE__ */ B(oe, {
527
527
  tone: n.color ?? "slate",
528
528
  size: "xs",
529
- children: m(n.name)
530
- }) : /* @__PURE__ */ V("span", {
529
+ children: D(n.name)
530
+ }) : /* @__PURE__ */ B("span", {
531
531
  style: { color: "var(--text-4)" },
532
532
  children: "—"
533
533
  })
@@ -535,7 +535,7 @@ function it({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
535
535
  continue;
536
536
  }
537
537
  if (t.fields.get(e) || t.files?.get(e)) {
538
- let a = Ie({
538
+ let a = ze({
539
539
  entity: t,
540
540
  entityCode: n,
541
541
  fieldName: e,
@@ -548,13 +548,13 @@ function it({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
548
548
  locale: s
549
549
  });
550
550
  l.push({
551
- label: Se(t, e, o.entities),
551
+ label: Te(t, e, o.entities),
552
552
  value: a
553
553
  });
554
554
  continue;
555
555
  }
556
556
  }
557
- return l.length === 0 ? null : /* @__PURE__ */ V(K, { items: l });
557
+ return l.length === 0 ? null : /* @__PURE__ */ B(K, { items: l });
558
558
  }
559
559
  //#endregion
560
560
  //#region src/components/shared/AuditMetaStrip.tsx
@@ -563,7 +563,7 @@ function at(e) {
563
563
  }
564
564
  function ot({ lines: e }) {
565
565
  let t = e.filter(at);
566
- return t.length === 0 ? null : /* @__PURE__ */ V("div", {
566
+ return t.length === 0 ? null : /* @__PURE__ */ B("div", {
567
567
  style: {
568
568
  display: "flex",
569
569
  flexWrap: "wrap",
@@ -575,18 +575,18 @@ function ot({ lines: e }) {
575
575
  fontSize: 11.5,
576
576
  color: "var(--text-3)"
577
577
  },
578
- children: t.map((e, t) => /* @__PURE__ */ V(st, { line: e }, t))
578
+ children: t.map((e, t) => /* @__PURE__ */ B(st, { line: e }, t))
579
579
  });
580
580
  }
581
581
  function st({ line: e }) {
582
- return /* @__PURE__ */ H("div", {
582
+ return /* @__PURE__ */ V("div", {
583
583
  style: {
584
584
  display: "flex",
585
585
  alignItems: "center",
586
586
  gap: 8,
587
587
  minWidth: 0
588
588
  },
589
- children: [/* @__PURE__ */ V("span", {
589
+ children: [/* @__PURE__ */ B("span", {
590
590
  style: {
591
591
  fontSize: 11,
592
592
  fontWeight: 600,
@@ -594,7 +594,7 @@ function st({ line: e }) {
594
594
  flexShrink: 0
595
595
  },
596
596
  children: e.label
597
- }), /* @__PURE__ */ H("span", {
597
+ }), /* @__PURE__ */ V("span", {
598
598
  style: {
599
599
  display: "inline-flex",
600
600
  alignItems: "center",
@@ -602,15 +602,15 @@ function st({ line: e }) {
602
602
  minWidth: 0
603
603
  },
604
604
  children: [
605
- e.by != null && /* @__PURE__ */ V("span", {
605
+ e.by != null && /* @__PURE__ */ B("span", {
606
606
  style: { color: "var(--text-2)" },
607
607
  children: e.by
608
608
  }),
609
- e.by != null && e.at != null && /* @__PURE__ */ V("span", {
609
+ e.by != null && e.at != null && /* @__PURE__ */ B("span", {
610
610
  style: { color: "var(--text-4)" },
611
611
  children: "·"
612
612
  }),
613
- e.at != null && /* @__PURE__ */ V("span", {
613
+ e.at != null && /* @__PURE__ */ B("span", {
614
614
  className: "num",
615
615
  children: e.at
616
616
  })
@@ -626,7 +626,7 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
626
626
  let c = (e) => {
627
627
  if (!e || !t.fields.get(e)) return;
628
628
  let s = r[e];
629
- if (!(s == null || s === "")) return Ie({
629
+ if (!(s == null || s === "")) return ze({
630
630
  entity: t,
631
631
  entityCode: n,
632
632
  fieldName: e,
@@ -639,8 +639,8 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
639
639
  locale: o
640
640
  });
641
641
  };
642
- return /* @__PURE__ */ V(ot, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
643
- label: m(e.label),
642
+ return /* @__PURE__ */ B(ot, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
643
+ label: D(e.label),
644
644
  at: c(e.at),
645
645
  by: c(e.by)
646
646
  })) : [{
@@ -662,13 +662,13 @@ function q(e) {
662
662
  }
663
663
  function lt({ evidence: e }) {
664
664
  let t = e?.verdict ?? "unverified", n = q(e?.verified_at), r = [];
665
- return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */ H("div", {
665
+ return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */ V("div", {
666
666
  style: {
667
667
  display: "flex",
668
668
  flexDirection: "column",
669
669
  gap: 6
670
670
  },
671
- children: [/* @__PURE__ */ H("div", {
671
+ children: [/* @__PURE__ */ V("div", {
672
672
  style: {
673
673
  display: "flex",
674
674
  alignItems: "center",
@@ -676,7 +676,7 @@ function lt({ evidence: e }) {
676
676
  flexWrap: "wrap"
677
677
  },
678
678
  children: [
679
- /* @__PURE__ */ V("span", {
679
+ /* @__PURE__ */ B("span", {
680
680
  style: {
681
681
  fontSize: 12,
682
682
  fontWeight: 600,
@@ -684,13 +684,13 @@ function lt({ evidence: e }) {
684
684
  },
685
685
  children: "Evidence"
686
686
  }),
687
- /* @__PURE__ */ V(k, {
688
- tone: he(t),
687
+ /* @__PURE__ */ B(oe, {
688
+ tone: ve(t),
689
689
  size: "sm",
690
690
  dot: !0,
691
- children: pe(t)
691
+ children: ge(t)
692
692
  }),
693
- r.length > 0 && /* @__PURE__ */ V("span", {
693
+ r.length > 0 && /* @__PURE__ */ B("span", {
694
694
  style: {
695
695
  fontSize: 12,
696
696
  color: "var(--muted-foreground)"
@@ -698,7 +698,7 @@ function lt({ evidence: e }) {
698
698
  children: r.join(" · ")
699
699
  })
700
700
  ]
701
- }), e?.reason && /* @__PURE__ */ V("span", {
701
+ }), e?.reason && /* @__PURE__ */ B("span", {
702
702
  style: {
703
703
  fontSize: 12,
704
704
  color: "var(--destructive)"
@@ -710,8 +710,8 @@ function lt({ evidence: e }) {
710
710
  //#endregion
711
711
  //#region src/components/shared/RecordHeader.tsx
712
712
  function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, highlights: o, mode: s, dirty: c = !1, showBack: l = !1, onBack: u, right: d, identityControls: f, showTitle: p = !0 }) {
713
- let m = re(), h = m.category === "phone" || m.width <= 520;
714
- return /* @__PURE__ */ H("div", {
713
+ let m = ie(), h = m.category === "phone" || m.width <= 520;
714
+ return /* @__PURE__ */ V("div", {
715
715
  style: {
716
716
  display: "flex",
717
717
  alignItems: "flex-start",
@@ -720,27 +720,27 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
720
720
  minWidth: 0
721
721
  },
722
722
  children: [
723
- p && l && /* @__PURE__ */ V("div", {
723
+ p && l && /* @__PURE__ */ B("div", {
724
724
  style: {
725
725
  paddingTop: 4,
726
726
  flexShrink: 0
727
727
  },
728
- children: /* @__PURE__ */ V(ne, {
728
+ children: /* @__PURE__ */ B(ee, {
729
729
  size: 26,
730
- icon: /* @__PURE__ */ V(e.back, { size: 14 }),
730
+ icon: /* @__PURE__ */ B(e.back, { size: 14 }),
731
731
  title: "Back",
732
732
  onClick: u
733
733
  })
734
734
  }),
735
- p && (n || t) && /* @__PURE__ */ V("div", {
735
+ p && (n || t) && /* @__PURE__ */ B("div", {
736
736
  style: {
737
737
  flexShrink: 0,
738
738
  paddingTop: 2
739
739
  },
740
- children: n ? /* @__PURE__ */ V(P, {
740
+ children: n ? /* @__PURE__ */ B(j, {
741
741
  name: n,
742
742
  size: 32
743
- }) : /* @__PURE__ */ V("span", {
743
+ }) : /* @__PURE__ */ B("span", {
744
744
  style: {
745
745
  width: 32,
746
746
  height: 32,
@@ -754,12 +754,12 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
754
754
  children: t
755
755
  })
756
756
  }),
757
- p && /* @__PURE__ */ H("div", {
757
+ p && /* @__PURE__ */ V("div", {
758
758
  style: {
759
759
  flex: "1 1 0",
760
760
  minWidth: 0
761
761
  },
762
- children: [/* @__PURE__ */ H("div", {
762
+ children: [/* @__PURE__ */ V("div", {
763
763
  style: {
764
764
  display: "flex",
765
765
  alignItems: "center",
@@ -767,7 +767,7 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
767
767
  flexWrap: "wrap"
768
768
  },
769
769
  children: [
770
- /* @__PURE__ */ V("h1", {
770
+ /* @__PURE__ */ B("h1", {
771
771
  style: {
772
772
  margin: 0,
773
773
  fontSize: "var(--page-title-size, var(--page-title-size-detail))",
@@ -784,13 +784,13 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
784
784
  },
785
785
  children: r
786
786
  }),
787
- i && /* @__PURE__ */ V(M, { value: i }),
788
- a && /* @__PURE__ */ V(N, {
787
+ i && /* @__PURE__ */ B(k, { value: i }),
788
+ a && /* @__PURE__ */ B(A, {
789
789
  label: a,
790
790
  "data-testid": "detail-description-info"
791
791
  }),
792
792
  f,
793
- s === "edit" && c && /* @__PURE__ */ H("span", {
793
+ s === "edit" && c && /* @__PURE__ */ V("span", {
794
794
  style: {
795
795
  display: "inline-flex",
796
796
  alignItems: "center",
@@ -798,26 +798,26 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
798
798
  fontSize: 11,
799
799
  color: "var(--warn)"
800
800
  },
801
- children: [/* @__PURE__ */ V("span", { style: {
801
+ children: [/* @__PURE__ */ B("span", { style: {
802
802
  width: 6,
803
803
  height: 6,
804
804
  borderRadius: 999,
805
805
  background: "var(--warn)"
806
806
  } }), "Unsaved"]
807
807
  }),
808
- s === "create" && /* @__PURE__ */ V(k, {
808
+ s === "create" && /* @__PURE__ */ B(oe, {
809
809
  tone: "violet",
810
810
  size: "xs",
811
811
  dot: !0,
812
812
  children: "New record"
813
813
  })
814
814
  ]
815
- }), o && s === "display" && /* @__PURE__ */ V("div", {
815
+ }), o && s === "display" && /* @__PURE__ */ B("div", {
816
816
  style: { marginTop: 8 },
817
817
  children: o
818
818
  })]
819
819
  }),
820
- d && /* @__PURE__ */ V("div", {
820
+ d && /* @__PURE__ */ B("div", {
821
821
  role: "toolbar",
822
822
  "aria-label": "Page actions",
823
823
  style: {
@@ -893,46 +893,46 @@ function _t(e, t) {
893
893
  }
894
894
  function vt(e, t) {
895
895
  if (e) {
896
- let n = O(oe(e, t));
896
+ let n = h(x(e, t));
897
897
  if (n.replace(/^\|+|\|+$/g, "")) return n;
898
898
  }
899
- return t.id == null ? crypto.randomUUID() : c(t.id);
899
+ return t.id == null ? crypto.randomUUID() : f(t.id);
900
900
  }
901
901
  function J({ screenCode: e }) {
902
- return /* @__PURE__ */ V(d, { children: /* @__PURE__ */ V(yt, { screenCode: e }) });
902
+ return /* @__PURE__ */ B(m, { children: /* @__PURE__ */ B(yt, { screenCode: e }) });
903
903
  }
904
904
  function yt({ screenCode: t }) {
905
- let { id: r } = Ye(), a = b(), [c, d] = Xe(), { data: h } = ee(), g = u((e) => e.user), v = s(), y = re(), S = h?.screens[t], w = S?.entity ? h?.entities[S.entity] : void 0, E = S?.entity, D = x(w, "create"), k = x(w, "update"), A = x(w, "restore"), ae = (() => {
906
- if (!w || !w.singleton || !w.prefilter) return;
907
- let e = ie(w);
905
+ let { id: n } = Xe(), a = ne(), [s, c] = Ze(), { data: f } = i(), m = re((e) => e.user), _ = u(), y = ie(), b = f?.screens[t], S = b?.entity ? f?.entities[b.entity] : void 0, C = b?.entity, w = le(S, "create"), T = le(S, "update"), E = le(S, "restore"), oe = (() => {
906
+ if (!S || !S.singleton || !S.prefilter) return;
907
+ let e = o(S);
908
908
  if (e.length !== 1) return;
909
- let t = w.prefilter[e[0]];
910
- if (t === "$caller.user_id") return g?.id;
911
- if (t === "$caller.tenant_id") return g?.tenant?.id;
912
- })(), j = ae !== void 0, M = j ? ae : r, N = !j && M === "new", P = L(() => {
913
- if (!M || N) return;
914
- if (!w) return M;
915
- let e = ie(w);
916
- if (e.length === 1) return { [e[0]]: M };
917
- let t = o(M, e.length);
909
+ let t = S.prefilter[e[0]];
910
+ if (t === "$caller.user_id") return m?.id;
911
+ if (t === "$caller.tenant_id") return m?.tenant?.id;
912
+ })(), O = oe !== void 0, k = O ? oe : n, A = !O && k === "new", j = I(() => {
913
+ if (!k || A) return;
914
+ if (!S) return k;
915
+ let e = o(S);
916
+ if (e.length === 1) return { [e[0]]: k };
917
+ let t = l(k, e.length);
918
918
  if (!t) return;
919
919
  let n = {};
920
920
  for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
921
921
  return n;
922
922
  }, [
923
- M,
924
- N,
925
- w
926
- ]), F = L(() => {
927
- if (P) return typeof P == "string" ? P : O(P);
928
- }, [P]), de = Ae(E, P), { data: fe, isLoading: pe, error: he } = de, ge = xe((e) => e.degradedEntities), Se = E ? ye(w?.realtime, ge, E) : !1;
929
- ce(je(E, P), !N);
930
- let we = ve(E ?? ""), Me = Pe(E ?? ""), Ne = Te(E ?? ""), Fe = Object.keys(w?.status_groups ?? {}).length > 0, Ie = fe?.data, Be = Ie?.$statuses, Ve = Ie?.$properties, He = c.get("edit") === "true", [Ge, z] = R(N || He), [B, $e] = R({}), [U, et] = R({}), [W, nt] = R({}), [G, K] = R(void 0), [at, ot] = R(!1), [st, q] = R(void 0), [ut, ft] = R(!1), mt = N ? D : k, J = Ge && mt, yt = te();
931
- T(J && !N, yt.enabled);
932
- let [xt, St] = R(() => {
933
- let e = parseInt(S?.sidebar_width || "380", 10);
923
+ k,
924
+ A,
925
+ S
926
+ ]), M = I(() => {
927
+ if (j) return typeof j == "string" ? j : h(j);
928
+ }, [j]), me = Ne(C, j), { data: he, isLoading: ge, error: ve } = me, ye = we((e) => e.degradedEntities), Te = C ? Se(S?.realtime, ye, C) : !1;
929
+ de(Pe(C, j), !A);
930
+ let De = xe(C ?? ""), Fe = Le(C ?? ""), Ie = Oe(C ?? ""), Re = Object.keys(S?.status_groups ?? {}).length > 0, ze = he?.data, Ue = ze?.$statuses, We = ze?.$properties, Ge = s.get("edit") === "true", [N, R] = L(A || Ge), [z, et] = L({}), [H, U] = L({}), [W, nt] = L({}), [G, K] = L(void 0), [at, ot] = L(!1), [st, q] = L(void 0), [ut, ft] = L(!1), mt = A ? w : T, J = N && mt, yt = ae();
931
+ te(J && !A, yt.enabled);
932
+ let [xt, St] = L(() => {
933
+ let e = parseInt(b?.sidebar_width || "380", 10);
934
934
  return isNaN(e) ? 380 : e;
935
- }), wt = qe(null), Y = qe(null), Tt = I((e) => {
935
+ }), wt = Je(null), Y = Je(null), Tt = P((e) => {
936
936
  e.preventDefault();
937
937
  let t = wt.current;
938
938
  if (!t) return;
@@ -949,75 +949,75 @@ function yt({ screenCode: t }) {
949
949
  Y.current && t && St(parseInt(t.style.width, 10) || Y.current.startW), Y.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
950
950
  };
951
951
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
952
- }, []), X = fe?.data, Z = typeof X?.$row_version == "string" ? X.$row_version : void 0, Et = X?.$refs, Dt = qe(Z);
953
- Ke(() => {
952
+ }, []), X = he?.data, Z = typeof X?.$row_version == "string" ? X.$row_version : void 0, Et = X?.$refs, Dt = Je(Z);
953
+ F(() => {
954
954
  if (!Z) return;
955
955
  let e = Dt.current;
956
- Dt.current = Z, e && e !== Z && Ge && ot(!0);
957
- }, [Ge, Z]);
958
- let Ot = !!w?.soft_delete && X != null && X[w.soft_delete] != null, kt = Je(), At = qe(null);
959
- le({ scrollElementRef: At });
960
- let jt = !N && he instanceof C && he.status === 404, Mt = qe(null);
961
- Ke(() => {
956
+ Dt.current = Z, e && e !== Z && N && ot(!0);
957
+ }, [N, Z]);
958
+ let Ot = !!S?.soft_delete && X != null && X[S.soft_delete] != null, kt = Ye(), At = Je(null);
959
+ fe({ scrollElementRef: At });
960
+ let jt = !A && ve instanceof se && ve.status === 404, Mt = Je(null);
961
+ F(() => {
962
962
  if (!jt) return;
963
- let e = _e(kt);
964
- Mt.current !== e && (Mt.current = e, se.getState().kill(e));
963
+ let e = be(kt);
964
+ Mt.current !== e && (Mt.current = e, ue.getState().kill(e));
965
965
  }, [jt, kt]);
966
- let { openTab: Nt, updateTabTitle: Pt, findTabByPathname: Ft } = Re();
967
- Ke(() => {
968
- if (!w || j || yt.enabled) return;
969
- let e = kt.pathname, t = m(S?.display?.name) || m(w.display.name), n = S?.display?.icon || w.display.icon;
966
+ let { openTab: Nt, updateTabTitle: Pt, findTabByPathname: Ft } = Ve();
967
+ F(() => {
968
+ if (!S || O || yt.enabled) return;
969
+ let e = kt.pathname, t = D(b?.display?.name) || D(S.display.name), n = b?.display?.icon || S.display.icon;
970
970
  Ft(e) || Nt({
971
971
  pathname: e,
972
972
  search: "",
973
- title: N ? `New ${t}` : t,
973
+ title: A ? `New ${t}` : t,
974
974
  icon: n,
975
975
  closable: !0
976
976
  });
977
977
  }, [
978
978
  kt.pathname,
979
- S?.display?.name?.en,
980
- w?.display.name?.en,
981
- S?.display?.icon,
982
- w?.display.icon,
983
- N,
984
- j,
979
+ b?.display?.name?.en,
980
+ S?.display.name?.en,
981
+ b?.display?.icon,
982
+ S?.display.icon,
983
+ A,
984
+ O,
985
985
  yt.enabled
986
- ]), Ke(() => {
987
- if (!X || !w || j || yt.enabled) return;
986
+ ]), F(() => {
987
+ if (!X || !S || O || yt.enabled) return;
988
988
  let e = Ft(kt.pathname);
989
989
  if (e) {
990
- let t = m(S?.display?.name) || m(w.display.name), n = i(X, w), r = n && !String(n).startsWith("/") ? String(n) : t;
990
+ let t = D(b?.display?.name) || D(S.display.name), n = v(X, S), r = n && !String(n).startsWith("/") ? String(n) : t;
991
991
  Pt(e.id, r);
992
992
  }
993
993
  }, [
994
994
  X,
995
- w?.display.name?.en,
996
- w?.display.display_field,
995
+ S?.display.name?.en,
996
+ S?.display.display_field,
997
997
  kt.pathname,
998
- j,
998
+ O,
999
999
  yt.enabled
1000
1000
  ]);
1001
- let It = L(() => {
1002
- if (!w || !mt) return /* @__PURE__ */ new Set();
1001
+ let It = I(() => {
1002
+ if (!S || !mt) return /* @__PURE__ */ new Set();
1003
1003
  let e = /* @__PURE__ */ new Set();
1004
- for (let [t, n] of w.fields) !n.auto && !n.primary && e.add(t);
1005
- for (let [t] of w.files ?? []) e.add(t);
1004
+ for (let [t, n] of S.fields) !n.auto && !n.primary && e.add(t);
1005
+ for (let [t] of S.files ?? []) e.add(t);
1006
1006
  return e;
1007
- }, [w, mt]);
1008
- Ke(() => {
1009
- if (!(!He || !X || !w || !k)) {
1010
- if (Ge || z(!0), Object.keys(B).length === 0) {
1011
- let e = M ? me(M) : null;
1012
- e && De(Ee({
1013
- entity: w,
1007
+ }, [S, mt]);
1008
+ F(() => {
1009
+ if (!(!Ge || !X || !S || !T)) {
1010
+ if (N || R(!0), Object.keys(z).length === 0) {
1011
+ let e = k ? _e(k) : null;
1012
+ e && Ae(ke({
1013
+ entity: S,
1014
1014
  formData: e,
1015
1015
  record: void 0,
1016
1016
  isNew: !0
1017
1017
  })).forEach((e) => {
1018
- v.registerDraft({
1018
+ _.registerDraft({
1019
1019
  fileId: e,
1020
- discard: () => l(e)
1020
+ discard: () => p(e)
1021
1021
  });
1022
1022
  });
1023
1023
  let t = {};
@@ -1027,16 +1027,16 @@ function yt({ screenCode: t }) {
1027
1027
  t[n] = r;
1028
1028
  return;
1029
1029
  }
1030
- let i = Ce(w, X, n);
1031
- t[n] = be(w, n) ? i ?? null : i ?? "";
1032
- }), $e(t);
1030
+ let i = Ee(S, X, n);
1031
+ t[n] = Ce(S, n) ? i ?? null : i ?? "";
1032
+ }), et(t);
1033
1033
  }
1034
- if (w.children !== void 0 && w.children.length > 0 && G === void 0) {
1034
+ if (S.children !== void 0 && S.children.length > 0 && G === void 0) {
1035
1035
  let e = X.$children;
1036
1036
  if (e && Object.keys(e).length > 0) {
1037
1037
  let t = {};
1038
1038
  for (let [n, r] of Object.entries(e)) {
1039
- let e = h?.entities[n];
1039
+ let e = f?.entities[n];
1040
1040
  t[n] = r.map((t) => ({
1041
1041
  ...t,
1042
1042
  _key: vt(e, t)
@@ -1045,46 +1045,46 @@ function yt({ screenCode: t }) {
1045
1045
  K(t), q(e);
1046
1046
  } else K({}), q({});
1047
1047
  }
1048
- d((e) => {
1048
+ c((e) => {
1049
1049
  let t = new URLSearchParams(e);
1050
1050
  return t.delete("edit"), t;
1051
1051
  }, { replace: !0 });
1052
1052
  }
1053
1053
  }, [
1054
- He,
1054
+ Ge,
1055
1055
  X,
1056
1056
  It,
1057
- k,
1058
- w,
1057
+ T,
1058
+ S,
1059
1059
  G,
1060
- h
1061
- ]), Ke(() => {
1062
- !N || !D || !w?.children || w.children.length === 0 || G === void 0 && (K({}), q({}));
1060
+ f
1061
+ ]), F(() => {
1062
+ !A || !w || !S?.children || S.children.length === 0 || G === void 0 && (K({}), q({}));
1063
1063
  }, [
1064
- N,
1065
- D,
1066
- w?.children
1064
+ A,
1065
+ w,
1066
+ S?.children
1067
1067
  ]);
1068
- let Lt = I(async () => {
1069
- if (await v.flushAllDrafts(), N) {
1070
- let e = S?.route?.replace("/:id", "") ?? "/";
1068
+ let Lt = P(async () => {
1069
+ if (await _.flushAllDrafts(), A) {
1070
+ let e = b?.route?.replace("/:id", "") ?? "/";
1071
1071
  a(e);
1072
- } else z(!1), $e({}), et({}), nt({}), K(void 0), q(void 0), ft(!1);
1072
+ } else R(!1), et({}), U({}), nt({}), K(void 0), q(void 0), ft(!1);
1073
1073
  }, [
1074
- v,
1075
- N,
1076
- S,
1074
+ _,
1075
+ A,
1076
+ b,
1077
1077
  a
1078
- ]), Rt = I((e, t) => {
1079
- $e((n) => ({
1078
+ ]), Rt = P((e, t) => {
1079
+ et((n) => ({
1080
1080
  ...n,
1081
1081
  [e]: t
1082
1082
  }));
1083
- }, []), Q = L(() => {
1084
- if (!S?.route) return "/";
1085
- let e = S.route.split("/");
1083
+ }, []), Q = I(() => {
1084
+ if (!b?.route) return "/";
1085
+ let e = b.route.split("/");
1086
1086
  return e.pop(), e.join("/") || "/";
1087
- }, [S]), zt = L(() => !h?.screens || !Q || Q === "/" ? !1 : Object.values(h.screens).some((e) => e.route === Q), [h, Q]), Bt = ke({ fallback: I(() => {
1087
+ }, [b]), zt = I(() => !f?.screens || !Q || Q === "/" ? !1 : Object.values(f.screens).some((e) => e.route === Q), [f, Q]), Bt = Me({ fallback: P(() => {
1088
1088
  if (!zt) {
1089
1089
  a("/");
1090
1090
  return;
@@ -1096,39 +1096,39 @@ function yt({ screenCode: t }) {
1096
1096
  Q,
1097
1097
  Ft,
1098
1098
  a
1099
- ]) }), Vt = !j && (Bt.hasOriginBack || Bt.allowFallbackBack && !!zt), Ht = n(), Ut = L(() => {
1100
- if (!w) return {};
1099
+ ]) }), Vt = !O && (Bt.hasOriginBack || Bt.allowFallbackBack && !!zt), Ht = r(), Ut = I(() => {
1100
+ if (!S) return {};
1101
1101
  let e = {};
1102
- for (let t of dt(w, B, N)) It.has(t) && (e[t] = "Required");
1103
- for (let t of pt(w, B)) It.has(t) && (e[t] = "Invalid email address");
1102
+ for (let t of dt(S, z, A)) It.has(t) && (e[t] = "Required");
1103
+ for (let t of pt(S, z)) It.has(t) && (e[t] = "Invalid email address");
1104
1104
  return e;
1105
1105
  }, [
1106
- w,
1107
- B,
1108
- N,
1106
+ S,
1107
+ z,
1108
+ A,
1109
1109
  It
1110
- ]), Wt = Object.keys(Ut).length > 0, Gt = I(() => {
1111
- if (!E || !w || N && !D || !N && !k || (ft(!0), Wt)) return;
1112
- let e = {}, t = Ee({
1113
- entity: w,
1114
- formData: B,
1110
+ ]), Wt = Object.keys(Ut).length > 0, Gt = P(() => {
1111
+ if (!C || !S || A && !w || !A && !T || (ft(!0), Wt)) return;
1112
+ let e = {}, t = ke({
1113
+ entity: S,
1114
+ formData: z,
1115
1115
  record: X,
1116
- isNew: N
1117
- }), n = De(t);
1118
- if (N) for (let [t, n] of Object.entries(B)) {
1119
- if (w.files?.has(t)) continue;
1120
- let r = Oe(w, t, n);
1116
+ isNew: A
1117
+ }), n = Ae(t);
1118
+ if (A) for (let [t, n] of Object.entries(z)) {
1119
+ if (S.files?.has(t)) continue;
1120
+ let r = je(S, t, n);
1121
1121
  r !== "" && r != null && (e[t] = r);
1122
1122
  }
1123
1123
  else {
1124
- for (let [t, n] of Object.entries(B)) {
1125
- if (w.files?.has(t)) continue;
1126
- let r = X ? Ce(w, X, t) : void 0, i = Oe(w, t, n), a = Oe(w, t, r);
1124
+ for (let [t, n] of Object.entries(z)) {
1125
+ if (S.files?.has(t)) continue;
1126
+ let r = X ? Ee(S, X, t) : void 0, i = je(S, t, n), a = je(S, t, r);
1127
1127
  (i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
1128
1128
  }
1129
1129
  Z && (e.$row_version = Z);
1130
1130
  }
1131
- if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(U).length > 0 && (e.$statuses = Object.entries(U).map(([e, t]) => ({
1131
+ if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(H).length > 0 && (e.$statuses = Object.entries(H).map(([e, t]) => ({
1132
1132
  status_group_code: e,
1133
1133
  status_code: t
1134
1134
  }))), Object.keys(W).length > 0 && (e.$properties = Object.entries(W).map(([e, t]) => ({
@@ -1141,81 +1141,81 @@ function yt({ screenCode: t }) {
1141
1141
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
1142
1142
  return i;
1143
1143
  }), i = st?.[e] ?? [];
1144
- (N || !_t(r, i)) && (t[e] = r);
1144
+ (A || !_t(r, i)) && (t[e] = r);
1145
1145
  }
1146
1146
  Object.keys(t).length > 0 && (e.$children = t);
1147
1147
  }
1148
- if (!N && Object.keys(e).length === 0) {
1149
- z(!1), et({}), nt({}), K(void 0), q(void 0), ft(!1);
1148
+ if (!A && Object.keys(e).length === 0) {
1149
+ R(!1), U({}), nt({}), K(void 0), q(void 0), ft(!1);
1150
1150
  return;
1151
1151
  }
1152
1152
  let r = () => {
1153
- z(!1), ot(!1), ft(!1), et({}), nt({}), K(void 0), q(void 0);
1153
+ R(!1), ot(!1), ft(!1), U({}), nt({}), K(void 0), q(void 0);
1154
1154
  };
1155
- N ? we.mutate(e, { onSuccess: (e) => {
1156
- n.forEach((e) => v.markCommitted(e));
1157
- let t = e.data, i = O(w ? oe(w, t) : {});
1155
+ A ? De.mutate(e, { onSuccess: (e) => {
1156
+ n.forEach((e) => _.markCommitted(e));
1157
+ let t = e.data, i = h(S ? x(S, t) : {});
1158
1158
  a(i ? `${Q}/${encodeURIComponent(i)}` : Q, { replace: !0 }), r();
1159
- } }) : P && Me.mutate({
1160
- pkValues: P,
1159
+ } }) : j && Fe.mutate({
1160
+ pkValues: j,
1161
1161
  data: e
1162
1162
  }, {
1163
1163
  onSuccess: () => {
1164
- n.forEach((e) => v.markCommitted(e)), r();
1164
+ n.forEach((e) => _.markCommitted(e)), r();
1165
1165
  },
1166
1166
  onError: (e) => {
1167
- e instanceof C && e.code === "STALE_OBJECT" && ot(!0);
1167
+ e instanceof se && e.code === "STALE_OBJECT" && ot(!0);
1168
1168
  }
1169
1169
  });
1170
1170
  }, [
1171
- v,
1172
- N,
1173
- D,
1174
- k,
1175
- E,
1176
- B,
1171
+ _,
1172
+ A,
1173
+ w,
1174
+ T,
1175
+ C,
1176
+ z,
1177
1177
  Wt,
1178
- U,
1178
+ H,
1179
1179
  W,
1180
1180
  G,
1181
1181
  st,
1182
- we,
1183
- Me,
1184
- w,
1182
+ De,
1183
+ Fe,
1184
+ S,
1185
1185
  a,
1186
1186
  Q,
1187
1187
  X,
1188
1188
  Z,
1189
- P
1190
- ]), Kt = I((e, t) => {
1189
+ j
1190
+ ]), Kt = P((e, t) => {
1191
1191
  K((n) => ({
1192
1192
  ...n ?? {},
1193
1193
  [e]: t
1194
1194
  }));
1195
- }, []), qt = I(() => {
1196
- !P || N || !A || Ne.mutate(P);
1195
+ }, []), qt = P(() => {
1196
+ !j || A || !E || Ie.mutate(j);
1197
1197
  }, [
1198
- P,
1199
- N,
1198
+ j,
1200
1199
  A,
1201
- Ne
1202
- ]), Jt = L(() => ht(G, h), [G, h]), Yt = Object.keys(Jt).length > 0;
1203
- if (!S || !w) return null;
1204
- if (!N && pe) return /* @__PURE__ */ V(ze, {});
1205
- if (!N && !X || jt) return /* @__PURE__ */ H("div", {
1200
+ E,
1201
+ Ie
1202
+ ]), Jt = I(() => ht(G, f), [G, f]), Yt = Object.keys(Jt).length > 0;
1203
+ if (!b || !S) return null;
1204
+ if (!A && ge) return /* @__PURE__ */ B(He, {});
1205
+ if (!A && !X || jt) return /* @__PURE__ */ V("div", {
1206
1206
  style: { padding: 24 },
1207
- children: [/* @__PURE__ */ H("div", {
1207
+ children: [/* @__PURE__ */ V("div", {
1208
1208
  style: {
1209
1209
  display: "flex",
1210
1210
  alignItems: "center",
1211
1211
  gap: 8,
1212
1212
  marginBottom: 8
1213
1213
  },
1214
- children: [Vt && /* @__PURE__ */ V(ne, {
1215
- icon: /* @__PURE__ */ V(e.back, { size: 14 }),
1214
+ children: [Vt && /* @__PURE__ */ B(ee, {
1215
+ icon: /* @__PURE__ */ B(e.back, { size: 14 }),
1216
1216
  onClick: Bt.goBack,
1217
1217
  title: "Back"
1218
- }), /* @__PURE__ */ V("h1", {
1218
+ }), /* @__PURE__ */ B("h1", {
1219
1219
  style: {
1220
1220
  margin: 0,
1221
1221
  fontSize: 18,
@@ -1224,29 +1224,29 @@ function yt({ screenCode: t }) {
1224
1224
  },
1225
1225
  children: "Not Found"
1226
1226
  })]
1227
- }), /* @__PURE__ */ V("p", {
1227
+ }), /* @__PURE__ */ B("p", {
1228
1228
  style: { color: "var(--text-3)" },
1229
1229
  children: "Record not found."
1230
1230
  })]
1231
1231
  });
1232
- let Xt = w.display, Zt = m(S.display?.name) || m(Xt.name), Qt = i(X, w), $t = N ? `New ${Zt}` : Qt ? String(Qt) : Zt, en = we.isPending || Me.isPending, tn = S.responsive?.[y.category]?.layout, nn = tn?.tabs ?? (y.isPhone ? "sections" : void 0), rn = tn?.header_card === !0 ? Le({
1233
- entity: w,
1234
- screen: S
1232
+ let Xt = S.display, Zt = D(b.display?.name) || D(Xt.name), Qt = v(X, S), $t = A ? `New ${Zt}` : Qt ? String(Qt) : Zt, en = De.isPending || Fe.isPending, tn = b.responsive?.[y.category]?.layout, nn = tn?.tabs ?? (y.isPhone ? "sections" : void 0), rn = tn?.header_card === !0 ? Be({
1233
+ entity: S,
1234
+ screen: b
1235
1235
  }) : void 0, $ = {
1236
- schema: h,
1237
- entity: w,
1238
- entityCode: E,
1239
- recordId: F ?? M ?? "",
1236
+ schema: f,
1237
+ entity: S,
1238
+ entityCode: C,
1239
+ recordId: M ?? k ?? "",
1240
1240
  record: J ? {
1241
1241
  ...X ?? {},
1242
- ...B
1242
+ ...z
1243
1243
  } : X ?? {},
1244
- isNew: N,
1244
+ isNew: A,
1245
1245
  mode: J ? "edit" : "display",
1246
1246
  onFieldChange: J ? Rt : void 0,
1247
1247
  refs: Et,
1248
1248
  objectProperties: (() => {
1249
- let e = Ve ?? [];
1249
+ let e = We ?? [];
1250
1250
  if (!J || Object.keys(W).length === 0) return e.length > 0 ? e : void 0;
1251
1251
  let t = e.map((e) => W[e.property_code] === void 0 ? e : {
1252
1252
  ...e,
@@ -1260,27 +1260,27 @@ function yt({ screenCode: t }) {
1260
1260
  });
1261
1261
  return t;
1262
1262
  })(),
1263
- onSetProperty: N || !k ? void 0 : J ? (e, t) => nt((n) => ({
1263
+ onSetProperty: A || !T ? void 0 : J ? (e, t) => nt((n) => ({
1264
1264
  ...n,
1265
1265
  [e]: t
1266
1266
  })) : void 0,
1267
1267
  isPropertyPending: !1,
1268
1268
  objectStatuses: (() => {
1269
- let e = Be ?? [];
1270
- if (!J || Object.keys(U).length === 0) return e.length > 0 ? e : void 0;
1271
- let t = e.map((e) => U[e.group_code] === void 0 ? e : {
1269
+ let e = Ue ?? [];
1270
+ if (!J || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
1271
+ let t = e.map((e) => H[e.group_code] === void 0 ? e : {
1272
1272
  ...e,
1273
- status_code: U[e.group_code]
1273
+ status_code: H[e.group_code]
1274
1274
  });
1275
- for (let [n, r] of Object.entries(U)) e.some((e) => e.group_code === n) || t.push({
1275
+ for (let [n, r] of Object.entries(H)) e.some((e) => e.group_code === n) || t.push({
1276
1276
  group_code: n,
1277
1277
  status_code: r,
1278
1278
  status_name: {},
1279
- set_at: f()
1279
+ set_at: d()
1280
1280
  });
1281
1281
  return t;
1282
1282
  })(),
1283
- onSetStatus: N || !k ? void 0 : J ? (e, t) => et((n) => ({
1283
+ onSetStatus: A || !T ? void 0 : J ? (e, t) => U((n) => ({
1284
1284
  ...n,
1285
1285
  [e]: t
1286
1286
  })) : void 0,
@@ -1291,32 +1291,32 @@ function yt({ screenCode: t }) {
1291
1291
  fieldErrors: J && ut ? Ut : void 0,
1292
1292
  detailTabsPresentation: nn,
1293
1293
  relatedRecordsPresentation: tn?.related_records
1294
- }, an = !!S.sidebar && S.sidebar.length > 0, on = tn?.sidebar === "hidden", sn = an && !on && !y.isDesktop, cn = an && !on && y.isDesktop, ln = !N && X ? /* @__PURE__ */ V(it, {
1295
- screen: S,
1296
- entity: w,
1297
- entityCode: E,
1294
+ }, an = !!b.sidebar && b.sidebar.length > 0, on = tn?.sidebar === "hidden", sn = an && !on && !y.isDesktop, cn = an && !on && y.isDesktop, ln = !A && X ? /* @__PURE__ */ B(it, {
1295
+ screen: b,
1296
+ entity: S,
1297
+ entityCode: C,
1298
1298
  record: X,
1299
1299
  refs: Et,
1300
- objectStatuses: Be,
1301
- schema: h,
1300
+ objectStatuses: Ue,
1301
+ schema: f,
1302
1302
  locale: Ht
1303
- }) : void 0, un = /* @__PURE__ */ V(Ct, {
1303
+ }) : void 0, un = /* @__PURE__ */ B(Ct, {
1304
1304
  title: $t,
1305
- recordId: M,
1305
+ recordId: k,
1306
1306
  editing: J,
1307
- isNew: N,
1307
+ isNew: A,
1308
1308
  isRecordDeleted: Ot,
1309
- dirty: Ge,
1309
+ dirty: N,
1310
1310
  isSaving: en,
1311
1311
  hasChildErrors: Yt,
1312
1312
  hasFieldErrors: ut && Wt,
1313
- canRestore: A,
1314
- entity: w,
1315
- screen: S,
1316
- globalActions: h?.actions,
1317
- entityCode: E,
1313
+ canRestore: E,
1314
+ entity: S,
1315
+ screen: b,
1316
+ globalActions: f?.actions,
1317
+ entityCode: C,
1318
1318
  record: X,
1319
- id: M,
1319
+ id: k,
1320
1320
  listRoute: Q,
1321
1321
  listRouteExists: !!zt,
1322
1322
  highlights: ln,
@@ -1325,16 +1325,16 @@ function yt({ screenCode: t }) {
1325
1325
  onCancelEdit: Lt,
1326
1326
  onSave: Gt,
1327
1327
  onRestore: qt,
1328
- isRestoring: Ne.isPending,
1328
+ isRestoring: Ie.isPending,
1329
1329
  refreshControl: {
1330
- refetch: de.refetch,
1331
- isFetching: de.isFetching,
1332
- isLoading: de.isLoading,
1333
- isLive: Se
1330
+ refetch: me.refetch,
1331
+ isFetching: me.isFetching,
1332
+ isLoading: me.isLoading,
1333
+ isLive: Te
1334
1334
  },
1335
- isRealtimeEntity: w?.realtime === !0,
1336
- canManageTemplates: ue(h)
1337
- }), dn = Ot && /* @__PURE__ */ H("div", {
1335
+ isRealtimeEntity: S?.realtime === !0,
1336
+ canManageTemplates: pe(f)
1337
+ }), dn = Ot && /* @__PURE__ */ V("div", {
1338
1338
  style: {
1339
1339
  display: "flex",
1340
1340
  alignItems: "center",
@@ -1347,8 +1347,8 @@ function yt({ screenCode: t }) {
1347
1347
  color: "var(--danger)",
1348
1348
  fontSize: 12.5
1349
1349
  },
1350
- children: [/* @__PURE__ */ V(e.warning, { size: 14 }), /* @__PURE__ */ H("span", { children: ["This record was deleted on ", _(String(X[w.soft_delete]))] })]
1351
- }), fn = at && /* @__PURE__ */ H("div", {
1350
+ children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ V("span", { children: ["This record was deleted on ", g(String(X[S.soft_delete]))] })]
1351
+ }), fn = at && /* @__PURE__ */ V("div", {
1352
1352
  style: {
1353
1353
  display: "flex",
1354
1354
  alignItems: "center",
@@ -1361,73 +1361,73 @@ function yt({ screenCode: t }) {
1361
1361
  color: "var(--warn)",
1362
1362
  fontSize: 12.5
1363
1363
  },
1364
- children: [/* @__PURE__ */ V(e.warning, { size: 14 }), /* @__PURE__ */ V("span", { children: "This record changed on the server while you were viewing or editing it." })]
1365
- }), pn = J && ut && Wt && /* @__PURE__ */ V(rt, {
1364
+ children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: "This record changed on the server while you were viewing or editing it." })]
1365
+ }), pn = J && ut && Wt && /* @__PURE__ */ B(rt, {
1366
1366
  errors: Object.entries(Ut).map(([e, t]) => {
1367
- let n = w.fields.get(e);
1367
+ let n = S.fields.get(e);
1368
1368
  return {
1369
1369
  name: e,
1370
- label: n ? p(n, e, h?.entities) : e,
1370
+ label: n ? ce(n, e, f?.entities) : e,
1371
1371
  message: t
1372
1372
  };
1373
1373
  }),
1374
1374
  onJump: (e) => {
1375
- let t = document.getElementById(`${E}-${e}`);
1375
+ let t = document.getElementById(`${C}-${e}`);
1376
1376
  t && (t.scrollIntoView({
1377
1377
  block: "center",
1378
1378
  behavior: "smooth"
1379
1379
  }), t.focus?.());
1380
1380
  }
1381
- }), mn = Fe && !N && !(S.items && S.items.length > 0) && /* @__PURE__ */ V("div", {
1381
+ }), mn = Re && !A && !(b.items && b.items.length > 0) && /* @__PURE__ */ B("div", {
1382
1382
  className: "mb-4",
1383
- children: /* @__PURE__ */ V(Ue, {
1384
- statusGroups: w.status_groups ?? {},
1383
+ children: /* @__PURE__ */ B(Ke, {
1384
+ statusGroups: S.status_groups ?? {},
1385
1385
  objectStatuses: $.objectStatuses,
1386
- onSetStatus: k && J ? (e, t) => et((n) => ({
1386
+ onSetStatus: T && J ? (e, t) => U((n) => ({
1387
1387
  ...n,
1388
1388
  [e]: t
1389
1389
  })) : gt,
1390
1390
  isPending: !1,
1391
1391
  mode: J ? "edit" : "display"
1392
1392
  })
1393
- }), hn = w.evidence_covered && !N && X && /* @__PURE__ */ V("div", {
1393
+ }), hn = S.evidence_covered && !A && X && /* @__PURE__ */ B("div", {
1394
1394
  className: "mb-4",
1395
- children: /* @__PURE__ */ V(lt, { evidence: X.$evidence })
1396
- }), gn = /* @__PURE__ */ H(Ze, { children: [
1397
- rn && (X || N) && /* @__PURE__ */ V(bt, {
1395
+ children: /* @__PURE__ */ B(lt, { evidence: X.$evidence })
1396
+ }), gn = /* @__PURE__ */ V(Qe, { children: [
1397
+ rn && (X || A) && /* @__PURE__ */ B(bt, {
1398
1398
  card: rn,
1399
- entity: w,
1399
+ entity: S,
1400
1400
  record: $.record,
1401
1401
  objectStatuses: $.objectStatuses,
1402
1402
  objectProperties: $.objectProperties
1403
1403
  }),
1404
- S.items && S.items.length > 0 && (X || N) && h && /* @__PURE__ */ V(We, {
1405
- nodes: S.items,
1404
+ b.items && b.items.length > 0 && (X || A) && f && /* @__PURE__ */ B(qe, {
1405
+ nodes: b.items,
1406
1406
  ctx: $
1407
1407
  }),
1408
- !N && M && E && w.associations && Object.keys(w.associations).length > 0 && h && /* @__PURE__ */ V(Qe, {
1409
- entityCode: E,
1410
- recordId: F ?? M ?? "",
1411
- associations: w.associations,
1412
- schema: h
1408
+ !A && k && C && S.associations && Object.keys(S.associations).length > 0 && f && /* @__PURE__ */ B($e, {
1409
+ entityCode: C,
1410
+ recordId: M ?? k ?? "",
1411
+ associations: S.associations,
1412
+ schema: f
1413
1413
  }),
1414
- !N && M && E && /* @__PURE__ */ V(tt, {
1415
- entityCode: E,
1416
- objectId: F ?? M,
1417
- canGenerateOne: !!w?.documents?.generate_one,
1418
- canManageTemplates: ue(h)
1414
+ !A && k && C && /* @__PURE__ */ B(tt, {
1415
+ entityCode: C,
1416
+ objectId: M ?? k,
1417
+ canGenerateOne: !!S?.documents?.generate_one,
1418
+ canManageTemplates: pe(f)
1419
1419
  }),
1420
- !N && X && h && /* @__PURE__ */ V(ct, {
1421
- screen: S,
1422
- entity: w,
1423
- entityCode: E,
1420
+ !A && X && f && /* @__PURE__ */ B(ct, {
1421
+ screen: b,
1422
+ entity: S,
1423
+ entityCode: C,
1424
1424
  record: X,
1425
1425
  refs: Et,
1426
- schema: h,
1426
+ schema: f,
1427
1427
  locale: Ht
1428
1428
  })
1429
1429
  ] });
1430
- if (cn) return /* @__PURE__ */ H("div", {
1430
+ if (cn) return /* @__PURE__ */ V("div", {
1431
1431
  style: {
1432
1432
  height: "100%",
1433
1433
  display: "flex",
@@ -1435,7 +1435,7 @@ function yt({ screenCode: t }) {
1435
1435
  background: "var(--background)"
1436
1436
  },
1437
1437
  children: [
1438
- /* @__PURE__ */ H("div", {
1438
+ /* @__PURE__ */ V("div", {
1439
1439
  style: {
1440
1440
  flex: 1,
1441
1441
  minWidth: 0,
@@ -1443,7 +1443,7 @@ function yt({ screenCode: t }) {
1443
1443
  flexDirection: "column",
1444
1444
  height: "100%"
1445
1445
  },
1446
- children: [/* @__PURE__ */ H("div", {
1446
+ children: [/* @__PURE__ */ V("div", {
1447
1447
  style: {
1448
1448
  flexShrink: 0,
1449
1449
  padding: "14px 20px 8px"
@@ -1456,7 +1456,7 @@ function yt({ screenCode: t }) {
1456
1456
  mn,
1457
1457
  hn
1458
1458
  ]
1459
- }), /* @__PURE__ */ V("div", {
1459
+ }), /* @__PURE__ */ B("div", {
1460
1460
  ref: At,
1461
1461
  style: {
1462
1462
  flex: 1,
@@ -1470,11 +1470,11 @@ function yt({ screenCode: t }) {
1470
1470
  children: gn
1471
1471
  })]
1472
1472
  }),
1473
- /* @__PURE__ */ V("div", {
1473
+ /* @__PURE__ */ B("div", {
1474
1474
  className: "detail-resize-handle",
1475
1475
  onMouseDown: Tt,
1476
1476
  title: "Drag to resize",
1477
- children: /* @__PURE__ */ V("div", { style: {
1477
+ children: /* @__PURE__ */ B("div", { style: {
1478
1478
  position: "absolute",
1479
1479
  top: 0,
1480
1480
  bottom: 0,
@@ -1484,22 +1484,22 @@ function yt({ screenCode: t }) {
1484
1484
  background: "var(--border)"
1485
1485
  } })
1486
1486
  }),
1487
- /* @__PURE__ */ V("div", {
1487
+ /* @__PURE__ */ B("div", {
1488
1488
  ref: wt,
1489
1489
  style: {
1490
1490
  flexShrink: 0,
1491
1491
  height: "100%",
1492
1492
  width: `${xt}px`
1493
1493
  },
1494
- children: (X || N) && h && /* @__PURE__ */ V(We, {
1495
- nodes: S.sidebar,
1494
+ children: (X || A) && f && /* @__PURE__ */ B(qe, {
1495
+ nodes: b.sidebar,
1496
1496
  ctx: $
1497
1497
  })
1498
1498
  })
1499
1499
  ]
1500
1500
  });
1501
1501
  let _n = y.isPhone ? 12 : 24;
1502
- return /* @__PURE__ */ H("div", {
1502
+ return /* @__PURE__ */ V("div", {
1503
1503
  style: {
1504
1504
  height: "100%",
1505
1505
  display: "flex",
@@ -1507,7 +1507,7 @@ function yt({ screenCode: t }) {
1507
1507
  overflow: "hidden",
1508
1508
  background: "var(--background)"
1509
1509
  },
1510
- children: [/* @__PURE__ */ H("div", {
1510
+ children: [/* @__PURE__ */ V("div", {
1511
1511
  style: {
1512
1512
  flexShrink: 0,
1513
1513
  padding: y.isPhone ? "14px 12px 8px" : "24px 24px 8px"
@@ -1520,7 +1520,7 @@ function yt({ screenCode: t }) {
1520
1520
  mn,
1521
1521
  hn
1522
1522
  ]
1523
- }), /* @__PURE__ */ H("div", {
1523
+ }), /* @__PURE__ */ V("div", {
1524
1524
  ref: At,
1525
1525
  style: {
1526
1526
  flex: 1,
@@ -1533,7 +1533,7 @@ function yt({ screenCode: t }) {
1533
1533
  minWidth: 0,
1534
1534
  WebkitOverflowScrolling: "touch"
1535
1535
  },
1536
- children: [gn, sn && (X || N) && h && /* @__PURE__ */ V("div", {
1536
+ children: [gn, sn && (X || A) && f && /* @__PURE__ */ B("div", {
1537
1537
  "data-testid": "detail-sidebar-inline",
1538
1538
  style: {
1539
1539
  display: "flex",
@@ -1541,23 +1541,23 @@ function yt({ screenCode: t }) {
1541
1541
  gap: 16,
1542
1542
  minWidth: 0
1543
1543
  },
1544
- children: /* @__PURE__ */ V(We, {
1545
- nodes: S.sidebar,
1544
+ children: /* @__PURE__ */ B(qe, {
1545
+ nodes: b.sidebar,
1546
1546
  ctx: $
1547
1547
  })
1548
1548
  })]
1549
1549
  })]
1550
1550
  });
1551
1551
  }
1552
- function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: a }) {
1553
- let o = (e) => {
1554
- let i = xt(t, e, n, r, a);
1555
- return i != null && c(i) !== "";
1556
- }, s = (e) => c(xt(t, e, n, r, a)) || /* @__PURE__ */ V("span", {
1552
+ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1553
+ let a = (e) => {
1554
+ let a = xt(t, e, n, r, i);
1555
+ return a != null && f(a) !== "";
1556
+ }, o = (e) => f(xt(t, e, n, r, i)) || /* @__PURE__ */ B("span", {
1557
1557
  style: { color: "var(--text-3)" },
1558
1558
  children: "-"
1559
- }), l = c(e.titleUsesDisplay ? i(n, t) : e.titleField ? xt(t, e.titleField, n, r, a) : void 0) || m(t.display?.name) || "Record", u = e.badgeFields.filter((t) => !e.hideEmptyFields || o(t)), d = e.bodyFields.filter((t) => !e.hideEmptyFields || o(t)), f = e.metaFields.filter((t) => !e.hideEmptyFields || o(t));
1560
- return /* @__PURE__ */ H("section", {
1559
+ }), s = f(e.titleUsesDisplay ? v(n, t) : e.titleField ? xt(t, e.titleField, n, r, i) : void 0) || D(t.display?.name) || "Record", c = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), l = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), u = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
1560
+ return /* @__PURE__ */ V("section", {
1561
1561
  "data-testid": "detail-header-card",
1562
1562
  style: {
1563
1563
  width: "100%",
@@ -1570,9 +1570,9 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1570
1570
  boxSizing: "border-box"
1571
1571
  },
1572
1572
  children: [
1573
- /* @__PURE__ */ H("div", {
1573
+ /* @__PURE__ */ V("div", {
1574
1574
  style: { minWidth: 0 },
1575
- children: [/* @__PURE__ */ V("div", {
1575
+ children: [/* @__PURE__ */ B("div", {
1576
1576
  style: {
1577
1577
  fontSize: 15,
1578
1578
  lineHeight: 1.25,
@@ -1580,8 +1580,8 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1580
1580
  color: "var(--text)",
1581
1581
  overflowWrap: "anywhere"
1582
1582
  },
1583
- children: l
1584
- }), e.subtitleField && /* @__PURE__ */ V("div", {
1583
+ children: s
1584
+ }), e.subtitleField && /* @__PURE__ */ B("div", {
1585
1585
  style: {
1586
1586
  marginTop: 4,
1587
1587
  fontSize: 12.5,
@@ -1589,17 +1589,17 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1589
1589
  color: "var(--text-3)",
1590
1590
  overflowWrap: "anywhere"
1591
1591
  },
1592
- children: s(e.subtitleField)
1592
+ children: o(e.subtitleField)
1593
1593
  })]
1594
1594
  }),
1595
- u.length > 0 && /* @__PURE__ */ V("div", {
1595
+ c.length > 0 && /* @__PURE__ */ B("div", {
1596
1596
  style: {
1597
1597
  display: "flex",
1598
1598
  flexWrap: "wrap",
1599
1599
  gap: 6,
1600
1600
  marginTop: 10
1601
1601
  },
1602
- children: u.map((e) => /* @__PURE__ */ V("span", {
1602
+ children: c.map((e) => /* @__PURE__ */ B("span", {
1603
1603
  style: {
1604
1604
  minWidth: 0,
1605
1605
  maxWidth: "100%",
@@ -1611,10 +1611,10 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1611
1611
  lineHeight: 1.4,
1612
1612
  overflowWrap: "anywhere"
1613
1613
  },
1614
- children: s(e)
1614
+ children: o(e)
1615
1615
  }, e))
1616
1616
  }),
1617
- d.length > 0 && /* @__PURE__ */ V("dl", {
1617
+ l.length > 0 && /* @__PURE__ */ B("dl", {
1618
1618
  style: {
1619
1619
  display: "grid",
1620
1620
  gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
@@ -1623,23 +1623,23 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1623
1623
  fontSize: 12.5,
1624
1624
  lineHeight: 1.35
1625
1625
  },
1626
- children: d.map((e) => /* @__PURE__ */ H("div", {
1626
+ children: l.map((e) => /* @__PURE__ */ V("div", {
1627
1627
  style: { display: "contents" },
1628
- children: [/* @__PURE__ */ V("dt", {
1628
+ children: [/* @__PURE__ */ B("dt", {
1629
1629
  style: { color: "var(--text-3)" },
1630
1630
  children: St(t, e)
1631
- }), /* @__PURE__ */ V("dd", {
1631
+ }), /* @__PURE__ */ B("dd", {
1632
1632
  style: {
1633
1633
  margin: 0,
1634
1634
  color: "var(--text-2)",
1635
1635
  minWidth: 0,
1636
1636
  overflowWrap: "anywhere"
1637
1637
  },
1638
- children: s(e)
1638
+ children: o(e)
1639
1639
  })]
1640
1640
  }, e))
1641
1641
  }),
1642
- f.length > 0 && /* @__PURE__ */ V("div", {
1642
+ u.length > 0 && /* @__PURE__ */ B("div", {
1643
1643
  style: {
1644
1644
  display: "flex",
1645
1645
  flexWrap: "wrap",
@@ -1648,7 +1648,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1648
1648
  color: "var(--text-3)",
1649
1649
  fontSize: 11.5
1650
1650
  },
1651
- children: f.map((e) => /* @__PURE__ */ H("span", {
1651
+ children: u.map((e) => /* @__PURE__ */ V("span", {
1652
1652
  style: {
1653
1653
  minWidth: 0,
1654
1654
  overflowWrap: "anywhere"
@@ -1656,7 +1656,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1656
1656
  children: [
1657
1657
  St(t, e),
1658
1658
  ": ",
1659
- s(e)
1659
+ o(e)
1660
1660
  ]
1661
1661
  }, e))
1662
1662
  })
@@ -1666,74 +1666,74 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1666
1666
  function xt(e, t, n, r, i) {
1667
1667
  if (t.startsWith("$status.")) {
1668
1668
  let e = t.slice(8), n = r?.find((t) => t.group_code === e);
1669
- return m(n?.status_name) || n?.status_code;
1669
+ return D(n?.status_name) || n?.status_code;
1670
1670
  }
1671
1671
  if (t.startsWith("$property.")) {
1672
1672
  let e = t.slice(10);
1673
1673
  return i?.find((t) => t.property_code === e)?.value;
1674
1674
  }
1675
- return Ce(e, n, t);
1675
+ return Ee(e, n, t);
1676
1676
  }
1677
1677
  function St(e, t) {
1678
1678
  if (t.startsWith("$status.")) return t.slice(8);
1679
1679
  if (t.startsWith("$property.")) return t.slice(10);
1680
1680
  let n = e.fields.get(t);
1681
- return n ? p(n, t) : t;
1681
+ return n ? ce(n, t) : t;
1682
1682
  }
1683
- function Ct({ title: r, recordId: i, editing: o, isNew: s, isRecordDeleted: c, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: f, canRestore: p, entity: h, screen: _, globalActions: x, entityCode: C, record: w, id: T, listRoute: D, listRouteExists: ee, highlights: O, showBack: te, onBack: k, onCancelEdit: ne, onSave: re, onRestore: A, isRestoring: ie, refreshControl: ae, isRealtimeEntity: oe, canManageTemplates: M }) {
1684
- let { run: N } = E(), P = fe("detail"), F = Me(), ce = b(), le = n(), ue = a(_?.action_layout, h?.action_layout, h?.actions, x, "detail_toolbar"), pe = v(a(_?.action_layout, h?.action_layout, h?.actions, x, "detail"), h?.actions, x, w ?? {}, []), me = v(ue, h?.actions, x, w ?? {}, []), he = L(() => {
1685
- if (!h) return;
1686
- let e = T ? [T] : [];
1683
+ function Ct({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: f, canRestore: p, entity: m, screen: h, globalActions: g, entityCode: _, record: v, id: x, listRoute: ee, listRouteExists: te, highlights: T, showBack: re, onBack: ie, onCancelEdit: ae, onSave: oe, onRestore: se, isRestoring: O, refreshControl: ce, isRealtimeEntity: le, canManageTemplates: k }) {
1684
+ let { run: A } = w(), j = he("detail"), M = Fe(), de = ne(), fe = r(), pe = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail_toolbar"), ge = b(c(h?.action_layout, m?.action_layout, m?.actions, g, "detail"), m?.actions, g, v ?? {}, []), _e = b(pe, m?.actions, g, v ?? {}, []), ve = I(() => {
1685
+ if (!m) return;
1686
+ let e = x ? [x] : [];
1687
1687
  return {
1688
- entity: h,
1689
- entityCode: C ?? "",
1690
- screen: _,
1691
- screenRoute: _?.route ?? "",
1692
- selectedRows: w ? [w] : [],
1688
+ entity: m,
1689
+ entityCode: _ ?? "",
1690
+ screen: h,
1691
+ screenRoute: h?.route ?? "",
1692
+ selectedRows: v ? [v] : [],
1693
1693
  selectedIds: e,
1694
- locale: le,
1695
- tabNavigate: (e, t) => F(e, {
1694
+ locale: fe,
1695
+ tabNavigate: (e, t) => M(e, {
1696
1696
  title: t?.title,
1697
1697
  icon: t?.icon,
1698
1698
  search: t?.search
1699
1699
  }),
1700
- runActionApi: (e, t) => j(e, t)
1700
+ runActionApi: (e, t) => S(e, t)
1701
1701
  };
1702
1702
  }, [
1703
- h,
1704
- C,
1703
+ m,
1705
1704
  _,
1706
- T,
1707
- w,
1708
- le,
1709
- F
1710
- ]), ve = (e, t) => {
1711
- let n = Ne(e, t, { row: w ?? void 0 });
1705
+ h,
1706
+ x,
1707
+ v,
1708
+ fe,
1709
+ M
1710
+ ]), xe = (e, t) => {
1711
+ let n = Ie(e, t, { row: v ?? void 0 });
1712
1712
  if (n === null) return;
1713
- let r = T ? [T] : [], i = e === "__delete" && ee ? D : null;
1714
- return N({
1713
+ let r = x ? [x] : [], i = e === "__delete" && te ? ee : null;
1714
+ return A({
1715
1715
  action: t,
1716
- title: m(t.display?.name) || e,
1717
- row: w ?? void 0,
1718
- execute: (e) => j(n, y(e, r)),
1716
+ title: D(t.display?.name) || e,
1717
+ row: v ?? void 0,
1718
+ execute: (e) => S(n, C(e, r)),
1719
1719
  onSuccess: i ? () => {
1720
- se.getState().kill(_e(location)), ce(i, { replace: !0 });
1720
+ ue.getState().kill(be(location)), de(i, { replace: !0 });
1721
1721
  } : void 0
1722
1722
  });
1723
- }, ye = P.isVisible("show_actions") && !s && T && pe.length > 0 ? /* @__PURE__ */ V(we, {
1724
- layout: pe,
1725
- row: w,
1726
- onRun: ve,
1723
+ }, Se = j.isVisible("show_actions") && !o && x && ge.length > 0 ? /* @__PURE__ */ B(De, {
1724
+ layout: ge,
1725
+ row: v,
1726
+ onRun: xe,
1727
1727
  kind: "detail",
1728
- entityActions: h?.actions,
1729
- globalActions: x,
1728
+ entityActions: m?.actions,
1729
+ globalActions: g,
1730
1730
  reservedRightWidth: 0,
1731
- widgetContext: he,
1731
+ widgetContext: ve,
1732
1732
  constrain: !1
1733
- }) : null, be = !s && T ? /* @__PURE__ */ V(ge, {
1734
- liveObject: ae,
1735
- realtime: oe
1736
- }) : null, xe = P.isVisible("show_actions") && !s && T && me.length > 0 ? /* @__PURE__ */ H("div", {
1733
+ }) : null, Ce = !o && x ? /* @__PURE__ */ B(ye, {
1734
+ liveObject: ce,
1735
+ realtime: le
1736
+ }) : null, we = j.isVisible("show_actions") && !o && x && _e.length > 0 ? /* @__PURE__ */ V("div", {
1737
1737
  style: {
1738
1738
  display: "flex",
1739
1739
  justifyContent: "flex-end",
@@ -1741,62 +1741,62 @@ function Ct({ title: r, recordId: i, editing: o, isNew: s, isRecordDeleted: c, d
1741
1741
  gap: 8,
1742
1742
  marginTop: 10
1743
1743
  },
1744
- children: [ye ? null : be, /* @__PURE__ */ V(we, {
1745
- layout: me,
1746
- row: w,
1747
- onRun: ve,
1744
+ children: [Se ? null : Ce, /* @__PURE__ */ B(De, {
1745
+ layout: _e,
1746
+ row: v,
1747
+ onRun: xe,
1748
1748
  kind: "detail",
1749
- entityActions: h?.actions,
1750
- globalActions: x,
1749
+ entityActions: m?.actions,
1750
+ globalActions: g,
1751
1751
  reservedRightWidth: 0,
1752
- widgetContext: he,
1753
- ariaLabel: ye ? "Detail toolbar actions" : "Page actions"
1752
+ widgetContext: ve,
1753
+ ariaLabel: Se ? "Detail toolbar actions" : "Page actions"
1754
1754
  })]
1755
- }) : null, Se = P.isVisible("show_actions") && !s && T && C ? /* @__PURE__ */ V(de, {
1756
- entityCode: C,
1755
+ }) : null, Te = j.isVisible("show_actions") && !o && x && _ ? /* @__PURE__ */ B(me, {
1756
+ entityCode: _,
1757
1757
  scope: "detail",
1758
- objectIds: [T],
1759
- capability: h?.documents,
1760
- canManageTemplates: M
1761
- }) : null, Ce = c ? p ? /* @__PURE__ */ V(S, {
1758
+ objectIds: [x],
1759
+ capability: m?.documents,
1760
+ canManageTemplates: k
1761
+ }) : null, Ee = s ? p ? /* @__PURE__ */ B(E, {
1762
1762
  kind: "primary",
1763
- icon: V(ie ? g : e.refresh, { size: 13 }),
1764
- onClick: A,
1765
- disabled: ie,
1766
- children: ie ? "Restoring…" : "Restore"
1767
- }) : null : o ? /* @__PURE__ */ H(Ze, { children: [/* @__PURE__ */ V(S, {
1768
- icon: /* @__PURE__ */ V(e.x, { size: 13 }),
1769
- onClick: ne,
1763
+ icon: B(O ? y : e.refresh, { size: 13 }),
1764
+ onClick: se,
1765
+ disabled: O,
1766
+ children: O ? "Restoring…" : "Restore"
1767
+ }) : null : a ? /* @__PURE__ */ V(Qe, { children: [/* @__PURE__ */ B(E, {
1768
+ icon: /* @__PURE__ */ B(e.x, { size: 13 }),
1769
+ onClick: ae,
1770
1770
  disabled: u,
1771
1771
  children: "Cancel"
1772
- }), /* @__PURE__ */ V(S, {
1772
+ }), /* @__PURE__ */ B(E, {
1773
1773
  kind: "primary",
1774
- icon: V(u ? g : e.save, { size: 13 }),
1775
- onClick: re,
1774
+ icon: B(u ? y : e.save, { size: 13 }),
1775
+ onClick: oe,
1776
1776
  disabled: u || d || f,
1777
1777
  title: d ? "Fix errors in child rows" : f ? "Fix the highlighted fields" : void 0,
1778
1778
  children: u ? "Saving…" : "Save"
1779
- })] }) : !s && T ? ye ? /* @__PURE__ */ H("span", {
1779
+ })] }) : !o && x ? Se ? /* @__PURE__ */ V("span", {
1780
1780
  style: { display: "contents" },
1781
- children: [Se, ye]
1782
- }) : Se : null;
1783
- return /* @__PURE__ */ H(Ze, { children: [/* @__PURE__ */ V(ut, {
1784
- icon: h?.display.icon ? /* @__PURE__ */ V(t, {
1785
- name: h.display.icon,
1781
+ children: [Te, Se]
1782
+ }) : Te : null;
1783
+ return /* @__PURE__ */ V(Qe, { children: [/* @__PURE__ */ B(ut, {
1784
+ icon: m?.display.icon ? /* @__PURE__ */ B(t, {
1785
+ name: m.display.icon,
1786
1786
  size: 16
1787
1787
  }) : void 0,
1788
- title: r,
1789
- description: m(_?.display?.description) || m(h?.display?.description),
1788
+ title: n,
1789
+ description: D(h?.display?.description) || D(m?.display?.description),
1790
1790
  recordId: i,
1791
- highlights: O,
1792
- identityControls: !c && !o && !s ? be : null,
1793
- mode: s ? "create" : o ? "edit" : "display",
1791
+ highlights: T,
1792
+ identityControls: !s && !a && !o ? Ce : null,
1793
+ mode: o ? "create" : a ? "edit" : "display",
1794
1794
  dirty: l,
1795
- showBack: te,
1796
- onBack: k,
1797
- right: Ce,
1798
- showTitle: P.isVisible("show_title")
1799
- }), xe] });
1795
+ showBack: re,
1796
+ onBack: ie,
1797
+ right: Ee,
1798
+ showTitle: j.isVisible("show_title")
1799
+ }), we] });
1800
1800
  }
1801
1801
  //#endregion
1802
1802
  export { J as SmartDetailPage };