PageSourceSearch

https://aguademadre.co.uk/cdn/shop/t/43/assets/modal-dialog.js?v=103802806071022512931788379130

js aguademadre.co.uk collected 2026-10-07 13:09:22 UTC 2,100 bytes, 2 lines download raw bytes

1import A11yDialog from"a11y-dialog";class ModalDialog extends HTMLElement{#n;#o;#i;#t;#e;constructor(){super(),this.#o=this.#s.bind(this),this.#i=this.#d.bind(this),this.#t=this.#l.bind(this),this.#e=this.#a.bind(this)}connectedCallback(){this.init()}disconnectedCallback(){this.destroy()}get shown(){return this.#n.shown}init(){this.#n=new A11yDialog(this),this.content=this.querySelector('[role="document"]'),document.querySelectorAll(`[data-a11y-dialog-show="${this.#n.id}"]`).forEach((n=>{n.addEventListener("click",ModalDialog.#h)})),this.#n.on("opening",this.#o).on("show",this.#t).on("closing",this.#i).on("hide",this.#e)}destroy(){document.querySelectorAll(`[data-a11y-dialog-show="${this.#n.id}"]`).forEach((n=>{n.removeEventListener("click",ModalDialog.#h)})),this.#n.off("opening",this.#o).off("show",this.#t).off("closing",this.#i).off("hide",this.#e),this.removeAttribute("aria-modal"),this.removeAttribute("tabindex"),this.removeAttribute("role")}async open(n=null){return n&&n instanceof HTMLElement&&"MODAL-DIALOG"===n.tagName&&this.#n.on("hide",(()=>n.open()),{once:!0}),this.#n.show(),new Promise((n=>{this.#n.shown?n():this.#n.on("show",(()=>{n()}),{once:!0})}))}openInstantly(){this.content.style.animation="none",this.#n.show(),this.content.style.animation=null}async close(){return this.#n.hide(),new Promise((n=>{this.#n.shown?this.#n.on("hide",(()=>{n()}),{once:!0}):n()}))}closeInstantly(){this.content.style.animation="none",this.#n.hide(),this.content.style.animation=null}on(n,o,i){return this.addEventListener(n,o,i),this}off(n,o,i){return this.removeEventListener(n,o,i),this}#s(){this.dispatchEvent(new CustomEvent("on:modal:opening")),document.body.classList.add("u-scroll-disabled")}#d(){this.dispatchEvent(new CustomEvent("on:modal:closing"))}#l(){this.dispatchEvent(new CustomEvent("on:modal:opened"))}#a(){this.dispatchEvent(new CustomEvent("on:modal:closed")),document.body.classList.remove("u-scroll-disabled")}static#h(n){n.preventDefault()}}customElements.define("modal-dialog",ModalDialog);export default ModalDialog;
2//# sourceMappingURL=modal-dialog.js.map

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.