@burdenoff/microfe-brainyrich 2026.716.1 → 2026.720.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/hooks/useBrainyRichApi.d.ts +12 -4
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js +261 -210
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +306 -318
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { useBrainyRich as e } from "../providers/BrainyRichProvider.js";
|
|
2
2
|
import { tWithFallback as t } from "../utils/i18n.js";
|
|
3
|
-
import { fetchAllAccounts as n,
|
|
4
|
-
import { DonutChart as
|
|
5
|
-
import { EmptyState as
|
|
6
|
-
import { useMemo as
|
|
7
|
-
import { ChevronDown as ne, Download as re, FileText as
|
|
3
|
+
import { fetchAllAccounts as n, fetchAllHoldings as r, useAccounts as i, useAllTransactions as a, useGoalFundings as o, useGoals as s, useHouseholds as c, useNetWorthSummary as l } from "../hooks/useBrainyRichApi.js";
|
|
4
|
+
import { DonutChart as u, FadeIn as d, GlassCard as f, ProgressRing as p, Sparkline as m, StatTile as h, TrendBars as g } from "../components/viz.js";
|
|
5
|
+
import { EmptyState as _, ErrorState as v, LoadingState as y, SectionShell as ee, deltaToneClass as b, formatCompact as x, formatDate as S, formatMoney as C, statusBadgeVariant as w } from "./_shared.js";
|
|
6
|
+
import { useMemo as T, useState as te } from "react";
|
|
7
|
+
import { ChevronDown as ne, Download as re, FileText as E, Layers as D, Printer as ie, Receipt as O, Target as k, TrendingUp as A, Users as j, Wallet as M } from "lucide-react";
|
|
8
8
|
import { useI18n as ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
-
import { useQuery as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { Badge as
|
|
12
|
-
import { graphqlFetch as de } from "@burdenoff/fe-libs/shared/graphql";
|
|
9
|
+
import { useQuery as N } from "@tanstack/react-query";
|
|
10
|
+
import { jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
11
|
+
import { Badge as I, Button as oe, Card as L, CardContent as R, CardDescription as z, CardHeader as B, CardTitle as V, DropdownMenu as se, DropdownMenuContent as ce, DropdownMenuItem as H, DropdownMenuTrigger as le, Skeleton as U, Table as W, TableBody as G, TableCell as K, TableHead as q, TableHeader as J, TableRow as Y, Tabs as ue, TabsList as de, TabsTrigger as X } from "@burdenoff/fe-libs/ui";
|
|
13
12
|
//#region src/brainyrich/pages/ReportsPage.tsx
|
|
14
13
|
var fe = {
|
|
15
14
|
EQUITY: "Equity",
|
|
@@ -128,9 +127,8 @@ function $(e, t) {
|
|
|
128
127
|
function Se(e) {
|
|
129
128
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "household";
|
|
130
129
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
let { apiGatewayUrl: t } = e(), r = M({
|
|
130
|
+
function Ce() {
|
|
131
|
+
let { apiGatewayUrl: t } = e(), i = N({
|
|
134
132
|
queryKey: [
|
|
135
133
|
"brainyrich",
|
|
136
134
|
"holdings",
|
|
@@ -138,27 +136,17 @@ function we() {
|
|
|
138
136
|
],
|
|
139
137
|
queryFn: async () => {
|
|
140
138
|
let e = await n(t);
|
|
141
|
-
return (await Promise.all(e.map(
|
|
142
|
-
let n = await de({
|
|
143
|
-
gateway: "workspace",
|
|
144
|
-
baseUrl: t,
|
|
145
|
-
query: Ce,
|
|
146
|
-
variables: { accountId: e.id },
|
|
147
|
-
workspaceToken: !0
|
|
148
|
-
});
|
|
149
|
-
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Failed to load holdings");
|
|
150
|
-
return n.data?.braListHoldings ?? [];
|
|
151
|
-
}))).flat();
|
|
139
|
+
return (await Promise.all(e.map((e) => r(t, { accountId: e.id })))).flat();
|
|
152
140
|
}
|
|
153
141
|
});
|
|
154
142
|
return {
|
|
155
|
-
...
|
|
156
|
-
data:
|
|
143
|
+
...i,
|
|
144
|
+
data: i.data ?? []
|
|
157
145
|
};
|
|
158
146
|
}
|
|
159
|
-
function
|
|
160
|
-
let { t: e } = ae(), n = (n, r, i) => t(e, n, r, i), [
|
|
161
|
-
if (
|
|
147
|
+
function we() {
|
|
148
|
+
let { t: e } = ae(), n = (n, r, i) => t(e, n, r, i), [r, o] = te("networth"), [u, f] = te(), p = l(), m = Ce(), g = a(), _ = c(), v = p.data, y = v?.currency ?? "USD", b = _.data, x = u ?? b[0]?.id, w = b.find((e) => e.id === x), E = i({ householdId: x }), k = s({ householdId: x }), N = E.data, I = k.data, L = T(() => m.data.slice().sort((e, t) => t.marketValue - e.marketValue), [m.data]), R = T(() => g.data.slice().sort((e, t) => new Date(t.tradeDate).getTime() - new Date(e.tradeDate).getTime()), [g.data]), z = T(() => ve(R), [R]), B = T(() => new Set(N.map((e) => e.id)), [N]), V = T(() => L.filter((e) => B.has(e.accountId)).slice().sort((e, t) => t.marketValue - e.marketValue), [L, B]), U = T(() => R.filter((e) => B.has(e.accountId)), [R, B]), W = T(() => be(N, V), [N, V]), G = T(() => L.reduce((e, t) => e + (t.marketValue - t.costBasis), 0), [L]), K = () => {
|
|
149
|
+
if (r === "networth") {
|
|
162
150
|
if (!v) return;
|
|
163
151
|
$("brainyrich-net-worth-statement.csv", Q([
|
|
164
152
|
"Metric",
|
|
@@ -193,7 +181,7 @@ function Te() {
|
|
|
193
181
|
]));
|
|
194
182
|
return;
|
|
195
183
|
}
|
|
196
|
-
if (
|
|
184
|
+
if (r === "holdings") {
|
|
197
185
|
$("brainyrich-holdings-schedule.csv", Q([
|
|
198
186
|
"Symbol",
|
|
199
187
|
"Name",
|
|
@@ -202,7 +190,7 @@ function Te() {
|
|
|
202
190
|
"Cost Basis",
|
|
203
191
|
"Market Value",
|
|
204
192
|
"Currency"
|
|
205
|
-
],
|
|
193
|
+
], L.map((e) => [
|
|
206
194
|
e.symbol,
|
|
207
195
|
e.name ?? "",
|
|
208
196
|
Z(e.assetClass),
|
|
@@ -213,9 +201,9 @@ function Te() {
|
|
|
213
201
|
])));
|
|
214
202
|
return;
|
|
215
203
|
}
|
|
216
|
-
if (
|
|
217
|
-
if (!
|
|
218
|
-
let e =
|
|
204
|
+
if (r === "statement") {
|
|
205
|
+
if (!w) return;
|
|
206
|
+
let e = w.currency ?? y, t = [
|
|
219
207
|
"Section",
|
|
220
208
|
"Label",
|
|
221
209
|
"Amount",
|
|
@@ -224,41 +212,41 @@ function Te() {
|
|
|
224
212
|
[
|
|
225
213
|
"Summary",
|
|
226
214
|
"Net Worth",
|
|
227
|
-
|
|
215
|
+
W.netWorth,
|
|
228
216
|
e
|
|
229
217
|
],
|
|
230
218
|
[
|
|
231
219
|
"Summary",
|
|
232
220
|
"Invested Value",
|
|
233
|
-
|
|
221
|
+
W.invested,
|
|
234
222
|
e
|
|
235
223
|
],
|
|
236
224
|
[
|
|
237
225
|
"Summary",
|
|
238
226
|
"Cash & Liquidity",
|
|
239
|
-
|
|
227
|
+
W.cash,
|
|
240
228
|
e
|
|
241
229
|
],
|
|
242
|
-
...
|
|
230
|
+
...W.allocation.map((t) => [
|
|
243
231
|
"Allocation",
|
|
244
232
|
t.label,
|
|
245
233
|
t.value,
|
|
246
234
|
e
|
|
247
235
|
]),
|
|
248
|
-
...
|
|
236
|
+
...V.map((e) => [
|
|
249
237
|
"Holding",
|
|
250
238
|
`${e.symbol}${e.name ? ` — ${e.name}` : ""}`,
|
|
251
239
|
e.marketValue,
|
|
252
240
|
e.currency
|
|
253
241
|
]),
|
|
254
|
-
...
|
|
242
|
+
...I.map((e) => [
|
|
255
243
|
"Goal",
|
|
256
244
|
e.name,
|
|
257
245
|
e.targetAmount,
|
|
258
246
|
e.currency
|
|
259
247
|
])
|
|
260
248
|
];
|
|
261
|
-
$(`brainyrich-${Se(
|
|
249
|
+
$(`brainyrich-${Se(w.name)}-statement.csv`, Q(t, n));
|
|
262
250
|
return;
|
|
263
251
|
}
|
|
264
252
|
$("brainyrich-transaction-ledger.csv", Q([
|
|
@@ -270,8 +258,8 @@ function Te() {
|
|
|
270
258
|
"Amount",
|
|
271
259
|
"Fee",
|
|
272
260
|
"Currency"
|
|
273
|
-
],
|
|
274
|
-
|
|
261
|
+
], R.map((e) => [
|
|
262
|
+
S(e.tradeDate),
|
|
275
263
|
e.type,
|
|
276
264
|
e.symbol ?? "",
|
|
277
265
|
e.quantity,
|
|
@@ -280,163 +268,163 @@ function Te() {
|
|
|
280
268
|
e.fee,
|
|
281
269
|
e.currency
|
|
282
270
|
])));
|
|
283
|
-
},
|
|
284
|
-
return /* @__PURE__ */
|
|
271
|
+
}, q = r === "networth" && (p.isLoading || !v) || r === "holdings" && (m.isLoading || L.length === 0) || r === "transactions" && (g.isLoading || R.length === 0) || r === "statement" && (!w || E.isLoading);
|
|
272
|
+
return /* @__PURE__ */ F(ee, {
|
|
285
273
|
title: n("brainyrich.reports.title", "Reports & Statements"),
|
|
286
274
|
description: n("brainyrich.reports.description", "Generate statements directly from your live portfolio data — no fabricated schedules."),
|
|
287
|
-
actions: /* @__PURE__ */
|
|
275
|
+
actions: /* @__PURE__ */ F(se, { children: [/* @__PURE__ */ P(le, {
|
|
288
276
|
asChild: !0,
|
|
289
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ F(oe, {
|
|
290
278
|
size: "sm",
|
|
291
|
-
disabled:
|
|
279
|
+
disabled: q,
|
|
292
280
|
"aria-label": n("brainyrich.reports.actions.export", "Print / Export"),
|
|
293
281
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ P(re, {
|
|
295
283
|
className: "size-4",
|
|
296
284
|
"aria-hidden": "true"
|
|
297
285
|
}),
|
|
298
286
|
n("brainyrich.reports.actions.export", "Print / Export"),
|
|
299
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ P(ne, {
|
|
300
288
|
className: "size-4",
|
|
301
289
|
"aria-hidden": "true"
|
|
302
290
|
})
|
|
303
291
|
]
|
|
304
292
|
})
|
|
305
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), /* @__PURE__ */ F(ce, {
|
|
306
294
|
align: "end",
|
|
307
|
-
children: [/* @__PURE__ */
|
|
308
|
-
onSelect:
|
|
309
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ F(H, {
|
|
296
|
+
onSelect: K,
|
|
297
|
+
children: [/* @__PURE__ */ P(re, {
|
|
310
298
|
className: "size-4",
|
|
311
299
|
"aria-hidden": "true"
|
|
312
300
|
}), n("brainyrich.reports.actions.downloadCsv", "Download CSV")]
|
|
313
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ F(H, {
|
|
314
302
|
onSelect: () => window.print(),
|
|
315
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ P(ie, {
|
|
316
304
|
className: "size-4",
|
|
317
305
|
"aria-hidden": "true"
|
|
318
306
|
}), n("brainyrich.reports.actions.print", "Print statement")]
|
|
319
307
|
})]
|
|
320
308
|
})] }),
|
|
321
309
|
children: [
|
|
322
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ P(d, { children: /* @__PURE__ */ F("div", {
|
|
323
311
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
324
312
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ P(h, {
|
|
326
314
|
label: n("brainyrich.reports.kpis.netWorth", "Net Worth"),
|
|
327
|
-
value: v ?
|
|
328
|
-
spark:
|
|
315
|
+
value: v ? C(v.totalNetWorth, y) : "—",
|
|
316
|
+
spark: z.netSeries,
|
|
329
317
|
glow: !0
|
|
330
318
|
}),
|
|
331
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ P(h, {
|
|
332
320
|
label: n("brainyrich.reports.kpis.marketValue", "Invested Value"),
|
|
333
|
-
value: v ?
|
|
334
|
-
icon: /* @__PURE__ */
|
|
321
|
+
value: v ? C(v.totalMarketValue, y) : "—",
|
|
322
|
+
icon: /* @__PURE__ */ P(A, {
|
|
335
323
|
className: "size-4",
|
|
336
324
|
"aria-hidden": "true"
|
|
337
325
|
})
|
|
338
326
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ P(h, {
|
|
340
328
|
label: n("brainyrich.reports.kpis.holdings", "Holdings on Schedule"),
|
|
341
|
-
value: String(
|
|
342
|
-
icon: /* @__PURE__ */
|
|
329
|
+
value: String(L.length),
|
|
330
|
+
icon: /* @__PURE__ */ P(D, {
|
|
343
331
|
className: "size-4",
|
|
344
332
|
"aria-hidden": "true"
|
|
345
333
|
})
|
|
346
334
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ P(h, {
|
|
348
336
|
label: n("brainyrich.reports.kpis.transactions", "Ledger Entries"),
|
|
349
|
-
value: String(
|
|
350
|
-
icon: /* @__PURE__ */
|
|
337
|
+
value: String(R.length),
|
|
338
|
+
icon: /* @__PURE__ */ P(O, {
|
|
351
339
|
className: "size-4",
|
|
352
340
|
"aria-hidden": "true"
|
|
353
341
|
})
|
|
354
342
|
})
|
|
355
343
|
]
|
|
356
344
|
}) }),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
value:
|
|
359
|
-
onValueChange: (e) =>
|
|
360
|
-
children: /* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ P(ue, {
|
|
346
|
+
value: r,
|
|
347
|
+
onValueChange: (e) => o(e),
|
|
348
|
+
children: /* @__PURE__ */ F(de, { children: [
|
|
349
|
+
/* @__PURE__ */ F(X, {
|
|
362
350
|
value: "networth",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ P(M, {
|
|
364
352
|
className: "size-4",
|
|
365
353
|
"aria-hidden": "true"
|
|
366
354
|
}), n("brainyrich.reports.tabs.netWorth", "Net Worth")]
|
|
367
355
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ F(X, {
|
|
369
357
|
value: "holdings",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ P(D, {
|
|
371
359
|
className: "size-4",
|
|
372
360
|
"aria-hidden": "true"
|
|
373
361
|
}), n("brainyrich.reports.tabs.holdings", "Holdings")]
|
|
374
362
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ F(X, {
|
|
376
364
|
value: "transactions",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ P(O, {
|
|
378
366
|
className: "size-4",
|
|
379
367
|
"aria-hidden": "true"
|
|
380
368
|
}), n("brainyrich.reports.tabs.ledger", "Ledger")]
|
|
381
369
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ F(X, {
|
|
383
371
|
value: "statement",
|
|
384
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ P(j, {
|
|
385
373
|
className: "size-4",
|
|
386
374
|
"aria-hidden": "true"
|
|
387
375
|
}), n("brainyrich.reports.tabs.statement", "Client Statement")]
|
|
388
376
|
})
|
|
389
377
|
] })
|
|
390
378
|
}),
|
|
391
|
-
|
|
379
|
+
r === "networth" ? /* @__PURE__ */ P(Te, {
|
|
392
380
|
query: p,
|
|
393
|
-
cashflow:
|
|
394
|
-
netSeries:
|
|
381
|
+
cashflow: z.bars,
|
|
382
|
+
netSeries: z.netSeries,
|
|
395
383
|
translate: n
|
|
396
|
-
}) :
|
|
397
|
-
query:
|
|
398
|
-
holdings:
|
|
399
|
-
unrealized:
|
|
384
|
+
}) : r === "holdings" ? /* @__PURE__ */ P(Ee, {
|
|
385
|
+
query: m,
|
|
386
|
+
holdings: L,
|
|
387
|
+
unrealized: G,
|
|
400
388
|
translate: n
|
|
401
|
-
}) :
|
|
389
|
+
}) : r === "transactions" ? /* @__PURE__ */ P(De, {
|
|
402
390
|
query: g,
|
|
403
|
-
transactions:
|
|
404
|
-
cashflow:
|
|
391
|
+
transactions: R,
|
|
392
|
+
cashflow: z.bars,
|
|
405
393
|
currency: y,
|
|
406
394
|
translate: n
|
|
407
|
-
}) : /* @__PURE__ */
|
|
395
|
+
}) : /* @__PURE__ */ P(Oe, {
|
|
408
396
|
householdsQuery: _,
|
|
409
397
|
households: b,
|
|
410
|
-
activeHousehold:
|
|
398
|
+
activeHousehold: w,
|
|
411
399
|
onSelect: f,
|
|
412
|
-
accountsQuery:
|
|
413
|
-
goals:
|
|
414
|
-
holdings:
|
|
415
|
-
transactions:
|
|
416
|
-
statement:
|
|
400
|
+
accountsQuery: E,
|
|
401
|
+
goals: I,
|
|
402
|
+
holdings: V,
|
|
403
|
+
transactions: U,
|
|
404
|
+
statement: W,
|
|
417
405
|
translate: n
|
|
418
406
|
})
|
|
419
407
|
]
|
|
420
408
|
});
|
|
421
409
|
}
|
|
422
|
-
function
|
|
423
|
-
let i = e.data, a = i?.currency ?? "USD", o =
|
|
410
|
+
function Te({ query: e, cashflow: t, netSeries: n, translate: r }) {
|
|
411
|
+
let i = e.data, a = i?.currency ?? "USD", o = T(() => i ? i.byAssetClass.slice().sort((e, t) => t.marketValue - e.marketValue).map((e) => ({
|
|
424
412
|
label: Z(e.assetClass),
|
|
425
413
|
value: e.marketValue,
|
|
426
414
|
tone: pe[e.assetClass]
|
|
427
415
|
})) : [], [i]);
|
|
428
|
-
if (e.isLoading) return /* @__PURE__ */
|
|
416
|
+
if (e.isLoading) return /* @__PURE__ */ P(L, { children: /* @__PURE__ */ P(R, {
|
|
429
417
|
className: "p-6",
|
|
430
|
-
children: /* @__PURE__ */
|
|
418
|
+
children: /* @__PURE__ */ P(y, { rows: 3 })
|
|
431
419
|
}) });
|
|
432
|
-
if (e.isError) return /* @__PURE__ */
|
|
420
|
+
if (e.isError) return /* @__PURE__ */ P(L, { children: /* @__PURE__ */ P(R, {
|
|
433
421
|
className: "p-6",
|
|
434
|
-
children: /* @__PURE__ */
|
|
422
|
+
children: /* @__PURE__ */ P(v, { onRetry: () => e.refetch() })
|
|
435
423
|
}) });
|
|
436
|
-
if (!i) return /* @__PURE__ */
|
|
424
|
+
if (!i) return /* @__PURE__ */ P(L, { children: /* @__PURE__ */ P(R, {
|
|
437
425
|
className: "p-6",
|
|
438
|
-
children: /* @__PURE__ */
|
|
439
|
-
icon: /* @__PURE__ */
|
|
426
|
+
children: /* @__PURE__ */ P(_, {
|
|
427
|
+
icon: /* @__PURE__ */ P(M, {
|
|
440
428
|
className: "size-6",
|
|
441
429
|
"aria-hidden": "true"
|
|
442
430
|
}),
|
|
@@ -444,17 +432,17 @@ function Ee({ query: e, cashflow: t, netSeries: n, translate: r }) {
|
|
|
444
432
|
description: r("brainyrich.reports.netWorth.emptyDesc", "Link an account and add holdings to generate a net-worth statement.")
|
|
445
433
|
})
|
|
446
434
|
}) });
|
|
447
|
-
let s = r("brainyrich.reports.netWorth.asOf", "as of {date}", { date:
|
|
448
|
-
return /* @__PURE__ */
|
|
435
|
+
let s = r("brainyrich.reports.netWorth.asOf", "as of {date}", { date: S((/* @__PURE__ */ new Date()).toISOString()) });
|
|
436
|
+
return /* @__PURE__ */ F("div", {
|
|
449
437
|
className: "space-y-6",
|
|
450
438
|
children: [
|
|
451
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ F("div", {
|
|
452
440
|
className: "grid gap-6 lg:grid-cols-[1.1fr_1fr]",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ P(d, { children: /* @__PURE__ */ F(f, {
|
|
454
442
|
glow: !0,
|
|
455
443
|
className: "h-full",
|
|
456
444
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ F("p", {
|
|
458
446
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
459
447
|
children: [
|
|
460
448
|
r("brainyrich.reports.netWorth.title", "Net Worth Statement"),
|
|
@@ -462,205 +450,205 @@ function Ee({ query: e, cashflow: t, netSeries: n, translate: r }) {
|
|
|
462
450
|
s
|
|
463
451
|
]
|
|
464
452
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ P("p", {
|
|
466
454
|
className: "mt-2 text-4xl font-semibold tracking-tight text-text-primary",
|
|
467
|
-
children:
|
|
455
|
+
children: C(i.totalNetWorth, a)
|
|
468
456
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ F("div", {
|
|
470
458
|
className: "mt-3 flex flex-wrap gap-2",
|
|
471
459
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ F("span", {
|
|
473
461
|
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-1 text-xs text-text-secondary",
|
|
474
|
-
children: [r("brainyrich.reports.netWorth.invested", "Invested"), /* @__PURE__ */
|
|
462
|
+
children: [r("brainyrich.reports.netWorth.invested", "Invested"), /* @__PURE__ */ P("span", {
|
|
475
463
|
className: "font-medium text-text-primary",
|
|
476
|
-
children:
|
|
464
|
+
children: C(i.totalMarketValue, a)
|
|
477
465
|
})]
|
|
478
466
|
}),
|
|
479
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ F("span", {
|
|
480
468
|
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-1 text-xs text-text-secondary",
|
|
481
|
-
children: [r("brainyrich.reports.netWorth.cash", "Cash"), /* @__PURE__ */
|
|
469
|
+
children: [r("brainyrich.reports.netWorth.cash", "Cash"), /* @__PURE__ */ P("span", {
|
|
482
470
|
className: "font-medium text-text-primary",
|
|
483
|
-
children:
|
|
471
|
+
children: C(i.totalCash, a)
|
|
484
472
|
})]
|
|
485
473
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ F("span", {
|
|
487
475
|
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-1 text-xs text-text-secondary",
|
|
488
|
-
children: [r("brainyrich.reports.netWorth.accounts", "Accounts"), /* @__PURE__ */
|
|
476
|
+
children: [r("brainyrich.reports.netWorth.accounts", "Accounts"), /* @__PURE__ */ P("span", {
|
|
489
477
|
className: "font-medium text-text-primary",
|
|
490
478
|
children: i.accountCount
|
|
491
479
|
})]
|
|
492
480
|
})
|
|
493
481
|
]
|
|
494
482
|
}),
|
|
495
|
-
n.length > 1 ? /* @__PURE__ */
|
|
483
|
+
n.length > 1 ? /* @__PURE__ */ F("div", {
|
|
496
484
|
className: "mt-5",
|
|
497
|
-
children: [/* @__PURE__ */
|
|
485
|
+
children: [/* @__PURE__ */ P("p", {
|
|
498
486
|
className: "mb-1 text-[11px] text-text-secondary",
|
|
499
487
|
children: r("brainyrich.reports.netWorth.netFlow", "Cumulative net cash flow (recent months)")
|
|
500
|
-
}), /* @__PURE__ */
|
|
488
|
+
}), /* @__PURE__ */ P(m, {
|
|
501
489
|
data: n,
|
|
502
490
|
height: 48
|
|
503
491
|
})]
|
|
504
492
|
}) : null
|
|
505
493
|
]
|
|
506
|
-
}) }), /* @__PURE__ */
|
|
494
|
+
}) }), /* @__PURE__ */ P(d, {
|
|
507
495
|
index: 1,
|
|
508
|
-
children: /* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ F(L, {
|
|
509
497
|
className: "h-full",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
498
|
+
children: [/* @__PURE__ */ P(B, { children: /* @__PURE__ */ P(V, {
|
|
511
499
|
className: "text-base",
|
|
512
500
|
children: r("brainyrich.reports.netWorth.allocation", "Allocation by Asset Class")
|
|
513
|
-
}) }), /* @__PURE__ */
|
|
501
|
+
}) }), /* @__PURE__ */ P(R, { children: o.length > 0 ? /* @__PURE__ */ P(u, {
|
|
514
502
|
data: o,
|
|
515
503
|
centerLabel: r("brainyrich.reports.netWorth.invested", "Invested"),
|
|
516
|
-
centerValue:
|
|
517
|
-
valueFormatter: (e) =>
|
|
518
|
-
}) : /* @__PURE__ */
|
|
504
|
+
centerValue: x(i.totalMarketValue, a),
|
|
505
|
+
valueFormatter: (e) => C(e, a)
|
|
506
|
+
}) : /* @__PURE__ */ P("p", {
|
|
519
507
|
className: "text-sm text-text-secondary",
|
|
520
508
|
children: r("brainyrich.reports.netWorth.noAllocation", "No holdings to allocate yet.")
|
|
521
509
|
}) })]
|
|
522
510
|
})
|
|
523
511
|
})]
|
|
524
512
|
}),
|
|
525
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ P(d, {
|
|
526
514
|
index: 2,
|
|
527
|
-
children: /* @__PURE__ */
|
|
515
|
+
children: /* @__PURE__ */ F(L, { children: [/* @__PURE__ */ P(B, { children: /* @__PURE__ */ F(V, {
|
|
528
516
|
className: "flex items-center gap-2 text-base",
|
|
529
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ P(M, {
|
|
530
518
|
className: "size-4",
|
|
531
519
|
"aria-hidden": "true"
|
|
532
520
|
}), r("brainyrich.reports.netWorth.schedule", "By Asset Class")]
|
|
533
|
-
}) }), /* @__PURE__ */
|
|
521
|
+
}) }), /* @__PURE__ */ P(R, { children: o.length > 0 ? /* @__PURE__ */ P("div", {
|
|
534
522
|
className: "overflow-x-auto",
|
|
535
|
-
children: /* @__PURE__ */
|
|
523
|
+
children: /* @__PURE__ */ F(W, { children: [/* @__PURE__ */ P(J, { children: /* @__PURE__ */ F(Y, { children: [/* @__PURE__ */ P(q, { children: r("brainyrich.reports.netWorth.assetClass", "Asset class") }), /* @__PURE__ */ P(q, {
|
|
536
524
|
className: "text-right",
|
|
537
525
|
children: r("brainyrich.reports.netWorth.total", "Total")
|
|
538
|
-
})] }) }), /* @__PURE__ */
|
|
526
|
+
})] }) }), /* @__PURE__ */ F(G, { children: [o.map((e) => /* @__PURE__ */ F(Y, {
|
|
539
527
|
className: "transition-colors hover:bg-bg-elevated/60",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ P(K, {
|
|
541
529
|
className: "font-medium text-text-primary",
|
|
542
530
|
children: e.label
|
|
543
|
-
}), /* @__PURE__ */
|
|
531
|
+
}), /* @__PURE__ */ P(K, {
|
|
544
532
|
className: "text-right tabular-nums text-text-primary",
|
|
545
|
-
children:
|
|
533
|
+
children: C(e.value, a)
|
|
546
534
|
})]
|
|
547
|
-
}, e.label)), /* @__PURE__ */
|
|
535
|
+
}, e.label)), /* @__PURE__ */ F(Y, { children: [/* @__PURE__ */ P(K, {
|
|
548
536
|
className: "font-semibold text-text-primary",
|
|
549
537
|
children: r("brainyrich.reports.netWorth.totals", "Totals")
|
|
550
|
-
}), /* @__PURE__ */
|
|
538
|
+
}), /* @__PURE__ */ P(K, {
|
|
551
539
|
className: "text-right font-semibold tabular-nums text-status-success-text",
|
|
552
|
-
children:
|
|
540
|
+
children: C(i.totalMarketValue, a)
|
|
553
541
|
})] })] })] })
|
|
554
|
-
}) : /* @__PURE__ */
|
|
542
|
+
}) : /* @__PURE__ */ P("p", {
|
|
555
543
|
className: "text-sm text-text-secondary",
|
|
556
544
|
children: r("brainyrich.reports.netWorth.noAllocation", "No holdings to allocate yet.")
|
|
557
545
|
}) })] })
|
|
558
546
|
}),
|
|
559
|
-
t.length > 0 ? /* @__PURE__ */
|
|
547
|
+
t.length > 0 ? /* @__PURE__ */ P(d, {
|
|
560
548
|
index: 3,
|
|
561
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ F(L, { children: [/* @__PURE__ */ F(B, { children: [/* @__PURE__ */ F(V, {
|
|
562
550
|
className: "flex items-center gap-2 text-base",
|
|
563
|
-
children: [/* @__PURE__ */
|
|
551
|
+
children: [/* @__PURE__ */ P(A, {
|
|
564
552
|
className: "size-4",
|
|
565
553
|
"aria-hidden": "true"
|
|
566
554
|
}), r("brainyrich.reports.cashflow.title", "Cash Flow")]
|
|
567
|
-
}), /* @__PURE__ */
|
|
555
|
+
}), /* @__PURE__ */ P(z, { children: r("brainyrich.reports.cashflow.description", "Inflows and outflows recorded on your ledger, by month.") })] }), /* @__PURE__ */ P(R, { children: /* @__PURE__ */ P(g, {
|
|
568
556
|
data: t,
|
|
569
|
-
valueFormatter: (e) =>
|
|
557
|
+
valueFormatter: (e) => x(e, a)
|
|
570
558
|
}) })] })
|
|
571
559
|
}) : null
|
|
572
560
|
]
|
|
573
561
|
});
|
|
574
562
|
}
|
|
575
|
-
function
|
|
563
|
+
function Ee({ query: e, holdings: t, unrealized: n, translate: r }) {
|
|
576
564
|
let i = t.reduce((e, t) => e + t.marketValue, 0), a = t.reduce((e, t) => e + t.costBasis, 0), o = t[0]?.currency ?? "USD";
|
|
577
|
-
return /* @__PURE__ */
|
|
565
|
+
return /* @__PURE__ */ F("div", {
|
|
578
566
|
className: "space-y-6",
|
|
579
|
-
children: [!e.isLoading && !e.isError && t.length > 0 ? /* @__PURE__ */
|
|
567
|
+
children: [!e.isLoading && !e.isError && t.length > 0 ? /* @__PURE__ */ P(d, { children: /* @__PURE__ */ F("div", {
|
|
580
568
|
className: "grid gap-4 sm:grid-cols-3",
|
|
581
569
|
children: [
|
|
582
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ P(h, {
|
|
583
571
|
label: r("brainyrich.reports.holdings.marketValue", "Market Value"),
|
|
584
|
-
value:
|
|
572
|
+
value: C(i, o),
|
|
585
573
|
glow: !0
|
|
586
574
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ P(h, {
|
|
588
576
|
label: r("brainyrich.reports.holdings.costBasis", "Cost Basis"),
|
|
589
|
-
value:
|
|
577
|
+
value: C(a, o)
|
|
590
578
|
}),
|
|
591
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ P(h, {
|
|
592
580
|
label: r("brainyrich.reports.holdings.gainLoss", "Unrealized"),
|
|
593
|
-
value:
|
|
581
|
+
value: C(n, o),
|
|
594
582
|
delta: a > 0 ? n / a * 100 : void 0,
|
|
595
583
|
sparkTone: n >= 0 ? "success" : "error"
|
|
596
584
|
})
|
|
597
585
|
]
|
|
598
|
-
}) }) : null, /* @__PURE__ */
|
|
586
|
+
}) }) : null, /* @__PURE__ */ P(d, {
|
|
599
587
|
index: 1,
|
|
600
|
-
children: /* @__PURE__ */
|
|
588
|
+
children: /* @__PURE__ */ F(L, { children: [/* @__PURE__ */ F(B, { children: [/* @__PURE__ */ F(V, {
|
|
601
589
|
className: "flex items-center gap-2",
|
|
602
|
-
children: [/* @__PURE__ */
|
|
590
|
+
children: [/* @__PURE__ */ P(D, {
|
|
603
591
|
className: "size-5",
|
|
604
592
|
"aria-hidden": "true"
|
|
605
593
|
}), r("brainyrich.reports.holdings.title", "Holdings Schedule")]
|
|
606
|
-
}), /* @__PURE__ */
|
|
594
|
+
}), /* @__PURE__ */ P(z, { children: r("brainyrich.reports.holdings.description", "Every position across your portfolios with cost basis and market value.") })] }), /* @__PURE__ */ P(R, { children: e.isLoading ? /* @__PURE__ */ P(y, { rows: 4 }) : e.isError ? /* @__PURE__ */ P(v, { onRetry: () => e.refetch() }) : t.length > 0 ? /* @__PURE__ */ P("div", {
|
|
607
595
|
className: "overflow-x-auto",
|
|
608
|
-
children: /* @__PURE__ */
|
|
609
|
-
/* @__PURE__ */
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */
|
|
596
|
+
children: /* @__PURE__ */ F(W, { children: [/* @__PURE__ */ P(J, { children: /* @__PURE__ */ F(Y, { children: [
|
|
597
|
+
/* @__PURE__ */ P(q, { children: r("brainyrich.reports.holdings.symbol", "Symbol") }),
|
|
598
|
+
/* @__PURE__ */ P(q, { children: r("brainyrich.reports.holdings.assetClass", "Asset Class") }),
|
|
599
|
+
/* @__PURE__ */ P(q, {
|
|
612
600
|
className: "text-right",
|
|
613
601
|
children: r("brainyrich.reports.holdings.quantity", "Quantity")
|
|
614
602
|
}),
|
|
615
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ P(q, {
|
|
616
604
|
className: "text-right",
|
|
617
605
|
children: r("brainyrich.reports.holdings.costBasis", "Cost Basis")
|
|
618
606
|
}),
|
|
619
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ P(q, {
|
|
620
608
|
className: "text-right",
|
|
621
609
|
children: r("brainyrich.reports.holdings.marketValue", "Market Value")
|
|
622
610
|
}),
|
|
623
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ P(q, {
|
|
624
612
|
className: "text-right",
|
|
625
613
|
children: r("brainyrich.reports.holdings.gainLoss", "Unrealized")
|
|
626
614
|
})
|
|
627
|
-
] }) }), /* @__PURE__ */
|
|
615
|
+
] }) }), /* @__PURE__ */ P(G, { children: t.map((e) => {
|
|
628
616
|
let t = e.marketValue - e.costBasis;
|
|
629
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ F(Y, {
|
|
630
618
|
className: "transition-colors hover:bg-bg-elevated/60",
|
|
631
619
|
children: [
|
|
632
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ F(K, { children: [/* @__PURE__ */ P("div", {
|
|
633
621
|
className: "font-medium text-text-primary",
|
|
634
622
|
children: e.symbol
|
|
635
|
-
}), e.name ? /* @__PURE__ */
|
|
623
|
+
}), e.name ? /* @__PURE__ */ P("div", {
|
|
636
624
|
className: "text-xs text-text-secondary",
|
|
637
625
|
children: e.name
|
|
638
626
|
}) : null] }),
|
|
639
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ P(K, { children: /* @__PURE__ */ P(I, {
|
|
640
628
|
variant: "outline",
|
|
641
629
|
children: Z(e.assetClass)
|
|
642
630
|
}) }),
|
|
643
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ P(K, {
|
|
644
632
|
className: "text-right tabular-nums text-text-primary",
|
|
645
633
|
children: e.quantity
|
|
646
634
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ P(K, {
|
|
648
636
|
className: "text-right tabular-nums text-text-primary",
|
|
649
|
-
children:
|
|
637
|
+
children: C(e.costBasis, e.currency)
|
|
650
638
|
}),
|
|
651
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ P(K, {
|
|
652
640
|
className: "text-right tabular-nums text-text-primary",
|
|
653
|
-
children:
|
|
641
|
+
children: C(e.marketValue, e.currency)
|
|
654
642
|
}),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
className: `text-right tabular-nums font-medium ${
|
|
657
|
-
children: [t > 0 ? "+" : "",
|
|
643
|
+
/* @__PURE__ */ F(K, {
|
|
644
|
+
className: `text-right tabular-nums font-medium ${b(t)}`,
|
|
645
|
+
children: [t > 0 ? "+" : "", C(t, e.currency)]
|
|
658
646
|
})
|
|
659
647
|
]
|
|
660
648
|
}, e.id);
|
|
661
649
|
}) })] })
|
|
662
|
-
}) : /* @__PURE__ */
|
|
663
|
-
icon: /* @__PURE__ */
|
|
650
|
+
}) : /* @__PURE__ */ P(_, {
|
|
651
|
+
icon: /* @__PURE__ */ P(D, {
|
|
664
652
|
className: "size-6",
|
|
665
653
|
"aria-hidden": "true"
|
|
666
654
|
}),
|
|
@@ -670,102 +658,102 @@ function De({ query: e, holdings: t, unrealized: n, translate: r }) {
|
|
|
670
658
|
})]
|
|
671
659
|
});
|
|
672
660
|
}
|
|
673
|
-
function
|
|
674
|
-
let a =
|
|
675
|
-
return /* @__PURE__ */
|
|
661
|
+
function De({ query: e, transactions: t, cashflow: n, currency: r, translate: i }) {
|
|
662
|
+
let a = T(() => ye(t), [t]), o = !e.isLoading && !e.isError && t.length > 0;
|
|
663
|
+
return /* @__PURE__ */ F("div", {
|
|
676
664
|
className: "space-y-6",
|
|
677
665
|
children: [
|
|
678
|
-
o ? /* @__PURE__ */
|
|
666
|
+
o ? /* @__PURE__ */ P(d, { children: /* @__PURE__ */ F("div", {
|
|
679
667
|
className: "grid gap-4 sm:grid-cols-3",
|
|
680
668
|
children: [
|
|
681
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ P(h, {
|
|
682
670
|
label: i("brainyrich.reports.ledger.inflow", "Total Inflow"),
|
|
683
|
-
value:
|
|
671
|
+
value: C(a.inflow, r),
|
|
684
672
|
sparkTone: "success"
|
|
685
673
|
}),
|
|
686
|
-
/* @__PURE__ */
|
|
674
|
+
/* @__PURE__ */ P(h, {
|
|
687
675
|
label: i("brainyrich.reports.ledger.outflow", "Total Outflow"),
|
|
688
|
-
value:
|
|
676
|
+
value: C(a.outflow, r),
|
|
689
677
|
sparkTone: "error"
|
|
690
678
|
}),
|
|
691
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ P(h, {
|
|
692
680
|
label: i("brainyrich.reports.ledger.net", "Net Flow"),
|
|
693
|
-
value:
|
|
681
|
+
value: C(a.net, r),
|
|
694
682
|
glow: a.net >= 0,
|
|
695
683
|
delta: a.inflow > 0 ? a.net / a.inflow * 100 : void 0
|
|
696
684
|
})
|
|
697
685
|
]
|
|
698
686
|
}) }) : null,
|
|
699
|
-
o && n.length > 0 ? /* @__PURE__ */
|
|
687
|
+
o && n.length > 0 ? /* @__PURE__ */ P(d, {
|
|
700
688
|
index: 1,
|
|
701
|
-
children: /* @__PURE__ */
|
|
689
|
+
children: /* @__PURE__ */ F(L, { children: [/* @__PURE__ */ P(B, { children: /* @__PURE__ */ F(V, {
|
|
702
690
|
className: "flex items-center gap-2 text-base",
|
|
703
|
-
children: [/* @__PURE__ */
|
|
691
|
+
children: [/* @__PURE__ */ P(A, {
|
|
704
692
|
className: "size-4",
|
|
705
693
|
"aria-hidden": "true"
|
|
706
694
|
}), i("brainyrich.reports.cashflow.title", "Cash Flow")]
|
|
707
|
-
}) }), /* @__PURE__ */
|
|
695
|
+
}) }), /* @__PURE__ */ P(R, { children: /* @__PURE__ */ P(g, {
|
|
708
696
|
data: n,
|
|
709
|
-
valueFormatter: (e) =>
|
|
697
|
+
valueFormatter: (e) => x(e, r)
|
|
710
698
|
}) })] })
|
|
711
699
|
}) : null,
|
|
712
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ P(d, {
|
|
713
701
|
index: 2,
|
|
714
|
-
children: /* @__PURE__ */
|
|
702
|
+
children: /* @__PURE__ */ F(L, { children: [/* @__PURE__ */ F(B, { children: [/* @__PURE__ */ F(V, {
|
|
715
703
|
className: "flex items-center gap-2",
|
|
716
|
-
children: [/* @__PURE__ */
|
|
704
|
+
children: [/* @__PURE__ */ P(O, {
|
|
717
705
|
className: "size-5",
|
|
718
706
|
"aria-hidden": "true"
|
|
719
707
|
}), i("brainyrich.reports.ledger.title", "Transaction Ledger")]
|
|
720
|
-
}), /* @__PURE__ */
|
|
708
|
+
}), /* @__PURE__ */ P(z, { children: i("brainyrich.reports.ledger.description", "Every recorded transaction across your accounts, newest first.") })] }), /* @__PURE__ */ P(R, { children: e.isLoading ? /* @__PURE__ */ P(y, { rows: 4 }) : e.isError ? /* @__PURE__ */ P(v, { onRetry: () => e.refetch() }) : t.length > 0 ? /* @__PURE__ */ P("div", {
|
|
721
709
|
className: "overflow-x-auto",
|
|
722
|
-
children: /* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
/* @__PURE__ */
|
|
710
|
+
children: /* @__PURE__ */ F(W, { children: [/* @__PURE__ */ P(J, { children: /* @__PURE__ */ F(Y, { children: [
|
|
711
|
+
/* @__PURE__ */ P(q, { children: i("brainyrich.reports.ledger.date", "Trade Date") }),
|
|
712
|
+
/* @__PURE__ */ P(q, { children: i("brainyrich.reports.ledger.type", "Type") }),
|
|
713
|
+
/* @__PURE__ */ P(q, { children: i("brainyrich.reports.ledger.symbol", "Symbol") }),
|
|
714
|
+
/* @__PURE__ */ P(q, {
|
|
727
715
|
className: "text-right",
|
|
728
716
|
children: i("brainyrich.reports.ledger.quantity", "Quantity")
|
|
729
717
|
}),
|
|
730
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ P(q, {
|
|
731
719
|
className: "text-right",
|
|
732
720
|
children: i("brainyrich.reports.ledger.price", "Price")
|
|
733
721
|
}),
|
|
734
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ P(q, {
|
|
735
723
|
className: "text-right",
|
|
736
724
|
children: i("brainyrich.reports.ledger.amount", "Amount")
|
|
737
725
|
})
|
|
738
|
-
] }) }), /* @__PURE__ */
|
|
726
|
+
] }) }), /* @__PURE__ */ P(G, { children: t.map((e) => /* @__PURE__ */ F(Y, {
|
|
739
727
|
className: "transition-colors hover:bg-bg-elevated/60",
|
|
740
728
|
children: [
|
|
741
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ P(K, {
|
|
742
730
|
className: "text-text-primary",
|
|
743
|
-
children:
|
|
731
|
+
children: S(e.tradeDate)
|
|
744
732
|
}),
|
|
745
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ P(K, { children: /* @__PURE__ */ P(I, {
|
|
746
734
|
variant: "outline",
|
|
747
735
|
children: e.type
|
|
748
736
|
}) }),
|
|
749
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ P(K, {
|
|
750
738
|
className: "text-text-primary",
|
|
751
739
|
children: e.symbol ?? "—"
|
|
752
740
|
}),
|
|
753
|
-
/* @__PURE__ */
|
|
741
|
+
/* @__PURE__ */ P(K, {
|
|
754
742
|
className: "text-right tabular-nums text-text-primary",
|
|
755
743
|
children: e.quantity
|
|
756
744
|
}),
|
|
757
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ P(K, {
|
|
758
746
|
className: "text-right tabular-nums text-text-primary",
|
|
759
|
-
children:
|
|
747
|
+
children: C(e.price, e.currency)
|
|
760
748
|
}),
|
|
761
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ P(K, {
|
|
762
750
|
className: "text-right tabular-nums text-text-primary",
|
|
763
|
-
children:
|
|
751
|
+
children: C(e.amount, e.currency)
|
|
764
752
|
})
|
|
765
753
|
]
|
|
766
754
|
}, e.id)) })] })
|
|
767
|
-
}) : /* @__PURE__ */
|
|
768
|
-
icon: /* @__PURE__ */
|
|
755
|
+
}) : /* @__PURE__ */ P(_, {
|
|
756
|
+
icon: /* @__PURE__ */ P(E, {
|
|
769
757
|
className: "size-6",
|
|
770
758
|
"aria-hidden": "true"
|
|
771
759
|
}),
|
|
@@ -776,243 +764,243 @@ function Oe({ query: e, transactions: t, cashflow: n, currency: r, translate: i
|
|
|
776
764
|
]
|
|
777
765
|
});
|
|
778
766
|
}
|
|
779
|
-
function
|
|
780
|
-
if (e.isLoading) return /* @__PURE__ */
|
|
767
|
+
function Oe({ householdsQuery: e, households: t, activeHousehold: n, onSelect: r, accountsQuery: i, goals: a, holdings: o, transactions: s, statement: c, translate: l }) {
|
|
768
|
+
if (e.isLoading) return /* @__PURE__ */ P(L, { children: /* @__PURE__ */ F(R, {
|
|
781
769
|
className: "space-y-3 p-6",
|
|
782
|
-
children: [/* @__PURE__ */
|
|
770
|
+
children: [/* @__PURE__ */ P(U, { className: "h-8 w-64" }), /* @__PURE__ */ P(U, { className: "h-40 w-full" })]
|
|
783
771
|
}) });
|
|
784
|
-
if (e.isError) return /* @__PURE__ */
|
|
772
|
+
if (e.isError) return /* @__PURE__ */ P(L, { children: /* @__PURE__ */ P(R, {
|
|
785
773
|
className: "p-6",
|
|
786
|
-
children: /* @__PURE__ */
|
|
774
|
+
children: /* @__PURE__ */ P(v, { onRetry: () => e.refetch() })
|
|
787
775
|
}) });
|
|
788
|
-
if (t.length === 0 || !n) return /* @__PURE__ */
|
|
776
|
+
if (t.length === 0 || !n) return /* @__PURE__ */ P(L, { children: /* @__PURE__ */ P(R, {
|
|
789
777
|
className: "p-6",
|
|
790
|
-
children: /* @__PURE__ */
|
|
791
|
-
icon: /* @__PURE__ */
|
|
778
|
+
children: /* @__PURE__ */ P(_, {
|
|
779
|
+
icon: /* @__PURE__ */ P(j, {
|
|
792
780
|
className: "size-6",
|
|
793
781
|
"aria-hidden": "true"
|
|
794
782
|
}),
|
|
795
|
-
title:
|
|
796
|
-
description:
|
|
783
|
+
title: l("brainyrich.reports.statement.emptyTitle", "No households yet"),
|
|
784
|
+
description: l("brainyrich.reports.statement.emptyDesc", "Create a household to generate a branded client wealth statement.")
|
|
797
785
|
})
|
|
798
786
|
}) });
|
|
799
|
-
let
|
|
800
|
-
return /* @__PURE__ */
|
|
787
|
+
let p = n.currency ?? "USD", h = ve(s).netSeries, g = S((/* @__PURE__ */ new Date()).toISOString());
|
|
788
|
+
return /* @__PURE__ */ F("div", {
|
|
801
789
|
className: "space-y-4",
|
|
802
|
-
children: [/* @__PURE__ */
|
|
790
|
+
children: [/* @__PURE__ */ F("div", {
|
|
803
791
|
className: "flex flex-wrap items-center gap-3",
|
|
804
|
-
children: [/* @__PURE__ */
|
|
792
|
+
children: [/* @__PURE__ */ P("span", {
|
|
805
793
|
className: "text-sm text-text-secondary",
|
|
806
|
-
children:
|
|
807
|
-
}), /* @__PURE__ */
|
|
794
|
+
children: l("brainyrich.reports.statement.for", "Statement for")
|
|
795
|
+
}), /* @__PURE__ */ F(se, { children: [/* @__PURE__ */ P(le, {
|
|
808
796
|
asChild: !0,
|
|
809
|
-
children: /* @__PURE__ */
|
|
797
|
+
children: /* @__PURE__ */ F(oe, {
|
|
810
798
|
variant: "outline",
|
|
811
799
|
size: "sm",
|
|
812
800
|
children: [
|
|
813
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ P(j, {
|
|
814
802
|
className: "size-4",
|
|
815
803
|
"aria-hidden": "true"
|
|
816
804
|
}),
|
|
817
805
|
n.name,
|
|
818
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ P(ne, {
|
|
819
807
|
className: "size-4",
|
|
820
808
|
"aria-hidden": "true"
|
|
821
809
|
})
|
|
822
810
|
]
|
|
823
811
|
})
|
|
824
|
-
}), /* @__PURE__ */
|
|
812
|
+
}), /* @__PURE__ */ P(ce, {
|
|
825
813
|
align: "start",
|
|
826
814
|
className: "max-h-72 overflow-y-auto",
|
|
827
|
-
children: t.map((e) => /* @__PURE__ */
|
|
815
|
+
children: t.map((e) => /* @__PURE__ */ P(H, {
|
|
828
816
|
onSelect: () => r(e.id),
|
|
829
817
|
children: e.name
|
|
830
818
|
}, e.id))
|
|
831
819
|
})] })]
|
|
832
|
-
}), i.isLoading ? /* @__PURE__ */
|
|
820
|
+
}), i.isLoading ? /* @__PURE__ */ P(L, { children: /* @__PURE__ */ P(R, {
|
|
833
821
|
className: "p-6",
|
|
834
|
-
children: /* @__PURE__ */
|
|
835
|
-
}) }) : i.isError ? /* @__PURE__ */
|
|
822
|
+
children: /* @__PURE__ */ P(y, { rows: 3 })
|
|
823
|
+
}) }) : i.isError ? /* @__PURE__ */ P(L, { children: /* @__PURE__ */ P(R, {
|
|
836
824
|
className: "p-6",
|
|
837
|
-
children: /* @__PURE__ */
|
|
838
|
-
}) }) : /* @__PURE__ */
|
|
825
|
+
children: /* @__PURE__ */ P(v, { onRetry: () => i.refetch() })
|
|
826
|
+
}) }) : /* @__PURE__ */ P(d, { children: /* @__PURE__ */ F(f, {
|
|
839
827
|
glow: !0,
|
|
840
828
|
className: "space-y-6",
|
|
841
829
|
children: [
|
|
842
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ F("div", {
|
|
843
831
|
className: "flex items-start justify-between gap-4 border-b border-border-subtle pb-4",
|
|
844
|
-
children: [/* @__PURE__ */
|
|
832
|
+
children: [/* @__PURE__ */ F("div", {
|
|
845
833
|
className: "flex items-center gap-3",
|
|
846
|
-
children: [/* @__PURE__ */
|
|
834
|
+
children: [/* @__PURE__ */ P("div", {
|
|
847
835
|
className: "flex size-10 items-center justify-center rounded-xl bg-[var(--color-action-primary-bg)] text-sm font-bold text-[var(--color-action-primary-text)]",
|
|
848
836
|
children: "BR"
|
|
849
|
-
}), /* @__PURE__ */
|
|
837
|
+
}), /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("h2", {
|
|
850
838
|
className: "text-lg font-semibold text-text-primary",
|
|
851
839
|
children: n.name
|
|
852
|
-
}), /* @__PURE__ */
|
|
840
|
+
}), /* @__PURE__ */ F("p", {
|
|
853
841
|
className: "text-xs text-text-secondary",
|
|
854
842
|
children: [
|
|
855
|
-
|
|
843
|
+
l("brainyrich.reports.statement.subtitle", "Wealth Statement"),
|
|
856
844
|
" ·",
|
|
857
845
|
" ",
|
|
858
|
-
|
|
846
|
+
g
|
|
859
847
|
]
|
|
860
848
|
})] })]
|
|
861
|
-
}), /* @__PURE__ */
|
|
862
|
-
variant:
|
|
849
|
+
}), /* @__PURE__ */ P(I, {
|
|
850
|
+
variant: w(n.status),
|
|
863
851
|
children: n.status
|
|
864
852
|
})]
|
|
865
853
|
}),
|
|
866
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ F("div", {
|
|
867
855
|
className: "grid gap-6 md:grid-cols-2",
|
|
868
|
-
children: [/* @__PURE__ */
|
|
869
|
-
/* @__PURE__ */
|
|
856
|
+
children: [/* @__PURE__ */ F("div", { children: [
|
|
857
|
+
/* @__PURE__ */ P("p", {
|
|
870
858
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
871
|
-
children:
|
|
859
|
+
children: l("brainyrich.reports.statement.netWorth", "Net Worth")
|
|
872
860
|
}),
|
|
873
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ P("p", {
|
|
874
862
|
className: "mt-1 text-3xl font-semibold tracking-tight text-text-primary",
|
|
875
|
-
children:
|
|
863
|
+
children: C(c.netWorth, p)
|
|
876
864
|
}),
|
|
877
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ F("div", {
|
|
878
866
|
className: "mt-2 flex flex-wrap gap-2 text-xs text-text-secondary",
|
|
879
867
|
children: [
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
|
|
868
|
+
/* @__PURE__ */ F("span", { children: [
|
|
869
|
+
l("brainyrich.reports.netWorth.invested", "Invested"),
|
|
882
870
|
" ",
|
|
883
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ P("span", {
|
|
884
872
|
className: "font-medium text-text-primary",
|
|
885
|
-
children:
|
|
873
|
+
children: C(c.invested, p)
|
|
886
874
|
})
|
|
887
875
|
] }),
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
|
|
876
|
+
/* @__PURE__ */ P("span", { children: "·" }),
|
|
877
|
+
/* @__PURE__ */ F("span", { children: [
|
|
878
|
+
l("brainyrich.reports.netWorth.cash", "Cash"),
|
|
891
879
|
" ",
|
|
892
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ P("span", {
|
|
893
881
|
className: "font-medium text-text-primary",
|
|
894
|
-
children:
|
|
882
|
+
children: C(c.cash, p)
|
|
895
883
|
})
|
|
896
884
|
] })
|
|
897
885
|
]
|
|
898
886
|
}),
|
|
899
|
-
h.length > 1 ? /* @__PURE__ */
|
|
887
|
+
h.length > 1 ? /* @__PURE__ */ P(m, {
|
|
900
888
|
data: h,
|
|
901
889
|
height: 44,
|
|
902
890
|
className: "mt-4"
|
|
903
891
|
}) : null
|
|
904
|
-
] }), /* @__PURE__ */
|
|
892
|
+
] }), /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
905
893
|
className: "mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
906
|
-
children:
|
|
907
|
-
}), c.allocation.length > 0 ? /* @__PURE__ */
|
|
894
|
+
children: l("brainyrich.reports.statement.allocation", "Asset Allocation")
|
|
895
|
+
}), c.allocation.length > 0 ? /* @__PURE__ */ P(u, {
|
|
908
896
|
data: c.allocation,
|
|
909
897
|
height: 200,
|
|
910
|
-
valueFormatter: (e) =>
|
|
911
|
-
}) : /* @__PURE__ */
|
|
898
|
+
valueFormatter: (e) => C(e, p)
|
|
899
|
+
}) : /* @__PURE__ */ P("p", {
|
|
912
900
|
className: "text-sm text-text-secondary",
|
|
913
|
-
children:
|
|
901
|
+
children: l("brainyrich.reports.netWorth.noAllocation", "No holdings to allocate yet.")
|
|
914
902
|
})] })]
|
|
915
903
|
}),
|
|
916
|
-
o.length > 0 ? /* @__PURE__ */
|
|
904
|
+
o.length > 0 ? /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
917
905
|
className: "mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
918
|
-
children:
|
|
919
|
-
}), /* @__PURE__ */
|
|
906
|
+
children: l("brainyrich.reports.statement.holdings", "Holdings Schedule")
|
|
907
|
+
}), /* @__PURE__ */ P("div", {
|
|
920
908
|
className: "overflow-x-auto rounded-lg border border-border-subtle",
|
|
921
|
-
children: /* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
909
|
+
children: /* @__PURE__ */ F(W, { children: [/* @__PURE__ */ P(J, { children: /* @__PURE__ */ F(Y, { children: [
|
|
910
|
+
/* @__PURE__ */ P(q, { children: l("brainyrich.reports.holdings.symbol", "Symbol") }),
|
|
911
|
+
/* @__PURE__ */ P(q, { children: l("brainyrich.reports.holdings.assetClass", "Asset Class") }),
|
|
912
|
+
/* @__PURE__ */ P(q, {
|
|
925
913
|
className: "text-right",
|
|
926
|
-
children:
|
|
914
|
+
children: l("brainyrich.reports.holdings.quantity", "Quantity")
|
|
927
915
|
}),
|
|
928
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ P(q, {
|
|
929
917
|
className: "text-right",
|
|
930
|
-
children:
|
|
918
|
+
children: l("brainyrich.reports.holdings.marketValue", "Market Value")
|
|
931
919
|
})
|
|
932
|
-
] }) }), /* @__PURE__ */
|
|
920
|
+
] }) }), /* @__PURE__ */ P(G, { children: o.map((e) => /* @__PURE__ */ F(Y, {
|
|
933
921
|
className: "transition-colors hover:bg-bg-elevated/60",
|
|
934
922
|
children: [
|
|
935
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ F(K, { children: [/* @__PURE__ */ P("div", {
|
|
936
924
|
className: "font-medium text-text-primary",
|
|
937
925
|
children: e.symbol
|
|
938
|
-
}), e.name ? /* @__PURE__ */
|
|
926
|
+
}), e.name ? /* @__PURE__ */ P("div", {
|
|
939
927
|
className: "text-xs text-text-secondary",
|
|
940
928
|
children: e.name
|
|
941
929
|
}) : null] }),
|
|
942
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ P(K, { children: /* @__PURE__ */ P(I, {
|
|
943
931
|
variant: "outline",
|
|
944
932
|
children: Z(e.assetClass)
|
|
945
933
|
}) }),
|
|
946
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ P(K, {
|
|
947
935
|
className: "text-right tabular-nums text-text-primary",
|
|
948
936
|
children: e.quantity
|
|
949
937
|
}),
|
|
950
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ P(K, {
|
|
951
939
|
className: "text-right tabular-nums text-text-primary",
|
|
952
|
-
children:
|
|
940
|
+
children: C(e.marketValue, e.currency)
|
|
953
941
|
})
|
|
954
942
|
]
|
|
955
943
|
}, e.id)) })] })
|
|
956
944
|
})] }) : null,
|
|
957
|
-
a.length > 0 ? /* @__PURE__ */
|
|
945
|
+
a.length > 0 ? /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
958
946
|
className: "mb-3 text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
959
|
-
children:
|
|
960
|
-
}), /* @__PURE__ */
|
|
947
|
+
children: l("brainyrich.reports.statement.goals", "Progress-to-Goals")
|
|
948
|
+
}), /* @__PURE__ */ P("div", {
|
|
961
949
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
962
|
-
children: a.map((e) => /* @__PURE__ */
|
|
950
|
+
children: a.map((e) => /* @__PURE__ */ P(ke, {
|
|
963
951
|
goal: e,
|
|
964
952
|
accountValues: c.accountValues,
|
|
965
|
-
translate:
|
|
953
|
+
translate: l
|
|
966
954
|
}, e.id))
|
|
967
955
|
})] }) : null,
|
|
968
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ P("p", {
|
|
969
957
|
className: "border-t border-border-subtle pt-4 text-center text-xs text-text-secondary",
|
|
970
|
-
children:
|
|
958
|
+
children: l("brainyrich.reports.statement.footer", "BrainyRich · Confidential")
|
|
971
959
|
})
|
|
972
960
|
]
|
|
973
961
|
}) })]
|
|
974
962
|
});
|
|
975
963
|
}
|
|
976
|
-
function
|
|
977
|
-
let r =
|
|
964
|
+
function ke({ goal: e, accountValues: t, translate: n }) {
|
|
965
|
+
let r = o(e.id), i = T(() => r.data.reduce((e, n) => {
|
|
978
966
|
if (n.fixedAmount != null) return e + n.fixedAmount;
|
|
979
967
|
let r = t.get(n.accountId) ?? 0;
|
|
980
968
|
return e + n.allocationPct / 100 * r;
|
|
981
969
|
}, 0), [r.data, t]);
|
|
982
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ F("div", {
|
|
983
971
|
className: "flex flex-col items-center gap-2 rounded-xl border border-border-subtle bg-bg-surface p-4 text-center transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))]",
|
|
984
972
|
children: [
|
|
985
|
-
/* @__PURE__ */
|
|
973
|
+
/* @__PURE__ */ P(p, {
|
|
986
974
|
value: e.targetAmount > 0 ? Math.min(100, i / e.targetAmount * 100) : 0,
|
|
987
975
|
tone: xe(e.projection),
|
|
988
976
|
size: 104
|
|
989
977
|
}),
|
|
990
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ F("div", {
|
|
991
979
|
className: "flex items-center gap-1.5",
|
|
992
|
-
children: [/* @__PURE__ */
|
|
980
|
+
children: [/* @__PURE__ */ P(k, {
|
|
993
981
|
className: "size-3.5 text-text-secondary",
|
|
994
982
|
"aria-hidden": "true"
|
|
995
|
-
}), /* @__PURE__ */
|
|
983
|
+
}), /* @__PURE__ */ P("span", {
|
|
996
984
|
className: "text-sm font-medium text-text-primary",
|
|
997
985
|
children: e.name
|
|
998
986
|
})]
|
|
999
987
|
}),
|
|
1000
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ F("p", {
|
|
1001
989
|
className: "text-xs text-text-secondary",
|
|
1002
990
|
children: [
|
|
1003
|
-
|
|
991
|
+
C(i, e.currency),
|
|
1004
992
|
" / ",
|
|
1005
|
-
|
|
993
|
+
C(e.targetAmount, e.currency)
|
|
1006
994
|
]
|
|
1007
995
|
}),
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
variant:
|
|
996
|
+
/* @__PURE__ */ P(I, {
|
|
997
|
+
variant: w(e.projection),
|
|
1010
998
|
children: n(`brainyrich.goals.projection.${e.projection}`, e.projection.replace(/_/g, " "))
|
|
1011
999
|
})
|
|
1012
1000
|
]
|
|
1013
1001
|
});
|
|
1014
1002
|
}
|
|
1015
1003
|
//#endregion
|
|
1016
|
-
export {
|
|
1004
|
+
export { we as ReportsPage };
|
|
1017
1005
|
|
|
1018
1006
|
//# sourceMappingURL=ReportsPage.js.map
|