@nivaro/react 0.3.116 → 0.3.118
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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +140 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3855 -3785
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ReportView.js +1086 -1091
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/cbv/column-totals.js +62 -57
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/charts/category-axis.js +93 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/use-query-entry.js +17 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,252 +1,252 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { ChevronUp as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { useTopInserts as Pe, slideIn as
|
|
8
|
-
import { resolveNotificationTargetFor as V, runNotificationTarget as
|
|
9
|
-
import { openInTabsMessage as
|
|
10
|
-
import { useRecordPeek as jt, isNewTabClick as
|
|
11
|
-
import { cn as
|
|
12
|
-
import { AgentBadge as
|
|
13
|
-
import {
|
|
14
|
-
import { RelativeTime as
|
|
15
|
-
import { SimpleSelect as
|
|
16
|
-
import { AsItWasSheet as
|
|
17
|
-
import { bundleLocally as
|
|
18
|
-
import { DeliveryChips as
|
|
19
|
-
import { NotificationActions as
|
|
20
|
-
import { NotificationChangesList as
|
|
21
|
-
const
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as ue } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as Ct, useQuery as G, keepPreviousData as St, useMutation as D } from "@tanstack/react-query";
|
|
3
|
+
import { ChevronUp as _t, Archive as Te, CheckCheck as At, Search as Dt, Check as me, AlarmClock as pe, ExternalLink as Le, Bell as Re, ShieldCheck as he, ChevronLeft as $t, ChevronRight as zt, History as Ft, Trash2 as qt, ChevronDown as Mt } from "lucide-react";
|
|
4
|
+
import { useState as u, useEffect as be, useRef as Tt, useCallback as Lt, Fragment as xe } from "react";
|
|
5
|
+
import { useNivaroClient as Rt } from "../../context.js";
|
|
6
|
+
import { get as H, post as S, patch as Pt, del as Ot } from "../../lib/commands.js";
|
|
7
|
+
import { useTopInserts as Pe, slideIn as It } from "../../lib/live-screen.js";
|
|
8
|
+
import { resolveNotificationTargetFor as V, runNotificationTarget as fe } from "../../lib/notification-target.js";
|
|
9
|
+
import { openInTabsMessage as Bt, openInTabs as Kt } from "../../lib/open-in-tabs.js";
|
|
10
|
+
import { useRecordPeek as jt, isNewTabClick as Ut, notificationPeekTarget as Oe } from "../../lib/record-peek.js";
|
|
11
|
+
import { cn as x, formatRelative as Ie } from "../../lib/utils.js";
|
|
12
|
+
import { AgentBadge as Gt } from "../AgentBadge.js";
|
|
13
|
+
import { bellGroupLabel as Ht, hasSnapshotView as Qt, offersChanges as Yt } from "../NotificationBell.js";
|
|
14
|
+
import { RelativeTime as Be } from "../RelativeTime.js";
|
|
15
|
+
import { SimpleSelect as ge } from "../ui/SimpleSelect.js";
|
|
16
|
+
import { AsItWasSheet as Vt } from "./AsItWasSheet.js";
|
|
17
|
+
import { bundleLocally as Wt, laneTone as Zt, bundleAsNotification as Jt, bundleHeadline as Ke, categoryChipLabel as Xt } from "./bundles.js";
|
|
18
|
+
import { DeliveryChips as Et } from "./DeliveryChips.js";
|
|
19
|
+
import { NotificationActions as ea } from "./NotificationActions.js";
|
|
20
|
+
import { NotificationChangesList as ta, ResolvedLine as aa, NotificationDetailBits as na } from "./NotificationDetailBits.js";
|
|
21
|
+
const ke = 25, la = [
|
|
22
22
|
{ key: "all", label: "All" },
|
|
23
23
|
{ key: "inbox", label: "Unread" },
|
|
24
24
|
{ key: "read", label: "Read" },
|
|
25
25
|
{ key: "snoozed", label: "Snoozed" },
|
|
26
26
|
{ key: "archived", label: "Archived" },
|
|
27
27
|
{ key: "sent", label: "Sent" }
|
|
28
|
-
],
|
|
28
|
+
], ra = [
|
|
29
29
|
{ key: "all", label: "Every lane" },
|
|
30
30
|
{ key: "critical", label: "Critical" },
|
|
31
31
|
{ key: "needs_you", label: "Needs you" },
|
|
32
32
|
{ key: "fyi", label: "FYI" }
|
|
33
33
|
];
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
-
{ label: "For 1 hour", until:
|
|
40
|
-
{ label: "Until tomorrow 8am", until:
|
|
41
|
-
{ label: "Until next week", until:
|
|
34
|
+
function je() {
|
|
35
|
+
const o = /* @__PURE__ */ new Date(), p = new Date(o.getTime() + 3600 * 1e3), f = new Date(o);
|
|
36
|
+
f.setDate(f.getDate() + 1), f.setHours(8, 0, 0, 0);
|
|
37
|
+
const g = new Date(o);
|
|
38
|
+
return g.setDate(g.getDate() + ((8 - g.getDay()) % 7 || 7)), g.setHours(8, 0, 0, 0), [
|
|
39
|
+
{ label: "For 1 hour", until: p },
|
|
40
|
+
{ label: "Until tomorrow 8am", until: f },
|
|
41
|
+
{ label: "Until next week", until: g }
|
|
42
42
|
];
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
function
|
|
46
|
-
routes:
|
|
47
|
-
onNavigate:
|
|
48
|
-
app:
|
|
49
|
-
mailLogUrl:
|
|
50
|
-
subscriptionsPath:
|
|
44
|
+
const Ue = (o) => `b:${o.collection}:${o.item}`, Ge = (o) => `n:${o.id}`;
|
|
45
|
+
function Aa({
|
|
46
|
+
routes: o,
|
|
47
|
+
onNavigate: p,
|
|
48
|
+
app: f,
|
|
49
|
+
mailLogUrl: g,
|
|
50
|
+
subscriptionsPath: W,
|
|
51
51
|
rulesPath: Qe,
|
|
52
|
-
changesId:
|
|
52
|
+
changesId: ve,
|
|
53
53
|
onNotice: r,
|
|
54
|
-
onError:
|
|
55
|
-
className:
|
|
54
|
+
onError: i,
|
|
55
|
+
className: Ye
|
|
56
56
|
}) {
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
57
|
+
const h = Rt(), Z = jt(), J = Ct(), [X, Ve] = u(() => {
|
|
58
|
+
if (ve !== void 0) return ve;
|
|
59
59
|
if (typeof window > "u") return null;
|
|
60
|
-
const e = new URLSearchParams(window.location.search).get("changes"),
|
|
61
|
-
return e && Number.isInteger(
|
|
62
|
-
}), [
|
|
63
|
-
queryKey: ["notifications", "sent",
|
|
64
|
-
queryFn: () =>
|
|
65
|
-
|
|
60
|
+
const e = new URLSearchParams(window.location.search).get("changes"), n = Number(e);
|
|
61
|
+
return e && Number.isInteger(n) && n > 0 ? n : null;
|
|
62
|
+
}), [d, We] = u("all"), [N, Ze] = u("all"), [Q, Je] = u(!0), { data: ye = [], isLoading: Xe } = G({
|
|
63
|
+
queryKey: ["notifications", "sent", Q],
|
|
64
|
+
queryFn: () => h.request(
|
|
65
|
+
H("/notifications/sent", { lane: Q ? "critical" : "all" })
|
|
66
66
|
).then((e) => e.data ?? []),
|
|
67
|
-
enabled:
|
|
68
|
-
refetchInterval:
|
|
69
|
-
}), [
|
|
70
|
-
|
|
71
|
-
Y(/* @__PURE__ */ new Set()),
|
|
72
|
-
}, [
|
|
67
|
+
enabled: d === "sent",
|
|
68
|
+
refetchInterval: d === "sent" ? 3e4 : !1
|
|
69
|
+
}), [_, q] = u(1), [Ee, E] = u(null), [we, Ne] = u(null), [ee, et] = u(""), [M, tt] = u(""), [$, at] = u(""), [B, nt] = u(!0), [lt, rt] = u(() => /* @__PURE__ */ new Set()), [C, Ce] = u(null), [T, Y] = u(() => /* @__PURE__ */ new Set()), [te, K] = u(!1), [it, ae] = u(!1), [ne, dt] = u(!1), [Se, st] = u("30");
|
|
70
|
+
be(() => {
|
|
71
|
+
Y(/* @__PURE__ */ new Set()), K(!1), ae(!1);
|
|
72
|
+
}, [d, N, _, M, $]), be(() => {
|
|
73
73
|
const e = setTimeout(() => {
|
|
74
|
-
|
|
74
|
+
tt(ee.trim()), q(1);
|
|
75
75
|
}, 350);
|
|
76
76
|
return () => clearTimeout(e);
|
|
77
|
-
}, [
|
|
78
|
-
const { data:
|
|
77
|
+
}, [ee]);
|
|
78
|
+
const { data: b } = G({
|
|
79
79
|
queryKey: ["notification-count"],
|
|
80
|
-
queryFn: () =>
|
|
81
|
-
}), { data:
|
|
80
|
+
queryFn: () => h.request(H("/notifications/unread-count"))
|
|
81
|
+
}), { data: m, isLoading: ot, isPlaceholderData: ct } = G({
|
|
82
82
|
queryKey: [
|
|
83
83
|
"notifications",
|
|
84
84
|
"center",
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
d,
|
|
86
|
+
N,
|
|
87
|
+
_,
|
|
88
|
+
M,
|
|
89
|
+
$,
|
|
90
|
+
f ?? null,
|
|
91
|
+
B
|
|
92
92
|
],
|
|
93
|
-
queryFn: () =>
|
|
94
|
-
|
|
95
|
-
page:
|
|
96
|
-
limit:
|
|
97
|
-
status:
|
|
98
|
-
snoozed:
|
|
99
|
-
lane:
|
|
100
|
-
search:
|
|
101
|
-
collection:
|
|
102
|
-
app:
|
|
103
|
-
bundle:
|
|
93
|
+
queryFn: () => h.request(
|
|
94
|
+
H("/notifications", {
|
|
95
|
+
page: _,
|
|
96
|
+
limit: ke,
|
|
97
|
+
status: d === "snoozed" || d === "sent" ? "all" : d,
|
|
98
|
+
snoozed: d === "snoozed" ? "true" : void 0,
|
|
99
|
+
lane: N === "all" ? void 0 : N,
|
|
100
|
+
search: M || void 0,
|
|
101
|
+
collection: $ || void 0,
|
|
102
|
+
app: f,
|
|
103
|
+
bundle: B ? "record" : void 0
|
|
104
104
|
})
|
|
105
105
|
).then((e) => {
|
|
106
|
-
if (!
|
|
107
|
-
const
|
|
108
|
-
return { ...e, data:
|
|
106
|
+
if (!B || e.bundles) return e;
|
|
107
|
+
const n = Wt(e.data ?? []);
|
|
108
|
+
return { ...e, data: n.rows, bundles: n.bundles };
|
|
109
109
|
}),
|
|
110
|
-
placeholderData:
|
|
111
|
-
enabled:
|
|
112
|
-
}), { data:
|
|
110
|
+
placeholderData: St,
|
|
111
|
+
enabled: d !== "sent"
|
|
112
|
+
}), { data: ut = [] } = G({
|
|
113
113
|
queryKey: ["notifications", "center", "collections"],
|
|
114
|
-
queryFn: () =>
|
|
115
|
-
|
|
114
|
+
queryFn: () => h.request(
|
|
115
|
+
H("/collections")
|
|
116
116
|
).then((e) => {
|
|
117
|
-
const
|
|
118
|
-
return [...new Set(
|
|
117
|
+
const n = Array.isArray(e) ? e : e.data ?? [];
|
|
118
|
+
return [...new Set(n.map((l) => l.collection))].sort();
|
|
119
119
|
}),
|
|
120
120
|
staleTime: 3e5
|
|
121
|
-
}), z =
|
|
122
|
-
enabled:
|
|
123
|
-
resetKey:
|
|
124
|
-
}), P = Pe(
|
|
125
|
-
enabled:
|
|
126
|
-
resetKey:
|
|
127
|
-
}),
|
|
121
|
+
}), z = d === "archived" || _ > 1 ? [] : (m == null ? void 0 : m.pinned) ?? [], mt = new Set(z.map((e) => e.id)), L = ((m == null ? void 0 : m.data) ?? []).filter((e) => !mt.has(e.id)), j = (m == null ? void 0 : m.bundles) ?? [], F = (m == null ? void 0 : m.total) ?? 0, le = Math.max(1, Math.ceil(F / ke)), _e = d !== "sent" && _ === 1 && !!m && !ct, Ae = [d, N, M, $, f ?? "", B].join("|"), R = Pe(m ? j : void 0, Ue, {
|
|
122
|
+
enabled: _e,
|
|
123
|
+
resetKey: Ae
|
|
124
|
+
}), P = Pe(m ? L : void 0, Ge, {
|
|
125
|
+
enabled: _e,
|
|
126
|
+
resetKey: Ae
|
|
127
|
+
}), pt = m ? R.rows : j, De = m ? P.rows : L, re = R.held + P.held, $e = Tt(null), ze = R.rootRef, Fe = P.rootRef, ht = Lt(
|
|
128
128
|
(e) => {
|
|
129
|
-
|
|
129
|
+
$e.current = e, ze(e), Fe(e);
|
|
130
130
|
},
|
|
131
|
-
[
|
|
131
|
+
[ze, Fe]
|
|
132
132
|
);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}, [
|
|
133
|
+
be(() => {
|
|
134
|
+
It($e.current, [...R.arrived, ...P.arrived]);
|
|
135
|
+
}, [R.arrived, P.arrived]);
|
|
136
136
|
const bt = () => {
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
mutationFn: (e) =>
|
|
142
|
-
onSuccess:
|
|
143
|
-
onError: () =>
|
|
144
|
-
}),
|
|
145
|
-
mutationFn: () =>
|
|
137
|
+
R.reveal(), P.reveal();
|
|
138
|
+
}, w = () => {
|
|
139
|
+
J.invalidateQueries({ queryKey: ["notifications"] }), J.invalidateQueries({ queryKey: ["notification-count"] });
|
|
140
|
+
}, xt = D({
|
|
141
|
+
mutationFn: (e) => h.request(S("/notifications/mark-read", { ids: e })),
|
|
142
|
+
onSuccess: w,
|
|
143
|
+
onError: () => i == null ? void 0 : i("Failed to mark the bundle read")
|
|
144
|
+
}), ie = D({
|
|
145
|
+
mutationFn: () => h.request(S("/notifications/mark-all-read")),
|
|
146
146
|
onSuccess: () => {
|
|
147
|
-
|
|
147
|
+
w(), r == null || r("All notifications marked as read");
|
|
148
148
|
},
|
|
149
|
-
onError: () =>
|
|
150
|
-
}), U =
|
|
149
|
+
onError: () => i == null ? void 0 : i("Failed to mark all read")
|
|
150
|
+
}), U = D({
|
|
151
151
|
mutationFn: ({
|
|
152
152
|
id: e,
|
|
153
|
-
until:
|
|
153
|
+
until: n,
|
|
154
154
|
untilChange: l
|
|
155
|
-
}) =>
|
|
156
|
-
|
|
155
|
+
}) => h.request(
|
|
156
|
+
S(
|
|
157
157
|
`/notifications/${e}/snooze`,
|
|
158
|
-
l ? { until_change: !0 } : { until:
|
|
158
|
+
l ? { until_change: !0 } : { until: n ? n.toISOString() : null }
|
|
159
159
|
)
|
|
160
160
|
),
|
|
161
|
-
onSuccess: (e,
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
onSuccess: (e, n) => {
|
|
162
|
+
w(), Ne(null), r == null || r(
|
|
163
|
+
n.untilChange ? "Snoozed — it comes back when someone changes the record" : n.until ? "Snoozed — it will return unread" : "Snooze cleared"
|
|
164
164
|
);
|
|
165
165
|
},
|
|
166
|
-
onError: () =>
|
|
167
|
-
}),
|
|
168
|
-
mutationFn: (e) =>
|
|
166
|
+
onError: () => i == null ? void 0 : i("Failed to snooze")
|
|
167
|
+
}), qe = D({
|
|
168
|
+
mutationFn: (e) => h.request(S(`/notifications/${e}/acknowledge`)),
|
|
169
169
|
onSuccess: () => {
|
|
170
|
-
|
|
170
|
+
w(), r == null || r("Acknowledged");
|
|
171
171
|
},
|
|
172
|
-
onError: () =>
|
|
173
|
-
}),
|
|
174
|
-
status:
|
|
175
|
-
snoozed:
|
|
176
|
-
lane:
|
|
177
|
-
search:
|
|
178
|
-
collection:
|
|
179
|
-
}),
|
|
180
|
-
mutationFn: (e) =>
|
|
181
|
-
|
|
172
|
+
onError: () => i == null ? void 0 : i("Failed to acknowledge")
|
|
173
|
+
}), ft = () => ({
|
|
174
|
+
status: d === "snoozed" || d === "sent" ? "all" : d,
|
|
175
|
+
snoozed: d === "snoozed" ? "true" : void 0,
|
|
176
|
+
lane: N === "all" ? void 0 : N,
|
|
177
|
+
search: M || void 0,
|
|
178
|
+
collection: $ || void 0
|
|
179
|
+
}), O = D({
|
|
180
|
+
mutationFn: (e) => h.request(
|
|
181
|
+
S("/notifications/bulk-action", {
|
|
182
182
|
action: e.action,
|
|
183
183
|
until: e.until ? e.until.toISOString() : void 0,
|
|
184
|
-
...
|
|
184
|
+
...te ? { filter: ft() } : { ids: [...T] }
|
|
185
185
|
})
|
|
186
186
|
),
|
|
187
|
-
onSuccess: (e,
|
|
187
|
+
onSuccess: (e, n) => {
|
|
188
188
|
var s;
|
|
189
|
-
|
|
189
|
+
w(), Y(/* @__PURE__ */ new Set()), K(!1), ae(!1);
|
|
190
190
|
const l = ((s = e.data) == null ? void 0 : s.updated) ?? 0;
|
|
191
191
|
r == null || r(
|
|
192
|
-
`${l} notification${l === 1 ? "" : "s"} ${
|
|
192
|
+
`${l} notification${l === 1 ? "" : "s"} ${n.action === "read" ? "marked read" : n.action === "archive" ? "archived" : "snoozed"}`
|
|
193
193
|
);
|
|
194
194
|
},
|
|
195
|
-
onError: () =>
|
|
196
|
-
}),
|
|
197
|
-
mutationFn: (e) =>
|
|
195
|
+
onError: () => i == null ? void 0 : i("That bulk action failed")
|
|
196
|
+
}), de = D({
|
|
197
|
+
mutationFn: (e) => h.request(S("/notifications/archive-read", { days: e })),
|
|
198
198
|
onSuccess: (e) => {
|
|
199
|
-
var
|
|
200
|
-
|
|
199
|
+
var n;
|
|
200
|
+
w(), r == null || r(`${((n = e.data) == null ? void 0 : n.updated) ?? 0} archived — find them under Archived`);
|
|
201
201
|
},
|
|
202
|
-
onError: () =>
|
|
203
|
-
}), { data:
|
|
202
|
+
onError: () => i == null ? void 0 : i("Clean-up failed")
|
|
203
|
+
}), { data: se } = G({
|
|
204
204
|
queryKey: ["nvr-profile-prefs"],
|
|
205
|
-
queryFn: () =>
|
|
206
|
-
var
|
|
207
|
-
return ((
|
|
205
|
+
queryFn: () => h.request(H("/users/me")).then((e) => {
|
|
206
|
+
var n;
|
|
207
|
+
return ((n = e.data) == null ? void 0 : n.preferences) ?? {};
|
|
208
208
|
}),
|
|
209
|
-
enabled:
|
|
210
|
-
}),
|
|
211
|
-
mutationFn: (e) =>
|
|
209
|
+
enabled: ne
|
|
210
|
+
}), gt = D({
|
|
211
|
+
mutationFn: (e) => h.request(Pt("/users/me/preferences", { notification_cleanup_days: e })),
|
|
212
212
|
onSuccess: () => {
|
|
213
|
-
|
|
213
|
+
J.invalidateQueries({ queryKey: ["nvr-profile-prefs"] }), r == null || r("Automatic clean-up saved");
|
|
214
214
|
},
|
|
215
|
-
onError: () =>
|
|
216
|
-
}),
|
|
217
|
-
mutationFn: (e) =>
|
|
215
|
+
onError: () => i == null ? void 0 : i("Could not save the clean-up setting")
|
|
216
|
+
}), oe = D({
|
|
217
|
+
mutationFn: (e) => h.request(Ot(`/notifications/${e}`)),
|
|
218
218
|
onSuccess: () => {
|
|
219
|
-
|
|
219
|
+
w(), E(null), r == null || r("Notification deleted");
|
|
220
220
|
},
|
|
221
|
-
onError: () =>
|
|
222
|
-
}),
|
|
223
|
-
await
|
|
224
|
-
}),
|
|
225
|
-
},
|
|
226
|
-
const l =
|
|
227
|
-
if (l &&
|
|
228
|
-
const s =
|
|
229
|
-
|
|
230
|
-
}).then(() =>
|
|
221
|
+
onError: () => i == null ? void 0 : i("Failed to delete notification")
|
|
222
|
+
}), kt = async (e) => {
|
|
223
|
+
await h.request(S(`/notifications/${e}/read`)).catch(() => {
|
|
224
|
+
}), w();
|
|
225
|
+
}, vt = async (e, n) => {
|
|
226
|
+
const l = Z && !Ut(n) ? Oe(e) : null;
|
|
227
|
+
if (l && Z) {
|
|
228
|
+
const s = L.map((k) => Oe(k)).filter((k) => !!k);
|
|
229
|
+
Z.open(l, { list: s }), e.read || h.request(S(`/notifications/${e.id}/read`)).catch(() => {
|
|
230
|
+
}).then(() => w());
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
|
-
e.read || (await
|
|
234
|
-
}),
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
const l = new Set(
|
|
233
|
+
e.read || (await h.request(S(`/notifications/${e.id}/read`)).catch(() => {
|
|
234
|
+
}), w()), fe(V(e, o), p);
|
|
235
|
+
}, yt = (e) => {
|
|
236
|
+
K(!1), Y((n) => {
|
|
237
|
+
const l = new Set(n);
|
|
238
238
|
return l.has(e) ? l.delete(e) : l.add(e), l;
|
|
239
239
|
});
|
|
240
|
-
},
|
|
241
|
-
var
|
|
242
|
-
const l = !e.read, s = V(e,
|
|
243
|
-
/* @__PURE__ */
|
|
240
|
+
}, ce = (e, n = !1) => {
|
|
241
|
+
var I, A, c, v;
|
|
242
|
+
const l = !e.read, s = V(e, o), k = /* @__PURE__ */ a(ue, { children: [
|
|
243
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-baseline gap-x-2 sm:flex-nowrap", children: [
|
|
244
244
|
e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
245
245
|
e.lane === "needs_you" && l && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-nvr-cyan/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-nvr-navy dark:text-nvr-cyan", children: "Needs you" }),
|
|
246
246
|
/* @__PURE__ */ t(
|
|
247
247
|
"span",
|
|
248
248
|
{
|
|
249
|
-
className:
|
|
249
|
+
className: x(
|
|
250
250
|
// Wraps on a phone so the sender and what changed stay readable; one line on wider screens.
|
|
251
251
|
"min-w-0 break-words text-[13px] sm:truncate",
|
|
252
252
|
l ? "font-medium text-slate-900 dark:text-slate-100" : "font-normal text-slate-600 dark:text-slate-400"
|
|
@@ -254,22 +254,22 @@ function Sa({
|
|
|
254
254
|
children: e.subject ?? e.title ?? "—"
|
|
255
255
|
}
|
|
256
256
|
),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */ t(
|
|
259
|
-
/* @__PURE__ */ t(
|
|
257
|
+
/* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1.5 text-[10.5px] text-slate-400", children: [
|
|
258
|
+
/* @__PURE__ */ t(Gt, { label: (I = e.detail) == null ? void 0 : I.via_agent }),
|
|
259
|
+
/* @__PURE__ */ t(Be, { value: e.created_at ?? /* @__PURE__ */ new Date() })
|
|
260
260
|
] })
|
|
261
261
|
] }),
|
|
262
|
-
e.message && /* @__PURE__ */ t(
|
|
263
|
-
/* @__PURE__ */ t(
|
|
262
|
+
e.message && /* @__PURE__ */ t(ia, { text: e.message.replace(/<[^>]+>/g, "") }),
|
|
263
|
+
/* @__PURE__ */ t(aa, { resolved: (A = e.detail) == null ? void 0 : A.resolved, className: "text-[11.5px]" })
|
|
264
264
|
] });
|
|
265
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ a(
|
|
266
266
|
"div",
|
|
267
267
|
{
|
|
268
|
-
className:
|
|
268
|
+
className: x(
|
|
269
269
|
"group relative flex items-start gap-3 py-3",
|
|
270
270
|
// Only a row that opens something lights up under the pointer.
|
|
271
271
|
s && "transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/40",
|
|
272
|
-
|
|
272
|
+
n ? "bg-slate-50/50 pl-8 pr-4 dark:bg-muted/30" : "px-4"
|
|
273
273
|
),
|
|
274
274
|
"data-notification-row": e.id,
|
|
275
275
|
"data-nvr-lane-row": e.lane ?? "",
|
|
@@ -278,8 +278,8 @@ function Sa({
|
|
|
278
278
|
"input",
|
|
279
279
|
{
|
|
280
280
|
type: "checkbox",
|
|
281
|
-
checked:
|
|
282
|
-
onChange: () =>
|
|
281
|
+
checked: T.has(e.id),
|
|
282
|
+
onChange: () => yt(e.id),
|
|
283
283
|
"aria-label": "Select notification",
|
|
284
284
|
"data-notification-select": e.id,
|
|
285
285
|
className: "mt-1.5 h-3.5 w-3.5 shrink-0"
|
|
@@ -288,29 +288,29 @@ function Sa({
|
|
|
288
288
|
/* @__PURE__ */ t(
|
|
289
289
|
"span",
|
|
290
290
|
{
|
|
291
|
-
className:
|
|
291
|
+
className: x(
|
|
292
292
|
"mt-2 h-2 w-2 shrink-0 rounded-full",
|
|
293
293
|
l ? e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan" : "bg-transparent"
|
|
294
294
|
)
|
|
295
295
|
}
|
|
296
296
|
),
|
|
297
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
298
298
|
s ? /* @__PURE__ */ t(
|
|
299
299
|
"button",
|
|
300
300
|
{
|
|
301
301
|
type: "button",
|
|
302
|
-
onClick: (
|
|
302
|
+
onClick: (y) => void vt(e, y),
|
|
303
303
|
className: "block w-full text-left",
|
|
304
|
-
children:
|
|
304
|
+
children: k
|
|
305
305
|
}
|
|
306
306
|
) : (
|
|
307
307
|
// Nowhere to open: plain text, read or not. As a button its click
|
|
308
308
|
// only marked the row read, so the row dimmed (or left the Unread
|
|
309
309
|
// list) and opened nothing. Mark read is its own control below.
|
|
310
|
-
/* @__PURE__ */ t("div", { "data-notification-plain": !0, children:
|
|
310
|
+
/* @__PURE__ */ t("div", { "data-notification-plain": !0, children: k })
|
|
311
311
|
),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
e.sender_name && /* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ a("div", { className: "mt-1 flex flex-wrap items-center gap-2", children: [
|
|
313
|
+
e.sender_name && /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", children: [
|
|
314
314
|
"From ",
|
|
315
315
|
e.sender_name
|
|
316
316
|
] }),
|
|
@@ -318,90 +318,94 @@ function Sa({
|
|
|
318
318
|
"button",
|
|
319
319
|
{
|
|
320
320
|
type: "button",
|
|
321
|
-
onClick: () =>
|
|
321
|
+
onClick: () => fe(s, p),
|
|
322
322
|
...e.collection && !e.item && s.type !== "chat" && s.type !== "external" ? {
|
|
323
|
-
"aria-label": `See what changed in ${
|
|
324
|
-
"data-tip": `See what changed in ${
|
|
323
|
+
"aria-label": `See what changed in ${He(e.collection)}`,
|
|
324
|
+
"data-tip": `See what changed in ${He(e.collection)}`
|
|
325
325
|
} : {},
|
|
326
326
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
327
|
-
children: s.type === "chat" ? "Open chat" : s.type === "external" ? "Open in app ↗" : e.target_label && e.kind !== "record" ? `${e.target_label}${e.item ? ` #${e.item}` : ""}` : e.collection === "__chat__" ? "Chat" : e.collection && !e.item ? "See changes" : e.collection ?
|
|
327
|
+
children: s.type === "chat" ? "Open chat" : s.type === "external" ? "Open in app ↗" : e.target_label && e.kind !== "record" ? `${e.target_label}${e.item ? ` #${e.item}` : ""}` : e.collection === "__chat__" ? "Chat" : e.collection && !e.item ? "See changes" : e.collection ? (
|
|
328
|
+
// The record's friendly id ("Workflow TP26-80418"), as the title
|
|
329
|
+
// names it — never the table name and row id.
|
|
330
|
+
(e.record_label ? Ht(e) : null) ?? `${e.collection} #${e.item}`
|
|
331
|
+
) : "Open"
|
|
328
332
|
}
|
|
329
333
|
),
|
|
330
|
-
l && !s && /* @__PURE__ */
|
|
334
|
+
l && !s && /* @__PURE__ */ a(
|
|
331
335
|
"button",
|
|
332
336
|
{
|
|
333
337
|
type: "button",
|
|
334
338
|
"data-notification-mark-read": e.id,
|
|
335
|
-
onClick: () => void
|
|
339
|
+
onClick: () => void kt(e.id),
|
|
336
340
|
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
337
341
|
children: [
|
|
338
|
-
/* @__PURE__ */ t(
|
|
342
|
+
/* @__PURE__ */ t(me, { className: "h-3 w-3" }),
|
|
339
343
|
"Mark read"
|
|
340
344
|
]
|
|
341
345
|
}
|
|
342
346
|
),
|
|
343
|
-
/* @__PURE__ */ t(
|
|
344
|
-
|
|
347
|
+
/* @__PURE__ */ t(Et, { delivery: e.delivery, mailLogUrl: g, onNavigate: p }),
|
|
348
|
+
Qt(e) && /* @__PURE__ */ a(
|
|
345
349
|
"button",
|
|
346
350
|
{
|
|
347
351
|
type: "button",
|
|
348
352
|
"data-notification-as-it-was": e.id,
|
|
349
353
|
"data-tip": "The record as it was when you were told",
|
|
350
|
-
onClick: () =>
|
|
354
|
+
onClick: () => Ce(e),
|
|
351
355
|
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10px] font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
352
356
|
children: [
|
|
353
|
-
/* @__PURE__ */ t(
|
|
354
|
-
"
|
|
357
|
+
/* @__PURE__ */ t(Ft, { className: "h-3 w-3" }),
|
|
358
|
+
"Record when sent"
|
|
355
359
|
]
|
|
356
360
|
}
|
|
357
361
|
)
|
|
358
362
|
] }),
|
|
359
363
|
/* @__PURE__ */ t(
|
|
360
|
-
|
|
364
|
+
na,
|
|
361
365
|
{
|
|
362
366
|
detail: e.detail,
|
|
363
367
|
why: e.why,
|
|
364
368
|
delivery: e.delivery,
|
|
365
369
|
notificationId: e.id,
|
|
366
|
-
recordChanges:
|
|
367
|
-
subscriptionsPath:
|
|
370
|
+
recordChanges: Yt(e),
|
|
371
|
+
subscriptionsPath: W,
|
|
368
372
|
rulesPath: Qe,
|
|
369
|
-
onNavigate:
|
|
373
|
+
onNavigate: p,
|
|
370
374
|
className: "mt-1"
|
|
371
375
|
}
|
|
372
376
|
),
|
|
373
|
-
((
|
|
374
|
-
/* @__PURE__ */ t(
|
|
377
|
+
((c = e.ack) == null ? void 0 : c.required) && /* @__PURE__ */ t("div", { className: "mt-1.5", "data-notification-ack": e.ack.at ? "acked" : "pending", children: e.ack.at ? /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-0.5 text-[10.5px] font-medium text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400", children: [
|
|
378
|
+
/* @__PURE__ */ t(he, { className: "h-3 w-3" }),
|
|
375
379
|
"Acknowledged ",
|
|
376
|
-
|
|
377
|
-
] }) : /* @__PURE__ */
|
|
380
|
+
Ie(e.ack.at)
|
|
381
|
+
] }) : /* @__PURE__ */ a(
|
|
378
382
|
"button",
|
|
379
383
|
{
|
|
380
384
|
type: "button",
|
|
381
|
-
disabled:
|
|
382
|
-
onClick: () =>
|
|
385
|
+
disabled: qe.isPending,
|
|
386
|
+
onClick: () => qe.mutate(e.id),
|
|
383
387
|
"data-notification-acknowledge": e.id,
|
|
384
388
|
className: "inline-flex items-center gap-1 rounded-md bg-nvr-cyan px-2.5 py-1 text-[11.5px] font-medium text-white hover:opacity-90 disabled:opacity-50",
|
|
385
389
|
children: [
|
|
386
|
-
/* @__PURE__ */ t(
|
|
390
|
+
/* @__PURE__ */ t(he, { className: "h-3.5 w-3.5" }),
|
|
387
391
|
"Acknowledge"
|
|
388
392
|
]
|
|
389
393
|
}
|
|
390
394
|
) }),
|
|
391
|
-
e.actions && e.actions.length > 0 && !((
|
|
392
|
-
|
|
395
|
+
e.actions && e.actions.length > 0 && !((v = e.detail) != null && v.resolved) && /* @__PURE__ */ t(
|
|
396
|
+
ea,
|
|
393
397
|
{
|
|
394
|
-
actions: l ? e.actions : e.actions.filter((
|
|
398
|
+
actions: l ? e.actions : e.actions.filter((y) => !!y.input),
|
|
395
399
|
notificationId: e.id,
|
|
396
400
|
size: "sm",
|
|
397
|
-
onError:
|
|
401
|
+
onError: i,
|
|
398
402
|
onDone: () => r == null ? void 0 : r("Done"),
|
|
399
403
|
className: "mt-1.5"
|
|
400
404
|
}
|
|
401
405
|
)
|
|
402
406
|
] }),
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
e.snoozed_until && new Date(e.snoozed_until) > /* @__PURE__ */ new Date() ? /* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ a("div", { className: "relative shrink-0", children: [
|
|
408
|
+
e.snoozed_until && new Date(e.snoozed_until) > /* @__PURE__ */ new Date() ? /* @__PURE__ */ a(
|
|
405
409
|
"button",
|
|
406
410
|
{
|
|
407
411
|
type: "button",
|
|
@@ -409,7 +413,7 @@ function Sa({
|
|
|
409
413
|
className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[10.5px] font-medium text-amber-700 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300",
|
|
410
414
|
"data-tip": "Click to wake now",
|
|
411
415
|
children: [
|
|
412
|
-
/* @__PURE__ */ t(
|
|
416
|
+
/* @__PURE__ */ t(pe, { className: "h-3 w-3" }),
|
|
413
417
|
e.snooze_until_change ? "Until it changes" : `Until ${new Date(e.snoozed_until).toLocaleString([], {
|
|
414
418
|
month: "short",
|
|
415
419
|
day: "numeric",
|
|
@@ -422,23 +426,23 @@ function Sa({
|
|
|
422
426
|
"button",
|
|
423
427
|
{
|
|
424
428
|
type: "button",
|
|
425
|
-
onClick: () =>
|
|
426
|
-
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-amber-50 hover:text-amber-500 group-hover:opacity-100 dark:hover:bg-amber-400/10",
|
|
429
|
+
onClick: () => Ne(we === e.id ? null : e.id),
|
|
430
|
+
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-amber-50 hover:text-amber-500 focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 dark:hover:bg-amber-400/10 [@media(hover:none)]:opacity-100",
|
|
427
431
|
"aria-label": "Snooze notification",
|
|
428
|
-
children: /* @__PURE__ */ t(
|
|
432
|
+
children: /* @__PURE__ */ t(pe, { className: "h-3.5 w-3.5" })
|
|
429
433
|
}
|
|
430
434
|
),
|
|
431
|
-
|
|
432
|
-
|
|
435
|
+
we === e.id && /* @__PURE__ */ a("div", { className: "absolute right-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: [
|
|
436
|
+
je().map((y) => /* @__PURE__ */ t(
|
|
433
437
|
"button",
|
|
434
438
|
{
|
|
435
439
|
type: "button",
|
|
436
440
|
disabled: U.isPending,
|
|
437
|
-
onClick: () => U.mutate({ id: e.id, until:
|
|
441
|
+
onClick: () => U.mutate({ id: e.id, until: y.until }),
|
|
438
442
|
className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
439
|
-
children:
|
|
443
|
+
children: y.label
|
|
440
444
|
},
|
|
441
|
-
|
|
445
|
+
y.label
|
|
442
446
|
)),
|
|
443
447
|
e.collection && e.item != null && /* @__PURE__ */ t(
|
|
444
448
|
"button",
|
|
@@ -453,12 +457,12 @@ function Sa({
|
|
|
453
457
|
)
|
|
454
458
|
] })
|
|
455
459
|
] }),
|
|
456
|
-
/* @__PURE__ */ t("div", { className: "shrink-0", children:
|
|
460
|
+
/* @__PURE__ */ t("div", { className: "shrink-0", children: Ee === e.id ? /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
|
|
457
461
|
/* @__PURE__ */ t(
|
|
458
462
|
"button",
|
|
459
463
|
{
|
|
460
464
|
type: "button",
|
|
461
|
-
onClick: () =>
|
|
465
|
+
onClick: () => E(null),
|
|
462
466
|
className: "h-6 rounded-md border border-slate-200 px-2 text-[11px] dark:border-border",
|
|
463
467
|
children: "Cancel"
|
|
464
468
|
}
|
|
@@ -467,53 +471,53 @@ function Sa({
|
|
|
467
471
|
"button",
|
|
468
472
|
{
|
|
469
473
|
type: "button",
|
|
470
|
-
disabled:
|
|
471
|
-
onClick: () =>
|
|
474
|
+
disabled: oe.isPending,
|
|
475
|
+
onClick: () => oe.mutate(e.id),
|
|
472
476
|
className: "h-6 rounded-md bg-red-500 px-2 text-[11px] text-white hover:bg-red-600",
|
|
473
|
-
children:
|
|
477
|
+
children: oe.isPending ? "Deleting…" : "Delete"
|
|
474
478
|
}
|
|
475
479
|
)
|
|
476
480
|
] }) : /* @__PURE__ */ t(
|
|
477
481
|
"button",
|
|
478
482
|
{
|
|
479
483
|
type: "button",
|
|
480
|
-
onClick: () =>
|
|
481
|
-
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-red-50 hover:text-red-400 group-hover:opacity-100",
|
|
484
|
+
onClick: () => E(e.id),
|
|
485
|
+
className: "rounded p-1.5 text-slate-300 opacity-0 transition-all hover:bg-red-50 hover:text-red-400 focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100",
|
|
482
486
|
"aria-label": "Delete notification",
|
|
483
|
-
children: /* @__PURE__ */ t(
|
|
487
|
+
children: /* @__PURE__ */ t(qt, { className: "h-3.5 w-3.5" })
|
|
484
488
|
}
|
|
485
489
|
) })
|
|
486
490
|
]
|
|
487
491
|
}
|
|
488
492
|
);
|
|
489
|
-
},
|
|
490
|
-
const
|
|
491
|
-
const
|
|
492
|
-
return
|
|
493
|
+
}, wt = (e) => {
|
|
494
|
+
const n = `${e.collection}:${e.item}`, l = lt.has(n), s = Zt(e.lane), k = e.deleted ? null : V(Jt(e), o), I = e.rows.filter((c) => !c.read).map((c) => c.id), A = () => rt((c) => {
|
|
495
|
+
const v = new Set(c);
|
|
496
|
+
return v.has(n) ? v.delete(n) : v.add(n), v;
|
|
493
497
|
});
|
|
494
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ a(
|
|
495
499
|
"div",
|
|
496
500
|
{
|
|
497
|
-
"data-live-key":
|
|
498
|
-
"data-notification-bundle":
|
|
501
|
+
"data-live-key": Ue(e),
|
|
502
|
+
"data-notification-bundle": n,
|
|
499
503
|
"data-notification-bundle-count": e.count,
|
|
500
504
|
"data-notification-bundle-lane": e.lane,
|
|
501
505
|
"data-notification-bundle-deleted": e.deleted ? "true" : void 0,
|
|
502
506
|
children: [
|
|
503
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ a("div", { className: "group flex items-start gap-3 px-4 py-3 transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/40", children: [
|
|
504
508
|
/* @__PURE__ */ t(
|
|
505
509
|
"button",
|
|
506
510
|
{
|
|
507
511
|
type: "button",
|
|
508
512
|
"aria-expanded": l,
|
|
509
513
|
"aria-label": l ? "Collapse" : "Expand",
|
|
510
|
-
"data-notification-bundle-expand":
|
|
511
|
-
onClick:
|
|
514
|
+
"data-notification-bundle-expand": n,
|
|
515
|
+
onClick: A,
|
|
512
516
|
className: "mt-1 rounded p-0.5 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
|
|
513
517
|
children: /* @__PURE__ */ t(
|
|
514
|
-
|
|
518
|
+
Mt,
|
|
515
519
|
{
|
|
516
|
-
className:
|
|
520
|
+
className: x("h-3.5 w-3.5 transition-transform", !l && "-rotate-90")
|
|
517
521
|
}
|
|
518
522
|
)
|
|
519
523
|
}
|
|
@@ -521,18 +525,19 @@ function Sa({
|
|
|
521
525
|
/* @__PURE__ */ t(
|
|
522
526
|
"span",
|
|
523
527
|
{
|
|
524
|
-
className:
|
|
528
|
+
className: x(
|
|
525
529
|
"mt-2 h-2 w-2 shrink-0 rounded-full",
|
|
526
|
-
|
|
530
|
+
// The same dot an unread row inside the group shows.
|
|
531
|
+
e.unread > 0 ? e.lane === "critical" ? "bg-red-500" : "bg-nvr-cyan" : "bg-transparent"
|
|
527
532
|
)
|
|
528
533
|
}
|
|
529
534
|
),
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */ t("button", { type: "button", onClick:
|
|
535
|
+
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
536
|
+
/* @__PURE__ */ t("button", { type: "button", onClick: A, className: "block w-full text-left", children: /* @__PURE__ */ a("div", { className: "flex items-baseline gap-2", children: [
|
|
532
537
|
e.lane === "critical" && e.unread > 0 && /* @__PURE__ */ t(
|
|
533
538
|
"span",
|
|
534
539
|
{
|
|
535
|
-
className:
|
|
540
|
+
className: x(
|
|
536
541
|
"shrink-0 rounded px-1 text-[9.5px] font-bold uppercase tracking-wide",
|
|
537
542
|
s.chip
|
|
538
543
|
),
|
|
@@ -542,16 +547,20 @@ function Sa({
|
|
|
542
547
|
/* @__PURE__ */ t(
|
|
543
548
|
"span",
|
|
544
549
|
{
|
|
545
|
-
className:
|
|
546
|
-
|
|
547
|
-
|
|
550
|
+
className: x(
|
|
551
|
+
// A phone wraps the headline (two lines) instead of cutting it to a word.
|
|
552
|
+
"min-w-0 line-clamp-2 break-words text-[13px] sm:line-clamp-none sm:truncate",
|
|
553
|
+
e.unread > 0 ? x("font-medium", s.text) : "font-normal text-slate-600 dark:text-slate-400"
|
|
548
554
|
),
|
|
549
|
-
children:
|
|
555
|
+
children: e.label ? /* @__PURE__ */ a(ue, { children: [
|
|
556
|
+
Ke(e).slice(0, -e.label.length),
|
|
557
|
+
/* @__PURE__ */ t("span", { className: "whitespace-nowrap", children: e.label })
|
|
558
|
+
] }) : Ke(e)
|
|
550
559
|
}
|
|
551
560
|
),
|
|
552
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ?
|
|
561
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: e.newest ? Ie(e.newest) : "" })
|
|
553
562
|
] }) }),
|
|
554
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ a("div", { className: "mt-1 flex flex-wrap items-center gap-1.5", children: [
|
|
555
564
|
e.collection_label && /* @__PURE__ */ t(
|
|
556
565
|
"span",
|
|
557
566
|
{
|
|
@@ -568,44 +577,46 @@ function Sa({
|
|
|
568
577
|
children: "deleted"
|
|
569
578
|
}
|
|
570
579
|
),
|
|
571
|
-
e.categories.map((
|
|
580
|
+
e.categories.map((c) => /* @__PURE__ */ t(
|
|
572
581
|
"span",
|
|
573
582
|
{
|
|
574
583
|
className: "rounded bg-slate-100 px-1.5 py-px text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
575
|
-
"data-notification-bundle-category":
|
|
576
|
-
children:
|
|
584
|
+
"data-notification-bundle-category": c,
|
|
585
|
+
children: Xt(c)
|
|
577
586
|
},
|
|
578
|
-
|
|
587
|
+
c
|
|
579
588
|
)),
|
|
580
|
-
|
|
589
|
+
k && /* @__PURE__ */ a(
|
|
581
590
|
"button",
|
|
582
591
|
{
|
|
583
592
|
type: "button",
|
|
584
|
-
onClick: () =>
|
|
593
|
+
onClick: () => fe(k, p),
|
|
585
594
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[10px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
586
595
|
children: [
|
|
587
|
-
/* @__PURE__ */ t(
|
|
596
|
+
/* @__PURE__ */ t(Le, { className: "h-3 w-3" }),
|
|
588
597
|
"Open ",
|
|
589
598
|
e.label
|
|
590
599
|
]
|
|
591
600
|
}
|
|
592
601
|
),
|
|
593
|
-
e.unread > 0 &&
|
|
602
|
+
e.unread > 0 && /* @__PURE__ */ a("span", { className: "text-[10.5px] text-slate-500 dark:text-slate-400", children: [
|
|
594
603
|
e.unread,
|
|
595
604
|
" unread"
|
|
596
605
|
] })
|
|
597
606
|
] })
|
|
598
607
|
] }),
|
|
599
|
-
|
|
608
|
+
I.length > 0 && /* @__PURE__ */ a(
|
|
600
609
|
"button",
|
|
601
610
|
{
|
|
602
611
|
type: "button",
|
|
603
|
-
"data-notification-bundle-read":
|
|
604
|
-
onClick: () =>
|
|
605
|
-
|
|
612
|
+
"data-notification-bundle-read": n,
|
|
613
|
+
onClick: () => xt.mutate(I),
|
|
614
|
+
"aria-label": "Mark read",
|
|
615
|
+
"data-tip": "Mark read",
|
|
616
|
+
className: "inline-flex shrink-0 items-center gap-1 rounded-md border border-slate-200 p-1.5 text-[11px] font-medium text-slate-600 hover:bg-slate-50 sm:px-2 sm:py-1 dark:border-border dark:text-slate-300 dark:hover:bg-muted",
|
|
606
617
|
children: [
|
|
607
|
-
/* @__PURE__ */ t(
|
|
608
|
-
"Mark read"
|
|
618
|
+
/* @__PURE__ */ t(me, { className: "h-3.5 w-3.5 sm:h-3 sm:w-3" }),
|
|
619
|
+
/* @__PURE__ */ t("span", { className: "max-sm:hidden", children: "Mark read" })
|
|
609
620
|
]
|
|
610
621
|
}
|
|
611
622
|
)
|
|
@@ -614,88 +625,94 @@ function Sa({
|
|
|
614
625
|
"div",
|
|
615
626
|
{
|
|
616
627
|
className: "divide-y divide-slate-100 border-t border-slate-100 dark:divide-border dark:border-border",
|
|
617
|
-
"data-notification-bundle-rows":
|
|
618
|
-
children: e.rows.map((
|
|
628
|
+
"data-notification-bundle-rows": n,
|
|
629
|
+
children: e.rows.map((c) => /* @__PURE__ */ t(xe, { children: ce(c, !0) }, c.id))
|
|
619
630
|
}
|
|
620
631
|
)
|
|
621
632
|
]
|
|
622
633
|
},
|
|
623
|
-
`bundle:${
|
|
634
|
+
`bundle:${n}`
|
|
624
635
|
);
|
|
625
|
-
},
|
|
626
|
-
var
|
|
627
|
-
return e === "all" ? null : ((
|
|
636
|
+
}, Me = z.length + L.length + j.reduce((e, n) => e + n.rows.length, 0), Nt = (e) => {
|
|
637
|
+
var n;
|
|
638
|
+
return e === "all" ? null : ((n = b == null ? void 0 : b.lanes) == null ? void 0 : n[e]) ?? null;
|
|
628
639
|
};
|
|
629
|
-
return /* @__PURE__ */
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ a("div", { className: x("flex flex-1 min-h-0 flex-col", Ye), "data-nvr-notification-center": !0, children: [
|
|
641
|
+
/* @__PURE__ */ a("header", { className: "shrink-0 border-b border-slate-200 bg-white px-4 py-5 dark:border-border dark:bg-background sm:px-8", children: [
|
|
642
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2", children: [
|
|
643
|
+
/* @__PURE__ */ a("div", { children: [
|
|
644
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
|
|
634
645
|
/* @__PURE__ */ t("h1", { className: "text-xl font-bold text-slate-900 dark:text-slate-100", children: "Notifications" }),
|
|
635
|
-
|
|
646
|
+
re > 0 && /* @__PURE__ */ a(
|
|
636
647
|
"button",
|
|
637
648
|
{
|
|
638
649
|
type: "button",
|
|
639
|
-
"data-notification-new-pill":
|
|
650
|
+
"data-notification-new-pill": re,
|
|
640
651
|
onClick: bt,
|
|
641
652
|
className: "inline-flex h-7 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-3 text-[12px] font-medium text-nvr-navy transition-colors hover:bg-nvr-cyan/15 focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan dark:border-nvr-cyan/40 dark:bg-nvr-cyan/15 dark:text-nvr-cyan dark:hover:bg-nvr-cyan/25",
|
|
642
653
|
children: [
|
|
643
|
-
/* @__PURE__ */ t(
|
|
644
|
-
|
|
654
|
+
/* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
655
|
+
re,
|
|
645
656
|
" new"
|
|
646
657
|
]
|
|
647
658
|
}
|
|
648
659
|
)
|
|
649
660
|
] }),
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
-
|
|
661
|
+
/* @__PURE__ */ a("p", { className: "mt-0.5 text-[13px] text-slate-500 dark:text-slate-400", children: [
|
|
662
|
+
F,
|
|
652
663
|
" notification",
|
|
653
|
-
|
|
654
|
-
|
|
664
|
+
F === 1 ? "" : "s",
|
|
665
|
+
N !== "all" || d !== "all" || M || $ ? " in this view" : "",
|
|
666
|
+
(b == null ? void 0 : b.attention) != null && b.attention > 0 ? ` · ${b.attention} need${b.attention === 1 ? "s" : ""} you` : ""
|
|
655
667
|
] })
|
|
656
668
|
] }),
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ a("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
670
|
+
/* @__PURE__ */ a(
|
|
659
671
|
"button",
|
|
660
672
|
{
|
|
661
673
|
type: "button",
|
|
662
674
|
onClick: () => dt((e) => !e),
|
|
663
675
|
"data-notification-cleanup-toggle": !0,
|
|
664
|
-
|
|
676
|
+
"aria-label": "Clean up",
|
|
677
|
+
"aria-expanded": ne,
|
|
678
|
+
"data-tip": "Clean up",
|
|
679
|
+
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-2 text-[12px] font-medium text-slate-700 hover:bg-slate-50 sm:px-3 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
665
680
|
children: [
|
|
666
|
-
/* @__PURE__ */ t(
|
|
667
|
-
"Clean up"
|
|
681
|
+
/* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
682
|
+
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children: "Clean up" })
|
|
668
683
|
]
|
|
669
684
|
}
|
|
670
685
|
),
|
|
671
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ a(
|
|
672
687
|
"button",
|
|
673
688
|
{
|
|
674
689
|
type: "button",
|
|
675
|
-
onClick: () =>
|
|
676
|
-
disabled:
|
|
677
|
-
|
|
690
|
+
onClick: () => ie.mutate(),
|
|
691
|
+
disabled: ie.isPending || b != null && b.unread === 0,
|
|
692
|
+
"aria-label": "Mark all read",
|
|
693
|
+
"data-tip": (b == null ? void 0 : b.unread) === 0 ? "Nothing unread" : "Mark all read",
|
|
694
|
+
className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 px-2 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50 sm:px-3 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
678
695
|
children: [
|
|
679
|
-
/* @__PURE__ */ t(
|
|
680
|
-
|
|
696
|
+
/* @__PURE__ */ t(At, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
697
|
+
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children: ie.isPending ? "Marking…" : "Mark all read" })
|
|
681
698
|
]
|
|
682
699
|
}
|
|
683
700
|
)
|
|
684
701
|
] })
|
|
685
702
|
] }),
|
|
686
|
-
|
|
703
|
+
ne && /* @__PURE__ */ a(
|
|
687
704
|
"div",
|
|
688
705
|
{
|
|
689
706
|
className: "mt-3 space-y-2 rounded-md border border-slate-200 bg-slate-50 px-3 py-2.5 text-[12px] text-slate-600 dark:border-border dark:bg-muted/40 dark:text-muted-foreground",
|
|
690
707
|
"data-notification-cleanup": !0,
|
|
691
708
|
children: [
|
|
692
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
693
710
|
"Archive everything read and older than",
|
|
694
711
|
/* @__PURE__ */ t(
|
|
695
|
-
|
|
712
|
+
ge,
|
|
696
713
|
{
|
|
697
|
-
value:
|
|
698
|
-
onChange:
|
|
714
|
+
value: Se,
|
|
715
|
+
onChange: st,
|
|
699
716
|
ariaLabel: "Older than",
|
|
700
717
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
701
718
|
options: [
|
|
@@ -710,21 +727,21 @@ function Sa({
|
|
|
710
727
|
"button",
|
|
711
728
|
{
|
|
712
729
|
type: "button",
|
|
713
|
-
disabled:
|
|
714
|
-
onClick: () =>
|
|
730
|
+
disabled: de.isPending,
|
|
731
|
+
onClick: () => de.mutate(Number(Se)),
|
|
715
732
|
"data-notification-archive-read": !0,
|
|
716
|
-
className: "h-7 rounded-md bg-
|
|
717
|
-
children:
|
|
733
|
+
className: "h-7 rounded-md bg-[#0f172a] px-2.5 text-[11.5px] font-medium text-[#ffffff] hover:bg-[#334155] disabled:opacity-50 dark:bg-[#e2e8f0] dark:text-[#0f172a] dark:hover:bg-[#ffffff]",
|
|
734
|
+
children: de.isPending ? "Archiving…" : "Archive now"
|
|
718
735
|
}
|
|
719
736
|
)
|
|
720
737
|
] }),
|
|
721
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
722
739
|
"Or do it automatically — archive read notifications after",
|
|
723
740
|
/* @__PURE__ */ t(
|
|
724
|
-
|
|
741
|
+
ge,
|
|
725
742
|
{
|
|
726
|
-
value: String((
|
|
727
|
-
onChange: (e) =>
|
|
743
|
+
value: String((se == null ? void 0 : se.notification_cleanup_days) ?? ""),
|
|
744
|
+
onChange: (e) => gt.mutate(e ? Number(e) : null),
|
|
728
745
|
ariaLabel: "Automatic clean-up",
|
|
729
746
|
className: "h-7 w-auto rounded-md border-slate-200 bg-background px-2 text-[12px] dark:border-border",
|
|
730
747
|
options: [
|
|
@@ -740,73 +757,80 @@ function Sa({
|
|
|
740
757
|
]
|
|
741
758
|
}
|
|
742
759
|
),
|
|
743
|
-
/* @__PURE__ */
|
|
744
|
-
/* @__PURE__ */ t("div", { className: "flex max-w-full
|
|
745
|
-
const
|
|
746
|
-
return /* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
761
|
+
/* @__PURE__ */ t("div", { className: "-mx-1 flex max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none] sm:flex-wrap", children: ra.map((e) => {
|
|
762
|
+
const n = Nt(e.key);
|
|
763
|
+
return /* @__PURE__ */ a(
|
|
747
764
|
"button",
|
|
748
765
|
{
|
|
749
766
|
type: "button",
|
|
750
767
|
onClick: () => {
|
|
751
|
-
|
|
768
|
+
Ze(e.key), q(1);
|
|
752
769
|
},
|
|
753
770
|
"data-nvr-lane": e.key,
|
|
754
|
-
className:
|
|
771
|
+
className: x(
|
|
755
772
|
"shrink-0 whitespace-nowrap rounded-md px-3 py-1.5 text-[12.5px] font-medium transition-colors",
|
|
756
|
-
|
|
773
|
+
N === e.key ? e.key === "critical" ? "bg-red-500/10 text-red-700 dark:text-red-400" : "bg-nvr-cyan/10 text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan" : "text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:hover:bg-slate-800/50"
|
|
757
774
|
),
|
|
758
775
|
children: [
|
|
759
776
|
e.label,
|
|
760
|
-
|
|
777
|
+
n != null && n > 0 && /* @__PURE__ */ t(
|
|
778
|
+
"span",
|
|
779
|
+
{
|
|
780
|
+
className: "ml-1.5 rounded-full bg-slate-200 px-1.5 text-[10px] font-bold text-slate-600 dark:bg-slate-700 dark:text-slate-300",
|
|
781
|
+
"data-tip": `${n} unread`,
|
|
782
|
+
children: n
|
|
783
|
+
}
|
|
784
|
+
)
|
|
761
785
|
]
|
|
762
786
|
},
|
|
763
787
|
e.key
|
|
764
788
|
);
|
|
765
789
|
}) }),
|
|
766
790
|
/* @__PURE__ */ t("span", { className: "mx-1 hidden h-5 w-px bg-slate-200 dark:bg-border sm:block" }),
|
|
767
|
-
/* @__PURE__ */ t("div", { className: "flex max-w-full
|
|
791
|
+
/* @__PURE__ */ t("div", { className: "-mx-1 flex max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none] sm:flex-wrap", children: la.map((e) => /* @__PURE__ */ t(
|
|
768
792
|
"button",
|
|
769
793
|
{
|
|
770
794
|
type: "button",
|
|
771
795
|
onClick: () => {
|
|
772
|
-
|
|
796
|
+
We(e.key), q(1);
|
|
773
797
|
},
|
|
774
|
-
className:
|
|
798
|
+
className: x(
|
|
775
799
|
"shrink-0 whitespace-nowrap rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
776
|
-
|
|
800
|
+
d === e.key ? "bg-[#0f172a] text-[#ffffff] dark:bg-[#e2e8f0] dark:text-[#0f172a]" : "text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:hover:bg-slate-800/50"
|
|
777
801
|
),
|
|
778
802
|
children: e.label
|
|
779
803
|
},
|
|
780
804
|
e.key
|
|
781
805
|
)) }),
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */ t(
|
|
806
|
+
/* @__PURE__ */ a("div", { className: "relative w-full sm:ml-auto sm:w-auto", children: [
|
|
807
|
+
/* @__PURE__ */ t(Dt, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
784
808
|
/* @__PURE__ */ t(
|
|
785
809
|
"input",
|
|
786
810
|
{
|
|
787
|
-
value:
|
|
788
|
-
onChange: (e) =>
|
|
811
|
+
value: ee,
|
|
812
|
+
onChange: (e) => et(e.target.value),
|
|
789
813
|
placeholder: "Search notifications…",
|
|
790
814
|
className: "h-8 w-full rounded-md border border-slate-200 bg-background pl-8 sm:w-[240px] pr-2.5 text-[12.5px] dark:border-border"
|
|
791
815
|
}
|
|
792
816
|
)
|
|
793
817
|
] }),
|
|
794
818
|
/* @__PURE__ */ t(
|
|
795
|
-
|
|
819
|
+
ge,
|
|
796
820
|
{
|
|
797
|
-
value:
|
|
821
|
+
value: $,
|
|
798
822
|
onChange: (e) => {
|
|
799
|
-
|
|
823
|
+
at(e), q(1);
|
|
800
824
|
},
|
|
801
825
|
ariaLabel: "Collection",
|
|
802
826
|
className: "h-8 w-auto rounded-md border-slate-200 bg-background px-2 text-[12.5px] dark:border-border",
|
|
803
827
|
options: [
|
|
804
828
|
{ value: "", label: "All collections" },
|
|
805
|
-
...
|
|
829
|
+
...ut.map((e) => ({ value: e, label: e }))
|
|
806
830
|
]
|
|
807
831
|
}
|
|
808
832
|
),
|
|
809
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ a(
|
|
810
834
|
"label",
|
|
811
835
|
{
|
|
812
836
|
className: "flex cursor-pointer items-center gap-1.5 text-[12px] text-slate-500 dark:text-slate-400",
|
|
@@ -816,8 +840,8 @@ function Sa({
|
|
|
816
840
|
"input",
|
|
817
841
|
{
|
|
818
842
|
type: "checkbox",
|
|
819
|
-
checked:
|
|
820
|
-
onChange: (e) =>
|
|
843
|
+
checked: B,
|
|
844
|
+
onChange: (e) => nt(e.target.checked),
|
|
821
845
|
className: "h-3.5 w-3.5",
|
|
822
846
|
"data-notification-group-by-record": !0
|
|
823
847
|
}
|
|
@@ -828,121 +852,121 @@ function Sa({
|
|
|
828
852
|
)
|
|
829
853
|
] })
|
|
830
854
|
] }),
|
|
831
|
-
|
|
855
|
+
X != null && /* @__PURE__ */ a(
|
|
832
856
|
"div",
|
|
833
857
|
{
|
|
834
858
|
className: "shrink-0 border-b border-slate-200 bg-white px-8 py-3 dark:border-border dark:bg-background",
|
|
835
|
-
"data-notification-changes-landing":
|
|
859
|
+
"data-notification-changes-landing": X,
|
|
836
860
|
children: [
|
|
837
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-2", children: [
|
|
838
862
|
/* @__PURE__ */ t("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "What changed" }),
|
|
839
863
|
/* @__PURE__ */ t(
|
|
840
864
|
"button",
|
|
841
865
|
{
|
|
842
866
|
type: "button",
|
|
843
|
-
onClick: () =>
|
|
867
|
+
onClick: () => Ve(null),
|
|
844
868
|
className: "text-[11.5px] text-slate-400 underline decoration-dotted underline-offset-2 hover:text-slate-600 dark:hover:text-slate-200",
|
|
845
869
|
children: "Dismiss"
|
|
846
870
|
}
|
|
847
871
|
)
|
|
848
872
|
] }),
|
|
849
|
-
/* @__PURE__ */ t(
|
|
873
|
+
/* @__PURE__ */ t(ta, { notificationId: X, className: "max-w-3xl" })
|
|
850
874
|
]
|
|
851
875
|
}
|
|
852
876
|
),
|
|
853
|
-
|
|
877
|
+
d !== "sent" && T.size > 0 && /* @__PURE__ */ a(
|
|
854
878
|
"div",
|
|
855
879
|
{
|
|
856
880
|
className: "flex shrink-0 flex-wrap items-center gap-2 border-b border-nvr-cyan/30 bg-nvr-cyan/5 px-8 py-2 text-[12px] text-slate-700 dark:text-slate-200",
|
|
857
881
|
"data-notification-bulkbar": !0,
|
|
858
882
|
children: [
|
|
859
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
860
|
-
!
|
|
883
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: te ? `All ${F} matching` : `${T.size} selected` }),
|
|
884
|
+
!te && T.size >= Me && F > Me && /* @__PURE__ */ a(
|
|
861
885
|
"button",
|
|
862
886
|
{
|
|
863
887
|
type: "button",
|
|
864
|
-
onClick: () =>
|
|
888
|
+
onClick: () => K(!0),
|
|
865
889
|
"data-notification-select-matching": !0,
|
|
866
890
|
className: "text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
|
|
867
891
|
children: [
|
|
868
892
|
"Select all ",
|
|
869
|
-
|
|
893
|
+
F,
|
|
870
894
|
" matching"
|
|
871
895
|
]
|
|
872
896
|
}
|
|
873
897
|
),
|
|
874
898
|
/* @__PURE__ */ t("span", { className: "mx-1 h-4 w-px bg-slate-300 dark:bg-border" }),
|
|
875
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ a(
|
|
876
900
|
"button",
|
|
877
901
|
{
|
|
878
902
|
type: "button",
|
|
879
|
-
disabled:
|
|
880
|
-
onClick: () =>
|
|
903
|
+
disabled: O.isPending,
|
|
904
|
+
onClick: () => O.mutate({ action: "read" }),
|
|
881
905
|
"data-notification-bulk": "read",
|
|
882
906
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
883
907
|
children: [
|
|
884
|
-
/* @__PURE__ */ t(
|
|
908
|
+
/* @__PURE__ */ t(me, { className: "h-3 w-3" }),
|
|
885
909
|
" Mark read"
|
|
886
910
|
]
|
|
887
911
|
}
|
|
888
912
|
),
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
914
|
+
/* @__PURE__ */ a(
|
|
891
915
|
"button",
|
|
892
916
|
{
|
|
893
917
|
type: "button",
|
|
894
|
-
disabled:
|
|
895
|
-
onClick: () =>
|
|
918
|
+
disabled: O.isPending,
|
|
919
|
+
onClick: () => ae((e) => !e),
|
|
896
920
|
"data-notification-bulk": "snooze",
|
|
897
921
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
898
922
|
children: [
|
|
899
|
-
/* @__PURE__ */ t(
|
|
923
|
+
/* @__PURE__ */ t(pe, { className: "h-3 w-3" }),
|
|
900
924
|
" Snooze"
|
|
901
925
|
]
|
|
902
926
|
}
|
|
903
927
|
),
|
|
904
|
-
|
|
928
|
+
it && /* @__PURE__ */ t("div", { className: "absolute left-0 top-8 z-20 w-[180px] rounded-md border border-slate-200 bg-white py-1 shadow-lg dark:border-border dark:bg-card", children: je().map((e) => /* @__PURE__ */ t(
|
|
905
929
|
"button",
|
|
906
930
|
{
|
|
907
931
|
type: "button",
|
|
908
|
-
onClick: () =>
|
|
932
|
+
onClick: () => O.mutate({ action: "snooze", until: e.until }),
|
|
909
933
|
className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
910
934
|
children: e.label
|
|
911
935
|
},
|
|
912
936
|
e.label
|
|
913
937
|
)) })
|
|
914
938
|
] }),
|
|
915
|
-
|
|
939
|
+
d !== "archived" && /* @__PURE__ */ a(
|
|
916
940
|
"button",
|
|
917
941
|
{
|
|
918
942
|
type: "button",
|
|
919
|
-
disabled:
|
|
920
|
-
onClick: () =>
|
|
943
|
+
disabled: O.isPending,
|
|
944
|
+
onClick: () => O.mutate({ action: "archive" }),
|
|
921
945
|
"data-notification-bulk": "archive",
|
|
922
946
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
923
947
|
children: [
|
|
924
|
-
/* @__PURE__ */ t(
|
|
948
|
+
/* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
|
|
925
949
|
" Archive"
|
|
926
950
|
]
|
|
927
951
|
}
|
|
928
952
|
),
|
|
929
|
-
/* @__PURE__ */
|
|
953
|
+
/* @__PURE__ */ a(
|
|
930
954
|
"button",
|
|
931
955
|
{
|
|
932
956
|
type: "button",
|
|
933
957
|
onClick: () => {
|
|
934
958
|
const e = [];
|
|
935
|
-
for (const
|
|
936
|
-
if (!
|
|
937
|
-
const l = V(
|
|
959
|
+
for (const n of [...z, ...L, ...j.flatMap((l) => l.rows)]) {
|
|
960
|
+
if (!T.has(n.id)) continue;
|
|
961
|
+
const l = V(n, o);
|
|
938
962
|
l && (l.type === "external" ? e.push(l.url) : l.type === "path" && typeof window < "u" && e.push(`${window.location.origin}${l.path}`));
|
|
939
963
|
}
|
|
940
|
-
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(
|
|
964
|
+
e.length === 0 ? r == null || r("None of the selected notifications opens a page") : r == null || r(Bt(Kt(e)));
|
|
941
965
|
},
|
|
942
966
|
"data-notification-bulk": "tabs",
|
|
943
967
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-background px-2 text-[11.5px] font-medium hover:bg-slate-50 dark:border-border",
|
|
944
968
|
children: [
|
|
945
|
-
/* @__PURE__ */ t(
|
|
969
|
+
/* @__PURE__ */ t(Le, { className: "h-3 w-3" }),
|
|
946
970
|
" Open in tabs"
|
|
947
971
|
]
|
|
948
972
|
}
|
|
@@ -952,7 +976,7 @@ function Sa({
|
|
|
952
976
|
{
|
|
953
977
|
type: "button",
|
|
954
978
|
onClick: () => {
|
|
955
|
-
Y(/* @__PURE__ */ new Set()),
|
|
979
|
+
Y(/* @__PURE__ */ new Set()), K(!1);
|
|
956
980
|
},
|
|
957
981
|
className: "ml-auto text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2",
|
|
958
982
|
children: "Clear selection"
|
|
@@ -961,17 +985,17 @@ function Sa({
|
|
|
961
985
|
]
|
|
962
986
|
}
|
|
963
987
|
),
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
|
|
966
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto bg-slate-50 dark:bg-background", children: [
|
|
989
|
+
d === "sent" ? /* @__PURE__ */ a("div", { className: "mx-4 my-6 space-y-3 sm:mx-8", "data-nvr-sent": !0, children: [
|
|
990
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-3 text-[12px] text-slate-500", children: [
|
|
967
991
|
/* @__PURE__ */ t("span", { children: "What you sent, with who has read it. A send is one subject to its recipients; a critical send bypasses mutes and quiet hours, so its receipts matter most." }),
|
|
968
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ a("label", { className: "ml-auto flex cursor-pointer items-center gap-1.5", children: [
|
|
969
993
|
/* @__PURE__ */ t(
|
|
970
994
|
"input",
|
|
971
995
|
{
|
|
972
996
|
type: "checkbox",
|
|
973
|
-
checked:
|
|
974
|
-
onChange: (e) =>
|
|
997
|
+
checked: Q,
|
|
998
|
+
onChange: (e) => Je(e.target.checked),
|
|
975
999
|
className: "h-3.5 w-3.5",
|
|
976
1000
|
"data-nvr-sent-critical": !0
|
|
977
1001
|
}
|
|
@@ -979,19 +1003,19 @@ function Sa({
|
|
|
979
1003
|
"Critical only"
|
|
980
1004
|
] })
|
|
981
1005
|
] }),
|
|
982
|
-
|
|
983
|
-
/* @__PURE__ */ t(
|
|
1006
|
+
Xe ? /* @__PURE__ */ t("p", { className: "py-10 text-[13px] text-slate-400", children: "Loading…" }) : ye.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
|
|
1007
|
+
/* @__PURE__ */ t(Re, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
984
1008
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "Nothing sent yet" }),
|
|
985
|
-
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children:
|
|
986
|
-
] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children:
|
|
987
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: Q ? 'No critical sends. Untick "Critical only" to see everything you sent.' : "Messages you send to stakeholders or colleagues appear here." })
|
|
1010
|
+
] }) : /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: ye.map((e) => /* @__PURE__ */ a("div", { className: "px-4 py-3", "data-nvr-sent-row": !0, children: [
|
|
1011
|
+
/* @__PURE__ */ a("div", { className: "flex items-baseline gap-2", children: [
|
|
988
1012
|
e.lane === "critical" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-red-500/10 px-1 text-[9.5px] font-bold uppercase tracking-wide text-red-600 dark:text-red-400", children: "Critical" }),
|
|
989
1013
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: e.subject.replace(/^critical:\s*/i, "") }),
|
|
990
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: /* @__PURE__ */ t(
|
|
991
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: /* @__PURE__ */ t(Be, { value: e.created_at ?? /* @__PURE__ */ new Date() }) }),
|
|
1015
|
+
/* @__PURE__ */ a(
|
|
992
1016
|
"span",
|
|
993
1017
|
{
|
|
994
|
-
className:
|
|
1018
|
+
className: x(
|
|
995
1019
|
"ml-auto shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-semibold tabular-nums",
|
|
996
1020
|
e.read_count === e.total ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400" : "bg-amber-50 text-amber-700 dark:bg-amber-400/10 dark:text-amber-300"
|
|
997
1021
|
),
|
|
@@ -1004,7 +1028,7 @@ function Sa({
|
|
|
1004
1028
|
]
|
|
1005
1029
|
}
|
|
1006
1030
|
),
|
|
1007
|
-
e.ack_required && /* @__PURE__ */
|
|
1031
|
+
e.ack_required && /* @__PURE__ */ a(
|
|
1008
1032
|
"span",
|
|
1009
1033
|
{
|
|
1010
1034
|
className: "shrink-0 rounded-full bg-sky-50 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-sky-700 dark:bg-sky-400/10 dark:text-sky-300",
|
|
@@ -1019,92 +1043,92 @@ function Sa({
|
|
|
1019
1043
|
)
|
|
1020
1044
|
] }),
|
|
1021
1045
|
e.message && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 whitespace-pre-line text-[12px] text-slate-500", children: e.message.replace(/<[^>]+>/g, "") }),
|
|
1022
|
-
/* @__PURE__ */ t("div", { className: "mt-1.5 flex flex-wrap gap-1", children: e.recipients.map((
|
|
1046
|
+
/* @__PURE__ */ t("div", { className: "mt-1.5 flex flex-wrap gap-1", children: e.recipients.map((n) => /* @__PURE__ */ a(
|
|
1023
1047
|
"span",
|
|
1024
1048
|
{
|
|
1025
|
-
className:
|
|
1049
|
+
className: x(
|
|
1026
1050
|
"inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[10.5px]",
|
|
1027
|
-
|
|
1051
|
+
n.read ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-slate-400"
|
|
1028
1052
|
),
|
|
1029
|
-
"data-nvr-receipt":
|
|
1030
|
-
"data-nvr-ack":
|
|
1031
|
-
"data-tip":
|
|
1053
|
+
"data-nvr-receipt": n.read ? "read" : "unread",
|
|
1054
|
+
"data-nvr-ack": n.ack ?? void 0,
|
|
1055
|
+
"data-tip": n.ack === "acked" ? `Acknowledged${n.ack_at ? ` ${new Date(n.ack_at).toLocaleString()}` : ""}` : n.ack === "pending" ? "Has not acknowledged yet" : n.read && n.read_at ? `Read ${new Date(n.read_at).toLocaleString()}` : n.read ? "Read" : "Not read yet",
|
|
1032
1056
|
children: [
|
|
1033
1057
|
/* @__PURE__ */ t(
|
|
1034
1058
|
"span",
|
|
1035
1059
|
{
|
|
1036
|
-
className:
|
|
1060
|
+
className: x(
|
|
1037
1061
|
"h-1.5 w-1.5 rounded-full",
|
|
1038
|
-
|
|
1062
|
+
n.read ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1039
1063
|
)
|
|
1040
1064
|
}
|
|
1041
1065
|
),
|
|
1042
|
-
|
|
1043
|
-
|
|
1066
|
+
n.name,
|
|
1067
|
+
n.ack === "acked" && /* @__PURE__ */ t(he, { className: "h-3 w-3" })
|
|
1044
1068
|
]
|
|
1045
1069
|
},
|
|
1046
|
-
|
|
1070
|
+
n.id
|
|
1047
1071
|
)) })
|
|
1048
1072
|
] }, e.key)) })
|
|
1049
|
-
] }) :
|
|
1050
|
-
/* @__PURE__ */ t(
|
|
1073
|
+
] }) : ot ? /* @__PURE__ */ t("p", { className: "px-8 py-10 text-[13px] text-slate-400", children: "Loading…" }) : L.length === 0 && j.length === 0 && z.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-24 text-center", children: [
|
|
1074
|
+
/* @__PURE__ */ t(Re, { className: "h-10 w-10 text-slate-200 dark:text-slate-700" }),
|
|
1051
1075
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[14px] font-medium text-slate-500", children: "You're all caught up" }),
|
|
1052
|
-
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children:
|
|
1053
|
-
] }) : /* @__PURE__ */ t(
|
|
1076
|
+
/* @__PURE__ */ t("p", { className: "mt-1 text-[12px] text-slate-400", children: d === "inbox" ? "No unread notifications." : "No notifications here." })
|
|
1077
|
+
] }) : /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ a(
|
|
1054
1078
|
"div",
|
|
1055
1079
|
{
|
|
1056
|
-
ref:
|
|
1057
|
-
className: "mx-
|
|
1080
|
+
ref: ht,
|
|
1081
|
+
className: "mx-4 my-6 divide-y sm:mx-8 divide-slate-100 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card",
|
|
1058
1082
|
children: [
|
|
1059
|
-
z.length > 0 && /* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1083
|
+
z.length > 0 && /* @__PURE__ */ a("div", { "data-notification-pinned": !0, children: [
|
|
1084
|
+
/* @__PURE__ */ a("div", { className: "bg-amber-50 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/10 dark:text-amber-300", children: [
|
|
1061
1085
|
"Needs your acknowledgement · ",
|
|
1062
1086
|
z.length
|
|
1063
1087
|
] }),
|
|
1064
|
-
z.map((e) => /* @__PURE__ */ t(
|
|
1088
|
+
z.map((e) => /* @__PURE__ */ t(xe, { children: ce(e) }, `pin:${e.id}`))
|
|
1065
1089
|
] }),
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
const l = (
|
|
1069
|
-
if (!
|
|
1070
|
-
const
|
|
1071
|
-
return
|
|
1072
|
-
}, s = l(e.created_at),
|
|
1073
|
-
return /* @__PURE__ */
|
|
1074
|
-
s !==
|
|
1075
|
-
/* @__PURE__ */ t("div", { "data-live-key":
|
|
1090
|
+
pt.map(wt),
|
|
1091
|
+
De.map((e, n) => {
|
|
1092
|
+
const l = (A) => {
|
|
1093
|
+
if (!A) return "Older";
|
|
1094
|
+
const c = new Date(A), v = /* @__PURE__ */ new Date(), y = new Date(v.getFullYear(), v.getMonth(), v.getDate());
|
|
1095
|
+
return c >= y ? "Today" : c >= new Date(y.getTime() - 864e5) ? "Yesterday" : c >= new Date(y.getTime() - 5184e5) ? "This week" : "Older";
|
|
1096
|
+
}, s = l(e.created_at), k = n > 0 ? l(De[n - 1].created_at) : null;
|
|
1097
|
+
return /* @__PURE__ */ a(xe, { children: [
|
|
1098
|
+
s !== k ? /* @__PURE__ */ t("div", { className: "bg-slate-50/80 px-4 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:bg-muted/40", children: s }) : null,
|
|
1099
|
+
/* @__PURE__ */ t("div", { "data-live-key": Ge(e), children: ce(e) })
|
|
1076
1100
|
] }, e.id);
|
|
1077
1101
|
})
|
|
1078
1102
|
]
|
|
1079
1103
|
}
|
|
1080
1104
|
) }),
|
|
1081
|
-
|
|
1082
|
-
/* @__PURE__ */
|
|
1105
|
+
d !== "sent" && F > ke && /* @__PURE__ */ a("div", { className: "mx-8 mb-6 flex items-center justify-between", children: [
|
|
1106
|
+
/* @__PURE__ */ a("p", { className: "text-[12px] text-slate-400", children: [
|
|
1083
1107
|
"Page ",
|
|
1084
|
-
|
|
1108
|
+
_,
|
|
1085
1109
|
" of ",
|
|
1086
|
-
|
|
1110
|
+
le
|
|
1087
1111
|
] }),
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1113
|
+
/* @__PURE__ */ a(
|
|
1090
1114
|
"button",
|
|
1091
1115
|
{
|
|
1092
1116
|
type: "button",
|
|
1093
|
-
disabled:
|
|
1094
|
-
onClick: () =>
|
|
1117
|
+
disabled: _ <= 1,
|
|
1118
|
+
onClick: () => q((e) => Math.max(1, e - 1)),
|
|
1095
1119
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
1096
1120
|
children: [
|
|
1097
|
-
/* @__PURE__ */ t(
|
|
1121
|
+
/* @__PURE__ */ t($t, { className: "mr-1 h-3.5 w-3.5" }),
|
|
1098
1122
|
"Previous"
|
|
1099
1123
|
]
|
|
1100
1124
|
}
|
|
1101
1125
|
),
|
|
1102
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ a(
|
|
1103
1127
|
"button",
|
|
1104
1128
|
{
|
|
1105
1129
|
type: "button",
|
|
1106
|
-
disabled:
|
|
1107
|
-
onClick: () =>
|
|
1130
|
+
disabled: _ >= le,
|
|
1131
|
+
onClick: () => q((e) => Math.min(le, e + 1)),
|
|
1108
1132
|
className: "inline-flex h-7 items-center rounded-md border border-slate-200 px-2 text-[12px] disabled:opacity-40 dark:border-border",
|
|
1109
1133
|
children: [
|
|
1110
1134
|
"Next",
|
|
@@ -1116,19 +1140,37 @@ function Sa({
|
|
|
1116
1140
|
] })
|
|
1117
1141
|
] }),
|
|
1118
1142
|
/* @__PURE__ */ t(
|
|
1119
|
-
|
|
1143
|
+
Vt,
|
|
1120
1144
|
{
|
|
1121
|
-
notificationId: (
|
|
1122
|
-
title: (
|
|
1123
|
-
onClose: () =>
|
|
1145
|
+
notificationId: (C == null ? void 0 : C.id) ?? null,
|
|
1146
|
+
title: (C == null ? void 0 : C.subject) ?? (C == null ? void 0 : C.title) ?? null,
|
|
1147
|
+
onClose: () => Ce(null)
|
|
1124
1148
|
}
|
|
1125
1149
|
)
|
|
1126
1150
|
] });
|
|
1127
1151
|
}
|
|
1128
|
-
function
|
|
1129
|
-
const
|
|
1130
|
-
return
|
|
1152
|
+
function He(o) {
|
|
1153
|
+
const p = o.replace(/_/g, " ").trim();
|
|
1154
|
+
return p ? p.charAt(0).toUpperCase() + p.slice(1) : o;
|
|
1155
|
+
}
|
|
1156
|
+
function ia({ text: o }) {
|
|
1157
|
+
const p = o.split(`
|
|
1158
|
+
`).map((g) => g.trim()).filter(Boolean);
|
|
1159
|
+
if (p.length <= 1)
|
|
1160
|
+
return /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-3 whitespace-pre-line text-[12px] text-slate-500", children: o });
|
|
1161
|
+
const f = p.slice(0, 4);
|
|
1162
|
+
return /* @__PURE__ */ a("div", { className: "mt-0.5 space-y-0.5 text-[12px] text-slate-500", children: [
|
|
1163
|
+
f.map((g, W) => (
|
|
1164
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: static lines of one message
|
|
1165
|
+
/* @__PURE__ */ t("p", { className: "line-clamp-2", children: g }, W)
|
|
1166
|
+
)),
|
|
1167
|
+
p.length > f.length && /* @__PURE__ */ a("p", { className: "text-[11.5px] text-slate-400", children: [
|
|
1168
|
+
"+",
|
|
1169
|
+
p.length - f.length,
|
|
1170
|
+
" more"
|
|
1171
|
+
] })
|
|
1172
|
+
] });
|
|
1131
1173
|
}
|
|
1132
1174
|
export {
|
|
1133
|
-
|
|
1175
|
+
Aa as NotificationCenterView
|
|
1134
1176
|
};
|