!function(e){"use strict";var t="frontend/element_ready/proradio-elementor-weather.default",n=null,r=null,a=!1,o=!1;function i(){return window.ProradioWeatherWidget||{}}function l(){try{if(window.parent&&window.parent!==window&&window.parent.document)return window.parent}catch(e){return window}return window}function c(){return l().jQuery||e}function u(){return l().document||document}function d(e){return String(null==e?"":e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function s(e){var t=c(),n=u();return t(['#elementor-panel [data-setting="'+e+'"]','#elementor-controls [data-setting="'+e+'"]',".elementor-control-"+e+' [data-setting="'+e+'"]','[data-setting="'+e+'"]'].join(","),n).filter("input, textarea, select").last()}function h(){var e=l().elementor||window.elementor||null,t=null;if(!e)return null;try{if(e.getPanelView&&e.getPanelView().getCurrentPageView&&e.getPanelView().getCurrentPageView()){var n=e.getPanelView().getCurrentPageView();n&&n.model&&"function"==typeof n.model.setSetting&&(t=n.model)}}catch(e){}if(!t)try{if(e.channels&&e.channels.editor){var r=e.channels.editor.request("panel:editor:widget:view");r&&r.model&&"function"==typeof r.model.setSetting&&(t=r.model)}}catch(e){}return t}function p(e,t){var n=null==t?"":String(t),r=s(e),a=h();if(r.length,a)try{a.setSetting(e,n)}catch(e){}r.length&&(r.val(n),r.trigger("input"),r.trigger("change"))}function g(){var t=s("weather_city_search").val()||"",n=s("weather_country_search").val()||"";return 2!==(n=e.trim(n).toUpperCase().replace(/[^A-Z]/g,"")).length&&(n=""),{q:e.trim(t),country:n}}function f(){return{parentMode:l()!==window,panelFound:c()("#elementor-panel",u()).first().length,cityInputFound:s("weather_city_search").length,countrySearchInputFound:s("weather_country_search").length,labelInputFound:s("weather_location_label").length,latInputFound:s("weather_lat").length,lonInputFound:s("weather_lon").length,modelFound:!!h(),boundParentPanel:a}}function w(){var e=c(),t=function(e){var t=c(),n=u(),r=s(e);if(r.length){var a=r.closest(".elementor-control-"+e);if(a.length)return a;if((a=r.closest(".elementor-control")).length)return a}return t(".elementor-control-"+e,n).last()}("weather_city_search");if(!t.length)return f(),e();var n=t.find(".proradio-weather-panel-results").first();return n.length||(n=e('<div class="proradio-weather-panel-results" style="margin-top:8px;"></div>'),t.append(n)),n}function m(){var e=w();e.length&&e.empty()}function y(e,t,n){var r=w();if(r.length){var a='<div class="proradio-weather-panel-status'+(n?" proradio-weather-panel-status-loading":"")+'" style="padding:8px;border:1px solid #ccd0d4;background:#fff;font-size:11px;line-height:1.4;color:#1d2327;">';n&&(a+='<span class="proradio-weather-panel-spinner" aria-hidden="true"></span>'),a+="<strong>"+d(e)+"</strong>",a+="</div>",r.html(a)}}function _(e){var t=w();if(t.length)if(e&&e.length){var n='<div style="padding:7px 8px;border:1px solid #2271b1;background:#f0f6fc;color:#1d2327;margin-bottom:6px;font-size:11px;"><strong>Select a city:</strong> '+e.length+" result(s)</div>";e.forEach((function(e,t){var r=[];e.country&&r.push(e.country),e.admin1&&r.push("state: "+e.admin1),e.population&&r.push("pop. "+e.population),n+='<button type="button" class="proradio-weather-result-item" data-index="'+t+'" style="display:block;width:100%;text-align:left;padding:9px 10px;margin:0 0 6px;border:1px solid #135e96;background:#2271b1;color:#fff;cursor:pointer;border-radius:3px;box-shadow:none;">',n+='<strong style="color:#fff;">'+d(e.label||e.name||"Unknown")+"</strong>",n+=r.length?'<br><small style="color:#eaf6ff;">'+d(r.join(" · "))+"</small>":"",n+='<br><small style="color:#eaf6ff;">lat '+d(e.lat||"")+" / lon "+d(e.lon||"")+"</small>",n+="</button>"})),t.html(n),t.find(".proradio-weather-result-item").each((function(t){c()(this).data("location",e[t])}))}else t.html('<div style="padding:8px;border:1px solid #ccd0d4;background:#fff;color:#1d2327;">No cities found.</div>')}function v(t){var n=i(),a=g();if(!0!==n.release_date&&"true"!==n.release_date&&1!==n.release_date&&"1"!==n.release_date)return y("Forbidden."),n.release_date,void n.remote_check;if(n.apiUrl,n.version,n.licenseKey,n.apiUrl)if(!a.q||a.q.length<2)y("Type at least 2 characters.");else{var o=a.q.toLowerCase()+"|"+a.country;o,r&&4!==r.readyState&&r.abort();var l={license_key:n.licenseKey||"PRORADIO-WEATHER-TEST",q:a.q,country:a.country,limit:10,remote_check:n.remote_check?"1":"0",samurai_entitlement:n.samurai_entitlement||""};y("Searching weather.pro.radio...",(l.q,l.country,l.limit),!0),(r=e.ajax({url:n.apiUrl,method:"POST",data:l,dataType:"json",cache:!1,timeout:15e3})).done((function(e,t,n){if(n.status,!e||!0!==e.success)return y("API returned an error."),void _([]);_(e.results||[])})),r.fail((function(e,t,n){var r=e&&e.responseText?e.responseText:"";try{r?JSON.parse(r):null}catch(e){e.message}y("Online API request failed.",(e&&e.status,!e||e.status)),_([])}))}else y("Missing API URL.")}function b(t,n){return t=(t=(t=String(null==t?"":t)).replace(/[<>]/g,"")).replace(/[\u0000-\u001F\u007F]/g,""),n=n||160,(t=e.trim(t)).length>n&&(t=t.substring(0,n)),t}function x(e){return e=parseFloat(e),isFinite(e)?String(Math.round(1e4*e)/1e4):""}function P(e){if(e){clearTimeout(n);var t,r=(new Date).toISOString();p("weather_location_label",b(e.label||e.name||"",180)),p("weather_location_id",b(e.id||"",32)),p("weather_country",2===(t=b(t=e.country||"",8).toUpperCase().replace(/[^A-Z]/g,"")).length?t:""),p("weather_admin1",b(e.admin1||"",32)),p("weather_lat",x(e.lat)),p("weather_lon",x(e.lon)),p("weather_timezone",function(e){return e=(e=b(e,64)).replace(/[^A-Za-z0-9_\/+\-]/g,"")}(e.timezone||"")),p("weather_population",function(e){return e=parseInt(e,10),!isFinite(e)||e<0?"":String(e)}(e.population)),p("weather_selected_date",b(r,32)),m();var a=s("weather_city_search");a.length&&a.val(""),e.label||e.name,e.id,e.country,e.admin1,e.lat,e.lon,e.timezone,e.population}}function S(){!function(){if(!o){o=!0;var e=c(),t=u();e(t).off("input.proradioWeather keyup.proradioWeather",'[data-setting="weather_city_search"], [data-setting="weather_country_search"]').on("input.proradioWeather keyup.proradioWeather",'[data-setting="weather_city_search"], [data-setting="weather_country_search"]',(function(t){if(!t.originalEvent)return t.type,e(this).attr("data-setting"),void e(this).val();t.type,e(this).attr("data-setting"),e(this).val(),g(),clearTimeout(n),g().q.length>=2?(y("Searching in 2 seconds...",0,!0),n=setTimeout((function(){v()}),2e3)):m()})),e(t).off("click.proradioWeather",".proradio-weather-result-item").on("click.proradioWeather",".proradio-weather-result-item",(function(t){t.preventDefault(),t.stopPropagation(),clearTimeout(n);var r=e(this).data("location");P(r)})),a=!0,i().debug&&window.ProradioWeatherVerbose&&f()}}(),i().debug&&window.ProradioWeatherVerbose&&f()}function k(e){e&&e.length&&e.data("id"),S()}e(window).on("elementor/frontend/init",(function(){window.elementorFrontend&&window.elementorFrontend.hooks&&window.elementorFrontend.hooks.addAction(t,k)})),e(document).ready((function(){i(),l(),window,S(),window.ProradioWeatherDebug={config:i,report:function(){var e=f();return e},search:function(){v()},setTest:function(){p("weather_city_search","Ibiza"),p("weather_country_search","ES"),v()}}}))}(jQuery);
(()=>{"use strict";const e="email",t="phone",n="name",l={[e]:["email","e-mail","mail","email address"],[t]:["phone","tel","mobile","cell","telephone","phone number"],[n]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function r(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function a(e){const t=r(e),n=t.lastIndexOf("@");if(-1===n)return t;const l=t.slice(n+1);return["gmail.com","googlemail.com"].includes(l)?`${t.slice(0,n).replace(/\./g,"")}@${l}`:t}function i(e){const t=r(e),n=t.replace(/\D/g,"");return t.startsWith("+")?`+${n}`:n}function s(e){const t=e.filter(e=>{let{type:t}=e;return t===n}).map(e=>{let{value:t}=e;return r(t)}).filter(Boolean);if(!t.length)return;const[l,...a]=1===t.length?t[0].split(" "):t;return{first_name:l,...a?.length>0?{last_name:a.join(" ")}:{}}}function u(t){return t.find(t=>{let{type:n}=t;return n===e})?.value}function o(e){return e.find(e=>{let{type:n}=e;return n===t})?.value}globalThis.document.addEventListener("wpcf7mailsent",m=>{const c=globalThis._googlesitekit?.gtagUserData,f=c?function(m){if(!(m&&m instanceof HTMLFormElement))return;const c=new FormData(m);return function(e){const t=[["address",s(e)],["email",u(e)],["phone_number",o(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(Array.from(c.entries()).map(s=>{let[u,o]=s;const c=m.querySelector(`[name='${u}']`),f=c?.type;return"hidden"===f||"submit"===f?null:function(s){let{type:u,name:o,value:m,label:c}=s||{};switch(u=r(u),o=r(o),m=r(m),c=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(c),u){case"email":return{type:e,value:a(m)};case"tel":return{type:t,value:i(m)}}return function(e){if(!e)return!1;const t=a(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(m)||l[e].includes(o)||l[e].includes(c)?{type:e,value:a(m)}:l[t].includes(o)||l[t].includes(c)?{type:t,value:i(m)}:l[n].includes(o)||l[n].includes(c)?{type:n,value:r(m)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=i(e);if(!/^\+?\d{7,}$/.test(t))return!1;const n=/[\s\-()+.]/.test(e),l=e.trim().startsWith("+");return!(!n&&!l)}(m)?{type:t,value:i(m)}:null}({type:f,label:c?.id?m.querySelector(`label[for='${c?.id}']`)?.textContent:void 0,name:u,value:o})}).filter(Boolean))}(m.target):null;globalThis._googlesitekit?.gtagEvent?.("contact",{event_category:m.detail.contactFormId,event_label:m.detail.unitTag,...f?{user_data:f}:{}})})})();
(()=>{"use strict";const e="email",t="phone",n="name",r={[e]:["email","e-mail","mail","email address"],[t]:["phone","tel","mobile","cell","telephone","phone number"],[n]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function l(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function a(e){const t=l(e),n=t.lastIndexOf("@");if(-1===n)return t;const r=t.slice(n+1);return["gmail.com","googlemail.com"].includes(r)?`${t.slice(0,n).replace(/\./g,"")}@${r}`:t}function i(e){const t=l(e),n=t.replace(/\D/g,"");return t.startsWith("+")?`+${n}`:n}function s(e){const t=e.filter(e=>{let{type:t}=e;return t===n}).map(e=>{let{value:t}=e;return l(t)}).filter(Boolean);if(!t.length)return;const[r,...a]=1===t.length?t[0].split(" "):t;return{first_name:r,...a?.length>0?{last_name:a.join(" ")}:{}}}function u(t){return t.find(t=>{let{type:n}=t;return n===e})?.value}function o(e){return e.find(e=>{let{type:n}=e;return n===t})?.value}var m;(m=globalThis.jQuery)&&m(globalThis.document.body).on("wpformsAjaxSubmitSuccess",m=>{const c=globalThis._googlesitekit?.gtagUserData,f=c?function(m){if(!(m&&m instanceof HTMLFormElement))return;const c=new FormData(m);return function(e){const t=[["address",s(e)],["email",u(e)],["phone_number",o(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(Array.from(c.entries()).map(s=>{let[u,o]=s,c=m.querySelector(`[name='${u}']`);"hidden"===c?.type&&"hidden"!==c?.previousSibling?.type&&(c=c.previousSibling);const f=c?.type;return"hidden"===f||"submit"===f?null:function(s){let{type:u,name:o,value:m,label:c}=s||{};switch(u=l(u),o=l(o),m=l(m),c=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(c),u){case"email":return{type:e,value:a(m)};case"tel":return{type:t,value:i(m)}}return function(e){if(!e)return!1;const t=a(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(m)||r[e].includes(o)||r[e].includes(c)?{type:e,value:a(m)}:r[t].includes(o)||r[t].includes(c)?{type:t,value:i(m)}:r[n].includes(o)||r[n].includes(c)?{type:n,value:l(m)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=i(e);if(!/^\+?\d{7,}$/.test(t))return!1;const n=/[\s\-()+.]/.test(e),r=e.trim().startsWith("+");return!(!n&&!r)}(m)?{type:t,value:i(m)}:null}({type:f,label:c?.id?m.querySelector(`label[for='${c?.id}']`)?.textContent:void 0,name:u,value:o})}).filter(Boolean))}(m.target):null;globalThis._googlesitekit?.gtagEvent?.("submit_lead_form",f?{user_data:f}:void 0)})})();