@burdenoff/microfe-subscriberbot 2026.1103.1 → 2026.1105.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 (200) 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/AgentDetailPage.stories.d.ts.map +1 -1
  5. package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
  6. package/dist/stories/pages/AgentsListPage.stories.d.ts.map +1 -1
  7. package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
  8. package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
  9. package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
  10. package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
  11. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
  12. package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
  13. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  14. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
  15. package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
  16. package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
  17. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
  18. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
  19. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
  20. package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
  21. package/dist/subscriberbot/components/Modal.js +43 -33
  22. package/dist/subscriberbot/components/Modal.js.map +1 -1
  23. package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
  24. package/dist/subscriberbot/components/PostureOptions.js +10 -10
  25. package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
  26. package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
  27. package/dist/subscriberbot/components/StateViews.js +45 -37
  28. package/dist/subscriberbot/components/StateViews.js.map +1 -1
  29. package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
  30. package/dist/subscriberbot/components/StatusBadge.js +6 -6
  31. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  32. package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
  33. package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
  34. package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
  35. package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
  36. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
  37. package/dist/subscriberbot/components/mobile/MobileDashboard.js +127 -127
  38. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
  39. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
  40. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
  41. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
  42. package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -1
  43. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
  44. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
  45. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
  46. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
  47. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
  48. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
  49. package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
  50. package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
  51. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
  52. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
  53. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
  54. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
  55. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
  56. package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
  57. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
  58. package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
  59. package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
  60. package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
  61. package/dist/subscriberbot/components/viz.d.ts +1 -0
  62. package/dist/subscriberbot/components/viz.d.ts.map +1 -1
  63. package/dist/subscriberbot/components/viz.js +100 -101
  64. package/dist/subscriberbot/components/viz.js.map +1 -1
  65. package/dist/subscriberbot/hooks/index.js +1 -1
  66. package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
  67. package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
  68. package/dist/subscriberbot/hooks/useFormError.js +28 -0
  69. package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
  70. package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
  71. package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
  72. package/dist/subscriberbot/hooks/useFormatters.js +13 -0
  73. package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
  74. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  75. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
  76. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  77. package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
  78. package/dist/subscriberbot/hooks/useTr.js +1 -1
  79. package/dist/subscriberbot/hooks/useTr.js.map +1 -1
  80. package/dist/subscriberbot/index.js +1 -1
  81. package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
  82. package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
  83. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
  84. package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
  85. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  86. package/dist/subscriberbot/pages/DashboardPage.js +107 -98
  87. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  88. package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
  89. package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
  90. package/dist/subscriberbot/pages/InboxPage.js +421 -402
  91. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  92. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
  93. package/dist/subscriberbot/pages/InsightsPage.js +130 -121
  94. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  95. package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
  96. package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
  97. package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
  98. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  99. package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
  100. package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
  101. package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
  102. package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
  103. package/dist/subscriberbot/pages/SavingsPage.js +57 -57
  104. package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
  105. package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
  106. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
  107. package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
  108. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  109. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
  110. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
  111. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
  112. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  113. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
  114. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
  115. package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
  116. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  117. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
  118. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
  119. package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
  120. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  121. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
  122. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
  123. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +267 -260
  124. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
  125. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
  126. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
  127. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
  128. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
  129. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
  130. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
  131. package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
  132. package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
  133. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
  134. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
  135. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
  136. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
  137. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
  138. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
  139. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
  140. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
  141. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
  142. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
  143. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
  144. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
  145. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
  146. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
  147. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
  148. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
  149. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
  150. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
  151. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
  152. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
  153. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
  154. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
  155. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
  156. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
  157. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
  158. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
  159. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
  160. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
  161. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
  162. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
  163. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
  164. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  165. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
  166. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
  167. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
  168. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  169. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
  170. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
  171. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
  172. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  173. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
  174. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  175. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
  176. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  177. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
  178. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
  179. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +104 -90
  180. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  181. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
  182. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
  183. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
  184. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  185. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
  186. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
  187. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
  188. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
  189. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
  190. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
  191. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
  192. package/dist/subscriberbot/utils/formatters.d.ts +16 -5
  193. package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
  194. package/dist/subscriberbot/utils/formatters.js +57 -25
  195. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  196. package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
  197. package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
  198. package/dist/subscriberbot/utils/plaidLink.js +21 -21
  199. package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
  200. package/package.json +1 -1
@@ -1,19 +1,20 @@
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, formatEnumLabel 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 u } from "../hooks/useTr.js";
10
- import { ErrorView as d, LoadingView as f, Section as p } from "../components/StateViews.js";
11
- import { CHART_COLORS as m, Donut as h, Legend as g } from "../components/viz.js";
12
- import { useCreateInvoice as _, useCreatePaymentInstrument as v, useInvoices as y, useMarkInvoicePaid as b, usePaymentInstruments as x, useRelationships as S, useRemovePaymentInstrument as C } from "../hooks/useSubscriberBotApi.js";
13
- import { useMemo as w, useState as T } from "react";
14
- import { AlertTriangle as E, CheckCircle2 as D, CreditCard as O, FileText as ee, Plus as k, Receipt as A, Star as j, Trash2 as M } from "lucide-react";
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 i } from "../components/PageLayout.js";
6
+ import { MetricsCard as a } from "../components/MetricsCard.js";
7
+ import { StatusBadge as o } from "../components/StatusBadge.js";
8
+ import { EmptyState as s } from "../components/EmptyState.js";
9
+ import { Modal as c } from "../components/Modal.js";
10
+ import { ErrorView as l, LoadingView as u, Section as d } from "../components/StateViews.js";
11
+ import { CHART_COLORS as f, Donut as p, Legend as m } from "../components/viz.js";
12
+ import { useCreateInvoice as h, useCreatePaymentInstrument as g, useInvoices as _, useMarkInvoicePaid as v, usePaymentInstruments as y, useRelationships as b, useRemovePaymentInstrument as x } from "../hooks/useSubscriberBotApi.js";
13
+ import { useFormError as S } from "../hooks/useFormError.js";
14
+ import { useMemo as C, useState as w } from "react";
15
+ import { AlertTriangle as T, CheckCircle2 as E, CreditCard as D, FileText as O, Plus as k, Receipt as A, Star as j, Trash2 as M } from "lucide-react";
15
16
  import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
16
- import { GlassCard as I, PagePurpose as te } from "@burdenoff/fe-libs/ui";
17
+ import { GlassCard as I, PagePurpose as ee } from "@burdenoff/fe-libs/ui";
17
18
  //#region src/subscriberbot/pages/InvoicesPage.tsx
