import{r as d,n as m,aL as f}from"./D-NqFN1U.js";function h(y,l,a=310,c=0){const o=d(0);let n,i;const u=()=>{const t=Array.from(document.querySelectorAll('[id^="om-"]')).filter(e=>{const r=e.id;return/^om-[a-zA-Z0-9]+$/.test(r)});if(t.length===0){const e=document.querySelectorAll(".promo-banner");e.length>0&&e.forEach(r=>t.push(r))}o.value=window.innerWidth>a?Array.from(t).filter(e=>window.getComputedStyle(e).display==="block").reduce((e,r)=>e+r.offsetHeight,0):0,o.value=o.value+c;const s=document.querySelector(l);s&&s.style.setProperty("--rh",`${o.value}px`)};return m(()=>{u(),n=()=>{requestAnimationFrame(u)},window.addEventListener("resize",n),setTimeout(()=>{i=new MutationObserver(t=>{requestAnimationFrame(()=>{for(const s of t)if(s.type==="childList"){u();break}})}),i.observe(document.body,{childList:!0,subtree:!0})},0)}),f(()=>{n&&window.removeEventListener("resize",n),i&&i.disconnect()}),{}}export{h as u};
//# sourceMappingURL=DFdqLK0E.js.map