customElements.get("newsletter-modal")||customElements.define("newsletter-modal",class extends ModalElement{constructor(){super(),!(window.location.pathname==="/challenge"||!theme.cookiesEnabled)&&(!theme.config.isTouch||Shopify.designMode?this.init():new theme.initWhenVisible(theme.utils.throttle(this.init.bind(this))),this.formNl&&(console.log(this.formNl),this.formNl.addEventListener("submit",()=>{sessionStorage.setItem("formNlSend","true")})))}get shouldLock(){return!0}get testMode(){return this.getAttribute("data-test-mode")==="true"}get delay(){return this.hasAttribute("data-delay")?parseInt(this.getAttribute("data-delay")):5}get expiry(){return this.hasAttribute("data-expiry")?parseInt(this.getAttribute("data-expiry")):30}get cookieName(){return"concept:newsletter-popup"}get submited(){return this.querySelector(".alert")!==null}get formNl(){return this.querySelector(".j-nlForm")}init(){if(this.initialized)return;this.initialized=!0;const isFormSent=sessionStorage.getItem("formNlSend");if(this.submited&&isFormSent){sessionStorage.removeItem("formNlSend"),this.setCookie(this.cookieName,this.expiry);return}(this.testMode||!this.getCookie(this.cookieName))&&this.load(this.delay)}load(delay){Shopify.designMode||setTimeout(()=>this.show(),delay*1e3)}afterShow(){super.afterShow(),this.classList.add("show-image")}afterHide(){if(super.afterHide(),this.classList.remove("show-image"),this.testMode){this.removeCookie(this.cookieName);return}this.setCookie(this.cookieName,this.expiry)}resetGesture(){typeof super.resetGesture=="function"?super.resetGesture():document.body.classList.remove("has-modal-open","has-modal-opening")}hide(){try{super.hide()}catch(e){console.warn("force close newsletter-modal:",e),this.removeAttribute("open"),this.classList.remove("show-image"),document.body.classList.remove("has-modal-open","has-modal-opening")}}getCookie(name){const match=document.cookie.match(`(^|