{t('stats_title', lang)}
{stats.totalWorkouts ?? 0}
{(stats.totalWorkouts ?? 0) === 1 ? t('workout_singular', lang) : t('workouts_plural', lang)}
{stats.totalTonnage ?? 0}
t
{t('lifted', lang)}
{#if stats.kcalEstimate}
~{stats.kcalEstimate.kcal.toLocaleString()}
kcal
{t('burned', lang)}
{#if !hasDemographics}
{t('kcal_set_profile', lang)}
{t('measure_title', lang)}
{/if}
{/if}
{stats.totalCardioKm ?? 0}
km
{t('covered', lang)}
{#if goalEditing}
{ if (e.key === 'Escape') goalEditing = false; }} role="dialog" tabindex="-1">
goalEditing = false} onkeydown={(e) => { if (e.key === 'Escape') goalEditing = false; }} role="presentation">
{t('weekly_goal', lang)}
{ if (goalInput > 1) goalInput--; }} disabled={goalInput <= 1}>-
{goalInput}
{ if (goalInput < 14) goalInput++; }} disabled={goalInput >= 14}>+
{t('workouts_per_week_goal', lang)}
{goalSaving ? t('saving', lang) : t('save', lang)}
goalEditing = false}>{t('cancel', lang)}
{/if}
{#if (stats.workoutsChart?.data?.length ?? 0) > 0}
{:else}
{t('no_workout_data', lang)}
{/if}
{goalStreak === 1 ? t('streak_week', lang) : t('streak_weeks', lang)}
{t('streak', lang)}
{#if goalWeekly !== null}
{goalWeekly}x / {t('streak_week', lang).toLowerCase()}
{:else}
{t('set_goal', lang)}
{/if}
{#if (stats.weightChart?.data?.length ?? 0) > 1}
{/if} {#if ns}
{#if ns.avgProteinPerKg != null}
{ns.avgProteinPerKg.toFixed(1)}
{t('protein_per_kg_unit', lang)}
{:else}
—
{/if}
{t('protein_per_kg', lang)}
{#if ns.avgProteinPerKg != null} {t('seven_day_avg', lang)} {:else if !ns.trendWeight} {t('no_weight_data', lang)} {:else} {t('no_nutrition_data', lang)} {/if}
0} class:deficit={ns.avgCalorieBalance < 0}>
{#if ns.avgCalorieBalance != null}
0} class:negative={ns.avgCalorieBalance < 0}> {ns.avgCalorieBalance > 0 ? '+' : ''}{ns.avgCalorieBalance}
{t('calorie_balance_unit', lang)}
{:else}
—
{/if}
{t('calorie_balance', lang)}
{#if ns.avgCalorieBalance != null} {t('seven_day_avg', lang)} {:else} {t('no_calorie_goal', lang)} {/if}
{#if ns.adherencePercent != null}
{ns.adherencePercent}
%
{:else}
—
{/if}
{t('diet_adherence', lang)}
{#if ns.adherencePercent != null} {t('since_start', lang)} ({ns.adherenceDays} {t('days', lang)}) {:else} {t('no_calorie_goal', lang)} {/if}
{#if ns.macroSplit}
{t('macro_split', lang)}
({t('seven_day_avg', lang)})
{#each [ { pct: ns.macroSplit.protein, target: ns.macroTargets?.protein, label: t('protein', lang), cls: 'ring-protein', fill: '#a3be8c' }, { pct: ns.macroSplit.fat, target: ns.macroTargets?.fat, label: t('fat', lang), cls: 'ring-fat', fill: '#d08770' }, { pct: ns.macroSplit.carbs, target: ns.macroTargets?.carbs, label: t('carbs', lang), cls: 'ring-carbs', fill: '#81a1c1' }, ] as macro (macro.cls)}
{#if macro.target != null} {@const pos = targetMarkerPos(macro.target)}
{macro.target}%
{/if}
{macro.pct}%
{macro.label}
{/each}
{/if}
{/if}
{t('muscle_balance', lang)}