@aneuhold/core-ts-db-lib 4.1.13 → 4.1.15

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 (28) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/ctos/workout/WorkoutMuscleGroupVolumeCTO.d.ts +1 -1
  3. package/lib/ctos/workout/WorkoutMuscleGroupVolumeCTO.d.ts.map +1 -1
  4. package/lib/ctos/workout/WorkoutMuscleGroupVolumeCTO.ts +1 -1
  5. package/lib/documents/workout/README.md +43 -9
  6. package/lib/documents/workout/WorkoutSet.d.ts +9 -6
  7. package/lib/documents/workout/WorkoutSet.d.ts.map +1 -1
  8. package/lib/documents/workout/WorkoutSet.ts +9 -6
  9. package/lib/services/workout/Exercise/WorkoutExerciseService.d.ts +17 -19
  10. package/lib/services/workout/Exercise/WorkoutExerciseService.d.ts.map +1 -1
  11. package/lib/services/workout/Exercise/WorkoutExerciseService.js +53 -87
  12. package/lib/services/workout/Exercise/WorkoutExerciseService.js.map +1 -1
  13. package/lib/services/workout/Exercise/WorkoutExerciseService.ts +57 -107
  14. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.d.ts +6 -2
  15. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.d.ts.map +1 -1
  16. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.js +7 -0
  17. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.js.map +1 -1
  18. package/lib/services/workout/Mesocycle/WorkoutMesocyclePlanContext.ts +13 -2
  19. package/lib/services/workout/Set/WorkoutSetService.d.ts.map +1 -1
  20. package/lib/services/workout/Set/WorkoutSetService.js +2 -3
  21. package/lib/services/workout/Set/WorkoutSetService.js.map +1 -1
  22. package/lib/services/workout/Set/WorkoutSetService.ts +2 -3
  23. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.d.ts +136 -56
  24. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.d.ts.map +1 -1
  25. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.js +304 -254
  26. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.js.map +1 -1
  27. package/lib/services/workout/util/VolumePlanning/WorkoutVolumePlanningService.ts +471 -330
  28. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 🔖 [4.1.15] (2026-03-12)
9
+
10
+ ### 🏗️ Changed
11
+
12
+ - `CompletedWorkoutSet` type refined to only require planned and actual performance fields (`plannedReps`, `plannedWeight`, `plannedRir`, `actualReps`, `actualWeight`, `rir`) to be non-nullable, rather than all fields.
13
+ - `WorkoutExerciseService.calculateTargetRepsAndWeightForFirstSet` no longer accepts a `microcycleIndex` parameter; all microcycle-to-microcycle progression is now handled by autoregulation/forecasting from the previous set.
14
+ - Replaced `hasCompleteAutoRegulationData` with `toCompletedSet`, which converts a `WorkoutSet` to a `CompletedWorkoutSet` and forecasts planned-only sets (surplus = 0) so progression continues smoothly even without actual performance data.
15
+ - `calculateCalibrationBasedTargets` now computes initial targets only (no microcycle loops); it is used exclusively when no previous set exists.
16
+ - `WorkoutSetService` no longer passes `microcycleIndex` to `calculateTargetRepsAndWeightForFirstSet`.
17
+
18
+ ## 🔖 [4.1.14] (2026-03-07)
19
+
20
+ ### 🏗️ Changed
21
+
22
+ - Refactored `WorkoutVolumePlanningService` into a cleaner multi-step pipeline with dedicated extracted methods: `getVolumeTargetsForMuscleGroup`, `calculateBaselineSetCounts`, `distributeEvenly`, `resolveHistoricalExerciseData`, `applyHistoricalSetCounts`, `evaluateSfrRecommendations`, `distributeSetsToExercises`, `sessionIsCapped`, `getSessionSetTotal`, and `addSetsToExercise`.
23
+ - `WorkoutMesocyclePlanContext` now exposes `accumulationMicrocycleCount` (total microcycles minus the deload, when applicable).
24
+ - `WorkoutVolumeLandmarkEstimate.estimatedMev` now represents total sets per microcycle for the muscle group, not per session.
25
+ - Default volume constants renamed: `DEFAULT_MEV` → `DEFAULT_MEV_PER_EXERCISE`, `DEFAULT_MRV` → `DEFAULT_MRV_PER_EXERCISE`.
26
+ - Cut cycle baseline progression now targets MAV (midpoint) instead of MRV.
27
+ - MAV for exercises returning from recovery is now distributed evenly across all exercises in the muscle group using floor-based distribution.
28
+ - MRV estimate is no longer hard-capped at `MAX_SETS_PER_MUSCLE_GROUP_PER_SESSION` in `estimateVolumeLandmarks()`.
29
+
30
+ ### 🔥 Removed
31
+
32
+ - Removed `WorkoutVolumePlanningService.evaluateMevProximity()` static method and the associated second-microcycle MEV proximity adjustment logic.
33
+
8
34
  ## 🔖 [4.1.13] (2026-02-28)
9
35
 
10
36
  ### ✅ Added
@@ -359,6 +385,8 @@ Updated dependency: now requires `@aneuhold/core-ts-lib@^2.3.11`.
359
385
 
360
386
  <!-- Link References -->
361
387
 
