@burdenoff/microfe-subscriberbot 2026.1023.2 → 2026.1029.1
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/subscriberbot/admin/AdminDashboardPage.js +5 -5
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts +10 -0
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -0
- package/dist/subscriberbot/components/PostureOptions.js +20 -0
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -0
- package/dist/subscriberbot/components/index.d.ts +2 -0
- package/dist/subscriberbot/components/index.d.ts.map +1 -1
- package/dist/subscriberbot/components/index.js +1 -0
- package/dist/subscriberbot/hooks/index.d.ts +1 -0
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/index.js +2 -1
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +15 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +13 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -0
- package/dist/subscriberbot/pages/AssetVaultPage.js +16 -16
- package/dist/subscriberbot/pages/DashboardPage.js +23 -23
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +62 -62
- package/dist/subscriberbot/pages/InsightsPage.js +14 -14
- package/dist/subscriberbot/pages/InvoicesPage.js +66 -66
- package/dist/subscriberbot/pages/WorkflowsPage.js +20 -20
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +184 -182
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +77 -79
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +134 -133
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +64 -64
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +3 -3
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +18 -18
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +76 -76
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +6 -6
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +7 -7
- package/package.json +1 -1
|
@@ -5,10 +5,10 @@ import { formatDateTime as r, formatEnumLabel as i, formatRelativeTime as a } fr
|
|
|
5
5
|
import { StatusBadge as o } from "../components/StatusBadge.js";
|
|
6
6
|
import { EmptyState as s } from "../components/EmptyState.js";
|
|
7
7
|
import { Modal as c } from "../components/Modal.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { useTr as l } from "../hooks/useTr.js";
|
|
9
|
+
import { ErrorView as u, LoadingView as d, Section as f } from "../components/StateViews.js";
|
|
10
|
+
import { MiniProgress as p } from "../components/viz.js";
|
|
11
|
+
import { useChannels as m, useCreateChannel as h, useInboxMessages as g, useIngestMessage as _, useMarkMessageRead as v, useVerifyChannel as y } from "../hooks/useSubscriberBotApi.js";
|
|
12
12
|
import { useState as b } from "react";
|
|
13
13
|
import { AlertTriangle as x, BadgeCheck as S, Bell as C, ChevronRight as w, Hash as T, Inbox as E, Mail as D, MailOpen as O, MessageSquare as k, MessagesSquare as A, MousePointerClick as j, Phone as M, Plus as N, Radio as P, Send as F, ShieldAlert as I, Sparkles as L, Webhook as R } from "lucide-react";
|
|
14
14
|
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
@@ -103,7 +103,7 @@ function Z({ category: e }) {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
function Q({ className: e }) {
|
|
106
|
-
let n =
|
|
106
|
+
let n = l();
|
|
107
107
|
return /* @__PURE__ */ V("span", {
|
|
108
108
|
title: n("inbox.message.actionRequiredTitle", "Action required"),
|
|
109
109
|
className: t("inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-warning-text", e),
|
|
@@ -115,32 +115,32 @@ function Q({ className: e }) {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
function ne({ onClose: e }) {
|
|
118
|
-
let t =
|
|
118
|
+
let t = l(), n = h(), [r, a] = b("EMAIL"), [o, s] = b(""), [u, d] = b(""), [f, p] = b(!0), [m, g] = b(null);
|
|
119
119
|
return /* @__PURE__ */ B(c, {
|
|
120
120
|
title: t("inbox.addChannelModal.title", "Add channel"),
|
|
121
121
|
onClose: e,
|
|
122
122
|
maxWidthClassName: "max-w-xl",
|
|
123
123
|
children: /* @__PURE__ */ V("form", {
|
|
124
124
|
onSubmit: (i) => {
|
|
125
|
-
if (i.preventDefault(),
|
|
126
|
-
|
|
125
|
+
if (i.preventDefault(), g(null), !o.trim()) {
|
|
126
|
+
g(t("inbox.addChannelModal.addressRequired", "An address is required."));
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
n.mutate({
|
|
130
130
|
type: r,
|
|
131
131
|
address: o.trim(),
|
|
132
|
-
ingestEnabled:
|
|
133
|
-
...
|
|
132
|
+
ingestEnabled: f,
|
|
133
|
+
...u.trim() ? { label: u.trim() } : {}
|
|
134
134
|
}, {
|
|
135
135
|
onSuccess: () => e(),
|
|
136
|
-
onError: (e) =>
|
|
136
|
+
onError: (e) => g(e instanceof Error ? e.message : t("inbox.addChannelModal.error", "Could not add channel."))
|
|
137
137
|
});
|
|
138
138
|
},
|
|
139
139
|
className: "space-y-4",
|
|
140
140
|
children: [
|
|
141
|
-
|
|
141
|
+
m && /* @__PURE__ */ B("div", {
|
|
142
142
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
143
|
-
children:
|
|
143
|
+
children: m
|
|
144
144
|
}),
|
|
145
145
|
/* @__PURE__ */ V("div", {
|
|
146
146
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
@@ -164,8 +164,8 @@ function ne({ onClose: e }) {
|
|
|
164
164
|
}), /* @__PURE__ */ B("input", {
|
|
165
165
|
id: "ch-label",
|
|
166
166
|
type: "text",
|
|
167
|
-
value:
|
|
168
|
-
onChange: (e) =>
|
|
167
|
+
value: u,
|
|
168
|
+
onChange: (e) => d(e.target.value),
|
|
169
169
|
placeholder: t("inbox.addChannelModal.labelPlaceholder", "e.g. Billing inbox"),
|
|
170
170
|
className: G
|
|
171
171
|
})] })]
|
|
@@ -194,8 +194,8 @@ function ne({ onClose: e }) {
|
|
|
194
194
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
195
195
|
children: [/* @__PURE__ */ B("input", {
|
|
196
196
|
type: "checkbox",
|
|
197
|
-
checked:
|
|
198
|
-
onChange: (e) =>
|
|
197
|
+
checked: f,
|
|
198
|
+
onChange: (e) => p(e.target.checked),
|
|
199
199
|
className: "size-4 rounded border-border-subtle"
|
|
200
200
|
}), t("inbox.addChannelModal.ingestLabel", "Ingest messages from this channel")]
|
|
201
201
|
}),
|
|
@@ -218,30 +218,30 @@ function ne({ onClose: e }) {
|
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
function re({ channel: e, onClose: t }) {
|
|
221
|
-
let n =
|
|
221
|
+
let n = l(), r = _(), [a, o] = b(""), [s, u] = b(""), [d, f] = b("OTHER"), [p, m] = b(!1), [h, g] = b(null);
|
|
222
222
|
return /* @__PURE__ */ B(c, {
|
|
223
223
|
title: n("inbox.logMessageModal.title", "Log test message"),
|
|
224
224
|
description: n("inbox.logMessageModal.description", "Simulate an ingested message from {channel}.", { channel: e.label || e.address }),
|
|
225
225
|
onClose: t,
|
|
226
226
|
children: /* @__PURE__ */ V("form", {
|
|
227
227
|
onSubmit: (i) => {
|
|
228
|
-
i.preventDefault(),
|
|
228
|
+
i.preventDefault(), g(null), r.mutate({
|
|
229
229
|
channelId: e.id,
|
|
230
230
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
231
|
-
category:
|
|
232
|
-
actionRequired:
|
|
231
|
+
category: d,
|
|
232
|
+
actionRequired: p,
|
|
233
233
|
...a.trim() ? { subject: a.trim() } : {},
|
|
234
234
|
...s.trim() ? { preview: s.trim() } : {}
|
|
235
235
|
}, {
|
|
236
236
|
onSuccess: () => t(),
|
|
237
|
-
onError: (e) =>
|
|
237
|
+
onError: (e) => g(e instanceof Error ? e.message : n("inbox.logMessageModal.error", "Could not log the message."))
|
|
238
238
|
});
|
|
239
239
|
},
|
|
240
240
|
className: "space-y-4",
|
|
241
241
|
children: [
|
|
242
|
-
|
|
242
|
+
h && /* @__PURE__ */ B("div", {
|
|
243
243
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
244
|
-
children:
|
|
244
|
+
children: h
|
|
245
245
|
}),
|
|
246
246
|
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
|
|
247
247
|
htmlFor: "msg-subject",
|
|
@@ -262,7 +262,7 @@ function re({ channel: e, onClose: t }) {
|
|
|
262
262
|
}), /* @__PURE__ */ B("textarea", {
|
|
263
263
|
id: "msg-preview",
|
|
264
264
|
value: s,
|
|
265
|
-
onChange: (e) =>
|
|
265
|
+
onChange: (e) => u(e.target.value),
|
|
266
266
|
rows: 2,
|
|
267
267
|
className: G
|
|
268
268
|
})] }),
|
|
@@ -272,8 +272,8 @@ function re({ channel: e, onClose: t }) {
|
|
|
272
272
|
children: n("inbox.logMessageModal.categoryLabel", "Category")
|
|
273
273
|
}), /* @__PURE__ */ B("select", {
|
|
274
274
|
id: "msg-category",
|
|
275
|
-
value:
|
|
276
|
-
onChange: (e) =>
|
|
275
|
+
value: d,
|
|
276
|
+
onChange: (e) => f(e.target.value),
|
|
277
277
|
className: G,
|
|
278
278
|
children: q.map((e) => /* @__PURE__ */ B("option", {
|
|
279
279
|
value: e,
|
|
@@ -284,8 +284,8 @@ function re({ channel: e, onClose: t }) {
|
|
|
284
284
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
285
285
|
children: [/* @__PURE__ */ B("input", {
|
|
286
286
|
type: "checkbox",
|
|
287
|
-
checked:
|
|
288
|
-
onChange: (e) =>
|
|
287
|
+
checked: p,
|
|
288
|
+
onChange: (e) => m(e.target.checked),
|
|
289
289
|
className: "size-4 rounded border-border-subtle"
|
|
290
290
|
}), n("inbox.logMessageModal.actionRequired", "Requires action")]
|
|
291
291
|
}),
|
|
@@ -308,7 +308,7 @@ function re({ channel: e, onClose: t }) {
|
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
function ie({ channel: e, onVerify: t, verifying: n, onLog: r }) {
|
|
311
|
-
let a =
|
|
311
|
+
let a = l(), s = X[e.type] ?? P, c = e.status === "VERIFIED";
|
|
312
312
|
return /* @__PURE__ */ V(H, {
|
|
313
313
|
treatment: "metric",
|
|
314
314
|
className: "flex flex-col p-4",
|
|
@@ -377,8 +377,8 @@ function ie({ channel: e, onVerify: t, verifying: n, onLog: r }) {
|
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
function ae() {
|
|
380
|
-
let e =
|
|
381
|
-
return /* @__PURE__ */ V(
|
|
380
|
+
let e = l(), { data: t, isLoading: n, isError: r, refetch: i } = m(), a = y(), [o, c] = b(!1), [p, h] = b(null), g = t ?? [], _ = g.filter((e) => e.status === "VERIFIED").length, v = g.filter((e) => e.status === "PENDING").length;
|
|
381
|
+
return /* @__PURE__ */ V(f, {
|
|
382
382
|
title: e("inbox.channels.title", "Ingest channels"),
|
|
383
383
|
description: e("inbox.channels.description", "The sources the Universal Inbox pulls subscription communication from"),
|
|
384
384
|
action: /* @__PURE__ */ V("button", {
|
|
@@ -392,48 +392,48 @@ function ae() {
|
|
|
392
392
|
]
|
|
393
393
|
}),
|
|
394
394
|
children: [
|
|
395
|
-
n ? /* @__PURE__ */ B(
|
|
395
|
+
n ? /* @__PURE__ */ B(d, { label: e("inbox.channels.loading", "Loading channels…") }) : r ? /* @__PURE__ */ B(u, {
|
|
396
396
|
message: e("inbox.channels.error", "Could not load channels."),
|
|
397
397
|
onRetry: () => void i()
|
|
398
|
-
}) :
|
|
398
|
+
}) : g.length === 0 ? /* @__PURE__ */ B(s, {
|
|
399
399
|
illustration: "empty-data",
|
|
400
400
|
icon: /* @__PURE__ */ B(P, { className: "h-12 w-12" }),
|
|
401
401
|
title: e("inbox.channels.emptyTitle", "No channels yet"),
|
|
402
402
|
description: e("inbox.channels.emptyDescription", "Add an email, SMS, Slack or webhook channel to start ingesting subscription communication.")
|
|
403
|
-
}) : /* @__PURE__ */ V(z, { children: [(
|
|
403
|
+
}) : /* @__PURE__ */ V(z, { children: [(_ > 0 || v > 0) && /* @__PURE__ */ V("div", {
|
|
404
404
|
className: "mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-secondary",
|
|
405
405
|
children: [/* @__PURE__ */ V("span", {
|
|
406
406
|
className: "inline-flex items-center gap-1.5",
|
|
407
407
|
children: [/* @__PURE__ */ B("span", {
|
|
408
408
|
className: "size-1.5 rounded-full bg-status-success-text",
|
|
409
409
|
"aria-hidden": !0
|
|
410
|
-
}), e("inbox.channels.verified", "{{count}} verified", { count:
|
|
411
|
-
}),
|
|
410
|
+
}), e("inbox.channels.verified", "{{count}} verified", { count: _ })]
|
|
411
|
+
}), v > 0 && /* @__PURE__ */ V("span", {
|
|
412
412
|
className: "inline-flex items-center gap-1.5",
|
|
413
413
|
children: [/* @__PURE__ */ B("span", {
|
|
414
414
|
className: "size-1.5 rounded-full bg-status-warning-text",
|
|
415
415
|
"aria-hidden": !0
|
|
416
|
-
}), e("inbox.channels.pending", "{{count}} pending verification", { count:
|
|
416
|
+
}), e("inbox.channels.pending", "{{count}} pending verification", { count: v })]
|
|
417
417
|
})]
|
|
418
418
|
}), /* @__PURE__ */ B("div", {
|
|
419
419
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
420
|
-
children:
|
|
420
|
+
children: g.map((e) => /* @__PURE__ */ B(ie, {
|
|
421
421
|
channel: e,
|
|
422
422
|
verifying: a.isPending,
|
|
423
423
|
onVerify: (e) => a.mutate(e),
|
|
424
|
-
onLog: (e) =>
|
|
424
|
+
onLog: (e) => h(e)
|
|
425
425
|
}, e.id))
|
|
426
426
|
})] }),
|
|
427
427
|
o && /* @__PURE__ */ B(ne, { onClose: () => c(!1) }),
|
|
428
|
-
|
|
429
|
-
channel:
|
|
430
|
-
onClose: () =>
|
|
428
|
+
p && /* @__PURE__ */ B(re, {
|
|
429
|
+
channel: p,
|
|
430
|
+
onClose: () => h(null)
|
|
431
431
|
})
|
|
432
432
|
]
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o, onViewRelationship: s }) {
|
|
436
|
-
let c =
|
|
436
|
+
let c = l(), u = !e.isRead;
|
|
437
437
|
return /* @__PURE__ */ V("div", {
|
|
438
438
|
role: "button",
|
|
439
439
|
tabIndex: 0,
|
|
@@ -442,15 +442,15 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
|
|
|
442
442
|
onKeyDown: (e) => {
|
|
443
443
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r());
|
|
444
444
|
},
|
|
445
|
-
className: t("relative flex cursor-pointer items-start gap-3 p-4 transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-inset", n ? "bg-bg-sunken" :
|
|
445
|
+
className: t("relative flex cursor-pointer items-start gap-3 p-4 transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-inset", n ? "bg-bg-sunken" : u ? "bg-accent-wash" : "hover:bg-bg-sunken/60"),
|
|
446
446
|
children: [
|
|
447
|
-
|
|
447
|
+
u && /* @__PURE__ */ B("span", {
|
|
448
448
|
"aria-hidden": !0,
|
|
449
449
|
className: "absolute inset-y-0 left-0 w-0.5 bg-text-link"
|
|
450
450
|
}),
|
|
451
451
|
/* @__PURE__ */ B("span", {
|
|
452
452
|
className: "mt-0.5 shrink-0 text-text-secondary",
|
|
453
|
-
children:
|
|
453
|
+
children: u ? /* @__PURE__ */ B(D, { className: "h-4 w-4 text-text-link" }) : /* @__PURE__ */ B(O, { className: "h-4 w-4" })
|
|
454
454
|
}),
|
|
455
455
|
/* @__PURE__ */ V("div", {
|
|
456
456
|
className: "min-w-0 flex-1",
|
|
@@ -458,12 +458,12 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
|
|
|
458
458
|
/* @__PURE__ */ V("div", {
|
|
459
459
|
className: "flex items-center gap-2",
|
|
460
460
|
children: [
|
|
461
|
-
|
|
461
|
+
u && /* @__PURE__ */ B("span", {
|
|
462
462
|
"aria-label": c("inbox.message.unreadAria", "Unread"),
|
|
463
463
|
className: "size-1.5 shrink-0 rounded-full bg-text-link"
|
|
464
464
|
}),
|
|
465
465
|
/* @__PURE__ */ B("p", {
|
|
466
|
-
className: t("min-w-0 flex-1 truncate text-sm",
|
|
466
|
+
className: t("min-w-0 flex-1 truncate text-sm", u ? "font-semibold text-text-primary" : "font-normal text-text-primary"),
|
|
467
467
|
children: e.subject || c("inbox.message.noSubject", "(no subject)")
|
|
468
468
|
}),
|
|
469
469
|
/* @__PURE__ */ B("span", {
|
|
@@ -489,7 +489,7 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
|
|
|
489
489
|
className: "text-xs font-medium text-text-link hover:underline",
|
|
490
490
|
children: c("inbox.message.viewRelationship", "View relationship")
|
|
491
491
|
}),
|
|
492
|
-
|
|
492
|
+
u && /* @__PURE__ */ B("button", {
|
|
493
493
|
type: "button",
|
|
494
494
|
disabled: o,
|
|
495
495
|
onClick: (e) => {
|
|
@@ -506,7 +506,7 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
|
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
508
|
function se({ message: e, channel: t, onMarkRead: n, markPending: i, onViewRelationship: a }) {
|
|
509
|
-
let o =
|
|
509
|
+
let o = l();
|
|
510
510
|
if (!e) return /* @__PURE__ */ V(H, {
|
|
511
511
|
treatment: "metric",
|
|
512
512
|
className: "flex min-h-[20rem] flex-col items-center justify-center p-8 text-center",
|
|
@@ -574,7 +574,7 @@ function se({ message: e, channel: t, onMarkRead: n, markPending: i, onViewRelat
|
|
|
574
574
|
className: "tabular-nums text-text-secondary",
|
|
575
575
|
children: o("inbox.readingPane.confidence", "{{pct}}% confidence", { pct: c })
|
|
576
576
|
})]
|
|
577
|
-
}), /* @__PURE__ */ B(
|
|
577
|
+
}), /* @__PURE__ */ B(p, {
|
|
578
578
|
value: c,
|
|
579
579
|
max: 100,
|
|
580
580
|
tone: c >= 66 ? "positive" : c >= 33 ? "accent" : "warning",
|
|
@@ -621,14 +621,14 @@ function $({ active: e, onClick: n, children: r, tone: i = "default" }) {
|
|
|
621
621
|
});
|
|
622
622
|
}
|
|
623
623
|
function ce() {
|
|
624
|
-
let r =
|
|
624
|
+
let r = l(), { navigateTo: i } = e(), [a, o] = b(0), [c, f] = b(""), [p, h] = b(!1), [_, y] = b(!1), [S, C] = b(null), { data: w, isLoading: T, isError: O, refetch: k, isFetching: A } = g({
|
|
625
625
|
category: c || void 0,
|
|
626
|
-
unreadOnly:
|
|
626
|
+
unreadOnly: p || void 0,
|
|
627
627
|
pagination: {
|
|
628
628
|
limit: W,
|
|
629
629
|
offset: a * W
|
|
630
630
|
}
|
|
631
|
-
}), { data: j } =
|
|
631
|
+
}), { data: j } = m(), M = v(), N = w?.items ?? [], P = w?.pageInfo.hasMore ?? !1, F = _ ? N.filter((e) => e.actionRequired) : N, I = N.filter((e) => !e.isRead).length, L = N.filter((e) => e.actionRequired).length, R = new Map((j ?? []).map((e) => [e.id, e])), z = F.find((e) => e.id === S) ?? null, H = z ? R.get(z.channelId) : void 0, G = () => {
|
|
632
632
|
o(0), C(null);
|
|
633
633
|
};
|
|
634
634
|
return /* @__PURE__ */ V(n, {
|
|
@@ -646,7 +646,7 @@ function ce() {
|
|
|
646
646
|
children: /* @__PURE__ */ B($, {
|
|
647
647
|
active: c === e.value,
|
|
648
648
|
onClick: () => {
|
|
649
|
-
|
|
649
|
+
f(e.value), G();
|
|
650
650
|
},
|
|
651
651
|
children: r(e.key, e.fallback)
|
|
652
652
|
})
|
|
@@ -656,10 +656,10 @@ function ce() {
|
|
|
656
656
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
657
657
|
children: [
|
|
658
658
|
/* @__PURE__ */ V($, {
|
|
659
|
-
active:
|
|
659
|
+
active: _,
|
|
660
660
|
tone: "warning",
|
|
661
661
|
onClick: () => {
|
|
662
|
-
|
|
662
|
+
y((e) => !e), C(null);
|
|
663
663
|
},
|
|
664
664
|
children: [
|
|
665
665
|
/* @__PURE__ */ B(x, { className: "h-3.5 w-3.5" }),
|
|
@@ -668,9 +668,9 @@ function ce() {
|
|
|
668
668
|
]
|
|
669
669
|
}),
|
|
670
670
|
/* @__PURE__ */ V($, {
|
|
671
|
-
active:
|
|
671
|
+
active: p,
|
|
672
672
|
onClick: () => {
|
|
673
|
-
|
|
673
|
+
h((e) => !e), G();
|
|
674
674
|
},
|
|
675
675
|
children: [
|
|
676
676
|
/* @__PURE__ */ B(D, { className: "h-3.5 w-3.5" }),
|
|
@@ -689,7 +689,7 @@ function ce() {
|
|
|
689
689
|
})
|
|
690
690
|
]
|
|
691
691
|
}),
|
|
692
|
-
T ? /* @__PURE__ */ B(
|
|
692
|
+
T ? /* @__PURE__ */ B(d, { label: r("inbox.loading", "Loading inbox…") }) : O ? /* @__PURE__ */ B(u, {
|
|
693
693
|
message: r("inbox.error", "Could not load the inbox."),
|
|
694
694
|
onRetry: () => void k()
|
|
695
695
|
}) : N.length === 0 ? /* @__PURE__ */ B("div", {
|
|
@@ -698,7 +698,7 @@ function ce() {
|
|
|
698
698
|
illustration: "empty-inbox",
|
|
699
699
|
icon: /* @__PURE__ */ B(E, { className: "h-12 w-12" }),
|
|
700
700
|
title: r("inbox.emptyTitle", "Inbox is empty"),
|
|
701
|
-
description:
|
|
701
|
+
description: p || c ? r("inbox.emptyDescriptionFiltered", "No messages match these filters.") : r("inbox.emptyDescription", "Merged subscription communications will appear here once channels start ingesting.")
|
|
702
702
|
})
|
|
703
703
|
}) : /* @__PURE__ */ V("div", {
|
|
704
704
|
className: "mt-5 grid grid-cols-1 gap-5 lg:grid-cols-[minmax(0,1fr)_380px]",
|
|
@@ -3,11 +3,11 @@ import { PageLayout as t } from "../components/PageLayout.js";
|
|
|
3
3
|
import { MetricsCard as n } from "../components/MetricsCard.js";
|
|
4
4
|
import { formatCurrency as r, formatEnumLabel as i } from "../utils/formatters.js";
|
|
5
5
|
import { EmptyState as a } from "../components/EmptyState.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useTr as o } from "../hooks/useTr.js";
|
|
7
|
+
import { ErrorView as s, LoadingView as c, Section as l } from "../components/StateViews.js";
|
|
8
|
+
import { BarList as u, Donut as d, Legend as f, MiniProgress as p } from "../components/viz.js";
|
|
8
9
|
import "../components/index.js";
|
|
9
|
-
import { useRelationships as
|
|
10
|
-
import { useTr as m } from "../hooks/useTr.js";
|
|
10
|
+
import { useRelationships as m } from "../hooks/useSubscriberBotApi.js";
|
|
11
11
|
import { useMemo as h } from "react";
|
|
12
12
|
import { CalendarClock as g, HeartPulse as _, Layers as v, TrendingUp as y, Wallet as b } from "lucide-react";
|
|
13
13
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
@@ -23,7 +23,7 @@ var E = {
|
|
|
23
23
|
FREE: 0,
|
|
24
24
|
USAGE_BASED: 1
|
|
25
25
|
}, D = (e) => e.amount * (E[e.interval] ?? 1), O = (e) => e.status === "ACTIVE", k = () => {
|
|
26
|
-
let E =
|
|
26
|
+
let E = m({ pagination: { limit: 100 } }), k = o(), A = h(() => E.data?.items ?? [], [E.data]), j = h(() => {
|
|
27
27
|
let e = A.filter(O), t = e[0]?.currency ?? A[0]?.currency ?? "USD", n = e.reduce((e, t) => e + D(t), 0), r = A.filter((e) => e.healthScore != null), a = r.length ? r.reduce((e, t) => e + (t.healthScore ?? 0), 0) / r.length : null, o = /* @__PURE__ */ new Map();
|
|
28
28
|
for (let e of A) o.set(e.status, (o.get(e.status) ?? 0) + 1);
|
|
29
29
|
let s = /* @__PURE__ */ new Map();
|
|
@@ -67,8 +67,8 @@ var E = {
|
|
|
67
67
|
total: A.length
|
|
68
68
|
};
|
|
69
69
|
}, [A]);
|
|
70
|
-
if (E.isLoading) return /* @__PURE__ */ S(
|
|
71
|
-
if (E.isError) return /* @__PURE__ */ S(
|
|
70
|
+
if (E.isLoading) return /* @__PURE__ */ S(c, { label: k("insights.loading", "Crunching your spend insights…") });
|
|
71
|
+
if (E.isError) return /* @__PURE__ */ S(s, {
|
|
72
72
|
message: k("insights.error", "Could not load insights."),
|
|
73
73
|
onRetry: () => void E.refetch()
|
|
74
74
|
});
|
|
@@ -121,11 +121,11 @@ var E = {
|
|
|
121
121
|
children: k("insights.portfolioByStatus", "Portfolio by status")
|
|
122
122
|
}), /* @__PURE__ */ C("div", {
|
|
123
123
|
className: "flex flex-col items-center gap-6 sm:flex-row",
|
|
124
|
-
children: [/* @__PURE__ */ S(
|
|
124
|
+
children: [/* @__PURE__ */ S(d, {
|
|
125
125
|
data: j.statusData,
|
|
126
126
|
centerLabel: String(j.total),
|
|
127
127
|
centerSub: k("insights.subscriptions", "subscriptions")
|
|
128
|
-
}), /* @__PURE__ */ S(
|
|
128
|
+
}), /* @__PURE__ */ S(f, {
|
|
129
129
|
className: "w-full sm:flex-1",
|
|
130
130
|
data: j.statusData
|
|
131
131
|
})]
|
|
@@ -137,7 +137,7 @@ var E = {
|
|
|
137
137
|
children: [/* @__PURE__ */ S("h3", {
|
|
138
138
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
139
139
|
children: k("insights.spendByType", "Monthly spend by type")
|
|
140
|
-
}), j.kindData.length ? /* @__PURE__ */ S(
|
|
140
|
+
}), j.kindData.length ? /* @__PURE__ */ S(u, {
|
|
141
141
|
data: j.kindData,
|
|
142
142
|
valueFormat: M
|
|
143
143
|
}) : /* @__PURE__ */ S("p", {
|
|
@@ -151,7 +151,7 @@ var E = {
|
|
|
151
151
|
children: [/* @__PURE__ */ S("h3", {
|
|
152
152
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
153
153
|
children: k("insights.renewalForecast", "Renewal forecast (6 mo)")
|
|
154
|
-
}), j.forecast.some((e) => e.value > 0) ? /* @__PURE__ */ S(
|
|
154
|
+
}), j.forecast.some((e) => e.value > 0) ? /* @__PURE__ */ S(u, {
|
|
155
155
|
data: j.forecast,
|
|
156
156
|
valueFormat: M
|
|
157
157
|
}) : /* @__PURE__ */ S("p", {
|
|
@@ -163,7 +163,7 @@ var E = {
|
|
|
163
163
|
}),
|
|
164
164
|
/* @__PURE__ */ C("div", {
|
|
165
165
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
166
|
-
children: [/* @__PURE__ */ S(
|
|
166
|
+
children: [/* @__PURE__ */ S(l, {
|
|
167
167
|
title: k("insights.topCosts", "Top monthly costs"),
|
|
168
168
|
children: /* @__PURE__ */ S(w, {
|
|
169
169
|
treatment: "plain",
|
|
@@ -182,7 +182,7 @@ var E = {
|
|
|
182
182
|
})]
|
|
183
183
|
}, e.id))
|
|
184
184
|
})
|
|
185
|
-
}), /* @__PURE__ */ S(
|
|
185
|
+
}), /* @__PURE__ */ S(l, {
|
|
186
186
|
title: k("insights.healthWatchlist", "Health watchlist"),
|
|
187
187
|
children: j.watchlist.length ? /* @__PURE__ */ S(w, {
|
|
188
188
|
treatment: "plain",
|
|
@@ -194,7 +194,7 @@ var E = {
|
|
|
194
194
|
className: "w-32 shrink-0 truncate text-sm text-text-primary",
|
|
195
195
|
children: t.label
|
|
196
196
|
}),
|
|
197
|
-
/* @__PURE__ */ S(
|
|
197
|
+
/* @__PURE__ */ S(p, {
|
|
198
198
|
className: "flex-1",
|
|
199
199
|
value: t.healthScore ?? 0,
|
|
200
200
|
tone: "negative"
|