18
19
  var L = 25, R = "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)]", z = "mb-1 block text-xs font-medium text-text-secondary", B = {
19
20
  ISSUED: "invoices.filters.issued",
@@ -52,46 +53,49 @@ var L = 25, R = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
52
53
  REFUNDED: "var(--color-status-warning-text)"
53
54
  };
54
55
  function G({ onClose: e }) {
55
- let t = u(), n = _(), r = S({ pagination: {
56
+ let n = t(), r = h(), i = b({ pagination: {
56
57
  limit: 100,
57
58
  offset: 0
58
- } }).data?.items ?? [], [i, a] = T(""), [o, s] = T(""), [c, d] = T("ISSUED"), [f, p] = T("USD"), [m, h] = T(""), [g, v] = T(""), [y, b] = T(""), [x, C] = T(""), [w, E] = T(""), [D, O] = T(null);
59
- return /* @__PURE__ */ P(l, {
60
- title: t("invoices.createModal.title", "Create invoice"),
59
+ } }).data?.items ?? [], [a, o] = w(""), [s, l] = w(""), [u, d] = w("ISSUED"), [f, p] = w("USD"), [m, g] = w(""), [_, v] = w(""), [y, x] = w(""), [C, T] = w(""), [E, D] = w(""), [O, k, A, j] = S();
60
+ return /* @__PURE__ */ P(c, {
61
+ title: n("invoices.createModal.title", "Create invoice"),
61
62
  onClose: e,
62
63
  maxWidthClassName: "max-w-xl",
63
64
  children: /* @__PURE__ */ F("form", {
64
- onSubmit: (r) => {
65
- if (r.preventDefault(), O(null), !i) {
66
- O(t("invoices.createModal.relationshipRequired", "Select the relationship this invoice belongs to."));
65
+ onSubmit: (t) => {
66
+ if (t.preventDefault(), k(null), !a) {
67
+ k(n("invoices.createModal.relationshipRequired", "Select the relationship this invoice belongs to."), "inv-relationship");
67
68
  return;
68
69
  }
69
- n.mutate({
70
- relationshipId: i,
71
- status: c,
70
+ r.mutate({
71
+ relationshipId: a,
72
+ status: u,
72
73
  currency: f.trim() || "USD",
73
- ...o.trim() ? { number: o.trim() } : {},
74
+ ...s.trim() ? { number: s.trim() } : {},
74
75
  ...m.trim() ? { subtotal: Number(m) } : {},
75
- ...g.trim() ? { taxAmount: Number(g) } : {},
76
+ ..._.trim() ? { taxAmount: Number(_) } : {},
76
77
  ...y.trim() ? { total: Number(y) } : {},
77
- ...x ? { issueDate: new Date(x).toISOString() } : {},
78
- ...w ? { dueDate: new Date(w).toISOString() } : {}
78
+ ...C ? { issueDate: new Date(C).toISOString() } : {},
79
+ ...E ? { dueDate: new Date(E).toISOString() } : {}
79
80
  }, {
80
81
  onSuccess: () => e(),
81
- onError: (e) => O(e instanceof Error ? e.message : t("invoices.createModal.error", "Could not create invoice."))
82
+ onError: (e) => k(e instanceof Error ? e.message : n("invoices.createModal.error", "Could not create invoice."))
82
83
  });
83
84
  },
84
85
  className: "space-y-4",
85
86
  children: [
86
- D && /* @__PURE__ */ P("div", {
87
+ O && /* @__PURE__ */ P("div", {
88
+ id: j,
89
+ tabIndex: -1,
90
+ role: "alert",
87
91
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
88
- children: D
92
+ children: O
89
93
  }),
90
94
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ F("label", {
91
95
  htmlFor: "inv-relationship",
92
96
  className: z,
93
97
  children: [
94
- t("invoices.createModal.relationshipLabel", "Relationship"),
98
+ n("invoices.createModal.relationshipLabel", "Relationship"),
95
99
  " ",
96
100
  /* @__PURE__ */ P("span", {
97
101
  className: "text-status-error-text",
@@ -99,15 +103,16 @@ function G({ onClose: e }) {
99
103
  })
100
104
  ]
101
105
  }), /* @__PURE__ */ F("select", {
106
+ ...A("inv-relationship"),
102
107
  id: "inv-relationship",
103
- value: i,
104
- onChange: (e) => a(e.target.value),
108
+ value: a,
109
+ onChange: (e) => o(e.target.value),
105
110
  className: R,
106
111
  required: !0,
107
112
  children: [/* @__PURE__ */ P("option", {
108
113
  value: "",
109
- children: t("invoices.createModal.relationshipPlaceholder", "— Select a relationship —")
110
- }), r.map((e) => /* @__PURE__ */ P("option", {
114
+ children: n("invoices.createModal.relationshipPlaceholder", "— Select a relationship —")
115
+ }), i.map((e) => /* @__PURE__ */ P("option", {
111
116
  value: e.id,
112
117
  children: e.label
113
118
  }, e.id))]
@@ -118,34 +123,37 @@ function G({ onClose: e }) {
118
123
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
119
124
  htmlFor: "inv-number",
120
125
  className: z,
121
- children: t("invoices.createModal.numberLabel", "Number")
126
+ children: n("invoices.createModal.numberLabel", "Number")
122
127
  }), /* @__PURE__ */ P("input", {
128
+ ...A("inv-number"),
123
129
  id: "inv-number",
124
130
  type: "text",
125
- value: o,
126
- onChange: (e) => s(e.target.value),
127
- placeholder: t("invoices.createModal.numberPlaceholder", "INV-0001"),
131
+ value: s,
132
+ onChange: (e) => l(e.target.value),
133
+ placeholder: n("invoices.createModal.numberPlaceholder", "INV-0001"),
128
134
  className: R
129
135
  })] }),
130
136
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
131
137
  htmlFor: "inv-status",
132
138
  className: z,
133
- children: t("invoices.createModal.statusLabel", "Status")
139
+ children: n("invoices.createModal.statusLabel", "Status")
134
140
  }), /* @__PURE__ */ P("select", {
141
+ ...A("inv-status"),
135
142
  id: "inv-status",
136
- value: c,
143
+ value: u,
137
144
  onChange: (e) => d(e.target.value),
138
145
  className: R,
139
146
  children: V.map((e) => /* @__PURE__ */ P("option", {
140
147
  value: e,
141
- children: t(B[e], e)
148
+ children: n(B[e], e)
142
149
  }, e))
143
150
  })] }),
144
151
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
145
152
  htmlFor: "inv-currency",
146
153
  className: z,
147
- children: t("invoices.createModal.currencyLabel", "Currency")
154
+ children: n("invoices.createModal.currencyLabel", "Currency")
148
155
  }), /* @__PURE__ */ P("input", {
156
+ ...A("inv-currency"),
149
157
  id: "inv-currency",
150
158
  type: "text",
151
159
  value: f,
@@ -161,40 +169,43 @@ function G({ onClose: e }) {
161
169
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
162
170
  htmlFor: "inv-subtotal",
163
171
  className: z,
164
- children: t("invoices.createModal.subtotalLabel", "Subtotal")
172
+ children: n("invoices.createModal.subtotalLabel", "Subtotal")
165
173
  }), /* @__PURE__ */ P("input", {
174
+ ...A("inv-subtotal"),
166
175
  id: "inv-subtotal",
167
176
  type: "number",
168
177
  min: "0",
169
178
  step: "0.01",
170
179
  value: m,
171
- onChange: (e) => h(e.target.value),
180
+ onChange: (e) => g(e.target.value),
172
181
  className: R
173
182
  })] }),
174
183
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
175
184
  htmlFor: "inv-tax",
176
185
  className: z,
177
- children: t("invoices.createModal.taxLabel", "Tax")
186
+ children: n("invoices.createModal.taxLabel", "Tax")
178
187
  }), /* @__PURE__ */ P("input", {
188
+ ...A("inv-tax"),
179
189
  id: "inv-tax",
180
190
  type: "number",
181
191
  min: "0",
182
192
  step: "0.01",
183
- value: g,
193
+ value: _,
184
194
  onChange: (e) => v(e.target.value),
185
195
  className: R
186
196
  })] }),
