@burdenoff/microfe-mybodyshield 2026.830.1 → 2026.1026.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.
@@ -1,29 +1,31 @@
1
- import { PageLayout as e } from "../../components/PageLayout.js";
2
- import { MetricsCard as t } from "../../components/MetricsCard.js";
3
- import { formatDate as n, formatNumber as r, formatRelativeTime as i } from "../../utils/formatters.js";
4
- import { EmptyState as ee } from "../../components/EmptyState.js";
5
- import { useMybLogRecovery as te, useMybRecoveryLogs as a } from "../../hooks/useMyBodyShieldApi.js";
6
- import { useTr as o } from "../../hooks/useTr.js";
1
+ import { useMyBodyShield as e } from "../../context/MyBodyShieldContext.js";
2
+ import { PageLayout as t } from "../../components/PageLayout.js";
3
+ import { MetricsCard as n } from "../../components/MetricsCard.js";
4
+ import { formatDate as ee, formatNumber as r, formatRelativeTime as i } from "../../utils/formatters.js";
5
+ import { EmptyState as te } from "../../components/EmptyState.js";
6
+ import "../../context/index.js";
7
+ import { useMybLogRecovery as ne, useMybRecoveryLogs as a } from "../../hooks/useMyBodyShieldApi.js";
8
+ import { useTr as re } from "../../hooks/useTr.js";
7
9
  import "../../hooks/index.js";
8
- import { ErrorView as s, LoadingView as c, Section as l } from "../../components/StateViews.js";
9
- import { DataTable as ne } from "../../components/DataTable.js";
10
- import { FilterTabs as re } from "../../components/FilterTabs.js";
10
+ import { ErrorView as o, LoadingView as ie, Section as s } from "../../components/StateViews.js";
11
+ import { DataTable as ae } from "../../components/DataTable.js";
12
+ import { FilterTabs as oe } from "../../components/FilterTabs.js";
11
13
  import "../../components/index.js";
12
- import { motion as u } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
13
- import { useReducedMotion as ie } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
14
- import { IconChip as d, RECOVERY_META as f } from "../_shared/visuals.js";
15
- import { Tooltip as ae } from "../../../node_modules/recharts/es6/component/Tooltip.js";
16
- import { ResponsiveContainer as oe } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
17
- import { ReferenceDot as p } from "../../../node_modules/recharts/es6/cartesian/ReferenceDot.js";
18
- import { CartesianGrid as se } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
19
- import { Area as ce } from "../../../node_modules/recharts/es6/cartesian/Area.js";
20
- import { XAxis as le } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
21
- import { YAxis as ue } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
22
- import { AreaChart as de } from "../../../node_modules/recharts/es6/chart/AreaChart.js";
23
- import { useMemo as m, useState as h } from "react";
24
- import { HeartPulse as g, Plus as _ } from "lucide-react";
25
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
26
- import { Button as b, GlassCard as fe, Input as x, Label as S, ResponsiveDialog as pe, ResponsiveDialogContent as me, ResponsiveDialogDescription as he, ResponsiveDialogFooter as ge, ResponsiveDialogHeader as _e, ResponsiveDialogTitle as ve, Select as ye, SelectContent as be, SelectItem as xe, SelectTrigger as Se, SelectValue as Ce, Spinner as we, Textarea as Te } from "@burdenoff/fe-libs/ui";
14
+ import { motion as c } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
15
+ import { useReducedMotion as se } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
16
+ import { IconChip as l, RECOVERY_META as u } from "../_shared/visuals.js";
17
+ import { Tooltip as ce } from "../../../node_modules/recharts/es6/component/Tooltip.js";
18
+ import { ResponsiveContainer as le } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
19
+ import { ReferenceDot as d } from "../../../node_modules/recharts/es6/cartesian/ReferenceDot.js";
20
+ import { CartesianGrid as ue } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
21
+ import { Area as de } from "../../../node_modules/recharts/es6/cartesian/Area.js";
22
+ import { XAxis as fe } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
23
+ import { YAxis as pe } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
24
+ import { AreaChart as f } from "../../../node_modules/recharts/es6/chart/AreaChart.js";
25
+ import { useMemo as p, useState as m } from "react";
26
+ import { HeartPulse as h, Plus as g } from "lucide-react";
27
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
28
+ import { Button as y, GlassCard as b, Input as x, Label as S, ResponsiveDialog as me, ResponsiveDialogContent as he, ResponsiveDialogDescription as ge, ResponsiveDialogFooter as _e, ResponsiveDialogHeader as ve, ResponsiveDialogTitle as ye, Select as be, SelectContent as xe, SelectItem as Se, SelectTrigger as Ce, SelectValue as we, Spinner as Te, Textarea as Ee } from "@burdenoff/fe-libs/ui";
27
29
  //#region src/mybodyshield/pages/recovery/RecoveryPage.tsx
28
30
  var C = [
29
31
  "SLEEP",
@@ -54,7 +56,7 @@ function k(e, t) {
54
56
  }
55
57
  }
