@nivaro/react 0.3.41 → 0.3.42

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 (96) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +644 -15
  5. package/dist/index.js +814 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/ProfileView.js +776 -1003
  20. package/dist/shared/components/RecentRecordsRail.js +34 -16
  21. package/dist/shared/components/RecordReadView.js +500 -477
  22. package/dist/shared/components/Skeletons.js +199 -0
  23. package/dist/shared/components/SlowNotice.js +63 -0
  24. package/dist/shared/components/Term.js +23 -0
  25. package/dist/shared/components/WidgetSlot.js +350 -353
  26. package/dist/shared/components/access/PermissionSummary.js +106 -0
  27. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  28. package/dist/shared/components/chat/ChatPanel.js +902 -886
  29. package/dist/shared/components/chat/MemberPaging.js +70 -0
  30. package/dist/shared/components/chat/RoomParts.js +147 -117
  31. package/dist/shared/components/chat/ScreenClip.js +73 -69
  32. package/dist/shared/components/chat/chat-core.js +449 -396
  33. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  34. package/dist/shared/components/help-videos/api.js +2 -5
  35. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  36. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  37. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  38. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  39. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  40. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  41. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  42. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  43. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  44. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  45. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  46. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  47. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  48. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  49. package/dist/shared/components/item-edit/field-sources.js +33 -0
  50. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  51. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  52. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  53. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  54. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  55. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  56. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  57. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  58. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  59. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  60. package/dist/shared/components/list/InlineEdit.js +363 -0
  61. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  62. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  63. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  64. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  65. package/dist/shared/components/notifications/changes-lines.js +24 -0
  66. package/dist/shared/components/notifications/why-lines.js +64 -0
  67. package/dist/shared/components/panels/CommentPanel.js +316 -281
  68. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  69. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  70. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  71. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  72. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  73. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  74. package/dist/shared/components/profile/PersonProfile.js +57 -52
  75. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  76. package/dist/shared/hooks/useSlowReason.js +39 -0
  77. package/dist/shared/lib/activity-sentence.js +670 -0
  78. package/dist/shared/lib/config-sentences.js +418 -0
  79. package/dist/shared/lib/core-glossary.js +229 -0
  80. package/dist/shared/lib/error-hints.js +159 -0
  81. package/dist/shared/lib/error-message.js +105 -0
  82. package/dist/shared/lib/error-toast.js +22 -0
  83. package/dist/shared/lib/field-comments.js +25 -0
  84. package/dist/shared/lib/filter-sentence.js +261 -0
  85. package/dist/shared/lib/glossary.js +55 -48
  86. package/dist/shared/lib/idle-reload.js +138 -0
  87. package/dist/shared/lib/layout-resolve.js +42 -29
  88. package/dist/shared/lib/list-inline-edit.js +190 -0
  89. package/dist/shared/lib/list-link.js +147 -0
  90. package/dist/shared/lib/prefetch.js +259 -106
  91. package/dist/shared/lib/record-ref.js +72 -0
  92. package/dist/shared/lib/reload-holds.js +25 -0
  93. package/dist/shared/lib/safe-error.js +52 -24
  94. package/dist/shared/lib/skeleton-shapes.js +72 -0
  95. package/dist/shared/lib/slow-reason.js +63 -0
  96. package/package.json +1 -1
@@ -1,81 +1,86 @@
1
1
  import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
- import { readUnreadNotificationCount as ve, markNotificationRead as we, markNotificationsRead as ye, markAllNotificationsRead as Ne } from "@nivaro/sdk";
3
- import { useQueryClient as Ce, useQuery as ne, useMutation as _ } from "@tanstack/react-query";
4
- import { Bell as $e, CheckCheck as Se, ExternalLink as re, Check as z, History as qe, ShieldCheck as Ee, ChevronDown as _e } from "lucide-react";
2
+ import { readUnreadNotificationCount as ye, markNotificationRead as Ne, markNotificationsRead as Ce, markAllNotificationsRead as $e } from "@nivaro/sdk";
3
+ import { useQueryClient as Se, useQuery as ne, useMutation as E } from "@tanstack/react-query";
4
+ import { Bell as qe, CheckCheck as _e, ExternalLink as re, Check as z, History as Ee, ShieldCheck as Re, ChevronDown as Ae } from "lucide-react";
5
5
  import { useState as N, useRef as oe, useEffect as O, useMemo as le, Fragment as ie } from "react";
