@nivaro/react 0.3.23 → 0.3.25

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 (28) hide show
  1. package/dist/hooks/useSessionRecorder.js +1 -1
  2. package/dist/index.d.ts +50 -26
  3. package/dist/shared/components/FilePreviewLightbox.js +56 -35
  4. package/dist/shared/components/ItemEditForm.js +4309 -4263
  5. package/dist/shared/components/PageRenderer.js +63 -62
  6. package/dist/shared/components/ProfileView.js +555 -520
  7. package/dist/shared/components/RecordReadView.js +229 -229
  8. package/dist/shared/components/ReportView.js +123 -120
  9. package/dist/shared/components/ai/AiMarkdown.js +168 -148
  10. package/dist/shared/components/chat/RoomParts.js +120 -119
  11. package/dist/shared/components/chat/chat-core.js +228 -224
  12. package/dist/shared/components/item-edit/FieldRenderer.js +333 -333
  13. package/dist/shared/components/item-edit/FieldRow.js +413 -394
  14. package/dist/shared/components/item-edit/GroupSection.js +637 -635
  15. package/dist/shared/components/item-edit/InlineGridField.js +89 -90
  16. package/dist/shared/components/item-edit/QuickPicker.js +9 -9
  17. package/dist/shared/components/item-edit/RawEditSheet.js +80 -79
  18. package/dist/shared/components/item-edit/RowMatchPanel.js +1 -1
  19. package/dist/shared/components/item-edit/m2m-invalidate.js +19 -0
  20. package/dist/shared/components/item-edit/record-lookups.js +15 -0
  21. package/dist/shared/components/item-edit/render-stability.js +147 -0
  22. package/dist/shared/components/layout-editor/FormMapButton.js +5 -4
  23. package/dist/shared/components/notifications/DeliveryChips.js +27 -17
  24. package/dist/shared/components/profile/TeamsConnect.js +71 -0
  25. package/dist/shared/components/profile/primitives.js +4 -4
  26. package/dist/shared/lib/safe-href.js +10 -0
  27. package/dist/shared/lib/socket-realtime.js +107 -78
  28. package/package.json +6 -6
@@ -1,30 +1,30 @@
1
1
  import { jsx as r, jsxs as m, Fragment as ge } from "react/jsx-runtime";
2
- import { useQuery as V, useQueryClient as Ot } from "@tanstack/react-query";
3
- import { Pencil as At, ChevronDown as Ct } from "lucide-react";
4
- import { useMemo as be, useRef as Rt, useState as Z, useEffect as ye, useCallback as ot, Fragment as Dt } from "react";
5
- import { DrilldownContext as Lt, useNivaroClient as Oe, useApiFetchConfig as Et, useDrilldown as mt } from "../context.js";
6
- import { useDebounced as Pt } from "../hooks/useDebounced.js";
7
- import { parseAllowedCollections as Kt } from "../lib/allowed-collections.js";
2
+ import { useQuery as V, useQueryClient as Rt } from "@tanstack/react-query";
3
+ import { Pencil as Ct, ChevronDown as Dt } from "lucide-react";
4
+ import { useMemo as be, useRef as Lt, useState as ee, useEffect as ye, useCallback as ct, Fragment as Et } from "react";
5
+ import { DrilldownContext as Pt, useNivaroClient as Oe, useApiFetchConfig as Kt, useDrilldown as ft } from "../context.js";
6
+ import { useDebounced as jt } from "../hooks/useDebounced.js";
7
+ import { parseAllowedCollections as It } from "../lib/allowed-collections.js";
8
8
  import { get as G } from "../lib/commands.js";
9
- import { readGroupStructure as jt, isFolded as It, isEmptyValue as Ke, planFieldGrid as Wt } from "../lib/form-structure.js";
10
- import { useLiveRecord as Mt } from "../lib/live.js";
11
- import { isDisplayFormulaField as qe, resolvePlacementText as Vt, displayFormulaOf as Ut, formatDisplayValue as Bt } from "../lib/placement-behaviour.js";
12
- import { useRecordReader as Gt } from "../lib/record-loader.js";
13
- import { sanitizeHtml as Jt } from "../lib/sanitize-html.js";
14
- import { titleCase as He, formatRelative as Te } from "../lib/utils.js";
15
- import { matchesVisibleWhen as Ht } from "../lib/visible-when.js";
16
- import { InboundRequestPopover as Qt } from "./integrations/InboundRequest.js";
17
- import { FileM2MField as zt } from "./item-edit/FilePickerField.js";
18
- import { useFieldTouches as Yt } from "./item-edit/HeaderFreshness.js";
19
- import { richTextToPlain as Xt } from "./item-edit/helpers.js";
20
- import { usePlacementTextContext as Zt, evaluateDisplayFormula as el } from "./item-edit/placement-behaviour.js";
21
- import { UserChip as ft } from "./item-edit/UserChip.js";
22
- import { DesignNode as tl } from "./layout-editor/DesignNode.js";
23
- import { DesignCanvas as ll } from "./layout-editor/design-canvas.js";
24
- import { revealGroupKey as rl } from "./layout-editor/design-context.js";
25
- import { useRecordIntegrity as nl, integrityByField as al } from "./panels/RecordIntegrityBanner.js";
26
- import { SimpleSelectXs as ct } from "./ui/SimpleSelect.js";
27
- import { WidgetSlot as il } from "./WidgetSlot.js";
9
+ import { readGroupStructure as Wt, isFolded as Mt, isEmptyValue as je, planFieldGrid as Vt } from "../lib/form-structure.js";
10
+ import { useLiveRecord as Ut } from "../lib/live.js";
11
+ import { isDisplayFormulaField as qe, resolvePlacementText as Bt, displayFormulaOf as Gt, formatDisplayValue as Jt } from "../lib/placement-behaviour.js";
12
+ import { useRecordReader as Ht } from "../lib/record-loader.js";
13
+ import { sanitizeHtml as Qt } from "../lib/sanitize-html.js";
14
+ import { titleCase as Qe, formatRelative as Te } from "../lib/utils.js";
15
+ import { matchesVisibleWhen as zt } from "../lib/visible-when.js";
16
+ import { InboundRequestPopover as Yt } from "./integrations/InboundRequest.js";
17
+ import { FileM2MField as Xt } from "./item-edit/FilePickerField.js";
18
+ import { useFieldTouches as Zt } from "./item-edit/HeaderFreshness.js";
19
+ import { richTextToPlain as el } from "./item-edit/helpers.js";
20
+ import { usePlacementTextContext as tl, evaluateDisplayFormula as ll } from "./item-edit/placement-behaviour.js";
21
+ import { UserChip as pt } from "./item-edit/UserChip.js";
22
+ import { DesignNode as rl } from "./layout-editor/DesignNode.js";
23
+ import { DesignCanvas as nl } from "./layout-editor/design-canvas.js";
24
+ import { revealGroupKey as al } from "./layout-editor/design-context.js";
25
+ import { useRecordIntegrity as il, integrityByField as sl } from "./panels/RecordIntegrityBanner.js";
26
+ import { SimpleSelectXs as ut } from "./ui/SimpleSelect.js";
27
+ import { WidgetSlot as dl } from "./WidgetSlot.js";
28
28
  const he = (a) => {
29
29
  if (!a) return {};
30
30
  if (typeof a == "object") return a;
@@ -33,18 +33,18 @@ const he = (a) => {
33
33
  } catch {
34
34
  return {};
35
35
  }
36
- }, pt = (a) => {
36
+ }, ht = (a) => {
37
37
  const f = String(a).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
38
38
  if (f) return `${f[2]}/${f[3]}/${f[1]}`;
39
39
  const y = new Date(String(a));
40
40
  return Number.isNaN(y.getTime()) ? String(a) : `${String(y.getMonth() + 1).padStart(2, "0")}/${String(y.getDate()).padStart(2, "0")}/${y.getFullYear()}`;
41
- }, Qe = (a) => {
41
+ }, ze = (a) => {
42
42
  const f = Number(a);
43
43
  return Number.isNaN(f) ? String(a) : `$${f.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
44
- }, Ie = (a) => {
44
+ }, We = (a) => {
45
45
  const f = Number(a);
46
46
  return Number.isNaN(f) ? String(a) : f.toLocaleString("en-US");
47
- }, je = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", ee = () => /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), sl = `
47
+ }, Ie = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", te = () => /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), ol = `
48
48
  [data-read-board]{grid-template-columns:minmax(0,1fr)}
