<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*console.log('FutabaUSA - Local Pickup Confirmation')*/

jQuery(document).ready(function ($) {
    // Function to show confirmation dialog
    function showConfirmation() {
        if (!confirm('Are you sure you want to use local pickup? The local pickup location is in Huntsville, Alabama.')) {
            // If the user cancels, uncheck the local pickup option
            $('input[name="shipping_method[0]"][value="local_pickup:30"]').prop('checked', false);
            
            var firstShippingMethod = $('input[name="shipping_method[0]"]:first');
            var secondShippingMethod = $('input[name="shipping_method"]').eq(1);
            
            if (secondShippingMethod.length &gt; 0) {
                // The first radio input control with the name "shipping_method[0]" exists
                // You can now work with the secondShippingMethod element
                secondShippingMethod.prop('checked', true);//Set it as checked
                //console.log('First Shipping Method Selected');
                //console.log(secondShippingMethod.val());
            }
        }
    }

    // Check if local pickup is selected by default
    var isLocalPickupSelected = $('input[name="shipping_method[0]"][value="local_pickup:30"]').is(':checked');

    if (isLocalPickupSelected) {
        showConfirmation();
    }

    // Listen for changes in the shipping method
    $('body').on('change', 'input[name="shipping_method[0]"]', function () {
        var isLocalPickup = $(this).val() === 'local_pickup:30';

        if (isLocalPickup) {
            showConfirmation();
        }
    });
});</pre></body></html>