@nivaro/react 0.3.139 → 0.3.141
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/components/InlineGridField.js +95 -92
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +39 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2702 -2671
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3475 -3458
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/RowPresence.js +83 -76
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/UnseenDot.js +183 -22
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/delivery-analytics/drill.js +32 -32
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1390 -1376
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/item-edit/RecordRecapChanges.js +116 -74
- package/dist/shared/components/item-edit/RecordRecapStrip.js +148 -160
- package/dist/shared/components/item-edit/summary-layout-request.js +15 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +226 -157
- package/dist/shared/components/layout-editor/settings/WhoSection.js +53 -52
- package/dist/shared/components/layout-editor/settings/controls.js +98 -90
- package/dist/shared/components/layout-editor/settings/settings-registry.js +8 -0
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +884 -872
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +123 -123
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +251 -229
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/layout-resolve.js +64 -48
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
import { jsxs as a, jsx as t, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useState as u, useMemo as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { useLiveOps as
|
|
8
|
-
import { useLiveRefetchInterval as
|
|
9
|
-
import { cn as y, formatDateTime as
|
|
10
|
-
import { audienceConfirmFromError as
|
|
11
|
-
import { BroadcastDraftPanel as
|
|
12
|
-
import { useHelpVideoLibrary as
|
|
13
|
-
import { formatDuration as
|
|
14
|
-
import { PickList as
|
|
15
|
-
import { LiveFigure as
|
|
16
|
-
const
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as xe, useQuery as v, useMutation as A } from "@tanstack/react-query";
|
|
3
|
+
import { useState as u, useMemo as W, useEffect as je } from "react";
|
|
4
|
+
import { createPortal as Ke } from "react-dom";
|
|
5
|
+
import { useNivaroClient as M } from "../context.js";
|
|
6
|
+
import { get as N, post as K, patch as Le, del as Pe } from "../lib/commands.js";
|
|
7
|
+
import { useLiveOps as Ee } from "../lib/live-ops.js";
|
|
8
|
+
import { useLiveRefetchInterval as Oe } from "../lib/live-queries.js";
|
|
9
|
+
import { cn as k, formatNumber as y, formatDateTime as Q } from "../lib/utils.js";
|
|
10
|
+
import { audienceConfirmFromError as De, AudienceConfirmPanel as Ie } from "./AudienceConfirmPanel.js";
|
|
11
|
+
import { BroadcastDraftPanel as Qe } from "./BroadcastDraft.js";
|
|
12
|
+
import { useHelpVideoLibrary as Re } from "./help-videos/api.js";
|
|
13
|
+
import { formatDuration as Me } from "./help-videos/viewer/format.js";
|
|
14
|
+
import { PickList as He } from "./imports/ServiceConfigBuilder.js";
|
|
15
|
+
import { LiveFigure as pe } from "./LiveFigure.js";
|
|
16
|
+
const he = {
|
|
17
17
|
info: "bg-sky-500",
|
|
18
18
|
warn: "bg-amber-500",
|
|
19
19
|
critical: "bg-red-500"
|
|
20
20
|
};
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
const i =
|
|
24
|
-
if (!
|
|
25
|
-
const e = Number(
|
|
21
|
+
function it({ className: r }) {
|
|
22
|
+
var ue;
|
|
23
|
+
const i = M(), c = xe(), [b, h] = u(""), [s, p] = u(""), [o, n] = u("info"), [m, x] = u(!1), [d, w] = u(!1), [g, ge] = u(!0), [H, fe] = u(!1), [q, ye] = u("banner"), [V, ke] = u(!1), [X, ve] = u(""), [U, B] = u(""), [ee, Ne] = u(""), [L, G] = u([]), [T, we] = u([]), [te, C] = u(null), [F, ae] = u(""), [re, ne] = u(""), j = Re({ status: "published" }), se = () => {
|
|
24
|
+
if (!F) return {};
|
|
25
|
+
const e = Number(re);
|
|
26
26
|
return {
|
|
27
|
-
help_video_id:
|
|
27
|
+
help_video_id: F,
|
|
28
28
|
help_video_t_ms: Number.isFinite(e) && e > 0 ? Math.round(e * 1e3) : null
|
|
29
29
|
};
|
|
30
|
-
}, { data:
|
|
30
|
+
}, { data: z } = v({
|
|
31
31
|
queryKey: ["broadcast-config"],
|
|
32
|
-
queryFn: () => i.request(
|
|
32
|
+
queryFn: () => i.request(N("/announcements/config")).then((e) => e.data).catch(() => ({ sms_enabled: !1 })),
|
|
33
33
|
staleTime: 5 * 6e4
|
|
34
|
-
}), { data:
|
|
34
|
+
}), { data: _e = [] } = v({
|
|
35
35
|
queryKey: ["broadcast-dimensions"],
|
|
36
|
-
queryFn: () => i.request(
|
|
36
|
+
queryFn: () => i.request(N("/scope-dimensions")).then((e) => e.data ?? []).catch(() => []),
|
|
37
37
|
staleTime: 5 * 6e4
|
|
38
|
-
}), { data:
|
|
38
|
+
}), { data: Se = [] } = v({
|
|
39
39
|
queryKey: ["broadcast-roles"],
|
|
40
|
-
queryFn: () => i.request(
|
|
40
|
+
queryFn: () => i.request(N("/chat/roles")).then((e) => e.data ?? []).catch(() => []),
|
|
41
41
|
staleTime: 5 * 6e4
|
|
42
|
-
}), { data:
|
|
42
|
+
}), { data: de = [] } = v({
|
|
43
43
|
queryKey: ["broadcasts"],
|
|
44
|
-
queryFn: () => i.request(
|
|
44
|
+
queryFn: () => i.request(N("/announcements")).then((e) => e.data ?? [])
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
Ee("broadcasts", () => {
|
|
47
47
|
c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["broadcast-receipt-summary"] }), c.invalidateQueries({ queryKey: ["broadcast-receipts"] });
|
|
48
48
|
});
|
|
49
|
-
const
|
|
49
|
+
const _ = W(() => {
|
|
50
50
|
const e = [];
|
|
51
|
-
return g && e.push(
|
|
52
|
-
}, [g,
|
|
53
|
-
() =>
|
|
51
|
+
return g && e.push(q), m && e.push("email"), d && e.push("sms"), H && e.push("login"), e;
|
|
52
|
+
}, [g, q, m, d, H]), P = W(
|
|
53
|
+
() => L.map((e) => {
|
|
54
54
|
const l = {};
|
|
55
|
-
for (const [f,
|
|
55
|
+
for (const [f, S] of Object.entries(e)) f && S.length > 0 && (l[f] = S);
|
|
56
56
|
return l;
|
|
57
57
|
}).filter((e) => Object.keys(e).length > 0),
|
|
58
|
-
[
|
|
59
|
-
),
|
|
58
|
+
[L]
|
|
59
|
+
), E = W(
|
|
60
60
|
() => ({
|
|
61
|
-
...
|
|
62
|
-
...
|
|
61
|
+
...P.length > 0 ? { groups: P } : {},
|
|
62
|
+
...T.length > 0 ? { roles: T } : {}
|
|
63
63
|
}),
|
|
64
|
-
[
|
|
65
|
-
), [
|
|
64
|
+
[P, T]
|
|
65
|
+
), [le, O] = u(null), $ = A({
|
|
66
66
|
mutationFn: (e) => i.request(
|
|
67
|
-
|
|
67
|
+
K("/announcements", {
|
|
68
68
|
...e != null && e.confirm ? { confirm_audience: !0 } : {},
|
|
69
69
|
subject: b.trim() || void 0,
|
|
70
70
|
message: s.trim(),
|
|
71
71
|
severity: o,
|
|
72
|
-
channels:
|
|
73
|
-
starts_at:
|
|
74
|
-
scheduled_send_at:
|
|
75
|
-
ends_at:
|
|
76
|
-
require_ack: g &&
|
|
77
|
-
audience:
|
|
78
|
-
...
|
|
72
|
+
channels: _,
|
|
73
|
+
starts_at: X || void 0,
|
|
74
|
+
scheduled_send_at: U || void 0,
|
|
75
|
+
ends_at: ee || void 0,
|
|
76
|
+
require_ack: g && q === "banner" ? V : !1,
|
|
77
|
+
audience: E,
|
|
78
|
+
...se()
|
|
79
79
|
})
|
|
80
80
|
),
|
|
81
81
|
onSuccess: (e) => {
|
|
82
|
-
|
|
82
|
+
O(null);
|
|
83
83
|
const l = e.data.scheduled_for;
|
|
84
|
-
|
|
85
|
-
l ? `Scheduled — delivers ${new Date(l).toLocaleString()}. Cancel from the history below.` :
|
|
86
|
-
), p(""), h(""),
|
|
84
|
+
C(
|
|
85
|
+
l ? `Scheduled — delivers ${new Date(l).toLocaleString()}. Cancel from the history below.` : _.some((f) => f !== "banner") ? `Sent — reached ${e.data.delivered} recipient(s).` : "Banner published."
|
|
86
|
+
), p(""), h(""), B(""), ae(""), ne(""), c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["announcements-active"] });
|
|
87
87
|
},
|
|
88
88
|
onError: (e) => {
|
|
89
|
-
const l =
|
|
89
|
+
const l = De(e);
|
|
90
90
|
if (l) {
|
|
91
|
-
|
|
91
|
+
O(l);
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
C(e.message);
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
96
|
+
}), D = s.trim().length > 0 && _.length > 0 && !$.isPending, { data: oe = [] } = v({
|
|
97
97
|
queryKey: ["broadcast-templates"],
|
|
98
|
-
queryFn: () => i.request(
|
|
98
|
+
queryFn: () => i.request(N("/announcements/templates")).then((e) => e.data ?? []).catch(() => []),
|
|
99
99
|
staleTime: 6e4
|
|
100
|
-
}),
|
|
100
|
+
}), ie = A({
|
|
101
101
|
mutationFn: (e) => i.request(
|
|
102
|
-
|
|
102
|
+
K("/announcements/templates", {
|
|
103
103
|
name: e,
|
|
104
104
|
snapshot: {
|
|
105
105
|
subject: b,
|
|
106
106
|
message: s,
|
|
107
107
|
severity: o,
|
|
108
|
-
channels:
|
|
109
|
-
require_ack:
|
|
110
|
-
audience:
|
|
108
|
+
channels: _,
|
|
109
|
+
require_ack: V,
|
|
110
|
+
audience: E
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
113
|
),
|
|
114
114
|
onSuccess: () => void c.invalidateQueries({ queryKey: ["broadcast-templates"] })
|
|
115
|
-
}),
|
|
115
|
+
}), qe = (e) => {
|
|
116
116
|
const l = e.snapshot ?? {};
|
|
117
117
|
typeof l.subject == "string" && h(l.subject), typeof l.message == "string" && p(l.message);
|
|
118
|
-
}, [
|
|
118
|
+
}, [Y, ce] = u(""), [Ce, me] = u(!1), Z = A({
|
|
119
119
|
mutationFn: () => i.request(
|
|
120
|
-
|
|
120
|
+
K("/announcements/test-send", {
|
|
121
121
|
subject: b.trim() || void 0,
|
|
122
122
|
message: s.trim(),
|
|
123
|
-
channels:
|
|
124
|
-
...
|
|
123
|
+
channels: _.filter((e) => e !== "banner"),
|
|
124
|
+
...se()
|
|
125
125
|
})
|
|
126
126
|
),
|
|
127
|
-
onSuccess: (e) =>
|
|
127
|
+
onSuccess: (e) => C(
|
|
128
128
|
`Test sent to you — ${Object.entries(e.data ?? {}).map(([l, f]) => `${l}: ${f}`).join(", ")}`
|
|
129
129
|
),
|
|
130
|
-
onError: (e) =>
|
|
131
|
-
}),
|
|
132
|
-
mutationFn: ({ id: e, body: l }) => i.request(
|
|
130
|
+
onError: (e) => C(e.message)
|
|
131
|
+
}), I = (/* @__PURE__ */ new Date()).getHours(), $e = !U && (I >= 21 || I < 7), Ae = A({
|
|
132
|
+
mutationFn: ({ id: e, body: l }) => i.request(Le(`/announcements/${e}`, l)),
|
|
133
133
|
onSuccess: () => {
|
|
134
134
|
c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["announcements-active"] });
|
|
135
135
|
}
|
|
136
|
-
}),
|
|
137
|
-
mutationFn: (e) => i.request(
|
|
136
|
+
}), Te = A({
|
|
137
|
+
mutationFn: (e) => i.request(Pe(`/announcements/${e}`)),
|
|
138
138
|
onSuccess: () => {
|
|
139
139
|
c.invalidateQueries({ queryKey: ["broadcasts"] }), c.invalidateQueries({ queryKey: ["announcements-active"] });
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
-
return /* @__PURE__ */ a("div", { className:
|
|
142
|
+
return /* @__PURE__ */ a("div", { className: k("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-6", r), children: [
|
|
143
143
|
/* @__PURE__ */ a("div", { className: "max-w-[760px] rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
|
|
144
144
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: "Audience" }),
|
|
145
145
|
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[11.5px] text-slate-400", children: "No selection = everyone. Zone/role targeting narrows both send channels and who sees a banner." }),
|
|
146
146
|
/* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: [
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
L.map((e, l) => /* @__PURE__ */ t(
|
|
148
|
+
Ue,
|
|
149
149
|
{
|
|
150
150
|
index: l,
|
|
151
151
|
group: e,
|
|
152
|
-
dimensions:
|
|
153
|
-
onChange: (f) =>
|
|
154
|
-
onRemove: () =>
|
|
152
|
+
dimensions: _e,
|
|
153
|
+
onChange: (f) => G((S) => S.map((J, Fe) => Fe === l ? f : J)),
|
|
154
|
+
onRemove: () => G((f) => f.filter((S, J) => J !== l))
|
|
155
155
|
},
|
|
156
156
|
l
|
|
157
157
|
)),
|
|
@@ -159,26 +159,26 @@ function ot({ className: r }) {
|
|
|
159
159
|
"button",
|
|
160
160
|
{
|
|
161
161
|
type: "button",
|
|
162
|
-
onClick: () =>
|
|
162
|
+
onClick: () => G((e) => [...e, {}]),
|
|
163
163
|
className: "rounded-md border border-dashed border-slate-300 px-3 py-1.5 text-[11.5px] text-slate-500 hover:border-slate-400 hover:text-slate-700 dark:border-border dark:text-muted-foreground",
|
|
164
164
|
children: [
|
|
165
165
|
"+",
|
|
166
166
|
" ",
|
|
167
|
-
|
|
167
|
+
L.length === 0 ? "Target by scope (e.g. Zone 2 + Node Splits)" : "Add another group (OR)"
|
|
168
168
|
]
|
|
169
169
|
}
|
|
170
170
|
)
|
|
171
171
|
] }),
|
|
172
172
|
/* @__PURE__ */ a("div", { className: "mt-3", children: [
|
|
173
173
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Limit to roles" }),
|
|
174
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1.5", children:
|
|
175
|
-
const l =
|
|
174
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1.5", children: Se.map((e) => {
|
|
175
|
+
const l = T.includes(e.id);
|
|
176
176
|
return /* @__PURE__ */ t(
|
|
177
177
|
"button",
|
|
178
178
|
{
|
|
179
179
|
type: "button",
|
|
180
|
-
onClick: () =>
|
|
181
|
-
className:
|
|
180
|
+
onClick: () => we((f) => l ? f.filter((S) => S !== e.id) : [...f, e.id]),
|
|
181
|
+
className: k(
|
|
182
182
|
"rounded-full border px-2.5 py-0.5 text-[11.5px] transition-colors",
|
|
183
183
|
l ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-border dark:text-muted-foreground"
|
|
184
184
|
),
|
|
@@ -189,10 +189,10 @@ function ot({ className: r }) {
|
|
|
189
189
|
}) })
|
|
190
190
|
] }),
|
|
191
191
|
/* @__PURE__ */ t("div", { className: "mt-3 border-t border-slate-100 pt-2.5 dark:border-border", children: /* @__PURE__ */ t(
|
|
192
|
-
|
|
192
|
+
be,
|
|
193
193
|
{
|
|
194
|
-
audience:
|
|
195
|
-
everyone:
|
|
194
|
+
audience: E,
|
|
195
|
+
everyone: P.length === 0 && T.length === 0,
|
|
196
196
|
label: "Sending to"
|
|
197
197
|
}
|
|
198
198
|
) })
|
|
@@ -200,10 +200,10 @@ function ot({ className: r }) {
|
|
|
200
200
|
/* @__PURE__ */ a("div", { className: "max-w-[760px] rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
|
|
201
201
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: "Message" }),
|
|
202
202
|
/* @__PURE__ */ t(
|
|
203
|
-
|
|
203
|
+
Qe,
|
|
204
204
|
{
|
|
205
|
-
audience:
|
|
206
|
-
channels:
|
|
205
|
+
audience: E,
|
|
206
|
+
channels: _,
|
|
207
207
|
severity: o,
|
|
208
208
|
onUse: (e) => {
|
|
209
209
|
e.subject !== void 0 && h(e.subject), p(e.message);
|
|
@@ -255,22 +255,22 @@ function ot({ className: r }) {
|
|
|
255
255
|
/* @__PURE__ */ a(
|
|
256
256
|
"select",
|
|
257
257
|
{
|
|
258
|
-
value:
|
|
259
|
-
onChange: (e) =>
|
|
258
|
+
value: F,
|
|
259
|
+
onChange: (e) => ae(e.target.value),
|
|
260
260
|
className: "h-7 max-w-[320px] rounded-md border border-slate-200 bg-background px-1.5 text-[12px] text-slate-800 dark:border-border dark:text-foreground",
|
|
261
261
|
"aria-label": "Attach a video",
|
|
262
262
|
"data-broadcast-video-id": !0,
|
|
263
263
|
children: [
|
|
264
264
|
/* @__PURE__ */ t("option", { value: "", children: "None" }),
|
|
265
|
-
(((
|
|
265
|
+
(((ue = j.data) == null ? void 0 : ue.data) ?? []).map((e) => /* @__PURE__ */ a("option", { value: e.id, children: [
|
|
266
266
|
e.title || "Untitled video",
|
|
267
|
-
e.duration_ms != null ? ` (${
|
|
267
|
+
e.duration_ms != null ? ` (${Me(e.duration_ms)})` : ""
|
|
268
268
|
] }, e.id))
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
271
|
)
|
|
272
272
|
] }),
|
|
273
|
-
|
|
273
|
+
F && /* @__PURE__ */ a("label", { className: "flex items-center gap-1.5", children: [
|
|
274
274
|
"Start at",
|
|
275
275
|
/* @__PURE__ */ t(
|
|
276
276
|
"input",
|
|
@@ -278,8 +278,8 @@ function ot({ className: r }) {
|
|
|
278
278
|
type: "number",
|
|
279
279
|
min: 0,
|
|
280
280
|
step: 1,
|
|
281
|
-
value:
|
|
282
|
-
onChange: (e) =>
|
|
281
|
+
value: re,
|
|
282
|
+
onChange: (e) => ne(e.target.value),
|
|
283
283
|
placeholder: "0",
|
|
284
284
|
className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border",
|
|
285
285
|
"aria-label": "Start at (seconds)",
|
|
@@ -288,17 +288,17 @@ function ot({ className: r }) {
|
|
|
288
288
|
),
|
|
289
289
|
"seconds"
|
|
290
290
|
] }),
|
|
291
|
-
|
|
291
|
+
j.hasNextPage && /* @__PURE__ */ t(
|
|
292
292
|
"button",
|
|
293
293
|
{
|
|
294
294
|
type: "button",
|
|
295
|
-
onClick: () => void
|
|
296
|
-
disabled:
|
|
295
|
+
onClick: () => void j.fetchNextPage(),
|
|
296
|
+
disabled: j.isFetchingNextPage,
|
|
297
297
|
className: "rounded border border-slate-200 px-1.5 py-0.5 text-[11px] hover:bg-slate-50 dark:border-border dark:hover:bg-muted",
|
|
298
|
-
children:
|
|
298
|
+
children: j.isFetchingNextPage ? "Loading…" : "More videos"
|
|
299
299
|
}
|
|
300
300
|
),
|
|
301
|
-
|
|
301
|
+
F && /* @__PURE__ */ t("span", { className: "text-slate-400 dark:text-slate-500", children: "Shown as a card with a link to that moment — only to people who can watch the video." })
|
|
302
302
|
]
|
|
303
303
|
}
|
|
304
304
|
),
|
|
@@ -309,7 +309,7 @@ function ot({ className: r }) {
|
|
|
309
309
|
{
|
|
310
310
|
type: "checkbox",
|
|
311
311
|
checked: g,
|
|
312
|
-
onChange: (e) =>
|
|
312
|
+
onChange: (e) => ge(e.target.checked),
|
|
313
313
|
className: "h-3.5 w-3.5"
|
|
314
314
|
}
|
|
315
315
|
),
|
|
@@ -322,10 +322,10 @@ function ot({ className: r }) {
|
|
|
322
322
|
"button",
|
|
323
323
|
{
|
|
324
324
|
type: "button",
|
|
325
|
-
onClick: () =>
|
|
326
|
-
className:
|
|
325
|
+
onClick: () => ye(e.value),
|
|
326
|
+
className: k(
|
|
327
327
|
"rounded px-2 py-0.5 text-[11px] font-medium transition-colors",
|
|
328
|
-
|
|
328
|
+
q === e.value ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600"
|
|
329
329
|
),
|
|
330
330
|
children: e.label
|
|
331
331
|
},
|
|
@@ -353,8 +353,8 @@ function ot({ className: r }) {
|
|
|
353
353
|
"input",
|
|
354
354
|
{
|
|
355
355
|
type: "checkbox",
|
|
356
|
-
checked:
|
|
357
|
-
onChange: (e) =>
|
|
356
|
+
checked: H,
|
|
357
|
+
onChange: (e) => fe(e.target.checked),
|
|
358
358
|
className: "h-3.5 w-3.5"
|
|
359
359
|
}
|
|
360
360
|
),
|
|
@@ -362,26 +362,26 @@ function ot({ className: r }) {
|
|
|
362
362
|
]
|
|
363
363
|
}
|
|
364
364
|
),
|
|
365
|
-
(
|
|
365
|
+
(z == null ? void 0 : z.sms_enabled) && /* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
|
|
366
366
|
/* @__PURE__ */ t(
|
|
367
367
|
"input",
|
|
368
368
|
{
|
|
369
369
|
type: "checkbox",
|
|
370
370
|
checked: d,
|
|
371
|
-
onChange: (e) =>
|
|
371
|
+
onChange: (e) => w(e.target.checked),
|
|
372
372
|
className: "h-3.5 w-3.5"
|
|
373
373
|
}
|
|
374
374
|
),
|
|
375
375
|
"Text (SMS)"
|
|
376
376
|
] }),
|
|
377
|
-
g &&
|
|
377
|
+
g && q === "banner" && /* @__PURE__ */ a(R, { children: [
|
|
378
378
|
/* @__PURE__ */ a("label", { className: "flex cursor-pointer items-center gap-1.5 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
379
379
|
/* @__PURE__ */ t(
|
|
380
380
|
"input",
|
|
381
381
|
{
|
|
382
382
|
type: "checkbox",
|
|
383
|
-
checked:
|
|
384
|
-
onChange: (e) =>
|
|
383
|
+
checked: V,
|
|
384
|
+
onChange: (e) => ke(e.target.checked),
|
|
385
385
|
className: "h-3.5 w-3.5"
|
|
386
386
|
}
|
|
387
387
|
),
|
|
@@ -392,12 +392,12 @@ function ot({ className: r }) {
|
|
|
392
392
|
{
|
|
393
393
|
type: "button",
|
|
394
394
|
onClick: () => n(e),
|
|
395
|
-
className:
|
|
395
|
+
className: k(
|
|
396
396
|
"flex items-center gap-1.5 rounded px-2 py-0.5 text-[11px] font-medium capitalize transition-colors",
|
|
397
397
|
o === e ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600"
|
|
398
398
|
),
|
|
399
399
|
children: [
|
|
400
|
-
/* @__PURE__ */ t("span", { className:
|
|
400
|
+
/* @__PURE__ */ t("span", { className: k("h-1.5 w-1.5 rounded-full", he[e]) }),
|
|
401
401
|
e
|
|
402
402
|
]
|
|
403
403
|
},
|
|
@@ -409,8 +409,8 @@ function ot({ className: r }) {
|
|
|
409
409
|
"input",
|
|
410
410
|
{
|
|
411
411
|
type: "datetime-local",
|
|
412
|
-
value:
|
|
413
|
-
onChange: (e) =>
|
|
412
|
+
value: X,
|
|
413
|
+
onChange: (e) => ve(e.target.value),
|
|
414
414
|
className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
415
415
|
}
|
|
416
416
|
)
|
|
@@ -421,15 +421,15 @@ function ot({ className: r }) {
|
|
|
421
421
|
"input",
|
|
422
422
|
{
|
|
423
423
|
type: "datetime-local",
|
|
424
|
-
value:
|
|
425
|
-
onChange: (e) =>
|
|
424
|
+
value: ee,
|
|
425
|
+
onChange: (e) => Ne(e.target.value),
|
|
426
426
|
className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
427
427
|
}
|
|
428
428
|
)
|
|
429
429
|
] })
|
|
430
430
|
] })
|
|
431
431
|
] }),
|
|
432
|
-
g &&
|
|
432
|
+
g && q === "banner" && /* @__PURE__ */ t("p", { className: "mt-1.5 text-[11px] text-slate-400", children: "Starts/Ends control only the banner's visibility window: it appears at Starts (empty = right away) and auto-expires at Ends for everyone who hasn't dismissed it (empty = stays up until each person dismisses it, or you turn it Off in history). Email, text, and inbox messages always send once, immediately — the window doesn't delay them." }),
|
|
433
433
|
/* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap items-center gap-3", children: [
|
|
434
434
|
/* @__PURE__ */ a("label", { className: "flex items-center gap-1.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
435
435
|
"Send later",
|
|
@@ -437,44 +437,44 @@ function ot({ className: r }) {
|
|
|
437
437
|
"input",
|
|
438
438
|
{
|
|
439
439
|
type: "datetime-local",
|
|
440
|
-
value:
|
|
441
|
-
onChange: (e) =>
|
|
440
|
+
value: U,
|
|
441
|
+
onChange: (e) => B(e.target.value),
|
|
442
442
|
title: "Leave empty to send immediately. With a time set, every channel (banner included) waits until then.",
|
|
443
443
|
className: "h-7 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
444
444
|
}
|
|
445
445
|
)
|
|
446
446
|
] }),
|
|
447
|
-
|
|
447
|
+
_.some((e) => e !== "banner") && /* @__PURE__ */ t(
|
|
448
448
|
"button",
|
|
449
449
|
{
|
|
450
450
|
type: "button",
|
|
451
|
-
disabled: !
|
|
451
|
+
disabled: !D || Z.isPending,
|
|
452
452
|
onClick: () => {
|
|
453
|
-
|
|
453
|
+
C(null), Z.mutate();
|
|
454
454
|
},
|
|
455
455
|
"data-tip": "Send this compose to YOURSELF over the picked channels first (#429)",
|
|
456
456
|
className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] font-medium text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:text-slate-300",
|
|
457
|
-
children:
|
|
457
|
+
children: Z.isPending ? "Testing…" : "Test on me"
|
|
458
458
|
}
|
|
459
459
|
),
|
|
460
460
|
/* @__PURE__ */ t(
|
|
461
461
|
"button",
|
|
462
462
|
{
|
|
463
463
|
type: "button",
|
|
464
|
-
disabled: !
|
|
464
|
+
disabled: !D,
|
|
465
465
|
onClick: () => {
|
|
466
|
-
|
|
466
|
+
C(null), O(null), $.mutate(void 0);
|
|
467
467
|
},
|
|
468
468
|
className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white disabled:opacity-50",
|
|
469
|
-
children:
|
|
469
|
+
children: $.isPending ? "Sending…" : "Send"
|
|
470
470
|
}
|
|
471
471
|
),
|
|
472
|
-
|
|
472
|
+
Ce ? /* @__PURE__ */ a("span", { className: "flex items-center gap-1", children: [
|
|
473
473
|
/* @__PURE__ */ t(
|
|
474
474
|
"input",
|
|
475
475
|
{
|
|
476
|
-
value:
|
|
477
|
-
onChange: (e) =>
|
|
476
|
+
value: Y,
|
|
477
|
+
onChange: (e) => ce(e.target.value),
|
|
478
478
|
placeholder: "Template name…",
|
|
479
479
|
className: "h-7 w-40 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
480
480
|
}
|
|
@@ -483,9 +483,9 @@ function ot({ className: r }) {
|
|
|
483
483
|
"button",
|
|
484
484
|
{
|
|
485
485
|
type: "button",
|
|
486
|
-
disabled: !
|
|
486
|
+
disabled: !Y.trim() || ie.isPending,
|
|
487
487
|
onClick: () => {
|
|
488
|
-
|
|
488
|
+
ie.mutate(Y.trim()), me(!1), ce("");
|
|
489
489
|
},
|
|
490
490
|
className: "h-7 rounded-md border border-slate-200 px-2 text-[11.5px] hover:bg-muted dark:border-border",
|
|
491
491
|
children: "Save"
|
|
@@ -496,29 +496,29 @@ function ot({ className: r }) {
|
|
|
496
496
|
{
|
|
497
497
|
type: "button",
|
|
498
498
|
disabled: !s.trim(),
|
|
499
|
-
onClick: () =>
|
|
499
|
+
onClick: () => me(!0),
|
|
500
500
|
"data-tip": "Save this compose (audience + channels + text) as a reusable template (#104)",
|
|
501
501
|
className: "h-8 rounded-md border border-dashed border-slate-300 px-2.5 text-[11.5px] text-slate-500 hover:text-slate-700 disabled:opacity-40 dark:border-border",
|
|
502
502
|
children: "☆ Save template"
|
|
503
503
|
}
|
|
504
504
|
),
|
|
505
|
-
!
|
|
506
|
-
|
|
505
|
+
!D && !$.isPending && /* @__PURE__ */ t("span", { className: "text-[11.5px] text-slate-400", children: "A message and at least one channel are required." }),
|
|
506
|
+
te && /* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-emerald-600 dark:text-emerald-400", children: te })
|
|
507
507
|
] }),
|
|
508
|
-
|
|
509
|
-
|
|
508
|
+
le && /* @__PURE__ */ t(
|
|
509
|
+
Ie,
|
|
510
510
|
{
|
|
511
511
|
className: "mt-3",
|
|
512
|
-
preview:
|
|
513
|
-
busy:
|
|
512
|
+
preview: le,
|
|
513
|
+
busy: $.isPending,
|
|
514
514
|
confirmLabel: "Confirm and send",
|
|
515
|
-
onConfirm: () =>
|
|
516
|
-
onCancel: () =>
|
|
515
|
+
onConfirm: () => $.mutate({ confirm: !0 }),
|
|
516
|
+
onCancel: () => O(null)
|
|
517
517
|
}
|
|
518
518
|
),
|
|
519
|
-
|
|
519
|
+
$e && D && /* @__PURE__ */ a("p", { className: "mt-2 rounded-md bg-amber-50 px-3 py-1.5 text-[12px] text-amber-700 dark:bg-amber-400/10 dark:text-amber-400", children: [
|
|
520
520
|
"It's ",
|
|
521
|
-
|
|
521
|
+
I >= 21 ? "late" : "early",
|
|
522
522
|
" for most recipients — consider the schedule field so this lands in the morning instead of overnight.",
|
|
523
523
|
" ",
|
|
524
524
|
/* @__PURE__ */ t(
|
|
@@ -528,9 +528,9 @@ function ot({ className: r }) {
|
|
|
528
528
|
className: "font-medium underline underline-offset-2",
|
|
529
529
|
onClick: () => {
|
|
530
530
|
const e = /* @__PURE__ */ new Date();
|
|
531
|
-
|
|
531
|
+
I >= 21 && e.setDate(e.getDate() + 1), e.setHours(8, 0, 0, 0);
|
|
532
532
|
const l = (f) => String(f).padStart(2, "0");
|
|
533
|
-
|
|
533
|
+
B(
|
|
534
534
|
`${e.getFullYear()}-${l(e.getMonth() + 1)}-${l(e.getDate())}T${l(e.getHours())}:${l(e.getMinutes())}`
|
|
535
535
|
);
|
|
536
536
|
},
|
|
@@ -538,9 +538,9 @@ function ot({ className: r }) {
|
|
|
538
538
|
}
|
|
539
539
|
)
|
|
540
540
|
] }),
|
|
541
|
-
|
|
541
|
+
oe.length > 0 && /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: [
|
|
542
542
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "Templates:" }),
|
|
543
|
-
|
|
543
|
+
oe.map((e) => /* @__PURE__ */ t(
|
|
544
544
|
"span",
|
|
545
545
|
{
|
|
546
546
|
className: "inline-flex items-center overflow-hidden rounded-full border border-slate-200 dark:border-border",
|
|
@@ -548,7 +548,7 @@ function ot({ className: r }) {
|
|
|
548
548
|
"button",
|
|
549
549
|
{
|
|
550
550
|
type: "button",
|
|
551
|
-
onClick: () =>
|
|
551
|
+
onClick: () => qe(e),
|
|
552
552
|
className: "px-2 py-0.5 text-[11.5px] text-slate-600 hover:bg-muted dark:text-slate-300",
|
|
553
553
|
children: e.name
|
|
554
554
|
}
|
|
@@ -560,39 +560,39 @@ function ot({ className: r }) {
|
|
|
560
560
|
] }),
|
|
561
561
|
/* @__PURE__ */ a("div", { className: "max-w-[760px] space-y-2", children: [
|
|
562
562
|
/* @__PURE__ */ t("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "History" }),
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
563
|
+
de.length === 0 && /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "Nothing sent yet." }),
|
|
564
|
+
de.map((e) => /* @__PURE__ */ t(
|
|
565
|
+
Ve,
|
|
566
566
|
{
|
|
567
567
|
broadcast: e,
|
|
568
|
-
onPatch:
|
|
569
|
-
onRemove:
|
|
568
|
+
onPatch: Ae.mutate,
|
|
569
|
+
onRemove: Te.mutate
|
|
570
570
|
},
|
|
571
571
|
e.id
|
|
572
572
|
))
|
|
573
573
|
] })
|
|
574
574
|
] });
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Ve({
|
|
577
577
|
broadcast: r,
|
|
578
578
|
onPatch: i,
|
|
579
579
|
onRemove: c
|
|
580
580
|
}) {
|
|
581
|
-
const b =
|
|
581
|
+
const b = M(), h = xe(), [s, p] = u(!1), { data: o } = v({
|
|
582
582
|
queryKey: ["broadcast-receipt-summary", r.id],
|
|
583
|
-
queryFn: () => b.request(
|
|
583
|
+
queryFn: () => b.request(N(`/announcements/${r.id}/receipts/summary`)).then((d) => d.data),
|
|
584
584
|
enabled: s,
|
|
585
585
|
staleTime: 5e3
|
|
586
|
-
}), n =
|
|
586
|
+
}), n = A({
|
|
587
587
|
mutationFn: () => b.request(
|
|
588
|
-
|
|
588
|
+
K(`/announcements/${r.id}/nudge`, {})
|
|
589
589
|
),
|
|
590
590
|
onSuccess: () => {
|
|
591
591
|
h.invalidateQueries({ queryKey: ["broadcast-receipt-summary", r.id] }), h.invalidateQueries({ queryKey: ["broadcast-receipts", r.id] });
|
|
592
592
|
}
|
|
593
|
-
}), m =
|
|
593
|
+
}), m = Oe(4e3), { data: x } = v({
|
|
594
594
|
queryKey: ["broadcast-receipts", r.id],
|
|
595
|
-
queryFn: () => b.request(
|
|
595
|
+
queryFn: () => b.request(N(`/announcements/${r.id}/receipts`)).then((d) => d.data),
|
|
596
596
|
enabled: s,
|
|
597
597
|
staleTime: 5e3,
|
|
598
598
|
// Live ticker (#265): a freshly-sent broadcast's counts climb in real
|
|
@@ -601,7 +601,7 @@ function He({
|
|
|
601
601
|
});
|
|
602
602
|
return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
603
603
|
/* @__PURE__ */ a("div", { className: "flex items-start gap-3 px-4 py-3", children: [
|
|
604
|
-
/* @__PURE__ */ t("span", { className:
|
|
604
|
+
/* @__PURE__ */ t("span", { className: k("mt-1.5 h-2 w-2 shrink-0 rounded-full", he[r.severity]) }),
|
|
605
605
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
606
606
|
r.subject && /* @__PURE__ */ t("p", { className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: r.subject }),
|
|
607
607
|
/* @__PURE__ */ t("p", { className: "text-[12.5px] text-slate-600 dark:text-muted-foreground", children: r.message }),
|
|
@@ -612,7 +612,7 @@ function He({
|
|
|
612
612
|
r.scheduled_send_at && !r.sent_at && /* @__PURE__ */ a("p", { className: "mt-1 flex items-center gap-2 text-[11.5px]", children: [
|
|
613
613
|
/* @__PURE__ */ a("span", { className: "rounded-full bg-amber-100 px-2 py-0.5 font-semibold text-amber-700 dark:bg-amber-500/15 dark:text-amber-400", children: [
|
|
614
614
|
"Scheduled · ",
|
|
615
|
-
|
|
615
|
+
Q(r.scheduled_send_at)
|
|
616
616
|
] }),
|
|
617
617
|
/* @__PURE__ */ t(
|
|
618
618
|
"button",
|
|
@@ -627,15 +627,15 @@ function He({
|
|
|
627
627
|
/* @__PURE__ */ a("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
628
628
|
(r.channels ?? []).join(" + "),
|
|
629
629
|
r.delivered_count != null && ` · reached ${r.delivered_count}`,
|
|
630
|
-
r.opened_count != null && (r.channels ?? []).includes("message") && /* @__PURE__ */ a(
|
|
630
|
+
r.opened_count != null && (r.channels ?? []).includes("message") && /* @__PURE__ */ a(R, { children: [
|
|
631
631
|
" · inbox opened ",
|
|
632
|
-
/* @__PURE__ */ t(
|
|
632
|
+
/* @__PURE__ */ t(pe, { value: r.opened_count, className: "font-medium", children: y(r.opened_count) })
|
|
633
633
|
] }),
|
|
634
|
-
(r.channels ?? []).includes("banner") && /* @__PURE__ */ a(
|
|
634
|
+
(r.channels ?? []).includes("banner") && /* @__PURE__ */ a(R, { children: [
|
|
635
635
|
" · banner dismissed ",
|
|
636
|
-
/* @__PURE__ */ t(
|
|
636
|
+
/* @__PURE__ */ t(pe, { value: r.ack_count, className: "font-medium", children: y(r.ack_count) })
|
|
637
637
|
] }),
|
|
638
|
-
r.created_at && ` · ${
|
|
638
|
+
r.created_at && ` · ${Q(r.created_at)}`,
|
|
639
639
|
" · ",
|
|
640
640
|
/* @__PURE__ */ a(
|
|
641
641
|
"button",
|
|
@@ -646,7 +646,7 @@ function He({
|
|
|
646
646
|
children: [
|
|
647
647
|
s ? "hide receipts" : "who saw this?",
|
|
648
648
|
(r.click_count ?? 0) > 0 && /* @__PURE__ */ a("span", { className: "ml-1.5 rounded bg-nvr-cyan/[0.08] px-1.5 py-px text-[10px] font-medium text-[#007a99] dark:text-nvr-cyan", children: [
|
|
649
|
-
r.click_count,
|
|
649
|
+
y(r.click_count),
|
|
650
650
|
" link click",
|
|
651
651
|
r.click_count === 1 ? "" : "s"
|
|
652
652
|
] })
|
|
@@ -660,7 +660,7 @@ function He({
|
|
|
660
660
|
{
|
|
661
661
|
type: "button",
|
|
662
662
|
onClick: () => i({ id: r.id, body: { is_active: !r.is_active } }),
|
|
663
|
-
className:
|
|
663
|
+
className: k(
|
|
664
664
|
"shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium",
|
|
665
665
|
r.is_active ? "border-emerald-300 text-emerald-700 dark:border-emerald-500/40 dark:text-emerald-400" : "border-slate-200 text-slate-400 dark:border-border"
|
|
666
666
|
),
|
|
@@ -687,14 +687,16 @@ function He({
|
|
|
687
687
|
/* @__PURE__ */ t("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "By audience" }),
|
|
688
688
|
/* @__PURE__ */ a("span", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
689
689
|
"delivered ",
|
|
690
|
-
/* @__PURE__ */ t("b", { children: o.totals.delivered }),
|
|
691
|
-
" · opened
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
690
|
+
/* @__PURE__ */ t("b", { children: y(o.totals.delivered) }),
|
|
691
|
+
" · opened",
|
|
692
|
+
" ",
|
|
693
|
+
/* @__PURE__ */ t("b", { children: y(o.totals.opened) }),
|
|
694
|
+
" · acknowledged",
|
|
695
|
+
" ",
|
|
696
|
+
/* @__PURE__ */ t("b", { children: y(o.totals.acked) }),
|
|
695
697
|
" · still unread",
|
|
696
698
|
" ",
|
|
697
|
-
/* @__PURE__ */ t("b", { children: o.totals.unread })
|
|
699
|
+
/* @__PURE__ */ t("b", { children: y(o.totals.unread) })
|
|
698
700
|
] }),
|
|
699
701
|
/* @__PURE__ */ t("span", { className: "flex-1" }),
|
|
700
702
|
o.totals.unread > 0 && /* @__PURE__ */ t(
|
|
@@ -710,7 +712,7 @@ function He({
|
|
|
710
712
|
)
|
|
711
713
|
] }),
|
|
712
714
|
/* @__PURE__ */ t("div", { className: "mt-2 grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3", children: [["Role", o.by_role], ...Object.entries(o.by_dimension)].map(
|
|
713
|
-
([d,
|
|
715
|
+
([d, w]) => /* @__PURE__ */ a("table", { className: "w-full text-[11.5px] tabular-nums", children: [
|
|
714
716
|
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ a("tr", { className: "text-left text-[10px] uppercase tracking-wide text-slate-400", children: [
|
|
715
717
|
/* @__PURE__ */ t("th", { className: "py-0.5 font-semibold", children: d }),
|
|
716
718
|
/* @__PURE__ */ t("th", { className: "py-0.5 text-right font-semibold", children: "Sent" }),
|
|
@@ -718,7 +720,7 @@ function He({
|
|
|
718
720
|
/* @__PURE__ */ t("th", { className: "py-0.5 text-right font-semibold", children: "Ack" }),
|
|
719
721
|
/* @__PURE__ */ t("th", { className: "py-0.5 text-right font-semibold", children: "Unread" })
|
|
720
722
|
] }) }),
|
|
721
|
-
/* @__PURE__ */ t("tbody", { children:
|
|
723
|
+
/* @__PURE__ */ t("tbody", { children: w.map((g) => /* @__PURE__ */ a("tr", { className: "border-t border-slate-100 dark:border-border", children: [
|
|
722
724
|
/* @__PURE__ */ t("td", { className: "py-0.5 text-slate-700 dark:text-foreground", children: g.label }),
|
|
723
725
|
/* @__PURE__ */ t("td", { className: "py-0.5 text-right", children: g.delivered }),
|
|
724
726
|
/* @__PURE__ */ t("td", { className: "py-0.5 text-right text-emerald-700 dark:text-emerald-400", children: g.opened }),
|
|
@@ -726,7 +728,7 @@ function He({
|
|
|
726
728
|
/* @__PURE__ */ t(
|
|
727
729
|
"td",
|
|
728
730
|
{
|
|
729
|
-
className:
|
|
731
|
+
className: k(
|
|
730
732
|
"py-0.5 text-right",
|
|
731
733
|
g.unread > 0 ? "text-amber-700 dark:text-amber-400" : "text-slate-400"
|
|
732
734
|
),
|
|
@@ -750,21 +752,21 @@ function He({
|
|
|
750
752
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Seen (banner dismissed)" }),
|
|
751
753
|
!x && /* @__PURE__ */ t("p", { className: "text-[11.5px] text-slate-400", children: "Loading…" }),
|
|
752
754
|
x && x.acks.length === 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px] text-slate-400", children: "Nobody has dismissed it yet." }),
|
|
753
|
-
x == null ? void 0 : x.acks.map((d,
|
|
755
|
+
x == null ? void 0 : x.acks.map((d, w) => /* @__PURE__ */ a("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
754
756
|
d.user_name || d.user_email || "Unknown",
|
|
755
|
-
/* @__PURE__ */ t("span", { className: "text-slate-400", children: d.acked_at ? ` · ${
|
|
756
|
-
] },
|
|
757
|
+
/* @__PURE__ */ t("span", { className: "text-slate-400", children: d.acked_at ? ` · ${Q(d.acked_at)}` : "" })
|
|
758
|
+
] }, w))
|
|
757
759
|
] }),
|
|
758
760
|
/* @__PURE__ */ a("div", { children: [
|
|
759
761
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Deliveries" }),
|
|
760
762
|
!x && /* @__PURE__ */ t("p", { className: "text-[11.5px] text-slate-400", children: "Loading…" }),
|
|
761
763
|
x && x.deliveries.length === 0 && /* @__PURE__ */ t("p", { className: "text-[11.5px] text-slate-400", children: "Banner-only — no send channels on this broadcast." }),
|
|
762
|
-
x == null ? void 0 : x.deliveries.map((d,
|
|
764
|
+
x == null ? void 0 : x.deliveries.map((d, w) => /* @__PURE__ */ a("p", { className: "text-[11.5px] text-slate-600 dark:text-muted-foreground", children: [
|
|
763
765
|
d.user_name || d.user_email || "Unknown",
|
|
764
766
|
/* @__PURE__ */ a(
|
|
765
767
|
"span",
|
|
766
768
|
{
|
|
767
|
-
className:
|
|
769
|
+
className: k(
|
|
768
770
|
"ml-1.5 rounded px-1 py-px text-[9.5px] font-medium uppercase",
|
|
769
771
|
d.status === "sent" ? "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400" : d.status === "failed" ? "bg-red-500/10 text-red-700 dark:text-red-400" : "bg-slate-500/10 text-slate-500"
|
|
770
772
|
),
|
|
@@ -775,13 +777,13 @@ function He({
|
|
|
775
777
|
]
|
|
776
778
|
}
|
|
777
779
|
),
|
|
778
|
-
/* @__PURE__ */ t("span", { className: "text-slate-400", children: d.delivered_at ? ` · ${
|
|
779
|
-
] },
|
|
780
|
+
/* @__PURE__ */ t("span", { className: "text-slate-400", children: d.delivered_at ? ` · ${Q(d.delivered_at)}` : "" })
|
|
781
|
+
] }, w))
|
|
780
782
|
] })
|
|
781
783
|
] })
|
|
782
784
|
] });
|
|
783
785
|
}
|
|
784
|
-
function
|
|
786
|
+
function Ue({
|
|
785
787
|
index: r,
|
|
786
788
|
group: i,
|
|
787
789
|
dimensions: c,
|
|
@@ -798,7 +800,7 @@ function Ve({
|
|
|
798
800
|
] }),
|
|
799
801
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2.5", children: [
|
|
800
802
|
o && /* @__PURE__ */ t(
|
|
801
|
-
|
|
803
|
+
be,
|
|
802
804
|
{
|
|
803
805
|
audience: { groups: [i] },
|
|
804
806
|
everyone: !1,
|
|
@@ -823,7 +825,7 @@ function Ve({
|
|
|
823
825
|
return /* @__PURE__ */ a("div", { className: "flex flex-wrap items-start gap-2", children: [
|
|
824
826
|
/* @__PURE__ */ t("span", { className: "mt-0.5 w-[110px] shrink-0 text-[11.5px] font-medium text-slate-600 dark:text-muted-foreground", children: (m == null ? void 0 : m.label) ?? n }),
|
|
825
827
|
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: m ? /* @__PURE__ */ t(
|
|
826
|
-
|
|
828
|
+
Be,
|
|
827
829
|
{
|
|
828
830
|
dim: m,
|
|
829
831
|
selected: i[n] ?? [],
|
|
@@ -836,7 +838,7 @@ function Ve({
|
|
|
836
838
|
] }, n);
|
|
837
839
|
}),
|
|
838
840
|
p.length > 0 && /* @__PURE__ */ t("div", { className: "w-[200px]", children: /* @__PURE__ */ t(
|
|
839
|
-
|
|
841
|
+
He,
|
|
840
842
|
{
|
|
841
843
|
value: "",
|
|
842
844
|
onChange: (n) => {
|
|
@@ -849,15 +851,15 @@ function Ve({
|
|
|
849
851
|
] })
|
|
850
852
|
] });
|
|
851
853
|
}
|
|
852
|
-
function
|
|
854
|
+
function Be({
|
|
853
855
|
dim: r,
|
|
854
856
|
selected: i,
|
|
855
857
|
onChange: c
|
|
856
858
|
}) {
|
|
857
|
-
const b =
|
|
859
|
+
const b = M(), { data: h = [] } = v({
|
|
858
860
|
queryKey: ["broadcast-dim-options", r.target_collection],
|
|
859
861
|
queryFn: () => b.request(
|
|
860
|
-
|
|
862
|
+
N(`/items/${r.target_collection}`, { limit: 200 })
|
|
861
863
|
).then(
|
|
862
864
|
(s) => (s.data ?? []).map((p) => ({
|
|
863
865
|
id: p.id,
|
|
@@ -877,7 +879,7 @@ function Ue({
|
|
|
877
879
|
onClick: () => c(
|
|
878
880
|
p ? i.filter((o) => String(o) !== String(s.id)) : [...i, s.id]
|
|
879
881
|
),
|
|
880
|
-
className:
|
|
882
|
+
className: k(
|
|
881
883
|
"rounded-full border px-2.5 py-0.5 text-[11.5px] transition-colors",
|
|
882
884
|
p ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "border-slate-200 bg-white text-slate-500 hover:text-slate-700 dark:border-border dark:bg-card dark:text-muted-foreground"
|
|
883
885
|
),
|
|
@@ -888,15 +890,15 @@ function Ue({
|
|
|
888
890
|
})
|
|
889
891
|
] });
|
|
890
892
|
}
|
|
891
|
-
function
|
|
893
|
+
function be({
|
|
892
894
|
audience: r,
|
|
893
895
|
everyone: i,
|
|
894
896
|
label: c,
|
|
895
897
|
compact: b
|
|
896
898
|
}) {
|
|
897
|
-
const h =
|
|
899
|
+
const h = M(), [s, p] = u(!1), o = JSON.stringify(r), { data: n } = v({
|
|
898
900
|
queryKey: ["broadcast-audience-preview", o],
|
|
899
|
-
queryFn: () => h.request(
|
|
901
|
+
queryFn: () => h.request(K("/announcements/preview-audience", { audience: r })).then((m) => m.data),
|
|
900
902
|
enabled: !i,
|
|
901
903
|
staleTime: 3e4
|
|
902
904
|
});
|
|
@@ -904,7 +906,7 @@ function he({
|
|
|
904
906
|
c,
|
|
905
907
|
": ",
|
|
906
908
|
/* @__PURE__ */ t("span", { className: "font-medium", children: "Everyone" })
|
|
907
|
-
] }) : /* @__PURE__ */ a(
|
|
909
|
+
] }) : /* @__PURE__ */ a(R, { children: [
|
|
908
910
|
/* @__PURE__ */ a(
|
|
909
911
|
"button",
|
|
910
912
|
{
|
|
@@ -916,13 +918,13 @@ function he({
|
|
|
916
918
|
c,
|
|
917
919
|
":",
|
|
918
920
|
" ",
|
|
919
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children: n ? `${n.count} user${n.count === 1 ? "" : "s"}` : "…" }),
|
|
921
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: n ? `${y(n.count)} user${n.count === 1 ? "" : "s"}` : "…" }),
|
|
920
922
|
!b && n != null && n.count > 0 && " (deduped across groups)"
|
|
921
923
|
]
|
|
922
924
|
}
|
|
923
925
|
),
|
|
924
926
|
s && n && /* @__PURE__ */ t(
|
|
925
|
-
|
|
927
|
+
Ge,
|
|
926
928
|
{
|
|
927
929
|
title: c === "Matches" ? "This group matches" : "Sending to",
|
|
928
930
|
count: n.count,
|
|
@@ -933,7 +935,7 @@ function he({
|
|
|
933
935
|
)
|
|
934
936
|
] });
|
|
935
937
|
}
|
|
936
|
-
function
|
|
938
|
+
function Ge({
|
|
937
939
|
title: r,
|
|
938
940
|
count: i,
|
|
939
941
|
users: c,
|
|
@@ -941,7 +943,7 @@ function Be({
|
|
|
941
943
|
onClose: h
|
|
942
944
|
}) {
|
|
943
945
|
const [s, p] = u("");
|
|
944
|
-
|
|
946
|
+
je(() => {
|
|
945
947
|
const m = (x) => {
|
|
946
948
|
x.key === "Escape" && h();
|
|
947
949
|
};
|
|
@@ -950,7 +952,7 @@ function Be({
|
|
|
950
952
|
const o = s.trim().toLowerCase(), n = o ? c.filter(
|
|
951
953
|
(m) => m.name.toLowerCase().includes(o) || (m.email ?? "").toLowerCase().includes(o)
|
|
952
954
|
) : c;
|
|
953
|
-
return
|
|
955
|
+
return Ke(
|
|
954
956
|
/* @__PURE__ */ a("div", { className: "fixed inset-0 z-[100]", children: [
|
|
955
957
|
/* @__PURE__ */ t("div", { className: "absolute inset-0 bg-black/30", onClick: h }),
|
|
956
958
|
/* @__PURE__ */ a("div", { className: "absolute right-0 top-0 flex h-full w-[380px] max-w-[92vw] flex-col border-l border-slate-200 bg-white shadow-xl dark:border-border dark:bg-card", children: [
|
|
@@ -959,7 +961,7 @@ function Be({
|
|
|
959
961
|
/* @__PURE__ */ a("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: [
|
|
960
962
|
r,
|
|
961
963
|
/* @__PURE__ */ a("span", { className: "ml-1.5 font-normal text-slate-400", children: [
|
|
962
|
-
i,
|
|
964
|
+
y(i),
|
|
963
965
|
" user",
|
|
964
966
|
i === 1 ? "" : "s"
|
|
965
967
|
] })
|
|
@@ -1000,9 +1002,9 @@ function Be({
|
|
|
1000
1002
|
)),
|
|
1001
1003
|
b && /* @__PURE__ */ a("p", { className: "py-2 text-[11px] text-slate-400", children: [
|
|
1002
1004
|
"Showing the first ",
|
|
1003
|
-
c.length,
|
|
1005
|
+
y(c.length),
|
|
1004
1006
|
" of ",
|
|
1005
|
-
i,
|
|
1007
|
+
y(i),
|
|
1006
1008
|
"."
|
|
1007
1009
|
] })
|
|
1008
1010
|
] })
|
|
@@ -1012,5 +1014,5 @@ function Be({
|
|
|
1012
1014
|
);
|
|
1013
1015
|
}
|
|
1014
1016
|
export {
|
|
1015
|
-
|
|
1017
|
+
it as BroadcastView
|
|
1016
1018
|
};
|