@burdenoff/microfe-mybodyshield 2026.705.1 → 2026.705.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/mybodyshield/components/DataTable.js +8 -4
  2. package/dist/mybodyshield/components/DataTable.js.map +1 -1
  3. package/dist/mybodyshield/components/EvidenceUpload.js +92 -4
  4. package/dist/mybodyshield/components/EvidenceUpload.js.map +1 -0
  5. package/dist/mybodyshield/components/FileLink.js +35 -2
  6. package/dist/mybodyshield/components/FileLink.js.map +1 -0
  7. package/dist/mybodyshield/components/MybDiscussion.js +107 -6
  8. package/dist/mybodyshield/components/MybDiscussion.js.map +1 -0
  9. package/dist/mybodyshield/components/MybTags.js +148 -4
  10. package/dist/mybodyshield/components/MybTags.js.map +1 -0
  11. package/dist/mybodyshield/components/Pagination.js.map +1 -1
  12. package/dist/mybodyshield/components/UserSearchSelect.js +148 -0
  13. package/dist/mybodyshield/components/UserSearchSelect.js.map +1 -0
  14. package/dist/mybodyshield/components/index.js +1 -0
  15. package/dist/mybodyshield/hooks/index.js +1 -0
  16. package/dist/mybodyshield/hooks/useMyBodyShieldApi.js +47 -27
  17. package/dist/mybodyshield/hooks/useMyBodyShieldApi.js.map +1 -1
  18. package/dist/mybodyshield/hooks/useMybComments.js +44 -2
  19. package/dist/mybodyshield/hooks/useMybComments.js.map +1 -0
  20. package/dist/mybodyshield/hooks/useMybFiles.js +80 -3
  21. package/dist/mybodyshield/hooks/useMybFiles.js.map +1 -0
  22. package/dist/mybodyshield/hooks/useMybTags.js +88 -2
  23. package/dist/mybodyshield/hooks/useMybTags.js.map +1 -0
  24. package/dist/mybodyshield/hooks/useMybUsers.js +36 -0
  25. package/dist/mybodyshield/hooks/useMybUsers.js.map +1 -0
  26. package/dist/mybodyshield/pages/DashboardPage.js +41 -36
  27. package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
  28. package/dist/mybodyshield/pages/_shared/visuals.js +15 -9
  29. package/dist/mybodyshield/pages/_shared/visuals.js.map +1 -1
  30. package/dist/mybodyshield/pages/coaching/CoachingPage.js +171 -147
  31. package/dist/mybodyshield/pages/coaching/CoachingPage.js.map +1 -1
  32. package/dist/mybodyshield/pages/goals/GoalsPage.js +0 -8
  33. package/dist/mybodyshield/pages/goals/GoalsPage.js.map +1 -1
  34. package/dist/mybodyshield/pages/nutrition/NutritionPage.js +352 -278
  35. package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
  36. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js +600 -296
  37. package/dist/mybodyshield/pages/programs/ProgramDetailPage.js.map +1 -1
  38. package/dist/mybodyshield/pages/progress/ProgressPage.js +88 -51
  39. package/dist/mybodyshield/pages/progress/ProgressPage.js.map +1 -1
  40. package/dist/mybodyshield/pages/train/SessionDetailPage.js +146 -126
  41. package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
  42. package/dist/mybodyshield/pages/train/SessionsPage.js +1 -4
  43. package/dist/mybodyshield/pages/train/SessionsPage.js.map +1 -1
  44. package/package.json +2 -2
@@ -1,28 +1,32 @@
1
1
  import { useMyBodyShield as e } from "../../context/MyBodyShieldContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { formatDate as n, formatDuration as r, formatEnumLabel as i, formatMinutes as a, formatNumber as o, formatWeight as s } from "../../utils/formatters.js";
4
- import { StatusBadge as c } from "../../components/StatusBadge.js";
5
- import { ErrorView as ee, LoadingView as te, Section as ne } from "../../components/StateViews.js";
6
- import { EmptyState as l } from "../../components/EmptyState.js";
7
- import { IconChip as u, MUSCLE_META as d, WORKOUT_TYPE_META as f } from "../_shared/visuals.js";
4
+ import { StatusBadge as ee } from "../../components/StatusBadge.js";
5
+ import { ErrorView as te, LoadingView as ne, Section as re } from "../../components/StateViews.js";
6
+ import { EmptyState as c } from "../../components/EmptyState.js";
7
+ import { IconChip as ie, MUSCLE_META as ae, WORKOUT_TYPE_META as l } from "../_shared/visuals.js";
8
8
  import "../../context/index.js";
9
- import { useMybAddExercise as re, useMybAddWorkout as ie, useMybArchiveProgram as ae, useMybProgram as oe, useMybTransitionProgram as se } from "../../hooks/useMyBodyShieldApi.js";
9
+ import { useMybAddExercise as oe, useMybAddWorkout as se, useMybArchiveProgram as ce, useMybProgram as le, useMybTransitionProgram as ue, useMybUpdateProgram as de } from "../../hooks/useMyBodyShieldApi.js";
10
10
  import "../../hooks/index.js";
11
+ import { EvidenceUpload as fe } from "../../components/EvidenceUpload.js";
12
+ import { FileLink as u } from "../../components/FileLink.js";
13
+ import { MybDiscussion as pe } from "../../components/MybDiscussion.js";
14
+ import { MybTags as me } from "../../components/MybTags.js";
11
15
  import "../../components/index.js";
