@nivaro/react 0.3.10 → 0.3.12

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 (50) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useNivaroForm.js +1 -1
  3. package/dist/hooks/useSessionRecorder.js +109 -102
  4. package/dist/index.d.ts +34 -3
  5. package/dist/shared/components/CollectionBrowserView.js +1546 -1477
  6. package/dist/shared/components/ItemEditForm.js +4332 -4195
  7. package/dist/shared/components/PageRenderer.js +512 -465
  8. package/dist/shared/components/ProfileView.js +115 -109
  9. package/dist/shared/components/QueryStatStrip.js +74 -70
  10. package/dist/shared/components/ReportView.js +818 -827
  11. package/dist/shared/components/SheetHeaderBody.js +16 -14
  12. package/dist/shared/components/chat/ChatPanel.js +492 -472
  13. package/dist/shared/components/item-edit/CatalogPickerField.js +1029 -933
  14. package/dist/shared/components/item-edit/FieldRenderer.js +161 -156
  15. package/dist/shared/components/item-edit/FieldRow.js +20 -19
  16. package/dist/shared/components/item-edit/FilePickerField.js +52 -40
  17. package/dist/shared/components/item-edit/GroupSection.js +221 -221
  18. package/dist/shared/components/item-edit/InlineGridField.js +41 -41
  19. package/dist/shared/components/item-edit/InlineTableField.js +2249 -2238
  20. package/dist/shared/components/item-edit/M2MCombobox.js +46 -44
  21. package/dist/shared/components/item-edit/NestedRelationEditor.js +11 -11
  22. package/dist/shared/components/item-edit/QuickPicker.js +263 -216
  23. package/dist/shared/components/item-edit/RelationCombobox.js +285 -245
  24. package/dist/shared/components/item-edit/RichTextEditorImpl.js +42 -32
  25. package/dist/shared/components/item-edit/RowHistorySheet.js +130 -134
  26. package/dist/shared/components/item-edit/SummaryPanel.js +305 -279
  27. package/dist/shared/components/item-edit/UserChip.js +301 -233
  28. package/dist/shared/components/item-edit/helpers.js +133 -134
  29. package/dist/shared/components/item-edit/line-qty.js +57 -0
  30. package/dist/shared/components/item-edit/option-disambiguate.js +53 -0
  31. package/dist/shared/components/panels/AddendumLinesDiff.js +87 -90
  32. package/dist/shared/components/panels/CommentPanel.js +350 -315
  33. package/dist/shared/components/panels/ItemLockBanner.js +297 -230
  34. package/dist/shared/components/panels/PipelinePanel.js +719 -701
  35. package/dist/shared/components/profile/PersonAdminTools.js +168 -144
  36. package/dist/shared/components/profile/PersonProfile.js +42 -41
  37. package/dist/shared/components/profile/session-actions.js +52 -0
  38. package/dist/shared/components/queue/QueueQuickFilters.js +43 -41
  39. package/dist/shared/components/queue/QueueWorklist.js +1005 -935
  40. package/dist/shared/components/widgets/ReviewListWidget.js +99 -93
  41. package/dist/shared/lib/obligation-banner.js +14 -13
  42. package/dist/shared/lib/obligation-reason-text.js +13 -0
  43. package/dist/shared/lib/query-filter-seed.js +34 -11
  44. package/dist/shared/lib/replay-checkout.js +20 -0
  45. package/dist/shared/lib/sanitize-html.js +24 -15
  46. package/dist/shared/lib/sheet-def.js +38 -22
  47. package/dist/shared/lib/unique-options.js +10 -0
  48. package/dist/shared/lib/utils.js +57 -43
  49. package/dist/shared/lib/validation-rules.js +58 -34
  50. package/package.json +1 -1
@@ -1,28 +1,28 @@
1
- import { jsx as e, jsxs as x, Fragment as _t } from "react/jsx-runtime";
2
- import { useQuery as de, useQueryClient as wt } from "@tanstack/react-query";
3
- import * as vt from "lucide-react";
4
- import { ChevronDown as St, Loader2 as kt, User as Dt, Mail as $t } from "lucide-react";
5
- import nt, { useState as Q, useRef as Se, useEffect as ne } from "react";
6
- import { fieldDrilldownConfig as Ft, useDrilldown as jt, useOptionalNivaroClient as ue, useNavigation as Lt } from "../../context.js";
7
- import { get as rt, post as Ot } from "../../lib/commands.js";
8
- import { planFieldGrid as qt, isEmptyValue as Bt, isFolded as Ut, readGroupStructure as Tt } from "../../lib/form-structure.js";
9
- import { reportSectionUse as it } from "../../lib/form-usage-beacon.js";
10
- import { useRecordReader as st } from "../../lib/record-loader.js";
11
- import { choiceLabel as It, titleCase as lt, cn as W } from "../../lib/utils.js";
12
- import { DesignDropZone as Mt, designWrap as Gt } from "../layout-editor/DesignNode.js";
13
- import { useLayoutDesign as Vt, revealGroupKey as Pt } from "../layout-editor/design-context.js";
1
+ import { jsx as e, jsxs as x, Fragment as wt } from "react/jsx-runtime";
2
+ import { useQuery as de, useQueryClient as vt } from "@tanstack/react-query";
3
+ import * as kt from "lucide-react";
4
+ import { ChevronDown as St, Loader2 as Dt, User as $t, Mail as Ft } from "lucide-react";
5
+ import rt, { useState as Q, useRef as ke, useEffect as ne } from "react";
6
+ import { fieldDrilldownConfig as jt, useDrilldown as Ot, useOptionalNivaroClient as ue, useNavigation as qt } from "../../context.js";
7
+ import { get as it, post as Bt } from "../../lib/commands.js";
8
+ import { planFieldGrid as Lt, isEmptyValue as Ut, isFolded as Tt, readGroupStructure as It } from "../../lib/form-structure.js";
9
+ import { reportSectionUse as st } from "../../lib/form-usage-beacon.js";
10
+ import { useRecordReader as lt } from "../../lib/record-loader.js";
11
+ import { choiceLabel as Mt, titleCase as at, cn as W, toLocalDateString as Se } from "../../lib/utils.js";
12
+ import { DesignDropZone as Gt, designWrap as Vt } from "../layout-editor/DesignNode.js";
13
+ import { useLayoutDesign as Pt, revealGroupKey as Ct } from "../layout-editor/design-context.js";
14
14
  import { GridGuides as we } from "../layout-editor/grid-guides.js";
15
- import { UserAvatar as Ct } from "../UserAvatar.js";
16
- import { DropdownMenu as Jt, DropdownMenuTrigger as Rt, DropdownMenuContent as zt, DropdownMenuItem as We } from "../ui/dropdown-menu.js";
17
- import { WidgetSlot as Ae } from "../WidgetSlot.js";
15
+ import { UserAvatar as Jt } from "../UserAvatar.js";
16
+ import { DropdownMenu as Rt, DropdownMenuTrigger as zt, DropdownMenuContent as Kt, DropdownMenuItem as Ae } from "../ui/dropdown-menu.js";
17
+ import { WidgetSlot as Ee } from "../WidgetSlot.js";
18
18
  import { FieldRow as ve } from "./FieldRow.js";