49
49
  [data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
50
50
  @media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
@@ -59,7 +59,7 @@ const he = (a) => {
59
59
  }
60
60
  @media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
61
61
  `;
62
- function We({
62
+ function Me({
63
63
  value: a,
64
64
  trueTone: f = "positive"
65
65
  }) {
@@ -72,8 +72,8 @@ function We({
72
72
  }
73
73
  );
74
74
  }
75
- function dl({ collection: a, id: f }) {
76
- const y = Oe(), c = Gt(), P = mt(), { data: S } = V({
75
+ function cl({ collection: a, id: f }) {
76
+ const y = Oe(), c = Ht(), P = ft(), { data: S } = V({
77
77
  queryKey: ["cbv-collection-meta", a],
78
78
  queryFn: () => y.request(
79
79
  G(`/collections/${a}`)
@@ -87,7 +87,7 @@ function dl({ collection: a, id: f }) {
87
87
  staleTime: 6e4,
88
88
  retry: !1
89
89
  });
90
- if (f == null) return /* @__PURE__ */ r(ee, {});
90
+ if (f == null) return /* @__PURE__ */ r(te, {});
91
91
  if (!$ && (W || !S))
92
92
  return /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 align-middle dark:bg-[hsl(var(--nvr-skeleton))]" });
93
93
  if (!$) return /* @__PURE__ */ m("span", { className: "text-slate-400", children: [
@@ -125,8 +125,8 @@ function dl({ collection: a, id: f }) {
125
125
  }
126
126
  ) : /* @__PURE__ */ r(ge, { children: _ });
127
127
  }
128
- function ol({ id: a }) {
129
- const f = Oe(), { apiBase: y } = Et(), { data: c, isPending: P } = V({
128
+ function ul({ id: a }) {
129
+ const f = Oe(), { apiBase: y } = Kt(), { data: c, isPending: P } = V({
130
130
  queryKey: ["rrv-file-meta", String(a)],
131
131
  queryFn: () => f.request(
132
132
  G(`/files/${a}/meta`)
@@ -135,7 +135,7 @@ function ol({ id: a }) {
135
135
  staleTime: 5 * 6e4,
136
136
  retry: !1
137
137
  });
138
- if (a == null) return /* @__PURE__ */ r(ee, {});
138
+ if (a == null) return /* @__PURE__ */ r(te, {});
139
139
  if (!c && P)
140
140
  return /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 align-middle dark:bg-[hsl(var(--nvr-skeleton))]" });
141
141
  const S = (c == null ? void 0 : c.title) || (c == null ? void 0 : c.filename_download) || `#${String(a)}`;
@@ -150,8 +150,8 @@ function ol({ id: a }) {
150
150
  }
151
151
  );
152
152
  }
