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.23.1",
                date = "06/15/2026",
                sections = {
                    { label = "Changed", body = [[The Olie and Fo Shizzle alert sounds have been updated. If you use one of them, you will hear the refreshed version.]] },
                },
            },
            {
                version = "6.23.0",
                date = "06/15/2026",
                sections = {
                    { label = "Changed", body = [[The Tooltip tab has been removed from the options for now while it gets reworked. Your Crit Log and Broker appearance options are unchanged, and any settings you already saved are kept.]] },
                },
            },
            {
                version = "6.22.1",
                date = "06/14/2026",
                sections = {
                    { label = "Fixed", body = [[The Crit Log now fills in with your records as soon as you log in, instead of sometimes coming up with only the spell icons and no names or numbers until you reloaded. The Crit and Hit lines CritMatic adds to your ability tooltips no longer change the font of the rest of the tooltip. And an error message that could appear when you logged in is fixed.]] },
                },
            },
        },
    }
end

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