@burdenoff/microfe-mybodyshield 2026.827.1 → 2026.830.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 (90) hide show
  1. package/dist/mybodyshield/MyBodyShieldRoot.d.ts.map +1 -1
  2. package/dist/mybodyshield/MyBodyShieldRoot.js +54 -56
  3. package/dist/mybodyshield/MyBodyShieldRoot.js.map +1 -1
  4. package/dist/mybodyshield/MyBodyShieldRoutes.d.ts.map +1 -1
  5. package/dist/mybodyshield/MyBodyShieldRoutes.js +121 -62
  6. package/dist/mybodyshield/MyBodyShieldRoutes.js.map +1 -1
  7. package/dist/mybodyshield/components/EvidenceUpload.d.ts.map +1 -1
  8. package/dist/mybodyshield/components/EvidenceUpload.js +46 -45
  9. package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -1
  10. package/dist/mybodyshield/components/FileLink.d.ts.map +1 -1
  11. package/dist/mybodyshield/components/FileLink.js +27 -18
  12. package/dist/mybodyshield/components/FileLink.js.map +1 -1
  13. package/dist/mybodyshield/components/MybDiscussion.d.ts +1 -1
  14. package/dist/mybodyshield/components/MybDiscussion.d.ts.map +1 -1
  15. package/dist/mybodyshield/components/MybDiscussion.js +59 -58
  16. package/dist/mybodyshield/components/MybDiscussion.js.map +1 -1
  17. package/dist/mybodyshield/components/MybTags.d.ts +1 -1
  18. package/dist/mybodyshield/components/MybTags.d.ts.map +1 -1
  19. package/dist/mybodyshield/components/MybTags.js +83 -74
  20. package/dist/mybodyshield/components/MybTags.js.map +1 -1
  21. package/dist/mybodyshield/components/PageDisabled.d.ts.map +1 -1
  22. package/dist/mybodyshield/components/PageDisabled.js +16 -11
  23. package/dist/mybodyshield/components/PageDisabled.js.map +1 -1
  24. package/dist/mybodyshield/components/Pagination.d.ts.map +1 -1
  25. package/dist/mybodyshield/components/Pagination.js +36 -27
  26. package/dist/mybodyshield/components/Pagination.js.map +1 -1
  27. package/dist/mybodyshield/components/StateViews.d.ts.map +1 -1
  28. package/dist/mybodyshield/components/StateViews.js +42 -34
  29. package/dist/mybodyshield/components/StateViews.js.map +1 -1
  30. package/dist/mybodyshield/components/UserSearchSelect.d.ts.map +1 -1
  31. package/dist/mybodyshield/components/UserSearchSelect.js +66 -68
  32. package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -1
  33. package/dist/mybodyshield/hooks/index.d.ts +1 -0
  34. package/dist/mybodyshield/hooks/index.d.ts.map +1 -1
  35. package/dist/mybodyshield/hooks/index.js +1 -0
  36. package/dist/mybodyshield/hooks/useTr.d.ts +5 -0
  37. package/dist/mybodyshield/hooks/useTr.d.ts.map +1 -0
  38. package/dist/mybodyshield/hooks/useTr.js +12 -0
  39. package/dist/mybodyshield/hooks/useTr.js.map +1 -0
  40. package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -1
  41. package/dist/mybodyshield/pages/DashboardPage.js +157 -136
  42. package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
  43. package/dist/mybodyshield/pages/SettingsPage.d.ts.map +1 -1
  44. package/dist/mybodyshield/pages/SettingsPage.js +50 -59
  45. package/dist/mybodyshield/pages/SettingsPage.js.map +1 -1
  46. package/dist/mybodyshield/pages/_shared/visuals.d.ts +2 -1
  47. package/dist/mybodyshield/pages/_shared/visuals.d.ts.map +1 -1
  48. package/dist/mybodyshield/pages/_shared/visuals.js +91 -81
  49. package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
  50. package/dist/mybodyshield/pages/ai/AiControlsPage.d.ts.map +1 -1
  51. package/dist/mybodyshield/pages/ai/AiControlsPage.js +255 -266
  52. package/dist/mybodyshield/pages/ai/AiControlsPage.js.map +1 -1
  53. package/dist/mybodyshield/pages/coaching/CoachingPage.d.ts.map +1 -1
  54. package/dist/mybodyshield/pages/coaching/CoachingPage.js +321 -301
  55. package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
  56. package/dist/mybodyshield/pages/goals/GoalsPage.d.ts.map +1 -1
  57. package/dist/mybodyshield/pages/goals/GoalsPage.js +247 -251
  58. package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
  59. package/dist/mybodyshield/pages/insights/InsightsCharts.d.ts.map +1 -1
  60. package/dist/mybodyshield/pages/insights/InsightsCharts.js +216 -213
  61. package/dist/mybodyshield/pages/insights/InsightsCharts.js.map +1 -1
  62. package/dist/mybodyshield/pages/insights/InsightsPage.d.ts.map +1 -1
  63. package/dist/mybodyshield/pages/insights/InsightsPage.js +290 -284
  64. package/dist/mybodyshield/pages/insights/InsightsPage.js.map +1 -1
  65. package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -1
  66. package/dist/mybodyshield/pages/nutrition/NutritionPage.js +575 -529
  67. package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
  68. package/dist/mybodyshield/pages/programs/ProgramDetailPage.d.ts.map +1 -1
  69. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +333 -275
  70. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
  71. package/dist/mybodyshield/pages/programs/ProgramsPage.d.ts.map +1 -1
  72. package/dist/mybodyshield/pages/programs/ProgramsPage.js +258 -253
  73. package/dist/mybodyshield/pages/programs/ProgramsPage.js.map +1 -1
  74. package/dist/mybodyshield/pages/progress/ProgressPage.d.ts.map +1 -1
  75. package/dist/mybodyshield/pages/progress/ProgressPage.js +271 -254
  76. package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
  77. package/dist/mybodyshield/pages/recovery/RecoveryPage.d.ts.map +1 -1
  78. package/dist/mybodyshield/pages/recovery/RecoveryPage.js +206 -200
  79. package/dist/mybodyshield/pages/recovery/RecoveryPage.js.map +1 -1
  80. package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
  81. package/dist/mybodyshield/pages/train/SessionDetailPage.js +327 -294
  82. package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
  83. package/dist/mybodyshield/pages/train/SessionsPage.d.ts.map +1 -1
  84. package/dist/mybodyshield/pages/train/SessionsPage.js +180 -163
  85. package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
  86. package/dist/mybodyshield/utils/i18n.d.ts +1 -2
  87. package/dist/mybodyshield/utils/i18n.d.ts.map +1 -1
  88. package/dist/mybodyshield/utils/i18n.js +15 -0
  89. package/dist/mybodyshield/utils/i18n.js.map +1 -0
  90. package/package.json +1 -1
