@burdenoff/microfe-brainyrich 2026.706.4 → 2026.713.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/brainyrich/BrainyRichRoot.d.ts +5 -0
  2. package/dist/brainyrich/BrainyRichRoot.d.ts.map +1 -0
  3. package/dist/brainyrich/BrainyRichRoutes.d.ts +2 -0
  4. package/dist/brainyrich/BrainyRichRoutes.d.ts.map +1 -0
  5. package/dist/brainyrich/BrainyRichRoutes.js +27 -15
  6. package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
  7. package/dist/brainyrich/components/ActorName.d.ts +26 -0
  8. package/dist/brainyrich/components/ActorName.d.ts.map +1 -0
  9. package/dist/brainyrich/components/ConfirmDialog.d.ts +20 -0
  10. package/dist/brainyrich/components/ConfirmDialog.d.ts.map +1 -0
  11. package/dist/brainyrich/components/LoadMore.d.ts +21 -0
  12. package/dist/brainyrich/components/LoadMore.d.ts.map +1 -0
  13. package/dist/brainyrich/components/index.d.ts +11 -0
  14. package/dist/brainyrich/components/index.d.ts.map +1 -0
  15. package/dist/brainyrich/components/notify.d.ts +33 -0
  16. package/dist/brainyrich/components/notify.d.ts.map +1 -0
  17. package/dist/brainyrich/components/pickers.d.ts +63 -0
  18. package/dist/brainyrich/components/pickers.d.ts.map +1 -0
  19. package/dist/brainyrich/components/reuse/CommentThread.d.ts +35 -0
  20. package/dist/brainyrich/components/reuse/CommentThread.d.ts.map +1 -0
  21. package/dist/brainyrich/components/reuse/DocumentsPanel.d.ts +33 -0
  22. package/dist/brainyrich/components/reuse/DocumentsPanel.d.ts.map +1 -0
  23. package/dist/brainyrich/components/reuse/TagField.d.ts +34 -0
  24. package/dist/brainyrich/components/reuse/TagField.d.ts.map +1 -0
  25. package/dist/brainyrich/components/reuse/transport.d.ts +20 -0
  26. package/dist/brainyrich/components/reuse/transport.d.ts.map +1 -0
  27. package/dist/brainyrich/components/viz.d.ts +129 -0
  28. package/dist/brainyrich/components/viz.d.ts.map +1 -0
  29. package/dist/brainyrich/components/viz.js.map +1 -1
  30. package/dist/brainyrich/hooks/useBrainyRichAnalytics.d.ts +17 -0
  31. package/dist/brainyrich/hooks/useBrainyRichAnalytics.d.ts.map +1 -0
  32. package/dist/brainyrich/hooks/useBrainyRichAnalytics.js +24 -0
  33. package/dist/brainyrich/hooks/useBrainyRichAnalytics.js.map +1 -0
  34. package/dist/brainyrich/hooks/useBrainyRichApi.d.ts +2125 -0
  35. package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -0
  36. package/dist/brainyrich/hooks/useBrainyRichApi.js +1 -1
  37. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
  38. package/dist/brainyrich/index.d.ts +6 -0
  39. package/dist/brainyrich/index.d.ts.map +1 -0
  40. package/dist/brainyrich/index.js +1 -0
  41. package/dist/brainyrich/pages/AccountsPage.d.ts +2 -0
  42. package/dist/brainyrich/pages/AccountsPage.d.ts.map +1 -0
  43. package/dist/brainyrich/pages/AccountsPage.js +608 -593
  44. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  45. package/dist/brainyrich/pages/AiAssistantPage.d.ts +2 -0
  46. package/dist/brainyrich/pages/AiAssistantPage.d.ts.map +1 -0
  47. package/dist/brainyrich/pages/AnalyticsPage.d.ts +2 -0
  48. package/dist/brainyrich/pages/AnalyticsPage.d.ts.map +1 -0
  49. package/dist/brainyrich/pages/DashboardPage.d.ts +2 -0
  50. package/dist/brainyrich/pages/DashboardPage.d.ts.map +1 -0
  51. package/dist/brainyrich/pages/DashboardPage.js +264 -256
  52. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  53. package/dist/brainyrich/pages/FamilyPage.d.ts +2 -0
  54. package/dist/brainyrich/pages/FamilyPage.d.ts.map +1 -0
  55. package/dist/brainyrich/pages/FamilyPage.js +467 -446
  56. package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
  57. package/dist/brainyrich/pages/GoalsPage.d.ts +2 -0
  58. package/dist/brainyrich/pages/GoalsPage.d.ts.map +1 -0
  59. package/dist/brainyrich/pages/GoalsPage.js +553 -531
  60. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  61. package/dist/brainyrich/pages/InvestmentsPage.d.ts +2 -0
  62. package/dist/brainyrich/pages/InvestmentsPage.d.ts.map +1 -0
  63. package/dist/brainyrich/pages/PortfoliosPage.d.ts +2 -0
  64. package/dist/brainyrich/pages/PortfoliosPage.d.ts.map +1 -0
  65. package/dist/brainyrich/pages/PortfoliosPage.js +378 -354
  66. package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
  67. package/dist/brainyrich/pages/ReportsPage.d.ts +2 -0
  68. package/dist/brainyrich/pages/ReportsPage.d.ts.map +1 -0
  69. package/dist/brainyrich/pages/RiskPage.d.ts +2 -0
  70. package/dist/brainyrich/pages/RiskPage.d.ts.map +1 -0
  71. package/dist/brainyrich/pages/TaxPage.d.ts +2 -0
  72. package/dist/brainyrich/pages/TaxPage.d.ts.map +1 -0
  73. package/dist/brainyrich/pages/_shared.d.ts +77 -0
  74. package/dist/brainyrich/pages/_shared.d.ts.map +1 -0
  75. package/dist/brainyrich/providers/BrainyRichProvider.d.ts +6 -0
  76. package/dist/brainyrich/providers/BrainyRichProvider.d.ts.map +1 -0
  77. package/dist/brainyrich/services/createSandboxAssistantTransport.d.ts +24 -0
  78. package/dist/brainyrich/services/createSandboxAssistantTransport.d.ts.map +1 -0
  79. package/dist/brainyrich/services/createSandboxAssistantTransport.js +14 -0
  80. package/dist/brainyrich/services/createSandboxAssistantTransport.js.map +1 -0
  81. package/dist/brainyrich/types/bra.d.ts +394 -0
  82. package/dist/brainyrich/types/bra.d.ts.map +1 -0
  83. package/dist/brainyrich/types/index.d.ts +39 -0
  84. package/dist/brainyrich/types/index.d.ts.map +1 -0
  85. package/dist/brainyrich/utils/cn.d.ts +4 -0
  86. package/dist/brainyrich/utils/cn.d.ts.map +1 -0
  87. package/dist/brainyrich/utils/i18n.d.ts +6 -0
  88. package/dist/brainyrich/utils/i18n.d.ts.map +1 -0
  89. package/dist/brainyrich/utils/nativeControls.d.ts +12 -0
  90. package/dist/brainyrich/utils/nativeControls.d.ts.map +1 -0
  91. package/dist/brainyrich/utils/nativeControls.js +12 -0
  92. package/dist/brainyrich/utils/nativeControls.js.map +1 -0
  93. package/dist/brainyrich/utils/navigation.d.ts +2 -0
  94. package/dist/brainyrich/utils/navigation.d.ts.map +1 -0
  95. package/dist/brainyrich/utils/pageContext.d.ts +30 -0
  96. package/dist/brainyrich/utils/pageContext.d.ts.map +1 -0
  97. package/dist/brainyrich/utils/pageContext.js +46 -0
  98. package/dist/brainyrich/utils/pageContext.js.map +1 -0
  99. package/dist/dev/main.d.ts +2 -0
  100. package/dist/dev/main.d.ts.map +1 -0
  101. package/dist/generated/global-operations.d.ts +2 -0
  102. package/dist/generated/global-operations.d.ts.map +1 -0
  103. package/dist/generated/global-types.d.ts +18199 -0
  104. package/dist/generated/global-types.d.ts.map +1 -0
  105. package/dist/generated/wspace-operations.d.ts +2 -0
  106. package/dist/generated/wspace-operations.d.ts.map +1 -0
  107. package/dist/generated/wspace-types.d.ts +43046 -0
  108. package/dist/generated/wspace-types.d.ts.map +1 -0
  109. package/dist/index.d.ts +2 -0
  110. package/dist/index.d.ts.map +1 -0
  111. package/dist/index.js +2 -1
  112. package/package.json +6 -2
@@ -4,15 +4,17 @@ import { LoadMore as te } from "../components/LoadMore.js";
4
4
  import { ConfirmDialog as ne } from "../components/ConfirmDialog.js";
5
5
  import { FadeIn as d, GlassCard as re, MiniAreaChart as ie, ProgressRing as ae, StatTile as f } from "../components/viz.js";
6
6
  import "../components/index.js";