187
197
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
188
198
  htmlFor: "inv-total",
189
199
  className: z,
190
- children: t("invoices.createModal.totalLabel", "Total")
200
+ children: n("invoices.createModal.totalLabel", "Total")
191
201
  }), /* @__PURE__ */ P("input", {
202
+ ...A("inv-total"),
192
203
  id: "inv-total",
193
204
  type: "number",
194
205
  min: "0",
195
206
  step: "0.01",
196
207
  value: y,
197
- onChange: (e) => b(e.target.value),
208
+ onChange: (e) => x(e.target.value),
198
209
  className: R
199
210
  })] })
200
211
  ]
@@ -204,22 +215,24 @@ function G({ onClose: e }) {
204
215
  children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
205
216
  htmlFor: "inv-issue",
206
217
  className: z,
207
- children: t("invoices.createModal.issueDateLabel", "Issue date")
218
+ children: n("invoices.createModal.issueDateLabel", "Issue date")
208
219
  }), /* @__PURE__ */ P("input", {
220
+ ...A("inv-issue"),
209
221
  id: "inv-issue",
210
222
  type: "date",
211
- value: x,
212
- onChange: (e) => C(e.target.value),
223
+ value: C,
224
+ onChange: (e) => T(e.target.value),
213
225
  className: R
214
226
  })] }), /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
215
227
  htmlFor: "inv-due",
216
228
  className: z,
217
- children: t("invoices.createModal.dueDateLabel", "Due date")
229
+ children: n("invoices.createModal.dueDateLabel", "Due date")
218
230
  }), /* @__PURE__ */ P("input", {
231
+ ...A("inv-due"),
219
232
  id: "inv-due",
220
233
  type: "date",
221
- value: w,
222
- onChange: (e) => E(e.target.value),
234
+ value: E,
235
+ onChange: (e) => D(e.target.value),
223
236
  className: R
224
237
  })] })]
225
238
  }),
@@ -229,12 +242,12 @@ function G({ onClose: e }) {
229
242
  type: "button",
230
243
  onClick: e,
231
244
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
232
- children: t("invoices.createModal.cancel", "Cancel")
245
+ children: n("invoices.createModal.cancel", "Cancel")
233
246
  }), /* @__PURE__ */ P("button", {
234
247
  type: "submit",
235
- disabled: n.isPending,
248
+ disabled: r.isPending,
236
249
  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",
237
- children: n.isPending ? t("invoices.creating", "Creating…") : t("invoices.createModal.submit", "Create invoice")
250
+ children: r.isPending ? n("invoices.creating", "Creating…") : n("invoices.createModal.submit", "Create invoice")
238
251
  })]
239
252
  })
240
253
  ]
@@ -242,36 +255,39 @@ function G({ onClose: e }) {
242
255
  });
243
256
  }
