// Bundled operator-defaults. A deploy without a `config.json` (or one that
// fails to parse) runs on exactly these values, so they must match the
// frontends' hardcoded store defaults — first paint is correct even before
// the config fetch resolves.

import { DEFAULT_TIME_SIGNATURE } from "./enums";
import type { RtmgConfig } from "./types";

export const DEFAULT_CONFIG: RtmgConfig = {
  version: 1,
  engine: {
    sde: false,
    lora: true,
    depth: 4,
    vae_window: 0.36,
    crop: 0,
    steps: 8,
    fast_vae: false,
    walk_window: false,
    walk_window_s: 60,
    lead_floor_s: 0.25,
    lead_ceiling_s: 1.35,
    lead_release_tau_s: 1.5,
    max_source_duration_s: 120,
    key: "G# minor",
    time_signature: DEFAULT_TIME_SIGNATURE,
    enabled_loras: [],
    auto_prepend_lora_triggers: true,
    show_incompatible_loras: false,
  },
  prompts: {
    a: "heavy dubstep, deathstep, afxdump, growl heavy bass distortion",
    b: "daft punk style, beautiful, four to the floor, angelic",
    blend: 0.4,
  },
  controls: {
    denoise: 0.7,
    hint_strength: 1.0,
    feedback: 0.0,
    feedback_depth: 1,
    shift: 3.5,
    ch_g0: 1.0,
    ch_g1: 1.0,
    ch_g2: 1.0,
    ch_g3: 1.0,
    ch_g4: 1.0,
    ch_g5: 1.0,
    ch_g6: 1.0,
    ch_g7: 1.0,
    ch13: 1.0,
    ch14: 1.0,
    ch19: 1.0,
    ch23: 1.0,
    ch29: 1.0,
    ch56: 1.0,
    dcw_scaler: 0.05,
    dcw_high_scaler: 0.02,
    dcw_enabled: true,
    dcw_mode: "double",
    dcw_wavelet: "haar",
    lora_default_strength: 1.4,
    guidance_scale: 7.0,
    cfg_rescale: 0.0,
    rcfg_mode: "off",
  },
  channel_ranges: {
    ch_g0: { min: 0, max: 2.2, reverse: false },
    ch_g1: { min: 0, max: 2.0, reverse: false },
    ch_g2: { min: 0, max: 2.3, reverse: true },
    ch_g3: { min: 0, max: 2.0, reverse: false },
    ch_g4: { min: 0, max: 2.5, reverse: false },
    ch_g5: { min: 0, max: 2.0, reverse: false },
    ch_g6: { min: 0, max: 2.0, reverse: true },
    ch_g7: { min: 0, max: 2.0, reverse: true },
    ch13: { min: 0, max: 2.0, reverse: true },
    ch14: { min: 0, max: 2.3, reverse: false },
    ch19: { min: 0, max: 2.5, reverse: false },
    ch23: { min: 0, max: 2.45, reverse: false },
    ch29: { min: 0, max: 2.0, reverse: false },
    ch56: { min: 0, max: 2.0, reverse: false },
  },
  seed: 0,
  swap_source_mode: "instruments",
  web: {
    effects: {
      parallax_strength: 0.4,
      bloom_on_kick: 0.3,
      bloom_threshold: 0.15,
      warp_strength: 0.4,
    },
    audio: {
      lufs_enabled: false,
      lufs_window_sec: 3.0,
      lufs_metric: "lufs",
      lufs_peak_headroom: 4.0,
      lufs_silence_floor_db: 30.0,
      lufs_silence_floor_hysteresis_db: 6.0,
    },
    reset_seconds: 0,
    denoise_session_gate: {
      enabled: true,
      glide_ms: 700,
    },
    restart_song_on_swap: true,
  },
};
