// data.jsx — fixture data for the prototype

const SERVERS = [
  { id: 'fra1', name: 'fra1.mm',     addr: '5.39.42.118:27015',  region: 'Frankfurt',  status: 'online',  players: '9/12', map: 'de_mirage' },
  { id: 'sea1', name: 'sea1.scrim',  addr: '10.0.1.22:27015',    region: 'Seattle',    status: 'online',  players: '10/10', map: 'de_inferno' },
  { id: 'home', name: 'home.lan',    addr: '192.168.1.40:27015', region: 'Local',      status: 'online',  players: '3/10', map: 'de_dust2' },
  { id: 'aws',  name: 'practice-aws',addr: '54.218.7.92:27015',  region: 'us-west-2',  status: 'warn',    players: '0/8',  map: 'aim_botz' },
  { id: 'old',  name: 'retake-old',  addr: '88.99.10.4:27015',   region: 'Hetzner',    status: 'offline', players: '—',    map: '—' },
];

const PLAYERS = [
  { name: 'm0use_',        steam: 'STEAM_1:0:48211904', ping: 18,  time: '1:24:11', country: 'SE', kd: '1.31', team: 'CT', flagged: true,  notes: 'rage suspect' },
  { name: 'ferr',          steam: 'STEAM_1:1:91134472', ping: 22,  time: '1:24:08', country: 'DE', kd: '0.94', team: 'CT', flagged: false },
  { name: 'kqly.exe',      steam: 'STEAM_1:0:32220110', ping: 41,  time: '1:18:54', country: 'PL', kd: '1.07', team: 'CT', flagged: false },
  { name: 'twist',         steam: 'STEAM_1:1:12349803', ping: 24,  time: '1:17:02', country: 'SE', kd: '1.18', team: 'CT', flagged: false },
  { name: 'olof',          steam: 'STEAM_1:0:55102941', ping: 28,  time: '1:11:33', country: 'SE', kd: '0.88', team: 'CT', flagged: false },
  { name: 'NEKO',          steam: 'STEAM_1:1:78231004', ping: 19,  time: '1:24:11', country: 'JP', kd: '1.42', team: 'T',  flagged: false },
  { name: 'zywoo•',        steam: 'STEAM_1:0:11923844', ping: 26,  time: '1:23:01', country: 'FR', kd: '1.95', team: 'T',  flagged: false },
  { name: 'bymas',         steam: 'STEAM_1:1:43712001', ping: 33,  time: '0:58:21', country: 'LT', kd: '1.04', team: 'T',  flagged: false },
  { name: 'jL',            steam: 'STEAM_1:0:90120431', ping: 29,  time: '0:42:11', country: 'FI', kd: '1.08', team: 'T',  flagged: false },
  { name: 'h4rdy_woods',   steam: 'STEAM_1:1:77124930', ping: 86,  time: '0:11:54', country: 'BR', kd: '0.73', team: 'T',  flagged: true, notes: 'multi-acc; 2x prior kick' },
];

const WATCHLIST = [
  { steam: 'STEAM_1:0:48211904', name: 'm0use_',       reason: 'wallhack reports x4', online: true },
  { steam: 'STEAM_1:1:77124930', name: 'h4rdy_woods',  reason: 'griefing — voted twice',   online: true },
  { steam: 'STEAM_1:1:20300912', name: 'silent.knife', reason: 'team-damage spammer',    online: false },
  { steam: 'STEAM_1:0:65332100', name: 'badboy_3000',  reason: 'racism — 1mo warn',        online: false },
];

const BANS = [
  { steam: 'STEAM_1:0:55512090', name: 'lobotomy',    reason: 'wallhack — demo evidence',  by: 'm0use@', expires: '2026-06-12 18:00', perm: false },
  { steam: 'STEAM_1:1:11203044', name: 'rage_quitter',reason: 'griefing',                  by: 'admin',  expires: '2026-05-24 04:00', perm: false },
  { steam: 'STEAM_1:0:99887700', name: 'idiot',       reason: 'racism — auto-detect',      by: 'system', expires: 'permanent',         perm: true  },
  { steam: 'STEAM_1:1:00091123', name: 'spinbot',     reason: 'aim hack — confirmed demo', by: 'm0use@', expires: 'permanent',         perm: true  },
];

