<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">jQuery(document).ready(function($){
    
    
    // Awards application form - Remove Free with Subscription for non Silver and Gold members
    if (typeof subscriptionData !== 'undefined' &amp;&amp; !subscriptionData.hasSilverOrGoldSubscription) {
        // Create a mutation observer to detect changes in the DOM
        var targetNode = document.body; // Observe changes in the whole body or a specific container
        var config = { childList: true, subtree: true };

        var callback = function(mutationsList, observer) {
            // Check if the option is now in the DOM
            if ($('option[value="Free-with-Silver-and-Gold-Subscription"]').length) {
                $('option[value="Free-with-Silver-and-Gold-Subscription"]').remove();
                console.log('free option hidden');
                observer.disconnect(); // Stop observing after hiding
            }
        };

        var observer = new MutationObserver(callback);
        observer.observe(targetNode, config);
    } else {
        console.log('free not hidden');
    }


    
    
	
	document.addEventListener( 'wpcf7mailsent', function( event ) {
		// https://contactform7.com/dom-events/
  		if ( '198877' == event.detail.contactFormId || '205010' == event.detail.contactFormId || '204834' == event.detail.contactFormId) {
			  var button = document.getElementById('paypal_hidden_form_button');
			  if (button) {
				button.click();
			  } else {
				console.error('Button not found!');
			  }
  		}
	}, false );
	

	
	

	$('.bsaProSubmit').on('click', function(){
		// $(this).prop('disabled', true);
		jQuery("body").css({
	        "position": "relative",
	    });
	    jQuery(".pre_loader_wrap").css({
	        "display": "flex",
	    });
	    jQuery("body").addClass("has_loader");
	});

	$('body').on('click', '#bsa-Pro-PayPal-Payment .bsaProImgSubmit', function(e){

		var qry_vars = getUrlVars();

		$.ajax({
			type: 	"POST",
			url: 	custom_ajaxurl.ajaxurl,
			dataType:"json",
			data: 	{
				action: "init_ad_recurring_plan",
				ad_order_id: qry_vars.oid,
			},
			success: function( response ){
				console.log(response.url);
				if ( response.url ) {
					window.location.href = response.url;
				}
			}

		});

	});

	function getUrlVars() {
	    var vars = [], hash;
	    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&amp;');
	    for(var i = 0; i &lt; hashes.length; i++) {
	        hash = hashes[i].split('=');
	        vars.push(hash[0]);
	        vars[hash[0]] = hash[1];
	    }
	    return vars;
	}



	$(".search_location_static").on("change", function (e) {

		const today = new Date().getDate();
		let key;
				
		if (today &lt; 4) {key = 'AIzaSyDJiyUTRtIqxidzNeiAyrTIuetYSc86Vj8'}
		else if (today &lt; 8)  {key = 'AIzaSyBtCXmiBdw0jva-S-Naii40YNB4Y_jdhQY'}
		else if (today &lt; 12) {key = 'AIzaSyCZFz6Td2wKV17_zFnhv1HzQsoUEMPAMsc'}
		else if (today &lt; 16) {key = 'AIzaSyBJGhkKZU02g0hOseTZOOgLb786O6C-wcQ'}
		else if (today &lt; 20) {key = 'AIzaSyD7LnLp0HfTxUKnLvAZcRU_oGIXgZzYfaQ'}
		else if (today &lt; 24) {key = 'AIzaSyB_h6CyoOSIsq5uVenTALs9I-VdOsFA3oc'}
		else if (today &lt; 28) {key = 'AIzaSyDx0gRyK9ScuIfHtYGpiz_jPO4Rj1ynH90'}
		else {key = 'AIzaSyDaYGLPA42UrZFaZFHDSzWYokdTqI9cj64'}
	
		var location = encodeURIComponent($(this).val());
		var url = "https://maps.googleapis.com/maps/api/geocode/json?address="+location+"&amp;components=country:GB&amp;sensor=false&amp;key="+key;

		$.ajax({
			type: "GET",
			url: url,
			dataType: "json",
			success: processJSON
		})

		function processJSON(json) {
			var coordinates = json.results[0].geometry.location;
			$("#search_location").val(location); // desktop home and search page
			$("#search_location_mobile").val(location); // mobile search page
			$("#advanced_lat_shortcode").val(coordinates.lat); // etc
			$("#advanced_lat_mobile").val(coordinates.lat);
			$("#advanced_lng_shortcode").val(coordinates.lng);
			$("#advanced_lng_mobile").val(coordinates.lng);
		}
	})
	
	
	var $myDiv = $('.fieldset-company_logo .description');
	if ( $myDiv.length){
	    $(".fieldset-company_logo .description").after('&lt;small class="description"&gt;Maximum image resolution 800x800.&lt;/small&gt;');
	}

});</pre></body></html>