@burdenoff/microfe-subscriberbot 2026.1103.2 → 2026.1105.2

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 (206) hide show
  1. package/dist/index.js +3 -3
  2. package/dist/stories/Accessibility.stories.d.ts +13 -0
  3. package/dist/stories/Accessibility.stories.d.ts.map +1 -0
  4. package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
  5. package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
  6. package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
  7. package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
  8. package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
  9. package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
  10. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
  11. package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
  12. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  13. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
  14. package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
  15. package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
  16. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
  17. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
  18. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
  19. package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
  20. package/dist/subscriberbot/components/Modal.js +43 -33
  21. package/dist/subscriberbot/components/Modal.js.map +1 -1
  22. package/dist/subscriberbot/components/PageLayout.d.ts +6 -0
  23. package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
  24. package/dist/subscriberbot/components/PageLayout.js +2 -1
  25. package/dist/subscriberbot/components/PageLayout.js.map +1 -1
  26. package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
  27. package/dist/subscriberbot/components/PostureOptions.js +10 -10
  28. package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
  29. package/dist/subscriberbot/components/StateViews.d.ts +2 -0
  30. package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
  31. package/dist/subscriberbot/components/StateViews.js +46 -37
  32. package/dist/subscriberbot/components/StateViews.js.map +1 -1
  33. package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
  34. package/dist/subscriberbot/components/StatusBadge.js +6 -6
  35. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  36. package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
  37. package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
  38. package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
  39. package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
  40. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
  41. package/dist/subscriberbot/components/mobile/MobileDashboard.js +143 -135
  42. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
  43. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
  44. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
  45. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
  46. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +3 -0
  47. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -1
  48. package/dist/subscriberbot/components/mobile/MobileScreen.js +5 -3
  49. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
  50. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
  51. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
  52. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
  53. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
  54. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
  55. package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
  56. package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
  57. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
  58. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
  59. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
  60. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
  61. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
  62. package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
  63. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
  64. package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
  65. package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
  66. package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
  67. package/dist/subscriberbot/components/viz.d.ts +1 -0
  68. package/dist/subscriberbot/components/viz.d.ts.map +1 -1
  69. package/dist/subscriberbot/components/viz.js +100 -101
  70. package/dist/subscriberbot/components/viz.js.map +1 -1
  71. package/dist/subscriberbot/hooks/index.js +1 -1
  72. package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
  73. package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
  74. package/dist/subscriberbot/hooks/useFormError.js +28 -0
  75. package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
  76. package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
  77. package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
  78. package/dist/subscriberbot/hooks/useFormatters.js +13 -0
  79. package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
  80. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  81. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
  82. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  83. package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
  84. package/dist/subscriberbot/hooks/useTr.js +1 -1
  85. package/dist/subscriberbot/hooks/useTr.js.map +1 -1
  86. package/dist/subscriberbot/index.js +1 -1
  87. package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
  88. package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
  89. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
  90. package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
  91. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  92. package/dist/subscriberbot/pages/DashboardPage.js +115 -98
  93. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  94. package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
  95. package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
  96. package/dist/subscriberbot/pages/InboxPage.js +421 -402
  97. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  98. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
  99. package/dist/subscriberbot/pages/InsightsPage.js +130 -121
  100. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  101. package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
  102. package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
  103. package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
  104. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  105. package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
  106. package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
  107. package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
  108. package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
  109. package/dist/subscriberbot/pages/SavingsPage.js +57 -57
  110. package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
  111. package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
  112. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
  113. package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
  114. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  115. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
  116. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
  117. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
  118. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  119. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
  120. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
  121. package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
  122. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  123. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
  124. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
  125. package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
  126. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  127. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
  128. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
  129. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +272 -260
  130. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
  131. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
  132. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
  133. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
  134. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
  135. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
  136. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
  137. package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
  138. package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
  139. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
  140. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
  141. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
  142. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
  143. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
  144. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
  145. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
  146. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
  147. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
  148. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
  149. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
  150. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
  151. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
  152. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
  153. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
  154. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
  155. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
  156. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
  157. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
  158. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
  159. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
  160. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
  161. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
  162. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
  163. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
  164. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
  165. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
  166. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
  167. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
  168. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
  169. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
  170. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  171. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
  172. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
  173. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
  174. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  175. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
  176. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
  177. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
  178. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  179. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
  180. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  181. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
  182. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  183. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
  184. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
  185. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +112 -91
  186. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  187. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
  188. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
  189. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
  190. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  191. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
  192. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
  193. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
  194. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
  195. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
  196. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
  197. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
  198. package/dist/subscriberbot/utils/formatters.d.ts +16 -5
  199. package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
  200. package/dist/subscriberbot/utils/formatters.js +57 -25
  201. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  202. package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
  203. package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
  204. package/dist/subscriberbot/utils/plaidLink.js +21 -21
  205. package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
  206. package/package.json +1 -1
@@ -1,26 +1,27 @@
1
1
  import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { MetricsCard as r } from "../../components/MetricsCard.js";
5
- import { formatCurrency as i, formatDate as a, formatIntervalSuffix as o } from "../../utils/formatters.js";
6
- import { StatusBadge as s } from "../../components/StatusBadge.js";
7
- import { EmptyState as c } from "../../components/EmptyState.js";
8
- import { Modal as l } from "../../components/Modal.js";
9
- import { useTr as ee } from "../../hooks/useTr.js";
10
- import { ErrorView as u, LoadingView as d, Section as f } from "../../components/StateViews.js";
2
+ import { useTr as t } from "../../hooks/useTr.js";
3
+ import { useFormatters as n } from "../../hooks/useFormatters.js";
4
+ import { cn as r } from "../../utils/cn.js";
5
+ import { PageLayout as ee } from "../../components/PageLayout.js";
6
+ import { MetricsCard as i } from "../../components/MetricsCard.js";
7
+ import { StatusBadge as a } from "../../components/StatusBadge.js";
8
+ import { EmptyState as o } from "../../components/EmptyState.js";
9
+ import { Modal as s } from "../../components/Modal.js";
10
+ import { ErrorView as c, LoadingView as l, Section as u } from "../../components/StateViews.js";
11
11
  import "../../components/index.js";