const COMP_MAPS = [
  { id: 'de_mirage',   name: 'Mirage',    mode: 'comp',     fav: true,  active: true  },
  { id: 'de_inferno',  name: 'Inferno',   mode: 'comp',     fav: true,  active: false },
  { id: 'de_dust2',    name: 'Dust II',   mode: 'comp',     fav: true,  active: false },
  { id: 'de_nuke',     name: 'Nuke',      mode: 'comp',     fav: false, active: false },
  { id: 'de_overpass', name: 'Overpass',  mode: 'comp',     fav: true,  active: false },
  { id: 'de_anubis',   name: 'Anubis',    mode: 'comp',     fav: false, active: false },
  { id: 'de_vertigo',  name: 'Vertigo',   mode: 'comp',     fav: false, active: false },
  { id: 'de_ancient',  name: 'Ancient',   mode: 'comp',     fav: false, active: false },
  { id: 'cs_office',   name: 'Office',    mode: 'hostage',  fav: false, active: false },
  { id: 'cs_italy',    name: 'Italy',     mode: 'hostage',  fav: false, active: false },
  { id: 'de_train',    name: 'Train',     mode: 'comp',     fav: false, active: false },
  { id: 'aim_botz',    name: 'aim_botz',  mode: 'practice', fav: true,  active: false },
];

const WORKSHOP_MAPS = [
  { id: '3070960859', name: 'de_cache_redux',     by: 'shawn',    subs: '281k',  fav: true  },
  { id: '3070192884', name: 'awp_lego',            by: '3kliksphilip', subs: '92k', fav: true },
  { id: '3071102234', name: 'surf_kitsune_ksf',    by: 'kitsune',  subs: '14k',  fav: false },
  { id: '3072201991', name: 'de_season',           by: 'sumamon',  subs: '441k', fav: false },
];

const CVAR_GROUPS = [
  {
    label: 'Round settings',
    presets: [
      { id: 'mr12',         label: 'MR12 (24+OT)',  applied: true,  vars: 'mp_maxrounds 24 ; mp_overtime_enable 1' },
      { id: 'mr15',         label: 'MR15 (30)',     applied: false, vars: 'mp_maxrounds 30 ; mp_overtime_enable 0' },
      { id: 'short',        label: 'Short (BO9)',   applied: false, vars: 'mp_maxrounds 8' },
      { id: 'warmup-15',    label: 'Warmup 15s',    applied: true,  vars: 'mp_warmuptime 15' },
      { id: 'warmup-60',    label: 'Warmup 60s',    applied: false, vars: 'mp_warmuptime 60' },
      { id: 'freeze-10',    label: 'Freeze 10s',    applied: false, vars: 'mp_freezetime 10' },
    ],
  },
  {
    label: 'Economy',
    presets: [
      { id: 'eco-comp',     label: 'Comp default',  applied: true,  vars: 'mp_startmoney 800 ; mp_maxmoney 16000' },
      { id: 'eco-pistol',   label: 'Pistol only',   applied: false, vars: 'mp_startmoney 200 ; mp_buy_anywhere 0' },
      { id: 'eco-rich',     label: 'Rich start',    applied: false, vars: 'mp_startmoney 16000' },
      { id: 'roundtime',    label: '1:55 round',    applied: true,  vars: 'mp_roundtime 1.92' },
    ],
  },
  {
    label: 'Movement',
    presets: [
      { id: 'mov-default',  label: 'Default',       applied: true,  vars: 'sv_accelerate 5.5 ; sv_airaccelerate 12' },
      { id: 'mov-surf',     label: 'Surf',          applied: false, vars: 'sv_airaccelerate 800 ; sv_maxvelocity 9999' },
      { id: 'mov-kz',       label: 'KZ',            applied: false, vars: 'sv_airaccelerate 100 ; sv_staminamax 0' },
    ],
  },
  {
    label: 'Server',
    presets: [
      { id: 'tick-128',     label: '128 tick',      applied: true,  vars: 'sv_minrate 128000 ; sv_maxupdaterate 128' },
      { id: 'tick-64',      label: '64 tick',       applied: false, vars: 'sv_minrate 64000  ; sv_maxupdaterate 64' },
      { id: 'lan',          label: 'LAN',           applied: false, vars: 'sv_lan 1 ; sv_cheats 0' },
      { id: 'pure',         label: 'Pure 2',        applied: true,  vars: 'sv_pure 2' },
    ],
  },
  {
    label: 'Practice',
    presets: [
      { id: 'prac-grenade', label: 'Nade practice', applied: false, vars: 'sv_cheats 1 ; sv_grenade_trajectory 1' },
      { id: 'prac-infinite',label: 'Infinite nades',applied: false, vars: 'ammo_grenade_limit_total 5' },
      { id: 'prac-noflash', label: 'No-flash bots', applied: false, vars: 'bot_difficulty 0 ; mp_flashlight 0' },
      { id: 'prac-respawn', label: 'Auto-respawn',  applied: false, vars: 'mp_respawn_on_death_t 1 ; mp_respawn_on_death_ct 1' },
    ],
  },
];