@@ -1,397 +1,386 @@
1
1
  import { PageLayout as e } from "../../components/PageLayout.js";
2
2
  import { MetricsCard as t } from "../../components/MetricsCard.js";
3
3
  import { formatDateTime as n, formatEnumLabel as r, formatRelativeTime as i } from "../../utils/formatters.js";
4
- import { ErrorView as a, LoadingView as o, Section as s } from "../../components/StateViews.js";
5
- import { DataTable as c } from "../../components/DataTable.js";
6
- import { useMybAiOperationLogs as l, useMybAiProcessingConsent as u, useMybAiSettings as d, useMybSetAiProcessingConsent as f, useMybUpdateAiSettings as p } from "../../hooks/useMyBodyShieldApi.js";
4
+ import { useMybAiOperationLogs as a, useMybAiProcessingConsent as o, useMybAiSettings as s, useMybSetAiProcessingConsent as c, useMybUpdateAiSettings as l } from "../../hooks/useMyBodyShieldApi.js";
5
+ import { useTr as u } from "../../hooks/useTr.js";
7
6
  import "../../hooks/index.js";
7
+ import { ErrorView as d, LoadingView as f, Section as p } from "../../components/StateViews.js";
8
+ import { DataTable as m } from "../../components/DataTable.js";
8
9
  import "../../components/index.js";
9
- import { IconChip as m } from "../_shared/visuals.js";
10
- import { useMemo as h, useState as g } from "react";
11
- import { Activity as _, Bot as v, KeyRound as y, Save as b, ShieldCheck as x, ShieldOff as S, Sparkles as C } from "lucide-react";
12
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
13
- import { Button as E, GlassCard as D, Input as O, Label as k, Select as A, SelectContent as j, SelectItem as M, SelectTrigger as N, SelectValue as P, Spinner as F, Switch as I } from "@burdenoff/fe-libs/ui";
10
+ import { IconChip as h } from "../_shared/visuals.js";
11
+ import { useMemo as g, useState as _ } from "react";
12
+ import { Activity as v, Bot as y, KeyRound as b, Save as x, ShieldCheck as S, ShieldOff as C, Sparkles as w } from "lucide-react";
13
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
14
+ import { Button as D, GlassCard as O, Input as k, Label as A, Select as j, SelectContent as M, SelectItem as N, SelectTrigger as P, SelectValue as F, Spinner as I, Switch as L } from "@burdenoff/fe-libs/ui";
14
15
  //#region src/mybodyshield/pages/ai/AiControlsPage.tsx
