@burdenoff/microfe-brainyrich 2026.705.1 → 2026.706.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 (47) hide show
  1. package/dist/brainyrich/BrainyRichRoot.js +13 -13
  2. package/dist/brainyrich/components/ActorName.js +38 -0
  3. package/dist/brainyrich/components/ActorName.js.map +1 -0
  4. package/dist/brainyrich/components/ConfirmDialog.js +25 -0
  5. package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
  6. package/dist/brainyrich/components/LoadMore.js +24 -0
  7. package/dist/brainyrich/components/LoadMore.js.map +1 -0
  8. package/dist/brainyrich/components/index.js +5 -0
  9. package/dist/brainyrich/components/notify.js +38 -0
  10. package/dist/brainyrich/components/notify.js.map +1 -0
  11. package/dist/brainyrich/components/pickers.js +232 -0
  12. package/dist/brainyrich/components/pickers.js.map +1 -0
  13. package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
  14. package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
  15. package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
  16. package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
  17. package/dist/brainyrich/components/reuse/TagField.js +206 -0
  18. package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
  19. package/dist/brainyrich/components/reuse/transport.js +24 -0
  20. package/dist/brainyrich/components/reuse/transport.js.map +1 -0
  21. package/dist/brainyrich/hooks/useBrainyRichApi.js +644 -372
  22. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
  23. package/dist/brainyrich/pages/AccountsPage.js +346 -293
  24. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  25. package/dist/brainyrich/pages/AiAssistantPage.js +339 -320
  26. package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
  27. package/dist/brainyrich/pages/AnalyticsPage.js +178 -164
  28. package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
  29. package/dist/brainyrich/pages/DashboardPage.js +195 -169
  30. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  31. package/dist/brainyrich/pages/FamilyPage.js +247 -198
  32. package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
  33. package/dist/brainyrich/pages/GoalsPage.js +478 -442
  34. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  35. package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
  36. package/dist/brainyrich/pages/PortfoliosPage.js +438 -396
  37. package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
  38. package/dist/brainyrich/pages/ReportsPage.js +246 -213
  39. package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
  40. package/dist/brainyrich/pages/RiskPage.js +321 -173
  41. package/dist/brainyrich/pages/RiskPage.js.map +1 -1
  42. package/dist/brainyrich/pages/TaxPage.js +258 -225
  43. package/dist/brainyrich/pages/TaxPage.js.map +1 -1
  44. package/dist/brainyrich/pages/_shared.js.map +1 -1
  45. package/dist/node_modules/sonner/dist/index.js +163 -0
  46. package/dist/node_modules/sonner/dist/index.js.map +1 -0
  47. package/package.json +3 -2
@@ -1,11 +1,17 @@
1
- import { useAccount as e, useAccounts as t, useArchiveAccount as n, useCreateAccount as r, useRecordTransaction as i, useTransactions as ee, useUpdateAccount as te } from "../hooks/useBrainyRichApi.js";
2
- import { EmptyState as a, ErrorState as o, KpiGrid as s, LoadingState as c, SectionShell as ne, formatDate as re, formatMoney as l, statusBadgeVariant as u } from "./_shared.js";
3
- import { useState as d } from "react";
4
- import { Archive as f, ArrowDownRight as p, ArrowUpRight as m, Landmark as ie, MoreHorizontal as ae, Pencil as oe, Plus as h, Receipt as g } from "lucide-react";
5
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
6
- import { Badge as y, Button as b, Card as se, CardContent as ce, CardDescription as le, CardHeader as ue, CardTitle as de, Dialog as x, DialogClose as fe, DialogContent as S, DialogDescription as C, DialogFooter as w, DialogHeader as T, DialogTitle as E, DropdownMenu as pe, DropdownMenuContent as me, DropdownMenuItem as he, DropdownMenuTrigger as ge, Input as D, Label as O, Select as _e, SelectContent as k, SelectItem as A, SelectTrigger as j, SelectValue as M, Sheet as N, SheetContent as P, SheetDescription as F, SheetHeader as I, SheetTitle as L, Table as ve, TableBody as ye, TableCell as R, TableHead as z, TableHeader as be, TableRow as xe, Textarea as Se } from "@burdenoff/fe-libs/ui";
1
+ import { useAccount as e, useAllAccounts as t, useArchiveAccount as n, useCreateAccount as r, usePagedAccounts as i, usePagedTransactions as a, useRecordTransaction as ee, useUpdateAccount as te } from "../hooks/useBrainyRichApi.js";
2
+ import { LoadMore as o } from "../components/LoadMore.js";
3
+ import { ConfirmDialog as ne } from "../components/ConfirmDialog.js";
4
+ import { ActorName as s } from "../components/ActorName.js";
5
+ import { HouseholdPicker as c } from "../components/pickers.js";
6
+ import "../components/index.js";
7
+ import { EmptyState as l, ErrorState as u, KpiGrid as d, LoadingState as f, SectionShell as re, formatDate as p, formatMoney as m, statusBadgeVariant as ie } from "./_shared.js";
8
+ import { DocumentsPanel as h } from "../components/reuse/DocumentsPanel.js";
9
+ import { useState as g } from "react";
10
+ import { Archive as ae, ArrowDownRight as _, ArrowUpRight as v, Landmark as oe, MoreHorizontal as se, Pencil as ce, Plus as y, Receipt as b } from "lucide-react";
11
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
12
+ import { Badge as C, Button as w, Card as le, CardContent as ue, CardDescription as de, CardHeader as fe, CardTitle as pe, Dialog as T, DialogClose as me, DialogContent as E, DialogDescription as D, DialogFooter as O, DialogHeader as k, DialogTitle as A, DropdownMenu as he, DropdownMenuContent as ge, DropdownMenuItem as j, DropdownMenuTrigger as _e, Input as M, Label as N, Select as P, SelectContent as F, SelectItem as I, SelectTrigger as ve, SelectValue as ye, Sheet as L, SheetContent as R, SheetDescription as z, SheetHeader as B, SheetTitle as V, Table as be, TableBody as xe, TableCell as H, TableHead as U, TableHeader as Se, TableRow as Ce, Textarea as we } from "@burdenoff/fe-libs/ui";
7
13
  //#region src/brainyrich/pages/AccountsPage.tsx
