1var a=Object.defineProperty;var p=(n,s,t)=>s in n?a(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var i=(n,s,t)=>p(n,typeof s!="symbol"?s+"":s,t);import{d as m}from"./index-up99TGJ_.js";import"./index-B2z_lZoq.js";class w extends HTMLElement{constructor(){super(...arguments);i(this,"show");i(this,"modal");i(this,"submitButton");i(this,"COOKIE_NAME");i(this,"initial");i(this,"scrollPercent",()=>{const t=this==null?void 0:this.querySelector("xo-modal"),e=this==null?void 0:this.getAttribute("xo-scroll"),o=t==null?void 0:t.getAttribute("xo-name"),h=window.scrollY,c=document.body.offsetHeight,l=window.innerHeight,r=h/(c-l),d=Math.round(r*100);if(!this.show)if(e==="none")this.openPopup(o,0);else{const u=Number((this==null?void 0:this.getAttribute("xo-scroll"))??0);d>=u&&this.openPopup(o,0)}});i(this,"handleSubmit",()=>{var e;this.acceptCookieConsent();const t=(e=this.modal)==null?void 0:e.getAttribute("xo-name");window.xoModal.close(t)});i(this,"popup",()=>{var l;const t=this==null?void 0:this.querySelector("xo-modal"),e=this==null?void 0:this.getAttribute("xo-show"),o=this==null?void 0:this.getAttribute("xo-when"),h=Number((this==null?void 0:this.getAttribute("xo-delay"))??0),c=t==null?void 0:t.getAttribute("xo-name");e==="false"||!c||(o==="immediately"?this.openPopup(c,h):(this.scrollPercent(),window.addEventListener("scroll",this.scrollPercent)),(l=this.submitButton)==null||l.addEventListener("click",this.handleSubmit))})}static get observedAttributes(){return["xo-observed"]}connectedCallback(){var t;this.show=!1,this.initial=!1,this.COOKIE_NAME="is_xo_cookie_consent",this.getCookie=this.getCookie.bind(this),this.popup=this.popup.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.modal=this==null?void 0:this.querySelector("xo-modal"),this.submitButton=(t=this.modal)==null?void 0:t.querySelector(".xo-cookie-consent__button-submit"),this.init(),this.initial=!0}disconnectedCallback(){this.destroy()}attributeChangedCallback(t,e,o){e!==o&&t==="xo-observed"&&this.initial&&(this.destroy(),this.init())}async openPopup(t,e){await m(e),window.xoModal.open(t),this.show=!0}setCookie(t,e){const o=new Date;o.setTime(o.getTime()+e*24*60*60*1e3);let h="expires="+o.toUTCString();document.cookie=this.COOKIE_NAME+"="+t+";"+h+";path=/"}deleteCookie(){const t=new Date;t.setTime(t.getTime()+1440*60*1e3);let e="expires="+t.toUTCString();document.cookie=this.COOKIE_NAME+"=;"+e+";path=/"}getCookie(){var o;const e=`; ${document.cookie}`.split(`; ${this.COOKIE_NAME}=`);if(e.length===2)return(o=e==null?void 0:e.pop())==null?void 0:o.split(";").shift()}acceptCookieConsent(){this.deleteCookie(),this.setCookie(1,30)}init(){this.getCookie()||window.addEventListener("load",this.popup)}destroy(){var t;window.removeEventListener("load",this.popup),(t=this.submitButton)==null||t.removeEventListener("click",this.handleSubmit)}}!window.customElements.get("xo-cookie-consent")&&!window.Shopify.designMode&&window.customElements.define("xo-cookie-consent",w);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.