@nivaro/react 0.3.117 → 0.3.119

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 (138) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3757 -3695
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4451 -4385
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +135 -94
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +88 -85
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +245 -141
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +15 -16
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/addendum-view.js +6 -0
  73. package/dist/shared/components/item-edit/file-live.js +69 -54
  74. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  75. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  76. package/dist/shared/components/item-edit/removed-line.js +31 -25
  77. package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
  78. package/dist/shared/components/list/ListViewers.js +46 -35
  79. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  80. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  81. package/dist/shared/components/panels/AlertBanners.js +82 -72
  82. package/dist/shared/components/panels/BranchLanes.js +22 -22
  83. package/dist/shared/components/panels/CommentImages.js +123 -102
  84. package/dist/shared/components/panels/CommentPanel.js +186 -185
  85. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  86. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  87. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  88. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  89. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  90. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  91. package/dist/shared/components/profile/AgentNameField.js +107 -81
  92. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  93. package/dist/shared/components/profile/PersonAccess.js +599 -495
  94. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  95. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  96. package/dist/shared/components/profile/primitives.js +1 -1
  97. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  98. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  99. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  100. package/dist/shared/components/support/AssignRules.js +1733 -0
  101. package/dist/shared/components/support/PersonPick.js +88 -0
  102. package/dist/shared/components/support/RequestList.js +790 -0
  103. package/dist/shared/components/support/ScreenShare.js +158 -152
  104. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  105. package/dist/shared/components/support/SupportView.js +140 -246
  106. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  107. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  108. package/dist/shared/components/support/assign-rules-text.js +171 -0
  109. package/dist/shared/components/support/support-list.js +125 -0
  110. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  111. package/dist/shared/components/ui/checkbox.js +6 -6
  112. package/dist/shared/components/ui/select.js +43 -39
  113. package/dist/shared/components/ui/sheet.js +9 -9
  114. package/dist/shared/components/ui/switch.js +12 -11
  115. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  116. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  117. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  118. package/dist/shared/lib/activity-sentence.js +103 -91
  119. package/dist/shared/lib/agent-presence.js +27 -21
  120. package/dist/shared/lib/approval-progress.js +2 -2
  121. package/dist/shared/lib/copy-rules.js +31 -24
  122. package/dist/shared/lib/derived-causes.js +113 -78
  123. package/dist/shared/lib/grid-cursors.js +26 -26
  124. package/dist/shared/lib/label-flash.js +27 -0
  125. package/dist/shared/lib/list-return.js +137 -125
  126. package/dist/shared/lib/live-deltas.js +40 -34
  127. package/dist/shared/lib/live-groups.js +56 -52
  128. package/dist/shared/lib/live-preference.js +64 -59
  129. package/dist/shared/lib/live-screen.js +223 -192
  130. package/dist/shared/lib/partner-failure.js +11 -11
  131. package/dist/shared/lib/rollup-recalc.js +68 -64
  132. package/dist/shared/lib/screen-refresh.js +74 -68
  133. package/dist/shared/lib/screen-share.js +108 -104
  134. package/dist/shared/lib/send-status.js +77 -61
  135. package/dist/shared/lib/text-diff-window.js +29 -0
  136. package/dist/shared/lib/watch-list.js +210 -209
  137. package/dist/shared/lib/widget-image-render.js +72 -49
  138. package/package.json +1 -1