8
- var B = [
14
+ var Te = [
9
15
  "BANK",
10
16
  "BROKERAGE",
11
17
  "RETIREMENT",
@@ -14,7 +20,7 @@ var B = [
14
20
  "REAL_ESTATE",
15
21
  "ALTERNATIVE",
16
22
  "LIABILITY"
17
- ], Ce = [
23
+ ], Ee = [
18
24
  "BUY",
19
25
  "SELL",
20
26
  "DIVIDEND",
@@ -24,22 +30,23 @@ var B = [
24
30
  "FEE",
25
31
  "TRANSFER"
26
32
  ];
27
- function V(e) {
33
+ function W(e) {
28
34
  return e === "DEPOSIT" || e === "DIVIDEND" || e === "INTEREST" || e === "SELL" || e === "TRANSFER";
29
35
  }
30
- function H(e) {
36
+ function G(e) {
31
37
  if (e.trim() === "") return;
32
38
  let t = Number(e);
33
39
  return Number.isFinite(t) ? t : void 0;
34
40
  }
35
- var U = {
41
+ var K = {
36
42
  name: "",
37
43
  type: "BANK",
38
44
  institution: "",
39
45
  currency: "USD",
40
46
  cashBalance: "",
41
- accountMask: ""
42
- }, we = {
47
+ accountMask: "",
48
+ householdId: null
49
+ }, De = {
43
50
  type: "DEPOSIT",
44
51
  tradeDate: "",
45
52
  symbol: "",
@@ -49,187 +56,191 @@ var U = {
49
56
  fee: "",
50
57
  notes: ""
51
58
  };
52
- function W() {
53
- let { data: e, isLoading: ee, isError: re, refetch: p } = t(), [m, g] = d(void 0), [N, P] = d(!1), [F, I] = d(U), [L, B] = d(null), [V, W] = d(U), [G, K] = d(null), [De, q] = d(!1), [J, Y] = d(we), X = r(), Z = te(), Q = n(), $ = i(), Oe = e.reduce((e, t) => e + (t.cashBalance ?? 0), 0), ke = e.filter((e) => e.status === "ACTIVE").length, Ae = new Set(e.map((e) => e.institution).filter((e) => !!e)).size, je = e[0]?.currency ?? "USD";
54
- function Me() {
55
- I(U), P(!0);
59
+ function q() {
60
+ let e = t().data, a = i(), [s, c] = g(void 0), [p, h] = g(!1), [_, v] = g(K), [b, L] = g(null), [R, z] = g(K), [B, V] = g(null), [Te, W] = g(!1), [q, J] = g(De), Y = r(), X = te(), Ae = n(), Z = ee(), je = e.reduce((e, t) => e + (t.cashBalance ?? 0), 0), Me = e.filter((e) => e.status === "ACTIVE").length, Ne = new Set(e.map((e) => e.institution).filter((e) => !!e)).size, Pe = e[0]?.currency ?? "USD";
61
+ function Fe() {
62
+ v(K), h(!0);
56
63
  }
57
- function Ne() {
58
- F.name.trim() && X.mutate({
59
- name: F.name.trim(),
60
- type: F.type,
61
- institution: F.institution.trim() || null,
62
- currency: F.currency.trim() || "USD",
63
- cashBalance: H(F.cashBalance) ?? 0,
64
- accountMask: F.accountMask.trim() || null
65
- }, { onSuccess: () => P(!1) });
64
+ function Ie() {
65
+ _.name.trim() && Y.mutate({
66
+ name: _.name.trim(),
67
+ type: _.type,
68
+ institution: _.institution.trim() || null,
69
+ currency: _.currency.trim() || "USD",
70
+ cashBalance: G(_.cashBalance) ?? 0,
71
+ accountMask: _.accountMask.trim() || null,
72
+ householdId: _.householdId
73
+ }, { onSuccess: () => h(!1) });
66
74
  }
67
- function Pe(e) {
68
- B(e), W({
75
+ function Le(e) {
76
+ L(e), z({
69
77
  name: e.name,
70
78
  type: e.type,
71
79
  institution: e.institution ?? "",
72
80
  currency: e.currency,
73
81
  cashBalance: String(e.cashBalance ?? ""),
74
- accountMask: e.accountMask ?? ""
82
+ accountMask: e.accountMask ?? "",
83
+ householdId: e.householdId
75
84
  });
76
85
  }
77
- function Fe() {
78
- !L || !V.name.trim() || Z.mutate({
79
- id: L.id,
86
+ function Re() {
87
+ !b || !R.name.trim() || X.mutate({
88
+ id: b.id,
80
89
  input: {
81
- name: V.name.trim(),
82
- type: V.type,
83
- institution: V.institution.trim() || null,
84
- currency: V.currency.trim() || "USD",
85
- cashBalance: H(V.cashBalance) ?? 0,
86
- accountMask: V.accountMask.trim() || null
90
+ name: R.name.trim(),
91
+ type: R.type,
92
+ institution: R.institution.trim() || null,
93
+ currency: R.currency.trim() || "USD",
94
+ cashBalance: G(R.cashBalance) ?? 0,
95
+ accountMask: R.accountMask.trim() || null,
96
+ householdId: R.householdId
87
97
  }
88
- }, { onSuccess: () => B(null) });
98
+ }, { onSuccess: () => L(null) });
89
99
  }
90
- function Ie() {
91
- if (!G) return;
92
- let e = G.id;
93
- Q.mutate(e, { onSuccess: () => {
94
- K(null), m === e && g(void 0);
100
+ function ze() {
101
+ if (!B) return;
102
+ let e = B.id;
103
+ Ae.mutate(e, { onSuccess: () => {
104
+ V(null), s === e && c(void 0);
95
105
  } });
96
106
  }
97
- function Le() {
98
- Y(we), q(!0);
107
+ function Be() {
108
+ J(De), W(!0);
99
109
  }
100
- function Re() {
101
- if (!m || !J.tradeDate) return;
102
- let e = new Date(J.tradeDate);
103
- Number.isNaN(e.getTime()) || $.mutate({
104
- accountId: m,
105
- type: J.type,
110
+ let Q = G(q.amount), $ = Q !== void 0 && Q > 0, Ve = !!(s && q.tradeDate) && $;
111
+ function He() {
112
+ if (!s || !q.tradeDate || !$) return;
113
+ let e = new Date(q.tradeDate);
114
+ Number.isNaN(e.getTime()) || Z.mutate({
115
+ accountId: s,
116
+ type: q.type,
106
117
  tradeDate: e.toISOString(),
107
- symbol: J.symbol.trim() || null,
108
- quantity: H(J.quantity),
109
- price: H(J.price),
110
- amount: H(J.amount),
111
- fee: H(J.fee),
112
- notes: J.notes.trim() || null
113
- }, { onSuccess: () => q(!1) });
118
+ symbol: q.symbol.trim() || null,
119
+ quantity: G(q.quantity),
120
+ price: G(q.price),
121
+ amount: Q,
122
+ fee: G(q.fee),
123
+ notes: q.notes.trim() || null
124
+ }, { onSuccess: () => W(!1) });
114
125
  }
115
- return /* @__PURE__ */ v(ne, {
126
+ return /* @__PURE__ */ S(re, {
116
127
  title: "Accounts",
117
128
  description: "Linked bank, brokerage and retirement accounts with recent activity.",
118
129
  badges: [`${e.length} account${e.length === 1 ? "" : "s"}`],
119
130
  actionLabel: "New account",
120
- onAction: Me,
131
+ onAction: Fe,
121
132
  children: [
122
- /* @__PURE__ */ _(s, { items: [
133
+ /* @__PURE__ */ x(d, { items: [
123
134
  {
124
135
  label: "Total accounts",
125
136
  value: String(e.length)
126
137
  },
127
138
  {
128
139
  label: "Total cash",
129
- value: l(Oe, je)
140
+ value: m(je, Pe)
130
141
  },
131
142
  {
132
143
  label: "Active",
133
- value: `${ke}/${e.length}`
144
+ value: `${Me}/${e.length}`
134
145
  },
135
146
  {
136
147
  label: "Institutions",
137
- value: String(Ae)
148
+ value: String(Ne)
138
149
  }
139
150
  ] }),
140
- /* @__PURE__ */ v(se, { children: [/* @__PURE__ */ v(ue, { children: [/* @__PURE__ */ v(de, {
151
+ /* @__PURE__ */ S(le, { children: [/* @__PURE__ */ S(fe, { children: [/* @__PURE__ */ S(pe, {
141
152
  className: "flex items-center gap-2",
142
- children: [/* @__PURE__ */ _(ie, {
153
+ children: [/* @__PURE__ */ x(oe, {
143
154
  className: "h-5 w-5",
144
155
  "aria-hidden": "true"
145
156
  }), "Linked accounts"]
146
- }), /* @__PURE__ */ _(le, { children: "Select an account to view holdings and transactions." })] }), /* @__PURE__ */ _(ce, { children: ee ? /* @__PURE__ */ _(c, {}) : re ? /* @__PURE__ */ _(o, { onRetry: () => p() }) : e.length === 0 ? /* @__PURE__ */ _(a, {
147
- icon: /* @__PURE__ */ _(ie, {
157
+ }), /* @__PURE__ */ x(de, { children: "Select an account to view holdings and transactions." })] }), /* @__PURE__ */ x(ue, { children: a.isLoading ? /* @__PURE__ */ x(f, {}) : a.isError ? /* @__PURE__ */ x(u, { onRetry: () => a.refetch() }) : a.items.length === 0 ? /* @__PURE__ */ x(l, {
158
+ icon: /* @__PURE__ */ x(oe, {
148
159
  className: "size-6",
149
160
  "aria-hidden": "true"
150
161
  }),
151
162
  title: "No accounts yet",
152
163
  description: "Add your first bank, brokerage or retirement account to start tracking net worth.",
153
- action: /* @__PURE__ */ v(b, {
164
+ action: /* @__PURE__ */ S(w, {
154
165
  size: "sm",
155
- onClick: Me,
156
- children: [/* @__PURE__ */ _(h, {
166
+ onClick: Fe,
167
+ children: [/* @__PURE__ */ x(y, {
157
168
  className: "size-4",
158
169
  "aria-hidden": "true"
159
170
  }), "New account"]
160
171
  })
161
- }) : /* @__PURE__ */ _("div", {
172
+ }) : /* @__PURE__ */ S("div", {
162
173
  className: "overflow-x-auto",
163
- children: /* @__PURE__ */ v(ve, { children: [/* @__PURE__ */ _(be, { children: /* @__PURE__ */ v(xe, { children: [
164
- /* @__PURE__ */ _(z, { children: "Account" }),
165
- /* @__PURE__ */ _(z, { children: "Type" }),
166
- /* @__PURE__ */ _(z, {
174
+ children: [/* @__PURE__ */ S(be, { children: [/* @__PURE__ */ x(Se, { children: /* @__PURE__ */ S(Ce, { children: [
175
+ /* @__PURE__ */ x(U, { children: "Account" }),
176
+ /* @__PURE__ */ x(U, { children: "Type" }),
177
+ /* @__PURE__ */ x(U, {
167
178
  className: "text-right",
168
179
  children: "Cash balance"
169
180
  }),
170
- /* @__PURE__ */ _(z, { children: "Status" }),
171
- /* @__PURE__ */ _(z, {
181
+ /* @__PURE__ */ x(U, { children: "Status" }),
182
+ /* @__PURE__ */ x(U, {
172
183
  className: "w-12 text-right",
173
184
  children: "Actions"
174
185
  })
175
- ] }) }), /* @__PURE__ */ _(ye, { children: e.map((e) => /* @__PURE__ */ v(xe, {
186
+ ] }) }), /* @__PURE__ */ x(xe, { children: a.items.map((e) => /* @__PURE__ */ S(Ce, {
176
187
  className: "cursor-pointer",
177
- onClick: () => g(e.id),
188
+ onClick: () => c(e.id),
178
189
  children: [
179
- /* @__PURE__ */ _(R, { children: /* @__PURE__ */ v("div", {
190
+ /* @__PURE__ */ x(H, { children: /* @__PURE__ */ S("div", {
180
191
  className: "flex items-center gap-3",
181
- children: [/* @__PURE__ */ _("div", {
192
+ children: [/* @__PURE__ */ x("div", {
182
193
  className: "flex h-9 w-9 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground",
183
194
  children: (e.institution ?? e.name).slice(0, 2).toUpperCase()
184
- }), /* @__PURE__ */ v("div", {
195
+ }), /* @__PURE__ */ S("div", {
185
196
  className: "min-w-0",
186
- children: [/* @__PURE__ */ _("p", {
197
+ children: [/* @__PURE__ */ x("p", {
187
198
  className: "truncate font-medium text-text-primary",
188
199
  children: e.name
189
- }), /* @__PURE__ */ v("p", {
200
+ }), /* @__PURE__ */ S("p", {
190
201
  className: "truncate text-xs text-text-secondary",
191
202
  children: [e.institution ?? "Manual account", e.accountMask ? ` · ••${e.accountMask}` : ""]
192
203
  })]
193
204
  })]
194
205
  }) }),
195
- /* @__PURE__ */ _(R, { children: /* @__PURE__ */ _(y, {
206
+ /* @__PURE__ */ x(H, { children: /* @__PURE__ */ x(C, {
196
207
  variant: "outline",
197
208
  children: e.type.replace(/_/g, " ")
198
209
  }) }),
199
- /* @__PURE__ */ _(R, {
210
+ /* @__PURE__ */ x(H, {
200
211
  className: "text-right font-semibold text-text-primary",
201
- children: l(e.cashBalance, e.currency)
212
+ children: m(e.cashBalance, e.currency)
202
213
  }),
203
- /* @__PURE__ */ _(R, { children: /* @__PURE__ */ _(y, {
204
- variant: u(e.status),
214
+ /* @__PURE__ */ x(H, { children: /* @__PURE__ */ x(C, {
215
+ variant: ie(e.status),
205
216
  children: e.status
206
217
  }) }),
207
- /* @__PURE__ */ _(R, {
218
+ /* @__PURE__ */ x(H, {
208
219
  className: "text-right",
209
220
  onClick: (e) => e.stopPropagation(),
210
- children: /* @__PURE__ */ v(pe, { children: [/* @__PURE__ */ _(ge, {
221
+ children: /* @__PURE__ */ S(he, { children: [/* @__PURE__ */ x(_e, {
211
222
  asChild: !0,
212
- children: /* @__PURE__ */ _(b, {
223
+ children: /* @__PURE__ */ x(w, {
213
224
  variant: "ghost",
214
225
  size: "sm",
215
226
  "aria-label": `Actions for ${e.name}`,
216
- children: /* @__PURE__ */ _(ae, {
227
+ children: /* @__PURE__ */ x(se, {
217
228
  className: "size-4",
218
229
  "aria-hidden": "true"
219
230
  })
220
231
  })
221
- }), /* @__PURE__ */ v(me, {
232
+ }), /* @__PURE__ */ S(ge, {
222
233
  align: "end",
223
- children: [/* @__PURE__ */ v(he, {
224
- onClick: () => Pe(e),
225
- children: [/* @__PURE__ */ _(oe, {
234
+ children: [/* @__PURE__ */ S(j, {
235
+ onClick: () => Le(e),
236
+ children: [/* @__PURE__ */ x(ce, {
226
237
  className: "size-4",
227
238
  "aria-hidden": "true"
228
239
  }), "Edit"]
229
- }), /* @__PURE__ */ v(he, {
240
+ }), /* @__PURE__ */ S(j, {
230
241
  className: "text-status-error-text",
231
- onClick: () => K(e),
232
- children: [/* @__PURE__ */ _(f, {
242
+ onClick: () => V(e),
243
+ children: [/* @__PURE__ */ x(ae, {
233
244
  className: "size-4",
234
245
  "aria-hidden": "true"
235
246
  }), "Archive"]
@@ -237,189 +248,203 @@ function W() {
237
248
  })] })
238
249
  })
239
250
  ]
240
- }, e.id)) })] })
251
+ }, e.id)) })] }), /* @__PURE__ */ x(o, {
252
+ hasMore: a.hasMore,
253
+ onClick: a.loadMore,
254
+ loading: a.isFetchingNextPage,
255
+ className: "mt-4"
256
+ })]
241
257
  }) })] }),
242
- /* @__PURE__ */ _(x, {
243
- open: N,
244
- onOpenChange: P,
245
- children: /* @__PURE__ */ v(S, { children: [
246
- /* @__PURE__ */ v(T, { children: [/* @__PURE__ */ _(E, { children: "New account" }), /* @__PURE__ */ _(C, { children: "Add a bank, brokerage or retirement account." })] }),
247
- /* @__PURE__ */ _(Te, {
248
- form: F,
249
- onChange: I
258
+ /* @__PURE__ */ x(T, {
259
+ open: p,
260
+ onOpenChange: h,
261
+ children: /* @__PURE__ */ S(E, { children: [
262
+ /* @__PURE__ */ S(k, { children: [/* @__PURE__ */ x(A, { children: "New account" }), /* @__PURE__ */ x(D, { children: "Add a bank, brokerage or retirement account." })] }),
263
+ /* @__PURE__ */ x(Oe, {
264
+ form: _,
265
+ onChange: v
250
266
  }),
251
- /* @__PURE__ */ v(w, { children: [/* @__PURE__ */ _(fe, {
267
+ /* @__PURE__ */ S(O, { children: [/* @__PURE__ */ x(me, {
252
268
  asChild: !0,
253
- children: /* @__PURE__ */ _(b, {
269
+ children: /* @__PURE__ */ x(w, {
254
270
  variant: "outline",
255
271
  children: "Cancel"
256
272
  })
257
- }), /* @__PURE__ */ _(b, {
258
- onClick: Ne,
259
- disabled: !F.name.trim() || X.isPending,
260
- children: X.isPending ? "Creating…" : "Create account"
273
+ }), /* @__PURE__ */ x(w, {
274
+ onClick: Ie,
275
+ disabled: !_.name.trim() || Y.isPending,
276
+ children: Y.isPending ? "Creating…" : "Create account"
261
277
  })] })
262
278
  ] })
263
279
  }),
264
- /* @__PURE__ */ _(x, {
265
- open: !!L,
266
- onOpenChange: (e) => !e && B(null),
267
- children: /* @__PURE__ */ v(S, { children: [
268
- /* @__PURE__ */ v(T, { children: [/* @__PURE__ */ _(E, { children: "Edit account" }), /* @__PURE__ */ _(C, { children: "Update account details." })] }),
269
- /* @__PURE__ */ _(Te, {
270
- form: V,
271
- onChange: W
280
+ /* @__PURE__ */ x(T, {
281
+ open: !!b,
282
+ onOpenChange: (e) => !e && L(null),
283
+ children: /* @__PURE__ */ S(E, { children: [
284
+ /* @__PURE__ */ S(k, { children: [/* @__PURE__ */ x(A, { children: "Edit account" }), /* @__PURE__ */ x(D, { children: "Update account details." })] }),
285
+ /* @__PURE__ */ x(Oe, {
286
+ form: R,
287
+ onChange: z
272
288
  }),
273
- /* @__PURE__ */ v(w, { children: [/* @__PURE__ */ _(b, {
289
+ /* @__PURE__ */ S(O, { children: [/* @__PURE__ */ x(w, {
274
290
  variant: "outline",
275
- onClick: () => B(null),
291
+ onClick: () => L(null),
276
292
  children: "Cancel"
277
- }), /* @__PURE__ */ _(b, {
278
- onClick: Fe,
279
- disabled: !V.name.trim() || Z.isPending,
280
- children: Z.isPending ? "Saving…" : "Save changes"
293
+ }), /* @__PURE__ */ x(w, {
294
+ onClick: Re,
295
+ disabled: !R.name.trim() || X.isPending,
296
+ children: X.isPending ? "Saving…" : "Save changes"
281
297
  })] })
282
298
  ] })
283
299
  }),
284
- /* @__PURE__ */ _(x, {
285
- open: !!G,
286
- onOpenChange: (e) => !e && K(null),
287
- children: /* @__PURE__ */ v(S, { children: [/* @__PURE__ */ v(T, { children: [/* @__PURE__ */ _(E, { children: "Archive account?" }), /* @__PURE__ */ _(C, { children: G ? `“${G.name}” will be archived and hidden from active lists. This does not delete its history.` : "" })] }), /* @__PURE__ */ v(w, { children: [/* @__PURE__ */ _(b, {
288
- variant: "outline",
289
- onClick: () => K(null),
290
- children: "Cancel"
291
- }), /* @__PURE__ */ _(b, {
292
- variant: "destructive",
293
- onClick: Ie,
294
- disabled: Q.isPending,
295
- children: Q.isPending ? "Archiving…" : "Archive account"
296
- })] })] })
300
+ /* @__PURE__ */ x(ne, {
301
+ open: !!B,
302
+ onOpenChange: (e) => !e && V(null),
303
+ title: "Archive account?",
304
+ description: B ? `“${B.name}” will be archived and hidden from active lists. This does not delete its history.` : void 0,
305
+ confirmLabel: "Archive account",
306
+ pendingLabel: "Archiving…",
307
+ destructive: !0,
308
+ pending: Ae.isPending,
309
+ onConfirm: ze
297
310
  }),
298
- /* @__PURE__ */ _(Ee, {
299
- accountId: m,
300
- onClose: () => g(void 0),
301
- onRecordTransaction: Le
311
+ /* @__PURE__ */ x(ke, {
312
+ accountId: s,
313
+ onClose: () => c(void 0),
314
+ onRecordTransaction: Be
302
315
  }),
303
- /* @__PURE__ */ _(x, {
304
- open: De,
305
- onOpenChange: q,
306
- children: /* @__PURE__ */ v(S, { children: [
307
- /* @__PURE__ */ v(T, { children: [/* @__PURE__ */ _(E, { children: "Record transaction" }), /* @__PURE__ */ _(C, { children: "Log activity against the selected account." })] }),
308
- /* @__PURE__ */ v("div", {
316
+ /* @__PURE__ */ x(T, {
317
+ open: Te,
318
+ onOpenChange: W,
319
+ children: /* @__PURE__ */ S(E, { children: [
320
+ /* @__PURE__ */ S(k, { children: [/* @__PURE__ */ x(A, { children: "Record transaction" }), /* @__PURE__ */ x(D, { children: "Log activity against the selected account." })] }),
321
+ /* @__PURE__ */ S("div", {
309
322
  className: "grid gap-4",
310
323
  children: [
311
- /* @__PURE__ */ v("div", {
324
+ /* @__PURE__ */ S("div", {
312
325
  className: "grid grid-cols-2 gap-4",
313
- children: [/* @__PURE__ */ v("div", {
326
+ children: [/* @__PURE__ */ S("div", {
314
327
  className: "space-y-2",
315
- children: [/* @__PURE__ */ _(O, {
328
+ children: [/* @__PURE__ */ x(N, {
316
329
  htmlFor: "tx-type",
317
330
  children: "Type"
318
- }), /* @__PURE__ */ v(_e, {
319
- value: J.type,
320
- onValueChange: (e) => Y((t) => ({
331
+ }), /* @__PURE__ */ S(P, {
332
+ value: q.type,
333
+ onValueChange: (e) => J((t) => ({
321
334
  ...t,
322
335
  type: e
323
336
  })),
324
- children: [/* @__PURE__ */ _(j, {
337
+ children: [/* @__PURE__ */ x(ve, {
325
338
  id: "tx-type",
326
- children: /* @__PURE__ */ _(M, {})
327
- }), /* @__PURE__ */ _(k, { children: Ce.map((e) => /* @__PURE__ */ _(A, {
339
+ children: /* @__PURE__ */ x(ye, {})
340
+ }), /* @__PURE__ */ x(F, { children: Ee.map((e) => /* @__PURE__ */ x(I, {
328
341
  value: e,
329
342
  children: e.replace(/_/g, " ")
330
343
  }, e)) })]
331
344
  })]
332
- }), /* @__PURE__ */ v("div", {
345
+ }), /* @__PURE__ */ S("div", {
333
346
  className: "space-y-2",
334
- children: [/* @__PURE__ */ _(O, {
347
+ children: [/* @__PURE__ */ x(N, {
335
348
  htmlFor: "tx-date",
336
349
  children: "Trade date"
337
- }), /* @__PURE__ */ _(D, {
350
+ }), /* @__PURE__ */ x(M, {
338
351
  id: "tx-date",
339
352
  type: "date",
340
- value: J.tradeDate,
341
- onChange: (e) => Y((t) => ({
353
+ value: q.tradeDate,
354
+ onChange: (e) => J((t) => ({
342
355
  ...t,
343
356
  tradeDate: e.target.value
344
357
  }))
345
358
  })]
346
359
  })]
347
360
  }),
348
- /* @__PURE__ */ v("div", {
361
+ /* @__PURE__ */ S("div", {
349
362
  className: "grid grid-cols-2 gap-4",
350
- children: [/* @__PURE__ */ v("div", {
363
+ children: [/* @__PURE__ */ S("div", {
351
364
  className: "space-y-2",
352
- children: [/* @__PURE__ */ _(O, {
365
+ children: [/* @__PURE__ */ x(N, {
353
366
  htmlFor: "tx-symbol",
354
367
  children: "Symbol"
355
- }), /* @__PURE__ */ _(D, {
368
+ }), /* @__PURE__ */ x(M, {
356
369
  id: "tx-symbol",
357
- value: J.symbol,
358
- onChange: (e) => Y((t) => ({
370
+ value: q.symbol,
371
+ onChange: (e) => J((t) => ({
359
372
  ...t,
360
373
  symbol: e.target.value
361
374
  })),
362
375
  placeholder: "e.g. VOO"
363
376
  })]
364
- }), /* @__PURE__ */ v("div", {
377
+ }), /* @__PURE__ */ S("div", {
365
378
  className: "space-y-2",
366
- children: [/* @__PURE__ */ _(O, {
367
- htmlFor: "tx-amount",
368
- children: "Amount"
369
- }), /* @__PURE__ */ _(D, {
370
- id: "tx-amount",
371
- type: "number",
372
- value: J.amount,
373
- onChange: (e) => Y((t) => ({
374
- ...t,
375
- amount: e.target.value
376
- }))
377
- })]
379
+ children: [
380
+ /* @__PURE__ */ x(N, {
381
+ htmlFor: "tx-amount",
382
+ children: "Amount"
383
+ }),
384
+ /* @__PURE__ */ x(M, {
385
+ id: "tx-amount",
386
+ type: "number",
387
+ min: "0",
388
+ step: "any",
389
+ value: q.amount,
390
+ onChange: (e) => J((t) => ({
391
+ ...t,
392
+ amount: e.target.value
393
+ })),
394
+ "aria-invalid": q.amount.trim() !== "" && !$,
395
+ "aria-describedby": "tx-amount-hint"
396
+ }),
397
+ /* @__PURE__ */ x("p", {
398
+ id: "tx-amount-hint",
399
+ className: "text-xs text-text-secondary",
400
+ children: q.amount.trim() !== "" && !$ ? "Enter an amount greater than 0." : "Positive amount; direction is set by the type."
401
+ })
402
+ ]
378
403
  })]
379
404
  }),
380
- /* @__PURE__ */ v("div", {
405
+ /* @__PURE__ */ S("div", {
381
406
  className: "grid grid-cols-3 gap-4",
382
407
  children: [
383
- /* @__PURE__ */ v("div", {
408
+ /* @__PURE__ */ S("div", {
384
409
  className: "space-y-2",
385
- children: [/* @__PURE__ */ _(O, {
410
+ children: [/* @__PURE__ */ x(N, {
386
411
  htmlFor: "tx-qty",
387
412
  children: "Quantity"
388
- }), /* @__PURE__ */ _(D, {
413
+ }), /* @__PURE__ */ x(M, {
389
414
  id: "tx-qty",
390
415
  type: "number",
391
- value: J.quantity,
392
- onChange: (e) => Y((t) => ({
416
+ value: q.quantity,
417
+ onChange: (e) => J((t) => ({
393
418
  ...t,
394
419
  quantity: e.target.value
395
420
  }))
396
421
  })]
397
422
  }),
398
- /* @__PURE__ */ v("div", {
423
+ /* @__PURE__ */ S("div", {
399
424
  className: "space-y-2",
400
- children: [/* @__PURE__ */ _(O, {
425
+ children: [/* @__PURE__ */ x(N, {
401
426
  htmlFor: "tx-price",
402
427
  children: "Price"
403
- }), /* @__PURE__ */ _(D, {
428
+ }), /* @__PURE__ */ x(M, {
404
429
  id: "tx-price",
405
430
  type: "number",
406
- value: J.price,
407
- onChange: (e) => Y((t) => ({
431
+ value: q.price,
432
+ onChange: (e) => J((t) => ({
408
433
  ...t,
409
434
  price: e.target.value
410
435
  }))
411
436
  })]
412
437
  }),
413
- /* @__PURE__ */ v("div", {
438
+ /* @__PURE__ */ S("div", {
414
439
  className: "space-y-2",
415
- children: [/* @__PURE__ */ _(O, {
440
+ children: [/* @__PURE__ */ x(N, {
416
441
  htmlFor: "tx-fee",
417
442
  children: "Fee"
418
- }), /* @__PURE__ */ _(D, {
443
+ }), /* @__PURE__ */ x(M, {
419
444
  id: "tx-fee",
420
445
  type: "number",
421
- value: J.fee,
422
- onChange: (e) => Y((t) => ({
446
+ value: q.fee,
447
+ onChange: (e) => J((t) => ({
423
448
  ...t,
424
449
  fee: e.target.value
425
450
  }))
@@ -427,15 +452,15 @@ function W() {
427
452
  })
428
453
  ]
429
454
  }),
430
- /* @__PURE__ */ v("div", {
455
+ /* @__PURE__ */ S("div", {
431
456
  className: "space-y-2",
432
- children: [/* @__PURE__ */ _(O, {
457
+ children: [/* @__PURE__ */ x(N, {
433
458
  htmlFor: "tx-notes",
434
459
  children: "Notes"
435
- }), /* @__PURE__ */ _(Se, {
460
+ }), /* @__PURE__ */ x(we, {
436
461
  id: "tx-notes",
437
- value: J.notes,
438
- onChange: (e) => Y((t) => ({
462
+ value: q.notes,
463
+ onChange: (e) => J((t) => ({
439
464
  ...t,
440
465
  notes: e.target.value
441
466
  })),
@@ -444,30 +469,30 @@ function W() {
444
469
  })
445
470
  ]
446
471
  }),
447
- /* @__PURE__ */ v(w, { children: [/* @__PURE__ */ _(b, {
472
+ /* @__PURE__ */ S(O, { children: [/* @__PURE__ */ x(w, {
448
473
  variant: "outline",
449
- onClick: () => q(!1),
474
+ onClick: () => W(!1),
450
475
  children: "Cancel"
451
- }), /* @__PURE__ */ _(b, {
452
- onClick: Re,
453
- disabled: !J.tradeDate || $.isPending,
454
- children: $.isPending ? "Saving…" : "Record transaction"
476
+ }), /* @__PURE__ */ x(w, {
477
+ onClick: He,
478
+ disabled: !Ve || Z.isPending,
479
+ children: Z.isPending ? "Saving…" : "Record transaction"
455
480
  })] })
456
481
  ] })
457
482
  })
458
483
  ]
459
484
  });
460
485
  }
461
- function Te({ form: e, onChange: t }) {
462
- return /* @__PURE__ */ v("div", {
486
+ function Oe({ form: e, onChange: t }) {
487
+ return /* @__PURE__ */ S("div", {
463
488
  className: "grid gap-4",
464
489
  children: [
465
- /* @__PURE__ */ v("div", {
490
+ /* @__PURE__ */ S("div", {
466
491
  className: "space-y-2",
467
- children: [/* @__PURE__ */ _(O, {
492
+ children: [/* @__PURE__ */ x(N, {
468
493
  htmlFor: "acct-name",
469
494
  children: "Name"
470
- }), /* @__PURE__ */ _(D, {
495
+ }), /* @__PURE__ */ x(M, {
471
496
  id: "acct-name",
472
497
  value: e.name,
473
498
  onChange: (e) => t((t) => ({
@@ -477,33 +502,33 @@ function Te({ form: e, onChange: t }) {
477
502
  placeholder: "e.g. Everyday Checking"
478
503
  })]
479
504
  }),
480
- /* @__PURE__ */ v("div", {
505
+ /* @__PURE__ */ S("div", {
481
506
  className: "grid grid-cols-2 gap-4",
482
- children: [/* @__PURE__ */ v("div", {
507
+ children: [/* @__PURE__ */ S("div", {
483
508
  className: "space-y-2",
484
- children: [/* @__PURE__ */ _(O, {
509
+ children: [/* @__PURE__ */ x(N, {
485
510
  htmlFor: "acct-type",
486
511
  children: "Type"
487
- }), /* @__PURE__ */ v(_e, {
512
+ }), /* @__PURE__ */ S(P, {
488
513
  value: e.type,
489
514
  onValueChange: (e) => t((t) => ({
490
515
  ...t,
491
516
  type: e
492
517
  })),
493
- children: [/* @__PURE__ */ _(j, {
518
+ children: [/* @__PURE__ */ x(ve, {
494
519
  id: "acct-type",
495
- children: /* @__PURE__ */ _(M, {})
496
- }), /* @__PURE__ */ _(k, { children: B.map((e) => /* @__PURE__ */ _(A, {
520
+ children: /* @__PURE__ */ x(ye, {})
521
+ }), /* @__PURE__ */ x(F, { children: Te.map((e) => /* @__PURE__ */ x(I, {
497
522
  value: e,
498
523
  children: e.replace(/_/g, " ")
499
524
  }, e)) })]
500
525
  })]
501
- }), /* @__PURE__ */ v("div", {
526
+ }), /* @__PURE__ */ S("div", {
502
527
  className: "space-y-2",
503
- children: [/* @__PURE__ */ _(O, {
528
+ children: [/* @__PURE__ */ x(N, {
504
529
  htmlFor: "acct-currency",
505
530
  children: "Currency"
506
- }), /* @__PURE__ */ _(D, {
531
+ }), /* @__PURE__ */ x(M, {
507
532
  id: "acct-currency",
508
533
  value: e.currency,
509
534
  onChange: (e) => t((t) => ({
@@ -514,12 +539,12 @@ function Te({ form: e, onChange: t }) {
514
539
  })]
515
540
  })]
516
541
  }),
517
- /* @__PURE__ */ v("div", {
542
+ /* @__PURE__ */ S("div", {
518
543
  className: "space-y-2",
519
- children: [/* @__PURE__ */ _(O, {
544
+ children: [/* @__PURE__ */ x(N, {
520
545
  htmlFor: "acct-institution",
521
546
  children: "Institution"
522
- }), /* @__PURE__ */ _(D, {
547
+ }), /* @__PURE__ */ x(M, {
523
548
  id: "acct-institution",
524
549
  value: e.institution,
525
550
  onChange: (e) => t((t) => ({
@@ -529,14 +554,14 @@ function Te({ form: e, onChange: t }) {
529
554
  placeholder: "e.g. Chase"
530
555
  })]
531
556
  }),
532
- /* @__PURE__ */ v("div", {
557
+ /* @__PURE__ */ S("div", {
533
558
  className: "grid grid-cols-2 gap-4",
534
- children: [/* @__PURE__ */ v("div", {
559
+ children: [/* @__PURE__ */ S("div", {
535
560
  className: "space-y-2",
536
- children: [/* @__PURE__ */ _(O, {
561
+ children: [/* @__PURE__ */ x(N, {
537
562
  htmlFor: "acct-balance",
538
563
  children: "Cash balance"
539
- }), /* @__PURE__ */ _(D, {
564
+ }), /* @__PURE__ */ x(M, {
540
565
  id: "acct-balance",
541
566
  type: "number",
542
567
  value: e.cashBalance,
@@ -545,12 +570,12 @@ function Te({ form: e, onChange: t }) {
545
570
  cashBalance: e.target.value
546
571
  }))
547
572
  })]
548
- }), /* @__PURE__ */ v("div", {
573
+ }), /* @__PURE__ */ S("div", {
549
574
  className: "space-y-2",
550
- children: [/* @__PURE__ */ _(O, {
575
+ children: [/* @__PURE__ */ x(N, {
551
576
  htmlFor: "acct-mask",
552
577
  children: "Account mask"
553
- }), /* @__PURE__ */ _(D, {
578
+ }), /* @__PURE__ */ x(M, {
554
579
  id: "acct-mask",
555
580
  value: e.accountMask,
556
581
  onChange: (e) => t((t) => ({
@@ -560,147 +585,175 @@ function Te({ form: e, onChange: t }) {
560
585
  placeholder: "Last 4 digits"
561
586
  })]
562
587
  })]
588
+ }),
589
+ /* @__PURE__ */ x(c, {
590
+ value: e.householdId,
591
+ onChange: (e) => t((t) => ({
592
+ ...t,
593
+ householdId: e
594
+ }))
563
595
  })
564
596
  ]
565
597
  });
566
598
  }
567
- function Ee({ accountId: t, onClose: n, onRecordTransaction: r }) {
568
- let { data: i, isLoading: te, isError: s, refetch: ne } = e(t), d = ee(t ? { accountId: t } : {}), f = t ? d.data : [];
569
- return /* @__PURE__ */ _(N, {
599
+ function ke({ accountId: t, onClose: n, onRecordTransaction: r }) {
600
+ let { data: i, isLoading: ee, isError: te, refetch: ne } = e(t), c = a(t ? { accountId: t } : {}), d = t ? c.items : [];
601
+ return /* @__PURE__ */ x(L, {
570
602
  open: !!t,
571
603
  onOpenChange: (e) => !e && n(),
572
- children: /* @__PURE__ */ v(P, {
604
+ children: /* @__PURE__ */ S(R, {
573
605
  className: "w-full overflow-y-auto sm:max-w-lg",
574
- children: [/* @__PURE__ */ v(I, { children: [/* @__PURE__ */ _(L, { children: i?.name ?? "Account" }), /* @__PURE__ */ _(F, { children: i ? `${i.institution ?? "Manual account"} · ${i.type.replace(/_/g, " ")}` : "Loading account details…" })] }), te ? /* @__PURE__ */ _("div", {
606
+ children: [/* @__PURE__ */ S(B, { children: [/* @__PURE__ */ x(V, { children: i?.name ?? "Account" }), /* @__PURE__ */ x(z, { children: i ? `${i.institution ?? "Manual account"} · ${i.type.replace(/_/g, " ")}` : "Loading account details…" })] }), ee ? /* @__PURE__ */ x("div", {
575
607
  className: "mt-6",
576
- children: /* @__PURE__ */ _(c, { rows: 3 })
577
- }) : s ? /* @__PURE__ */ _("div", {
608
+ children: /* @__PURE__ */ x(f, { rows: 3 })
609
+ }) : te ? /* @__PURE__ */ x("div", {
578
610
  className: "mt-6",
579
- children: /* @__PURE__ */ _(o, { onRetry: () => ne() })
580
- }) : i ? /* @__PURE__ */ v("div", {
611
+ children: /* @__PURE__ */ x(u, { onRetry: () => ne() })
612
+ }) : i ? /* @__PURE__ */ S("div", {
581
613
  className: "mt-6 space-y-6",
582
614
  children: [
583
- /* @__PURE__ */ v("div", {
615
+ /* @__PURE__ */ S("div", {
584
616
  className: "grid grid-cols-2 gap-4",
585
- children: [/* @__PURE__ */ v("div", {
617
+ children: [/* @__PURE__ */ S("div", {
586
618
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
587
- children: [/* @__PURE__ */ _("p", {
619
+ children: [/* @__PURE__ */ x("p", {
588
620
  className: "text-xs text-text-secondary",
589
621
  children: "Cash balance"
590
- }), /* @__PURE__ */ _("p", {
622
+ }), /* @__PURE__ */ x("p", {
591
623
  className: "text-xl font-semibold text-text-primary",
592
- children: l(i.cashBalance, i.currency)
624
+ children: m(i.cashBalance, i.currency)
593
625
  })]
594
- }), /* @__PURE__ */ v("div", {
626
+ }), /* @__PURE__ */ S("div", {
595
627
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
596
- children: [/* @__PURE__ */ _("p", {
628
+ children: [/* @__PURE__ */ x("p", {
597
629
  className: "text-xs text-text-secondary",
598
630
  children: "Status"
599
- }), /* @__PURE__ */ _(y, {
600
- variant: u(i.status),
631
+ }), /* @__PURE__ */ x(C, {
632
+ variant: ie(i.status),
601
633
  children: i.status
602
634
  })]
603
635
  })]
604
636
  }),
605
- /* @__PURE__ */ v("div", {
637
+ /* @__PURE__ */ S("div", {
638
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
639
+ children: [/* @__PURE__ */ x("p", {
640
+ className: "text-xs text-text-secondary",
641
+ children: "Owner"
642
+ }), /* @__PURE__ */ x(s, {
643
+ id: i.ownerId,
644
+ className: "text-sm font-medium text-text-primary"
645
+ })]
646
+ }),
647
+ /* @__PURE__ */ S("div", {
606
648
  className: "space-y-3",
607
- children: [/* @__PURE__ */ _("h3", {
649
+ children: [/* @__PURE__ */ x("h3", {
608
650
  className: "text-sm font-semibold text-text-primary",
609
651
  children: "Holdings"
610
- }), i.holdings.length === 0 ? /* @__PURE__ */ _(a, {
652
+ }), i.holdings.length === 0 ? /* @__PURE__ */ x(l, {
611
653
  title: "No holdings",
612
654
  description: "This account has no positions recorded yet."
613
- }) : /* @__PURE__ */ _("div", {
655
+ }) : /* @__PURE__ */ x("div", {
614
656
  className: "space-y-2",
615
- children: i.holdings.map((e) => /* @__PURE__ */ v("div", {
657
+ children: i.holdings.map((e) => /* @__PURE__ */ S("div", {
616
658
  className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface p-3",
617
- children: [/* @__PURE__ */ v("div", {
659
+ children: [/* @__PURE__ */ S("div", {
618
660
  className: "min-w-0",
619
- children: [/* @__PURE__ */ _("p", {
661
+ children: [/* @__PURE__ */ x("p", {
620
662
  className: "truncate text-sm font-medium text-text-primary",
621
663
  children: e.symbol
622
- }), e.name ? /* @__PURE__ */ _("p", {
664
+ }), e.name ? /* @__PURE__ */ x("p", {
623
665
  className: "truncate text-xs text-text-secondary",
624
666
  children: e.name
625
667
  }) : null]
626
- }), /* @__PURE__ */ _("span", {
668
+ }), /* @__PURE__ */ x("span", {
627
669
  className: "text-sm font-semibold text-text-primary",
628
- children: l(e.marketValue, e.currency)
670
+ children: m(e.marketValue, e.currency)
629
671
  })]
630
672
  }, e.id))
631
673
  })]
632
674
  }),
633
- /* @__PURE__ */ v("div", {
675
+ /* @__PURE__ */ S("div", {
634
676
  className: "space-y-3",
635
- children: [/* @__PURE__ */ v("div", {
677
+ children: [/* @__PURE__ */ S("div", {
636
678
  className: "flex items-center justify-between",
637
- children: [/* @__PURE__ */ _("h3", {
679
+ children: [/* @__PURE__ */ x("h3", {
638
680
  className: "text-sm font-semibold text-text-primary",
639
681
  children: "Recent transactions"
640
- }), /* @__PURE__ */ v(b, {
682
+ }), /* @__PURE__ */ S(w, {
641
683
  size: "sm",
642
684
  variant: "outline",
643
685
  onClick: r,
644
- children: [/* @__PURE__ */ _(g, {
686
+ children: [/* @__PURE__ */ x(b, {
645
687
  className: "size-4",
646
688
  "aria-hidden": "true"
647
689
  }), "Record"]
648
690
  })]
649
- }), d.isLoading ? /* @__PURE__ */ _(c, { rows: 2 }) : d.isError ? /* @__PURE__ */ _(o, { onRetry: () => d.refetch() }) : f.length === 0 ? /* @__PURE__ */ _(a, {
650
- icon: /* @__PURE__ */ _(g, {
691
+ }), c.isLoading ? /* @__PURE__ */ x(f, { rows: 2 }) : c.isError ? /* @__PURE__ */ x(u, { onRetry: () => c.refetch() }) : d.length === 0 ? /* @__PURE__ */ x(l, {
692
+ icon: /* @__PURE__ */ x(b, {
651
693
  className: "size-6",
652
694
  "aria-hidden": "true"
653
695
  }),
654
696
  title: "No transactions",
655
697
  description: "Record a transaction to see activity here.",
656
- action: /* @__PURE__ */ v(b, {
698
+ action: /* @__PURE__ */ S(w, {
657
699
  size: "sm",
658
700
  onClick: r,
659
- children: [/* @__PURE__ */ _(h, {
701
+ children: [/* @__PURE__ */ x(y, {
660
702
  className: "size-4",
661
703
  "aria-hidden": "true"
662
704
  }), "Record transaction"]
663
705
  })
664
- }) : /* @__PURE__ */ _("div", {
706
+ }) : /* @__PURE__ */ S("div", {
665
707
  className: "space-y-2",
666
- children: f.map((e) => {
667
- let t = V(e.type), n = t ? m : p, r = t ? "text-status-success-text" : "text-status-error-text";
668
- return /* @__PURE__ */ v("div", {
708
+ children: [d.map((e) => {
709
+ let t = W(e.type), n = t ? v : _, r = t ? "text-status-success-text" : "text-status-error-text";
710
+ return /* @__PURE__ */ S("div", {
669
711
  className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface p-3",
670
- children: [/* @__PURE__ */ v("div", {
712
+ children: [/* @__PURE__ */ S("div", {
671
713
  className: "min-w-0",
672
- children: [/* @__PURE__ */ v("div", {
714
+ children: [/* @__PURE__ */ S("div", {
673
715
  className: "flex items-center gap-2",
674
- children: [/* @__PURE__ */ _(y, {
716
+ children: [/* @__PURE__ */ x(C, {
675
717
  variant: "outline",
676
718
  children: e.type.replace(/_/g, " ")
677
- }), e.symbol ? /* @__PURE__ */ _("span", {
719
+ }), e.symbol ? /* @__PURE__ */ x("span", {
678
720
  className: "truncate text-xs text-text-secondary",
679
721
  children: e.symbol
680
722
  }) : null]
681
- }), /* @__PURE__ */ _("p", {
723
+ }), /* @__PURE__ */ x("p", {
682
724
  className: "mt-1 text-xs text-text-secondary",
683
- children: re(e.tradeDate)
725
+ children: p(e.tradeDate)
684
726
  })]
685
- }), /* @__PURE__ */ v("span", {
727
+ }), /* @__PURE__ */ S("span", {
686
728
  className: `inline-flex items-center gap-1 text-sm font-semibold ${r}`,
687
729
  children: [
688
- /* @__PURE__ */ _(n, {
730
+ /* @__PURE__ */ x(n, {
689
731
  className: "size-4",
690
732
  "aria-hidden": "true"
691
733
  }),
692
734
  t ? "+" : "−",
693
- l(Math.abs(e.amount), e.currency)
735
+ m(Math.abs(e.amount), e.currency)
694
736
  ]
695
737
  })]
696
738
  }, e.id);
697
- })
739
+ }), /* @__PURE__ */ x(o, {
740
+ hasMore: c.hasMore,
741
+ onClick: c.loadMore,
742
+ loading: c.isFetchingNextPage
743
+ })]
698
744
  })]
745
+ }),
746
+ /* @__PURE__ */ x("div", {
747
+ className: "space-y-3",
748
+ children: /* @__PURE__ */ x(h, {
749
+ entityType: "brainyrich-account",
750
+ entityId: i.id
751
+ })
699
752
  })
700
753
  ]
701
- }) : /* @__PURE__ */ _("div", {
754
+ }) : /* @__PURE__ */ x("div", {
702
755
  className: "mt-6",
703
- children: /* @__PURE__ */ _(a, {
756
+ children: /* @__PURE__ */ x(l, {
704
757
  title: "Account not found",
705
758
  description: "This account is no longer available."
706
759
  })
@@ -709,6 +762,6 @@ function Ee({ accountId: t, onClose: n, onRecordTransaction: r }) {
709
762
  });
710
763
  }
711
764
  //#endregion
712
- export { W as AccountsPage };
765
+ export { q as AccountsPage };
713
766
 
714
767
  //# sourceMappingURL=AccountsPage.js.map