@burdenoff/microfe-mybodyshield 2026.720.3 → 2026.731.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.
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts +28 -1
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.d.ts.map +1 -1
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.js +79 -40
- package/dist/mybodyshield/hooks/useMyBodyShieldApi.js.map +1 -1
- package/dist/mybodyshield/lib/offlineSessionQueue.d.ts +76 -0
- package/dist/mybodyshield/lib/offlineSessionQueue.d.ts.map +1 -0
- package/dist/mybodyshield/lib/offlineSessionQueue.js +77 -0
- package/dist/mybodyshield/lib/offlineSessionQueue.js.map +1 -0
- package/dist/mybodyshield/lib/useOfflineSessionSync.d.ts +30 -0
- package/dist/mybodyshield/lib/useOfflineSessionSync.d.ts.map +1 -0
- package/dist/mybodyshield/lib/useOfflineSessionSync.js +80 -0
- package/dist/mybodyshield/lib/useOfflineSessionSync.js.map +1 -0
- package/dist/mybodyshield/pages/DashboardPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/DashboardPage.js +247 -170
- package/dist/mybodyshield/pages/DashboardPage.js.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js +540 -441
- package/dist/mybodyshield/pages/nutrition/NutritionPage.js.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.d.ts.map +1 -1
- package/dist/mybodyshield/pages/train/SessionDetailPage.js +242 -173
- package/dist/mybodyshield/pages/train/SessionDetailPage.js.map +1 -1
- package/dist/mybodyshield/types/index.d.ts +46 -0
- package/dist/mybodyshield/types/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -14,14 +14,38 @@ import "../../components/index.js";
|
|
|
14
14
|
import { motion as s } from "../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
15
15
|
import { useReducedMotion as me } from "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
|
|
16
16
|
import { IconChip as c } from "../_shared/visuals.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
17
|
+
import { listPendingActionsForSession as he } from "../../lib/offlineSessionQueue.js";
|
|
18
|
+
import { useOfflineSessionSync as ge } from "../../lib/useOfflineSessionSync.js";
|
|
19
|
+
import { useCallback as _e, useEffect as ve, useMemo as l, useState as u } from "react";
|
|
20
|
+
import { AlertTriangle as ye, ArrowLeft as be, CheckCircle2 as xe, ChevronLeft as Se, ChevronRight as Ce, Dumbbell as d, Flame as we, Gauge as Te, ListChecks as Ee, Plus as f, Ruler as De, Timer as p, Trophy as Oe, Weight as ke, WifiOff as Ae, X as je } from "lucide-react";
|
|
21
|
+
import { useParams as Me } from "react-router-dom";
|
|
22
|
+
import { Fragment as Ne, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
23
|
+
import { Button as g, GlassCard as _, Input as v, Label as y, ResponsiveDialog as Pe, ResponsiveDialogContent as Fe, ResponsiveDialogDescription as Ie, ResponsiveDialogFooter as Le, ResponsiveDialogHeader as Re, ResponsiveDialogTitle as ze, Switch as Be, Textarea as Ve } from "@burdenoff/fe-libs/ui";
|
|
22
24
|
//#region src/mybodyshield/pages/train/SessionDetailPage.tsx
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
function He(e) {
|
|
26
|
+
if (typeof navigator < "u" && !navigator.onLine || e instanceof TypeError) return !0;
|
|
27
|
+
let t = e instanceof Error ? e.message.toLowerCase() : "";
|
|
28
|
+
return t.includes("failed to fetch") || t.includes("load failed") || t.includes("network");
|
|
29
|
+
}
|
|
30
|
+
function Ue(e, t) {
|
|
31
|
+
let n = e.input;
|
|
32
|
+
return {
|
|
33
|
+
id: `pending-${e.clientActionId}`,
|
|
34
|
+
workspaceId: "",
|
|
35
|
+
sessionId: t,
|
|
36
|
+
exerciseName: n.exerciseName,
|
|
37
|
+
setNumber: n.setNumber ?? 1,
|
|
38
|
+
reps: n.reps ?? 0,
|
|
39
|
+
weight: n.weight ?? 0,
|
|
40
|
+
distanceM: n.distanceM ?? 0,
|
|
41
|
+
durationSec: n.durationSec ?? 0,
|
|
42
|
+
isPersonalRecord: !!n.isPersonalRecord,
|
|
43
|
+
createdAt: e.capturedAt,
|
|
44
|
+
updatedAt: e.capturedAt
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
var We = 90, Ge = [];
|
|
48
|
+
function Ke(e, t, n) {
|
|
25
49
|
return n ? e > n.weight || e === n.weight && t > n.reps : !1;
|
|
26
50
|
}
|
|
27
51
|
var b = [
|
|
@@ -29,7 +53,7 @@ var b = [
|
|
|
29
53
|
1,
|
|
30
54
|
.3,
|
|
31
55
|
1
|
|
32
|
-
],
|
|
56
|
+
], qe = {
|
|
33
57
|
hidden: {},
|
|
34
58
|
show: { transition: { staggerChildren: .06 } }
|
|
35
59
|
}, x = {
|
|
@@ -60,17 +84,23 @@ var C = {
|
|
|
60
84
|
distanceM: "",
|
|
61
85
|
durationSec: "",
|
|
62
86
|
isPersonalRecord: !1
|
|
63
|
-
},
|
|
87
|
+
}, Je = {
|
|
64
88
|
caloriesBurned: "",
|
|
65
89
|
perceivedExertion: "",
|
|
66
90
|
notes: ""
|
|
67
91
|
};
|
|
68
92
|
function w() {
|
|
69
|
-
let { navigateTo: w, workspaceId:
|
|
93
|
+
let { navigateTo: w, workspaceId: Ye } = e(), T = me(), { id: E } = Me();
|
|
70
94
|
fe();
|
|
71
|
-
let D = ue(E), O = le(), k = se(),
|
|
95
|
+
let D = ue(E), O = le(), k = se(), Xe = de(D.data?.workoutId ?? void 0), A = ge((e) => O.mutateAsync(e), (e) => k.mutateAsync(e), () => D.refetch()), [j, Ze] = u([]), M = _e(() => {
|
|
96
|
+
E && he(E).then(Ze);
|
|
97
|
+
}, [E]);
|
|
98
|
+
ve(() => {
|
|
99
|
+
M();
|
|
100
|
+
}, [M, A.pendingCount]);
|
|
101
|
+
let Qe = l(() => E ? j.filter((e) => e.type === "LOG_SET").map((e) => Ue(e, E)) : [], [j, E]), $e = j.some((e) => e.type === "COMPLETE_SESSION"), [et, N] = u(!1), [P, F] = u(C), [tt, I] = u(null), [nt, L] = u(!1), [rt, R] = u(!1), [z, B] = u(Je), [it, V] = u(null), [at, H] = u(null), [ot, st] = u(D.data?.workoutId), [ct, U] = u(null), [lt, W] = u(0), G = ce(P.exerciseName), K = D.data, q = l(() => [...K?.sets ?? [], ...Qe], [K?.sets, Qe]), J = l(() => {
|
|
72
102
|
let e = /* @__PURE__ */ new Map();
|
|
73
|
-
for (let t of
|
|
103
|
+
for (let t of q) {
|
|
74
104
|
let n = e.get(t.exerciseName) ?? [];
|
|
75
105
|
n.push(t), e.set(t.exerciseName, n);
|
|
76
106
|
}
|
|
@@ -78,28 +108,28 @@ function w() {
|
|
|
78
108
|
name: e,
|
|
79
109
|
sets: t.slice().sort((e, t) => e.setNumber - t.setNumber)
|
|
80
110
|
}));
|
|
81
|
-
}, [
|
|
82
|
-
if (!
|
|
83
|
-
let e = new Date(
|
|
111
|
+
}, [q]), ut = l(() => q.reduce((e, t) => e + t.reps * t.weight, 0), [q]), dt = K?.startedAt, ft = K?.completedAt, pt = l(() => {
|
|
112
|
+
if (!dt || !ft) return;
|
|
113
|
+
let e = new Date(dt).getTime(), t = new Date(ft).getTime();
|
|
84
114
|
if (!(!Number.isFinite(e) || !Number.isFinite(t) || t < e)) return (t - e) / 1e3;
|
|
85
|
-
}, [
|
|
115
|
+
}, [dt, ft]), Y = Xe.data ?? Ge, X = l(() => {
|
|
86
116
|
let e = /* @__PURE__ */ new Map();
|
|
87
|
-
for (let t of
|
|
117
|
+
for (let t of J) e.set(t.name, t.sets.length);
|
|
88
118
|
return e;
|
|
89
|
-
}, [
|
|
90
|
-
if (
|
|
91
|
-
let e =
|
|
92
|
-
return e === -1 ?
|
|
93
|
-
}, [
|
|
94
|
-
D.data?.workoutId !==
|
|
95
|
-
if (
|
|
119
|
+
}, [J]), mt = l(() => {
|
|
120
|
+
if (Y.length === 0) return 0;
|
|
121
|
+
let e = Y.findIndex((e) => (X.get(e.name) ?? 0) < Math.max(e.sets, 1));
|
|
122
|
+
return e === -1 ? Y.length - 1 : e;
|
|
123
|
+
}, [Y, X]), Z = Math.min(at ?? mt, Math.max(Y.length - 1, 0)), Q = Y[Z], ht = Y.length > 0 && Y.every((e) => (X.get(e.name) ?? 0) >= Math.max(e.sets, 1));
|
|
124
|
+
D.data?.workoutId !== ot && (st(D.data?.workoutId), H(null)), ve(() => {
|
|
125
|
+
if (ct == null) return;
|
|
96
126
|
let e = window.setInterval(() => {
|
|
97
|
-
let e = Math.max(0, Math.ceil((
|
|
98
|
-
|
|
127
|
+
let e = Math.max(0, Math.ceil((ct - Date.now()) / 1e3));
|
|
128
|
+
W(e), e <= 0 && U(null);
|
|
99
129
|
}, 1e3);
|
|
100
130
|
return () => window.clearInterval(e);
|
|
101
|
-
}, [
|
|
102
|
-
let
|
|
131
|
+
}, [ct]);
|
|
132
|
+
let gt = S(P.weight) ?? 0, _t = S(P.reps) ?? 0, vt = P.exerciseName.trim().length > 0 && Ke(gt, _t, G.data), yt = nt ? P.isPersonalRecord : vt;
|
|
103
133
|
if (!E) return /* @__PURE__ */ m(t, {
|
|
104
134
|
title: "Workout session",
|
|
105
135
|
children: /* @__PURE__ */ m(ae, {
|
|
@@ -111,7 +141,7 @@ function w() {
|
|
|
111
141
|
title: "Workout session",
|
|
112
142
|
children: /* @__PURE__ */ m(oe, { label: "Loading session…" })
|
|
113
143
|
});
|
|
114
|
-
if (D.isError || !
|
|
144
|
+
if (D.isError || !K) return /* @__PURE__ */ m(t, {
|
|
115
145
|
title: "Workout session",
|
|
116
146
|
children: /* @__PURE__ */ m(ae, {
|
|
117
147
|
title: "Session not found",
|
|
@@ -119,37 +149,55 @@ function w() {
|
|
|
119
149
|
onRetry: () => D.refetch()
|
|
120
150
|
})
|
|
121
151
|
});
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
let t =
|
|
126
|
-
|
|
152
|
+
let $ = K.status === "IN_PROGRESS", bt = K.completedAt ? `Completed ${a(K.completedAt)}` : K.startedAt ? `Started ${a(K.startedAt)}` : K.scheduledFor ? `Scheduled ${a(K.scheduledFor)}` : `Created ${a(K.createdAt)}`, xt = () => {
|
|
153
|
+
F(C), I(null), L(!1), N(!0);
|
|
154
|
+
}, St = (e) => {
|
|
155
|
+
let t = X.get(e.name) ?? 0;
|
|
156
|
+
F({
|
|
127
157
|
...C,
|
|
128
158
|
exerciseName: e.name,
|
|
129
159
|
setNumber: String(t + 1),
|
|
130
160
|
reps: e.reps > 0 ? String(e.reps) : "",
|
|
131
161
|
weight: e.targetWeight > 0 ? String(e.targetWeight) : ""
|
|
132
|
-
}),
|
|
162
|
+
}), I(null), L(!1), N(!0);
|
|
133
163
|
};
|
|
134
164
|
return /* @__PURE__ */ h(t, {
|
|
135
165
|
title: "Workout session",
|
|
136
|
-
description:
|
|
137
|
-
actions:
|
|
166
|
+
description: bt,
|
|
167
|
+
actions: $ ? /* @__PURE__ */ h(Ne, { children: [/* @__PURE__ */ h(g, {
|
|
138
168
|
variant: "outline",
|
|
139
|
-
onClick:
|
|
169
|
+
onClick: xt,
|
|
140
170
|
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
|
|
141
171
|
}), /* @__PURE__ */ h(g, {
|
|
142
172
|
onClick: () => {
|
|
143
|
-
|
|
173
|
+
B(Je), V(null), R(!0);
|
|
144
174
|
},
|
|
145
|
-
|
|
175
|
+
disabled: $e,
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ m(xe, { className: "h-4 w-4" }),
|
|
178
|
+
" ",
|
|
179
|
+
$e ? "Pending sync…" : "Complete"
|
|
180
|
+
]
|
|
146
181
|
})] }) : void 0,
|
|
147
182
|
children: [
|
|
148
183
|
/* @__PURE__ */ h("button", {
|
|
149
184
|
type: "button",
|
|
150
185
|
onClick: () => w("train"),
|
|
151
186
|
className: "mb-4 inline-flex items-center gap-1.5 text-sm font-medium text-text-secondary hover:text-text-primary",
|
|
152
|
-
children: [/* @__PURE__ */ m(
|
|
187
|
+
children: [/* @__PURE__ */ m(be, { className: "h-4 w-4" }), " Back to sessions"]
|
|
188
|
+
}),
|
|
189
|
+
(!A.isOnline || j.length > 0) && /* @__PURE__ */ h("div", {
|
|
190
|
+
className: "mb-4 flex items-center gap-2 rounded-xl border border-status-warning-text/40 bg-status-warning-bg-subtle px-4 py-2.5 text-sm text-text-primary",
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ m(Ae, { className: "h-4 w-4 shrink-0 text-status-warning-text" }),
|
|
193
|
+
/* @__PURE__ */ m("span", { children: A.isOnline ? `Syncing ${j.length} queued ${j.length === 1 ? "action" : "actions"}…` : `You're offline — logged sets and completion will sync automatically once you're back online${j.length > 0 ? ` (${j.length} queued)` : ""}.` }),
|
|
194
|
+
A.isOnline && j.length > 0 && /* @__PURE__ */ m(g, {
|
|
195
|
+
variant: "ghost",
|
|
196
|
+
onClick: A.syncNow,
|
|
197
|
+
className: "ml-auto h-7 px-2 text-xs",
|
|
198
|
+
children: "Retry now"
|
|
199
|
+
})
|
|
200
|
+
]
|
|
153
201
|
}),
|
|
154
202
|
/* @__PURE__ */ m(s.div, {
|
|
155
203
|
initial: T ? !1 : {
|
|
@@ -166,7 +214,7 @@ function w() {
|
|
|
166
214
|
},
|
|
167
215
|
children: /* @__PURE__ */ h(_, {
|
|
168
216
|
treatment: "glass",
|
|
169
|
-
glow:
|
|
217
|
+
glow: $,
|
|
170
218
|
className: "p-6",
|
|
171
219
|
children: [
|
|
172
220
|
/* @__PURE__ */ m("div", {
|
|
@@ -174,71 +222,71 @@ function w() {
|
|
|
174
222
|
children: /* @__PURE__ */ h("div", {
|
|
175
223
|
className: "flex items-center gap-3",
|
|
176
224
|
children: [/* @__PURE__ */ m(c, {
|
|
177
|
-
icon: m(
|
|
178
|
-
tint:
|
|
225
|
+
icon: m($ ? we : d, { className: "h-5 w-5" }),
|
|
226
|
+
tint: $ ? "var(--color-accent-teal)" : "var(--color-accent-primary)"
|
|
179
227
|
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
180
228
|
className: "flex items-center gap-2",
|
|
181
|
-
children: /* @__PURE__ */ m(re, { status:
|
|
229
|
+
children: /* @__PURE__ */ m(re, { status: K.status })
|
|
182
230
|
}), /* @__PURE__ */ m("p", {
|
|
183
231
|
className: "mt-1 text-sm text-text-secondary",
|
|
184
|
-
children:
|
|
232
|
+
children: bt
|
|
185
233
|
})] })]
|
|
186
234
|
})
|
|
187
235
|
}),
|
|
188
236
|
/* @__PURE__ */ h("div", {
|
|
189
237
|
className: "mt-5 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
190
238
|
children: [
|
|
191
|
-
|
|
239
|
+
K.scheduledFor && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
192
240
|
className: "text-xs text-text-tertiary",
|
|
193
241
|
children: "Scheduled for"
|
|
194
242
|
}), /* @__PURE__ */ m("p", {
|
|
195
243
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
196
|
-
children: ee(
|
|
244
|
+
children: ee(K.scheduledFor)
|
|
197
245
|
})] }),
|
|
198
|
-
|
|
246
|
+
K.startedAt && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
199
247
|
className: "text-xs text-text-tertiary",
|
|
200
248
|
children: "Started"
|
|
201
249
|
}), /* @__PURE__ */ m("p", {
|
|
202
250
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
203
|
-
children: ee(
|
|
251
|
+
children: ee(K.startedAt)
|
|
204
252
|
})] }),
|
|
205
|
-
|
|
253
|
+
K.completedAt && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
206
254
|
className: "text-xs text-text-tertiary",
|
|
207
255
|
children: "Completed"
|
|
208
256
|
}), /* @__PURE__ */ m("p", {
|
|
209
257
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
210
|
-
children: ee(
|
|
258
|
+
children: ee(K.completedAt)
|
|
211
259
|
})] }),
|
|
212
|
-
|
|
260
|
+
K.perceivedExertion != null && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
213
261
|
className: "text-xs text-text-tertiary",
|
|
214
262
|
children: "Perceived exertion"
|
|
215
263
|
}), /* @__PURE__ */ h("p", {
|
|
216
264
|
className: "mt-0.5 text-sm font-medium tabular-nums text-text-primary",
|
|
217
|
-
children: [
|
|
265
|
+
children: [K.perceivedExertion, "/10 RPE"]
|
|
218
266
|
})] }),
|
|
219
|
-
|
|
267
|
+
K.caloriesBurned > 0 && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
220
268
|
className: "text-xs text-text-tertiary",
|
|
221
269
|
children: "Calories burned"
|
|
222
270
|
}), /* @__PURE__ */ m("p", {
|
|
223
271
|
className: "mt-0.5 text-sm font-medium tabular-nums text-text-primary",
|
|
224
|
-
children: ne(
|
|
272
|
+
children: ne(K.caloriesBurned)
|
|
225
273
|
})] })
|
|
226
274
|
]
|
|
227
275
|
}),
|
|
228
|
-
|
|
276
|
+
K.notes && /* @__PURE__ */ h("div", {
|
|
229
277
|
className: "mt-5 rounded-xl bg-bg-sunken/60 p-4",
|
|
230
278
|
children: [/* @__PURE__ */ m("p", {
|
|
231
279
|
className: "text-xs text-text-tertiary",
|
|
232
280
|
children: "Notes"
|
|
233
281
|
}), /* @__PURE__ */ m("p", {
|
|
234
282
|
className: "mt-1 whitespace-pre-wrap text-sm text-text-secondary",
|
|
235
|
-
children:
|
|
283
|
+
children: K.notes
|
|
236
284
|
})]
|
|
237
285
|
})
|
|
238
286
|
]
|
|
239
287
|
})
|
|
240
288
|
}),
|
|
241
|
-
|
|
289
|
+
$ && lt > 0 && /* @__PURE__ */ m(s.div, {
|
|
242
290
|
initial: T ? !1 : {
|
|
243
291
|
opacity: 0,
|
|
244
292
|
y: -6
|
|
@@ -265,7 +313,7 @@ function w() {
|
|
|
265
313
|
children: "Resting"
|
|
266
314
|
}), /* @__PURE__ */ h("p", {
|
|
267
315
|
className: "text-xs tabular-nums text-text-secondary",
|
|
268
|
-
children: [r(
|
|
316
|
+
children: [r(lt), " remaining"]
|
|
269
317
|
})] })]
|
|
270
318
|
}), /* @__PURE__ */ h("div", {
|
|
271
319
|
className: "flex items-center gap-2",
|
|
@@ -273,21 +321,21 @@ function w() {
|
|
|
273
321
|
variant: "outline",
|
|
274
322
|
size: "sm",
|
|
275
323
|
onClick: () => {
|
|
276
|
-
|
|
324
|
+
U((e) => e && e + 15e3), W((e) => e + 15);
|
|
277
325
|
},
|
|
278
326
|
children: "+15s"
|
|
279
327
|
}), /* @__PURE__ */ h(g, {
|
|
280
328
|
variant: "ghost",
|
|
281
329
|
size: "sm",
|
|
282
330
|
onClick: () => {
|
|
283
|
-
|
|
331
|
+
U(null), W(0);
|
|
284
332
|
},
|
|
285
|
-
children: [/* @__PURE__ */ m(
|
|
333
|
+
children: [/* @__PURE__ */ m(je, { className: "h-4 w-4" }), " Skip"]
|
|
286
334
|
})]
|
|
287
335
|
})]
|
|
288
336
|
})
|
|
289
337
|
}),
|
|
290
|
-
|
|
338
|
+
$ && Y.length > 0 && /* @__PURE__ */ m(s.div, {
|
|
291
339
|
initial: T ? !1 : {
|
|
292
340
|
opacity: 0,
|
|
293
341
|
y: 10
|
|
@@ -309,65 +357,65 @@ function w() {
|
|
|
309
357
|
className: "mb-3 flex items-center justify-between gap-2",
|
|
310
358
|
children: [/* @__PURE__ */ h("div", {
|
|
311
359
|
className: "flex items-center gap-2.5",
|
|
312
|
-
children: [/* @__PURE__ */ m(c, { icon: /* @__PURE__ */ m(
|
|
360
|
+
children: [/* @__PURE__ */ m(c, { icon: /* @__PURE__ */ m(Ee, { className: "h-4 w-4" }) }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h3", {
|
|
313
361
|
className: "text-sm font-semibold text-text-primary",
|
|
314
362
|
children: "Guided workout"
|
|
315
363
|
}), /* @__PURE__ */ m("p", {
|
|
316
364
|
className: "text-xs text-text-secondary",
|
|
317
|
-
children:
|
|
365
|
+
children: ht ? "All planned exercises logged — nice work." : `Exercise ${Z + 1} of ${Y.length}`
|
|
318
366
|
})] })]
|
|
319
367
|
}), /* @__PURE__ */ h("div", {
|
|
320
368
|
className: "flex items-center gap-1.5",
|
|
321
369
|
children: [/* @__PURE__ */ m(g, {
|
|
322
370
|
variant: "outline",
|
|
323
371
|
size: "sm",
|
|
324
|
-
onClick: () =>
|
|
325
|
-
disabled:
|
|
372
|
+
onClick: () => H(Math.max(Z - 1, 0)),
|
|
373
|
+
disabled: Z === 0,
|
|
326
374
|
"aria-label": "Previous exercise",
|
|
327
|
-
children: /* @__PURE__ */ m(
|
|
375
|
+
children: /* @__PURE__ */ m(Se, { className: "h-4 w-4" })
|
|
328
376
|
}), /* @__PURE__ */ m(g, {
|
|
329
377
|
variant: "outline",
|
|
330
378
|
size: "sm",
|
|
331
|
-
onClick: () =>
|
|
332
|
-
disabled:
|
|
379
|
+
onClick: () => H(Math.min(Z + 1, Y.length - 1)),
|
|
380
|
+
disabled: Z >= Y.length - 1,
|
|
333
381
|
"aria-label": "Next exercise",
|
|
334
|
-
children: /* @__PURE__ */ m(
|
|
382
|
+
children: /* @__PURE__ */ m(Ce, { className: "h-4 w-4" })
|
|
335
383
|
})]
|
|
336
384
|
})]
|
|
337
|
-
}),
|
|
385
|
+
}), Q && /* @__PURE__ */ h("div", {
|
|
338
386
|
className: "flex flex-wrap items-center justify-between gap-3 rounded-xl bg-bg-sunken/60 p-3",
|
|
339
387
|
children: [/* @__PURE__ */ h("div", { children: [
|
|
340
388
|
/* @__PURE__ */ m("p", {
|
|
341
389
|
className: "text-sm font-semibold text-text-primary",
|
|
342
|
-
children:
|
|
390
|
+
children: Q.name
|
|
343
391
|
}),
|
|
344
392
|
/* @__PURE__ */ h("p", {
|
|
345
393
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
346
394
|
children: [
|
|
347
|
-
te(
|
|
395
|
+
te(Q.muscleGroup),
|
|
348
396
|
" · ",
|
|
349
|
-
|
|
397
|
+
Q.sets,
|
|
350
398
|
" ×",
|
|
351
399
|
" ",
|
|
352
|
-
|
|
400
|
+
Q.reps,
|
|
353
401
|
" reps",
|
|
354
|
-
|
|
355
|
-
|
|
402
|
+
Q.targetWeight > 0 ? ` @ ${o(Q.targetWeight)}` : "",
|
|
403
|
+
Q.restSeconds > 0 ? ` · ${r(Q.restSeconds)} rest` : ""
|
|
356
404
|
]
|
|
357
405
|
}),
|
|
358
406
|
/* @__PURE__ */ h("p", {
|
|
359
407
|
className: "mt-0.5 text-xs tabular-nums text-text-tertiary",
|
|
360
408
|
children: [
|
|
361
|
-
|
|
409
|
+
X.get(Q.name) ?? 0,
|
|
362
410
|
" of",
|
|
363
411
|
" ",
|
|
364
|
-
Math.max(
|
|
412
|
+
Math.max(Q.sets, 1),
|
|
365
413
|
" sets logged"
|
|
366
414
|
]
|
|
367
415
|
})
|
|
368
416
|
] }), /* @__PURE__ */ h(g, {
|
|
369
417
|
size: "sm",
|
|
370
|
-
onClick: () =>
|
|
418
|
+
onClick: () => St(Q),
|
|
371
419
|
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log this exercise"]
|
|
372
420
|
})]
|
|
373
421
|
})]
|
|
@@ -375,7 +423,7 @@ function w() {
|
|
|
375
423
|
}),
|
|
376
424
|
/* @__PURE__ */ h(s.div, {
|
|
377
425
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
378
|
-
variants: T ? void 0 :
|
|
426
|
+
variants: T ? void 0 : qe,
|
|
379
427
|
initial: T ? !1 : "hidden",
|
|
380
428
|
animate: "show",
|
|
381
429
|
children: [
|
|
@@ -386,7 +434,7 @@ function w() {
|
|
|
386
434
|
className: "text-action-primary-bg",
|
|
387
435
|
children: /* @__PURE__ */ m(d, { className: "h-5 w-5" })
|
|
388
436
|
}),
|
|
389
|
-
value: i(
|
|
437
|
+
value: i(q.length),
|
|
390
438
|
label: "Total sets"
|
|
391
439
|
})
|
|
392
440
|
}),
|
|
@@ -395,9 +443,9 @@ function w() {
|
|
|
395
443
|
children: /* @__PURE__ */ m(n, {
|
|
396
444
|
icon: /* @__PURE__ */ m("span", {
|
|
397
445
|
className: "text-action-primary-bg",
|
|
398
|
-
children: /* @__PURE__ */ m(
|
|
446
|
+
children: /* @__PURE__ */ m(ke, { className: "h-5 w-5" })
|
|
399
447
|
}),
|
|
400
|
-
value: `${i(
|
|
448
|
+
value: `${i(ut)} kg`,
|
|
401
449
|
label: "Total volume"
|
|
402
450
|
})
|
|
403
451
|
}),
|
|
@@ -408,7 +456,7 @@ function w() {
|
|
|
408
456
|
className: "text-action-primary-bg",
|
|
409
457
|
children: /* @__PURE__ */ m(p, { className: "h-5 w-5" })
|
|
410
458
|
}),
|
|
411
|
-
value:
|
|
459
|
+
value: pt == null ? "—" : r(pt),
|
|
412
460
|
label: "Duration"
|
|
413
461
|
})
|
|
414
462
|
}),
|
|
@@ -417,9 +465,9 @@ function w() {
|
|
|
417
465
|
children: /* @__PURE__ */ m(n, {
|
|
418
466
|
icon: /* @__PURE__ */ m("span", {
|
|
419
467
|
className: "text-action-primary-bg",
|
|
420
|
-
children: /* @__PURE__ */ m(
|
|
468
|
+
children: /* @__PURE__ */ m(we, { className: "h-5 w-5" })
|
|
421
469
|
}),
|
|
422
|
-
value:
|
|
470
|
+
value: K.caloriesBurned > 0 ? ne(K.caloriesBurned) : "—",
|
|
423
471
|
label: "Calories burned"
|
|
424
472
|
})
|
|
425
473
|
})
|
|
@@ -435,28 +483,28 @@ function w() {
|
|
|
435
483
|
}), /* @__PURE__ */ m("p", {
|
|
436
484
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
437
485
|
children: "Every set recorded during this session, grouped by exercise."
|
|
438
|
-
})] }),
|
|
486
|
+
})] }), $ && /* @__PURE__ */ h(g, {
|
|
439
487
|
variant: "outline",
|
|
440
488
|
size: "sm",
|
|
441
|
-
onClick:
|
|
489
|
+
onClick: xt,
|
|
442
490
|
className: "shrink-0",
|
|
443
491
|
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
|
|
444
492
|
})]
|
|
445
|
-
}),
|
|
493
|
+
}), J.length === 0 ? /* @__PURE__ */ m(ie, {
|
|
446
494
|
illustration: "empty-data",
|
|
447
495
|
icon: /* @__PURE__ */ m(d, { className: "h-10 w-10" }),
|
|
448
496
|
title: "No sets logged yet",
|
|
449
|
-
description:
|
|
450
|
-
action:
|
|
451
|
-
onClick:
|
|
497
|
+
description: $ ? "Log your first set to start tracking this workout." : "No sets were recorded for this session.",
|
|
498
|
+
action: $ ? /* @__PURE__ */ h(g, {
|
|
499
|
+
onClick: xt,
|
|
452
500
|
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), " Log set"]
|
|
453
501
|
}) : void 0
|
|
454
502
|
}) : /* @__PURE__ */ m(s.div, {
|
|
455
503
|
className: "space-y-4",
|
|
456
|
-
variants: T ? void 0 :
|
|
504
|
+
variants: T ? void 0 : qe,
|
|
457
505
|
initial: T ? !1 : "hidden",
|
|
458
506
|
animate: "show",
|
|
459
|
-
children:
|
|
507
|
+
children: J.map((e) => {
|
|
460
508
|
let t = e.sets.filter((e) => e.isPersonalRecord).length;
|
|
461
509
|
return /* @__PURE__ */ m(s.div, {
|
|
462
510
|
variants: T ? void 0 : x,
|
|
@@ -521,7 +569,7 @@ function w() {
|
|
|
521
569
|
}), t && e.distanceM > 0 && /* @__PURE__ */ h("span", {
|
|
522
570
|
className: "inline-flex items-center gap-1 tabular-nums",
|
|
523
571
|
children: [
|
|
524
|
-
/* @__PURE__ */ m(
|
|
572
|
+
/* @__PURE__ */ m(De, { className: "h-3.5 w-3.5 text-accent" }),
|
|
525
573
|
i(e.distanceM),
|
|
526
574
|
" m"
|
|
527
575
|
]
|
|
@@ -539,16 +587,16 @@ function w() {
|
|
|
539
587
|
className: "mt-8",
|
|
540
588
|
children: /* @__PURE__ */ m(pe, {
|
|
541
589
|
entityType: "mybodyshield-session",
|
|
542
|
-
entityId:
|
|
590
|
+
entityId: K.id,
|
|
543
591
|
title: "Coach feedback",
|
|
544
592
|
description: "Discuss form, cues and this session's results with your coach and team."
|
|
545
593
|
})
|
|
546
594
|
}),
|
|
547
|
-
/* @__PURE__ */ m(
|
|
548
|
-
open:
|
|
549
|
-
onOpenChange:
|
|
550
|
-
children: /* @__PURE__ */ h(
|
|
551
|
-
/* @__PURE__ */ h(
|
|
595
|
+
/* @__PURE__ */ m(Pe, {
|
|
596
|
+
open: et,
|
|
597
|
+
onOpenChange: N,
|
|
598
|
+
children: /* @__PURE__ */ h(Fe, { children: [
|
|
599
|
+
/* @__PURE__ */ h(Re, { children: [/* @__PURE__ */ m(ze, { children: "Log a set" }), /* @__PURE__ */ m(Ie, { children: "Record reps and load for strength work, or duration and distance for cardio. The dialog stays open so you can log sets back-to-back." })] }),
|
|
552
600
|
/* @__PURE__ */ h("div", {
|
|
553
601
|
className: "space-y-4 px-1",
|
|
554
602
|
children: [
|
|
@@ -559,13 +607,13 @@ function w() {
|
|
|
559
607
|
children: "Exercise"
|
|
560
608
|
}), /* @__PURE__ */ m(v, {
|
|
561
609
|
id: "myb-set-exercise",
|
|
562
|
-
value:
|
|
610
|
+
value: P.exerciseName,
|
|
563
611
|
onChange: (e) => {
|
|
564
612
|
let t = e.target.value;
|
|
565
|
-
|
|
613
|
+
F((e) => ({
|
|
566
614
|
...e,
|
|
567
615
|
exerciseName: t
|
|
568
|
-
})),
|
|
616
|
+
})), L(!1);
|
|
569
617
|
},
|
|
570
618
|
placeholder: "e.g. Back Squat"
|
|
571
619
|
})]
|
|
@@ -583,8 +631,8 @@ function w() {
|
|
|
583
631
|
type: "number",
|
|
584
632
|
inputMode: "numeric",
|
|
585
633
|
min: 1,
|
|
586
|
-
value:
|
|
587
|
-
onChange: (e) =>
|
|
634
|
+
value: P.setNumber,
|
|
635
|
+
onChange: (e) => F((t) => ({
|
|
588
636
|
...t,
|
|
589
637
|
setNumber: e.target.value
|
|
590
638
|
})),
|
|
@@ -601,8 +649,8 @@ function w() {
|
|
|
601
649
|
type: "number",
|
|
602
650
|
inputMode: "numeric",
|
|
603
651
|
min: 0,
|
|
604
|
-
value:
|
|
605
|
-
onChange: (e) =>
|
|
652
|
+
value: P.reps,
|
|
653
|
+
onChange: (e) => F((t) => ({
|
|
606
654
|
...t,
|
|
607
655
|
reps: e.target.value
|
|
608
656
|
})),
|
|
@@ -620,8 +668,8 @@ function w() {
|
|
|
620
668
|
inputMode: "decimal",
|
|
621
669
|
min: 0,
|
|
622
670
|
step: "0.5",
|
|
623
|
-
value:
|
|
624
|
-
onChange: (e) =>
|
|
671
|
+
value: P.weight,
|
|
672
|
+
onChange: (e) => F((t) => ({
|
|
625
673
|
...t,
|
|
626
674
|
weight: e.target.value
|
|
627
675
|
})),
|
|
@@ -638,8 +686,8 @@ function w() {
|
|
|
638
686
|
type: "number",
|
|
639
687
|
inputMode: "numeric",
|
|
640
688
|
min: 0,
|
|
641
|
-
value:
|
|
642
|
-
onChange: (e) =>
|
|
689
|
+
value: P.distanceM,
|
|
690
|
+
onChange: (e) => F((t) => ({
|
|
643
691
|
...t,
|
|
644
692
|
distanceM: e.target.value
|
|
645
693
|
})),
|
|
@@ -656,8 +704,8 @@ function w() {
|
|
|
656
704
|
type: "number",
|
|
657
705
|
inputMode: "numeric",
|
|
658
706
|
min: 0,
|
|
659
|
-
value:
|
|
660
|
-
onChange: (e) =>
|
|
707
|
+
value: P.durationSec,
|
|
708
|
+
onChange: (e) => F((t) => ({
|
|
661
709
|
...t,
|
|
662
710
|
durationSec: e.target.value
|
|
663
711
|
})),
|
|
@@ -670,63 +718,75 @@ function w() {
|
|
|
670
718
|
className: "flex items-center justify-between gap-3 rounded-xl bg-bg-sunken/60 p-3",
|
|
671
719
|
children: [/* @__PURE__ */ h("div", {
|
|
672
720
|
className: "flex items-center gap-2",
|
|
673
|
-
children: [
|
|
721
|
+
children: [yt ? /* @__PURE__ */ m(Oe, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ m(Te, { className: "h-4 w-4 text-accent" }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m(y, {
|
|
674
722
|
htmlFor: "myb-set-pr",
|
|
675
723
|
className: "cursor-pointer",
|
|
676
724
|
children: "Personal record"
|
|
677
725
|
}), /* @__PURE__ */ m("p", {
|
|
678
726
|
className: "text-xs text-text-tertiary",
|
|
679
|
-
children:
|
|
727
|
+
children: G.data ? `Auto-detected against your best: ${i(G.data.reps)} × ${o(G.data.weight)}.` : P.exerciseName.trim() ? "First time logging this exercise — nothing to compare yet." : "Flag this set as a new PR."
|
|
680
728
|
})] })]
|
|
681
|
-
}), /* @__PURE__ */ m(
|
|
729
|
+
}), /* @__PURE__ */ m(Be, {
|
|
682
730
|
id: "myb-set-pr",
|
|
683
|
-
checked:
|
|
731
|
+
checked: yt,
|
|
684
732
|
onCheckedChange: (e) => {
|
|
685
|
-
|
|
733
|
+
L(!0), F((t) => ({
|
|
686
734
|
...t,
|
|
687
735
|
isPersonalRecord: e
|
|
688
736
|
}));
|
|
689
737
|
}
|
|
690
738
|
})]
|
|
691
739
|
}),
|
|
692
|
-
|
|
740
|
+
tt && /* @__PURE__ */ m("p", {
|
|
693
741
|
className: "text-sm text-status-error-text",
|
|
694
|
-
children:
|
|
742
|
+
children: tt
|
|
695
743
|
})
|
|
696
744
|
]
|
|
697
745
|
}),
|
|
698
|
-
/* @__PURE__ */ h(
|
|
746
|
+
/* @__PURE__ */ h(Le, { children: [/* @__PURE__ */ m(g, {
|
|
699
747
|
variant: "outline",
|
|
700
|
-
onClick: () =>
|
|
748
|
+
onClick: () => N(!1),
|
|
701
749
|
children: "Done"
|
|
702
750
|
}), /* @__PURE__ */ m(g, {
|
|
703
751
|
onClick: async () => {
|
|
704
|
-
|
|
705
|
-
let e =
|
|
752
|
+
I(null);
|
|
753
|
+
let e = P.exerciseName.trim();
|
|
706
754
|
if (!e) {
|
|
707
|
-
|
|
755
|
+
I("Exercise name is required.");
|
|
708
756
|
return;
|
|
709
757
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
});
|
|
721
|
-
M({
|
|
758
|
+
let t = {
|
|
759
|
+
exerciseName: e,
|
|
760
|
+
setNumber: S(P.setNumber),
|
|
761
|
+
reps: S(P.reps),
|
|
762
|
+
weight: S(P.weight),
|
|
763
|
+
distanceM: S(P.distanceM),
|
|
764
|
+
durationSec: S(P.durationSec),
|
|
765
|
+
isPersonalRecord: yt
|
|
766
|
+
}, n = (t) => {
|
|
767
|
+
F({
|
|
722
768
|
...C,
|
|
723
769
|
exerciseName: e,
|
|
724
|
-
setNumber: String(t
|
|
725
|
-
}),
|
|
726
|
-
let n =
|
|
727
|
-
|
|
770
|
+
setNumber: String(t)
|
|
771
|
+
}), L(!1);
|
|
772
|
+
let n = Q && Q.name === e && Q.restSeconds > 0 ? Q.restSeconds : We;
|
|
773
|
+
U(Date.now() + n * 1e3), W(n);
|
|
774
|
+
};
|
|
775
|
+
if (!A.isOnline) {
|
|
776
|
+
await A.enqueueLogSet(E, t), M(), n((S(P.setNumber) ?? q.length) + 1);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
try {
|
|
780
|
+
n((await O.mutateAsync({
|
|
781
|
+
sessionId: E,
|
|
782
|
+
...t
|
|
783
|
+
})).setNumber + 1);
|
|
728
784
|
} catch (e) {
|
|
729
|
-
|
|
785
|
+
if (He(e)) {
|
|
786
|
+
await A.enqueueLogSet(E, t), M(), n((S(P.setNumber) ?? q.length) + 1);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
I(e instanceof Error ? e.message : "Failed to log the set.");
|
|
730
790
|
}
|
|
731
791
|
},
|
|
732
792
|
disabled: O.isPending,
|
|
@@ -734,17 +794,17 @@ function w() {
|
|
|
734
794
|
})] })
|
|
735
795
|
] })
|
|
736
796
|
}),
|
|
737
|
-
/* @__PURE__ */ m(
|
|
738
|
-
open:
|
|
739
|
-
onOpenChange:
|
|
740
|
-
children: /* @__PURE__ */ h(
|
|
741
|
-
/* @__PURE__ */ h(
|
|
797
|
+
/* @__PURE__ */ m(Pe, {
|
|
798
|
+
open: rt,
|
|
799
|
+
onOpenChange: R,
|
|
800
|
+
children: /* @__PURE__ */ h(Fe, { children: [
|
|
801
|
+
/* @__PURE__ */ h(Re, { children: [/* @__PURE__ */ m(ze, { children: "Complete session" }), /* @__PURE__ */ m(Ie, { children: "Wrap up this workout and record how it went." })] }),
|
|
742
802
|
/* @__PURE__ */ h("div", {
|
|
743
803
|
className: "space-y-4 px-1",
|
|
744
804
|
children: [
|
|
745
|
-
|
|
805
|
+
q.length === 0 && /* @__PURE__ */ h("div", {
|
|
746
806
|
className: "flex items-start gap-2.5 rounded-xl border border-status-warning-text/40 bg-status-warning-bg-subtle p-3",
|
|
747
|
-
children: [/* @__PURE__ */ m(
|
|
807
|
+
children: [/* @__PURE__ */ m(ye, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ h("p", {
|
|
748
808
|
className: "text-sm text-text-secondary",
|
|
749
809
|
children: [/* @__PURE__ */ m("span", {
|
|
750
810
|
className: "font-medium text-text-primary",
|
|
@@ -764,8 +824,8 @@ function w() {
|
|
|
764
824
|
type: "number",
|
|
765
825
|
inputMode: "numeric",
|
|
766
826
|
min: 0,
|
|
767
|
-
value:
|
|
768
|
-
onChange: (e) =>
|
|
827
|
+
value: z.caloriesBurned,
|
|
828
|
+
onChange: (e) => B((t) => ({
|
|
769
829
|
...t,
|
|
770
830
|
caloriesBurned: e.target.value
|
|
771
831
|
})),
|
|
@@ -782,8 +842,8 @@ function w() {
|
|
|
782
842
|
inputMode: "numeric",
|
|
783
843
|
min: 1,
|
|
784
844
|
max: 10,
|
|
785
|
-
value:
|
|
786
|
-
onChange: (e) =>
|
|
845
|
+
value: z.perceivedExertion,
|
|
846
|
+
onChange: (e) => B((t) => ({
|
|
787
847
|
...t,
|
|
788
848
|
perceivedExertion: e.target.value
|
|
789
849
|
})),
|
|
@@ -796,41 +856,50 @@ function w() {
|
|
|
796
856
|
children: [/* @__PURE__ */ m(y, {
|
|
797
857
|
htmlFor: "myb-complete-notes",
|
|
798
858
|
children: "Notes"
|
|
799
|
-
}), /* @__PURE__ */ m(
|
|
859
|
+
}), /* @__PURE__ */ m(Ve, {
|
|
800
860
|
id: "myb-complete-notes",
|
|
801
861
|
rows: 3,
|
|
802
|
-
value:
|
|
803
|
-
onChange: (e) =>
|
|
862
|
+
value: z.notes,
|
|
863
|
+
onChange: (e) => B((t) => ({
|
|
804
864
|
...t,
|
|
805
865
|
notes: e.target.value
|
|
806
866
|
})),
|
|
807
867
|
placeholder: "How did the session feel?"
|
|
808
868
|
})]
|
|
809
869
|
}),
|
|
810
|
-
|
|
870
|
+
it && /* @__PURE__ */ m("p", {
|
|
811
871
|
className: "text-sm text-status-error-text",
|
|
812
|
-
children:
|
|
872
|
+
children: it
|
|
813
873
|
})
|
|
814
874
|
]
|
|
815
875
|
}),
|
|
816
|
-
/* @__PURE__ */ h(
|
|
876
|
+
/* @__PURE__ */ h(Le, { children: [/* @__PURE__ */ m(g, {
|
|
817
877
|
variant: "outline",
|
|
818
|
-
onClick: () =>
|
|
878
|
+
onClick: () => R(!1),
|
|
819
879
|
children: "Cancel"
|
|
820
880
|
}), /* @__PURE__ */ m(g, {
|
|
821
881
|
onClick: async () => {
|
|
822
|
-
|
|
882
|
+
V(null);
|
|
883
|
+
let e = {
|
|
884
|
+
caloriesBurned: S(z.caloriesBurned),
|
|
885
|
+
perceivedExertion: S(z.perceivedExertion),
|
|
886
|
+
notes: z.notes.trim() ? z.notes.trim() : void 0
|
|
887
|
+
};
|
|
888
|
+
if (!A.isOnline) {
|
|
889
|
+
await A.enqueueCompleteSession(E, e), M(), R(!1);
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
823
892
|
try {
|
|
824
893
|
await k.mutateAsync({
|
|
825
894
|
id: E,
|
|
826
|
-
input:
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
895
|
+
input: e
|
|
896
|
+
}), R(!1);
|
|
897
|
+
} catch (t) {
|
|
898
|
+
if (He(t)) {
|
|
899
|
+
await A.enqueueCompleteSession(E, e), M(), R(!1);
|
|
900
|
+
return;
|
|
901
|
+
}
|
|
902
|
+
V(t instanceof Error ? t.message : "Failed to complete the session.");
|
|
834
903
|
}
|
|
835
904
|
},
|
|
836
905
|
disabled: k.isPending,
|