@burdenoff/microfe-brainyrich 2026.828.2 → 2026.830.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,14 @@
1
1
  import { useAccounts as e, useAllTransactions as t, useHoldings as n, useNetWorthSummary as r, useRecordTransaction as i } from "../hooks/useBrainyRichApi.js";
2
- import { DonutChart as a, FadeIn as o, GlassCard as s, ProgressRing as ee, StatTile as c, TrendBars as te } from "../components/viz.js";
2
+ import { useTr as a } from "../hooks/useTr.js";
3
+ import { DonutChart as o, FadeIn as s, GlassCard as c, ProgressRing as ee, StatTile as l, TrendBars as te } from "../components/viz.js";
3
4
  import "../components/index.js";
4
- import { EmptyState as l, ErrorState as u, LoadingState as d, SectionShell as f, formatCompact as ne, formatDate as re, formatMoney as p, formatPct as ie } from "./_shared.js";
5
- import { useMemo as m, useState as ae } from "react";
6
- import { ArrowDownRight as oe, ArrowUpRight as h, BarChart3 as g, Coins as se, Minus as _, PieChart as ce, Plus as le, TrendingDown as ue, TrendingUp as de, Wallet as v } from "lucide-react";
7
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
8
- import { Badge as fe, Button as x, Card as S, CardContent as C, CardDescription as w, CardHeader as T, CardTitle as pe, Input as me, Label as E, ResponsiveDialog as he, ResponsiveDialogContent as ge, ResponsiveDialogDescription as _e, ResponsiveDialogFooter as ve, ResponsiveDialogHeader as ye, ResponsiveDialogTitle as be, ResponsiveDialogTrigger as xe, Select as Se, SelectContent as Ce, SelectItem as we, SelectTrigger as Te, SelectValue as D, Table as O, TableBody as k, TableCell as A, TableHead as j, TableHeader as M, TableRow as N, Tabs as Ee, TabsContent as P, TabsList as De, TabsTrigger as F, Textarea as Oe } from "@burdenoff/fe-libs/ui";
5
+ import { EmptyState as u, ErrorState as ne, LoadingState as d, SectionShell as re, formatCompact as ie, formatDate as ae, formatMoney as f, formatPct as oe } from "./_shared.js";
6
+ import { useMemo as p, useState as se } from "react";
7
+ import { ArrowDownRight as m, ArrowUpRight as ce, BarChart3 as h, Coins as le, Minus as g, PieChart as ue, Plus as de, TrendingDown as fe, TrendingUp as pe, Wallet as _ } from "lucide-react";
8
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
9
+ import { Badge as me, Button as b, Card as he, CardContent as ge, CardDescription as _e, CardHeader as ve, CardTitle as ye, Input as x, Label as S, ResponsiveDialog as be, ResponsiveDialogContent as xe, ResponsiveDialogDescription as Se, ResponsiveDialogFooter as Ce, ResponsiveDialogHeader as we, ResponsiveDialogTitle as Te, ResponsiveDialogTrigger as Ee, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Table as O, TableBody as k, TableCell as A, TableHead as j, TableHeader as M, TableRow as N, Tabs as De, TabsContent as P, TabsList as Oe, TabsTrigger as F, Textarea as ke } from "@burdenoff/fe-libs/ui";
9
10
  //#region src/brainyrich/pages/AnalyticsPage.tsx