12
- import { useMemo as p, useState as m } from "react";
13
- import { Archive as ce, ArrowLeft as h, CheckCircle2 as le, Dumbbell as ue, Play as de, Plus as g } from "lucide-react";
14
- import { useParams as fe } from "react-router-dom";
15
- import { Fragment as pe, jsx as _, jsxs as v } from "react/jsx-runtime";
16
- import { Button as y, GlassCard as b, Input as x, Label as S, ResponsiveDialog as C, ResponsiveDialogContent as w, ResponsiveDialogDescription as T, ResponsiveDialogFooter as E, ResponsiveDialogHeader as D, ResponsiveDialogTitle as O, Select as k, SelectContent as A, SelectItem as j, SelectTrigger as M, SelectValue as N, Textarea as me } from "@burdenoff/fe-libs/ui";
16
+ import { useMemo as he, useState as d } from "react";
17
+ import { Archive as ge, ArrowLeft as f, CheckCircle2 as _e, Dumbbell as ve, Flame as ye, Lock as be, Pencil as xe, Play as Se, Plus as p } from "lucide-react";
18
+ import { useParams as Ce } from "react-router-dom";
19
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
20
+ import { Button as _, GlassCard as we, Input as v, Label as y, ResponsiveDialog as b, ResponsiveDialogContent as x, ResponsiveDialogDescription as S, ResponsiveDialogFooter as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
17
21
  //#region src/mybodyshield/pages/programs/ProgramDetailPage.tsx
18
- var he = [
22
+ var Te = [
19
23
  "STRENGTH",
20
24
  "CARDIO",
21
25
  "HIIT",
22
26
  "MOBILITY",
23
27
  "YOGA",
24
28
  "RECOVERY"
25
- ], ge = [
29
+ ], Ee = [
26
30
  "CHEST",
27
31
  "BACK",
28
32
  "LEGS",
@@ -30,17 +34,17 @@ var he = [
30
34
  "ARMS",
31
35
  "CORE",
32
36
  "FULL_BODY"
33
- ], P = (e) => {
37
+ ], M = (e) => {
34
38
  let t = e.trim();
35
39
  if (t === "") return null;
36
40
  let n = Number(t);
37
41
  return Number.isFinite(n) ? n : null;
38
- }, F = ({ children: e }) => /* @__PURE__ */ _("span", {
42
+ }, N = ({ children: e }) => /* @__PURE__ */ h("span", {
39
43
  className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
40
44
  children: e
41
- }), I = ({ group: e }) => {
42
- let t = d[e].tint;
43
- return /* @__PURE__ */ _("span", {
45
+ }), P = ({ group: e }) => {
46
+ let t = ae[e].tint;
47
+ return /* @__PURE__ */ h("span", {
44
48
  className: "inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",
45
49
  style: {
46
50
  backgroundColor: `color-mix(in srgb, ${t} 16%, transparent)`,
@@ -49,26 +53,26 @@ var he = [
49
53
  children: i(e)
50
54
  });
51
55
  };
52
- function L({ id: e, value: t, onChange: n, options: r }) {
53
- return /* @__PURE__ */ v(k, {
56
+ function F({ id: e, value: t, onChange: n, options: r }) {
57
+ return /* @__PURE__ */ g(E, {
54
58
  value: t,
55
59
  onValueChange: (e) => n(e),
56
- children: [/* @__PURE__ */ _(M, {
60
+ children: [/* @__PURE__ */ h(k, {
57
61
  id: e,
58
- children: /* @__PURE__ */ _(N, {})
59
- }), /* @__PURE__ */ _(A, { children: r.map((e) => /* @__PURE__ */ _(j, {
62
+ children: /* @__PURE__ */ h(A, {})
63
+ }), /* @__PURE__ */ h(D, { children: r.map((e) => /* @__PURE__ */ h(O, {
60
64
  value: e,
61
65
  children: i(e)
62
66
  }, e)) })]
63
67
  });
64
68
  }
65
- var R = {
69
+ var I = {
66
70
  name: "",
67
71
  type: "STRENGTH",
68
72
  weekNumber: "1",
69
73
  dayOfWeek: "1",
70
74
  durationMin: ""
71
- }, z = {
75
+ }, L = {
72
76
  name: "",
73
77
  muscleGroup: "FULL_BODY",
74
78
  sets: "",
@@ -76,59 +80,97 @@ var R = {
76
80
  targetWeight: "",
77
81
  restSeconds: "",
78
82
  instructions: ""
83
+ }, De = [
84
+ "WEIGHT_LOSS",
85
+ "MUSCLE_GAIN",
86
+ "STRENGTH",
87
+ "ENDURANCE",
88
+ "MOBILITY",
89
+ "GENERAL_FITNESS"
90
+ ], Oe = [
91
+ "BEGINNER",
92
+ "INTERMEDIATE",
93
+ "ADVANCED",
94
+ "ELITE"
95
+ ], ke = [
96
+ "BUILD",
97
+ "PEAK",
98
+ "DELOAD",
99
+ "MAINTENANCE"
100
+ ], Ae = {
101
+ name: "",
102
+ description: "",
103
+ goalType: "GENERAL_FITNESS",
104
+ level: "BEGINNER",
105
+ phase: "BUILD",
106
+ weeks: "",
107
+ daysPerWeek: "",
108
+ startDate: "",
109
+ endDate: ""
110
+ }, R = (e) => {
111
+ if (!e) return "";
112
+ let t = new Date(e);
113
+ return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
79
114
  };
80
- function B({ exercise: e }) {
81
- return /* @__PURE__ */ v("div", {
115
+ function je({ exercise: e }) {
116
+ return /* @__PURE__ */ g("div", {
82
117
  className: "flex flex-col gap-2 py-3 sm:flex-row sm:items-start sm:justify-between",
83
- children: [/* @__PURE__ */ v("div", {
118
+ children: [/* @__PURE__ */ g("div", {
84
119
  className: "min-w-0",
85
- children: [/* @__PURE__ */ v("div", {
86
- className: "flex flex-wrap items-center gap-2",
87
- children: [/* @__PURE__ */ _("p", {
88
- className: "font-medium text-text-primary",
89
- children: e.name
90
- }), /* @__PURE__ */ _(I, { group: e.muscleGroup })]
91
- }), e.instructions && /* @__PURE__ */ _("p", {
92
- className: "mt-1 text-xs text-text-tertiary",
93
- children: e.instructions
94
- })]
95
- }), /* @__PURE__ */ v("div", {
120
+ children: [
121
+ /* @__PURE__ */ g("div", {
122
+ className: "flex flex-wrap items-center gap-2",
123
+ children: [/* @__PURE__ */ h("p", {
124
+ className: "font-medium text-text-primary",
125
+ children: e.name
126
+ }), /* @__PURE__ */ h(P, { group: e.muscleGroup })]
127
+ }),
128
+ e.instructions && /* @__PURE__ */ h("p", {
129
+ className: "mt-1 text-xs text-text-tertiary",
130
+ children: e.instructions
131
+ }),
132
+ e.demo?.id && /* @__PURE__ */ h("div", {
133
+ className: "mt-1.5",
134
+ children: /* @__PURE__ */ h(u, { fileId: e.demo.id })
135
+ })
136
+ ]
137
+ }), /* @__PURE__ */ g("div", {
96
138
  className: "flex shrink-0 items-center gap-4 text-sm tabular-nums text-text-secondary",
97
- children: [/* @__PURE__ */ v("span", { children: [
139
+ children: [/* @__PURE__ */ g("span", { children: [
98
140
  o(e.sets),
99
141
  "×",
100
142
  o(e.reps),
101
143
  " @",
102
144
  " ",
103
145
  s(e.targetWeight)
104
- ] }), /* @__PURE__ */ v("span", {
146
+ ] }), /* @__PURE__ */ g("span", {
105
147
  className: "text-text-tertiary",
106
148
  children: ["Rest ", r(e.restSeconds)]
107
149
  })]
108
150
  })]
109
151
  });
110
152
  }
111
- function _e({ workout: e, onAddExercise: t }) {
112
- let n = f[e.type], r = n.icon, i = p(() => [...e.exercises ?? []].sort((e, t) => e.orderIndex - t.orderIndex), [e.exercises]);
113
- return /* @__PURE__ */ v(b, {
153
+ function Me({ workout: e, canEdit: t, onAddExercise: n }) {
154
+ let r = l[e.type], i = r.icon, s = he(() => [...e.exercises ?? []].sort((e, t) => e.orderIndex - t.orderIndex), [e.exercises]);
155
+ return /* @__PURE__ */ g(we, {
114
156
  treatment: "glass",
115
157
  className: "p-5",
116
- children: [/* @__PURE__ */ v("div", {
158
+ children: [/* @__PURE__ */ g("div", {
117
159
  className: "flex flex-wrap items-start justify-between gap-3",
118
- children: [/* @__PURE__ */ v("div", {
160
+ children: [/* @__PURE__ */ g("div", {
119
161
  className: "flex min-w-0 items-start gap-3",
120
- children: [/* @__PURE__ */ _(u, {
121
- icon: /* @__PURE__ */ _(r, { className: "h-4 w-4" }),
122
- tint: n.tint
123
- }), /* @__PURE__ */ v("div", {
162
+ children: [/* @__PURE__ */ h(ie, {
163
+ icon: /* @__PURE__ */ h(i, { className: "h-4 w-4" }),
164
+ tint: r.tint
165
+ }), /* @__PURE__ */ g("div", {
124
166
  className: "min-w-0",
125
- children: [/* @__PURE__ */ v("div", {
167
+ children: [/* @__PURE__ */ g("div", {
126
168
  className: "flex flex-wrap items-center gap-2",
127
- children: [/* @__PURE__ */ _("h3", {
169
+ children: [/* @__PURE__ */ h("h3", {
128
170
  className: "font-semibold text-text-primary",
129
171
  children: e.name
130
- }), /* @__PURE__ */ _(c, { status: e.type })]
131
- }), /* @__PURE__ */ v("p", {
172
+ }), /* @__PURE__ */ h(ee, { status: e.type })]
173
+ }), /* @__PURE__ */ g("p", {
132
174
  className: "mt-0.5 text-xs text-text-tertiary",
133
175
  children: [
134
176
  "Week ",
@@ -141,311 +183,385 @@ function _e({ workout: e, onAddExercise: t }) {
141
183
  ]
142
184
  })]
143
185
  })]
144
- }), /* @__PURE__ */ v(y, {
186
+ }), t && /* @__PURE__ */ g(_, {
145
187
  variant: "outline",
146
188
  size: "sm",
147
- onClick: () => t(e.id),
148
- children: [/* @__PURE__ */ _(g, { className: "mr-1 h-4 w-4" }), " Add exercise"]
189
+ onClick: () => n(e.id),
190
+ children: [/* @__PURE__ */ h(p, { className: "mr-1 h-4 w-4" }), " Add exercise"]
149
191
  })]
150
- }), i.length === 0 ? /* @__PURE__ */ _("p", {
192
+ }), s.length === 0 ? /* @__PURE__ */ h("p", {
151
193
  className: "mt-4 rounded-lg border border-dashed border-border-seam px-3 py-4 text-center text-sm text-text-tertiary",
152
194
  children: "No exercises yet — add the first movement to this workout."
153
- }) : /* @__PURE__ */ _("div", {
195
+ }) : /* @__PURE__ */ h("div", {
154
196
  className: "mt-4 divide-y divide-border-seam/60",
155
- children: i.map((e) => /* @__PURE__ */ _(B, { exercise: e }, e.id))
197
+ children: s.map((e) => /* @__PURE__ */ h(je, { exercise: e }, e.id))
156
198
  })]
157
199
  });
158
200
  }
159
- function V() {
160
- let { id: r } = fe(), { navigateTo: a } = e(), { data: s, isLoading: u, isError: d, refetch: f } = oe(r), k = se(), A = ae(), j = ie(), M = re(), [N, I] = m(null), [B, V] = m(!1), [H, U] = m(R), [W, G] = m(null), [K, q] = m(null), [J, Y] = m(z), [X, Z] = m(null), ve = p(() => [...s?.workouts ?? []].sort((e, t) => e.weekNumber - t.weekNumber || e.dayOfWeek - t.dayOfWeek || e.orderIndex - t.orderIndex), [s?.workouts]);
161
- if (u) return /* @__PURE__ */ _(t, {
201
+ function z() {
202
+ let { id: r } = Ce(), { navigateTo: a } = e(), { data: s, isLoading: ie, isError: ae, refetch: l } = le(r), u = ue(), E = ce(), D = de(), O = se(), k = oe(), [A, P] = d(null), [je, z] = d(!1), [B, V] = d(I), [Ne, H] = d(null), [U, W] = d(null), [G, K] = d(L), [Pe, Fe] = d(null), [Ie, q] = d(null), [Le, J] = d(!1), [Y, X] = d(Ae), [Re, Z] = d(null), ze = he(() => [...s?.workouts ?? []].sort((e, t) => e.weekNumber - t.weekNumber || e.dayOfWeek - t.dayOfWeek || e.orderIndex - t.orderIndex), [s?.workouts]);
203
+ if (ie) return /* @__PURE__ */ h(t, {
162
204
  title: "Program",
163
- children: /* @__PURE__ */ _(te, { label: "Loading program…" })
205
+ children: /* @__PURE__ */ h(ne, { label: "Loading program…" })
164
206
  });
165
- if (d) return /* @__PURE__ */ _(t, {
207
+ if (ae) return /* @__PURE__ */ h(t, {
166
208
  title: "Program",
167
- children: /* @__PURE__ */ _(ee, {
209
+ children: /* @__PURE__ */ h(te, {
168
210
  message: "We couldn't load this program.",
169
- onRetry: () => void f()
211
+ onRetry: () => void l()
170
212
  })
171
213
  });
172
- if (!s) return /* @__PURE__ */ _(t, {
214
+ if (!s) return /* @__PURE__ */ h(t, {
173
215
  title: "Program",
174
- children: /* @__PURE__ */ _(l, {
216
+ children: /* @__PURE__ */ h(c, {
175
217
  illustration: "empty-data",
176
- icon: /* @__PURE__ */ _(ue, { className: "h-10 w-10" }),
218
+ icon: /* @__PURE__ */ h(ve, { className: "h-10 w-10" }),
177
219
  title: "Program not found",
178
220
  description: "This program may have been deleted or you don't have access to it.",
179
- action: /* @__PURE__ */ v(y, {
221
+ action: /* @__PURE__ */ g(_, {
180
222
  variant: "outline",
181
223
  onClick: () => a("programs"),
182
- children: [/* @__PURE__ */ _(h, { className: "mr-1 h-4 w-4" }), " Back to programs"]
224
+ children: [/* @__PURE__ */ h(f, { className: "mr-1 h-4 w-4" }), " Back to programs"]
183
225
  })
184
226
  })
185
227
  });
186
- let Q = s.id, ye = async (e) => {
187
- I(null);
228
+ let Q = s.id, $ = s.status === "DRAFT" || s.status === "ACTIVE", Be = () => {
229
+ X({
230
+ name: s.name,
231
+ description: s.description ?? "",
232
+ goalType: s.goalType,
233
+ level: s.level,
234
+ phase: s.phase,
235
+ weeks: s.weeks ? String(s.weeks) : "",
236
+ daysPerWeek: s.daysPerWeek ? String(s.daysPerWeek) : "",
237
+ startDate: R(s.startDate),
238
+ endDate: R(s.endDate)
239
+ }), Z(null), J(!0);
240
+ }, Ve = async () => {
241
+ if (!Y.name.trim()) {
242
+ Z("Program name is required.");
243
+ return;
244
+ }
245
+ let e = {
246
+ name: Y.name.trim(),
247
+ description: Y.description.trim() || null,
248
+ goalType: Y.goalType,
249
+ level: Y.level,
250
+ phase: Y.phase,
251
+ weeks: M(Y.weeks),
252
+ daysPerWeek: M(Y.daysPerWeek),
253
+ startDate: Y.startDate ? new Date(Y.startDate).toISOString() : null,
254
+ endDate: Y.endDate ? new Date(Y.endDate).toISOString() : null
255
+ };
256
+ Z(null);
188
257
  try {
189
- await k.mutateAsync({
258
+ await D.mutateAsync({
259
+ id: Q,
260
+ input: e
261
+ }), J(!1);
262
+ } catch (e) {
263
+ Z(e instanceof Error ? e.message : "Failed to update program.");
264
+ }
265
+ }, He = async (e) => {
266
+ P(null);
267
+ try {
268
+ await u.mutateAsync({
190
269
  id: Q,
191
270
  status: e
192
271
  });
193
272
  } catch (e) {
194
- I(e instanceof Error ? e.message : "Failed to update program status.");
273
+ P(e instanceof Error ? e.message : "Failed to update program status.");
195
274
  }
196
- }, be = async () => {
275
+ }, Ue = async () => {
197
276
  if (window.confirm("Archive this program? It will be moved out of your active library.")) {
198
- I(null);
277
+ P(null);
199
278
  try {
200
- await A.mutateAsync(Q), await f();
279
+ await E.mutateAsync(Q), await l();
201
280
  } catch (e) {
202
- I(e instanceof Error ? e.message : "Failed to archive program.");
281
+ P(e instanceof Error ? e.message : "Failed to archive program.");
203
282
  }
204
283
  }
205
- }, $ = () => {
206
- U(R), G(null), V(!0);
207
- }, xe = async () => {
208
- if (!H.name.trim()) {
209
- G("Workout name is required.");
284
+ }, We = () => {
285
+ V(I), H(null), z(!0);
286
+ }, Ge = async () => {
287
+ if (!B.name.trim()) {
288
+ H("Workout name is required.");
210
289
  return;
211
290
  }
212
291
  let e = {
213
292
  programId: Q,
214
- name: H.name.trim(),
215
- type: H.type,
216
- weekNumber: P(H.weekNumber),
217
- dayOfWeek: P(H.dayOfWeek),
218
- durationMin: P(H.durationMin)
293
+ name: B.name.trim(),
294
+ type: B.type,
295
+ weekNumber: M(B.weekNumber),
296
+ dayOfWeek: M(B.dayOfWeek),
297
+ durationMin: M(B.durationMin)
219
298
  };
220
299
  try {
221
- await j.mutateAsync(e), V(!1);
300
+ await O.mutateAsync(e), z(!1);
222
301
  } catch (e) {
223
- G(e instanceof Error ? e.message : "Failed to add workout.");
302
+ H(e instanceof Error ? e.message : "Failed to add workout.");
224
303
  }
225
- }, Se = (e) => {
226
- Y(z), Z(null), q(e);
227
- }, Ce = async () => {
228
- if (!K) return;
229
- if (!J.name.trim()) {
230
- Z("Exercise name is required.");
304
+ }, Ke = (e) => {
305
+ K(L), Fe(null), q(null), W(e);
306
+ }, qe = async () => {
307
+ if (!U) return;
308
+ if (!G.name.trim()) {
309
+ q("Exercise name is required.");
231
310
  return;
232
311
  }
233
312
  let e = {
234
- workoutId: K,
235
- name: J.name.trim(),
236
- muscleGroup: J.muscleGroup,
237
- sets: P(J.sets),
238
- reps: P(J.reps),
239
- targetWeight: P(J.targetWeight),
240
- restSeconds: P(J.restSeconds),
241
- instructions: J.instructions.trim() || null
313
+ workoutId: U,
314
+ name: G.name.trim(),
315
+ muscleGroup: G.muscleGroup,
316
+ sets: M(G.sets),
317
+ reps: M(G.reps),
318
+ targetWeight: M(G.targetWeight),
319
+ restSeconds: M(G.restSeconds),
320
+ instructions: G.instructions.trim() || null,
321
+ demoFileId: Pe?.fileId ?? null
242
322
  };
243
323
  try {
244
- await M.mutateAsync(e), q(null);
324
+ await k.mutateAsync(e), W(null);
245
325
  } catch (e) {
246
- Z(e instanceof Error ? e.message : "Failed to add exercise.");
326
+ q(e instanceof Error ? e.message : "Failed to add exercise.");
247
327
  }
248
328
  };
249
- return /* @__PURE__ */ v(t, {
329
+ return /* @__PURE__ */ g(t, {
250
330
  title: s.name,
251
- actions: /* @__PURE__ */ v(pe, { children: [
252
- s.status === "DRAFT" && /* @__PURE__ */ v(y, {
253
- onClick: () => void ye("ACTIVE"),
254
- disabled: k.isPending,
255
- children: [/* @__PURE__ */ _(de, { className: "mr-1 h-4 w-4" }), " Activate"]
331
+ actions: /* @__PURE__ */ g(m, { children: [
332
+ s.status === "DRAFT" && /* @__PURE__ */ g(_, {
333
+ onClick: () => void He("ACTIVE"),
334
+ disabled: u.isPending,
335
+ children: [/* @__PURE__ */ h(Se, { className: "mr-1 h-4 w-4" }), " Activate"]
256
336
  }),
257
- s.status === "ACTIVE" && /* @__PURE__ */ v(y, {
258
- onClick: () => void ye("COMPLETED"),
259
- disabled: k.isPending,
260
- children: [/* @__PURE__ */ _(le, { className: "mr-1 h-4 w-4" }), " Complete"]
337
+ s.status === "ACTIVE" && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g(_, {
338
+ onClick: () => void He("COMPLETED"),
339
+ disabled: u.isPending,
340
+ children: [/* @__PURE__ */ h(_e, { className: "mr-1 h-4 w-4" }), " Complete"]
341
+ }), /* @__PURE__ */ g(_, {
342
+ variant: "outline",
343
+ onClick: () => a("train"),
344
+ children: [/* @__PURE__ */ h(ye, { className: "mr-1 h-4 w-4" }), " Start a session"]
345
+ })] }),
346
+ s.status !== "ARCHIVED" && /* @__PURE__ */ g(_, {
347
+ variant: "outline",
348
+ onClick: Be,
349
+ disabled: D.isPending,
350
+ children: [/* @__PURE__ */ h(xe, { className: "mr-1 h-4 w-4" }), " Edit"]
261
351
  }),
262
- s.status !== "ARCHIVED" && /* @__PURE__ */ v(y, {
352
+ s.status !== "ARCHIVED" && /* @__PURE__ */ g(_, {
263
353
  variant: "outline",
264
- onClick: () => void be(),
265
- disabled: A.isPending,
266
- children: [/* @__PURE__ */ _(ce, { className: "mr-1 h-4 w-4" }), " Archive"]
354
+ onClick: () => void Ue(),
355
+ disabled: E.isPending,
356
+ children: [/* @__PURE__ */ h(ge, { className: "mr-1 h-4 w-4" }), " Archive"]
267
357
  }),
268
- /* @__PURE__ */ v(y, {
269
- onClick: $,
270
- children: [/* @__PURE__ */ _(g, { className: "mr-1 h-4 w-4" }), " Add workout"]
358
+ $ && /* @__PURE__ */ g(_, {
359
+ onClick: We,
360
+ children: [/* @__PURE__ */ h(p, { className: "mr-1 h-4 w-4" }), " Add workout"]
271
361
  })
272
362
  ] }),
273
363
  children: [
274
- /* @__PURE__ */ v("button", {
364
+ /* @__PURE__ */ g("button", {
275
365
  type: "button",
276
366
  onClick: () => a("programs"),
277
367
  className: "mb-4 inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
278
- children: [/* @__PURE__ */ _(h, { className: "h-4 w-4" }), " All programs"]
368
+ children: [/* @__PURE__ */ h(f, { className: "h-4 w-4" }), " All programs"]
279
369
  }),
280
- /* @__PURE__ */ v(b, {
370
+ /* @__PURE__ */ g(we, {
281
371
  treatment: "glass",
282
372
  className: "p-6",
283
- children: [/* @__PURE__ */ _("div", {
284
- className: "flex flex-wrap items-start justify-between gap-4",
285
- children: /* @__PURE__ */ v("div", {
286
- className: "min-w-0",
287
- children: [
288
- /* @__PURE__ */ v("div", {
289
- className: "flex flex-wrap items-center gap-2",
290
- children: [/* @__PURE__ */ _("h2", {
291
- className: "text-xl font-semibold text-text-primary",
292
- children: s.name
293
- }), /* @__PURE__ */ _(c, { status: s.status })]
294
- }),
295
- /* @__PURE__ */ v("div", {
296
- className: "mt-3 flex flex-wrap gap-1.5",
297
- children: [
298
- /* @__PURE__ */ _(F, { children: i(s.phase) }),
299
- /* @__PURE__ */ _(F, { children: i(s.level) }),
300
- /* @__PURE__ */ _(F, { children: i(s.goalType) }),
301
- /* @__PURE__ */ v(F, { children: [
302
- o(s.weeks),
303
- " wk × ",
304
- o(s.daysPerWeek),
305
- " days"
306
- ] })
307
- ]
308
- }),
309
- /* @__PURE__ */ v("p", {
310
- className: "mt-3 text-sm text-text-secondary",
311
- children: [
312
- n(s.startDate),
313
- " – ",
314
- n(s.endDate)
315
- ]
316
- }),
317
- s.tags.length > 0 && /* @__PURE__ */ _("div", {
318
- className: "mt-3 flex flex-wrap gap-1.5",
319
- children: s.tags.map((e) => /* @__PURE__ */ v("span", {
320
- className: "inline-flex items-center rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-xs font-medium text-text-secondary",
321
- children: ["#", e]
322
- }, e))
323
- }),
324
- s.description && /* @__PURE__ */ _("p", {
325
- className: "mt-3 max-w-2xl text-sm text-text-secondary",
326
- children: s.description
327
- })
328
- ]
373
+ children: [
374
+ /* @__PURE__ */ h("div", {
375
+ className: "flex flex-wrap items-start justify-between gap-4",
376
+ children: /* @__PURE__ */ g("div", {
377
+ className: "min-w-0",
378
+ children: [
379
+ /* @__PURE__ */ g("div", {
380
+ className: "flex flex-wrap items-center gap-2",
381
+ children: [/* @__PURE__ */ h("h2", {
382
+ className: "text-xl font-semibold text-text-primary",
383
+ children: s.name
384
+ }), /* @__PURE__ */ h(ee, { status: s.status })]
385
+ }),
386
+ /* @__PURE__ */ g("div", {
387
+ className: "mt-3 flex flex-wrap gap-1.5",
388
+ children: [
389
+ /* @__PURE__ */ h(N, { children: i(s.phase) }),
390
+ /* @__PURE__ */ h(N, { children: i(s.level) }),
391
+ /* @__PURE__ */ h(N, { children: i(s.goalType) }),
392
+ /* @__PURE__ */ g(N, { children: [
393
+ o(s.weeks),
394
+ " wk × ",
395
+ o(s.daysPerWeek),
396
+ " days"
397
+ ] })
398
+ ]
399
+ }),
400
+ /* @__PURE__ */ g("p", {
401
+ className: "mt-3 text-sm text-text-secondary",
402
+ children: [
403
+ n(s.startDate),
404
+ " – ",
405
+ n(s.endDate)
406
+ ]
407
+ }),
408
+ (s.tags ?? []).length > 0 && /* @__PURE__ */ h("div", {
409
+ className: "mt-3 flex flex-wrap gap-1.5",
410
+ children: (s.tags ?? []).map((e) => /* @__PURE__ */ g("span", {
411
+ className: "inline-flex items-center rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-xs font-medium text-text-secondary",
412
+ children: ["#", e]
413
+ }, e))
414
+ }),
415
+ s.description && /* @__PURE__ */ h("p", {
416
+ className: "mt-3 max-w-2xl text-sm text-text-secondary",
417
+ children: s.description
418
+ })
419
+ ]
420
+ })
421
+ }),
422
+ /* @__PURE__ */ h("div", {
423
+ className: "mt-5 border-t border-border-seam pt-4",
424
+ children: /* @__PURE__ */ h(me, {
425
+ entityType: "mybodyshield-program",
426
+ entityId: s.id,
427
+ label: "Platform tags"
428
+ })
429
+ }),
430
+ A && /* @__PURE__ */ h("p", {
431
+ className: "mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
432
+ children: A
329
433
  })
330
- }), N && /* @__PURE__ */ _("p", {
331
- className: "mt-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
332
- children: N
333
- })]
434
+ ]
334
435
  }),
335
- /* @__PURE__ */ _(ne, {
436
+ /* @__PURE__ */ g(re, {
336
437
  title: "Workouts",
337
438
  description: "Sessions in this block, ordered by week, day & sequence.",
338
- children: ve.length === 0 ? /* @__PURE__ */ _(l, {
439
+ children: [!$ && /* @__PURE__ */ g("p", {
440
+ className: "mb-4 inline-flex items-center gap-1.5 rounded-lg border border-border-seam bg-bg-sunken/60 px-3 py-2 text-xs text-text-tertiary",
441
+ children: [
442
+ /* @__PURE__ */ h(be, { className: "h-3.5 w-3.5 shrink-0" }),
443
+ "This program is ",
444
+ i(s.status).toLowerCase(),
445
+ " — its structure is locked and can no longer be edited."
446
+ ]
447
+ }), ze.length === 0 ? /* @__PURE__ */ h(c, {
339
448
  illustration: "empty-data",
340
- icon: /* @__PURE__ */ _(ue, { className: "h-10 w-10" }),
449
+ icon: /* @__PURE__ */ h(ve, { className: "h-10 w-10" }),
341
450
  title: "No workouts yet",
342
- description: "Add workouts to lay out the training week, then attach exercises to each one.",
343
- action: /* @__PURE__ */ v(y, {
344
- onClick: $,
345
- children: [/* @__PURE__ */ _(g, { className: "mr-1 h-4 w-4" }), " Add workout"]
346
- })
347
- }) : /* @__PURE__ */ _("div", {
451
+ description: $ ? "Add workouts to lay out the training week, then attach exercises to each one." : "This program has no workouts, and its structure is locked in its current status.",
452
+ action: $ ? /* @__PURE__ */ g(_, {
453
+ onClick: We,
454
+ children: [/* @__PURE__ */ h(p, { className: "mr-1 h-4 w-4" }), " Add workout"]
455
+ }) : void 0
456
+ }) : /* @__PURE__ */ h("div", {
348
457
  className: "space-y-4",
349
- children: ve.map((e) => /* @__PURE__ */ _(_e, {
458
+ children: ze.map((e) => /* @__PURE__ */ h(Me, {
350
459
  workout: e,
351
- onAddExercise: Se
460
+ canEdit: $,
461
+ onAddExercise: Ke
352
462
  }, e.id))
353
- })
463
+ })]
354
464
  }),
355
- /* @__PURE__ */ _(C, {
356
- open: B,
357
- onOpenChange: V,
358
- children: /* @__PURE__ */ v(w, {
465
+ /* @__PURE__ */ h(pe, {
466
+ entityType: "mybodyshield-program",
467
+ entityId: s.id,
468
+ title: "Program notes",
469
+ description: "Coach and member notes for this training block."
470
+ }),
471
+ /* @__PURE__ */ h(b, {
472
+ open: je,
473
+ onOpenChange: z,
474
+ children: /* @__PURE__ */ g(x, {
359
475
  className: "sm:max-w-lg",
360
476
  children: [
361
- /* @__PURE__ */ v(D, { children: [/* @__PURE__ */ _(O, { children: "Add workout" }), /* @__PURE__ */ _(T, { children: "Add a training session to this program. Attach exercises once it's created." })] }),
362
- /* @__PURE__ */ v("div", {
477
+ /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Add workout" }), /* @__PURE__ */ h(S, { children: "Add a training session to this program. Attach exercises once it's created." })] }),
478
+ /* @__PURE__ */ g("div", {
363
479
  className: "space-y-4 py-2",
364
480
  children: [
365
- W && /* @__PURE__ */ _("p", {
481
+ Ne && /* @__PURE__ */ h("p", {
366
482
  className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
367
- children: W
483
+ children: Ne
368
484
  }),
369
- /* @__PURE__ */ v("div", {
485
+ /* @__PURE__ */ g("div", {
370
486
  className: "space-y-1.5",
371
- children: [/* @__PURE__ */ _(S, {
487
+ children: [/* @__PURE__ */ h(y, {
372
488
  htmlFor: "myb-wk-name",
373
489
  children: "Name"
374
- }), /* @__PURE__ */ _(x, {
490
+ }), /* @__PURE__ */ h(v, {
375
491
  id: "myb-wk-name",
376
- value: H.name,
377
- onChange: (e) => U({
378
- ...H,
492
+ value: B.name,
493
+ onChange: (e) => V({
494
+ ...B,
379
495
  name: e.target.value
380
496
  }),
381
497
  placeholder: "e.g. Upper Body — Push"
382
498
  })]
383
499
  }),
384
- /* @__PURE__ */ v("div", {
500
+ /* @__PURE__ */ g("div", {
385
501
  className: "space-y-1.5",
386
- children: [/* @__PURE__ */ _(S, {
502
+ children: [/* @__PURE__ */ h(y, {
387
503
  htmlFor: "myb-wk-type",
388
504
  children: "Type"
389
- }), /* @__PURE__ */ _(L, {
505
+ }), /* @__PURE__ */ h(F, {
390
506
  id: "myb-wk-type",
391
- value: H.type,
392
- onChange: (e) => U({
393
- ...H,
507
+ value: B.type,
508
+ onChange: (e) => V({
509
+ ...B,
394
510
  type: e
395
511
  }),
396
- options: he
512
+ options: Te
397
513
  })]
398
514
  }),
399
- /* @__PURE__ */ v("div", {
515
+ /* @__PURE__ */ g("div", {
400
516
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
401
517
  children: [
402
- /* @__PURE__ */ v("div", {
518
+ /* @__PURE__ */ g("div", {
403
519
  className: "space-y-1.5",
404
- children: [/* @__PURE__ */ _(S, {
520
+ children: [/* @__PURE__ */ h(y, {
405
521
  htmlFor: "myb-wk-week",
406
522
  children: "Week"
407
- }), /* @__PURE__ */ _(x, {
523
+ }), /* @__PURE__ */ h(v, {
408
524
  id: "myb-wk-week",
409
525
  type: "number",
410
526
  min: 1,
411
- value: H.weekNumber,
412
- onChange: (e) => U({
413
- ...H,
527
+ value: B.weekNumber,
528
+ onChange: (e) => V({
529
+ ...B,
414
530
  weekNumber: e.target.value
415
531
  }),
416
532
  placeholder: "1"
417
533
  })]
418
534
  }),
419
- /* @__PURE__ */ v("div", {
535
+ /* @__PURE__ */ g("div", {
420
536
  className: "space-y-1.5",
421
- children: [/* @__PURE__ */ _(S, {
537
+ children: [/* @__PURE__ */ h(y, {
422
538
  htmlFor: "myb-wk-day",
423
539
  children: "Day"
424
- }), /* @__PURE__ */ _(x, {
540
+ }), /* @__PURE__ */ h(v, {
425
541
  id: "myb-wk-day",
426
542
  type: "number",
427
543
  min: 1,
428
544
  max: 7,
429
- value: H.dayOfWeek,
430
- onChange: (e) => U({
431
- ...H,
545
+ value: B.dayOfWeek,
546
+ onChange: (e) => V({
547
+ ...B,
432
548
  dayOfWeek: e.target.value
433
549
  }),
434
550
  placeholder: "1"
435
551
  })]
436
552
  }),
437
- /* @__PURE__ */ v("div", {
553
+ /* @__PURE__ */ g("div", {
438
554
  className: "space-y-1.5",
439
- children: [/* @__PURE__ */ _(S, {
555
+ children: [/* @__PURE__ */ h(y, {
440
556
  htmlFor: "myb-wk-dur",
441
557
  children: "Duration (min)"
442
- }), /* @__PURE__ */ _(x, {
558
+ }), /* @__PURE__ */ h(v, {
443
559
  id: "myb-wk-dur",
444
560
  type: "number",
445
561
  min: 0,
446
- value: H.durationMin,
447
- onChange: (e) => U({
448
- ...H,
562
+ value: B.durationMin,
563
+ onChange: (e) => V({
564
+ ...B,
449
565
  durationMin: e.target.value
450
566
  }),
451
567
  placeholder: "60"
@@ -455,132 +571,132 @@ function V() {
455
571
  })
456
572
  ]
457
573
  }),
458
- /* @__PURE__ */ v(E, { children: [/* @__PURE__ */ _(y, {
574
+ /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
459
575
  variant: "outline",
460
- onClick: () => V(!1),
461
- disabled: j.isPending,
576
+ onClick: () => z(!1),
577
+ disabled: O.isPending,
462
578
  children: "Cancel"
463
- }), /* @__PURE__ */ _(y, {
464
- onClick: () => void xe(),
465
- disabled: j.isPending,
466
- children: j.isPending ? "Adding…" : "Add workout"
579
+ }), /* @__PURE__ */ h(_, {
580
+ onClick: () => void Ge(),
581
+ disabled: O.isPending,
582
+ children: O.isPending ? "Adding…" : "Add workout"
467
583
  })] })
468
584
  ]
469
585
  })
470
586
  }),
471
- /* @__PURE__ */ _(C, {
472
- open: K !== null,
587
+ /* @__PURE__ */ h(b, {
588
+ open: U !== null,
473
589
  onOpenChange: (e) => {
474
- e || q(null);
590
+ e || W(null);
475
591
  },
476
- children: /* @__PURE__ */ v(w, {
592
+ children: /* @__PURE__ */ g(x, {
477
593
  className: "sm:max-w-lg",
478
594
  children: [
479
- /* @__PURE__ */ v(D, { children: [/* @__PURE__ */ _(O, { children: "Add exercise" }), /* @__PURE__ */ _(T, { children: "Add a movement with its target sets, reps, load & rest." })] }),
480
- /* @__PURE__ */ v("div", {
595
+ /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Add exercise" }), /* @__PURE__ */ h(S, { children: "Add a movement with its target sets, reps, load & rest." })] }),
596
+ /* @__PURE__ */ g("div", {
481
597
  className: "space-y-4 py-2",
482
598
  children: [
483
- X && /* @__PURE__ */ _("p", {
599
+ Ie && /* @__PURE__ */ h("p", {
484
600
  className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
485
- children: X
601
+ children: Ie
486
602
  }),
487
- /* @__PURE__ */ v("div", {
603
+ /* @__PURE__ */ g("div", {
488
604
  className: "space-y-1.5",
489
- children: [/* @__PURE__ */ _(S, {
605
+ children: [/* @__PURE__ */ h(y, {
490
606
  htmlFor: "myb-ex-name",
491
607
  children: "Name"
492
- }), /* @__PURE__ */ _(x, {
608
+ }), /* @__PURE__ */ h(v, {
493
609
  id: "myb-ex-name",
494
- value: J.name,
495
- onChange: (e) => Y({
496
- ...J,
610
+ value: G.name,
611
+ onChange: (e) => K({
612
+ ...G,
497
613
  name: e.target.value
498
614
  }),
499
615
  placeholder: "e.g. Barbell Bench Press"
500
616
  })]
501
617
  }),
502
- /* @__PURE__ */ v("div", {
618
+ /* @__PURE__ */ g("div", {
503
619
  className: "space-y-1.5",
504
- children: [/* @__PURE__ */ _(S, {
620
+ children: [/* @__PURE__ */ h(y, {
505
621
  htmlFor: "myb-ex-muscle",
506
622
  children: "Muscle group"
507
- }), /* @__PURE__ */ _(L, {
623
+ }), /* @__PURE__ */ h(F, {
508
624
  id: "myb-ex-muscle",
509
- value: J.muscleGroup,
510
- onChange: (e) => Y({
511
- ...J,
625
+ value: G.muscleGroup,
626
+ onChange: (e) => K({
627
+ ...G,
512
628
  muscleGroup: e
513
629
  }),
514
- options: ge
630
+ options: Ee
515
631
  })]
516
632
  }),
517
- /* @__PURE__ */ v("div", {
633
+ /* @__PURE__ */ g("div", {
518
634
  className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
519
635
  children: [
520
- /* @__PURE__ */ v("div", {
636
+ /* @__PURE__ */ g("div", {
521
637
  className: "space-y-1.5",
522
- children: [/* @__PURE__ */ _(S, {
638
+ children: [/* @__PURE__ */ h(y, {
523
639
  htmlFor: "myb-ex-sets",
524
640
  children: "Sets"
525
- }), /* @__PURE__ */ _(x, {
641
+ }), /* @__PURE__ */ h(v, {
526
642
  id: "myb-ex-sets",
527
643
  type: "number",
528
644
  min: 0,
529
- value: J.sets,
530
- onChange: (e) => Y({
531
- ...J,
645
+ value: G.sets,
646
+ onChange: (e) => K({
647
+ ...G,
532
648
  sets: e.target.value
533
649
  }),
534
650
  placeholder: "3"
535
651
  })]
536
652
  }),
537
- /* @__PURE__ */ v("div", {
653
+ /* @__PURE__ */ g("div", {
538
654
  className: "space-y-1.5",
539
- children: [/* @__PURE__ */ _(S, {
655
+ children: [/* @__PURE__ */ h(y, {
540
656
  htmlFor: "myb-ex-reps",
541
657
  children: "Reps"
542
- }), /* @__PURE__ */ _(x, {
658
+ }), /* @__PURE__ */ h(v, {
543
659
  id: "myb-ex-reps",
544
660
  type: "number",
545
661
  min: 0,
546
- value: J.reps,
547
- onChange: (e) => Y({
548
- ...J,
662
+ value: G.reps,
663
+ onChange: (e) => K({
664
+ ...G,
549
665
  reps: e.target.value
550
666
  }),
551
667
  placeholder: "10"
552
668
  })]
553
669
  }),
554
- /* @__PURE__ */ v("div", {
670
+ /* @__PURE__ */ g("div", {
555
671
  className: "space-y-1.5",
556
- children: [/* @__PURE__ */ _(S, {
672
+ children: [/* @__PURE__ */ h(y, {
557
673
  htmlFor: "myb-ex-weight",
558
674
  children: "Weight (kg)"
559
- }), /* @__PURE__ */ _(x, {
675
+ }), /* @__PURE__ */ h(v, {
560
676
  id: "myb-ex-weight",
561
677
  type: "number",
562
678
  min: 0,
563
679
  step: "0.5",
564
- value: J.targetWeight,
565
- onChange: (e) => Y({
566
- ...J,
680
+ value: G.targetWeight,
681
+ onChange: (e) => K({
682
+ ...G,
567
683
  targetWeight: e.target.value
568
684
  }),
569
685
  placeholder: "60"
570
686
  })]
571
687
  }),
572
- /* @__PURE__ */ v("div", {
688
+ /* @__PURE__ */ g("div", {
573
689
  className: "space-y-1.5",
574
- children: [/* @__PURE__ */ _(S, {
690
+ children: [/* @__PURE__ */ h(y, {
575
691
  htmlFor: "myb-ex-rest",
576
692
  children: "Rest (sec)"
577
- }), /* @__PURE__ */ _(x, {
693
+ }), /* @__PURE__ */ h(v, {
578
694
  id: "myb-ex-rest",
579
695
  type: "number",
580
696
  min: 0,
581
- value: J.restSeconds,
582
- onChange: (e) => Y({
583
- ...J,
697
+ value: G.restSeconds,
698
+ onChange: (e) => K({
699
+ ...G,
584
700
  restSeconds: e.target.value
585
701
  }),
586
702
  placeholder: "90"
@@ -588,33 +704,221 @@ function V() {
588
704
  })
589
705
  ]
590
706
  }),
591
- /* @__PURE__ */ v("div", {
707
+ /* @__PURE__ */ g("div", {
592
708
  className: "space-y-1.5",
593
- children: [/* @__PURE__ */ _(S, {
709
+ children: [/* @__PURE__ */ h(y, {
594
710
  htmlFor: "myb-ex-instructions",
595
711
  children: "Instructions"
596
- }), /* @__PURE__ */ _(me, {
712
+ }), /* @__PURE__ */ h(j, {
597
713
  id: "myb-ex-instructions",
598
714
  rows: 3,
599
- value: J.instructions,
600
- onChange: (e) => Y({
601
- ...J,
715
+ value: G.instructions,
716
+ onChange: (e) => K({
717
+ ...G,
602
718
  instructions: e.target.value
603
719
  }),
604
720
  placeholder: "Cues, tempo, form notes…"
605
721
  })]
722
+ }),
723
+ /* @__PURE__ */ h(fe, {
724
+ id: "myb-ex-demo",
725
+ label: "Demo media (optional)",
726
+ value: Pe,
727
+ onChange: Fe,
728
+ accept: "video/*,image/*",
729
+ disabled: k.isPending,
730
+ hint: "Attach a short demo clip or image to show how the movement is performed."
731
+ })
732
+ ]
733
+ }),
734
+ /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
735
+ variant: "outline",
736
+ onClick: () => W(null),
737
+ disabled: k.isPending,
738
+ children: "Cancel"
739
+ }), /* @__PURE__ */ h(_, {
740
+ onClick: () => void qe(),
741
+ disabled: k.isPending,
742
+ children: k.isPending ? "Adding…" : "Add exercise"
743
+ })] })
744
+ ]
745
+ })
746
+ }),
747
+ /* @__PURE__ */ h(b, {
748
+ open: Le,
749
+ onOpenChange: J,
750
+ children: /* @__PURE__ */ g(x, {
751
+ className: "sm:max-w-lg",
752
+ children: [
753
+ /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Edit program" }), /* @__PURE__ */ h(S, { children: "Update this program's plan, goal & schedule. Workouts stay untouched." })] }),
754
+ /* @__PURE__ */ g("div", {
755
+ className: "space-y-4 py-2",
756
+ children: [
757
+ Re && /* @__PURE__ */ h("p", {
758
+ className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
759
+ children: Re
760
+ }),
761
+ /* @__PURE__ */ g("div", {
762
+ className: "space-y-1.5",
763
+ children: [/* @__PURE__ */ h(y, {
764
+ htmlFor: "myb-edit-name",
765
+ children: "Name"
766
+ }), /* @__PURE__ */ h(v, {
767
+ id: "myb-edit-name",
768
+ value: Y.name,
769
+ onChange: (e) => X({
770
+ ...Y,
771
+ name: e.target.value
772
+ }),
773
+ placeholder: "e.g. Hypertrophy Block A"
774
+ })]
775
+ }),
776
+ /* @__PURE__ */ g("div", {
777
+ className: "space-y-1.5",
778
+ children: [/* @__PURE__ */ h(y, {
779
+ htmlFor: "myb-edit-desc",
780
+ children: "Description"
781
+ }), /* @__PURE__ */ h(j, {
782
+ id: "myb-edit-desc",
783
+ rows: 3,
784
+ value: Y.description,
785
+ onChange: (e) => X({
786
+ ...Y,
787
+ description: e.target.value
788
+ }),
789
+ placeholder: "Focus, progression scheme, notes…"
790
+ })]
791
+ }),
792
+ /* @__PURE__ */ g("div", {
793
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
794
+ children: [
795
+ /* @__PURE__ */ g("div", {
796
+ className: "space-y-1.5",
797
+ children: [/* @__PURE__ */ h(y, {
798
+ htmlFor: "myb-edit-goal",
799
+ children: "Goal type"
800
+ }), /* @__PURE__ */ h(F, {
801
+ id: "myb-edit-goal",
802
+ value: Y.goalType,
803
+ onChange: (e) => X({
804
+ ...Y,
805
+ goalType: e
806
+ }),
807
+ options: De
808
+ })]
809
+ }),
810
+ /* @__PURE__ */ g("div", {
811
+ className: "space-y-1.5",
812
+ children: [/* @__PURE__ */ h(y, {
813
+ htmlFor: "myb-edit-level",
814
+ children: "Level"
815
+ }), /* @__PURE__ */ h(F, {
816
+ id: "myb-edit-level",
817
+ value: Y.level,
818
+ onChange: (e) => X({
819
+ ...Y,
820
+ level: e
821
+ }),
822
+ options: Oe
823
+ })]
824
+ }),
825
+ /* @__PURE__ */ g("div", {
826
+ className: "space-y-1.5",
827
+ children: [/* @__PURE__ */ h(y, {
828
+ htmlFor: "myb-edit-phase",
829
+ children: "Phase"
830
+ }), /* @__PURE__ */ h(F, {
831
+ id: "myb-edit-phase",
832
+ value: Y.phase,
833
+ onChange: (e) => X({
834
+ ...Y,
835
+ phase: e
836
+ }),
837
+ options: ke
838
+ })]
839
+ })
840
+ ]
841
+ }),
842
+ /* @__PURE__ */ g("div", {
843
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
844
+ children: [/* @__PURE__ */ g("div", {
845
+ className: "space-y-1.5",
846
+ children: [/* @__PURE__ */ h(y, {
847
+ htmlFor: "myb-edit-weeks",
848
+ children: "Weeks"
849
+ }), /* @__PURE__ */ h(v, {
850
+ id: "myb-edit-weeks",
851
+ type: "number",
852
+ min: 1,
853
+ value: Y.weeks,
854
+ onChange: (e) => X({
855
+ ...Y,
856
+ weeks: e.target.value
857
+ }),
858
+ placeholder: "8"
859
+ })]
860
+ }), /* @__PURE__ */ g("div", {
861
+ className: "space-y-1.5",
862
+ children: [/* @__PURE__ */ h(y, {
863
+ htmlFor: "myb-edit-days",
864
+ children: "Days / week"
865
+ }), /* @__PURE__ */ h(v, {
866
+ id: "myb-edit-days",
867
+ type: "number",
868
+ min: 1,
869
+ max: 7,
870
+ value: Y.daysPerWeek,
871
+ onChange: (e) => X({
872
+ ...Y,
873
+ daysPerWeek: e.target.value
874
+ }),
875
+ placeholder: "4"
876
+ })]
877
+ })]
878
+ }),
879
+ /* @__PURE__ */ g("div", {
880
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
881
+ children: [/* @__PURE__ */ g("div", {
882
+ className: "space-y-1.5",
883
+ children: [/* @__PURE__ */ h(y, {
884
+ htmlFor: "myb-edit-start",
885
+ children: "Start date"
886
+ }), /* @__PURE__ */ h(v, {
887
+ id: "myb-edit-start",
888
+ type: "date",
889
+ value: Y.startDate,
890
+ onChange: (e) => X({
891
+ ...Y,
892
+ startDate: e.target.value
893
+ })
894
+ })]
895
+ }), /* @__PURE__ */ g("div", {
896
+ className: "space-y-1.5",
897
+ children: [/* @__PURE__ */ h(y, {
898
+ htmlFor: "myb-edit-end",
899
+ children: "End date"
900
+ }), /* @__PURE__ */ h(v, {
901
+ id: "myb-edit-end",
902
+ type: "date",
903
+ value: Y.endDate,
904
+ onChange: (e) => X({
905
+ ...Y,
906
+ endDate: e.target.value
907
+ })
908
+ })]
909
+ })]
606
910
  })
607
911
  ]
608
912
  }),
609
- /* @__PURE__ */ v(E, { children: [/* @__PURE__ */ _(y, {
913
+ /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
610
914
  variant: "outline",
611
- onClick: () => q(null),
612
- disabled: M.isPending,
915
+ onClick: () => J(!1),
916
+ disabled: D.isPending,
613
917
  children: "Cancel"
614
- }), /* @__PURE__ */ _(y, {
615
- onClick: () => void Ce(),
616
- disabled: M.isPending,
617
- children: M.isPending ? "Adding…" : "Add exercise"
918
+ }), /* @__PURE__ */ h(_, {
919
+ onClick: () => void Ve(),
920
+ disabled: D.isPending,
921
+ children: D.isPending ? "Saving…" : "Save changes"
618
922
  })] })
619
923
  ]
620
924
  })
@@ -623,6 +927,6 @@ function V() {
623
927
  });
624
928
  }
625
929
  //#endregion
626
- export { V as ProgramDetailPage };
930
+ export { z as ProgramDetailPage };
627
931
 
628
932
  //# sourceMappingURL=ProgramDetailPage.js.map