244
257
  function K({ onClose: e }) {
245
- let t = u(), n = v(), [r, i] = T(""), [a, s] = T("CARD"), [c, d] = T(""), [f, p] = T(""), [m, h] = T(""), [g, _] = T(""), [y, b] = T(!1), [x, S] = T(null);
246
- return /* @__PURE__ */ P(l, {
247
- title: t("invoices.addPaymentMethodModal.title", "Add payment method"),
248
- description: t("invoices.addPaymentMethodModal.description", "A passive annotation of which external card/account pays for a subscription — no full card numbers or CVV."),
258
+ let { formatEnumLabel: r } = n(), i = t(), a = g(), [o, s] = w(""), [l, u] = w("CARD"), [d, f] = w(""), [p, m] = w(""), [h, _] = w(""), [v, y] = w(""), [b, x] = w(!1), [C, T, E, D] = S();
259
+ return /* @__PURE__ */ P(c, {
260
+ title: i("invoices.addPaymentMethodModal.title", "Add payment method"),
261
+ description: i("invoices.addPaymentMethodModal.description", "A passive annotation of which external card/account pays for a subscription — no full card numbers or CVV."),
249
262
  onClose: e,
250
263
  maxWidthClassName: "max-w-xl",
251
264
  children: /* @__PURE__ */ F("form", {
252
- onSubmit: (i) => {
253
- if (i.preventDefault(), S(null), !r.trim()) {
254
- S(t("invoices.addPaymentMethodModal.labelRequired", "A label is required."));
265
+ onSubmit: (t) => {
266
+ if (t.preventDefault(), T(null), !o.trim()) {
267
+ T(i("invoices.addPaymentMethodModal.labelRequired", "A label is required."), "pm-label");
255
268
  return;
256
269
  }
257
- n.mutate({
258
- label: r.trim(),
259
- type: a,
260
- isDefault: y,
261
- ...c.trim() ? { brand: c.trim() } : {},
262
- ...f.trim() ? { last4: f.trim() } : {},
263
- ...m.trim() ? { expiryMonth: Number(m) } : {},
264
- ...g.trim() ? { expiryYear: Number(g) } : {}
270
+ a.mutate({
271
+ label: o.trim(),
272
+ type: l,
273
+ isDefault: b,
274
+ ...d.trim() ? { brand: d.trim() } : {},
275
+ ...p.trim() ? { last4: p.trim() } : {},
276
+ ...h.trim() ? { expiryMonth: Number(h) } : {},
277
+ ...v.trim() ? { expiryYear: Number(v) } : {}
265
278
  }, {
266
279
  onSuccess: () => e(),
267
- onError: (e) => S(e instanceof Error ? e.message : t("invoices.addPaymentMethodModal.error", "Could not add payment method."))
280
+ onError: (e) => T(e instanceof Error ? e.message : i("invoices.addPaymentMethodModal.error", "Could not add payment method."))
268
281
  });
269
282
  },
270
283
  className: "space-y-4",
271
284
  children: [
272
- x && /* @__PURE__ */ P("div", {
285
+ C && /* @__PURE__ */ P("div", {
286
+ id: D,
287
+ tabIndex: -1,
288
+ role: "alert",
273
289
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
274
- children: x
290
+ children: C
275
291
  }),
276
292
  /* @__PURE__ */ F("div", {
277
293
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
@@ -279,7 +295,7 @@ function K({ onClose: e }) {
279
295
  htmlFor: "pm-label",
280
296
  className: z,
281
297
  children: [
282
- t("invoices.addPaymentMethodModal.labelLabel", "Label"),
298
+ i("invoices.addPaymentMethodModal.labelLabel", "Label"),
283
299
  " ",
284
300
  /* @__PURE__ */ P("span", {
285
301
  className: "text-status-error-text",
@@ -287,25 +303,27 @@ function K({ onClose: e }) {
287
303
  })
288
304
  ]
289
305
  }), /* @__PURE__ */ P("input", {
306
+ ...E("pm-label"),
290
307
  id: "pm-label",
291
308
  type: "text",
292
- value: r,
293
- onChange: (e) => i(e.target.value),
294
- placeholder: t("invoices.addPaymentMethodModal.labelPlaceholder", "e.g. Personal Visa"),
309
+ value: o,
310
+ onChange: (e) => s(e.target.value),
311
+ placeholder: i("invoices.addPaymentMethodModal.labelPlaceholder", "e.g. Personal Visa"),
295
312
  className: R,
296
313
  required: !0
297
314
  })] }), /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
298
315
  htmlFor: "pm-type",
299
316
  className: z,
300
- children: t("invoices.addPaymentMethodModal.typeLabel", "Type")
317
+ children: i("invoices.addPaymentMethodModal.typeLabel", "Type")
301
318
  }), /* @__PURE__ */ P("select", {
319
+ ...E("pm-type"),
302
320
  id: "pm-type",
303
- value: a,
304
- onChange: (e) => s(e.target.value),
321
+ value: l,
322
+ onChange: (e) => u(e.target.value),
305
323
  className: R,
306
324
  children: H.map((e) => /* @__PURE__ */ P("option", {
307
325
  value: e,
308
- children: o(e)
326
+ children: r(e)
309
327
  }, e))
310
328
  })] })]
311
329
  }),
@@ -315,27 +333,29 @@ function K({ onClose: e }) {
315
333
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
316
334
  htmlFor: "pm-brand",
317
335
  className: z,
318
- children: t("invoices.addPaymentMethodModal.brandLabel", "Brand")
336
+ children: i("invoices.addPaymentMethodModal.brandLabel", "Brand")
319
337
  }), /* @__PURE__ */ P("input", {
338
+ ...E("pm-brand"),
320
339
  id: "pm-brand",
321
340
  type: "text",
322
- value: c,
323
- onChange: (e) => d(e.target.value),
324
- placeholder: t("invoices.addPaymentMethodModal.brandPlaceholder", "Visa, Amex…"),
341
+ value: d,
342
+ onChange: (e) => f(e.target.value),
343
+ placeholder: i("invoices.addPaymentMethodModal.brandPlaceholder", "Visa, Amex…"),
325
344
  className: R
326
345
  })] }),
327
346
  /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
328
347
  htmlFor: "pm-last4",
329
348
  className: z,
330
- children: t("invoices.addPaymentMethodModal.last4Label", "Last 4")
349
+ children: i("invoices.addPaymentMethodModal.last4Label", "Last 4")
331
350
  }), /* @__PURE__ */ P("input", {
351
+ ...E("pm-last4"),
332
352
  id: "pm-last4",
333
353
  type: "text",
334
354
  inputMode: "numeric",
335
355
  maxLength: 4,
336
- value: f,
337
- onChange: (e) => p(e.target.value.replace(/\D/g, "")),
338
- placeholder: t("invoices.addPaymentMethodModal.last4Placeholder", "4242"),
356
+ value: p,
357
+ onChange: (e) => m(e.target.value.replace(/\D/g, "")),
358
+ placeholder: i("invoices.addPaymentMethodModal.last4Placeholder", "4242"),
339
359
  className: R
340
360
  })] }),
341
361
  /* @__PURE__ */ F("div", {
@@ -343,28 +363,30 @@ function K({ onClose: e }) {
343
363
  children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
344
364
  htmlFor: "pm-exp-month",
345
365
  className: z,
346
- children: t("invoices.addPaymentMethodModal.expMonthLabel", "Exp. mo.")
366
+ children: i("invoices.addPaymentMethodModal.expMonthLabel", "Exp. mo.")
347
367
  }), /* @__PURE__ */ P("input", {
368
+ ...E("pm-exp-month"),
348
369
  id: "pm-exp-month",
349
370
  type: "number",
350
371
  min: "1",
351
372
  max: "12",
352
- value: m,
353
- onChange: (e) => h(e.target.value),
354
- placeholder: t("invoices.addPaymentMethodModal.expMonthPlaceholder", "12"),
373
+ value: h,
374
+ onChange: (e) => _(e.target.value),
375
+ placeholder: i("invoices.addPaymentMethodModal.expMonthPlaceholder", "12"),
355
376
  className: R
356
377
  })] }), /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
357
378
  htmlFor: "pm-exp-year",
358
379
  className: z,
359
- children: t("invoices.addPaymentMethodModal.expYearLabel", "Exp. yr.")
380
+ children: i("invoices.addPaymentMethodModal.expYearLabel", "Exp. yr.")
360
381
  }), /* @__PURE__ */ P("input", {
382
+ ...E("pm-exp-year"),
361
383
  id: "pm-exp-year",
362
384
  type: "number",
363
385
  min: "2024",
364
386
  max: "2099",
365
- value: g,
366
- onChange: (e) => _(e.target.value),
367
- placeholder: t("invoices.addPaymentMethodModal.expYearPlaceholder", "2028"),
387
+ value: v,
388
+ onChange: (e) => y(e.target.value),
389
+ placeholder: i("invoices.addPaymentMethodModal.expYearPlaceholder", "2028"),
368
390
  className: R
369
391
  })] })]