12
- import { useBankAggregators as p, useBankConnections as m, useCompleteBankLink as h, useCreateBankLinkSession as te, useDismissRecurringCharge as g, useImportBankStatement as ne, useRecurringCharges as _, useRemoveBankConnection as v, useRestoreRecurringCharge as y, useSyncBankConnection as b, useTrackRecurringCharge as x } from "../../hooks/useBankingApi.js";
12
+ import { useFormError as d } from "../../hooks/useFormError.js";
13
+ import { useBankAggregators as f, useBankConnections as p, useCompleteBankLink as m, useCreateBankLinkSession as h, useDismissRecurringCharge as g, useImportBankStatement as _, useRecurringCharges as v, useRemoveBankConnection as y, useRestoreRecurringCharge as te, useSyncBankConnection as b, useTrackRecurringCharge as x } from "../../hooks/useBankingApi.js";
13
14
  import { openPlaidLink as S } from "../../utils/plaidLink.js";
14
15
  import { useMemo as C, useState as w } from "react";
15
- import { CalendarClock as T, FileUp as E, Landmark as re, Link2 as ie, RefreshCw as ae, Repeat as oe, ShieldCheck as se, Trash2 as ce } from "lucide-react";
16
- import { Fragment as le, jsx as D, jsxs as O } from "react/jsx-runtime";
17
- import { PagePurpose as ue } from "@burdenoff/fe-libs/ui";
16
+ import { CalendarClock as T, FileUp as E, Landmark as D, Link2 as ne, RefreshCw as re, Repeat as O, ShieldCheck as k, Trash2 as ie } from "lucide-react";
17
+ import { Fragment as ae, jsx as A, jsxs as j } from "react/jsx-runtime";
18
+ import { PagePurpose as oe } from "@burdenoff/fe-libs/ui";
18
19
  //#region src/subscriberbot/pages/banking/BankConnectionsPage.tsx
