@nivaro/react 0.3.17 → 0.3.18

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,49 +1,50 @@
1
- import { jsx as r, jsxs as u, Fragment as he } from "react/jsx-runtime";
2
- import { useQuery as V, useQueryClient as qt } from "@tanstack/react-query";
3
- import { Pencil as Tt, ChevronDown as Ct } from "lucide-react";
4
- import { useMemo as ge, useRef as Ot, useState as Z, useEffect as be, useCallback as dt, Fragment as At } from "react";
5
- import { DrilldownContext as Rt, useNivaroClient as Ce, useApiFetchConfig as Dt, useDrilldown as ut } from "../context.js";
6
- import { useDebounced as Lt } from "../hooks/useDebounced.js";
7
- import { parseAllowedCollections as Pt } from "../lib/allowed-collections.js";
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";
8
8
  import { get as G } from "../lib/commands.js";
9
- import { readGroupStructure as Kt, isFolded as jt, isEmptyValue as Ge, planFieldGrid as Et } from "../lib/form-structure.js";
10
- import { useLiveRecord as It } from "../lib/live.js";
11
- import { isDisplayFormulaField as qe, resolvePlacementText as Wt, displayFormulaOf as Mt, formatDisplayValue as Ut } from "../lib/placement-behaviour.js";
12
- import { useRecordReader as Vt } from "../lib/record-loader.js";
13
- import { sanitizeHtml as Bt } from "../lib/sanitize-html.js";
14
- import { titleCase as Je, formatRelative as Te } from "../lib/utils.js";
15
- import { InboundRequestPopover as Gt } from "./integrations/InboundRequest.js";
16
- import { FileM2MField as Jt } from "./item-edit/FilePickerField.js";
17
- import { useFieldTouches as Ht } from "./item-edit/HeaderFreshness.js";
18
- import { richTextToPlain as Qt } from "./item-edit/helpers.js";
19
- import { usePlacementTextContext as zt, evaluateDisplayFormula as Yt } from "./item-edit/placement-behaviour.js";
20
- import { UserChip as mt } from "./item-edit/UserChip.js";
21
- import { DesignNode as Xt } from "./layout-editor/DesignNode.js";
22
- import { DesignCanvas as Zt } from "./layout-editor/design-canvas.js";
23
- import { revealGroupKey as el } from "./layout-editor/design-context.js";
24
- import { useRecordIntegrity as tl, integrityByField as ll } from "./panels/RecordIntegrityBanner.js";
25
- import { SimpleSelectXs as ot } from "./ui/SimpleSelect.js";
26
- import { WidgetSlot as rl } from "./WidgetSlot.js";
27
- const pe = (n) => {
28
- if (!n) return {};
29
- if (typeof n == "object") return n;
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";
28
+ const he = (a) => {
29
+ if (!a) return {};
30
+ if (typeof a == "object") return a;
30
31
  try {
31
- return JSON.parse(n);
32
+ return JSON.parse(a);
32
33
  } catch {
33
34
  return {};
34
35
  }
35
- }, ft = (n) => {
36
- const m = String(n).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
37
- if (m) return `${m[2]}/${m[3]}/${m[1]}`;
38
- const y = new Date(String(n));
39
- return Number.isNaN(y.getTime()) ? String(n) : `${String(y.getMonth() + 1).padStart(2, "0")}/${String(y.getDate()).padStart(2, "0")}/${y.getFullYear()}`;
40
- }, He = (n) => {
41
- const m = Number(n);
42
- return Number.isNaN(m) ? String(n) : `$${m.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
43
- }, Ie = (n) => {
44
- const m = Number(n);
45
- return Number.isNaN(m) ? String(n) : m.toLocaleString("en-US");
46
- }, Ee = "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: "—" }), nl = `
36
+ }, pt = (a) => {
37
+ const f = String(a).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
38
+ if (f) return `${f[2]}/${f[3]}/${f[1]}`;
39
+ const y = new Date(String(a));
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) => {
42
+ const f = Number(a);
43
+ return Number.isNaN(f) ? String(a) : `$${f.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
44
+ }, Ie = (a) => {
45
+ const f = Number(a);
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
48
  [data-read-board]{grid-template-columns:minmax(0,1fr)}
48
49
  [data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
49
50
  @media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
@@ -59,44 +60,44 @@ const pe = (n) => {
59
60
  @media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
60
61
  `;
61
62
  function We({
62
- value: n,
63
- trueTone: m = "positive"
63
+ value: a,
64
+ trueTone: f = "positive"
64
65
  }) {
65
- const y = n === !0 || n === 1 || n === "1" || n === "true";
66
+ const y = a === !0 || a === 1 || a === "1" || a === "true";
66
67
  return /* @__PURE__ */ r(
67
68
  "span",
68
69
  {
69
- className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${y ? m === "danger" ? "bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400" : "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
70
+ className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${y ? f === "danger" ? "bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400" : "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
70
71
  children: y ? "Yes" : "No"
71
72
  }
72
73
  );
73
74
  }
74
- function al({ collection: n, id: m }) {
75
- const y = Ce(), c = Vt(), P = ut(), { data: w } = V({
76
- queryKey: ["cbv-collection-meta", n],
75
+ function dl({ collection: a, id: f }) {
76
+ const y = Oe(), c = Gt(), P = mt(), { data: S } = V({
77
+ queryKey: ["cbv-collection-meta", a],
77
78
  queryFn: () => y.request(
78
- G(`/collections/${n}`)
79
+ G(`/collections/${a}`)
79
80
  ).then((q) => q.data).catch(() => ({ display_template: null, fields: [] })),
80
81
  staleTime: 10 * 6e4,
81
82
  retry: !1
82
83
  }), { data: $, isPending: W } = V({
83
- queryKey: ["rrv-related", n, String(m)],
84
- queryFn: () => c(n, m).catch(() => null),
85
- enabled: m != null && !!w,
84
+ queryKey: ["rrv-related", a, String(f)],
85
+ queryFn: () => c(a, f).catch(() => null),
86
+ enabled: f != null && !!S,
86
87
  staleTime: 6e4,
87
88
  retry: !1
88
89
  });
89
- if (m == null) return /* @__PURE__ */ r(ee, {});
90
- if (!$ && (W || !w))
90
+ if (f == null) return /* @__PURE__ */ r(ee, {});
91
+ if (!$ && (W || !S))
91
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))]" });
92
- if (!$) return /* @__PURE__ */ u("span", { className: "text-slate-400", children: [
93
+ if (!$) return /* @__PURE__ */ m("span", { className: "text-slate-400", children: [
93
94
  "#",
94
- String(m)
95
+ String(f)
95
96
  ] });
96
97
  let _ = "";
97
- const h = w == null ? void 0 : w.display_template;
98
+ const h = S == null ? void 0 : S.display_template;
98
99
  if (h && (_ = h.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (q, K) => {
99
- const M = K.split(".").reduce((S, x) => S == null ? void 0 : S[x], $);
100
+ const M = K.split(".").reduce((k, x) => k == null ? void 0 : k[x], $);
100
101
  return M == null ? "" : String(M);
101
102
  }).trim()), !_) {
102
103
  for (const q of [
@@ -114,73 +115,85 @@ function al({ collection: n, id: m }) {
114
115
  break;
115
116
  }
116
117
  }
117
- return _ || (_ = `#${String(m)}`), P ? /* @__PURE__ */ r(
118
+ return _ || (_ = `#${String(f)}`), P ? /* @__PURE__ */ r(
118
119
  "button",
119
120
  {
120
121
  type: "button",
121
- onClick: () => P.open({ collection: n, itemId: String(m) }),
122
+ onClick: () => P.open({ collection: a, itemId: String(f) }),
122
123
  className: "text-left underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#007a99] hover:decoration-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan dark:hover:decoration-nvr-cyan",
123
124
  children: _
124
125
  }
125
- ) : /* @__PURE__ */ r(he, { children: _ });
126
+ ) : /* @__PURE__ */ r(ge, { children: _ });
126
127
  }
127
- function il({ id: n }) {
128
- const m = Ce(), { apiBase: y } = Dt(), { data: c, isPending: P } = V({
129
- queryKey: ["rrv-file-meta", String(n)],
130
- queryFn: () => m.request(
131
- G(`/files/${n}/meta`)
128
+ function ol({ id: a }) {
129
+ const f = Oe(), { apiBase: y } = Et(), { data: c, isPending: P } = V({
130
+ queryKey: ["rrv-file-meta", String(a)],
131
+ queryFn: () => f.request(
132
+ G(`/files/${a}/meta`)
132
133
  ).then(($) => $.data).catch(() => null),
133
- enabled: n != null,
134
+ enabled: a != null,
134
135
  staleTime: 5 * 6e4,
135
136
  retry: !1
136
137
  });
137
- if (n == null) return /* @__PURE__ */ r(ee, {});
138
+ if (a == null) return /* @__PURE__ */ r(ee, {});
138
139
  if (!c && P)
139
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))]" });
140
- const w = (c == null ? void 0 : c.title) || (c == null ? void 0 : c.filename_download) || `#${String(n)}`;
141
+ const S = (c == null ? void 0 : c.title) || (c == null ? void 0 : c.filename_download) || `#${String(a)}`;
141
142
  return /* @__PURE__ */ r(
142
143
  "a",
143
144
  {
144
- href: `${y}/files/${n}`,
145
+ href: `${y}/files/${a}`,
145
146
  target: "_blank",
146
147
  rel: "noreferrer",
147
148
  className: "underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#007a99] hover:decoration-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan dark:hover:decoration-nvr-cyan",
148
- children: w
149
+ children: S
149
150
  }
150
151
  );
151
152
  }
152
- const Qe = ({ collection: n, id: m }) => n === "nivaro_files" ? /* @__PURE__ */ r(il, { id: m }) : /* @__PURE__ */ r(al, { collection: n, id: m });
153
- function sl({
154
- junction: n,
155
- parentFk: m,
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({
155
+ junction: a,
156
+ parentFk: f,
156
157
  junctionField: y,
157
158
  parentId: c,
158
159
  onCount: P,
159
- onTarget: w,
160
+ onTarget: S,
160
161
  relation: $
161
162
  }) {
162
163
  var j;
163
- const W = Ce(), { data: _ } = V({
164
- queryKey: ["cbv-collection-meta", n],
165
- queryFn: () => W.request(G(`/collections/${n}`)).then((v) => v.data),
164
+ const W = Oe(), { data: _ } = V({
165
+ queryKey: ["cbv-collection-meta", a],
166
+ queryFn: () => W.request(G(`/collections/${a}`)).then((v) => v.data),
166
167
  staleTime: 10 * 6e4,
167
168
  retry: !1
168
169
  }), h = ((_ == null ? void 0 : _.relations) ?? []).find(
169
- (v) => v.many_collection === n && v.many_field === y
170
- ), q = Pt(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", S = (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" : S(q[0]) : null), { data: b } = V({
171
- queryKey: ["rrv-m2m", n, m, c, y, K ? M : ""],
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({
172
+ // Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
173
+ // so never the same cache entry): every link write that refreshes the form's list —
174
+ // a file upload, a picker change, the save itself — refreshes Summary's too. Its own
175
+ // 'rrv-m2m' key heard none of them, so a file added this session never showed here.
176
+ queryKey: [
177
+ "m2m-items",
178
+ a,
179
+ f,
180
+ c,
181
+ "rrv",
182
+ y,
183
+ K ? M : ""
184
+ ],
172
185
  queryFn: () => W.request(
173
- G(`/items/${n}`, {
174
- filter: JSON.stringify({ [m]: { _eq: c } }),
186
+ G(`/items/${a}`, {
187
+ filter: JSON.stringify({ [f]: { _eq: c } }),
175
188
  fields: K ? `id,${y},${M}` : `id,${y}`,
176
189
  limit: 200
177
190
  })
178
191
  ).then(
179
- (v) => (v.data ?? []).filter((N) => N[y] != null).map((N) => {
180
- const F = N[y];
192
+ (v) => (v.data ?? []).filter((w) => w[y] != null).map((w) => {
193
+ const F = w[y];
181
194
  return {
182
195
  id: String(typeof F == "object" ? F.id : F),
183
- collection: K ? S(N[M]) : null
196
+ collection: K ? k(w[M]) : null
184
197
  };
185
198
  })
186
199
  ).catch(() => []),
@@ -188,64 +201,64 @@ function sl({
188
201
  enabled: !!_,
189
202
  staleTime: 3e4,
190
203
  retry: !1
191
- }), C = b == null ? void 0 : b.map((v) => v.id), k = x ?? (K ? ((j = b == null ? void 0 : b.find((v) => v.collection)) == null ? void 0 : j.collection) ?? null : null), O = C == null ? void 0 : C.length;
192
- return be(() => {
193
- O !== void 0 && (P == null || P(O));
194
- }, [O, P]), be(() => {
195
- k && (w == null || w(k));
196
- }, [k, w]), _ && !k && (!K || b) ? /* @__PURE__ */ r(ee, {}) : !C || !k ? /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ r(ee, {}) : k === "nivaro_files" && $ ? /* @__PURE__ */ r("div", { className: "mt-1", children: /* @__PURE__ */ r(
197
- Jt,
204
+ }), O = b == null ? void 0 : b.map((v) => v.id), N = x ?? (K ? ((j = b == null ? void 0 : b.find((v) => v.collection)) == null ? void 0 : j.collection) ?? null : null), A = O == null ? void 0 : O.length;
205
+ return ye(() => {
206
+ A !== void 0 && (P == null || P(A));
207
+ }, [A, P]), ye(() => {
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,
198
211
  {
199
212
  relation: $,
200
213
  parentId: c,
201
214
  allRelations: [],
202
215
  disabled: !0
203
216
  }
204
- ) }) : /* @__PURE__ */ r("span", { className: "flex flex-wrap gap-x-1.5 gap-y-0.5", children: (b ?? []).map(({ id: v, collection: N }, F) => /* @__PURE__ */ u(
217
+ ) }) : /* @__PURE__ */ r("span", { className: "flex flex-wrap gap-x-1.5 gap-y-0.5", children: (b ?? []).map(({ id: v, collection: w }, F) => /* @__PURE__ */ m(
205
218
  "span",
206
219
  {
207
220
  className: "inline-flex items-center whitespace-nowrap",
208
221
  children: [
209
- /* @__PURE__ */ r(Qe, { collection: N ?? k, id: v }),
210
- F < C.length - 1 && /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
222
+ /* @__PURE__ */ r(ze, { collection: w ?? N, id: v }),
223
+ F < O.length - 1 && /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
211
224
  ]
212
225
  },
213
- `${N ?? k}:${v}`
226
+ `${w ?? N}:${v}`
214
227
  )) });
215
228
  }
216
- function dl({
217
- collection: n,
218
- fkField: m,
229
+ function ul({
230
+ collection: a,
231
+ fkField: f,
219
232
  parentId: y,
220
233
  layoutId: c,
221
234
  presets: P,
222
- defaultPreset: w,
235
+ defaultPreset: S,
223
236
  onCount: $
224
237
  }) {
225
- const W = Ce(), _ = ut(), h = (P ?? []).filter((t) => t && Array.isArray(t.columns)), [q, K] = Z(
238
+ const W = Oe(), _ = mt(), h = (P ?? []).filter((t) => t && Array.isArray(t.columns)), [q, K] = Z(
226
239
  () => {
227
240
  var t;
228
- return h.length >= 2 ? ((t = h.find((a) => a.name === w)) == null ? void 0 : t.name) ?? h[0].name : "__all__";
241
+ return h.length >= 2 ? ((t = h.find((i) => i.name === S)) == null ? void 0 : t.name) ?? h[0].name : "__all__";
229
242
  }
230
243
  ), { data: M } = V({
231
- queryKey: ["cbv-collection-meta", n],
232
- queryFn: () => W.request(G(`/collections/${n}`)).then((t) => t.data),
244
+ queryKey: ["cbv-collection-meta", a],
245
+ queryFn: () => W.request(G(`/collections/${a}`)).then((t) => t.data),
233
246
  staleTime: 10 * 6e4,
234
247
  retry: !1
235
- }), S = (t) => {
236
- var a;
237
- return ((a = ((M == null ? void 0 : M.relations) ?? []).find(
238
- (d) => d.many_collection === n && d.many_field === t && d.one_collection
239
- )) == null ? void 0 : a.one_collection) ?? null;
248
+ }), k = (t) => {
249
+ var i;
250
+ return ((i = ((M == null ? void 0 : M.relations) ?? []).find(
251
+ (d) => d.many_collection === a && d.many_field === t && d.one_collection
252
+ )) == null ? void 0 : i.one_collection) ?? null;
240
253
  }, { data: x } = V({
241
- queryKey: ["rrv-cols", n, c ?? null],
254
+ queryKey: ["rrv-cols", a, c ?? null],
242
255
  queryFn: () => W.request(
243
- G(`/field-config/${n}`, c ? { layout_id: c } : {})
256
+ G(`/field-config/${a}`, c ? { layout_id: c } : {})
244
257
  ).then((t) => ({
245
258
  // Lines carry their own number — sort by it and show it first.
246
- lineNo: (t.data ?? []).some((a) => a.field === "line_number"),
259
+ lineNo: (t.data ?? []).some((i) => i.field === "line_number"),
247
260
  cols: (t.data ?? []).filter(
248
- (a) => !a.hidden && !a.field.startsWith("__") && (!a.field.includes(".") || a.interface === "relation-path") && a.field !== m && ((c ? a.layout_assigned : !0) ?? !0) && (a.interface === "relation-path" || [
261
+ (i) => !i.hidden && !i.field.startsWith("__") && (!i.field.includes(".") || i.interface === "relation-path") && i.field !== f && ((c ? i.layout_assigned : !0) ?? !0) && (i.interface === "relation-path" || [
249
262
  "string",
250
263
  "text",
251
264
  "integer",
@@ -256,68 +269,68 @@ function dl({
256
269
  "datetime",
257
270
  "timestamp",
258
271
  "uuid"
259
- ].includes(a.type ?? ""))
260
- ).filter((a, d, f) => f.findIndex((T) => T.field === a.field) === d)
272
+ ].includes(i.type ?? ""))
273
+ ).filter((i, d, p) => p.findIndex((T) => T.field === i.field) === d)
261
274
  })),
262
275
  staleTime: 5 * 6e4,
263
276
  retry: !1
264
- }), b = (x == null ? void 0 : x.cols) ?? [], C = !!(x != null && x.lineNo), k = q !== "__all__" ? h.find((t) => t.name === q) : null, O = ge(() => {
265
- if (!k) return b;
266
- const t = new Set(k.columns), a = b.filter((d) => t.has(d.field));
267
- return a.length > 0 ? a : b;
268
- }, [b, k]), [j, v] = Z(""), [N, F] = Z(1), [ne, J] = Z({}), Y = Lt(ne, 350), Oe = ge(() => {
277
+ }), b = (x == null ? void 0 : x.cols) ?? [], O = !!(x != null && x.lineNo), N = q !== "__all__" ? h.find((t) => t.name === q) : null, A = be(() => {
278
+ if (!N) return b;
279
+ const t = new Set(N.columns), i = b.filter((d) => t.has(d.field));
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(() => {
269
282
  const t = [
270
- { path: [m], op: "_eq", value: y }
283
+ { path: [f], op: "_eq", value: y }
271
284
  ];
272
- for (const [a, d] of Object.entries(Y)) {
285
+ for (const [i, d] of Object.entries(Y)) {
273
286
  if (!(d != null && d.value.trim())) continue;
274
- const f = d.value.trim(), T = Number(f), D = d.op === "_contains" ? f : f === "true" || f === "false" ? f === "true" : Number.isNaN(T) ? f : T;
275
- t.push({ path: [a], op: d.op, value: D });
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
+ t.push({ path: [i], op: d.op, value: D });
276
289
  }
277
290
  return JSON.stringify(t);
278
- }, [Y, m, y]), p = 25, {
279
- data: B,
291
+ }, [Y, f, y]), u = 25, {
292
+ data: U,
280
293
  isLoading: oe,
281
- isFetching: Ae
294
+ isFetching: Ce
282
295
  } = V({
283
- queryKey: ["rrv-rows", n, m, y, j, C, N, Oe],
296
+ queryKey: ["rrv-rows", a, f, y, j, O, w, Ae],
284
297
  queryFn: () => W.request(
285
- G(`/items/${n}`, {
286
- limit: p,
287
- page: N,
288
- ...j ? { sort: j } : C ? { sort: "line_number" } : {},
289
- conditions: Oe
298
+ G(`/items/${a}`, {
299
+ limit: u,
300
+ page: w,
301
+ ...j ? { sort: j } : O ? { sort: "line_number" } : {},
302
+ conditions: Ae
290
303
  })
291
304
  ),
292
305
  placeholderData: (t) => t,
293
306
  staleTime: 3e4,
294
307
  retry: !1
295
- }), A = (B == null ? void 0 : B.data) ?? [], X = (B == null ? void 0 : B.total) ?? A.length, H = Object.values(Y).some((t) => !!(t != null && t.value.trim()));
296
- be(() => {
297
- B && !H && ($ == null || $(X));
298
- }, [B, H, X, $]);
299
- const ce = O.filter((t) => t.field.includes(".")), ue = A.map((t) => String(t.id)), { data: Q } = V({
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()));
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({
300
313
  queryKey: [
301
314
  "rrv-resolve-paths",
302
- n,
315
+ a,
303
316
  ce.map((t) => t.field).join(","),
304
317
  ue.join(",")
305
318
  ],
306
319
  queryFn: () => W.request(
307
- G(`/items/${n}/resolve-paths`, {
320
+ G(`/items/${a}/resolve-paths`, {
308
321
  ids: ue.join(","),
309
322
  paths: ce.map((t) => t.field).join(",")
310
323
  })
311
324
  ).then((t) => t.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
312
325
  enabled: ce.length > 0 && ue.length > 0,
313
326
  staleTime: 3e4
314
- }), R = C && A.some((t) => t.line_number != null), ye = Math.max(1, Math.ceil(X / p)), ae = (t, a, d) => {
315
- F(1), J((f) => {
316
- const T = { ...f };
317
- return d ? T[t] = { op: a, value: d } : delete T[t], T;
327
+ }), R = O && C.some((t) => t.line_number != null), xe = Math.max(1, Math.ceil(X / u)), ie = (t, i, d) => {
328
+ F(1), J((p) => {
329
+ const T = { ...p };
330
+ return d ? T[t] = { op: i, value: d } : delete T[t], T;
318
331
  });
319
332
  }, Me = (t) => {
320
- F(1), v((a) => a === t ? `-${t}` : a === `-${t}` ? "" : t);
333
+ F(1), v((i) => i === t ? `-${t}` : i === `-${t}` ? "" : t);
321
334
  };
322
335
  if (oe)
323
336
  return /* @__PURE__ */ r("div", { className: "space-y-1.5 py-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ r(
@@ -327,64 +340,64 @@ function dl({
327
340
  },
328
341
  t
329
342
  )) });
330
- if (A.length === 0 && Object.keys(Y).length === 0)
343
+ if (C.length === 0 && Object.keys(Y).length === 0)
331
344
  return /* @__PURE__ */ r("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
332
- const Ue = (t, a) => {
345
+ const Ve = (t, i) => {
333
346
  var D, te;
334
- if (a.field.includes(".")) {
335
- const le = (D = Q == null ? void 0 : Q.rows[String(t.id)]) == null ? void 0 : D[a.field];
347
+ if (i.field.includes(".")) {
348
+ const le = (D = Q == null ? void 0 : Q.rows[String(t.id)]) == null ? void 0 : D[i.field];
336
349
  if (!Q)
337
350
  return /* @__PURE__ */ r("span", { className: "inline-block h-3 w-14 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
338
351
  if (!le || le.value === "") return /* @__PURE__ */ r(ee, {});
339
- const Pe = Q.targets[a.field], me = (te = le.ids) == null ? void 0 : te[0];
340
- return _ && Pe && me ? /* @__PURE__ */ r(
352
+ const Ee = Q.targets[i.field], me = (te = le.ids) == null ? void 0 : te[0];
353
+ return _ && Ee && me ? /* @__PURE__ */ r(
341
354
  "button",
342
355
  {
343
356
  type: "button",
344
357
  onClick: (fe) => {
345
- fe.stopPropagation(), _.open({ collection: Pe, itemId: String(me) });
358
+ fe.stopPropagation(), _.open({ collection: Ee, itemId: String(me) });
346
359
  },
347
360
  className: "text-left underline decoration-slate-300 underline-offset-2 hover:text-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan",
348
361
  children: le.value
349
362
  }
350
363
  ) : le.value;
351
364
  }
352
- const d = t[a.field];
353
- if (a.type === "boolean" && d == null) return /* @__PURE__ */ r(We, { value: !1 });
365
+ const d = t[i.field];
366
+ if (i.type === "boolean" && d == null) return /* @__PURE__ */ r(We, { value: !1 });
354
367
  if (d == null || d === "") return /* @__PURE__ */ r(ee, {});
355
- const f = S(a.field);
356
- if (f === "nivaro_users")
357
- return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(mt, { userId: String(d), size: "compact" }) });
358
- if (f) return /* @__PURE__ */ r(Qe, { collection: f, id: d });
359
- if (a.type === "boolean") return /* @__PURE__ */ r(We, { value: d });
360
- if (a.type === "decimal" || a.type === "float") return He(d);
361
- if (a.type === "integer") return Ie(d);
362
- if (a.type === "date" || a.type === "datetime" || a.type === "timestamp") return ft(d);
368
+ const p = k(i.field);
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);
363
376
  const T = String(d);
364
377
  return T.length > 48 ? `${T.slice(0, 48)}…` : T;
365
- }, ie = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !S(t.field) && !t.field.includes("."), Re = (t) => {
366
- const a = t.options;
367
- if (!a) return {};
368
- if (typeof a == "string")
378
+ }, se = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !k(t.field) && !t.field.includes("."), Re = (t) => {
379
+ const i = t.options;
380
+ if (!i) return {};
381
+ if (typeof i == "string")
369
382
  try {
370
- return JSON.parse(a);
383
+ return JSON.parse(i);
371
384
  } catch {
372
385
  return {};
373
386
  }
374
- return a;
375
- }, xe = (t) => {
376
- const a = Re(t).aggregate;
377
- return typeof a == "string" && ["sum", "avg", "min", "max", "count"].includes(a) ? a : null;
378
- }, De = O.some((t) => xe(t)), ve = (t) => {
379
- const a = xe(t);
380
- if (!a) return null;
381
- const d = A.map((D) => Number(D[t.field])).filter((D) => !Number.isNaN(D));
382
- let f = null;
383
- if (a === "count" ? f = A.length : d.length > 0 && (a === "sum" ? f = d.reduce((D, te) => D + te, 0) : a === "avg" ? f = d.reduce((D, te) => D + te, 0) / d.length : a === "min" ? f = Math.min(...d) : a === "max" && (f = Math.max(...d))), f === null) return "—";
387
+ return i;
388
+ }, ve = (t) => {
389
+ const i = Re(t).aggregate;
390
+ return typeof i == "string" && ["sum", "avg", "min", "max", "count"].includes(i) ? i : null;
391
+ }, De = A.some((t) => ve(t)), _e = (t) => {
392
+ const i = ve(t);
393
+ if (!i) return null;
394
+ const d = C.map((D) => Number(D[t.field])).filter((D) => !Number.isNaN(D));
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 "—";
384
397
  const T = Re(t).format;
385
- return a === "count" || T === "int" ? Ie(Math.round(f)) : T === "currency" || t.type === "decimal" || t.type === "float" ? He(f) : a === "avg" ? f.toFixed(2) : Ie(f);
386
- }, _e = (t) => !S(t.field) && !t.field.includes("."), Le = (t) => S(t.field) || t.field.includes(".") ? null : t.type === "boolean" ? "bool" : ["integer", "decimal", "float"].includes(t.type ?? "") ? "num" : ["string", "text"].includes(t.type ?? "") ? "text" : null, ke = O.some((t) => Le(t) != null);
387
- return /* @__PURE__ */ u("div", { children: [
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);
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
+ return /* @__PURE__ */ m("div", { children: [
388
401
  h.length >= 2 && /* @__PURE__ */ r("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
389
402
  { name: "__all__", label: "All" },
390
403
  ...h.map((t) => ({ name: t.name, label: t.name }))
@@ -402,48 +415,48 @@ function dl({
402
415
  /* @__PURE__ */ r(
403
416
  "div",
404
417
  {
405
- className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Ae && !oe ? "opacity-70" : ""}`,
406
- children: /* @__PURE__ */ u("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
407
- /* @__PURE__ */ u("thead", { children: [
408
- /* @__PURE__ */ u("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
418
+ className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Ce && !oe ? "opacity-70" : ""}`,
419
+ children: /* @__PURE__ */ m("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
420
+ /* @__PURE__ */ m("thead", { children: [
421
+ /* @__PURE__ */ m("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
409
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: "#" }),
410
- O.map((t) => {
411
- const a = j === t.field || j === `-${t.field}`;
412
- return /* @__PURE__ */ u(
423
+ A.map((t) => {
424
+ const i = j === t.field || j === `-${t.field}`;
425
+ return /* @__PURE__ */ m(
413
426
  "th",
414
427
  {
415
- onClick: () => _e(t) && Me(t.field),
416
- 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 ${ie(t) ? "text-right" : "text-left"} ${_e(t) ? "cursor-pointer hover:text-slate-700 dark:hover:text-slate-200" : ""}`,
428
+ onClick: () => ke(t) && Me(t.field),
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" : ""}`,
417
430
  children: [
418
- t.label || Je(t.field),
419
- _e(t) && /* @__PURE__ */ r("span", { className: a ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: a ? j.startsWith("-") ? "▼" : "▲" : "⇅" })
431
+ t.label || He(t.field),
432
+ ke(t) && /* @__PURE__ */ r("span", { className: i ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: i ? j.startsWith("-") ? "▼" : "▲" : "⇅" })
420
433
  ]
421
434
  },
422
435
  t.field
423
436
  );
424
437
  })
425
438
  ] }),
426
- ke && /* @__PURE__ */ u("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
439
+ Ne && /* @__PURE__ */ m("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
427
440
  R && /* @__PURE__ */ r("th", { className: "px-1.5 py-1" }),
428
- O.map((t) => {
429
- const a = Le(t), d = ne[t.field];
430
- return /* @__PURE__ */ u("th", { className: "px-1.5 py-1 font-normal", children: [
431
- a === "text" && /* @__PURE__ */ r(
441
+ A.map((t) => {
442
+ const i = Le(t), d = ae[t.field];
443
+ return /* @__PURE__ */ m("th", { className: "px-1.5 py-1 font-normal", children: [
444
+ i === "text" && /* @__PURE__ */ r(
432
445
  "input",
433
446
  {
434
447
  value: (d == null ? void 0 : d.value) ?? "",
435
- onChange: (f) => ae(t.field, "_contains", f.target.value),
448
+ onChange: (p) => ie(t.field, "_contains", p.target.value),
436
449
  placeholder: "Filter…",
437
450
  "aria-label": `Filter ${t.field}`,
438
451
  className: "h-6 w-full min-w-[56px] rounded border border-slate-200 bg-white px-1.5 text-[10.5px] font-normal normal-case tracking-normal outline-none focus:border-nvr-cyan/50 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-100"
439
452
  }
440
453
  ),
441
- a === "num" && /* @__PURE__ */ u("span", { className: "flex items-center gap-0.5", children: [
454
+ i === "num" && /* @__PURE__ */ m("span", { className: "flex items-center gap-0.5", children: [
442
455
  /* @__PURE__ */ r(
443
- ot,
456
+ ct,
444
457
  {
445
458
  value: (d == null ? void 0 : d.op) ?? "_eq",
446
- onChange: (f) => ae(t.field, f, (d == null ? void 0 : d.value) ?? ""),
459
+ onChange: (p) => ie(t.field, p, (d == null ? void 0 : d.value) ?? ""),
447
460
  options: [
448
461
  { value: "_eq", label: "=" },
449
462
  { value: "_gte", label: "≥" },
@@ -457,17 +470,17 @@ function dl({
457
470
  {
458
471
  type: "number",
459
472
  value: (d == null ? void 0 : d.value) ?? "",
460
- onChange: (f) => ae(t.field, (d == null ? void 0 : d.op) ?? "_eq", f.target.value),
473
+ onChange: (p) => ie(t.field, (d == null ? void 0 : d.op) ?? "_eq", p.target.value),
461
474
  "aria-label": `Filter ${t.field}`,
462
475
  className: "h-6 w-full min-w-[48px] rounded border border-slate-200 bg-white px-1 text-[10.5px] font-normal outline-none focus:border-nvr-cyan/50 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-100"
463
476
  }
464
477
  )
465
478
  ] }),
466
- a === "bool" && /* @__PURE__ */ r(
467
- ot,
479
+ i === "bool" && /* @__PURE__ */ r(
480
+ ct,
468
481
  {
469
482
  value: (d == null ? void 0 : d.value) ?? "",
470
- onChange: (f) => ae(t.field, "_eq", f),
483
+ onChange: (p) => ie(t.field, "_eq", p),
471
484
  options: [
472
485
  { value: "", label: "All" },
473
486
  { value: "true", label: "Yes" },
@@ -481,51 +494,51 @@ function dl({
481
494
  })
482
495
  ] })
483
496
  ] }),
484
- /* @__PURE__ */ u("tbody", { children: [
485
- A.length === 0 && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
497
+ /* @__PURE__ */ m("tbody", { children: [
498
+ C.length === 0 && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
486
499
  "td",
487
500
  {
488
- colSpan: O.length + (R ? 1 : 0),
501
+ colSpan: A.length + (R ? 1 : 0),
489
502
  className: "py-4 text-center text-[12px] text-slate-400",
490
503
  children: "No matches — adjust filters"
491
504
  }
492
505
  ) }),
493
- A.map((t) => /* @__PURE__ */ u(
506
+ C.map((t) => /* @__PURE__ */ m(
494
507
  "tr",
495
508
  {
496
- onClick: _ ? () => _.open({ collection: n, itemId: String(t.id) }) : void 0,
509
+ onClick: _ ? () => _.open({ collection: a, itemId: String(t.id) }) : void 0,
497
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" : ""}`,
498
511
  children: [
499
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) }),
500
- O.map((a) => /* @__PURE__ */ r(
513
+ A.map((i) => /* @__PURE__ */ r(
501
514
  "td",
502
515
  {
503
- className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${ie(a) ? "text-right" : ""}`,
504
- children: Ue(t, a)
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)
505
518
  },
506
- a.field
519
+ i.field
507
520
  ))
508
521
  ]
509
522
  },
510
523
  String(t.id)
511
524
  ))
512
525
  ] }),
513
- De && A.length > 0 && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ u(
526
+ De && C.length > 0 && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ m(
514
527
  "tr",
515
528
  {
516
529
  "data-read-grid-footer": !0,
517
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",
518
531
  children: [
519
532
  R && /* @__PURE__ */ r("td", {}),
520
- O.map((t) => {
521
- const a = xe(t);
533
+ A.map((t) => {
534
+ const i = ve(t);
522
535
  return /* @__PURE__ */ r(
523
536
  "td",
524
537
  {
525
- className: `whitespace-nowrap px-2.5 py-1.5 ${ie(t) ? "text-right" : ""}`,
526
- children: a && /* @__PURE__ */ u(he, { children: [
527
- /* @__PURE__ */ r("span", { className: "mr-1 font-mono text-[10px] text-slate-400", children: a.toUpperCase() }),
528
- /* @__PURE__ */ r("span", { className: "tabular-nums", children: ve(t) })
538
+ className: `whitespace-nowrap px-2.5 py-1.5 ${se(t) ? "text-right" : ""}`,
539
+ children: i && /* @__PURE__ */ m(ge, { children: [
540
+ /* @__PURE__ */ r("span", { className: "mr-1 font-mono text-[10px] text-slate-400", children: i.toUpperCase() }),
541
+ /* @__PURE__ */ r("span", { className: "tabular-nums", children: _e(t) })
529
542
  ] })
530
543
  },
531
544
  t.field
@@ -537,36 +550,36 @@ function dl({
537
550
  ] })
538
551
  }
539
552
  ),
540
- X > p && /* @__PURE__ */ u("div", { className: "mt-1.5 flex items-center justify-between", children: [
541
- /* @__PURE__ */ u("p", { className: "text-[11px] tabular-nums text-slate-400", children: [
542
- ((N - 1) * p + 1).toLocaleString("en-US"),
553
+ X > u && /* @__PURE__ */ m("div", { className: "mt-1.5 flex items-center justify-between", children: [
554
+ /* @__PURE__ */ m("p", { className: "text-[11px] tabular-nums text-slate-400", children: [
555
+ ((w - 1) * u + 1).toLocaleString("en-US"),
543
556
  "–",
544
- Math.min(N * p, X).toLocaleString("en-US"),
557
+ Math.min(w * u, X).toLocaleString("en-US"),
545
558
  " of",
546
559
  " ",
547
560
  X.toLocaleString("en-US")
548
561
  ] }),
549
- /* @__PURE__ */ u("span", { className: "flex items-center gap-0.5", children: [
562
+ /* @__PURE__ */ m("span", { className: "flex items-center gap-0.5", children: [
550
563
  /* @__PURE__ */ r(
551
564
  "button",
552
565
  {
553
566
  type: "button",
554
- disabled: N <= 1,
567
+ disabled: w <= 1,
555
568
  onClick: () => F((t) => Math.max(1, t - 1)),
556
569
  className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
557
570
  children: "← Prev"
558
571
  }
559
572
  ),
560
- /* @__PURE__ */ u("span", { className: "min-w-[48px] text-center text-[11px] tabular-nums text-slate-500", children: [
561
- N,
573
+ /* @__PURE__ */ m("span", { className: "min-w-[48px] text-center text-[11px] tabular-nums text-slate-500", children: [
574
+ w,
562
575
  " / ",
563
- ye.toLocaleString("en-US")
576
+ xe.toLocaleString("en-US")
564
577
  ] }),
565
578
  /* @__PURE__ */ r(
566
579
  "button",
567
580
  {
568
581
  type: "button",
569
- disabled: N >= ye,
582
+ disabled: w >= xe,
570
583
  onClick: () => F((t) => t + 1),
571
584
  className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
572
585
  children: "Next →"
@@ -576,48 +589,48 @@ function dl({
576
589
  ] })
577
590
  ] });
578
591
  }
579
- function ct({
580
- collection: n,
581
- itemId: m,
592
+ function ut({
593
+ collection: a,
594
+ itemId: f,
582
595
  layoutData: y,
583
596
  design: c,
584
597
  flush: P,
585
- renderSlot: w,
598
+ renderSlot: S,
586
599
  integrityMarks: $,
587
600
  renderGrid: W,
588
601
  onEditSection: _,
589
602
  gridCounts: h
590
603
  }) {
591
- var tt;
592
- const q = Ce(), K = zt(), M = c ? c.record ?? {} : null, S = !!(c != null && c.context.showHidden), x = c ? String(((tt = c.record) == null ? void 0 : tt.id) ?? "") : m ?? "", b = ge(
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(
593
606
  () => c ? {
594
607
  ...c.layout,
595
608
  layout: c.layout.layout ?? { id: 0, name: "" }
596
609
  } : y,
597
610
  [c, y]
598
- ), C = (e) => ({
611
+ ), O = (e) => ({
599
612
  kind: qe(e.field) ? "slot" : "field",
600
613
  field: e.field,
601
614
  group_key: e.group_key ?? null
602
- }), k = (e, l, s = !1) => c ? /* @__PURE__ */ r(Xt, { target: e, children: s ? /* @__PURE__ */ r("div", { "data-design-hidden": !0, className: "opacity-40", children: l }) : l }) : l, O = ge(
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(
603
616
  () => [
604
617
  ...new Set(
605
618
  (c ? [] : (b == null ? void 0 : b.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
606
619
  )
607
620
  ].sort(),
608
621
  [b, c]
609
- ), { data: j } = Ht(n, x, O), v = (e) => {
622
+ ), { data: j } = Yt(a, x, A), v = (e) => {
610
623
  const l = j == null ? void 0 : j[e];
611
624
  if (!l) return null;
612
625
  const s = l.via !== "user";
613
626
  return l.caller && l.activity_id ? /* @__PURE__ */ r(
614
- Gt,
627
+ Qt,
615
628
  {
616
629
  activityId: l.activity_id,
617
630
  callerName: l.caller.name,
618
- collection: n,
631
+ collection: a,
619
632
  itemId: x,
620
- children: /* @__PURE__ */ u(
633
+ children: /* @__PURE__ */ m(
621
634
  "button",
622
635
  {
623
636
  type: "button",
@@ -645,10 +658,10 @@ function ct({
645
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"}`
646
659
  }
647
660
  );
648
- }, { data: N } = tl(n, x, !!$ && !c), F = ge(
649
- () => $ && (N != null && N.enabled) ? ll(N.findings) : null,
650
- [$, N]
651
- ), ne = ({ field: e }) => {
661
+ }, { data: w } = nl(a, x, !!$ && !c), F = be(
662
+ () => $ && (w != null && w.enabled) ? al(w.findings) : null,
663
+ [$, w]
664
+ ), ae = ({ field: e }) => {
652
665
  const l = F == null ? void 0 : F.get(e);
653
666
  if (!l || l.length === 0) return null;
654
667
  const s = l.map((o) => o.message || o.rule).join(`
@@ -665,64 +678,64 @@ function ct({
665
678
  }
666
679
  );
667
680
  }, { data: J } = V({
668
- queryKey: ["cbv-collection-meta", n],
681
+ queryKey: ["cbv-collection-meta", a],
669
682
  queryFn: () => q.request(
670
- G(`/collections/${n}`)
683
+ G(`/collections/${a}`)
671
684
  ).then((e) => e.data),
672
685
  staleTime: 10 * 6e4,
673
686
  retry: !1
674
- }), Y = qt(), { data: Oe } = V({
675
- queryKey: ["rrv-record", n, x],
687
+ }), Y = Ot(), { data: Ae } = V({
688
+ queryKey: ["rrv-record", a, x],
676
689
  enabled: !c,
677
- queryFn: () => q.request(G(`/items/${n}/${x}`)).then((e) => e.data),
678
- initialData: () => Y.getQueryData(["item", n, x]) ?? void 0,
690
+ queryFn: () => q.request(G(`/items/${a}/${x}`)).then((e) => e.data),
691
+ initialData: () => Y.getQueryData(["item", a, x]) ?? void 0,
679
692
  initialDataUpdatedAt: () => {
680
693
  var e;
681
- return (e = Y.getQueryState(["item", n, x])) == null ? void 0 : e.dataUpdatedAt;
694
+ return (e = Y.getQueryState(["item", a, x])) == null ? void 0 : e.dataUpdatedAt;
682
695
  },
683
696
  staleTime: 3e4,
684
697
  retry: !1
685
- }), p = M ?? Oe;
686
- It(n, c ? null : x, (e) => {
687
- e.aspectsOnly || e.deleted || (Y.invalidateQueries({ queryKey: ["rrv-record", n, x] }), Y.invalidateQueries({ queryKey: ["field-touch", n, x] }));
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] }));
688
701
  });
689
- const B = Ot(null), [oe, Ae] = Z(() => /* @__PURE__ */ new Set());
690
- be(() => {
691
- const e = B.current;
692
- if (B.current = p ?? null, c || !e || !p || e === p) return;
693
- const l = Object.keys(p).filter(
694
- (o) => !o.startsWith("__") && JSON.stringify(e[o]) !== JSON.stringify(p[o])
702
+ const U = Rt(null), [oe, Ce] = Z(() => /* @__PURE__ */ new Set());
703
+ ye(() => {
704
+ const e = U.current;
705
+ if (U.current = u ?? null, c || !e || !u || e === u) return;
706
+ const l = Object.keys(u).filter(
707
+ (o) => !o.startsWith("__") && JSON.stringify(e[o]) !== JSON.stringify(u[o])
695
708
  );
696
709
  if (l.length === 0) return;
697
- Ae(new Set(l));
698
- const s = setTimeout(() => Ae(/* @__PURE__ */ new Set()), 2400);
710
+ Ce(new Set(l));
711
+ const s = setTimeout(() => Ce(/* @__PURE__ */ new Set()), 2400);
699
712
  return () => clearTimeout(s);
700
- }, [p, c]);
701
- const A = (e) => oe.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: X } = V({
702
- queryKey: ["rrv-field-config", n, b.layout.id],
713
+ }, [u, c]);
714
+ const C = (e) => oe.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: X } = V({
715
+ queryKey: ["rrv-field-config", a, b.layout.id],
703
716
  enabled: !c,
704
717
  queryFn: () => q.request(
705
- G(`/field-config/${n}`, { layout_id: b.layout.id })
718
+ G(`/field-config/${a}`, { layout_id: b.layout.id })
706
719
  ).then((e) => e.data ?? []).catch(() => null),
707
720
  staleTime: 5 * 6e4,
708
721
  retry: !1
709
- }), H = ge(
722
+ }), H = be(
710
723
  () => new Map((X ?? (J == null ? void 0 : J.fields) ?? []).map((e) => [e.field, e])),
711
724
  [X, J]
712
725
  ), ce = (J == null ? void 0 : J.relations) ?? [], ue = (e) => {
713
726
  var l;
714
727
  return ((l = ce.find(
715
- (s) => s.many_collection === n && s.many_field === e && s.one_collection
728
+ (s) => s.many_collection === a && s.many_field === e && s.one_collection
716
729
  )) == null ? void 0 : l.one_collection) ?? null;
717
730
  }, Q = (e) => ce.find(
718
- (l) => l.one_collection === n && (l.one_field === e || l.many_collection === e)
731
+ (l) => l.one_collection === a && (l.one_field === e || l.many_collection === e)
719
732
  ) ?? null, R = (e) => {
720
733
  var l;
721
- return !((e.is_visible === void 0 || e.is_visible) && pe(e.overrides).hidden !== !0 && !((l = H.get(e.field)) != null && l.hidden));
722
- }, ye = b.assignments.filter(
723
- (e) => (!e.field.startsWith("__") || qe(e.field)) && (S || !R(e))
724
- ), ae = b.assignments.filter(
725
- (e) => e.field.startsWith("__widget_") && e.widget_id != null && (S || e.is_visible === void 0 || !!e.is_visible)
734
+ return !((e.is_visible === void 0 || e.is_visible) && he(e.overrides).hidden !== !0 && !((l = H.get(e.field)) != null && l.hidden));
735
+ }, xe = b.assignments.filter(
736
+ (e) => (!e.field.startsWith("__") || qe(e.field)) && (k || !R(e))
737
+ ), ie = b.assignments.filter(
738
+ (e) => e.field.startsWith("__widget_") && e.widget_id != null && (k || e.is_visible === void 0 || !!e.is_visible)
726
739
  ), Me = (e) => {
727
740
  if (!e.input_bindings) return [];
728
741
  try {
@@ -730,94 +743,94 @@ function ct({
730
743
  } catch {
731
744
  return [];
732
745
  }
733
- }, Ue = w || c ? b.assignments.filter(
734
- (e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !qe(e.field) && (S || e.is_visible === void 0 || !!e.is_visible)
735
- ).sort((e, l) => e.sort - l.sort) : [], ie = ["__pipeline__", "__addendums__"], Re = new Set(ie), xe = (e) => (w == null ? void 0 : w(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 || Je(e.field.replace(/^_+|_+$/g, "")) }) : null), De = (e, l = "trailing") => w || c ? Ue.filter(
746
+ }, Ve = S || c ? b.assignments.filter(
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(
736
749
  (s) => e === null ? s.group_key == null && l === "leading" === Re.has(s.field) : s.group_key === e
737
750
  ).sort(
738
- (s, o) => l === "leading" && e === null ? ie.indexOf(s.field) - ie.indexOf(o.field) : 0
739
- ).map((s) => ({ key: s.field, a: s, node: xe(s) })).filter((s) => s.node != null) : [], ve = (e, l = "trailing") => {
751
+ (s, o) => l === "leading" && e === null ? se.indexOf(s.field) - se.indexOf(o.field) : 0
752
+ ).map((s) => ({ key: s.field, a: s, node: ve(s) })).filter((s) => s.node != null) : [], _e = (e, l = "trailing") => {
740
753
  const s = De(e, l);
741
754
  return s.length === 0 ? null : /* @__PURE__ */ r(
742
755
  "div",
743
756
  {
744
757
  className: l === "leading" ? "mb-4 space-y-4" : "mt-3 space-y-4",
745
758
  "data-read-live-slots": l,
746
- children: s.map((o) => /* @__PURE__ */ r("div", { children: k(
759
+ children: s.map((o) => /* @__PURE__ */ r("div", { children: N(
747
760
  { kind: "slot", field: o.a.field, group_key: o.a.group_key ?? null },
748
761
  o.node,
749
762
  R(o.a)
750
763
  ) }, o.key))
751
764
  }
752
765
  );
753
- }, [_e, Le] = Z({}), ke = (e) => S || _e[e] === !0, [t, a] = Z({}), d = dt(
754
- (e) => (l) => a((s) => s[e] === l ? s : { ...s, [e]: l }),
766
+ }, [ke, Le] = Z({}), Ne = (e) => k || ke[e] === !0, [t, i] = Z({}), d = ot(
767
+ (e) => (l) => i((s) => s[e] === l ? s : { ...s, [e]: l }),
755
768
  []
756
- ), [f, T] = Z({}), D = dt(
769
+ ), [p, T] = Z({}), D = ot(
757
770
  (e) => (l) => T((s) => s[e] === l ? s : { ...s, [e]: l }),
758
771
  []
759
772
  ), te = (e) => {
760
- const l = ae.filter((o) => o.group_key === e).sort((o, g) => o.sort - g.sort);
773
+ const l = ie.filter((o) => o.group_key === e).sort((o, g) => o.sort - g.sort);
761
774
  if (l.length === 0) return null;
762
- const s = l.some((o) => ke(o.field));
763
- return /* @__PURE__ */ r("div", { className: s ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: l.map((o) => /* @__PURE__ */ r("div", { hidden: !ke(o.field), children: k(
775
+ const s = l.some((o) => Ne(o.field));
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(
764
777
  { kind: "slot", field: o.field, group_key: o.group_key ?? null },
765
778
  /* @__PURE__ */ r(
766
- rl,
779
+ il,
767
780
  {
768
781
  widgetId: o.widget_id,
769
782
  inputBindings: Me(o),
770
- itemDraft: p ?? {},
771
- itemCollection: n,
772
- ready: !!p,
783
+ itemDraft: u ?? {},
784
+ itemCollection: a,
785
+ ready: !!u,
773
786
  label: o.label_override ?? void 0,
774
787
  defaultExpanded: o.default_expanded == null ? !0 : !!o.default_expanded,
775
788
  onContentChange: (g) => Le(
776
- (E) => E[o.field] === g ? E : { ...E, [o.field]: g }
789
+ (I) => I[o.field] === g ? I : { ...I, [o.field]: g }
777
790
  )
778
791
  }
779
792
  ),
780
793
  R(o)
781
794
  ) }, o.field)) });
782
- }, le = [...b.groups].sort((e, l) => e.sort - l.sort).filter((e) => S || e.visibility_mode !== "new_only"), [Pe, me] = Z(() => /* @__PURE__ */ new Set()), fe = (e) => !e.is_collapsed || Pe.has(e.key), pt = (e) => me((l) => {
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) => {
783
796
  const s = new Set(l);
784
797
  return s.has(e) ? s.delete(e) : s.add(e), s;
785
- }), Ne = (c == null ? void 0 : c.context.fold) ?? null, we = (c == null ? void 0 : c.context.reveal) ?? null;
786
- be(() => {
787
- Ne && me(Ne.open ? new Set(b.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
788
- }, [Ne == null ? void 0 : Ne.seq]), be(() => {
789
- const e = we ? el(we.target) : null;
798
+ }), we = (c == null ? void 0 : c.context.fold) ?? null, Se = (c == null ? void 0 : c.context.reveal) ?? null;
799
+ ye(() => {
800
+ we && me(we.open ? new Set(b.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
801
+ }, [we == null ? void 0 : we.seq]), ye(() => {
802
+ const e = Se ? rl(Se.target) : null;
790
803
  e && me((l) => l.has(e) ? l : new Set(l).add(e));
791
- }, [we == null ? void 0 : we.seq]);
792
- const Ve = [];
804
+ }, [Se == null ? void 0 : Se.seq]);
805
+ const Ue = [];
793
806
  for (const e of le) {
794
807
  if (e.type === "container") {
795
808
  for (const l of le.filter((s) => s.container_id != null && s.container_id === e.id))
796
- Ve.push(l);
809
+ Ue.push(l);
797
810
  continue;
798
811
  }
799
- e.container_id == null && Ve.push(e);
812
+ e.container_id == null && Ue.push(e);
800
813
  }
801
- const se = (e) => {
814
+ const re = (e) => {
802
815
  var l;
803
816
  return !!((l = Q(e.field)) != null && l.junction_field);
804
- }, ze = (e) => {
817
+ }, Ye = (e) => {
805
818
  var s;
806
819
  const l = String(
807
- pe(e.overrides).interface ?? ((s = H.get(e.field)) == null ? void 0 : s.interface) ?? ""
820
+ he(e.overrides).interface ?? ((s = H.get(e.field)) == null ? void 0 : s.interface) ?? ""
808
821
  );
809
822
  return /rich|wysiwyg|editorjs/i.test(l);
810
- }, Ke = (e) => {
811
- const l = H.get(e.field), s = pe(e.overrides);
823
+ }, Pe = (e) => {
824
+ const l = H.get(e.field), s = he(e.overrides);
812
825
  if (qe(e.field)) {
813
- const L = Mt(s), de = Yt((L == null ? void 0 : L.expr) ?? "", p ?? {});
814
- return /* @__PURE__ */ r("span", { "data-display-formula": e.field, className: "tabular-nums", children: de.error ? "—" : Ut(de.value, L ?? { format: "", currency: null }) });
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 }) });
815
828
  }
816
829
  const o = Q(e.field);
817
830
  if (c && !x && (o != null && o.junction_field)) return /* @__PURE__ */ r(ee, {});
818
831
  if (o != null && o.junction_field && o.many_collection && o.many_field)
819
832
  return /* @__PURE__ */ r(
820
- sl,
833
+ cl,
821
834
  {
822
835
  junction: o.many_collection,
823
836
  parentFk: o.many_field,
@@ -828,10 +841,10 @@ function ct({
828
841
  relation: o
829
842
  }
830
843
  );
831
- const g = p == null ? void 0 : p[e.field], E = ue(e.field);
832
- if (E === "nivaro_users" && g != null)
833
- return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(mt, { userId: String(g), size: "compact" }) });
834
- if (E) return /* @__PURE__ */ r(Qe, { collection: E, id: g });
844
+ const g = u == null ? void 0 : u[e.field], I = ue(e.field);
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 });
835
848
  if ((l == null ? void 0 : l.type) === "boolean" && (g == null || g === "")) return /* @__PURE__ */ r(We, { value: !1 });
836
849
  if (g == null || g === "") return /* @__PURE__ */ r(ee, {});
837
850
  if ((l == null ? void 0 : l.type) === "boolean")
@@ -843,15 +856,15 @@ function ct({
843
856
  }
844
857
  );
845
858
  const z = s.options ?? {};
846
- return ze(e) && typeof g == "string" ? /^\s*\{/.test(g) ? /* @__PURE__ */ r("div", { className: "min-w-0 whitespace-pre-wrap font-normal [overflow-wrap:anywhere]", children: Qt(g) }) : /* @__PURE__ */ r(
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(
847
860
  "div",
848
861
  {
849
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",
850
- dangerouslySetInnerHTML: { __html: Bt(g) }
863
+ dangerouslySetInnerHTML: { __html: Jt(g) }
851
864
  }
852
- ) : z.format === "currency" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: He(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" ? ft(g) : String(g);
853
- }, ht = (e) => {
854
- const l = pe(e.overrides), s = Q(e.field);
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) => {
867
+ const l = he(e.overrides), s = Q(e.field);
855
868
  if (!(s != null && s.many_collection) || !s.many_field) return null;
856
869
  if (c && !x) return /* @__PURE__ */ r("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
857
870
  const o = l.options ?? {}, g = (() => {
@@ -865,104 +878,104 @@ function ct({
865
878
  return {};
866
879
  }
867
880
  return z;
868
- })(), E = o.layout_id ?? null;
881
+ })(), I = o.layout_id ?? null;
869
882
  return /* @__PURE__ */ r(
870
- dl,
883
+ ul,
871
884
  {
872
885
  collection: s.many_collection,
873
886
  fkField: s.many_field,
874
887
  parentId: x,
875
- layoutId: E,
888
+ layoutId: I,
876
889
  presets: o.column_presets ?? g.column_presets,
877
890
  defaultPreset: o.default_preset ?? g.default_preset ?? null,
878
891
  onCount: d(e.field)
879
892
  },
880
893
  e.field
881
894
  );
882
- }, Se = (e) => !!Q(e.field) && !se(e), gt = !!b.layout.hide_empty, Ye = Array.isArray(b.layout.header_fields) ? b.layout.header_fields.filter((e) => typeof e == "string") : [], bt = new Set(Ye), yt = (e) => {
883
- if (!p || se(e)) return !1;
884
- const l = p[e.field];
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;
897
+ const l = u[e.field];
885
898
  return l == null || l === "" || Array.isArray(l) && l.length === 0;
886
- }, xt = (e) => ye.find((l) => l.field === e), $e = (e) => {
899
+ }, vt = (e) => xe.find((l) => l.field === e), $e = (e) => {
887
900
  var o;
888
- const l = pe(e.overrides).label, s = K ? Wt(e.overrides, K).label : void 0;
889
- 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) || Je(e.field);
890
- }, vt = (e) => {
891
- const l = Kt(e.swap_config), s = ye.filter((i) => i.group_key === e.key && !bt.has(i.field)).filter((i) => S || !p || !jt(i.overrides) || !Ge(p[i.field])).sort((i, I) => i.sort - I.sort), o = ae.filter((i) => i.group_key === e.key), g = De(e.key), E = s.length === 0 && o.length === 0 && g.length === 0;
892
- if (E && !c) return null;
893
- const z = (i) => gt && !S && (Se(i) || se(i)) && ((h == null ? void 0 : h[i.field]) ?? t[i.field]) === 0, L = s.filter((i) => !Se(i)), de = s.filter(Se), lt = o.filter((i) => ke(i.field)), kt = s.filter((i) => !z(i)), Nt = !E && kt.length === 0 && g.length === 0 && lt.length === 0, wt = (i) => (h == null ? void 0 : h[i.field]) ?? t[i.field], Be = !!l.emptyText && !!p && !c && g.length === 0 && lt.length === 0 && s.every((i) => Se(i) || se(i) ? wt(i) === 0 : Ge(p[i.field])), St = Et(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", $t = (i) => {
894
- var at, it, st;
895
- if (z(i)) return null;
896
- const Fe = !!(pe(i.overrides).options ?? {}).emphasis, U = ze(i) || !!((it = (at = H.get(i.field)) == null ? void 0 : at.interface) != null && it.includes("rich-text")), je = p == null ? void 0 : p[i.field], nt = !U && !se(i) && !ue(i.field) && (String(((st = H.get(i.field)) == null ? void 0 : st.interface) ?? "").includes("textarea") || typeof je == "string" && je.length > 36);
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;
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);
897
909
  return /* @__PURE__ */ r(
898
910
  "div",
899
911
  {
900
- className: `min-w-0 ${U || se(i) && (f[i.field] === "nivaro_files" || (t[i.field] ?? 0) > 3) ? "col-span-full" : Fe || nt ? "col-span-2" : ""}`,
901
- children: k(
902
- C(i),
903
- /* @__PURE__ */ u(he, { children: [
904
- /* @__PURE__ */ u("dt", { className: Ee, children: [
905
- $e(i),
906
- /* @__PURE__ */ r(ne, { field: i.field }),
907
- v(i.field)
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" : ""}`,
914
+ children: N(
915
+ O(n),
916
+ /* @__PURE__ */ m(ge, { children: [
917
+ /* @__PURE__ */ m("dt", { className: je, children: [
918
+ $e(n),
919
+ /* @__PURE__ */ r(ae, { field: n.field }),
920
+ v(n.field)
908
921
  ] }),
909
922
  /* @__PURE__ */ r(
910
923
  "dd",
911
924
  {
912
- "data-replay-field": i.field,
913
- "data-field-collection": n,
914
- "data-remote-changed": oe.has(i.field) || void 0,
915
- className: `mt-1 min-w-0${A(i.field)} ${Fe ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${se(i) || U ? "" : nt ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
916
- children: p ? Ke(i) : /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
925
+ "data-replay-field": n.field,
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`}`,
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))]" })
917
930
  }
918
931
  )
919
932
  ] }),
920
- R(i)
933
+ R(n)
921
934
  )
922
935
  },
923
- i.field
936
+ n.field
924
937
  );
925
- }, Ft = (i, I) => {
926
- const Fe = p && !c ? I.filter((U) => !Ge(p[U.field])) : I;
927
- return /* @__PURE__ */ u(
938
+ }, Tt = (n, E) => {
939
+ const Je = u && !c ? E.filter((B) => !Ke(u[B.field])) : E;
940
+ return /* @__PURE__ */ m(
928
941
  "div",
929
942
  {
930
- "data-read-row": i.key,
931
- className: `min-w-0 ${I.length > 2 ? "col-span-full" : "col-span-2"}`,
943
+ "data-read-row": n.key,
944
+ className: `min-w-0 ${E.length > 2 ? "col-span-full" : "col-span-2"}`,
932
945
  children: [
933
- /* @__PURE__ */ r("dt", { className: Ee, children: i.label.trim() || I.map($e).join(" / ") }),
934
- /* @__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: p ? Fe.length === 0 ? /* @__PURE__ */ r(ee, {}) : Fe.map((U, je) => /* @__PURE__ */ u(At, { children: [
935
- je > 0 && /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
936
- k(
937
- C(U),
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: [
948
+ Fe > 0 && /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
949
+ N(
950
+ O(B),
938
951
  /* @__PURE__ */ r(
939
952
  "span",
940
953
  {
941
- "data-replay-field": U.field,
942
- "data-field-collection": n,
943
- className: `min-w-0 break-words${A(U.field)}`,
944
- children: Ke(U)
954
+ "data-replay-field": B.field,
955
+ "data-field-collection": a,
956
+ className: `min-w-0 break-words${C(B.field)}`,
957
+ children: Pe(B)
945
958
  }
946
959
  ),
947
- R(U)
960
+ R(B)
948
961
  )
949
- ] }, U.field)) : /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-28 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) })
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))]" }) })
950
963
  ]
951
964
  },
952
- `row:${i.key}`
965
+ `row:${n.key}`
953
966
  );
954
967
  };
955
968
  return /* @__PURE__ */ r(
956
969
  "section",
957
970
  {
958
- hidden: Nt,
971
+ hidden: St,
959
972
  "data-read-section": e.key,
960
973
  "data-read-width": rt,
961
974
  className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
962
- children: k(
975
+ children: N(
963
976
  { kind: "group", key: e.key },
964
- /* @__PURE__ */ u(he, { children: [
965
- /* @__PURE__ */ u(
977
+ /* @__PURE__ */ m(ge, { children: [
978
+ /* @__PURE__ */ m(
966
979
  "h3",
967
980
  {
968
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" : ""}`,
@@ -971,7 +984,7 @@ function ct({
971
984
  "button",
972
985
  {
973
986
  type: "button",
974
- onClick: () => pt(e.key),
987
+ onClick: () => ht(e.key),
975
988
  "aria-expanded": fe(e),
976
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",
977
990
  children: e.label
@@ -983,13 +996,13 @@ function ct({
983
996
  type: "button",
984
997
  "data-read-edit-section": e.key,
985
998
  onClick: () => {
986
- var i, I;
987
- return _(e.key, ((i = L[0]) == null ? void 0 : i.field) ?? ((I = de[0]) == null ? void 0 : I.field) ?? null);
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);
988
1001
  },
989
1002
  title: `Edit ${e.label}`,
990
1003
  "aria-label": `Edit ${e.label}`,
991
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",
992
- children: /* @__PURE__ */ r(Tt, { className: "h-3 w-3" })
1005
+ children: /* @__PURE__ */ r(At, { className: "h-3 w-3" })
993
1006
  }
994
1007
  ),
995
1008
  e.is_collapsed && /* @__PURE__ */ r(
@@ -1002,8 +1015,8 @@ function ct({
1002
1015
  ]
1003
1016
  }
1004
1017
  ),
1005
- /* @__PURE__ */ u("div", { className: "px-5 pb-5 pt-4", hidden: !fe(e), children: [
1006
- Be && /* @__PURE__ */ r(
1018
+ /* @__PURE__ */ m("div", { className: "px-5 pb-5 pt-4", hidden: !fe(e), children: [
1019
+ Ge && /* @__PURE__ */ r(
1007
1020
  "p",
1008
1021
  {
1009
1022
  "data-read-empty": e.key,
@@ -1011,44 +1024,53 @@ function ct({
1011
1024
  children: l.emptyText
1012
1025
  }
1013
1026
  ),
1014
- L.length > 0 && !Be && // One column rhythm for the whole page: every section's facts sit
1027
+ L.length > 0 && // One column rhythm for the whole page: every section's facts sit
1015
1028
  // on the same 2 / 3 / 4 / 6 tracks, so values line up card to
1016
- // card instead of each card auto-filling its own grid.
1017
- /* @__PURE__ */ r("dl", { className: "grid gap-x-6 gap-y-5", "data-read-dl": rt, children: St.map(
1018
- (i) => i.kind === "row" ? Ft(i.row, i.members) : $t(i.field)
1019
- ) }),
1020
- de.map((i) => {
1021
- var I;
1029
+ // card instead of each card auto-filling its own grid. Hidden, not
1030
+ // unrendered, under the empty text: its link facts must keep reporting.
1031
+ /* @__PURE__ */ r(
1032
+ "dl",
1033
+ {
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)
1039
+ )
1040
+ }
1041
+ ),
1042
+ de.map((n) => {
1043
+ var E;
1022
1044
  return /* @__PURE__ */ r(
1023
1045
  "div",
1024
1046
  {
1025
1047
  className: L.length > 0 ? "mt-3" : "",
1026
- hidden: z(i) || Be,
1027
- children: k(
1028
- C(i),
1029
- /* @__PURE__ */ u(he, { children: [
1030
- (I = F == null ? void 0 : F.get(i.field)) != null && I.length ? /* @__PURE__ */ u("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-300", children: [
1031
- /* @__PURE__ */ r("span", { children: $e(i) }),
1032
- /* @__PURE__ */ r(ne, { field: i.field }),
1033
- /* @__PURE__ */ u("span", { className: "font-normal text-amber-700/80 dark:text-amber-300/80", children: [
1048
+ hidden: z(n) || Ge,
1049
+ children: N(
1050
+ O(n),
1051
+ /* @__PURE__ */ m(ge, { children: [
1052
+ (E = F == null ? void 0 : F.get(n.field)) != null && E.length ? /* @__PURE__ */ m("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-300", children: [
1053
+ /* @__PURE__ */ r("span", { children: $e(n) }),
1054
+ /* @__PURE__ */ r(ae, { field: n.field }),
1055
+ /* @__PURE__ */ m("span", { className: "font-normal text-amber-700/80 dark:text-amber-300/80", children: [
1034
1056
  "— ",
1035
- F.get(i.field).length,
1057
+ F.get(n.field).length,
1036
1058
  " line issue",
1037
- F.get(i.field).length === 1 ? "" : "s",
1059
+ F.get(n.field).length === 1 ? "" : "s",
1038
1060
  "; switch to Edit to fix"
1039
1061
  ] })
1040
1062
  ] }) : null,
1041
- (W ? W(i) : null) ?? ht(i)
1063
+ (W ? W(n) : null) ?? gt(n)
1042
1064
  ] }),
1043
- R(i)
1065
+ R(n)
1044
1066
  )
1045
1067
  },
1046
- i.field
1068
+ n.field
1047
1069
  );
1048
1070
  }),
1049
1071
  te(e.key),
1050
- ve(e.key),
1051
- E && c && /* @__PURE__ */ r(
1072
+ _e(e.key),
1073
+ I && c && /* @__PURE__ */ r(
1052
1074
  "div",
1053
1075
  {
1054
1076
  "data-design-drop": e.key,
@@ -1063,54 +1085,54 @@ function ct({
1063
1085
  },
1064
1086
  e.key
1065
1087
  );
1066
- }, Xe = ve(null), _t = ve(null, "leading"), Ze = Ye.map((e) => xt(e)).filter((e) => !!e && !Se(e)).filter((e) => S || !yt(e)), [re, ...et] = Ze;
1067
- return /* @__PURE__ */ u(
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;
1089
+ return /* @__PURE__ */ m(
1068
1090
  "div",
1069
1091
  {
1070
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",
1071
1093
  children: [
1072
- _t,
1073
- Ze.length > 0 && /* @__PURE__ */ u(
1094
+ kt,
1095
+ et.length > 0 && /* @__PURE__ */ m(
1074
1096
  "div",
1075
1097
  {
1076
1098
  "data-read-header": !0,
1077
1099
  className: "mb-4 rounded-xl border border-slate-200 bg-white px-5 py-4 dark:border-slate-700/60 dark:bg-slate-900/40",
1078
1100
  children: [
1079
- re && k(
1080
- { kind: "header", field: re.field },
1081
- /* @__PURE__ */ u("div", { className: "min-w-0", children: [
1082
- /* @__PURE__ */ u("p", { className: Ee, children: [
1083
- $e(re),
1084
- /* @__PURE__ */ r(ne, { field: re.field })
1101
+ ne && N(
1102
+ { kind: "header", field: ne.field },
1103
+ /* @__PURE__ */ m("div", { className: "min-w-0", children: [
1104
+ /* @__PURE__ */ m("p", { className: je, children: [
1105
+ $e(ne),
1106
+ /* @__PURE__ */ r(ae, { field: ne.field })
1085
1107
  ] }),
1086
1108
  /* @__PURE__ */ r(
1087
1109
  "p",
1088
1110
  {
1089
- "data-replay-field": re.field,
1090
- "data-field-collection": n,
1091
- className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${A(re.field)}`,
1092
- children: p ? Ke(re) : "…"
1111
+ "data-replay-field": ne.field,
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)}`,
1114
+ children: u ? Pe(ne) : "…"
1093
1115
  }
1094
1116
  )
1095
1117
  ] }),
1096
- R(re)
1118
+ R(ne)
1097
1119
  ),
1098
- et.length > 0 && /* @__PURE__ */ r("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: et.map((e) => /* @__PURE__ */ r("div", { className: "min-w-0", children: k(
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(
1099
1121
  { kind: "header", field: e.field },
1100
- /* @__PURE__ */ u(he, { children: [
1101
- /* @__PURE__ */ u("dt", { className: Ee, children: [
1122
+ /* @__PURE__ */ m(ge, { children: [
1123
+ /* @__PURE__ */ m("dt", { className: je, children: [
1102
1124
  $e(e),
1103
- /* @__PURE__ */ r(ne, { field: e.field }),
1125
+ /* @__PURE__ */ r(ae, { field: e.field }),
1104
1126
  v(e.field)
1105
1127
  ] }),
1106
1128
  /* @__PURE__ */ r(
1107
1129
  "dd",
1108
1130
  {
1109
1131
  "data-replay-field": e.field,
1110
- "data-field-collection": n,
1132
+ "data-field-collection": a,
1111
1133
  "data-remote-changed": oe.has(e.field) || void 0,
1112
- className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${A(e.field)}`,
1113
- children: p ? Ke(e) : "…"
1134
+ className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${C(e.field)}`,
1135
+ children: u ? Pe(e) : "…"
1114
1136
  }
1115
1137
  )
1116
1138
  ] }),
@@ -1119,20 +1141,20 @@ function ct({
1119
1141
  ]
1120
1142
  }
1121
1143
  ),
1122
- /* @__PURE__ */ r("style", { children: nl }),
1123
- J ? /* @__PURE__ */ r("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Ve.map(vt) }) : /* @__PURE__ */ u("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
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: [
1124
1146
  /* @__PURE__ */ r("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1125
1147
  /* @__PURE__ */ r("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1126
1148
  /* @__PURE__ */ r("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
1127
1149
  ] }),
1128
- Xe && /* @__PURE__ */ r("div", { className: "mt-4", children: Xe })
1150
+ Ze && /* @__PURE__ */ r("div", { className: "mt-4", children: Ze })
1129
1151
  ]
1130
1152
  }
1131
1153
  );
1132
1154
  }
1133
- function Kl(n) {
1134
- return n.design ? /* @__PURE__ */ r(Zt, { design: n.design.context, onRefusedWrite: n.design.onRefusedWrite, children: /* @__PURE__ */ r(Rt.Provider, { value: null, children: /* @__PURE__ */ r(ct, { ...n }) }) }) : /* @__PURE__ */ r(ct, { ...n });
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 });
1135
1157
  }
1136
1158
  export {
1137
- Kl as RecordReadView
1159
+ Ml as RecordReadView
1138
1160
  };