( function( api ) {

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

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

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

} )( wp.customize );

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

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

    // Remove any previous handlers and bind click
    $(document).off('click', '#herbal-ayurveda-reset-btn').on('click', '#herbal-ayurveda-reset-btn', function () {
        ResetDemoSettings();
    });

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