7
- import { EmptyState as oe, ErrorState as se, LoadingState as ce, SectionShell as p, formatCompact as le, formatDate as ue, formatMoney as m, formatPct as de, statusBadgeVariant as fe } from "./_shared.js";
8
- import { TagField as h } from "../components/reuse/TagField.js";
9
- import { useMemo as g, useState as _ } from "react";
10
- import { AlertTriangle as v, CalendarClock as pe, Coins as me, LineChart as y, Link2 as he, MoreHorizontal as b, PiggyBank as ge, Plus as x, RefreshCw as _e, Target as S, Trash2 as ve, TrendingDown as C, TrendingUp as w, Unlink as T, Wallet as E } from "lucide-react";
11
- import { useI18n as D } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
- import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
13
- import { Badge as j, Button as M, Card as ye, CardContent as N, CardDescription as P, CardHeader as F, CardTitle as I, Dialog as L, DialogContent as R, DialogDescription as z, DialogFooter as B, DialogHeader as V, DialogTitle as H, DropdownMenu as be, DropdownMenuContent as xe, DropdownMenuItem as Se, DropdownMenuSeparator as Ce, DropdownMenuTrigger as we, Input as U, Label as W, Select as G, SelectContent as K, SelectItem as q, SelectTrigger as J, SelectValue as Y, Sheet as Te, SheetContent as Ee, SheetDescription as De, SheetHeader as Oe, SheetTitle as ke, Table as Ae, TableBody as je, TableCell as X, TableHead as Z, TableHeader as Me, TableRow as Ne, Textarea as Pe } from "@burdenoff/fe-libs/ui";
7
+ import { EmptyState as oe, ErrorState as se, LoadingState as ce, SectionShell as p, formatCompact as le, formatDate as m, formatMoney as h, formatPct as ue, statusBadgeVariant as de } from "./_shared.js";
8
+ import { hapticSuccess as g, showToast as _ } from "../utils/nativeControls.js";
9
+ import { useTrackBrainyRichPageView as v } from "../hooks/useBrainyRichAnalytics.js";
10
+ import { TagField as y } from "../components/reuse/TagField.js";
11
+ import { useMemo as b, useState as x } from "react";
12
+ import { AlertTriangle as S, CalendarClock as fe, Coins as pe, LineChart as me, Link2 as he, MoreHorizontal as C, PiggyBank as ge, Plus as w, RefreshCw as _e, Target as T, Trash2 as ve, TrendingDown as E, TrendingUp as D, Unlink as O, Wallet as k } from "lucide-react";
13
+ import { useI18n as A } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
+ import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
15
+ import { Badge as ye, Button as P, Card as be, CardContent as xe, CardDescription as F, CardHeader as I, CardTitle as L, Dialog as R, DialogContent as z, DialogDescription as B, DialogFooter as V, DialogHeader as H, DialogTitle as U, DropdownMenu as Se, DropdownMenuContent as Ce, DropdownMenuItem as we, DropdownMenuSeparator as Te, DropdownMenuTrigger as Ee, Input as W, Label as G, Select as K, SelectContent as q, SelectItem as J, SelectTrigger as Y, SelectValue as X, Sheet as De, SheetContent as Oe, SheetDescription as ke, SheetHeader as Ae, SheetTitle as je, Table as Me, TableBody as Ne, TableCell as Z, TableHead as Q, TableHeader as Pe, TableRow as Fe, Textarea as Ie } from "@burdenoff/fe-libs/ui";
14
16
  //#region src/brainyrich/pages/GoalsPage.tsx
