-- ============================================================================
-- DragonUI - Package Default Overrides
-- Retains only selected Combuctor defaults from the imported profile.
-- ============================================================================

local addon = select(2, ...);

local profileOverrides = {
    modules = {
        chatmods = {
            tabIdleAlpha = 1,
        },
        combuctor = {
            enabled = true,
            db = {
                inventory = {
                    sets = {
                        "全部",
                        "Equipment",
                        "Usable",
                        "任务",
                        "商品",
                        "其它",
                    },
                    showBags = true,
                },
                bank = {
                    sets = {
                        "全部",
                        "Equipment",
                        "Usable",
                        "任务",
                        "商品",
                        "其它",
                    },
                    showBags = true,
                },
            },
        },
    },
};

local function deepMerge(source, target)
    for key, value in pairs(source) do
        if type(value) == "table" then
            if type(target[key]) ~= "table" then
                target[key] = {};
            end
            deepMerge(value, target[key]);
        else
            target[key] = value;
        end
    end
end

if addon.defaults and addon.defaults.profile then
    deepMerge(profileOverrides, addon.defaults.profile);
end

if addon.db and addon.db.profile then
    deepMerge(profileOverrides, addon.db.profile);
end