388
+ [4.1.15]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v4.1.14...core-ts-db-lib-v4.1.15
389
+ [4.1.14]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v4.1.13...core-ts-db-lib-v4.1.14
362
390
  [4.1.13]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v4.1.12...core-ts-db-lib-v4.1.13
363
391
  [4.1.12]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v4.1.11...core-ts-db-lib-v4.1.12
364
392
  [4.1.11]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v4.1.10...core-ts-db-lib-v4.1.11
@@ -38,7 +38,7 @@ export type WorkoutMuscleGroupVolumeCTO = z.infer<typeof WorkoutMuscleGroupVolum
38
38
  * from historical mesocycle data.
39
39
  */
40
40
  export type WorkoutVolumeLandmarkEstimate = {
41
- /** Estimated minimum effective volume (sets per muscle group per session). */
41
+ /** Estimated minimum effective volume (sets per microcycle for this muscle group). */
42
42
  estimatedMev: number;
43
43
  /** Estimated maximum recoverable volume. */
44
44
  estimatedMrv: number;
@@ -1 +1 @@
1
- {"version":3,"file":"WorkoutMuscleGroupVolumeCTO.d.ts","sourceRoot":"","sources":["../../../src/ctos/workout/WorkoutMuscleGroupVolumeCTO.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;iBAS5C,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;IAErB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IAErB,mEAAmE;IACnE,YAAY,EAAE,MAAM,CAAC;IAErB,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"WorkoutMuscleGroupVolumeCTO.d.ts","sourceRoot":"","sources":["../../../src/ctos/workout/WorkoutMuscleGroupVolumeCTO.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;iBAS5C,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,sFAAsF;IACtF,YAAY,EAAE,MAAM,CAAC;IAErB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IAErB,mEAAmE;IACnE,YAAY,EAAE,MAAM,CAAC;IAErB,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -33,7 +33,7 @@ export type WorkoutMuscleGroupVolumeCTO = z.infer<typeof WorkoutMuscleGroupVolum
33
33
  * from historical mesocycle data.
34
34
  */
35
35
  export type WorkoutVolumeLandmarkEstimate = {
36
- /** Estimated minimum effective volume (sets per muscle group per session). */
36
+ /** Estimated minimum effective volume (sets per microcycle for this muscle group). */
37
37
  estimatedMev: number;
38
38
 
39
39
  /** Estimated maximum recoverable volume. */
@@ -243,8 +243,10 @@ These are requirements that were developed after taking all the notes in the mor
243
243
  - **Reps in Reserve (RIR)** (pg 30): Reps in Reserve are the set's proximity to muscle failure. In other words, how many reps do you have left before you completely fail to produce the movement.
244
244
  - **Effective Sets** (pg 33): Effective sets are a set that is done within 5-30 reps, and within 0-5 RIR.
245
245
  - **Volume** (pg 34+): From page 34 and onwards, the book discusses volume as the number of effective sets. Even though this isn't the technical definition, everything averages out as long as you are using effective sets.
246
+ - **Maintenance Volume (MV)** (pg. 34): The minimum volume necessary to avoid muscle loss. Training below this volume (or not training at all), will result in a loss of muscle over time.
246
247
  - **Minimum Effective Volume (MEV)** (pg. 34): The minimum volume which leads to muscle growth. This varies by age, training experience, and existing muscle mass. As you get stronger / bigger, this gets higher.
247
- - **Maximum Recoverable Volume (MRV)** (pg. 34,117): The maximum volume that can be done before muscle loss begins.
248
+ - **Maximum Adaptive Volume (MAV)** (pg. 34): The amount of training which at any given time provides the greatest muscle growth per unit of time. It shifts over the course of a mesocycle as fatigue accumulates and volume sensitivity changes. When looking at the chart on page 34, this it the "peak" of growth.
249
+ - **Maximum Recoverable Volume (MRV)** (pg. 34,117): The maximum volume that can be done before muscle loss begins. Detected in practice by under-performing two sessions in a row (a drop in reps at any given RIR compared to last week, even adjusted for potentially increased load).
248
250
  - **Raw Stimulus Magnitude (RSM)** (pg. 50-53): RSM is the amount of muscle growth stimulus any given Workout Session gives.
249
251
  - **Microcycle**: The shortest cycle of training that includes all workout sessions and rest days and is repeated. Typically, but not always, this is a week.
250
252
  - **Mesocycle**: An organized sequence of microcycles ordered to elicit a set of distinct training adaptations. The typical mesocycle is composed of two distinct phases: an accumulation phase, and a shorter deload phase.
@@ -363,16 +365,16 @@ To get your MEV, do the RSM calculation for the first 2-3 days of the mesocycle.
363
365
  | 0–1 | Stimulus likely below MEV | Increase volume the following week by two to four sets |
364
366
  | 2–3 | Stimulus likely at or below MEV | Increase volume the following week by two to four sets |
365
367
  | 4–6 | Stimulus likely at or just above MEV (a great place to start your mesocycle) | Progress normally |
366
- | 7–9 | Stimulus likely between MEV and MRV, possibly exceeding MRV | Drop volume the following week |
368
+ | 7–9 | Stimulus likely between MEV and MRV, possibly exceeding MRV | Drop volume the following week (this is handled by recovery sessions) |
367
369
 
368
370
  After you get this information, go ahead and finish out the first week at MEV, then calculate how you should progress by answering the following questions:
369
371
 
370
- On a scale of 0-3 how sore did you get in the target muscle group?
372
+ On a scale of 0-3 how sore did you get in the target muscles?
371
373
 
372
- - 0: You did not get at all sore in the target muscle group
373
- - 1: You got stiff for a few hours after training and had mild soreness in the target muscle group that resolved by next session targeting the same muscle group
374
- - 2: You got DOMS in the target muscle group that resolved just in time for the next session targeting the same muscle group
375
- - 3: You got DOMS in the target muscle group that remained for the next session targeting the same muscle group
374
+ - 0: You did not get at all sore in the target muscles
375
+ - 1: You got stiff for a few hours after training and had mild soreness in the target muscles that resolved by next session targeting the same muscles
376
+ - 2: You got DOMS in the target muscles that resolved just in time for the next session targeting the same muscles
377
+ - 3: You got DOMS in the target muscles that remained for the next session targeting the same muscles
376
378
 
377
379
  On a scale of 0-3 how was your performance?
378
380
 
@@ -402,6 +404,10 @@ The user can choose how they want to progress between two types of progression f
402
404
  - Load Progression: Add the lowest increment available for the weight that the exercise uses each week, within reason. Like if someone is lifting 300lbs, then perhaps increase by 10 lbs instead of 5lbs. A good rule of thumb is if the weight increase is less than 2% of the overall weight, then use the next higher increment available to get at, or above a 2% increase in the weight.
403
405
  - Rep Progression (Default): Add 2 reps per week to each set that is being executed. The reps should be above the previous week's by 2 once data starts coming in. Don't adjust the weight unless the target reps goes above the maximum for that exercise, in which case increase by the lowest increment available.
404
406
 
407
+ These defaults should be auto-regulated based on actual performance. The book's core progression rule is: "If you are increasing load weekly, add only enough to allow at least the same reps, at the same or slightly lower RIR with at least four weeks of accumulation being the goal." The same principle applies in reverse for rep progression: add only enough reps to allow the same load at the same or slightly lower RIR. (Ch. 6: Phase Potentiation, "Hypertrophy Load Progression" / "Hypertrophy Rep Progression"; also repeated in Ch. 8: Summary)
408
+
409
+ In practice this means: if RIR drops faster than planned (e.g. you added weight and went from 4 RIR to 1 RIR in one week), hold the same weight or reps for the next week until RIR catches up. If RIR is unexpectedly high (e.g. staying at 4 RIR when it should have dropped), add more load or reps than the default increment. A very important recommendation is to almost always err on the lighter side of load progression—if you under-add weight, you can make up for it later, but if you over-add, accumulated fatigue may force you to cut the mesocycle short. (Ch. 2: Overload, "Load Progression")
410
+
405
411
  So, with this in mind, the default projection might look like this:
406
412
 
407
413
  - Week 1: 4 RIR, 2 sets per exercise
@@ -426,6 +432,18 @@ How to take a deload?
426
432
  - How to choose the exercises: This can be done in 3 different ways, which are choosing the current mesocycle's exercises, the next mesocycle's, or specifically low stress exercises. To keep things simple for the purposes of my own program, I am just going to go with the first option. It is safest, and easiest to calculate.
427
433
  - How much stimulus to impose: Similar to recovery sessions, for the first half of the week, cut the last microcycle's sets and reps in half, but keep the same weight. The the second half of the week, cut the weight in half as well.
428
434
 
435
+ #### Mesocycle-to-Mesocycle Progression (Ch. 8: Summary, "Mesocycle to Mesocycle Progress"; Ch. 3: Fatigue Management, "Dropping fatigue to reveal performance")
436
+
437
+ Fatigue masks performance during a mesocycle. The deload removes fatigue and reveals the underlying fitness gains—it does not reset the strength baseline. Because of this, performance data from previous mesocycles should inform planning for new ones.
438
+
439
+ When starting a new mesocycle, how to set starting weights depends on the exercise's relationship to the previous mesocycle:
440
+
441
+ - **Same exercise, same rep range:** Start conservatively, below the ending weight from the previous mesocycle. The ending weight was achieved under peak fatigue and is not a sustainable starting point. It is always better to start a bit more conservative—it is less detrimental to add more weight across a meso when load is too light than to deal with the accumulated fatigue of overshooting load early on. (Ch. 8: Summary, "Progression with matched rep range for the same exercise across mesocycles")
442
+ - **Same exercise, different rep range:** Pick the approximate RM for the new target rep range. For example, if switching from the 5-10 range to the 10-20 range, choose a weight between your 14 and 24 rep maxes (offset by the starting 4 RIR). Progress between loading ranges is not expected, only within them. (Ch. 8: Summary, "Progression with different rep ranges for the same exercise across mesocycles")
443
+ - **New exercise:** Loading should be assessed independently and not based on weight used for other lifts. Different people have different exercise-to-exercise load ratios, so trial and error with a logbook is the practical approach. Because loading ranges are wide, estimating a weight to get within the target rep range at ~4 RIR is straightforward enough. (Ch. 8: Summary, "Progression with different exercises across mesocycles")
444
+
445
+ RIR progression resets to ~4 RIR at the start of every mesocycle, progressing down to ~1-0 RIR (or ~2 RIR for beginners) by the final accumulation week. This reset is universal—it allows the longest productive accumulation phase regardless of where the previous mesocycle ended. (Ch. 8: Summary, "Mesocycle Length Choices"; Ch. 2: Overload)
446
+
429
447
  #### Phase Potentiation (pg. 181-191)
430
448
 
431
449
  This is a more advanced concept, and could be explored further later on. Basically, it is a way to organize mesocycles, outside of the periodic active rest periods, to get better performance. This seems to be characterized by a maintenance training phase which is an entire mesocycle training at MV (so very low volumes), but with high weight.
@@ -436,6 +454,23 @@ A clean middle-ground might be to just take a resensitization phase every 3-4 me
436
454
 
437
455
  Identifying the type of mesocycle that is happening in the data model may be helpful to provide even more context. For example, a strength gain mesocycle will likely always be more productive than a cutting mesocycle. There are some great tips on how to track progress during a cutting mesocycle and how to track on page 220-221. What it comes down to is trying to stay around MEV for as long as possible until your cut is complete. You don't want your cut to ever last longer than a single mesocycle, so for example, instead of progressing from 5 sets to 9 sets over four weeks, you might go from 5 to 7 sets over six weeks. You still take the deload at the end of course, and progress with the roughly normal (but reduced) set and rep progression algorithm.
438
456
 
457
+ #### Cycle-Type-Specific Training Modifications
458
+
459
+ **Cut (Fat Loss) Mesocycles** (Ch. 7: Individualization, fat loss training section):
460
+
461
+ The training goal during a fat loss phase is to prevent net muscle loss, not to maximize growth. Training can be altered to extend the mesocycle (improving the accumulation-to-deload ratio) without much downside. Key modifications:
462
+
463
+ - Stay near MEV rather than pushing aggressively toward MRV. Just get some pumps, some metabolites, some soreness, and maintain performance microcycle to microcycle via the Set Progression Algorithm and muscle should be retained.
464
+ - Add only the smallest needed volumes to stay ahead of the MEV landmark. This allows extending the accumulation phase (e.g. going from 5 to 7 sets over six weeks instead of 5 to 9 over four weeks).
465
+ - RIR progression starts at ~4 RIR as normal—no modification is prescribed for cuts.
466
+
467
+ **Resensitization (Maintenance) Mesocycles** (Ch. 6: Phase Potentiation, "Volume Potentiation"; Ch. 7: Individualization):
468
+
469
+ - MV-level training: very low volume. You should rarely get sore, achieve a pump, or even feel very challenged. (Ch. 6: Phase Potentiation, maintenance training phase description)
470
+ - Bias toward the heavy rep range. Muscle conservation during maintenance dieting is best when heavier weights are used at low volumes. (Ch. 6: Phase Potentiation, "Volume Potentiation")
471
+ - Frequency can be very low: 1-2 sessions per muscle group per microcycle, as sparing muscle requires minimal stimulation (as little as once per week per muscle group). (Ch. 6: Phase Potentiation; Ch. 7: Individualization)
472
+ - Duration: 3-6 weeks for the maintenance training phase. (Ch. 6: Phase Potentiation)
473
+
439
474
  ### Fatigue (pg. 87-89)
440
475
 
441
476
  There are different types of fatigue outlined below:
@@ -498,6 +533,7 @@ In addition to the above, which help improve the SFR, which can also help reduce
498
533
  - Recovery sessions should target the affected muscle group. In bad cases, you may need to take it easy for the entire session, but it is better if just the impacted muscle group has lower volume.
499
534
  - To actually take a recovery session, simply cut the planned reps and sets in half. So if you planned to do 5 sets of 20 reps roughly, then do 2 sets of 10 reps. Use the same weight though. If you feel that you can't do any reps at the same weight, then cut the weight and sets in half, but leave the reps the same.
500
535
  - Note that cutting things in half may seem like overkill. But what you want to avoid is only reducing the number of sets by 1, or number of reps by a couple and calling that a recovery. That just reduces stimulation AND doesn't reduce fatigue. Making both problems worse.
536
+ - If the recovery session was taken because MRV was hit too early, the next stimulative session can progress in load as planned, but volume should be dropped to around midway between MEV and MRV. For example, if you did week one with 10 sets and your MRV is around 20 sets, then re-starting at ~15 sets after your recovery session(s) is a good idea. From there, apply the Set Progression Algorithm and move forward with volume as needed. (Ch. 3: Fatigue Management, "Taking Recovery Sessions")
501
537
  - Active rest periods (pg. 112): This happens once per year and lasts 1-4 weeks. Take the time completely off and try not to binge eat lol. Normally this is done right after a deload, and works well with holidays. This is actually not needed for recreational hypertrophy training because the training is a hobby and not a career and the amount of stresses on the body is much less, but it is encouraged.
502
538
 
503
539
  If you are sick, and it is a fever or bad sickness, then take as many rest days as you need to fully recover. You don't want to exacerbate the problem by training early which will make it take even longer to recover and lose more time. After a sickness that takes more than a few days to recover, you need to take a deload and then start a new mesocycle.
@@ -553,5 +589,3 @@ There isn't a definitive part in the book that says this, but it seems implied:
553
589
  These are exhausting to test, and dangerous. You will be strongest at the end of a resensitization phase, or phase where you are working at MV for an extended period of time. The upsides, are you get an accurate representation of 1RM that you can use, the downsides are the danger and fluctuations. Also testing causes 0 gains on it's own. [Here is a Youtube video from RP that discusses this](https://www.youtube.com/watch?v=4luBPhK-rlE). The primary reason this information is needed, is for the algorithms.
554
590
 
555
591
  [NASM provides a 1-rep max calculator](https://www.nasm.org/resources/one-rep-max-calculator) / algorithm that seems like it is relatively accurate. It comes from a reputable organization so it seems safe to trust them. The algorithm can be done by trying to do the most weight you can for the lowest reps possible (lower reps makes it more accurate) and plug it in to: 1RM = (Weight Lifted x Reps / 30.48) + Weight Lifted.
556
-
557
- # Todo
@@ -39,11 +39,14 @@ export declare const WorkoutSetSchema: z.ZodObject<{
39
39
  */
40
40
  export type WorkoutSet = z.infer<typeof WorkoutSetSchema>;
41
41
  /**
42
- * A {@link WorkoutSet} with all nullable fields guaranteed to be defined.
43
- * Zod's `.nullish()` produces `T | null | undefined`, so `Required` alone
44
- * only strips the optional `?` — `NonNullable` is needed to also strip `null`.
42
+ * A {@link WorkoutSet} with all planned and actual performance fields guaranteed non-nullable.
45
43
  */
46
- export type CompletedWorkoutSet = Required<{
47
- [K in keyof WorkoutSet]: NonNullable<WorkoutSet[K]>;
48
- }>;
44
+ export type CompletedWorkoutSet = WorkoutSet & {
45
+ plannedReps: NonNullable<WorkoutSet['plannedReps']>;
46
+ plannedWeight: NonNullable<WorkoutSet['plannedWeight']>;
47
+ plannedRir: NonNullable<WorkoutSet['plannedRir']>;
48
+ actualReps: NonNullable<WorkoutSet['actualReps']>;
49
+ actualWeight: NonNullable<WorkoutSet['actualWeight']>;
50
+ rir: NonNullable<WorkoutSet['rir']>;
51
+ };
49
52
  //# sourceMappingURL=WorkoutSet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkoutSet.d.ts","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;iBAyD3B,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;KACxC,CAAC,IAAI,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC"}
1
+ {"version":3,"file":"WorkoutSet.d.ts","sourceRoot":"","sources":["../../../src/documents/workout/WorkoutSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;iBAyD3B,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG;IAC7C,WAAW,EAAE,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;IACpD,aAAa,EAAE,WAAW,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC;IACxD,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAClD,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;IAClD,YAAY,EAAE,WAAW,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IACtD,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;CACrC,CAAC"}
@@ -90,10 +90,13 @@ export const WorkoutSetSchema = z.object({
90
90
  export type WorkoutSet = z.infer<typeof WorkoutSetSchema>;
91
91
 
92
92
  /**
93
- * A {@link WorkoutSet} with all nullable fields guaranteed to be defined.
94
- * Zod's `.nullish()` produces `T | null | undefined`, so `Required` alone
95
- * only strips the optional `?` — `NonNullable` is needed to also strip `null`.
93
+ * A {@link WorkoutSet} with all planned and actual performance fields guaranteed non-nullable.
96
94
  */
97
- export type CompletedWorkoutSet = Required<{
98
- [K in keyof WorkoutSet]: NonNullable<WorkoutSet[K]>;
99
- }>;
95
+ export type CompletedWorkoutSet = WorkoutSet & {
96
+ plannedReps: NonNullable<WorkoutSet['plannedReps']>;
97
+ plannedWeight: NonNullable<WorkoutSet['plannedWeight']>;
98
+ plannedRir: NonNullable<WorkoutSet['plannedRir']>;
99
+ actualReps: NonNullable<WorkoutSet['actualReps']>;
100
+ actualWeight: NonNullable<WorkoutSet['actualWeight']>;
101
+ rir: NonNullable<WorkoutSet['rir']>;
102
+ };
@@ -27,29 +27,19 @@ export default class WorkoutExerciseService {
27
27
  */
28
28
  static getFatigueScore(exercise: WorkoutExercise): number;
29
29
  /**
30
- * Calculates the progressed target weight and reps for an exercise based on microcycle progression.
31
- * This returns the target weight and reps for the FIRST set of the exercise in the given microcycle,
32
- * assuming it is an accumulation phase (i.e., not a deload).
30
+ * Calculates the target weight and reps for the FIRST set of an exercise.
33
31
  *
34
- * This method applies either rep-based or load-based progression depending on the exercise's
35
- * preferred progression type, then rounds the weight to available equipment options.
32
+ * When a `previousFirstSet` is provided (completed or planned-only), autoregulation
33
+ * computes a surplus and applies progression. Planned-only sets are forecasted with
34
+ * surplus = 0 so the plan progresses smoothly without falling back to calibration.
36
35
  *
37
- * When a `previousFirstSet` is provided, autoregulation adjusts progression based on the
38
- * surplus between planned and actual performance. Without it, the calibration-based formula
39
- * is used as a baseline.
40
- *
41
- * Rep progression: The weight is calculated based on reps at microcycle 0, and reps increase
42
- * by 2 per microcycle to reach max reps at the final accumulation microcycle (ideally),
43
- * or drop back down and increase weight by 2%.
44
- *
45
- * Load progression: Increases weight by at least 2% per microcycle.
46
- * If weight can't be increased, adds 2 reps instead.
36
+ * When no previous set exists (first mesocycle or new exercise), the calibration-based
37
+ * formula computes initial targets from the exercise's 1RM and rep range.
47
38
  */
48
39
  static calculateTargetRepsAndWeightForFirstSet(params: {
49
40
  exercise: WorkoutExercise;
50
41
  calibration: WorkoutExerciseCalibration;
51
42
  equipment: WorkoutEquipmentType;
52
- microcycleIndex: number;
53
43
  firstMicrocycleRir: number;
54
44
  previousFirstSet?: WorkoutSet;
55
45
  }): {
@@ -83,11 +73,19 @@ export default class WorkoutExerciseService {
83
73
  */
84
74
  private static calculateAutoRegulatedLoadTargets;
85
75
  /**
86
- * Checks whether a set has all the data needed for autoregulation calculations.
76
+ * Converts a {@link WorkoutSet} into a {@link CompletedWorkoutSet} for autoregulation.
77
+ *
78
+ * If actual performance data exists, returns the set with those values. Otherwise,
79
+ * forecasts by copying planned values into the actual fields (producing surplus = 0)
80
+ * so that autoregulation applies normal progression from the planned baseline.
81
+ *
82
+ * Returns null if the set lacks the minimum planned data needed.
87
83
  */
88
- private static hasCompleteAutoRegulationData;
84
+ private static toCompletedSet;
89
85
  /**
90
- * Calculates targets using the calibration-based formula (original behavior).
86
+ * Calculates initial targets from calibration data. Used only when no previous
87
+ * set exists (first microcycle of the first mesocycle, or brand-new exercise).
88
+ * All subsequent microcycle progression is handled by autoregulation/forecasting.
91
89
  */
92
90
  private static calculateCalibrationBasedTargets;
93
91
  private static findNextTwoPercentWeight;
@@ -1 +1 @@
1
- {"version":3,"file":"WorkoutExerciseService.d.ts","sourceRoot":"","sources":["../../../../src/services/workout/Exercise/WorkoutExerciseService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAEL,gBAAgB,EACjB,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAC3G,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAMhG;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACzC;;;;;;;;OAQG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAWlF;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM;IAIzD;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,uCAAuC,CAAC,MAAM,EAAE;QACrD,QAAQ,EAAE,eAAe,CAAC;QAC1B,WAAW,EAAE,0BAA0B,CAAC;QACxC,SAAS,EAAE,oBAAoB,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;QACxB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,gBAAgB,CAAC,EAAE,UAAU,CAAC;KAC/B,GAAG;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE;IA2ChD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAsB5C;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;IA4C/C;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,iCAAiC;IA2ChD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAU5C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;IAgG/C,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAgBxC"}
1
+ {"version":3,"file":"WorkoutExerciseService.d.ts","sourceRoot":"","sources":["../../../../src/services/workout/Exercise/WorkoutExerciseService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAEL,gBAAgB,EACjB,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAC3G,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAMhG;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACzC;;;;;;;;OAQG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAWlF;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM;IAIzD;;;;;;;;;OASG;IACH,MAAM,CAAC,uCAAuC,CAAC,MAAM,EAAE;QACrD,QAAQ,EAAE,eAAe,CAAC;QAC1B,WAAW,EAAE,0BAA0B,CAAC;QACxC,SAAS,EAAE,oBAAoB,CAAC;QAChC,kBAAkB,EAAE,MAAM,CAAC;QAC3B,gBAAgB,CAAC,EAAE,UAAU,CAAC;KAC/B,GAAG;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE;IAuChD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAsB5C;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;IA4C/C;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,iCAAiC;IA2ChD;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAmB7B;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;IA2C/C,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAgBxC"}
@@ -35,26 +35,17 @@ export default class WorkoutExerciseService {
35
35
  return WorkoutSFRService.getFatigueTotal(exercise.initialFatigueGuess) || 0;
36
36
  }
37
37
  /**
38
- * Calculates the progressed target weight and reps for an exercise based on microcycle progression.
39
- * This returns the target weight and reps for the FIRST set of the exercise in the given microcycle,
40
- * assuming it is an accumulation phase (i.e., not a deload).
38
+ * Calculates the target weight and reps for the FIRST set of an exercise.
41
39
  *
42
- * This method applies either rep-based or load-based progression depending on the exercise's
43
- * preferred progression type, then rounds the weight to available equipment options.
40
+ * When a `previousFirstSet` is provided (completed or planned-only), autoregulation
41
+ * computes a surplus and applies progression. Planned-only sets are forecasted with
42
+ * surplus = 0 so the plan progresses smoothly without falling back to calibration.
44
43
  *
45
- * When a `previousFirstSet` is provided, autoregulation adjusts progression based on the
46
- * surplus between planned and actual performance. Without it, the calibration-based formula
47
- * is used as a baseline.
48
- *
49
- * Rep progression: The weight is calculated based on reps at microcycle 0, and reps increase
50
- * by 2 per microcycle to reach max reps at the final accumulation microcycle (ideally),
51
- * or drop back down and increase weight by 2%.
52
- *
53
- * Load progression: Increases weight by at least 2% per microcycle.
54
- * If weight can't be increased, adds 2 reps instead.
44
+ * When no previous set exists (first mesocycle or new exercise), the calibration-based
45
+ * formula computes initial targets from the exercise's 1RM and rep range.
55
46
  */
56
47
  static calculateTargetRepsAndWeightForFirstSet(params) {
57
- const { exercise, calibration, equipment, microcycleIndex, firstMicrocycleRir, previousFirstSet } = params;
48
+ const { exercise, calibration, equipment, firstMicrocycleRir, previousFirstSet } = params;
58
49
  // Validate equipment has weight options
59
50
  if (!equipment.weightOptions || equipment.weightOptions.length === 0) {
60
51
  throw new Error(`No weight options defined for equipment type ${equipment._id}, ${equipment.title}`);
@@ -62,12 +53,16 @@ export default class WorkoutExerciseService {
62
53
  // Get rep range for this exercise
63
54
  const repRange = this.getRepRangeValues(exercise.repRange);
64
55
  const repRangeMidpoint = Math.floor((repRange.min + repRange.max) / 2);
65
- // If we have a previous set with complete data, use autoregulation
66
- if (previousFirstSet && this.hasCompleteAutoRegulationData(previousFirstSet)) {
56
+ // When a previous set is available, use autoregulation for progression.
57
+ // toCompletedSet returns the real data when actual performance exists, or
58
+ // forecasts by copying planned values into actuals (surplus = 0) so the
59
+ // plan progresses smoothly from the planned baseline.
60
+ const completedPreviousSet = this.toCompletedSet(previousFirstSet);
61
+ if (completedPreviousSet) {
67
62
  return this.calculateAutoRegulatedTargets({
68
63
  exercise,
69
64
  equipment,
70
- previousFirstSet,
65
+ previousFirstSet: completedPreviousSet,
71
66
  repRange
72
67
  });
73
68
  }
@@ -76,7 +71,6 @@ export default class WorkoutExerciseService {
76
71
  exercise,
77
72
  calibration,
78
73
  equipment,
79
- microcycleIndex,
80
74
  firstMicrocycleRir,
81
75
  repRange,
82
76
  repRangeMidpoint
@@ -176,82 +170,54 @@ export default class WorkoutExerciseService {
176
170
  return { targetWeight, targetReps };
177
171
  }
178
172
  /**
179
- * Checks whether a set has all the data needed for autoregulation calculations.
173
+ * Converts a {@link WorkoutSet} into a {@link CompletedWorkoutSet} for autoregulation.
174
+ *
175
+ * If actual performance data exists, returns the set with those values. Otherwise,
176
+ * forecasts by copying planned values into the actual fields (producing surplus = 0)
177
+ * so that autoregulation applies normal progression from the planned baseline.
178
+ *
179
+ * Returns null if the set lacks the minimum planned data needed.
180
180
  */
181
- static hasCompleteAutoRegulationData(set) {
182
- return (set.actualReps != null &&
183
- set.plannedReps != null &&
184
- set.rir != null &&
185
- set.plannedRir != null &&
186
- set.plannedWeight != null);
181
+ static toCompletedSet(set) {
182
+ if (!set) {
183
+ return null;
184
+ }
185
+ const { plannedReps, plannedWeight, plannedRir } = set;
186
+ if (plannedReps == null || plannedWeight == null || plannedRir == null) {
187
+ return null;
188
+ }
189
+ return {
190
+ ...set,
191
+ plannedReps,
192
+ plannedWeight,
193
+ plannedRir,
194
+ actualReps: set.actualReps ?? plannedReps,
195
+ actualWeight: set.actualWeight ?? plannedWeight,
196
+ rir: set.rir ?? plannedRir
197
+ };
187
198
  }
188
199
  /**
189
- * Calculates targets using the calibration-based formula (original behavior).
200
+ * Calculates initial targets from calibration data. Used only when no previous
201
+ * set exists (first microcycle of the first mesocycle, or brand-new exercise).
202
+ * All subsequent microcycle progression is handled by autoregulation/forecasting.
190
203
  */
191
204
  static calculateCalibrationBasedTargets(params) {
192
- const { exercise, calibration, equipment, microcycleIndex, firstMicrocycleRir, repRange, repRangeMidpoint } = params;
193
- // For rep progression, calculate weight based on reps at microcycle 0
205
+ const { exercise, calibration, equipment, firstMicrocycleRir, repRange, repRangeMidpoint } = params;
206
+ // For rep progression, calculate weight based on midpoint + RIR reps
194
207
  // For load progression, use max reps
195
- let baseRepsForWeight;
196
- if (exercise.preferredProgressionType === ExerciseProgressionType.Rep) {
197
- baseRepsForWeight = repRangeMidpoint + firstMicrocycleRir;
198
- }
199
- else {
200
- // Load progression uses max reps for initial weight calculation
201
- baseRepsForWeight = repRange.max;
202
- }
208
+ const baseRepsForWeight = exercise.preferredProgressionType === ExerciseProgressionType.Rep
209
+ ? repRangeMidpoint + firstMicrocycleRir
210
+ : repRange.max;
203
211
  // Calculate base weight
204
- let targetWeight = WorkoutExerciseCalibrationService.getTargetWeight(calibration, baseRepsForWeight);
205
- // Round to nearest available weight, preferring lower
206
- const roundedWeight = WorkoutEquipmentTypeService.findNearestWeight(equipment, targetWeight, 'prefer-down');
207
- if (roundedWeight === null) {
212
+ const rawWeight = WorkoutExerciseCalibrationService.getTargetWeight(calibration, baseRepsForWeight);
213
+ const targetWeight = WorkoutEquipmentTypeService.findNearestWeight(equipment, rawWeight, 'prefer-down');
214
+ if (targetWeight === null) {
208
215
  throw new Error(`No available weight options found for equipment type ${equipment._id}, ${equipment.title}`);
209
216
  }
210
- targetWeight = roundedWeight;
211
- // Calculate target reps based on progression type
212
- let targetReps;
213
- if (exercise.preferredProgressionType === ExerciseProgressionType.Rep) {
214
- // Rep progression: Add up to max reps, then loop back if needed
215
- let currentMicrocycleIndex = 0;
216
- targetReps = repRangeMidpoint;
217
- while (currentMicrocycleIndex < microcycleIndex) {
218
- targetReps += 2;
219
- if (targetReps > repRange.max) {
220
- // Different reset amounts based on the rep range
221
- switch (exercise.repRange) {
222
- case ExerciseRepRange.Heavy:
223
- targetReps = targetReps - 4;
224
- break;
225
- case ExerciseRepRange.Medium:
226
- targetReps = targetReps - 6;
227
- break;
228
- case ExerciseRepRange.Light:
229
- targetReps = targetReps - 8;
230
- break;
231
- }
232
- const nextWeight = this.findNextTwoPercentWeight(targetWeight, equipment);
233
- if (nextWeight !== null) {
234
- targetWeight = nextWeight;
235
- }
236
- }
237
- currentMicrocycleIndex++;
238
- }
239
- }
240
- else {
241
- // Load progression: Start at max reps
242
- targetReps = repRange.max;
243
- }
244
- // Apply load progression if applicable for the weight
245
- if (exercise.preferredProgressionType === ExerciseProgressionType.Load && microcycleIndex > 0) {
246
- const nextWeight = this.findNextTwoPercentWeight(targetWeight, equipment);
247
- if (nextWeight !== null) {
248
- targetWeight = nextWeight;
249
- }
250
- else {
251
- // Increase reps if we can't increase weight
252
- targetReps = targetReps + 2;
253
- }
254
- }
217
+ // Rep progression starts at midpoint; load progression starts at max reps
218
+ const targetReps = exercise.preferredProgressionType === ExerciseProgressionType.Rep
219
+ ? repRangeMidpoint
220
+ : repRange.max;
255
221
  return { targetWeight, targetReps };
256
222
  }
257
223
  static findNextTwoPercentWeight(currentWeight, equipment) {
@@ -1 +1 @@
1
- {"version":3,"file":"WorkoutExerciseService.js","sourceRoot":"","sources":["../../../../src/services/workout/Exercise/WorkoutExerciseService.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+CAA+C,CAAC;AAGvD,OAAO,2BAA2B,MAAM,iDAAiD,CAAC;AAC1F,OAAO,iCAAiC,MAAM,6DAA6D,CAAC;AAC5G,OAAO,6BAA6B,MAAM,qDAAqD,CAAC;AAChG,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAEjE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACzC;;;;;;;;OAQG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAA0B;QACjD,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,gBAAgB,CAAC,KAAK;gBACzB,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;YAC7B,KAAK,gBAAgB,CAAC,MAAM;gBAC1B,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;YAC9B,KAAK,gBAAgB,CAAC,KAAK;gBACzB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,QAAyB;QAC9C,OAAO,iBAAiB,CAAC,eAAe,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;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AAE,SAAS,CAAC,CAAC;YAC1E,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;gBACxB,YAAY,GAAG,UAAU,CAAC;YAC5B,CAAC;iBAAM,CAAC;gBACN,4CAA4C;gBAC5C,UAAU,GAAG,UAAU,GAAG,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;IACtC,CAAC;IAEO,MAAM,CAAC,wBAAwB,CACrC,aAAqB,EACrB,SAA+B;QAE/B,iCAAiC;QACjC,MAAM,kBAAkB,GAAG,aAAa,GAAG,IAAI,CAAC;QAEhD,6FAA6F;QAC7F,0FAA0F;QAC1F,MAAM,UAAU,GAAG,2BAA2B,CAAC,iBAAiB,CAC9D,SAAS,EACT,kBAAkB,EAClB,IAAI,CACL,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC;CACF"}
1
+ {"version":3,"file":"WorkoutExerciseService.js","sourceRoot":"","sources":["../../../../src/services/workout/Exercise/WorkoutExerciseService.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+CAA+C,CAAC;AAGvD,OAAO,2BAA2B,MAAM,iDAAiD,CAAC;AAC1F,OAAO,iCAAiC,MAAM,6DAA6D,CAAC;AAC5G,OAAO,6BAA6B,MAAM,qDAAqD,CAAC;AAChG,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAEjE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACzC;;;;;;;;OAQG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAA0B;QACjD,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,gBAAgB,CAAC,KAAK;gBACzB,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;YAC7B,KAAK,gBAAgB,CAAC,MAAM;gBAC1B,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE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