19
- import { FoldArea as Kt, RowGroupCell as Ht, rowMemberField as Wt } from "./form-structure-ui.js";
20
- import { useFormHelpVideos as At, FormHelpVideoButton as Et } from "./FormHelpVideoButton.js";
21
- import { applyDisplayTemplate as Yt, useContainerWidth as Qt, resolveColSpan as Ee } from "./helpers.js";
22
- import { SectionIntro as Zt } from "./LayoutContentBlock.js";
23
- import { UserChip as at, OwnersInline as Ye, OwnersInlineCompact as Xt } from "./UserChip.js";
24
- import { UserRosterCluster as Bn } from "./UserChip.js";
25
- function Qe(t) {
19
+ import { FoldArea as Ht, RowGroupCell as Wt, rowMemberField as At } from "./form-structure-ui.js";
20
+ import { useFormHelpVideos as Et, FormHelpVideoButton as Yt } from "./FormHelpVideoButton.js";
21
+ import { applyDisplayTemplate as Qt, useContainerWidth as Zt, resolveColSpan as Ye } from "./helpers.js";
22
+ import { SectionIntro as Xt } from "./LayoutContentBlock.js";
23
+ import { UserChip as ot, OwnersInline as Qe, OwnersInlineCompact as en } from "./UserChip.js";
24
+ import { UserRosterCluster as Un } from "./UserChip.js";
25
+ function Ze(t) {
26
26
  if (typeof t != "string") return t ?? [];
27
27
  try {
28
28
  return JSON.parse(t);
@@ -30,20 +30,20 @@ function Qe(t) {
30
30
  return [];
31
31
  }
32
32
  }
33
- function en({
33
+ function tn({
34
34
  relCollection: t,
35
35
  relId: r,
36
36
  entries: i,
37
37
  separator: u
38
38
  }) {
39
- const s = ue(), l = st(), n = String(r), m = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data: h } = de({
39
+ const s = ue(), l = lt(), n = String(r), m = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data: h } = de({
40
40
  queryKey: ["inline-display", t, n, m],
41
41
  queryFn: () => l(t, n, m),
42
42
  enabled: !!s && !!n,
43
43
  staleTime: 6e4
44
44
  });
45
45
  if (!h) return null;
46
- const k = (g) => {
46
+ const S = (g) => {
47
47
  let f = h;
48
48
  for (const y of g.split(".")) {
49
49
  if (f == null || typeof f != "object") return;
@@ -52,33 +52,33 @@ function en({
52
52
  return f;
53
53
  };
54
54
  if (u != null) {
55
- const g = (L) => {
56
- const S = k(L.field);
57
- if (S == null || S === "") return null;
58
- const D = L.format ?? "text";
55
+ const g = (O) => {
56
+ const k = S(O.field);
57
+ if (k == null || k === "") return null;
58
+ const D = O.format ?? "text";
59
59
  if (D === "date" || D === "datetime")
60
60
  try {
61
- return new Date(String(S)).toLocaleDateString();
61
+ return Se(k);
62
62
  } catch {
63
- return String(S);
63
+ return String(k);
64
64
  }
65
- return D === "boolean" ? S ? "Yes" : "No" : String(S);
65
+ return D === "boolean" ? k ? "Yes" : "No" : String(k);
66
66
  }, f = [];
67
67
  let y = [];
68
- for (const L of i)
69
- L.line_break && y.length > 0 ? (f.push(y), y = [L]) : y.push(L);
68
+ for (const O of i)
69
+ O.line_break && y.length > 0 ? (f.push(y), y = [O]) : y.push(O);
70
70
  y.length > 0 && f.push(y);
71
- const q = f.map(
72
- (L) => L.map((S) => {
73
- const D = g(S);
74
- return D ? { label: S.label ?? null, display: D } : null;
71
+ const B = f.map(
72
+ (O) => O.map((k) => {
73
+ const D = g(k);
74
+ return D ? { label: k.label ?? null, display: D } : null;
75
75
  }).filter(Boolean)
76
- ).filter((L) => L.length > 0);
77
- return q.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: q.map((L, S) => (
76
+ ).filter((O) => O.length > 0);
77
+ return B.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: B.map((O, k) => (
78
78
  // biome-ignore lint/suspicious/noArrayIndexKey: stable line order
79
- /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: L.map((D, J) => (
79
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: O.map((D, J) => (
80
80
  // biome-ignore lint/suspicious/noArrayIndexKey: stable token order
81
- /* @__PURE__ */ x(nt.Fragment, { children: [
81
+ /* @__PURE__ */ x(rt.Fragment, { children: [
82
82
  J > 0 && u,
83
83
  D.label && /* @__PURE__ */ x("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
84
84
  D.label,
@@ -87,22 +87,22 @@ function en({
87
87
  D.label ? " " : "",
88
88
  D.display
89
89
  ] }, J)
90
- )) }, S)
90
+ )) }, k)
91
91
  )) });
92
92
  }
93
93
  const o = i.map((g) => {
94
- const f = k(g.field);
94
+ const f = S(g.field);
95
95
  if (f == null || f === "") return null;
96
96
  const y = g.format ?? "text";
97
- let q;
97
+ let B;
98
98
  if (y === "date" || y === "datetime")
99
99
  try {
100
- q = new Date(String(f)).toLocaleDateString();
100
+ B = Se(f);
101
101
  } catch {
102
- q = String(f);
102
+ B = String(f);
103
103
  }
104
- else y === "boolean" ? q = f ? "Yes" : "No" : q = String(f);
105
- return { label: g.label, display: q };
104
+ else y === "boolean" ? B = f ? "Yes" : "No" : B = String(f);
105
+ return { label: g.label, display: B };
106
106
  }).filter(Boolean);
107
107
  return o.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1 rounded border border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800/50 px-3 py-1.5 space-y-0.5", children: o.map((g, f) => (
108
108
  // biome-ignore lint/suspicious/noArrayIndexKey: stable order from config
@@ -112,12 +112,12 @@ function en({
112
112
  ] }, f)
113
113
  )) });
114
114
  }
115
- function tn(t) {
115
+ function nn(t) {
116
116
  if (!t) return null;
117
- const r = t.replace(/(^|-)([a-z])/g, (u, s, l) => l.toUpperCase()), i = vt[r];
117
+ const r = t.replace(/(^|-)([a-z])/g, (u, s, l) => l.toUpperCase()), i = kt[r];
118
118
  return i || null;
119
119
  }
120
- function Ze(t) {
120
+ function Xe(t) {
121
121
  if (!t.options) return {};
122
122
  if (typeof t.options == "object") return t.options;
123
123
  try {
@@ -126,7 +126,7 @@ function Ze(t) {
126
126
  return {};
127
127
  }
128
128
  }
129
- function ke(t, r) {
129
+ function De(t, r) {
130
130
  if (t == null || t === "") return "—";
131
131
  if (typeof t == "boolean") return t ? "Yes" : "No";
132
132
  const i = (r == null ? void 0 : r.interface) ?? "", u = (() => {
@@ -195,15 +195,15 @@ function ke(t, r) {
195
195
  } catch {
196
196
  }
197
197
  if ((i === "select-dropdown" || i === "radio-buttons") && r) {
198
- const a = Ze(r).choices;
198
+ const a = Xe(r).choices;
199
199
  if (Array.isArray(a)) {
200
200
  const m = a.find((h) => String(h.value) === s);
201
- if (m) return It(m.text);
201
+ if (m) return Mt(m.text);
202
202
  }
203
203
  }
204
204
  const l = Number(s);
205
205
  if (!Number.isNaN(l) && s !== "" && r) {
206
- const n = Ze(r), a = n.format, m = typeof n.unit == "string" ? n.unit.trim() : "";
206
+ const n = Xe(r), a = n.format, m = typeof n.unit == "string" ? n.unit.trim() : "";
207
207
  if (m && !a) {
208
208
  const h = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(l);
209
209
  if (m === "$")
@@ -234,21 +234,21 @@ function ke(t, r) {
234
234
  }).format(l);
235
235
  }
236
236
  }
237
- return !s.includes(" ") && !s.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s) && !/^\d+$/.test(s) && (s.includes("_") || s.includes("-") || /^[a-z]/.test(s)) ? lt(s) : s;
237
+ return !s.includes(" ") && !s.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s) && !/^\d+$/.test(s) && (s.includes("_") || s.includes("-") || /^[a-z]/.test(s)) ? at(s) : s;
238
238
  }
239
- function Xe({ userId: t }) {
240
- const r = ue(), { navigate: i, userUrl: u } = Lt(), s = u ? u(t) : `/users/${t}`, { data: l } = de({
239
+ function et({ userId: t }) {
240
+ const r = ue(), { navigate: i, userUrl: u } = qt(), s = u ? u(t) : `/users/${t}`, { data: l } = de({
241
241
  queryKey: ["user-chip", t],
242
242
  queryFn: () => r.request(
243
- rt(`/users/${t}`)
243
+ it(`/users/${t}`)
244
244
  ).then((m) => m.data ?? null),
245
245
  enabled: !!r && !!t,
246
246
  staleTime: 12e4
247
247
  }), n = l ? [l.first_name, l.last_name].filter(Boolean).join(" ") || l.email : t, a = n.split(" ").map((m) => m[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
248
- return /* @__PURE__ */ x(Jt, { children: [
249
- /* @__PURE__ */ e(Rt, { asChild: !0, children: /* @__PURE__ */ x("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 py-px pl-0.5 pr-2 hover:bg-slate-200 transition-colors", children: [
248
+ return /* @__PURE__ */ x(Rt, { children: [
249
+ /* @__PURE__ */ e(zt, { asChild: !0, children: /* @__PURE__ */ x("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 py-px pl-0.5 pr-2 hover:bg-slate-200 transition-colors", children: [
250
250
  /* @__PURE__ */ e(
251
- Ct,
251
+ Jt,
252
252
  {
253
253
  userId: t,
254
254
  className: "h-4 w-4",
@@ -257,27 +257,27 @@ function Xe({ userId: t }) {
257
257
  ),
258
258
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-600", children: n })
259
259
  ] }) }),
260
- /* @__PURE__ */ x(zt, { align: "start", className: "text-[12px]", children: [
260
+ /* @__PURE__ */ x(Kt, { align: "start", className: "text-[12px]", children: [
261
261
  s && /* @__PURE__ */ x(
262
- We,
262
+ Ae,
263
263
  {
264
264
  className: "gap-2 text-[12px] cursor-pointer",
265
265
  onSelect: () => i(s),
266
266
  children: [
267
- /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" }),
267
+ /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
268
268
  " View profile"
269
269
  ]
270
270
  }
271
271
  ),
272
272
  (l == null ? void 0 : l.email) && /* @__PURE__ */ x(
273
- We,
273
+ Ae,
274
274
  {
275
275
  className: "gap-2 text-[12px] cursor-pointer",
276
276
  onSelect: () => {
277
277
  window.location.href = `mailto:${l.email}`;
278
278
  },
279
279
  children: [
280
- /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
280
+ /* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
281
281
  " Send email"
282
282
  ]
283
283
  }
@@ -285,7 +285,7 @@ function Xe({ userId: t }) {
285
285
  ] })
286
286
  ] });
287
287
  }
288
- function nn({
288
+ function rn({
289
289
  collection: t,
290
290
  itemId: r,
291
291
  layoutId: i,
@@ -293,12 +293,12 @@ function nn({
293
293
  filenameTemplate: s,
294
294
  label: l
295
295
  }) {
296
- const n = ue(), a = wt(), [m, h] = Q(!1), k = async () => {
296
+ const n = ue(), a = vt(), [m, h] = Q(!1), S = async () => {
297
297
  if (!(!n || m || !u)) {
298
298
  h(!0);
299
299
  try {
300
300
  await n.request(
301
- Ot(`/collection-layouts/${i}/generate-and-attach`, {
301
+ Bt(`/collection-layouts/${i}/generate-and-attach`, {
302
302
  collection: t,
303
303
  item_id: r,
304
304
  attach_field: u,
@@ -315,7 +315,7 @@ function nn({
315
315
  "button",
316
316
  {
317
317
  type: "button",
318
- onClick: k,
318
+ onClick: S,
319
319
  disabled: m || o,
320
320
  title: o ? "Configure PDF field in Data Model → Layouts" : void 0,
321
321
  className: "inline-flex items-center gap-1.5 rounded-md border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 disabled:cursor-not-allowed disabled:opacity-40 dark:text-nvr-cyan",
@@ -348,36 +348,36 @@ function re({
348
348
  className: i
349
349
  }) {
350
350
  var f;
351
- const u = ue(), s = st(), l = r != null && r !== "" ? String(r) : null, { data: n } = de({
351
+ const u = ue(), s = lt(), l = r != null && r !== "" ? String(r) : null, { data: n } = de({
352
352
  queryKey: ["col-meta-dt", t],
353
353
  queryFn: () => u.request(
354
- rt(`/collections/${t}`)
354
+ it(`/collections/${t}`)
355
355
  ).then((y) => y.data).catch(() => ({})),
356
356
  enabled: !!u && !!l,
357
357
  staleTime: 3e5
358
- }), a = (((f = n == null ? void 0 : n.display_template) == null ? void 0 : f.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((y) => y.replace(/[{}\s]/g, "")).filter((y) => y.includes(".")), m = a.length ? ["id", ...a].join(",") : null, { data: h, isLoading: k } = de({
358
+ }), a = (((f = n == null ? void 0 : n.display_template) == null ? void 0 : f.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((y) => y.replace(/[{}\s]/g, "")).filter((y) => y.includes(".")), m = a.length ? ["id", ...a].join(",") : null, { data: h, isLoading: S } = de({
359
359
  queryKey: ["rel-display", t, l, m],
360
360
  queryFn: () => s(t, l, m),
361
361
  enabled: !!u && !!l && n !== void 0,
362
362
  staleTime: 6e4
363
363
  });
364
364
  if (!l) return /* @__PURE__ */ e("span", { children: "—" });
365
- if (k || u && n === void 0)
365
+ if (S || u && n === void 0)
366
366
  return /* @__PURE__ */ e("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
367
367
  const o = i ?? "text-[13px] text-slate-700";
368
368
  if (!h) return /* @__PURE__ */ e("span", { className: o, children: l });
369
- const g = n != null && n.display_template ? Yt(n.display_template, h) : String(h.name ?? h.title ?? h.label ?? h.display_name ?? l);
369
+ const g = n != null && n.display_template ? Qt(n.display_template, h) : String(h.name ?? h.title ?? h.label ?? h.display_name ?? l);
370
370
  return /* @__PURE__ */ e("span", { className: o, children: g });
371
371
  }
372
- function et({ userId: t }) {
373
- return /* @__PURE__ */ e(at, { userId: t, size: "compact" });
372
+ function tt({ userId: t }) {
373
+ return /* @__PURE__ */ e(ot, { userId: t, size: "compact" });
374
374
  }
375
- function tt({
375
+ function nt({
376
376
  relCollection: t,
377
377
  id: r,
378
378
  drillConfig: i
379
379
  }) {
380
- const u = jt(), s = /* @__PURE__ */ e(re, { relCollection: t, id: r });
380
+ const u = Ot(), s = /* @__PURE__ */ e(re, { relCollection: t, id: r });
381
381
  return !u || r == null || r === "" ? s : /* @__PURE__ */ e(
382
382
  "button",
383
383
  {
@@ -404,8 +404,8 @@ function tt({
404
404
  }
405
405
  );
406
406
  }
407
- function rn(t) {
408
- const [r, i] = Q(!1), u = Se(!0), s = Se(JSON.stringify(t ?? null));
407
+ function sn(t) {
408
+ const [r, i] = Q(!1), u = ke(!0), s = ke(JSON.stringify(t ?? null));
409
409
  return ne(() => {
410
410
  const l = JSON.stringify(t ?? null);
411
411
  if (u.current) {
@@ -420,7 +420,7 @@ function rn(t) {
420
420
  };
421
421
  }, [t]), r ? "nvr-value-pulse" : "";
422
422
  }
423
- function jn({
423
+ function On({
424
424
  field: t,
425
425
  val: r,
426
426
  relations: i,
@@ -428,15 +428,15 @@ function jn({
428
428
  displayFormat: s,
429
429
  textClassName: l
430
430
  }) {
431
- const n = rn(r), a = W(l ?? "text-[13px] text-slate-900 dark:text-slate-100", n), m = Ft(t) ?? { enabled: !0, layout_id: null, width: null }, h = i.find(
431
+ const n = sn(r), a = W(l ?? "text-[13px] text-slate-900 dark:text-slate-100", n), m = jt(t) ?? { enabled: !0, layout_id: null, width: null }, h = i.find(
432
432
  (o) => o.one_collection === u && o.one_field === t.field && o.junction_field
433
433
  );
434
434
  if (h) {
435
435
  const o = i.find(
436
436
  (y) => y.many_collection === h.many_collection && y.many_field === h.junction_field
437
437
  ), g = o == null ? void 0 : o.one_collection, f = Array.isArray(r) ? r : r != null && r !== "" ? [r] : [];
438
- return !g || f.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : g === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: f.map((y) => /* @__PURE__ */ e(et, { userId: String(y) }, String(y))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: f.map((y) => /* @__PURE__ */ e(
439
- tt,
438
+ return !g || f.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : g === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: f.map((y) => /* @__PURE__ */ e(tt, { userId: String(y) }, String(y))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: f.map((y) => /* @__PURE__ */ e(
439
+ nt,
440
440
  {
441
441
  relCollection: g,
442
442
  id: y,
@@ -445,15 +445,15 @@ function jn({
445
445
  String(y)
446
446
  )) });
447
447
  }
448
- const k = i.find(
448
+ const S = i.find(
449
449
  (o) => o.many_collection === u && o.many_field === t.field && !o.junction_field
450
450
  );
451
- if (k != null && k.one_collection) {
451
+ if (S != null && S.one_collection) {
452
452
  const o = Array.isArray(r) ? r : r != null && r !== "" ? [r] : [];
453
- return o.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : k.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: o.map((g) => /* @__PURE__ */ e(et, { userId: String(g) }, String(g))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: o.map((g) => /* @__PURE__ */ e(
454
- tt,
453
+ return o.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : S.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: o.map((g) => /* @__PURE__ */ e(tt, { userId: String(g) }, String(g))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: o.map((g) => /* @__PURE__ */ e(
454
+ nt,
455
455
  {
456
- relCollection: k.one_collection,
456
+ relCollection: S.one_collection,
457
457
  id: g,
458
458
  drillConfig: m
459
459
  },
@@ -480,7 +480,7 @@ function jn({
480
480
  ) });
481
481
  if (s === "date")
482
482
  try {
483
- return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Date(String(r)).toLocaleDateString() });
483
+ return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: Se(r) });
484
484
  } catch {
485
485
  }
486
486
  if (s === "datetime")
@@ -489,9 +489,9 @@ function jn({
489
489
  } catch {
490
490
  }
491
491
  }
492
- return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: ke(r, t) });
492
+ return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: De(r, t) });
493
493
  }
494
- function sn({
494
+ function ln({
495
495
  summaryFields: t,
496
496
  fields: r,
497
497
  draft: i,
@@ -502,27 +502,27 @@ function sn({
502
502
  ownersItemId: a,
503
503
  ownersAssignment: m,
504
504
  m2mCounts: h,
505
- o2mCounts: k,
505
+ o2mCounts: S,
506
506
  o2mAggValues: o,
507
507
  summaryAggConfigs: g,
508
508
  o2mLoading: f,
509
509
  hideEmpty: y
510
510
  }) {
511
- const q = t.map((N) => typeof N == "string" ? N : N.field), L = y ? q.filter((N) => {
511
+ const B = t.map((N) => typeof N == "string" ? N : N.field), O = y ? B.filter((N) => {
512
512
  if (N === "__owners__" || f != null && f.has(N) || o && N in o) return !0;
513
513
  if (h && N in h) return (h[N] ?? 0) > 0;
514
- if (k && N in k) return (k[N] ?? 0) > 0;
514
+ if (S && N in S) return (S[N] ?? 0) > 0;
515
515
  const U = i[N];
516
516
  return U != null && U !== "" && !(Array.isArray(U) && U.length === 0);
517
- }) : q;
518
- if (L.length === 0) return null;
519
- const S = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", D = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", J = "text-[12px] text-slate-300 dark:text-slate-600", R = "flex items-baseline gap-1.5", me = (N) => {
517
+ }) : B;
518
+ if (O.length === 0) return null;
519
+ const k = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", D = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", J = "text-[12px] text-slate-300 dark:text-slate-600", R = "flex items-baseline gap-1.5", me = (N) => {
520
520
  if (N === "__owners__") {
521
521
  const d = (m == null ? void 0 : m.label_override) || "Owners";
522
522
  return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
523
- /* @__PURE__ */ e("span", { className: S, children: d }),
523
+ /* @__PURE__ */ e("span", { className: k, children: d }),
524
524
  /* @__PURE__ */ e(
525
- Xt,
525
+ en,
526
526
  {
527
527
  collection: n ?? s,
528
528
  itemId: a ?? l
@@ -533,11 +533,11 @@ function sn({
533
533
  const U = t.find((d) => (typeof d == "string" ? d : d.field) === N), ie = U && typeof U != "string" ? U.label : void 0, A = r.find((d) => d.field === N), I = ie || (A == null ? void 0 : A.label) || N.replace(/_/g, " ").replace(/\b\w/g, (d) => d.toUpperCase());
534
534
  if (f != null && f.has(N))
535
535
  return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
536
- /* @__PURE__ */ e("span", { className: S, children: I }),
537
- /* @__PURE__ */ e(kt, { className: "h-3 w-3 animate-spin text-slate-300" })
536
+ /* @__PURE__ */ e("span", { className: k, children: I }),
537
+ /* @__PURE__ */ e(Dt, { className: "h-3 w-3 animate-spin text-slate-300" })
538
538
  ] });
539
539
  if (o && N in o) {
540
- const d = g == null ? void 0 : g[N], B = (d == null ? void 0 : d.label) || I, $ = o[N];
540
+ const d = g == null ? void 0 : g[N], L = (d == null ? void 0 : d.label) || I, $ = o[N];
541
541
  let G;
542
542
  if ((d == null ? void 0 : d.agg) === "count")
543
543
  G = String($);
@@ -570,14 +570,14 @@ function sn({
570
570
  G = $.toLocaleString(void 0, { maximumFractionDigits: 2 });
571
571
  }
572
572
  return /* @__PURE__ */ x("div", { className: R, children: [
573
- /* @__PURE__ */ e("span", { className: S, children: B }),
573
+ /* @__PURE__ */ e("span", { className: k, children: L }),
574
574
  /* @__PURE__ */ e("span", { className: D, children: G })
575
575
  ] });
576
576
  }
577
577
  if (h && N in h) {
578
578
  const d = h[N];
579
579
  return /* @__PURE__ */ x("div", { className: R, children: [
580
- /* @__PURE__ */ e("span", { className: S, children: I }),
580
+ /* @__PURE__ */ e("span", { className: k, children: I }),
581
581
  /* @__PURE__ */ x("span", { className: D, children: [
582
582
  d,
583
583
  " item",
@@ -585,10 +585,10 @@ function sn({
585
585
  ] })
586
586
  ] });
587
587
  }
588
- if (k && N in k) {
589
- const d = k[N];
588
+ if (S && N in S) {
589
+ const d = S[N];
590
590
  return /* @__PURE__ */ x("div", { className: R, children: [
591
- /* @__PURE__ */ e("span", { className: S, children: I }),
591
+ /* @__PURE__ */ e("span", { className: k, children: I }),
592
592
  /* @__PURE__ */ x("span", { className: D, children: [
593
593
  d,
594
594
  " row",
@@ -602,16 +602,16 @@ function sn({
602
602
  if (M != null && M.one_collection) {
603
603
  const d = Array.isArray(j) ? j : j != null && j !== "" ? [j] : [];
604
604
  return /* @__PURE__ */ x("div", { className: R, children: [
605
- /* @__PURE__ */ e("span", { className: S, children: I }),
606
- d.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : M.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: d.map((B) => /* @__PURE__ */ e(Xe, { userId: String(B) }, String(B))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: d.map((B) => /* @__PURE__ */ e(re, { relCollection: M.one_collection, id: B }, String(B))) })
605
+ /* @__PURE__ */ e("span", { className: k, children: I }),
606
+ d.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : M.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: d.map((L) => /* @__PURE__ */ e(et, { userId: String(L) }, String(L))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: d.map((L) => /* @__PURE__ */ e(re, { relCollection: M.one_collection, id: L }, String(L))) })
607
607
  ] });
608
608
  }
609
609
  if (Array.isArray(j)) {
610
- const d = u.find(($) => $.many_field === N && $.junction_field), B = d == null ? void 0 : d.one_collection;
610
+ const d = u.find(($) => $.many_field === N && $.junction_field), L = d == null ? void 0 : d.one_collection;
611
611
  return /* @__PURE__ */ x("div", { className: R, children: [
612
- /* @__PURE__ */ e("span", { className: S, children: I }),
613
- j.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : B ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: j.map(
614
- ($) => B === "nivaro_users" ? /* @__PURE__ */ e(Xe, { userId: String($) }, String($)) : /* @__PURE__ */ e(re, { relCollection: B, id: $ }, String($))
612
+ /* @__PURE__ */ e("span", { className: k, children: I }),
613
+ j.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : L ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: j.map(
614
+ ($) => L === "nivaro_users" ? /* @__PURE__ */ e(et, { userId: String($) }, String($)) : /* @__PURE__ */ e(re, { relCollection: L, id: $ }, String($))
615
615
  ) }) : /* @__PURE__ */ x("span", { className: D, children: [
616
616
  j.length,
617
617
  " item",
@@ -620,13 +620,13 @@ function sn({
620
620
  ] });
621
621
  }
622
622
  return /* @__PURE__ */ x("div", { className: R, children: [
623
- /* @__PURE__ */ e("span", { className: S, children: I }),
624
- j == null || j === "" ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : /* @__PURE__ */ e("span", { className: D, children: ke(j, A) })
623
+ /* @__PURE__ */ e("span", { className: k, children: I }),
624
+ j == null || j === "" ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : /* @__PURE__ */ e("span", { className: D, children: De(j, A) })
625
625
  ] });
626
626
  };
627
- return /* @__PURE__ */ e("div", { className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5 border-t border-slate-100 dark:border-border/60 bg-slate-50/50 dark:bg-white/[0.015] px-5 py-2.5", children: L.map((N) => /* @__PURE__ */ e(nt.Fragment, { children: me(N) }, N)) });
627
+ return /* @__PURE__ */ e("div", { className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5 border-t border-slate-100 dark:border-border/60 bg-slate-50/50 dark:bg-white/[0.015] px-5 py-2.5", children: O.map((N) => /* @__PURE__ */ e(rt.Fragment, { children: me(N) }, N)) });
628
628
  }
629
- function Ln({
629
+ function qn({
630
630
  group: t,
631
631
  fields: r,
632
632
  draft: i,
@@ -637,14 +637,14 @@ function Ln({
637
637
  errors: a,
638
638
  visibleFields: m,
639
639
  lockedFields: h,
640
- layoutAiEnabled: k,
640
+ layoutAiEnabled: S,
641
641
  displayOnly: o,
642
642
  renderField: g,
643
643
  onCountChange: f,
644
644
  isNew: y,
645
- fieldValues: q,
646
- isOpen: L,
647
- onToggle: S,
645
+ fieldValues: B,
646
+ isOpen: O,
647
+ onToggle: k,
648
648
  summaryFields: D,
649
649
  m2mCounts: J,
650
650
  o2mCounts: R,
@@ -657,46 +657,46 @@ function Ln({
657
657
  ownersAssignment: j,
658
658
  pdfAssignment: M,
659
659
  pdfAttachField: d,
660
- pdfFilenameTemplate: B,
660
+ pdfFilenameTemplate: L,
661
661
  layoutId: $,
662
662
  hideEmptySummary: G,
663
663
  widgetAssignments: K,
664
664
  widgetApiBase: E,
665
665
  fieldInlineDisplay: Y,
666
666
  swapConfig: V,
667
- swapped: De,
668
- onSwapToggle: $e,
667
+ swapped: $e,
668
+ onSwapToggle: Fe,
669
669
  alternateFields: Z,
670
670
  alternateWidths: pe,
671
671
  deferred: se,
672
672
  onFirstOpen: le
673
673
  }) {
674
- var Me;
675
- const [ot, ct] = Q(t.is_collapsed ?? !1), [dt, ut] = Q(!1), F = Vt(), H = (p, _) => Gt(F, p, _, { asChild: !0 }), ae = (p) => ({ kind: "slot", field: p, group_key: t.key }), Fe = !!(F != null && F.showHidden), [je, Le] = Q({}), { data: fe } = At(l), X = (F == null ? void 0 : F.fold) ?? null, ee = (F == null ? void 0 : F.reveal) ?? null, [Oe, he] = Q(null);
674
+ var Ge;
675
+ const [ct, dt] = Q(t.is_collapsed ?? !1), [ut, mt] = Q(!1), F = Pt(), H = (p, _) => Vt(F, p, _, { asChild: !0 }), ae = (p) => ({ kind: "slot", field: p, group_key: t.key }), je = !!(F != null && F.showHidden), [Oe, qe] = Q({}), { data: fe } = Et(l), X = (F == null ? void 0 : F.fold) ?? null, ee = (F == null ? void 0 : F.reveal) ?? null, [Be, he] = Q(null);
676
676
  ne(() => {
677
677
  X && he(!X.open);
678
678
  }, [X == null ? void 0 : X.seq]), ne(() => {
679
- ee && Pt(ee.target) === t.key && he(!1);
679
+ ee && Ct(ee.target) === t.key && he(!1);
680
680
  }, [ee == null ? void 0 : ee.seq]);
681
- const qe = S !== void 0, z = Oe ?? (qe ? !L : ot);
681
+ const Le = k !== void 0, z = Be ?? (Le ? !O : ct);
682
682
  ne(() => {
683
683
  se && !z && (le == null || le(t.key));
684
684
  }, [se, z, le, t.key]);
685
- const be = Oe !== null ? () => he((p) => !p) : qe ? S : () => ct((p) => !p), Be = !F && $ != null, ge = () => {
686
- Be && it({ layoutId: Number($), collection: l, kind: "opened", key: t.key });
687
- }, mt = () => {
685
+ const be = Be !== null ? () => he((p) => !p) : Le ? k : () => dt((p) => !p), Ue = !F && $ != null, ge = () => {
686
+ Ue && st({ layoutId: Number($), collection: l, kind: "opened", key: t.key });
687
+ }, pt = () => {
688
688
  z && ge(), be == null || be();
689
- }, pt = !o && r.some((p) => a[p.field]), Ue = F ? "always" : t.visibility_mode ?? "always";
690
- if (Ue === "new_only" && !y || Ue === "existing_only" && y) return null;
691
- const te = K ?? [], ft = !y && te.some((p) => p.widget_id != null && je[p.field] === void 0);
689
+ }, ft = !o && r.some((p) => a[p.field]), Te = F ? "always" : t.visibility_mode ?? "always";
690
+ if (Te === "new_only" && !y || Te === "existing_only" && y) return null;
691
+ const te = K ?? [], ht = !y && te.some((p) => p.widget_id != null && Oe[p.field] === void 0);
692
692
  let oe = !1;
693
- if (t.hide_when_empty && q && !F && (oe = q.every(
693
+ if (t.hide_when_empty && B && !F && (oe = B.every(
694
694
  (_) => _ == null || _ === "" || Array.isArray(_) && _.length === 0
695
- ) && !ft && te.every((_) => !je[_.field])), oe && te.length === 0) return null;
696
- const xe = Se(null), ye = Qt(xe), Te = tn(t.icon), ht = Fe ? r : r.filter((p) => !p.hidden), Ie = (Me = fe == null ? void 0 : fe.sections) == null ? void 0 : Me[t.key], bt = Array.isArray(Ie) && Ie.length > 0, gt = (p) => bt ? /* @__PURE__ */ x("div", { className: "relative", children: [
695
+ ) && !ht && te.every((_) => !Oe[_.field])), oe && te.length === 0) return null;
696
+ const xe = ke(null), ye = Zt(xe), Ie = nn(t.icon), bt = je ? r : r.filter((p) => !p.hidden), Me = (Ge = fe == null ? void 0 : fe.sections) == null ? void 0 : Ge[t.key], gt = Array.isArray(Me) && Me.length > 0, xt = (p) => gt ? /* @__PURE__ */ x("div", { className: "relative", children: [
697
697
  p,
698
698
  /* @__PURE__ */ e("span", { className: "absolute right-[52px] top-1/2 flex -translate-y-1/2", children: /* @__PURE__ */ e(
699
- Et,
699
+ Yt,
700
700
  {
701
701
  collection: l,
702
702
  kind: "section",
@@ -704,7 +704,7 @@ function Ln({
704
704
  label: t.label || t.key
705
705
  }
706
706
  ) })
707
- ] }) : p, Ne = (p) => Fe && (p.hidden || !(m.has(p.field) || !m.size));
707
+ ] }) : p, Ne = (p) => je && (p.hidden || !(m.has(p.field) || !m.size));
708
708
  return /* @__PURE__ */ x(
709
709
  "div",
710
710
  {
@@ -724,14 +724,14 @@ function Ln({
724
724
  (c = (_ = p.target) == null ? void 0 : _.closest) != null && c.call(_, "[data-usage-header]") || ge();
725
725
  },
726
726
  children: [
727
- Be && !oe && /* @__PURE__ */ e(ln, { layoutId: Number($), collection: l, sectionKey: t.key }),
728
- gt(
727
+ Ue && !oe && /* @__PURE__ */ e(an, { layoutId: Number($), collection: l, sectionKey: t.key }),
728
+ xt(
729
729
  /* @__PURE__ */ x(
730
730
  "button",
731
731
  {
732
732
  type: "button",
733
733
  "data-usage-header": "",
734
- onClick: mt,
734
+ onClick: pt,
735
735
  "data-design-group-header": F ? "" : void 0,
736
736
  className: W(
737
737
  "flex w-full items-center gap-2 px-5 py-3 text-left hover:bg-slate-50/50 dark:hover:bg-white/[0.02] rounded-t-xl",
@@ -741,10 +741,10 @@ function Ln({
741
741
  z && !(D && D.length > 0) && "rounded-b-xl"
742
742
  ),
743
743
  children: [
744
- Te && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
744
+ Ie && /* @__PURE__ */ e(Ie, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
745
745
  /* @__PURE__ */ e("span", { className: "font-medium text-[13px] shrink-0 text-slate-800 dark:text-slate-200", children: t.label }),
746
746
  /* @__PURE__ */ e("span", { className: "flex-1" }),
747
- pt && /* @__PURE__ */ e("span", { className: "nvr-pop h-2 w-2 rounded-full bg-destructive shrink-0" }),
747
+ ft && /* @__PURE__ */ e("span", { className: "nvr-pop h-2 w-2 rounded-full bg-destructive shrink-0" }),
748
748
  /* @__PURE__ */ e(
749
749
  St,
750
750
  {
@@ -760,7 +760,7 @@ function Ln({
760
760
  )
761
761
  ),
762
762
  z && D && D.length > 0 && /* @__PURE__ */ e(
763
- sn,
763
+ ln,
764
764
  {
765
765
  summaryFields: D,
766
766
  fields: r,
@@ -780,27 +780,27 @@ function Ln({
780
780
  }
781
781
  ),
782
782
  z && !se && t.hide_when_empty && te.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: te.filter((p) => p.widget_id != null).map((p) => /* @__PURE__ */ e(
783
- Ae,
783
+ Ee,
784
784
  {
785
785
  widgetId: p.widget_id,
786
- inputBindings: Qe(p.input_bindings),
786
+ inputBindings: Ze(p.input_bindings),
787
787
  itemDraft: i,
788
788
  frameless: !0,
789
789
  apiBase: E,
790
- onContentChange: (_) => Le(
790
+ onContentChange: (_) => qe(
791
791
  (c) => c[p.field] === _ ? c : { ...c, [p.field]: _ }
792
792
  )
793
793
  },
794
794
  p.field
795
795
  )) }),
796
796
  !z && /* @__PURE__ */ x("div", { className: "nvr-expand-in border-t border-slate-100 px-5 py-4", children: [
797
- !o && /* @__PURE__ */ e(Zt, { group: t, className: "mb-3" }),
797
+ !o && /* @__PURE__ */ e(Xt, { group: t, className: "mb-3" }),
798
798
  (() => {
799
- const p = qt(ht, {
800
- rows: o ? [] : Tt(t.swap_config).rows,
801
- folded: (c) => !o && Ut(c._overrides),
799
+ const p = Lt(bt, {
800
+ rows: o ? [] : It(t.swap_config).rows,
801
+ folded: (c) => !o && Tt(c._overrides),
802
802
  keep: (c) => !!c.required,
803
- filled: (c) => !Bt(i[c.field]) || !!a[c.field]
803
+ filled: (c) => !Ut(i[c.field]) || !!a[c.field]
804
804
  }), _ = p.units.map(
805
805
  (c) => c.kind === "row" ? {
806
806
  _k: `row:${c.row.key}`,
@@ -823,7 +823,7 @@ function Ln({
823
823
  });
824
824
  for (const c of K ?? [])
825
825
  _.push({ _k: c.field, sort: c.sort, _t: "widget", slot: c });
826
- return _.sort((c, O) => c.sort - O.sort), F && _.length === 0 && p.folded.length === 0 ? /* @__PURE__ */ e(Mt, {}) : o ? /* @__PURE__ */ x(
826
+ return _.sort((c, q) => c.sort - q.sort), F && _.length === 0 && p.folded.length === 0 ? /* @__PURE__ */ e(Gt, {}) : o ? /* @__PURE__ */ x(
827
827
  "div",
828
828
  {
829
829
  ref: xe,
@@ -841,7 +841,7 @@ function Ln({
841
841
  className: "min-w-0",
842
842
  style: { gridColumn: `span ${v}` },
843
843
  children: /* @__PURE__ */ e(
844
- Ye,
844
+ Qe,
845
845
  {
846
846
  collection: l,
847
847
  itemId: n,
@@ -854,25 +854,25 @@ function Ln({
854
854
  );
855
855
  }
856
856
  if (c._t === "pdf" || c._t === "widget" || c._t === "row") return null;
857
- const O = c.f, b = s.find(
858
- (v) => v.many_collection === l && v.many_field === O.field && !v.junction_field
857
+ const q = c.f, b = s.find(
858
+ (v) => v.many_collection === l && v.many_field === q.field && !v.junction_field
859
859
  );
860
860
  return H(
861
- { kind: "field", field: O.field, group_key: t.key },
861
+ { kind: "field", field: q.field, group_key: t.key },
862
862
  /* @__PURE__ */ x(
863
863
  "div",
864
864
  {
865
865
  className: "min-w-0",
866
- style: { gridColumn: `span ${Ee(O.options, ye)}` },
866
+ style: { gridColumn: `span ${Ye(q.options, ye)}` },
867
867
  children: [
868
- /* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: O.label || lt(O.field) }),
868
+ /* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: q.label || at(q.field) }),
869
869
  /* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (b == null ? void 0 : b.one_collection) === "nivaro_users" ? (() => {
870
- const v = i[O.field], P = Array.isArray(v) ? v : v != null && v !== "" ? [v] : [];
871
- return P.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: P.map((T) => /* @__PURE__ */ e(at, { userId: String(T) }, String(T))) });
872
- })() : b != null && b.one_collection ? /* @__PURE__ */ e(re, { relCollection: b.one_collection, id: i[O.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: ke(i[O.field], O) }) })
870
+ const v = i[q.field], P = Array.isArray(v) ? v : v != null && v !== "" ? [v] : [];
871
+ return P.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: P.map((T) => /* @__PURE__ */ e(ot, { userId: String(T) }, String(T))) });
872
+ })() : b != null && b.one_collection ? /* @__PURE__ */ e(re, { relCollection: b.one_collection, id: i[q.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: De(i[q.field], q) }) })
873
873
  ]
874
874
  },
875
- O.field
875
+ q.field
876
876
  )
877
877
  );
878
878
  })
@@ -880,10 +880,10 @@ function Ln({
880
880
  }
881
881
  ) : (() => {
882
882
  const c = (b) => {
883
- var ze, Ke;
883
+ var Ke, He;
884
884
  if (b._t === "row")
885
885
  return /* @__PURE__ */ e(
886
- Ht,
886
+ Wt,
887
887
  {
888
888
  row: b.row,
889
889
  members: b.members,
@@ -894,7 +894,7 @@ function Ln({
894
894
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
895
895
  ve,
896
896
  {
897
- field: Wt(w),
897
+ field: At(w),
898
898
  draft: i,
899
899
  onChange: u,
900
900
  relations: s,
@@ -904,7 +904,7 @@ function Ln({
904
904
  visible: m.has(w.field) || !m.size,
905
905
  forceVisible: Ne(w) || void 0,
906
906
  locked: h.has(w.field),
907
- layoutAiEnabled: k,
907
+ layoutAiEnabled: S,
908
908
  renderField: g,
909
909
  onCountChange: f
910
910
  }
@@ -918,7 +918,7 @@ function Ln({
918
918
  return H(
919
919
  ae("__owners__"),
920
920
  /* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
921
- Ye,
921
+ Qe,
922
922
  {
923
923
  collection: l,
924
924
  itemId: n,
@@ -929,17 +929,17 @@ function Ln({
929
929
  }
930
930
  if (b._t === "pdf") {
931
931
  if (!$) return null;
932
- const w = b.slot.col_span ?? 12, C = ((ze = b.slot.label_override) == null ? void 0 : ze.trim()) || "Generate PDF";
932
+ const w = b.slot.col_span ?? 12, C = ((Ke = b.slot.label_override) == null ? void 0 : Ke.trim()) || "Generate PDF";
933
933
  return H(
934
934
  ae("__pdf__"),
935
935
  /* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
936
- nn,
936
+ rn,
937
937
  {
938
938
  collection: l,
939
939
  itemId: n,
940
940
  layoutId: $,
941
941
  attachField: d ?? null,
942
- filenameTemplate: B,
942
+ filenameTemplate: L,
943
943
  label: C
944
944
  }
945
945
  ) }, "__pdf__")
@@ -947,11 +947,11 @@ function Ln({
947
947
  }
948
948
  if (b._t === "widget") {
949
949
  if (!b.slot.widget_id) return null;
950
- const w = b.slot.col_span ?? 12, C = Qe(b.slot.input_bindings);
950
+ const w = b.slot.col_span ?? 12, C = Ze(b.slot.input_bindings);
951
951
  return H(
952
952
  ae(b.slot.field),
953
953
  /* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
954
- Ae,
954
+ Ee,
955
955
  {
956
956
  widgetId: b.slot.widget_id,
957
957
  inputBindings: C,
@@ -960,29 +960,29 @@ function Ln({
960
960
  defaultExpanded: b.slot.default_expanded ?? !0,
961
961
  frameless: !0,
962
962
  apiBase: E,
963
- onContentChange: (He) => Le(
964
- (_e) => _e[b.slot.field] === He ? _e : { ..._e, [b.slot.field]: He }
963
+ onContentChange: (We) => qe(
964
+ (_e) => _e[b.slot.field] === We ? _e : { ..._e, [b.slot.field]: We }
965
965
  )
966
966
  }
967
967
  ) }, b.slot.field)
968
968
  );
969
969
  }
970
- const v = b.f, P = Y == null ? void 0 : Y[v.field], T = P == null ? void 0 : P.entries, xt = (P == null ? void 0 : P.separator) ?? null, ce = i[v.field], Ge = ce != null && ce !== "", Ve = T != null && T.length && Ge ? ((Ke = s.find(
970
+ const v = b.f, P = Y == null ? void 0 : Y[v.field], T = P == null ? void 0 : P.entries, yt = (P == null ? void 0 : P.separator) ?? null, ce = i[v.field], Ve = ce != null && ce !== "", Pe = T != null && T.length && Ve ? ((He = s.find(
971
971
  (w) => w.many_collection === l && w.many_field === v.field && !w.junction_field
972
- )) == null ? void 0 : Ke.one_collection) ?? null : null, Pe = (V == null ? void 0 : V.enabled) && v.field === V.primary_field, Ce = (() => {
972
+ )) == null ? void 0 : He.one_collection) ?? null : null, Ce = (V == null ? void 0 : V.enabled) && v.field === V.primary_field, Je = (() => {
973
973
  const w = i[(V == null ? void 0 : V.primary_field) ?? ""];
974
974
  return w != null && w !== "";
975
- })(), Je = (Z ?? []).some((w) => {
975
+ })(), Re = (Z ?? []).some((w) => {
976
976
  const C = i[w.field];
977
977
  return C != null && C !== "";
978
- }), yt = Pe && $e ? /* @__PURE__ */ x("span", { className: "inline-flex items-center gap-1.5", children: [
978
+ }), Nt = Ce && Fe ? /* @__PURE__ */ x("span", { className: "inline-flex items-center gap-1.5", children: [
979
979
  /* @__PURE__ */ e(
980
980
  "button",
981
981
  {
982
982
  type: "button",
983
- onClick: $e,
983
+ onClick: Fe,
984
984
  className: "inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 transition-colors",
985
- children: De ? V.back_label ?? "Back" : V.toggle_label ?? "Enter manually"
985
+ children: $e ? V.back_label ?? "Back" : V.toggle_label ?? "Enter manually"
986
986
  }
987
987
  ),
988
988
  /* @__PURE__ */ x(
@@ -990,7 +990,7 @@ function Ln({
990
990
  {
991
991
  className: [
992
992
  "inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
993
- Ce ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
993
+ Je ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
994
994
  ].join(" "),
995
995
  title: "Original field",
996
996
  children: [
@@ -999,7 +999,7 @@ function Ln({
999
999
  {
1000
1000
  className: [
1001
1001
  "h-1.5 w-1.5 rounded-full",
1002
- Ce ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1002
+ Je ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1003
1003
  ].join(" ")
1004
1004
  }
1005
1005
  ),
@@ -1012,7 +1012,7 @@ function Ln({
1012
1012
  {
1013
1013
  className: [
1014
1014
  "inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
1015
- Je ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
1015
+ Re ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
1016
1016
  ].join(" "),
1017
1017
  title: "Manual fields",
1018
1018
  children: [
@@ -1021,7 +1021,7 @@ function Ln({
1021
1021
  {
1022
1022
  className: [
1023
1023
  "h-1.5 w-1.5 rounded-full",
1024
- Je ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1024
+ Re ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
1025
1025
  ].join(" ")
1026
1026
  }
1027
1027
  ),
@@ -1029,7 +1029,7 @@ function Ln({
1029
1029
  ]
1030
1030
  }
1031
1031
  )
1032
- ] }) : void 0, Nt = Pe && De && (Z != null && Z.length) ? /* @__PURE__ */ e("div", { className: "mt-2 rounded-lg border border-slate-200 bg-slate-50 dark:border-border dark:bg-slate-900/40 p-3", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: Z.map((w) => {
1032
+ ] }) : void 0, _t = Ce && $e && (Z != null && Z.length) ? /* @__PURE__ */ e("div", { className: "mt-2 rounded-lg border border-slate-200 bg-slate-50 dark:border-border dark:bg-slate-900/40 p-3", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: Z.map((w) => {
1033
1033
  const C = (pe == null ? void 0 : pe[w.field]) ?? 2;
1034
1034
  return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${C}` }, children: /* @__PURE__ */ e(
1035
1035
  ve,
@@ -1044,12 +1044,12 @@ function Ln({
1044
1044
  visible: !0,
1045
1045
  forceVisible: !0,
1046
1046
  locked: h.has(w.field),
1047
- layoutAiEnabled: k,
1047
+ layoutAiEnabled: S,
1048
1048
  renderField: g,
1049
1049
  onCountChange: f
1050
1050
  }
1051
1051
  ) }, w.field);
1052
- }) }) }) : void 0, Re = /* @__PURE__ */ e(
1052
+ }) }) }) : void 0, ze = /* @__PURE__ */ e(
1053
1053
  ve,
1054
1054
  {
1055
1055
  field: v,
@@ -1062,11 +1062,11 @@ function Ln({
1062
1062
  visible: m.has(v.field) || !m.size,
1063
1063
  forceVisible: Ne(v) || void 0,
1064
1064
  locked: h.has(v.field),
1065
- layoutAiEnabled: k,
1065
+ layoutAiEnabled: S,
1066
1066
  renderField: g,
1067
1067
  onCountChange: f,
1068
- swapButton: yt,
1069
- swapContent: Nt
1068
+ swapButton: Nt,
1069
+ swapContent: _t
1070
1070
  }
1071
1071
  );
1072
1072
  return H(
@@ -1074,16 +1074,16 @@ function Ln({
1074
1074
  /* @__PURE__ */ x(
1075
1075
  "div",
1076
1076
  {
1077
- style: { gridColumn: `span ${Ee(v.options, ye)}` },
1077
+ style: { gridColumn: `span ${Ye(v.options, ye)}` },
1078
1078
  children: [
1079
- Ne(v) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: Re }) : Re,
1080
- (T == null ? void 0 : T.length) && Ge && Ve && /* @__PURE__ */ e(
1081
- en,
1079
+ Ne(v) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: ze }) : ze,
1080
+ (T == null ? void 0 : T.length) && Ve && Pe && /* @__PURE__ */ e(
1081
+ tn,
1082
1082
  {
1083
- relCollection: Ve,
1083
+ relCollection: Pe,
1084
1084
  relId: ce,
1085
1085
  entries: T,
1086
- separator: xt
1086
+ separator: yt
1087
1087
  }
1088
1088
  )
1089
1089
  ]
@@ -1091,13 +1091,13 @@ function Ln({
1091
1091
  v.field
1092
1092
  )
1093
1093
  );
1094
- }, O = p.folded.map((b) => ({
1094
+ }, q = p.folded.map((b) => ({
1095
1095
  _k: b.field,
1096
1096
  sort: b.sort ?? 0,
1097
1097
  _t: "field",
1098
1098
  f: b
1099
1099
  }));
1100
- return /* @__PURE__ */ x(_t, { children: [
1100
+ return /* @__PURE__ */ x(wt, { children: [
1101
1101
  /* @__PURE__ */ x(
1102
1102
  "div",
1103
1103
  {
@@ -1110,20 +1110,20 @@ function Ln({
1110
1110
  }
1111
1111
  ),
1112
1112
  /* @__PURE__ */ e(
1113
- Kt,
1113
+ Ht,
1114
1114
  {
1115
- count: O.length,
1116
- open: dt,
1115
+ count: q.length,
1116
+ open: ut,
1117
1117
  forcedOpen: p.forcedOpen,
1118
1118
  design: !!F,
1119
- onToggle: () => ut((b) => !b),
1119
+ onToggle: () => mt((b) => !b),
1120
1120
  children: /* @__PURE__ */ x(
1121
1121
  "div",
1122
1122
  {
1123
1123
  className: W(F && "relative", "grid grid-cols-12 gap-4 items-start"),
1124
1124
  children: [
1125
1125
  /* @__PURE__ */ e(we, {}),
1126
- O.map(c)
1126
+ q.map(c)
1127
1127
  ]
1128
1128
  }
1129
1129
  )
@@ -1138,24 +1138,24 @@ function Ln({
1138
1138
  }
1139
1139
  );
1140
1140
  }
1141
- function ln({
1141
+ function an({
1142
1142
  layoutId: t,
1143
1143
  collection: r,
1144
1144
  sectionKey: i
1145
1145
  }) {
1146
1146
  return ne(() => {
1147
- it({ layoutId: t, collection: r, kind: "shown", key: i });
1147
+ st({ layoutId: t, collection: r, kind: "shown", key: i });
1148
1148
  }, [t, r, i]), null;
1149
1149
  }
1150
1150
  export {
1151
- Ln as GroupSection,
1152
- en as InlineDisplay,
1153
- Ye as OwnersInline,
1154
- Xt as OwnersInlineCompact,
1151
+ qn as GroupSection,
1152
+ tn as InlineDisplay,
1153
+ Qe as OwnersInline,
1154
+ en as OwnersInlineCompact,
1155
1155
  re as RelationCell,
1156
- jn as StripFieldValue,
1157
- at as UserChip,
1158
- Bn as UserRosterCluster,
1159
- ke as formatDisplayValue,
1160
- rn as useChangePulse
1156
+ On as StripFieldValue,
1157
+ ot as UserChip,
1158
+ Un as UserRosterCluster,
1159
+ De as formatDisplayValue,
1160
+ sn as useChangePulse
1161
1161
  };