@nivaro/react 0.3.41 → 0.3.43

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 (97) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +733 -15
  5. package/dist/index.js +820 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/ProfileView.js +776 -1003
  20. package/dist/shared/components/RecentRecordsRail.js +34 -16
  21. package/dist/shared/components/RecordReadView.js +500 -477
  22. package/dist/shared/components/Skeletons.js +199 -0
  23. package/dist/shared/components/SlowNotice.js +63 -0
  24. package/dist/shared/components/Term.js +23 -0
  25. package/dist/shared/components/WidgetSlot.js +350 -353
  26. package/dist/shared/components/access/PermissionSummary.js +106 -0
  27. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  28. package/dist/shared/components/chat/ChatPanel.js +902 -886
  29. package/dist/shared/components/chat/MemberPaging.js +70 -0
  30. package/dist/shared/components/chat/RoomParts.js +147 -117
  31. package/dist/shared/components/chat/ScreenClip.js +73 -69
  32. package/dist/shared/components/chat/chat-core.js +449 -396
  33. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  34. package/dist/shared/components/help-videos/api.js +2 -5
  35. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  36. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  37. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  38. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  39. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  40. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  41. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  42. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  43. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  44. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  45. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  46. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  47. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  48. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  49. package/dist/shared/components/item-edit/field-sources.js +33 -0
  50. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  51. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  52. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  53. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  54. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  55. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  56. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  57. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  58. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  59. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  60. package/dist/shared/components/list/InlineEdit.js +363 -0
  61. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  62. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  63. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  64. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  65. package/dist/shared/components/notifications/changes-lines.js +24 -0
  66. package/dist/shared/components/notifications/why-lines.js +64 -0
  67. package/dist/shared/components/panels/CommentPanel.js +316 -281
  68. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  69. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  70. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  71. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  72. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  73. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  74. package/dist/shared/components/profile/PersonProfile.js +57 -52
  75. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  76. package/dist/shared/hooks/useSlowReason.js +39 -0
  77. package/dist/shared/lib/activity-sentence.js +670 -0
  78. package/dist/shared/lib/config-sentences.js +418 -0
  79. package/dist/shared/lib/core-glossary.js +229 -0
  80. package/dist/shared/lib/error-hints.js +159 -0
  81. package/dist/shared/lib/error-message.js +105 -0
  82. package/dist/shared/lib/error-toast.js +22 -0
  83. package/dist/shared/lib/field-comments.js +25 -0
  84. package/dist/shared/lib/filter-sentence.js +261 -0
  85. package/dist/shared/lib/glossary.js +55 -48
  86. package/dist/shared/lib/idle-reload.js +138 -0
  87. package/dist/shared/lib/layout-resolve.js +42 -29
  88. package/dist/shared/lib/list-inline-edit.js +190 -0
  89. package/dist/shared/lib/list-link.js +147 -0
  90. package/dist/shared/lib/nav-trail.js +107 -0
  91. package/dist/shared/lib/prefetch.js +259 -106
  92. package/dist/shared/lib/record-ref.js +72 -0
  93. package/dist/shared/lib/reload-holds.js +25 -0
  94. package/dist/shared/lib/safe-error.js +52 -24
  95. package/dist/shared/lib/skeleton-shapes.js +72 -0
  96. package/dist/shared/lib/slow-reason.js +63 -0
  97. package/package.json +1 -1
@@ -1,31 +1,33 @@
1
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import { useQueryClient as We, useQueries as xt, useQuery as le, useMutation as ft } from "@tanstack/react-query";
3
- import { Info as yt, Loader2 as bt, Sparkles as gt, Lock as vt, SlidersHorizontal as wt, History as kt, BellRing as _t, Bell as Nt, Sigma as Ft } from "lucide-react";
4
- import { memo as Ct, useState as we, useRef as R, useId as Lt, useEffect as ae, useCallback as Me } from "react";
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { useQueryClient as Ve, useQueries as ft, useQuery as oe, useMutation as yt } from "@tanstack/react-query";
3
+ import { Info as bt, Loader2 as gt, Sparkles as vt, Lock as wt, SlidersHorizontal as kt, History as _t, BellRing as Nt, Bell as Ft, Sigma as Ct } from "lucide-react";
4
+ import { memo as Lt, useState as we, useRef as R, useId as St, useEffect as ae, useCallback as Ke } from "react";
5
5
  import { toast as U } from "sonner";
6
- import { useParentDraft as Rt, useNivaroClient as oe } from "../../context.js";
7
- import { showsAiButton as St, AUTOFILL_CHECK_KEY as $t, readAiFill as qt } from "../../lib/ai-fill.js";
8
- import { get as H, del as Tt, post as ve } from "../../lib/commands.js";
9
- import { titleCase as ge, cn as D } from "../../lib/utils.js";
10
- import { GlossaryLabel as Ke } from "../ai/GlossaryText.js";
11
- import { Label as At } from "../ui/label.js";
12
- import { TooltipProvider as ee, Tooltip as te, TooltipTrigger as ne, TooltipContent as re } from "../ui/tooltip.js";
13
- import { useAddendumFields as Et } from "./AddendumFieldContext.js";
14
- import { AutoIdPreviewField as Pt } from "./AutoIdPreviewField.js";
15
- import { FOCUSABLE as Ue } from "./entry/entry-keys.js";
16
- import { useFieldAffordances as jt, useFieldContextMenu as Dt, usePresenceSoftLock as Ot, LockReasonBadge as Bt, PresenceSoftLockStrip as Mt, RemoteChangeGhost as Kt } from "./FieldAffordances.js";
17
- import { FieldRenderer as Ut } from "./FieldRenderer.js";
18
- import { FormHelpVideoButton as Ht } from "./FormHelpVideoButton.js";
19
- import { getCascadeFilters as Wt, SYSTEM_FIELDS as Vt, parseJson as zt, buildCascadeFilter as Gt, CascadeEffectController as Qt } from "./helpers.js";
20
- import { isDerivedForRecord as Yt } from "./live-rollups.js";
21
- import { useM2MStaging as Jt } from "./M2MStagingContext.js";
22
- import { personalDefaultSlotFor as Xt, PersonalDefaultSlot as Zt } from "./PersonalDefaultControl.js";
23
- import { PersonalDefaultHint as It } from "./PersonalDefaultPill.js";
24
- import { isDisplayFormulaRow as He, usePlacementTextContext as en, placementFieldText as tn, fieldCounterConfig as nn, fieldIsRecommended as rn, RecommendedMarker as ln, RepeatLastButton as an, DisplayFormulaValue as on, FieldCounter as sn } from "./placement-behaviour.js";
25
- import { keepIfEqual as dn, jsonEqual as cn } from "./render-stability.js";
26
- import { usePersonalDefaultsApi as un } from "./usePersonalDefaults.js";
27
- import { resolveOptionFilterTokens as mn } from "../../lib/option-filter-tokens.js";
28
- const pn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), hn = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), xn = /* @__PURE__ */ new Set([
6
+ import { useParentDraft as Rt, useNivaroClient as ie } from "../../context.js";
7
+ import { showsAiButton as $t, AUTOFILL_CHECK_KEY as qt, readAiFill as Tt } from "../../lib/ai-fill.js";
8
+ import { get as H, del as At, post as ve } from "../../lib/commands.js";
9
+ import { titleCase as ee, cn as D } from "../../lib/utils.js";
10
+ import { GlossaryLabel as Ue } from "../ai/GlossaryText.js";
11
+ import { useFieldSource as Et, FieldSourceInfo as Pt } from "../ConfigReadBack.js";
12
+ import { Label as jt } from "../ui/label.js";
13
+ import { TooltipProvider as te, Tooltip as ne, TooltipTrigger as re, TooltipContent as le } from "../ui/tooltip.js";
14
+ import { useAddendumFields as Dt } from "./AddendumFieldContext.js";
15
+ import { AutoIdPreviewField as Bt } from "./AutoIdPreviewField.js";
16
+ import { FOCUSABLE as He } from "./entry/entry-keys.js";
17
+ import { useFieldAffordances as Ot, useFieldContextMenu as Mt, usePresenceSoftLock as Kt, LockReasonBadge as Ut, PresenceSoftLockStrip as Ht, RemoteChangeGhost as Wt } from "./FieldAffordances.js";
18
+ import { FieldCommentButton as Vt } from "./FieldComments.js";
19
+ import { FieldRenderer as zt } from "./FieldRenderer.js";
20
+ import { FormHelpVideoButton as Gt } from "./FormHelpVideoButton.js";
21
+ import { getCascadeFilters as Qt, SYSTEM_FIELDS as Yt, parseJson as Jt, buildCascadeFilter as Xt, CascadeEffectController as Zt } from "./helpers.js";
22
+ import { isDerivedForRecord as It } from "./live-rollups.js";
23
+ import { useM2MStaging as en } from "./M2MStagingContext.js";
24
+ import { personalDefaultSlotFor as tn, PersonalDefaultSlot as nn } from "./PersonalDefaultControl.js";
25
+ import { PersonalDefaultHint as rn } from "./PersonalDefaultPill.js";
26
+ import { isDisplayFormulaRow as We, usePlacementTextContext as ln, placementFieldText as on, fieldCounterConfig as an, fieldIsRecommended as sn, RecommendedMarker as cn, RepeatLastButton as dn, DisplayFormulaValue as un, FieldCounter as mn } from "./placement-behaviour.js";
27
+ import { keepIfEqual as pn, jsonEqual as hn } from "./render-stability.js";
28
+ import { usePersonalDefaultsApi as xn } from "./usePersonalDefaults.js";
29
+ import { resolveOptionFilterTokens as fn } from "../../lib/option-filter-tokens.js";
30
+ const yn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), bn = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), gn = /* @__PURE__ */ new Set([
29
31
  "input",
30
32
  "textarea",
31
33
  "wysiwyg",
@@ -33,7 +35,7 @@ const pn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
33
35
  "input-rich-text-html",
34
36
  "rich_text",
35
37
  "extension-editorjs"
36
- ]), fn = /* @__PURE__ */ new Set([
38
+ ]), vn = /* @__PURE__ */ new Set([
37
39
  "relation-m2o",
38
40
  "relation-m2m",
39
41
  "select-multiple-m2m",
@@ -44,108 +46,108 @@ const pn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
44
46
  "file",
45
47
  "files",
46
48
  "image"
47
- ]), yn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
48
- function bn(d) {
49
- const e = d.interface ?? "";
50
- return fn.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") ? !1 : !!(hn.has(d.type ?? "") || xn.has(e) || !e && d.type && !pn.has(d.type));
49
+ ]), wn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
50
+ function kn(c) {
51
+ const e = c.interface ?? "";
52
+ return vn.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") ? !1 : !!(bn.has(c.type ?? "") || gn.has(e) || !e && c.type && !yn.has(c.type));
51
53
  }
