(()=>{var e={799:()=>{window.WPConsent={displayChecks:[],checksPassed:!0,settingsHooks:[],settingsProcessed:!1,listeners:[],lastPreferences:null,registerListener:function(e){if(this.listeners.push(e),this.lastPreferences)try{e(this.lastPreferences)}catch(e){console.error("Error in WPConsent listener:",e)}},registerDisplayCheck:function(e){this.displayChecks.push(e),this.checksPassed=!1},registerSettingsHook:function(e){this.settingsHooks.push(e),this.settingsProcessed=!1},runDisplayChecks:function(){return 0===this.displayChecks.length?(this.checksPassed=!0,Promise.resolve()):Promise.all(this.displayChecks.map((e=>e()))).then((()=>(this.checksPassed=!0,Promise.resolve()))).catch((e=>(console.error("Error in WPConsent display check:",e),this.checksPassed=!0,Promise.resolve())))},runSettingsHooks:function(){return 0===this.settingsHooks.length?(this.settingsProcessed=!0,Promise.resolve()):Promise.all(this.settingsHooks.map((e=>e(window.wpconsent)))).then((()=>(this.settingsProcessed=!0,Promise.resolve()))).catch((e=>(console.error("Error in WPConsent settings hook:",e),this.settingsProcessed=!0,Promise.resolve())))},hooks:{beforeShowPreferences:[],afterShowPreferences:[],beforeHideBanner:[],afterHideBanner:[],beforeShowBanner:[],afterShowBanner:[],accordionToggled:[]},addHook:function(e,t){this.hooks[e]&&this.hooks[e].push(t)},runHooks:function(e,...t){this.hooks[e]&&this.hooks[e].length>0&&this.hooks[e].forEach((o=>{try{o(...t)}catch(t){console.error(`Error in WPConsent hook ${e}:`,t)}}))},showToast:function(e,t=2500){const o=this.shadowRoot.querySelector("#wpconsent-gpc-toast");if(!o)return;const n=o.querySelector(".wpconsent-toast-message");n&&e&&(n.textContent=e),o.style.display="block",setTimeout((()=>{o.classList.add("wpconsent-toast-visible")}),10);const s=()=>{o.classList.remove("wpconsent-toast-visible"),setTimeout((()=>{o.style.display="none"}),300)},c=setTimeout(s,t),r=o.querySelector(".wpconsent-toast-close");r&&(r.onclick=()=>{clearTimeout(c),s()})},highlightGPCOverride:function(){const e=this.shadowRoot.querySelector("#wpconsent-gpc-override-toggle-label"),t=this.shadowRoot.querySelector("#wpconsent-gpc-override-checkbox"),o=this.shadowRoot.querySelector("#wpconsent-gpc-override-container");e&&(e.classList.add("wpconsent-gpc-override-error"),e.classList.add("wpconsent-shake"),setTimeout((()=>{e.classList.remove("wpconsent-shake")}),300),t&&t.focus(),o&&setTimeout((()=>{o.scrollIntoView({behavior:"smooth",block:"center"})}),100),t&&t.addEventListener("change",(function(){t.checked&&e.classList.remove("wpconsent-gpc-override-error")}),{once:!0}))},acceptAll:function(){const e={};Array.isArray(wpconsent.slugs)&&wpconsent.slugs.forEach((t=>{e[t]=!0})),this.savePreferences(e),this.closePreferences()},checkGPC:function(){if(!wpconsent.respect_gpc||!0!==navigator.globalPrivacyControl)return;const e=this.getCookie("wpconsent_preferences");let t={};if(e)try{t=JSON.parse(e)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}if(t.hasOwnProperty("respect_gpc"))return;const o={};if(wpconsent.slugs.forEach((e=>{const t=this.shadowRoot?.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${e}"]`);t&&t.disabled?o[e]=!0:o[e]=!1})),o.essential=!0,o.respect_gpc=!0,this.savePreferences(o,!0),!1!==wpconsent.gpc_toast_enabled){const e=wpconsent.gpc_toast_message||"GPC Signal Honored",t=wpconsent.gpc_toast_duration||1e4;this.showToast(e,t)}this.checksPassed=!1},savePreferences:function(e,t=!1){const o=this.getCookie("wpconsent_preferences");let n=!1,s=null;if(o)try{s=JSON.parse(o)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}if(wpconsent.respect_gpc&&!t&&s){const t=!0===navigator.globalPrivacyControl,o=!0===s.respect_gpc;if(t&&o){const t=this.shadowRoot.querySelector("#wpconsent-gpc-override-checkbox");if(t&&!t.checked)return void this.highlightGPCOverride();e.respect_gpc=!1}}t||(s&&JSON.stringify(s)!==JSON.stringify(e)||wpconsent.default_allow&&Object.values(e).some((e=>!1===e)))&&(this.clearCookies(),n=!0),wpconsent.respect_gpc&&!t&&s&&s.hasOwnProperty("respect_gpc")&&(e.respect_gpc=!1),this.setCookie("wpconsent_preferences",JSON.stringify(e),wpconsent.consent_duration),this.hideBanner(),this.closePreferences(),this.unlockScripts(e),this.unlockIframes(e),this.showFloatingButtonIfEnabled(),this.updateWordPressConsent(e),window.dispatchEvent(new CustomEvent("wpconsent_consent_saved",{detail:e})),o&&window.dispatchEvent(new CustomEvent("wpconsent_consent_updated",{detail:e})),n&&(Object.defineProperty(document,"cookie",{get:function(){return""},set:function(e){}}),window.location.reload())},showPreferences:function(){const e=this.shadowRoot?.querySelector("#wpconsent-preferences-modal");if(e){e.style.display="flex",this.setupFocusTrap(e),this.runHooks("afterShowPreferences");const t=this.shadowRoot?.querySelector("#wpconsent-preferences-title");t&&setTimeout((()=>{t.focus({preventScroll:!0}),this.lastFocusedElement=t}),100);const o=this.getCookie("wpconsent_preferences");if(o)try{const e=JSON.parse(o);this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]').forEach((t=>{let o=null;o=t.id.startsWith("cookie-category-")?t.id.replace("cookie-category-",""):t.id.startsWith("cookie-service-")?t.id.replace("cookie-service-",""):t.value,o&&o in e&&(t.checked=e[o])}));const t=this.shadowRoot.querySelector("#wpconsent-gpc-override-container");if(t){const o=!0===navigator.globalPrivacyControl,n=e&&!0===e.respect_gpc;t.style.display=o&&n?"block":"none"}}catch(e){console.error("Error parsing WPConsent preferences:",e)}}},closePreferences:function(){const e=this.shadowRoot?.querySelector("#wpconsent-preferences-modal");e&&(e.style.display="none",this.removeFocusTrap(),this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus({preventScroll:!0}),this.previouslyFocusedElement=null))},showBanner:function(){if(!wpconsent.enable_consent_banner)return;const e=this.shadowRoot?.querySelector("#wpconsent-banner-holder");e&&(this.runHooks("beforeShowBanner"),e.classList.add("wpconsent-banner-visible"),this.updateButtonVisibility(wpconsent),this.setupFocusTrap(e),this.runHooks("afterShowBanner"))},hideBanner:function(){const e=this.shadowRoot?.querySelector("#wpconsent-banner-holder");e&&(this.runHooks("beforeHideBanner"),e.classList.remove("wpconsent-banner-visible"),this.removeFocusTrap(),this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus({preventScroll:!0}),this.previouslyFocusedElement=null),this.runHooks("afterHideBanner"))},setCookie:function(e,t,o){let n="";if(o>0){const e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3),n="expires="+e.toUTCString()+";"}const s=this.getCookieDomain();document.cookie=e+"="+t+";"+n+s+"path=/"},getCookieDomain:function(){return wpconsent.enable_shared_consent&&wpconsent.cookie_domain&&""!==wpconsent.cookie_domain?"domain="+(wpconsent.cookie_domain.startsWith(".")?wpconsent.cookie_domain:"."+wpconsent.cookie_domain)+";":""},getCookie:function(e){const t=`; ${document.cookie}`.split(`; ${e}=`);if(2===t.length)return t.pop().split(";").shift()},hasConsent:function(e){const t=this.getCookie("wpconsent_preferences");if(!t)return!1;try{const o=JSON.parse(t);return"essential"===e||!0===o[e]}catch(e){return console.error("Error parsing WPConsent preferences:",e),!1}},shouldUnlockContent:function(e,t,o){return"essential"===o||(wpconsent.manual_toggle_services?!(!t||void 0===e[t])&&e[t]:!0===e[o])},unlockScripts:function(e){this.lastPreferences=e,this.listeners&&this.listeners.length>0&&this.listeners.forEach((t=>{try{t(e)}catch(e){console.error("Error in WPConsent listener:",e)}})),document.querySelectorAll('script[type="text/plain"]').forEach((t=>{const o=t.getAttribute("data-wpconsent-category"),n=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,n,o)){const e=document.createElement("script");t.getAttributeNames().forEach((o=>{"type"!==o&&e.setAttribute(o,t.getAttribute(o))}));const o=t.getAttribute("data-wpconsent-src");o?e.src=o:e.text=t.text,t.parentNode.replaceChild(e,t)}})),document.dispatchEvent(new CustomEvent("wpconsent_consent_processed",{detail:e})),WPConsent.localGtag("set","developer_id.dMmRkYz",!0),WPConsent.localGtag("consent","update",{ad_storage:e.marketing?"granted":"denied",analytics_storage:e.statistics?"granted":"denied",ad_user_data:e.marketing?"granted":"denied",ad_personalization:e.marketing?"granted":"denied"}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"wpconsent_consent_processed",wpconsentPreferences:e})},unlockIframes:function(e){document.querySelectorAll("iframe[data-wpconsent-src]").forEach((t=>{const o=t.getAttribute("data-wpconsent-category"),n=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,n,o)){const e=t.getAttribute("data-wpconsent-src");e&&(t.src=e),t.removeAttribute("data-wpconsent-src"),t.removeAttribute("data-wpconsent-name"),t.removeAttribute("data-wpconsent-category")}})),document.querySelectorAll(".wpconsent-iframe-placeholder").forEach((t=>{const o=t.getAttribute("data-wpconsent-category"),n=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,n,o)){const e=t.querySelector(".wpconsent-iframe-thumbnail"),o=t.querySelector(".wpconsent-iframe-overlay-content");e&&e.remove(),o&&o.remove(),t.classList.remove("wpconsent-iframe-placeholder")}}))},init:function(){this.runSettingsHooks().then((()=>{this.initWordPress(),this.updateButtonVisibility(wpconsent);const e=document.getElementById("wpconsent-container"),t=document.getElementById("wpconsent-template");if(this.shadowRoot=e.shadowRoot,this.shadowRoot)this.runDisplayChecks().then((()=>{this.processBannerDisplay()}));else{this.shadowRoot=e.attachShadow({mode:"open"});const o=t.content.cloneNode(!0);this.shadowRoot.appendChild(o),t.remove(),this.initializeEventListeners(),this.initializeAccordions(),this.initializeKeyboardHandlers(),this.runDisplayChecks().then((()=>{this.loadExternalCSS(e).then((()=>{this.processBannerDisplay()}))}))}}))},processBannerDisplay:function(){this.checkGPC();const e=this.getCookie("wpconsent_preferences");if(e){let t={};try{if(t=JSON.parse(e),wpconsent.slugs&&Array.isArray(wpconsent.slugs)&&!wpconsent.slugs.every((e=>t.hasOwnProperty(e))))return this.setCookie("wpconsent_preferences","",-1),void(this.checksPassed&&this.showBanner());this.unlockScripts(t),this.unlockIframes(t)}catch(e){console.error("Error parsing WPConsent preferences:",e)}this.showFloatingButtonIfEnabled()}else if(this.checksPassed&&this.showBanner(),wpconsent.default_allow||!wpconsent.enable_script_blocking){const e={};wpconsent.slugs.forEach((t=>{e[t]=!0})),this.unlockScripts(e),this.unlockIframes(e)}window.dispatchEvent(new CustomEvent("wpconsent_banner_initialized"))},loadExternalCSS:function(e){return new Promise(((t,o)=>{try{const o=`${wpconsent.css_url}?ver=${wpconsent.css_version}`;fetch(o).then((e=>e.text())).then((o=>{const n=document.createElement("style");n.textContent=o,this.shadowRoot.appendChild(n),e.style.display="block",t()})).catch((e=>{console.error("Failed to load WPConsent styles:",e),t()}))}catch(e){console.error("Failed to load WPConsent styles:",e),t()}}))},initializeEventListeners:function(){this.shadowRoot.querySelectorAll(".wpconsent-accept-all").forEach((e=>e.addEventListener("click",(()=>this.acceptAll())))),this.shadowRoot.querySelectorAll(".wpconsent-cancel-cookies").forEach((e=>e.addEventListener("click",(()=>{const e={};wpconsent.slugs.forEach((t=>{const o=this.shadowRoot.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${t}"]`);o&&o.disabled?e[t]=!0:e[t]=!1})),e.essential=!0,this.savePreferences(e)})))),this.shadowRoot.querySelector("#wpconsent-banner-close")?.addEventListener("click",(()=>this.hideBanner())),this.shadowRoot.querySelector("#wpconsent-preferences-all")?.addEventListener("click",(()=>this.showPreferences()));const e=this.shadowRoot.querySelector("#wpconsent-consent-floating");e&&e.addEventListener("click",(()=>this.showPreferences())),this.initializeCheckboxListeners(),document.addEventListener("click",(e=>{const t=e.target.closest(".wpconsent-iframe-accept-button");if(t){const e=t.getAttribute("data-category"),o=t.closest(".wpconsent-iframe-placeholder"),n=o?.getAttribute("data-wpconsent-name");if(e){let t={};try{t=JSON.parse(this.getCookie("wpconsent_preferences")||"{}")}catch(e){console.error("Failed to parse wpconsent_preferences cookie:",e)}const o=!0===navigator.globalPrivacyControl,s=!0===t.respect_gpc;if(wpconsent.respect_gpc&&o&&s){this.showPreferences();const t=this.shadowRoot.querySelector(`#cookie-category-${e}`);if(t&&(t.checked=!0),n){const e=this.shadowRoot.querySelector(`#cookie-service-${n}`);e&&(e.checked=!0)}const o=this.shadowRoot.querySelector("#wpconsent-gpc-override-container");o&&(o.style.display="block"),this.highlightGPCOverride()}else{const o={...t,essential:!0,[e]:!0};n&&(o[n]=!0),this.savePreferences(o)}}}})),document.addEventListener("click",(e=>{e.target.closest(".wpconsent-open-preferences")&&(e.preventDefault(),this.showPreferences())})),this.shadowRoot.querySelector(".wpconsent-preferences-header-close")?.addEventListener("click",(()=>this.closePreferences())),this.shadowRoot.querySelector(".wpconsent-save-preferences")?.addEventListener("click",(()=>{const e=this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]'),t=Array.from(e).filter((e=>e.checked)).map((e=>e.value)),o={};wpconsent.slugs.forEach((e=>{o[e]=t.includes(e)})),o.essential=!0,this.savePreferences(o)})),this.shadowRoot.querySelector(".wpconsent-close-preferences")?.addEventListener("click",(()=>this.closePreferences())),window.addEventListener("wpconsent_consent_saved",(function(e){if("function"!=typeof window.clarity)return;const t=e.detail;window.clarity("consentv2",{ad_Storage:t.marketing?"granted":"denied",analytics_Storage:t.statistics?"granted":"denied"})}))},localGtag:function(){window.dataLayer=window.dataLayer||[],function(){dataLayer.push(arguments)}.apply(window,arguments)},initializeCheckboxListeners:function(){this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-category-"]').forEach((e=>{e.addEventListener("change",(e=>{this.handleCategoryCheckboxChange(e.target)}))})),this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach((e=>{e.addEventListener("change",(e=>{this.handleServiceCheckboxChange(e.target)}))}))},handleCategoryCheckboxChange:function(e){const t=e.id.replace("cookie-category-","");this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach((o=>{o.closest(`.wpconsent-cookie-category-${t}`)&&(o.checked=e.checked)}))},handleServiceCheckboxChange:function(e){const t=e.closest(".wpconsent-cookie-category");if(!t)return;const o=t.querySelector('input[type="checkbox"][id^="cookie-category-"]');if(!o)return;const n=t.querySelectorAll('input[type="checkbox"][id^="cookie-service-"]');let s=!1;n.forEach((e=>{e.checked&&(s=!0)})),o.checked=s},initializeAccordions(){this.shadowRoot.querySelectorAll(".wpconsent-preferences-accordion-item").forEach((e=>{const t=e.querySelector(".wpconsent-preferences-accordion-header"),o=e.querySelector(".wpconsent-preferences-accordion-content");t&&o&&t.addEventListener("click",(t=>{t.target.closest(".wpconsent-preferences-checkbox-toggle")||this.toggleAccordion(e,o)}))}))},toggleAccordion(e,t){e.classList.contains("active");const o=e.parentElement,n=e.classList.contains("wpconsent-cookie-service"),s=e.classList.contains("wpconsent-cookie-category");s?o&&o.querySelectorAll(":scope > .wpconsent-preferences-accordion-item.wpconsent-cookie-category").forEach((t=>{if(t!==e){t.classList.remove("active");const e=t.querySelector(".wpconsent-preferences-accordion-toggle");e&&e.setAttribute("aria-expanded","false"),t.querySelectorAll(".wpconsent-cookie-service").forEach((e=>{e.classList.remove("active");const t=e.querySelector(".wpconsent-preferences-accordion-toggle");t&&t.setAttribute("aria-expanded","false"),this.runHooks("accordionToggled",{accordion:e,content:e.querySelector(".wpconsent-preferences-accordion-content"),isActive:!1,isService:!0,isCategory:!1})}))}})):n&&o&&o.querySelectorAll(":scope > .wpconsent-preferences-accordion-item.wpconsent-cookie-service").forEach((t=>{if(t!==e){t.classList.remove("active");const e=t.querySelector(".wpconsent-preferences-accordion-toggle");e&&e.setAttribute("aria-expanded","false"),this.runHooks("accordionToggled",{accordion:t,content:t.querySelector(".wpconsent-preferences-accordion-content"),isActive:!1,isService:!0,isCategory:!1})}})),e.classList.toggle("active");const c=e.querySelector(".wpconsent-preferences-accordion-toggle");if(c){const t=e.classList.contains("active");c.setAttribute("aria-expanded",t?"true":"false")}const r=e.classList.contains("active");this.runHooks("accordionToggled",{accordion:e,content:t,isActive:r,isService:n,isCategory:s})},initializeKeyboardHandlers:function(){document.addEventListener("keydown",(e=>{"Tab"===e.key?this.handleTabKey(e):"Escape"===e.key&&this.handleEscapeKey(e)}))},handleEscapeKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),o=this.shadowRoot?.querySelector("#wpconsent-banner-holder");t&&"flex"===t.style.display?this.closePreferences():o&&o.classList.contains("wpconsent-banner-visible")&&this.hideBanner()},handleTabKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-banner-holder"),o=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),n=t&&t.classList.contains("wpconsent-banner-visible"),s=o&&"flex"===o.style.display;if(!n&&!s)return;const c=s?o:t,r=this.getFocusableElements(c);if(0===r.length)return;e.preventDefault();const i=r[0],a=r[r.length-1];let l;this.lastFocusedElement&&r.includes(this.lastFocusedElement)?l=this.lastFocusedElement:(l=i,this.lastFocusedElement=l);const d=r.indexOf(l);let h;h=e.shiftKey?d<=0?a:r[d-1]:d>=r.length-1?i:r[d+1],h.focus({preventScroll:!0}),this.lastFocusedElement=h},setupFocusTrap:function(e){this.previouslyFocusedElement=document.activeElement,this.lastFocusedElement=null},removeFocusTrap:function(){this.lastFocusedElement=null},setInitialFocus:function(e){const t=this.getFocusableElements(e);t.length>0&&setTimeout((()=>{t[0].focus({preventScroll:!0}),this.lastFocusedElement=t[0]}),100)},getFocusableElements:function(e){return Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter((t=>{let o=t;for(;o&&o!==e;){const e=window.getComputedStyle(o);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||o.disabled||"true"===o.getAttribute("aria-hidden"))return!1;o=o.parentElement}return!0}))},isElementInContainer:function(e,t){return!(!e||!t)&&(t.shadowRoot?t.shadowRoot.contains(e):t.contains(e))},clearCookies:function(){for(var e=document.cookie.split("; "),t=0;t0;){var n=encodeURIComponent(e[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+o.join(".")+" ;path=",s=location.pathname.split("/");for(document.cookie=n+"/";s.length>0;)document.cookie=n+s.join("/"),s.pop();o.shift()}},initWordPress:function(){window.wp_consent_type=wpconsent.consent_type;let e=new CustomEvent("wp_consent_type_defined");document.dispatchEvent(e)},showFloatingButtonIfEnabled:function(){if(wpconsent.enable_consent_floating){const e=this.shadowRoot?.querySelector("#wpconsent-consent-floating");e&&(e.style.display="block")}},updateButtonVisibility:function(e){this.shadowRoot&&["accept","cancel","preferences"].forEach((t=>{const o=this.shadowRoot.querySelector(`#wpconsent-${t}-all`);o&&(e[`${t}_button_enabled`]?(o.classList.remove("wpconsent-button-disabled"),o.removeAttribute("data-disabled")):(o.classList.add("wpconsent-button-disabled"),o.setAttribute("data-disabled","true")))}))},updateWordPressConsent:function(e){"function"==typeof wp_set_consent&&(wp_set_consent("functional","allow"),wp_set_consent("preferences","allow"),wp_set_consent("statistics",e.statistics?"allow":"deny"),wp_set_consent("statistics-anonymous",e.statistics?"allow":"deny"),wp_set_consent("marketing",e.marketing?"allow":"deny"))}},document.addEventListener("DOMContentLoaded",(()=>WPConsent.init()))}},t={};function o(n){var s=t[n];if(void 0!==s)return s.exports;var c=t[n]={exports:{}};return e[n](c,c.exports,o),c.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";o(799)})()})();