PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/distinctdesign/codenwebz.com/website-design-3/js/
Server: Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
IP: 162.0.232.53
Choose File :

Url:
Dir : /home/distinctdesign/codenwebz.com/website-design-3/js/frontend-pro.js

(()=>{var e={4089:()=>{!function(){const e=wpconsent.geolocation?.enabled;function t(e){if(window.WPConsent&&window.WPConsent.shadowRoot){if(e.hasOwnProperty("accept_button_text")&&e.accept_button_text){const t=WPConsent.shadowRoot.querySelector("#wpconsent-accept-all");t&&(t.textContent=e.accept_button_text)}if(e.hasOwnProperty("cancel_button_text")&&e.cancel_button_text){const t=WPConsent.shadowRoot.querySelector("#wpconsent-cancel-all");t&&(t.textContent=e.cancel_button_text)}if(e.hasOwnProperty("preferences_button_text")&&e.preferences_button_text){const t=WPConsent.shadowRoot.querySelector("#wpconsent-preferences-all");t&&(t.textContent=e.preferences_button_text)}}else console.warn("WPConsent or its shadow root is not available yet")}function n(e){if(window.WPConsent&&window.WPConsent.shadowRoot){if(e.hasOwnProperty("banner_message")&&e.banner_message){const t=WPConsent.shadowRoot.querySelector(".wpconsent-banner-message");t&&(t.innerHTML=e.banner_message)}}else console.warn("WPConsent or its shadow root is not available yet")}function o(e){if(!window.WPConsent||!window.WPConsent.shadowRoot)return void console.warn("WPConsent or its shadow root is not available yet");const t=void 0!==e?e:wpconsent.default_allow;!WPConsent.getCookie("wpconsent_preferences")&&t&&(WPConsent.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-category-"]').forEach((e=>{e.disabled||(e.checked=!0)})),WPConsent.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach((e=>{e.disabled||(e.checked=!0)})))}function s(e){if(window.WPConsent&&window.WPConsent.shadowRoot)return void o(e);const t=function(){o(e),window.removeEventListener("wpconsent_banner_initialized",t)};window.addEventListener("wpconsent_banner_initialized",t)}function c(e,o){if(e.use_default)return o.original_default_allow&&!WPConsent.getCookie("wpconsent_preferences")&&WPConsent.localGtag("consent","update",{ad_storage:"granted",analytics_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",security_storage:"granted",functionality_storage:"granted"}),o.default_allow=o.original_default_allow,o.enable_consent_banner=o.original_enable_consent_banner,o.enable_script_blocking=o.original_enable_script_blocking,o.accept_button_enabled=o.original_accept_button_enabled,o.cancel_button_enabled=o.original_cancel_button_enabled,o.preferences_button_enabled=o.original_preferences_button_enabled,o.banner_message=o.original_banner_message,void s(o.original_default_allow);if(!1!==e.show_banner)e.country&&(o.user_country=e.country),e.hasOwnProperty("enable_script_blocking")&&(o.enable_script_blocking=e.enable_script_blocking),e.hasOwnProperty("enable_consent_floating")&&(o.enable_consent_floating=e.enable_consent_floating),e.hasOwnProperty("manual_toggle_services")&&(o.manual_toggle_services=e.manual_toggle_services),e.hasOwnProperty("consent_mode")&&(o.consent_mode=e.consent_mode,"optin"===e.consent_mode?(o.consent_type="optin",o.default_allow=!1):"optout"===e.consent_mode&&(o.consent_type="optout",o.default_allow=!0)),e.hasOwnProperty("show_banner")&&(o.show_banner=e.show_banner),e.hasOwnProperty("accept_button_enabled")&&(o.accept_button_enabled=e.accept_button_enabled),e.hasOwnProperty("cancel_button_enabled")&&(o.cancel_button_enabled=e.cancel_button_enabled),e.hasOwnProperty("preferences_button_enabled")&&(o.preferences_button_enabled=e.preferences_button_enabled),e.hasOwnProperty("accept_button_text")&&(o.accept_button_text=e.accept_button_text),e.hasOwnProperty("cancel_button_text")&&(o.cancel_button_text=e.cancel_button_text),e.hasOwnProperty("preferences_button_text")&&(o.preferences_button_text=e.preferences_button_text),e.hasOwnProperty("button_order")&&Array.isArray(e.button_order)&&(o.button_order=e.button_order),e.hasOwnProperty("banner_message")&&(o.banner_message=e.banner_message),function(e){if(window.WPConsent&&window.WPConsent.shadowRoot)return void t(e);const n=function(){t(e),window.removeEventListener("wpconsent_banner_initialized",n)};window.addEventListener("wpconsent_banner_initialized",n)}(e),function(e){if(window.WPConsent&&window.WPConsent.shadowRoot)return void n(e);const t=function(){n(e),window.removeEventListener("wpconsent_banner_initialized",t)};window.addEventListener("wpconsent_banner_initialized",t)}(e),s();else if(o.enable_consent_banner=!1,!WPConsent.getCookie("wpconsent_preferences")){const e={essential:!0,statistics:!0,marketing:!0};WPConsent.setCookie("wpconsent_preferences",JSON.stringify(e),30),WPConsent.unlockScripts(e),WPConsent.unlockIframes(e),WPConsent.localGtag("consent","update",{ad_storage:"granted",analytics_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",security_storage:"granted",functionality_storage:"granted"})}}e&&"undefined"==typeof wpconsentPreferences&&WPConsent.registerSettingsHook((function(e){return new Promise(((t,n)=>{const o=wpconsent.geolocation?.api_url;if(!o)return console.error("Geolocation API URL not found"),void t();const s=WPConsent.getCookie("wpconsent_geolocation");if(s)try{return c(JSON.parse(s),e),void t()}catch(e){console.error("Error parsing cached geolocation data:",e)}fetch(o).then((e=>e.json())).then((n=>{WPConsent.setCookie("wpconsent_geolocation",JSON.stringify(n),30),c(n,e),t()})).catch((e=>{console.error("Geolocation settings hook failed:",e),t()}))}))}))}()},9308:()=>{window.addEventListener("wpconsent_banner_initialized",(function(){window.WPConsent&&window.WPConsent.shadowRoot?WPConsent.shadowRoot.querySelectorAll(".wpconsent-language-picker").forEach((e=>{const t=e.querySelector(".wpconsent-language-switch-button"),n=e.querySelectorAll(".wpconsent-language-item");t&&n.length&&(t.addEventListener("click",(t=>{t.stopPropagation(),e.classList.toggle("active")})),n.forEach((t=>{t.addEventListener("click",(async o=>{o.preventDefault();const s=t.getAttribute("data-language");await async function(e,t=null){try{const n=await fetch(`/wp-json/wpconsent/v1/language/${e}`),o=await n.json();if(o){const n={".wpconsent-banner-message":"banner_message",".wpconsent-accept-all":"accept_button_text",".wpconsent-cancel-all":"cancel_button_text",".wpconsent-preferences-all":"preferences_button_text","#wpconsent-preferences-title":"preferences_panel_title",".wpconsent_preferences_panel_description":"preferences_panel_description",".wpconsent-cookie-policy-title":"cookie_policy_title",".wpconsent-cookie-policy-text":"cookie_policy_text",".wpconsent-save-preferences":"save_preferences_button_text",".wpconsent-close-preferences":"close_button_text"};Object.entries(o.categories).forEach((([e,t])=>{o[e+"_name"]=t.name,o[e+"_description"]=t.description,n[`.wpconsent-cookie-category-${e} .wpconsent-cookie-category-text label`]=e+"_name",n[`.wpconsent-cookie-category-${e} .wpconsent-category-description`]=e+"_description",t.services&&Object.keys(t.services).length>0&&Object.entries(t.services).forEach((([t,n])=>{const s=e+"_service_"+t;o[s+"_name"]=n.name,o[s+"_description"]=n.description,o.__services__||(o.__services__={}),o.__services__[e]||(o.__services__[e]=[]),o.__services__[e].push({slug:t,name:n.name,description:n.description,url:n.service_url,cookies:n.cookies||{}})})),t.cookies&&Object.keys(t.cookies).length>0&&(o.__category_cookies__||(o.__category_cookies__={}),o.__category_cookies__[e]=t.cookies)})),Object.entries(n).forEach((([e,t])=>{WPConsent.shadowRoot.querySelectorAll(e).forEach((e=>{e&&o[t]&&(e.innerHTML=o[t])}))})),o.__services__&&Object.entries(o.__services__).forEach((([e,t])=>{const n=WPConsent.shadowRoot.querySelector(`.wpconsent-cookie-category-${e}`);if(n){const e=n.querySelectorAll(".wpconsent-cookie-service");t.forEach(((t,n)=>{if(e[n]){const o=e[n].querySelector(".wpconsent-service-description");o&&t.description&&(o.innerHTML=t.description);const s=e[n].querySelector(".wpconsent-cookie-category-text label");s&&t.name&&(s.innerHTML=t.name),t.cookies&&Object.keys(t.cookies).length>0&&Object.entries(t.cookies).forEach((([t,o])=>{const s=e[n].querySelector(`.wpconsent-preferences-list-item[data-cookie-id="${t}"]`);if(s){const e=s.querySelector(".cookie-name");e&&o.name&&(e.textContent=o.name);const t=s.querySelector(".cookie-desc");t&&o.description&&(t.innerHTML=o.description);const n=s.querySelector(".cookie-duration");n&&o.duration&&(n.textContent=o.duration)}}))}}))}})),o.__category_cookies__&&Object.entries(o.__category_cookies__).forEach((([e,t])=>{const n=WPConsent.shadowRoot.querySelector(`.wpconsent-cookie-category-${e}`);n&&Object.entries(t).forEach((([e,t])=>{const o=n.querySelector(`.wpconsent-preferences-list-item[data-cookie-id="${e}"]`);if(o){const e=o.querySelector(".cookie-name");e&&t.name&&(e.textContent=t.name);const n=o.querySelector(".cookie-desc");n&&t.description&&(n.innerHTML=t.description);const s=o.querySelector(".cookie-duration");s&&t.duration&&(s.textContent=t.duration)}}))})),t&&t.forEach((t=>{t.getAttribute("data-language")===e?t.classList.add("active"):t.classList.remove("active")}))}return!0}catch(e){return console.error("Error fetching translations:",e),!1}}(s,n),e.classList.remove("active")}))})),document.addEventListener("click",(t=>{e.contains(t.target)||e.classList.remove("active")})))})):console.warn("WPConsent or its shadow root is not available yet")}))},2981:()=>{window.addEventListener("wpconsent_consent_saved",(function(e){if(!wpconsent.records_of_consent||"0"===wpconsent.records_of_consent)return;const t=wpconsent.api_url+"/log-consent",n=wpconsent.nonce,o={"Content-Type":"application/json"};n&&(o["X-WP-Nonce"]=n),fetch(t,{method:"POST",headers:o,body:JSON.stringify({consent_data:JSON.stringify(e.detail)}),credentials:"same-origin",keepalive:!0}).then((function(e){if(!e.ok)throw new Error("Network response was not ok");return e.json()})).catch((function(e){console.error("Error logging consent:",e)}))}))},2799:()=>{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((n=>{try{n(...t)}catch(t){console.error(`Error in WPConsent hook ${e}:`,t)}}))},showToast:function(e,t=2500){const n=this.shadowRoot.querySelector("#wpconsent-gpc-toast");if(!n)return;const o=n.querySelector(".wpconsent-toast-message");o&&e&&(o.textContent=e),n.style.display="block",setTimeout((()=>{n.classList.add("wpconsent-toast-visible")}),10);const s=()=>{n.classList.remove("wpconsent-toast-visible"),setTimeout((()=>{n.style.display="none"}),300)},c=setTimeout(s,t),r=n.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"),n=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(),n&&setTimeout((()=>{n.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 n={};if(wpconsent.slugs.forEach((e=>{const t=this.shadowRoot?.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${e}"]`);t&&t.disabled?n[e]=!0:n[e]=!1})),n.essential=!0,n.respect_gpc=!0,this.savePreferences(n,!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 n=this.getCookie("wpconsent_preferences");let o=!1,s=null;if(n)try{s=JSON.parse(n)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}if(wpconsent.respect_gpc&&!t&&s){const t=!0===navigator.globalPrivacyControl,n=!0===s.respect_gpc;if(t&&n){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(),o=!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})),n&&window.dispatchEvent(new CustomEvent("wpconsent_consent_updated",{detail:e})),o&&(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 n=this.getCookie("wpconsent_preferences");if(n)try{const e=JSON.parse(n);this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]').forEach((t=>{let n=null;n=t.id.startsWith("cookie-category-")?t.id.replace("cookie-category-",""):t.id.startsWith("cookie-service-")?t.id.replace("cookie-service-",""):t.value,n&&n in e&&(t.checked=e[n])}));const t=this.shadowRoot.querySelector("#wpconsent-gpc-override-container");if(t){const n=!0===navigator.globalPrivacyControl,o=e&&!0===e.respect_gpc;t.style.display=n&&o?"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,n){let o="";if(n>0){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="expires="+e.toUTCString()+";"}const s=this.getCookieDomain();document.cookie=e+"="+t+";"+o+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 n=JSON.parse(t);return"essential"===e||!0===n[e]}catch(e){return console.error("Error parsing WPConsent preferences:",e),!1}},shouldUnlockContent:function(e,t,n){return"essential"===n||(wpconsent.manual_toggle_services?!(!t||void 0===e[t])&&e[t]:!0===e[n])},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 n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){const e=document.createElement("script");t.getAttributeNames().forEach((n=>{"type"!==n&&e.setAttribute(n,t.getAttribute(n))}));const n=t.getAttribute("data-wpconsent-src");n?e.src=n: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 n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){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 n=t.getAttribute("data-wpconsent-category"),o=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,o,n)){const e=t.querySelector(".wpconsent-iframe-thumbnail"),n=t.querySelector(".wpconsent-iframe-overlay-content");e&&e.remove(),n&&n.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 n=t.content.cloneNode(!0);this.shadowRoot.appendChild(n),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,n)=>{try{const n=`${wpconsent.css_url}?ver=${wpconsent.css_version}`;fetch(n).then((e=>e.text())).then((n=>{const o=document.createElement("style");o.textContent=n,this.shadowRoot.appendChild(o),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 n=this.shadowRoot.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${t}"]`);n&&n.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"),n=t.closest(".wpconsent-iframe-placeholder"),o=n?.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 n=!0===navigator.globalPrivacyControl,s=!0===t.respect_gpc;if(wpconsent.respect_gpc&&n&&s){this.showPreferences();const t=this.shadowRoot.querySelector(`#cookie-category-${e}`);if(t&&(t.checked=!0),o){const e=this.shadowRoot.querySelector(`#cookie-service-${o}`);e&&(e.checked=!0)}const n=this.shadowRoot.querySelector("#wpconsent-gpc-override-container");n&&(n.style.display="block"),this.highlightGPCOverride()}else{const n={...t,essential:!0,[e]:!0};o&&(n[o]=!0),this.savePreferences(n)}}}})),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)),n={};wpconsent.slugs.forEach((e=>{n[e]=t.includes(e)})),n.essential=!0,this.savePreferences(n)})),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((n=>{n.closest(`.wpconsent-cookie-category-${t}`)&&(n.checked=e.checked)}))},handleServiceCheckboxChange:function(e){const t=e.closest(".wpconsent-cookie-category");if(!t)return;const n=t.querySelector('input[type="checkbox"][id^="cookie-category-"]');if(!n)return;const o=t.querySelectorAll('input[type="checkbox"][id^="cookie-service-"]');let s=!1;o.forEach((e=>{e.checked&&(s=!0)})),n.checked=s},initializeAccordions(){this.shadowRoot.querySelectorAll(".wpconsent-preferences-accordion-item").forEach((e=>{const t=e.querySelector(".wpconsent-preferences-accordion-header"),n=e.querySelector(".wpconsent-preferences-accordion-content");t&&n&&t.addEventListener("click",(t=>{t.target.closest(".wpconsent-preferences-checkbox-toggle")||this.toggleAccordion(e,n)}))}))},toggleAccordion(e,t){e.classList.contains("active");const n=e.parentElement,o=e.classList.contains("wpconsent-cookie-service"),s=e.classList.contains("wpconsent-cookie-category");s?n&&n.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})}))}})):o&&n&&n.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:o,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"),n=this.shadowRoot?.querySelector("#wpconsent-banner-holder");t&&"flex"===t.style.display?this.closePreferences():n&&n.classList.contains("wpconsent-banner-visible")&&this.hideBanner()},handleTabKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-banner-holder"),n=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),o=t&&t.classList.contains("wpconsent-banner-visible"),s=n&&"flex"===n.style.display;if(!o&&!s)return;const c=s?n: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 p;p=e.shiftKey?d<=0?a:r[d-1]:d>=r.length-1?i:r[d+1],p.focus({preventScroll:!0}),this.lastFocusedElement=p},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 n=t;for(;n&&n!==e;){const e=window.getComputedStyle(n);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||n.disabled||"true"===n.getAttribute("aria-hidden"))return!1;n=n.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;t<e.length;t++)for(var n=window.location.hostname.split(".");n.length>0;){var o=encodeURIComponent(e[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+n.join(".")+" ;path=",s=location.pathname.split("/");for(document.cookie=o+"/";s.length>0;)document.cookie=o+s.join("/"),s.pop();n.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 n=this.shadowRoot.querySelector(`#wpconsent-${t}-all`);n&&(e[`${t}_button_enabled`]?(n.classList.remove("wpconsent-button-disabled"),n.removeAttribute("data-disabled")):(n.classList.add("wpconsent-button-disabled"),n.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 n(o){var s=t[o];if(void 0!==s)return s.exports;var c=t[o]={exports:{}};return e[o](c,c.exports,n),c.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(2799),n(2981),n(4089),n(9308)})()})();