10
- var ke = {
11
+ var Ae = {
11
12
  EQUITY: "brand",
12
13
  FIXED_INCOME: "blue",
13
14
  CASH: "teal",
@@ -24,7 +25,7 @@ var ke = {
24
25
  "WITHDRAWAL",
25
26
  "FEE",
26
27
  "BUY"
27
- ], z = (e) => L.includes(e) ? "in" : R.includes(e) ? "out" : "neutral", Ae = (e) => {
28
+ ], z = (e) => L.includes(e) ? "in" : R.includes(e) ? "out" : "neutral", je = (e) => {
28
29
  let t = new Date(e);
29
30
  return Number.isNaN(t.getTime()) ? null : {
30
31
  key: `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}`,
@@ -33,10 +34,10 @@ var ke = {
33
34
  year: "numeric"
34
35
  }).format(t)
35
36
  };
36
- }, je = (e) => {
37
+ }, Me = (e) => {
37
38
  let t = /* @__PURE__ */ new Map();
38
39
  for (let n of e) {
39
- let e = Ae(n.tradeDate);
40
+ let e = je(n.tradeDate);
40
41
  if (!e) continue;
41
42
  let r = z(n.type);
42
43
  if (r === "neutral") continue;
@@ -49,7 +50,7 @@ var ke = {
49
50
  r === "in" ? a.inflow += i : a.outflow += i, t.set(e.key, a);
50
51
  }
51
52
  return Array.from(t.values()).sort((e, t) => e.key.localeCompare(t.key));
52
- }, Me = (e) => {
53
+ }, Ne = (e) => {
53
54
  let t = /* @__PURE__ */ new Map();
54
55
  for (let n of e) t.set(n.type, (t.get(n.type) ?? 0) + Math.abs(n.amount));
55
56
  return Array.from(t.entries()).map(([e, t]) => ({
@@ -59,17 +60,17 @@ var ke = {
59
60
  })).sort((e, t) => t.total - e.total);
60
61
  };
61
62
  function B({ value: e, currency: t, pct: n }) {
62
- let r = e > 0, i = e < 0, a = r ? h : i ? oe : _, o = r ? "text-status-success-text" : i ? "text-status-error-text" : "text-text-secondary", s = r ? "+" : i ? "-" : "", ee = n != null && Number.isFinite(n);
63
- return /* @__PURE__ */ b("span", {
63
+ let r = e > 0, i = e < 0, a = r ? ce : i ? m : g, o = r ? "text-status-success-text" : i ? "text-status-error-text" : "text-text-secondary", s = r ? "+" : i ? "-" : "", c = n != null && Number.isFinite(n);
64
+ return /* @__PURE__ */ y("span", {
64
65
  className: `inline-flex items-center justify-end gap-1 font-medium tabular-nums ${o}`,
65
66
  children: [
66
- /* @__PURE__ */ y(a, {
67
+ /* @__PURE__ */ v(a, {
67
68
  className: "size-3.5 shrink-0",
68
69
  "aria-hidden": "true"
69
70
  }),
70
71
  s,
71
- p(Math.abs(e), t),
72
- ee ? /* @__PURE__ */ b("span", {
72
+ f(Math.abs(e), t),
73
+ c ? /* @__PURE__ */ y("span", {
73
74
  className: "text-xs opacity-80",
74
75
  children: [
75
76
  "(",
@@ -88,7 +89,7 @@ var V = {
88
89
  symbol: "",
89
90
  tradeDate: "",
90
91
  notes: ""
91
- }, Ne = [
92
+ }, Pe = [
92
93
  "DEPOSIT",
93
94
  "WITHDRAWAL",
94
95
  "DIVIDEND",
@@ -98,17 +99,17 @@ var V = {
98
99
  "SELL",
99
100
  "TRANSFER"
100
101
  ];
101
- function H() {
102
- let _ = r(), L = t(), R = e(), [z, Ae] = ae(void 0), H = R.data, Pe = z ?? H[0]?.id, U = n({ accountId: Pe }), W = i(), [Fe, G] = ae(!1), [K, q] = ae(V), J = _.data, Y = J?.currency ?? "USD", X = L.data, Ie = m(() => !J || J.totalMarketValue <= 0 ? [] : J.byAssetClass.filter((e) => e.marketValue !== 0).map((e) => ({
102
+ function Fe() {
103
+ let g = a(), L = r(), R = t(), z = e(), [je, Fe] = se(void 0), H = z.data, Ie = je ?? H[0]?.id, U = n({ accountId: Ie }), W = i(), [Le, G] = se(!1), [K, q] = se(V), J = L.data, Y = J?.currency ?? "USD", X = R.data, Re = p(() => !J || J.totalMarketValue <= 0 ? [] : J.byAssetClass.filter((e) => e.marketValue !== 0).map((e) => ({
103
104
  label: I(e.assetClass),
104
105
  value: e.marketValue / J.totalMarketValue * 100,
105
- caption: p(e.marketValue, Y),
106
+ caption: f(e.marketValue, Y),
106
107
  tone: "accent"
107
- })).sort((e, t) => t.value - e.value), [J, Y]), Le = m(() => !J || J.totalMarketValue <= 0 ? [] : J.byAssetClass.filter((e) => e.marketValue > 0).map((e) => ({
108
+ })).sort((e, t) => t.value - e.value), [J, Y]), ze = p(() => !J || J.totalMarketValue <= 0 ? [] : J.byAssetClass.filter((e) => e.marketValue > 0).map((e) => ({
108
109
  label: I(e.assetClass),
109
110
  value: e.marketValue,
110
- tone: ke[e.assetClass]
111
- })).sort((e, t) => t.value - e.value), [J]), Re = m(() => !J || J.totalMarketValue + J.totalCash <= 0 ? [] : [{
111
+ tone: Ae[e.assetClass]
112
+ })).sort((e, t) => t.value - e.value), [J]), Be = p(() => !J || J.totalMarketValue + J.totalCash <= 0 ? [] : [{
112
113
  label: "Invested",
113
114
  value: J.totalMarketValue,
114
115
  tone: "brand"
@@ -116,11 +117,11 @@ function H() {
116
117
  label: "Cash",
117
118
  value: J.totalCash,
118
119
  tone: "teal"
119
- }].filter((e) => e.value > 0), [J]), ze = m(() => {
120
+ }].filter((e) => e.value > 0), [J]), Ve = p(() => {
120
121
  if (!J) return 0;
121
122
  let e = J.totalMarketValue + J.totalCash;
122
123
  return e > 0 ? J.totalMarketValue / e * 100 : 0;
123
- }, [J]), Z = m(() => je(X), [X]), Be = m(() => Me(X), [X]), Q = m(() => {
124
+ }, [J]), Z = p(() => Me(X), [X]), He = p(() => Ne(X), [X]), Q = p(() => {
124
125
  let e = 0, t = 0;
125
126
  for (let n of Z) e += n.inflow, t += n.outflow;
126
127
  return {
@@ -128,8 +129,8 @@ function H() {
128
129
  outflow: t,
129
130
  net: e - t
130
131
  };
131
- }, [Z]), Ve = m(() => Z.map((e) => e.inflow - e.outflow), [Z]), He = U.data, $ = m(() => {
132
- let e = He.map((e) => {
132
+ }, [Z]), Ue = p(() => Z.map((e) => e.inflow - e.outflow), [Z]), We = U.data, $ = p(() => {
133
+ let e = We.map((e) => {
133
134
  let t = e.marketValue - e.costBasis;
134
135
  return {
135
136
  holding: e,
@@ -140,102 +141,102 @@ function H() {
140
141
  return {
141
142
  rows: e,
142
143
  totalUnrealized: e.reduce((e, t) => e + t.unrealized, 0),
143
- totalCost: He.reduce((e, t) => e + t.costBasis, 0),
144
+ totalCost: We.reduce((e, t) => e + t.costBasis, 0),
144
145
  gainers: e.filter((e) => e.unrealized > 0).slice(0, 4),
145
146
  losers: e.filter((e) => e.unrealized < 0).sort((e, t) => e.unrealized - t.unrealized).slice(0, 4)
146
147
  };
147
- }, [He]);
148
- if (_.isLoading) return /* @__PURE__ */ y(f, {
149
- title: "Wealth Analytics",
150
- description: "Allocation, cash flow, and holdings performance derived from your real accounts.",
151
- children: /* @__PURE__ */ y(d, { rows: 5 })
148
+ }, [We]);
149
+ if (L.isLoading) return /* @__PURE__ */ v(re, {
150
+ title: g("brainyrich.analytics.title", "Wealth Analytics"),
151
+ description: g("brainyrich.analytics.description", "Allocation, cash flow, and holdings performance derived from your real accounts."),
152
+ children: /* @__PURE__ */ v(d, { rows: 5 })
152
153
  });
153
- if (_.isError || !J) return /* @__PURE__ */ y(f, {
154
- title: "Wealth Analytics",
155
- description: "Allocation, cash flow, and holdings performance derived from your real accounts.",
156
- children: /* @__PURE__ */ y(u, {
154
+ if (L.isError || !J) return /* @__PURE__ */ v(re, {
155
+ title: g("brainyrich.analytics.title", "Wealth Analytics"),
156
+ description: g("brainyrich.analytics.description", "Allocation, cash flow, and holdings performance derived from your real accounts."),
157
+ children: /* @__PURE__ */ v(ne, {
157
158
  title: "Could not load analytics",
158
159
  description: "We couldn't reach the wealth service. Please retry.",
159
- onRetry: () => _.refetch()
160
+ onRetry: () => L.refetch()
160
161
  })
161
162
  });
162
- let Ue = Number(K.amount), We = !!K.accountId && !!K.tradeDate && K.amount.trim() !== "" && Number.isFinite(Ue) && Ue > 0 && !W.isPending, Ge = /* @__PURE__ */ b(he, {
163
- open: Fe,
163
+ let Ge = Number(K.amount), Ke = !!K.accountId && !!K.tradeDate && K.amount.trim() !== "" && Number.isFinite(Ge) && Ge > 0 && !W.isPending, qe = /* @__PURE__ */ y(be, {
164
+ open: Le,
164
165
  onOpenChange: (e) => {
165
166
  G(e), e || q(V);
166
167
  },
167
- children: [/* @__PURE__ */ y(xe, {
168
+ children: [/* @__PURE__ */ v(Ee, {
168
169
  asChild: !0,
169
- children: /* @__PURE__ */ b(x, {
170
+ children: /* @__PURE__ */ y(b, {
170
171
  size: "sm",
171
- children: [/* @__PURE__ */ y(le, {
172
+ children: [/* @__PURE__ */ v(de, {
172
173
  className: "mr-1 size-4",
173
174
  "aria-hidden": "true"
174
175
  }), "Record Transaction"]
175
176
  })
176
- }), /* @__PURE__ */ b(ge, { children: [
177
- /* @__PURE__ */ b(ye, { children: [/* @__PURE__ */ y(be, { children: "Record Transaction" }), /* @__PURE__ */ y(_e, { children: "Log a real cash flow or trade. It updates your cash-flow analytics immediately." })] }),
178
- H.length === 0 ? /* @__PURE__ */ y(l, {
179
- icon: /* @__PURE__ */ y(v, {
177
+ }), /* @__PURE__ */ y(xe, { children: [
178
+ /* @__PURE__ */ y(we, { children: [/* @__PURE__ */ v(Te, { children: "Record Transaction" }), /* @__PURE__ */ v(Se, { children: "Log a real cash flow or trade. It updates your cash-flow analytics immediately." })] }),
179
+ H.length === 0 ? /* @__PURE__ */ v(u, {
180
+ icon: /* @__PURE__ */ v(_, {
180
181
  className: "size-6",
181
182
  "aria-hidden": "true"
182
183
  }),
183
184
  title: "Create an account first",
184
185
  description: "You need at least one account before you can record a transaction. Open the Accounts page to add one, then come back here."
185
- }) : /* @__PURE__ */ b("div", {
186
+ }) : /* @__PURE__ */ y("div", {
186
187
  className: "space-y-4",
187
188
  children: [
188
- /* @__PURE__ */ b("div", {
189
+ /* @__PURE__ */ y("div", {
189
190
  className: "space-y-1.5",
190
- children: [/* @__PURE__ */ y(E, {
191
+ children: [/* @__PURE__ */ v(S, {
191
192
  htmlFor: "tx-account",
192
193
  children: "Account"
193
- }), /* @__PURE__ */ b(Se, {
194
+ }), /* @__PURE__ */ y(C, {
194
195
  value: K.accountId,
195
196
  onValueChange: (e) => q((t) => ({
196
197
  ...t,
197
198
  accountId: e
198
199
  })),
199
- children: [/* @__PURE__ */ y(Te, {
200
+ children: [/* @__PURE__ */ v(E, {
200
201
  id: "tx-account",
201
- children: /* @__PURE__ */ y(D, { placeholder: "Select an account" })
202
- }), /* @__PURE__ */ y(Ce, { children: H.map((e) => /* @__PURE__ */ y(we, {
202
+ children: /* @__PURE__ */ v(D, { placeholder: "Select an account" })
203
+ }), /* @__PURE__ */ v(w, { children: H.map((e) => /* @__PURE__ */ v(T, {
203
204
  value: e.id,
204
205
  children: e.name
205
206
  }, e.id)) })]
206
207
  })]
207
208
  }),
208
- /* @__PURE__ */ b("div", {
209
+ /* @__PURE__ */ y("div", {
209
210
  className: "grid grid-cols-2 gap-4",
210
- children: [/* @__PURE__ */ b("div", {
211
+ children: [/* @__PURE__ */ y("div", {
211
212
  className: "space-y-1.5",
212
- children: [/* @__PURE__ */ y(E, {
213
+ children: [/* @__PURE__ */ v(S, {
213
214
  htmlFor: "tx-type",
214
215
  children: "Type"
215
- }), /* @__PURE__ */ b(Se, {
216
+ }), /* @__PURE__ */ y(C, {
216
217
  value: K.type,
217
218
  onValueChange: (e) => q((t) => ({
218
219
  ...t,
219
220
  type: e
220
221
  })),
221
- children: [/* @__PURE__ */ y(Te, {
222
+ children: [/* @__PURE__ */ v(E, {
222
223
  id: "tx-type",
223
- children: /* @__PURE__ */ y(D, {})
224
- }), /* @__PURE__ */ y(Ce, { children: Ne.map((e) => /* @__PURE__ */ y(we, {
224
+ children: /* @__PURE__ */ v(D, {})
225
+ }), /* @__PURE__ */ v(w, { children: Pe.map((e) => /* @__PURE__ */ v(T, {
225
226
  value: e,
226
227
  children: I(e)
227
228
  }, e)) })]
228
229
  })]
229
- }), /* @__PURE__ */ b("div", {
230
+ }), /* @__PURE__ */ y("div", {
230
231
  className: "space-y-1.5",
231
- children: [/* @__PURE__ */ b(E, {
232
+ children: [/* @__PURE__ */ y(S, {
232
233
  htmlFor: "tx-amount",
233
234
  children: [
234
235
  "Amount (",
235
236
  Y,
236
237
  ")"
237
238
  ]
238
- }), /* @__PURE__ */ y(me, {
239
+ }), /* @__PURE__ */ v(x, {
239
240
  id: "tx-amount",
240
241
  type: "number",
241
242
  min: "0",
@@ -250,14 +251,14 @@ function H() {
250
251
  })]
251
252
  })]
252
253
  }),
253
- /* @__PURE__ */ b("div", {
254
+ /* @__PURE__ */ y("div", {
254
255
  className: "grid grid-cols-2 gap-4",
255
- children: [/* @__PURE__ */ b("div", {
256
+ children: [/* @__PURE__ */ y("div", {
256
257
  className: "space-y-1.5",
257
- children: [/* @__PURE__ */ y(E, {
258
+ children: [/* @__PURE__ */ v(S, {
258
259
  htmlFor: "tx-date",
259
260
  children: "Trade date"
260
- }), /* @__PURE__ */ y(me, {
261
+ }), /* @__PURE__ */ v(x, {
261
262
  id: "tx-date",
262
263
  type: "date",
263
264
  value: K.tradeDate,
@@ -266,12 +267,12 @@ function H() {
266
267
  tradeDate: e.target.value
267
268
  }))
268
269
  })]
269
- }), /* @__PURE__ */ b("div", {
270
+ }), /* @__PURE__ */ y("div", {
270
271
  className: "space-y-1.5",
271
- children: [/* @__PURE__ */ y(E, {
272
+ children: [/* @__PURE__ */ v(S, {
272
273
  htmlFor: "tx-symbol",
273
274
  children: "Symbol (optional)"
274
- }), /* @__PURE__ */ y(me, {
275
+ }), /* @__PURE__ */ v(x, {
275
276
  id: "tx-symbol",
276
277
  placeholder: "e.g. AAPL",
277
278
  value: K.symbol,
@@ -282,12 +283,12 @@ function H() {
282
283
  })]
283
284
  })]
284
285
  }),
285
- /* @__PURE__ */ b("div", {
286
+ /* @__PURE__ */ y("div", {
286
287
  className: "space-y-1.5",
287
- children: [/* @__PURE__ */ y(E, {
288
+ children: [/* @__PURE__ */ v(S, {
288
289
  htmlFor: "tx-notes",
289
290
  children: "Notes (optional)"
290
- }), /* @__PURE__ */ y(Oe, {
291
+ }), /* @__PURE__ */ v(ke, {
291
292
  id: "tx-notes",
292
293
  rows: 2,
293
294
  placeholder: "Context for this transaction",
@@ -298,22 +299,22 @@ function H() {
298
299
  }))
299
300
  })]
300
301
  }),
301
- W.isError ? /* @__PURE__ */ y("p", {
302
+ W.isError ? /* @__PURE__ */ v("p", {
302
303
  className: "text-sm text-status-error-text",
303
304
  children: W.error instanceof Error ? W.error.message : "Could not record transaction."
304
305
  }) : null
305
306
  ]
306
307
  }),
307
- /* @__PURE__ */ b(ve, { children: [/* @__PURE__ */ y(x, {
308
+ /* @__PURE__ */ y(Ce, { children: [/* @__PURE__ */ v(b, {
308
309
  variant: "outline",
309
310
  onClick: () => G(!1),
310
311
  children: H.length === 0 ? "Close" : "Cancel"
311
- }), H.length > 0 ? /* @__PURE__ */ y(x, {
312
+ }), H.length > 0 ? /* @__PURE__ */ v(b, {
312
313
  onClick: () => {
313
- We && W.mutate({
314
+ Ke && W.mutate({
314
315
  accountId: K.accountId,
315
316
  type: K.type,
316
- amount: Ue,
317
+ amount: Ge,
317
318
  symbol: K.symbol.trim() ? K.symbol.trim() : void 0,
318
319
  tradeDate: new Date(K.tradeDate).toISOString(),
319
320
  notes: K.notes.trim() ? K.notes.trim() : void 0
@@ -321,240 +322,240 @@ function H() {
321
322
  G(!1), q(V);
322
323
  } });
323
324
  },
324
- disabled: !We,
325
+ disabled: !Ke,
325
326
  children: W.isPending ? "Recording…" : "Record"
326
327
  }) : null] })
327
328
  ] })]
328
329
  });
329
- return /* @__PURE__ */ b(f, {
330
- title: "Wealth Analytics",
331
- description: "Allocation, cash flow, and holdings performance derived from your real accounts.",
330
+ return /* @__PURE__ */ y(re, {
331
+ title: g("brainyrich.analytics.title", "Wealth Analytics"),
332
+ description: g("brainyrich.analytics.description", "Allocation, cash flow, and holdings performance derived from your real accounts."),
332
333
  badges: [`${J.accountCount} accounts`],
333
- actions: Ge,
334
- children: [/* @__PURE__ */ b("div", {
334
+ actions: qe,
335
+ children: [/* @__PURE__ */ y("div", {
335
336
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
336
337
  children: [
337
- /* @__PURE__ */ y(o, {
338
+ /* @__PURE__ */ v(s, {
338
339
  index: 0,
339
- children: /* @__PURE__ */ y(c, {
340
+ children: /* @__PURE__ */ v(l, {
340
341
  label: "Net Worth",
341
- value: p(J.totalNetWorth, Y),
342
- icon: /* @__PURE__ */ y(v, {
342
+ value: f(J.totalNetWorth, Y),
343
+ icon: /* @__PURE__ */ v(_, {
343
344
  className: "size-4",
344
345
  "aria-hidden": "true"
345
346
  }),
346
347
  glow: !0
347
348
  })
348
349
  }),
349
- /* @__PURE__ */ y(o, {
350
+ /* @__PURE__ */ v(s, {
350
351
  index: 1,
351
- children: /* @__PURE__ */ y(c, {
352
+ children: /* @__PURE__ */ v(l, {
352
353
  label: "Invested Value",
353
- value: p(J.totalMarketValue, Y),
354
- icon: /* @__PURE__ */ y(de, {
354
+ value: f(J.totalMarketValue, Y),
355
+ icon: /* @__PURE__ */ v(pe, {
355
356
  className: "size-4",
356
357
  "aria-hidden": "true"
357
358
  })
358
359
  })
359
360
  }),
360
- /* @__PURE__ */ y(o, {
361
+ /* @__PURE__ */ v(s, {
361
362
  index: 2,
362
- children: /* @__PURE__ */ y(c, {
363
+ children: /* @__PURE__ */ v(l, {
363
364
  label: "Cash",
364
- value: p(J.totalCash, Y),
365
- icon: /* @__PURE__ */ y(se, {
365
+ value: f(J.totalCash, Y),
366
+ icon: /* @__PURE__ */ v(le, {
366
367
  className: "size-4",
367
368
  "aria-hidden": "true"
368
369
  })
369
370
  })
370
371
  }),
371
- /* @__PURE__ */ y(o, {
372
+ /* @__PURE__ */ v(s, {
372
373
  index: 3,
373
- children: /* @__PURE__ */ y(c, {
374
+ children: /* @__PURE__ */ v(l, {
374
375
  label: "Net Cash Flow",
375
- value: p(Q.net, Y),
376
+ value: f(Q.net, Y),
376
377
  deltaTone: Q.net > 0 ? "positive" : Q.net < 0 ? "negative" : "neutral",
377
378
  delta: Q.inflow > 0 ? Q.net / Q.inflow * 100 : void 0,
378
379
  deltaSuffix: "% of inflows",
379
- spark: Ve.length > 1 ? Ve : void 0,
380
+ spark: Ue.length > 1 ? Ue : void 0,
380
381
  sparkTone: Q.net >= 0 ? "positive" : "negative",
381
- icon: /* @__PURE__ */ y(g, {
382
+ icon: /* @__PURE__ */ v(h, {
382
383
  className: "size-4",
383
384
  "aria-hidden": "true"
384
385
  })
385
386
  })
386
387
  })
387
388
  ]
388
- }), /* @__PURE__ */ b(Ee, {
389
+ }), /* @__PURE__ */ y(De, {
389
390
  defaultValue: "allocation",
390
391
  className: "space-y-4",
391
392
  children: [
392
- /* @__PURE__ */ b(De, {
393
+ /* @__PURE__ */ y(Oe, {
393
394
  className: "grid w-full grid-cols-3",
394
395
  children: [
395
- /* @__PURE__ */ y(F, {
396
+ /* @__PURE__ */ v(F, {
396
397
  value: "allocation",
397
- children: "Allocation"
398
+ children: g("brainyrich.analytics.tabs.allocation", "Allocation")
398
399
  }),
399
- /* @__PURE__ */ y(F, {
400
+ /* @__PURE__ */ v(F, {
400
401
  value: "cashflow",
401
- children: "Cash Flow"
402
+ children: g("brainyrich.analytics.tabs.cashflow", "Cash Flow")
402
403
  }),
403
- /* @__PURE__ */ y(F, {
404
+ /* @__PURE__ */ v(F, {
404
405
  value: "performance",
405
- children: "Performance"
406
+ children: g("brainyrich.analytics.tabs.performance", "Performance")
406
407
  })
407
408
  ]
408
409
  }),
409
- /* @__PURE__ */ b(P, {
410
+ /* @__PURE__ */ y(P, {
410
411
  value: "allocation",
411
412
  className: "space-y-4",
412
- children: [/* @__PURE__ */ y(o, { children: /* @__PURE__ */ b(s, {
413
+ children: [/* @__PURE__ */ v(s, { children: /* @__PURE__ */ y(c, {
413
414
  glow: !0,
414
415
  className: "space-y-5",
415
- children: [/* @__PURE__ */ b("div", {
416
+ children: [/* @__PURE__ */ y("div", {
416
417
  className: "flex items-center gap-2",
417
- children: [/* @__PURE__ */ y(ce, {
418
+ children: [/* @__PURE__ */ v(ue, {
418
419
  className: "size-5 text-text-secondary",
419
420
  "aria-hidden": "true"
420
- }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h2", {
421
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
421
422
  className: "text-base font-semibold text-text-primary",
422
- children: "Asset Allocation"
423
- }), /* @__PURE__ */ y("p", {
423
+ children: g("brainyrich.analytics.allocation.title", "Asset Allocation")
424
+ }), /* @__PURE__ */ v("p", {
424
425
  className: "text-sm text-text-secondary",
425
- children: "Share of invested value by asset class, from your holdings."
426
+ children: g("brainyrich.analytics.allocation.description", "Share of invested value by asset class, from your holdings.")
426
427
  })] })]
427
- }), Ie.length === 0 ? /* @__PURE__ */ y(l, {
428
- icon: /* @__PURE__ */ y(ce, {
428
+ }), Re.length === 0 ? /* @__PURE__ */ v(u, {
429
+ icon: /* @__PURE__ */ v(ue, {
429
430
  className: "size-6",
430
431
  "aria-hidden": "true"
431
432
  }),
432
433
  title: "No invested holdings yet",
433
434
  description: "Add holdings to your accounts to see an asset-class breakdown here."
434
- }) : /* @__PURE__ */ b("div", {
435
+ }) : /* @__PURE__ */ y("div", {
435
436
  className: "grid gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.1fr)] lg:items-center",
436
- children: [/* @__PURE__ */ y(a, {
437
- data: Le,
437
+ children: [/* @__PURE__ */ v(o, {
438
+ data: ze,
438
439
  height: 240,
439
- centerValue: ne(J.totalMarketValue, Y),
440
+ centerValue: ie(J.totalMarketValue, Y),
440
441
  centerLabel: "Invested",
441
- valueFormatter: (e) => p(e, Y)
442
- }), /* @__PURE__ */ y("div", {
442
+ valueFormatter: (e) => f(e, Y)
443
+ }), /* @__PURE__ */ v("div", {
443
444
  className: "overflow-x-auto",
444
- children: /* @__PURE__ */ b(O, { children: [/* @__PURE__ */ y(M, { children: /* @__PURE__ */ b(N, { children: [
445
- /* @__PURE__ */ y(j, { children: "Asset class" }),
446
- /* @__PURE__ */ y(j, {
445
+ children: /* @__PURE__ */ y(O, { children: [/* @__PURE__ */ v(M, { children: /* @__PURE__ */ y(N, { children: [
446
+ /* @__PURE__ */ v(j, { children: "Asset class" }),
447
+ /* @__PURE__ */ v(j, {
447
448
  className: "text-right",
448
449
  children: "Weight"
449
450
  }),
450
- /* @__PURE__ */ y(j, {
451
+ /* @__PURE__ */ v(j, {
451
452
  className: "text-right",
452
453
  children: "Market value"
453
454
  })
454
- ] }) }), /* @__PURE__ */ y(k, { children: Ie.map((e) => /* @__PURE__ */ b(N, { children: [
455
- /* @__PURE__ */ y(A, {
455
+ ] }) }), /* @__PURE__ */ v(k, { children: Re.map((e) => /* @__PURE__ */ y(N, { children: [
456
+ /* @__PURE__ */ v(A, {
456
457
  className: "font-medium text-text-primary",
457
458
  children: e.label
458
459
  }),
459
- /* @__PURE__ */ y(A, {
460
+ /* @__PURE__ */ v(A, {
460
461
  className: "text-right tabular-nums text-text-secondary",
461
- children: ie(e.value)
462
+ children: oe(e.value)
462
463
  }),
463
- /* @__PURE__ */ y(A, {
464
+ /* @__PURE__ */ v(A, {
464
465
  className: "text-right tabular-nums font-medium text-text-primary",
465
466
  children: e.caption
466
467
  })
467
468
  ] }, e.label)) })] })
468
469
  })]
469
470
  })]
470
- }) }), /* @__PURE__ */ y(o, {
471
+ }) }), /* @__PURE__ */ v(s, {
471
472
  index: 1,
472
- children: /* @__PURE__ */ b(S, {
473
+ children: /* @__PURE__ */ y(he, {
473
474
  className: "transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))]",
474
- children: [/* @__PURE__ */ b(T, { children: [/* @__PURE__ */ b(pe, {
475
+ children: [/* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ y(ye, {
475
476
  className: "flex items-center gap-2",
476
- children: [/* @__PURE__ */ y(v, {
477
+ children: [/* @__PURE__ */ v(_, {
477
478
  className: "size-5",
478
479
  "aria-hidden": "true"
479
- }), "Net Worth Composition"]
480
- }), /* @__PURE__ */ y(w, { children: "Invested value versus liquid cash." })] }), /* @__PURE__ */ y(C, { children: Re.length === 0 ? /* @__PURE__ */ y(l, {
481
- icon: /* @__PURE__ */ y(v, {
480
+ }), g("brainyrich.analytics.composition.title", "Net Worth Composition")]
481
+ }), /* @__PURE__ */ v(_e, { children: g("brainyrich.analytics.composition.description", "Invested value versus liquid cash.") })] }), /* @__PURE__ */ v(ge, { children: Be.length === 0 ? /* @__PURE__ */ v(u, {
482
+ icon: /* @__PURE__ */ v(_, {
482
483
  className: "size-6",
483
484
  "aria-hidden": "true"
484
485
  }),
485
486
  title: "No balances yet",
486
487
  description: "Add accounts with balances or holdings to see your composition."
487
- }) : /* @__PURE__ */ b("div", {
488
+ }) : /* @__PURE__ */ y("div", {
488
489
  className: "flex flex-col items-center gap-6 sm:flex-row sm:justify-around",
489
- children: [/* @__PURE__ */ y(ee, {
490
- value: ze,
490
+ children: [/* @__PURE__ */ v(ee, {
491
+ value: Ve,
491
492
  label: "Invested",
492
493
  tone: "brand",
493
494
  size: 140
494
- }), /* @__PURE__ */ y("div", {
495
+ }), /* @__PURE__ */ v("div", {
495
496
  className: "min-w-0 flex-1",
496
- children: /* @__PURE__ */ y(a, {
497
- data: Re,
497
+ children: /* @__PURE__ */ v(o, {
498
+ data: Be,
498
499
  height: 180,
499
- centerValue: ne(J.totalNetWorth, Y),
500
+ centerValue: ie(J.totalNetWorth, Y),
500
501
  centerLabel: "Net worth",
501
- valueFormatter: (e) => p(e, Y)
502
+ valueFormatter: (e) => f(e, Y)
502
503
  })
503
504
  })]
504
505
  }) })]
505
506
  })
506
507
  })]
507
508
  }),
508
- /* @__PURE__ */ b(P, {
509
+ /* @__PURE__ */ y(P, {
509
510
  value: "cashflow",
510
511
  className: "space-y-4",
511
512
  children: [
512
- /* @__PURE__ */ y(o, { children: /* @__PURE__ */ b(s, {
513
+ /* @__PURE__ */ v(s, { children: /* @__PURE__ */ y(c, {
513
514
  className: "space-y-5",
514
- children: [/* @__PURE__ */ b("div", {
515
+ children: [/* @__PURE__ */ y("div", {
515
516
  className: "flex items-center gap-2",
516
- children: [/* @__PURE__ */ y(g, {
517
+ children: [/* @__PURE__ */ v(h, {
517
518
  className: "size-5 text-text-secondary",
518
519
  "aria-hidden": "true"
519
- }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h2", {
520
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
520
521
  className: "text-base font-semibold text-text-primary",
521
- children: "Inflows vs Outflows by month"
522
- }), /* @__PURE__ */ b("p", {
522
+ children: g("brainyrich.analytics.cashflow.title", "Inflows vs Outflows by month")
523
+ }), /* @__PURE__ */ y("p", {
523
524
  className: "text-sm text-text-secondary",
524
525
  children: ["Monthly cash flow aggregated from your recorded transactions.", X.length > 0 ? ` Based on ${X.length.toLocaleString()} ${X.length === 1 ? "transaction" : "transactions"}.` : ""]
525
526
  })] })]
526
- }), L.isLoading ? /* @__PURE__ */ y(d, { rows: 4 }) : L.isError ? /* @__PURE__ */ y(u, { onRetry: () => L.refetch() }) : Z.length === 0 ? /* @__PURE__ */ y(l, {
527
- icon: /* @__PURE__ */ y(g, {
527
+ }), R.isLoading ? /* @__PURE__ */ v(d, { rows: 4 }) : R.isError ? /* @__PURE__ */ v(ne, { onRetry: () => R.refetch() }) : Z.length === 0 ? /* @__PURE__ */ v(u, {
528
+ icon: /* @__PURE__ */ v(h, {
528
529
  className: "size-6",
529
530
  "aria-hidden": "true"
530
531
  }),
531
532
  title: "No cash flow to analyze yet",
532
533
  description: "Record deposits, withdrawals, or trades to build a cash-flow history.",
533
- action: /* @__PURE__ */ b(x, {
534
+ action: /* @__PURE__ */ y(b, {
534
535
  size: "sm",
535
536
  onClick: () => G(!0),
536
- children: [/* @__PURE__ */ y(le, {
537
+ children: [/* @__PURE__ */ v(de, {
537
538
  className: "mr-1 size-4",
538
539
  "aria-hidden": "true"
539
540
  }), "Record Transaction"]
540
541
  })
541
- }) : /* @__PURE__ */ b("div", {
542
+ }) : /* @__PURE__ */ y("div", {
542
543
  className: "space-y-4",
543
- children: [/* @__PURE__ */ y(te, {
544
+ children: [/* @__PURE__ */ v(te, {
544
545
  data: Z,
545
546
  height: 280,
546
- valueFormatter: (e) => ne(e, Y)
547
- }), /* @__PURE__ */ b("div", {
547
+ valueFormatter: (e) => ie(e, Y)
548
+ }), /* @__PURE__ */ y("div", {
548
549
  className: "flex flex-wrap gap-4 text-xs text-text-secondary",
549
- children: [/* @__PURE__ */ b("span", {
550
+ children: [/* @__PURE__ */ y("span", {
550
551
  className: "inline-flex items-center gap-1.5",
551
- children: [/* @__PURE__ */ y(h, {
552
+ children: [/* @__PURE__ */ v(ce, {
552
553
  className: "size-3.5 text-status-success-text",
553
554
  "aria-hidden": "true"
554
555
  }), "Inflow"]
555
- }), /* @__PURE__ */ b("span", {
556
+ }), /* @__PURE__ */ y("span", {
556
557
  className: "inline-flex items-center gap-1.5",
557
- children: [/* @__PURE__ */ y(oe, {
558
+ children: [/* @__PURE__ */ v(m, {
558
559
  className: "size-3.5 text-status-error-text",
559
560
  "aria-hidden": "true"
560
561
  }), "Outflow"]
@@ -562,37 +563,37 @@ function H() {
562
563
  })]
563
564
  })]
564
565
  }) }),
565
- Z.length > 0 ? /* @__PURE__ */ b("div", {
566
+ Z.length > 0 ? /* @__PURE__ */ y("div", {
566
567
  className: "grid gap-4 sm:grid-cols-3",
567
568
  children: [
568
- /* @__PURE__ */ y(o, {
569
+ /* @__PURE__ */ v(s, {
569
570
  index: 0,
570
- children: /* @__PURE__ */ y(c, {
571
+ children: /* @__PURE__ */ v(l, {
571
572
  label: "Total inflows",
572
- value: p(Q.inflow, Y),
573
- icon: /* @__PURE__ */ y(h, {
573
+ value: f(Q.inflow, Y),
574
+ icon: /* @__PURE__ */ v(ce, {
574
575
  className: "size-4",
575
576
  "aria-hidden": "true"
576
577
  }),
577
578
  sparkTone: "positive"
578
579
  })
579
580
  }),
580
- /* @__PURE__ */ y(o, {
581
+ /* @__PURE__ */ v(s, {
581
582
  index: 1,
582
- children: /* @__PURE__ */ y(c, {
583
+ children: /* @__PURE__ */ v(l, {
583
584
  label: "Total outflows",
584
- value: p(Q.outflow, Y),
585
- icon: /* @__PURE__ */ y(oe, {
585
+ value: f(Q.outflow, Y),
586
+ icon: /* @__PURE__ */ v(m, {
586
587
  className: "size-4",
587
588
  "aria-hidden": "true"
588
589
  })
589
590
  })
590
591
  }),
591
- /* @__PURE__ */ y(o, {
592
+ /* @__PURE__ */ v(s, {
592
593
  index: 2,
593
- children: /* @__PURE__ */ y(c, {
594
+ children: /* @__PURE__ */ v(l, {
594
595
  label: "Net",
595
- value: p(Q.net, Y),
596
+ value: f(Q.net, Y),
596
597
  deltaTone: Q.net > 0 ? "positive" : Q.net < 0 ? "negative" : "neutral",
597
598
  delta: Q.inflow > 0 ? Q.net / Q.inflow * 100 : void 0,
598
599
  deltaSuffix: "% of inflows",
@@ -601,31 +602,31 @@ function H() {
601
602
  })
602
603
  ]
603
604
  }) : null,
604
- Be.length > 0 ? /* @__PURE__ */ y(o, { children: /* @__PURE__ */ b(S, {
605
+ He.length > 0 ? /* @__PURE__ */ v(s, { children: /* @__PURE__ */ y(he, {
605
606
  className: "transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))]",
606
- children: [/* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y(pe, { children: "By Transaction Type" }), /* @__PURE__ */ y(w, { children: "Total value moved per transaction type." })] }), /* @__PURE__ */ y(C, {
607
+ children: [/* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ v(ye, { children: g("brainyrich.analytics.cashflow.byType", "By Transaction Type") }), /* @__PURE__ */ v(_e, { children: g("brainyrich.analytics.cashflow.byTypeDescription", "Total value moved per transaction type.") })] }), /* @__PURE__ */ v(ge, {
607
608
  className: "overflow-x-auto",
608
- children: /* @__PURE__ */ b(O, { children: [/* @__PURE__ */ y(M, { children: /* @__PURE__ */ b(N, { children: [
609
- /* @__PURE__ */ y(j, { children: "Type" }),
610
- /* @__PURE__ */ y(j, { children: "Direction" }),
611
- /* @__PURE__ */ y(j, {
609
+ children: /* @__PURE__ */ y(O, { children: [/* @__PURE__ */ v(M, { children: /* @__PURE__ */ y(N, { children: [
610
+ /* @__PURE__ */ v(j, { children: "Type" }),
611
+ /* @__PURE__ */ v(j, { children: "Direction" }),
612
+ /* @__PURE__ */ v(j, {
612
613
  className: "text-right",
613
614
  children: "Total"
614
615
  })
615
- ] }) }), /* @__PURE__ */ y(k, { children: Be.map((e) => /* @__PURE__ */ b(N, {
616
+ ] }) }), /* @__PURE__ */ v(k, { children: He.map((e) => /* @__PURE__ */ y(N, {
616
617
  className: "transition-colors hover:bg-bg-elevated",
617
618
  children: [
618
- /* @__PURE__ */ y(A, {
619
+ /* @__PURE__ */ v(A, {
619
620
  className: "font-medium text-text-primary",
620
621
  children: I(e.type)
621
622
  }),
622
- /* @__PURE__ */ y(A, { children: /* @__PURE__ */ y(fe, {
623
+ /* @__PURE__ */ v(A, { children: /* @__PURE__ */ v(me, {
623
624
  variant: e.dir === "in" ? "default" : e.dir === "out" ? "destructive" : "secondary",
624
625
  children: e.dir === "in" ? "Inflow" : e.dir === "out" ? "Outflow" : "Neutral"
625
626
  }) }),
626
- /* @__PURE__ */ y(A, {
627
+ /* @__PURE__ */ v(A, {
627
628
  className: "text-right font-medium tabular-nums",
628
- children: p(e.total, Y)
629
+ children: f(e.total, Y)
629
630
  })
630
631
  ]
631
632
  }, e.type)) })] })
@@ -633,106 +634,106 @@ function H() {
633
634
  }) }) : null
634
635
  ]
635
636
  }),
636
- /* @__PURE__ */ b(P, {
637
+ /* @__PURE__ */ y(P, {
637
638
  value: "performance",
638
639
  className: "space-y-4",
639
- children: [/* @__PURE__ */ b(S, { children: [/* @__PURE__ */ b(T, {
640
+ children: [/* @__PURE__ */ y(he, { children: [/* @__PURE__ */ y(ve, {
640
641
  className: "flex flex-col gap-3 md:flex-row md:items-start md:justify-between",
641
- children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y(pe, { children: "Holdings Performance" }), /* @__PURE__ */ y(w, { children: "Unrealized gain or loss — market value versus cost basis." })] }), H.length > 0 ? /* @__PURE__ */ b("div", {
642
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v(ye, { children: g("brainyrich.analytics.performance.title", "Holdings Performance") }), /* @__PURE__ */ v(_e, { children: g("brainyrich.analytics.performance.description", "Unrealized gain or loss — market value versus cost basis.") })] }), H.length > 0 ? /* @__PURE__ */ y("div", {
642
643
  className: "w-full md:w-56",
643
- children: [/* @__PURE__ */ y(E, {
644
+ children: [/* @__PURE__ */ v(S, {
644
645
  htmlFor: "perf-account",
645
646
  className: "sr-only",
646
647
  children: "Account"
647
- }), /* @__PURE__ */ b(Se, {
648
- value: Pe ?? "",
649
- onValueChange: (e) => Ae(e),
650
- children: [/* @__PURE__ */ y(Te, {
648
+ }), /* @__PURE__ */ y(C, {
649
+ value: Ie ?? "",
650
+ onValueChange: (e) => Fe(e),
651
+ children: [/* @__PURE__ */ v(E, {
651
652
  id: "perf-account",
652
- children: /* @__PURE__ */ y(D, { placeholder: "Select account" })
653
- }), /* @__PURE__ */ y(Ce, { children: H.map((e) => /* @__PURE__ */ y(we, {
653
+ children: /* @__PURE__ */ v(D, { placeholder: "Select account" })
654
+ }), /* @__PURE__ */ v(w, { children: H.map((e) => /* @__PURE__ */ v(T, {
654
655
  value: e.id,
655
656
  children: e.name
656
657
  }, e.id)) })]
657
658
  })]
658
659
  }) : null]
659
- }), /* @__PURE__ */ y(C, { children: R.isLoading ? /* @__PURE__ */ y(d, { rows: 3 }) : H.length === 0 ? /* @__PURE__ */ y(l, {
660
- icon: /* @__PURE__ */ y(v, {
660
+ }), /* @__PURE__ */ v(ge, { children: z.isLoading ? /* @__PURE__ */ v(d, { rows: 3 }) : H.length === 0 ? /* @__PURE__ */ v(u, {
661
+ icon: /* @__PURE__ */ v(_, {
661
662
  className: "size-6",
662
663
  "aria-hidden": "true"
663
664
  }),
664
665
  title: "No accounts yet",
665
666
  description: "Create an account and add holdings to analyze performance."
666
- }) : U.isLoading ? /* @__PURE__ */ y(d, { rows: 3 }) : U.isError ? /* @__PURE__ */ y(u, { onRetry: () => U.refetch() }) : $.rows.length === 0 ? /* @__PURE__ */ y(l, {
667
- icon: /* @__PURE__ */ y(g, {
667
+ }) : U.isLoading ? /* @__PURE__ */ v(d, { rows: 3 }) : U.isError ? /* @__PURE__ */ v(ne, { onRetry: () => U.refetch() }) : $.rows.length === 0 ? /* @__PURE__ */ v(u, {
668
+ icon: /* @__PURE__ */ v(h, {
668
669
  className: "size-6",
669
670
  "aria-hidden": "true"
670
671
  }),
671
672
  title: "No holdings in this account",
672
673
  description: "Add holdings to this account to see unrealized gains and losses."
673
- }) : /* @__PURE__ */ b("div", {
674
+ }) : /* @__PURE__ */ y("div", {
674
675
  className: "space-y-4",
675
- children: [/* @__PURE__ */ b("div", {
676
+ children: [/* @__PURE__ */ y("div", {
676
677
  className: "grid gap-4 sm:grid-cols-3",
677
678
  children: [
678
- /* @__PURE__ */ y(c, {
679
+ /* @__PURE__ */ v(l, {
679
680
  label: "Total unrealized",
680
- value: `${$.totalUnrealized >= 0 ? "+" : "-"}${p(Math.abs($.totalUnrealized), Y)}`,
681
+ value: `${$.totalUnrealized >= 0 ? "+" : "-"}${f(Math.abs($.totalUnrealized), Y)}`,
681
682
  deltaTone: $.totalUnrealized > 0 ? "positive" : $.totalUnrealized < 0 ? "negative" : "neutral",
682
683
  delta: $.totalCost > 0 ? $.totalUnrealized / $.totalCost * 100 : void 0,
683
684
  glow: $.totalUnrealized >= 0
684
685
  }),
685
- /* @__PURE__ */ y(c, {
686
+ /* @__PURE__ */ v(l, {
686
687
  label: "Cost basis",
687
- value: p($.totalCost, Y)
688
+ value: f($.totalCost, Y)
688
689
  }),
689
- /* @__PURE__ */ y(c, {
690
+ /* @__PURE__ */ v(l, {
690
691
  label: "Return on cost",
691
- value: ie($.totalCost > 0 ? $.totalUnrealized / $.totalCost * 100 : null)
692
+ value: oe($.totalCost > 0 ? $.totalUnrealized / $.totalCost * 100 : null)
692
693
  })
693
694
  ]
694
- }), /* @__PURE__ */ y("div", {
695
+ }), /* @__PURE__ */ v("div", {
695
696
  className: "overflow-x-auto",
696
- children: /* @__PURE__ */ b(O, { children: [/* @__PURE__ */ y(M, { children: /* @__PURE__ */ b(N, { children: [
697
- /* @__PURE__ */ y(j, { children: "Holding" }),
698
- /* @__PURE__ */ y(j, {
697
+ children: /* @__PURE__ */ y(O, { children: [/* @__PURE__ */ v(M, { children: /* @__PURE__ */ y(N, { children: [
698
+ /* @__PURE__ */ v(j, { children: "Holding" }),
699
+ /* @__PURE__ */ v(j, {
699
700
  className: "text-right",
700
701
  children: "Market value"
701
702
  }),
702
- /* @__PURE__ */ y(j, {
703
+ /* @__PURE__ */ v(j, {
703
704
  className: "text-right",
704
705
  children: "Cost basis"
705
706
  }),
706
- /* @__PURE__ */ y(j, {
707
+ /* @__PURE__ */ v(j, {
707
708
  className: "text-right",
708
709
  children: "Unrealized gain/loss"
709
710
  })
710
- ] }) }), /* @__PURE__ */ y(k, { children: $.rows.map(({ holding: e, unrealized: t, pct: n }) => /* @__PURE__ */ b(N, {
711
+ ] }) }), /* @__PURE__ */ v(k, { children: $.rows.map(({ holding: e, unrealized: t, pct: n }) => /* @__PURE__ */ y(N, {
711
712
  className: "transition-colors hover:bg-bg-elevated",
712
713
  children: [
713
- /* @__PURE__ */ b(A, { children: [/* @__PURE__ */ y("div", {
714
+ /* @__PURE__ */ y(A, { children: [/* @__PURE__ */ v("div", {
714
715
  className: "font-medium text-text-primary",
715
716
  children: e.symbol
716
- }), /* @__PURE__ */ b("div", {
717
+ }), /* @__PURE__ */ y("div", {
717
718
  className: "text-xs text-text-secondary",
718
719
  children: [
719
720
  e.name ?? I(e.assetClass),
720
721
  " · as of",
721
722
  " ",
722
- re(e.asOf)
723
+ ae(e.asOf)
723
724
  ]
724
725
  })] }),
725
- /* @__PURE__ */ y(A, {
726
+ /* @__PURE__ */ v(A, {
726
727
  className: "text-right tabular-nums",
727
- children: p(e.marketValue, e.currency)
728
+ children: f(e.marketValue, e.currency)
728
729
  }),
729
- /* @__PURE__ */ y(A, {
730
+ /* @__PURE__ */ v(A, {
730
731
  className: "text-right tabular-nums text-text-secondary",
731
- children: p(e.costBasis, e.currency)
732
+ children: f(e.costBasis, e.currency)
732
733
  }),
733
- /* @__PURE__ */ y(A, {
734
+ /* @__PURE__ */ v(A, {
734
735
  className: "text-right",
735
- children: /* @__PURE__ */ y(B, {
736
+ children: /* @__PURE__ */ v(B, {
736
737
  value: t,
737
738
  currency: e.currency,
738
739
  pct: n
@@ -741,29 +742,29 @@ function H() {
741
742
  ]
742
743
  }, e.id)) })] })
743
744
  })]
744
- }) })] }), $.rows.length > 0 && ($.gainers.length > 0 || $.losers.length > 0) ? /* @__PURE__ */ b("div", {
745
+ }) })] }), $.rows.length > 0 && ($.gainers.length > 0 || $.losers.length > 0) ? /* @__PURE__ */ y("div", {
745
746
  className: "grid gap-4 md:grid-cols-2",
746
- children: [$.gainers.length > 0 ? /* @__PURE__ */ y(o, {
747
+ children: [$.gainers.length > 0 ? /* @__PURE__ */ v(s, {
747
748
  index: 0,
748
- children: /* @__PURE__ */ b(s, {
749
+ children: /* @__PURE__ */ y(c, {
749
750
  className: "space-y-3",
750
- children: [/* @__PURE__ */ b("div", {
751
+ children: [/* @__PURE__ */ y("div", {
751
752
  className: "flex items-center gap-2",
752
- children: [/* @__PURE__ */ y(de, {
753
+ children: [/* @__PURE__ */ v(pe, {
753
754
  className: "size-4 text-status-success-text",
754
755
  "aria-hidden": "true"
755
- }), /* @__PURE__ */ y("h3", {
756
+ }), /* @__PURE__ */ v("h3", {
756
757
  className: "text-sm font-semibold text-text-primary",
757
- children: "Top gainers"
758
+ children: g("brainyrich.analytics.performance.topGainers", "Top gainers")
758
759
  })]
759
- }), /* @__PURE__ */ y("ul", {
760
+ }), /* @__PURE__ */ v("ul", {
760
761
  className: "space-y-2",
761
- children: $.gainers.map(({ holding: e, unrealized: t, pct: n }) => /* @__PURE__ */ b("li", {
762
+ children: $.gainers.map(({ holding: e, unrealized: t, pct: n }) => /* @__PURE__ */ y("li", {
762
763
  className: "flex items-center justify-between gap-3 text-sm",
763
- children: [/* @__PURE__ */ y("span", {
764
+ children: [/* @__PURE__ */ v("span", {
764
765
  className: "font-medium text-text-primary",
765
766
  children: e.symbol
766
- }), /* @__PURE__ */ y(B, {
767
+ }), /* @__PURE__ */ v(B, {
767
768
  value: t,
768
769
  currency: e.currency,
769
770
  pct: n
@@ -771,27 +772,27 @@ function H() {
771
772
  }, e.id))
772
773
  })]
773
774
  })
774
- }) : null, $.losers.length > 0 ? /* @__PURE__ */ y(o, {
775
+ }) : null, $.losers.length > 0 ? /* @__PURE__ */ v(s, {
775
776
  index: 1,
776
- children: /* @__PURE__ */ b(s, {
777
+ children: /* @__PURE__ */ y(c, {
777
778
  className: "space-y-3",
778
- children: [/* @__PURE__ */ b("div", {
779
+ children: [/* @__PURE__ */ y("div", {
779
780
  className: "flex items-center gap-2",
780
- children: [/* @__PURE__ */ y(ue, {
781
+ children: [/* @__PURE__ */ v(fe, {
781
782
  className: "size-4 text-status-error-text",
782
783
  "aria-hidden": "true"
783
- }), /* @__PURE__ */ y("h3", {
784
+ }), /* @__PURE__ */ v("h3", {
784
785
  className: "text-sm font-semibold text-text-primary",
785
- children: "Top losers"
786
+ children: g("brainyrich.analytics.performance.topLosers", "Top losers")
786
787
  })]
787
- }), /* @__PURE__ */ y("ul", {
788
+ }), /* @__PURE__ */ v("ul", {
788
789
  className: "space-y-2",
789
- children: $.losers.map(({ holding: e, unrealized: t, pct: n }) => /* @__PURE__ */ b("li", {
790
+ children: $.losers.map(({ holding: e, unrealized: t, pct: n }) => /* @__PURE__ */ y("li", {
790
791
  className: "flex items-center justify-between gap-3 text-sm",
791
- children: [/* @__PURE__ */ y("span", {
792
+ children: [/* @__PURE__ */ v("span", {
792
793
  className: "font-medium text-text-primary",
793
794
  children: e.symbol
794
- }), /* @__PURE__ */ y(B, {
795
+ }), /* @__PURE__ */ v(B, {
795
796
  value: t,
796
797
  currency: e.currency,
797
798
  pct: n
@@ -807,6 +808,6 @@ function H() {
807
808
  });
808
809
  }
809
810
  //#endregion
810
- export { H as AnalyticsPage };
811
+ export { Fe as AnalyticsPage };
811
812
 
812
813
  //# sourceMappingURL=AnalyticsPage.js.map