@@ -1,234 +1,338 @@
1
- import { jsx as v, jsxs as W } from "react/jsx-runtime";
2
- import { MoreHorizontal as N } from "lucide-react";
3
- import { useRef as b, useState as R, useEffect as _ } from "react";
4
- import { createPortal as L } from "react-dom";
5
- import { cn as y } from "../../lib/utils.js";
6
- function B(c, t) {
7
- const d = c.target;
8
- if (!(d != null && d.closest)) return !0;
9
- if (d.closest("[data-radix-popper-content-wrapper]")) return !1;
10
- const a = d.closest('[role="dialog"]');
11
- return !a || !!(t && a.contains(t));
1
+ import { jsx as w, jsxs as L } from "react/jsx-runtime";
2
+ import { MoreHorizontal as F } from "lucide-react";
3
+ import { useRef as m, useState as M, useEffect as R, useContext as K, createContext as U } from "react";
4
+ import { createPortal as P } from "react-dom";
5
+ import { cn as W } from "../../lib/utils.js";
6
+ function j(i, t) {
7
+ const s = i.target;
8
+ if (!(s != null && s.closest)) return !0;
9
+ if (s.closest("[data-radix-popper-content-wrapper]")) return !1;
10
+ const n = s.closest('[role="dialog"]');
11
+ return !n || !!(t && n.contains(t));
12
12
  }
13
- function D({ children: c }) {
14
- var g, x;
15
- const t = b(null), d = b(null), [a, i] = R(!1), u = b(!1);
16
- u.current = a;
17
- const n = b(0), o = b(0), [s, l] = R(!1);
18
- if (_(() => {
19
- var k, C;
20
- const e = (k = t.current) == null ? void 0 : k.closest("[data-nvr-header-row]");
13
+ const N = U(!0), q = '[role="dialog"],[role="alertdialog"]';
14
+ function J(i, t) {
15
+ return i instanceof Element ? (i.matches(q) ? [i] : Array.from(i.querySelectorAll(q))).some((n) => !n.closest("[data-radix-popper-content-wrapper]") && !t(n)) : !1;
16
+ }
17
+ const Q = 1500;
18
+ function G(i, t, s) {
19
+ const n = m(t);
20
+ n.current = t;
21
+ const p = m(s);
22
+ p.current = s, R(() => {
23
+ if (!i) return;
24
+ let f = 0;
25
+ const o = [], u = (a) => {
26
+ const c = a.target;
27
+ if (!(c != null && c.closest) || !p.current(c)) return;
28
+ const d = window.location.href, h = !!c.closest("a[href]");
29
+ f = Date.now() + Q;
30
+ const l = () => {
31
+ (h || window.location.href !== d) && n.current();
32
+ };
33
+ o.push(setTimeout(l, 0), setTimeout(l, 250));
34
+ }, r = typeof MutationObserver > "u" ? null : new MutationObserver((a) => {
35
+ if (!(Date.now() > f)) {
36
+ for (const c of a)
37
+ for (const d of Array.from(c.addedNodes))
38
+ if (J(d, p.current)) {
39
+ f = 0, n.current();
40
+ return;
41
+ }
42
+ }
43
+ });
44
+ return r == null || r.observe(document.body, { childList: !0, subtree: !0 }), window.addEventListener("click", u, !0), () => {
45
+ r == null || r.disconnect(), window.removeEventListener("click", u, !0);
46
+ for (const a of o) clearTimeout(a);
47
+ };
48
+ }, [i]);
49
+ }
50
+ function O(i, t) {
51
+ const s = i.querySelector("[data-nvr-header-title]"), n = s == null ? void 0 : s.querySelector("[data-nvr-record-title]"), p = n == null ? void 0 : n.parentElement;
52
+ if (!s || !n || !p || !t) return 0;
53
+ const f = s.getBoundingClientRect();
54
+ if (t.getBoundingClientRect().top >= f.bottom - 1) return 0;
55
+ const u = n.getBoundingClientRect().top, r = Array.from(p.children).filter(
56
+ (d) => d instanceof HTMLElement && d.offsetWidth > 0
57
+ );
58
+ if (!r.some((d) => d.getBoundingClientRect().top > u + 2)) return 0;
59
+ const a = Number.parseFloat(getComputedStyle(p).columnGap) || 0, c = r.reduce((d, h) => d + h.offsetWidth, 0) + a * (r.length - 1);
60
+ return Math.max(0, Math.ceil(c - p.clientWidth));
61
+ }
62
+ function te({ children: i }) {
63
+ var x, k;
64
+ const t = m(null), s = m(null), [n, p] = M(!1), f = m(!1);
65
+ f.current = n;
66
+ const o = m(0), u = m(0), [r, a] = M(!1), c = m(null), d = m(!1);
67
+ if (n ? r && (d.current = !0) : d.current = !1, G(
68
+ r,
69
+ () => a(!1),
70
+ (e) => {
71
+ var b;
72
+ return !!((b = c.current) != null && b.contains(e) || e.closest("[data-nvr-header-menu-panel]"));
73
+ }
74
+ ), R(() => {
75
+ var A, B;
76
+ const e = (A = t.current) == null ? void 0 : A.closest("[data-nvr-header-row]");
21
77
  if (!e) return;
22
- const f = () => {
23
- if (!u.current) {
24
- e.scrollWidth > e.clientWidth + 2 && (n.current = e.scrollWidth, i(!0), l(!1));
78
+ const b = () => {
79
+ var I, D;
80
+ if (!f.current) {
81
+ if (e.scrollWidth > e.clientWidth + 2) {
82
+ o.current = e.scrollWidth, p(!0), a(!1);
83
+ return;
84
+ }
85
+ const H = O(e, ((I = t.current) == null ? void 0 : I.parentElement) ?? null);
86
+ H > 0 && (o.current = e.clientWidth + H, p(!0), a(!1));
25
87
  return;
26
88
  }
27
- const E = e.hasAttribute("data-nvr-header-wrap");
28
- !E && e.scrollWidth > e.clientWidth + 2 ? (o.current = e.scrollWidth, e.setAttribute("data-nvr-header-wrap", "")) : E && e.clientWidth > o.current + 32 ? e.removeAttribute("data-nvr-header-wrap") : !E && n.current > 0 && e.clientWidth > n.current + 32 && i(!1);
89
+ const C = e.hasAttribute("data-nvr-header-wrap"), S = e.scrollWidth > e.clientWidth + 2, T = C || e.querySelector('[data-nvr-header-fold="inline"]') ? 0 : O(e, ((D = t.current) == null ? void 0 : D.parentElement) ?? null);
90
+ !C && (S || T > 0) ? (u.current = Math.max(
91
+ S ? e.scrollWidth : 0,
92
+ e.clientWidth + T
93
+ ), e.setAttribute("data-nvr-header-wrap", "")) : C && e.clientWidth > u.current + 32 ? e.removeAttribute("data-nvr-header-wrap") : !C && o.current > 0 && e.clientWidth > o.current + 32 && p(!1);
94
+ };
95
+ b();
96
+ const E = new ResizeObserver(b);
97
+ E.observe(e);
98
+ const v = (B = t.current) == null ? void 0 : B.parentElement;
99
+ v && v !== e && E.observe(v);
100
+ let y = 0;
101
+ const _ = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
102
+ y || (y = requestAnimationFrame(() => {
103
+ y = 0, b();
104
+ }));
105
+ });
106
+ return _ == null || _.observe(e, { childList: !0, subtree: !0 }), () => {
107
+ E.disconnect(), _ == null || _.disconnect(), y && cancelAnimationFrame(y);
29
108
  };
30
- f();
31
- const w = new ResizeObserver(f);
32
- w.observe(e);
33
- const p = (C = t.current) == null ? void 0 : C.parentElement;
34
- return p && p !== e && w.observe(p), () => w.disconnect();
35
- }), _(() => {
36
- if (!s) return;
37
- const e = (f) => {
38
- f.key !== "Escape" || !B(f, t.current) || (f.stopPropagation(), l(!1));
109
+ }), R(() => {
110
+ if (!r) return;
111
+ const e = (b) => {
112
+ b.key !== "Escape" || !j(b, t.current) || (b.stopPropagation(), a(!1));
39
113
  };
40
114
  return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
41
- }, [s]), _(() => {
42
- if (!s) return;
43
- const e = (w) => {
44
- const p = w.target;
45
- if (p.closest("[data-nvr-header-tools-panel]") || p.closest("[data-nvr-header-tools-btn]") || p.closest("[data-nvr-header-menu-panel]") || p.closest("[data-radix-popper-content-wrapper]"))
115
+ }, [r]), R(() => {
116
+ if (!r) return;
117
+ const e = (E) => {
118
+ const v = E.target;
119
+ if (v.closest("[data-nvr-header-tools-panel]") || v.closest("[data-nvr-header-tools-btn]") || v.closest("[data-nvr-header-menu-panel]") || v.closest("[data-radix-popper-content-wrapper]"))
46
120
  return;
47
- const k = p.closest('[role="dialog"]');
48
- k && !k.contains(t.current) || l(!1);
49
- }, f = (w) => {
50
- w.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && l(!1);
121
+ const y = v.closest('[role="dialog"]');
122
+ y && !y.contains(t.current) || a(!1);
123
+ }, b = (E) => {
124
+ E.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && a(!1);
51
125
  };
52
- return window.addEventListener("mousedown", e, !0), window.addEventListener("click", f), () => {
53
- window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", f);
126
+ return window.addEventListener("mousedown", e, !0), window.addEventListener("click", b), () => {
127
+ window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", b);
54
128
  };
55
- }, [s]), !a)
56
- return /* @__PURE__ */ v("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: c });
57
- const r = s ? (g = d.current) == null ? void 0 : g.getBoundingClientRect() : void 0, h = ((x = d.current) == null ? void 0 : x.closest('[role="dialog"]')) ?? document.body, m = r ? r.right - (h === document.body ? 0 : h.getBoundingClientRect().left) - 16 : 440;
58
- return /* @__PURE__ */ W("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
59
- /* @__PURE__ */ v(
129
+ }, [r]), !n)
130
+ return /* @__PURE__ */ w("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: /* @__PURE__ */ w(N.Provider, { value: !0, children: i }) });
131
+ const h = r ? (x = s.current) == null ? void 0 : x.getBoundingClientRect() : void 0, l = ((k = s.current) == null ? void 0 : k.closest('[role="dialog"]')) ?? document.body, g = h ? h.right - (l === document.body ? 0 : l.getBoundingClientRect().left) - 16 : 440;
132
+ return /* @__PURE__ */ L("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
133
+ /* @__PURE__ */ w(
60
134
  "button",
61
135
  {
62
- ref: d,
136
+ ref: s,
63
137
  type: "button",
64
138
  "data-nvr-header-tools-btn": !0,
65
- "aria-expanded": s,
139
+ "aria-expanded": r,
66
140
  "aria-label": "More tools",
67
141
  "data-tip": "More tools",
68
- onClick: () => l((e) => !e),
69
- className: y(
142
+ onClick: () => a((e) => !e),
143
+ className: W(
70
144
  "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground dark:bg-transparent dark:hover:bg-accent",
71
- s && "bg-accent text-accent-foreground dark:bg-accent"
145
+ r && "bg-accent text-accent-foreground dark:bg-accent"
72
146
  ),
73
- children: /* @__PURE__ */ v(N, { className: "h-4 w-4" })
147
+ children: /* @__PURE__ */ w(F, { className: "h-4 w-4" })
74
148
  }
75
149
  ),
76
- s && r && L(
77
- /* @__PURE__ */ v(
150
+ d.current && P(
151
+ /* @__PURE__ */ w(
78
152
  "div",
79
153
  {
154
+ ref: c,
80
155
  "data-nvr-header-tools-panel": !0,
81
- style: h === document.body ? {
156
+ style: r && h ? l === document.body ? {
82
157
  position: "fixed",
83
- top: r.bottom + 6,
84
- right: Math.max(8, window.innerWidth - r.right),
85
- maxWidth: Math.min(440, m),
158
+ top: h.bottom + 6,
159
+ right: Math.max(8, window.innerWidth - h.right),
160
+ maxWidth: Math.min(440, g),
86
161
  zIndex: 110
87
162
  } : {
88
163
  position: "absolute",
89
- top: r.bottom - h.getBoundingClientRect().top + 6,
90
- right: Math.max(8, h.getBoundingClientRect().right - r.right),
91
- maxWidth: Math.min(440, m),
164
+ top: h.bottom - l.getBoundingClientRect().top + 6,
165
+ right: Math.max(8, l.getBoundingClientRect().right - h.right),
166
+ maxWidth: Math.min(440, g),
92
167
  zIndex: 110
93
- },
168
+ } : { display: "none" },
94
169
  className: "flex flex-wrap items-center justify-end gap-1.5 rounded-lg border border-slate-200 bg-white p-2 shadow-xl dark:border-border dark:bg-card [&_[data-nvr-header-tool-group]]:h-auto [&_[data-nvr-header-tool-group]]:min-h-9 [&_[data-nvr-header-tool-group]]:max-w-full [&_[data-nvr-header-tool-group]]:shrink [&_[data-nvr-header-tool-group]]:flex-wrap",
95
- children: c
170
+ children: /* @__PURE__ */ w(N.Provider, { value: r, children: i })
96
171
  }
97
172
  ),
98
- h
173
+ l
99
174
  )
100
175
  ] });
101
176
  }
102
- function P(c, t) {
103
- const [d, a] = R(!1), i = b(!1);
104
- i.current = d;
105
- const u = b(0);
106
- return _(() => {
107
- const n = c.current, o = n == null ? void 0 : n.closest("[data-nvr-header-row]");
108
- if (!t || !n || !o) {
109
- !t && i.current && a(!1);
177
+ function ne(i, t) {
178
+ const [s, n] = M(!1), p = m(!1);
179
+ p.current = s;
180
+ const f = m(0);
181
+ return R(() => {
182
+ const o = i.current, u = o == null ? void 0 : o.closest("[data-nvr-header-row]");
183
+ if (!t || !o || !u) {
184
+ !t && p.current && n(!1);
110
185
  return;
111
186
  }
112
- const s = () => {
113
- if (i.current)
114
- u.current > 0 && o.clientWidth > u.current + 32 && a(!1);
187
+ o.setAttribute("data-nvr-header-fold", p.current ? "folded" : "inline");
188
+ const r = () => {
189
+ if (p.current)
190
+ f.current > 0 && u.clientWidth > f.current + 32 && n(!1);
115
191
  else {
116
- if (o.scrollWidth <= o.clientWidth + 2) return;
117
- const r = o.querySelector("[data-nvr-header-tools]");
118
- if ((r == null ? void 0 : r.getAttribute("data-nvr-header-tools")) === "inline" && r.childElementCount > 0)
192
+ const h = u.scrollWidth > u.clientWidth + 2, l = u.querySelector("[data-nvr-header-tools]");
193
+ if ((l == null ? void 0 : l.getAttribute("data-nvr-header-tools")) === "inline" && l.childElementCount > 0)
119
194
  return;
120
- u.current = o.scrollWidth, a(!0);
195
+ const g = h ? 0 : O(u, o.parentElement);
196
+ if (!h && g <= 0) return;
197
+ f.current = h ? u.scrollWidth : u.clientWidth + g, n(!0);
121
198
  }
122
199
  };
123
- s();
124
- const l = new ResizeObserver(s);
125
- return l.observe(o), n.parentElement && n.parentElement !== o && l.observe(n.parentElement), () => l.disconnect();
126
- }), d;
200
+ r();
201
+ const a = new ResizeObserver(r);
202
+ a.observe(u), o.parentElement && o.parentElement !== u && a.observe(o.parentElement);
203
+ let c = 0;
204
+ const d = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
205
+ c || (c = requestAnimationFrame(() => {
206
+ c = 0, r();
207
+ }));
208
+ });
209
+ return d == null || d.observe(u, { childList: !0, subtree: !0 }), () => {
210
+ a.disconnect(), d == null || d.disconnect(), c && cancelAnimationFrame(c);
211
+ };
212
+ }), R(() => {
213
+ var o;
214
+ t || (o = i.current) == null || o.removeAttribute("data-nvr-header-fold");
215
+ }, [t, i]), s;
127
216
  }
128
- const z = 240;
129
- function M(c, t) {
130
- return Math.max(8, Math.min(c, t - z - 8));
217
+ const V = 240;
218
+ function z(i, t) {
219
+ return Math.max(8, Math.min(i, t - V - 8));
131
220
  }
132
- function T({
133
- children: c,
221
+ function re({
222
+ children: i,
134
223
  label: t = "More",
135
- className: d
224
+ className: s
136
225
  }) {
137
- var s, l;
138
- const a = b(null), [i, u] = R(!1);
139
- _(() => {
140
- if (!i) return;
141
- const r = (m) => {
142
- var x;
143
- const g = m.target;
144
- g.closest("[data-nvr-header-menu-panel]") || g.closest("[data-nvr-header-menu-btn]") || g.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
145
- g.closest('[role="dialog"]') && !((x = g.closest('[role="dialog"]')) != null && x.contains(a.current)) || u(!1);
146
- }, h = (m) => {
147
- m.key !== "Escape" || !B(m, a.current) || (m.stopPropagation(), u(!1));
226
+ var d, h;
227
+ const n = m(null), p = m(null), [f, o] = M(!1), u = m(!1);
228
+ f && (u.current = !0), G(
229
+ f,
230
+ () => o(!1),
231
+ (l) => {
232
+ var g;
233
+ return !!((g = p.current) != null && g.contains(l));
234
+ }
235
+ );
236
+ const r = K(N);
237
+ R(() => {
238
+ r || o(!1);
239
+ }, [r]), R(() => {
240
+ if (!f) return;
241
+ const l = (x) => {
242
+ var e;
243
+ const k = x.target;
244
+ k.closest("[data-nvr-header-menu-panel]") || k.closest("[data-nvr-header-menu-btn]") || k.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
245
+ k.closest('[role="dialog"]') && !((e = k.closest('[role="dialog"]')) != null && e.contains(n.current)) || o(!1);
246
+ }, g = (x) => {
247
+ x.key !== "Escape" || !j(x, n.current) || (x.stopPropagation(), o(!1));
148
248
  };
149
- return window.addEventListener("mousedown", r, !0), window.addEventListener("keydown", h, !0), () => {
150
- window.removeEventListener("mousedown", r, !0), window.removeEventListener("keydown", h, !0);
249
+ return window.addEventListener("mousedown", l, !0), window.addEventListener("keydown", g, !0), () => {
250
+ window.removeEventListener("mousedown", l, !0), window.removeEventListener("keydown", g, !0);
151
251
  };
152
- }, [i]);
153
- const n = i ? (s = a.current) == null ? void 0 : s.getBoundingClientRect() : void 0, o = ((l = a.current) == null ? void 0 : l.closest('[role="dialog"]')) ?? document.body;
154
- return /* @__PURE__ */ W("div", { className: y("relative shrink-0", d), children: [
155
- /* @__PURE__ */ W(
252
+ }, [f]);
253
+ const a = f ? (d = n.current) == null ? void 0 : d.getBoundingClientRect() : void 0, c = ((h = n.current) == null ? void 0 : h.closest('[role="dialog"]')) ?? document.body;
254
+ return /* @__PURE__ */ L("div", { className: W("relative shrink-0", s), children: [
255
+ /* @__PURE__ */ L(
156
256
  "button",
157
257
  {
158
- ref: a,
258
+ ref: n,
159
259
  type: "button",
160
260
  "data-nvr-header-menu-btn": !0,
161
261
  "aria-haspopup": "menu",
162
- "aria-expanded": i,
262
+ "aria-expanded": f,
163
263
  "aria-label": t,
164
264
  "data-tip": "More actions",
165
- onClick: () => u((r) => !r),
166
- className: y(
265
+ onClick: () => o((l) => !l),
266
+ className: W(
167
267
  "inline-flex h-9 items-center gap-1 rounded-md border border-input bg-background px-2.5 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground dark:bg-transparent dark:hover:bg-accent",
168
- i && "bg-accent text-accent-foreground dark:bg-accent"
268
+ f && "bg-accent text-accent-foreground dark:bg-accent"
169
269
  ),
170
270
  children: [
171
- /* @__PURE__ */ v(N, { className: "h-4 w-4" }),
172
- /* @__PURE__ */ v("span", { className: "hidden lg:inline", children: t })
271
+ /* @__PURE__ */ w(F, { className: "h-4 w-4" }),
272
+ /* @__PURE__ */ w("span", { className: "hidden lg:inline", children: t })
173
273
  ]
174
274
  }
175
275
  ),
176
- i && n && L(
177
- /* @__PURE__ */ v(
276
+ u.current && P(
277
+ /* @__PURE__ */ w(
178
278
  "div",
179
279
  {
280
+ ref: p,
180
281
  "data-nvr-header-menu-panel": !0,
181
282
  role: "menu",
182
- onClick: (r) => {
183
- r.target.closest("[data-nvr-menu-close]") && u(!1);
283
+ onClick: (l) => {
284
+ l.target.closest("[data-nvr-menu-close]") && o(!1);
184
285
  },
185
- style: o === document.body ? {
286
+ style: f && a ? c === document.body ? {
186
287
  position: "fixed",
187
- top: n.bottom + 6,
188
- right: M(window.innerWidth - n.right, window.innerWidth),
288
+ top: a.bottom + 6,
289
+ right: z(window.innerWidth - a.right, window.innerWidth),
189
290
  zIndex: 110
190
291
  } : {
191
292
  position: "absolute",
192
- top: n.bottom - o.getBoundingClientRect().top + 6,
193
- right: M(
194
- o.getBoundingClientRect().right - n.right,
195
- o.getBoundingClientRect().width
293
+ top: a.bottom - c.getBoundingClientRect().top + 6,
294
+ right: z(
295
+ c.getBoundingClientRect().right - a.right,
296
+ c.getBoundingClientRect().width
196
297
  ),
197
298
  zIndex: 110
198
- },
199
- className: y(
299
+ } : { display: "none" },
300
+ className: W(
200
301
  "flex w-[240px] flex-col gap-px rounded-lg border border-slate-200 bg-white p-1 shadow-xl dark:border-border dark:bg-card",
201
302
  "[&_button]:h-8 [&_button]:w-full [&_button]:justify-start [&_button]:gap-2 [&_button]:rounded-sm [&_button]:border-0 [&_button]:bg-transparent [&_button]:px-2 [&_button]:text-[12.5px] [&_button]:font-medium [&_button]:shadow-none",
202
303
  "[&_button:hover]:bg-accent [&_button:hover]:text-accent-foreground [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button_svg]:shrink-0 [&_button_svg]:text-slate-500",
203
304
  "[&>[data-nvr-menu-divider]]:my-1 [&>[data-nvr-menu-divider]]:h-px [&>[data-nvr-menu-divider]]:bg-slate-100 dark:[&>[data-nvr-menu-divider]]:bg-border"
204
305
  ),
205
- children: c
306
+ children: i
206
307
  }
207
308
  ),
208
- o
309
+ c
209
310
  )
210
311
  ] });
211
312
  }
212
- function F({
213
- children: c,
313
+ function oe({
314
+ children: i,
214
315
  className: t
215
316
  }) {
216
- return /* @__PURE__ */ v(
317
+ return /* @__PURE__ */ w(
217
318
  "div",
218
319
  {
219
320
  "data-nvr-header-tool-group": !0,
220
- className: y(
321
+ className: W(
221
322
  "inline-flex h-9 shrink-0 items-center rounded-md border border-input bg-background px-0.5 shadow-sm [&>*+*]:border-l [&>*+*]:border-input/70",
222
323
  t
223
324
  ),
224
- children: c
325
+ children: i
225
326
  }
226
327
  );
227
328
  }
228
329
  export {
229
- T as HeaderMenu,
230
- F as HeaderToolGroup,
231
- D as HeaderTools,
232
- M as menuRight,
233
- P as useHeaderFold
330
+ re as HeaderMenu,
331
+ oe as HeaderToolGroup,
332
+ te as HeaderTools,
333
+ z as menuRight,
334
+ J as openedLayerIn,
335
+ O as titleChipDeficit,
336
+ G as useCloseWhenRowOpensLayer,
337
+ ne as useHeaderFold
234
338
  };