if select(2, ...).IS_LEGACY_CLIENT then return end -- HET-LEGACY-1207: no-op once Legacy1207 is deleted
-------------------------------------------------------------------------------
-- PersonalDefensives.lua
-- Multi-spell tracker group fed by SpellData_Buffs.lua: every spell tagged
-- "Personal Defensive" in the curated table appears in this group's
-- Defensive List (same-named IDs merge into one checkbox). SpellData is
-- the single source of truth — add/remove spells THERE.
-- No bundled voice clips (hasVoiceClips false ⇒ sound trackers offer
-- Custom Sound only).
-------------------------------------------------------------------------------
local addonName, ns = ...

local SPELLS = ns.SpellData.BuildSpellList("Personal Defensive", nil)

local allIDs = {}
local defaultSpells = {}
for _, sp in ipairs(SPELLS) do
    defaultSpells[sp.key] = true
    for _, id in ipairs(sp.ids) do
        allIDs[#allIDs + 1] = id
    end
end

ns.RegisterTracker("persdef", {
    dbPrefix      = "pd_",
    displaySpell  = 22812, -- Barkskin icon for previews/tree
    buffSpellIDs  = allIDs,
    spellList     = SPELLS,
    hasVoiceClips = false,
    frameSuffix   = "PersonalDefensives",
    label         = "Personal Defensives",
    defaultPos    = { "CENTER", "CENTER", 0, 0 },

    -- 12.1 preset (see Innervate for the sparse-table rationale). Groups
    -- default to an Icon(s) tracker with NO stacks text. Seeded on first
    -- enable.
    preset = {
        { style = "icon", iconShowStackText = false },
    },

    defaults = {
        enabled        = false,
        barCircleColor = { 0.9, 0.6, 0.2, 1.0 },
        spells         = defaultSpells,
    },
})
