PageSourceSearch

https://www.charitywater.org/vite/assets/Modal-DydjzmAS.js

js charitywater.org collected 2026-09-24 06:53:47 UTC 2,399 bytes, 2 lines download raw bytes

1import{aJ as i,av as e}from"./store-DUosIV5A.js";import{r as s}from"./application-CegkUz9G.js";document.addEventListener("alpine:init",()=>{Alpine.store("modal",{current:""}),window.addEventListener("hashchange",()=>{Alpine.store("modal").current=window.location.hash.slice(1)})});const l=(n,t)=>({show:!1,modalId:n,childComponentEls:[],scrollPosition:0,bodyMarginTop:"",init:function(){this.$nextTick(()=>{(window.location.hash.match(new RegExp(`^#${this.modalId}(\\?|$)`))||t.autoOpen)&&this.open()}),t.disableHistory||this.$watch("$store.modal.current",o=>{o.match(new RegExp(`^${this.modalId}(\\?|$)`))?this.open():this.close()})},open:function(){if(!this.show){if(this.show=!0,!t.disableHistory){const o=window.location.hash.split("?")[1]||"";window.location.hash=`#${this.modalId+(o?`?${o}`:"")}`,this.$store.modal.current=this.modalId}this.persistScrollPositionAndLockBody(),this.track(),this.renderChildComponents(),this.fireOpenEvent()}},close:function(){this.show&&(this.show=!1,!t.disableHistory&&this.$store.modal.current===this.modalId&&(this.$store.modal.current="",window.location.hash=""),this.restoreScrollPositionAndUnlockBody(),this.unmountChildComponents())},maybeClose:function(){t.explicitClose||this.close()},track:function(){const o={name:this.modalId,label:this.modalId,utm:e.get("maji_utm"),...t.trackingInfo};window.track_event("Viewed Modal",o)},fireOpenEvent:function(){this.$nextTick(()=>{htmx.process(this.$refs.inner),htmx.trigger(document,"ModalOpened"),$(this.$refs.inner).find("[data-parsley-validate]").parsley(),document.dispatchEvent(new CustomEvent("ModalOpened",{detail:{modalId:this.modalId}}))})},renderChildComponents:function(){this.$nextTick(()=>{Array.from(this.$refs.inner.querySelectorAll("[data-component]")).forEach(o=>{this.childComponentEls.push(o),s(o)})})},unmountChildComponents:function(){this.childComponentEls.forEach(o=>{i.unmountComponentAtNode(o)})},persistScrollPositionAndLockBody:function(){this.scrollPosition=window.scrollY,this.bodyMarginTop=getComputedStyle(document.body).marginTop,document.body.classList.add("modal-open"),document.body.style.marginTop=`-${this.scrollPosition}px`},restoreScrollPositionAndUnlockBody:function(){document.body.classList.remove("modal-open"),document.body.style.marginTop=this.bodyMarginTop,window.scrollTo(0,this.scrollPosition)}});export{l as default};
2//# sourceMappingURL=Modal-DydjzmAS.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.