1document.addEventListener("alpine:init",()=>{Alpine.data("PromoPopup",({delay,frequency,enabled,hasErrors,hasSuccessMessage})=>({delay,frequency,enabled,sectionId:null,storageKey:null,async init(){if(this.sectionId=this.$root.id,this.storageKey=`switch-popup-${this.sectionId}`,window.location.pathname==="/challenge")return;initTeleport(this.$root),Alpine.store("modals").register("promoPopup","promo"),document.body.addEventListener("promo-is-closed",e=>{setExpiringStorageItem(this.storageKey,"shown",daysInMs(this.frequency))});const popupContent=this.$refs.teleported.content.querySelector("template").content,hasErrors2=!!popupContent.querySelector("[data-errors]");(popupContent.querySelector("[data-success-message]")||hasErrors2)&&(this.open(),this.clearSuccessParams(),setExpiringStorageItem(this.storageKey,"shown",daysInMs(200))),Shopify.designMode?(window.theme.designMode.selected===this.sectionId&&(this.enabled===!0?this.open():Alpine.store("modals").close("promoPopup")),document.addEventListener("shopify:section:select",this.onSectionSelect.bind(this)),document.addEventListener("shopify:section:deselect",this.onSectionDeselect.bind(this))):getExpiringStorageItem(this.storageKey)!=="shown"&&setTimeout(()=>{this.open();const escapeHandler=e=>{e.code==="Escape"&&(this.$store.modals.close("promoPopup"),document.body.removeEventListener("keydown",escapeHandler))};document.body.addEventListener("keydown",escapeHandler)},this.delay*1e3)},open(){this.$store.modals.open("promoPopup"),this.$focus.first()},onSectionSelect(e){e.target.contains(this.$root)&&this.enabled&&this.open()},onSectionDeselect(e){e.target.contains(this.$root)&&this.$store.modals.close("promoPopup")},clearSuccessParams(){const updatedParams=new URLSearchParams(window.location.search);updatedParams.has("customer_posted")&&updatedParams.delete("customer_posted");let newURL;updatedParams.toString().length>0?newURL=`${window.location.pathname}?${updatedParams.toString()}`:newURL=window.location.pathname,history.replaceState("",document.title,newURL)},destroy(){document.removeEventListener("shopify:section:select",this.onSectionSelect),document.removeEventListener("shopify:section:deselect",this.onSectionDeselect)}}))}); 2//# sourceMappingURL=/cdn/shop/t/95/assets/promo-popup.js.map?v=69268742982127050501763134145
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.