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