local DR = select(2, ...)
local constants = DR.Modules and DR.Modules["Core.Constants"]

local defaults = {
  global = {
    schemaVersion = constants and constants.VERSION.SCHEMA or 1,
    protocolVersion = constants and constants.VERSION.PROTOCOL or 1,
    logs = {},
    identityByGuid = {},
    guidByDisplay = {},
    weightLedger = {},
    weeklyLedger = {
      lastResetToken = nil,
    },
    bossLedger = {},
    auditEvents = {},
    commStats = {
      sent = 0,
      acked = 0,
      retried = 0,
      dropped = 0,
      duplicates = 0,
      pruned = 0,
    },
    deferredTrades = {},
    deferredTradeOrder = {},
    activeRaid = {},
  },
  profile = {
    debugEnabled = false,
    versionGateStrict = true,
    fallbackChatEnabled = true,
    fallbackChatChannel = "RAID",
    autoMarkTradedFromTrade = true,
    autoTradeItems = true,
    autoAcceptTrade = true,
    autoTimeoutDeferredTrades = true,
    deferredTradeTimeoutMinutes = 120,
    sessionTimeoutSeconds = 60,
    autoPassEnabled = true,
    autoAddLoot = true,
    autoAddLootMinQuality = 4,
    minWeight = constants and constants.ROLL.MIN_WEIGHT or 1,
    maxWeight = constants and constants.ROLL.MAX_WEIGHT or 200,
    startingWeight = constants and constants.ROLL.START_WEIGHT or 100,
    winnerPenaltyFactor = constants and constants.ROLL.WINNER_PENALTY_FACTOR or 0.60,
    bossRegain = constants and constants.ROLL.BOSS_REGAIN or 5,
    benchBossRegain = constants and constants.ROLL.BENCH_BOSS_REGAIN or 12.5,
    weeklyRegain = constants and constants.ROLL.WEEKLY_REGAIN or 0,
    ui = {
      throttleSeconds = 0.15,
      showRollOffModal = true,
      positions = {},
      toolbarShown = true,
      toolbarLocked = false,
    },
  },
}

DR:RegisterModule("Core.Defaults", defaults)