6
- import { createPortal as Re } from "react-dom";
7
- import { useNivaroClient as Ae } from "../context.js";
8
- import { get as Fe, post as Le } from "../lib/commands.js";
9
- import { useLiveRefetchInterval as Me } from "../lib/live-queries.js";
6
+ import { createPortal as Fe } from "react-dom";
7
+ import { useNivaroClient as Le } from "../context.js";
8
+ import { get as Me, post as Ie } from "../lib/commands.js";
9
+ import { useLiveRefetchInterval as De } from "../lib/live-queries.js";
10
10
  import { resolveNotificationTargetFor as R, runNotificationTarget as A } from "../lib/notification-target.js";
11
- import { useTabAttention as Ie } from "../lib/tab-attention.js";
11
+ import { useTabAttention as Te } from "../lib/tab-attention.js";
12
12
  import { formatRelative as se } from "../lib/utils.js";
13
- import { AsItWasSheet as De } from "./notifications/AsItWasSheet.js";
14
- import { bundleLocally as Te, laneTone as Ke, bundleAsNotification as Be, bundleHeadline as je, categoryChipLabel as ze } from "./notifications/bundles.js";
15
- import { DeliveryChips as Oe } from "./notifications/DeliveryChips.js";
16
- import { NotificationActions as Pe } from "./notifications/NotificationActions.js";
17
- import { NotificationDetailBits as Qe } from "./notifications/NotificationDetailBits.js";
18
- function He(s) {
13
+ import { AsItWasSheet as Ke } from "./notifications/AsItWasSheet.js";
14
+ import { bundleLocally as Be, laneTone as je, bundleAsNotification as ze, bundleHeadline as Oe, categoryChipLabel as Pe } from "./notifications/bundles.js";
15
+ import { DeliveryChips as Qe } from "./notifications/DeliveryChips.js";
16
+ import { NotificationActions as He } from "./notifications/NotificationActions.js";
17
+ import { NotificationDetailBits as Ye } from "./notifications/NotificationDetailBits.js";
18
+ function Ge(l) {
19
+ var d, p;
20
+ return de(l) ? l.revision_id != null || (((p = (d = l.detail) == null ? void 0 : d.changes) == null ? void 0 : p.length) ?? 0) > 0 || l.category === "watch" || l.category === "workflow" : !1;
21
+ }
22
+ function de(l) {
19
23
  var C, $, S;
20
- if ((((C = s.target) == null ? void 0 : C.kind) ?? s.kind ?? (s.collection && s.item ? "record" : null)) !== "record") return !1;
21
- const g = (($ = s.target) == null ? void 0 : $.collection) ?? s.collection, m = ((S = s.target) == null ? void 0 : S.id) ?? s.item;
22
- return !!g && m != null && m !== "" && !/^(nivaro|directus)_|^__/i.test(g);
24
+ if ((((C = l.target) == null ? void 0 : C.kind) ?? l.kind ?? (l.collection && l.item ? "record" : null)) !== "record") return !1;
25
+ const p = (($ = l.target) == null ? void 0 : $.collection) ?? l.collection, x = ((S = l.target) == null ? void 0 : S.id) ?? l.item;
26
+ return !!p && x != null && x !== "" && !/^(nivaro|directus)_|^__/i.test(p);
23
27
  }
24
- function dt({
25
- routes: s,
26
- onNavigate: p,
27
- app: g,
28
- subscribe: m,
28
+ function ut({
29
+ routes: l,
30
+ onNavigate: d,
31
+ app: p,
32
+ subscribe: x,
29
33
  buttonClassName: C,
30
34
  panelClassName: $,
31
35
  beforeList: S,
32
36
  extraBadge: P = 0,
33
- mailLogUrl: de,
37
+ mailLogUrl: ce,
34
38
  renderTrigger: Q,
35
39
  allPath: H,
36
- subscriptionsPath: ce,
37
- onActionError: ue,
40
+ subscriptionsPath: ue,
41
+ rulesPath: me,
42
+ onActionError: pe,
38
43
  panelPlacement: v = "below",
39
- tabBadge: me = !0
44
+ tabBadge: xe = !0
40
45
  }) {
41
- const h = Ae(), [x, d] = N(!1), [f, Y] = N("attention"), F = oe(null), G = oe(null), [L, pe] = N(null), U = Ce(), w = () => {
46
+ const b = Le(), [f, c] = N(!1), [h, Y] = N("attention"), F = oe(null), G = oe(null), [L, fe] = N(null), U = Se(), w = () => {
42
47
  U.invalidateQueries({ queryKey: ["notification-count"] }), U.invalidateQueries({ queryKey: ["notifications"] });
43
- }, xe = Me(6e4, { enabled: !!m, safetyMs: 12e4 }), { data: c } = ne({
48
+ }, he = De(6e4, { enabled: !!x, safetyMs: 12e4 }), { data: u } = ne({
44
49
  queryKey: ["notification-count"],
45
- queryFn: () => h.request(ve()),
46
- refetchInterval: xe
47
- }), M = (c == null ? void 0 : c.unread) ?? 0, I = (c == null ? void 0 : c.attention) ?? M, q = (c == null ? void 0 : c.lanes) ?? { critical: 0, fyi: 0 }, b = M + P;
48
- Ie(I + P, { enabled: me });
49
- const { data: u } = ne({
50
- queryKey: ["notifications", "bell", g ?? null, f],
51
- queryFn: () => h.request(
52
- Fe("/notifications", {
50
+ queryFn: () => b.request(ye()),
51
+ refetchInterval: he
52
+ }), M = (u == null ? void 0 : u.unread) ?? 0, I = (u == null ? void 0 : u.attention) ?? M, q = (u == null ? void 0 : u.lanes) ?? { critical: 0, fyi: 0 }, k = M + P;
53
+ Te(I + P, { enabled: xe });
54
+ const { data: m } = ne({
55
+ queryKey: ["notifications", "bell", p ?? null, h],
56
+ queryFn: () => b.request(
57
+ Me("/notifications", {
53
58
  limit: 60,
54
- app: g,
59
+ app: p,
55
60
  bundle: "record",
56
- ...f === "attention" ? { lane: "attention", status: "inbox" } : {},
57
- ...f === "fyi" ? { lane: "fyi", status: "inbox" } : {}
61
+ ...h === "attention" ? { lane: "attention", status: "inbox" } : {},
62
+ ...h === "fyi" ? { lane: "fyi", status: "inbox" } : {}
58
63
  })
59
64
  ).then((e) => {
60
- const t = e.pinned ?? [], o = new Set(t.map((n) => n.id)), i = (e.data ?? []).filter((n) => !o.has(n.id));
61
- return e.bundles ? { rows: i, bundles: e.bundles, pinned: t } : { ...Te(i), pinned: t };
65
+ const t = e.pinned ?? [], o = new Set(t.map((n) => n.id)), s = (e.data ?? []).filter((n) => !o.has(n.id));
66
+ return e.bundles ? { rows: s, bundles: e.bundles, pinned: t } : { ...Be(s), pinned: t };
62
67
  }),
63
- enabled: x
64
- }), V = (u == null ? void 0 : u.rows) ?? [], D = (u == null ? void 0 : u.pinned) ?? [], W = (u == null ? void 0 : u.bundles) ?? [], [fe, J] = N(() => /* @__PURE__ */ new Set()), [k, T] = N(null);
65
- O(() => m == null ? void 0 : m(w), [m]), O(() => {
66
- if (!x) return;
68
+ enabled: f
69
+ }), V = (m == null ? void 0 : m.rows) ?? [], D = (m == null ? void 0 : m.pinned) ?? [], W = (m == null ? void 0 : m.bundles) ?? [], [be, J] = N(() => /* @__PURE__ */ new Set()), [g, T] = N(null);
70
+ O(() => x == null ? void 0 : x(w), [x]), O(() => {
71
+ if (!f) return;
67
72
  const e = (t) => {
68
- var i, n;
73
+ var s, n;
69
74
  const o = t.target;
70
- (i = F.current) != null && i.contains(o) || (n = G.current) != null && n.contains(o) || d(!1);
75
+ (s = F.current) != null && s.contains(o) || (n = G.current) != null && n.contains(o) || c(!1);
71
76
  };
72
77
  return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
73
- }, [x]), O(() => {
74
- if (!x || v !== "right") return;
78
+ }, [f]), O(() => {
79
+ if (!f || v !== "right") return;
75
80
  const e = () => {
76
81
  var o;
77
82
  const t = (o = F.current) == null ? void 0 : o.getBoundingClientRect();
78
- t && pe({
83
+ t && fe({
79
84
  left: Math.round(t.right + 12),
80
85
  bottom: Math.max(8, Math.round(window.innerHeight - t.bottom))
81
86
  });
@@ -83,45 +88,45 @@ function dt({
83
88
  return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
84
89
  window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
85
90
  };
86
- }, [x, v]);
87
- const X = _({
88
- mutationFn: (e) => h.request(Le(`/notifications/${e}/acknowledge`)),
91
+ }, [f, v]);
92
+ const X = E({
93
+ mutationFn: (e) => b.request(Ie(`/notifications/${e}/acknowledge`)),
89
94
  onSuccess: w
90
- }), K = _({
91
- mutationFn: (e) => h.request(we(e)),
95
+ }), K = E({
96
+ mutationFn: (e) => b.request(Ne(e)),
92
97
  onSuccess: w
93
- }), B = _({
94
- mutationFn: (e) => h.request(ye(e)),
98
+ }), B = E({
99
+ mutationFn: (e) => b.request(Ce(e)),
95
100
  onSuccess: w
96
- }), he = _({
97
- mutationFn: () => h.request(Ne()),
101
+ }), ke = E({
102
+ mutationFn: () => b.request($e()),
98
103
  onSuccess: w
99
104
  }), Z = le(() => V.slice(0, 40), [V]), ee = le(() => {
100
105
  const e = /* @__PURE__ */ new Map();
101
106
  for (const t of Z) {
102
- const o = t.collection && t.item ? `${t.collection}:${t.item}` : `single:${t.id}`, i = e.get(o) ?? {
107
+ const o = t.collection && t.item ? `${t.collection}:${t.item}` : `single:${t.id}`, s = e.get(o) ?? {
103
108
  key: o,
104
109
  collection: t.collection ?? null,
105
110
  item: t.item ?? null,
106
111
  rows: []
107
112
  };
108
- i.rows.push(t), e.set(o, i);
113
+ s.rows.push(t), e.set(o, s);
109
114
  }
110
115
  return [...e.values()];
111
- }, [Z]), be = (e) => {
112
- const t = R(e, s);
113
- t && (d(!1), A(t, p));
116
+ }, [Z]), ge = (e) => {
117
+ const t = R(e, l);
118
+ t && (c(!1), A(t, d));
114
119
  }, te = (e) => {
115
- d(!1), p(e);
120
+ c(!1), d(e);
116
121
  }, j = (e, t, o = !1) => {
117
- var i;
122
+ var s;
118
123
  return /* @__PURE__ */ r(ie, { children: [
119
124
  /* @__PURE__ */ r(
120
125
  "button",
121
126
  {
122
127
  type: "button",
123
128
  onClick: () => {
124
- e.read || K.mutate(e.id), be(e);
129
+ e.read || K.mutate(e.id), ge(e);
125
130
  },
126
131
  className: `flex w-full items-start gap-2.5 py-2 pr-3 text-left transition-colors ${o ? "pl-7" : "pl-3"} ${t ? "hover:bg-slate-50 dark:hover:bg-muted" : "cursor-default"}`,
127
132
  "data-notification-row": e.id,
@@ -147,14 +152,14 @@ function dt({
147
152
  /* @__PURE__ */ r("span", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[10.5px] text-slate-400", children: [
148
153
  se(e.created_at),
149
154
  /* @__PURE__ */ a(
150
- Oe,
155
+ Qe,
151
156
  {
152
157
  delivery: e.delivery,
153
- mailLogUrl: de,
158
+ mailLogUrl: ce,
154
159
  onNavigate: te
155
160
  }
156
161
  ),
157
- He(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
162
+ de(e) && // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
158
163
  /* @__PURE__ */ r(
159
164
  "span",
160
165
  {
@@ -163,14 +168,14 @@ function dt({
163
168
  "data-notification-as-it-was": e.id,
164
169
  "data-tip": "The record as it was when you were told",
165
170
  onClick: (n) => {
166
- n.stopPropagation(), d(!1), T(e);
171
+ n.stopPropagation(), c(!1), T(e);
167
172
  },
168
173
  onKeyDown: (n) => {
169
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), n.stopPropagation(), d(!1), T(e));
174
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), n.stopPropagation(), c(!1), T(e));
170
175
  },
171
176
  className: "inline-flex items-center gap-0.5 rounded px-1 text-[10.5px] text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
172
177
  children: [
173
- /* @__PURE__ */ a(qe, { className: "h-3 w-3" }),
178
+ /* @__PURE__ */ a(Ee, { className: "h-3 w-3" }),
174
179
  "as it was"
175
180
  ]
176
181
  }
@@ -197,7 +202,7 @@ function dt({
197
202
  ]
198
203
  }
199
204
  ),
200
- ((i = e.ack) == null ? void 0 : i.required) && !e.ack.at && /* @__PURE__ */ a("div", { className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`, children: /* @__PURE__ */ r(
205
+ ((s = e.ack) == null ? void 0 : s.required) && !e.ack.at && /* @__PURE__ */ a("div", { className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`, children: /* @__PURE__ */ r(
201
206
  "button",
202
207
  {
203
208
  type: "button",
@@ -206,34 +211,37 @@ function dt({
206
211
  "data-notification-acknowledge": e.id,
207
212
  className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2 py-1 text-[11px] font-medium text-white hover:opacity-90 disabled:opacity-50",
208
213
  children: [
209
- /* @__PURE__ */ a(Ee, { className: "h-3 w-3" }),
214
+ /* @__PURE__ */ a(Re, { className: "h-3 w-3" }),
210
215
  "Acknowledge"
211
216
  ]
212
217
  }
213
218
  ) }),
214
219
  e.actions && e.actions.length > 0 && !e.read && /* @__PURE__ */ a(
215
- Pe,
220
+ He,
216
221
  {
217
222
  actions: e.actions,
218
223
  notificationId: e.id,
219
- onError: ue,
224
+ onError: pe,
220
225
  className: `pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
221
226
  }
222
227
  ),
223
228
  /* @__PURE__ */ a(
224
- Qe,
229
+ Ye,
225
230
  {
226
231
  detail: e.detail,
227
232
  why: e.why,
228
233
  delivery: e.delivery,
229
- subscriptionsPath: ce,
234
+ notificationId: e.id,
235
+ recordChanges: Ge(e),
236
+ subscriptionsPath: ue,
237
+ rulesPath: me,
230
238
  onNavigate: te,
231
239
  className: `-mt-1 pb-2 pr-3 ${o ? "pl-[46px]" : "pl-[30px]"}`
232
240
  }
233
241
  )
234
242
  ] }, e.id);
235
- }, ke = (e) => {
236
- const t = `${e.collection}:${e.item}`, o = fe.has(t), i = Ke(e.lane), n = e.deleted ? null : R(Be(e), s), y = e.rows.filter((l) => !l.read).map((l) => l.id);
243
+ }, ve = (e) => {
244
+ const t = `${e.collection}:${e.item}`, o = be.has(t), s = je(e.lane), n = e.deleted ? null : R(ze(e), l), y = e.rows.filter((i) => !i.read).map((i) => i.id);
237
245
  return /* @__PURE__ */ r(
238
246
  "div",
239
247
  {
@@ -251,13 +259,13 @@ function dt({
251
259
  "aria-expanded": o,
252
260
  "aria-label": o ? "Collapse" : "Expand",
253
261
  "data-notification-bundle-expand": t,
254
- onClick: () => J((l) => {
255
- const E = new Set(l);
256
- return E.has(t) ? E.delete(t) : E.add(t), E;
262
+ onClick: () => J((i) => {
263
+ const _ = new Set(i);
264
+ return _.has(t) ? _.delete(t) : _.add(t), _;
257
265
  }),
258
266
  className: "mt-0.5 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
259
267
  children: /* @__PURE__ */ a(
260
- _e,
268
+ Ae,
261
269
  {
262
270
  className: `h-3.5 w-3.5 transition-transform ${o ? "" : "-rotate-90"}`
263
271
  }
@@ -269,7 +277,7 @@ function dt({
269
277
  {
270
278
  type: "button",
271
279
  onClick: () => {
272
- n ? (d(!1), A(n, p)) : J((l) => new Set(l).add(t));
280
+ n ? (c(!1), A(n, d)) : J((i) => new Set(i).add(t));
273
281
  },
274
282
  className: "min-w-0 flex-1 text-left",
275
283
  children: [
@@ -277,14 +285,14 @@ function dt({
277
285
  /* @__PURE__ */ a(
278
286
  "span",
279
287
  {
280
- className: `h-2 w-2 shrink-0 rounded-full ${e.unread > 0 ? i.dot : "bg-transparent"}`
288
+ className: `h-2 w-2 shrink-0 rounded-full ${e.unread > 0 ? s.dot : "bg-transparent"}`
281
289
  }
282
290
  ),
283
291
  /* @__PURE__ */ a(
284
292
  "span",
285
293
  {
286
- className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${i.text}` : "font-normal text-slate-600 dark:text-slate-400"}`,
287
- children: je(e)
294
+ className: `truncate text-[12.5px] ${e.unread > 0 ? `font-medium ${s.text}` : "font-normal text-slate-600 dark:text-slate-400"}`,
295
+ children: Oe(e)
288
296
  }
289
297
  )
290
298
  ] }),
@@ -292,7 +300,7 @@ function dt({
292
300
  e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ a(
293
301
  "span",
294
302
  {
295
- className: `rounded px-1 text-[9.5px] font-bold uppercase tracking-wide ${i.chip}`,
303
+ className: `rounded px-1 text-[9.5px] font-bold uppercase tracking-wide ${s.chip}`,
296
304
  children: "Critical"
297
305
  }
298
306
  ),
@@ -312,14 +320,14 @@ function dt({
312
320
  children: "deleted"
313
321
  }
314
322
  ),
315
- e.categories.map((l) => /* @__PURE__ */ a(
323
+ e.categories.map((i) => /* @__PURE__ */ a(
316
324
  "span",
317
325
  {
318
326
  className: "rounded bg-slate-100 px-1 py-px text-[9.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
319
- "data-notification-bundle-category": l,
320
- children: ze(l)
327
+ "data-notification-bundle-category": i,
328
+ children: Pe(i)
321
329
  },
322
- l
330
+ i
323
331
  )),
324
332
  /* @__PURE__ */ a("span", { children: e.newest ? se(e.newest) : "" }),
325
333
  e.unread > 0 && e.unread < e.count && /* @__PURE__ */ r("span", { children: [
@@ -338,7 +346,7 @@ function dt({
338
346
  type: "button",
339
347
  title: "Open record",
340
348
  onClick: () => {
341
- d(!1), A(n, p);
349
+ c(!1), A(n, d);
342
350
  },
343
351
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
344
352
  children: /* @__PURE__ */ a(re, { className: "h-3 w-3" })
@@ -362,40 +370,40 @@ function dt({
362
370
  {
363
371
  className: "border-t border-slate-50 bg-slate-50/50 dark:border-border/50 dark:bg-muted/30",
364
372
  "data-notification-bundle-rows": t,
365
- children: e.rows.map((l) => j(l, !0, !0))
373
+ children: e.rows.map((i) => j(i, !0, !0))
366
374
  }
367
375
  )
368
376
  ]
369
377
  },
370
378
  `bundle:${t}`
371
379
  );
372
- }, ge = [
380
+ }, we = [
373
381
  { key: "attention", label: "Needs you", count: I },
374
382
  { key: "fyi", label: "FYI", count: q.fyi },
375
383
  { key: "all", label: "All", count: null }
376
- ], ae = () => d((e) => (!e && f === "attention" && I === 0 && q.fyi > 0 && Y("fyi"), !e));
384
+ ], ae = () => c((e) => (!e && h === "attention" && I === 0 && q.fyi > 0 && Y("fyi"), !e));
377
385
  return /* @__PURE__ */ r("div", { ref: F, className: "relative", "data-nvr-notification-bell": !0, children: [
378
- Q ? Q({ open: x, badge: b, toggle: ae }) : /* @__PURE__ */ r(
386
+ Q ? Q({ open: f, badge: k, toggle: ae }) : /* @__PURE__ */ r(
379
387
  "button",
380
388
  {
381
389
  type: "button",
382
390
  onClick: ae,
383
391
  className: C ?? "relative rounded-md p-1.5 text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-muted",
384
- "aria-label": b ? `Notifications (${b} unread)` : "Notifications",
392
+ "aria-label": k ? `Notifications (${k} unread)` : "Notifications",
385
393
  children: [
386
- /* @__PURE__ */ a($e, { className: "h-4 w-4", strokeWidth: 1.8 }),
387
- b > 0 && /* @__PURE__ */ a(
394
+ /* @__PURE__ */ a(qe, { className: "h-4 w-4", strokeWidth: 1.8 }),
395
+ k > 0 && /* @__PURE__ */ a(
388
396
  "span",
389
397
  {
390
398
  "data-nvr-recording-hide": !0,
391
399
  className: `absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold ${q.critical > 0 ? "bg-red-500 text-white" : "bg-nvr-cyan text-nvr-navy"}`,
392
- children: b > 99 ? "99+" : b
400
+ children: k > 99 ? "99+" : k
393
401
  }
394
402
  )
395
403
  ]
396
404
  }
397
405
  ),
398
- x && (v === "right" ? Re : (e) => e)(
406
+ f && (v === "right" ? Fe : (e) => e)(
399
407
  /* @__PURE__ */ r(
400
408
  "div",
401
409
  {
@@ -406,13 +414,13 @@ function dt({
406
414
  children: [
407
415
  S,
408
416
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 dark:border-border/60", children: [
409
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: ge.map((e) => /* @__PURE__ */ r(
417
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1 rounded-md bg-slate-100 p-0.5 dark:bg-muted", children: we.map((e) => /* @__PURE__ */ r(
410
418
  "button",
411
419
  {
412
420
  type: "button",
413
421
  onClick: () => Y(e.key),
414
422
  "data-nvr-lane-tab": e.key,
415
- className: f === e.key ? "rounded bg-white px-2 py-0.5 text-[11px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-slate-100" : "rounded px-2 py-0.5 text-[11px] font-medium text-slate-500 hover:text-slate-700 dark:text-slate-400",
423
+ className: h === e.key ? "rounded bg-white px-2 py-0.5 text-[11px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-slate-100" : "rounded px-2 py-0.5 text-[11px] font-medium text-slate-500 hover:text-slate-700 dark:text-slate-400",
416
424
  children: [
417
425
  e.label,
418
426
  e.count != null && e.count > 0 && /* @__PURE__ */ a(
@@ -430,10 +438,10 @@ function dt({
430
438
  "button",
431
439
  {
432
440
  type: "button",
433
- onClick: () => he.mutate(),
441
+ onClick: () => ke.mutate(),
434
442
  className: "inline-flex items-center gap-1 text-[11px] font-medium text-slate-400 transition-colors hover:text-nvr-cyan",
435
443
  children: [
436
- /* @__PURE__ */ a(Se, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
444
+ /* @__PURE__ */ a(_e, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
437
445
  "Mark all read"
438
446
  ]
439
447
  }
@@ -442,18 +450,18 @@ function dt({
442
450
  /* @__PURE__ */ r("div", { className: "max-h-96 overflow-y-auto", children: [
443
451
  D.length > 0 && /* @__PURE__ */ r("div", { "data-notification-pinned": !0, children: [
444
452
  /* @__PURE__ */ a("div", { className: "bg-amber-50 px-3 py-1 text-[10px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: "Needs your acknowledgement" }),
445
- D.map((e) => /* @__PURE__ */ a(ie, { children: j(e, !!R(e, s)) }, e.id))
453
+ D.map((e) => /* @__PURE__ */ a(ie, { children: j(e, !!R(e, l)) }, e.id))
446
454
  ] }),
447
- ee.length === 0 && W.length === 0 && D.length === 0 ? /* @__PURE__ */ a("p", { className: "px-3 py-6 text-center text-[12px] text-slate-400", children: f === "attention" ? "Nothing needs you right now." : f === "fyi" ? "No FYI notifications." : "No notifications" }) : [
448
- ...W.map(ke),
455
+ ee.length === 0 && W.length === 0 && D.length === 0 ? /* @__PURE__ */ a("p", { className: "px-3 py-6 text-center text-[12px] text-slate-400", children: h === "attention" ? "Nothing needs you right now." : h === "fyi" ? "No FYI notifications." : "No notifications" }) : [
456
+ ...W.map(ve),
449
457
  ...ee.map((e) => {
450
- const t = e.rows.filter((l) => !l.read).map((l) => l.id), o = R(e.rows[0], s), i = !!o, n = e.rows[0], y = n != null && n.target_label && (n == null ? void 0 : n.kind) !== "record" ? `${n.target_label}${e.item ? ` · ${e.item}` : ""}` : String(e.collection) === "__chat__" ? "Chat" : e.collection ? `${String(e.collection).replace(/_/g, " ")}${e.item ? ` · ${e.item}` : ""}` : null;
458
+ const t = e.rows.filter((i) => !i.read).map((i) => i.id), o = R(e.rows[0], l), s = !!o, n = e.rows[0], y = n != null && n.target_label && (n == null ? void 0 : n.kind) !== "record" ? `${n.target_label}${e.item ? ` · ${e.item}` : ""}` : String(e.collection) === "__chat__" ? "Chat" : e.collection ? `${String(e.collection).replace(/_/g, " ")}${e.item ? ` · ${e.item}` : ""}` : null;
451
459
  return /* @__PURE__ */ r(
452
460
  "div",
453
461
  {
454
462
  className: "border-b border-slate-50 last:border-b-0 dark:border-border/50",
455
463
  children: [
456
- i && y && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 px-3 pt-2", children: [
464
+ s && y && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 px-3 pt-2", children: [
457
465
  /* @__PURE__ */ r("span", { className: "truncate text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: [
458
466
  y,
459
467
  e.rows.length > 1 ? ` · ${e.rows.length}` : ""
@@ -465,7 +473,7 @@ function dt({
465
473
  type: "button",
466
474
  title: "Open record",
467
475
  onClick: () => {
468
- t.length && B.mutate(t), d(!1), A(o, p);
476
+ t.length && B.mutate(t), c(!1), A(o, d);
469
477
  },
470
478
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
471
479
  children: /* @__PURE__ */ a(re, { className: "h-3 w-3" })
@@ -483,7 +491,7 @@ function dt({
483
491
  )
484
492
  ] })
485
493
  ] }),
486
- e.rows.map((l) => j(l, i))
494
+ e.rows.map((i) => j(i, s))
487
495
  ]
488
496
  },
489
497
  e.key
@@ -496,7 +504,7 @@ function dt({
496
504
  {
497
505
  type: "button",
498
506
  onClick: () => {
499
- d(!1), p(H);
507
+ c(!1), d(H);
500
508
  },
501
509
  className: "block w-full border-t border-slate-100 px-3 py-1.5 text-center text-[11px] font-medium text-slate-500 hover:text-nvr-cyan dark:border-border/60",
502
510
  children: "See all notifications"
@@ -508,16 +516,17 @@ function dt({
508
516
  document.body
509
517
  ),
510
518
  /* @__PURE__ */ a(
511
- De,
519
+ Ke,
512
520
  {
513
- notificationId: (k == null ? void 0 : k.id) ?? null,
514
- title: (k == null ? void 0 : k.title) ?? null,
521
+ notificationId: (g == null ? void 0 : g.id) ?? null,
522
+ title: (g == null ? void 0 : g.title) ?? null,
515
523
  onClose: () => T(null)
516
524
  }
517
525
  )
518
526
  ] });
519
527
  }
520
528
  export {
521
- dt as NotificationBell,
522
- He as hasSnapshotView
529
+ ut as NotificationBell,
530
+ de as hasSnapshotView,
531
+ Ge as offersChanges
523
532
  };