(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'building_construction_lite_primary_color': '#f7a238',
            'building_construction_lite_heading_color': '#1d1d1d',
            'building_construction_lite_text_color': '#787878',
            'building_construction_lite_primary_fade': '#fff2e2',
            'construction_firm_home_sec_bg' :'#efefef',
            'building_construction_lite_footer_bg': '#1d1d1d',
            'construction_firm_post_bg': '#ffffff',
        };

        // Iterate over each setting and set it to its default value
        for (let settingId in defaultColors) {
            wp.customize(settingId).set(defaultColors[settingId]);
        }

        // Optionally refresh the preview
        wp.customize.previewer.refresh();
    }

    // Attach reset function to global scope
    window.resetColorsToDefault = resetColorsToDefault;

    $(document).ready(function() {
        $('.color-reset-btn').val('RESET'); // This adds the 'RESET' text inside the button
    });
})(jQuery);