/**
 * Location Selector Opener for Vendor Store Pages
 * Forces the location modal to open on vendor store pages when vendor has settings enabled
 *
 */
jQuery(document).ready(function($) {
    if (typeof wpcLocation !== "undefined") {
        // Force the modal to open
        function forceOpenVendorModal() {
            $("#wpc-location-selector-modal").css("display", "flex");
        }
        
        // Check if modal exists and force it open
        if ($("#wpc-location-selector-modal").length > 0) {
            forceOpenVendorModal();
        } else {
            setTimeout(function() {
                if ($("#wpc-location-selector-modal").length > 0) {
                    forceOpenVendorModal();
                }
            }, 100);
        }
    }
});