19
- var k = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", A = "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50", j = "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50", M = "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50", de = [
20
+ var M = "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)]", N = "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50", P = "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50", F = "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50", se = [
20
21
  "DETECTED",
21
22
  "TRACKED",
22
23
  "DISMISSED"
23
- ], N = {
24
+ ], I = {
24
25
  DETECTED: {
25
26
  key: "banking.charges.detected",
26
27
  fallback: "To review"
@@ -33,24 +34,24 @@ var k = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
33
34
  key: "banking.charges.dismissed",
34
35
  fallback: "Dismissed"
35
36
  }
36
- }, P = 2e6, F = (e) => e instanceof Error ? e.message : "Something went wrong";
37
- function I() {
38
- let l = ee(), { navigateTo: ne } = e(), [k, P] = w("DETECTED"), [I, L] = w(!1), [R, z] = w(null), [B, V] = w(!1), pe = p(), H = m(), U = _(k), W = _("DETECTED"), G = _("TRACKED"), me = te(), he = h(), K = b(), q = v(), J = x(), Y = g(), ge = y(), X = pe.data?.find((e) => e.aggregator === "PLAID"), Z = H.data?.items ?? [], _e = U.data?.items ?? [], ve = C(() => {
37
+ }, L = 2e6, R = (e, t) => e instanceof Error ? e.message : t("common.somethingWentWrong", "Something went wrong");
38
+ function z() {
39
+ let { formatCurrency: s, formatDate: d, formatIntervalSuffix: _ } = n(), M = t(), { navigateTo: L } = e(), [z, B] = w("DETECTED"), [le, V] = w(!1), [H, U] = w(null), [W, G] = w(!1), ue = f(), K = p(), q = v(z), J = v("DETECTED"), de = v("TRACKED"), fe = h(), pe = m(), me = b(), he = y(), ge = x(), Y = g(), _e = te(), X = ue.data?.find((e) => e.aggregator === "PLAID"), Z = K.data?.items ?? [], ve = q.data?.items ?? [], ye = C(() => {
39
40
  let e = /* @__PURE__ */ new Map();
40
- for (let t of W.data?.items ?? []) e.set(t.currency, (e.get(t.currency) ?? 0) + t.annualCost);
41
- return [...e.entries()].map(([e, t]) => i(t, e)).join(" + ");
42
- }, [W.data]), Q = (e) => l("banking.notice.synced", "{{added}} new transaction(s) from {{institution}}; {{recurring}} recurring charge(s) found.", {
41
+ for (let t of J.data?.items ?? []) e.set(t.currency, (e.get(t.currency) ?? 0) + t.annualCost);
42
+ return [...e.entries()].map(([e, t]) => s(t, e)).join(" + ");
43
+ }, [J.data, s]), Q = (e) => M("banking.notice.synced", "{{added}} new transaction(s) from {{institution}}; {{recurring}} recurring charge(s) found.", {
43
44
  added: e.added,
44
45
  institution: e.connection.institutionName,
45
46
  recurring: e.recurringDetected
46
- }), ye = async () => {
47
- z(null), V(!0);
47
+ }), be = async () => {
48
+ U(null), G(!0);
48
49
  try {
49
- let e = await S((await me.mutateAsync({ aggregator: "PLAID" })).linkToken);
50
+ let e = await S((await fe.mutateAsync({ aggregator: "PLAID" })).linkToken, M);
50
51
  if (!e) return;
51
- z({
52
+ U({
52
53
  tone: "success",
53
- text: Q(await he.mutateAsync({ input: {
54
+ text: Q(await pe.mutateAsync({ input: {
54
55
  aggregator: "PLAID",
55
56
  publicToken: e.publicToken,
56
57
  institutionId: e.institutionId,
@@ -58,218 +59,222 @@ function I() {
58
59
  } }))
59
60
  });
60
61
  } catch (e) {
61
- z({
62
+ U({
62
63
  tone: "error",
63
- text: F(e)
64
+ text: R(e, M)
64
65
  });
65
66
  } finally {
66
- V(!1);
67
+ G(!1);
67
68
  }
68
- }, be = async (e) => {
69
- z(null);
69
+ }, xe = async (e) => {
70
+ U(null);
70
71
  try {
71
- z({
72
+ U({
72
73
  tone: "success",
73
- text: Q(await K.mutateAsync({ id: e.id }))
74
+ text: Q(await me.mutateAsync({ id: e.id }))
74
75
  });
75
76
  } catch (e) {
76
- z({
77
+ U({
77
78
  tone: "error",
78
- text: F(e)
79
+ text: R(e, M)
79
80
  });
80
81
  }
81
- }, xe = async (e) => {
82
- if (window.confirm(l("banking.disconnect.confirm", "Disconnect {{institution}}? Its accounts and transactions are deleted from Subscriber Bot. Subscriptions you already track stay.", { institution: e.institutionName }))) {
83
- z(null);
82
+ }, Se = async (e) => {
83
+ if (window.confirm(M("banking.disconnect.confirm", "Disconnect {{institution}}? Its accounts and transactions are deleted from Subscriber Bot. Subscriptions you already track stay.", { institution: e.institutionName }))) {
84
+ U(null);
84
85
  try {
85
- await q.mutateAsync({ id: e.id }), z({
86
+ await he.mutateAsync({ id: e.id }), U({
86
87
  tone: "success",
87
- text: l("banking.notice.disconnected", "{{institution}} was disconnected.", { institution: e.institutionName })
88
+ text: M("banking.notice.disconnected", "{{institution}} was disconnected.", { institution: e.institutionName })
88
89
  });
89
90
  } catch (e) {
90
- z({
91
+ U({
91
92
  tone: "error",
92
- text: F(e)
93
+ text: R(e, M)
93
94
  });
94
95
  }
95
96
  }
96
97
  }, $ = async (e, t) => {
97
- z(null);
98
+ U(null);
98
99
  try {
99
100
  let n = await {
100
- track: J,
101
+ track: ge,
101
102
  dismiss: Y,
102
- restore: ge
103
+ restore: _e
103
104
  }[e].mutateAsync({ id: t.id });
104
- e === "track" && z({
105
+ e === "track" && U({
105
106
  tone: "success",
106
- text: l("banking.notice.tracked", "{{name}} is now tracked as a subscription.", { name: n.displayName })
107
+ text: M("banking.notice.tracked", "{{name}} is now tracked as a subscription.", { name: n.displayName })
107
108
  });
108
109
  } catch (e) {
109
- z({
110
+ U({
110
111
  tone: "error",
111
- text: F(e)
112
+ text: R(e, M)
112
113
  });
113
114
  }
114
- }, Se = /* @__PURE__ */ O("div", {
115
+ }, Ce = /* @__PURE__ */ j("div", {
115
116
  className: "flex flex-wrap gap-2",
116
- children: [/* @__PURE__ */ O("button", {
117
+ "data-tour": "subscriberbot-banking-connect",
118
+ children: [/* @__PURE__ */ j("button", {
117
119
  type: "button",
118
- className: j,
119
- onClick: () => L(!0),
120
+ className: P,
121
+ onClick: () => V(!0),
120
122
  children: [
121
- /* @__PURE__ */ D(E, {
123
+ /* @__PURE__ */ A(E, {
122
124
  className: "h-4 w-4",
123
125
  "aria-hidden": !0
124
126
  }),
125
127
  " ",
126
- l("banking.import.open", "Import a statement")
128
+ M("banking.import.open", "Import a statement")
127
129
  ]
128
- }), /* @__PURE__ */ O("button", {
130
+ }), /* @__PURE__ */ j("button", {
129
131
  type: "button",
130
- className: A,
131
- onClick: () => void ye(),
132
- disabled: !X?.available || B,
133
- title: X?.available ? void 0 : l("banking.plaid.unavailable", "Bank linking is not switched on yet. Import a statement instead."),
134
- children: [/* @__PURE__ */ D(ie, {
132
+ className: N,
133
+ onClick: () => void be(),
134
+ disabled: !X?.available || W,
135
+ title: X?.available ? void 0 : M("banking.plaid.unavailable", "Bank linking is not switched on yet. Import a statement instead."),
136
+ children: [/* @__PURE__ */ A(ne, {
135
137
  className: "h-4 w-4",
136
138
  "aria-hidden": !0
137
- }), B ? l("banking.plaid.linking", "Connecting…") : l("banking.plaid.connect", "Connect a bank")]
139
+ }), W ? M("banking.plaid.linking", "Connecting…") : M("banking.plaid.connect", "Connect a bank")]
138
140
  })]
139
141
  });
140
- return /* @__PURE__ */ O(n, {
141
- title: l("banking.title", "Bank & card connections"),
142
- description: l("banking.description", "Find every subscription in your bank and card transactions."),
143
- actions: Se,
142
+ return /* @__PURE__ */ j(ee, {
143
+ dataTour: "subscriberbot-banking",
144
+ title: M("banking.title", "Bank & card connections"),
145
+ description: M("banking.description", "Find every subscription in your bank and card transactions."),
146
+ actions: Ce,
144
147
  children: [
145
- /* @__PURE__ */ D(ue, {
148
+ /* @__PURE__ */ A(oe, {
146
149
  className: "mb-6",
147
- children: l("banking.purpose", "Connect a US bank or card through Plaid, or import the CSV export any bank lets you download. Subscriber Bot spots the charges that repeat every week, month, quarter or year so you can track them or wave them off. Your bank password is never shared with Subscriber Bot, and only you can see these accounts.")
150
+ children: M("banking.purpose", "Connect a US bank or card through Plaid, or import the CSV export any bank lets you download. Subscriber Bot spots the charges that repeat every week, month, quarter or year so you can track them or wave them off. Your bank password is never shared with Subscriber Bot, and only you can see these accounts.")
148
151
  }),
149
- X && !X.available && /* @__PURE__ */ O("p", {
152
+ X && !X.available && /* @__PURE__ */ j("p", {
150
153
  className: "mb-4 flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
151
154
  "data-testid": "plaid-unavailable",
152
- children: [/* @__PURE__ */ D(se, {
155
+ children: [/* @__PURE__ */ A(k, {
153
156
  className: "mt-0.5 h-4 w-4 shrink-0",
154
157
  "aria-hidden": !0
155
- }), l("banking.plaid.unavailableLong", "Direct bank linking is being switched on. Until then, import a statement export: it finds the same recurring charges.")]
158
+ }), M("banking.plaid.unavailableLong", "Direct bank linking is being switched on. Until then, import a statement export: it finds the same recurring charges.")]
156
159
  }),
157
- R && /* @__PURE__ */ D("p", {
158
- role: R.tone === "error" ? "alert" : "status",
159
- className: t("mb-4 rounded-lg px-3 py-2 text-sm", R.tone === "error" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text"),
160
+ H && /* @__PURE__ */ A("p", {
161
+ role: H.tone === "error" ? "alert" : "status",
162
+ className: r("mb-4 rounded-lg px-3 py-2 text-sm", H.tone === "error" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text"),
160
163
  "data-testid": "banking-notice",
161
- children: R.text
164
+ children: H.text
162
165
  }),
163
- /* @__PURE__ */ O("div", {
166
+ /* @__PURE__ */ j("div", {
164
167
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
168
+ "data-tour": "subscriberbot-banking-metrics",
165
169
  children: [
166
- /* @__PURE__ */ D(r, {
167
- icon: /* @__PURE__ */ D(re, { className: "h-5 w-5" }),
168
- value: H.isLoading ? "—" : Z.length,
169
- label: l("banking.metrics.connections", "Connected accounts")
170
+ /* @__PURE__ */ A(i, {
171
+ icon: /* @__PURE__ */ A(D, { className: "h-5 w-5" }),
172
+ value: K.isLoading ? "—" : Z.length,
173
+ label: M("banking.metrics.connections", "Connected accounts")
170
174
  }),
171
- /* @__PURE__ */ D(r, {
172
- icon: /* @__PURE__ */ D(oe, { className: "h-5 w-5" }),
173
- value: W.isLoading ? "—" : W.data?.items.length ?? 0,
174
- label: l("banking.metrics.detected", "Charges to review")
175
+ /* @__PURE__ */ A(i, {
176
+ icon: /* @__PURE__ */ A(O, { className: "h-5 w-5" }),
177
+ value: J.isLoading ? "—" : J.data?.items.length ?? 0,
178
+ label: M("banking.metrics.detected", "Charges to review")
175
179
  }),
176
- /* @__PURE__ */ D(r, {
177
- icon: /* @__PURE__ */ D(T, { className: "h-5 w-5" }),
178
- value: W.isLoading ? "—" : ve || i(0, "USD"),
179
- label: l("banking.metrics.yearly", "Yearly cost to review")
180
+ /* @__PURE__ */ A(i, {
181
+ icon: /* @__PURE__ */ A(T, { className: "h-5 w-5" }),
182
+ value: J.isLoading ? "—" : ye || s(0, "USD"),
183
+ label: M("banking.metrics.yearly", "Yearly cost to review")
180
184
  }),
181
- /* @__PURE__ */ D(r, {
182
- icon: /* @__PURE__ */ D(se, { className: "h-5 w-5" }),
183
- value: G.isLoading ? "—" : G.data?.items.length ?? 0,
184
- label: l("banking.metrics.tracked", "Tracked from your bank")
185
+ /* @__PURE__ */ A(i, {
186
+ icon: /* @__PURE__ */ A(k, { className: "h-5 w-5" }),
187
+ value: de.isLoading ? "—" : de.data?.items.length ?? 0,
188
+ label: M("banking.metrics.tracked", "Tracked from your bank")
185
189
  })
186
190
  ]
187
191
  }),
188
- /* @__PURE__ */ O(f, {
189
- title: l("banking.charges.title", "Recurring charges found"),
190
- description: l("banking.charges.description", "Charges from the same merchant at a steady amount and rhythm."),
191
- children: [/* @__PURE__ */ D("div", {
192
+ /* @__PURE__ */ j(u, {
193
+ dataTour: "subscriberbot-banking-charges",
194
+ title: M("banking.charges.title", "Recurring charges found"),
195
+ description: M("banking.charges.description", "Charges from the same merchant at a steady amount and rhythm."),
196
+ children: [/* @__PURE__ */ A("div", {
192
197
  role: "tablist",
193
- "aria-label": l("banking.charges.filter", "Charge status"),
198
+ "aria-label": M("banking.charges.filter", "Charge status"),
194
199
  className: "mb-3 flex gap-1.5",
195
- children: de.map((e) => /* @__PURE__ */ D("button", {
200
+ children: se.map((e) => /* @__PURE__ */ A("button", {
196
201
  type: "button",
197
202
  role: "tab",
198
- "aria-selected": k === e,
199
- onClick: () => P(e),
200
- className: t("rounded-lg px-3 py-1.5 text-xs font-medium", k === e ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle text-text-primary hover:bg-bg-sunken"),
201
- children: l(N[e].key, N[e].fallback)
203
+ "aria-selected": z === e,
204
+ onClick: () => B(e),
205
+ className: r("rounded-lg px-3 py-1.5 text-xs font-medium", z === e ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle text-text-primary hover:bg-bg-sunken"),
206
+ children: M(I[e].key, I[e].fallback)
202
207
  }, e))
203
- }), U.isLoading ? /* @__PURE__ */ D(d, { label: l("banking.charges.loading", "Loading recurring charges…") }) : U.isError ? /* @__PURE__ */ D(u, {
204
- message: F(U.error),
205
- onRetry: () => void U.refetch()
206
- }) : _e.length === 0 ? /* @__PURE__ */ D(c, {
208
+ }), q.isLoading ? /* @__PURE__ */ A(l, { label: M("banking.charges.loading", "Loading recurring charges…") }) : q.isError ? /* @__PURE__ */ A(c, {
209
+ message: R(q.error, M),
210
+ onRetry: () => void q.refetch()
211
+ }) : ve.length === 0 ? /* @__PURE__ */ A(o, {
207
212
  illustration: "empty-data",
208
- title: l("banking.charges.empty.title", "Nothing here yet"),
209
- description: l("banking.charges.empty.description", "Import a statement with at least two months of transactions, or connect a bank, and repeating charges show up here.")
210
- }) : /* @__PURE__ */ D("ul", {
213
+ title: M("banking.charges.empty.title", "Nothing here yet"),
214
+ description: M("banking.charges.empty.description", "Import a statement with at least two months of transactions, or connect a bank, and repeating charges show up here.")
215
+ }) : /* @__PURE__ */ A("ul", {
211
216
  className: "grid grid-cols-1 gap-3 lg:grid-cols-2",
212
217
  "data-testid": "recurring-charge-list",
213
- children: _e.map((e) => /* @__PURE__ */ O("li", {
218
+ children: ve.map((e) => /* @__PURE__ */ j("li", {
214
219
  className: "rounded-xl border border-border-subtle bg-bg-surface p-4",
215
220
  "data-testid": "recurring-charge",
216
221
  children: [
217
- /* @__PURE__ */ O("div", {
222
+ /* @__PURE__ */ j("div", {
218
223
  className: "flex items-start justify-between gap-3",
219
- children: [/* @__PURE__ */ O("div", {
224
+ children: [/* @__PURE__ */ j("div", {
220
225
  className: "min-w-0",
221
- children: [/* @__PURE__ */ D("p", {
226
+ children: [/* @__PURE__ */ A("p", {
222
227
  className: "truncate text-sm font-semibold text-text-primary",
223
228
  children: e.displayName
224
- }), /* @__PURE__ */ D("p", {
229
+ }), /* @__PURE__ */ A("p", {
225
230
  className: "mt-0.5 text-xs text-text-secondary",
226
- children: l("banking.charges.meta", "{{count}} charges since {{first}} · {{confidence}}% sure", {
231
+ children: M("banking.charges.meta", "{{count}} charges since {{first}} · {{confidence}}% sure", {
227
232
  count: e.occurrences,
228
- first: a(e.firstChargedOn),
233
+ first: d(e.firstChargedOn),
229
234
  confidence: e.confidence
230
235
  })
231
236
  })]
232
- }), /* @__PURE__ */ O("span", {
237
+ }), /* @__PURE__ */ j("span", {
233
238
  className: "shrink-0 text-sm font-semibold text-text-primary",
234
- children: [i(e.lastAmount, e.currency), o(e.interval)]
239
+ children: [s(e.lastAmount, e.currency), _(e.interval)]
235
240
  })]
236
241
  }),
237
- /* @__PURE__ */ O("p", {
242
+ /* @__PURE__ */ j("p", {
238
243
  className: "mt-2 text-xs text-text-secondary",
239
244
  children: [
240
- l("banking.charges.dates", "Last charged {{last}}", { last: a(e.lastChargedOn) }),
241
- e.nextExpectedOn && ` · ${l("banking.charges.next", "next expected {{next}}", { next: a(e.nextExpectedOn) })}`,
242
- ` · ${l("banking.charges.yearly", "{{amount}} a year", { amount: i(e.annualCost, e.currency) })}`
245
+ M("banking.charges.dates", "Last charged {{last}}", { last: d(e.lastChargedOn) }),
246
+ e.nextExpectedOn && ` · ${M("banking.charges.next", "next expected {{next}}", { next: d(e.nextExpectedOn) })}`,
247
+ ` · ${M("banking.charges.yearly", "{{amount}} a year", { amount: s(e.annualCost, e.currency) })}`
243
248
  ]
244
249
  }),
245
- /* @__PURE__ */ O("div", {
250
+ /* @__PURE__ */ j("div", {
246
251
  className: "mt-3 flex flex-wrap gap-2",
247
252
  children: [
248
- e.status === "DETECTED" && /* @__PURE__ */ O(le, { children: [/* @__PURE__ */ D("button", {
253
+ e.status === "DETECTED" && /* @__PURE__ */ j(ae, { children: [/* @__PURE__ */ A("button", {
249
254
  type: "button",
250
- className: A,
255
+ className: N,
251
256
  onClick: () => void $("track", e),
252
- disabled: J.isPending,
253
- children: l("banking.charges.track", "Track as subscription")
254
- }), /* @__PURE__ */ D("button", {
257
+ disabled: ge.isPending,
258
+ children: M("banking.charges.track", "Track as subscription")
259
+ }), /* @__PURE__ */ A("button", {
255
260
  type: "button",
256
- className: j,
261
+ className: P,
257
262
  onClick: () => void $("dismiss", e),
258
263
  disabled: Y.isPending,
259
- children: l("banking.charges.dismiss", "Not a subscription")
264
+ children: M("banking.charges.dismiss", "Not a subscription")
260
265
  })] }),
261
- e.status === "TRACKED" && e.relationshipId && /* @__PURE__ */ D("button", {
266
+ e.status === "TRACKED" && e.relationshipId && /* @__PURE__ */ A("button", {
262
267
  type: "button",
263
- className: j,
264
- onClick: () => ne(`/relationships/${e.relationshipId}`),
265
- children: l("banking.charges.view", "View subscription")
268
+ className: P,
269
+ onClick: () => L(`/relationships/${e.relationshipId}`),
270
+ children: M("banking.charges.view", "View subscription")
266
271
  }),
267
- e.status === "DISMISSED" && /* @__PURE__ */ D("button", {
272
+ e.status === "DISMISSED" && /* @__PURE__ */ A("button", {
268
273
  type: "button",
269
- className: j,
274
+ className: P,
270
275
  onClick: () => void $("restore", e),
271
- disabled: ge.isPending,
272
- children: l("banking.charges.restore", "Review again")
276
+ disabled: _e.isPending,
277
+ children: M("banking.charges.restore", "Review again")
273
278
  })
274
279
  ]
275
280
  })
@@ -277,99 +282,100 @@ function I() {
277
282
  }, e.id))
278
283
  })]
279
284
  }),
280
- /* @__PURE__ */ D(f, {
281
- title: l("banking.connections.title", "Your connections"),
282
- description: l("banking.connections.description", "Disconnecting deletes the accounts and transactions from Subscriber Bot."),
283
- children: H.isLoading ? /* @__PURE__ */ D(d, { label: l("banking.connections.loading", "Loading connections…") }) : H.isError ? /* @__PURE__ */ D(u, {
284
- message: F(H.error),
285
- onRetry: () => void H.refetch()
286
- }) : Z.length === 0 ? /* @__PURE__ */ D(c, {
285
+ /* @__PURE__ */ A(u, {
286
+ dataTour: "subscriberbot-banking-connections",
287
+ title: M("banking.connections.title", "Your connections"),
288
+ description: M("banking.connections.description", "Disconnecting deletes the accounts and transactions from Subscriber Bot."),
289
+ children: K.isLoading ? /* @__PURE__ */ A(l, { label: M("banking.connections.loading", "Loading connections…") }) : K.isError ? /* @__PURE__ */ A(c, {
290
+ message: R(K.error, M),
291
+ onRetry: () => void K.refetch()
292
+ }) : Z.length === 0 ? /* @__PURE__ */ A(o, {
287
293
  illustration: "empty-data",
288
- title: l("banking.connections.empty.title", "No bank or card connected"),
289
- description: l("banking.connections.empty.description", "Download a CSV of your transactions from your bank or card website and import it, or connect a bank."),
290
- action: /* @__PURE__ */ O("button", {
294
+ title: M("banking.connections.empty.title", "No bank or card connected"),
295
+ description: M("banking.connections.empty.description", "Download a CSV of your transactions from your bank or card website and import it, or connect a bank."),
296
+ action: /* @__PURE__ */ j("button", {
291
297
  type: "button",
292
- className: A,
293
- onClick: () => L(!0),
298
+ className: N,
299
+ onClick: () => V(!0),
294
300
  children: [
295
- /* @__PURE__ */ D(E, {
301
+ /* @__PURE__ */ A(E, {
296
302
  className: "h-4 w-4",
297
303
  "aria-hidden": !0
298
304
  }),
299
305
  " ",
300
- l("banking.import.open", "Import a statement")
306
+ M("banking.import.open", "Import a statement")
301
307
  ]
302
308
  })
303
- }) : /* @__PURE__ */ D("ul", {
309
+ }) : /* @__PURE__ */ A("ul", {
304
310
  className: "space-y-3",
305
311
  "data-testid": "bank-connection-list",
306
- children: Z.map((e) => /* @__PURE__ */ O("li", {
312
+ children: Z.map((e) => /* @__PURE__ */ j("li", {
307
313
  className: "flex flex-col gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
308
314
  "data-testid": "bank-connection",
309
- children: [/* @__PURE__ */ O("div", {
315
+ children: [/* @__PURE__ */ j("div", {
310
316
  className: "min-w-0",
311
317
  children: [
312
- /* @__PURE__ */ O("div", {
318
+ /* @__PURE__ */ j("div", {
313
319
  className: "flex items-center gap-2",
314
- children: [/* @__PURE__ */ D("p", {
320
+ children: [/* @__PURE__ */ A("p", {
315
321
  className: "truncate text-sm font-semibold text-text-primary",
316
322
  children: e.institutionName
317
- }), /* @__PURE__ */ D(s, { status: e.status })]
323
+ }), /* @__PURE__ */ A(a, { status: e.status })]
318
324
  }),
319
- /* @__PURE__ */ O("p", {
325
+ /* @__PURE__ */ j("p", {
320
326
  className: "mt-0.5 text-xs text-text-secondary",
321
327
  children: [
322
- e.aggregator === "PLAID" ? l("banking.connections.viaPlaid", "Linked with Plaid") : l("banking.connections.viaImport", "Statement import"),
328
+ e.aggregator === "PLAID" ? M("banking.connections.viaPlaid", "Linked with Plaid") : M("banking.connections.viaImport", "Statement import"),
323
329
  " · ",
324
- e.accounts.map((e) => e.mask ? `${e.name} ••${e.mask}` : e.name).join(", ") || l("banking.connections.noAccounts", "no accounts yet"),
330
+ e.accounts.map((e) => e.mask ? `${e.name} ••${e.mask}` : e.name).join(", ") || M("banking.connections.noAccounts", "no accounts yet"),
325
331
  " · ",
326
- l("banking.connections.count", "{{count}} transactions", { count: e.transactionCount }),
327
- e.lastSyncedAt && ` · ${l("banking.connections.synced", "updated {{date}}", { date: a(e.lastSyncedAt) })}`
332
+ M("banking.connections.count", "{{count}} transactions", { count: e.transactionCount }),
333
+ e.lastSyncedAt && ` · ${M("banking.connections.synced", "updated {{date}}", { date: d(e.lastSyncedAt) })}`
328
334
  ]
329
335
  }),
330
- e.lastSyncError && /* @__PURE__ */ D("p", {
336
+ e.lastSyncError && /* @__PURE__ */ A("p", {
331
337
  className: "mt-1 text-xs text-status-error-text",
332
338
  children: e.lastSyncError
333
339
  })
334
340
  ]
335
- }), /* @__PURE__ */ O("div", {
341
+ }), /* @__PURE__ */ j("div", {
336
342
  className: "flex shrink-0 gap-2",
337
- children: [e.aggregator === "PLAID" && /* @__PURE__ */ O("button", {
343
+ children: [e.aggregator === "PLAID" && /* @__PURE__ */ j("button", {
338
344
  type: "button",
339
- className: M,
340
- onClick: () => void be(e),
341
- disabled: K.isPending || !X?.available,
345
+ className: F,
346
+ onClick: () => void xe(e),
347
+ disabled: me.isPending || !X?.available,
342
348
  children: [
343
- /* @__PURE__ */ D(ae, {
349
+ /* @__PURE__ */ A(re, {
344
350
  className: "h-3.5 w-3.5",
345
351
  "aria-hidden": !0
346
352
  }),
347
353
  " ",
348
- l("banking.connections.sync", "Sync")
354
+ M("banking.connections.sync", "Sync")
349
355
  ]
350
- }), /* @__PURE__ */ O("button", {
356
+ }), /* @__PURE__ */ j("button", {
351
357
  type: "button",
352
- className: M,
353
- onClick: () => void xe(e),
354
- disabled: q.isPending,
358
+ className: F,
359
+ onClick: () => void Se(e),
360
+ disabled: he.isPending,
355
361
  children: [
356
- /* @__PURE__ */ D(ce, {
362
+ /* @__PURE__ */ A(ie, {
357
363
  className: "h-3.5 w-3.5",
358
364
  "aria-hidden": !0
359
365
  }),
360
366
  " ",
361
- l("banking.connections.disconnect", "Disconnect")
367
+ M("banking.connections.disconnect", "Disconnect")
362
368
  ]
363
369
  })]
364
370
  })]
365
371
  }, e.id))
366
372
  })
367
373
  }),
368
- I && /* @__PURE__ */ D(fe, {
374
+ le && /* @__PURE__ */ A(ce, {
369
375
  connections: Z.filter((e) => e.aggregator === "STATEMENT_IMPORT"),
370
- onClose: () => L(!1),
376
+ onClose: () => V(!1),
371
377
  onImported: (e) => {
372
- L(!1), P("DETECTED"), z({
378
+ V(!1), B("DETECTED"), U({
373
379
  tone: "success",
374
380
  text: Q(e)
375
381
  });
@@ -378,135 +384,135 @@ function I() {
378
384
  ]
379
385
  });
380
386
  }
381
- function fe({ connections: e, onClose: n, onImported: r }) {
382
- let i = ee(), a = ne(), [o, s] = w(""), [c, u] = w(""), [d, f] = w(""), [p, m] = w(""), [h, te] = w("USD"), [g, _] = w("OUTFLOW_NEGATIVE"), [v, y] = w("MDY"), [b, x] = w(""), [S, C] = w(null), T = async (e) => {
383
- if (C(null), x(""), e) {
384
- if (e.size > P) {
385
- C(i("banking.import.tooLarge", "That file is larger than 2 MB. Export a shorter date range."));
387
+ function ce({ connections: e, onClose: n, onImported: ee }) {
388
+ let i = t(), a = _(), [o, c] = w(""), [l, u] = w(""), [f, p] = w(""), [m, h] = w(""), [g, v] = w("USD"), [y, te] = w("OUTFLOW_NEGATIVE"), [b, x] = w("MDY"), [S, C] = w(""), [T, E, D, ne] = d(), re = async (e) => {
389
+ if (E(null), C(""), e) {
390
+ if (e.size > L) {
391
+ E(i("banking.import.tooLarge", "That file is larger than 2 MB. Export a shorter date range."), "statement-file");
386
392
  return;
387
393
  }
388
- x(await e.text());
394
+ C(await e.text());
389
395
  }
390
- }, E = async (e) => {
391
- if (e.preventDefault(), C(null), !b.trim()) {
392
- C(i("banking.import.required", "Choose a CSV file or paste the statement."));
396
+ }, O = async (e) => {
397
+ if (e.preventDefault(), E(null), !S.trim()) {
398
+ E(i("banking.import.required", "Choose a CSV file or paste the statement."), ["statement-csv", "statement-file"]);
393
399
  return;
394
400
  }
395
401
  try {
396
- r(await a.mutateAsync({ input: {
402
+ ee(await a.mutateAsync({ input: {
397
403
  connectionId: o || null,
398
- institutionName: o ? null : c || null,
399
- accountName: d || null,
400
- accountMask: p || null,
401
- currency: h || "USD",
402
- csv: b,
403
- amountConvention: g,
404
- dateFormat: v
404
+ institutionName: o ? null : l || null,
405
+ accountName: f || null,
406
+ accountMask: m || null,
407
+ currency: g || "USD",
408
+ csv: S,
409
+ amountConvention: y,
410
+ dateFormat: b
405
411
  } }));
406
412
  } catch (e) {
407
- C(F(e));
413
+ E(R(e, i));
408
414
  }
409
415
  };
410
- return /* @__PURE__ */ D(l, {
416
+ return /* @__PURE__ */ A(s, {
411
417
  title: i("banking.import.title", "Import a bank or card statement"),
412
418
  description: i("banking.import.description", "Download your transactions as CSV from your bank or card website (two months or more works best)."),
413
419
  onClose: n,
414
420
  maxWidthClassName: "max-w-xl",
415
- children: /* @__PURE__ */ O("form", {
416
- onSubmit: (e) => void E(e),
421
+ children: /* @__PURE__ */ j("form", {
422
+ onSubmit: (e) => void O(e),
417
423
  className: "space-y-3",
418
424
  "data-testid": "import-statement-form",
419
425
  children: [
420
- e.length > 0 && /* @__PURE__ */ O("label", {
426
+ e.length > 0 && /* @__PURE__ */ j("label", {
421
427
  className: "block text-sm text-text-primary",
422
- children: [i("banking.import.target", "Add to"), /* @__PURE__ */ O("select", {
423
- className: t(k, "mt-1"),
428
+ children: [i("banking.import.target", "Add to"), /* @__PURE__ */ j("select", {
429
+ className: r(M, "mt-1"),
424
430
  value: o,
425
- onChange: (e) => s(e.target.value),
426
- children: [/* @__PURE__ */ D("option", {
431
+ onChange: (e) => c(e.target.value),
432
+ children: [/* @__PURE__ */ A("option", {
427
433
  value: "",
428
434
  children: i("banking.import.newConnection", "A new connection")
429
- }), e.map((e) => /* @__PURE__ */ D("option", {
435
+ }), e.map((e) => /* @__PURE__ */ A("option", {
430
436
  value: e.id,
431
437
  children: e.institutionName
432
438
  }, e.id))]
433
439
  })]
434
440
  }),
435
- !o && /* @__PURE__ */ O("label", {
441
+ !o && /* @__PURE__ */ j("label", {
436
442
  className: "block text-sm text-text-primary",
437
- children: [i("banking.import.institution", "Bank or card issuer"), /* @__PURE__ */ D("input", {
438
- className: t(k, "mt-1"),
439
- value: c,
443
+ children: [i("banking.import.institution", "Bank or card issuer"), /* @__PURE__ */ A("input", {
444
+ className: r(M, "mt-1"),
445
+ value: l,
440
446
  onChange: (e) => u(e.target.value),
441
447
  placeholder: i("banking.import.institutionPlaceholder", "e.g. Chase"),
442
448
  maxLength: 255
443
449
  })]
444
450
  }),
445
- /* @__PURE__ */ O("div", {
451
+ /* @__PURE__ */ j("div", {
446
452
  className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
447
- children: [/* @__PURE__ */ O("label", {
453
+ children: [/* @__PURE__ */ j("label", {
448
454
  className: "block text-sm text-text-primary sm:col-span-2",
449
- children: [i("banking.import.account", "Account name"), /* @__PURE__ */ D("input", {
450
- className: t(k, "mt-1"),
451
- value: d,
452
- onChange: (e) => f(e.target.value),
455
+ children: [i("banking.import.account", "Account name"), /* @__PURE__ */ A("input", {
456
+ className: r(M, "mt-1"),
457
+ value: f,
458
+ onChange: (e) => p(e.target.value),
453
459
  placeholder: i("banking.import.accountPlaceholder", "e.g. Sapphire card"),
454
460
  maxLength: 255
455
461
  })]
456
- }), /* @__PURE__ */ O("label", {
462
+ }), /* @__PURE__ */ j("label", {
457
463
  className: "block text-sm text-text-primary",
458
- children: [i("banking.import.mask", "Last 4 digits"), /* @__PURE__ */ D("input", {
459
- className: t(k, "mt-1"),
460
- value: p,
461
- onChange: (e) => m(e.target.value.replace(/\D/g, "").slice(-4)),
464
+ children: [i("banking.import.mask", "Last 4 digits"), /* @__PURE__ */ A("input", {
465
+ className: r(M, "mt-1"),
466
+ value: m,
467
+ onChange: (e) => h(e.target.value.replace(/\D/g, "").slice(-4)),
462
468
  inputMode: "numeric",
463
469
  maxLength: 4
464
470
  })]
465
471
  })]
466
472
  }),
467
- /* @__PURE__ */ O("div", {
473
+ /* @__PURE__ */ j("div", {
468
474
  className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
469
475
  children: [
470
- /* @__PURE__ */ O("label", {
476
+ /* @__PURE__ */ j("label", {
471
477
  className: "block text-sm text-text-primary",
472
- children: [i("banking.import.currency", "Currency"), /* @__PURE__ */ D("input", {
473
- className: t(k, "mt-1 uppercase"),
474
- value: h,
475
- onChange: (e) => te(e.target.value.toUpperCase().slice(0, 3)),
478
+ children: [i("banking.import.currency", "Currency"), /* @__PURE__ */ A("input", {
479
+ className: r(M, "mt-1 uppercase"),
480
+ value: g,
481
+ onChange: (e) => v(e.target.value.toUpperCase().slice(0, 3)),
476
482
  maxLength: 3
477
483
  })]
478
484
  }),
479
- /* @__PURE__ */ O("label", {
485
+ /* @__PURE__ */ j("label", {
480
486
  className: "block text-sm text-text-primary",
481
- children: [i("banking.import.convention", "Money out is"), /* @__PURE__ */ O("select", {
482
- className: t(k, "mt-1"),
483
- value: g,
484
- onChange: (e) => _(e.target.value),
485
- children: [/* @__PURE__ */ D("option", {
487
+ children: [i("banking.import.convention", "Money out is"), /* @__PURE__ */ j("select", {
488
+ className: r(M, "mt-1"),
489
+ value: y,
490
+ onChange: (e) => te(e.target.value),
491
+ children: [/* @__PURE__ */ A("option", {
486
492
  value: "OUTFLOW_NEGATIVE",
487
493
  children: i("banking.import.negative", "Negative (bank)")
488
- }), /* @__PURE__ */ D("option", {
494
+ }), /* @__PURE__ */ A("option", {
489
495
  value: "OUTFLOW_POSITIVE",
490
496
  children: i("banking.import.positive", "Positive (card)")
491
497
  })]
492
498
  })]
493
499
  }),
494
- /* @__PURE__ */ O("label", {
500
+ /* @__PURE__ */ j("label", {
495
501
  className: "block text-sm text-text-primary",
496
- children: [i("banking.import.dateFormat", "Date format"), /* @__PURE__ */ O("select", {
497
- className: t(k, "mt-1"),
498
- value: v,
499
- onChange: (e) => y(e.target.value),
502
+ children: [i("banking.import.dateFormat", "Date format"), /* @__PURE__ */ j("select", {
503
+ className: r(M, "mt-1"),
504
+ value: b,
505
+ onChange: (e) => x(e.target.value),
500
506
  children: [
501
- /* @__PURE__ */ D("option", {
507
+ /* @__PURE__ */ A("option", {
502
508
  value: "MDY",
503
509
  children: "MM/DD/YYYY"
504
510
  }),
505
- /* @__PURE__ */ D("option", {
511
+ /* @__PURE__ */ A("option", {
506
512
  value: "DMY",
507
513
  children: "DD/MM/YYYY"
508
514
  }),
509
- /* @__PURE__ */ D("option", {
515
+ /* @__PURE__ */ A("option", {
510
516
  value: "YMD",
511
517
  children: "YYYY-MM-DD"
512
518
  })
@@ -515,41 +521,47 @@ function fe({ connections: e, onClose: n, onImported: r }) {
515
521
  })
516
522
  ]
517
523
  }),
518
- /* @__PURE__ */ O("label", {
524
+ /* @__PURE__ */ j("label", {
519
525
  className: "block text-sm text-text-primary",
520
- children: [i("banking.import.file", "CSV file"), /* @__PURE__ */ D("input", {
526
+ children: [i("banking.import.file", "CSV file"), /* @__PURE__ */ A("input", {
521
527
  type: "file",
522
528
  accept: ".csv,text/csv,text/plain",
523
- className: t(k, "mt-1"),
524
- onChange: (e) => void T(e.target.files?.[0]),
529
+ className: r(M, "mt-1"),
530
+ onChange: (e) => void re(e.target.files?.[0]),
531
+ id: "statement-file",
532
+ ...D("statement-file"),
525
533
  "data-testid": "import-statement-file"
526
534
  })]
527
535
  }),
528
- /* @__PURE__ */ O("label", {
536
+ /* @__PURE__ */ j("label", {
529
537
  className: "block text-sm text-text-primary",
530
- children: [i("banking.import.paste", "Or paste the statement"), /* @__PURE__ */ D("textarea", {
531
- className: t(k, "mt-1 h-32 font-mono text-xs"),
532
- value: b,
533
- onChange: (e) => x(e.target.value),
538
+ children: [i("banking.import.paste", "Or paste the statement"), /* @__PURE__ */ A("textarea", {
539
+ className: r(M, "mt-1 h-32 font-mono text-xs"),
540
+ value: S,
541
+ onChange: (e) => C(e.target.value),
534
542
  placeholder: "Date,Description,Amount\n10/05/2026,NETFLIX.COM,-15.49",
543
+ id: "statement-csv",
544
+ ...D("statement-csv"),
535
545
  "data-testid": "import-statement-csv"
536
546
  })]
537
547
  }),
538
- S && /* @__PURE__ */ D("p", {
548
+ T && /* @__PURE__ */ A("p", {
549
+ id: ne,
550
+ tabIndex: -1,
539
551
  role: "alert",
540
552
  className: "text-sm text-status-error-text",
541
- children: S
553
+ children: T
542
554
  }),
543
- /* @__PURE__ */ O("div", {
555
+ /* @__PURE__ */ j("div", {
544
556
  className: "flex justify-end gap-2 pt-1",
545
- children: [/* @__PURE__ */ D("button", {
557
+ children: [/* @__PURE__ */ A("button", {
546
558
  type: "button",
547
- className: j,
559
+ className: P,
548
560
  onClick: n,
549
561
  children: i("common.cancel", "Cancel")
550
- }), /* @__PURE__ */ D("button", {
562
+ }), /* @__PURE__ */ A("button", {
551
563
  type: "submit",
552
- className: A,
564
+ className: N,
553
565
  disabled: a.isPending,
554
566
  children: a.isPending ? i("banking.import.submitting", "Importing…") : i("banking.import.submit", "Import and find subscriptions")
555
567
  })]
@@ -559,6 +571,6 @@ function fe({ connections: e, onClose: n, onImported: r }) {
559
571
  });
560
572
  }
561
573
  //#endregion
562
- export { I as BankConnectionsPage };
574
+ export { z as BankConnectionsPage };
563
575
 
564
576
  //# sourceMappingURL=BankConnectionsPage.js.map