https://www.enchantingtravels.com/wp-content/themes/enchanting/dis…/modal/index.js?ver=2026.09.23.04
1(()=>{"use strict";const{customElements:t,HTMLElement:e}=window;t.define("et-open-modal",class extends e{constructor(){super(),this.modalId=this.getAttribute("modal-id"),this.modalId&&(this.modal=document.getElementById(this.modalId),this.parentElement&&(this.parentElement.addEventListener("click",()=>this.openModal()),this.parentElement.addEventListener("keydown",t=>this.handleModalOpenOnKeyDown(t))))}openModal(){this.modal&&this.modal.open()}handleModalOpenOnKeyDown(t){"Enter"===t.key&&(t.preventDefault(),this.openModal())}}),t.define("et-modal",class extends e{constructor(){super(),this.activeModal=null,this.wpSiteBlocks=null,this.body=document.querySelector("body"),this.closeButton=this.querySelector(".modal__close-btn"),this.modalId=this.getAttribute("id"),this.wpSiteBlocks=document.querySelector(".wp-site-blocks"),this.addEventListener("click",t=>this.handleModalClick(t)),this.closeButton&&this.closeButton.addEventListener("click",this.close.bind(this)),null!==this.ownerDocument.defaultView&&this.ownerDocument.defaultView.addEventListener("keydown",t=>this.handleModalCloseOnKeyDown(t)),this.body&&this.body.appendChild(this)}static get observedAttributes(){return["active"]}attributeChangedCallback(t,e,s){e!==s&&"active"===t&&this.body&&("true"===s?this.body.classList.add("prevent-scroll"):this.body.classList.remove("prevent-scroll"))}open(){var t;this.setAttribute("active","true");const e={modalId:this.modalId};this.hasAttribute("data-form-name")&&(e.formName=null!==(t=this.getAttribute("data-form-name"))&&void 0!==t?t:""),this.dispatchEvent(new CustomEvent("modal-open",{bubbles:!0,detail:e})),this.tabIndex=0,this.removeAttribute("inert"),this.focus(),this.activeModal=this.modalId,this.addEventListener("keydown",t=>this.trapFocus(t)),this.wpSiteBlocks&&(this.wpSiteBlocks.setAttribute("aria-hidden","true"),this.wpSiteBlocks.setAttribute("inert",""))}close(){this.setAttribute("active","false"),this.dispatchEvent(new CustomEvent("modal-close",{detail:{modalId:this.modalId}})),this.tabIndex=-1,this.setAttribute("inert",""),this.removeEventListener("keydown",t=>this.trapFocus(t)),this.wpSiteBlocks&&(this.wpSiteBlocks.setAttribute("aria-hidden","false"),this.wpSiteBlocks.removeAttribute("inert"));const t=document.querySelector(`et-open-modal[modal-id="${this.activeModal}"]`);t&&(t.focus(),this.activeModal=null)}trapFocus(t){const e=this.querySelectorAll(["a[href]","area[href]",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed",'[tabindex]:not([tabindex="-1"])',"[contenteditable]"].join(",")),s=e[0],i=e[e.length-1];"Tab"===t.key&&(t.shiftKey?this.ownerDocument.activeElement===s&&(t.preventDefault(),i.focus()):this.ownerDocument.activeElement===i&&(t.preventDefault(),s.focus()))}handleModalClick(t){t.target.closest(".modal__content")||this.close()}handleModalCloseOnKeyDown(t){"Escape"===t.key&&(t.preventDefault(),this.close())}})})();
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.