(()=>{var o=class extends HTMLElement{constructor(){super(),this.layoutMasonry=this.layoutMasonry.bind(this)}connectedCallback(){requestAnimationFrame(()=>{this.layoutMasonry(),window.addEventListener("resize",this.debounceLayout.bind(this,100))})}disconnectedCallback(){window.removeEventListener("resize",this.debounceLayout)}debounceLayout(t){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(this.layoutMasonry,t)}layoutMasonry(){let t=getComputedStyle(this).gridTemplateColumns.split(" ").length,s=Array.from(this.children);s.forEach((e,n)=>{if(e.style.marginTop="0px",n>=t){let i=s[n-t],a=i.offsetTop+i.offsetHeight+parseFloat(getComputedStyle(this).rowGap),r=e.offsetTop,u=a-r;e.style.marginTop=`${u}px`}})}};customElements.define("custom-masonry",o);})();