@nivaro/react 0.3.103 → 0.3.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +15 -3
  4. package/dist/shared/components/CollectionBrowserView.js +1694 -1639
  5. package/dist/shared/components/ItemEditForm.js +2867 -2845
  6. package/dist/shared/components/imports/CollectionImportPanel.js +483 -459
  7. package/dist/shared/components/integrations/IntegrationStatusLines.js +71 -68
  8. package/dist/shared/components/item-edit/InlineTableField.js +88 -88
  9. package/dist/shared/components/item-edit/UserChip.js +38 -38
  10. package/dist/shared/components/layout-editor/DesignNode.js +16 -14
  11. package/dist/shared/components/layout-editor/LayoutEditor.js +445 -441
  12. package/dist/shared/components/layout-editor/inspector/Inspector.js +18 -18
  13. package/dist/shared/components/layout-editor/inspector/SlotInspector.js +80 -52
  14. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  15. package/dist/shared/components/layout-editor/settings/ButtonsSection.js +54 -26
  16. package/dist/shared/components/layout-editor/settings/settings-registry.js +23 -15
  17. package/dist/shared/components/layout-editor/useLayoutDraft.js +211 -196
  18. package/dist/shared/components/panels/ExternalRequestsChip.js +141 -122
  19. package/dist/shared/components/quick-filters/QuickFilterBarEditor.js +334 -0
  20. package/dist/shared/components/quick-filters/QuickFilterFieldPicker.js +151 -0
  21. package/dist/shared/components/quick-filters/QuickFilterForm.js +371 -0
  22. package/dist/shared/components/quick-filters/config.js +63 -0
  23. package/dist/shared/components/quick-filters/facets.js +55 -0
  24. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +95 -0
  25. package/dist/shared/lib/entry-config.js +7 -7
  26. package/dist/shared/lib/integration-chip.js +10 -6
  27. package/dist/shared/lib/owners-header-tile.js +63 -0
  28. package/package.json +1 -1
@@ -1,103 +1,104 @@
1
1
  import { jsxs as y, jsx as r, Fragment as ie } from "react/jsx-runtime";
2
- import { useQueryClient as xo, useQuery as So } from "@tanstack/react-query";
3
- import { Percent as Lo, OctagonAlert as To, ListOrdered as Co, AlertTriangle as At, Lock as Po, Plus as Ro, BarChart3 as Oo, LayoutGrid as No, Table2 as Ao, Grid3x3 as Eo, Users as Io } from "lucide-react";
4
- import { useState as O, useEffect as B, useMemo as w, useRef as z, useCallback as T } from "react";
5
- import { createPortal as Do } from "react-dom";
6
- import { toast as Et } from "sonner";
7
- import { useNivaroClient as Fo } from "../../context.js";
8
- import { get as Ko } from "../../lib/commands.js";
9
- import { HEADER_GROUP_KEY as zt, UNGROUPED_KEY as Mo } from "../../lib/layout-ops.js";
10
- import { activeFreeze as _o, dayWords as Bo } from "../../lib/layout-resolve.js";
11
- import { useMyUserId as qo } from "../../lib/presence-signals.js";
12
- import { useUnsavedWork as Uo } from "../../lib/unsaved-work.js";
2
+ import { useQueryClient as So, useQuery as To } from "@tanstack/react-query";
3
+ import { Percent as Lo, OctagonAlert as Co, ListOrdered as Ro, AlertTriangle as Et, Lock as Oo, Plus as Po, BarChart3 as Ao, LayoutGrid as No, Table2 as Eo, Grid3x3 as Io, Users as Do } from "lucide-react";
4
+ import { useState as P, useEffect as B, useMemo as w, useRef as z, useCallback as L } from "react";
5
+ import { createPortal as Fo } from "react-dom";
6
+ import { toast as It } from "sonner";
7
+ import { useNivaroClient as Ko } from "../../context.js";
8
+ import { get as Mo } from "../../lib/commands.js";
9
+ import { HEADER_GROUP_KEY as $t, UNGROUPED_KEY as _o } from "../../lib/layout-ops.js";
10
+ import { activeFreeze as Bo, dayWords as qo } from "../../lib/layout-resolve.js";
11
+ import { withAutoOwnersTile as Uo } from "../../lib/owners-header-tile.js";
12
+ import { useMyUserId as zo } from "../../lib/presence-signals.js";
13
+ import { useUnsavedWork as $o } from "../../lib/unsaved-work.js";
13
14
  import { cn as G } from "../../lib/utils.js";
14
- import { usePretendDownScope as zo, LAYOUT_PRETEND_SCOPE as It, layoutPretendDownOptions as $o, PretendDownSection as Wo } from "../PretendDown.js";
15
- import { modalHostOf as Vo } from "../ui/popover.js";
16
- import { Skeleton as Dt } from "../ui/skeleton.js";
17
- import { AddPanel as Ho } from "./AddPanel.js";
18
- import { AutoArrangeButton as jo } from "./AutoArrange.js";
19
- import { AiToolsButton as Go } from "./ai/AiToolsButton.js";
20
- import { pinsToMarks as Zo, mergeMarks as Ft } from "./ai/ai-tools-api.js";
21
- import { AiFormsButton as Qo } from "./ai-forms/AiFormsButton.js";
22
- import { AskButton as Yo, AskPanel as Jo } from "./assist/AskPanel.js";
23
- import { useAskThread as Xo } from "./assist/assist-api.js";
24
- import { jumpToSetting as er } from "./assist/jump.js";
25
- import { ProposalsButton as tr } from "./assist/ProposalsButton.js";
26
- import { BulkChangesButton as or } from "./bulk/BulkChangesButton.js";
27
- import { useMacroRecorder as rr } from "./bulk/useMacroRecorder.js";
28
- import { bundleToActiveLayout as $t, previewForRole as nr, roleMarker as ar } from "./bundle-to-active.js";
29
- import { useCanvasCompare as sr, CompareBanner as ir } from "./CanvasCompare.js";
30
- import { changeNotePolicyOf as Kt, changeNoteMeta as lr, changeNoteReady as dr, ChangeNoteFields as cr, ChangeNoteSave as ur } from "./ChangeNote.js";
31
- import { PresenceAvatars as pr, DroppedBanner as mr, RecoveryBanner as fr, UnsavedList as hr } from "./CollabParts.js";
32
- import { CommandPalette as yr } from "./commands/CommandPalette.js";
33
- import { nextSelection as vr, targetKey as $ } from "./design-context.js";
34
- import { LayoutDndProvider as gr, useLayoutDnd as kr } from "./dnd/LayoutDndProvider.js";
35
- import { NO_DND as br } from "./dnd/node.js";
36
- import { useTrashWarning as wr } from "./dnd/trash-links.js";
37
- import { useDraftRecovery as xr, stagedTip as Sr } from "./draft-recovery.js";
38
- import { canvasRenderer as Lr, EditorCanvas as Tr } from "./EditorCanvas.js";
39
- import { EditorTopBar as Cr } from "./EditorTopBar.js";
40
- import { notesOf as Pr, noteKey as Rr } from "./editor-notes.js";
41
- import { EntryEditorContext as Mt } from "./entry/entry-editor-context.js";
42
- import { useTabOrderEditor as Or, TabOrderBar as Nr } from "./entry/tab-order.js";
43
- import { useAppIsDark as Ar, ThemePreviewTool as Er, previewThemeClass as Ir } from "./entry/theme-preview.js";
44
- import { useRulesView as Dr, explainMarks as Fr, RulesToggle as Kr, RuleLoopsBanner as Mr } from "./explain/CanvasRules.js";
45
- import { useDriverHover as _r } from "./explain/driver-hover.js";
46
- import { fieldLabel as Br } from "./explain/field-sources.js";
47
- import { useCanvasExplain as qr, useDefaultGhosts as Ur } from "./explain/use-explain.js";
48
- import { FindReplaceButton as zr } from "./FindReplace.js";
49
- import { FormMapButton as $r } from "./FormMapButton.js";
50
- import { WIDTH_LABELS as Wr } from "./field-zones.js";
51
- import { useSectionChanges as Vr } from "./history-api.js";
52
- import { useLayoutEditorHost as Hr } from "./host.js";
53
- import { overriddenTargets as jr, overrideMark as Gr } from "./inheritance.js";
54
- import { BulkInspector as Zr } from "./inspector/BulkInspector.js";
55
- import { requestInspectorTab as Qr } from "./inspector/tab-request.js";
56
- import { isTyping as Ze } from "./is-typing.js";
57
- import { ARROW_DIRS as Yr, altArrowMove as Jr } from "./keyboard-move.js";
58
- import { LayoutsRail as Xr } from "./LayoutsRail.js";
59
- import { useLabelStyleControls as en } from "./lint/LabelStyle.js";
60
- import { LintButton as tn, LintPanel as on } from "./lint/LintPanel.js";
61
- import { useLayoutLint as rn } from "./lint/lint-api.js";
62
- import { FieldStateMatrix as nn } from "./matrix/FieldStateMatrix.js";
63
- import { RoleSectionMatrix as an } from "./matrix/RoleSectionMatrix.js";
64
- import { FindTool as sn, OutlineTool as ln, ViewTools as dn, ShortcutsTool as cn } from "./nav/NavTools.js";
65
- import { OutlinePanel as un } from "./nav/OutlinePanel.js";
66
- import { useEditorNav as pn } from "./nav/useEditorNav.js";
67
- import { fitZoom as mn, effectiveZoom as fn } from "./nav/view-prefs.js";
68
- import { ZoomChip as hn } from "./nav/ZoomControls.js";
69
- import { OutputsButton as yn } from "./outputs/OutputsButton.js";
70
- import { useLayoutOverview as vn, useOverviewFields as gn, useInvalidateLayouts as Wt, useRuleChoiceLabels as kn, useApproxRecordCount as bn } from "./overview/overview-api.js";
71
- import { purposeSegments as wn, Sentence as xn } from "./overview/purpose.js";
72
- import { PlacementsTable as Sn } from "./PlacementsTable.js";
73
- import { usePlaceTools as Ln, PlaceToolsProvider as _t } from "./PlaceTools.js";
74
- import { segTrack as Tn, segOption as Cn, amberStrip as We } from "./panel-style.js";
15
+ import { usePretendDownScope as Wo, LAYOUT_PRETEND_SCOPE as Dt, layoutPretendDownOptions as Vo, PretendDownSection as Ho } from "../PretendDown.js";
16
+ import { modalHostOf as jo } from "../ui/popover.js";
17
+ import { Skeleton as Ft } from "../ui/skeleton.js";
18
+ import { AddPanel as Go } from "./AddPanel.js";
19
+ import { AutoArrangeButton as Zo } from "./AutoArrange.js";
20
+ import { AiToolsButton as Qo } from "./ai/AiToolsButton.js";
21
+ import { pinsToMarks as Yo, mergeMarks as Kt } from "./ai/ai-tools-api.js";
22
+ import { AiFormsButton as Jo } from "./ai-forms/AiFormsButton.js";
23
+ import { AskButton as Xo, AskPanel as er } from "./assist/AskPanel.js";
24
+ import { useAskThread as tr } from "./assist/assist-api.js";
25
+ import { jumpToSetting as or } from "./assist/jump.js";
26
+ import { ProposalsButton as rr } from "./assist/ProposalsButton.js";
27
+ import { BulkChangesButton as nr } from "./bulk/BulkChangesButton.js";
28
+ import { useMacroRecorder as ar } from "./bulk/useMacroRecorder.js";
29
+ import { bundleToActiveLayout as Wt, previewForRole as sr, roleMarker as ir } from "./bundle-to-active.js";
30
+ import { useCanvasCompare as lr, CompareBanner as dr } from "./CanvasCompare.js";
31
+ import { changeNotePolicyOf as Mt, changeNoteMeta as cr, changeNoteReady as ur, ChangeNoteFields as pr, ChangeNoteSave as mr } from "./ChangeNote.js";
32
+ import { PresenceAvatars as fr, DroppedBanner as hr, RecoveryBanner as yr, UnsavedList as vr } from "./CollabParts.js";
33
+ import { CommandPalette as gr } from "./commands/CommandPalette.js";
34
+ import { nextSelection as kr, targetKey as $ } from "./design-context.js";
35
+ import { LayoutDndProvider as wr, useLayoutDnd as br } from "./dnd/LayoutDndProvider.js";
36
+ import { NO_DND as xr } from "./dnd/node.js";
37
+ import { useTrashWarning as Sr } from "./dnd/trash-links.js";
38
+ import { useDraftRecovery as Tr, stagedTip as Lr } from "./draft-recovery.js";
39
+ import { canvasRenderer as Cr, EditorCanvas as Rr } from "./EditorCanvas.js";
40
+ import { EditorTopBar as Or } from "./EditorTopBar.js";
41
+ import { notesOf as Pr, noteKey as Ar } from "./editor-notes.js";
42
+ import { EntryEditorContext as _t } from "./entry/entry-editor-context.js";
43
+ import { useTabOrderEditor as Nr, TabOrderBar as Er } from "./entry/tab-order.js";
44
+ import { useAppIsDark as Ir, ThemePreviewTool as Dr, previewThemeClass as Fr } from "./entry/theme-preview.js";
45
+ import { useRulesView as Kr, explainMarks as Mr, RulesToggle as _r, RuleLoopsBanner as Br } from "./explain/CanvasRules.js";
46
+ import { useDriverHover as qr } from "./explain/driver-hover.js";
47
+ import { fieldLabel as Ur } from "./explain/field-sources.js";
48
+ import { useCanvasExplain as zr, useDefaultGhosts as $r } from "./explain/use-explain.js";
49
+ import { FindReplaceButton as Wr } from "./FindReplace.js";
50
+ import { FormMapButton as Vr } from "./FormMapButton.js";
51
+ import { WIDTH_LABELS as Hr } from "./field-zones.js";
52
+ import { useSectionChanges as jr } from "./history-api.js";
53
+ import { useLayoutEditorHost as Gr } from "./host.js";
54
+ import { overriddenTargets as Zr, overrideMark as Qr } from "./inheritance.js";
55
+ import { BulkInspector as Yr } from "./inspector/BulkInspector.js";
56
+ import { requestInspectorTab as Jr } from "./inspector/tab-request.js";
57
+ import { isTyping as Qe } from "./is-typing.js";
58
+ import { ARROW_DIRS as Xr, altArrowMove as en } from "./keyboard-move.js";
59
+ import { LayoutsRail as tn } from "./LayoutsRail.js";
60
+ import { useLabelStyleControls as on } from "./lint/LabelStyle.js";
61
+ import { LintButton as rn, LintPanel as nn } from "./lint/LintPanel.js";
62
+ import { useLayoutLint as an } from "./lint/lint-api.js";
63
+ import { FieldStateMatrix as sn } from "./matrix/FieldStateMatrix.js";
64
+ import { RoleSectionMatrix as ln } from "./matrix/RoleSectionMatrix.js";
65
+ import { FindTool as dn, OutlineTool as cn, ViewTools as un, ShortcutsTool as pn } from "./nav/NavTools.js";
66
+ import { OutlinePanel as mn } from "./nav/OutlinePanel.js";
67
+ import { useEditorNav as fn } from "./nav/useEditorNav.js";
68
+ import { fitZoom as hn, effectiveZoom as yn } from "./nav/view-prefs.js";
69
+ import { ZoomChip as vn } from "./nav/ZoomControls.js";
70
+ import { OutputsButton as gn } from "./outputs/OutputsButton.js";
71
+ import { useLayoutOverview as kn, useOverviewFields as wn, useInvalidateLayouts as Vt, useRuleChoiceLabels as bn, useApproxRecordCount as xn } from "./overview/overview-api.js";
72
+ import { purposeSegments as Sn, Sentence as Tn } from "./overview/purpose.js";
73
+ import { PlacementsTable as Ln } from "./PlacementsTable.js";
74
+ import { usePlaceTools as Cn, PlaceToolsProvider as Bt } from "./PlaceTools.js";
75
+ import { segTrack as Rn, segOption as On, amberStrip as Ve } from "./panel-style.js";
75
76
  import { usePersonalDefaultMarks as Pn } from "./personal-default-marks.js";