56
58
  function A() {
57
- let D = o(), [A, Ee] = h("ALL"), [De, j] = h(!1), [M, N] = h(O), [P, F] = h(null), Oe = a("READINESS"), ke = a("SLEEP"), Ae = a("MOOD"), I = a(A === "ALL" ? void 0 : A), L = te(), R = ie(), z = (e, t = !0) => R ? { initial: !1 } : {
59
+ let D = re(), { navigateTo: A } = e(), [j, De] = m("ALL"), [Oe, M] = m(!1), [N, P] = m(O), [F, I] = m(null), ke = a("READINESS"), Ae = a("SLEEP"), je = a("MOOD"), L = a(j === "ALL" ? void 0 : j), R = ne(), z = se(), B = (e, t = !0) => z ? { initial: !1 } : {
58
60
  initial: {
59
61
  opacity: 0,
60
62
  y: 14
@@ -76,64 +78,64 @@ function A() {
76
78
  damping: 22
77
79
  }
78
80
  } } : {}
79
- }, B = Oe.data?.items ?? [], V = ke.data?.items ?? [], H = Ae.data?.items ?? [], U = I.data?.items ?? [], W = m(() => [...B].sort((e, t) => new Date(t.loggedAt).getTime() - new Date(e.loggedAt).getTime())[0], [B]), G = m(() => [...H].sort((e, t) => new Date(t.loggedAt).getTime() - new Date(e.loggedAt).getTime())[0], [H]), K = m(() => V.length === 0 ? null : V.reduce((e, t) => e + t.sleepHours, 0) / V.length, [V]), q = A === "SLEEP", J = A === "ALL" ? D("mybodyshield.pages.recovery.allMetrics", "All metrics") : k(D, A), je = [{
81
+ }, V = ke.data?.items ?? [], H = Ae.data?.items ?? [], U = je.data?.items ?? [], W = L.data?.items ?? [], G = p(() => [...V].sort((e, t) => new Date(t.loggedAt).getTime() - new Date(e.loggedAt).getTime())[0], [V]), K = p(() => [...U].sort((e, t) => new Date(t.loggedAt).getTime() - new Date(e.loggedAt).getTime())[0], [U]), q = p(() => H.length === 0 ? null : H.reduce((e, t) => e + t.sleepHours, 0) / H.length, [H]), J = j === "SLEEP", Y = j === "ALL" ? D("mybodyshield.pages.recovery.allMetrics", "All metrics") : k(D, j), Me = [{
80
82
  value: "ALL",
81
83
  label: D("mybodyshield.common.all", "All")
82
84
  }, ...C.map((e) => ({
83
85
  value: e,
84
86
  label: k(D, e)
85
- }))], Y = m(() => [...U].sort((e, t) => new Date(e.loggedAt).getTime() - new Date(t.loggedAt).getTime()).map((e) => ({
86
- label: n(e.loggedAt),
87
- value: q ? e.sleepHours : e.score
88
- })), [U, q]), X = Y.length > 0 ? Y[Y.length - 1] : void 0, Z = (e = "READINESS") => {
89
- N(O(e)), F(null), j(!0);
90
- }, Q = M.metric === "SLEEP", Me = async () => {
91
- if (F(null), Q) {
92
- if (M.sleepHours.trim() === "") {
93
- F(D("mybodyshield.pages.recovery.sleepHoursRequired", "Sleep hours is required for sleep entries."));
87
+ }))], X = p(() => [...W].sort((e, t) => new Date(e.loggedAt).getTime() - new Date(t.loggedAt).getTime()).map((e) => ({
88
+ label: ee(e.loggedAt),
89
+ value: J ? e.sleepHours : e.score
90
+ })), [W, J]), Z = X.length > 0 ? X[X.length - 1] : void 0, Q = (e = "READINESS") => {
91
+ P(O(e)), I(null), M(!0);
92
+ }, $ = N.metric === "SLEEP", Ne = async () => {
93
+ if (I(null), $) {
94
+ if (N.sleepHours.trim() === "") {
95
+ I(D("mybodyshield.pages.recovery.sleepHoursRequired", "Sleep hours is required for sleep entries."));
94
96
  return;
95
97
  }
96
- let e = Number(M.sleepHours);
98
+ let e = Number(N.sleepHours);
97
99
  if (!Number.isFinite(e) || e < 0 || e > 24) {
98
- F(D("mybodyshield.pages.recovery.sleepHoursRange", "Enter sleep hours between 0 and 24."));
100
+ I(D("mybodyshield.pages.recovery.sleepHoursRange", "Enter sleep hours between 0 and 24."));
99
101
  return;
100
102
  }
101
- } else if (M.score.trim() === "") {
102
- F(D("mybodyshield.pages.recovery.scoreRequired", "A score is required."));
103
+ } else if (N.score.trim() === "") {
104
+ I(D("mybodyshield.pages.recovery.scoreRequired", "A score is required."));
103
105
  return;
104
106
  }
105
- if (M.score.trim() !== "") {
106
- let e = Number(M.score);
107
+ if (N.score.trim() !== "") {
108
+ let e = Number(N.score);
107
109
  if (!Number.isFinite(e) || e < 0 || e > 100) {
108
- F(D("mybodyshield.pages.recovery.scoreRange", "Enter a score between 0 and 100."));
110
+ I(D("mybodyshield.pages.recovery.scoreRange", "Enter a score between 0 and 100."));
109
111
  return;
110
112
  }
111
113
  }
112
114
  let e = {
113
- metric: M.metric,
114
- score: M.score.trim() === "" ? void 0 : Number(M.score),
115
- sleepHours: M.sleepHours.trim() === "" ? void 0 : Number(M.sleepHours),
116
- notes: M.notes.trim() || void 0,
117
- loggedAt: M.loggedAt ? new Date(M.loggedAt).toISOString() : void 0
115
+ metric: N.metric,
116
+ score: N.score.trim() === "" ? void 0 : Number(N.score),
117
+ sleepHours: N.sleepHours.trim() === "" ? void 0 : Number(N.sleepHours),
118
+ notes: N.notes.trim() || void 0,
119
+ loggedAt: N.loggedAt ? new Date(N.loggedAt).toISOString() : void 0
118
120
  };
119
121
  try {
120
- await L.mutateAsync(e), j(!1);
122
+ await R.mutateAsync(e), M(!1);
121
123
  } catch (e) {
122
- F(e instanceof Error ? e.message : D("mybodyshield.pages.recovery.failedToLog", "Failed to log recovery."));
124
+ I(e instanceof Error ? e.message : D("mybodyshield.pages.recovery.failedToLog", "Failed to log recovery."));
123
125
  }
124
- }, $ = [
126
+ }, Pe = [
125
127
  {
126
128
  key: "metric",
127
129
  header: D("mybodyshield.pages.recovery.metricColumn", "Metric"),
128
130
  sortValue: (e) => k(D, e.metric),
129
131
  render: (e) => {
130
- let t = f[e.metric], n = t.icon;
131
- return /* @__PURE__ */ y("span", {
132
+ let t = u[e.metric], n = t.icon;
133
+ return /* @__PURE__ */ v("span", {
132
134
  className: "inline-flex items-center gap-2.5",
133
- children: [/* @__PURE__ */ v(d, {
134
- icon: /* @__PURE__ */ v(n, { className: "h-4 w-4" }),
135
+ children: [/* @__PURE__ */ _(l, {
136
+ icon: /* @__PURE__ */ _(n, { className: "h-4 w-4" }),
135
137
  tint: t.tint
136
- }), /* @__PURE__ */ v("span", {
138
+ }), /* @__PURE__ */ _("span", {
137
139
  className: "font-medium text-text-primary",
138
140
  children: k(D, e.metric)
139
141
  })]
@@ -145,10 +147,10 @@ function A() {
145
147
  header: D("mybodyshield.pages.recovery.valueColumn", "Value"),
146
148
  align: "right",
147
149
  sortValue: (e) => e.metric === "SLEEP" ? e.sleepHours : e.score,
148
- render: (e) => e.metric === "SLEEP" ? /* @__PURE__ */ y("span", {
150
+ render: (e) => e.metric === "SLEEP" ? /* @__PURE__ */ v("span", {
149
151
  className: "tabular-nums text-text-primary",
150
152
  children: [r(e.sleepHours, { maximumFractionDigits: 1 }), " h"]
151
- }) : /* @__PURE__ */ v("span", {
153
+ }) : /* @__PURE__ */ _("span", {
152
154
  className: "tabular-nums text-text-primary",
153
155
  children: r(e.score)
154
156
  })
@@ -157,10 +159,10 @@ function A() {
157
159
  key: "notes",
158
160
  header: D("mybodyshield.pages.recovery.notesColumn", "Notes"),
159
161
  hideOnMobile: !0,
160
- render: (e) => e.notes && e.notes.trim() ? /* @__PURE__ */ v("span", {
162
+ render: (e) => e.notes && e.notes.trim() ? /* @__PURE__ */ _("span", {
161
163
  className: "text-text-secondary",
162
164
  children: e.notes
163
- }) : /* @__PURE__ */ v("span", {
165
+ }) : /* @__PURE__ */ _("span", {
164
166
  className: "text-text-tertiary",
165
167
  children: "—"
166
168
  })
@@ -170,131 +172,138 @@ function A() {
170
172
  header: D("mybodyshield.pages.recovery.loggedColumn", "Logged"),
171
173
  align: "right",
172
174
  sortValue: (e) => new Date(e.loggedAt).getTime(),
173
- render: (e) => /* @__PURE__ */ v("span", {
175
+ render: (e) => /* @__PURE__ */ _("span", {
174
176
  className: "whitespace-nowrap text-text-tertiary",
175
177
  children: i(e.loggedAt)
176
178
  })
177
179
  }
178
- ], Ne = f.READINESS.icon, Pe = f.SLEEP.icon, Fe = f.MOOD.icon;
179
- return /* @__PURE__ */ y(e, {
180
+ ], Fe = u.READINESS.icon, Ie = u.SLEEP.icon, Le = u.MOOD.icon;
181
+ return /* @__PURE__ */ v(t, {
180
182
  title: D("mybodyshield.pages.recovery.title", "Recovery"),
181
183
  description: D("mybodyshield.pages.recovery.description", "Sleep, readiness, soreness, stress & mood."),
182
- actions: /* @__PURE__ */ y(b, {
183
- className: "gap-2",
184
- onClick: () => Z(),
185
- children: [/* @__PURE__ */ v(_, { className: "h-4 w-4" }), D("mybodyshield.pages.recovery.logRecoveryButton", "Log recovery")]
184
+ actions: /* @__PURE__ */ v("div", {
185
+ className: "flex gap-2",
186
+ children: [/* @__PURE__ */ _(y, {
187
+ variant: "outline",
188
+ onClick: () => A("mindfulness"),
189
+ children: "Mindfulness"
190
+ }), /* @__PURE__ */ v(y, {
191
+ className: "gap-2",
192
+ onClick: () => Q(),
193
+ children: [/* @__PURE__ */ _(g, { className: "h-4 w-4" }), D("mybodyshield.pages.recovery.logRecoveryButton", "Log recovery")]
194
+ })]
186
195
  }),
187
196
  children: [
188
- /* @__PURE__ */ y(u.div, {
189
- ...z(0),
197
+ /* @__PURE__ */ v(c.div, {
198
+ ...B(0),
190
199
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
191
200
  children: [
192
- /* @__PURE__ */ v(t, {
193
- icon: /* @__PURE__ */ v(d, {
194
- icon: /* @__PURE__ */ v(Ne, { className: "h-5 w-5" }),
195
- tint: f.READINESS.tint
201
+ /* @__PURE__ */ _(n, {
202
+ icon: /* @__PURE__ */ _(l, {
203
+ icon: /* @__PURE__ */ _(Fe, { className: "h-5 w-5" }),
204
+ tint: u.READINESS.tint
196
205
  }),
197
- value: W ? r(W.score) : "—",
206
+ value: G ? r(G.score) : "—",
198
207
  label: D("mybodyshield.pages.recovery.latestReadiness", "Latest readiness"),
199
- accent: W ? T(W.score) : void 0,
200
- footer: W ? /* @__PURE__ */ v("p", {
208
+ accent: G ? T(G.score) : void 0,
209
+ footer: G ? /* @__PURE__ */ _("p", {
201
210
  className: "text-xs text-text-tertiary",
202
- children: i(W.loggedAt)
203
- }) : /* @__PURE__ */ v("button", {
211
+ children: i(G.loggedAt)
212
+ }) : /* @__PURE__ */ _("button", {
204
213
  type: "button",
205
- onClick: () => Z("READINESS"),
214
+ onClick: () => Q("READINESS"),
206
215
  className: "text-xs font-medium text-accent hover:underline",
207
216
  children: D("mybodyshield.pages.recovery.logReadiness", "Log readiness →")
208
217
  })
209
218
  }),
210
- /* @__PURE__ */ v(t, {
211
- icon: /* @__PURE__ */ v(d, {
212
- icon: /* @__PURE__ */ v(Pe, { className: "h-5 w-5" }),
213
- tint: f.SLEEP.tint
219
+ /* @__PURE__ */ _(n, {
220
+ icon: /* @__PURE__ */ _(l, {
221
+ icon: /* @__PURE__ */ _(Ie, { className: "h-5 w-5" }),
222
+ tint: u.SLEEP.tint
214
223
  }),
215
- value: K == null ? "—" : `${r(K, { maximumFractionDigits: 1 })} h`,
224
+ value: q == null ? "—" : `${r(q, { maximumFractionDigits: 1 })} h`,
216
225
  label: D("mybodyshield.pages.recovery.avgSleep", "Avg sleep"),
217
- accent: K == null ? void 0 : E(K),
218
- footer: V.length > 0 ? /* @__PURE__ */ y("p", {
226
+ accent: q == null ? void 0 : E(q),
227
+ footer: H.length > 0 ? /* @__PURE__ */ v("p", {
219
228
  className: "text-xs text-text-tertiary",
220
229
  children: [
221
- /* @__PURE__ */ v("span", {
230
+ /* @__PURE__ */ _("span", {
222
231
  className: "tabular-nums text-text-secondary",
223
- children: V.length
232
+ children: H.length
224
233
  }),
225
234
  " ",
226
- V.length === 1 ? D("mybodyshield.pages.recovery.nightsLogged", "{{count}} night logged", { count: V.length }) : D("mybodyshield.pages.recovery.nightsLoggedPlural", "{{count}} nights logged", { count: V.length })
235
+ H.length === 1 ? D("mybodyshield.pages.recovery.nightsLogged", "{{count}} night logged", { count: H.length }) : D("mybodyshield.pages.recovery.nightsLoggedPlural", "{{count}} nights logged", { count: H.length })
227
236
  ]
228
- }) : /* @__PURE__ */ v("button", {
237
+ }) : /* @__PURE__ */ _("button", {
229
238
  type: "button",
230
- onClick: () => Z("SLEEP"),
239
+ onClick: () => Q("SLEEP"),
231
240
  className: "text-xs font-medium text-accent hover:underline",
232
241
  children: D("mybodyshield.pages.recovery.logSleep", "Log sleep →")
233
242
  })
234
243
  }),
235
- /* @__PURE__ */ v(t, {
236
- icon: /* @__PURE__ */ v(d, {
237
- icon: /* @__PURE__ */ v(Fe, { className: "h-5 w-5" }),
238
- tint: f.MOOD.tint
244
+ /* @__PURE__ */ _(n, {
245
+ icon: /* @__PURE__ */ _(l, {
246
+ icon: /* @__PURE__ */ _(Le, { className: "h-5 w-5" }),
247
+ tint: u.MOOD.tint
239
248
  }),
240
- value: G ? r(G.score) : "—",
249
+ value: K ? r(K.score) : "—",
241
250
  label: D("mybodyshield.pages.recovery.latestMood", "Latest mood"),
242
- accent: G ? T(G.score) : void 0,
243
- footer: G ? /* @__PURE__ */ v("p", {
251
+ accent: K ? T(K.score) : void 0,
252
+ footer: K ? /* @__PURE__ */ _("p", {
244
253
  className: "text-xs text-text-tertiary",
245
- children: i(G.loggedAt)
246
- }) : /* @__PURE__ */ v("button", {
254
+ children: i(K.loggedAt)
255
+ }) : /* @__PURE__ */ _("button", {
247
256
  type: "button",
248
- onClick: () => Z("MOOD"),
257
+ onClick: () => Q("MOOD"),
249
258
  className: "text-xs font-medium text-accent hover:underline",
250
259
  children: D("mybodyshield.pages.recovery.logMood", "Log mood →")
251
260
  })
252
261
  })
253
262
  ]
254
263
  }),
255
- /* @__PURE__ */ v("div", {
264
+ /* @__PURE__ */ _("div", {
256
265
  className: "mt-6 flex flex-wrap items-center gap-3",
257
- children: /* @__PURE__ */ v(re, {
258
- options: je,
259
- value: A,
260
- onChange: Ee
266
+ children: /* @__PURE__ */ _(oe, {
267
+ options: Me,
268
+ value: j,
269
+ onChange: De
261
270
  })
262
271
  }),
263
- /* @__PURE__ */ v(l, {
264
- title: D("mybodyshield.pages.recovery.trendTitle", "{{metric}} trend", { metric: J }),
265
- description: q ? D("mybodyshield.pages.recovery.sleepTrendDescription", "Sleep hours over time.") : D("mybodyshield.pages.recovery.scoreTrendDescription", "Recovery score over time."),
266
- children: /* @__PURE__ */ v(u.div, {
267
- ...z(.08),
268
- children: /* @__PURE__ */ v(fe, {
272
+ /* @__PURE__ */ _(s, {
273
+ title: D("mybodyshield.pages.recovery.trendTitle", "{{metric}} trend", { metric: Y }),
274
+ description: J ? D("mybodyshield.pages.recovery.sleepTrendDescription", "Sleep hours over time.") : D("mybodyshield.pages.recovery.scoreTrendDescription", "Recovery score over time."),
275
+ children: /* @__PURE__ */ _(c.div, {
276
+ ...B(.08),
277
+ children: /* @__PURE__ */ _(b, {
269
278
  treatment: "glass",
270
279
  className: "rounded-2xl p-6 transition-shadow duration-300 hover:shadow-2xl",
271
- children: I.isLoading ? /* @__PURE__ */ v("div", {
280
+ children: L.isLoading ? /* @__PURE__ */ _("div", {
272
281
  className: "flex h-[280px] items-center justify-center",
273
- children: /* @__PURE__ */ v(we, { size: "lg" })
274
- }) : I.isError ? /* @__PURE__ */ v(s, {
282
+ children: /* @__PURE__ */ _(Te, { size: "lg" })
283
+ }) : L.isError ? /* @__PURE__ */ _(o, {
275
284
  message: D("mybodyshield.pages.recovery.chartError", "We couldn't load this metric's history."),
276
- onRetry: () => I.refetch()
277
- }) : Y.length === 0 ? /* @__PURE__ */ y("div", {
285
+ onRetry: () => L.refetch()
286
+ }) : X.length === 0 ? /* @__PURE__ */ v("div", {
278
287
  className: "flex h-[280px] flex-col items-center justify-center text-center",
279
288
  children: [
280
- /* @__PURE__ */ v("span", {
289
+ /* @__PURE__ */ _("span", {
281
290
  className: "flex size-11 items-center justify-center rounded-full bg-[var(--color-accent-soft)]",
282
- children: /* @__PURE__ */ v(g, { className: "h-5 w-5 text-accent" })
291
+ children: /* @__PURE__ */ _(h, { className: "h-5 w-5 text-accent" })
283
292
  }),
284
- /* @__PURE__ */ v("p", {
293
+ /* @__PURE__ */ _("p", {
285
294
  className: "mt-3 text-sm font-medium text-text-primary",
286
295
  children: D("mybodyshield.pages.recovery.emptyChartTitle", "Nothing to chart yet")
287
296
  }),
288
- /* @__PURE__ */ v("p", {
297
+ /* @__PURE__ */ _("p", {
289
298
  className: "mt-1 max-w-xs text-xs text-text-tertiary",
290
- children: D("mybodyshield.pages.recovery.emptyChartDescription", "Log a few {{metric}} entries to see your trend here.", { metric: J.toLowerCase() })
299
+ children: D("mybodyshield.pages.recovery.emptyChartDescription", "Log a few {{metric}} entries to see your trend here.", { metric: Y.toLowerCase() })
291
300
  })
292
301
  ]
293
- }) : /* @__PURE__ */ v(oe, {
302
+ }) : /* @__PURE__ */ _(le, {
294
303
  width: "100%",
295
304
  height: 280,
296
- children: /* @__PURE__ */ y(de, {
297
- data: Y,
305
+ children: /* @__PURE__ */ v(f, {
306
+ data: X,
298
307
  margin: {
299
308
  top: 12,
300
309
  right: 16,
@@ -302,36 +311,36 @@ function A() {
302
311
  left: 4
303
312
  },
304
313
  children: [
305
- /* @__PURE__ */ v("defs", { children: /* @__PURE__ */ y("linearGradient", {
314
+ /* @__PURE__ */ _("defs", { children: /* @__PURE__ */ v("linearGradient", {
306
315
  id: "myb-recovery-fill",
307
316
  x1: "0",
308
317
  y1: "0",
309
318
  x2: "0",
310
319
  y2: "1",
311
320
  children: [
312
- /* @__PURE__ */ v("stop", {
321
+ /* @__PURE__ */ _("stop", {
313
322
  offset: "0%",
314
323
  stopColor: w,
315
324
  stopOpacity: .38
316
325
  }),
317
- /* @__PURE__ */ v("stop", {
326
+ /* @__PURE__ */ _("stop", {
318
327
  offset: "55%",
319
328
  stopColor: w,
320
329
  stopOpacity: .12
321
330
  }),
322
- /* @__PURE__ */ v("stop", {
331
+ /* @__PURE__ */ _("stop", {
323
332
  offset: "100%",
324
333
  stopColor: w,
325
334
  stopOpacity: 0
326
335
  })
327
336
  ]
328
337
  }) }),
329
- /* @__PURE__ */ v(se, {
338
+ /* @__PURE__ */ _(ue, {
330
339
  vertical: !1,
331
340
  stroke: "var(--color-border-seam)",
332
341
  strokeDasharray: "4 4"
333
342
  }),
334
- /* @__PURE__ */ v(le, {
343
+ /* @__PURE__ */ _(fe, {
335
344
  dataKey: "label",
336
345
  tickLine: !1,
337
346
  axisLine: !1,
@@ -342,7 +351,7 @@ function A() {
342
351
  fontSize: 12
343
352
  }
344
353
  }),
345
- /* @__PURE__ */ v(ue, {
354
+ /* @__PURE__ */ _(pe, {
346
355
  width: 44,
347
356
  tickLine: !1,
348
357
  axisLine: !1,
@@ -351,7 +360,7 @@ function A() {
351
360
  fontSize: 12
352
361
  }
353
362
  }),
354
- /* @__PURE__ */ v(ae, {
363
+ /* @__PURE__ */ _(ce, {
355
364
  contentStyle: {
356
365
  background: "var(--color-bg-surface)",
357
366
  border: "1px solid var(--color-border-seam)",
@@ -365,10 +374,10 @@ function A() {
365
374
  strokeDasharray: "4 4"
366
375
  }
367
376
  }),
368
- /* @__PURE__ */ v(ce, {
377
+ /* @__PURE__ */ _(de, {
369
378
  type: "monotone",
370
379
  dataKey: "value",
371
- name: q ? D("mybodyshield.pages.recovery.sleepHours", "Sleep hours") : D("mybodyshield.pages.recovery.score", "Score"),
380
+ name: J ? D("mybodyshield.pages.recovery.sleepHours", "Sleep hours") : D("mybodyshield.pages.recovery.score", "Score"),
372
381
  stroke: w,
373
382
  strokeWidth: 2.5,
374
383
  fill: "url(#myb-recovery-fill)",
@@ -380,12 +389,12 @@ function A() {
380
389
  stroke: "var(--color-bg-surface)",
381
390
  fill: w
382
391
  },
383
- isAnimationActive: !R,
392
+ isAnimationActive: !z,
384
393
  animationDuration: 900
385
394
  }),
386
- X && /* @__PURE__ */ v(p, {
387
- x: X.label,
388
- y: X.value,
395
+ Z && /* @__PURE__ */ _(d, {
396
+ x: Z.label,
397
+ y: Z.value,
389
398
  r: 12,
390
399
  isFront: !0,
391
400
  ifOverflow: "visible",
@@ -393,9 +402,9 @@ function A() {
393
402
  fillOpacity: .16,
394
403
  stroke: "none"
395
404
  }),
396
- X && /* @__PURE__ */ v(p, {
397
- x: X.label,
398
- y: X.value,
405
+ Z && /* @__PURE__ */ _(d, {
406
+ x: Z.label,
407
+ y: Z.value,
399
408
  r: 5,
400
409
  isFront: !0,
401
410
  ifOverflow: "visible",
@@ -409,27 +418,27 @@ function A() {
409
418
  })
410
419
  })
411
420
  }),
412
- /* @__PURE__ */ v(u.div, {
413
- ...z(.16, !1),
414
- children: /* @__PURE__ */ v(l, {
421
+ /* @__PURE__ */ _(c.div, {
422
+ ...B(.16, !1),
423
+ children: /* @__PURE__ */ _(s, {
415
424
  title: D("mybodyshield.pages.recovery.recoveryLog", "Recovery log"),
416
425
  description: D("mybodyshield.pages.recovery.recoveryLogDescription", "Every recovery entry, most recent first."),
417
- children: I.isLoading ? /* @__PURE__ */ v(c, { label: D("mybodyshield.pages.recovery.loading", "Loading recovery logs…") }) : I.isError ? /* @__PURE__ */ v(s, {
426
+ children: L.isLoading ? /* @__PURE__ */ _(ie, { label: D("mybodyshield.pages.recovery.loading", "Loading recovery logs…") }) : L.isError ? /* @__PURE__ */ _(o, {
418
427
  message: D("mybodyshield.pages.recovery.error", "We couldn't load your recovery logs."),
419
- onRetry: () => I.refetch()
420
- }) : U.length === 0 ? /* @__PURE__ */ v(ee, {
428
+ onRetry: () => L.refetch()
429
+ }) : W.length === 0 ? /* @__PURE__ */ _(te, {
421
430
  illustration: "empty-data",
422
- icon: /* @__PURE__ */ v(g, { className: "h-10 w-10" }),
431
+ icon: /* @__PURE__ */ _(h, { className: "h-10 w-10" }),
423
432
  title: D("mybodyshield.pages.recovery.emptyTitle", "No recovery logs yet"),
424
433
  description: D("mybodyshield.pages.recovery.emptyDescription", "Track your sleep, readiness, soreness, stress or mood to see how your body is recovering between sessions."),
425
- action: /* @__PURE__ */ y(b, {
434
+ action: /* @__PURE__ */ v(y, {
426
435
  className: "gap-2",
427
- onClick: () => Z(),
428
- children: [/* @__PURE__ */ v(_, { className: "h-4 w-4" }), D("mybodyshield.pages.recovery.logRecoveryButton", "Log recovery")]
436
+ onClick: () => Q(),
437
+ children: [/* @__PURE__ */ _(g, { className: "h-4 w-4" }), D("mybodyshield.pages.recovery.logRecoveryButton", "Log recovery")]
429
438
  })
430
- }) : /* @__PURE__ */ v(ne, {
431
- columns: $,
432
- rows: U,
439
+ }) : /* @__PURE__ */ _(ae, {
440
+ columns: Pe,
441
+ rows: W,
433
442
  rowKey: (e) => e.id,
434
443
  defaultSort: {
435
444
  key: "loggedAt",
@@ -438,134 +447,134 @@ function A() {
438
447
  })
439
448
  })
440
449
  }),
441
- /* @__PURE__ */ v(pe, {
442
- open: De,
443
- onOpenChange: j,
444
- children: /* @__PURE__ */ y(me, {
450
+ /* @__PURE__ */ _(me, {
451
+ open: Oe,
452
+ onOpenChange: M,
453
+ children: /* @__PURE__ */ v(he, {
445
454
  className: "sm:max-w-[480px]",
446
455
  children: [
447
- /* @__PURE__ */ y(_e, { children: [/* @__PURE__ */ v(ve, { children: D("mybodyshield.pages.recovery.dialogTitle", "Log recovery") }), /* @__PURE__ */ v(he, { children: D("mybodyshield.pages.recovery.dialogDescription", "Capture how your body is recovering — one metric per entry.") })] }),
448
- /* @__PURE__ */ y("div", {
456
+ /* @__PURE__ */ v(ve, { children: [/* @__PURE__ */ _(ye, { children: D("mybodyshield.pages.recovery.dialogTitle", "Log recovery") }), /* @__PURE__ */ _(ge, { children: D("mybodyshield.pages.recovery.dialogDescription", "Capture how your body is recovering — one metric per entry.") })] }),
457
+ /* @__PURE__ */ v("div", {
449
458
  className: "space-y-4 py-2",
450
459
  children: [
451
- /* @__PURE__ */ y("div", {
460
+ /* @__PURE__ */ v("div", {
452
461
  className: "space-y-1.5",
453
- children: [/* @__PURE__ */ v(S, {
462
+ children: [/* @__PURE__ */ _(S, {
454
463
  htmlFor: "myb-recovery-metric",
455
464
  children: D("mybodyshield.pages.recovery.metric", "Metric")
456
- }), /* @__PURE__ */ y(ye, {
457
- value: M.metric,
458
- onValueChange: (e) => N((t) => ({
465
+ }), /* @__PURE__ */ v(be, {
466
+ value: N.metric,
467
+ onValueChange: (e) => P((t) => ({
459
468
  ...t,
460
469
  metric: e
461
470
  })),
462
- children: [/* @__PURE__ */ v(Se, {
471
+ children: [/* @__PURE__ */ _(Ce, {
463
472
  id: "myb-recovery-metric",
464
- children: /* @__PURE__ */ v(Ce, {})
465
- }), /* @__PURE__ */ v(be, { children: C.map((e) => /* @__PURE__ */ v(xe, {
473
+ children: /* @__PURE__ */ _(we, {})
474
+ }), /* @__PURE__ */ _(xe, { children: C.map((e) => /* @__PURE__ */ _(Se, {
466
475
  value: e,
467
476
  children: k(D, e)
468
477
  }, e)) })]
469
478
  })]
470
479
  }),
471
- Q && /* @__PURE__ */ y("div", {
480
+ $ && /* @__PURE__ */ v("div", {
472
481
  className: "space-y-1.5",
473
482
  children: [
474
- /* @__PURE__ */ v(S, {
483
+ /* @__PURE__ */ _(S, {
475
484
  htmlFor: "myb-recovery-sleep",
476
485
  children: D("mybodyshield.pages.recovery.sleepHours", "Sleep hours")
477
486
  }),
478
- /* @__PURE__ */ v(x, {
487
+ /* @__PURE__ */ _(x, {
479
488
  id: "myb-recovery-sleep",
480
489
  type: "number",
481
490
  min: "0",
482
491
  max: "24",
483
492
  step: "0.1",
484
- value: M.sleepHours,
485
- onChange: (e) => N((t) => ({
493
+ value: N.sleepHours,
494
+ onChange: (e) => P((t) => ({
486
495
  ...t,
487
496
  sleepHours: e.target.value
488
497
  })),
489
498
  placeholder: D("mybodyshield.pages.recovery.sleepHoursPlaceholder", "e.g. 7.5")
490
499
  }),
491
- /* @__PURE__ */ v("p", {
500
+ /* @__PURE__ */ _("p", {
492
501
  className: "text-xs text-text-tertiary",
493
502
  children: D("mybodyshield.pages.recovery.sleepHoursHint", "Primary measure for sleep entries.")
494
503
  })
495
504
  ]
496
505
  }),
497
- /* @__PURE__ */ y("div", {
506
+ /* @__PURE__ */ v("div", {
498
507
  className: "space-y-1.5",
499
508
  children: [
500
- /* @__PURE__ */ v(S, {
509
+ /* @__PURE__ */ _(S, {
501
510
  htmlFor: "myb-recovery-score",
502
- children: Q ? D("mybodyshield.pages.recovery.scoreOptional", "Score (optional)") : D("mybodyshield.pages.recovery.score", "Score")
511
+ children: $ ? D("mybodyshield.pages.recovery.scoreOptional", "Score (optional)") : D("mybodyshield.pages.recovery.score", "Score")
503
512
  }),
504
- /* @__PURE__ */ v(x, {
513
+ /* @__PURE__ */ _(x, {
505
514
  id: "myb-recovery-score",
506
515
  type: "number",
507
516
  min: "0",
508
517
  max: "100",
509
518
  step: "1",
510
- value: M.score,
511
- onChange: (e) => N((t) => ({
519
+ value: N.score,
520
+ onChange: (e) => P((t) => ({
512
521
  ...t,
513
522
  score: e.target.value
514
523
  })),
515
524
  placeholder: D("mybodyshield.pages.recovery.scorePlaceholder", "0–100")
516
525
  }),
517
- /* @__PURE__ */ v("p", {
526
+ /* @__PURE__ */ _("p", {
518
527
  className: "text-xs text-text-tertiary",
519
- children: Q ? D("mybodyshield.pages.recovery.sleepScoreHint", "Optional 0–100 sleep-quality score.") : D("mybodyshield.pages.recovery.scoreHint", "A 0–100 rating for this metric.")
528
+ children: $ ? D("mybodyshield.pages.recovery.sleepScoreHint", "Optional 0–100 sleep-quality score.") : D("mybodyshield.pages.recovery.scoreHint", "A 0–100 rating for this metric.")
520
529
  })
521
530
  ]
522
531
  }),
523
- /* @__PURE__ */ y("div", {
532
+ /* @__PURE__ */ v("div", {
524
533
  className: "space-y-1.5",
525
- children: [/* @__PURE__ */ v(S, {
534
+ children: [/* @__PURE__ */ _(S, {
526
535
  htmlFor: "myb-recovery-at",
527
536
  children: D("mybodyshield.pages.recovery.loggedAt", "Logged at")
528
- }), /* @__PURE__ */ v(x, {
537
+ }), /* @__PURE__ */ _(x, {
529
538
  id: "myb-recovery-at",
530
539
  type: "datetime-local",
531
- value: M.loggedAt,
532
- onChange: (e) => N((t) => ({
540
+ value: N.loggedAt,
541
+ onChange: (e) => P((t) => ({
533
542
  ...t,
534
543
  loggedAt: e.target.value
535
544
  }))
536
545
  })]
537
546
  }),
538
- /* @__PURE__ */ y("div", {
547
+ /* @__PURE__ */ v("div", {
539
548
  className: "space-y-1.5",
540
- children: [/* @__PURE__ */ v(S, {
549
+ children: [/* @__PURE__ */ _(S, {
541
550
  htmlFor: "myb-recovery-notes",
542
551
  children: D("mybodyshield.common.notes", "Notes")
543
- }), /* @__PURE__ */ v(Te, {
552
+ }), /* @__PURE__ */ _(Ee, {
544
553
  id: "myb-recovery-notes",
545
554
  rows: 3,
546
- value: M.notes,
547
- onChange: (e) => N((t) => ({
555
+ value: N.notes,
556
+ onChange: (e) => P((t) => ({
548
557
  ...t,
549
558
  notes: e.target.value
550
559
  })),
551
560
  placeholder: D("mybodyshield.pages.recovery.notesPlaceholder", "How are you feeling? (optional)")
552
561
  })]
553
562
  }),
554
- P && /* @__PURE__ */ v("p", {
563
+ F && /* @__PURE__ */ _("p", {
555
564
  className: "text-sm text-status-error-text",
556
- children: P
565
+ children: F
557
566
  })
558
567
  ]
559
568
  }),
560
- /* @__PURE__ */ y(ge, { children: [/* @__PURE__ */ v(b, {
569
+ /* @__PURE__ */ v(_e, { children: [/* @__PURE__ */ _(y, {
561
570
  variant: "outline",
562
- onClick: () => j(!1),
563
- disabled: L.isPending,
571
+ onClick: () => M(!1),
572
+ disabled: R.isPending,
564
573
  children: D("mybodyshield.common.cancel", "Cancel")
565
- }), /* @__PURE__ */ v(b, {
566
- onClick: Me,
567
- disabled: L.isPending,
568
- children: L.isPending ? D("mybodyshield.common.saving", "Saving…") : D("mybodyshield.pages.recovery.logRecoveryButton", "Log recovery")
574
+ }), /* @__PURE__ */ _(y, {
575
+ onClick: Ne,
576
+ disabled: R.isPending,
577
+ children: R.isPending ? D("mybodyshield.common.saving", "Saving…") : D("mybodyshield.pages.recovery.logRecoveryButton", "Log recovery")
569
578
  })] })
570
579
  ]
571
580
  })