const PLUGINS = [
  { name: 'CounterStrikeSharp',    ver: '1.0.305',  status: 'ok',   update: null,      desc: 'CS# host runtime + scripting',   essential: true },
  { name: 'MatchZy',               ver: '0.8.7',    status: 'ok',   update: '0.8.8',   desc: 'Pug, scrim & match management' },
  { name: 'KitsuneLab.MovementApi',ver: '1.4.0',    status: 'ok',   update: null,      desc: 'CS2-specific movement hooks' },
  { name: 'WeaponPaints',          ver: '4.0',      status: 'warn', update: null,      desc: 'Skin chooser — see error log' },
  { name: 'CS2-SimpleAdmin',       ver: '1.6.1',    status: 'ok',   update: null,      desc: 'In-game admin commands' },
  { name: 'Metamod:Source',        ver: '2.0.0-12', status: 'ok',   update: null,      desc: 'Plugin loader',                  essential: true },
  { name: 'CallAdmin',             ver: '0.6.2',    status: 'off',  update: null,      desc: 'Discord report integration' },
  { name: 'GotvFix',               ver: '0.3.0',    status: 'err',  update: null,      desc: 'GOTV TCP shim — failed at boot' },
];

const PLUGIN_ERRORS = [
  { ts: '12:48:02', plug: 'WeaponPaints',  level: 'warn', msg: 'failed to fetch skin metadata for STEAM_1:1:43712001 (timeout 5s)' },
  { ts: '12:18:54', plug: 'GotvFix',       level: 'err',  msg: 'bind(0.0.0.0:27020) → EADDRINUSE — gotv relay disabled' },
  { ts: '11:30:11', plug: 'MatchZy',       level: 'info', msg: 'matchzy: live config "mr12_competitive.cfg" applied' },
];

const SCHED = [
  { id: 1, name: 'Nightly restart',     cron: '0 5 * * *',   cmd: 'sv_shutdown',                last: '2026-05-21 05:00', next: '2026-05-22 05:00', on: true },
  { id: 2, name: 'Warmup reset',        cron: '*/30 * * * *',cmd: 'mp_warmup_start',            last: '12:30',           next: '13:00',           on: true },
  { id: 3, name: 'Workshop sync',       cron: '0 4 * * 0',   cmd: 'ds_workshop_sync',           last: '2026-05-18 04:00', next: '2026-05-25 04:00', on: true },
  { id: 4, name: 'Daily backup',        cron: '0 3 * * *',   cmd: 'exec ./backups/snap.sh',     last: '2026-05-21 03:00', next: '2026-05-22 03:00', on: true },
  { id: 5, name: 'Pug auto-shuffle',    cron: '0 19 * * 5',  cmd: 'mz_shuffle',                 last: '2026-05-16 19:00', next: '2026-05-23 19:00', on: false },
];

const ADMINS = [
  { user: 'm0use@',    role: 'owner',     last: '12:51 — now', mfa: true,  email: 'm@m0use.dev' },
  { user: 'jaeger',    role: 'admin',     last: '2h ago',      mfa: true,  email: 'p.j@axum.io' },
  { user: 'kira',      role: 'admin',     last: '1d ago',      mfa: false, email: 'kira@scrim.gg' },
  { user: 'ref-bot',   role: 'moderator', last: '4d ago',      mfa: true,  email: 'discord://ref' },
];