76
- import { useLayoutPresence as Rn, peersByTarget as On } from "./presence.js";
77
- import { PreviewModes as Nn } from "./preview/PreviewModes.js";
78
- import { PreviewPanes as An } from "./preview/PreviewPanes.js";
79
- import { previewNaturalWidth as En } from "./preview/preview-model.js";
80
- import { useRemovalLog as In } from "./removed-log.js";
81
- import { FormMoreMenu as Dn } from "./reuse/FormMoreMenu.js";
82
- import { useLinkedSections as Fn, useLinkedSectionMarks as Kn, LinkedSectionsProvider as Mn } from "./reuse/linked-sections.js";
83
- import { useRailCopy as _n } from "./reuse/useRailCopy.js";
84
- import { SlashInsert as Bn } from "./SlashInsert.js";
85
- import { StagedByOthers as qn } from "./StagedChip.js";
86
- import { StructureActions as Un, usePinMarks as zn } from "./StructureMenu.js";
87
- import { useRolePreview as $n } from "./settings/settings-api.js";
88
- import { layoutKindOf as Wn } from "./settings/settings-registry.js";
89
- import { useStagedDraft as Vn, useStagedWriter as Hn } from "./staged-api.js";
90
- import { ImpactButton as jn, TestingButton as Gn } from "./testing/TestingPanels.js";
91
- import { MenuSeparator as Re, ToolButton as Ve } from "./toolbar-kit.js";
92
- import { unsavedText as Zn, UnsavedConfirm as Qn } from "./UnsavedConfirm.js";
93
- import { unsavedKeys as Yn, targetFromKey as Bt, describeTarget as qt } from "./unsaved-marks.js";
94
- import { useRefusalLens as Jn } from "./usage/refusal-lens.js";
95
- import { UsagePanel as Xn } from "./usage/UsagePanel.js";
96
- import { useShowFillRates as ea, useFieldFillRates as ta, usageTodayText as oa, useLayoutUsageToday as ra } from "./usage/usage-api.js";
97
- import { useLayoutDraft as na, useLayoutBundle as He, layoutDraftKeys as aa, touchesOverview as sa } from "./useLayoutDraft.js";
98
- import { FormSettings as ia } from "./settings/FormSettings.js";
99
- import { Inspector as la } from "./inspector/Inspector.js";
100
- function da(o) {
77
+ import { useLayoutPresence as An, peersByTarget as Nn } from "./presence.js";
78
+ import { PreviewModes as En } from "./preview/PreviewModes.js";
79
+ import { PreviewPanes as In } from "./preview/PreviewPanes.js";
80
+ import { previewNaturalWidth as Dn } from "./preview/preview-model.js";
81
+ import { useRemovalLog as Fn } from "./removed-log.js";
82
+ import { FormMoreMenu as Kn } from "./reuse/FormMoreMenu.js";
83
+ import { useLinkedSections as Mn, useLinkedSectionMarks as _n, LinkedSectionsProvider as Bn } from "./reuse/linked-sections.js";
84
+ import { useRailCopy as qn } from "./reuse/useRailCopy.js";
85
+ import { SlashInsert as Un } from "./SlashInsert.js";
86
+ import { StagedByOthers as zn } from "./StagedChip.js";
87
+ import { StructureActions as $n, usePinMarks as Wn } from "./StructureMenu.js";
88
+ import { useRolePreview as Vn } from "./settings/settings-api.js";
89
+ import { layoutKindOf as Hn } from "./settings/settings-registry.js";
90
+ import { useStagedDraft as jn, useStagedWriter as Gn } from "./staged-api.js";
91
+ import { ImpactButton as Zn, TestingButton as Qn } from "./testing/TestingPanels.js";
92
+ import { MenuSeparator as Oe, ToolButton as He } from "./toolbar-kit.js";
93
+ import { unsavedText as Yn, UnsavedConfirm as Jn } from "./UnsavedConfirm.js";
94
+ import { unsavedKeys as Xn, targetFromKey as qt, describeTarget as Ut } from "./unsaved-marks.js";
95
+ import { useRefusalLens as ea } from "./usage/refusal-lens.js";
96
+ import { UsagePanel as ta } from "./usage/UsagePanel.js";
97
+ import { useShowFillRates as oa, useFieldFillRates as ra, usageTodayText as na, useLayoutUsageToday as aa } from "./usage/usage-api.js";
98
+ import { useLayoutDraft as sa, useLayoutBundle as je, layoutDraftKeys as ia, touchesOverview as la } from "./useLayoutDraft.js";
99
+ import { FormSettings as da } from "./settings/FormSettings.js";
100
+ import { Inspector as ca } from "./inspector/Inspector.js";
101
+ function ua(o) {
101
102
  B(() => {
102
103
  const i = (s) => {
103
104
  if (!(s.metaKey || s.ctrlKey) || s.altKey) return;
@@ -107,18 +108,18 @@ function da(o) {
107
108
  return;
108
109
  }
109
110
  const m = l === "z" && s.shiftKey || l === "y" && !s.shiftKey;
110
- l !== "z" && !m || Ze(s.target) || (s.preventDefault(), m ? o.redo() : o.undo());
111
+ l !== "z" && !m || Qe(s.target) || (s.preventDefault(), m ? o.redo() : o.undo());
111
112
  };
112
113
  return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
113
114
  }, [o.undo, o.redo, o.autosave, o.flush, o.save]);
114
115
  }
115
- function ca(o, i, s, l, m) {
116
+ function pa(o, i, s, l, m) {
116
117
  B(() => {
117
118
  const d = (u) => {
118
- const v = Yr[u.key];
119
- if (!v || !u.altKey || u.metaKey || u.ctrlKey || u.shiftKey || u.defaultPrevented || !o || i.length !== 1 || l.current || Ze(u.target) || document.querySelector('[data-radix-popper-content-wrapper], [role="menu"]')) return;
119
+ const v = Xr[u.key];
120
+ if (!v || !u.altKey || u.metaKey || u.ctrlKey || u.shiftKey || u.defaultPrevented || !o || i.length !== 1 || l.current || Qe(u.target) || document.querySelector('[data-radix-popper-content-wrapper], [role="menu"]')) return;
120
121
  u.preventDefault();
121
- const p = Jr(o, i[0], v);
122
+ const p = en(o, i[0], v);
122
123
  if (!p) return;
123
124
  s(p.ops, { label: p.label }), m(p.next);
124
125
  const c = $(p.next);
@@ -133,9 +134,9 @@ function ca(o, i, s, l, m) {
133
134
  return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
134
135
  }, [o, i, s, l, m]);
135
136
  }
136
- function ua(o) {
137
+ function ma(o) {
137
138
  const i = o.status === "saving" || o.dirty;
138
- Uo(i, "Layout changes"), B(() => {
139
+ $o(i, "Layout changes"), B(() => {
139
140
  if (!i) return;
140
141
  const s = (l) => {
141
142
  o.flush(), l.preventDefault(), l.returnValue = "";
@@ -146,28 +147,28 @@ function ua(o) {
146
147
  return window.addEventListener("pagehide", s), () => window.removeEventListener("pagehide", s);
147
148
  }, [o.flush]);
148
149
  }
149
- function pa(o) {
150
- const i = xo(), s = Wt(o);
151
- return T(
150
+ function fa(o) {
151
+ const i = So(), s = Vt(o);
152
+ return L(
152
153
  (l, m) => {
153
154
  const d = Number(l.layout.id);
154
- Number.isFinite(d) && i.invalidateQueries({ queryKey: aa.versions(d) }), s({ lazy: !sa(m) });
155
+ Number.isFinite(d) && i.invalidateQueries({ queryKey: ia.versions(d) }), s({ lazy: !la(m) });
155
156
  },
156
157
  [i, s]
157
158
  );
158
159
  }
159
- function ma(o, i) {
160
- const s = Fo();
161
- return So({
160
+ function ha(o, i) {
161
+ const s = Ko();
162
+ return To({
162
163
  queryKey: ["layout-editor", "preview-record", o, i],
163
164
  queryFn: () => s.request(
164
- Ko(`/items/${encodeURIComponent(o)}/${encodeURIComponent(String(i))}`)
165
+ Mo(`/items/${encodeURIComponent(o)}/${encodeURIComponent(String(i))}`)
165
166
  ).then((l) => l.data ?? null),
166
167
  enabled: i != null,
167
168
  staleTime: 3e4
168
169
  });
169
170
  }
170
- function fa(o, i) {
171
+ function ya(o, i) {
171
172
  const s = z(i);
172
173
  s.current = i, B(() => {
173
174
  if (!o) return;
@@ -195,15 +196,15 @@ function fa(o, i) {
195
196
  return document.addEventListener("click", m, !0), () => document.removeEventListener("click", m, !0);
196
197
  }, [o]);
197
198
  }
198
- function je(o, i, s = null) {
199
+ function Ge(o, i, s = null) {
199
200
  const l = (m) => {
200
- if (o.kind === "group") return o.key === Mo || m.groups.some((u) => u.key === o.key);
201
- const d = o.kind === "header" ? zt : o.group_key;
201
+ if (o.kind === "group") return o.key === _o || m.groups.some((u) => u.key === o.key);
202
+ const d = o.kind === "header" ? $t : o.group_key;
202
203
  return m.placements.some((u) => u.field === o.field && u.group_key === d);
203
204
  };
204
205
  return l(i) || s != null && l(s);
205
206
  }
206
- function ha(o, i, s) {
207
+ function va(o, i, s) {
207
208
  const l = z(null), m = z(i);
208
209
  return m.current = i, B(() => {
209
210
  var v;
@@ -211,14 +212,14 @@ function ha(o, i, s) {
211
212
  const d = document.activeElement;
212
213
  (v = l.current) == null || v.focus();
213
214
  const u = (p) => {
214
- p.key !== "Escape" || p.defaultPrevented || s.current || Ze(p.target) || document.querySelector('[data-radix-popper-content-wrapper], [role="menu"]') || (p.preventDefault(), m.current());
215
+ p.key !== "Escape" || p.defaultPrevented || s.current || Qe(p.target) || document.querySelector('[data-radix-popper-content-wrapper], [role="menu"]') || (p.preventDefault(), m.current());
215
216
  };
216
217
  return document.addEventListener("keydown", u), () => {
217
218
  document.removeEventListener("keydown", u), d != null && d.isConnected && d.focus();
218
219
  };
219
220
  }, [o, s]), l;
220
221
  }
221
- function ya({
222
+ function ga({
222
223
  collection: o,
223
224
  bundle: i,
224
225
  parent: s,
@@ -231,8 +232,8 @@ function ya({
231
232
  deps: c,
232
233
  noDnd: g = !1,
233
234
  record: Z,
234
- selected: be,
235
- selection: we,
235
+ selected: we,
236
+ selection: be,
236
237
  onSelect: xe,
237
238
  showHidden: le,
238
239
  fold: n = null,
@@ -241,49 +242,49 @@ function ya({
241
242
  whenIdle: q,
242
243
  fillRate: re,
243
244
  unsaved: U,
244
- peers: N,
245
+ peers: A,
245
246
  compare: Q,
246
247
  lastChanges: ue
247
248
  }) {
248
- const Oe = kr(), pe = g ? br : Oe, b = Lr(String(i.layout.layout_type ?? "grouped")), W = (b === "item-edit-form" || b === "read-view") && (Q == null ? void 0 : Q.diff.bundle) || i, R = w(() => $t(W, s), [W, s]), V = w(
249
- () => s ? jr(i, s) : null,
249
+ const Pe = br(), pe = g ? xr : Pe, b = Cr(String(i.layout.layout_type ?? "grouped")), W = (b === "item-edit-form" || b === "read-view") && (Q == null ? void 0 : Q.diff.bundle) || i, O = w(() => Wt(W, s), [W, s]), V = w(
250
+ () => s ? Zr(i, s) : null,
250
251
  [i, s]
251
252
  ), Y = w(() => V != null && V.size ? (f) => {
252
253
  const K = V.get($(f)), C = (d == null ? void 0 : d(f)) ?? [];
253
- return K ? [...C, Gr(K)] : C;
254
- } : d, [V, d]), Le = w(
255
- () => nr(R.active, l, le),
256
- [R.active, l, le]
257
- ), { data: H = null } = $n(o, l), me = w(
258
- () => l ? ar(H) : void 0,
254
+ return K ? [...C, Qr(K)] : C;
255
+ } : d, [V, d]), Te = w(
256
+ () => sr(O.active, l, le),
257
+ [O.active, l, le]
258
+ ), { data: H = null } = Vn(o, l), me = w(
259
+ () => l ? ir(H) : void 0,
259
260
  [l, H]
260
- ), ne = w(() => Pr(i), [i]), Ne = w(
261
+ ), ne = w(() => Pr(i), [i]), Ae = w(
261
262
  () => Y && v ? (f) => [...Y(f), ...v(f)] : Y ?? v,
262
263
  [Y, v]
263
- ), de = Pn(i, Ne), L = Kn(de), J = zn(i, L.marks), A = w(
264
+ ), de = Pn(i, Ae), T = _n(de), J = Wn(i, T.marks), N = w(
264
265
  () => ({
265
- selected: be,
266
- selection: we,
266
+ selected: we,
267
+ selection: be,
267
268
  onSelect: xe,
268
269
  showHidden: le,
269
- inheritedFrom: (f) => R.inherited.get($(f)) ?? null,
270
+ inheritedFrom: (f) => O.inherited.get($(f)) ?? null,
270
271
  dnd: pe,
271
272
  roleMark: me,
272
273
  marks: J,
273
274
  overlay: u,
274
275
  fillRate: re,
275
276
  note: (f) => {
276
- const K = Rr(f);
277
+ const K = Ar(f);
277
278
  return K ? ne.get(K) ?? null : null;
278
279
  },
279
280
  fold: n,
280
281
  reveal: Se,
281
282
  unsaved: U,
282
- peers: N,
283
+ peers: A,
283
284
  diffMark: Q ? (f) => Q.diff.marks.get($(f)) ?? null : void 0,
284
285
  lastChange: ue ? (f) => f.kind === "group" ? ue[f.key] ?? null : null : void 0,
285
286
  ghost: p,
286
- locked: L.locked,
287
+ locked: T.locked,
287
288
  resizeWidth: g ? void 0 : (f, K) => {
288
289
  f.kind !== "field" && f.kind !== "slot" || t(
289
290
  [
@@ -293,16 +294,16 @@ function ya({
293
294
  patch: { col_span: K === 12 ? null : K }
294
295
  }
295
296
  ],
296
- { label: `Set the width to ${Wr[K] ?? K}` }
297
+ { label: `Set the width to ${Hr[K] ?? K}` }
297
298
  );
298
299
  }
299
300
  }),
300
301
  [
301
- be,
302
302
  we,
303
+ be,
303
304
  xe,
304
305
  le,
305
- R.inherited,
306
+ O.inherited,
306
307
  pe,
307
308
  me,
308
309
  J,
@@ -312,31 +313,31 @@ function ya({
312
313
  n,
313
314
  Se,
314
315
  U,
315
- N,
316
+ A,
316
317
  Q,
317
318
  ue,
318
319
  p,
319
- L.locked,
320
+ T.locked,
320
321
  t,
321
322
  g
322
323
  ]
323
- ), E = _r(c);
324
+ ), E = qr(c);
324
325
  return /* @__PURE__ */ r("div", { ref: E, className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ r(
325
- Tr,
326
+ Rr,
326
327
  {
327
328
  collection: o,
328
329
  bundle: W,
329
- layout: Le,
330
+ layout: Te,
330
331
  record: Z,
331
332
  stateKey: m,
332
333
  roleId: l,
333
- design: A,
334
+ design: N,
334
335
  apply: t,
335
336
  whenIdle: q
336
337
  }
337
338
  ) });
338
339
  }
339
- function va({
340
+ function ka({
340
341
  collection: o,
341
342
  name: i,
342
343
  row: s,
@@ -345,7 +346,7 @@ function va({
345
346
  fields: d,
346
347
  onDone: u
347
348
  }) {
348
- const v = kn(o, d, m), { data: p } = bn(o, s, m), c = oa(ra(l).data), g = s ? s.section === "forms" && (s.reason.kind === "default" || s.reason.kind === "fallback") ? [{ text: "used by every record no rule catches" }] : wn(s, d, v) : [];
349
+ const v = bn(o, d, m), { data: p } = xn(o, s, m), c = na(aa(l).data), g = s ? s.section === "forms" && (s.reason.kind === "default" || s.reason.kind === "fallback") ? [{ text: "used by every record no rule catches" }] : Sn(s, d, v) : [];
349
350
  return g.length > 0 && typeof p == "number" && g.push({ text: ` (≈ ${p.toLocaleString()} ${p === 1 ? "record" : "records"})` }), c && g.push({ text: g.length > 0 ? `; ${c}` : c }), /* @__PURE__ */ y(
350
351
  "div",
351
352
  {
@@ -357,7 +358,7 @@ function va({
357
358
  /* @__PURE__ */ r("b", { className: "font-semibold text-slate-900 dark:text-foreground", children: i }),
358
359
  g.length > 0 && /* @__PURE__ */ y(ie, { children: [
359
360
  " — ",
360
- /* @__PURE__ */ r(xn, { segs: g, muted: !0 })
361
+ /* @__PURE__ */ r(Tn, { segs: g, muted: !0 })
361
362
  ] })
362
363
  ] }),
363
364
  /* @__PURE__ */ r(
@@ -373,7 +374,7 @@ function va({
373
374
  }
374
375
  );
375
376
  }
376
- function ga({ view: o, onView: i }) {
377
+ function wa({ view: o, onView: i }) {
377
378
  const s = (l, m, d, u) => /* @__PURE__ */ y(
378
379
  "button",
379
380
  {
@@ -383,7 +384,7 @@ function ga({ view: o, onView: i }) {
383
384
  "data-editor-view": l,
384
385
  "data-tip": u,
385
386
  onClick: () => i(l),
386
- className: G(Cn(o === l), "inline-flex items-center justify-center gap-1"),
387
+ className: G(On(o === l), "inline-flex items-center justify-center gap-1"),
387
388
  children: [
388
389
  /* @__PURE__ */ r(d, { className: "h-3.5 w-3.5 shrink-0" }),
389
390
  /* @__PURE__ */ r("span", { "data-tb-xwide": "", children: m })
@@ -394,26 +395,26 @@ function ga({ view: o, onView: i }) {
394
395
  "fieldset",
395
396
  {
396
397
  "aria-label": "Show the form as",
397
- className: G("m-0 min-w-0 shrink-0 border-0", Tn(4)),
398
+ className: G("m-0 min-w-0 shrink-0 border-0", Rn(4)),
398
399
  children: [
399
400
  s("canvas", "Canvas", No, "The form as people see it"),
400
- s("table", "Table", Ao, "Every field as a row: label, section, width, rules"),
401
+ s("table", "Table", Eo, "Every field as a row: label, section, width, rules"),
401
402
  s(
402
403
  "states",
403
404
  "States",
404
- Eo,
405
+ Io,
405
406
  "Every field by workflow state: editable, read-only, required"
406
407
  ),
407
- s("roles", "Roles", Io, "Every section by role: can edit, read-only, hidden")
408
+ s("roles", "Roles", Do, "Every section by role: can edit, read-only, hidden")
408
409
  ]
409
410
  }
410
411
  );
411
412
  }
412
- const Ge = (o) => G(
413
+ const Ze = (o) => G(
413
414
  "inline-flex h-7 items-center gap-1 rounded-md px-2.5 text-[12px] font-medium transition-colors",
414
415
  o ? "bg-accent text-slate-900 dark:text-foreground" : "text-slate-500 hover:bg-muted hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground"
415
416
  );
416
- function ci({
417
+ function mi({
417
418
  collection: o,
418
419
  layoutId: i,
419
420
  onBack: s,
@@ -423,89 +424,92 @@ function ci({
423
424
  portalContainer: u,
424
425
  onDirtyChange: v
425
426
  }) {
426
- var Tt, Ct, Pt, Rt, Ot, Nt;
427
- const p = Hr(), [c, g] = O(i);
427
+ var Ct, Rt, Ot, Pt, At, Nt;
428
+ const p = Gr(), [c, g] = P(i);
428
429
  B(() => g(i), [i]);
429
- const Z = pa(o), { draft: be, recorder: we } = rr(na(c, { onSaved: Z })), { draft: xe, removed: le } = In(be, c), { draft: n, value: Se } = Fn(c, xe), t = n.bundle, [q, re] = O("layouts"), [U, N] = O("inspector"), [Q, ue] = Xo(), [Oe, pe] = O(null), [b, F] = O([]), W = b.length > 0 ? b[b.length - 1] : null, [R, V] = O("canvas"), [Y, Le] = O(!1), [H, me] = ea(), { data: ne } = ta(o, H), Ne = w(
430
+ const Z = fa(o), { draft: we, recorder: be } = ar(
431
+ // The record page's automatic Owners tile is listed like any header tile (Rob 2026-11-13).
432
+ sa(c, { onSaved: Z, autoOwnersTile: !0 })
433
+ ), { draft: xe, removed: le } = Fn(we, c), { draft: n, value: Se } = Mn(c, xe), t = n.bundle, [q, re] = P("layouts"), [U, A] = P("inspector"), [Q, ue] = tr(), [Pe, pe] = P(null), [b, F] = P([]), W = b.length > 0 ? b[b.length - 1] : null, [O, V] = P("canvas"), [Y, Te] = P(!1), [H, me] = oa(), { data: ne } = ra(o, H), Ae = w(
430
434
  () => H && ne && ne.total > 0 ? (e) => ne.pct.get(e) ?? null : void 0,
431
435
  [H, ne]
432
- ), de = Jn(c), [L, J] = O({
436
+ ), de = ea(c), [T, J] = P({
433
437
  record: d ? { id: d, label: `#${d}` } : null,
434
438
  roleId: null
435
- }), { data: A } = vn(o), { data: E = [] } = gn(o), f = A == null ? void 0 : A.rows.find((e) => e.layout_id === c), K = (t == null ? void 0 : t.layout.parent_layout_id) != null ? Number(t.layout.parent_layout_id) : null, { data: C = null } = He(K), { data: Vt = null } = ma(o, ((Tt = L.record) == null ? void 0 : Tt.id) ?? null), fe = w(
436
- () => t ? $t(t, C).active : null,
439
+ }), { data: N } = kn(o), { data: E = [] } = wn(o), f = N == null ? void 0 : N.rows.find((e) => e.layout_id === c), K = (t == null ? void 0 : t.layout.parent_layout_id) != null ? Number(t.layout.parent_layout_id) : null, { data: C = null } = je(K), { data: Ht = null } = ha(o, ((Ct = T.record) == null ? void 0 : Ct.id) ?? null), fe = w(
440
+ () => t ? Wt(t, C).active : null,
437
441
  [t, C]
438
442
  );
439
- zo(It);
440
- const Ht = w(() => $o(fe), [fe]), Te = rn(o, t, C), Qe = en(U === "checks"), { data: Ye } = He(c), X = sr(t, Ye ?? null, n.unsavedCount, c), { data: jt } = Vr(c, t != null), [Je, Gt] = O([]), Zt = w(() => {
441
- const e = Zo(Je), a = /* @__PURE__ */ new WeakMap();
443
+ Wo(Dt);
444
+ const jt = w(() => Vo(fe), [fe]), Le = an(o, t, C), Ye = on(U === "checks"), { data: Ne } = je(c), Je = w(() => Ne ? Uo(Ne) : null, [Ne]), X = lr(t, Je, n.unsavedCount, c), { data: Gt } = jr(c, t != null), [Xe, Zt] = P([]), Qt = w(() => {
445
+ const e = Yo(Xe), a = /* @__PURE__ */ new WeakMap();
442
446
  return (h) => {
443
- if (!h || !e) return Ft(h, e);
447
+ if (!h || !e) return Kt(h, e);
444
448
  const S = a.get(h);
445
449
  if (S) return S;
446
- const D = Ft(h, e);
450
+ const D = Kt(h, e);
447
451
  return a.set(h, D), D;
448
452
  };
449
- }, [Je]), [he, Qt] = Dr(), ee = qr(o, fe, he), ye = Ur(
453
+ }, [Xe]), [he, Yt] = Kr(), ee = zr(o, fe, he), ye = $r(
450
454
  o,
451
455
  fe,
452
- he && !L.record && !L.sample
453
- ), { data: ce } = He(c), te = _o(((Ct = ce == null ? void 0 : ce.layout) == null ? void 0 : Ct.conditions) ?? ((Pt = t == null ? void 0 : t.layout) == null ? void 0 : Pt.conditions)), I = Kt(ce == null ? void 0 : ce.layout) ?? Kt(t == null ? void 0 : t.layout) ?? (te ? "note" : null), [ve, Ae] = O({ reason: "", ticket: "" }), [Xe, et] = O(null), Ee = z(ve);
454
- Ee.current = ve;
455
- const tt = T(async () => {
456
+ he && !T.record && !T.sample
457
+ ), { data: ce } = je(c), te = Bo(((Rt = ce == null ? void 0 : ce.layout) == null ? void 0 : Rt.conditions) ?? ((Ot = t == null ? void 0 : t.layout) == null ? void 0 : Ot.conditions)), I = Mt(ce == null ? void 0 : ce.layout) ?? Mt(t == null ? void 0 : t.layout) ?? (te ? "note" : null), [ve, Ee] = P({ reason: "", ticket: "" }), [et, tt] = P(null), Ie = z(ve);
458
+ Ie.current = ve;
459
+ const ot = L(async () => {
456
460
  const e = I ? {
457
- ...lr(Ee.current),
458
- ...te ? { freeze_override: Ee.current.reason.trim() } : {}
461
+ ...cr(Ie.current),
462
+ ...te ? { freeze_override: Ie.current.reason.trim() } : {}
459
463
  } : void 0;
460
464
  await n.save(e);
461
465
  const a = n.unsavedOps().length === 0;
462
- return a && e && Ae((h) => ({ ...h, reason: "" })), a;
463
- }, [n.save, n.unsavedOps, I, te]), ot = T(() => {
466
+ return a && e && Ee((h) => ({ ...h, reason: "" })), a;
467
+ }, [n.save, n.unsavedOps, I, te]), rt = L(() => {
464
468
  var e, a;
465
- return I ? (n.unsavedOps().length > 0 && et(
469
+ return I ? (n.unsavedOps().length > 0 && tt(
466
470
  ((e = M.current) == null ? void 0 : e.querySelector("[data-editor-save]")) ?? ((a = M.current) == null ? void 0 : a.querySelector("[data-editor-topbar]")) ?? null
467
471
  ), Promise.resolve()) : n.save();
468
472
  }, [I, n.save, n.unsavedOps]);
469
473
  B(() => {
470
474
  I && n.autosave && n.setAutosave(!1);
471
475
  }, [I, n.autosave, n.setAutosave]);
472
- const Yt = I ? { ...n, save: ot, setAutosave: void 0 } : n;
473
- da(I ? { ...n, save: ot } : n), ua(n);
474
- const M = z(null), [Jt, rt] = O(null), nt = z(n.dirty);
475
- nt.current = n.dirty;
476
- const ae = T((e, a, h) => {
476
+ const Jt = I ? { ...n, save: rt, setAutosave: void 0 } : n;
477
+ ua(I ? { ...n, save: rt } : n), ma(n);
478
+ const M = z(null), [Xt, nt] = P(null), at = z(n.dirty);
479
+ at.current = n.dirty;
480
+ const ae = L((e, a, h) => {
477
481
  var D, ke;
478
- if (!nt.current) return a();
482
+ if (!at.current) return a();
479
483
  const S = ((D = M.current) == null ? void 0 : D.querySelector("[data-editor-save]")) ?? ((ke = M.current) == null ? void 0 : ke.querySelector("[data-editor-topbar]")) ?? null;
480
- rt({ what: e, go: a, anchor: h ?? S });
481
- }, []), Xt = tt;
482
- fa(n.dirty, (e, a) => ae("leave this page", e, a)), B(() => {
484
+ nt({ what: e, go: a, anchor: h ?? S });
485
+ }, []), eo = ot;
486
+ ya(n.dirty, (e, a) => ae("leave this page", e, a)), B(() => {
483
487
  v == null || v(n.dirty);
484
488
  }, [n.dirty, v]);
485
- const at = z(n.unsavedOps);
486
- at.current = n.unsavedOps, B(
489
+ const st = z(n.unsavedOps);
490
+ st.current = n.unsavedOps, B(
487
491
  () => () => {
488
- at.current().length > 0 && Et.warning("Unsaved form changes kept — open the form again to save or discard them");
492
+ st.current().length > 0 && It.warning("Unsaved form changes kept — open the form again to save or discard them");
489
493
  },
490
494
  []
491
495
  );
492
- const st = Wt(o), it = T(() => {
496
+ const it = Vt(o), lt = L(() => {
493
497
  const e = n.whenIdle();
494
- e.then(() => st()), s(e);
495
- }, [n.whenIdle, st, s]), Ie = T(
496
- (e) => ae(l === "overlay" ? "go back to the record" : "leave this form", it, e),
497
- [ae, it, l]
498
+ e.then(() => it()), s(e);
499
+ }, [n.whenIdle, it, s]), De = L(
500
+ (e) => ae(l === "overlay" ? "go back to the record" : "leave this form", lt, e),
501
+ [ae, lt, l]
498
502
  );
499
503
  B(() => {
500
504
  if (!t || b.length === 0) return;
501
- const e = b.filter((a) => je(a, t, C));
505
+ const e = b.filter((a) => Ge(a, t, C));
502
506
  e.length !== b.length && F(e);
503
507
  }, [b, t, C]);
504
- const se = l === "overlay", [De, eo] = O(null), Fe = z(!1), to = T((e) => {
505
- Fe.current = e;
506
- }, []), oo = ha(se && De != null, () => Ie(), Fe), P = T((e, a) => {
507
- F((h) => vr(h, e, a)), N("inspector");
508
- }, []), lt = T((e) => F([e]), []), _ = Or(t, n.apply), ro = w(() => _.intercept(P), [_.intercept, P]), [Ke, no] = O(!1), Me = Ar(), _e = w(
508
+ const se = l === "overlay", [Fe, to] = P(null), Ke = z(!1), oo = L((e) => {
509
+ Ke.current = e;
510
+ }, []), ro = va(se && Fe != null, () => De(), Ke), R = L((e, a) => {
511
+ F((h) => kr(h, e, a)), A("inspector");
512
+ }, []), dt = L((e) => F([e]), []), _ = Nr(t, n.apply), no = w(() => _.intercept(R), [_.intercept, R]), [Me, ao] = P(!1), _e = Ir(), Be = w(
509
513
  () => ({
510
514
  tabOrderActive: _.active,
511
515
  startTabOrder: () => {
@@ -513,11 +517,11 @@ function ci({
513
517
  }
514
518
  }),
515
519
  [_.active, _.start]
516
- ), dt = T(
520
+ ), ct = L(
517
521
  (e, a) => {
518
- if (e.kind === "group") return P({ kind: "group", key: e.key });
522
+ if (e.kind === "group") return R({ kind: "group", key: e.key });
519
523
  if (e.kind === "tab") {
520
- P(a), (a.kind === "field" || a.kind === "header") && Qr(a.field, e.tab);
524
+ R(a), (a.kind === "field" || a.kind === "header") && Jr(a.field, e.tab);
521
525
  return;
522
526
  }
523
527
  if (e.kind === "pipeline")
@@ -530,72 +534,72 @@ function ci({
530
534
  () => p.navigate(`/data-model/${encodeURIComponent(o)}?tab=rules`)
531
535
  );
532
536
  },
533
- [P, ae, p, o]
534
- ), ao = w(() => {
537
+ [R, ae, p, o]
538
+ ), so = w(() => {
535
539
  const e = /* @__PURE__ */ new Map();
536
540
  for (const [a, h] of ye)
537
541
  (h.type === "boolean" || h.text.endsWith(" linked")) && e.set(a, h.text);
538
- return Fr(ee, { chips: he, ghostTags: e, open: dt });
539
- }, [ee, he, ye, dt]), so = w(
542
+ return Mr(ee, { chips: he, ghostTags: e, open: ct });
543
+ }, [ee, he, ye, ct]), io = w(
540
544
  () => ye.size > 0 ? (e) => {
541
545
  var a;
542
546
  return ((a = ye.get(e)) == null ? void 0 : a.text) ?? null;
543
547
  } : void 0,
544
548
  [ye]
545
- ), io = T(
549
+ ), lo = L(
546
550
  (e) => {
547
551
  const a = t == null ? void 0 : t.placements.find((S) => S.field === e);
548
552
  if (!a) return;
549
- const h = a.group_key === zt ? { kind: "header", field: e } : { kind: "field", field: e, group_key: a.group_key };
550
- P(h), requestAnimationFrame(
553
+ const h = a.group_key === $t ? { kind: "header", field: e } : { kind: "field", field: e, group_key: a.group_key };
554
+ R(h), requestAnimationFrame(
551
555
  () => {
552
556
  var S, D;
553
557
  return (D = (S = document.querySelector(`[data-layout-editor] [data-design-target="${CSS.escape($(h))}"]`)) == null ? void 0 : S.scrollIntoView) == null ? void 0 : D.call(S, { block: "center" });
554
558
  }
555
559
  );
556
560
  },
557
- [t, P]
561
+ [t, R]
558
562
  );
559
- ca(t, b, n.apply, Fe, lt);
560
- const lo = T(
561
- (e) => Br(e, ee.describe),
563
+ pa(t, b, n.apply, Ke, dt);
564
+ const co = L(
565
+ (e) => Ur(e, ee.describe),
562
566
  [ee.describe]
563
- ), co = wr(o, ee.deps, lo, ee.groupLabel), uo = w(
567
+ ), uo = Sr(o, ee.deps, co, ee.groupLabel), po = w(
564
568
  () => ({ run: n.undo, label: n.undoLabel }),
565
569
  [n.undo, n.undoLabel]
566
- ), Be = Rn(c, W ? $(W) : null), ct = w(() => On(Be), [Be]), po = T(
567
- (e) => (ct.get($(e)) ?? []).map((a) => ({
570
+ ), qe = An(c, W ? $(W) : null), ut = w(() => Nn(qe), [qe]), mo = L(
571
+ (e) => (ut.get($(e)) ?? []).map((a) => ({
568
572
  id: a.id,
569
573
  name: a.name,
570
574
  outline: a.tone.outline,
571
575
  chip: a.tone.chip
572
576
  })),
573
- [ct]
574
- ), ut = w(() => Yn(n.unsavedSteps), [n.unsavedSteps]), mo = T((e) => ut.has($(e)), [ut]), [pt, Ce] = O(null), mt = T((e) => {
575
- V("canvas"), F([e]), N("inspector"), requestAnimationFrame(() => {
577
+ [ut]
578
+ ), pt = w(() => Xn(n.unsavedSteps), [n.unsavedSteps]), fo = L((e) => pt.has($(e)), [pt]), [mt, Ce] = P(null), ft = L((e) => {
579
+ V("canvas"), F([e]), A("inspector"), requestAnimationFrame(() => {
576
580
  var h;
577
581
  const a = document.querySelector(
578
582
  `[data-layout-editor] [data-design-target="${CSS.escape($(e))}"]`
579
583
  );
580
584
  (h = a == null ? void 0 : a.scrollIntoView) == null || h.call(a, { block: "center" }), a == null || a.focus({ preventScroll: !0 });
581
585
  });
582
- }, []), fo = qo(), j = Vn(c), ft = Hn(), ho = w(
586
+ }, []), ho = zo(), j = jn(c), ht = Gn(), yo = w(
583
587
  () => {
584
588
  var e, a;
585
589
  return {
586
590
  settled: j.isFetched || j.isError,
587
591
  draft: ((e = j.data) == null ? void 0 : e.data) ?? null,
588
592
  available: ((a = j.data) == null ? void 0 : a.available) ?? !j.isError,
589
- writer: ft
593
+ writer: ht
590
594
  };
591
595
  },
592
- [j.isFetched, j.isError, j.data, ft]
593
- ), Pe = xr(n, c, fo, ho), yo = T(
596
+ [j.isFetched, j.isError, j.data, ht]
597
+ ), Re = Tr(n, c, ho, yo), vo = L(
594
598
  (e) => J((a) => a.roleId === e ? a : { ...a, roleId: e }),
595
599
  []
596
600
  ), oe = (e) => {
597
601
  var S;
598
- if (N("inspector"), e === c) return;
602
+ if (A("inspector"), e === c) return;
599
603
  const a = document.activeElement, h = a instanceof HTMLElement && ((S = M.current) != null && S.contains(a)) ? a : null;
600
604
  ae(
601
605
  "open another form",
@@ -604,30 +608,30 @@ function ci({
604
608
  },
605
609
  h
606
610
  );
607
- }, vo = _n(o, t, (A == null ? void 0 : A.rows) ?? [], oe), go = T(
608
- (e) => t ? er(e, {
611
+ }, go = qn(o, t, (N == null ? void 0 : N.rows) ?? [], oe), ko = L(
612
+ (e) => t ? or(e, {
609
613
  bundle: t,
610
614
  selection: b,
611
615
  select: (a) => {
612
- F([a]), N("inspector");
616
+ F([a]), A("inspector");
613
617
  },
614
- openSettings: () => N("settings"),
618
+ openSettings: () => A("settings"),
615
619
  openAddPanel: () => re("add"),
616
620
  root: M.current
617
621
  }) : Promise.resolve({ ok: !1, message: "The form is still loading" }),
618
622
  [t, b]
619
- ), ht = z(oe);
620
- ht.current = oe;
621
- const ko = T(
623
+ ), yt = z(oe);
624
+ yt.current = oe;
625
+ const wo = L(
622
626
  (e) => {
623
627
  if (e.kind === "record")
624
628
  J((a) => ({ ...a, record: { id: e.id, label: `#${e.id}` }, sample: null }));
625
- else if (e.kind === "layout") ht.current(e.id);
629
+ else if (e.kind === "layout") yt.current(e.id);
626
630
  else {
627
631
  const a = t == null ? void 0 : t.placements.find((S) => S.field === e.field);
628
- if (!a) return Et.info(`${e.label} is not on this form`);
632
+ if (!a) return It.info(`${e.label} is not on this form`);
629
633
  const h = { kind: "field", field: a.field, group_key: a.group_key };
630
- P(h), requestAnimationFrame(
634
+ R(h), requestAnimationFrame(
631
635
  () => {
632
636
  var S, D, ke;
633
637
  return (ke = (D = (S = M.current) == null ? void 0 : S.querySelector(`[data-design-target="${CSS.escape($(h))}"]`)) == null ? void 0 : D.scrollIntoView) == null ? void 0 : ke.call(D, { block: "center" });
@@ -635,32 +639,32 @@ function ci({
635
639
  );
636
640
  }
637
641
  },
638
- [t, P]
639
- ), ge = String((t == null ? void 0 : t.layout.name) ?? (f == null ? void 0 : f.name) ?? ""), qe = String((t == null ? void 0 : t.layout.layout_type) ?? (f == null ? void 0 : f.layout_type) ?? "grouped"), k = qe !== "table" && qe !== "file", x = pn({
642
+ [t, R]
643
+ ), ge = String((t == null ? void 0 : t.layout.name) ?? (f == null ? void 0 : f.name) ?? ""), Ue = String((t == null ? void 0 : t.layout.layout_type) ?? (f == null ? void 0 : f.layout_type) ?? "grouped"), k = Ue !== "table" && Ue !== "file", x = fn({
640
644
  bodyRef: M,
641
645
  bundle: t,
642
646
  parent: C,
643
647
  fields: E,
644
- onSelect: P,
648
+ onSelect: R,
645
649
  showHidden: Y,
646
- setShowHidden: Le,
647
- canvasShown: !(k && R === "table")
648
- }), yt = x.outlineOpen && !!t && k, vt = z(null), Ue = fn(x.zoom, x.compact), { zoom: gt, setZoom: ze, compact: kt } = x, bt = En(
649
- L.device,
650
- L.roleId && L.compareRoleId ? 2 : 1
651
- ), wt = w(
650
+ setShowHidden: Te,
651
+ canvasShown: !(k && O === "table")
652
+ }), vt = x.outlineOpen && !!t && k, gt = z(null), ze = yn(x.zoom, x.compact), { zoom: kt, setZoom: $e, compact: wt } = x, bt = Dn(
653
+ T.device,
654
+ T.roleId && T.compareRoleId ? 2 : 1
655
+ ), xt = w(
652
656
  () => ({
653
- value: gt,
654
- onChange: ze,
657
+ value: kt,
658
+ onChange: $e,
655
659
  onFit: () => {
656
660
  var e;
657
- return ze(mn(((e = vt.current) == null ? void 0 : e.clientWidth) ?? 0, bt, kt));
661
+ return $e(hn(((e = gt.current) == null ? void 0 : e.clientWidth) ?? 0, bt, wt));
658
662
  }
659
663
  }),
660
- [gt, ze, kt, bt]
661
- ), xt = p.warning ?? (A == null ? void 0 : A.warning) ?? null, $e = Ln({
664
+ [kt, $e, wt, bt]
665
+ ), St = p.warning ?? (N == null ? void 0 : N.warning) ?? null, We = Cn({
662
666
  bundle: t,
663
- savedBundle: Ye ?? null,
667
+ savedBundle: Je ?? null,
664
668
  collection: o,
665
669
  layoutId: c,
666
670
  layoutName: ge,
@@ -674,11 +678,11 @@ function ci({
674
678
  "aria-modal": !0,
675
679
  "aria-label": `Edit form ${ge}`,
676
680
  tabIndex: -1
677
- } : {}, wo = /* @__PURE__ */ y(
681
+ } : {}, xo = /* @__PURE__ */ y(
678
682
  "div",
679
683
  {
680
684
  ref: (e) => {
681
- M.current = e, se && (oo.current = e);
685
+ M.current = e, se && (ro.current = e);
682
686
  },
683
687
  "data-layout-editor": "",
684
688
  "data-mode": l,
@@ -689,63 +693,63 @@ function ci({
689
693
  ),
690
694
  children: [
691
695
  /* @__PURE__ */ r(
692
- Cr,
696
+ Or,
693
697
  {
694
698
  collection: o,
695
699
  layoutId: c,
696
700
  layoutName: ge,
697
- layoutType: qe,
701
+ layoutType: Ue,
698
702
  row: f,
699
703
  fields: E,
700
- draft: Yt,
701
- preview: L,
704
+ draft: Jt,
705
+ preview: T,
702
706
  onPreview: J,
703
707
  showHidden: Y,
704
- onShowHidden: Le,
705
- onBack: Ie,
708
+ onShowHidden: Te,
709
+ onBack: De,
706
710
  backLabel: se ? "Back to record" : "Forms",
707
711
  onShowOnCanvas: X.showVersion,
708
712
  onReviewChanges: X.toggleReview,
709
- reviewing: ((Rt = X.compare) == null ? void 0 : Rt.kind) === "unsaved",
713
+ reviewing: ((Pt = X.compare) == null ? void 0 : Pt.kind) === "unsaved",
710
714
  onOpenUnsaved: Ce,
711
- pendingTip: Sr(Pe.sync),
715
+ pendingTip: Lr(Re.sync),
712
716
  presence: /* @__PURE__ */ y(ie, { children: [
713
717
  /* @__PURE__ */ r(
714
- pr,
718
+ fr,
715
719
  {
716
- peers: Be,
720
+ peers: qe,
717
721
  describe: (e) => {
718
- const a = Bt(e);
719
- return a && t && je(a, t, C) ? qt(a, t, E) : null;
722
+ const a = qt(e);
723
+ return a && t && Ge(a, t, C) ? Ut(a, t, E) : null;
720
724
  },
721
725
  onJump: (e) => {
722
- const a = Bt(e);
723
- a && mt(a);
726
+ const a = qt(e);
727
+ a && ft(a);
724
728
  }
725
729
  }
726
730
  ),
727
- /* @__PURE__ */ r(qn, { others: ((Ot = j.data) == null ? void 0 : Ot.others) ?? [] })
731
+ /* @__PURE__ */ r(zn, { others: ((At = j.data) == null ? void 0 : At.others) ?? [] })
728
732
  ] }),
729
733
  onSelectField: (e) => {
730
734
  var a;
731
- return P({
735
+ return R({
732
736
  kind: "field",
733
737
  field: e,
734
738
  group_key: ((a = t == null ? void 0 : t.placements.find((h) => h.field === e)) == null ? void 0 : a.group_key) ?? null
735
739
  });
736
740
  },
737
741
  view: t && k ? /* @__PURE__ */ y(ie, { children: [
738
- /* @__PURE__ */ r(ga, { view: R, onView: V }),
739
- /* @__PURE__ */ r(Kr, { on: he, onChange: Qt })
742
+ /* @__PURE__ */ r(wa, { view: O, onView: V }),
743
+ /* @__PURE__ */ r(_r, { on: he, onChange: Yt })
740
744
  ] }) : null,
741
745
  tools: /* @__PURE__ */ y(ie, { children: [
742
- t && k && /* @__PURE__ */ r(jo, { bundle: t, apply: n.apply }),
743
- t && /* @__PURE__ */ r(sn, { find: x.find }),
744
- t && k && /* @__PURE__ */ r(zr, { bundle: t, apply: n.apply, collection: o }),
745
- t && k && /* @__PURE__ */ r(yn, { bundle: t, apply: n.apply, collection: o }),
746
- /* @__PURE__ */ r(Re, {}),
746
+ t && k && /* @__PURE__ */ r(Zo, { bundle: t, apply: n.apply }),
747
+ t && /* @__PURE__ */ r(dn, { find: x.find }),
748
+ t && k && /* @__PURE__ */ r(Wr, { bundle: t, apply: n.apply, collection: o }),
749
+ t && k && /* @__PURE__ */ r(gn, { bundle: t, apply: n.apply, collection: o }),
750
+ /* @__PURE__ */ r(Oe, {}),
747
751
  t && /* @__PURE__ */ r(
748
- ln,
752
+ cn,
749
753
  {
750
754
  outline: k ? {
751
755
  open: x.outlineOpen,
@@ -754,19 +758,19 @@ function ci({
754
758
  }
755
759
  ),
756
760
  t && /* @__PURE__ */ r(
757
- dn,
761
+ un,
758
762
  {
759
- view: k && R === "canvas" ? {
763
+ view: k && O === "canvas" ? {
760
764
  compact: x.compact,
761
765
  onCompact: x.setCompact,
762
766
  onExpandAll: x.expandAll,
763
767
  onCollapseAll: x.collapseAll,
764
- zoom: wt
768
+ zoom: xt
765
769
  } : null
766
770
  }
767
771
  ),
768
772
  t && k && /* @__PURE__ */ r(
769
- Ve,
773
+ He,
770
774
  {
771
775
  label: "Show how full each field is",
772
776
  icon: /* @__PURE__ */ r(Lo, { className: "h-3.5 w-3.5" }),
@@ -777,10 +781,10 @@ function ci({
777
781
  }
778
782
  ),
779
783
  t && k && /* @__PURE__ */ r(
780
- Ve,
784
+ He,
781
785
  {
782
786
  label: "Show where saves fail",
783
- icon: /* @__PURE__ */ r(To, { className: "h-3.5 w-3.5" }),
787
+ icon: /* @__PURE__ */ r(Co, { className: "h-3.5 w-3.5" }),
784
788
  hint: "Tint each field by how often a save is refused on it",
785
789
  checked: de.on,
786
790
  onClick: () => de.setOn(!de.on),
@@ -788,42 +792,42 @@ function ci({
788
792
  }
789
793
  ),
790
794
  t && k && /* @__PURE__ */ r(
791
- Ve,
795
+ He,
792
796
  {
793
797
  label: "Set the tab order",
794
- icon: /* @__PURE__ */ r(Co, { className: "h-3.5 w-3.5" }),
798
+ icon: /* @__PURE__ */ r(Ro, { className: "h-3.5 w-3.5" }),
795
799
  hint: "Click fields in the order Tab should visit them",
796
800
  checked: _.active,
797
- onClick: () => _.active ? _.cancel() : _e.startTabOrder(),
801
+ onClick: () => _.active ? _.cancel() : Be.startTabOrder(),
798
802
  data: { "data-editor-tab-order-toggle": "" }
799
803
  }
800
804
  ),
801
805
  t && k && /* @__PURE__ */ r(
802
- Er,
806
+ Dr,
803
807
  {
804
- on: Ke,
805
- onChange: no,
806
- appDark: Me,
807
- disabled: R !== "canvas"
808
+ on: Me,
809
+ onChange: ao,
810
+ appDark: _e,
811
+ disabled: O !== "canvas"
808
812
  }
809
813
  ),
810
- /* @__PURE__ */ r(Re, {}),
814
+ /* @__PURE__ */ r(Oe, {}),
811
815
  /* @__PURE__ */ r(
812
- or,
816
+ nr,
813
817
  {
814
818
  collection: o,
815
819
  layoutId: c,
816
820
  dirty: n.dirty,
817
- recorder: we
821
+ recorder: be
818
822
  }
819
823
  ),
820
- /* @__PURE__ */ r($r, { bundle: t, collection: o }),
821
- /* @__PURE__ */ r(Re, {}),
822
- t && /* @__PURE__ */ r(cn, { shortcuts: x.shortcuts })
824
+ /* @__PURE__ */ r(Vr, { bundle: t, collection: o }),
825
+ /* @__PURE__ */ r(Oe, {}),
826
+ t && /* @__PURE__ */ r(pn, { shortcuts: x.shortcuts })
823
827
  ] }),
824
828
  ai: /* @__PURE__ */ y(ie, { children: [
825
829
  t && k && /* @__PURE__ */ r(
826
- Qo,
830
+ Jo,
827
831
  {
828
832
  collection: o,
829
833
  layoutId: c,
@@ -832,30 +836,30 @@ function ci({
832
836
  }
833
837
  ),
834
838
  t && /* @__PURE__ */ r(
835
- Go,
839
+ Qo,
836
840
  {
837
841
  collection: o,
838
842
  layoutId: c,
839
843
  bundle: t,
840
844
  apply: n.apply,
841
- previewRecordShown: L.record != null,
842
- onPins: Gt,
843
- onSelect: P
845
+ previewRecordShown: T.record != null,
846
+ onPins: Zt,
847
+ onSelect: R
844
848
  }
845
849
  ),
846
- /* @__PURE__ */ r(Re, {}),
850
+ /* @__PURE__ */ r(Oe, {}),
847
851
  t && p.isAdmin && /* @__PURE__ */ r(
848
- Yo,
852
+ Xo,
849
853
  {
850
854
  active: U === "ask",
851
- onClick: () => N((e) => e === "ask" ? "inspector" : "ask")
855
+ onClick: () => A((e) => e === "ask" ? "inspector" : "ask")
852
856
  }
853
857
  ),
854
- /* @__PURE__ */ r(yr, { collection: o, layoutId: c, draft: n }),
855
- t && /* @__PURE__ */ r(tr, { layoutId: c, draft: n })
858
+ /* @__PURE__ */ r(gr, { collection: o, layoutId: c, draft: n }),
859
+ t && /* @__PURE__ */ r(rr, { layoutId: c, draft: n })
856
860
  ] }),
857
861
  testing: t ? /* @__PURE__ */ r(
858
- Gn,
862
+ Qn,
859
863
  {
860
864
  collection: o,
861
865
  layoutId: c,
@@ -867,7 +871,7 @@ function ci({
867
871
  }
868
872
  ) : null,
869
873
  beforeSave: t ? /* @__PURE__ */ r(
870
- jn,
874
+ Zn,
871
875
  {
872
876
  collection: o,
873
877
  layoutId: c,
@@ -880,46 +884,46 @@ function ci({
880
884
  ) : null,
881
885
  previewExtra: /* @__PURE__ */ y(ie, { children: [
882
886
  /* @__PURE__ */ r(
883
- Nn,
887
+ En,
884
888
  {
885
889
  collection: o,
886
- value: L,
890
+ value: T,
887
891
  onChange: J,
888
892
  layout: fe,
889
893
  fields: E
890
894
  }
891
895
  ),
892
- /* @__PURE__ */ r(Wo, { scope: It, options: Ht })
896
+ /* @__PURE__ */ r(Ho, { scope: Dt, options: jt })
893
897
  ] }),
894
898
  problems: t && /* @__PURE__ */ r(
895
- tn,
899
+ rn,
896
900
  {
897
- findings: Te.findings,
901
+ findings: Le.findings,
898
902
  active: U === "checks",
899
- onClick: () => N((e) => e === "checks" ? "inspector" : "checks")
903
+ onClick: () => A((e) => e === "checks" ? "inspector" : "checks")
900
904
  }
901
905
  ),
902
906
  more: /* @__PURE__ */ r(
903
- Dn,
907
+ Kn,
904
908
  {
905
909
  collection: o,
906
910
  bundle: t,
907
- previewRecord: L.record,
911
+ previewRecord: T.record,
908
912
  onOpenLayout: oe
909
913
  }
910
914
  )
911
915
  }
912
916
  ),
913
917
  se && /* @__PURE__ */ r(
914
- va,
918
+ ka,
915
919
  {
916
920
  collection: o,
917
921
  layoutId: c,
918
922
  name: ge,
919
923
  row: f,
920
- rows: (A == null ? void 0 : A.rows) ?? [],
924
+ rows: (N == null ? void 0 : N.rows) ?? [],
921
925
  fields: E,
922
- onDone: Ie
926
+ onDone: De
923
927
  }
924
928
  ),
925
929
  n.status === "conflict" && n.dirty && /* @__PURE__ */ y(
@@ -929,10 +933,10 @@ function ci({
929
933
  "data-unsaved-conflict": "",
930
934
  className: G(
931
935
  "flex shrink-0 items-center gap-3 border-b px-4 py-1.5 text-[12.5px]",
932
- We
936
+ Ve
933
937
  ),
934
938
  children: [
935
- /* @__PURE__ */ r(At, { className: "h-3.5 w-3.5 shrink-0" }),
939
+ /* @__PURE__ */ r(Et, { className: "h-3.5 w-3.5 shrink-0" }),
936
940
  /* @__PURE__ */ y("p", { className: "m-0 min-w-0 flex-1", children: [
937
941
  n.error ?? "Someone else saved this form",
938
942
  ". Save again to try once more, or reload their version."
@@ -946,7 +950,7 @@ function ci({
946
950
  className: "inline-flex h-7 shrink-0 items-center rounded-md border border-amber-300 px-2.5 text-[12px] font-medium hover:bg-amber-100 dark:border-amber-500/40 dark:hover:bg-amber-500/15",
947
951
  children: [
948
952
  "Reload (discard my ",
949
- Zn(n.unsavedCount),
953
+ Yn(n.unsavedCount),
950
954
  ")"
951
955
  ]
952
956
  }
@@ -954,26 +958,26 @@ function ci({
954
958
  ]
955
959
  }
956
960
  ),
957
- /* @__PURE__ */ r(mr, { labels: n.dropped, onDismiss: n.clearDropped }),
961
+ /* @__PURE__ */ r(hr, { labels: n.dropped, onDismiss: n.clearDropped }),
958
962
  /* @__PURE__ */ r(
959
- fr,
963
+ yr,
960
964
  {
961
- state: Pe.state,
962
- onRecover: Pe.recover,
963
- onDismiss: Pe.dismiss
965
+ state: Re.state,
966
+ onRecover: Re.recover,
967
+ onDismiss: Re.dismiss
964
968
  }
965
969
  ),
966
- xt && /* @__PURE__ */ y(
970
+ St && /* @__PURE__ */ y(
967
971
  "div",
968
972
  {
969
973
  role: "note",
970
974
  className: G(
971
975
  "flex shrink-0 items-center gap-2 border-b px-4 py-1.5 text-[12.5px]",
972
- We
976
+ Ve
973
977
  ),
974
978
  children: [
975
- /* @__PURE__ */ r(At, { className: "h-3.5 w-3.5 shrink-0" }),
976
- xt
979
+ /* @__PURE__ */ r(Et, { className: "h-3.5 w-3.5 shrink-0" }),
980
+ St
977
981
  ]
978
982
  }
979
983
  ),
@@ -984,32 +988,32 @@ function ci({
984
988
  "data-editor-frozen": te.until,
985
989
  className: G(
986
990
  "flex shrink-0 items-center gap-2 border-b px-4 py-1.5 text-[12.5px]",
987
- We
991
+ Ve
988
992
  ),
989
993
  children: [
990
- /* @__PURE__ */ r(Po, { className: "h-3.5 w-3.5 shrink-0" }),
991
- Ut(te)
994
+ /* @__PURE__ */ r(Oo, { className: "h-3.5 w-3.5 shrink-0" }),
995
+ zt(te)
992
996
  ]
993
997
  }
994
998
  ),
995
- /* @__PURE__ */ r(Mr, { explain: ee, onShow: io }),
999
+ /* @__PURE__ */ r(Br, { explain: ee, onShow: lo }),
996
1000
  /* @__PURE__ */ r(
997
- gr,
1001
+ wr,
998
1002
  {
999
1003
  bundle: t,
1000
1004
  apply: n.apply,
1001
- onDragActive: to,
1002
- onDropOnLayout: vo,
1005
+ onDragActive: oo,
1006
+ onDropOnLayout: go,
1003
1007
  selection: b,
1004
- undo: uo,
1005
- warnTrash: co,
1008
+ undo: po,
1009
+ warnTrash: uo,
1006
1010
  children: /* @__PURE__ */ y("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
1007
1011
  /* @__PURE__ */ y(
1008
1012
  "aside",
1009
1013
  {
1010
1014
  className: G(
1011
1015
  "flex w-[260px] shrink-0 flex-col border-r border-slate-200 bg-white dark:border-border dark:bg-card",
1012
- yt && "hidden"
1016
+ vt && "hidden"
1013
1017
  ),
1014
1018
  children: [
1015
1019
  /* @__PURE__ */ y(
@@ -1026,7 +1030,7 @@ function ci({
1026
1030
  role: "tab",
1027
1031
  "aria-selected": q === "layouts",
1028
1032
  "data-editor-tab": "layouts",
1029
- className: Ge(q === "layouts"),
1033
+ className: Ze(q === "layouts"),
1030
1034
  onClick: () => re("layouts"),
1031
1035
  children: "Forms"
1032
1036
  }
@@ -1038,12 +1042,12 @@ function ci({
1038
1042
  role: "tab",
1039
1043
  "aria-selected": q === "add",
1040
1044
  "data-editor-tab": "add",
1041
- className: Ge(q === "add"),
1045
+ className: Ze(q === "add"),
1042
1046
  onClick: () => re("add"),
1043
1047
  disabled: !t,
1044
1048
  "data-tip": "Add a field, section, panel or widget after the selection",
1045
1049
  children: [
1046
- /* @__PURE__ */ r(Ro, { className: "h-3.5 w-3.5" }),
1050
+ /* @__PURE__ */ r(Po, { className: "h-3.5 w-3.5" }),
1047
1051
  "Add"
1048
1052
  ]
1049
1053
  }
@@ -1055,12 +1059,12 @@ function ci({
1055
1059
  role: "tab",
1056
1060
  "aria-selected": q === "usage",
1057
1061
  "data-editor-tab": "usage",
1058
- className: Ge(q === "usage"),
1062
+ className: Ze(q === "usage"),
1059
1063
  onClick: () => re("usage"),
1060
1064
  disabled: !t,
1061
1065
  "data-tip": "How this form is used and where it slows people down",
1062
1066
  children: [
1063
- /* @__PURE__ */ r(Oo, { className: "h-3.5 w-3.5" }),
1067
+ /* @__PURE__ */ r(Ao, { className: "h-3.5 w-3.5" }),
1064
1068
  "Usage"
1065
1069
  ]
1066
1070
  }
@@ -1069,17 +1073,17 @@ function ci({
1069
1073
  }
1070
1074
  ),
1071
1075
  /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 overflow-y-auto", children: q === "add" && t ? /* @__PURE__ */ r(
1072
- Ho,
1076
+ Go,
1073
1077
  {
1074
1078
  bundle: t,
1075
1079
  collection: o,
1076
1080
  selected: W,
1077
1081
  apply: n.apply,
1078
- onSelect: P,
1082
+ onSelect: R,
1079
1083
  removed: le.entries
1080
1084
  }
1081
1085
  ) : q === "usage" && t ? /* @__PURE__ */ r(
1082
- Xn,
1086
+ ta,
1083
1087
  {
1084
1088
  bundle: t,
1085
1089
  collection: o,
@@ -1090,128 +1094,128 @@ function ci({
1090
1094
  onOpenLayout: oe
1091
1095
  }
1092
1096
  ) : /* @__PURE__ */ r(
1093
- Xr,
1097
+ tn,
1094
1098
  {
1095
1099
  collection: o,
1096
1100
  currentId: c,
1097
1101
  onOpen: oe,
1098
1102
  settingsOpen: U === "settings",
1099
- onSettings: () => N("settings"),
1103
+ onSettings: () => A("settings"),
1100
1104
  dropTargets: !0
1101
1105
  }
1102
1106
  ) })
1103
1107
  ]
1104
1108
  }
1105
1109
  ),
1106
- yt && t && /* @__PURE__ */ r(
1110
+ vt && t && /* @__PURE__ */ r(
1107
1111
  "aside",
1108
1112
  {
1109
1113
  "data-editor-outline-panel": "",
1110
1114
  className: "flex w-[260px] shrink-0 flex-col border-r border-slate-200 bg-white dark:border-border dark:bg-card",
1111
1115
  children: /* @__PURE__ */ r(
1112
- un,
1116
+ mn,
1113
1117
  {
1114
1118
  bundle: t,
1115
1119
  nodes: x.nodes,
1116
1120
  selection: b,
1117
1121
  onPick: x.selectAndReveal,
1118
- onMoved: lt,
1122
+ onMoved: dt,
1119
1123
  apply: n.apply,
1120
1124
  onClose: () => x.setOutlineOpen(!1)
1121
1125
  }
1122
1126
  )
1123
1127
  }
1124
1128
  ),
1125
- /* @__PURE__ */ y("main", { ref: vt, className: "flex min-w-0 flex-1 flex-col overflow-y-auto", children: [
1126
- R === "canvas" && /* @__PURE__ */ r(Nr, { editor: _ }),
1127
- X.compare && (R === "canvas" || !k) && /* @__PURE__ */ r(ir, { compare: X.compare, onClose: X.close }),
1128
- t && k && R === "states" ? /* @__PURE__ */ r(
1129
- nn,
1129
+ /* @__PURE__ */ y("main", { ref: gt, className: "flex min-w-0 flex-1 flex-col overflow-y-auto", children: [
1130
+ O === "canvas" && /* @__PURE__ */ r(Er, { editor: _ }),
1131
+ X.compare && (O === "canvas" || !k) && /* @__PURE__ */ r(dr, { compare: X.compare, onClose: X.close }),
1132
+ t && k && O === "states" ? /* @__PURE__ */ r(
1133
+ sn,
1130
1134
  {
1131
1135
  bundle: t,
1132
1136
  parent: C,
1133
1137
  collection: o,
1134
1138
  apply: n.apply,
1135
- onSelect: P
1139
+ onSelect: R
1136
1140
  }
1137
- ) : t && k && R === "roles" ? /* @__PURE__ */ r(
1138
- an,
1141
+ ) : t && k && O === "roles" ? /* @__PURE__ */ r(
1142
+ ln,
1139
1143
  {
1140
1144
  bundle: t,
1141
1145
  parent: C,
1142
1146
  apply: n.apply,
1143
- onSelect: P
1147
+ onSelect: R
1144
1148
  }
1145
- ) : t && k && R === "table" ? /* @__PURE__ */ r(
1146
- Sn,
1149
+ ) : t && k && O === "table" ? /* @__PURE__ */ r(
1150
+ Ln,
1147
1151
  {
1148
1152
  bundle: t,
1149
1153
  collection: o,
1150
1154
  apply: n.apply,
1151
1155
  flush: n.flush,
1152
1156
  selection: b,
1153
- onSelect: P,
1157
+ onSelect: R,
1154
1158
  onSelection: F
1155
1159
  }
1156
1160
  ) : t ? /* @__PURE__ */ r(
1157
1161
  "div",
1158
1162
  {
1159
1163
  "data-canvas-density": x.compact && k ? "compact" : "normal",
1160
- "data-canvas-zoom": k ? Ue : void 0,
1161
- style: k && Ue !== 1 ? { zoom: Ue } : void 0,
1164
+ "data-canvas-zoom": k ? ze : void 0,
1165
+ style: k && ze !== 1 ? { zoom: ze } : void 0,
1162
1166
  className: G(
1163
1167
  "flex min-h-0 flex-1 flex-col",
1164
- Ir(Ke, Me),
1165
- Ke && !Me && "bg-background text-foreground"
1168
+ Fr(Me, _e),
1169
+ Me && !_e && "bg-background text-foreground"
1166
1170
  ),
1167
1171
  children: /* @__PURE__ */ r(
1168
- An,
1172
+ In,
1169
1173
  {
1170
1174
  collection: o,
1171
1175
  bundle: t,
1172
1176
  parent: C,
1173
- preview: L,
1177
+ preview: T,
1174
1178
  onPreview: J,
1175
- record: L.sample ?? Vt,
1179
+ record: T.sample ?? Ht,
1176
1180
  fields: E,
1177
1181
  renderPane: (e) => /* @__PURE__ */ r(
1178
- ya,
1182
+ ga,
1179
1183
  {
1180
1184
  collection: o,
1181
1185
  bundle: t,
1182
1186
  parent: C,
1183
1187
  roleId: e.roleId,
1184
1188
  stateKey: e.stateKey,
1185
- marks: Zt(e.marks),
1189
+ marks: Qt(e.marks),
1186
1190
  overlay: _.overlay(de.wrap(e.overlay)),
1187
- ruleMarks: ao,
1188
- ghost: so,
1191
+ ruleMarks: so,
1192
+ ghost: io,
1189
1193
  deps: ee.deps,
1190
1194
  noDnd: e.noDnd,
1191
1195
  record: e.record,
1192
1196
  selected: W,
1193
1197
  selection: b,
1194
- onSelect: ro,
1198
+ onSelect: no,
1195
1199
  showHidden: Y,
1196
1200
  fold: x.fold,
1197
1201
  reveal: x.reveal,
1198
1202
  apply: n.apply,
1199
1203
  whenIdle: n.whenIdle,
1200
- fillRate: Ne,
1201
- unsaved: mo,
1202
- peers: po,
1204
+ fillRate: Ae,
1205
+ unsaved: fo,
1206
+ peers: mo,
1203
1207
  compare: X.compare,
1204
- lastChanges: X.compare ? void 0 : jt
1208
+ lastChanges: X.compare ? void 0 : Gt
1205
1209
  }
1206
1210
  )
1207
1211
  }
1208
1212
  )
1209
1213
  }
1210
1214
  ) : n.error ? /* @__PURE__ */ r("p", { className: "p-6 text-[13px] text-red-700 dark:text-red-300", children: n.error }) : /* @__PURE__ */ y("div", { className: "flex flex-col gap-3 p-6", children: [
1211
- /* @__PURE__ */ r(Dt, { className: "h-10 w-full rounded-lg" }),
1212
- /* @__PURE__ */ r(Dt, { className: "h-48 w-full rounded-lg" })
1215
+ /* @__PURE__ */ r(Ft, { className: "h-10 w-full rounded-lg" }),
1216
+ /* @__PURE__ */ r(Ft, { className: "h-48 w-full rounded-lg" })
1213
1217
  ] }),
1214
- t && k && R === "canvas" && /* @__PURE__ */ r(hn, { zoom: wt })
1218
+ t && k && O === "canvas" && /* @__PURE__ */ r(vn, { zoom: xt })
1215
1219
  ] }),
1216
1220
  /* @__PURE__ */ r(
1217
1221
  "aside",
@@ -1219,47 +1223,47 @@ function ci({
1219
1223
  "data-editor-inspector": "",
1220
1224
  className: "flex w-[344px] shrink-0 flex-col overflow-hidden border-l border-slate-200 bg-white dark:border-border dark:bg-card",
1221
1225
  children: t && (U === "ask" ? /* @__PURE__ */ r(
1222
- Jo,
1226
+ er,
1223
1227
  {
1224
1228
  layoutId: c,
1225
1229
  layoutName: ge,
1226
- kind: Wn(t.layout),
1230
+ kind: Hn(t.layout),
1227
1231
  bundle: t,
1228
1232
  thread: Q,
1229
1233
  setThread: ue,
1230
- pending: Oe,
1234
+ pending: Pe,
1231
1235
  onPendingTaken: () => pe(null),
1232
- jump: go,
1233
- onCite: ko,
1234
- recordId: ((Nt = L.record) == null ? void 0 : Nt.id) ?? null
1236
+ jump: ko,
1237
+ onCite: wo,
1238
+ recordId: ((Nt = T.record) == null ? void 0 : Nt.id) ?? null
1235
1239
  }
1236
1240
  ) : U === "checks" ? /* @__PURE__ */ r(
1237
- on,
1241
+ nn,
1238
1242
  {
1239
- findings: Te.findings,
1240
- health: Te.health,
1241
- ready: Te.ready,
1243
+ findings: Le.findings,
1244
+ health: Le.health,
1245
+ ready: Le.ready,
1242
1246
  onSelect: (e) => F([e]),
1243
1247
  apply: n.apply,
1244
- onOpenAiReview: p.aiReviewSlot ? () => N("settings") : void 0,
1245
- onTurnOff: Qe.onTurnOff,
1246
- styleSettings: Qe.settings
1248
+ onOpenAiReview: p.aiReviewSlot ? () => A("settings") : void 0,
1249
+ onTurnOff: Ye.onTurnOff,
1250
+ styleSettings: Ye.settings
1247
1251
  }
1248
1252
  ) : U === "settings" ? /* @__PURE__ */ r(
1249
- ia,
1253
+ da,
1250
1254
  {
1251
1255
  bundle: t,
1252
1256
  apply: n.apply,
1253
1257
  flush: n.flush,
1254
1258
  collection: o,
1255
- previewRoleId: L.roleId,
1256
- onPreviewRoleChange: yo,
1259
+ previewRoleId: T.roleId,
1260
+ onPreviewRoleChange: vo,
1257
1261
  onAskWhere: p.isAdmin ? (e) => {
1258
- pe(e), N("ask");
1262
+ pe(e), A("ask");
1259
1263
  } : void 0
1260
1264
  }
1261
1265
  ) : b.length > 1 ? /* @__PURE__ */ r(
1262
- Zr,
1266
+ Yr,
1263
1267
  {
1264
1268
  bundle: t,
1265
1269
  selection: b,
@@ -1268,7 +1272,7 @@ function ci({
1268
1272
  onSelection: F
1269
1273
  }
1270
1274
  ) : /* @__PURE__ */ r(
1271
- la,
1275
+ ca,
1272
1276
  {
1273
1277
  bundle: t,
1274
1278
  target: W,
@@ -1285,86 +1289,86 @@ function ci({
1285
1289
  }
1286
1290
  ),
1287
1291
  /* @__PURE__ */ r(
1288
- Un,
1292
+ $n,
1289
1293
  {
1290
1294
  bundle: t,
1291
1295
  selection: b,
1292
1296
  apply: n.apply,
1293
1297
  onSelection: F,
1294
1298
  rootRef: M,
1295
- extraItems: $e.menuItems
1299
+ extraItems: We.menuItems
1296
1300
  }
1297
1301
  ),
1298
1302
  /* @__PURE__ */ r(
1299
- Bn,
1303
+ Un,
1300
1304
  {
1301
1305
  bundle: t,
1302
1306
  fields: E,
1303
1307
  apply: n.apply,
1304
- onSelect: P,
1308
+ onSelect: R,
1305
1309
  rootRef: M,
1306
- enabled: !(k && R !== "canvas")
1310
+ enabled: !(k && O !== "canvas")
1307
1311
  }
1308
1312
  ),
1309
1313
  /* @__PURE__ */ r(
1310
- Qn,
1314
+ Jn,
1311
1315
  {
1312
- request: Jt,
1316
+ request: Xt,
1313
1317
  count: n.unsavedCount,
1314
- onSave: Xt,
1318
+ onSave: eo,
1315
1319
  onDiscard: n.discard,
1316
- onKeep: () => rt(null),
1317
- note: I ? /* @__PURE__ */ r(cr, { policy: I, value: ve, onChange: Ae }) : void 0,
1318
- canSave: dr(I, ve)
1320
+ onKeep: () => nt(null),
1321
+ note: I ? /* @__PURE__ */ r(pr, { policy: I, value: ve, onChange: Ee }) : void 0,
1322
+ canSave: ur(I, ve)
1319
1323
  }
1320
1324
  ),
1321
- I && Xe && /* @__PURE__ */ r(
1322
- ur,
1325
+ I && et && /* @__PURE__ */ r(
1326
+ mr,
1323
1327
  {
1324
1328
  open: !0,
1325
- anchor: Xe,
1329
+ anchor: et,
1326
1330
  policy: I,
1327
- intro: te ? Ut(te) : void 0,
1331
+ intro: te ? zt(te) : void 0,
1328
1332
  count: n.unsavedCount,
1329
1333
  value: ve,
1330
- onChange: Ae,
1331
- onSave: tt,
1332
- onClose: () => et(null)
1334
+ onChange: Ee,
1335
+ onSave: ot,
1336
+ onClose: () => tt(null)
1333
1337
  }
1334
1338
  ),
1335
- pt && /* @__PURE__ */ r(
1336
- hr,
1339
+ mt && /* @__PURE__ */ r(
1340
+ vr,
1337
1341
  {
1338
- anchor: pt,
1342
+ anchor: mt,
1339
1343
  steps: n.unsavedSteps,
1340
- exists: (e) => !!t && je(e, t, C),
1341
- describe: (e) => qt(e, t, E),
1344
+ exists: (e) => !!t && Ge(e, t, C),
1345
+ describe: (e) => Ut(e, t, E),
1342
1346
  onJump: (e) => {
1343
- Ce(null), mt(e);
1347
+ Ce(null), ft(e);
1344
1348
  },
1345
1349
  onSettings: () => {
1346
- Ce(null), N("settings");
1350
+ Ce(null), A("settings");
1347
1351
  },
1348
1352
  onClose: () => Ce(null)
1349
1353
  }
1350
1354
  )
1351
1355
  ]
1352
1356
  }
1353
- ), St = /* @__PURE__ */ r(Mn, { value: Se, children: wo });
1357
+ ), Tt = /* @__PURE__ */ r(Bn, { value: Se, children: xo });
1354
1358
  if (!se)
1355
- return /* @__PURE__ */ r(Mt.Provider, { value: _e, children: /* @__PURE__ */ r(_t, { value: $e, children: St }) });
1356
- const Lt = u ?? (De ? Vo(De) ?? document.body : null);
1359
+ return /* @__PURE__ */ r(_t.Provider, { value: Be, children: /* @__PURE__ */ r(Bt, { value: We, children: Tt }) });
1360
+ const Lt = u ?? (Fe ? jo(Fe) ?? document.body : null);
1357
1361
  return /* @__PURE__ */ y(ie, { children: [
1358
- /* @__PURE__ */ r("span", { ref: eo, hidden: !0, "data-layout-editor-marker": "" }),
1359
- /* @__PURE__ */ r(Mt.Provider, { value: _e, children: /* @__PURE__ */ r(_t, { value: $e, children: Lt && Do(St, Lt) }) })
1362
+ /* @__PURE__ */ r("span", { ref: to, hidden: !0, "data-layout-editor-marker": "" }),
1363
+ /* @__PURE__ */ r(_t.Provider, { value: Be, children: /* @__PURE__ */ r(Bt, { value: We, children: Lt && Fo(Tt, Lt) }) })
1360
1364
  ] });
1361
1365
  }
1362
- function Ut(o) {
1366
+ function zt(o) {
1363
1367
  const i = o.reason.trim() ? `: ${o.reason.trim()}` : "";
1364
- return `Frozen until ${Bo(o.until)}${i}. Saving asks for an override note, kept in History.`;
1368
+ return `Frozen until ${qo(o.until)}${i}. Saving asks for an override note, kept in History.`;
1365
1369
  }
1366
1370
  export {
1367
- ci as LayoutEditor,
1368
- Ze as isTyping,
1369
- je as targetExists
1371
+ mi as LayoutEditor,
1372
+ Qe as isTyping,
1373
+ Ge as targetExists
1370
1374
  };