@burdenoff/microfe-brainyrich 2026.830.2 → 2026.1025.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.
- package/dist/brainyrich/components/AggregationPanel.d.ts +2 -0
- package/dist/brainyrich/components/AggregationPanel.d.ts.map +1 -0
- package/dist/brainyrich/components/AggregationPanel.js +173 -0
- package/dist/brainyrich/components/AggregationPanel.js.map +1 -0
- package/dist/brainyrich/hooks/useAggregation.d.ts +341 -0
- package/dist/brainyrich/hooks/useAggregation.d.ts.map +1 -0
- package/dist/brainyrich/hooks/useAggregation.js +96 -0
- package/dist/brainyrich/hooks/useAggregation.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts +62 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.js +95 -85
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +2 -2
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/types/bra.d.ts +38 -0
- package/dist/brainyrich/types/bra.d.ts.map +1 -1
- package/dist/brainyrich/utils/plaidLink.d.ts +63 -0
- package/dist/brainyrich/utils/plaidLink.d.ts.map +1 -0
- package/dist/brainyrich/utils/plaidLink.js +41 -0
- package/dist/brainyrich/utils/plaidLink.js.map +1 -0
- package/package.json +1 -1
|
@@ -8,12 +8,13 @@ import "../components/index.js";
|
|
|
8
8
|
import { EmptyState as u, ErrorState as d, LoadingState as f, SectionShell as p, formatCompact as oe, formatDate as se, formatMoney as m, statusBadgeVariant as ce } from "./_shared.js";
|
|
9
9
|
import { hapticSuccess as le, showToast as ue } from "../utils/nativeControls.js";
|
|
10
10
|
import { useTrackBrainyRichPageView as de } from "../hooks/useBrainyRichAnalytics.js";
|
|
11
|
+
import { AggregationPanel as fe } from "../components/AggregationPanel.js";
|
|
11
12
|
import { DocumentsPanel as h } from "../components/reuse/DocumentsPanel.js";
|
|
12
13
|
import { TagField as g } from "../components/reuse/TagField.js";
|
|
13
|
-
import { useEffect as
|
|
14
|
-
import { Archive as
|
|
14
|
+
import { useEffect as pe, useMemo as me, useState as _ } from "react";
|
|
15
|
+
import { Archive as he, ArrowDownRight as v, ArrowUpRight as y, Building2 as ge, CheckCircle2 as _e, ChevronRight as ve, Landmark as b, Layers as ye, MoreHorizontal as be, Pencil as xe, Plus as Se, Receipt as x, Wallet as Ce } from "lucide-react";
|
|
15
16
|
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
16
|
-
import { Badge as w, Button as T, Card as
|
|
17
|
+
import { Badge as w, Button as T, Card as we, CardContent as Te, CardDescription as Ee, CardHeader as De, CardTitle as Oe, DropdownMenu as ke, DropdownMenuContent as Ae, DropdownMenuItem as je, DropdownMenuTrigger as Me, Input as E, Label as D, ResponsiveDialog as O, ResponsiveDialogClose as Ne, ResponsiveDialogContent as k, ResponsiveDialogDescription as A, ResponsiveDialogFooter as j, ResponsiveDialogHeader as M, ResponsiveDialogTitle as N, Select as Pe, SelectContent as Fe, SelectItem as Ie, SelectTrigger as Le, SelectValue as Re, Sheet as P, SheetContent as F, SheetDescription as I, SheetHeader as L, SheetTitle as ze, Table as Be, TableBody as Ve, TableCell as R, TableHead as z, TableHeader as He, TableRow as B, Tabs as V, TabsContent as H, TabsList as U, TabsTrigger as W, Textarea as Ue } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/brainyrich/pages/AccountsPage.tsx
|
|
18
19
|
var G = [
|
|
19
20
|
"BANK",
|
|
@@ -24,7 +25,7 @@ var G = [
|
|
|
24
25
|
"REAL_ESTATE",
|
|
25
26
|
"ALTERNATIVE",
|
|
26
27
|
"LIABILITY"
|
|
27
|
-
],
|
|
28
|
+
], We = [
|
|
28
29
|
"BUY",
|
|
29
30
|
"SELL",
|
|
30
31
|
"DIVIDEND",
|
|
@@ -33,7 +34,7 @@ var G = [
|
|
|
33
34
|
"WITHDRAWAL",
|
|
34
35
|
"FEE",
|
|
35
36
|
"TRANSFER"
|
|
36
|
-
],
|
|
37
|
+
], Ge = {
|
|
37
38
|
BANK: "teal",
|
|
38
39
|
BROKERAGE: "brand",
|
|
39
40
|
RETIREMENT: "blue",
|
|
@@ -59,7 +60,7 @@ var J = {
|
|
|
59
60
|
cashBalance: "",
|
|
60
61
|
accountMask: "",
|
|
61
62
|
householdId: null
|
|
62
|
-
},
|
|
63
|
+
}, Ke = {
|
|
63
64
|
type: "DEPOSIT",
|
|
64
65
|
tradeDate: "",
|
|
65
66
|
symbol: "",
|
|
@@ -71,15 +72,15 @@ var J = {
|
|
|
71
72
|
};
|
|
72
73
|
function Y() {
|
|
73
74
|
de("brainyrich.accounts.viewed");
|
|
74
|
-
let e = t().data, a = i(), [o, l] = _(void 0), [se, h] = _(!1), [g, v] = _(J), [y, x] = _(null), [P, F] = _(J), [I, L] = _(null), [
|
|
75
|
-
|
|
75
|
+
let e = t().data, a = i(), [o, l] = _(void 0), [se, h] = _(!1), [g, v] = _(J), [y, x] = _(null), [P, F] = _(J), [I, L] = _(null), [ze, V] = _(!1), [H, U] = _(void 0), [W, G] = _(void 0), [K, Y] = _(Ke), X = r(), Z = te(), Ye = n(), Xe = ee();
|
|
76
|
+
pe(() => {
|
|
76
77
|
if (!W) return;
|
|
77
78
|
let e = window.setTimeout(() => {
|
|
78
79
|
G(void 0), V(!0);
|
|
79
80
|
}, 320);
|
|
80
81
|
return () => window.clearTimeout(e);
|
|
81
82
|
}, [W]);
|
|
82
|
-
let
|
|
83
|
+
let Ze = e.reduce((e, t) => e + (t.cashBalance ?? 0), 0), Qe = e.filter((e) => e.status === "ACTIVE").length, $e = new Set(e.map((e) => e.institution).filter((e) => !!e)).size, et = e[0]?.currency ?? "USD", tt = me(() => {
|
|
83
84
|
let t = /* @__PURE__ */ new Map();
|
|
84
85
|
for (let n of e) {
|
|
85
86
|
let e = n.cashBalance ?? 0;
|
|
@@ -88,13 +89,13 @@ function Y() {
|
|
|
88
89
|
return [...t.entries()].map(([e, t]) => ({
|
|
89
90
|
label: e.replace(/_/g, " "),
|
|
90
91
|
value: t,
|
|
91
|
-
tone:
|
|
92
|
+
tone: Ge[e]
|
|
92
93
|
})).sort((e, t) => t.value - e.value);
|
|
93
94
|
}, [e]);
|
|
94
|
-
function
|
|
95
|
+
function nt() {
|
|
95
96
|
v(J), h(!0);
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function rt() {
|
|
98
99
|
g.name.trim() && X.mutate({
|
|
99
100
|
name: g.name.trim(),
|
|
100
101
|
type: g.type,
|
|
@@ -105,7 +106,7 @@ function Y() {
|
|
|
105
106
|
householdId: g.householdId
|
|
106
107
|
}, { onSuccess: () => h(!1) });
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
+
function it(e) {
|
|
109
110
|
x(e), F({
|
|
110
111
|
name: e.name,
|
|
111
112
|
type: e.type,
|
|
@@ -116,7 +117,7 @@ function Y() {
|
|
|
116
117
|
householdId: e.householdId
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function at() {
|
|
120
121
|
!y || !P.name.trim() || Z.mutate({
|
|
121
122
|
id: y.id,
|
|
122
123
|
input: {
|
|
@@ -130,36 +131,36 @@ function Y() {
|
|
|
130
131
|
}
|
|
131
132
|
}, { onSuccess: () => x(null) });
|
|
132
133
|
}
|
|
133
|
-
function
|
|
134
|
+
function ot() {
|
|
134
135
|
if (!I) return;
|
|
135
136
|
let e = I.id;
|
|
136
|
-
|
|
137
|
+
Ye.mutate(e, { onSuccess: () => {
|
|
137
138
|
le(), ue("Account archived"), L(null), o === e && l(void 0);
|
|
138
139
|
} });
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
-
Y(
|
|
141
|
+
function st(e) {
|
|
142
|
+
Y(Ke), U(e), l(void 0), G(e);
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function ct() {
|
|
144
145
|
G(void 0), V(!1);
|
|
145
146
|
let e = H;
|
|
146
147
|
U(void 0), e && l(e);
|
|
147
148
|
}
|
|
148
|
-
let
|
|
149
|
-
function
|
|
149
|
+
let Q = q(K.amount), $ = Q !== void 0 && Q > 0, lt = !!(H && K.tradeDate) && $;
|
|
150
|
+
function ut() {
|
|
150
151
|
if (!H || !K.tradeDate || !$) return;
|
|
151
152
|
let e = new Date(K.tradeDate);
|
|
152
|
-
Number.isNaN(e.getTime()) ||
|
|
153
|
+
Number.isNaN(e.getTime()) || Xe.mutate({
|
|
153
154
|
accountId: H,
|
|
154
155
|
type: K.type,
|
|
155
156
|
tradeDate: e.toISOString(),
|
|
156
157
|
symbol: K.symbol.trim() || null,
|
|
157
158
|
quantity: q(K.quantity),
|
|
158
159
|
price: q(K.price),
|
|
159
|
-
amount:
|
|
160
|
+
amount: Q,
|
|
160
161
|
fee: q(K.fee),
|
|
161
162
|
notes: K.notes.trim() || null
|
|
162
|
-
}, { onSuccess:
|
|
163
|
+
}, { onSuccess: ct });
|
|
163
164
|
}
|
|
164
165
|
return /* @__PURE__ */ S("div", {
|
|
165
166
|
"data-tour": "brainyrich-page-accounts",
|
|
@@ -169,7 +170,7 @@ function Y() {
|
|
|
169
170
|
description: "Linked bank, brokerage and retirement accounts with recent activity.",
|
|
170
171
|
badges: [`${e.length} account${e.length === 1 ? "" : "s"}`],
|
|
171
172
|
actionLabel: "New account",
|
|
172
|
-
onAction:
|
|
173
|
+
onAction: nt,
|
|
173
174
|
children: [
|
|
174
175
|
/* @__PURE__ */ C("div", {
|
|
175
176
|
className: "grid gap-4 lg:grid-cols-3",
|
|
@@ -180,9 +181,9 @@ function Y() {
|
|
|
180
181
|
index: 0,
|
|
181
182
|
children: /* @__PURE__ */ S(c, {
|
|
182
183
|
label: "Total cash",
|
|
183
|
-
value: m(
|
|
184
|
+
value: m(Ze, et),
|
|
184
185
|
glow: !0,
|
|
185
|
-
icon: /* @__PURE__ */ S(
|
|
186
|
+
icon: /* @__PURE__ */ S(Ce, {
|
|
186
187
|
className: "size-4",
|
|
187
188
|
"aria-hidden": "true"
|
|
188
189
|
})
|
|
@@ -203,8 +204,8 @@ function Y() {
|
|
|
203
204
|
index: 2,
|
|
204
205
|
children: /* @__PURE__ */ S(c, {
|
|
205
206
|
label: "Active",
|
|
206
|
-
value: `${
|
|
207
|
-
icon: /* @__PURE__ */ S(
|
|
207
|
+
value: `${Qe}/${e.length}`,
|
|
208
|
+
icon: /* @__PURE__ */ S(_e, {
|
|
208
209
|
className: "size-4",
|
|
209
210
|
"aria-hidden": "true"
|
|
210
211
|
})
|
|
@@ -214,8 +215,8 @@ function Y() {
|
|
|
214
215
|
index: 3,
|
|
215
216
|
children: /* @__PURE__ */ S(c, {
|
|
216
217
|
label: "Institutions",
|
|
217
|
-
value: String(
|
|
218
|
-
icon: /* @__PURE__ */ S(
|
|
218
|
+
value: String($e),
|
|
219
|
+
icon: /* @__PURE__ */ S(ge, {
|
|
219
220
|
className: "size-4",
|
|
220
221
|
"aria-hidden": "true"
|
|
221
222
|
})
|
|
@@ -229,22 +230,22 @@ function Y() {
|
|
|
229
230
|
glow: !0,
|
|
230
231
|
children: [/* @__PURE__ */ C("div", {
|
|
231
232
|
className: "mb-2 flex items-center gap-2",
|
|
232
|
-
children: [/* @__PURE__ */ S(
|
|
233
|
+
children: [/* @__PURE__ */ S(ye, {
|
|
233
234
|
className: "size-4 text-text-secondary",
|
|
234
235
|
"aria-hidden": "true"
|
|
235
236
|
}), /* @__PURE__ */ S("h2", {
|
|
236
237
|
className: "text-sm font-semibold text-text-primary",
|
|
237
238
|
children: "Cash by account type"
|
|
238
239
|
})]
|
|
239
|
-
}),
|
|
240
|
+
}), tt.length === 0 ? /* @__PURE__ */ S("p", {
|
|
240
241
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
241
242
|
children: "No cash balances recorded yet."
|
|
242
243
|
}) : /* @__PURE__ */ S(ie, {
|
|
243
|
-
data:
|
|
244
|
-
centerValue: oe(
|
|
244
|
+
data: tt,
|
|
245
|
+
centerValue: oe(Ze, et),
|
|
245
246
|
centerLabel: "Total cash",
|
|
246
247
|
height: 200,
|
|
247
|
-
valueFormatter: (e) => m(e,
|
|
248
|
+
valueFormatter: (e) => m(e, et)
|
|
248
249
|
})]
|
|
249
250
|
})
|
|
250
251
|
})]
|
|
@@ -252,15 +253,15 @@ function Y() {
|
|
|
252
253
|
/* @__PURE__ */ S(s, {
|
|
253
254
|
index: 5,
|
|
254
255
|
as: "section",
|
|
255
|
-
children: /* @__PURE__ */ C(
|
|
256
|
+
children: /* @__PURE__ */ C(we, {
|
|
256
257
|
className: "transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))]",
|
|
257
|
-
children: [/* @__PURE__ */ C(
|
|
258
|
+
children: [/* @__PURE__ */ C(De, { children: [/* @__PURE__ */ C(Oe, {
|
|
258
259
|
className: "flex items-center gap-2",
|
|
259
260
|
children: [/* @__PURE__ */ S(b, {
|
|
260
261
|
className: "h-5 w-5",
|
|
261
262
|
"aria-hidden": "true"
|
|
262
263
|
}), "Linked accounts"]
|
|
263
|
-
}), /* @__PURE__ */ S(
|
|
264
|
+
}), /* @__PURE__ */ S(Ee, { children: "Select an account to view holdings and transactions." })] }), /* @__PURE__ */ S(Te, { children: a.isLoading ? /* @__PURE__ */ S(f, {}) : a.isError ? /* @__PURE__ */ S(d, { onRetry: () => a.refetch() }) : a.items.length === 0 ? /* @__PURE__ */ S(u, {
|
|
264
265
|
icon: /* @__PURE__ */ S(b, {
|
|
265
266
|
className: "size-6",
|
|
266
267
|
"aria-hidden": "true"
|
|
@@ -269,15 +270,15 @@ function Y() {
|
|
|
269
270
|
description: "Add your first bank, brokerage or retirement account to start tracking net worth.",
|
|
270
271
|
action: /* @__PURE__ */ C(T, {
|
|
271
272
|
size: "sm",
|
|
272
|
-
onClick:
|
|
273
|
-
children: [/* @__PURE__ */ S(
|
|
273
|
+
onClick: nt,
|
|
274
|
+
children: [/* @__PURE__ */ S(Se, {
|
|
274
275
|
className: "size-4",
|
|
275
276
|
"aria-hidden": "true"
|
|
276
277
|
}), "New account"]
|
|
277
278
|
})
|
|
278
279
|
}) : /* @__PURE__ */ C("div", {
|
|
279
280
|
className: "overflow-x-auto",
|
|
280
|
-
children: [/* @__PURE__ */ C(
|
|
281
|
+
children: [/* @__PURE__ */ C(Be, { children: [/* @__PURE__ */ S(He, { children: /* @__PURE__ */ C(B, { children: [
|
|
281
282
|
/* @__PURE__ */ S(z, { children: "Account" }),
|
|
282
283
|
/* @__PURE__ */ S(z, { children: "Type" }),
|
|
283
284
|
/* @__PURE__ */ S(z, { children: "Institution" }),
|
|
@@ -290,7 +291,7 @@ function Y() {
|
|
|
290
291
|
className: "w-12 text-right",
|
|
291
292
|
children: "Actions"
|
|
292
293
|
})
|
|
293
|
-
] }) }), /* @__PURE__ */ S(
|
|
294
|
+
] }) }), /* @__PURE__ */ S(Ve, { children: a.items.map((e) => /* @__PURE__ */ C(B, {
|
|
294
295
|
className: "group cursor-pointer transition-colors hover:bg-bg-elevated",
|
|
295
296
|
onClick: () => l(e.id),
|
|
296
297
|
children: [
|
|
@@ -304,13 +305,17 @@ function Y() {
|
|
|
304
305
|
className: "min-w-0",
|
|
305
306
|
children: [/* @__PURE__ */ C("p", {
|
|
306
307
|
className: "flex items-center gap-1 truncate font-medium text-text-primary",
|
|
307
|
-
children: [e.name, /* @__PURE__ */ S(
|
|
308
|
+
children: [e.name, /* @__PURE__ */ S(ve, {
|
|
308
309
|
className: "size-3.5 shrink-0 text-text-secondary opacity-0 transition-opacity group-hover:opacity-100",
|
|
309
310
|
"aria-hidden": "true"
|
|
310
311
|
})]
|
|
311
312
|
}), /* @__PURE__ */ C("p", {
|
|
312
313
|
className: "truncate text-xs text-text-secondary",
|
|
313
|
-
children: [
|
|
314
|
+
children: [
|
|
315
|
+
e.institution ?? (e.isManual ? "Manual account" : "Synced account"),
|
|
316
|
+
e.accountMask ? ` · ••${e.accountMask}` : "",
|
|
317
|
+
e.isManual ? "" : " · Synced automatically"
|
|
318
|
+
]
|
|
314
319
|
})]
|
|
315
320
|
})]
|
|
316
321
|
}) }),
|
|
@@ -333,29 +338,29 @@ function Y() {
|
|
|
333
338
|
/* @__PURE__ */ S(R, {
|
|
334
339
|
className: "text-right",
|
|
335
340
|
onClick: (e) => e.stopPropagation(),
|
|
336
|
-
children: /* @__PURE__ */ C(
|
|
341
|
+
children: /* @__PURE__ */ C(ke, { children: [/* @__PURE__ */ S(Me, {
|
|
337
342
|
asChild: !0,
|
|
338
343
|
children: /* @__PURE__ */ S(T, {
|
|
339
344
|
variant: "ghost",
|
|
340
345
|
size: "sm",
|
|
341
346
|
"aria-label": `Actions for ${e.name}`,
|
|
342
|
-
children: /* @__PURE__ */ S(
|
|
347
|
+
children: /* @__PURE__ */ S(be, {
|
|
343
348
|
className: "size-4",
|
|
344
349
|
"aria-hidden": "true"
|
|
345
350
|
})
|
|
346
351
|
})
|
|
347
|
-
}), /* @__PURE__ */ C(
|
|
352
|
+
}), /* @__PURE__ */ C(Ae, {
|
|
348
353
|
align: "end",
|
|
349
|
-
children: [/* @__PURE__ */ C(
|
|
350
|
-
onClick: () =>
|
|
351
|
-
children: [/* @__PURE__ */ S(
|
|
354
|
+
children: [/* @__PURE__ */ C(je, {
|
|
355
|
+
onClick: () => it(e),
|
|
356
|
+
children: [/* @__PURE__ */ S(xe, {
|
|
352
357
|
className: "size-4",
|
|
353
358
|
"aria-hidden": "true"
|
|
354
359
|
}), "Edit"]
|
|
355
|
-
}), /* @__PURE__ */ C(
|
|
360
|
+
}), /* @__PURE__ */ C(je, {
|
|
356
361
|
className: "text-status-error-text",
|
|
357
362
|
onClick: () => L(e),
|
|
358
|
-
children: [/* @__PURE__ */ S(
|
|
363
|
+
children: [/* @__PURE__ */ S(he, {
|
|
359
364
|
className: "size-4",
|
|
360
365
|
"aria-hidden": "true"
|
|
361
366
|
}), "Archive"]
|
|
@@ -372,6 +377,11 @@ function Y() {
|
|
|
372
377
|
}) })]
|
|
373
378
|
})
|
|
374
379
|
}),
|
|
380
|
+
/* @__PURE__ */ S(s, {
|
|
381
|
+
index: 6,
|
|
382
|
+
as: "section",
|
|
383
|
+
children: /* @__PURE__ */ S(fe, {})
|
|
384
|
+
}),
|
|
375
385
|
/* @__PURE__ */ S(O, {
|
|
376
386
|
open: se,
|
|
377
387
|
onOpenChange: h,
|
|
@@ -379,18 +389,18 @@ function Y() {
|
|
|
379
389
|
className: "max-h-[90vh] overflow-y-auto",
|
|
380
390
|
children: [
|
|
381
391
|
/* @__PURE__ */ C(M, { children: [/* @__PURE__ */ S(N, { children: "New account" }), /* @__PURE__ */ S(A, { children: "Add a bank, brokerage or retirement account." })] }),
|
|
382
|
-
/* @__PURE__ */ S(
|
|
392
|
+
/* @__PURE__ */ S(qe, {
|
|
383
393
|
form: g,
|
|
384
394
|
onChange: v
|
|
385
395
|
}),
|
|
386
|
-
/* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(
|
|
396
|
+
/* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(Ne, {
|
|
387
397
|
asChild: !0,
|
|
388
398
|
children: /* @__PURE__ */ S(T, {
|
|
389
399
|
variant: "outline",
|
|
390
400
|
children: "Cancel"
|
|
391
401
|
})
|
|
392
402
|
}), /* @__PURE__ */ S(T, {
|
|
393
|
-
onClick:
|
|
403
|
+
onClick: rt,
|
|
394
404
|
disabled: !g.name.trim() || X.isPending,
|
|
395
405
|
children: X.isPending ? "Creating…" : "Create account"
|
|
396
406
|
})] })
|
|
@@ -404,7 +414,7 @@ function Y() {
|
|
|
404
414
|
className: "max-h-[90vh] overflow-y-auto",
|
|
405
415
|
children: [
|
|
406
416
|
/* @__PURE__ */ C(M, { children: [/* @__PURE__ */ S(N, { children: "Edit account" }), /* @__PURE__ */ S(A, { children: "Update account details." })] }),
|
|
407
|
-
/* @__PURE__ */ S(
|
|
417
|
+
/* @__PURE__ */ S(qe, {
|
|
408
418
|
form: P,
|
|
409
419
|
onChange: F
|
|
410
420
|
}),
|
|
@@ -413,7 +423,7 @@ function Y() {
|
|
|
413
423
|
onClick: () => x(null),
|
|
414
424
|
children: "Cancel"
|
|
415
425
|
}), /* @__PURE__ */ S(T, {
|
|
416
|
-
onClick:
|
|
426
|
+
onClick: at,
|
|
417
427
|
disabled: !P.name.trim() || Z.isPending,
|
|
418
428
|
children: Z.isPending ? "Saving…" : "Save changes"
|
|
419
429
|
})] })
|
|
@@ -428,19 +438,19 @@ function Y() {
|
|
|
428
438
|
confirmLabel: "Archive account",
|
|
429
439
|
pendingLabel: "Archiving…",
|
|
430
440
|
destructive: !0,
|
|
431
|
-
pending:
|
|
432
|
-
onConfirm:
|
|
441
|
+
pending: Ye.isPending,
|
|
442
|
+
onConfirm: ot
|
|
433
443
|
}),
|
|
434
|
-
/* @__PURE__ */ S(
|
|
444
|
+
/* @__PURE__ */ S(Je, {
|
|
435
445
|
accountId: o,
|
|
436
446
|
onClose: () => {
|
|
437
447
|
l(void 0), G(void 0);
|
|
438
448
|
},
|
|
439
|
-
onRecordTransaction:
|
|
449
|
+
onRecordTransaction: st
|
|
440
450
|
}),
|
|
441
451
|
/* @__PURE__ */ S(O, {
|
|
442
|
-
open:
|
|
443
|
-
onOpenChange: (e) => !e &&
|
|
452
|
+
open: ze,
|
|
453
|
+
onOpenChange: (e) => !e && ct(),
|
|
444
454
|
children: /* @__PURE__ */ C(k, {
|
|
445
455
|
className: "max-h-[90vh] overflow-y-auto",
|
|
446
456
|
children: [
|
|
@@ -455,16 +465,16 @@ function Y() {
|
|
|
455
465
|
children: [/* @__PURE__ */ S(D, {
|
|
456
466
|
htmlFor: "tx-type",
|
|
457
467
|
children: "Type"
|
|
458
|
-
}), /* @__PURE__ */ C(
|
|
468
|
+
}), /* @__PURE__ */ C(Pe, {
|
|
459
469
|
value: K.type,
|
|
460
470
|
onValueChange: (e) => Y((t) => ({
|
|
461
471
|
...t,
|
|
462
472
|
type: e
|
|
463
473
|
})),
|
|
464
|
-
children: [/* @__PURE__ */ S(
|
|
474
|
+
children: [/* @__PURE__ */ S(Le, {
|
|
465
475
|
id: "tx-type",
|
|
466
|
-
children: /* @__PURE__ */ S(
|
|
467
|
-
}), /* @__PURE__ */ S(
|
|
476
|
+
children: /* @__PURE__ */ S(Re, {})
|
|
477
|
+
}), /* @__PURE__ */ S(Fe, { children: We.map((e) => /* @__PURE__ */ S(Ie, {
|
|
468
478
|
value: e,
|
|
469
479
|
children: e.replace(/_/g, " ")
|
|
470
480
|
}, e)) })]
|
|
@@ -584,7 +594,7 @@ function Y() {
|
|
|
584
594
|
children: [/* @__PURE__ */ S(D, {
|
|
585
595
|
htmlFor: "tx-notes",
|
|
586
596
|
children: "Notes"
|
|
587
|
-
}), /* @__PURE__ */ S(
|
|
597
|
+
}), /* @__PURE__ */ S(Ue, {
|
|
588
598
|
id: "tx-notes",
|
|
589
599
|
value: K.notes,
|
|
590
600
|
onChange: (e) => Y((t) => ({
|
|
@@ -598,12 +608,12 @@ function Y() {
|
|
|
598
608
|
}),
|
|
599
609
|
/* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(T, {
|
|
600
610
|
variant: "outline",
|
|
601
|
-
onClick:
|
|
611
|
+
onClick: ct,
|
|
602
612
|
children: "Cancel"
|
|
603
613
|
}), /* @__PURE__ */ S(T, {
|
|
604
|
-
onClick:
|
|
605
|
-
disabled: !
|
|
606
|
-
children:
|
|
614
|
+
onClick: ut,
|
|
615
|
+
disabled: !lt || Xe.isPending,
|
|
616
|
+
children: Xe.isPending ? "Saving…" : "Record transaction"
|
|
607
617
|
})] })
|
|
608
618
|
]
|
|
609
619
|
})
|
|
@@ -612,7 +622,7 @@ function Y() {
|
|
|
612
622
|
})
|
|
613
623
|
});
|
|
614
624
|
}
|
|
615
|
-
function
|
|
625
|
+
function qe({ form: e, onChange: t }) {
|
|
616
626
|
return /* @__PURE__ */ C("div", {
|
|
617
627
|
className: "grid gap-4",
|
|
618
628
|
children: [
|
|
@@ -638,16 +648,16 @@ function Ke({ form: e, onChange: t }) {
|
|
|
638
648
|
children: [/* @__PURE__ */ S(D, {
|
|
639
649
|
htmlFor: "acct-type",
|
|
640
650
|
children: "Type"
|
|
641
|
-
}), /* @__PURE__ */ C(
|
|
651
|
+
}), /* @__PURE__ */ C(Pe, {
|
|
642
652
|
value: e.type,
|
|
643
653
|
onValueChange: (e) => t((t) => ({
|
|
644
654
|
...t,
|
|
645
655
|
type: e
|
|
646
656
|
})),
|
|
647
|
-
children: [/* @__PURE__ */ S(
|
|
657
|
+
children: [/* @__PURE__ */ S(Le, {
|
|
648
658
|
id: "acct-type",
|
|
649
|
-
children: /* @__PURE__ */ S(
|
|
650
|
-
}), /* @__PURE__ */ S(
|
|
659
|
+
children: /* @__PURE__ */ S(Re, {})
|
|
660
|
+
}), /* @__PURE__ */ S(Fe, { children: G.map((e) => /* @__PURE__ */ S(Ie, {
|
|
651
661
|
value: e,
|
|
652
662
|
children: e.replace(/_/g, " ")
|
|
653
663
|
}, e)) })]
|
|
@@ -725,8 +735,8 @@ function Ke({ form: e, onChange: t }) {
|
|
|
725
735
|
]
|
|
726
736
|
});
|
|
727
737
|
}
|
|
728
|
-
function
|
|
729
|
-
let { data: i, isLoading: ee, isError: te, refetch: re } = e(t), s = a(t ? { accountId: t } : {}, { enabled: !!t }), c = t ? s.items : [], l =
|
|
738
|
+
function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
|
|
739
|
+
let { data: i, isLoading: ee, isError: te, refetch: re } = e(t), s = a(t ? { accountId: t } : {}, { enabled: !!t }), c = t ? s.items : [], l = me(() => i ? i.holdings.filter((e) => Number.isFinite(e.marketValue) && e.marketValue > 0).map((e) => ({
|
|
730
740
|
label: e.symbol,
|
|
731
741
|
value: e.marketValue
|
|
732
742
|
})).sort((e, t) => t.value - e.value) : [], [i]), p = l.reduce((e, t) => e + t.value, 0);
|
|
@@ -737,7 +747,7 @@ function qe({ accountId: t, onClose: n, onRecordTransaction: r }) {
|
|
|
737
747
|
className: "flex w-full flex-col overflow-y-auto p-0 sm:max-w-xl",
|
|
738
748
|
children: [/* @__PURE__ */ C(L, {
|
|
739
749
|
className: "border-b border-border-subtle px-6 pb-4 pt-6",
|
|
740
|
-
children: [/* @__PURE__ */ S(
|
|
750
|
+
children: [/* @__PURE__ */ S(ze, {
|
|
741
751
|
className: "text-lg",
|
|
742
752
|
children: i?.name ?? "Account"
|
|
743
753
|
}), /* @__PURE__ */ S(I, { children: i ? `${i.institution ?? "Manual account"} · ${i.type.replace(/_/g, " ")}` : "Loading account details…" })]
|
|
@@ -852,7 +862,7 @@ function qe({ accountId: t, onClose: n, onRecordTransaction: r }) {
|
|
|
852
862
|
value: "holdings",
|
|
853
863
|
className: "mt-4",
|
|
854
864
|
children: i.holdings.length === 0 ? /* @__PURE__ */ S(u, {
|
|
855
|
-
icon: /* @__PURE__ */ S(
|
|
865
|
+
icon: /* @__PURE__ */ S(ye, {
|
|
856
866
|
className: "size-6",
|
|
857
867
|
"aria-hidden": "true"
|
|
858
868
|
}),
|
|
@@ -860,7 +870,7 @@ function qe({ accountId: t, onClose: n, onRecordTransaction: r }) {
|
|
|
860
870
|
description: "This account has no positions recorded yet."
|
|
861
871
|
}) : /* @__PURE__ */ S("div", {
|
|
862
872
|
className: "overflow-x-auto rounded-lg border border-border-subtle",
|
|
863
|
-
children: /* @__PURE__ */ C(
|
|
873
|
+
children: /* @__PURE__ */ C(Be, { children: [/* @__PURE__ */ S(He, { children: /* @__PURE__ */ C(B, { children: [
|
|
864
874
|
/* @__PURE__ */ S(z, { children: "Holding" }),
|
|
865
875
|
/* @__PURE__ */ S(z, {
|
|
866
876
|
className: "text-right",
|
|
@@ -874,7 +884,7 @@ function qe({ accountId: t, onClose: n, onRecordTransaction: r }) {
|
|
|
874
884
|
className: "text-right",
|
|
875
885
|
children: "Market value"
|
|
876
886
|
})
|
|
877
|
-
] }) }), /* @__PURE__ */ S(
|
|
887
|
+
] }) }), /* @__PURE__ */ S(Ve, { children: i.holdings.map((e) => /* @__PURE__ */ C(B, {
|
|
878
888
|
className: "transition-colors hover:bg-bg-elevated",
|
|
879
889
|
children: [
|
|
880
890
|
/* @__PURE__ */ C(R, { children: [/* @__PURE__ */ S("p", {
|
|
@@ -926,7 +936,7 @@ function qe({ accountId: t, onClose: n, onRecordTransaction: r }) {
|
|
|
926
936
|
action: /* @__PURE__ */ C(T, {
|
|
927
937
|
size: "sm",
|
|
928
938
|
onClick: () => r(i.id),
|
|
929
|
-
children: [/* @__PURE__ */ S(
|
|
939
|
+
children: [/* @__PURE__ */ S(Se, {
|
|
930
940
|
className: "size-4",
|
|
931
941
|
"aria-hidden": "true"
|
|
932
942
|
}), "Record transaction"]
|