15
- var L = [
16
+ var R = [
16
17
  "GEMINI",
17
18
  "OPENAI",
18
19
  "ANTHROPIC"
19
- ], R = {
20
+ ], z = {
20
21
  GEMINI: "Google Gemini",
21
22
  OPENAI: "OpenAI",
22
23
  ANTHROPIC: "Anthropic"
23
- }, z = {
24
+ }, B = {
24
25
  GEMINI: "gemini-2.5-flash",
25
26
  OPENAI: "gpt-4o-mini",
26
27
  ANTHROPIC: "claude-3-5-haiku-latest"
27
- }, B = (e) => ({
28
+ }, V = (e) => ({
28
29
  provider: e.provider,
29
30
  modelName: e.modelName,
30
31
  dailyAllowance: String(e.dailyAllowance),
31
32
  providerKey: "",
32
33
  clearKey: !1
33
34
  });
34
- function V() {
35
- let e = u(), t = f();
36
- if (e.isLoading) return /* @__PURE__ */ w(o, { label: "Loading AI-processing consent…" });
37
- if (e.isError) return /* @__PURE__ */ w(a, {
38
- message: "We couldn't load your AI-processing consent.",
39
- onRetry: () => e.refetch()
35
+ function H() {
36
+ let e = u(), t = o(), n = c();
37
+ if (t.isLoading) return /* @__PURE__ */ T(f, { label: e("mybodyshield.pages.aiControls.loadingConsent", "Loading AI-processing consent…") });
38
+ if (t.isError) return /* @__PURE__ */ T(d, {
39
+ message: e("mybodyshield.pages.aiControls.consentError", "We couldn't load your AI-processing consent."),
40
+ onRetry: () => t.refetch()
40
41
  });
41
- let n = e.data?.enabled ?? !1;
42
- return /* @__PURE__ */ w(D, {
42
+ let r = t.data?.enabled ?? !1;
43
+ return /* @__PURE__ */ T(O, {
43
44
  treatment: "plain",
44
45
  className: "p-5",
45
- children: /* @__PURE__ */ T("div", {
46
+ children: /* @__PURE__ */ E("div", {
46
47
  className: "flex flex-wrap items-start justify-between gap-4",
47
- children: [/* @__PURE__ */ T("div", {
48
+ children: [/* @__PURE__ */ E("div", {
48
49
  className: "flex min-w-0 items-start gap-3",
49
- children: [/* @__PURE__ */ w(m, { icon: w(n ? x : S, { className: "h-5 w-5" }) }), /* @__PURE__ */ T("div", {
50
+ children: [/* @__PURE__ */ T(h, { icon: T(r ? S : C, { className: "h-5 w-5" }) }), /* @__PURE__ */ E("div", {
50
51
  className: "min-w-0",
51
52
  children: [
52
- /* @__PURE__ */ w("p", {
53
+ /* @__PURE__ */ T("p", {
53
54
  className: "text-sm font-medium text-text-primary",
54
- children: n ? "AI may read your health data" : "AI processing is withdrawn — summaries will not run"
55
+ children: r ? e("mybodyshield.pages.aiControls.aiMayReadData", "AI may read your health data") : e("mybodyshield.pages.aiControls.aiWithdrawn", "AI processing is withdrawn — summaries will not run")
55
56
  }),
56
- /* @__PURE__ */ w("p", {
57
+ /* @__PURE__ */ T("p", {
57
58
  className: "mt-0.5 text-sm text-text-secondary",
58
- children: n ? "The provider and model below are used to turn your logged training, nutrition, recovery and body-metric data into plain-language summaries." : "The provider and model below are saved, but no AI summary is generated while consent is withdrawn. Rule-based guidance and every manual logging path keep working."
59
+ children: r ? e("mybodyshield.pages.aiControls.aiEnabledDescription", "The provider and model below are used to turn your logged training, nutrition, recovery and body-metric data into plain-language summaries.") : e("mybodyshield.pages.aiControls.aiWithdrawnDescription", "The provider and model below are saved, but no AI summary is generated while consent is withdrawn. Rule-based guidance and every manual logging path keep working.")
59
60
  }),
60
- e.data?.withdrawnAt && !n && /* @__PURE__ */ T("p", {
61
+ t.data?.withdrawnAt && !r && /* @__PURE__ */ T("p", {
61
62
  className: "mt-1 text-xs text-text-tertiary",
62
- children: [
63
- "Withdrawn ",
64
- i(e.data.withdrawnAt),
65
- "."
66
- ]
63
+ children: e("mybodyshield.pages.aiControls.withdrawnAgo", "Withdrawn {{time}}.", { time: i(t.data.withdrawnAt) })
67
64
  }),
68
- e.data?.acceptedAt && n && /* @__PURE__ */ T("p", {
65
+ t.data?.acceptedAt && r && /* @__PURE__ */ T("p", {
69
66
  className: "mt-1 text-xs text-text-tertiary",
70
- children: [
71
- "Consent given ",
72
- i(e.data.acceptedAt),
73
- "."
74
- ]
67
+ children: e("mybodyshield.pages.aiControls.consentGivenAgo", "Consent given {{time}}.", { time: i(t.data.acceptedAt) })
75
68
  })
76
69
  ]
77
70
  })]
78
- }), /* @__PURE__ */ w(I, {
79
- checked: n,
80
- onCheckedChange: (e) => t.mutate(e),
81
- disabled: t.isPending,
82
- "aria-label": "Allow AI to read my health data"
71
+ }), /* @__PURE__ */ T(L, {
72
+ checked: r,
73
+ onCheckedChange: (e) => n.mutate(e),
74
+ disabled: n.isPending,
75
+ "aria-label": e("mybodyshield.pages.aiControls.allowAiData", "Allow AI to read my health data")
83
76
  })]
84
77
  })
85
78
  });
86
79
  }
87
- function H({ settings: l, logsQuery: u }) {
88
- let d = p(), [f, m] = g(() => B(l)), [x, S] = g(null), [I, H] = g(!1), U = h(() => {
89
- let { dailyAllowance: e, dailyAllowanceUsed: t } = l;
80
+ function U({ settings: a, logsQuery: o }) {
81
+ let s = u(), c = l(), [h, S] = _(() => V(a)), [C, L] = _(null), [U, W] = _(!1), G = g(() => {
82
+ let { dailyAllowance: e, dailyAllowanceUsed: t } = a;
90
83
  return e <= 0 ? 0 : Math.min(100, Math.round(t / e * 100));
91
- }, [l]), W = l.dailyAllowanceUsed >= l.dailyAllowance, G = (e) => {
92
- m((t) => ({
84
+ }, [a]), K = a.dailyAllowanceUsed >= a.dailyAllowance, q = (e) => {
85
+ S((t) => ({
93
86
  ...t,
94
87
  provider: e,
95
- modelName: t.modelName === z[t.provider] ? z[e] : t.modelName
88
+ modelName: t.modelName === B[t.provider] ? B[e] : t.modelName
96
89
  }));
97
- };
98
- return /* @__PURE__ */ T(e, {
99
- title: "AI controls",
100
- description: "Choose your AI provider, model and daily allowance.",
101
- actions: /* @__PURE__ */ T(E, {
90
+ }, J = async () => {
91
+ L(null), W(!1);
92
+ let e = Number(h.dailyAllowance);
93
+ if (!Number.isInteger(e) || e < 0 || e > 1e4) {
94
+ L(s("mybodyshield.pages.aiControls.allowanceRange", "Daily allowance must be an integer between 0 and 10,000."));
95
+ return;
96
+ }
97
+ if (!h.modelName.trim()) {
98
+ L(s("mybodyshield.pages.aiControls.modelRequired", "Model name is required."));
99
+ return;
100
+ }
101
+ let t = {
102
+ provider: h.provider,
103
+ modelName: h.modelName.trim(),
104
+ dailyAllowance: e
105
+ };
106
+ h.clearKey ? t.providerKey = "" : h.providerKey.trim() && (t.providerKey = h.providerKey.trim());
107
+ try {
108
+ await c.mutateAsync(t), W(!0), S((e) => ({
109
+ ...e,
110
+ providerKey: "",
111
+ clearKey: !1
112
+ }));
113
+ } catch (e) {
114
+ L(e instanceof Error ? e.message : s("mybodyshield.pages.aiControls.failedToSave", "Failed to save AI settings."));
115
+ }
116
+ }, Y = [
117
+ {
118
+ key: "createdAt",
119
+ header: s("mybodyshield.pages.aiControls.time", "Time"),
120
+ sortValue: (e) => new Date(e.createdAt).getTime(),
121
+ render: (e) => /* @__PURE__ */ E("div", {
122
+ className: "text-text-primary",
123
+ children: [/* @__PURE__ */ T("span", {
124
+ className: "block text-sm",
125
+ children: n(e.createdAt)
126
+ }), /* @__PURE__ */ T("span", {
127
+ className: "text-xs text-text-tertiary",
128
+ children: i(e.createdAt)
129
+ })]
130
+ })
131
+ },
132
+ {
133
+ key: "operationType",
134
+ header: s("mybodyshield.pages.aiControls.operation", "Operation"),
135
+ render: (e) => /* @__PURE__ */ T("span", {
136
+ className: "text-text-secondary",
137
+ children: r(e.operationType)
138
+ })
139
+ },
140
+ {
141
+ key: "provider",
142
+ header: s("mybodyshield.pages.aiControls.providerModel", "Provider / Model"),
143
+ render: (e) => /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
144
+ className: "block text-sm text-text-primary",
145
+ children: z[e.provider]
146
+ }), /* @__PURE__ */ T("span", {
147
+ className: "text-xs text-text-tertiary",
148
+ children: e.modelName
149
+ })] })
150
+ },
151
+ {
152
+ key: "tokens",
153
+ header: s("mybodyshield.pages.aiControls.tokens", "Tokens"),
154
+ align: "right",
155
+ render: (e) => /* @__PURE__ */ E("span", {
156
+ className: "tabular-nums text-text-secondary",
157
+ children: [
158
+ e.inputTokens ?? "—",
159
+ " / ",
160
+ e.outputTokens ?? "—"
161
+ ]
162
+ })
163
+ },
164
+ {
165
+ key: "status",
166
+ header: s("mybodyshield.pages.aiControls.status", "Status"),
167
+ render: (e) => /* @__PURE__ */ T("span", {
168
+ className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${e.status === "SUCCESS" ? "bg-status-success-bg text-status-success-text" : "bg-status-error-bg text-status-error-text"}`,
169
+ children: r(e.status)
170
+ })
171
+ },
172
+ {
173
+ key: "error",
174
+ header: s("mybodyshield.pages.aiControls.errorColumn", "Error"),
175
+ hideOnMobile: !0,
176
+ render: (e) => e.errorMessage ? /* @__PURE__ */ T("span", {
177
+ className: "text-xs text-status-error-text",
178
+ children: e.errorMessage
179
+ }) : /* @__PURE__ */ T("span", {
180
+ className: "text-text-tertiary",
181
+ children: "—"
182
+ })
183
+ }
184
+ ];
185
+ return /* @__PURE__ */ E(e, {
186
+ title: s("mybodyshield.pages.aiControls.title", "AI controls"),
187
+ description: s("mybodyshield.pages.aiControls.description", "Choose your AI provider, model and daily allowance."),
188
+ actions: /* @__PURE__ */ E(D, {
102
189
  className: "gap-2",
103
- onClick: async () => {
104
- S(null), H(!1);
105
- let e = Number(f.dailyAllowance);
106
- if (!Number.isInteger(e) || e < 0 || e > 1e4) {
107
- S("Daily allowance must be an integer between 0 and 10,000.");
108
- return;
109
- }
110
- if (!f.modelName.trim()) {
111
- S("Model name is required.");
112
- return;
113
- }
114
- let t = {
115
- provider: f.provider,
116
- modelName: f.modelName.trim(),
117
- dailyAllowance: e
118
- };
119
- f.clearKey ? t.providerKey = "" : f.providerKey.trim() && (t.providerKey = f.providerKey.trim());
120
- try {
121
- await d.mutateAsync(t), H(!0), m((e) => ({
122
- ...e,
123
- providerKey: "",
124
- clearKey: !1
125
- }));
126
- } catch (e) {
127
- S(e instanceof Error ? e.message : "Failed to save AI settings.");
128
- }
129
- },
130
- disabled: d.isPending,
131
- children: [d.isPending ? /* @__PURE__ */ w(F, { size: "sm" }) : /* @__PURE__ */ w(b, { className: "h-4 w-4" }), "Save settings"]
190
+ onClick: J,
191
+ disabled: c.isPending,
192
+ children: [c.isPending ? /* @__PURE__ */ T(I, { size: "sm" }) : /* @__PURE__ */ T(x, { className: "h-4 w-4" }), s("mybodyshield.pages.aiControls.saveSettings", "Save settings")]
132
193
  }),
133
194
  children: [
134
- /* @__PURE__ */ w(s, {
135
- title: "AI-processing consent",
136
- description: "AI summaries only run while you allow AI to read your health data.",
137
- children: /* @__PURE__ */ w(V, {})
195
+ /* @__PURE__ */ T(p, {
196
+ title: s("mybodyshield.pages.aiControls.consentTitle", "AI-processing consent"),
197
+ description: s("mybodyshield.pages.aiControls.consentDescription", "AI summaries only run while you allow AI to read your health data."),
198
+ children: /* @__PURE__ */ T(H, {})
138
199
  }),
139
- /* @__PURE__ */ T("div", {
200
+ /* @__PURE__ */ E("div", {
140
201
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
141
202
  children: [
142
- /* @__PURE__ */ w(t, {
143
- icon: /* @__PURE__ */ w(C, { className: "h-5 w-5" }),
144
- value: l.provider,
145
- label: "Current provider"
203
+ /* @__PURE__ */ T(t, {
204
+ icon: /* @__PURE__ */ T(w, { className: "h-5 w-5" }),
205
+ value: a.provider,
206
+ label: s("mybodyshield.pages.aiControls.currentProvider", "Current provider")
146
207
  }),
147
- /* @__PURE__ */ w(t, {
148
- icon: /* @__PURE__ */ w(v, { className: "h-5 w-5" }),
149
- value: l.modelName,
150
- label: "Current model"
208
+ /* @__PURE__ */ T(t, {
209
+ icon: /* @__PURE__ */ T(y, { className: "h-5 w-5" }),
210
+ value: a.modelName,
211
+ label: s("mybodyshield.pages.aiControls.currentModel", "Current model")
151
212
  }),
152
- /* @__PURE__ */ w(t, {
153
- icon: /* @__PURE__ */ w(_, { className: "h-5 w-5" }),
154
- value: `${l.dailyAllowanceUsed} / ${l.dailyAllowance}`,
155
- label: "Daily allowance used",
156
- accent: W ? "error" : U >= 80 ? "warning" : "success",
213
+ /* @__PURE__ */ T(t, {
214
+ icon: /* @__PURE__ */ T(v, { className: "h-5 w-5" }),
215
+ value: `${a.dailyAllowanceUsed} / ${a.dailyAllowance}`,
216
+ label: s("mybodyshield.pages.aiControls.dailyAllowanceUsed", "Daily allowance used"),
217
+ accent: K ? "error" : G >= 80 ? "warning" : "success",
157
218
  footer: /* @__PURE__ */ T("p", {
158
219
  className: "text-xs text-text-tertiary",
159
- children: ["Resets ", i(l.allowanceResetAt)]
220
+ children: s("mybodyshield.pages.aiControls.resets", "Resets {{time}}", { time: i(a.allowanceResetAt) })
160
221
  })
161
222
  })
162
223
  ]
163
224
  }),
164
- /* @__PURE__ */ w(s, {
165
- title: "Configuration",
166
- description: "Changes apply to your account only.",
167
- children: /* @__PURE__ */ T(D, {
225
+ /* @__PURE__ */ T(p, {
226
+ title: s("mybodyshield.pages.aiControls.configuration", "Configuration"),
227
+ description: s("mybodyshield.pages.aiControls.configurationDescription", "Changes apply to your account only."),
228
+ children: /* @__PURE__ */ E(O, {
168
229
  treatment: "plain",
169
230
  className: "p-6",
170
231
  children: [
171
- /* @__PURE__ */ T("div", {
232
+ /* @__PURE__ */ E("div", {
172
233
  className: "grid gap-6 md:grid-cols-2",
173
234
  children: [
174
- /* @__PURE__ */ T("div", {
235
+ /* @__PURE__ */ E("div", {
175
236
  className: "space-y-1.5",
176
237
  children: [
177
- /* @__PURE__ */ w(k, {
238
+ /* @__PURE__ */ T(A, {
178
239
  htmlFor: "myb-ai-provider",
179
- children: "AI provider"
240
+ children: s("mybodyshield.pages.aiControls.aiProvider", "AI provider")
180
241
  }),
181
- /* @__PURE__ */ T(A, {
182
- value: f.provider,
183
- onValueChange: (e) => G(e),
184
- children: [/* @__PURE__ */ w(N, {
242
+ /* @__PURE__ */ E(j, {
243
+ value: h.provider,
244
+ onValueChange: (e) => q(e),
245
+ children: [/* @__PURE__ */ T(P, {
185
246
  id: "myb-ai-provider",
186
- children: /* @__PURE__ */ w(P, {})
187
- }), /* @__PURE__ */ w(j, { children: L.map((e) => /* @__PURE__ */ w(M, {
247
+ children: /* @__PURE__ */ T(F, {})
248
+ }), /* @__PURE__ */ T(M, { children: R.map((e) => /* @__PURE__ */ T(N, {
188
249
  value: e,
189
- children: R[e]
250
+ children: z[e]
190
251
  }, e)) })]
191
252
  }),
192
- /* @__PURE__ */ w("p", {
253
+ /* @__PURE__ */ T("p", {
193
254
  className: "text-xs text-text-tertiary",
194
- children: "The provider used for AI-generated guidance summaries."
255
+ children: s("mybodyshield.pages.aiControls.providerDescription", "The provider used for AI-generated guidance summaries.")
195
256
  })
196
257
  ]
197
258
  }),
198
- /* @__PURE__ */ T("div", {
259
+ /* @__PURE__ */ E("div", {
199
260
  className: "space-y-1.5",
200
261
  children: [
201
- /* @__PURE__ */ w(k, {
262
+ /* @__PURE__ */ T(A, {
202
263
  htmlFor: "myb-ai-model",
203
- children: "Model name"
264
+ children: s("mybodyshield.pages.aiControls.modelName", "Model name")
204
265
  }),
205
- /* @__PURE__ */ w(O, {
266
+ /* @__PURE__ */ T(k, {
206
267
  id: "myb-ai-model",
207
- value: f.modelName,
208
- onChange: (e) => m((t) => ({
268
+ value: h.modelName,
269
+ onChange: (e) => S((t) => ({
209
270
  ...t,
210
271
  modelName: e.target.value
211
272
  })),
212
- placeholder: z[f.provider]
273
+ placeholder: s("mybodyshield.pages.aiControls.modelPlaceholder", "e.g. {{model}}", { model: B[h.provider] })
213
274
  }),
214
275
  /* @__PURE__ */ T("p", {
215
276
  className: "text-xs text-text-tertiary",
216
- children: [
217
- "e.g. ",
218
- z[f.provider],
219
- ". Must be valid for the chosen provider."
220
- ]
277
+ children: s("mybodyshield.pages.aiControls.modelHint", "Must be valid for the chosen provider.")
221
278
  })
222
279
  ]
223
280
  }),
224
- /* @__PURE__ */ T("div", {
281
+ /* @__PURE__ */ E("div", {
225
282
  className: "space-y-1.5",
226
283
  children: [
227
- /* @__PURE__ */ w(k, {
284
+ /* @__PURE__ */ T(A, {
228
285
  htmlFor: "myb-ai-allowance",
229
- children: "Daily allowance"
286
+ children: s("mybodyshield.pages.aiControls.dailyAllowance", "Daily allowance")
230
287
  }),
231
- /* @__PURE__ */ w(O, {
288
+ /* @__PURE__ */ T(k, {
232
289
  id: "myb-ai-allowance",
233
290
  type: "number",
234
291
  min: 0,
235
292
  max: 1e4,
236
293
  step: 1,
237
- value: f.dailyAllowance,
238
- onChange: (e) => m((t) => ({
294
+ value: h.dailyAllowance,
295
+ onChange: (e) => S((t) => ({
239
296
  ...t,
240
297
  dailyAllowance: e.target.value
241
298
  }))
242
299
  }),
243
- /* @__PURE__ */ w("p", {
300
+ /* @__PURE__ */ T("p", {
244
301
  className: "text-xs text-text-tertiary",
245
- children: "Maximum AI operations counted against your account per UTC day."
302
+ children: s("mybodyshield.pages.aiControls.dailyAllowanceHint", "Maximum AI operations counted against your account per UTC day.")
246
303
  })
247
304
  ]
248
305
  }),
249
- /* @__PURE__ */ T("div", {
306
+ /* @__PURE__ */ E("div", {
250
307
  className: "space-y-1.5",
251
308
  children: [
252
- /* @__PURE__ */ w(k, {
309
+ /* @__PURE__ */ T(A, {
253
310
  htmlFor: "myb-ai-key",
254
- children: /* @__PURE__ */ T("span", {
311
+ children: /* @__PURE__ */ E("span", {
255
312
  className: "inline-flex items-center gap-1.5",
256
- children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), "Provider API key"]
313
+ children: [/* @__PURE__ */ T(b, { className: "h-3.5 w-3.5" }), s("mybodyshield.pages.aiControls.providerApiKey", "Provider API key")]
257
314
  })
258
315
  }),
259
- /* @__PURE__ */ w(O, {
316
+ /* @__PURE__ */ T(k, {
260
317
  id: "myb-ai-key",
261
318
  type: "password",
262
- value: f.providerKey,
263
- onChange: (e) => m((t) => ({
319
+ value: h.providerKey,
320
+ onChange: (e) => S((t) => ({
264
321
  ...t,
265
322
  providerKey: e.target.value,
266
323
  clearKey: !1
267
324
  })),
268
- placeholder: l.hasProviderKey ? "•••••••• (saved)" : "Optional",
269
- disabled: f.clearKey
325
+ placeholder: a.hasProviderKey ? s("mybodyshield.pages.aiControls.providerKeySaved", "•••••••• (saved)") : s("mybodyshield.pages.aiControls.providerKeyPlaceholder", "Optional"),
326
+ disabled: h.clearKey
270
327
  }),
271
- /* @__PURE__ */ T("div", {
328
+ /* @__PURE__ */ E("div", {
272
329
  className: "flex items-center gap-2",
273
- children: [/* @__PURE__ */ w("input", {
330
+ children: [/* @__PURE__ */ T("input", {
274
331
  id: "myb-ai-clear-key",
275
332
  type: "checkbox",
276
- checked: f.clearKey,
277
- onChange: (e) => m((t) => ({
333
+ checked: h.clearKey,
334
+ onChange: (e) => S((t) => ({
278
335
  ...t,
279
336
  clearKey: e.target.checked,
280
337
  providerKey: ""
281
338
  })),
282
339
  className: "h-4 w-4 rounded border-border-seam text-accent focus:ring-accent"
283
- }), /* @__PURE__ */ w(k, {
340
+ }), /* @__PURE__ */ T(A, {
284
341
  htmlFor: "myb-ai-clear-key",
285
342
  className: "text-xs font-normal text-text-secondary",
286
- children: "Clear saved key and fall back to the workspace default"
343
+ children: s("mybodyshield.pages.aiControls.clearKey", "Clear saved key and fall back to the workspace default")
287
344
  })]
288
345
  })
289
346
  ]
290
347
  })
291
348
  ]
292
349
  }),
293
- I && /* @__PURE__ */ w("p", {
350
+ U && /* @__PURE__ */ T("p", {
294
351
  className: "mt-4 text-sm text-status-success-text",
295
- children: "AI settings saved."
352
+ children: s("mybodyshield.pages.aiControls.settingsSaved", "AI settings saved.")
296
353
  }),
297
- x && /* @__PURE__ */ w("p", {
354
+ C && /* @__PURE__ */ T("p", {
298
355
  className: "mt-4 text-sm text-status-error-text",
299
- children: x
356
+ children: C
300
357
  })
301
358
  ]
302
359
  })
303
360
  }),
304
- /* @__PURE__ */ w(s, {
305
- title: "Operation history",
306
- description: "Redacted audit log of AI operations for your account.",
307
- children: u.isLoading ? /* @__PURE__ */ w(o, { label: "Loading operation history…" }) : u.isError ? /* @__PURE__ */ w(a, {
308
- message: "We couldn't load the operation log.",
309
- onRetry: () => u.refetch()
310
- }) : u.data?.items.length === 0 ? /* @__PURE__ */ T(D, {
361
+ /* @__PURE__ */ T(p, {
362
+ title: s("mybodyshield.pages.aiControls.operationHistory", "Operation history"),
363
+ description: s("mybodyshield.pages.aiControls.operationHistoryDescription", "Redacted audit log of AI operations for your account."),
364
+ children: o.isLoading ? /* @__PURE__ */ T(f, { label: s("mybodyshield.pages.aiControls.loadingHistory", "Loading operation history…") }) : o.isError ? /* @__PURE__ */ T(d, {
365
+ message: s("mybodyshield.pages.aiControls.historyError", "We couldn't load the operation log."),
366
+ onRetry: () => o.refetch()
367
+ }) : o.data?.items.length === 0 ? /* @__PURE__ */ E(O, {
311
368
  treatment: "plain",
312
369
  className: "p-8 text-center",
313
370
  children: [
314
- /* @__PURE__ */ w(C, { className: "mx-auto h-8 w-8 text-text-tertiary" }),
315
- /* @__PURE__ */ w("p", {
371
+ /* @__PURE__ */ T(w, { className: "mx-auto h-8 w-8 text-text-tertiary" }),
372
+ /* @__PURE__ */ T("p", {
316
373
  className: "mt-3 text-sm font-medium text-text-primary",
317
- children: "No AI operations yet"
374
+ children: s("mybodyshield.pages.aiControls.noOperations", "No AI operations yet")
318
375
  }),
319
- /* @__PURE__ */ w("p", {
376
+ /* @__PURE__ */ T("p", {
320
377
  className: "mt-1 text-xs text-text-tertiary",
321
- children: "Operations appear here once AI-generated guidance runs."
378
+ children: s("mybodyshield.pages.aiControls.noOperationsDescription", "Operations appear here once AI-generated guidance runs.")
322
379
  })
323
380
  ]
324
- }) : /* @__PURE__ */ w(c, {
325
- columns: [
326
- {
327
- key: "createdAt",
328
- header: "Time",
329
- sortValue: (e) => new Date(e.createdAt).getTime(),
330
- render: (e) => /* @__PURE__ */ T("div", {
331
- className: "text-text-primary",
332
- children: [/* @__PURE__ */ w("span", {
333
- className: "block text-sm",
334
- children: n(e.createdAt)
335
- }), /* @__PURE__ */ w("span", {
336
- className: "text-xs text-text-tertiary",
337
- children: i(e.createdAt)
338
- })]
339
- })
340
- },
341
- {
342
- key: "operationType",
343
- header: "Operation",
344
- render: (e) => /* @__PURE__ */ w("span", {
345
- className: "text-text-secondary",
346
- children: r(e.operationType)
347
- })
348
- },
349
- {
350
- key: "provider",
351
- header: "Provider / Model",
352
- render: (e) => /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("span", {
353
- className: "block text-sm text-text-primary",
354
- children: R[e.provider]
355
- }), /* @__PURE__ */ w("span", {
356
- className: "text-xs text-text-tertiary",
357
- children: e.modelName
358
- })] })
359
- },
360
- {
361
- key: "tokens",
362
- header: "Tokens",
363
- align: "right",
364
- render: (e) => /* @__PURE__ */ T("span", {
365
- className: "tabular-nums text-text-secondary",
366
- children: [
367
- e.inputTokens ?? "—",
368
- " / ",
369
- e.outputTokens ?? "—"
370
- ]
371
- })
372
- },
373
- {
374
- key: "status",
375
- header: "Status",
376
- render: (e) => /* @__PURE__ */ w("span", {
377
- className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${e.status === "SUCCESS" ? "bg-status-success-bg text-status-success-text" : "bg-status-error-bg text-status-error-text"}`,
378
- children: r(e.status)
379
- })
380
- },
381
- {
382
- key: "error",
383
- header: "Error",
384
- hideOnMobile: !0,
385
- render: (e) => e.errorMessage ? /* @__PURE__ */ w("span", {
386
- className: "text-xs text-status-error-text",
387
- children: e.errorMessage
388
- }) : /* @__PURE__ */ w("span", {
389
- className: "text-text-tertiary",
390
- children: "—"
391
- })
392
- }
393
- ],
394
- rows: u.data?.items ?? [],
381
+ }) : /* @__PURE__ */ T(m, {
382
+ columns: Y,
383
+ rows: o.data?.items ?? [],
395
384
  rowKey: (e) => e.id,
396
385
  defaultSort: {
397
386
  key: "createdAt",
@@ -402,36 +391,36 @@ function H({ settings: l, logsQuery: u }) {
402
391
  ]
403
392
  });
404
393
  }
405
- function U() {
406
- let t = d(), n = l();
407
- if (t.isLoading) return /* @__PURE__ */ w(e, {
408
- title: "AI controls",
409
- children: /* @__PURE__ */ w(o, { label: "Loading AI settings…" })
394
+ function W() {
395
+ let t = u(), n = s(), r = a();
396
+ if (n.isLoading) return /* @__PURE__ */ T(e, {
397
+ title: t("mybodyshield.pages.aiControls.title", "AI controls"),
398
+ children: /* @__PURE__ */ T(f, { label: t("mybodyshield.pages.aiControls.loadingSettings", "Loading AI settings…") })
410
399
  });
411
- if (t.isError) return /* @__PURE__ */ w(e, {
412
- title: "AI controls",
413
- children: /* @__PURE__ */ w(a, {
414
- title: "Could not load AI settings",
415
- message: "We couldn't fetch your AI configuration. Try again in a moment.",
416
- onRetry: () => t.refetch()
400
+ if (n.isError) return /* @__PURE__ */ T(e, {
401
+ title: t("mybodyshield.pages.aiControls.title", "AI controls"),
402
+ children: /* @__PURE__ */ T(d, {
403
+ title: t("mybodyshield.pages.aiControls.errorTitle", "Could not load AI settings"),
404
+ message: t("mybodyshield.pages.aiControls.error", "We couldn't fetch your AI configuration. Try again in a moment."),
405
+ onRetry: () => n.refetch()
417
406
  })
418
407
  });
419
- let r = t.data;
420
- if (!r) return /* @__PURE__ */ w(e, {
421
- title: "AI controls",
422
- children: /* @__PURE__ */ w(a, {
423
- title: "Could not load AI settings",
424
- message: "We couldn't fetch your AI configuration. Try again in a moment.",
425
- onRetry: () => t.refetch()
408
+ let i = n.data;
409
+ if (!i) return /* @__PURE__ */ T(e, {
410
+ title: t("mybodyshield.pages.aiControls.title", "AI controls"),
411
+ children: /* @__PURE__ */ T(d, {
412
+ title: t("mybodyshield.pages.aiControls.errorTitle", "Could not load AI settings"),
413
+ message: t("mybodyshield.pages.aiControls.error", "We couldn't fetch your AI configuration. Try again in a moment."),
414
+ onRetry: () => n.refetch()
426
415
  })
427
416
  });
428
- let i = `${r.id}:${r.updatedAt}`;
429
- return /* @__PURE__ */ w(H, {
430
- settings: r,
431
- logsQuery: n
432
- }, i);
417
+ let o = `${i.id}:${i.updatedAt}`;
418
+ return /* @__PURE__ */ T(U, {
419
+ settings: i,
420
+ logsQuery: r
421
+ }, o);
433
422
  }
434
423
  //#endregion
435
- export { U as AiControlsPage };
424
+ export { W as AiControlsPage };
436
425
 
437
426
  //# sourceMappingURL=AiControlsPage.js.map