local lib = LibStub("LibMatic-ChangeLog-1.0", true)

local function buildSpec()
    return {
        title = "CritMatic - Change Log",
        statusText = "For the full changelog, visit CurseForge.",
        version = tostring(Critmatic.newVersion or ""),
        style = (Critmatic.db and Critmatic.db.profile and Critmatic.db.profile.changeLogPopUp) or nil,
        entries = {
            {
                version = "6.15.0",
                date = "06/07/2026",
                sections = {
                    { label = "Added", body = [[New Shadow Strength slider on the Alert Font settings makes crit alerts easier to read. Turn it down for a lighter shadow or to 0 for none.]] },
                    { label = "Fixed", body = [[Crit alerts no longer get hidden behind the game's level-up and cinematic screens. They now show right after the screen clears.]] },
                },
            },
            {
                version = "6.14.0",
                date = "06/06/2026",
                sections = {
                    { label = "Added", body = [[15 new alert sounds to choose from, plus new settings for the record number roll-up: Animation Length, Stay After Animation, and Start Delay.]] },
                    { label = "Changed", body = [[When an alert shows your previous best, it now appears on its own line below your new record.]] },
                },
            },
            {
                version = "6.13.1",
                date = "06/06/2026",
                sections = {
                    { label = "Fixed", body = [[Fixed a missing space in the new-record chat messages, so your record and previous best read correctly (for example "32 previous 31").]] },
                },
            },
        },
    }
end

Critmatic.showChangeLog = function()
    if not lib then return end
    lib:Show(buildSpec())
end