370
392
  })
@@ -374,10 +396,10 @@ function K({ onClose: e }) {
374
396
  className: "flex items-center gap-2 text-sm text-text-primary",
375
397
  children: [/* @__PURE__ */ P("input", {
376
398
  type: "checkbox",
377
- checked: y,
378
- onChange: (e) => b(e.target.checked),
399
+ checked: b,
400
+ onChange: (e) => x(e.target.checked),
379
401
  className: "size-4 rounded border-border-subtle"
380
- }), t("invoices.addPaymentMethodModal.defaultLabel", "Set as default")]
402
+ }), i("invoices.addPaymentMethodModal.defaultLabel", "Set as default")]
381
403
  }),
382
404
  /* @__PURE__ */ F("div", {
383
405
  className: "flex justify-end gap-3",
@@ -385,12 +407,12 @@ function K({ onClose: e }) {
385
407
  type: "button",
386
408
  onClick: e,
387
409
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
388
- children: t("invoices.addPaymentMethodModal.cancel", "Cancel")
410
+ children: i("invoices.addPaymentMethodModal.cancel", "Cancel")
389
411
  }), /* @__PURE__ */ P("button", {
390
412
  type: "submit",
391
- disabled: n.isPending,
413
+ disabled: a.isPending,
392
414
  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",
393
- children: n.isPending ? t("invoices.addPaymentMethodModal.adding", "Adding…") : t("invoices.addPaymentMethodModal.submit", "Add payment method")
415
+ children: a.isPending ? i("invoices.addPaymentMethodModal.adding", "Adding…") : i("invoices.addPaymentMethodModal.submit", "Add payment method")
394
416
  })]
395
417
  })
396
418
  ]
@@ -398,31 +420,31 @@ function K({ onClose: e }) {
398
420
  });
399
421
  }
400
422
  function q() {
401
- let e = u(), { data: t, isLoading: n, isError: r, refetch: i } = x(), a = C(), [l, m] = T(!1), h = t ?? [];
402
- return /* @__PURE__ */ F(p, {
403
- title: e("invoices.paymentMethods.title", "Payment methods"),
404
- description: e("invoices.paymentMethods.description", "Which external cards and accounts pay for your subscriptions"),
423
+ let { formatEnumLabel: e } = n(), r = t(), { data: i, isLoading: a, isError: c, refetch: f } = y(), p = x(), [m, h] = w(!1), g = i ?? [];
424
+ return /* @__PURE__ */ F(d, {
425
+ title: r("invoices.paymentMethods.title", "Payment methods"),
426
+ description: r("invoices.paymentMethods.description", "Which external cards and accounts pay for your subscriptions"),
405
427
  action: /* @__PURE__ */ F("button", {
406
428
  type: "button",
407
- onClick: () => m(!0),
429
+ onClick: () => h(!0),
408
430
  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",
409
431
  children: [
410
432
  /* @__PURE__ */ P(k, { className: "h-3.5 w-3.5" }),
411
433
  " ",
412
- e("invoices.paymentMethods.add", "Add payment method")
434
+ r("invoices.paymentMethods.add", "Add payment method")
413
435
  ]
414
436
  }),
415
- children: [n ? /* @__PURE__ */ P(f, { label: e("invoices.paymentMethods.loading", "Loading payment methods…") }) : r ? /* @__PURE__ */ P(d, {
416
- message: e("invoices.paymentMethods.error", "Could not load payment methods."),
417
- onRetry: () => void i()
418
- }) : h.length === 0 ? /* @__PURE__ */ P(c, {
437
+ children: [a ? /* @__PURE__ */ P(u, { label: r("invoices.paymentMethods.loading", "Loading payment methods…") }) : c ? /* @__PURE__ */ P(l, {
438
+ message: r("invoices.paymentMethods.error", "Could not load payment methods."),
439
+ onRetry: () => void f()
440
+ }) : g.length === 0 ? /* @__PURE__ */ P(s, {
419
441
  illustration: "empty-data",
420
- icon: /* @__PURE__ */ P(O, { className: "h-12 w-12" }),
421
- title: e("invoices.paymentMethods.emptyTitle", "No payment methods"),
422
- description: e("invoices.paymentMethods.emptyDescription", "Annotate which card or account pays for each subscription. No full card numbers are stored.")
442
+ icon: /* @__PURE__ */ P(D, { className: "h-12 w-12" }),
443
+ title: r("invoices.paymentMethods.emptyTitle", "No payment methods"),
444
+ description: r("invoices.paymentMethods.emptyDescription", "Annotate which card or account pays for each subscription. No full card numbers are stored.")
423
445
  }) : /* @__PURE__ */ P("div", {
424
446
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
425
- children: h.map((t) => {
447
+ children: g.map((t) => {
426
448
  let n = [t.expiryMonth && t.expiryYear ? `Exp ${String(t.expiryMonth).padStart(2, "0")}/${String(t.expiryYear).slice(-2)}` : null].filter(Boolean);
427
449
  return /* @__PURE__ */ F(I, {
428
450
  treatment: "metric",
@@ -433,7 +455,7 @@ function q() {
433
455
  className: "flex items-center gap-3",
434
456
  children: [/* @__PURE__ */ P("span", {
435
457
  className: "grid h-9 w-12 place-items-center rounded-md bg-[var(--color-accent-soft)] text-text-primary",
436
- children: /* @__PURE__ */ P(O, {
458
+ children: /* @__PURE__ */ P(D, {
437
459
  className: "h-4 w-4",
438
460
  "aria-hidden": !0
439
461
  })
@@ -446,14 +468,14 @@ function q() {
446
468
  children: [/* @__PURE__ */ P(j, {
447
469
  className: "h-2.5 w-2.5 fill-current",
448
470
  "aria-hidden": !0
449
- }), e("invoices.paymentMethods.default", "Default")]
471
+ }), r("invoices.paymentMethods.default", "Default")]
450
472
  })]
451
473
  }), /* @__PURE__ */ P("p", {
452
474
  className: "font-mono text-sm tracking-[0.15em] text-text-secondary",
453
- children: t.last4 ? `•••• ${t.last4}` : o(t.type)
475
+ children: t.last4 ? `•••• ${t.last4}` : e(t.type)
454
476
  })]
455
477
  })]
456
- }), /* @__PURE__ */ P(s, { status: t.status })]
478
+ }), /* @__PURE__ */ P(o, { status: t.status })]
457
479
  }), /* @__PURE__ */ F("div", {
458
480
  className: "mt-auto flex items-center justify-between border-t border-border-subtle pt-3",
459
481
  children: [/* @__PURE__ */ P("p", {
@@ -461,48 +483,48 @@ function q() {
461
483
  children: [t.label, ...n].filter(Boolean).join(" · ")
462
484
  }), /* @__PURE__ */ F("button", {
463
485
  type: "button",
464
- "aria-label": e("invoices.paymentMethods.removeAria", "Remove {{label}}", { label: t.label }),
465
- disabled: a.isPending,
466
- onClick: () => a.mutate(t.id),
486
+ "aria-label": r("invoices.paymentMethods.removeAria", "Remove {{label}}", { label: t.label }),
487
+ disabled: p.isPending,
488
+ onClick: () => p.mutate(t.id),
467
489
  className: "inline-flex shrink-0 items-center gap-1 rounded-lg border border-border-subtle px-2.5 py-1 text-xs font-medium text-text-secondary hover:border-status-error-text/40 hover:bg-status-error-bg-subtle hover:text-status-error-text disabled:opacity-50",
468
490
  children: [/* @__PURE__ */ P(M, {
469
491
  className: "h-3.5 w-3.5",
470
492
  "aria-hidden": !0
471
- }), e("invoices.paymentMethods.remove", "Remove")]
493
+ }), r("invoices.paymentMethods.remove", "Remove")]
472
494
  })]
473
495
  })]
474
496
  }, t.id);
