@nivaro/react 0.3.118 → 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.
@@ -1,243 +1,338 @@
1
- import { jsx as w, jsxs as M } from "react/jsx-runtime";
2
- import { MoreHorizontal as B } from "lucide-react";
3
- import { useRef as v, useState as E, useEffect as y } from "react";
4
- import { createPortal as z } from "react-dom";
5
- import { cn as R } from "../../lib/utils.js";
6
- function O(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 P({ children: c }) {
14
- var m, _;
15
- const t = v(null), d = v(null), [a, i] = E(!1), u = v(!1);
16
- u.current = a;
17
- const n = v(0), o = v(0), [s, l] = E(!1);
18
- if (y(() => {
19
- var C, N;
20
- const e = (C = t.current) == null ? void 0 : C.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 p = () => {
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 W = e.hasAttribute("data-nvr-header-wrap");
28
- !W && e.scrollWidth > e.clientWidth + 2 ? (o.current = e.scrollWidth, e.setAttribute("data-nvr-header-wrap", "")) : W && e.clientWidth > o.current + 32 ? e.removeAttribute("data-nvr-header-wrap") : !W && 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);
29
94
  };
30
- p();
31
- const x = new ResizeObserver(p);
32
- x.observe(e);
33
- const h = (N = t.current) == null ? void 0 : N.parentElement;
34
- h && h !== e && x.observe(h);
35
- let g = 0;
36
- const k = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
37
- g || (g = requestAnimationFrame(() => {
38
- g = 0, p();
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();
39
104
  }));
40
105
  });
41
- return k == null || k.observe(e, { childList: !0, subtree: !0 }), () => {
42
- x.disconnect(), k == null || k.disconnect(), g && cancelAnimationFrame(g);
106
+ return _ == null || _.observe(e, { childList: !0, subtree: !0 }), () => {
107
+ E.disconnect(), _ == null || _.disconnect(), y && cancelAnimationFrame(y);
43
108
  };
44
- }), y(() => {
45
- if (!s) return;
46
- const e = (p) => {
47
- p.key !== "Escape" || !O(p, t.current) || (p.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));
48
113
  };
49
114
  return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
50
- }, [s]), y(() => {
51
- if (!s) return;
52
- const e = (x) => {
53
- const h = x.target;
54
- if (h.closest("[data-nvr-header-tools-panel]") || h.closest("[data-nvr-header-tools-btn]") || h.closest("[data-nvr-header-menu-panel]") || h.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]"))
55
120
  return;
56
- const g = h.closest('[role="dialog"]');
57
- g && !g.contains(t.current) || l(!1);
58
- }, p = (x) => {
59
- x.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);
60
125
  };
61
- return window.addEventListener("mousedown", e, !0), window.addEventListener("click", p), () => {
62
- window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", p);
126
+ return window.addEventListener("mousedown", e, !0), window.addEventListener("click", b), () => {
127
+ window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", b);
63
128
  };
64
- }, [s]), !a)
65
- return /* @__PURE__ */ w("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: c });
66
- const r = s ? (m = d.current) == null ? void 0 : m.getBoundingClientRect() : void 0, f = ((_ = d.current) == null ? void 0 : _.closest('[role="dialog"]')) ?? document.body, b = r ? r.right - (f === document.body ? 0 : f.getBoundingClientRect().left) - 16 : 440;
67
- return /* @__PURE__ */ M("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
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: [
68
133
  /* @__PURE__ */ w(
69
134
  "button",
70
135
  {
71
- ref: d,
136
+ ref: s,
72
137
  type: "button",
73
138
  "data-nvr-header-tools-btn": !0,
74
- "aria-expanded": s,
139
+ "aria-expanded": r,
75
140
  "aria-label": "More tools",
76
141
  "data-tip": "More tools",
77
- onClick: () => l((e) => !e),
78
- className: R(
142
+ onClick: () => a((e) => !e),
143
+ className: W(
79
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",
80
- s && "bg-accent text-accent-foreground dark:bg-accent"
145
+ r && "bg-accent text-accent-foreground dark:bg-accent"
81
146
  ),
82
- children: /* @__PURE__ */ w(B, { className: "h-4 w-4" })
147
+ children: /* @__PURE__ */ w(F, { className: "h-4 w-4" })
83
148
  }
84
149
  ),
85
- s && r && z(
150
+ d.current && P(
86
151
  /* @__PURE__ */ w(
87
152
  "div",
88
153
  {
154
+ ref: c,
89
155
  "data-nvr-header-tools-panel": !0,
90
- style: f === document.body ? {
156
+ style: r && h ? l === document.body ? {
91
157
  position: "fixed",
92
- top: r.bottom + 6,
93
- right: Math.max(8, window.innerWidth - r.right),
94
- maxWidth: Math.min(440, b),
158
+ top: h.bottom + 6,
159
+ right: Math.max(8, window.innerWidth - h.right),
160
+ maxWidth: Math.min(440, g),
95
161
  zIndex: 110
96
162
  } : {
97
163
  position: "absolute",
98
- top: r.bottom - f.getBoundingClientRect().top + 6,
99
- right: Math.max(8, f.getBoundingClientRect().right - r.right),
100
- maxWidth: Math.min(440, b),
164
+ top: h.bottom - l.getBoundingClientRect().top + 6,
165
+ right: Math.max(8, l.getBoundingClientRect().right - h.right),
166
+ maxWidth: Math.min(440, g),
101
167
  zIndex: 110
102
- },
168
+ } : { display: "none" },
103
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",
104
- children: c
170
+ children: /* @__PURE__ */ w(N.Provider, { value: r, children: i })
105
171
  }
106
172
  ),
107
- f
173
+ l
108
174
  )
109
175
  ] });
110
176
  }
111
- function T(c, t) {
112
- const [d, a] = E(!1), i = v(!1);
113
- i.current = d;
114
- const u = v(0);
115
- return y(() => {
116
- const n = c.current, o = n == null ? void 0 : n.closest("[data-nvr-header-row]");
117
- if (!t || !n || !o) {
118
- !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);
119
185
  return;
120
186
  }
121
- const s = () => {
122
- if (i.current)
123
- 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);
124
191
  else {
125
- if (o.scrollWidth <= o.clientWidth + 2) return;
126
- const r = o.querySelector("[data-nvr-header-tools]");
127
- 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)
128
194
  return;
129
- 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);
130
198
  }
131
199
  };
