1import Modals from"module.modal";import{lockMobileScrolling,unlockMobileScrolling}from"util.a11y";import{HTMLThemeElement}from"element.theme";import{setLocalStorage,getLocalStorage}from"util.storage";class AgeVerificationPopup extends HTMLThemeElement{connectedCallback(){this.storageKey=this.id,this.storageValue=getLocalStorage(this.storageKey),this.classes={activeContent:"age-verification-popup__content--active",inactiveContent:"age-verification-popup__content--inactive",inactiveDeclineContent:"age-verification-popup__decline-content--inactive",activeDeclineContent:"age-verification-popup__decline-content--active"},this.declineButton=this.querySelector("[data-age-verification-popup-decline-button]"),this.declineContent=this.querySelector("[data-age-verification-popup-decline-content]"),this.content=this.querySelector("[data-age-verification-popup-content]"),this.returnButton=this.querySelector("[data-age-verification-popup-return-button]"),this.exitButton=this.querySelector("[data-age-verification-popup-exit-button]"),this.backgroundImage=this.querySelector("[data-background-image]"),this.mobileBackgroundImage=this.querySelector("[data-mobile-background-image]"),!(this.storageValue&&this.dataset.testMode==="false")&&this.init()}init(){this.modal=new Modals(this.id,"age-verification-popup-modal",{closeOffContentClick:!1}),this.backgroundImage&&(this.backgroundImage.style.display="block"),matchMedia("(max-width: 768px)").matches&&this.mobileBackgroundImage&&(this.mobileBackgroundImage.style.display="block"),this.modal.open(),lockMobileScrolling(document.querySelector("#MainContent")),this.declineButton&&this.declineButton.addEventListener("click",e=>{e.preventDefault(),this.showDeclineContent(),Shopify.designMode&&sessionStorage.setItem(this.id,"second-view")}),this.returnButton&&this.returnButton.addEventListener("click",e=>{e.preventDefault(),this.hideDeclineContent();const secondViewVisited=sessionStorage.getItem(this.id);Shopify.designMode&&secondViewVisited&&sessionStorage.removeItem(this.id)}),this.exitButton&&this.exitButton.addEventListener("click",e=>{e.preventDefault(),this.dataset.testMode==="false"&&setLocalStorage(this.storageKey,"entered",30),this.backgroundImage&&(this.backgroundImage.style.display="none"),matchMedia("(max-width: 768px)").matches&&this.mobileBackgroundImage&&(this.mobileBackgroundImage.style.display="none"),this.modal.close(),unlockMobileScrolling(document.querySelector("#MainContent"))})}showDeclineContent(){this.declineContent.classList.remove(this.classes.inactiveDeclineContent),this.declineContent.classList.add(this.classes.activeDeclineContent),this.content.classList.add(this.classes.inactiveContent),this.content.classList.remove(this.classes.activeContent)}hideDeclineContent(){this.declineContent.classList.add(this.classes.inactiveDeclineContent),this.declineContent.classList.remove(this.classes.activeDeclineContent),this.content.classList.remove(this.classes.inactiveContent),this.content.classList.add(this.classes.activeContent)}onSectionLoad(){this.init(),this.dataset.testMode==="true"&&this.storageValue&&localStorage.removeItem(this.storageKey),sessionStorage.getItem(this.id)&&this.showDeclineContent()}onSectionUnload(){this.modal.close()}onSectionSelect(){this.init()}}customElements.define("age-verification-popup",AgeVerificationPopup); 2//# sourceMappingURL=/cdn/shop/t/55/assets/section.age-verification-popup.js.map?v=58303022586883027081784905521
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.