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.5.0",
                date = "05/21/2026",
                sections = {
                    { label = "Added", body = [[New Bounce Style option in the Alert Notifications settings. Choose "Classic Bounce" for the original alert animation, or "Bounce" for a quicker, snappier pop when a new record lands. Your alerts keep the classic animation until you switch it.]] },
                },
            },
            {
                version = "6.4.5",
                date = "05/21/2026",
                sections = {
                    { label = "Maintenance", body = [[Maintenance release. No changes to how CritMatic tracks or displays your critical hits and normal hits.]] },
                },
            },
            {
                version = "6.4.4",
                date = "05/20/2026",
                sections = {
                    { label = "Changed", body = [[The RepMatic link in the About section of General Options now shows RepMatic's refreshed, higher-resolution icon.]] },
                },
            },
        },
    }
end

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