@burdenoff/microfe-subscriberbot 2026.1023.2 → 2026.1030.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/SubscriberBotRoutes.d.ts.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +2 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- 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 +3 -0
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/index.js +3 -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/hooks/useRouteSelection.d.ts +15 -0
- package/dist/subscriberbot/hooks/useRouteSelection.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useRouteSelection.js +18 -0
- package/dist/subscriberbot/hooks/useRouteSelection.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.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +249 -248
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +14 -14
- package/dist/subscriberbot/pages/InvoicesPage.js +66 -66
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +183 -182
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- 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/dist/subscriberbot/utils/pageContext.d.ts +43 -11
- package/dist/subscriberbot/utils/pageContext.d.ts.map +1 -1
- package/dist/subscriberbot/utils/pageContext.js +42 -37
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/package.json +4 -2
|
@@ -5,16 +5,17 @@ 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 {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
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
|
+
import { useRouteSelection as b } from "../hooks/useRouteSelection.js";
|
|
13
|
+
import { useState as x } from "react";
|
|
14
|
+
import { AlertTriangle as S, BadgeCheck as C, Bell as w, ChevronRight as T, Hash as E, Inbox as D, Mail as O, MailOpen as k, MessageSquare as A, MessagesSquare as j, MousePointerClick as M, Phone as N, Plus as P, Radio as F, Send as I, ShieldAlert as L, Sparkles as R, Webhook as z } from "lucide-react";
|
|
15
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
16
|
+
import { GlassCard as U, PagePurpose as W } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/subscriberbot/pages/InboxPage.tsx
|
|
17
|
-
var
|
|
18
|
+
var G = 25, K = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", q = "mb-1 block text-xs font-medium text-text-secondary", J = [
|
|
18
19
|
"BILLING",
|
|
19
20
|
"RENEWAL",
|
|
20
21
|
"REQUIRED_ACTION",
|
|
@@ -22,7 +23,7 @@ var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
|
|
|
22
23
|
"PRODUCT_UPDATE",
|
|
23
24
|
"MARKETING",
|
|
24
25
|
"OTHER"
|
|
25
|
-
],
|
|
26
|
+
], ee = [
|
|
26
27
|
"EMAIL",
|
|
27
28
|
"SMS",
|
|
28
29
|
"SLACK",
|
|
@@ -38,7 +39,7 @@ var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
|
|
|
38
39
|
PRODUCT_UPDATE: "inbox.categories.productUpdate",
|
|
39
40
|
MARKETING: "inbox.categories.marketing",
|
|
40
41
|
OTHER: "inbox.categories.other"
|
|
41
|
-
},
|
|
42
|
+
}, te = [
|
|
42
43
|
{
|
|
43
44
|
value: "",
|
|
44
45
|
key: "inbox.categories.all",
|
|
@@ -79,7 +80,7 @@ var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
|
|
|
79
80
|
key: Y.OTHER,
|
|
80
81
|
fallback: "Other"
|
|
81
82
|
}
|
|
82
|
-
],
|
|
83
|
+
], ne = {
|
|
83
84
|
BILLING: "bg-[var(--color-accent-soft)] text-text-primary",
|
|
84
85
|
RENEWAL: "bg-status-success-bg-subtle text-status-success-text",
|
|
85
86
|
REQUIRED_ACTION: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
@@ -88,125 +89,125 @@ var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
|
|
|
88
89
|
MARKETING: "bg-bg-sunken text-text-secondary",
|
|
89
90
|
OTHER: "bg-bg-sunken text-text-secondary"
|
|
90
91
|
}, X = {
|
|
91
|
-
EMAIL:
|
|
92
|
-
SMS:
|
|
93
|
-
SLACK:
|
|
94
|
-
DISCORD:
|
|
95
|
-
WHATSAPP:
|
|
96
|
-
PUSH:
|
|
97
|
-
WEBHOOK:
|
|
92
|
+
EMAIL: O,
|
|
93
|
+
SMS: A,
|
|
94
|
+
SLACK: E,
|
|
95
|
+
DISCORD: j,
|
|
96
|
+
WHATSAPP: N,
|
|
97
|
+
PUSH: w,
|
|
98
|
+
WEBHOOK: z
|
|
98
99
|
};
|
|
99
100
|
function Z({ category: e }) {
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium",
|
|
101
|
+
return /* @__PURE__ */ V("span", {
|
|
102
|
+
className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium", ne[e]),
|
|
102
103
|
children: i(e)
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
function Q({ className: e }) {
|
|
106
|
-
let n =
|
|
107
|
-
return /* @__PURE__ */
|
|
107
|
+
let n = l();
|
|
108
|
+
return /* @__PURE__ */ H("span", {
|
|
108
109
|
title: n("inbox.message.actionRequiredTitle", "Action required"),
|
|
109
110
|
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),
|
|
110
111
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ V(S, { className: "h-3 w-3" }),
|
|
112
113
|
" ",
|
|
113
114
|
n("inbox.message.actionFlag", "Action")
|
|
114
115
|
]
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
-
let t =
|
|
119
|
-
return /* @__PURE__ */
|
|
118
|
+
function re({ onClose: e }) {
|
|
119
|
+
let t = l(), n = h(), [r, a] = x("EMAIL"), [o, s] = x(""), [u, d] = x(""), [f, p] = x(!0), [m, g] = x(null);
|
|
120
|
+
return /* @__PURE__ */ V(c, {
|
|
120
121
|
title: t("inbox.addChannelModal.title", "Add channel"),
|
|
121
122
|
onClose: e,
|
|
122
123
|
maxWidthClassName: "max-w-xl",
|
|
123
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ H("form", {
|
|
124
125
|
onSubmit: (i) => {
|
|
125
|
-
if (i.preventDefault(),
|
|
126
|
-
|
|
126
|
+
if (i.preventDefault(), g(null), !o.trim()) {
|
|
127
|
+
g(t("inbox.addChannelModal.addressRequired", "An address is required."));
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
130
|
n.mutate({
|
|
130
131
|
type: r,
|
|
131
132
|
address: o.trim(),
|
|
132
|
-
ingestEnabled:
|
|
133
|
-
...
|
|
133
|
+
ingestEnabled: f,
|
|
134
|
+
...u.trim() ? { label: u.trim() } : {}
|
|
134
135
|
}, {
|
|
135
136
|
onSuccess: () => e(),
|
|
136
|
-
onError: (e) =>
|
|
137
|
+
onError: (e) => g(e instanceof Error ? e.message : t("inbox.addChannelModal.error", "Could not add channel."))
|
|
137
138
|
});
|
|
138
139
|
},
|
|
139
140
|
className: "space-y-4",
|
|
140
141
|
children: [
|
|
141
|
-
|
|
142
|
+
m && /* @__PURE__ */ V("div", {
|
|
142
143
|
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:
|
|
144
|
+
children: m
|
|
144
145
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ H("div", {
|
|
146
147
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
148
149
|
htmlFor: "ch-type",
|
|
149
|
-
className:
|
|
150
|
+
className: q,
|
|
150
151
|
children: t("inbox.addChannelModal.typeLabel", "Type")
|
|
151
|
-
}), /* @__PURE__ */
|
|
152
|
+
}), /* @__PURE__ */ V("select", {
|
|
152
153
|
id: "ch-type",
|
|
153
154
|
value: r,
|
|
154
155
|
onChange: (e) => a(e.target.value),
|
|
155
|
-
className:
|
|
156
|
-
children:
|
|
156
|
+
className: K,
|
|
157
|
+
children: ee.map((e) => /* @__PURE__ */ V("option", {
|
|
157
158
|
value: e,
|
|
158
159
|
children: i(e)
|
|
159
160
|
}, e))
|
|
160
|
-
})] }), /* @__PURE__ */
|
|
161
|
+
})] }), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
161
162
|
htmlFor: "ch-label",
|
|
162
|
-
className:
|
|
163
|
+
className: q,
|
|
163
164
|
children: t("inbox.addChannelModal.labelLabel", "Label")
|
|
164
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ V("input", {
|
|
165
166
|
id: "ch-label",
|
|
166
167
|
type: "text",
|
|
167
|
-
value:
|
|
168
|
-
onChange: (e) =>
|
|
168
|
+
value: u,
|
|
169
|
+
onChange: (e) => d(e.target.value),
|
|
169
170
|
placeholder: t("inbox.addChannelModal.labelPlaceholder", "e.g. Billing inbox"),
|
|
170
|
-
className:
|
|
171
|
+
className: K
|
|
171
172
|
})] })]
|
|
172
173
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("label", {
|
|
174
175
|
htmlFor: "ch-address",
|
|
175
|
-
className:
|
|
176
|
+
className: q,
|
|
176
177
|
children: [
|
|
177
178
|
t("inbox.addChannelModal.addressLabel", "Address"),
|
|
178
179
|
" ",
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ V("span", {
|
|
180
181
|
className: "text-status-error-text",
|
|
181
182
|
children: "*"
|
|
182
183
|
})
|
|
183
184
|
]
|
|
184
|
-
}), /* @__PURE__ */
|
|
185
|
+
}), /* @__PURE__ */ V("input", {
|
|
185
186
|
id: "ch-address",
|
|
186
187
|
type: "text",
|
|
187
188
|
value: o,
|
|
188
189
|
onChange: (e) => s(e.target.value),
|
|
189
190
|
placeholder: t("inbox.addChannelModal.addressPlaceholder", "e.g. billing@acme.com, +1…, a webhook URL"),
|
|
190
|
-
className:
|
|
191
|
+
className: K,
|
|
191
192
|
required: !0
|
|
192
193
|
})] }),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ H("label", {
|
|
194
195
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ V("input", {
|
|
196
197
|
type: "checkbox",
|
|
197
|
-
checked:
|
|
198
|
-
onChange: (e) =>
|
|
198
|
+
checked: f,
|
|
199
|
+
onChange: (e) => p(e.target.checked),
|
|
199
200
|
className: "size-4 rounded border-border-subtle"
|
|
200
201
|
}), t("inbox.addChannelModal.ingestLabel", "Ingest messages from this channel")]
|
|
201
202
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ H("div", {
|
|
203
204
|
className: "flex justify-end gap-3",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ V("button", {
|
|
205
206
|
type: "button",
|
|
206
207
|
onClick: e,
|
|
207
208
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
208
209
|
children: t("inbox.addChannelModal.cancel", "Cancel")
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ V("button", {
|
|
210
211
|
type: "submit",
|
|
211
212
|
disabled: n.isPending,
|
|
212
213
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
@@ -217,86 +218,86 @@ function ne({ onClose: e }) {
|
|
|
217
218
|
})
|
|
218
219
|
});
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
-
let n =
|
|
222
|
-
return /* @__PURE__ */
|
|
221
|
+
function ie({ channel: e, onClose: t }) {
|
|
222
|
+
let n = l(), r = _(), [a, o] = x(""), [s, u] = x(""), [d, f] = x("OTHER"), [p, m] = x(!1), [h, g] = x(null);
|
|
223
|
+
return /* @__PURE__ */ V(c, {
|
|
223
224
|
title: n("inbox.logMessageModal.title", "Log test message"),
|
|
224
225
|
description: n("inbox.logMessageModal.description", "Simulate an ingested message from {channel}.", { channel: e.label || e.address }),
|
|
225
226
|
onClose: t,
|
|
226
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ H("form", {
|
|
227
228
|
onSubmit: (i) => {
|
|
228
|
-
i.preventDefault(),
|
|
229
|
+
i.preventDefault(), g(null), r.mutate({
|
|
229
230
|
channelId: e.id,
|
|
230
231
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
231
|
-
category:
|
|
232
|
-
actionRequired:
|
|
232
|
+
category: d,
|
|
233
|
+
actionRequired: p,
|
|
233
234
|
...a.trim() ? { subject: a.trim() } : {},
|
|
234
235
|
...s.trim() ? { preview: s.trim() } : {}
|
|
235
236
|
}, {
|
|
236
237
|
onSuccess: () => t(),
|
|
237
|
-
onError: (e) =>
|
|
238
|
+
onError: (e) => g(e instanceof Error ? e.message : n("inbox.logMessageModal.error", "Could not log the message."))
|
|
238
239
|
});
|
|
239
240
|
},
|
|
240
241
|
className: "space-y-4",
|
|
241
242
|
children: [
|
|
242
|
-
|
|
243
|
+
h && /* @__PURE__ */ V("div", {
|
|
243
244
|
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:
|
|
245
|
+
children: h
|
|
245
246
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
247
248
|
htmlFor: "msg-subject",
|
|
248
|
-
className:
|
|
249
|
+
className: q,
|
|
249
250
|
children: n("inbox.logMessageModal.subjectLabel", "Subject")
|
|
250
|
-
}), /* @__PURE__ */
|
|
251
|
+
}), /* @__PURE__ */ V("input", {
|
|
251
252
|
id: "msg-subject",
|
|
252
253
|
type: "text",
|
|
253
254
|
value: a,
|
|
254
255
|
onChange: (e) => o(e.target.value),
|
|
255
256
|
placeholder: n("inbox.logMessageModal.subjectPlaceholder", "e.g. Your plan renews in 3 days"),
|
|
256
|
-
className:
|
|
257
|
+
className: K
|
|
257
258
|
})] }),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
259
260
|
htmlFor: "msg-preview",
|
|
260
|
-
className:
|
|
261
|
+
className: q,
|
|
261
262
|
children: n("inbox.logMessageModal.previewLabel", "Preview")
|
|
262
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ V("textarea", {
|
|
263
264
|
id: "msg-preview",
|
|
264
265
|
value: s,
|
|
265
|
-
onChange: (e) =>
|
|
266
|
+
onChange: (e) => u(e.target.value),
|
|
266
267
|
rows: 2,
|
|
267
|
-
className:
|
|
268
|
+
className: K
|
|
268
269
|
})] }),
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
270
271
|
htmlFor: "msg-category",
|
|
271
|
-
className:
|
|
272
|
+
className: q,
|
|
272
273
|
children: n("inbox.logMessageModal.categoryLabel", "Category")
|
|
273
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ V("select", {
|
|
274
275
|
id: "msg-category",
|
|
275
|
-
value:
|
|
276
|
-
onChange: (e) =>
|
|
277
|
-
className:
|
|
278
|
-
children:
|
|
276
|
+
value: d,
|
|
277
|
+
onChange: (e) => f(e.target.value),
|
|
278
|
+
className: K,
|
|
279
|
+
children: J.map((e) => /* @__PURE__ */ V("option", {
|
|
279
280
|
value: e,
|
|
280
281
|
children: n(Y[e], i(e))
|
|
281
282
|
}, e))
|
|
282
283
|
})] }),
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ H("label", {
|
|
284
285
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ V("input", {
|
|
286
287
|
type: "checkbox",
|
|
287
|
-
checked:
|
|
288
|
-
onChange: (e) =>
|
|
288
|
+
checked: p,
|
|
289
|
+
onChange: (e) => m(e.target.checked),
|
|
289
290
|
className: "size-4 rounded border-border-subtle"
|
|
290
291
|
}), n("inbox.logMessageModal.actionRequired", "Requires action")]
|
|
291
292
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ H("div", {
|
|
293
294
|
className: "flex justify-end gap-3",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ V("button", {
|
|
295
296
|
type: "button",
|
|
296
297
|
onClick: t,
|
|
297
298
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
298
299
|
children: n("inbox.logMessageModal.cancel", "Cancel")
|
|
299
|
-
}), /* @__PURE__ */
|
|
300
|
+
}), /* @__PURE__ */ V("button", {
|
|
300
301
|
type: "submit",
|
|
301
302
|
disabled: r.isPending,
|
|
302
303
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
@@ -307,67 +308,67 @@ function re({ channel: e, onClose: t }) {
|
|
|
307
308
|
})
|
|
308
309
|
});
|
|
309
310
|
}
|
|
310
|
-
function
|
|
311
|
-
let a =
|
|
312
|
-
return /* @__PURE__ */
|
|
311
|
+
function ae({ channel: e, onVerify: t, verifying: n, onLog: r }) {
|
|
312
|
+
let a = l(), s = X[e.type] ?? F, c = e.status === "VERIFIED";
|
|
313
|
+
return /* @__PURE__ */ H(U, {
|
|
313
314
|
treatment: "metric",
|
|
314
315
|
className: "flex flex-col p-4",
|
|
315
316
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ H("div", {
|
|
317
318
|
className: "flex items-start justify-between gap-2",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ H("div", {
|
|
319
320
|
className: "flex min-w-0 items-center gap-2.5",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ V("span", {
|
|
321
322
|
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
322
|
-
children: /* @__PURE__ */
|
|
323
|
-
}), /* @__PURE__ */
|
|
323
|
+
children: /* @__PURE__ */ V(s, { className: "h-4 w-4" })
|
|
324
|
+
}), /* @__PURE__ */ H("div", {
|
|
324
325
|
className: "min-w-0",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ V("p", {
|
|
326
327
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
327
328
|
children: i(e.type)
|
|
328
|
-
}), e.label && /* @__PURE__ */
|
|
329
|
+
}), e.label && /* @__PURE__ */ V("p", {
|
|
329
330
|
className: "truncate text-xs text-text-secondary",
|
|
330
331
|
children: e.label
|
|
331
332
|
})]
|
|
332
333
|
})]
|
|
333
|
-
}), /* @__PURE__ */
|
|
334
|
+
}), /* @__PURE__ */ V(o, { status: e.status })]
|
|
334
335
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ H("div", {
|
|
336
337
|
className: "mt-3 border-t border-border-subtle pt-3",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ V("p", {
|
|
338
339
|
className: "text-[11px] uppercase tracking-wide text-text-secondary",
|
|
339
340
|
children: e.ingestEnabled ? a("inbox.channels.ingestingFrom", "Ingesting from") : a("inbox.channels.ingestPaused", "Ingest paused")
|
|
340
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ V("p", {
|
|
341
342
|
className: "mt-0.5 truncate text-sm text-text-primary",
|
|
342
343
|
title: e.address,
|
|
343
344
|
children: e.address
|
|
344
345
|
})]
|
|
345
346
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ H("div", {
|
|
347
348
|
className: "mt-auto flex flex-wrap items-center gap-2 pt-3",
|
|
348
349
|
children: [
|
|
349
|
-
e.status === "PENDING" && /* @__PURE__ */
|
|
350
|
+
e.status === "PENDING" && /* @__PURE__ */ H("button", {
|
|
350
351
|
type: "button",
|
|
351
352
|
disabled: n,
|
|
352
353
|
onClick: () => t(e.id),
|
|
353
354
|
className: "inline-flex items-center gap-1 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
354
355
|
children: [
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ V(C, { className: "h-3.5 w-3.5" }),
|
|
356
357
|
" ",
|
|
357
358
|
a("inbox.channels.verify", "Verify")
|
|
358
359
|
]
|
|
359
360
|
}),
|
|
360
|
-
c && e.ingestEnabled && /* @__PURE__ */
|
|
361
|
+
c && e.ingestEnabled && /* @__PURE__ */ H("button", {
|
|
361
362
|
type: "button",
|
|
362
363
|
onClick: () => r(e),
|
|
363
364
|
className: "inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
364
365
|
children: [
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ V(I, { className: "h-3.5 w-3.5" }),
|
|
366
367
|
" ",
|
|
367
368
|
a("inbox.channels.logTestMessage", "Log test message")
|
|
368
369
|
]
|
|
369
370
|
}),
|
|
370
|
-
e.status === "DISABLED" && /* @__PURE__ */
|
|
371
|
+
e.status === "DISABLED" && /* @__PURE__ */ V("span", {
|
|
371
372
|
className: "text-xs text-text-secondary",
|
|
372
373
|
children: a("inbox.channels.disabled", "Channel disabled")
|
|
373
374
|
})
|
|
@@ -376,65 +377,65 @@ function ie({ channel: e, onVerify: t, verifying: n, onLog: r }) {
|
|
|
376
377
|
]
|
|
377
378
|
});
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
-
let e =
|
|
381
|
-
return /* @__PURE__ */
|
|
380
|
+
function oe() {
|
|
381
|
+
let e = l(), { data: t, isLoading: n, isError: r, refetch: i } = m(), a = y(), [o, c] = x(!1), [p, h] = x(null), g = t ?? [], _ = g.filter((e) => e.status === "VERIFIED").length, v = g.filter((e) => e.status === "PENDING").length;
|
|
382
|
+
return /* @__PURE__ */ H(f, {
|
|
382
383
|
title: e("inbox.channels.title", "Ingest channels"),
|
|
383
384
|
description: e("inbox.channels.description", "The sources the Universal Inbox pulls subscription communication from"),
|
|
384
|
-
action: /* @__PURE__ */
|
|
385
|
+
action: /* @__PURE__ */ H("button", {
|
|
385
386
|
type: "button",
|
|
386
387
|
onClick: () => c(!0),
|
|
387
388
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90",
|
|
388
389
|
children: [
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" }),
|
|
390
391
|
" ",
|
|
391
392
|
e("inbox.channels.add", "Add channel")
|
|
392
393
|
]
|
|
393
394
|
}),
|
|
394
395
|
children: [
|
|
395
|
-
n ? /* @__PURE__ */
|
|
396
|
+
n ? /* @__PURE__ */ V(d, { label: e("inbox.channels.loading", "Loading channels…") }) : r ? /* @__PURE__ */ V(u, {
|
|
396
397
|
message: e("inbox.channels.error", "Could not load channels."),
|
|
397
398
|
onRetry: () => void i()
|
|
398
|
-
}) :
|
|
399
|
+
}) : g.length === 0 ? /* @__PURE__ */ V(s, {
|
|
399
400
|
illustration: "empty-data",
|
|
400
|
-
icon: /* @__PURE__ */
|
|
401
|
+
icon: /* @__PURE__ */ V(F, { className: "h-12 w-12" }),
|
|
401
402
|
title: e("inbox.channels.emptyTitle", "No channels yet"),
|
|
402
403
|
description: e("inbox.channels.emptyDescription", "Add an email, SMS, Slack or webhook channel to start ingesting subscription communication.")
|
|
403
|
-
}) : /* @__PURE__ */
|
|
404
|
+
}) : /* @__PURE__ */ H(B, { children: [(_ > 0 || v > 0) && /* @__PURE__ */ H("div", {
|
|
404
405
|
className: "mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-secondary",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
406
|
+
children: [/* @__PURE__ */ H("span", {
|
|
406
407
|
className: "inline-flex items-center gap-1.5",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ V("span", {
|
|
408
409
|
className: "size-1.5 rounded-full bg-status-success-text",
|
|
409
410
|
"aria-hidden": !0
|
|
410
|
-
}), e("inbox.channels.verified", "{{count}} verified", { count:
|
|
411
|
-
}),
|
|
411
|
+
}), e("inbox.channels.verified", "{{count}} verified", { count: _ })]
|
|
412
|
+
}), v > 0 && /* @__PURE__ */ H("span", {
|
|
412
413
|
className: "inline-flex items-center gap-1.5",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ V("span", {
|
|
414
415
|
className: "size-1.5 rounded-full bg-status-warning-text",
|
|
415
416
|
"aria-hidden": !0
|
|
416
|
-
}), e("inbox.channels.pending", "{{count}} pending verification", { count:
|
|
417
|
+
}), e("inbox.channels.pending", "{{count}} pending verification", { count: v })]
|
|
417
418
|
})]
|
|
418
|
-
}), /* @__PURE__ */
|
|
419
|
+
}), /* @__PURE__ */ V("div", {
|
|
419
420
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
420
|
-
children:
|
|
421
|
+
children: g.map((e) => /* @__PURE__ */ V(ae, {
|
|
421
422
|
channel: e,
|
|
422
423
|
verifying: a.isPending,
|
|
423
424
|
onVerify: (e) => a.mutate(e),
|
|
424
|
-
onLog: (e) =>
|
|
425
|
+
onLog: (e) => h(e)
|
|
425
426
|
}, e.id))
|
|
426
427
|
})] }),
|
|
427
|
-
o && /* @__PURE__ */
|
|
428
|
-
|
|
429
|
-
channel:
|
|
430
|
-
onClose: () =>
|
|
428
|
+
o && /* @__PURE__ */ V(re, { onClose: () => c(!1) }),
|
|
429
|
+
p && /* @__PURE__ */ V(ie, {
|
|
430
|
+
channel: p,
|
|
431
|
+
onClose: () => h(null)
|
|
431
432
|
})
|
|
432
433
|
]
|
|
433
434
|
});
|
|
434
435
|
}
|
|
435
|
-
function
|
|
436
|
-
let c =
|
|
437
|
-
return /* @__PURE__ */
|
|
436
|
+
function se({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o, onViewRelationship: s }) {
|
|
437
|
+
let c = l(), u = !e.isRead;
|
|
438
|
+
return /* @__PURE__ */ H("div", {
|
|
438
439
|
role: "button",
|
|
439
440
|
tabIndex: 0,
|
|
440
441
|
"aria-pressed": n,
|
|
@@ -442,46 +443,46 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
|
|
|
442
443
|
onKeyDown: (e) => {
|
|
443
444
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r());
|
|
444
445
|
},
|
|
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" :
|
|
446
|
+
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
447
|
children: [
|
|
447
|
-
|
|
448
|
+
u && /* @__PURE__ */ V("span", {
|
|
448
449
|
"aria-hidden": !0,
|
|
449
450
|
className: "absolute inset-y-0 left-0 w-0.5 bg-text-link"
|
|
450
451
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ V("span", {
|
|
452
453
|
className: "mt-0.5 shrink-0 text-text-secondary",
|
|
453
|
-
children:
|
|
454
|
+
children: u ? /* @__PURE__ */ V(O, { className: "h-4 w-4 text-text-link" }) : /* @__PURE__ */ V(k, { className: "h-4 w-4" })
|
|
454
455
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ H("div", {
|
|
456
457
|
className: "min-w-0 flex-1",
|
|
457
458
|
children: [
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ H("div", {
|
|
459
460
|
className: "flex items-center gap-2",
|
|
460
461
|
children: [
|
|
461
|
-
|
|
462
|
+
u && /* @__PURE__ */ V("span", {
|
|
462
463
|
"aria-label": c("inbox.message.unreadAria", "Unread"),
|
|
463
464
|
className: "size-1.5 shrink-0 rounded-full bg-text-link"
|
|
464
465
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
className: t("min-w-0 flex-1 truncate text-sm",
|
|
466
|
+
/* @__PURE__ */ V("p", {
|
|
467
|
+
className: t("min-w-0 flex-1 truncate text-sm", u ? "font-semibold text-text-primary" : "font-normal text-text-primary"),
|
|
467
468
|
children: e.subject || c("inbox.message.noSubject", "(no subject)")
|
|
468
469
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ V("span", {
|
|
470
471
|
className: "shrink-0 text-xs tabular-nums text-text-secondary",
|
|
471
472
|
children: a(e.receivedAt)
|
|
472
473
|
})
|
|
473
474
|
]
|
|
474
475
|
}),
|
|
475
|
-
e.preview && /* @__PURE__ */
|
|
476
|
+
e.preview && /* @__PURE__ */ V("p", {
|
|
476
477
|
className: "mt-0.5 line-clamp-2 text-xs text-text-secondary",
|
|
477
478
|
children: e.preview
|
|
478
479
|
}),
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ H("div", {
|
|
480
481
|
className: "mt-1.5 flex flex-wrap items-center gap-2",
|
|
481
482
|
children: [
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
e.actionRequired && /* @__PURE__ */
|
|
484
|
-
s && /* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ V(Z, { category: e.category }),
|
|
484
|
+
e.actionRequired && /* @__PURE__ */ V(Q, {}),
|
|
485
|
+
s && /* @__PURE__ */ V("button", {
|
|
485
486
|
type: "button",
|
|
486
487
|
onClick: (e) => {
|
|
487
488
|
e.stopPropagation(), s();
|
|
@@ -489,7 +490,7 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
|
|
|
489
490
|
className: "text-xs font-medium text-text-link hover:underline",
|
|
490
491
|
children: c("inbox.message.viewRelationship", "View relationship")
|
|
491
492
|
}),
|
|
492
|
-
|
|
493
|
+
u && /* @__PURE__ */ V("button", {
|
|
493
494
|
type: "button",
|
|
494
495
|
disabled: o,
|
|
495
496
|
onClick: (e) => {
|
|
@@ -505,34 +506,34 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
|
|
|
505
506
|
]
|
|
506
507
|
});
|
|
507
508
|
}
|
|
508
|
-
function
|
|
509
|
-
let o =
|
|
510
|
-
if (!e) return /* @__PURE__ */
|
|
509
|
+
function ce({ message: e, channel: t, onMarkRead: n, markPending: i, onViewRelationship: a }) {
|
|
510
|
+
let o = l();
|
|
511
|
+
if (!e) return /* @__PURE__ */ H(U, {
|
|
511
512
|
treatment: "metric",
|
|
512
513
|
className: "flex min-h-[20rem] flex-col items-center justify-center p-8 text-center",
|
|
513
514
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ V(M, { className: "h-10 w-10 text-text-secondary" }),
|
|
516
|
+
/* @__PURE__ */ V("p", {
|
|
516
517
|
className: "mt-3 text-sm font-medium text-text-primary",
|
|
517
518
|
children: o("inbox.readingPane.selectTitle", "Select a message")
|
|
518
519
|
}),
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ V("p", {
|
|
520
521
|
className: "mt-1 max-w-[16rem] text-xs text-text-secondary",
|
|
521
522
|
children: o("inbox.readingPane.selectDescription", "Pick any message from the list to read the full details here.")
|
|
522
523
|
})
|
|
523
524
|
]
|
|
524
525
|
});
|
|
525
|
-
let s = t ? X[t.type] ??
|
|
526
|
-
return /* @__PURE__ */
|
|
526
|
+
let s = t ? X[t.type] ?? F : F, c = e.categoryConfidence == null ? null : Math.round(Math.max(0, Math.min(1, e.categoryConfidence)) * 100);
|
|
527
|
+
return /* @__PURE__ */ H(U, {
|
|
527
528
|
treatment: "metric",
|
|
528
529
|
className: "flex flex-col p-5",
|
|
529
530
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ H("div", {
|
|
531
532
|
className: "flex items-start justify-between gap-3",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
533
|
+
children: [/* @__PURE__ */ V("h3", {
|
|
533
534
|
className: "text-base font-semibold text-text-primary",
|
|
534
535
|
children: e.subject || o("inbox.message.noSubject", "(no subject)")
|
|
535
|
-
}), !e.isRead && /* @__PURE__ */
|
|
536
|
+
}), !e.isRead && /* @__PURE__ */ V("button", {
|
|
536
537
|
type: "button",
|
|
537
538
|
disabled: i,
|
|
538
539
|
onClick: n,
|
|
@@ -540,79 +541,79 @@ function se({ message: e, channel: t, onMarkRead: n, markPending: i, onViewRelat
|
|
|
540
541
|
children: o("inbox.message.markRead", "Mark read")
|
|
541
542
|
})]
|
|
542
543
|
}),
|
|
543
|
-
t && /* @__PURE__ */
|
|
544
|
+
t && /* @__PURE__ */ H("div", {
|
|
544
545
|
className: "mt-2 flex items-center gap-2 text-sm",
|
|
545
|
-
children: [/* @__PURE__ */
|
|
546
|
+
children: [/* @__PURE__ */ V(s, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ V("span", {
|
|
546
547
|
className: "truncate text-text-secondary",
|
|
547
548
|
title: t.address,
|
|
548
549
|
children: t.address
|
|
549
550
|
})]
|
|
550
551
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ H("div", {
|
|
552
553
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
553
554
|
children: [
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
e.actionRequired && /* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ V(Z, { category: e.category }),
|
|
556
|
+
e.actionRequired && /* @__PURE__ */ V(Q, {}),
|
|
557
|
+
/* @__PURE__ */ V("span", {
|
|
557
558
|
className: "text-xs text-text-secondary",
|
|
558
559
|
children: r(e.receivedAt)
|
|
559
560
|
})
|
|
560
561
|
]
|
|
561
562
|
}),
|
|
562
|
-
c != null && /* @__PURE__ */
|
|
563
|
+
c != null && /* @__PURE__ */ H("div", {
|
|
563
564
|
className: "mt-4 rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
565
|
+
children: [/* @__PURE__ */ H("div", {
|
|
565
566
|
className: "flex items-center justify-between text-xs",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ H("span", {
|
|
567
568
|
className: "inline-flex items-center gap-1.5 font-medium text-text-primary",
|
|
568
569
|
children: [
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ V(R, { className: "h-3.5 w-3.5 text-text-link" }),
|
|
570
571
|
" ",
|
|
571
572
|
o("inbox.readingPane.aiCategorization", "AI categorization")
|
|
572
573
|
]
|
|
573
|
-
}), /* @__PURE__ */
|
|
574
|
+
}), /* @__PURE__ */ V("span", {
|
|
574
575
|
className: "tabular-nums text-text-secondary",
|
|
575
576
|
children: o("inbox.readingPane.confidence", "{{pct}}% confidence", { pct: c })
|
|
576
577
|
})]
|
|
577
|
-
}), /* @__PURE__ */
|
|
578
|
+
}), /* @__PURE__ */ V(p, {
|
|
578
579
|
value: c,
|
|
579
580
|
max: 100,
|
|
580
581
|
tone: c >= 66 ? "positive" : c >= 33 ? "accent" : "warning",
|
|
581
582
|
className: "mt-2"
|
|
582
583
|
})]
|
|
583
584
|
}),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ V("div", {
|
|
585
586
|
className: "mt-4 border-t border-border-subtle pt-4",
|
|
586
|
-
children: e.preview ? /* @__PURE__ */
|
|
587
|
+
children: e.preview ? /* @__PURE__ */ V("p", {
|
|
587
588
|
className: "whitespace-pre-wrap text-sm leading-relaxed text-text-primary",
|
|
588
589
|
children: e.preview
|
|
589
|
-
}) : /* @__PURE__ */
|
|
590
|
+
}) : /* @__PURE__ */ V("p", {
|
|
590
591
|
className: "text-sm italic text-text-secondary",
|
|
591
592
|
children: o("inbox.readingPane.noPreview", "No preview available for this message.")
|
|
592
593
|
})
|
|
593
594
|
}),
|
|
594
|
-
e.actionRequired && /* @__PURE__ */
|
|
595
|
+
e.actionRequired && /* @__PURE__ */ H("div", {
|
|
595
596
|
className: "mt-4 flex items-start gap-2 rounded-lg border border-status-warning-text/30 bg-status-warning-bg-subtle p-3",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
597
|
+
children: [/* @__PURE__ */ V(L, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ V("p", {
|
|
597
598
|
className: "text-xs text-status-warning-text",
|
|
598
599
|
children: o("inbox.readingPane.attention", "This message needs your attention — review it before its provider deadline.")
|
|
599
600
|
})]
|
|
600
601
|
}),
|
|
601
|
-
a && /* @__PURE__ */
|
|
602
|
+
a && /* @__PURE__ */ H("button", {
|
|
602
603
|
type: "button",
|
|
603
604
|
onClick: a,
|
|
604
605
|
className: "mt-4 inline-flex items-center gap-1 self-start text-sm font-medium text-text-link hover:underline",
|
|
605
606
|
children: [
|
|
606
607
|
o("inbox.message.viewRelationship", "View relationship"),
|
|
607
608
|
" ",
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ V(T, { className: "h-4 w-4" })
|
|
609
610
|
]
|
|
610
611
|
})
|
|
611
612
|
]
|
|
612
613
|
});
|
|
613
614
|
}
|
|
614
615
|
function $({ active: e, onClick: n, children: r, tone: i = "default" }) {
|
|
615
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ V("button", {
|
|
616
617
|
type: "button",
|
|
617
618
|
onClick: n,
|
|
618
619
|
"aria-pressed": e,
|
|
@@ -620,158 +621,158 @@ function $({ active: e, onClick: n, children: r, tone: i = "default" }) {
|
|
|
620
621
|
children: r
|
|
621
622
|
});
|
|
622
623
|
}
|
|
623
|
-
function
|
|
624
|
-
let r =
|
|
624
|
+
function le() {
|
|
625
|
+
let r = l(), { navigateTo: i } = e(), [a, o] = x(0), [c, f] = x(""), [p, h] = x(!1), [_, y] = x(!1), [C, w] = b("inbox"), { data: T, isLoading: E, isError: k, refetch: A, isFetching: j } = g({
|
|
625
626
|
category: c || void 0,
|
|
626
|
-
unreadOnly:
|
|
627
|
+
unreadOnly: p || void 0,
|
|
627
628
|
pagination: {
|
|
628
|
-
limit:
|
|
629
|
-
offset: a *
|
|
629
|
+
limit: G,
|
|
630
|
+
offset: a * G
|
|
630
631
|
}
|
|
631
|
-
}), { data:
|
|
632
|
-
o(0),
|
|
632
|
+
}), { data: M } = m(), N = v(), P = T?.items ?? [], F = T?.pageInfo.hasMore ?? !1, I = _ ? P.filter((e) => e.actionRequired) : P, L = P.filter((e) => !e.isRead).length, R = P.filter((e) => e.actionRequired).length, z = new Map((M ?? []).map((e) => [e.id, e])), B = I.find((e) => e.id === C) ?? null, U = B ? z.get(B.channelId) : void 0, K = () => {
|
|
633
|
+
o(0), w(null);
|
|
633
634
|
};
|
|
634
|
-
return /* @__PURE__ */
|
|
635
|
+
return /* @__PURE__ */ H(n, {
|
|
635
636
|
title: r("inbox.title", "Universal Inbox"),
|
|
636
637
|
description: r("inbox.description", "Every subscription communication, merged and categorized"),
|
|
637
638
|
children: [
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ V(W, {
|
|
639
640
|
className: "mb-4",
|
|
640
641
|
children: r("inbox.purpose", "Subscription communication is noisy and scattered. The Universal Inbox merges every channel a provider uses and uses AI to categorize each message so you never miss a renewal, required action or security notice.")
|
|
641
642
|
}),
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ V("div", {
|
|
643
644
|
className: "-mx-1 flex gap-2 overflow-x-auto px-1 pb-1",
|
|
644
|
-
children:
|
|
645
|
+
children: te.map((e) => /* @__PURE__ */ V("span", {
|
|
645
646
|
className: "shrink-0",
|
|
646
|
-
children: /* @__PURE__ */
|
|
647
|
+
children: /* @__PURE__ */ V($, {
|
|
647
648
|
active: c === e.value,
|
|
648
649
|
onClick: () => {
|
|
649
|
-
|
|
650
|
+
f(e.value), K();
|
|
650
651
|
},
|
|
651
652
|
children: r(e.key, e.fallback)
|
|
652
653
|
})
|
|
653
654
|
}, e.value))
|
|
654
655
|
}),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ H("div", {
|
|
656
657
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
657
658
|
children: [
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
active:
|
|
659
|
+
/* @__PURE__ */ H($, {
|
|
660
|
+
active: _,
|
|
660
661
|
tone: "warning",
|
|
661
662
|
onClick: () => {
|
|
662
|
-
|
|
663
|
+
y((e) => !e), w(null);
|
|
663
664
|
},
|
|
664
665
|
children: [
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ V(S, { className: "h-3.5 w-3.5" }),
|
|
666
667
|
" ",
|
|
667
668
|
r("inbox.filters.actionRequired", "Action required")
|
|
668
669
|
]
|
|
669
670
|
}),
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
active:
|
|
671
|
+
/* @__PURE__ */ H($, {
|
|
672
|
+
active: p,
|
|
672
673
|
onClick: () => {
|
|
673
|
-
|
|
674
|
+
h((e) => !e), K();
|
|
674
675
|
},
|
|
675
676
|
children: [
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ V(O, { className: "h-3.5 w-3.5" }),
|
|
677
678
|
" ",
|
|
678
679
|
r("inbox.filters.unreadOnly", "Unread only")
|
|
679
680
|
]
|
|
680
681
|
}),
|
|
681
|
-
!
|
|
682
|
+
!E && !k && P.length > 0 && /* @__PURE__ */ H("p", {
|
|
682
683
|
className: "ml-auto text-xs text-text-secondary",
|
|
683
684
|
children: [
|
|
684
|
-
r("inbox.filters.unreadCount", "{{count}} unread", { count:
|
|
685
|
+
r("inbox.filters.unreadCount", "{{count}} unread", { count: L }),
|
|
685
686
|
" · ",
|
|
686
|
-
r("inbox.filters.actionCount", "{{count}} need action", { count:
|
|
687
|
-
|
|
687
|
+
r("inbox.filters.actionCount", "{{count}} need action", { count: R }),
|
|
688
|
+
j ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""
|
|
688
689
|
]
|
|
689
690
|
})
|
|
690
691
|
]
|
|
691
692
|
}),
|
|
692
|
-
|
|
693
|
+
E ? /* @__PURE__ */ V(d, { label: r("inbox.loading", "Loading inbox…") }) : k ? /* @__PURE__ */ V(u, {
|
|
693
694
|
message: r("inbox.error", "Could not load the inbox."),
|
|
694
|
-
onRetry: () => void
|
|
695
|
-
}) :
|
|
695
|
+
onRetry: () => void A()
|
|
696
|
+
}) : P.length === 0 ? /* @__PURE__ */ V("div", {
|
|
696
697
|
className: "mt-6",
|
|
697
|
-
children: /* @__PURE__ */
|
|
698
|
+
children: /* @__PURE__ */ V(s, {
|
|
698
699
|
illustration: "empty-inbox",
|
|
699
|
-
icon: /* @__PURE__ */
|
|
700
|
+
icon: /* @__PURE__ */ V(D, { className: "h-12 w-12" }),
|
|
700
701
|
title: r("inbox.emptyTitle", "Inbox is empty"),
|
|
701
|
-
description:
|
|
702
|
+
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
703
|
})
|
|
703
|
-
}) : /* @__PURE__ */
|
|
704
|
+
}) : /* @__PURE__ */ H("div", {
|
|
704
705
|
className: "mt-5 grid grid-cols-1 gap-5 lg:grid-cols-[minmax(0,1fr)_380px]",
|
|
705
|
-
children: [/* @__PURE__ */
|
|
706
|
+
children: [/* @__PURE__ */ H("div", {
|
|
706
707
|
className: "min-w-0",
|
|
707
|
-
children: [
|
|
708
|
+
children: [I.length === 0 ? /* @__PURE__ */ H("div", {
|
|
708
709
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-8 text-center",
|
|
709
710
|
children: [
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ V(S, { className: "mx-auto h-8 w-8 text-text-secondary" }),
|
|
712
|
+
/* @__PURE__ */ V("p", {
|
|
712
713
|
className: "mt-2 text-sm font-medium text-text-primary",
|
|
713
714
|
children: r("inbox.noActionTitle", "No action-required messages on this page")
|
|
714
715
|
}),
|
|
715
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ V("p", {
|
|
716
717
|
className: "mt-1 text-xs text-text-secondary",
|
|
717
718
|
children: r("inbox.noActionDescription", "Turn off the “Action required” lens or move to another page.")
|
|
718
719
|
})
|
|
719
720
|
]
|
|
720
|
-
}) : /* @__PURE__ */
|
|
721
|
+
}) : /* @__PURE__ */ V("div", {
|
|
721
722
|
className: "divide-y divide-border-subtle overflow-hidden rounded-xl border border-border-subtle bg-bg-surface",
|
|
722
|
-
children:
|
|
723
|
+
children: I.map((e) => /* @__PURE__ */ V(se, {
|
|
723
724
|
message: e,
|
|
724
|
-
active: e.id ===
|
|
725
|
-
onSelect: () =>
|
|
726
|
-
onMarkRead: () =>
|
|
727
|
-
markPending:
|
|
725
|
+
active: e.id === C,
|
|
726
|
+
onSelect: () => w(e.id),
|
|
727
|
+
onMarkRead: () => N.mutate(e.id),
|
|
728
|
+
markPending: N.isPending,
|
|
728
729
|
onViewRelationship: e.relationshipId ? () => i(`/relationships/${e.relationshipId}`) : null
|
|
729
730
|
}, e.id))
|
|
730
|
-
}), /* @__PURE__ */
|
|
731
|
+
}), /* @__PURE__ */ H("div", {
|
|
731
732
|
className: "mt-4 flex items-center justify-between",
|
|
732
|
-
children: [/* @__PURE__ */
|
|
733
|
+
children: [/* @__PURE__ */ H("p", {
|
|
733
734
|
className: "text-xs text-text-secondary",
|
|
734
|
-
children: [r("inbox.pagination.page", "Page {{page}}", { page: a + 1 }),
|
|
735
|
-
}), /* @__PURE__ */
|
|
735
|
+
children: [r("inbox.pagination.page", "Page {{page}}", { page: a + 1 }), j ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""]
|
|
736
|
+
}), /* @__PURE__ */ H("div", {
|
|
736
737
|
className: "flex gap-2",
|
|
737
|
-
children: [/* @__PURE__ */
|
|
738
|
+
children: [/* @__PURE__ */ V("button", {
|
|
738
739
|
type: "button",
|
|
739
740
|
disabled: a === 0,
|
|
740
741
|
onClick: () => {
|
|
741
|
-
o((e) => Math.max(0, e - 1)),
|
|
742
|
+
o((e) => Math.max(0, e - 1)), w(null);
|
|
742
743
|
},
|
|
743
744
|
className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", a === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
|
|
744
745
|
children: r("inbox.pagination.previous", "Previous")
|
|
745
|
-
}), /* @__PURE__ */
|
|
746
|
+
}), /* @__PURE__ */ V("button", {
|
|
746
747
|
type: "button",
|
|
747
|
-
disabled: !
|
|
748
|
+
disabled: !F,
|
|
748
749
|
onClick: () => {
|
|
749
|
-
o((e) => e + 1),
|
|
750
|
+
o((e) => e + 1), w(null);
|
|
750
751
|
},
|
|
751
|
-
className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium",
|
|
752
|
+
className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", F ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
|
|
752
753
|
children: r("inbox.pagination.next", "Next")
|
|
753
754
|
})]
|
|
754
755
|
})]
|
|
755
756
|
})]
|
|
756
|
-
}), /* @__PURE__ */
|
|
757
|
+
}), /* @__PURE__ */ V("aside", {
|
|
757
758
|
className: "hidden lg:block",
|
|
758
|
-
children: /* @__PURE__ */
|
|
759
|
+
children: /* @__PURE__ */ V("div", {
|
|
759
760
|
className: "lg:sticky lg:top-4",
|
|
760
|
-
children: /* @__PURE__ */
|
|
761
|
-
message:
|
|
762
|
-
channel:
|
|
763
|
-
onMarkRead: () =>
|
|
764
|
-
markPending:
|
|
765
|
-
onViewRelationship:
|
|
761
|
+
children: /* @__PURE__ */ V(ce, {
|
|
762
|
+
message: B,
|
|
763
|
+
channel: U,
|
|
764
|
+
onMarkRead: () => B && N.mutate(B.id),
|
|
765
|
+
markPending: N.isPending,
|
|
766
|
+
onViewRelationship: B?.relationshipId ? () => i(`/relationships/${B.relationshipId}`) : null
|
|
766
767
|
})
|
|
767
768
|
})
|
|
768
769
|
})]
|
|
769
770
|
}),
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ V(oe, {})
|
|
771
772
|
]
|
|
772
773
|
});
|
|
773
774
|
}
|
|
774
775
|
//#endregion
|
|
775
|
-
export {
|
|
776
|
+
export { le as InboxPage };
|
|
776
777
|
|
|
777
778
|
//# sourceMappingURL=InboxPage.js.map
|