475
497
  })
476
- }), l && /* @__PURE__ */ P(K, { onClose: () => m(!1) })]
498
+ }), m && /* @__PURE__ */ P(K, { onClose: () => h(!1) })]
477
499
  });
478
500
  }
479
501
  function J() {
480
- let o = u(), { navigateTo: l } = e(), [p, _] = T(0), [v, x] = T(""), [C, O] = T(!1), j = [{
502
+ let { formatCurrency: c, formatDate: d } = n(), h = t(), { navigateTo: g } = e(), [y, x] = w(0), [S, D] = w(""), [j, M] = w(!1), R = [{
481
503
  value: "",
482
- label: o("invoices.filters.allStatuses", "All statuses")
504
+ label: h("invoices.filters.allStatuses", "All statuses")
483
505
  }, ...V.map((e) => ({
484
506
  value: e,
485
- label: o(B[e], e)
486
- }))], { data: M, isLoading: R, isError: z, refetch: H, isFetching: K } = y({
487
- status: v || void 0,
507
+ label: h(B[e], e)
508
+ }))], { data: z, isLoading: H, isError: K, refetch: J, isFetching: te } = _({
509
+ status: S || void 0,
488
510
  pagination: {
489
511
  limit: L,
490
- offset: p * L
512
+ offset: y * L
491
513
  }
492
- }), J = b(), Y = S({ pagination: {
514
+ }), Y = v(), X = b({ pagination: {
493
515
  limit: 100,
494
516
  offset: 0
495
- } }), X = w(() => {
517
+ } }), ne = C(() => {
496
518
  let e = /* @__PURE__ */ new Map();
497
- for (let t of Y.data?.items ?? []) e.set(t.id, t.label);
519
+ for (let t of X.data?.items ?? []) e.set(t.id, t.label);
498
520
  return e;
499
- }, [Y.data]), Z = w(() => M?.items ?? [], [M]), Q = M?.pageInfo.hasMore ?? !1, $ = w(() => {
521
+ }, [X.data]), Z = C(() => z?.items ?? [], [z]), Q = z?.pageInfo.hasMore ?? !1, $ = C(() => {
500
522
  let e = Z.filter((e) => U.has(e.status)), t = Z[0]?.currency ?? "USD", n = /* @__PURE__ */ new Map();
501
523
  for (let e of Z) n.set(e.status, (n.get(e.status) ?? 0) + 1);
502
524
  let r = Array.from(n.entries()).sort((e, t) => t[1] - e[1]).map(([e, t], n) => ({
503
- label: o(B[e], e.charAt(0) + e.slice(1).toLowerCase()),
525
+ label: h(B[e], e.charAt(0) + e.slice(1).toLowerCase()),
504
526
  value: t,
505
- color: W[e] ?? m[n % m.length]
527
+ color: W[e] ?? f[n % f.length]
506
528
  }));
507
529
  return {
508
530
  outstandingCount: e.length,
@@ -512,51 +534,51 @@ function J() {
512
534
  distribution: r,
513
535
  currency: t
514
536
  };
515
- }, [Z, o]);
516
- return /* @__PURE__ */ F(n, {
517
- title: o("invoices.title", "Invoices"),
518
- description: o("invoices.description", "Your billing ledger across every relationship"),
537
+ }, [Z, h]);
538
+ return /* @__PURE__ */ F(i, {
539
+ title: h("invoices.title", "Invoices"),
540
+ description: h("invoices.description", "Your billing ledger across every relationship"),
519
541
  actions: /* @__PURE__ */ F("button", {
520
542
  type: "button",
521
- onClick: () => O(!0),
543
+ onClick: () => M(!0),
522
544
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
523
545
  children: [
524
546
  /* @__PURE__ */ P(k, { className: "h-4 w-4" }),
525
547
  " ",
526
- o("invoices.create", "Create invoice")
548
+ h("invoices.create", "Create invoice")
527
549
  ]
528
550
  }),
529
551
  children: [
530
- /* @__PURE__ */ P(te, {
552
+ /* @__PURE__ */ P(ee, {
531
553
  className: "mb-4",
532
- children: o("invoices.purpose", "Every invoice from your recurring relationships in one ledger. Filter by status and settle issued or overdue invoices directly.")
554
+ children: h("invoices.purpose", "Every invoice from your recurring relationships in one ledger. Filter by status and settle issued or overdue invoices directly.")
533
555
  }),
534
- !R && !z && Z.length > 0 && /* @__PURE__ */ F("div", {
556
+ !H && !K && Z.length > 0 && /* @__PURE__ */ F("div", {
535
557
  className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
536
558
  children: [/* @__PURE__ */ F("div", {
537
559
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:col-span-2",
538
560
  children: [
539
- /* @__PURE__ */ P(r, {
561
+ /* @__PURE__ */ P(a, {
540
562
  featured: !0,
541
563
  icon: /* @__PURE__ */ P(A, {}),
542
- value: i($.outstandingTotal, $.currency, { maximumFractionDigits: 0 }),
543
- label: o("invoices.metrics.outstanding", "Outstanding · this page")
564
+ value: c($.outstandingTotal, $.currency, { maximumFractionDigits: 0 }),
565
+ label: h("invoices.metrics.outstanding", "Outstanding · this page")
544
566
  }),
545
- /* @__PURE__ */ P(r, {
546
- icon: /* @__PURE__ */ P(ee, {}),
567
+ /* @__PURE__ */ P(a, {
568
+ icon: /* @__PURE__ */ P(O, {}),
547
569
  value: $.outstandingCount,
548
- label: o("invoices.metrics.openInvoices", "Open invoices")
570
+ label: h("invoices.metrics.openInvoices", "Open invoices")
549
571
  }),
550
- /* @__PURE__ */ P(r, {
551
- icon: /* @__PURE__ */ P(E, {}),
572
+ /* @__PURE__ */ P(a, {
573
+ icon: /* @__PURE__ */ P(T, {}),
552
574
  value: $.overdueCount,
553
- label: o("invoices.metrics.overdue", "Overdue"),
575
+ label: h("invoices.metrics.overdue", "Overdue"),
554
576
  ...$.overdueCount > 0 ? { trend: "down" } : {}
555
577
  }),
556
- /* @__PURE__ */ P(r, {
557
- icon: /* @__PURE__ */ P(D, {}),
578
+ /* @__PURE__ */ P(a, {
579
+ icon: /* @__PURE__ */ P(E, {}),
558
580
  value: $.paidCount,
559
- label: o("invoices.metrics.paid", "Paid"),
581
+ label: h("invoices.metrics.paid", "Paid"),
560
582
  ...$.paidCount > 0 ? { trend: "up" } : {}
561
583
  })
562
584
  ]
@@ -566,22 +588,22 @@ function J() {
566
588
  children: [
567
589
  /* @__PURE__ */ P("p", {
568
590
  className: "text-sm font-semibold text-text-primary",
569
- children: o("invoices.metrics.statusBreakdown", "Status breakdown")
591
+ children: h("invoices.metrics.statusBreakdown", "Status breakdown")
570
592
  }),
571
593
  /* @__PURE__ */ P("p", {
572
594
  className: "text-xs text-text-secondary",
573
- children: o("invoices.metrics.statusBreakdownHint", "Across the invoices on this page")
595
+ children: h("invoices.metrics.statusBreakdownHint", "Across the invoices on this page")
574
596
  }),
575
597
  /* @__PURE__ */ F("div", {
576
598
  className: "mt-4 flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row",
577
- children: [/* @__PURE__ */ P(h, {
599
+ children: [/* @__PURE__ */ P(p, {
578
600
  data: $.distribution,
579
601
  size: 132,
580
602
  thickness: 16,
581
603
  centerLabel: String(Z.length),
582
- centerSub: o("invoices.metrics.invoices", "invoices"),
604
+ centerSub: h("invoices.metrics.invoices", "invoices"),
583
605
  className: "shrink-0"
584
- }), /* @__PURE__ */ P(g, {
606
+ }), /* @__PURE__ */ P(m, {
585
607
  data: $.distribution,
586
608
  className: "w-full min-w-0 flex-1",
587
609
  valueFormat: (e) => String(e)
@@ -593,33 +615,33 @@ function J() {
593
615
  /* @__PURE__ */ P("div", {
594
616
  className: "mt-6 flex flex-wrap items-center gap-3",
595
617
  children: /* @__PURE__ */ P("select", {
596
- "aria-label": o("invoices.filters.statusLabel", "Filter by status"),
597
- value: v,
618
+ "aria-label": h("invoices.filters.statusLabel", "Filter by status"),
619
+ value: S,
598
620
  onChange: (e) => {
599
- x(e.target.value), _(0);
621
+ D(e.target.value), x(0);
600
622
  },
601
623
  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)]",
602
- children: j.map((e) => /* @__PURE__ */ P("option", {
624
+ children: R.map((e) => /* @__PURE__ */ P("option", {
603
625
  value: e.value,
604
626
  children: e.label
605
627
  }, e.value))
606
628
  })
607
629
  }),
608
- R ? /* @__PURE__ */ P(f, { label: o("invoices.loading", "Loading invoices…") }) : z ? /* @__PURE__ */ P(d, {
609
- message: o("invoices.error", "Could not load invoices."),
610
- onRetry: () => void H()
630
+ H ? /* @__PURE__ */ P(u, { label: h("invoices.loading", "Loading invoices…") }) : K ? /* @__PURE__ */ P(l, {
631
+ message: h("invoices.error", "Could not load invoices."),
632
+ onRetry: () => void J()
611
633
  }) : Z.length === 0 ? /* @__PURE__ */ P("div", {
612
634
  className: "mt-6",
613
- children: /* @__PURE__ */ P(c, {
635
+ children: /* @__PURE__ */ P(s, {
614
636
  illustration: "empty-data",
615
637
  icon: /* @__PURE__ */ P(A, { className: "h-12 w-12" }),
616
- title: o("invoices.emptyTitle", "No invoices"),
617
- description: v ? o("invoices.emptyDescriptionFiltered", "No invoices match this status filter.") : o("invoices.emptyDescription", "Invoices from your relationships will appear here — or create one manually."),
638
+ title: h("invoices.emptyTitle", "No invoices"),
639
+ description: S ? h("invoices.emptyDescriptionFiltered", "No invoices match this status filter.") : h("invoices.emptyDescription", "Invoices from your relationships will appear here — or create one manually."),
618
640
  action: /* @__PURE__ */ P("button", {
619
641
  type: "button",
620
- onClick: () => O(!0),
642
+ onClick: () => M(!0),
621
643
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
622
- children: o("invoices.create", "Create invoice")
644
+ children: h("invoices.create", "Create invoice")
623
645
  })
624
646
  })
625
647
  }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ F("div", {
@@ -627,20 +649,20 @@ function J() {
627
649
  children: [/* @__PURE__ */ F("div", {
628
650
  className: "hidden grid-cols-[1.3fr_1.2fr_0.8fr_0.8fr_0.8fr_auto] gap-4 border-b border-border-subtle bg-bg-sunken px-4 py-2.5 text-xs font-medium text-text-secondary sm:grid",
629
651
  children: [
630
- /* @__PURE__ */ P("span", { children: o("invoices.table.invoice", "Invoice") }),
631
- /* @__PURE__ */ P("span", { children: o("invoices.table.subscription", "Subscription") }),
632
- /* @__PURE__ */ P("span", { children: o("invoices.table.status", "Status") }),
652
+ /* @__PURE__ */ P("span", { children: h("invoices.table.invoice", "Invoice") }),
653
+ /* @__PURE__ */ P("span", { children: h("invoices.table.subscription", "Subscription") }),
654
+ /* @__PURE__ */ P("span", { children: h("invoices.table.status", "Status") }),
633
655
  /* @__PURE__ */ P("span", {
634
- className: "text-right",
635
- children: o("invoices.table.total", "Total")
656
+ className: "text-end",
657
+ children: h("invoices.table.total", "Total")
636
658
  }),
637
659
  /* @__PURE__ */ P("span", {
638
- className: "text-right",
639
- children: o("invoices.table.due", "Due")
660
+ className: "text-end",
661
+ children: h("invoices.table.due", "Due")
640
662
  }),
641
663
  /* @__PURE__ */ P("span", {
642
- className: "text-right",
643
- children: o("invoices.table.action", "Action")
664
+ className: "text-end",
665
+ children: h("invoices.table.action", "Action")
644
666
  })
645
667
  ]
646
668
  }), /* @__PURE__ */ P("div", {
@@ -650,44 +672,44 @@ function J() {
650
672
  children: [
651
673
  /* @__PURE__ */ F("button", {
652
674
  type: "button",
653
- onClick: () => l(`/relationships/${e.relationshipId}`),
654
- className: "min-w-0 text-left",
675
+ onClick: () => g(`/relationships/${e.relationshipId}`),
676
+ className: "min-w-0 text-start",
655
677
  children: [/* @__PURE__ */ P("p", {
656
678
  className: "truncate text-sm font-medium text-text-primary",
657
- children: e.number || `${o("invoices.table.invoice", "Invoice")} ${e.id.slice(0, 8)}`
679
+ children: e.number || `${h("invoices.table.invoice", "Invoice")} ${e.id.slice(0, 8)}`
658
680
  }), /* @__PURE__ */ P("p", {
659
681
  className: "text-xs text-text-secondary",
660
- children: e.issueDate ? o("invoices.table.issued", "Issued {{date}}", { date: a(e.issueDate) }) : "—"
682
+ children: e.issueDate ? h("invoices.table.issued", "Issued {{date}}", { date: d(e.issueDate) }) : "—"
661
683
  })]
662
684
  }),
663
685
  /* @__PURE__ */ P("span", {
664
686
  className: "min-w-0 truncate text-sm text-text-secondary",
665
- children: X.get(e.relationshipId) ?? "—"
687
+ children: ne.get(e.relationshipId) ?? "—"
666
688
  }),
667
- /* @__PURE__ */ P("span", { children: /* @__PURE__ */ P(s, { status: e.status }) }),
689
+ /* @__PURE__ */ P("span", { children: /* @__PURE__ */ P(o, { status: e.status }) }),
668
690
  /* @__PURE__ */ P("span", {
669
- className: "text-sm font-semibold tabular-nums text-text-primary sm:text-right",
670
- children: i(e.total, e.currency)
691
+ className: "text-sm font-semibold tabular-nums text-text-primary sm:text-end",
692
+ children: c(e.total, e.currency)
671
693
  }),
672
694
  /* @__PURE__ */ P("span", {
673
- className: "text-xs text-text-secondary sm:text-right",
674
- children: e.dueDate ? a(e.dueDate) : "—"
695
+ className: "text-xs text-text-secondary sm:text-end",
696
+ children: e.dueDate ? d(e.dueDate) : "—"
675
697
  }),
676
698
  /* @__PURE__ */ P("span", {
677
- className: "sm:text-right",
699
+ className: "sm:text-end",
678
700
  children: U.has(e.status) ? /* @__PURE__ */ F("button", {
679
701
  type: "button",
680
- disabled: J.isPending,
681
- onClick: () => J.mutate(e.id),
682
- "aria-label": o("invoices.table.markPaidAria", "Mark {{invoice}} paid", { invoice: e.number || `${o("invoices.table.invoice", "Invoice")} ${e.id.slice(0, 8)}` }),
702
+ disabled: Y.isPending,
703
+ onClick: () => Y.mutate(e.id),
704
+ "aria-label": h("invoices.table.markPaidAria", "Mark {{invoice}} paid", { invoice: e.number || `${h("invoices.table.invoice", "Invoice")} ${e.id.slice(0, 8)}` }),
683
705
  className: "inline-flex items-center gap-1.5 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle px-3 py-1.5 text-xs font-medium text-status-success-text hover:opacity-90 disabled:opacity-50",
684
- children: [/* @__PURE__ */ P(D, {
706
+ children: [/* @__PURE__ */ P(E, {
685
707
  className: "h-3.5 w-3.5",
686
708
  "aria-hidden": !0
687
- }), o("invoices.table.markPaid", "Mark paid")]
709
+ }), h("invoices.table.markPaid", "Mark paid")]
688
710
  }) : e.paidAt ? /* @__PURE__ */ P("span", {
689
711
  className: "text-xs text-text-secondary",
690
- children: o("invoices.table.paidAt", "Paid {{date}}", { date: a(e.paidAt) })
712
+ children: h("invoices.table.paidAt", "Paid {{date}}", { date: d(e.paidAt) })
691
713
  }) : /* @__PURE__ */ P("span", {
692
714
  className: "text-xs text-text-secondary",
693
715
  children: "—"
@@ -700,26 +722,26 @@ function J() {
700
722
  className: "mt-4 flex items-center justify-between",
701
723
  children: [/* @__PURE__ */ F("p", {
702
724
  className: "text-xs text-text-secondary",
703
- children: [o("invoices.pagination.page", "Page {{page}}", { page: p + 1 }), K ? ` · ${o("invoices.pagination.refreshing", "refreshing…")}` : ""]
725
+ children: [h("invoices.pagination.page", "Page {{page}}", { page: y + 1 }), te ? ` · ${h("invoices.pagination.refreshing", "refreshing…")}` : ""]
704
726
  }), /* @__PURE__ */ F("div", {
705
727
  className: "flex gap-2",
706
728
  children: [/* @__PURE__ */ P("button", {
707
729
  type: "button",
708
- disabled: p === 0,
709
- onClick: () => _((e) => Math.max(0, e - 1)),
710
- className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", p === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
711
- children: o("invoices.pagination.previous", "Previous")
730
+ disabled: y === 0,
731
+ onClick: () => x((e) => Math.max(0, e - 1)),
732
+ className: r("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", y === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
733
+ children: h("invoices.pagination.previous", "Previous")
712
734
  }), /* @__PURE__ */ P("button", {
713
735
  type: "button",
714
736
  disabled: !Q,
715
- onClick: () => _((e) => e + 1),
716
- className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", Q ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
717
- children: o("invoices.pagination.next", "Next")
737
+ onClick: () => x((e) => e + 1),
738
+ className: r("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", Q ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
739
+ children: h("invoices.pagination.next", "Next")
718
740
  })]
719
741
  })]
720
742
  })] }),
721
743
  /* @__PURE__ */ P(q, {}),
722
- C && /* @__PURE__ */ P(G, { onClose: () => O(!1) })
744
+ j && /* @__PURE__ */ P(G, { onClose: () => M(!1) })
723
745
  ]
724
746
  });
725
747
  }