PageSourceSearch

https://www.wildfoods.co/cdn/shop/t/46/assets/popup-modal.js?v=101577933603455078221752145222

js wildfoods.co collected 2026-10-04 00:17:15 UTC 2,031 bytes, 1 lines download raw bytes

1import{c as i}from"vendors/focus-trap.esm";import{a as t}from"vendors/js.cookie";class o extends HTMLElement{constructor(){super(),this.originalZIndex=500,this.openZIndex=1e3,this.promoSection=this.closest(".section__promos"),this.blockType=this.dataset.blockType,this.blockId=this.dataset.blockId,this.focusTrap=i(this,{initialFocus:!1}),this.delay=this.dataset.delay,this.homepageLimit=JSON.parse(this.dataset.homepageLimit),this.visitorLimit=JSON.parse(this.dataset.visitorLimit),this.showFor=this.dataset.showFor,!Shopify.designMode&&t.get(`${this.blockType}-${this.blockId}`)===void 0&&(this.homepageLimit==!0&&theme.pageType!=="index"||this.visitorLimit==!0&&theme.customer||setTimeout(()=>{this.showFor==="desktop"&&window.innerWidth<theme.mobileBreakpoint||this.showFor==="mobile"&&window.innerWidth>=theme.mobileBreakpoint||(this.bindEvents(),this.showModal())},this.delay))}bindEvents(){this.closeButton=this.querySelector(".modal__close"),this.modalBackground=this.querySelector(".modal__background"),this.form=this.querySelector("form"),this.closeButton.addEventListener("click",e=>{e.preventDefault(),this.hideModal(),t.set(`${this.blockType}-${this.blockId}`,"close",{expires:60})}),this.modalBackground.addEventListener("click",e=>{e.preventDefault(),this.hideModal(),t.set(`${this.blockType}-${this.blockId}`,"close",{expires:60})}),this.addEventListener("keyup",e=>{if(e.code.toUpperCase()!=="ESCAPE")return;this.hideModal(),t.set(`${this.blockType}-${this.blockId}`,"close",{expires:60})}),this.form&&this.form.addEventListener("submit",e=>{t.set(`${this.blockType}-${this.blockId}`,"submit",{expires:365})})}showModal(){document.body.classList.add("has-modal"),this.promoSection.style.zIndex=this.openZIndex,this.classList.add("modal--active"),this.closeButton=this.querySelector(".modal__close"),this.closeButton.focus(),this.focusTrap.activate()}hideModal(){document.body.classList.remove("has-modal"),this.classList.remove("modal--active"),this.focusTrap.deactivate()}}customElements.define("popup-modal",o);

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.