local stages_util = require("notify.stages.util")
require("notify").setup({
    stages = {
        function(state)
            local next_height = state.message.height + 2
            local next_row = stages_util.available_slot(state.open_windows, next_height, stages_util.DIRECTION.TOP_DOWN)
            if not next_row then
                return nil
            end
            return {
                relative = "editor",
                anchor = "NE",
                width = 1,
                height = state.message.height,
                col = vim.opt.columns:get(),
                row = next_row,
                border = "rounded",
                style = "minimal",
            }
        end,
        function(state)
            return {
                width = { state.message.width, frequency = 2 },
                col = { vim.opt.columns:get() },
            }
        end,
        function()
            return {
                col = { vim.opt.columns:get() },
                time = true,
            }
        end,
        function()
            return {
                width = {
                    1,
                    frequency = 2.5,
                    damping = 0.9,
                    complete = function(cur_width)
                        return cur_width < 2
                    end,
                },
                col = { vim.opt.columns:get() },
            }
        end,
    },
    background_colour = "Normal",
    fps = 15,
    icons = {
        DEBUG = "",
        ERROR = "",
        INFO = "",
        TRACE = "✎",
        WARN = "",
    },
    level = 2,
    minimum_width = 50,
    render = "default",
    timeout = 5000,
    top_down = false,
})