const AUDIT = [
  { ts: '12:51:08', who: 'm0use@', act: 'cmd',    target: 'mp_warmup_end',                            ok: true },
  { ts: '12:49:51', who: 'jaeger', act: 'kick',   target: 'h4rdy_woods (STEAM_1:1:77124930) — afk',  ok: true },
  { ts: '12:48:02', who: 'system', act: 'plugin', target: 'WeaponPaints warn: fetch timeout',         ok: false },
  { ts: '12:40:11', who: 'm0use@', act: 'map',    target: 'de_mirage (was de_inferno)',               ok: true },
  { ts: '12:38:00', who: 'jaeger', act: 'preset', target: 'apply: MR12 (24+OT)',                      ok: true },
  { ts: '12:35:12', who: 'm0use@', act: 'config', target: 'edit gamemode_competitive.cfg (+4 −2)',    ok: true },
  { ts: '12:30:00', who: 'cron',   act: 'cmd',    target: 'mp_warmup_start',                          ok: true },
  { ts: '12:18:54', who: 'system', act: 'plugin', target: 'GotvFix bind failure',                     ok: false },
  { ts: '12:14:33', who: 'kira',   act: 'ban',    target: 'lobotomy — wallhack — 21d',                ok: true },
  { ts: '12:02:11', who: 'm0use@', act: 'signin', target: 'from 84.124.221.9 — chrome/macOS',         ok: true },
];

const CVAR_DICT = [
  { name: 'mp_warmuptime',         val: '15',   ty: 'replicated', desc: 'Time after a new round before match starts.' },
  { name: 'mp_warmup_end',         val: '—',    ty: 'cmd',        desc: 'End the warmup period immediately.' },
  { name: 'mp_warmup_pausetimer',  val: '0',    ty: 'replicated', desc: 'Pause the warmup countdown indefinitely.' },
  { name: 'mp_maxrounds',          val: '24',   ty: 'replicated', desc: 'Maximum number of rounds to play before server changes maps.' },
  { name: 'mp_overtime_enable',    val: '1',    ty: 'replicated', desc: 'When enabled, the match will not end in a tie.' },
  { name: 'mp_freezetime',         val: '15',   ty: 'replicated', desc: 'Time in seconds to keep players frozen when round starts.' },
  { name: 'mp_roundtime',          val: '1.92', ty: 'replicated', desc: 'Round time in minutes.' },
  { name: 'mp_startmoney',         val: '800',  ty: 'replicated', desc: 'Amount of money each player gets when they reset.' },
  { name: 'mp_buy_anywhere',       val: '0',    ty: 'replicated', desc: 'Allow buying anywhere on the map.' },
  { name: 'sv_cheats',             val: '0',    ty: 'archive',    desc: 'Allow cheats on server.' },
  { name: 'sv_grenade_trajectory', val: '0',    ty: 'cheat',      desc: 'Draws grenade trajectories.' },
  { name: 'sv_lan',                val: '0',    ty: 'archive',    desc: 'Server is a LAN server.' },
  { name: 'sv_password',           val: '****',ty: 'archive',    desc: 'Password to join the server.' },
  { name: 'host_workshop_map',     val: '—',    ty: 'cmd',        desc: 'Host a workshop map by ID.' },
  { name: 'changelevel',           val: '—',    ty: 'cmd',        desc: 'Change server level.' },
];

const LOG_LINES = [
  { ts: '12:51:08', cat: 'rcon',  txt: '> mp_warmup_end' },
  { ts: '12:51:08', cat: 'world', txt: 'World triggered "Warmup_End"' },
  { ts: '12:51:09', cat: 'round', txt: 'World triggered "Round_Start"' },
  { ts: '12:51:14', cat: 'kill',  txt: '"m0use_<2><STEAM_1:0:48211904><CT>" killed "zywoo•<7><STEAM_1:0:11923844><T>" with "ak47" (headshot)' },
  { ts: '12:51:23', cat: 'chat',  txt: '"m0use_<2><STEAM_1:0:48211904><CT>" say "gg wp"' },
  { ts: '12:51:25', cat: 'kill',  txt: '"NEKO<5><STEAM_1:1:78231004><T>" killed "ferr<3><STEAM_1:1:91134472><CT>" with "awp"' },
  { ts: '12:51:27', cat: 'round', txt: 'Team "T" triggered "SFUI_Notice_Target_Saved" (CT "1") (T "0")' },
  { ts: '12:51:27', cat: 'round', txt: 'World triggered "Round_End"' },
  { ts: '12:51:32', cat: 'conn',  txt: '"jL<9><STEAM_1:0:90120431><>" connected, address "78.34.221.41:27015"' },
  { ts: '12:51:34', cat: 'team',  txt: '"jL<9><STEAM_1:0:90120431><Unassigned>" switched from team <Unassigned> to <TERRORIST>' },
  { ts: '12:51:40', cat: 'chat',  txt: '"NEKO<5><STEAM_1:1:78231004><T>" say "rotate B"' },
  { ts: '12:51:55', cat: 'rcon',  txt: '> status' },
  { ts: '12:51:55', cat: 'srv',   txt: 'hostname: nokit | fra1.mm  •  map: de_mirage  •  players: 10/12' },
  { ts: '12:52:01', cat: 'kill',  txt: '"twist<6><STEAM_1:1:12349803><CT>" killed "bymas<8><STEAM_1:1:43712001><T>" with "deagle" (headshot)' },
  { ts: '12:52:08', cat: 'chat',  txt: '"olof<4><STEAM_1:0:55102941><CT>" say_team "info one toxic at long"' },
  { ts: '12:52:12', cat: 'plug',  txt: '[WeaponPaints] failed to fetch skin metadata for STEAM_1:1:43712001 (timeout 5s)' },
  { ts: '12:52:30', cat: 'kill',  txt: '"zywoo•<7><STEAM_1:0:11923844><T>" killed "m0use_<2><STEAM_1:0:48211904><CT>" with "awp" (penetrated)' },
  { ts: '12:52:55', cat: 'round', txt: 'Team "CT" triggered "SFUI_Notice_Bomb_Defused" (CT "1") (T "1")' },
  { ts: '12:53:01', cat: 'rcon',  txt: '> changelevel de_inferno' },
];