15
- var Fe = [
17
+ var Le = [
16
18
  "RETIREMENT",
17
19
  "EDUCATION",
18
20
  "HOME",
@@ -20,39 +22,39 @@ var Fe = [
20
22
  "MAJOR_PURCHASE",
21
23
  "WEALTH_GROWTH",
22
24
  "CUSTOM"
23
- ], Ie = [
25
+ ], Re = [
24
26
  "ACTIVE",
25
27
  "ACHIEVED",
26
28
  "ON_HOLD",
27
29
  "ABANDONED"
28
30
  ];
29
- function Le(e) {
31
+ function ze(e) {
30
32
  switch (e) {
31
33
  case "AHEAD":
32
34
  case "ON_TRACK": return {
33
- icon: w,
35
+ icon: D,
34
36
  tone: "text-status-success-text"
35
37
  };
36
38
  case "BEHIND": return {
37
- icon: C,
39
+ icon: E,
38
40
  tone: "text-status-warning-text"
39
41
  };
40
42
  default: return {
41
- icon: v,
43
+ icon: S,
42
44
  tone: "text-status-error-text"
43
45
  };
44
46
  }
45
47
  }
46
- function Q(e) {
48
+ function $(e) {
47
49
  return e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
48
50
  }
49
- function Re(e) {
51
+ function Be(e) {
50
52
  return e.fundings.reduce((e, t) => e + (t.fixedAmount ?? 0), 0);
51
53
  }
52
- function ze(e) {
53
- return e.status === "ACHIEVED" ? 100 : e.targetAmount > 0 ? Math.max(0, Math.min(100, Re(e) / e.targetAmount * 100)) : 0;
54
+ function Ve(e) {
55
+ return e.status === "ACHIEVED" ? 100 : e.targetAmount > 0 ? Math.max(0, Math.min(100, Be(e) / e.targetAmount * 100)) : 0;
54
56
  }
55
- function Be(e, t) {
57
+ function He(e, t) {
56
58
  if (e === "ACHIEVED") return "success";
57
59
  switch (t) {
58
60
  case "AHEAD":
@@ -61,7 +63,7 @@ function Be(e, t) {
61
63
  default: return "error";
62
64
  }
63
65
  }
64
- function Ve(e, t, n) {
66
+ function Ue(e, t, n) {
65
67
  if (!n) return [];
66
68
  let r = new Date(n);
67
69
  if (Number.isNaN(r.getTime())) return [];
@@ -80,12 +82,12 @@ function Ve(e, t, n) {
80
82
  }
81
83
  return c;
82
84
  }
83
- function He(e) {
85
+ function We(e) {
84
86
  if (!e) return "";
85
87
  let t = new Date(e);
86
88
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
87
89
  }
88
- function Ue() {
90
+ function Ge() {
89
91
  return {
90
92
  name: "",
91
93
  type: "CUSTOM",
@@ -99,13 +101,13 @@ function Ue() {
99
101
  notes: ""
100
102
  };
101
103
  }
102
- function We(e) {
104
+ function Ke(e) {
103
105
  return {
104
106
  name: e.name,
105
107
  type: e.type,
106
108
  status: e.status,
107
109
  targetAmount: String(e.targetAmount),
108
- targetDate: He(e.targetDate),
110
+ targetDate: We(e.targetDate),
109
111
  monthlyContribution: String(e.monthlyContribution),
110
112
  priority: String(e.priority),
111
113
  currency: e.currency,
@@ -113,369 +115,381 @@ function We(e) {
113
115
  notes: e.notes ?? ""
114
116
  };
115
117
  }
116
- var $ = "__none__";
117
- function Ge() {
118
- let { t } = D(), i = (n, r, i) => e(t, n, r, i), { items: a, hasMore: s, loadMore: l, isFetchingNextPage: u, isLoading: re, isError: ie, refetch: le } = c(), { data: de } = o(), h = r(), y = ee(), C = n(), [w, T] = _(!1), [E, L] = _(null), [R, z] = _(null), [B, V] = _(null), [H, U] = _(Ue), W = (e, t) => U((n) => ({
118
+ var qe = "__none__";
119
+ function Je() {
120
+ let { t } = A(), i = (n, r, i) => e(t, n, r, i);
121
+ v("brainyrich.goals.viewed");
122
+ let { items: a, hasMore: s, loadMore: l, isFetchingNextPage: u, isLoading: re, isError: ie, refetch: le } = c(), { data: ue } = o(), y = r(), me = ee(), E = n(), [D, O] = x(!1), [k, R] = x(null), [z, B] = x(null), [V, H] = x(null), [U, W] = x(Ge), G = (e, t) => W((n) => ({
119
123
  ...n,
120
124
  [e]: t
121
- })), G = g(() => ({
125
+ })), K = b(() => ({
122
126
  totalTarget: a.reduce((e, t) => e + t.targetAmount, 0),
123
127
  totalMonthly: a.reduce((e, t) => e + t.monthlyContribution, 0),
124
128
  atRisk: a.filter((e) => e.projection === "AT_RISK" || e.projection === "BEHIND").length
125
- }), [a]), K = a[0]?.currency ?? "USD", q = () => {
126
- U(Ue()), T(!0);
127
- }, J = (e) => {
128
- U(We(e)), L(e);
129
- }, Y = H.name.trim().length > 0 && Number(H.targetAmount) > 0 && H.targetDate.length > 0;
130
- return /* @__PURE__ */ A(O, { children: [
131
- /* @__PURE__ */ k(p, {
132
- title: i("brainyrich.goals.title", "Financial Goals"),
133
- description: i("brainyrich.goals.description", "Track progress toward your wealth milestones and life objectives"),
134
- actionLabel: i("brainyrich.goals.actions.createGoal", "New goal"),
135
- onAction: q,
136
- children: re ? /* @__PURE__ */ k(ce, { rows: 4 }) : ie ? /* @__PURE__ */ k(se, {
137
- title: i("brainyrich.goals.error.title", "Could not load goals"),
138
- description: i("brainyrich.goals.error.description", "We could not reach the goals service. Please try again."),
139
- onRetry: () => le()
140
- }) : a.length === 0 ? /* @__PURE__ */ k(oe, {
141
- icon: /* @__PURE__ */ k(S, {
142
- className: "size-6",
143
- "aria-hidden": "true"
144
- }),
145
- title: i("brainyrich.goals.empty.title", "No financial goals yet"),
146
- description: i("brainyrich.goals.empty.description", "Create your first goal to start tracking progress toward a milestone."),
147
- action: /* @__PURE__ */ A(M, {
148
- size: "sm",
149
- onClick: q,
150
- children: [/* @__PURE__ */ k(x, {
151
- className: "size-4",
129
+ }), [a]), q = a[0]?.currency ?? "USD", J = () => {
130
+ W(Ge()), O(!0);
131
+ }, Y = (e) => {
132
+ W(Ke(e)), R(e);
133
+ }, X = U.name.trim().length > 0 && Number(U.targetAmount) > 0 && U.targetDate.length > 0;
134
+ return /* @__PURE__ */ N("div", {
135
+ "data-tour": "brainyrich-page-goals",
136
+ className: "contents",
137
+ children: [
138
+ /* @__PURE__ */ M(p, {
139
+ title: i("brainyrich.goals.title", "Financial Goals"),
140
+ description: i("brainyrich.goals.description", "Track progress toward your wealth milestones and life objectives"),
141
+ actionLabel: i("brainyrich.goals.actions.createGoal", "New goal"),
142
+ onAction: J,
143
+ children: re ? /* @__PURE__ */ M(ce, { rows: 4 }) : ie ? /* @__PURE__ */ M(se, {
144
+ title: i("brainyrich.goals.error.title", "Could not load goals"),
145
+ description: i("brainyrich.goals.error.description", "We could not reach the goals service. Please try again."),
146
+ onRetry: () => le()
147
+ }) : a.length === 0 ? /* @__PURE__ */ M(oe, {
148
+ icon: /* @__PURE__ */ M(T, {
149
+ className: "size-6",
152
150
  "aria-hidden": "true"
153
- }), i("brainyrich.goals.actions.createGoal", "New goal")]
154
- })
155
- }) : /* @__PURE__ */ A(O, { children: [
156
- /* @__PURE__ */ A("div", {
157
- className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-4",
158
- children: [
159
- /* @__PURE__ */ k(d, {
160
- index: 0,
161
- children: /* @__PURE__ */ k(f, {
162
- glow: !0,
163
- icon: /* @__PURE__ */ k(S, {
164
- className: "size-4",
165
- "aria-hidden": "true"
166
- }),
167
- label: i("brainyrich.goals.metrics.activeGoals", "Goals"),
168
- value: String(a.length)
169
- })
170
- }),
171
- /* @__PURE__ */ k(d, {
172
- index: 1,
173
- children: /* @__PURE__ */ k(f, {
174
- icon: /* @__PURE__ */ k(ge, {
175
- className: "size-4",
176
- "aria-hidden": "true"
177
- }),
178
- label: i("brainyrich.goals.metrics.totalTarget", "Total target"),
179
- value: m(G.totalTarget, K)
180
- })
181
- }),
182
- /* @__PURE__ */ k(d, {
183
- index: 2,
184
- children: /* @__PURE__ */ k(f, {
185
- icon: /* @__PURE__ */ k(me, {
186
- className: "size-4",
187
- "aria-hidden": "true"
188
- }),
189
- label: i("brainyrich.goals.metrics.monthly", "Monthly contributions"),
190
- value: m(G.totalMonthly, K)
191
- })
192
- }),
193
- /* @__PURE__ */ k(d, {
194
- index: 3,
195
- children: /* @__PURE__ */ k(f, {
196
- icon: /* @__PURE__ */ k(v, {
197
- className: "size-4",
198
- "aria-hidden": "true"
199
- }),
200
- label: i("brainyrich.goals.metrics.atRisk", "Needs attention"),
201
- value: String(G.atRisk),
202
- className: G.atRisk > 0 ? "ring-1 ring-status-error-text/30" : void 0
151
+ }),
152
+ title: i("brainyrich.goals.empty.title", "No financial goals yet"),
153
+ description: i("brainyrich.goals.empty.description", "Create your first goal to start tracking progress toward a milestone."),
154
+ action: /* @__PURE__ */ N(P, {
155
+ size: "sm",
156
+ onClick: J,
157
+ children: [/* @__PURE__ */ M(w, {
158
+ className: "size-4",
159
+ "aria-hidden": "true"
160
+ }), i("brainyrich.goals.actions.createGoal", "New goal")]
161
+ })
162
+ }) : /* @__PURE__ */ N(j, { children: [
163
+ /* @__PURE__ */ N("div", {
164
+ className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-4",
165
+ children: [
166
+ /* @__PURE__ */ M(d, {
167
+ index: 0,
168
+ children: /* @__PURE__ */ M(f, {
169
+ glow: !0,
170
+ icon: /* @__PURE__ */ M(T, {
171
+ className: "size-4",
172
+ "aria-hidden": "true"
173
+ }),
174
+ label: i("brainyrich.goals.metrics.activeGoals", "Goals"),
175
+ value: String(a.length)
176
+ })
177
+ }),
178
+ /* @__PURE__ */ M(d, {
179
+ index: 1,
180
+ children: /* @__PURE__ */ M(f, {
181
+ icon: /* @__PURE__ */ M(ge, {
182
+ className: "size-4",
183
+ "aria-hidden": "true"
184
+ }),
185
+ label: i("brainyrich.goals.metrics.totalTarget", "Total target"),
186
+ value: h(K.totalTarget, q)
187
+ })
188
+ }),
189
+ /* @__PURE__ */ M(d, {
190
+ index: 2,
191
+ children: /* @__PURE__ */ M(f, {
192
+ icon: /* @__PURE__ */ M(pe, {
193
+ className: "size-4",
194
+ "aria-hidden": "true"
195
+ }),
196
+ label: i("brainyrich.goals.metrics.monthly", "Monthly contributions"),
197
+ value: h(K.totalMonthly, q)
198
+ })
199
+ }),
200
+ /* @__PURE__ */ M(d, {
201
+ index: 3,
202
+ children: /* @__PURE__ */ M(f, {
203
+ icon: /* @__PURE__ */ M(S, {
204
+ className: "size-4",
205
+ "aria-hidden": "true"
206
+ }),
207
+ label: i("brainyrich.goals.metrics.atRisk", "Needs attention"),
208
+ value: String(K.atRisk),
209
+ className: K.atRisk > 0 ? "ring-1 ring-status-error-text/30" : void 0
210
+ })
203
211
  })
204
- })
205
- ]
206
- }),
207
- /* @__PURE__ */ k("div", {
208
- className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3",
209
- children: a.map((e, t) => {
210
- let n = Le(e.projection), r = n.icon, a = Be(e.status, e.projection), o = ze(e);
211
- return /* @__PURE__ */ k(d, {
212
- index: t,
213
- children: /* @__PURE__ */ A(ye, {
214
- className: `group flex h-full flex-col transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))] ${e.status === "ACHIEVED" ? "ring-1 ring-status-success-text/30" : ""}`,
215
- children: [/* @__PURE__ */ k(F, {
216
- className: "pb-3",
217
- children: /* @__PURE__ */ A("div", {
218
- className: "flex items-start justify-between gap-2",
219
- children: [/* @__PURE__ */ A("div", {
220
- className: "min-w-0",
221
- children: [/* @__PURE__ */ A(I, {
222
- className: "flex items-center gap-2 text-base",
223
- children: [/* @__PURE__ */ k(S, {
224
- className: "size-4 shrink-0 text-text-secondary",
225
- "aria-hidden": "true"
226
- }), /* @__PURE__ */ k("span", {
227
- className: "truncate",
228
- children: e.name
229
- })]
230
- }), /* @__PURE__ */ A(P, {
231
- className: "mt-1 flex flex-wrap items-center gap-2",
232
- children: [/* @__PURE__ */ k(j, {
233
- variant: "outline",
234
- children: Q(e.type)
235
- }), /* @__PURE__ */ k(j, {
236
- variant: fe(e.status),
237
- children: Q(e.status)
238
- })]
239
- })]
240
- }), /* @__PURE__ */ A(be, { children: [/* @__PURE__ */ k(we, {
241
- asChild: !0,
242
- children: /* @__PURE__ */ k(M, {
243
- variant: "ghost",
244
- size: "icon",
245
- "aria-label": i("brainyrich.goals.actions.menu", "Goal actions"),
246
- children: /* @__PURE__ */ k(b, {
247
- className: "size-4",
248
- "aria-hidden": "true"
249
- })
250
- })
251
- }), /* @__PURE__ */ A(xe, {
252
- align: "end",
253
- children: [
254
- /* @__PURE__ */ A(Se, {
255
- onSelect: () => z(e.id),
256
- children: [/* @__PURE__ */ k(he, {
257
- className: "size-4",
258
- "aria-hidden": "true"
259
- }), i("brainyrich.goals.actions.manageFunding", "Manage funding")]
260
- }),
261
- /* @__PURE__ */ A(Se, {
262
- onSelect: () => J(e),
263
- children: [/* @__PURE__ */ k(_e, {
264
- className: "size-4",
212
+ ]
213
+ }),
214
+ /* @__PURE__ */ M("div", {
215
+ className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3",
216
+ children: a.map((e, t) => {
217
+ let n = ze(e.projection), r = n.icon, a = He(e.status, e.projection), o = Ve(e);
218
+ return /* @__PURE__ */ M(d, {
219
+ index: t,
220
+ children: /* @__PURE__ */ N(be, {
221
+ className: `group flex h-full flex-col transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))] ${e.status === "ACHIEVED" ? "ring-1 ring-status-success-text/30" : ""}`,
222
+ children: [/* @__PURE__ */ M(I, {
223
+ className: "pb-3",
224
+ children: /* @__PURE__ */ N("div", {
225
+ className: "flex items-start justify-between gap-2",
226
+ children: [/* @__PURE__ */ N("div", {
227
+ className: "min-w-0",
228
+ children: [/* @__PURE__ */ N(L, {
229
+ className: "flex items-center gap-2 text-base",
230
+ children: [/* @__PURE__ */ M(T, {
231
+ className: "size-4 shrink-0 text-text-secondary",
265
232
  "aria-hidden": "true"
266
- }), i("brainyrich.goals.actions.editGoal", "Edit goal")]
267
- }),
268
- /* @__PURE__ */ k(Ce, {}),
269
- /* @__PURE__ */ A(Se, {
270
- className: "text-status-error-text focus:text-status-error-text",
271
- onSelect: () => V(e),
272
- children: [/* @__PURE__ */ k(ve, {
233
+ }), /* @__PURE__ */ M("span", {
234
+ className: "truncate",
235
+ children: e.name
236
+ })]
237
+ }), /* @__PURE__ */ N(F, {
238
+ className: "mt-1 flex flex-wrap items-center gap-2",
239
+ children: [/* @__PURE__ */ M(ye, {
240
+ variant: "outline",
241
+ children: $(e.type)
242
+ }), /* @__PURE__ */ M(ye, {
243
+ variant: de(e.status),
244
+ children: $(e.status)
245
+ })]
246
+ })]
247
+ }), /* @__PURE__ */ N(Se, { children: [/* @__PURE__ */ M(Ee, {
248
+ asChild: !0,
249
+ children: /* @__PURE__ */ M(P, {
250
+ variant: "ghost",
251
+ size: "icon",
252
+ "aria-label": i("brainyrich.goals.actions.menu", "Goal actions"),
253
+ children: /* @__PURE__ */ M(C, {
273
254
  className: "size-4",
274
255
  "aria-hidden": "true"
275
- }), i("brainyrich.goals.actions.archive", "Archive goal")]
256
+ })
276
257
  })
277
- ]
278
- })] })]
279
- })
280
- }), /* @__PURE__ */ A(N, {
281
- className: "flex flex-1 flex-col gap-4",
282
- children: [
283
- /* @__PURE__ */ A("div", {
284
- className: "flex items-center gap-4",
285
- children: [/* @__PURE__ */ k(ae, {
286
- value: o,
287
- tone: a,
288
- size: 92,
289
- strokeWidth: 9,
290
- label: i("brainyrich.goals.card.funded", "funded")
291
- }), /* @__PURE__ */ A("div", {
292
- className: "min-w-0 flex-1",
258
+ }), /* @__PURE__ */ N(Ce, {
259
+ align: "end",
293
260
  children: [
294
- /* @__PURE__ */ k("p", {
295
- className: "text-xs text-text-secondary",
296
- children: i("brainyrich.goals.card.target", "Target amount")
261
+ /* @__PURE__ */ N(we, {
262
+ onSelect: () => B(e.id),
263
+ children: [/* @__PURE__ */ M(he, {
264
+ className: "size-4",
265
+ "aria-hidden": "true"
266
+ }), i("brainyrich.goals.actions.manageFunding", "Manage funding")]
297
267
  }),
298
- /* @__PURE__ */ k("p", {
299
- className: "truncate text-2xl font-semibold text-text-primary",
300
- children: m(e.targetAmount, e.currency)
268
+ /* @__PURE__ */ N(we, {
269
+ onSelect: () => Y(e),
270
+ children: [/* @__PURE__ */ M(_e, {
271
+ className: "size-4",
272
+ "aria-hidden": "true"
273
+ }), i("brainyrich.goals.actions.editGoal", "Edit goal")]
301
274
  }),
302
- /* @__PURE__ */ A("span", {
303
- className: `mt-1 inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium ${n.tone}`,
304
- children: [/* @__PURE__ */ k(r, {
305
- className: "size-3.5",
275
+ /* @__PURE__ */ M(Te, {}),
276
+ /* @__PURE__ */ N(we, {
277
+ className: "text-status-error-text focus:text-status-error-text",
278
+ onSelect: () => H(e),
279
+ children: [/* @__PURE__ */ M(ve, {
280
+ className: "size-4",
306
281
  "aria-hidden": "true"
307
- }), Q(e.projection)]
282
+ }), i("brainyrich.goals.actions.archive", "Archive goal")]
308
283
  })
309
284
  ]
310
- })]
311
- }),
312
- /* @__PURE__ */ A("dl", {
313
- className: "grid grid-cols-2 gap-3 rounded-lg bg-bg-sunken p-3 text-sm",
314
- children: [
315
- /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
316
- className: "text-xs text-text-secondary",
317
- children: i("brainyrich.goals.card.targetDate", "Target date")
318
- }), /* @__PURE__ */ A("dd", {
319
- className: "flex items-center gap-1 font-medium text-text-primary",
320
- children: [/* @__PURE__ */ k(pe, {
321
- className: "size-3.5 text-text-secondary",
322
- "aria-hidden": "true"
323
- }), ue(e.targetDate)]
324
- })] }),
325
- /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
326
- className: "text-xs text-text-secondary",
327
- children: i("brainyrich.goals.card.monthly", "Monthly")
328
- }), /* @__PURE__ */ k("dd", {
329
- className: "font-medium text-text-primary",
330
- children: m(e.monthlyContribution, e.currency)
331
- })] }),
332
- /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
333
- className: "text-xs text-text-secondary",
334
- children: i("brainyrich.goals.card.priority", "Priority")
335
- }), /* @__PURE__ */ k("dd", {
336
- className: "font-medium text-text-primary",
337
- children: e.priority
338
- })] }),
339
- /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", {
340
- className: "text-xs text-text-secondary",
341
- children: i("brainyrich.goals.card.fundings", "Funding links")
342
- }), /* @__PURE__ */ k("dd", {
343
- className: "font-medium text-text-primary",
344
- children: e.fundings.length
345
- })] })
346
- ]
347
- }),
348
- /* @__PURE__ */ k("div", {
349
- className: "mt-auto",
350
- children: /* @__PURE__ */ k(M, {
351
- variant: "outline",
352
- size: "sm",
353
- className: "w-full",
354
- onClick: () => z(e.id),
355
- children: i("brainyrich.goals.actions.viewDetails", "View details & funding")
356
- })
285
+ })] })]
357
286
  })
358
- ]
359
- })]
360
- })
361
- }, e.id);
287
+ }), /* @__PURE__ */ N(xe, {
288
+ className: "flex flex-1 flex-col gap-4",
289
+ children: [
290
+ /* @__PURE__ */ N("div", {
291
+ className: "flex items-center gap-4",
292
+ children: [/* @__PURE__ */ M(ae, {
293
+ value: o,
294
+ tone: a,
295
+ size: 92,
296
+ strokeWidth: 9,
297
+ label: i("brainyrich.goals.card.funded", "funded")
298
+ }), /* @__PURE__ */ N("div", {
299
+ className: "min-w-0 flex-1",
300
+ children: [
301
+ /* @__PURE__ */ M("p", {
302
+ className: "text-xs text-text-secondary",
303
+ children: i("brainyrich.goals.card.target", "Target amount")
304
+ }),
305
+ /* @__PURE__ */ M("p", {
306
+ className: "truncate text-2xl font-semibold text-text-primary",
307
+ children: h(e.targetAmount, e.currency)
308
+ }),
309
+ /* @__PURE__ */ N("span", {
310
+ className: `mt-1 inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium ${n.tone}`,
311
+ children: [/* @__PURE__ */ M(r, {
312
+ className: "size-3.5",
313
+ "aria-hidden": "true"
314
+ }), $(e.projection)]
315
+ })
316
+ ]
317
+ })]
318
+ }),
319
+ /* @__PURE__ */ N("dl", {
320
+ className: "grid grid-cols-2 gap-3 rounded-lg bg-bg-sunken p-3 text-sm",
321
+ children: [
322
+ /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
323
+ className: "text-xs text-text-secondary",
324
+ children: i("brainyrich.goals.card.targetDate", "Target date")
325
+ }), /* @__PURE__ */ N("dd", {
326
+ className: "flex items-center gap-1 font-medium text-text-primary",
327
+ children: [/* @__PURE__ */ M(fe, {
328
+ className: "size-3.5 text-text-secondary",
329
+ "aria-hidden": "true"
330
+ }), m(e.targetDate)]
331
+ })] }),
332
+ /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
333
+ className: "text-xs text-text-secondary",
334
+ children: i("brainyrich.goals.card.monthly", "Monthly")
335
+ }), /* @__PURE__ */ M("dd", {
336
+ className: "font-medium text-text-primary",
337
+ children: h(e.monthlyContribution, e.currency)
338
+ })] }),
339
+ /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
340
+ className: "text-xs text-text-secondary",
341
+ children: i("brainyrich.goals.card.priority", "Priority")
342
+ }), /* @__PURE__ */ M("dd", {
343
+ className: "font-medium text-text-primary",
344
+ children: e.priority
345
+ })] }),
346
+ /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
347
+ className: "text-xs text-text-secondary",
348
+ children: i("brainyrich.goals.card.fundings", "Funding links")
349
+ }), /* @__PURE__ */ M("dd", {
350
+ className: "font-medium text-text-primary",
351
+ children: e.fundings.length
352
+ })] })
353
+ ]
354
+ }),
355
+ /* @__PURE__ */ M("div", {
356
+ className: "mt-auto",
357
+ children: /* @__PURE__ */ M(P, {
358
+ variant: "outline",
359
+ size: "sm",
360
+ className: "w-full",
361
+ onClick: () => B(e.id),
362
+ children: i("brainyrich.goals.actions.viewDetails", "View details & funding")
363
+ })
364
+ })
365
+ ]
366
+ })]
367
+ })
368
+ }, e.id);
369
+ })
370
+ }),
371
+ /* @__PURE__ */ M(te, {
372
+ hasMore: s,
373
+ loading: u,
374
+ onClick: l,
375
+ label: i("brainyrich.goals.actions.loadMore", "Load more goals"),
376
+ loadingLabel: i("brainyrich.goals.actions.loadingMore", "Loading…")
362
377
  })
363
- }),
364
- /* @__PURE__ */ k(te, {
365
- hasMore: s,
366
- loading: u,
367
- onClick: l,
368
- label: i("brainyrich.goals.actions.loadMore", "Load more goals"),
369
- loadingLabel: i("brainyrich.goals.actions.loadingMore", "Loading…")
370
- })
371
- ] })
372
- }),
373
- /* @__PURE__ */ k(Ke, {
374
- open: w,
375
- mode: "create",
376
- form: H,
377
- setField: W,
378
- households: de.map((e) => ({
379
- id: e.id,
380
- name: e.name
381
- })),
382
- valid: Y,
383
- pending: h.isPending,
384
- onSubmit: () => {
385
- if (!Y) return;
386
- let e = {
387
- name: H.name.trim(),
388
- type: H.type,
389
- targetAmount: Number(H.targetAmount),
390
- targetDate: new Date(H.targetDate).toISOString(),
391
- monthlyContribution: Number(H.monthlyContribution) || 0,
392
- priority: Number(H.priority) || 1,
393
- currency: H.currency.trim() || "USD",
394
- notes: H.notes.trim() || null,
395
- tags: [],
396
- ...H.householdId ? { householdId: H.householdId } : {}
397
- };
398
- h.mutate(e, { onSuccess: () => T(!1) });
399
- },
400
- onOpenChange: (e) => T(e),
401
- translate: i
402
- }),
403
- /* @__PURE__ */ k(Ke, {
404
- open: !!E,
405
- mode: "edit",
406
- goalId: E?.id,
407
- form: H,
408
- setField: W,
409
- households: de.map((e) => ({
410
- id: e.id,
411
- name: e.name
412
- })),
413
- valid: Y,
414
- pending: y.isPending,
415
- onSubmit: () => {
416
- if (!E || !Y) return;
417
- let e = {
418
- name: H.name.trim(),
419
- type: H.type,
420
- status: H.status,
421
- targetAmount: Number(H.targetAmount),
422
- targetDate: new Date(H.targetDate).toISOString(),
423
- monthlyContribution: Number(H.monthlyContribution) || 0,
424
- priority: Number(H.priority) || 1,
425
- currency: H.currency.trim() || "USD",
426
- notes: H.notes.trim() || null,
427
- tags: E.tags
428
- };
429
- y.mutate({
430
- id: E.id,
431
- input: e
432
- }, { onSuccess: () => L(null) });
433
- },
434
- onOpenChange: (e) => {
435
- e || L(null);
436
- },
437
- translate: i
438
- }),
439
- /* @__PURE__ */ k(qe, {
440
- goalId: R,
441
- onClose: () => z(null),
442
- translate: i
443
- }),
444
- /* @__PURE__ */ k(ne, {
445
- open: !!B,
446
- onOpenChange: (e) => {
447
- e || V(null);
448
- },
449
- title: i("brainyrich.goals.archive.title", "Archive goal?"),
450
- description: i("brainyrich.goals.archive.description", "This removes “{name}” from your active goals. You can no longer track its progress.", { name: B?.name ?? "" }),
451
- confirmLabel: i("brainyrich.goals.archive.confirm", "Archive goal"),
452
- pendingLabel: i("brainyrich.goals.archive.pending", "Archiving…"),
453
- destructive: !0,
454
- pending: C.isPending,
455
- onConfirm: () => {
456
- B && C.mutate(B.id, { onSuccess: () => V(null) });
457
- }
458
- })
459
- ] });
378
+ ] })
379
+ }),
380
+ /* @__PURE__ */ M(Ye, {
381
+ open: D,
382
+ mode: "create",
383
+ form: U,
384
+ setField: G,
385
+ households: ue.map((e) => ({
386
+ id: e.id,
387
+ name: e.name
388
+ })),
389
+ valid: X,
390
+ pending: y.isPending,
391
+ onSubmit: () => {
392
+ if (!X) return;
393
+ let e = {
394
+ name: U.name.trim(),
395
+ type: U.type,
396
+ targetAmount: Number(U.targetAmount),
397
+ targetDate: new Date(U.targetDate).toISOString(),
398
+ monthlyContribution: Number(U.monthlyContribution) || 0,
399
+ priority: Number(U.priority) || 1,
400
+ currency: U.currency.trim() || "USD",
401
+ notes: U.notes.trim() || null,
402
+ tags: [],
403
+ ...U.householdId ? { householdId: U.householdId } : {}
404
+ };
405
+ y.mutate(e, { onSuccess: () => {
406
+ g(), _(i("brainyrich.goals.created", "Goal created")), O(!1);
407
+ } });
408
+ },
409
+ onOpenChange: (e) => O(e),
410
+ translate: i
411
+ }),
412
+ /* @__PURE__ */ M(Ye, {
413
+ open: !!k,
414
+ mode: "edit",
415
+ goalId: k?.id,
416
+ form: U,
417
+ setField: G,
418
+ households: ue.map((e) => ({
419
+ id: e.id,
420
+ name: e.name
421
+ })),
422
+ valid: X,
423
+ pending: me.isPending,
424
+ onSubmit: () => {
425
+ if (!k || !X) return;
426
+ let e = {
427
+ name: U.name.trim(),
428
+ type: U.type,
429
+ status: U.status,
430
+ targetAmount: Number(U.targetAmount),
431
+ targetDate: new Date(U.targetDate).toISOString(),
432
+ monthlyContribution: Number(U.monthlyContribution) || 0,
433
+ priority: Number(U.priority) || 1,
434
+ currency: U.currency.trim() || "USD",
435
+ notes: U.notes.trim() || null,
436
+ tags: k.tags
437
+ };
438
+ me.mutate({
439
+ id: k.id,
440
+ input: e
441
+ }, { onSuccess: () => {
442
+ g(), _(i("brainyrich.goals.saved", "Goal saved")), R(null);
443
+ } });
444
+ },
445
+ onOpenChange: (e) => {
446
+ e || R(null);
447
+ },
448
+ translate: i
449
+ }),
450
+ /* @__PURE__ */ M(Xe, {
451
+ goalId: z,
452
+ onClose: () => B(null),
453
+ translate: i
454
+ }),
455
+ /* @__PURE__ */ M(ne, {
456
+ open: !!V,
457
+ onOpenChange: (e) => {
458
+ e || H(null);
459
+ },
460
+ title: i("brainyrich.goals.archive.title", "Archive goal?"),
461
+ description: i("brainyrich.goals.archive.description", "This removes “{name}” from your active goals. You can no longer track its progress.", { name: V?.name ?? "" }),
462
+ confirmLabel: i("brainyrich.goals.archive.confirm", "Archive goal"),
463
+ pendingLabel: i("brainyrich.goals.archive.pending", "Archiving…"),
464
+ destructive: !0,
465
+ pending: E.isPending,
466
+ onConfirm: () => {
467
+ V && E.mutate(V.id, { onSuccess: () => {
468
+ g(), _(i("brainyrich.goals.archived", "Goal archived", { name: V.name })), H(null);
469
+ } });
470
+ }
471
+ })
472
+ ]
473
+ });
460
474
  }
