---@class addonTablePlatynator
local addonTable = select(2, ...)

local function GetColor(rgb, a)
  local color = CreateColorFromRGBHexString(rgb)
  return {r = color.r, g = color.g, b = color.b, a = a}
end

addonTable.CustomiseDialog.DesignWidgets = {
  {
    name = addonTable.Locales.BARS,
    special = "header",
  },
  {
    name = addonTable.Locales.HEALTH,
    kind = "bars",
    default = {
      kind = "health",
      anchor = {"TOPLEFT", -140, 50},
      scale = 1,
      layer = 1,
      aggroColoursOnHostiles = true,
      background = {
        asset = "wide/fade-bottom",
        color = GetColor("FFFFFF", 1),
        applyColor = false,
      },
      foreground = {
        asset = "wide/fade-bottom",
      },
      border = {
        asset = "wide/bold",
        color = GetColor("000000", 1)
      },
      absorb = {
        asset = "wide/blizzard-absorb",
        color = GetColor("FFFFFF", 1)
      },
      marker = {
        asset = "none",
      },
      autoColors = {
        CopyTable(addonTable.CustomiseDialog.ColorsConfig["classColors"].default),
        CopyTable(addonTable.CustomiseDialog.ColorsConfig["tapped"].default),
        CopyTable(addonTable.CustomiseDialog.ColorsConfig["threat"].default),
        CopyTable(addonTable.CustomiseDialog.ColorsConfig["reaction"].default),
      }
    },
  },
  {
    name = addonTable.Locales.CAST,
    kind = "bars",
    default = {
      kind = "cast",
      anchor = {"TOPLEFT", -140, 50},
      colors = {
        normal = GetColor("FC8C00"),
        normalChannel = GetColor("3ec637"),
        uninterruptable = GetColor("83C0C3"),
        interrupted = CreateColorFromRGBHexString("FC36E0"),
      },
      marker = {
        asset = "none",
      },
      background = {
        asset = "wide/fade-bottom",
        color = GetColor("FFFFFF", 1),
        applyColor = false,
      },
      foreground = {
        asset = "wide/fade-bottom",
      },
      border = {
        asset = "wide/bold",
        color = GetColor("000000", 1)
      },
      scale = 1,
      layer = 1,
    },
  },
  {
    name = addonTable.Locales.POWER,
    kind = "specialBars",
    default = {
      kind = "power",
      blank = "normal/soft-faded",
      filled = "normal/soft-full",
      scale = 1 * 0.60,
      layer = 3,
      anchor = {"TOPLEFT", -140, 50},
    },
  },
  {
    name = addonTable.Locales.HIGHLIGHTS,
    special = "header",
  },
  {
    name = addonTable.Locales.AUTOMATIC,
    kind = "highlights",
    default = {
      anchor = {"TOPLEFT", -140, 50},
      kind = "automatic",
      asset = "wide/soft-glow",
      color = GetColor("FFFFFF", 1),
      autoColors = {
        addonTable.CustomiseDialog.AddAlphaToColors(CopyTable(addonTable.CustomiseDialog.ColorsConfig["threat"].default)),
      },
      scale = 1,
      layer = 3,
    },
  },
  {
    name = addonTable.Locales.TARGETED,
    kind = "highlights",
    default = {
      anchor = {"TOPLEFT", -140, 50},
      kind = "target",
      asset = "wide/glow",
      color = GetColor("FFFFFF", 1),
      scale = 1,
      layer = 0,
    },
  },
  {
    name = addonTable.Locales.FOCUSED,
    kind = "highlights",
    default = {
      anchor = {"TOPLEFT", -140, 50},
      kind = "focus",
      asset = "wide/glow",
      color = GetColor("FFFFFF", 1),
      scale = 1,
      layer = 0,
    },
  },
  {
    name = addonTable.Locales.MOUSEOVER,
    kind = "highlights",
    default = {
      anchor = {"TOPLEFT", -140, 50},
      kind = "mouseover",
      asset = "wide/glow",
      color = GetColor("AAAAAA", 1),
      scale = 1,
      layer = 0,
    },
  },
  {
    name = addonTable.Locales.AURAS,
    special = "header",
  },
  {
    name = addonTable.Locales.DEBUFFS,
    kind = "auras",
    noDuplicates = true,
    default = {
      kind = "debuffs",
      anchor = {"TOPLEFT", -140, 50},
      scale = 1,
      height = 1,
      showCountdown = true,
      direction = "RIGHT",
    },
  },
  {
    name = addonTable.Locales.BUFFS,
    kind = "auras",
    noDuplicates = true,
    default = {
      kind = "buffs",
      anchor = {"TOPLEFT", -140, 50},
      scale = 1,
      height = 1,
      showCountdown = true,
      direction = "LEFT",
    },
  },
  {
    name = addonTable.Locales.CROWD_CONTROL,
    kind = "auras",
    noDuplicates = true,
    default = {
      kind = "crowdControl",
      anchor = {"TOPLEFT", -140, 50},
      scale = 1,
      height = 1,
      showCountdown = true,
      direction = "RIGHT",
    },
  },
  {
    name = addonTable.Locales.TEXTS,
    special = "header",
  },
  {
    name = addonTable.Locales.CREATURE_NAME,
    kind = "texts",
    default = {
      kind = "creatureName",
      scale = 1.1,
      layer = 2,
      anchor = {"TOPLEFT", -140, 50},
      widthLimit = 124,
      color = GetColor("FFFFFF"),
      align = "CENTER",
      shorten = "NONE",
      truncate = false,
      autoColors = {}
    },
  },
  {
    name = addonTable.Locales.GUILD,
    kind = "texts",
    default = {
      kind = "guild",
      scale = 1,
      layer = 2,
      anchor = {"TOPLEFT", -140, 50},
      widthLimit = 124,
      color = GetColor("FFFFFF"),
      align = "CENTER",
      shorten = "NONE",
      truncate = false,
    },
  },
  {
    name = addonTable.Locales.HEALTH_VALUE,
    kind = "texts",
    default = {
      kind = "health",
      scale = 0.98,
      layer = 2,
      anchor = {"TOPLEFT", -140, 50},
      displayTypes = {"percentage"}, -- or "absolute", or both
      color = GetColor("FFFFFF"),
      align = "CENTER",
      shorten = "NONE",
      truncate = false,
    },
  },
  {
    name = addonTable.Locales.CAST_NAME,
    kind = "texts",
    default = {
      kind = "castSpellName",
      scale = 1,
      layer = 2,
      anchor = {"TOPLEFT", -140, 50},
      color = GetColor("FFFFFF"),
      align = "CENTER",
      shorten = "NONE",
      truncate = false,
      colors = {
        npc = {
          friendly = GetColor("00FF00"),
          neutral = GetColor("FFFF00"),
          hostile = GetColor("FF0000"),
          tapped = GetColor("6E6E6E"),
        },
      },
    },
  },
  {
    name = addonTable.Locales.LEVEL,
    kind = "texts",
    default = {
      kind = "level",
      scale = 1,
      layer = 2,
      anchor = {"TOPLEFT", -140, 50},
      color = GetColor("FFFFFF"),
      align = "CENTER",
      shorten = "NONE",
      truncate = false,
      autoColors = {
        CopyTable(addonTable.CustomiseDialog.ColorsConfig["difficulty"].default),
      }
    },
  },
  {
    name = addonTable.Locales.TARGET,
    kind = "texts",
    default = {
      kind = "target",
      scale = 1,
      layer = 2,
      anchor = {"TOPLEFT", -140, 50},
      color = GetColor("FFFFFF"),
      applyClassColors = true,
      align = "CENTER",
      shorten = "NONE",
      truncate = false,
    },
  },
  {
    name = addonTable.Locales.CAST_TARGET,
    kind = "texts",
    default = {
      kind = "castTarget",
      scale = 1,
      layer = 2,
      anchor = {"TOPLEFT", -140, 50},
      color = GetColor("FFFFFF"),
      applyClassColors = true,
      align = "CENTER",
      shorten = "NONE",
    },
  },
  {
    name = addonTable.Locales.ICONS,
    special = "header",
  },
  {
    name = addonTable.Locales.QUEST_OBJECTIVE,
    kind = "markers",
    default = {
      kind = "quest",
      scale = 1 * 0.9,
      layer = 3,
      asset = "normal/quest-blizzard",
      color = GetColor("ffffff"),
      anchor = {"TOPLEFT", -140, 50},
    },
  },
  {
    name = addonTable.Locales.CAST,
    kind = "markers",
    default = {
      kind = "castIcon",
      scale = 1,
      layer = 3,
      asset = "normal/cast-icon",
      color = GetColor("ffffff"),
      anchor = {"TOPLEFT", -140, 50},
    },
  },
  {
    name = addonTable.Locales.CANNOT_INTERRUPT,
    kind = "markers",
    default = {
      kind = "cannotInterrupt",
      scale = 1 * 0.5,
      layer = 3,
      asset = "normal/shield-soft",
      color = GetColor("647b7f"),
      anchor = {"TOPLEFT", -140, 50},
    },
  },
  {
    name = addonTable.Locales.ELITE,
    kind = "markers",
    default = {
      kind = "elite",
      scale = 1 * 0.8,
      layer = 3,
      asset = "special/blizzard-elite-midnight",
      color = GetColor("ffffff"),
      anchor = {"TOPLEFT", -140, 50},
    },
  },
  {
    name = addonTable.Locales.RARE,
    kind = "markers",
    default = {
      kind = "rare",
      scale = 1,
      layer = 3,
      asset = "normal/blizzard-rare-midnight",
      color = GetColor("ffffff"),
      anchor = {"TOPLEFT", -140, 50},
    },
  },
  {
    name = addonTable.Locales.PVP,
    kind = "markers",
    default = {
      kind = "pvp",
      scale = 1,
      layer = 3,
      asset = "normal/blizzard-pvp",
      color = GetColor("ffffff"),
      anchor = {"TOPLEFT", -140, 50},
    },
  },
  {
    name = addonTable.Locales.RAID_MARKER,
    kind = "markers",
    default = {
      kind = "raid",
      scale = 1,
      layer = 3,
      asset = "normal/blizzard-raid",
      color = GetColor("ffffff"),
      anchor = {"TOPLEFT", -140, 50},
    },
  },
}
