import 'package:slrpg_app/l10n/app_localizations.dart';

class ExerciseGuide {
  final String title;
  final String difficulty;
  final String rpgLore;
  final List<String> steps;
  final List<String> muscles;
  final List<String> commonMistakes;

  const ExerciseGuide({
    required this.title,
    required this.difficulty,
    required this.rpgLore,
    required this.steps,
    required this.muscles,
    required this.commonMistakes,
  });

  static List<String> _split(String input) {
    return input.split('|').map((e) => e.trim()).toList();
  }

  static Map<String, ExerciseGuide> getLibrary(AppLocalizations l10n) {
    return {
      'pullup': ExerciseGuide(
        title: l10n.guidePullupTitle,
        difficulty: 'Adept',
        rpgLore: l10n.guidePullupLore,
        steps: _split(l10n.guidePullupSteps),
        muscles: _split(l10n.guidePullupMuscles),
        commonMistakes: _split(l10n.guidePullupMistakes),
      ),
      'dip': ExerciseGuide(
        title: l10n.guideDipTitle,
        difficulty: 'Adept',
        rpgLore: l10n.guideDipLore,
        steps: _split(l10n.guideDipSteps),
        muscles: _split(l10n.guideDipMuscles),
        commonMistakes: _split(l10n.guideDipMistakes),
      ),
      'squat': ExerciseGuide(
        title: l10n.guideSquatTitle,
        difficulty: 'Master',
        rpgLore: l10n.guideSquatLore,
        steps: _split(l10n.guideSquatSteps),
        muscles: _split(l10n.guideSquatMuscles),
        commonMistakes: _split(l10n.guideSquatMistakes),
      ),
      'bench': ExerciseGuide(
        title: l10n.guideBenchTitle,
        difficulty: 'Novice',
        rpgLore: l10n.guideBenchLore,
        steps: _split(l10n.guideBenchSteps),
        muscles: _split(l10n.guideBenchMuscles),
        commonMistakes: _split(l10n.guideBenchMistakes),
      ),
      'ohp': ExerciseGuide(
        title: l10n.guideOhpTitle,
        difficulty: 'Adept',
        rpgLore: l10n.guideOhpLore,
        steps: _split(l10n.guideOhpSteps),
        muscles: _split(l10n.guideOhpMuscles),
        commonMistakes: _split(l10n.guideOhpMistakes),
      ),
      'rdl': ExerciseGuide(
        title: l10n.guideRdlTitle,
        difficulty: 'Adept',
        rpgLore: l10n.guideRdlLore,
        steps: _split(l10n.guideRdlSteps),
        muscles: _split(l10n.guideRdlMuscles),
        commonMistakes: _split(l10n.guideRdlMistakes),
      ),
      'row': ExerciseGuide(
        title: l10n.guideRowTitle,
        difficulty: 'Adept',
        rpgLore: l10n.guideRowLore,
        steps: _split(l10n.guideRowSteps),
        muscles: _split(l10n.guideRowMuscles),
        commonMistakes: _split(l10n.guideRowMistakes),
      ),
      'curl': ExerciseGuide(
        title: l10n.guideCurlTitle,
        difficulty: 'Novice',
        rpgLore: l10n.guideCurlLore,
        steps: _split(l10n.guideCurlSteps),
        muscles: _split(l10n.guideCurlMuscles),
        commonMistakes: _split(l10n.guideCurlMistakes),
      ),
      'kb_swing': ExerciseGuide(
        title: l10n.guideKbSwingTitle,
        difficulty: 'Adept',
        rpgLore: l10n.guideKbSwingLore,
        steps: _split(l10n.guideKbSwingSteps),
        muscles: _split(l10n.guideKbSwingMuscles),
        commonMistakes: _split(l10n.guideKbSwingMistakes),
      ),
      'kb_snatch': ExerciseGuide(
        title: l10n.guideKbSnatchTitle,
        difficulty: 'Master',
        rpgLore: l10n.guideKbSnatchLore,
        steps: _split(l10n.guideKbSnatchSteps),
        muscles: _split(l10n.guideKbSnatchMuscles),
        commonMistakes: _split(l10n.guideKbSnatchMistakes),
      ),
      'kb_thruster': ExerciseGuide(
        title: l10n.guideKbThrusterTitle,
        difficulty: 'Master',
        rpgLore: l10n.guideKbThrusterLore,
        steps: _split(l10n.guideKbThrusterSteps),
        muscles: _split(l10n.guideKbThrusterMuscles),
        commonMistakes: _split(l10n.guideKbThrusterMistakes),
      ),
      'kb_clean_press': ExerciseGuide(
        title: l10n.guideKbCleanPressTitle,
        difficulty: 'Adept',
        rpgLore: l10n.guideKbCleanPressLore,
        steps: _split(l10n.guideKbCleanPressSteps),
        muscles: _split(l10n.guideKbCleanPressMuscles),
        commonMistakes: _split(l10n.guideKbCleanPressMistakes),
      ),
      'face_pull': ExerciseGuide(
        title: l10n.guideFacePullTitle,
        difficulty: 'Novice',
        rpgLore: l10n.guideFacePullLore,
        steps: _split(l10n.guideFacePullSteps),
        muscles: _split(l10n.guideFacePullMuscles),
        commonMistakes: _split(l10n.guideFacePullMistakes),
      ),
      'ab_wheel': ExerciseGuide(
        title: l10n.guideAbWheelTitle,
        difficulty: 'Adept',
        rpgLore: l10n.guideAbWheelLore,
        steps: _split(l10n.guideAbWheelSteps),
        muscles: _split(l10n.guideAbWheelMuscles),
        commonMistakes: _split(l10n.guideAbWheelMistakes),
      ),
      'plank': ExerciseGuide(
        title: l10n.guidePlankTitle,
        difficulty: 'Novice',
        rpgLore: l10n.guidePlankLore,
        steps: _split(l10n.guidePlankSteps),
        muscles: _split(l10n.guidePlankMuscles),
        commonMistakes: _split(l10n.guidePlankMistakes),
      ),
    };
  }
}