461
- function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a, valid: o, pending: s, onSubmit: c, onOpenChange: l, translate: u }) {
462
- return /* @__PURE__ */ k(L, {
475
+ function Ye({ open: e, mode: t, goalId: n, form: r, setField: i, households: a, valid: o, pending: s, onSubmit: c, onOpenChange: l, translate: u }) {
476
+ return /* @__PURE__ */ M(R, {
463
477
  open: e,
464
478
  onOpenChange: l,
465
- children: /* @__PURE__ */ A(R, {
479
+ children: /* @__PURE__ */ N(z, {
466
480
  className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
467
- children: [/* @__PURE__ */ A(V, { children: [/* @__PURE__ */ k(H, { children: t === "create" ? u("brainyrich.goals.form.createTitle", "New goal") : u("brainyrich.goals.form.editTitle", "Edit goal") }), /* @__PURE__ */ k(z, { children: u("brainyrich.goals.form.subtitle", "Define the milestone, target and contribution plan.") })] }), /* @__PURE__ */ A("form", {
481
+ children: [/* @__PURE__ */ N(H, { children: [/* @__PURE__ */ M(U, { children: t === "create" ? u("brainyrich.goals.form.createTitle", "New goal") : u("brainyrich.goals.form.editTitle", "Edit goal") }), /* @__PURE__ */ M(B, { children: u("brainyrich.goals.form.subtitle", "Define the milestone, target and contribution plan.") })] }), /* @__PURE__ */ N("form", {
468
482
  className: "space-y-4",
469
483
  onSubmit: (e) => {
470
484
  e.preventDefault(), c();
471
485
  },
472
486
  children: [
473
- /* @__PURE__ */ A("div", {
487
+ /* @__PURE__ */ N("div", {
474
488
  className: "space-y-1.5",
475
- children: [/* @__PURE__ */ k(W, {
489
+ children: [/* @__PURE__ */ M(G, {
476
490
  htmlFor: "goal-name",
477
491
  children: u("brainyrich.goals.form.name", "Name")
478
- }), /* @__PURE__ */ k(U, {
492
+ }), /* @__PURE__ */ M(W, {
479
493
  id: "goal-name",
480
494
  value: r.name,
481
495
  onChange: (e) => i("name", e.target.value),
@@ -483,46 +497,46 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
483
497
  required: !0
484
498
  })]
485
499
  }),
486
- /* @__PURE__ */ A("div", {
500
+ /* @__PURE__ */ N("div", {
487
501
  className: "grid grid-cols-2 gap-3",
488
- children: [/* @__PURE__ */ A("div", {
502
+ children: [/* @__PURE__ */ N("div", {
489
503
  className: "space-y-1.5",
490
- children: [/* @__PURE__ */ k(W, {
504
+ children: [/* @__PURE__ */ M(G, {
491
505
  htmlFor: "goal-type",
492
506
  children: u("brainyrich.goals.form.type", "Type")
493
- }), /* @__PURE__ */ A(G, {
507
+ }), /* @__PURE__ */ N(K, {
494
508
  value: r.type,
495
509
  onValueChange: (e) => i("type", e),
496
- children: [/* @__PURE__ */ k(J, {
510
+ children: [/* @__PURE__ */ M(Y, {
497
511
  id: "goal-type",
498
- children: /* @__PURE__ */ k(Y, {})
499
- }), /* @__PURE__ */ k(K, { children: Fe.map((e) => /* @__PURE__ */ k(q, {
512
+ children: /* @__PURE__ */ M(X, {})
513
+ }), /* @__PURE__ */ M(q, { children: Le.map((e) => /* @__PURE__ */ M(J, {
500
514
  value: e,
501
- children: Q(e)
515
+ children: $(e)
502
516
  }, e)) })]
503
517
  })]
504
- }), t === "edit" ? /* @__PURE__ */ A("div", {
518
+ }), t === "edit" ? /* @__PURE__ */ N("div", {
505
519
  className: "space-y-1.5",
506
- children: [/* @__PURE__ */ k(W, {
520
+ children: [/* @__PURE__ */ M(G, {
507
521
  htmlFor: "goal-status",
508
522
  children: u("brainyrich.goals.form.status", "Status")
509
- }), /* @__PURE__ */ A(G, {
523
+ }), /* @__PURE__ */ N(K, {
510
524
  value: r.status,
511
525
  onValueChange: (e) => i("status", e),
512
- children: [/* @__PURE__ */ k(J, {
526
+ children: [/* @__PURE__ */ M(Y, {
513
527
  id: "goal-status",
514
- children: /* @__PURE__ */ k(Y, {})
515
- }), /* @__PURE__ */ k(K, { children: Ie.map((e) => /* @__PURE__ */ k(q, {
528
+ children: /* @__PURE__ */ M(X, {})
529
+ }), /* @__PURE__ */ M(q, { children: Re.map((e) => /* @__PURE__ */ M(J, {
516
530
  value: e,
517
- children: Q(e)
531
+ children: $(e)
518
532
  }, e)) })]
519
533
  })]
520
- }) : /* @__PURE__ */ A("div", {
534
+ }) : /* @__PURE__ */ N("div", {
521
535
  className: "space-y-1.5",
522
- children: [/* @__PURE__ */ k(W, {
536
+ children: [/* @__PURE__ */ M(G, {
523
537
  htmlFor: "goal-priority",
524
538
  children: u("brainyrich.goals.form.priority", "Priority")
525
- }), /* @__PURE__ */ k(U, {
539
+ }), /* @__PURE__ */ M(W, {
526
540
  id: "goal-priority",
527
541
  type: "number",
528
542
  min: 1,
@@ -531,14 +545,14 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
531
545
  })]
532
546
  })]
533
547
  }),
534
- /* @__PURE__ */ A("div", {
548
+ /* @__PURE__ */ N("div", {
535
549
  className: "grid grid-cols-2 gap-3",
536
- children: [/* @__PURE__ */ A("div", {
550
+ children: [/* @__PURE__ */ N("div", {
537
551
  className: "space-y-1.5",
538
- children: [/* @__PURE__ */ k(W, {
552
+ children: [/* @__PURE__ */ M(G, {
539
553
  htmlFor: "goal-target",
540
554
  children: u("brainyrich.goals.form.targetAmount", "Target amount")
541
- }), /* @__PURE__ */ k(U, {
555
+ }), /* @__PURE__ */ M(W, {
542
556
  id: "goal-target",
543
557
  type: "number",
544
558
  min: 0,
@@ -547,12 +561,12 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
547
561
  onChange: (e) => i("targetAmount", e.target.value),
548
562
  required: !0
549
563
  })]
550
- }), /* @__PURE__ */ A("div", {
564
+ }), /* @__PURE__ */ N("div", {
551
565
  className: "space-y-1.5",
552
- children: [/* @__PURE__ */ k(W, {
566
+ children: [/* @__PURE__ */ M(G, {
553
567
  htmlFor: "goal-date",
554
568
  children: u("brainyrich.goals.form.targetDate", "Target date")
555
- }), /* @__PURE__ */ k(U, {
569
+ }), /* @__PURE__ */ M(W, {
556
570
  id: "goal-date",
557
571
  type: "date",
558
572
  value: r.targetDate,
@@ -561,14 +575,14 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
561
575
  })]
562
576
  })]
563
577
  }),
564
- /* @__PURE__ */ A("div", {
578
+ /* @__PURE__ */ N("div", {
565
579
  className: "grid grid-cols-2 gap-3",
566
- children: [/* @__PURE__ */ A("div", {
580
+ children: [/* @__PURE__ */ N("div", {
567
581
  className: "space-y-1.5",
568
- children: [/* @__PURE__ */ k(W, {
582
+ children: [/* @__PURE__ */ M(G, {
569
583
  htmlFor: "goal-monthly",
570
584
  children: u("brainyrich.goals.form.monthly", "Monthly contribution")
571
- }), /* @__PURE__ */ k(U, {
585
+ }), /* @__PURE__ */ M(W, {
572
586
  id: "goal-monthly",
573
587
  type: "number",
574
588
  min: 0,
@@ -576,12 +590,12 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
576
590
  value: r.monthlyContribution,
577
591
  onChange: (e) => i("monthlyContribution", e.target.value)
578
592
  })]
579
- }), /* @__PURE__ */ A("div", {
593
+ }), /* @__PURE__ */ N("div", {
580
594
  className: "space-y-1.5",
581
- children: [/* @__PURE__ */ k(W, {
595
+ children: [/* @__PURE__ */ M(G, {
582
596
  htmlFor: "goal-currency",
583
597
  children: u("brainyrich.goals.form.currency", "Currency")
584
- }), /* @__PURE__ */ k(U, {
598
+ }), /* @__PURE__ */ M(W, {
585
599
  id: "goal-currency",
586
600
  value: r.currency,
587
601
  onChange: (e) => i("currency", e.target.value.toUpperCase()),
@@ -589,12 +603,12 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
589
603
  })]
590
604
  })]
591
605
  }),
592
- t === "edit" ? /* @__PURE__ */ A("div", {
606
+ t === "edit" ? /* @__PURE__ */ N("div", {
593
607
  className: "space-y-1.5",
594
- children: [/* @__PURE__ */ k(W, {
608
+ children: [/* @__PURE__ */ M(G, {
595
609
  htmlFor: "goal-priority-edit",
596
610
  children: u("brainyrich.goals.form.priority", "Priority")
597
- }), /* @__PURE__ */ k(U, {
611
+ }), /* @__PURE__ */ M(W, {
598
612
  id: "goal-priority-edit",
599
613
  type: "number",
600
614
  min: 1,
@@ -602,56 +616,56 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
602
616
  onChange: (e) => i("priority", e.target.value)
603
617
  })]
604
618
  }) : null,
605
- /* @__PURE__ */ A("div", {
619
+ /* @__PURE__ */ N("div", {
606
620
  className: "space-y-1.5",
607
- children: [/* @__PURE__ */ k(W, {
621
+ children: [/* @__PURE__ */ M(G, {
608
622
  htmlFor: "goal-household",
609
623
  children: u("brainyrich.goals.form.household", "Household (optional)")
610
- }), /* @__PURE__ */ A(G, {
611
- value: r.householdId || $,
612
- onValueChange: (e) => i("householdId", e === $ ? "" : e),
613
- children: [/* @__PURE__ */ k(J, {
624
+ }), /* @__PURE__ */ N(K, {
625
+ value: r.householdId || qe,
626
+ onValueChange: (e) => i("householdId", e === qe ? "" : e),
627
+ children: [/* @__PURE__ */ M(Y, {
614
628
  id: "goal-household",
615
- children: /* @__PURE__ */ k(Y, { placeholder: u("brainyrich.goals.form.householdNone", "None") })
616
- }), /* @__PURE__ */ A(K, { children: [/* @__PURE__ */ k(q, {
617
- value: $,
629
+ children: /* @__PURE__ */ M(X, { placeholder: u("brainyrich.goals.form.householdNone", "None") })
630
+ }), /* @__PURE__ */ N(q, { children: [/* @__PURE__ */ M(J, {
631
+ value: qe,
618
632
  children: u("brainyrich.goals.form.householdNone", "None")
619
- }), a.map((e) => /* @__PURE__ */ k(q, {
633
+ }), a.map((e) => /* @__PURE__ */ M(J, {
620
634
  value: e.id,
621
635
  children: e.name
622
636
  }, e.id))] })]
623
637
  })]
624
638
  }),
625
- t === "edit" && n ? /* @__PURE__ */ k(h, {
639
+ t === "edit" && n ? /* @__PURE__ */ M(y, {
626
640
  entityType: "brainyrich-goal",
627
641
  entityId: n,
628
642
  label: u("brainyrich.goals.form.tags", "Tags")
629
- }) : /* @__PURE__ */ A("div", {
643
+ }) : /* @__PURE__ */ N("div", {
630
644
  className: "space-y-1.5",
631
- children: [/* @__PURE__ */ k(W, { children: u("brainyrich.goals.form.tags", "Tags") }), /* @__PURE__ */ k("p", {
645
+ children: [/* @__PURE__ */ M(G, { children: u("brainyrich.goals.form.tags", "Tags") }), /* @__PURE__ */ M("p", {
632
646
  className: "text-sm text-text-secondary",
633
647
  children: u("brainyrich.goals.form.tagsAfterCreate", "You can add tags after creating the goal.")
634
648
  })]
635
649
  }),
636
- /* @__PURE__ */ A("div", {
650
+ /* @__PURE__ */ N("div", {
637
651
  className: "space-y-1.5",
638
- children: [/* @__PURE__ */ k(W, {
652
+ children: [/* @__PURE__ */ M(G, {
639
653
  htmlFor: "goal-notes",
640
654
  children: u("brainyrich.goals.form.notes", "Notes")
641
- }), /* @__PURE__ */ k(Pe, {
655
+ }), /* @__PURE__ */ M(Ie, {
642
656
  id: "goal-notes",
643
657
  value: r.notes,
644
658
  onChange: (e) => i("notes", e.target.value),
645
659
  rows: 3
646
660
  })]
647
661
  }),
648
- /* @__PURE__ */ A(B, { children: [/* @__PURE__ */ k(M, {
662
+ /* @__PURE__ */ N(V, { children: [/* @__PURE__ */ M(P, {
649
663
  type: "button",
650
664
  variant: "outline",
651
665
  onClick: () => l(!1),
652
666
  disabled: s,
653
667
  children: u("brainyrich.goals.form.cancel", "Cancel")
654
- }), /* @__PURE__ */ k(M, {
668
+ }), /* @__PURE__ */ M(P, {
655
669
  type: "submit",
656
670
  disabled: !o || s,
657
671
  children: s ? u("brainyrich.goals.form.saving", "Saving…") : t === "create" ? u("brainyrich.goals.form.create", "Create goal") : u("brainyrich.goals.form.save", "Save changes")
@@ -661,173 +675,173 @@ function Ke({ open: e, mode: t, goalId: n, form: r, setField: i, households: a,
661
675
  })
662
676
  });
663
677
  }
664
- function qe({ goalId: e, onClose: n, translate: r }) {
665
- let { data: o, isLoading: c, isError: ee, refetch: te } = i(e ?? void 0), { data: d } = a(e ?? void 0), { data: p } = t(), h = s(), g = u(), v = l(), [b, ge] = _(""), [x, ve] = _("PERCENT"), [C, w] = _(""), [D, ye] = _(""), [N, P] = _(null), F = d.reduce((e, t) => e + (t.fixedAmount ?? 0), 0), I = o?.currency ?? "USD", L = o ? ze(o) : 0, R = o ? Be(o.status, o.projection) : "brand", z = o ? Ve(F, o.monthlyContribution, o.targetDate) : [], B = (e) => p.find((t) => t.id === e)?.name ?? e, V = () => {
678
+ function Xe({ goalId: e, onClose: n, translate: r }) {
679
+ let { data: o, isLoading: c, isError: ee, refetch: te } = i(e ?? void 0), { data: d } = a(e ?? void 0), { data: p } = t(), g = s(), _ = u(), v = l(), [b, S] = x(""), [C, ge] = x("PERCENT"), [w, ve] = x(""), [E, D] = x(""), [A, F] = x(null), I = d.reduce((e, t) => e + (t.fixedAmount ?? 0), 0), L = o?.currency ?? "USD", R = o ? Ve(o) : 0, z = o ? He(o.status, o.projection) : "brand", B = o ? Ue(I, o.monthlyContribution, o.targetDate) : [], V = (e) => p.find((t) => t.id === e)?.name ?? e, H = () => {
666
680
  if (!e || !b) return;
667
- let t = Number(C);
668
- !Number.isFinite(t) || t <= 0 || h.mutate({
681
+ let t = Number(w);
682
+ !Number.isFinite(t) || t <= 0 || g.mutate({
669
683
  goalId: e,
670
684
  accountId: b,
671
- ...x === "PERCENT" ? { allocationPct: t } : { fixedAmount: t }
685
+ ...C === "PERCENT" ? { allocationPct: t } : { fixedAmount: t }
672
686
  }, { onSuccess: () => {
673
- ge(""), w("");
687
+ S(""), ve("");
674
688
  } });
675
- }, H = () => {
689
+ }, U = () => {
676
690
  if (!e) return;
677
- let t = D === "" ? F : Number(D);
691
+ let t = E === "" ? I : Number(E);
678
692
  Number.isFinite(t) && v.mutate({
679
693
  id: e,
680
694
  fundedAmount: t
681
695
  });
682
- }, be = !!b && Number(C) > 0, xe = N ? N.fixedAmount == null ? B(N.accountId) : m(N.fixedAmount, I) : "";
683
- return /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(Te, {
696
+ }, Se = !!b && Number(w) > 0, Ce = A ? A.fixedAmount == null ? V(A.accountId) : h(A.fixedAmount, L) : "";
697
+ return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(De, {
684
698
  open: !!e,
685
699
  onOpenChange: (e) => {
686
700
  e || n();
687
701
  },
688
- children: /* @__PURE__ */ A(Ee, {
702
+ children: /* @__PURE__ */ N(Oe, {
689
703
  className: "flex w-full flex-col gap-0 overflow-y-auto sm:max-w-xl",
690
- children: [/* @__PURE__ */ A(Oe, { children: [/* @__PURE__ */ k(ke, { children: o?.name ?? r("brainyrich.goals.detail.title", "Goal") }), /* @__PURE__ */ k(De, { children: r("brainyrich.goals.detail.subtitle", "Manage funding links and projection.") })] }), /* @__PURE__ */ k("div", {
704
+ children: [/* @__PURE__ */ N(Ae, { children: [/* @__PURE__ */ M(je, { children: o?.name ?? r("brainyrich.goals.detail.title", "Goal") }), /* @__PURE__ */ M(ke, { children: r("brainyrich.goals.detail.subtitle", "Manage funding links and projection.") })] }), /* @__PURE__ */ M("div", {
691
705
  className: "space-y-6 p-4",
692
- children: c ? /* @__PURE__ */ k(ce, { rows: 3 }) : ee ? /* @__PURE__ */ k(se, {
706
+ children: c ? /* @__PURE__ */ M(ce, { rows: 3 }) : ee ? /* @__PURE__ */ M(se, {
693
707
  title: r("brainyrich.goals.detail.error", "Could not load goal"),
694
708
  onRetry: () => te()
695
- }) : o ? /* @__PURE__ */ A(O, { children: [
696
- /* @__PURE__ */ A(re, {
709
+ }) : o ? /* @__PURE__ */ N(j, { children: [
710
+ /* @__PURE__ */ N(re, {
697
711
  glow: !0,
698
712
  className: "flex items-center gap-5",
699
- children: [/* @__PURE__ */ k(ae, {
700
- value: L,
701
- tone: R,
713
+ children: [/* @__PURE__ */ M(ae, {
714
+ value: R,
715
+ tone: z,
702
716
  size: 116,
703
717
  strokeWidth: 11,
704
718
  label: r("brainyrich.goals.detail.funded", "funded")
705
- }), /* @__PURE__ */ A("div", {
719
+ }), /* @__PURE__ */ N("div", {
706
720
  className: "min-w-0 flex-1 space-y-1",
707
721
  children: [
708
- /* @__PURE__ */ k(j, {
709
- variant: fe(o.projection),
710
- children: Q(o.projection)
722
+ /* @__PURE__ */ M(ye, {
723
+ variant: de(o.projection),
724
+ children: $(o.projection)
711
725
  }),
712
- /* @__PURE__ */ k("p", {
726
+ /* @__PURE__ */ M("p", {
713
727
  className: "text-2xl font-semibold text-text-primary",
714
- children: m(F, I)
728
+ children: h(I, L)
715
729
  }),
716
- /* @__PURE__ */ k("p", {
730
+ /* @__PURE__ */ M("p", {
717
731
  className: "text-xs text-text-secondary",
718
- children: r("brainyrich.goals.detail.ofTarget", "of {target} target", { target: le(o.targetAmount, I) })
732
+ children: r("brainyrich.goals.detail.ofTarget", "of {target} target", { target: le(o.targetAmount, L) })
719
733
  })
720
734
  ]
721
735
  })]
722
736
  }),
723
- /* @__PURE__ */ A("div", {
737
+ /* @__PURE__ */ N("div", {
724
738
  className: "grid grid-cols-2 gap-3",
725
739
  children: [
726
- /* @__PURE__ */ k(f, {
727
- icon: /* @__PURE__ */ k(S, {
740
+ /* @__PURE__ */ M(f, {
741
+ icon: /* @__PURE__ */ M(T, {
728
742
  className: "size-4",
729
743
  "aria-hidden": "true"
730
744
  }),
731
745
  label: r("brainyrich.goals.detail.target", "Target"),
732
- value: m(o.targetAmount, I)
746
+ value: h(o.targetAmount, L)
733
747
  }),
734
- /* @__PURE__ */ k(f, {
735
- icon: /* @__PURE__ */ k(E, {
748
+ /* @__PURE__ */ M(f, {
749
+ icon: /* @__PURE__ */ M(k, {
736
750
  className: "size-4",
737
751
  "aria-hidden": "true"
738
752
  }),
739
753
  label: r("brainyrich.goals.detail.funded", "Funded (fixed)"),
740
- value: m(F, I)
754
+ value: h(I, L)
741
755
  }),
742
- /* @__PURE__ */ k(f, {
743
- icon: /* @__PURE__ */ k(me, {
756
+ /* @__PURE__ */ M(f, {
757
+ icon: /* @__PURE__ */ M(pe, {
744
758
  className: "size-4",
745
759
  "aria-hidden": "true"
746
760
  }),
747
761
  label: r("brainyrich.goals.detail.monthly", "Monthly"),
748
- value: m(o.monthlyContribution, I)
762
+ value: h(o.monthlyContribution, L)
749
763
  }),
750
- /* @__PURE__ */ k(f, {
751
- icon: /* @__PURE__ */ k(pe, {
764
+ /* @__PURE__ */ M(f, {
765
+ icon: /* @__PURE__ */ M(fe, {
752
766
  className: "size-4",
753
767
  "aria-hidden": "true"
754
768
  }),
755
769
  label: r("brainyrich.goals.detail.targetDate", "Target date"),
756
- value: ue(o.targetDate)
770
+ value: m(o.targetDate)
757
771
  })
758
772
  ]
759
773
  }),
760
- z.length >= 2 ? /* @__PURE__ */ A("section", {
774
+ B.length >= 2 ? /* @__PURE__ */ N("section", {
761
775
  className: "space-y-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
762
776
  children: [
763
- /* @__PURE__ */ A("div", {
777
+ /* @__PURE__ */ N("div", {
764
778
  className: "flex items-center gap-2",
765
- children: [/* @__PURE__ */ k(y, {
779
+ children: [/* @__PURE__ */ M(me, {
766
780
  className: "size-4 text-text-secondary",
767
781
  "aria-hidden": "true"
768
- }), /* @__PURE__ */ k("h3", {
782
+ }), /* @__PURE__ */ M("h3", {
769
783
  className: "text-sm font-semibold text-text-primary",
770
784
  children: r("brainyrich.goals.detail.projectionChart", "Contribution projection")
771
785
  })]
772
786
  }),
773
- /* @__PURE__ */ k(ie, {
774
- data: z,
787
+ /* @__PURE__ */ M(ie, {
788
+ data: B,
775
789
  target: o.targetAmount,
776
- tone: R,
790
+ tone: z,
777
791
  height: 180,
778
- valueFormatter: (e) => le(e, I)
792
+ valueFormatter: (e) => le(e, L)
779
793
  }),
780
- /* @__PURE__ */ k("p", {
794
+ /* @__PURE__ */ M("p", {
781
795
  className: "text-xs text-text-secondary",
782
796
  children: r("brainyrich.goals.detail.projectionHint", "Starting balance plus {monthly}/mo through {date}.", {
783
- monthly: m(o.monthlyContribution, I),
784
- date: ue(o.targetDate)
797
+ monthly: h(o.monthlyContribution, L),
798
+ date: m(o.targetDate)
785
799
  })
786
800
  })
787
801
  ]
788
802
  }) : null,
789
- /* @__PURE__ */ A("section", {
803
+ /* @__PURE__ */ N("section", {
790
804
  className: "space-y-3",
791
- children: [/* @__PURE__ */ k("h3", {
805
+ children: [/* @__PURE__ */ M("h3", {
792
806
  className: "text-sm font-semibold text-text-primary",
793
807
  children: r("brainyrich.goals.detail.fundingLinks", "Funding sources")
794
- }), d.length === 0 ? /* @__PURE__ */ k("p", {
808
+ }), d.length === 0 ? /* @__PURE__ */ M("p", {
795
809
  className: "rounded-lg border border-dashed border-border-subtle bg-bg-surface px-4 py-6 text-center text-sm text-text-secondary",
796
810
  children: r("brainyrich.goals.detail.noFundings", "No accounts linked to fund this goal yet.")
797
- }) : /* @__PURE__ */ k("div", {
811
+ }) : /* @__PURE__ */ M("div", {
798
812
  className: "overflow-x-auto rounded-lg border border-border-subtle",
799
- children: /* @__PURE__ */ A(Ae, { children: [/* @__PURE__ */ k(Me, { children: /* @__PURE__ */ A(Ne, { children: [
800
- /* @__PURE__ */ k(Z, { children: r("brainyrich.goals.detail.account", "Account") }),
801
- /* @__PURE__ */ k(Z, {
813
+ children: /* @__PURE__ */ N(Me, { children: [/* @__PURE__ */ M(Pe, { children: /* @__PURE__ */ N(Fe, { children: [
814
+ /* @__PURE__ */ M(Q, { children: r("brainyrich.goals.detail.account", "Account") }),
815
+ /* @__PURE__ */ M(Q, {
802
816
  className: "text-right",
803
817
  children: r("brainyrich.goals.detail.allocation", "Allocation")
804
818
  }),
805
- /* @__PURE__ */ k(Z, {
819
+ /* @__PURE__ */ M(Q, {
806
820
  className: "text-right",
807
821
  children: r("brainyrich.goals.detail.fixedAmount", "Fixed amount")
808
822
  }),
809
- /* @__PURE__ */ k(Z, { className: "w-10" })
810
- ] }) }), /* @__PURE__ */ k(je, { children: d.map((e) => /* @__PURE__ */ A(Ne, { children: [
811
- /* @__PURE__ */ k(X, {
823
+ /* @__PURE__ */ M(Q, { className: "w-10" })
824
+ ] }) }), /* @__PURE__ */ M(Ne, { children: d.map((e) => /* @__PURE__ */ N(Fe, { children: [
825
+ /* @__PURE__ */ M(Z, {
812
826
  className: "font-medium text-text-primary",
813
- children: B(e.accountId)
827
+ children: V(e.accountId)
814
828
  }),
815
- /* @__PURE__ */ k(X, {
829
+ /* @__PURE__ */ M(Z, {
816
830
  className: "text-right tabular-nums text-text-secondary",
817
- children: e.fixedAmount == null ? de(e.allocationPct) : "—"
831
+ children: e.fixedAmount == null ? ue(e.allocationPct) : "—"
818
832
  }),
819
- /* @__PURE__ */ k(X, {
833
+ /* @__PURE__ */ M(Z, {
820
834
  className: "text-right tabular-nums text-text-secondary",
821
- children: e.fixedAmount == null ? "—" : m(e.fixedAmount, I)
835
+ children: e.fixedAmount == null ? "—" : h(e.fixedAmount, L)
822
836
  }),
823
- /* @__PURE__ */ k(X, {
837
+ /* @__PURE__ */ M(Z, {
824
838
  className: "text-right",
825
- children: /* @__PURE__ */ k(M, {
839
+ children: /* @__PURE__ */ M(P, {
826
840
  variant: "ghost",
827
841
  size: "icon",
828
842
  "aria-label": r("brainyrich.goals.detail.unlink", "Unlink funding"),
829
- onClick: () => P(e),
830
- children: /* @__PURE__ */ k(T, {
843
+ onClick: () => F(e),
844
+ children: /* @__PURE__ */ M(O, {
831
845
  className: "size-4",
832
846
  "aria-hidden": "true"
833
847
  })
@@ -836,124 +850,132 @@ function qe({ goalId: e, onClose: n, translate: r }) {
836
850
  ] }, e.id)) })] })
837
851
  })]
838
852
  }),
839
- /* @__PURE__ */ A("section", {
853
+ /* @__PURE__ */ N("section", {
840
854
  className: "space-y-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
841
- children: [/* @__PURE__ */ k("h3", {
855
+ children: [/* @__PURE__ */ M("h3", {
842
856
  className: "text-sm font-semibold text-text-primary",
843
857
  children: r("brainyrich.goals.detail.linkTitle", "Link an account")
844
- }), p.length === 0 ? /* @__PURE__ */ k("p", {
858
+ }), p.length === 0 ? /* @__PURE__ */ M("p", {
845
859
  className: "text-sm text-text-secondary",
846
860
  children: r("brainyrich.goals.detail.noAccounts", "No accounts available to link.")
847
- }) : /* @__PURE__ */ A(O, { children: [
848
- /* @__PURE__ */ A("div", {
861
+ }) : /* @__PURE__ */ N(j, { children: [
862
+ /* @__PURE__ */ N("div", {
849
863
  className: "space-y-1.5",
850
- children: [/* @__PURE__ */ k(W, {
864
+ children: [/* @__PURE__ */ M(G, {
851
865
  htmlFor: "funding-account",
852
866
  children: r("brainyrich.goals.detail.account", "Account")
853
- }), /* @__PURE__ */ A(G, {
867
+ }), /* @__PURE__ */ N(K, {
854
868
  value: b,
855
- onValueChange: ge,
856
- children: [/* @__PURE__ */ k(J, {
869
+ onValueChange: S,
870
+ children: [/* @__PURE__ */ M(Y, {
857
871
  id: "funding-account",
858
- children: /* @__PURE__ */ k(Y, { placeholder: r("brainyrich.goals.detail.selectAccount", "Select account") })
859
- }), /* @__PURE__ */ k(K, { children: p.map((e) => /* @__PURE__ */ k(q, {
872
+ children: /* @__PURE__ */ M(X, { placeholder: r("brainyrich.goals.detail.selectAccount", "Select account") })
873
+ }), /* @__PURE__ */ M(q, { children: p.map((e) => /* @__PURE__ */ M(J, {
860
874
  value: e.id,
861
875
  children: e.name
862
876
  }, e.id)) })]
863
877
  })]
864
878
  }),
865
- /* @__PURE__ */ A("div", {
879
+ /* @__PURE__ */ N("div", {
866
880
  className: "grid grid-cols-2 gap-3",
867
- children: [/* @__PURE__ */ A("div", {
881
+ children: [/* @__PURE__ */ N("div", {
868
882
  className: "space-y-1.5",
869
- children: [/* @__PURE__ */ k(W, {
883
+ children: [/* @__PURE__ */ M(G, {
870
884
  htmlFor: "funding-mode",
871
885
  children: r("brainyrich.goals.detail.mode", "Method")
872
- }), /* @__PURE__ */ A(G, {
873
- value: x,
874
- onValueChange: (e) => ve(e),
875
- children: [/* @__PURE__ */ k(J, {
886
+ }), /* @__PURE__ */ N(K, {
887
+ value: C,
888
+ onValueChange: (e) => ge(e),
889
+ children: [/* @__PURE__ */ M(Y, {
876
890
  id: "funding-mode",
877
- children: /* @__PURE__ */ k(Y, {})
878
- }), /* @__PURE__ */ A(K, { children: [/* @__PURE__ */ k(q, {
891
+ children: /* @__PURE__ */ M(X, {})
892
+ }), /* @__PURE__ */ N(q, { children: [/* @__PURE__ */ M(J, {
879
893
  value: "PERCENT",
880
894
  children: r("brainyrich.goals.detail.percent", "Percentage")
881
- }), /* @__PURE__ */ k(q, {
895
+ }), /* @__PURE__ */ M(J, {
882
896
  value: "FIXED",
883
897
  children: r("brainyrich.goals.detail.fixed", "Fixed amount")
884
898
  })] })]
885
899
  })]
886
- }), /* @__PURE__ */ A("div", {
900
+ }), /* @__PURE__ */ N("div", {
887
901
  className: "space-y-1.5",
888
- children: [/* @__PURE__ */ k(W, {
902
+ children: [/* @__PURE__ */ M(G, {
889
903
  htmlFor: "funding-value",
890
- children: x === "PERCENT" ? r("brainyrich.goals.detail.pct", "Percent") : r("brainyrich.goals.detail.amount", "Amount")
891
- }), /* @__PURE__ */ k(U, {
904
+ children: C === "PERCENT" ? r("brainyrich.goals.detail.pct", "Percent") : r("brainyrich.goals.detail.amount", "Amount")
905
+ }), /* @__PURE__ */ M(W, {
892
906
  id: "funding-value",
893
907
  type: "number",
894
908
  min: 0,
895
909
  step: "0.01",
896
- value: C,
897
- onChange: (e) => w(e.target.value)
910
+ value: w,
911
+ onChange: (e) => ve(e.target.value)
898
912
  })]
899
913
  })]
900
914
  }),
901
- /* @__PURE__ */ A(M, {
915
+ /* @__PURE__ */ N(P, {
902
916
  size: "sm",
903
917
  className: "w-full",
904
- disabled: !be || h.isPending,
905
- onClick: V,
906
- children: [/* @__PURE__ */ k(he, {
918
+ disabled: !Se || g.isPending,
919
+ onClick: H,
920
+ children: [/* @__PURE__ */ M(he, {
907
921
  className: "size-4",
908
922
  "aria-hidden": "true"
909
- }), h.isPending ? r("brainyrich.goals.detail.linking", "Linking…") : r("brainyrich.goals.detail.link", "Link funding")]
923
+ }), g.isPending ? r("brainyrich.goals.detail.linking", "Linking…") : r("brainyrich.goals.detail.link", "Link funding")]
910
924
  })
911
925
  ] })]
912
926
  }),
913
- /* @__PURE__ */ A("section", {
927
+ /* @__PURE__ */ M(be, { children: /* @__PURE__ */ M(xe, {
928
+ className: "p-4",
929
+ children: /* @__PURE__ */ M(y, {
930
+ entityType: "brainyrich-goal",
931
+ entityId: o.id,
932
+ label: r("brainyrich.goals.detail.tags", "Tags")
933
+ })
934
+ }) }),
935
+ /* @__PURE__ */ N("section", {
914
936
  className: "space-y-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
915
937
  children: [
916
- /* @__PURE__ */ k("h3", {
938
+ /* @__PURE__ */ M("h3", {
917
939
  className: "text-sm font-semibold text-text-primary",
918
940
  children: r("brainyrich.goals.detail.recalcTitle", "Recalculate projection")
919
941
  }),
920
- /* @__PURE__ */ A("div", {
942
+ /* @__PURE__ */ N("div", {
921
943
  className: "space-y-1.5",
922
944
  children: [
923
- /* @__PURE__ */ k(W, {
945
+ /* @__PURE__ */ M(G, {
924
946
  htmlFor: "recalc-funded",
925
947
  children: r("brainyrich.goals.detail.fundedAmount", "Funded amount")
926
948
  }),
927
- /* @__PURE__ */ k(U, {
949
+ /* @__PURE__ */ M(W, {
928
950
  id: "recalc-funded",
929
951
  type: "number",
930
952
  min: 0,
931
953
  step: "0.01",
932
- value: D,
933
- placeholder: String(F),
934
- onChange: (e) => ye(e.target.value)
954
+ value: E,
955
+ placeholder: String(I),
956
+ onChange: (e) => D(e.target.value)
935
957
  }),
936
- /* @__PURE__ */ k("p", {
958
+ /* @__PURE__ */ M("p", {
937
959
  className: "text-xs text-text-secondary",
938
960
  children: r("brainyrich.goals.detail.recalcHint", "Defaults to the sum of fixed fundings when left blank.")
939
961
  })
940
962
  ]
941
963
  }),
942
- /* @__PURE__ */ A(M, {
964
+ /* @__PURE__ */ N(P, {
943
965
  size: "sm",
944
966
  variant: "outline",
945
967
  className: "w-full",
946
968
  disabled: v.isPending,
947
- onClick: H,
948
- children: [/* @__PURE__ */ k(_e, {
969
+ onClick: U,
970
+ children: [/* @__PURE__ */ M(_e, {
949
971
  className: "size-4",
950
972
  "aria-hidden": "true"
951
973
  }), v.isPending ? r("brainyrich.goals.detail.recalculating", "Recalculating…") : r("brainyrich.goals.detail.recalc", "Recalculate")]
952
974
  })
953
975
  ]
954
976
  })
955
- ] }) : /* @__PURE__ */ k(oe, {
956
- icon: /* @__PURE__ */ k(S, {
977
+ ] }) : /* @__PURE__ */ M(oe, {
978
+ icon: /* @__PURE__ */ M(T, {
957
979
  className: "size-6",
958
980
  "aria-hidden": "true"
959
981
  }),
@@ -961,23 +983,23 @@ function qe({ goalId: e, onClose: n, translate: r }) {
961
983
  })
962
984
  })]
963
985
  })
964
- }), /* @__PURE__ */ k(ne, {
965
- open: !!N,
986
+ }), /* @__PURE__ */ M(ne, {
987
+ open: !!A,
966
988
  onOpenChange: (e) => {
967
- e || P(null);
989
+ e || F(null);
968
990
  },
969
991
  title: r("brainyrich.goals.detail.unlinkTitle", "Unlink funding?"),
970
- description: r("brainyrich.goals.detail.unlinkConfirm", "This removes the “{name}” funding link from this goal.", { name: xe }),
992
+ description: r("brainyrich.goals.detail.unlinkConfirm", "This removes the “{name}” funding link from this goal.", { name: Ce }),
971
993
  confirmLabel: r("brainyrich.goals.detail.unlink", "Unlink funding"),
972
994
  pendingLabel: r("brainyrich.goals.detail.unlinking", "Unlinking…"),
973
995
  destructive: !0,
974
- pending: g.isPending,
996
+ pending: _.isPending,
975
997
  onConfirm: () => {
976
- N && g.mutate(N.id, { onSuccess: () => P(null) });
998
+ A && _.mutate(A.id, { onSuccess: () => F(null) });
977
999
  }
978
1000
  })] });
979
1001
  }
980
1002
  //#endregion
981
- export { Ge as GoalsPage };
1003
+ export { Je as GoalsPage };
982
1004
 
983
1005
  //# sourceMappingURL=GoalsPage.js.map