window.WpStatisticsUserTracker||(window.WpStatisticsUserTracker={lastUrl:window.location.href,originalPushState:history.pushState,originalReplaceState:history.replaceState,isDndActive:parseInt(navigator.msDoNotTrack||window.doNotTrack||navigator.doNotTrack,10),hasTrackerInitializedOnce:!1,isTrackingEnabled:!1,pendingHit:null,isRestoringPendingHit:!1,pendingUrlChangeGenerations:{},hasUrlChangeTrackerInitialized:!1,urlChangeGeneration:0,supersededUrlChangeGenerations:{},lastUrlChangeAt:0,hitRequestSuccessful:!0,init:function(t){var e=this.isTrackingEnabled;this.isTrackingEnabled=!0,this.hasTrackerInitializedOnce?!e&&(this.pendingHit||0s.pendingHit.generation)&&(s.pendingHit=e),0===Object.keys(s.pendingUrlChangeGenerations).length&&s.flushPendingHit()):s.checkHitRequestConditions(t,n):(!s.pendingHit||i>s.pendingHit.generation)&&(s.pendingHit=e))})}}}); window.WpStatisticsEventTracker||(window.WpStatisticsEventTracker={hasEventsInitializedOnce:!1,isTrackingEnabled:!1,downloadTracker:!1,linkTracker:!1,guardedLegacyEventTracker:null,init:async function(){this.isTrackingEnabled=!0,WP_Statistics_Tracker_Object.isLegacyEventLoaded?this.guardLegacyEventTracker():this.hasEventsInitializedOnce||(this.hasEventsInitializedOnce=!0,"undefined"!=typeof WP_Statistics_DataPlus_Event_Object&&(this.downloadTracker=WP_Statistics_DataPlus_Event_Object.options.downloadTracker,this.linkTracker=WP_Statistics_DataPlus_Event_Object.options.linkTracker,this.downloadTracker||this.linkTracker)&&this.captureEvent(),window.wp_statistics_event=this.handleCustomEvent.bind(this),"undefined"!=typeof WP_Statistics_Marketing_Event_Object&&this.captureCustomClickEvents())},stop:function(){this.isTrackingEnabled=!1},guardLegacyEventTracker:function(){var a="undefined"!=typeof wpStatisticsDataPlusEvents?wpStatisticsDataPlusEvents:window.wpStatisticsDataPlusEvents;if(a&&"function"==typeof a.sendEventData&&this.guardedLegacyEventTracker!==a){let t=this,e=a.sendEventData;a.sendEventData=function(){return t.isTrackingEnabled?e.apply(this,arguments):Promise.resolve()},this.guardedLegacyEventTracker=a}},handleCustomEvent:function(t,e={}){var a=WP_Statistics_Tracker_Object.customEventAjaxUrl||WP_Statistics_Tracker_Object.ajaxUrl,t=(e.timestamp=Date.now(),e.resource_id||(e.resource_id=WP_Statistics_Tracker_Object.hitParams.source_id),{event_name:t,event_data:JSON.stringify(e)});WP_Statistics_Tracker_Object.customEventNonce&&(t.action="wp_statistics_custom_event",t.nonce=WP_Statistics_Tracker_Object.customEventNonce),this.sendEventData(t,a)},captureCustomClickEvents:function(){WP_Statistics_Marketing_Event_Object.events.clicks.forEach(e=>{!e.selector||null!=e.scope&&e.scope!=WP_Statistics_Tracker_Object.hitParams.source_id||document.querySelectorAll(""+e.selector).forEach(t=>{t.addEventListener("click",t=>{t={text:t.target.textContent,id:t.currentTarget.id,class:t.currentTarget.className,target:t.currentTarget.href};this.handleCustomEvent(e.name,t)})})})},captureEvent:function(){document.querySelectorAll("a").forEach(t=>{t.addEventListener("click",async t=>this.handleEvent(t)),t.addEventListener("mouseup",async t=>this.handleEvent(t))})},handleEvent:async function(t){var e;"mouseup"==t.type&&1!=t.button||(t=this.prepareEventData(t))&&(e=WP_Statistics_DataPlus_Event_Object.eventAjaxUrl,await this.sendEventData(t,e))},prepareEventData:function(t){let e={en:t.type,et:Date.now(),eid:t.currentTarget.id,ec:t.currentTarget.className,ev:"",mb:t.button,fn:"",fx:"",m:"",tu:"",pid:""};return"A"===t.currentTarget.tagName&&(e=this.extractLinkData(t,e)),"undefined"!=typeof WP_Statistics_Tracker_Object&&(e.pid=WP_Statistics_Tracker_Object.hitParams.source_id),e},extractLinkData(t,e){var a=t.target.textContent,n=t.currentTarget.href,i=WP_Statistics_DataPlus_Event_Object.fileExtensions;let s=new RegExp("\\.("+i.join("|")+")$","i");if(a&&(e.ev=a),!n||/^(javascript|data|about):/i.test(n))return!1;e.tu=n;i=t.currentTarget.classList.contains("woocommerce-MyAccount-downloads-file")||n.includes("download_file=");e.wcdl=i;let r="";a=n.split(/[?#]/).shift();if(s.test(a)){r=a.substring(a.lastIndexOf("/")+1);try{r=decodeURIComponent(r)}catch(t){}}if(!r){t="undefined"!=typeof WP_Statistics_Tracker_Object&&Array.isArray(WP_Statistics_Tracker_Object.downloadQueryKeys)?WP_Statistics_Tracker_Object.downloadQueryKeys:[];try{let e=new URL(n).searchParams;var c=t.find(t=>s.test(e.get(t)||""));r=c?e.get(c):""}catch(t){}r=r.substring(r.lastIndexOf("/")+1)}if(r||i){let t=null;try{t=new URL(n).searchParams}catch(t){}if(e.df=i&&t&&t.get("download_file")||"",e.dk=i&&t&&t.get("key")||"",e.en="file_download",e.fn=i?e.df:r.substring(0,r.lastIndexOf(".")),e.fx=i?e.df:r.split(".").pop(),!i&&-1!==e.fn.indexOf("%")){e.fnr=e.fn;let t=e.fn;try{t=decodeURIComponent(t)}catch(t){}e.fn=t.replace(/%/g,"").trim()||e.fn}}if("click"===e.en||"mouseup"===e.en){if(!this.linkTracker)return!1;try{if(new URL(n).host===window.location.host)return!1}catch(t){}}return!("file_download"===e.en&&!this.downloadTracker)&&e},sendEventData:async function(t,e){if(this.isTrackingEnabled){var a,n=new URLSearchParams;for(a in t)n.append(a,t[a]);if(!e)throw new Error("AJAX URL is not defined.");try{(await fetch(e,{method:"POST",keepalive:!0,body:n})).ok}catch(t){console.error("Error:",t)}}}}); function wpStatisticsBootTracker(){var t;document.prerendering?document.addEventListener("prerenderingchange",wpStatisticsBootTracker,{once:!0}):((t=WP_Statistics_Tracker_Object.option.consentIntegration.name)||wpStatisticsStartTracking(),"borlabs_cookie"===t&&handleBorlabsCookieIntegration(),"wp_consent_api"===t&&handleWpConsentApiIntegration(),"real_cookie_banner"===t&&handleRealCookieBannerIntegration(),"cookieyes"===t&&handleCookieYesIntegration())}function wpStatisticsStartTracking(t){WpStatisticsUserTracker.init(t),WpStatisticsEventTracker.init()}function wpStatisticsStopTracking(){WpStatisticsUserTracker.stop(),WpStatisticsEventTracker.stop()}function handleWpConsentApiIntegration(){let t=t=>{var e=window.consent_api&&window.consent_api.cookie_prefix||"wp_consent",e=document.cookie.match(new RegExp("(?:^|;\\s*)"+e+"_"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):""},e=()=>""!==t("statistics")||""!==t("statistics-anonymous"),i=()=>e()?"allow"===t("statistics")||"allow"===t("statistics-anonymous"):wp_has_consent("statistics")||wp_has_consent("statistics-anonymous");var n;let o="wp_statistics_consent_downgrade",a=t=>{try{var e=new URL(t,window.location.href);return e.searchParams.delete("cmplz-force-reload"),e.pathname+e.search}catch(t){return""}},s=()=>a(window.location.href),c=!1,r=()=>{c||(c=!0,i()&&wpStatisticsStartTracking({skipCurrentPage:(()=>{let t=null;try{t=JSON.parse(window.sessionStorage.getItem(o)||"null"),window.sessionStorage.removeItem(o)}catch(t){return!1}if(!t||t.path!==s()||3e4setTimeout(r,500),"complete"===document.readyState?n():window.addEventListener("load",n)),document.addEventListener("wp_consent_type_defined",r),document.addEventListener("wp_listen_for_consent_change",function(t){var e,n=t.detail;for(e in n)if(n.hasOwnProperty(e)&&("statistics"===e||"statistics-anonymous"===e)){c=!0,(i()?("statistics"!==e||"deny"!==n[e]||!WpStatisticsUserTracker.isTrackingEnabled||"function"==typeof WpStatisticsUserTracker.hasPendingHit&&WpStatisticsUserTracker.hasPendingHit()||(()=>{try{window.sessionStorage.setItem(o,JSON.stringify({path:s(),at:Date.now()}))}catch(t){}})(),wpStatisticsStartTracking):wpStatisticsStopTracking)();break}})}function handleRealCookieBannerIntegration(){let t=()=>{var t=window.consentApi?.consentSync("wp-statistics"),e=window.consentApi?.consentSync("wp-statistics-with-data-processing"),t=!(!t||!t.cookieOptIn),e=!(!e||null==e.cookie||!e.cookieOptIn);return t||e?(wpStatisticsStartTracking(),!0):(wpStatisticsStopTracking(),!1)};(window.consentApi?.consent("wp-statistics")||Promise.resolve()).then(t).catch(()=>{t()||console.log("WP Statistics: Real Cookie Banner consent is not given to track visitor information.")}),document.addEventListener("RCB/OptIn",t),document.addEventListener("RCB/OptOut",t)}function handleBorlabsCookieIntegration(){let e=(WP_Statistics_Tracker_Object.option.consentIntegration||{}).status||{};var t=()=>{var t;!0===e.anonymous_tracking?wpStatisticsStartTracking():(t=window.BorlabsCookie&&window.BorlabsCookie.Consents)&&"function"==typeof t.hasConsent&&(t.hasConsent("wp-statistics")?wpStatisticsStartTracking:wpStatisticsStopTracking)()};t(),window.addEventListener("borlabs-cookie-after-init",t),window.addEventListener("borlabs-cookie-consent-saved",t)}function handleCookieYesIntegration(){let n=()=>{var t;return"function"==typeof window.getCkyConsent?!(!(t=window.getCkyConsent())||!t.categories||!0!==t.categories.analytics):(t=document.cookie.match(/(?:^|;\s*)cookieyes-consent=([^;]*)/))?-1!==decodeURIComponent(t[1]).split(",").indexOf("analytics:yes"):(()=>{if(!e||i("viewed_cookie_policy")!=="yes")return false;const t=i("cookielawinfo-checkbox-analytics");return t===null||t==="yes"})()};let e=!0===((WP_Statistics_Tracker_Object.option.consentIntegration||{}).status||{}).legacy||void 0!==window.Cli_Data,i=t=>{t=document.cookie.match(new RegExp("(?:^|;\\s*)"+t+"=([^;]*)"));return t?decodeURIComponent(t[1]):null};n()&&wpStatisticsStartTracking(),document.addEventListener("cookieyes_consent_update",function(t){var e=t.detail&&t.detail.accepted||[];(-1===(t.detail&&t.detail.rejected||[]).indexOf("analytics")&&(-1!==e.indexOf("analytics")||n())?wpStatisticsStartTracking:wpStatisticsStopTracking)()}),document.addEventListener("click",function(t){e&&t.target&&"function"==typeof t.target.closest&&t.target.closest("#cookie-law-info-bar, #cliSettingsPopup, .cli-modal, .cli-bar-container")&&setTimeout(function(){n()?window.CLI&&window.CLI.settings&&!0===Boolean(window.CLI.settings.accept_close_reload)||wpStatisticsStartTracking():wpStatisticsStopTracking()},300)})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",wpStatisticsBootTracker):wpStatisticsBootTracker();