( function( api ) {

	// Extends our custom "event-management" section.
	api.sectionConstructor['event-management'] = api.Section.extend( {

		// No events for this type of section.
		attachEvents: function () {},

		// Always make the section active.
		isContextuallyActive: function () {
			return true;
		}
	} );

} )( wp.customize );

(function ($) {
    function ResetDemoSettings() {
        if (!confirm("Are you sure you want to reset demo import settings?")) return;

        $.post(ajaxurl, { action: 'event_management_reset_demo_import_settings' }, function () {
            location.reload();
        });
    }

    window.ResetDemoSettings = ResetDemoSettings;
})(jQuery);

(function ($, wp) {
    function ResetGlobalColor() {
        if (confirm("Are you sure you want to reset global color settings?")) {
            wp.customize.instance("event_management_first_color").set("#FD5056");
			wp.customize.instance("event_management_second_color").set("#1A093F");
        }
    }

    window.ResetGlobalColor = ResetGlobalColor;
})(jQuery, wp);