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.11.0",
                date = "06/02/2026",
                sections = {
                    { label = "Added", body = [[Your on-screen record alerts now count up. When you set a new record, the number rolls from zero up to your new best over a few seconds, then holds before fading. Prefer the old instant number? Turn off "Animate Alert Numbers" in the General options.]] },
                    { label = "Changed", body = [[Added a Discord icon to the General options so the support link is easier to spot, and updated CritMatic for Mists of Pandaria 5.5.4.]] },
                },
            },
            {
                version = "6.10.0",
                date = "06/02/2026",
                sections = {
                    { label = "Added", body = [[New ways to show CritMatic's info-bar plugin and minimap button text. You can list your top Hit before your top Crit, and pick a shorter style: numbers only (like 199/99), initials (like C:199 H:99), or short labels (like Crit: 199  Hit: 99). They are all off by default, so nothing changes unless you turn them on, and the shorter styles stay colored to match your alert colors. The hover tooltip still shows the full labels.]] },
                    { label = "Changed", body = [[Your new-record messages in chat now use the same colors you picked for the on-screen pop-up alerts.]] },
                    { label = "Fixed", body = [[The info-bar and minimap button display now updates right away when you switch settings profiles, instead of waiting until your next record.]] },
                },
            },
            {
                version = "6.9.1",
                date = "06/01/2026",
                sections = {
                    { label = "Changed", body = [[The text added in the last update is now translated into every supported language, so pet attack records, the record profiles, the info-bar hit and crit display, and the new-record threshold slider all show up in your language.]] },
                },
            },
        },
    }
end

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