132
- s();
133
- const l = new ResizeObserver(s);
134
- return l.observe(o), n.parentElement && n.parentElement !== o && l.observe(n.parentElement), () => l.disconnect();
135
- }), 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;
136
216
  }
137
- const A = 240;
138
- function L(c, t) {
139
- return Math.max(8, Math.min(c, t - A - 8));
217
+ const V = 240;
218
+ function z(i, t) {
219
+ return Math.max(8, Math.min(i, t - V - 8));
140
220
  }
141
- function q({
142
- children: c,
221
+ function re({
222
+ children: i,
143
223
  label: t = "More",
144
- className: d
224
+ className: s
145
225
  }) {
146
- var s, l;
147
- const a = v(null), [i, u] = E(!1);
148
- y(() => {
149
- if (!i) return;
150
- const r = (b) => {
151
- var _;
152
- const m = b.target;
153
- m.closest("[data-nvr-header-menu-panel]") || m.closest("[data-nvr-header-menu-btn]") || m.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
154
- m.closest('[role="dialog"]') && !((_ = m.closest('[role="dialog"]')) != null && _.contains(a.current)) || u(!1);
155
- }, f = (b) => {
156
- b.key !== "Escape" || !O(b, a.current) || (b.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));
157
248
  };
158
- return window.addEventListener("mousedown", r, !0), window.addEventListener("keydown", f, !0), () => {
159
- window.removeEventListener("mousedown", r, !0), window.removeEventListener("keydown", f, !0);
249
+ return window.addEventListener("mousedown", l, !0), window.addEventListener("keydown", g, !0), () => {
250
+ window.removeEventListener("mousedown", l, !0), window.removeEventListener("keydown", g, !0);
160
251
  };
161
- }, [i]);
162
- 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;
163
- return /* @__PURE__ */ M("div", { className: R("relative shrink-0", d), children: [
164
- /* @__PURE__ */ M(
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(
165
256
  "button",
166
257
  {
167
- ref: a,
258
+ ref: n,
168
259
  type: "button",
169
260
  "data-nvr-header-menu-btn": !0,
170
261
  "aria-haspopup": "menu",
171
- "aria-expanded": i,
262
+ "aria-expanded": f,
172
263
  "aria-label": t,
173
264
  "data-tip": "More actions",
174
- onClick: () => u((r) => !r),
175
- className: R(
265
+ onClick: () => o((l) => !l),
266
+ className: W(
176
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",
177
- i && "bg-accent text-accent-foreground dark:bg-accent"
268
+ f && "bg-accent text-accent-foreground dark:bg-accent"
178
269
  ),
179
270
  children: [
180
- /* @__PURE__ */ w(B, { className: "h-4 w-4" }),
271
+ /* @__PURE__ */ w(F, { className: "h-4 w-4" }),
181
272
  /* @__PURE__ */ w("span", { className: "hidden lg:inline", children: t })
182
273
  ]
183
274
  }
184
275
  ),
185
- i && n && z(
276
+ u.current && P(
186
277
  /* @__PURE__ */ w(
187
278
  "div",
188
279
  {
280
+ ref: p,
189
281
  "data-nvr-header-menu-panel": !0,
190
282
  role: "menu",
191
- onClick: (r) => {
192
- r.target.closest("[data-nvr-menu-close]") && u(!1);
283
+ onClick: (l) => {
284
+ l.target.closest("[data-nvr-menu-close]") && o(!1);
193
285
  },
194
- style: o === document.body ? {
286
+ style: f && a ? c === document.body ? {
195
287
  position: "fixed",
196
- top: n.bottom + 6,
197
- right: L(window.innerWidth - n.right, window.innerWidth),
288
+ top: a.bottom + 6,
289
+ right: z(window.innerWidth - a.right, window.innerWidth),
198
290
  zIndex: 110
199
291
  } : {
200
292
  position: "absolute",
201
- top: n.bottom - o.getBoundingClientRect().top + 6,
202
- right: L(
203
- o.getBoundingClientRect().right - n.right,
204
- o.getBoundingClientRect().width
293
+ top: a.bottom - c.getBoundingClientRect().top + 6,
294
+ right: z(
295
+ c.getBoundingClientRect().right - a.right,
296
+ c.getBoundingClientRect().width
205
297
  ),
206
298
  zIndex: 110
207
- },
208
- className: R(
299
+ } : { display: "none" },
300
+ className: W(
209
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",
210
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",
211
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",
212
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"
213
305
  ),
214
- children: c
306
+ children: i
215
307
  }
216
308
  ),
217
- o
309
+ c
218
310
  )
219
311
  ] });
220
312
  }
221
- function K({
222
- children: c,
313
+ function oe({
314
+ children: i,
223
315
  className: t
224
316
  }) {
225
317
  return /* @__PURE__ */ w(
226
318
  "div",
227
319
  {
228
320
  "data-nvr-header-tool-group": !0,
229
- className: R(
321
+ className: W(
230
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",
231
323
  t
232
324
  ),
233
- children: c
325
+ children: i
234
326
  }
235
327
  );
236
328
  }
237
329
  export {
238
- q as HeaderMenu,
239
- K as HeaderToolGroup,
240
- P as HeaderTools,
241
- L as menuRight,
242
- T 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
243
338
  };
@@ -12,8 +12,8 @@ const h = (e, t) => [
12
12
  function K(e) {
13
13
  const t = Array.isArray(e == null ? void 0 : e.tickets) ? e.tickets[0] : void 0;
14
14
  if (!e || !t) return null;
15
- const i = e.tickets.length - 1, c = t.requested_by, s = c ? `Help requested by ${c}` : "Help requested";
16
- return i > 0 ? `${s} +${i}` : s;
15
+ const i = e.tickets.length - 1, c = t.requested_by, n = c ? `Help requested by ${c}` : "Help requested";
16
+ return i > 0 ? `${n} +${i}` : n;
17
17
  }
18
18
  function y(e) {
19
19
  const t = e.tickets[0];
@@ -23,7 +23,7 @@ function y(e) {
23
23
  }
24
24
  function Q({ collection: e, itemId: t }) {
25
25
  var f;
26
- const i = C(), c = x(), s = q(), a = t && t !== "new" ? String(t) : null, { data: n } = v({
26
+ const i = C(), c = x(), n = q(), a = t && t !== "new" ? String(t) : null, { data: s } = v({
27
27
  queryKey: h(e, a ?? ""),
28
28
  queryFn: () => i.request(
29
29
  N(`/support/record/${encodeURIComponent(e)}/${encodeURIComponent(a ?? "")}`)
@@ -40,9 +40,9 @@ function Q({ collection: e, itemId: t }) {
40
40
  includeOwn: !0,
41
41
  client: c
42
42
  });
43
- const d = K(n);
44
- if (!n || !d) return null;
45
- const l = n.tickets[0], u = l ? ((f = s.consoleUrl) == null ? void 0 : f.call(s, `/support?ticket=${l.id}`)) ?? (s.consoleUrl ? null : `/support?ticket=${l.id}`) : null, p = "nvr-fade-in relative inline-flex max-w-[16rem] shrink-0 items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-1 py-1 text-[10.5px] font-medium text-amber-800 sm:px-2 sm:py-px dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200", m = /* @__PURE__ */ g(k, { children: [
43
+ const d = K(s);
44
+ if (!s || !d) return null;
45
+ const l = s.tickets[0], u = l ? ((f = n.consoleUrl) == null ? void 0 : f.call(n, `/support?ticket=${l.id}`)) ?? (n.consoleUrl ? null : `/support?ticket=${l.id}`) : null, p = "nvr-fade-in relative inline-flex min-w-0 max-w-[min(16rem,100%)] shrink-0 items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-1 py-1 text-[10.5px] font-medium text-amber-800 sm:px-2 sm:py-px dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200", m = /* @__PURE__ */ g(k, { children: [
46
46
  /* @__PURE__ */ o($, { className: "h-3 w-3 shrink-0 text-amber-700 dark:text-amber-300", "aria-hidden": !0 }),
47
47
  /* @__PURE__ */ o("span", { className: "hidden truncate sm:inline", children: d }),
48
48
  /* @__PURE__ */ o("span", { className: "sr-only sm:hidden", children: d })
@@ -51,15 +51,15 @@ function Q({ collection: e, itemId: t }) {
51
51
  "a",
52
52
  {
53
53
  href: u,
54
- "data-record-help": n.open,
55
- "data-tip": y(n),
54
+ "data-record-help": s.open,
55
+ "data-tip": y(s),
56
56
  onClick: (r) => {
57
- r.metaKey || r.ctrlKey || r.shiftKey || /^https?:/.test(u) || (r.preventDefault(), s.navigate(u));
57
+ r.metaKey || r.ctrlKey || r.shiftKey || /^https?:/.test(u) || (r.preventDefault(), n.navigate(u));
58
58
  },
59
59
  className: `${p} hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400 dark:hover:bg-amber-500/20`,
60
60
  children: m
61
61
  }
62
- ) : /* @__PURE__ */ o("span", { "data-record-help": n.open, "data-tip": y(n), className: p, children: m });
62
+ ) : /* @__PURE__ */ o("span", { "data-record-help": s.open, "data-tip": y(s), className: p, children: m });
63
63
  }
64
64
  export {
65
65
  Q as RecordHelpChip,
@@ -0,0 +1,6 @@
1
+ function o(n, r, e) {
2
+ return !e || !n || n === "original" ? !1 : !r.some((i) => String(i.id) === n);
3
+ }
4
+ export {
5
+ o as addendumViewGone
6
+ };