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