52
- function gn(d, e, m, p) {
53
- const f = oe();
54
- return le({
55
- queryKey: ["field-lineage", d, e, m],
54
+ function _n(c, e, m, p) {
55
+ const f = ie();
56
+ return oe({
57
+ queryKey: ["field-lineage", c, e, m],
56
58
  queryFn: () => f.request(
57
- H(`/lineage/${d}/${encodeURIComponent(e)}/${m}`)
59
+ H(`/lineage/${c}/${encodeURIComponent(e)}/${m}`)
58
60
  ).then((i) => i.data),
59
61
  enabled: p,
60
62
  staleTime: 3e4
61
63
  });
62
64
  }
63
- function Xn(d, e = "rows") {
65
+ function rr(c, e = "rows") {
64
66
  var l, N, b;
65
- if (d && (d.kind === "write" || d.kind === "read") && d.formula) {
67
+ if (c && (c.kind === "write" || c.kind === "read") && c.formula) {
66
68
  const u = (y) => typeof y == "number" ? y.toLocaleString(void 0, { maximumFractionDigits: 2 }) : y == null || y === "" ? "∅" : String(y);
67
- return `= ${d.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (y, a) => {
69
+ return `= ${c.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (y, o) => {
68
70
  var x;
69
- return u((x = d.inputs) == null ? void 0 : x[a]);
71
+ return u((x = c.inputs) == null ? void 0 : x[o]);
70
72
  }).replace(/\s*-\s*/g, " − ").replace(/\s*\*\s*/g, " × ").replace(/\s*\/\s*/g, " ÷ ")}`;
71
73
  }
72
- if (!d || d.kind !== "rollup") return null;
73
- const m = (d.sources ?? []).reduce((u, o) => u + o.rows.length, 0), p = (d.sources ?? []).reduce((u, o) => {
74
+ if (!c || c.kind !== "rollup") return null;
75
+ const m = (c.sources ?? []).reduce((u, a) => u + a.rows.length, 0), p = (c.sources ?? []).reduce((u, a) => {
74
76
  var y;
75
- return u + (((y = o.excluded) == null ? void 0 : y.length) ?? 0);
76
- }, 0), f = (b = (N = (l = (d.sources ?? []).find((u) => {
77
- var o;
78
- return (o = u.excluded) == null ? void 0 : o.length;
77
+ return u + (((y = a.excluded) == null ? void 0 : y.length) ?? 0);
78
+ }, 0), f = (b = (N = (l = (c.sources ?? []).find((u) => {
79
+ var a;
80
+ return (a = u.excluded) == null ? void 0 : a.length;
79
81
  })) == null ? void 0 : l.excluded) == null ? void 0 : N[0]) == null ? void 0 : b.reason, i = [`= ${m} ${m === 1 ? e.replace(/s$/, "") : e}`];
80
82
  return p && i.push(
81
83
  `${p} excluded${f ? ` (${f.replace(/^does not match: /, "")})` : ""}`
82
84
  ), i.join(" · ");
83
85
  }
84
- function vn({
85
- collection: d,
86
+ function Nn({
87
+ collection: c,
86
88
  itemId: e,
87
89
  field: m
88
90
  }) {
89
- const [p, f] = we(!1), i = R(null), { data: l, isLoading: N } = gn(d, e, m, p);
91
+ const [p, f] = we(!1), i = R(null), { data: l, isLoading: N } = _n(c, e, m, p);
90
92
  ae(() => {
91
93
  if (!p) return;
92
- const o = (y) => {
93
- var a;
94
- (a = i.current) != null && a.contains(y.target) || f(!1);
94
+ const a = (y) => {
95
+ var o;
96
+ (o = i.current) != null && o.contains(y.target) || f(!1);
95
97
  };
96
- return window.addEventListener("mousedown", o), () => window.removeEventListener("mousedown", o);
98
+ return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
97
99
  }, [p]);
98
- const b = (o) => o == null ? "—" : Number(o).toLocaleString(void 0, { maximumFractionDigits: 2 }), u = (l == null ? void 0 : l.stored_value) != null ? Number(l.stored_value) : null;
99
- return /* @__PURE__ */ c("div", { ref: i, className: "relative inline-flex", children: [
100
- /* @__PURE__ */ r(
100
+ const b = (a) => a == null ? "—" : Number(a).toLocaleString(void 0, { maximumFractionDigits: 2 }), u = (l == null ? void 0 : l.stored_value) != null ? Number(l.stored_value) : null;
101
+ return /* @__PURE__ */ d("div", { ref: i, className: "relative inline-flex", children: [
102
+ /* @__PURE__ */ n(
101
103
  "button",
102
104
  {
103
105
  type: "button",
104
- onClick: () => f((o) => !o),
106
+ onClick: () => f((a) => !a),
105
107
  title: "Where does this number come from?",
106
108
  className: D(
107
109
  "inline-flex items-center rounded p-0.5 transition-opacity",
108
110
  p ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
109
111
  ),
110
112
  "data-field-lineage": !0,
111
- children: /* @__PURE__ */ r(Ft, { className: "h-3 w-3" })
113
+ children: /* @__PURE__ */ n(Ct, { className: "h-3 w-3" })
112
114
  }
113
115
  ),
114
- p && /* @__PURE__ */ c("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-[340px] w-[360px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
115
- /* @__PURE__ */ r("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Where this number comes from" }),
116
- N && /* @__PURE__ */ r("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }),
117
- (l == null ? void 0 : l.kind) === "write" && /* @__PURE__ */ c("div", { className: "space-y-1 px-1 py-1", children: [
118
- /* @__PURE__ */ r("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: l.formula }),
119
- Object.entries(l.inputs ?? {}).map(([o, y]) => /* @__PURE__ */ c("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
120
- /* @__PURE__ */ r("span", { className: "font-mono", children: o }),
116
+ p && /* @__PURE__ */ d("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-[340px] w-[360px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
117
+ /* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Where this number comes from" }),
118
+ N && /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }),
119
+ (l == null ? void 0 : l.kind) === "write" && /* @__PURE__ */ d("div", { className: "space-y-1 px-1 py-1", children: [
120
+ /* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: l.formula }),
121
+ Object.entries(l.inputs ?? {}).map(([a, y]) => /* @__PURE__ */ d("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
122
+ /* @__PURE__ */ n("span", { className: "font-mono", children: a }),
121
123
  " = ",
122
124
  b(y)
123
- ] }, o)),
124
- /* @__PURE__ */ c("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
125
+ ] }, a)),
126
+ /* @__PURE__ */ d("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
125
127
  "= ",
126
128
  b(l.stored_value)
127
129
  ] })
128
130
  ] }),
129
- (l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((o, y) => {
130
- var a;
131
- return /* @__PURE__ */ c("div", { className: "mb-1.5", children: [
132
- /* @__PURE__ */ c("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
133
- (o.aggregate ?? "sum").toUpperCase(),
134
- o.value_field ? ` of ${o.value_field}` : "",
131
+ (l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((a, y) => {
132
+ var o;
133
+ return /* @__PURE__ */ d("div", { className: "mb-1.5", children: [
134
+ /* @__PURE__ */ d("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
135
+ (a.aggregate ?? "sum").toUpperCase(),
136
+ a.value_field ? ` of ${a.value_field}` : "",
135
137
  " across ",
136
- o.collection,
137
- o.filtered ? " (filtered)" : ""
138
+ a.collection,
139
+ a.filtered ? " (filtered)" : ""
138
140
  ] }),
139
- o.error && /* @__PURE__ */ r("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: o.error }),
140
- o.note && /* @__PURE__ */ r("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: o.note }),
141
- o.rows.length > 0 && /* @__PURE__ */ r("div", { className: "mt-0.5 space-y-px", children: o.rows.map((x) => /* @__PURE__ */ c(
141
+ a.error && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: a.error }),
142
+ a.note && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: a.note }),
143
+ a.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: a.rows.map((x) => /* @__PURE__ */ d(
142
144
  "div",
143
145
  {
144
146
  className: "flex items-baseline gap-2 rounded px-1 py-0.5 text-[11.5px] hover:bg-slate-50 dark:hover:bg-muted",
145
147
  children: [
146
- /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: x.label }),
147
- /* @__PURE__ */ r("span", { className: "shrink-0 font-mono tabular-nums text-slate-800 dark:text-slate-100", children: b(x.value) }),
148
- /* @__PURE__ */ r(
148
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: x.label }),
149
+ /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums text-slate-800 dark:text-slate-100", children: b(x.value) }),
150
+ /* @__PURE__ */ n(
149
151
  "span",
150
152
  {
151
153
  className: "w-[88px] shrink-0 truncate text-right text-[10px] text-slate-400",
@@ -157,121 +159,121 @@ function vn({
157
159
  },
158
160
  x.id
159
161
  )) }),
160
- o.truncated && /* @__PURE__ */ r("p", { className: "px-1 pt-0.5 text-[10.5px] text-amber-600 dark:text-amber-400", children: "Showing the first 200 rows — the subtotal covers only these." }),
161
- o.subtotal != null && /* @__PURE__ */ c("p", { className: "border-t border-slate-100 px-1 pt-1 text-right text-[11.5px] font-medium text-slate-700 dark:border-border dark:text-slate-200", children: [
162
+ a.truncated && /* @__PURE__ */ n("p", { className: "px-1 pt-0.5 text-[10.5px] text-amber-600 dark:text-amber-400", children: "Showing the first 200 rows — the subtotal covers only these." }),
163
+ a.subtotal != null && /* @__PURE__ */ d("p", { className: "border-t border-slate-100 px-1 pt-1 text-right text-[11.5px] font-medium text-slate-700 dark:border-border dark:text-slate-200", children: [
162
164
  "subtotal ",
163
- b(o.subtotal)
165
+ b(a.subtotal)
164
166
  ] }),
165
- (((a = o.excluded) == null ? void 0 : a.length) ?? 0) > 0 && /* @__PURE__ */ c("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
166
- /* @__PURE__ */ c("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
167
- o.excluded.length,
167
+ (((o = a.excluded) == null ? void 0 : o.length) ?? 0) > 0 && /* @__PURE__ */ d("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
168
+ /* @__PURE__ */ d("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
169
+ a.excluded.length,
168
170
  " excluded —",
169
171
  " ",
170
- o.excluded[0].reason.replace(/^does not match: /, "")
172
+ a.excluded[0].reason.replace(/^does not match: /, "")
171
173
  ] }),
172
- o.excluded.slice(0, 8).map((x) => /* @__PURE__ */ c(
174
+ a.excluded.slice(0, 8).map((x) => /* @__PURE__ */ d(
173
175
  "div",
174
176
  {
175
177
  className: "flex items-baseline gap-2 px-0.5 text-[11px] text-slate-400",
176
178
  children: [
177
- /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate line-through decoration-slate-300", children: x.label }),
178
- /* @__PURE__ */ r("span", { className: "shrink-0 font-mono tabular-nums", children: b(x.value) })
179
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate line-through decoration-slate-300", children: x.label }),
180
+ /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums", children: b(x.value) })
179
181
  ]
180
182
  },
181
183
  x.id
182
184
  )),
183
- o.excluded.length > 8 && /* @__PURE__ */ c("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
185
+ a.excluded.length > 8 && /* @__PURE__ */ d("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
184
186
  "+",
185
- o.excluded.length - 8,
187
+ a.excluded.length - 8,
186
188
  " more"
187
189
  ] })
188
190
  ] })
189
191
  ] }, y);
190
192
  }),
191
- (l == null ? void 0 : l.kind) === "rollup" && u != null && /* @__PURE__ */ c("p", { className: "px-1 pt-0.5 text-right text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
193
+ (l == null ? void 0 : l.kind) === "rollup" && u != null && /* @__PURE__ */ d("p", { className: "px-1 pt-0.5 text-right text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
192
194
  "stored ",
193
195
  b(u),
194
196
  (() => {
195
- const o = (l.sources ?? []).reduce((a, x) => a + (x.subtotal ?? 0), 0);
196
- return (l.sources ?? []).some((a) => a.truncated) ? null : Math.abs(o - u) < 0.01 ? /* @__PURE__ */ r("span", { className: "ml-1 text-emerald-600 dark:text-emerald-400", children: "✓ matches" }) : /* @__PURE__ */ r("span", { className: "ml-1 text-amber-600 dark:text-amber-400", children: "✕ differs from contributions" });
197
+ const a = (l.sources ?? []).reduce((o, x) => o + (x.subtotal ?? 0), 0);
198
+ return (l.sources ?? []).some((o) => o.truncated) ? null : Math.abs(a - u) < 0.01 ? /* @__PURE__ */ n("span", { className: "ml-1 text-emerald-600 dark:text-emerald-400", children: "✓ matches" }) : /* @__PURE__ */ n("span", { className: "ml-1 text-amber-600 dark:text-amber-400", children: "✕ differs from contributions" });
197
199
  })()
198
200
  ] })
199
201
  ] })
200
202
  ] });
201
203
  }
202
- function wn({
203
- collection: d,
204
+ function Fn({
205
+ collection: c,
204
206
  itemId: e,
205
207
  field: m,
206
208
  formatValue: p,
207
209
  onRestore: f
208
210
  }) {
209
- const i = oe(), [l, N] = we(!1), b = R(null), { data: u, isLoading: o } = le({
210
- queryKey: ["field-value-history", d, e, m],
211
- queryFn: () => i.request(H(`/field-history/${d}/${encodeURIComponent(e)}/${m}`)).then((a) => a.data ?? []),
211
+ const i = ie(), [l, N] = we(!1), b = R(null), { data: u, isLoading: a } = oe({
212
+ queryKey: ["field-value-history", c, e, m],
213
+ queryFn: () => i.request(H(`/field-history/${c}/${encodeURIComponent(e)}/${m}`)).then((o) => o.data ?? []),
212
214
  enabled: l,
213
215
  staleTime: 6e4
214
216
  });
215
217
  ae(() => {
216
218
  if (!l) return;
217
- const a = (x) => {
219
+ const o = (x) => {
218
220
  var W;
219
221
  (W = b.current) != null && W.contains(x.target) || N(!1);
220
222
  };
221
- return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
223
+ return window.addEventListener("mousedown", o), () => window.removeEventListener("mousedown", o);
222
224
  }, [l]);
223
- const y = (a, x) => x || (a == null || a === "" ? "—" : p ? p(a) : typeof a == "boolean" || a === "true" || a === "false" ? a === !0 || a === "true" ? "Yes" : "No" : typeof a == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(a) ? new Date(a).toLocaleString() : typeof a == "object" ? JSON.stringify(a).slice(0, 60) : String(a).slice(0, 80));
224
- return /* @__PURE__ */ c("div", { ref: b, className: "relative inline-flex", children: [
225
- /* @__PURE__ */ r(
225
+ const y = (o, x) => x || (o == null || o === "" ? "—" : p ? p(o) : typeof o == "boolean" || o === "true" || o === "false" ? o === !0 || o === "true" ? "Yes" : "No" : typeof o == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(o) ? new Date(o).toLocaleString() : typeof o == "object" ? JSON.stringify(o).slice(0, 60) : String(o).slice(0, 80));
226
+ return /* @__PURE__ */ d("div", { ref: b, className: "relative inline-flex", children: [
227
+ /* @__PURE__ */ n(
226
228
  "button",
227
229
  {
228
230
  type: "button",
229
- onClick: () => N((a) => !a),
231
+ onClick: () => N((o) => !o),
230
232
  title: "Value history",
231
233
  className: D(
232
234
  "inline-flex items-center rounded p-0.5 transition-opacity",
233
235
  l ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
234
236
  ),
235
237
  "data-field-history": !0,
236
- children: /* @__PURE__ */ r(kt, { className: "h-3 w-3" })
238
+ children: /* @__PURE__ */ n(_t, { className: "h-3 w-3" })
237
239
  }
238
240
  ),
239
- l && /* @__PURE__ */ c("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-64 w-[300px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
240
- /* @__PURE__ */ r("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Value history" }),
241
- o ? /* @__PURE__ */ r("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (u ?? []).length === 0 ? /* @__PURE__ */ r("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "No recorded changes for this field." }) : /* @__PURE__ */ r("div", { className: "space-y-1", children: (u ?? []).map((a, x) => /* @__PURE__ */ c(
241
+ l && /* @__PURE__ */ d("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-64 w-[300px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
242
+ /* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Value history" }),
243
+ a ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (u ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "No recorded changes for this field." }) : /* @__PURE__ */ n("div", { className: "space-y-1", children: (u ?? []).map((o, x) => /* @__PURE__ */ d(
242
244
  "div",
243
245
  {
244
246
  className: "rounded px-1 py-1 text-[11.5px] leading-snug hover:bg-slate-50 dark:hover:bg-muted",
245
247
  children: [
246
- /* @__PURE__ */ c("span", { className: "flex items-baseline justify-between gap-2", children: [
247
- /* @__PURE__ */ r("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: y(a.value, a.display) }),
248
- f && x > 0 && /* @__PURE__ */ r(
248
+ /* @__PURE__ */ d("span", { className: "flex items-baseline justify-between gap-2", children: [
249
+ /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: y(o.value, o.display) }),
250
+ f && x > 0 && /* @__PURE__ */ n(
249
251
  "button",
250
252
  {
251
253
  type: "button",
252
254
  onClick: () => {
253
- f(a.value ?? null), N(!1);
255
+ f(o.value ?? null), N(!1);
254
256
  },
255
257
  className: "shrink-0 rounded border border-slate-200 px-1.5 py-px text-[10px] text-slate-500 hover:border-nvr-cyan/60 hover:text-nvr-navy dark:border-border dark:hover:text-nvr-cyan",
256
258
  children: "Restore"
257
259
  }
258
260
  )
259
261
  ] }),
260
- /* @__PURE__ */ c("span", { className: "block text-[10.5px] text-slate-400", children: [
261
- a.action === "create" ? "initial value" : "changed",
262
- a.timestamp ? ` · ${new Date(a.timestamp).toLocaleString()}` : "",
263
- a.user_name ? ` · ${a.user_name}` : "",
264
- a.origin && a.origin.kind !== "user" && /* @__PURE__ */ r(
262
+ /* @__PURE__ */ d("span", { className: "block text-[10.5px] text-slate-400", children: [
263
+ o.action === "create" ? "initial value" : "changed",
264
+ o.timestamp ? ` · ${new Date(o.timestamp).toLocaleString()}` : "",
265
+ o.user_name ? ` · ${o.user_name}` : "",
266
+ o.origin && o.origin.kind !== "user" && /* @__PURE__ */ n(
265
267
  "span",
266
268
  {
267
- className: a.origin.kind === "integration" ? "ml-1 rounded bg-purple-500/10 px-1 py-px text-[9.5px] font-medium text-purple-700 dark:text-purple-400" : a.origin.kind === "import" ? "ml-1 rounded bg-sky-500/10 px-1 py-px text-[9.5px] font-medium text-sky-700 dark:text-sky-400" : "ml-1 rounded bg-amber-500/10 px-1 py-px text-[9.5px] font-medium text-amber-700 dark:text-amber-400",
268
- children: a.origin.label ?? a.origin.kind
269
+ className: o.origin.kind === "integration" ? "ml-1 rounded bg-purple-500/10 px-1 py-px text-[9.5px] font-medium text-purple-700 dark:text-purple-400" : o.origin.kind === "import" ? "ml-1 rounded bg-sky-500/10 px-1 py-px text-[9.5px] font-medium text-sky-700 dark:text-sky-400" : "ml-1 rounded bg-amber-500/10 px-1 py-px text-[9.5px] font-medium text-amber-700 dark:text-amber-400",
270
+ children: o.origin.label ?? o.origin.kind
269
271
  }
270
272
  )
271
273
  ] }),
272
- a.note && /* @__PURE__ */ c("span", { className: "block text-[10.5px] italic text-slate-500 dark:text-slate-400", children: [
274
+ o.note && /* @__PURE__ */ d("span", { className: "block text-[10.5px] italic text-slate-500 dark:text-slate-400", children: [
273
275
  "“",
274
- a.note,
276
+ o.note,
275
277
  "”"
276
278
  ] })
277
279
  ]
@@ -281,26 +283,26 @@ function wn({
281
283
  ] })
282
284
  ] });
283
285
  }
284
- function kn({
285
- collection: d,
286
+ function Cn({
287
+ collection: c,
286
288
  itemId: e,
287
289
  field: m
288
290
  }) {
289
- const p = oe(), f = We(), { data: i } = le({
291
+ const p = ie(), f = Ve(), { data: i } = oe({
290
292
  queryKey: ["field-watch-config"],
291
- queryFn: () => p.request(H("/field-watches/config")).then((o) => o.data).catch(() => ({ enabled: !1 })),
293
+ queryFn: () => p.request(H("/field-watches/config")).then((a) => a.data).catch(() => ({ enabled: !1 })),
292
294
  staleTime: 5 * 6e4
293
- }), l = ["field-watch-self", d, e], { data: N = [] } = le({
295
+ }), l = ["field-watch-self", c, e], { data: N = [] } = oe({
294
296
  queryKey: l,
295
- queryFn: () => p.request(H("/field-watches/self", { collection: d, item_id: e })).then((o) => o.data ?? []).catch(() => []),
297
+ queryFn: () => p.request(H("/field-watches/self", { collection: c, item_id: e })).then((a) => a.data ?? []).catch(() => []),
296
298
  enabled: !!(i != null && i.enabled),
297
299
  staleTime: 6e4
298
- }), b = N.includes(m), u = ft({
300
+ }), b = N.includes(m), u = yt({
299
301
  mutationFn: () => b ? p.request(
300
- Tt(
301
- `/field-watches/self?collection=${encodeURIComponent(d)}&field=${encodeURIComponent(m)}&item_id=${encodeURIComponent(e)}`
302
+ At(
303
+ `/field-watches/self?collection=${encodeURIComponent(c)}&field=${encodeURIComponent(m)}&item_id=${encodeURIComponent(e)}`
302
304
  )
303
- ) : p.request(ve("/field-watches/self", { collection: d, field: m, item_id: e })),
305
+ ) : p.request(ve("/field-watches/self", { collection: c, field: m, item_id: e })),
304
306
  onSuccess: () => {
305
307
  f.invalidateQueries({ queryKey: l }), U.success(
306
308
  b ? "No longer watching this field" : "Watching — you will be notified when it changes"
@@ -308,7 +310,7 @@ function kn({
308
310
  },
309
311
  onError: () => U.error("Could not update the watch")
310
312
  });
311
- return i != null && i.enabled ? /* @__PURE__ */ r(
313
+ return i != null && i.enabled ? /* @__PURE__ */ n(
312
314
  "button",
313
315
  {
314
316
  type: "button",
@@ -316,16 +318,16 @@ function kn({
316
318
  title: b ? "Stop watching this field on this record" : "Watch this field on this record",
317
319
  "data-field-watch": m,
318
320
  className: `rounded p-0.5 transition-colors ${b ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-slate-500"}`,
319
- children: b ? /* @__PURE__ */ r(_t, { className: "h-3 w-3" }) : /* @__PURE__ */ r(Nt, { className: "h-3 w-3" })
321
+ children: b ? /* @__PURE__ */ n(Nt, { className: "h-3 w-3" }) : /* @__PURE__ */ n(Ft, { className: "h-3 w-3" })
320
322
  }
321
323
  ) : null;
322
324
  }
323
- function _n(d) {
324
- return d ? d.querySelector(
325
+ function Ln(c) {
326
+ return c ? c.querySelector(
325
327
  'input:not([type=hidden]), textarea, [role="combobox"], [contenteditable="true"]'
326
- ) ?? d.querySelector("button") : null;
328
+ ) ?? c.querySelector("button") : null;
327
329
  }
328
- const Zn = Ct(function({
330
+ const lr = Lt(function({
329
331
  field: e,
330
332
  draft: m,
331
333
  onChange: p,
@@ -335,49 +337,49 @@ const Zn = Ct(function({
335
337
  error: N,
336
338
  visible: b,
337
339
  locked: u,
338
- layoutAiEnabled: o,
340
+ layoutAiEnabled: a,
339
341
  renderField: y,
340
- onCountChange: a,
342
+ onCountChange: o,
341
343
  swapButton: x,
342
344
  swapContent: W,
343
- forceVisible: Ve,
344
- autoFillTick: ie
345
+ forceVisible: ze,
346
+ autoFillTick: se
345
347
  }) {
346
- var De, Oe, Be;
347
- const V = yn.has(e.interface ?? ""), C = Rt(), g = Jt(), ke = We(), se = oe(), [_e, z] = we(!1), s = jt(), G = R(null), Q = Lt(), de = R(null), Ne = R(!1);
348
+ var Be, Oe, Me;
349
+ const V = wn.has(e.interface ?? ""), C = Rt(), g = en(), ke = Ve(), ce = ie(), [_e, z] = we(!1), s = Ot(), Ne = Et(e.field), G = R(null), Q = St(), de = R(null), Fe = R(!1);
348
350
  ae(() => {
349
- const t = Ne.current ? _n(de.current) : null;
351
+ const t = Fe.current ? Ln(de.current) : null;
350
352
  if (!t || t.hasAttribute("aria-label")) return;
351
353
  t.id || (t.id = `${Q}-control`);
352
- const n = t.tagName === "BUTTON" ? `${Q} ${t.id}` : Q;
353
- t.getAttribute("aria-labelledby") !== n && t.setAttribute("aria-labelledby", n);
354
+ const r = t.tagName === "BUTTON" ? `${Q} ${t.id}` : Q;
355
+ t.getAttribute("aria-labelledby") !== r && t.setAttribute("aria-labelledby", r);
354
356
  });
355
- const Fe = u && !V, Ce = R(null);
357
+ const Ce = u && !V, Le = R(null);
356
358
  ae(() => {
357
- const t = Ce.current;
359
+ const t = Le.current;
358
360
  if (!t) return;
359
- if (!Fe) {
361
+ if (!Ce) {
360
362
  t.removeAttribute("inert");
361
363
  return;
362
364
  }
363
- const n = typeof document < "u" ? document.activeElement : null;
364
- n instanceof HTMLElement && t.contains(n) && n.blur(), t.setAttribute("inert", "");
365
- }, [Fe, ie]);
366
- const Y = e.field, Le = Me(
365
+ const r = typeof document < "u" ? document.activeElement : null;
366
+ r instanceof HTMLElement && t.contains(r) && r.blur(), t.setAttribute("inert", "");
367
+ }, [Ce, se]);
368
+ const Y = e.field, Se = Ke(
367
369
  (t) => {
368
370
  u || p(Y, t);
369
371
  },
370
372
  [u, p, Y]
371
- ), ze = Me(
372
- (t) => a == null ? void 0 : a(Y, t),
373
- [a, Y]
374
- ), Ge = R(void 0), Re = R(void 0), Se = R(void 0), $e = !u && !e.readonly && !e.computed_formula && !(e.hidden && !e.layout_assigned) && !He(e), {
375
- onContextMenu: Qe,
376
- onKeyDown: Ye,
377
- menu: Je,
378
- confirmSaveFrom: Xe,
379
- openedBy: ce
380
- } = Dt({
373
+ ), Ge = Ke(
374
+ (t) => o == null ? void 0 : o(Y, t),
375
+ [o, Y]
376
+ ), Qe = R(void 0), Re = R(void 0), $e = R(void 0), qe = !u && !e.readonly && !e.computed_formula && !(e.hidden && !e.layout_assigned) && !We(e), {
377
+ onContextMenu: Ye,
378
+ onKeyDown: Je,
379
+ menu: Xe,
380
+ confirmSaveFrom: Ze,
381
+ openedBy: ue
382
+ } = Mt({
381
383
  wrapperRef: G,
382
384
  field: e,
383
385
  value: m[e.field],
@@ -385,36 +387,36 @@ const Zn = Ct(function({
385
387
  collection: i,
386
388
  itemId: l,
387
389
  openRelated: s == null ? void 0 : s.openRelated,
388
- editable: $e
389
- }), A = Ot(G), Ze = en(), qe = s == null ? void 0 : s.remoteChanges[e.field], O = s == null ? void 0 : s.lockReasons[e.field], q = s == null ? void 0 : s.applyToLines[e.field], L = un(), Ie = (L == null ? void 0 : L.applied(e.field)) ?? !1, Te = (L == null ? void 0 : L.hintFor(e.field)) ?? null, ue = Xt(L, e.field, $e), me = () => {
390
- var t, n;
391
- return ((t = de.current) == null ? void 0 : t.querySelector(Ue)) ?? ((n = G.current) == null ? void 0 : n.querySelector(Ue));
392
- }, J = St(e._overrides, o, bn(e)), pe = !!(s != null && s.fromAutofill) && !!e._overrides && e._overrides[$t] === !0;
393
- async function et() {
390
+ editable: qe
391
+ }), E = Kt(G), Ie = ln(), Te = s == null ? void 0 : s.remoteChanges[e.field], B = s == null ? void 0 : s.lockReasons[e.field], q = s == null ? void 0 : s.applyToLines[e.field], L = xn(), et = (L == null ? void 0 : L.applied(e.field)) ?? !1, Ae = (L == null ? void 0 : L.hintFor(e.field)) ?? null, me = tn(L, e.field, qe), pe = () => {
392
+ var t, r;
393
+ return ((t = de.current) == null ? void 0 : t.querySelector(He)) ?? ((r = G.current) == null ? void 0 : r.querySelector(He));
394
+ }, J = $t(e._overrides, a, kn(e)), he = !!(s != null && s.fromAutofill) && !!e._overrides && e._overrides[qt] === !0;
395
+ async function tt() {
394
396
  var t;
395
- if (J.perField) return tt();
397
+ if (J.perField) return nt();
396
398
  z(!0);
397
399
  try {
398
- const n = await se.request(
400
+ const r = await ce.request(
399
401
  ve("/ai/generate", {
400
402
  collection: i,
401
403
  item_id: l !== "new" ? l : void 0,
402
404
  field: e.field
403
405
  })
404
406
  );
405
- ((t = n.data) == null ? void 0 : t.value) != null && p(e.field, n.data.value);
407
+ ((t = r.data) == null ? void 0 : t.value) != null && p(e.field, r.data.value);
406
408
  } catch {
407
409
  } finally {
408
410
  z(!1);
409
411
  }
410
412
  }
411
- async function tt() {
412
- var n, h, k, j, T, F;
413
+ async function nt() {
414
+ var r, h, k, j, A, F;
413
415
  const t = {};
414
- for (const v of ((n = qt(e._overrides)) == null ? void 0 : n.tokens) ?? []) v in m && (t[v] = m[v]);
416
+ for (const v of ((r = Tt(e._overrides)) == null ? void 0 : r.tokens) ?? []) v in m && (t[v] = m[v]);
415
417
  z(!0);
416
418
  try {
417
- const v = await se.request(
419
+ const v = await ce.request(
418
420
  ve("/ai/field-fill", {
419
421
  collection: i,
420
422
  layout_id: (s == null ? void 0 : s.layoutId) ?? null,
@@ -426,185 +428,186 @@ const Zn = Ct(function({
426
428
  typeof _ == "string" && _ !== "" ? p(e.field, _) : U.info("The AI had nothing to write here"), (j = (k = v.data) == null ? void 0 : k.missing) != null && j.length && U.info(`Filled without ${v.data.missing.join(", ")} (empty or not visible to you)`);
427
429
  } catch (v) {
428
430
  const _ = v;
429
- U.error(((F = (T = _ == null ? void 0 : _.response) == null ? void 0 : T.data) == null ? void 0 : F.error) ?? (_ == null ? void 0 : _.message) ?? "AI fill failed");
431
+ U.error(((F = (A = _ == null ? void 0 : _.response) == null ? void 0 : A.data) == null ? void 0 : F.error) ?? (_ == null ? void 0 : _.message) ?? "AI fill failed");
430
432
  } finally {
431
433
  z(!1);
432
434
  }
433
435
  }
434
- const E = Wt(e.dependency_config), Ae = E.flatMap((t) => {
435
- const n = f.find(
436
+ const P = Qt(e.dependency_config), Ee = P.flatMap((t) => {
437
+ const r = f.find(
436
438
  (k) => k.one_collection === i && k.one_field === t.parent_field
437
439
  );
438
- if (!n) return [];
439
- if (n.junction_field) return [{ rule: t, rel: n }];
440
+ if (!r) return [];
441
+ if (r.junction_field) return [{ rule: t, rel: r }];
440
442
  const h = f.find(
441
- (k) => k.many_collection === n.many_collection && k.id !== n.id
443
+ (k) => k.many_collection === r.many_collection && k.id !== r.id
442
444
  );
443
- return h != null && h.many_field ? [{ rule: t, rel: { ...n, junction_field: h.many_field } }] : [];
444
- }), nt = xt({
445
- queries: Ae.map(({ rel: t }) => ({
445
+ return h != null && h.many_field ? [{ rule: t, rel: { ...r, junction_field: h.many_field } }] : [];
446
+ }), rt = ft({
447
+ queries: Ee.map(({ rel: t }) => ({
446
448
  queryKey: ["m2m-items", t.many_collection, t.many_field, l],
447
- queryFn: () => se.request(
449
+ queryFn: () => ce.request(
448
450
  H(`/items/${t.many_collection}`, {
449
451
  filter: JSON.stringify({ [t.many_field]: { _eq: l } }),
450
452
  limit: 200,
451
453
  fields: `id,${t.junction_field}`
452
454
  })
453
- ).then((n) => n.data ?? []),
455
+ ).then((r) => r.data ?? []),
454
456
  enabled: !!l && l !== "new",
455
457
  staleTime: 3e4
456
458
  }))
457
- }), rt = Object.fromEntries(
458
- Ae.map(({ rule: t, rel: n }, h) => {
459
- var T;
460
- const k = n.one_field ?? `${n.many_collection}.${n.junction_field}`, j = (g == null ? void 0 : g.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
459
+ }), lt = Object.fromEntries(
460
+ Ee.map(({ rule: t, rel: r }, h) => {
461
+ var A;
462
+ const k = r.one_field ?? `${r.many_collection}.${r.junction_field}`, j = (g == null ? void 0 : g.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
461
463
  return [
462
464
  t.parent_field,
463
- (((T = nt[h]) == null ? void 0 : T.data) ?? []).filter((F) => !j.has(F.id)).map((F) => F[n.junction_field])
465
+ (((A = rt[h]) == null ? void 0 : A.data) ?? []).filter((F) => !j.has(F.id)).map((F) => F[r.junction_field])
464
466
  ];
465
467
  })
466
- ), X = Et()[e.field] ?? [];
467
- if (!Ve && (!b || !e.layout_assigned && (e.hidden || Vt.has(e.field))))
468
+ ), X = Dt()[e.field] ?? [];
469
+ if (!ze && (!b || !e.layout_assigned && (e.hidden || Yt.has(e.field))))
468
470
  return null;
469
- const he = m[e.field] ?? null, Z = tn(e, Ze), S = Z.label ?? ge(e.field);
470
- Ne.current = S !== "";
471
- const P = He(e), Ee = P ? null : nn(e), lt = !P && !u && !e.readonly && ((De = e._overrides) == null ? void 0 : De.repeat_last) === !0, at = Yt(e, m), ot = (Be = (Oe = zt(e.options)) == null ? void 0 : Oe.auto_id) == null ? void 0 : Be.pattern, w = (() => {
471
+ const xe = m[e.field] ?? null, Z = on(e, Ie), S = Z.label ?? ee(e.field);
472
+ Fe.current = S !== "";
473
+ const T = We(e), Pe = T ? null : an(e), ot = !T && !u && !e.readonly && ((Be = e._overrides) == null ? void 0 : Be.repeat_last) === !0, at = It(e, m), it = (Me = (Oe = Jt(e.options)) == null ? void 0 : Oe.auto_id) == null ? void 0 : Me.pattern, w = (() => {
472
474
  const t = f.find(
473
475
  (h) => h.one_collection === i && h.one_field === e.field
474
476
  );
475
477
  if (!t) return null;
476
478
  if (t.junction_field) return t;
477
- const n = f.find(
479
+ const r = f.find(
478
480
  (h) => h.many_collection === t.many_collection && h.id !== t.id
479
481
  );
480
- return n ? { ...t, junction_field: n.many_field } : null;
481
- })(), xe = w ? null : f.find((t) => t.many_collection === i && t.many_field === e.field) ?? null, fe = w ? f.find(
482
+ return r ? { ...t, junction_field: r.many_field } : null;
483
+ })(), fe = w ? null : f.find((t) => t.many_collection === i && t.many_field === e.field) ?? null, ye = w ? f.find(
482
484
  (t) => t.many_collection === w.many_collection && t.many_field === w.junction_field && t.id !== w.id
483
- ) ?? null : null, B = w ? w.one_field ?? `${w.many_collection}.${w.junction_field}` : null, Pe = B ? (g == null ? void 0 : g.getStagedLinks(B)) ?? [] : [], it = w ? (ke.getQueryData([
485
+ ) ?? null : null, O = w ? w.one_field ?? `${w.many_collection}.${w.junction_field}` : null, je = O ? (g == null ? void 0 : g.getStagedLinks(O)) ?? [] : [], st = w ? (ke.getQueryData([
484
486
  "m2m-items",
485
487
  w.many_collection,
486
488
  w.many_field,
487
489
  l
488
- ]) ?? []).map((t) => t[w.junction_field]) : [], st = w ? Pe[0] ?? it[0] ?? null : he, dt = (fe == null ? void 0 : fe.one_collection) ?? (xe == null ? void 0 : xe.one_collection) ?? void 0, I = (t) => {
489
- var n;
490
- return ((C == null ? void 0 : C.collection) === i ? (n = C == null ? void 0 : C.fieldLabels) == null ? void 0 : n[t] : void 0) ?? ge(String(t));
491
- }, $ = Gt({
492
- rules: E,
490
+ ]) ?? []).map((t) => t[w.junction_field]) : [], ct = w ? je[0] ?? st[0] ?? null : xe, dt = (ye == null ? void 0 : ye.one_collection) ?? (fe == null ? void 0 : fe.one_collection) ?? void 0, I = (t) => {
491
+ var r;
492
+ return ((C == null ? void 0 : C.collection) === i ? (r = C == null ? void 0 : C.fieldLabels) == null ? void 0 : r[t] : void 0) ?? ee(String(t));
493
+ }, $ = Xt({
494
+ rules: P,
493
495
  // A parent whose value THIS field's own pick derived must not narrow this
494
496
  // field's options — otherwise picking a region locks the region picker
495
497
  // into the zone the pick itself filled, and cross-zone changes read as
496
498
  // "No results".
497
499
  skipParent: (t) => {
498
- var n;
499
- return ((n = g == null ? void 0 : g.getDerivedOrigin) == null ? void 0 : n.call(g, t)) === e.field;
500
+ var r;
501
+ return ((r = g == null ? void 0 : g.getDerivedOrigin) == null ? void 0 : r.call(g, t)) === e.field;
500
502
  },
501
503
  parentValue: (t) => {
502
504
  if (m[t] != null) return m[t];
503
- const n = f.find((v) => v.one_collection === i && v.one_field === t);
504
- if (!n) return null;
505
- let h = n;
505
+ const r = f.find((v) => v.one_collection === i && v.one_field === t);
506
+ if (!r) return null;
507
+ let h = r;
506
508
  if (!h.junction_field) {
507
509
  const v = f.find(
508
- (_) => _.many_collection === n.many_collection && _.id !== n.id
510
+ (_) => _.many_collection === r.many_collection && _.id !== r.id
509
511
  );
510
- if (v != null && v.many_field) h = { ...n, junction_field: v.many_field };
512
+ if (v != null && v.many_field) h = { ...r, junction_field: v.many_field };
511
513
  else return null;
512
514
  }
513
- const k = h.one_field ?? `${h.many_collection}.${h.junction_field}`, j = (g == null ? void 0 : g.getStagedLinks(k)) ?? [], T = rt[t] ?? [], F = [...new Set([...j, ...T].map((v) => String(v)))];
515
+ const k = h.one_field ?? `${h.many_collection}.${h.junction_field}`, j = (g == null ? void 0 : g.getStagedLinks(k)) ?? [], A = lt[t] ?? [], F = [...new Set([...j, ...A].map((v) => String(v)))];
514
516
  return F.length === 0 ? null : F.length === 1 ? F[0] : F;
515
517
  },
516
518
  parentOptionFilter: (t) => {
517
519
  var h;
518
- const n = (C == null ? void 0 : C.collection) === i ? (h = C.fieldOptionFilters) == null ? void 0 : h[t] : void 0;
519
- return n ? mn(n, m, l) : void 0;
520
+ const r = (C == null ? void 0 : C.collection) === i ? (h = C.fieldOptionFilters) == null ? void 0 : h[t] : void 0;
521
+ return r ? fn(r, m, l) : void 0;
520
522
  }
521
- }), M = $.filter ? dn(Ge, $.filter, cn) : $.filter, K = $.satisfiedParents.map(I), ye = $.satisfiedParents, ct = $.unsatisfiedParents.length ? I($.unsatisfiedParents[0]) : null, be = $.missingRequiredParents, je = be.length ? I(be[0]) : null;
522
- function ut() {
523
- const t = Se.current;
523
+ }), M = $.filter ? pn(Qe, $.filter, hn) : $.filter, K = $.satisfiedParents.map(I), be = $.satisfiedParents, ut = $.unsatisfiedParents.length ? I($.unsatisfiedParents[0]) : null, ge = $.missingRequiredParents, De = ge.length ? I(ge[0]) : null;
524
+ function mt() {
525
+ const t = $e.current;
524
526
  if (t && t.src === e) return t.value;
525
- const n = { ...e, readonly: !0 };
526
- return Se.current = { src: e, value: n }, n;
527
+ const r = { ...e, readonly: !0 };
528
+ return $e.current = { src: e, value: r }, r;
527
529
  }
528
- function mt() {
529
- const t = JSON.stringify([K, ye]), n = Re.current;
530
- if (n && n.sig === t && n.onChange === p) return n.value;
530
+ function pt() {
531
+ const t = JSON.stringify([K, be]), r = Re.current;
532
+ if (r && r.sig === t && r.onChange === p) return r.value;
531
533
  const h = {
532
534
  labels: K,
533
- keys: ye,
535
+ keys: be,
534
536
  onClear: (k) => p(k, null)
535
537
  };
536
538
  return Re.current = { sig: t, onChange: p, value: h }, h;
537
539
  }
538
- function pt() {
539
- for (const t of ye) {
540
- const n = document.querySelector(`[data-field="${t}"]`);
541
- n && (n.scrollIntoView({ behavior: "smooth", block: "center" }), n.style.transition = "box-shadow 0.15s ease", n.style.boxShadow = "0 0 0 2px rgb(var(--nvr-cyan-rgb, 0 206 255)), 0 0 0 5px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.25)", n.style.borderRadius = "12px", setTimeout(() => {
542
- n.style.boxShadow = "none", setTimeout(() => {
543
- n.style.transition = "", n.style.borderRadius = "";
540
+ function ht() {
541
+ for (const t of be) {
542
+ const r = document.querySelector(`[data-field="${t}"]`);
543
+ r && (r.scrollIntoView({ behavior: "smooth", block: "center" }), r.style.transition = "box-shadow 0.15s ease", r.style.boxShadow = "0 0 0 2px rgb(var(--nvr-cyan-rgb, 0 206 255)), 0 0 0 5px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.25)", r.style.borderRadius = "12px", setTimeout(() => {
544
+ r.style.boxShadow = "none", setTimeout(() => {
545
+ r.style.transition = "", r.style.borderRadius = "";
544
546
  }, 300);
545
547
  }, 900));
546
548
  }
547
549
  }
548
- const ht = () => {
549
- if (w && B) {
550
- for (const n of Pe) g == null || g.unstageLink(B, n);
550
+ const xt = () => {
551
+ if (w && O) {
552
+ for (const r of je) g == null || g.unstageLink(O, r);
551
553
  const t = ke.getQueryData([
552
554
  "m2m-items",
553
555
  w.many_collection,
554
556
  w.many_field,
555
557
  l
556
558
  ]) ?? [];
557
- for (const n of t) g == null || g.stageUnlink(B, n.id);
559
+ for (const r of t) g == null || g.stageUnlink(O, r.id);
558
560
  } else
559
561
  p(e.field, null);
560
562
  };
561
563
  return (
562
564
  // biome-ignore lint/a11y/noStaticElementInteractions: the wrapper only hosts the field context menu (right-click / Shift+F10); the inputs inside stay the controls
563
- /* @__PURE__ */ c(
565
+ /* @__PURE__ */ d(
564
566
  "div",
565
567
  {
566
568
  ref: G,
567
569
  "data-field": e.field,
568
570
  "data-field-collection": i,
569
571
  "data-field-interface": e.interface ?? void 0,
570
- "data-autofill-check": pe ? "" : void 0,
572
+ "data-autofill-check": he ? "" : void 0,
571
573
  className: D(
572
574
  "group/fieldrow space-y-1.5",
573
- pe && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
575
+ he && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
574
576
  ),
575
- onContextMenu: Qe,
576
- onKeyDown: Ye,
577
- onFocusCapture: A.onFocusCapture,
577
+ onContextMenu: Ye,
578
+ onKeyDown: Je,
579
+ onFocusCapture: E.onFocusCapture,
578
580
  children: [
579
- Je,
580
- E.length > 0 && /* @__PURE__ */ r(
581
- Qt,
581
+ Xe,
582
+ P.length > 0 && /* @__PURE__ */ n(
583
+ Zt,
582
584
  {
583
- cascadeRules: E,
585
+ cascadeRules: P,
584
586
  cascadeFilter: M,
585
- currentValue: st,
587
+ currentValue: ct,
586
588
  relatedCollection: dt,
587
- missingRequiredParents: be,
588
- onClear: ht
589
+ missingRequiredParents: ge,
590
+ onClear: xt
589
591
  }
590
592
  ),
591
- (S !== "" || X.length > 0) && /* @__PURE__ */ c(
593
+ (S !== "" || X.length > 0) && /* @__PURE__ */ d(
592
594
  "div",
593
595
  {
594
596
  className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]",
595
- "data-pd-row": ue ? "" : void 0,
597
+ "data-pd-row": me ? "" : void 0,
596
598
  children: [
597
- S !== "" && /* @__PURE__ */ c(At, { id: Q, "data-field-label": !0, className: "text-sm font-medium", children: [
598
- /* @__PURE__ */ r(Ke, { text: S, collection: i }),
599
- e.required && /* @__PURE__ */ r("span", { className: "ml-0.5 text-destructive", children: "*" }),
600
- rn(e) && /* @__PURE__ */ r(ln, {})
599
+ S !== "" && /* @__PURE__ */ d(jt, { id: Q, "data-field-label": !0, className: "text-sm font-medium", children: [
600
+ /* @__PURE__ */ n(Ue, { text: S, collection: i }),
601
+ e.required && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" }),
602
+ sn(e) && /* @__PURE__ */ n(cn, {})
601
603
  ] }),
602
- Z.note && /* @__PURE__ */ r(ee, { delayDuration: 100, children: /* @__PURE__ */ c(te, { children: [
603
- /* @__PURE__ */ r(ne, { asChild: !0, children: /* @__PURE__ */ r(yt, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
604
- /* @__PURE__ */ r(re, { side: "top", className: "max-w-[240px] text-[12px]", children: (s == null ? void 0 : s.glossaryHelp) === !1 ? Z.note : /* @__PURE__ */ r(Ke, { text: Z.note, collection: i }) })
604
+ Z.note && /* @__PURE__ */ n(te, { delayDuration: 100, children: /* @__PURE__ */ d(ne, { children: [
605
+ /* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ n(bt, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
606
+ /* @__PURE__ */ n(le, { side: "top", className: "max-w-[240px] text-[12px]", children: (s == null ? void 0 : s.glossaryHelp) === !1 ? Z.note : /* @__PURE__ */ n(Ue, { text: Z.note, collection: i }) })
605
607
  ] }) }),
606
- !P && l && l !== "new" && /* @__PURE__ */ r(
607
- wn,
608
+ Ne && /* @__PURE__ */ n(Pt, { source: Ne, label: S }),
609
+ !T && l && l !== "new" && /* @__PURE__ */ n(
610
+ Fn,
608
611
  {
609
612
  collection: i,
610
613
  itemId: l,
@@ -612,34 +615,35 @@ const Zn = Ct(function({
612
615
  onRestore: e.readonly ? void 0 : (t) => p(e.field, t)
613
616
  }
614
617
  ),
615
- !P && l && l !== "new" && /* @__PURE__ */ r(kn, { collection: i, itemId: l, field: e.field }),
616
- l && l !== "new" && at && /* @__PURE__ */ r(vn, { collection: i, itemId: l, field: e.field }),
617
- lt && /* @__PURE__ */ r(
618
- an,
618
+ !T && l && l !== "new" && /* @__PURE__ */ n(Cn, { collection: i, itemId: l, field: e.field }),
619
+ !T && l && l !== "new" && /* @__PURE__ */ n(Vt, { field: e.field, label: S || ee(e.field) }),
620
+ l && l !== "new" && at && /* @__PURE__ */ n(Nn, { collection: i, itemId: l, field: e.field }),
621
+ ot && /* @__PURE__ */ n(
622
+ dn,
619
623
  {
620
624
  collection: i,
621
625
  itemId: l,
622
626
  field: e.field,
623
- label: S || ge(e.field),
627
+ label: S || ee(e.field),
624
628
  onFill: (t) => p(e.field, t)
625
629
  }
626
630
  ),
627
- !P && J.show && !(J.perField && (u || e.readonly)) && /* @__PURE__ */ c(
631
+ !T && J.show && !(J.perField && (u || e.readonly)) && /* @__PURE__ */ d(
628
632
  "button",
629
633
  {
630
634
  type: "button",
631
- onClick: et,
635
+ onClick: tt,
632
636
  disabled: _e,
633
637
  "data-ai-fill": J.perField ? e.field : void 0,
634
638
  className: "inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 disabled:opacity-50 transition-colors",
635
639
  title: "Generate with AI",
636
640
  children: [
637
- _e ? /* @__PURE__ */ r(bt, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ r(gt, { className: "h-3 w-3" }),
641
+ _e ? /* @__PURE__ */ n(gt, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(vt, { className: "h-3 w-3" }),
638
642
  "AI"
639
643
  ]
640
644
  }
641
645
  ),
642
- pe && /* @__PURE__ */ r(
646
+ he && /* @__PURE__ */ n(
643
647
  "span",
644
648
  {
645
649
  "data-tip": "People often change what the AI read from the document here — check it",
@@ -648,7 +652,7 @@ const Zn = Ct(function({
648
652
  }
649
653
  ),
650
654
  x,
651
- q && !u && !e.readonly && /* @__PURE__ */ c(
655
+ q && !u && !e.readonly && /* @__PURE__ */ d(
652
656
  "button",
653
657
  {
654
658
  type: "button",
@@ -663,21 +667,21 @@ const Zn = Ct(function({
663
667
  ]
664
668
  }
665
669
  ),
666
- X.length > 0 && /* @__PURE__ */ r(ee, { delayDuration: 100, children: /* @__PURE__ */ c(te, { children: [
667
- /* @__PURE__ */ r(ne, { asChild: !0, children: /* @__PURE__ */ c("span", { className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20 cursor-default", children: [
668
- /* @__PURE__ */ r("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
670
+ X.length > 0 && /* @__PURE__ */ n(te, { delayDuration: 100, children: /* @__PURE__ */ d(ne, { children: [
671
+ /* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20 cursor-default", children: [
672
+ /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
669
673
  "addendum"
670
674
  ] }) }),
671
- /* @__PURE__ */ c(re, { side: "top", className: "max-w-[220px] text-[12px]", children: [
672
- /* @__PURE__ */ c("p", { className: "font-medium mb-1", children: [
675
+ /* @__PURE__ */ d(le, { side: "top", className: "max-w-[220px] text-[12px]", children: [
676
+ /* @__PURE__ */ d("p", { className: "font-medium mb-1", children: [
673
677
  "In active addendum",
674
678
  X.length > 1 ? "s" : "",
675
679
  ":"
676
680
  ] }),
677
- X.map((t) => /* @__PURE__ */ c("p", { className: "text-slate-400", children: [
681
+ X.map((t) => /* @__PURE__ */ d("p", { className: "text-slate-400", children: [
678
682
  t.title,
679
683
  " ",
680
- /* @__PURE__ */ c("span", { className: "capitalize", children: [
684
+ /* @__PURE__ */ d("span", { className: "capitalize", children: [
681
685
  "(",
682
686
  t.status,
683
687
  ")"
@@ -685,8 +689,8 @@ const Zn = Ct(function({
685
689
  ] }, t.id))
686
690
  ] })
687
691
  ] }) }),
688
- /* @__PURE__ */ r(
689
- Ht,
692
+ /* @__PURE__ */ n(
693
+ Gt,
690
694
  {
691
695
  collection: i,
692
696
  kind: "field",
@@ -694,57 +698,57 @@ const Zn = Ct(function({
694
698
  label: S
695
699
  }
696
700
  ),
697
- (u || e.readonly) && O ? /* @__PURE__ */ r(Bt, { reason: O, onHover: s == null ? void 0 : s.onLockHover }) : u ? /* @__PURE__ */ r(ee, { delayDuration: 200, children: /* @__PURE__ */ c(te, { children: [
698
- /* @__PURE__ */ r(ne, { asChild: !0, children: /* @__PURE__ */ r("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ r(vt, { className: "h-3 w-3" }) }) }),
699
- /* @__PURE__ */ r(re, { side: "top", className: "text-[12px]", children: "This field is locked" })
701
+ (u || e.readonly) && B ? /* @__PURE__ */ n(Ut, { reason: B, onHover: s == null ? void 0 : s.onLockHover }) : u ? /* @__PURE__ */ n(te, { delayDuration: 200, children: /* @__PURE__ */ d(ne, { children: [
702
+ /* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(wt, { className: "h-3 w-3" }) }) }),
703
+ /* @__PURE__ */ n(le, { side: "top", className: "text-[12px]", children: "This field is locked" })
700
704
  ] }) }) : null,
701
- E.length > 0 && (() => {
702
- const t = !!M && Object.keys(M).length > 0 && K.length > 0, n = E.map(
705
+ P.length > 0 && (() => {
706
+ const t = !!M && Object.keys(M).length > 0 && K.length > 0, r = P.map(
703
707
  (h) => I(String(h.parent_field))
704
708
  );
705
- return /* @__PURE__ */ r(ee, { delayDuration: 100, children: /* @__PURE__ */ c(te, { children: [
706
- /* @__PURE__ */ r(ne, { asChild: !0, children: /* @__PURE__ */ r(
709
+ return /* @__PURE__ */ n(te, { delayDuration: 100, children: /* @__PURE__ */ d(ne, { children: [
710
+ /* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ n(
707
711
  "button",
708
712
  {
709
713
  type: "button",
710
714
  "aria-label": `Show the fields that narrow ${S || "this list"}`,
711
- onClick: pt,
715
+ onClick: ht,
712
716
  className: D(
713
717
  "inline-flex items-center transition-colors",
714
718
  t ? "text-nvr-cyan hover:text-nvr-cyan" : "text-slate-300 hover:text-nvr-cyan dark:text-slate-600 dark:hover:text-nvr-cyan"
715
719
  ),
716
- children: /* @__PURE__ */ r(wt, { className: "h-3 w-3" })
720
+ children: /* @__PURE__ */ n(kt, { className: "h-3 w-3" })
717
721
  }
718
722
  ) }),
719
- /* @__PURE__ */ r(re, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${K.join(", ")} — click to highlight` : `Options filter by ${n.join(", ")} once set` })
723
+ /* @__PURE__ */ n(le, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${K.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
720
724
  ] }) });
721
725
  })(),
722
- ue && // Right-anchored: the personal-default control flush with the field's right edge
726
+ me && // Right-anchored: the personal-default control flush with the field's right edge
723
727
  // (it carries Make / Update / Clear itself — no ⋯ button; right-click and
724
728
  // Shift+F10 still open the field menu). The slot keeps one box whatever it shows,
725
729
  // so nothing to its left moves.
726
- /* @__PURE__ */ r("span", { className: "ml-auto inline-flex shrink-0 items-center gap-1", children: /* @__PURE__ */ r(
727
- Zt,
730
+ /* @__PURE__ */ n("span", { className: "ml-auto inline-flex shrink-0 items-center gap-1", children: /* @__PURE__ */ n(
731
+ nn,
728
732
  {
729
733
  field: e.field,
730
734
  label: S,
731
- state: ue,
732
- confirmOpen: ce === "make" || ce === "update" ? ce : null,
733
- onConfirm: (t, n) => (
735
+ state: me,
736
+ confirmOpen: ue === "make" || ue === "update" ? ue : null,
737
+ onConfirm: (t, r) => (
734
738
  // After a save the button becomes "Your default": focus goes to the field.
735
- Xe(t, me, n)
739
+ Ze(t, pe, r)
736
740
  ),
737
741
  onUndo: () => {
738
742
  L == null || L.undo(e.field), requestAnimationFrame(() => {
739
743
  var t;
740
- return (t = me()) == null ? void 0 : t.focus();
744
+ return (t = pe()) == null ? void 0 : t.focus();
741
745
  });
742
746
  },
743
747
  onCleared: () => (
744
748
  // The Clear button is gone (and not a tab stop): focus goes to the field.
745
749
  requestAnimationFrame(() => {
746
750
  var t;
747
- return (t = me()) == null ? void 0 : t.focus();
751
+ return (t = pe()) == null ? void 0 : t.focus();
748
752
  })
749
753
  )
750
754
  }
@@ -752,26 +756,26 @@ const Zn = Ct(function({
752
756
  ]
753
757
  }
754
758
  ),
755
- A.editor && !u && /* @__PURE__ */ r(
756
- Mt,
759
+ E.editor && !u && /* @__PURE__ */ n(
760
+ Ht,
757
761
  {
758
- editor: A.editor,
759
- confirming: A.confirming,
760
- onConfirm: A.confirm,
761
- onCancel: A.cancel
762
+ editor: E.editor,
763
+ confirming: E.confirming,
764
+ onConfirm: E.confirm,
765
+ onCancel: E.cancel
762
766
  }
763
767
  ),
764
- W ?? /* @__PURE__ */ r(
768
+ W ?? /* @__PURE__ */ n(
765
769
  "div",
766
770
  {
767
771
  ref: de,
768
772
  className: D(u && !V && "cursor-not-allowed"),
769
- "data-tip": (u || e.readonly) && O ? O : void 0,
770
- onPointerEnter: (u || e.readonly) && O ? s == null ? void 0 : s.onLockHover : void 0,
771
- children: /* @__PURE__ */ r(
773
+ "data-tip": (u || e.readonly) && B ? B : void 0,
774
+ onPointerEnter: (u || e.readonly) && B ? s == null ? void 0 : s.onLockHover : void 0,
775
+ children: /* @__PURE__ */ n(
772
776
  "div",
773
777
  {
774
- ref: Ce,
778
+ ref: Le,
775
779
  className: D(
776
780
  // A locked FILE field stays interactive: its chips keep the
777
781
  // download link and preview click (the component itself hides
@@ -782,10 +786,10 @@ const Zn = Ct(function({
782
786
  // The ring lands with a 2px shake so the eye finds the field;
783
787
  // the animation runs once when the class is added.
784
788
  N && "nvr-shake ring-1 ring-red-400 rounded-md",
785
- ie && "nvr-autofill-glow"
789
+ se && "nvr-autofill-glow"
786
790
  ),
787
- children: P ? /* @__PURE__ */ r(on, { field: e, values: m }) : ot ? /* @__PURE__ */ r(
788
- Pt,
791
+ children: T ? /* @__PURE__ */ n(un, { field: e, values: m }) : it ? /* @__PURE__ */ n(
792
+ Bt,
789
793
  {
790
794
  collection: i,
791
795
  field: e,
@@ -794,41 +798,41 @@ const Zn = Ct(function({
794
798
  }
795
799
  ) : y ? y({
796
800
  field: e,
797
- value: he,
798
- onChange: Le,
801
+ value: xe,
802
+ onChange: Se,
799
803
  disabled: u,
800
804
  collection: i,
801
805
  itemId: l,
802
806
  relations: f,
803
807
  cascadeFilter: M,
804
- unsatisfiedParentLabel: ct,
805
- requiredParentLabel: je
806
- }) : /* @__PURE__ */ r(
807
- Ut,
808
+ unsatisfiedParentLabel: ut,
809
+ requiredParentLabel: De
810
+ }) : /* @__PURE__ */ n(
811
+ zt,
808
812
  {
809
- field: u && V ? ut() : e,
810
- value: he,
811
- onChange: Le,
813
+ field: u && V ? mt() : e,
814
+ value: xe,
815
+ onChange: Se,
812
816
  relations: f,
813
817
  collection: i,
814
818
  itemId: l,
815
819
  cascadeFilter: M,
816
- requiredParentLabel: je,
817
- narrowedBy: K.length > 0 ? mt() : void 0,
818
- onCountChange: a ? ze : void 0
820
+ requiredParentLabel: De,
821
+ narrowedBy: K.length > 0 ? pt() : void 0,
822
+ onCountChange: o ? Ge : void 0
819
823
  }
820
824
  )
821
825
  },
822
- ie ?? 0
826
+ se ?? 0
823
827
  )
824
828
  }
825
829
  ),
826
- Ee && /* @__PURE__ */ r(sn, { value: m[e.field], config: Ee }),
827
- Te && !Ie && /* @__PURE__ */ r(It, { field: e.field, text: Te }),
828
- qe && /* @__PURE__ */ r(
829
- Kt,
830
+ Pe && /* @__PURE__ */ n(mn, { value: m[e.field], config: Pe }),
831
+ Ae && !et && /* @__PURE__ */ n(rn, { field: e.field, text: Ae }),
832
+ Te && /* @__PURE__ */ n(
833
+ Wt,
830
834
  {
831
- change: qe,
835
+ change: Te,
832
836
  onDismiss: () => s == null ? void 0 : s.dismissRemoteChange(e.field),
833
837
  onTakeTheirs: s != null && s.takeRemoteChange ? () => {
834
838
  var t;
@@ -842,7 +846,7 @@ const Zn = Ct(function({
842
846
  );
843
847
  });
844
848
  export {
845
- Zn as FieldRow,
846
- Xn as lineageSummary,
847
- gn as useFieldLineage
849
+ lr as FieldRow,
850
+ rr as lineageSummary,
851
+ _n as useFieldLineage
848
852
  };