153
- const ze = ({ collection: a, id: f }) => a === "nivaro_files" ? /* @__PURE__ */ r(ol, { id: f }) : /* @__PURE__ */ r(dl, { collection: a, id: f });
154
- function cl({
153
+ const Ye = ({ collection: a, id: f }) => a === "nivaro_files" ? /* @__PURE__ */ r(ul, { id: f }) : /* @__PURE__ */ r(cl, { collection: a, id: f });
154
+ function ml({
155
155
  junction: a,
156
156
  parentFk: f,
157
157
  junctionField: y,
@@ -168,7 +168,7 @@ function cl({
168
168
  retry: !1
169
169
  }), h = ((_ == null ? void 0 : _.relations) ?? []).find(
170
170
  (v) => v.many_collection === a && v.many_field === y
171
- ), q = Kt(h == null ? void 0 : h.one_allowed_collections), K = !!h && !h.one_collection && (q.length > 0 || !!h.one_collection_field), M = (h == null ? void 0 : h.one_collection_field) ?? "collection", k = (v) => v ? v === "directus_users" ? "nivaro_users" : v : null, x = (h == null ? void 0 : h.one_collection) ?? (K ? q.some((v) => v === "directus_users" || v === "nivaro_users") ? "nivaro_users" : k(q[0]) : null), { data: b } = V({
171
+ ), q = It(h == null ? void 0 : h.one_allowed_collections), K = !!h && !h.one_collection && (q.length > 0 || !!h.one_collection_field), M = (h == null ? void 0 : h.one_collection_field) ?? "collection", k = (v) => v ? v === "directus_users" ? "nivaro_users" : v : null, x = (h == null ? void 0 : h.one_collection) ?? (K ? q.some((v) => v === "directus_users" || v === "nivaro_users") ? "nivaro_users" : k(q[0]) : null), { data: b } = V({
172
172
  // Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
173
173
  // so never the same cache entry): every link write that refreshes the form's list —
174
174
  // a file upload, a picker change, the save itself — refreshes Summary's too. Its own
@@ -206,8 +206,8 @@ function cl({
206
206
  A !== void 0 && (P == null || P(A));
207
207
  }, [A, P]), ye(() => {
208
208
  N && (S == null || S(N));
209
- }, [N, S]), _ && !N && (!K || b) ? /* @__PURE__ */ r(ee, {}) : !O || !N ? /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : O.length === 0 ? /* @__PURE__ */ r(ee, {}) : N === "nivaro_files" && $ ? /* @__PURE__ */ r("div", { className: "mt-1", children: /* @__PURE__ */ r(
210
- zt,
209
+ }, [N, S]), _ && !N && (!K || b) ? /* @__PURE__ */ r(te, {}) : !O || !N ? /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : O.length === 0 ? /* @__PURE__ */ r(te, {}) : N === "nivaro_files" && $ ? /* @__PURE__ */ r("div", { className: "mt-1", children: /* @__PURE__ */ r(
210
+ Xt,
211
211
  {
212
212
  relation: $,
213
213
  parentId: c,
@@ -219,14 +219,14 @@ function cl({
219
219
  {
220
220
  className: "inline-flex items-center whitespace-nowrap",
221
221
  children: [
222
- /* @__PURE__ */ r(ze, { collection: w ?? N, id: v }),
222
+ /* @__PURE__ */ r(Ye, { collection: w ?? N, id: v }),
223
223
  F < O.length - 1 && /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
224
224
  ]
225
225
  },
226
226
  `${w ?? N}:${v}`
227
227
  )) });
228
228
  }
229
- function ul({
229
+ function fl({
230
230
  collection: a,
231
231
  fkField: f,
232
232
  parentId: y,
@@ -235,7 +235,7 @@ function ul({
235
235
  defaultPreset: S,
236
236
  onCount: $
237
237
  }) {
238
- const W = Oe(), _ = mt(), h = (P ?? []).filter((t) => t && Array.isArray(t.columns)), [q, K] = Z(
238
+ const W = Oe(), _ = ft(), h = (P ?? []).filter((t) => t && Array.isArray(t.columns)), [q, K] = ee(
239
239
  () => {
240
240
  var t;
241
241
  return h.length >= 2 ? ((t = h.find((i) => i.name === S)) == null ? void 0 : t.name) ?? h[0].name : "__all__";
@@ -278,20 +278,20 @@ function ul({
278
278
  if (!N) return b;
279
279
  const t = new Set(N.columns), i = b.filter((d) => t.has(d.field));
280
280
  return i.length > 0 ? i : b;
281
- }, [b, N]), [j, v] = Z(""), [w, F] = Z(1), [ae, J] = Z({}), Y = Pt(ae, 350), Ae = be(() => {
281
+ }, [b, N]), [j, v] = ee(""), [w, F] = ee(1), [ae, J] = ee({}), z = jt(ae, 350), Ae = be(() => {
282
282
  const t = [
283
283
  { path: [f], op: "_eq", value: y }
284
284
  ];
285
- for (const [i, d] of Object.entries(Y)) {
285
+ for (const [i, d] of Object.entries(z)) {
286
286
  if (!(d != null && d.value.trim())) continue;
287
287
  const p = d.value.trim(), T = Number(p), D = d.op === "_contains" ? p : p === "true" || p === "false" ? p === "true" : Number.isNaN(T) ? p : T;
288
288
  t.push({ path: [i], op: d.op, value: D });
289
289
  }
290
290
  return JSON.stringify(t);
291
- }, [Y, f, y]), u = 25, {
291
+ }, [z, f, y]), u = 25, {
292
292
  data: U,
293
- isLoading: oe,
294
- isFetching: Ce
293
+ isLoading: ce,
294
+ isFetching: Re
295
295
  } = V({
296
296
  queryKey: ["rrv-rows", a, f, y, j, O, w, Ae],
297
297
  queryFn: () => W.request(
@@ -305,34 +305,34 @@ function ul({
305
305
  placeholderData: (t) => t,
306
306
  staleTime: 3e4,
307
307
  retry: !1
308
- }), C = (U == null ? void 0 : U.data) ?? [], X = (U == null ? void 0 : U.total) ?? C.length, H = Object.values(Y).some((t) => !!(t != null && t.value.trim()));
308
+ }), R = (U == null ? void 0 : U.data) ?? [], Y = (U == null ? void 0 : U.total) ?? R.length, H = Object.values(z).some((t) => !!(t != null && t.value.trim()));
309
309
  ye(() => {
310
- U && !H && ($ == null || $(X));
311
- }, [U, H, X, $]);
312
- const ce = A.filter((t) => t.field.includes(".")), ue = C.map((t) => String(t.id)), { data: Q } = V({
310
+ U && !H && ($ == null || $(Y));
311
+ }, [U, H, Y, $]);
312
+ const ue = A.filter((t) => t.field.includes(".")), me = R.map((t) => String(t.id)), { data: Q } = V({
313
313
  queryKey: [
314
314
  "rrv-resolve-paths",
315
315
  a,
316
- ce.map((t) => t.field).join(","),
317
- ue.join(",")
316
+ ue.map((t) => t.field).join(","),
317
+ me.join(",")
318
318
  ],
319
319
  queryFn: () => W.request(
320
320
  G(`/items/${a}/resolve-paths`, {
321
- ids: ue.join(","),
322
- paths: ce.map((t) => t.field).join(",")
321
+ ids: me.join(","),
322
+ paths: ue.map((t) => t.field).join(",")
323
323
  })
324
324
  ).then((t) => t.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
325
- enabled: ce.length > 0 && ue.length > 0,
325
+ enabled: ue.length > 0 && me.length > 0,
326
326
  staleTime: 3e4
327
- }), R = O && C.some((t) => t.line_number != null), xe = Math.max(1, Math.ceil(X / u)), ie = (t, i, d) => {
327
+ }), C = O && R.some((t) => t.line_number != null), xe = Math.max(1, Math.ceil(Y / u)), ie = (t, i, d) => {
328
328
  F(1), J((p) => {
329
329
  const T = { ...p };
330
330
  return d ? T[t] = { op: i, value: d } : delete T[t], T;
331
331
  });
332
- }, Me = (t) => {
332
+ }, Ve = (t) => {
333
333
  F(1), v((i) => i === t ? `-${t}` : i === `-${t}` ? "" : t);
334
334
  };
335
- if (oe)
335
+ if (ce)
336
336
  return /* @__PURE__ */ r("div", { className: "space-y-1.5 py-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ r(
337
337
  "div",
338
338
  {
@@ -340,42 +340,42 @@ function ul({
340
340
  },
341
341
  t
342
342
  )) });
343
- if (C.length === 0 && Object.keys(Y).length === 0)
343
+ if (R.length === 0 && Object.keys(z).length === 0)
344
344
  return /* @__PURE__ */ r("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
345
- const Ve = (t, i) => {
346
- var D, te;
345
+ const Ue = (t, i) => {
346
+ var D, le;
347
347
  if (i.field.includes(".")) {
348
- const le = (D = Q == null ? void 0 : Q.rows[String(t.id)]) == null ? void 0 : D[i.field];
348
+ const re = (D = Q == null ? void 0 : Q.rows[String(t.id)]) == null ? void 0 : D[i.field];
349
349
  if (!Q)
350
350
  return /* @__PURE__ */ r("span", { className: "inline-block h-3 w-14 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
351
- if (!le || le.value === "") return /* @__PURE__ */ r(ee, {});
352
- const Ee = Q.targets[i.field], me = (te = le.ids) == null ? void 0 : te[0];
353
- return _ && Ee && me ? /* @__PURE__ */ r(
351
+ if (!re || re.value === "") return /* @__PURE__ */ r(te, {});
352
+ const Ee = Q.targets[i.field], fe = (le = re.ids) == null ? void 0 : le[0];
353
+ return _ && Ee && fe ? /* @__PURE__ */ r(
354
354
  "button",
355
355
  {
356
356
  type: "button",
357
- onClick: (fe) => {
358
- fe.stopPropagation(), _.open({ collection: Ee, itemId: String(me) });
357
+ onClick: (pe) => {
358
+ pe.stopPropagation(), _.open({ collection: Ee, itemId: String(fe) });
359
359
  },
360
360
  className: "text-left underline decoration-slate-300 underline-offset-2 hover:text-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan",
361
- children: le.value
361
+ children: re.value
362
362
  }
363
- ) : le.value;
363
+ ) : re.value;
364
364
  }
365
365
  const d = t[i.field];
366
- if (i.type === "boolean" && d == null) return /* @__PURE__ */ r(We, { value: !1 });
367
- if (d == null || d === "") return /* @__PURE__ */ r(ee, {});
366
+ if (i.type === "boolean" && d == null) return /* @__PURE__ */ r(Me, { value: !1 });
367
+ if (d == null || d === "") return /* @__PURE__ */ r(te, {});
368
368
  const p = k(i.field);
369
369
  if (p === "nivaro_users")
370
- return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(ft, { userId: String(d), size: "compact" }) });
371
- if (p) return /* @__PURE__ */ r(ze, { collection: p, id: d });
372
- if (i.type === "boolean") return /* @__PURE__ */ r(We, { value: d });
373
- if (i.type === "decimal" || i.type === "float") return Qe(d);
374
- if (i.type === "integer") return Ie(d);
375
- if (i.type === "date" || i.type === "datetime" || i.type === "timestamp") return pt(d);
370
+ return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(pt, { userId: String(d), size: "compact" }) });
371
+ if (p) return /* @__PURE__ */ r(Ye, { collection: p, id: d });
372
+ if (i.type === "boolean") return /* @__PURE__ */ r(Me, { value: d });
373
+ if (i.type === "decimal" || i.type === "float") return ze(d);
374
+ if (i.type === "integer") return We(d);
375
+ if (i.type === "date" || i.type === "datetime" || i.type === "timestamp") return ht(d);
376
376
  const T = String(d);
377
377
  return T.length > 48 ? `${T.slice(0, 48)}…` : T;
378
- }, se = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !k(t.field) && !t.field.includes("."), Re = (t) => {
378
+ }, se = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !k(t.field) && !t.field.includes("."), Ce = (t) => {
379
379
  const i = t.options;
380
380
  if (!i) return {};
381
381
  if (typeof i == "string")
@@ -386,16 +386,16 @@ function ul({
386
386
  }
387
387
  return i;
388
388
  }, ve = (t) => {
389
- const i = Re(t).aggregate;
389
+ const i = Ce(t).aggregate;
390
390
  return typeof i == "string" && ["sum", "avg", "min", "max", "count"].includes(i) ? i : null;
391
391
  }, De = A.some((t) => ve(t)), _e = (t) => {
392
392
  const i = ve(t);
393
393
  if (!i) return null;
394
- const d = C.map((D) => Number(D[t.field])).filter((D) => !Number.isNaN(D));
394
+ const d = R.map((D) => Number(D[t.field])).filter((D) => !Number.isNaN(D));
395
395
  let p = null;
396
- if (i === "count" ? p = C.length : d.length > 0 && (i === "sum" ? p = d.reduce((D, te) => D + te, 0) : i === "avg" ? p = d.reduce((D, te) => D + te, 0) / d.length : i === "min" ? p = Math.min(...d) : i === "max" && (p = Math.max(...d))), p === null) return "—";
397
- const T = Re(t).format;
398
- return i === "count" || T === "int" ? Ie(Math.round(p)) : T === "currency" || t.type === "decimal" || t.type === "float" ? Qe(p) : i === "avg" ? p.toFixed(2) : Ie(p);
396
+ if (i === "count" ? p = R.length : d.length > 0 && (i === "sum" ? p = d.reduce((D, le) => D + le, 0) : i === "avg" ? p = d.reduce((D, le) => D + le, 0) / d.length : i === "min" ? p = Math.min(...d) : i === "max" && (p = Math.max(...d))), p === null) return "—";
397
+ const T = Ce(t).format;
398
+ return i === "count" || T === "int" ? We(Math.round(p)) : T === "currency" || t.type === "decimal" || t.type === "float" ? ze(p) : i === "avg" ? p.toFixed(2) : We(p);
399
399
  }, ke = (t) => !k(t.field) && !t.field.includes("."), Le = (t) => k(t.field) || t.field.includes(".") ? null : t.type === "boolean" ? "bool" : ["integer", "decimal", "float"].includes(t.type ?? "") ? "num" : ["string", "text"].includes(t.type ?? "") ? "text" : null, Ne = A.some((t) => Le(t) != null);
400
400
  return /* @__PURE__ */ m("div", { children: [
401
401
  h.length >= 2 && /* @__PURE__ */ r("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
@@ -415,20 +415,20 @@ function ul({
415
415
  /* @__PURE__ */ r(
416
416
  "div",
417
417
  {
418
- className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Ce && !oe ? "opacity-70" : ""}`,
418
+ className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Re && !ce ? "opacity-70" : ""}`,
419
419
  children: /* @__PURE__ */ m("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
420
420
  /* @__PURE__ */ m("thead", { children: [
421
421
  /* @__PURE__ */ m("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
422
- R && /* @__PURE__ */ r("th", { className: "h-7 w-8 px-2 text-right text-[9.5px] font-bold uppercase tracking-wider text-slate-400", children: "#" }),
422
+ C && /* @__PURE__ */ r("th", { className: "h-7 w-8 px-2 text-right text-[9.5px] font-bold uppercase tracking-wider text-slate-400", children: "#" }),
423
423
  A.map((t) => {
424
424
  const i = j === t.field || j === `-${t.field}`;
425
425
  return /* @__PURE__ */ m(
426
426
  "th",
427
427
  {
428
- onClick: () => ke(t) && Me(t.field),
428
+ onClick: () => ke(t) && Ve(t.field),
429
429
  className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${se(t) ? "text-right" : "text-left"} ${ke(t) ? "cursor-pointer hover:text-slate-700 dark:hover:text-slate-200" : ""}`,
430
430
  children: [
431
- t.label || He(t.field),
431
+ t.label || Qe(t.field),
432
432
  ke(t) && /* @__PURE__ */ r("span", { className: i ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: i ? j.startsWith("-") ? "▼" : "▲" : "⇅" })
433
433
  ]
434
434
  },
@@ -437,7 +437,7 @@ function ul({
437
437
  })
438
438
  ] }),
439
439
  Ne && /* @__PURE__ */ m("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
440
- R && /* @__PURE__ */ r("th", { className: "px-1.5 py-1" }),
440
+ C && /* @__PURE__ */ r("th", { className: "px-1.5 py-1" }),
441
441
  A.map((t) => {
442
442
  const i = Le(t), d = ae[t.field];
443
443
  return /* @__PURE__ */ m("th", { className: "px-1.5 py-1 font-normal", children: [
@@ -453,7 +453,7 @@ function ul({
453
453
  ),
454
454
  i === "num" && /* @__PURE__ */ m("span", { className: "flex items-center gap-0.5", children: [
455
455
  /* @__PURE__ */ r(
456
- ct,
456
+ ut,
457
457
  {
458
458
  value: (d == null ? void 0 : d.op) ?? "_eq",
459
459
  onChange: (p) => ie(t.field, p, (d == null ? void 0 : d.value) ?? ""),
@@ -477,7 +477,7 @@ function ul({
477
477
  )
478
478
  ] }),
479
479
  i === "bool" && /* @__PURE__ */ r(
480
- ct,
480
+ ut,
481
481
  {
482
482
  value: (d == null ? void 0 : d.value) ?? "",
483
483
  onChange: (p) => ie(t.field, "_eq", p),
@@ -495,26 +495,26 @@ function ul({
495
495
  ] })
496
496
  ] }),
497
497
  /* @__PURE__ */ m("tbody", { children: [
498
- C.length === 0 && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
498
+ R.length === 0 && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
499
499
  "td",
500
500
  {
501
- colSpan: A.length + (R ? 1 : 0),
501
+ colSpan: A.length + (C ? 1 : 0),
502
502
  className: "py-4 text-center text-[12px] text-slate-400",
503
503
  children: "No matches — adjust filters"
504
504
  }
505
505
  ) }),
506
- C.map((t) => /* @__PURE__ */ m(
506
+ R.map((t) => /* @__PURE__ */ m(
507
507
  "tr",
508
508
  {
509
509
  onClick: _ ? () => _.open({ collection: a, itemId: String(t.id) }) : void 0,
510
510
  className: `border-b border-slate-100 last:border-0 dark:border-slate-800 ${_ ? "cursor-pointer hover:bg-nvr-cyan/5 dark:hover:bg-nvr-cyan/10" : ""}`,
511
511
  children: [
512
- R && /* @__PURE__ */ r("td", { className: "px-2 py-1.5 text-right text-[11px] tabular-nums text-slate-400", children: t.line_number == null ? "" : String(t.line_number) }),
512
+ C && /* @__PURE__ */ r("td", { className: "px-2 py-1.5 text-right text-[11px] tabular-nums text-slate-400", children: t.line_number == null ? "" : String(t.line_number) }),
513
513
  A.map((i) => /* @__PURE__ */ r(
514
514
  "td",
515
515
  {
516
516
  className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${se(i) ? "text-right" : ""}`,
517
- children: Ve(t, i)
517
+ children: Ue(t, i)
518
518
  },
519
519
  i.field
520
520
  ))
@@ -523,13 +523,13 @@ function ul({
523
523
  String(t.id)
524
524
  ))
525
525
  ] }),
526
- De && C.length > 0 && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ m(
526
+ De && R.length > 0 && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ m(
527
527
  "tr",
528
528
  {
529
529
  "data-read-grid-footer": !0,
530
530
  className: "border-t border-slate-200 bg-slate-50 text-[11px] font-medium text-slate-600 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-300",
531
531
  children: [
532
- R && /* @__PURE__ */ r("td", {}),
532
+ C && /* @__PURE__ */ r("td", {}),
533
533
  A.map((t) => {
534
534
  const i = ve(t);
535
535
  return /* @__PURE__ */ r(
@@ -550,14 +550,14 @@ function ul({
550
550
  ] })
551
551
  }
552
552
  ),
553
- X > u && /* @__PURE__ */ m("div", { className: "mt-1.5 flex items-center justify-between", children: [
553
+ Y > u && /* @__PURE__ */ m("div", { className: "mt-1.5 flex items-center justify-between", children: [
554
554
  /* @__PURE__ */ m("p", { className: "text-[11px] tabular-nums text-slate-400", children: [
555
555
  ((w - 1) * u + 1).toLocaleString("en-US"),
556
556
  "–",
557
- Math.min(w * u, X).toLocaleString("en-US"),
557
+ Math.min(w * u, Y).toLocaleString("en-US"),
558
558
  " of",
559
559
  " ",
560
- X.toLocaleString("en-US")
560
+ Y.toLocaleString("en-US")
561
561
  ] }),
562
562
  /* @__PURE__ */ m("span", { className: "flex items-center gap-0.5", children: [
563
563
  /* @__PURE__ */ r(
@@ -589,7 +589,7 @@ function ul({
589
589
  ] })
590
590
  ] });
591
591
  }
592
- function ut({
592
+ function mt({
593
593
  collection: a,
594
594
  itemId: f,
595
595
  layoutData: y,
@@ -601,8 +601,8 @@ function ut({
601
601
  onEditSection: _,
602
602
  gridCounts: h
603
603
  }) {
604
- var lt;
605
- const q = Oe(), K = Zt(), M = c ? c.record ?? {} : null, k = !!(c != null && c.context.showHidden), x = c ? String(((lt = c.record) == null ? void 0 : lt.id) ?? "") : f ?? "", b = be(
604
+ var rt;
605
+ const q = Oe(), K = tl(), M = c ? c.record ?? {} : null, k = !!(c != null && c.context.showHidden), x = c ? String(((rt = c.record) == null ? void 0 : rt.id) ?? "") : f ?? "", b = be(
606
606
  () => c ? {
607
607
  ...c.layout,
608
608
  layout: c.layout.layout ?? { id: 0, name: "" }
@@ -612,19 +612,19 @@ function ut({
612
612
  kind: qe(e.field) ? "slot" : "field",
613
613
  field: e.field,
614
614
  group_key: e.group_key ?? null
615
- }), N = (e, l, s = !1) => c ? /* @__PURE__ */ r(tl, { target: e, children: s ? /* @__PURE__ */ r("div", { "data-design-hidden": !0, className: "opacity-40", children: l }) : l }) : l, A = be(
615
+ }), N = (e, l, s = !1) => c ? /* @__PURE__ */ r(rl, { target: e, children: s ? /* @__PURE__ */ r("div", { "data-design-hidden": !0, className: "opacity-40", children: l }) : l }) : l, A = be(
616
616
  () => [
617
617
  ...new Set(
618
618
  (c ? [] : (b == null ? void 0 : b.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
619
619
  )
620
620
  ].sort(),
621
621
  [b, c]
622
- ), { data: j } = Yt(a, x, A), v = (e) => {
622
+ ), { data: j } = Zt(a, x, A), v = (e) => {
623
623
  const l = j == null ? void 0 : j[e];
624
624
  if (!l) return null;
625
625
  const s = l.via !== "user";
626
626
  return l.caller && l.activity_id ? /* @__PURE__ */ r(
627
- Qt,
627
+ Yt,
628
628
  {
629
629
  activityId: l.activity_id,
630
630
  callerName: l.caller.name,
@@ -658,8 +658,8 @@ function ut({
658
658
  className: `ml-1 inline-block h-1.5 w-1.5 rounded-full align-middle ${s ? "bg-amber-400" : "bg-slate-300 dark:bg-slate-600"}`
659
659
  }
660
660
  );
661
- }, { data: w } = nl(a, x, !!$ && !c), F = be(
662
- () => $ && (w != null && w.enabled) ? al(w.findings) : null,
661
+ }, { data: w } = il(a, x, !!$ && !c), F = be(
662
+ () => $ && (w != null && w.enabled) ? sl(w.findings) : null,
663
663
  [$, w]
664
664
  ), ae = ({ field: e }) => {
665
665
  const l = F == null ? void 0 : F.get(e);
@@ -684,22 +684,22 @@ function ut({
684
684
  ).then((e) => e.data),
685
685
  staleTime: 10 * 6e4,
686
686
  retry: !1
687
- }), Y = Ot(), { data: Ae } = V({
687
+ }), z = Rt(), { data: Ae } = V({
688
688
  queryKey: ["rrv-record", a, x],
689
689
  enabled: !c,
690
690
  queryFn: () => q.request(G(`/items/${a}/${x}`)).then((e) => e.data),
691
- initialData: () => Y.getQueryData(["item", a, x]) ?? void 0,
691
+ initialData: () => z.getQueryData(["item", a, x]) ?? void 0,
692
692
  initialDataUpdatedAt: () => {
693
693
  var e;
694
- return (e = Y.getQueryState(["item", a, x])) == null ? void 0 : e.dataUpdatedAt;
694
+ return (e = z.getQueryState(["item", a, x])) == null ? void 0 : e.dataUpdatedAt;
695
695
  },
696
696
  staleTime: 3e4,
697
697
  retry: !1
698
698
  }), u = M ?? Ae;
699
- Mt(a, c ? null : x, (e) => {
700
- e.aspectsOnly || e.deleted || (Y.invalidateQueries({ queryKey: ["rrv-record", a, x] }), Y.invalidateQueries({ queryKey: ["field-touch", a, x] }));
699
+ Ut(a, c ? null : x, (e) => {
700
+ e.aspectsOnly || e.deleted || (z.invalidateQueries({ queryKey: ["rrv-record", a, x] }), z.invalidateQueries({ queryKey: ["field-touch", a, x] }));
701
701
  });
702
- const U = Rt(null), [oe, Ce] = Z(() => /* @__PURE__ */ new Set());
702
+ const U = Lt(null), [ce, Re] = ee(() => /* @__PURE__ */ new Set());
703
703
  ye(() => {
704
704
  const e = U.current;
705
705
  if (U.current = u ?? null, c || !e || !u || e === u) return;
@@ -707,11 +707,11 @@ function ut({
707
707
  (o) => !o.startsWith("__") && JSON.stringify(e[o]) !== JSON.stringify(u[o])
708
708
  );
709
709
  if (l.length === 0) return;
710
- Ce(new Set(l));
711
- const s = setTimeout(() => Ce(/* @__PURE__ */ new Set()), 2400);
710
+ Re(new Set(l));
711
+ const s = setTimeout(() => Re(/* @__PURE__ */ new Set()), 2400);
712
712
  return () => clearTimeout(s);
713
713
  }, [u, c]);
714
- const C = (e) => oe.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: X } = V({
714
+ const R = (e) => ce.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: Y } = V({
715
715
  queryKey: ["rrv-field-config", a, b.layout.id],
716
716
  enabled: !c,
717
717
  queryFn: () => q.request(
@@ -720,33 +720,33 @@ function ut({
720
720
  staleTime: 5 * 6e4,
721
721
  retry: !1
722
722
  }), H = be(
723
- () => new Map((X ?? (J == null ? void 0 : J.fields) ?? []).map((e) => [e.field, e])),
724
- [X, J]
725
- ), ce = (J == null ? void 0 : J.relations) ?? [], ue = (e) => {
723
+ () => new Map((Y ?? (J == null ? void 0 : J.fields) ?? []).map((e) => [e.field, e])),
724
+ [Y, J]
725
+ ), ue = (J == null ? void 0 : J.relations) ?? [], me = (e) => {
726
726
  var l;
727
- return ((l = ce.find(
727
+ return ((l = ue.find(
728
728
  (s) => s.many_collection === a && s.many_field === e && s.one_collection
729
729
  )) == null ? void 0 : l.one_collection) ?? null;
730
- }, Q = (e) => ce.find(
730
+ }, Q = (e) => ue.find(
731
731
  (l) => l.one_collection === a && (l.one_field === e || l.many_collection === e)
732
- ) ?? null, R = (e) => {
732
+ ) ?? null, C = (e) => {
733
733
  var l;
734
734
  return !((e.is_visible === void 0 || e.is_visible) && he(e.overrides).hidden !== !0 && !((l = H.get(e.field)) != null && l.hidden));
735
735
  }, xe = b.assignments.filter(
736
- (e) => (!e.field.startsWith("__") || qe(e.field)) && (k || !R(e))
736
+ (e) => (!e.field.startsWith("__") || qe(e.field)) && (k || !C(e))
737
737
  ), ie = b.assignments.filter(
738
738
  (e) => e.field.startsWith("__widget_") && e.widget_id != null && (k || e.is_visible === void 0 || !!e.is_visible)
739
- ), Me = (e) => {
739
+ ), Ve = (e) => {
740
740
  if (!e.input_bindings) return [];
741
741
  try {
742
742
  return JSON.parse(String(e.input_bindings));
743
743
  } catch {
744
744
  return [];
745
745
  }
746
- }, Ve = S || c ? b.assignments.filter(
746
+ }, Ue = S || c ? b.assignments.filter(
747
747
  (e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !qe(e.field) && (k || e.is_visible === void 0 || !!e.is_visible)
748
- ).sort((e, l) => e.sort - l.sort) : [], se = ["__pipeline__", "__addendums__"], Re = new Set(se), ve = (e) => (S == null ? void 0 : S(e.field, e)) ?? (c ? /* @__PURE__ */ r("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || He(e.field.replace(/^_+|_+$/g, "")) }) : null), De = (e, l = "trailing") => S || c ? Ve.filter(
749
- (s) => e === null ? s.group_key == null && l === "leading" === Re.has(s.field) : s.group_key === e
748
+ ).sort((e, l) => e.sort - l.sort) : [], se = ["__pipeline__", "__addendums__"], Ce = new Set(se), ve = (e) => (S == null ? void 0 : S(e.field, e)) ?? (c ? /* @__PURE__ */ r("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || Qe(e.field.replace(/^_+|_+$/g, "")) }) : null), De = (e, l = "trailing") => S || c ? Ue.filter(
749
+ (s) => e === null ? s.group_key == null && l === "leading" === Ce.has(s.field) : s.group_key === e
750
750
  ).sort(
751
751
  (s, o) => l === "leading" && e === null ? se.indexOf(s.field) - se.indexOf(o.field) : 0
752
752
  ).map((s) => ({ key: s.field, a: s, node: ve(s) })).filter((s) => s.node != null) : [], _e = (e, l = "trailing") => {
@@ -759,27 +759,27 @@ function ut({
759
759
  children: s.map((o) => /* @__PURE__ */ r("div", { children: N(
760
760
  { kind: "slot", field: o.a.field, group_key: o.a.group_key ?? null },
761
761
  o.node,
762
- R(o.a)
762
+ C(o.a)
763
763
  ) }, o.key))
764
764
  }
765
765
  );
766
- }, [ke, Le] = Z({}), Ne = (e) => k || ke[e] === !0, [t, i] = Z({}), d = ot(
766
+ }, [ke, Le] = ee({}), Ne = (e) => k || ke[e] === !0, [t, i] = ee({}), d = ct(
767
767
  (e) => (l) => i((s) => s[e] === l ? s : { ...s, [e]: l }),
768
768
  []
769
- ), [p, T] = Z({}), D = ot(
769
+ ), [p, T] = ee({}), D = ct(
770
770
  (e) => (l) => T((s) => s[e] === l ? s : { ...s, [e]: l }),
771
771
  []
772
- ), te = (e) => {
772
+ ), le = (e) => {
773
773
  const l = ie.filter((o) => o.group_key === e).sort((o, g) => o.sort - g.sort);
774
774
  if (l.length === 0) return null;
775
775
  const s = l.some((o) => Ne(o.field));
776
776
  return /* @__PURE__ */ r("div", { className: s ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: l.map((o) => /* @__PURE__ */ r("div", { hidden: !Ne(o.field), children: N(
777
777
  { kind: "slot", field: o.field, group_key: o.group_key ?? null },
778
778
  /* @__PURE__ */ r(
779
- il,
779
+ dl,
780
780
  {
781
781
  widgetId: o.widget_id,
782
- inputBindings: Me(o),
782
+ inputBindings: Ve(o),
783
783
  itemDraft: u ?? {},
784
784
  itemCollection: a,
785
785
  ready: !!u,
@@ -790,31 +790,31 @@ function ut({
790
790
  )
791
791
  }
792
792
  ),
793
- R(o)
793
+ C(o)
794
794
  ) }, o.field)) });
795
- }, le = [...b.groups].sort((e, l) => e.sort - l.sort).filter((e) => k || e.visibility_mode !== "new_only").filter((e) => k || !u || Ht(e.visible_when, u)), [Ee, me] = Z(() => /* @__PURE__ */ new Set()), fe = (e) => !e.is_collapsed || Ee.has(e.key), ht = (e) => me((l) => {
795
+ }, re = [...b.groups].sort((e, l) => e.sort - l.sort).filter((e) => k || e.visibility_mode !== "new_only").filter((e) => k || !u || zt(e.visible_when, u)), [Ee, fe] = ee(() => /* @__PURE__ */ new Set()), pe = (e) => !e.is_collapsed || Ee.has(e.key), gt = (e) => fe((l) => {
796
796
  const s = new Set(l);
797
797
  return s.has(e) ? s.delete(e) : s.add(e), s;
798
798
  }), we = (c == null ? void 0 : c.context.fold) ?? null, Se = (c == null ? void 0 : c.context.reveal) ?? null;
799
799
  ye(() => {
800
- we && me(we.open ? new Set(b.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
800
+ we && fe(we.open ? new Set(b.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
801
801
  }, [we == null ? void 0 : we.seq]), ye(() => {
802
- const e = Se ? rl(Se.target) : null;
803
- e && me((l) => l.has(e) ? l : new Set(l).add(e));
802
+ const e = Se ? al(Se.target) : null;
803
+ e && fe((l) => l.has(e) ? l : new Set(l).add(e));
804
804
  }, [Se == null ? void 0 : Se.seq]);
805
- const Ue = [];
806
- for (const e of le) {
805
+ const Be = [];
806
+ for (const e of re) {
807
807
  if (e.type === "container") {
808
- for (const l of le.filter((s) => s.container_id != null && s.container_id === e.id))
809
- Ue.push(l);
808
+ for (const l of re.filter((s) => s.container_id != null && s.container_id === e.id))
809
+ Be.push(l);
810
810
  continue;
811
811
  }
812
- e.container_id == null && Ue.push(e);
812
+ e.container_id == null && Be.push(e);
813
813
  }
814
- const re = (e) => {
814
+ const X = (e) => {
815
815
  var l;
816
816
  return !!((l = Q(e.field)) != null && l.junction_field);
817
- }, Ye = (e) => {
817
+ }, Xe = (e) => {
818
818
  var s;
819
819
  const l = String(
820
820
  he(e.overrides).interface ?? ((s = H.get(e.field)) == null ? void 0 : s.interface) ?? ""
@@ -823,14 +823,14 @@ function ut({
823
823
  }, Pe = (e) => {
824
824
  const l = H.get(e.field), s = he(e.overrides);
825
825
  if (qe(e.field)) {
826
- const L = Ut(s), de = el((L == null ? void 0 : L.expr) ?? "", u ?? {});
827
- return /* @__PURE__ */ r("span", { "data-display-formula": e.field, className: "tabular-nums", children: de.error ? "—" : Bt(de.value, L ?? { format: "", currency: null }) });
826
+ const L = Gt(s), oe = ll((L == null ? void 0 : L.expr) ?? "", u ?? {});
827
+ return /* @__PURE__ */ r("span", { "data-display-formula": e.field, className: "tabular-nums", children: oe.error ? "—" : Jt(oe.value, L ?? { format: "", currency: null }) });
828
828
  }
829
829
  const o = Q(e.field);
830
- if (c && !x && (o != null && o.junction_field)) return /* @__PURE__ */ r(ee, {});
830
+ if (c && !x && (o != null && o.junction_field)) return /* @__PURE__ */ r(te, {});
831
831
  if (o != null && o.junction_field && o.many_collection && o.many_field)
832
832
  return /* @__PURE__ */ r(
833
- cl,
833
+ ml,
834
834
  {
835
835
  junction: o.many_collection,
836
836
  parentFk: o.many_field,
@@ -841,46 +841,46 @@ function ut({
841
841
  relation: o
842
842
  }
843
843
  );
844
- const g = u == null ? void 0 : u[e.field], I = ue(e.field);
844
+ const g = u == null ? void 0 : u[e.field], I = me(e.field);
845
845
  if (I === "nivaro_users" && g != null)
846
- return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(ft, { userId: String(g), size: "compact" }) });
847
- if (I) return /* @__PURE__ */ r(ze, { collection: I, id: g });
848
- if ((l == null ? void 0 : l.type) === "boolean" && (g == null || g === "")) return /* @__PURE__ */ r(We, { value: !1 });
849
- if (g == null || g === "") return /* @__PURE__ */ r(ee, {});
846
+ return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(pt, { userId: String(g), size: "compact" }) });
847
+ if (I) return /* @__PURE__ */ r(Ye, { collection: I, id: g });
848
+ if ((l == null ? void 0 : l.type) === "boolean" && (g == null || g === "")) return /* @__PURE__ */ r(Me, { value: !1 });
849
+ if (g == null || g === "") return /* @__PURE__ */ r(te, {});
850
850
  if ((l == null ? void 0 : l.type) === "boolean")
851
851
  return /* @__PURE__ */ r(
852
- We,
852
+ Me,
853
853
  {
854
854
  value: g,
855
855
  trueTone: (s.options ?? {}).trueTone ?? "positive"
856
856
  }
857
857
  );
858
- const z = s.options ?? {};
859
- return Ye(e) && typeof g == "string" ? /^\s*\{/.test(g) ? /* @__PURE__ */ r("div", { className: "min-w-0 whitespace-pre-wrap font-normal [overflow-wrap:anywhere]", children: Xt(g) }) : /* @__PURE__ */ r(
858
+ const Z = s.options ?? {};
859
+ return Xe(e) && typeof g == "string" ? /^\s*\{/.test(g) ? /* @__PURE__ */ r("div", { className: "min-w-0 whitespace-pre-wrap font-normal [overflow-wrap:anywhere]", children: el(g) }) : /* @__PURE__ */ r(
860
860
  "div",
861
861
  {
862
862
  className: "rrv-prose min-w-0 font-normal leading-relaxed [overflow-wrap:anywhere] [&_a]:underline [&_h1]:text-[15px] [&_h1]:font-semibold [&_h2]:text-[14px] [&_h2]:font-semibold [&_h3]:font-semibold [&_li]:ml-4 [&_ol]:list-decimal [&_p]:my-1 [&_ul]:list-disc",
863
- dangerouslySetInnerHTML: { __html: Jt(g) }
863
+ dangerouslySetInnerHTML: { __html: Qt(g) }
864
864
  }
865
- ) : z.format === "currency" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: Qe(g) }) : (l == null ? void 0 : l.type) === "decimal" || (l == null ? void 0 : l.type) === "float" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: Ie(g) }) : (l == null ? void 0 : l.type) === "date" || (l == null ? void 0 : l.type) === "datetime" || (l == null ? void 0 : l.type) === "timestamp" ? pt(g) : String(g);
866
- }, gt = (e) => {
865
+ ) : Z.format === "currency" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: ze(g) }) : (l == null ? void 0 : l.type) === "decimal" || (l == null ? void 0 : l.type) === "float" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: We(g) }) : (l == null ? void 0 : l.type) === "date" || (l == null ? void 0 : l.type) === "datetime" || (l == null ? void 0 : l.type) === "timestamp" ? ht(g) : String(g);
866
+ }, bt = (e) => {
867
867
  const l = he(e.overrides), s = Q(e.field);
868
868
  if (!(s != null && s.many_collection) || !s.many_field) return null;
869
869
  if (c && !x) return /* @__PURE__ */ r("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
870
870
  const o = l.options ?? {}, g = (() => {
871
871
  var L;
872
- const z = (L = H.get(e.field)) == null ? void 0 : L.options;
873
- if (!z) return {};
874
- if (typeof z == "string")
872
+ const Z = (L = H.get(e.field)) == null ? void 0 : L.options;
873
+ if (!Z) return {};
874
+ if (typeof Z == "string")
875
875
  try {
876
- return JSON.parse(z);
876
+ return JSON.parse(Z);
877
877
  } catch {
878
878
  return {};
879
879
  }
880
- return z;
880
+ return Z;
881
881
  })(), I = o.layout_id ?? null;
882
882
  return /* @__PURE__ */ r(
883
- ul,
883
+ fl,
884
884
  {
885
885
  collection: s.many_collection,
886
886
  fkField: s.many_field,
@@ -892,29 +892,29 @@ function ut({
892
892
  },
893
893
  e.field
894
894
  );
895
- }, pe = (e) => !!Q(e.field) && !re(e), bt = !!b.layout.hide_empty, Xe = Array.isArray(b.layout.header_fields) ? b.layout.header_fields.filter((e) => typeof e == "string") : [], yt = new Set(Xe), xt = (e) => {
896
- if (!u || re(e)) return !1;
895
+ }, de = (e) => !!Q(e.field) && !X(e), yt = !!b.layout.hide_empty, Ze = Array.isArray(b.layout.header_fields) ? b.layout.header_fields.filter((e) => typeof e == "string") : [], xt = new Set(Ze), vt = (e) => {
896
+ if (!u || X(e)) return !1;
897
897
  const l = u[e.field];
898
898
  return l == null || l === "" || Array.isArray(l) && l.length === 0;
899
- }, vt = (e) => xe.find((l) => l.field === e), $e = (e) => {
899
+ }, _t = (e) => xe.find((l) => l.field === e), $e = (e) => {
900
900
  var o;
901
- const l = he(e.overrides).label, s = K ? Vt(e.overrides, K).label : void 0;
902
- return s !== void 0 ? s : qe(e.field) ? typeof l == "string" && l.trim() ? l : "Formula" : typeof l == "string" && l.trim() ? l : e.label_override || ((o = H.get(e.field)) == null ? void 0 : o.label) || He(e.field);
903
- }, _t = (e) => {
904
- const l = jt(e.swap_config), s = xe.filter((n) => n.group_key === e.key && !yt.has(n.field)).filter((n) => k || !u || !It(n.overrides) || !Ke(u[n.field])).sort((n, E) => n.sort - E.sort), o = ie.filter((n) => n.group_key === e.key), g = De(e.key), I = s.length === 0 && o.length === 0 && g.length === 0;
901
+ const l = he(e.overrides).label, s = K ? Bt(e.overrides, K).label : void 0;
902
+ return s !== void 0 ? s : qe(e.field) ? typeof l == "string" && l.trim() ? l : "Formula" : typeof l == "string" && l.trim() ? l : e.label_override || ((o = H.get(e.field)) == null ? void 0 : o.label) || Qe(e.field);
903
+ }, kt = (e) => {
904
+ const l = Wt(e.swap_config), s = xe.filter((n) => n.group_key === e.key && !xt.has(n.field)).filter((n) => k || !u || !Mt(n.overrides) || !je(u[n.field])).sort((n, E) => n.sort - E.sort), o = ie.filter((n) => n.group_key === e.key), g = De(e.key), I = s.length === 0 && o.length === 0 && g.length === 0;
905
905
  if (I && !c) return null;
906
- const z = (n) => bt && !k && (pe(n) || re(n)) && ((h == null ? void 0 : h[n.field]) ?? t[n.field]) === 0, L = s.filter((n) => !pe(n)), de = s.filter(pe), Be = o.filter((n) => Ne(n.field)), Nt = s.filter((n) => !z(n)), wt = (n) => (h == null ? void 0 : h[n.field]) ?? t[n.field], St = !!e.hide_when_empty && !c && !k && !!u && g.length === 0 && Be.length === 0 && s.every((n) => pe(n) || re(n) ? wt(n) === 0 : Ke(u[n.field])) || !I && Nt.length === 0 && g.length === 0 && Be.length === 0, $t = (n) => (h == null ? void 0 : h[n.field]) ?? t[n.field], Ge = !!l.emptyText && !!u && !c && g.length === 0 && Be.length === 0 && s.every((n) => pe(n) || re(n) ? $t(n) === 0 : Ke(u[n.field])), Ft = Wt(L, { rows: l.rows }).units, rt = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : de.length > 0 || o.length > 0 || g.length > 0 || L.length > 4 ? "full" : "half", qt = (n) => {
907
- var it, st, dt;
908
- const E = z(n), B = !!(he(n.overrides).options ?? {}).emphasis, Fe = Ye(n) || !!((st = (it = H.get(n.field)) == null ? void 0 : it.interface) != null && st.includes("rich-text")), nt = u == null ? void 0 : u[n.field], at = !Fe && !re(n) && !ue(n.field) && (String(((dt = H.get(n.field)) == null ? void 0 : dt.interface) ?? "").includes("textarea") || typeof nt == "string" && nt.length > 36);
906
+ const Z = (n) => yt && !k && (de(n) || X(n)) && ((h == null ? void 0 : h[n.field]) ?? t[n.field]) === 0, L = s.filter((n) => !de(n)), oe = s.filter(de), Ke = o.filter((n) => Ne(n.field)), wt = !e.hide_when_empty && g.length === 0 && Ke.length === 0 && s.length > 0 && s.some((n) => de(n) || X(n)) && s.every(Z), Ge = (n) => !wt && Z(n), St = s.filter((n) => !Ge(n)), $t = (n) => (h == null ? void 0 : h[n.field]) ?? t[n.field], Ft = !!e.hide_when_empty && !c && !k && !!u && g.length === 0 && Ke.length === 0 && s.every((n) => de(n) || X(n) ? $t(n) === 0 : je(u[n.field])) || !I && St.length === 0 && g.length === 0 && Ke.length === 0, qt = (n) => (h == null ? void 0 : h[n.field]) ?? t[n.field], Je = !!l.emptyText && !!u && !c && g.length === 0 && Ke.length === 0 && s.every((n) => de(n) || X(n) ? qt(n) === 0 : je(u[n.field])), Tt = Vt(L, { rows: l.rows }).units, nt = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : oe.length > 0 || o.length > 0 || g.length > 0 || L.length > 4 ? "full" : "half", Ot = (n) => {
907
+ var st, dt, ot;
908
+ const E = Ge(n), B = !!(he(n.overrides).options ?? {}).emphasis, Fe = Xe(n) || !!((dt = (st = H.get(n.field)) == null ? void 0 : st.interface) != null && dt.includes("rich-text")), at = u == null ? void 0 : u[n.field], it = !Fe && !X(n) && !me(n.field) && (String(((ot = H.get(n.field)) == null ? void 0 : ot.interface) ?? "").includes("textarea") || typeof at == "string" && at.length > 36);
909
909
  return /* @__PURE__ */ r(
910
910
  "div",
911
911
  {
912
912
  hidden: E,
913
- className: `min-w-0 ${Fe || re(n) && (p[n.field] === "nivaro_files" || (t[n.field] ?? 0) > 3) ? "col-span-full" : B || at ? "col-span-2" : ""}`,
913
+ className: `min-w-0 ${Fe || X(n) && (p[n.field] === "nivaro_files" || (t[n.field] ?? 0) > 3) ? "col-span-full" : B || it ? "col-span-2" : ""}`,
914
914
  children: N(
915
915
  O(n),
916
916
  /* @__PURE__ */ m(ge, { children: [
917
- /* @__PURE__ */ m("dt", { className: je, children: [
917
+ /* @__PURE__ */ m("dt", { className: Ie, children: [
918
918
  $e(n),
919
919
  /* @__PURE__ */ r(ae, { field: n.field }),
920
920
  v(n.field)
@@ -924,27 +924,27 @@ function ut({
924
924
  {
925
925
  "data-replay-field": n.field,
926
926
  "data-field-collection": a,
927
- "data-remote-changed": oe.has(n.field) || void 0,
928
- className: `mt-1 min-w-0${C(n.field)} ${B ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${re(n) || Fe ? "" : at ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
927
+ "data-remote-changed": ce.has(n.field) || void 0,
928
+ className: `mt-1 min-w-0${R(n.field)} ${B ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${X(n) || Fe ? "" : it ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
929
929
  children: u ? Pe(n) : /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
930
930
  }
931
931
  )
932
932
  ] }),
933
- R(n)
933
+ C(n)
934
934
  )
935
935
  },
936
936
  n.field
937
937
  );
938
- }, Tt = (n, E) => {
939
- const Je = u && !c ? E.filter((B) => !Ke(u[B.field])) : E;
938
+ }, At = (n, E) => {
939
+ const He = u && !c ? E.filter((B) => !je(u[B.field])) : E;
940
940
  return /* @__PURE__ */ m(
941
941
  "div",
942
942
  {
943
943
  "data-read-row": n.key,
944
944
  className: `min-w-0 ${E.length > 2 ? "col-span-full" : "col-span-2"}`,
945
945
  children: [
946
- /* @__PURE__ */ r("dt", { className: je, children: n.label.trim() || E.map($e).join(" / ") }),
947
- /* @__PURE__ */ r("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u ? Je.length === 0 ? /* @__PURE__ */ r(ee, {}) : Je.map((B, Fe) => /* @__PURE__ */ m(Dt, { children: [
946
+ /* @__PURE__ */ r("dt", { className: Ie, children: n.label.trim() || E.map($e).join(" / ") }),
947
+ /* @__PURE__ */ r("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u ? He.length === 0 ? /* @__PURE__ */ r(te, {}) : He.map((B, Fe) => /* @__PURE__ */ m(Et, { children: [
948
948
  Fe > 0 && /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
949
949
  N(
950
950
  O(B),
@@ -953,11 +953,11 @@ function ut({
953
953
  {
954
954
  "data-replay-field": B.field,
955
955
  "data-field-collection": a,
956
- className: `min-w-0 break-words${C(B.field)}`,
956
+ className: `min-w-0 break-words${R(B.field)}`,
957
957
  children: Pe(B)
958
958
  }
959
959
  ),
960
- R(B)
960
+ C(B)
961
961
  )
962
962
  ] }, B.field)) : /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-28 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) })
963
963
  ]
@@ -968,9 +968,9 @@ function ut({
968
968
  return /* @__PURE__ */ r(
969
969
  "section",
970
970
  {
971
- hidden: St,
971
+ hidden: Ft,
972
972
  "data-read-section": e.key,
973
- "data-read-width": rt,
973
+ "data-read-width": nt,
974
974
  className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
975
975
  children: N(
976
976
  { kind: "group", key: e.key },
@@ -978,45 +978,45 @@ function ut({
978
978
  /* @__PURE__ */ m(
979
979
  "h3",
980
980
  {
981
- className: `group/rs relative flex items-center justify-between gap-2 px-5 py-2.5 text-[12.5px] font-semibold text-slate-700 dark:text-slate-200 ${fe(e) ? "border-b border-slate-100 dark:border-slate-800" : ""}`,
981
+ className: `group/rs relative flex items-center justify-between gap-2 px-5 py-2.5 text-[12.5px] font-semibold text-slate-700 dark:text-slate-200 ${pe(e) ? "border-b border-slate-100 dark:border-slate-800" : ""}`,
982
982
  children: [
983
983
  e.is_collapsed ? /* @__PURE__ */ r(
984
984
  "button",
985
985
  {
986
986
  type: "button",
987
- onClick: () => ht(e.key),
988
- "aria-expanded": fe(e),
987
+ onClick: () => gt(e.key),
988
+ "aria-expanded": pe(e),
989
989
  className: "min-w-0 flex-1 text-left after:absolute after:inset-0 group-hover/rs:text-slate-900 dark:group-hover/rs:text-white",
990
990
  children: e.label
991
991
  }
992
992
  ) : /* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: e.label }),
993
- _ && (L.length > 0 || de.length > 0) && /* @__PURE__ */ r(
993
+ _ && (L.length > 0 || oe.length > 0) && /* @__PURE__ */ r(
994
994
  "button",
995
995
  {
996
996
  type: "button",
997
997
  "data-read-edit-section": e.key,
998
998
  onClick: () => {
999
999
  var n, E;
1000
- return _(e.key, ((n = L[0]) == null ? void 0 : n.field) ?? ((E = de[0]) == null ? void 0 : E.field) ?? null);
1000
+ return _(e.key, ((n = L[0]) == null ? void 0 : n.field) ?? ((E = oe[0]) == null ? void 0 : E.field) ?? null);
1001
1001
  },
1002
1002
  title: `Edit ${e.label}`,
1003
1003
  "aria-label": `Edit ${e.label}`,
1004
1004
  className: "relative -my-1 rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-slate-700 focus-visible:opacity-100 group-hover/rs:opacity-100 dark:hover:bg-white/5 dark:hover:text-slate-200 motion-reduce:transition-none",
1005
- children: /* @__PURE__ */ r(At, { className: "h-3 w-3" })
1005
+ children: /* @__PURE__ */ r(Ct, { className: "h-3 w-3" })
1006
1006
  }
1007
1007
  ),
1008
1008
  e.is_collapsed && /* @__PURE__ */ r(
1009
- Ct,
1009
+ Dt,
1010
1010
  {
1011
1011
  "aria-hidden": "true",
1012
- className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${fe(e) ? "" : "-rotate-90"}`
1012
+ className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${pe(e) ? "" : "-rotate-90"}`
1013
1013
  }
1014
1014
  )
1015
1015
  ]
1016
1016
  }
1017
1017
  ),
1018
- /* @__PURE__ */ m("div", { className: "px-5 pb-5 pt-4", hidden: !fe(e), children: [
1019
- Ge && /* @__PURE__ */ r(
1018
+ /* @__PURE__ */ m("div", { className: "px-5 pb-5 pt-4", hidden: !pe(e), children: [
1019
+ Je && /* @__PURE__ */ r(
1020
1020
  "p",
1021
1021
  {
1022
1022
  "data-read-empty": e.key,
@@ -1032,20 +1032,20 @@ function ut({
1032
1032
  "dl",
1033
1033
  {
1034
1034
  className: "grid gap-x-6 gap-y-5",
1035
- "data-read-dl": rt,
1036
- style: Ge ? { display: "none" } : void 0,
1037
- children: Ft.map(
1038
- (n) => n.kind === "row" ? Tt(n.row, n.members) : qt(n.field)
1035
+ "data-read-dl": nt,
1036
+ style: Je ? { display: "none" } : void 0,
1037
+ children: Tt.map(
1038
+ (n) => n.kind === "row" ? At(n.row, n.members) : Ot(n.field)
1039
1039
  )
1040
1040
  }
1041
1041
  ),
1042
- de.map((n) => {
1042
+ oe.map((n) => {
1043
1043
  var E;
1044
1044
  return /* @__PURE__ */ r(
1045
1045
  "div",
1046
1046
  {
1047
1047
  className: L.length > 0 ? "mt-3" : "",
1048
- hidden: z(n) || Ge,
1048
+ hidden: Ge(n) || Je,
1049
1049
  children: N(
1050
1050
  O(n),
1051
1051
  /* @__PURE__ */ m(ge, { children: [
@@ -1060,15 +1060,15 @@ function ut({
1060
1060
  "; switch to Edit to fix"
1061
1061
  ] })
1062
1062
  ] }) : null,
1063
- (W ? W(n) : null) ?? gt(n)
1063
+ (W ? W(n) : null) ?? bt(n)
1064
1064
  ] }),
1065
- R(n)
1065
+ C(n)
1066
1066
  )
1067
1067
  },
1068
1068
  n.field
1069
1069
  );
1070
1070
  }),
1071
- te(e.key),
1071
+ le(e.key),
1072
1072
  _e(e.key),
1073
1073
  I && c && /* @__PURE__ */ r(
1074
1074
  "div",
@@ -1085,14 +1085,14 @@ function ut({
1085
1085
  },
1086
1086
  e.key
1087
1087
  );
1088
- }, Ze = _e(null), kt = _e(null, "leading"), et = Xe.map((e) => vt(e)).filter((e) => !!e && !pe(e)).filter((e) => k || !xt(e)), [ne, ...tt] = et;
1088
+ }, et = _e(null), Nt = _e(null, "leading"), tt = Ze.map((e) => _t(e)).filter((e) => !!e && !de(e)).filter((e) => k || !vt(e)), [ne, ...lt] = tt;
1089
1089
  return /* @__PURE__ */ m(
1090
1090
  "div",
1091
1091
  {
1092
1092
  className: P ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
1093
1093
  children: [
1094
- kt,
1095
- et.length > 0 && /* @__PURE__ */ m(
1094
+ Nt,
1095
+ tt.length > 0 && /* @__PURE__ */ m(
1096
1096
  "div",
1097
1097
  {
1098
1098
  "data-read-header": !0,
@@ -1101,7 +1101,7 @@ function ut({
1101
1101
  ne && N(
1102
1102
  { kind: "header", field: ne.field },
1103
1103
  /* @__PURE__ */ m("div", { className: "min-w-0", children: [
1104
- /* @__PURE__ */ m("p", { className: je, children: [
1104
+ /* @__PURE__ */ m("p", { className: Ie, children: [
1105
1105
  $e(ne),
1106
1106
  /* @__PURE__ */ r(ae, { field: ne.field })
1107
1107
  ] }),
@@ -1110,17 +1110,17 @@ function ut({
1110
1110
  {
1111
1111
  "data-replay-field": ne.field,
1112
1112
  "data-field-collection": a,
1113
- className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${C(ne.field)}`,
1113
+ className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${R(ne.field)}`,
1114
1114
  children: u ? Pe(ne) : "…"
1115
1115
  }
1116
1116
  )
1117
1117
  ] }),
1118
- R(ne)
1118
+ C(ne)
1119
1119
  ),
1120
- tt.length > 0 && /* @__PURE__ */ r("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: tt.map((e) => /* @__PURE__ */ r("div", { className: "min-w-0", children: N(
1120
+ lt.length > 0 && /* @__PURE__ */ r("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: lt.map((e) => /* @__PURE__ */ r("div", { className: "min-w-0", children: N(
1121
1121
  { kind: "header", field: e.field },
1122
1122
  /* @__PURE__ */ m(ge, { children: [
1123
- /* @__PURE__ */ m("dt", { className: je, children: [
1123
+ /* @__PURE__ */ m("dt", { className: Ie, children: [
1124
1124
  $e(e),
1125
1125
  /* @__PURE__ */ r(ae, { field: e.field }),
1126
1126
  v(e.field)
@@ -1130,31 +1130,31 @@ function ut({
1130
1130
  {
1131
1131
  "data-replay-field": e.field,
1132
1132
  "data-field-collection": a,
1133
- "data-remote-changed": oe.has(e.field) || void 0,
1134
- className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${C(e.field)}`,
1133
+ "data-remote-changed": ce.has(e.field) || void 0,
1134
+ className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${R(e.field)}`,
1135
1135
  children: u ? Pe(e) : "…"
1136
1136
  }
1137
1137
  )
1138
1138
  ] }),
1139
- R(e)
1139
+ C(e)
1140
1140
  ) }, e.field)) })
1141
1141
  ]
1142
1142
  }
1143
1143
  ),
1144
- /* @__PURE__ */ r("style", { children: sl }),
1145
- J ? /* @__PURE__ */ r("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Ue.map(_t) }) : /* @__PURE__ */ m("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
1144
+ /* @__PURE__ */ r("style", { children: ol }),
1145
+ J ? /* @__PURE__ */ r("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Be.map(kt) }) : /* @__PURE__ */ m("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
1146
1146
  /* @__PURE__ */ r("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1147
1147
  /* @__PURE__ */ r("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1148
1148
  /* @__PURE__ */ r("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
1149
1149
  ] }),
1150
- Ze && /* @__PURE__ */ r("div", { className: "mt-4", children: Ze })
1150
+ et && /* @__PURE__ */ r("div", { className: "mt-4", children: et })
1151
1151
  ]
1152
1152
  }
1153
1153
  );
1154
1154
  }
1155
- function Ml(a) {
1156
- return a.design ? /* @__PURE__ */ r(ll, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ r(Lt.Provider, { value: null, children: /* @__PURE__ */ r(ut, { ...a }) }) }) : /* @__PURE__ */ r(ut, { ...a });
1155
+ function Ul(a) {
1156
+ return a.design ? /* @__PURE__ */ r(nl, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ r(Pt.Provider, { value: null, children: /* @__PURE__ */ r(mt, { ...a }) }) }) : /* @__PURE__ */ r(mt, { ...a });
1157
1157
  }
1158
1158
  export {
1159
- Ml as RecordReadView
1159
+ Ul as RecordReadView
1160
1160
  };