const CONSOLE_HISTORY = [
  { kind: 'rcon', txt: 'status' },
  { kind: 'out',  txt: 'hostname: nokit | fra1.mm  •  map: de_mirage  •  players: 10/12  •  pubkey: 8f12..ed94' },
  { kind: 'rcon', txt: 'mp_warmuptime 15' },
  { kind: 'out',  txt: '"mp_warmuptime" = "15" ( def. "30" min. 0.000000 max. 90.000000 ) replicated - Time after a new round...' },
  { kind: 'rcon', txt: 'sv_password' },
  { kind: 'out',  txt: '"sv_password" = "********" archive notify - Password to join the server.' },
  { kind: 'rcon', txt: 'mp_warmup_end' },
  { kind: 'out',  txt: '[matchzy] warmup ended. live in 5…' },
  { kind: 'sys',  txt: '— live —' },
];

const CONFIG_TREE = {
  cfg: {
    'autoexec.cfg': { lines: 24, modified: '2d' },
    'server.cfg':   { lines: 142, modified: '1h' },
    'banned_users.cfg': { lines: 41, modified: '3h' },
    'banned_ip.cfg':    { lines: 8, modified: '7d' },
    gamemodes: {
      'gamemode_competitive.cfg': { lines: 86, modified: '12m' },
      'gamemode_competitive_server.cfg': { lines: 31, modified: '1d' },
      'gamemode_casual.cfg': { lines: 64, modified: '7d' },
      'gamemode_deathmatch.cfg': { lines: 28, modified: '14d' },
    },
    matchzy: {
      'mr12_competitive.cfg': { lines: 47, modified: '8h' },
      'live.cfg':             { lines: 19, modified: '6h' },
      'warmup.cfg':           { lines: 12, modified: '6h' },
    },
    cs_sharp: {
      'WeaponPaints.json':  { lines: 38, modified: '5d' },
      'MatchZy.json':       { lines: 71, modified: '8h' },
    },
  },
};

const COMP_CFG = `// gamemode_competitive_server.cfg
// matchzy + tournament defaults — fra1.mm
// last edit: m0use@ — 12:35

mp_maxrounds              24
mp_overtime_enable        1
mp_overtime_maxrounds     6
mp_overtime_startmoney    16000
mp_freezetime             15
mp_roundtime              1.92
mp_warmuptime             15
mp_startmoney             800
mp_maxmoney               16000
mp_buy_anywhere           0
mp_team_intro_period      0

sv_pure                   2
sv_minrate                128000
sv_maxupdaterate          128
sv_minupdaterate          128
sv_cheats                 0

// matchzy
matchzy_minimum_ready_required   5
matchzy_kick_when_no_match_loaded 0
matchzy_demo_path                "matchzy_demos"
matchzy_chat_prefix               "[\x10nokit\x01]"
`;

Object.assign(window, {
  SERVERS, PLAYERS, WATCHLIST, BANS, COMP_MAPS, WORKSHOP_MAPS,
  CVAR_GROUPS, PLUGINS, PLUGIN_ERRORS, SCHED, ADMINS, AUDIT,
  CVAR_DICT, LOG_LINES, CONSOLE_HISTORY, CONFIG_TREE, COMP_CFG,
});
