import{a,k as l,C as v,n as m,m as w}from"./vue-pic.1yvOmXPY.js";const d=6,h=(t,u,n=d)=>{const e=a(n),s=l(()=>e.value>=u.value),o=()=>{if(!t.value)return;const{bottom:c}=t.value.getBoundingClientRect();c<window.innerHeight&&(e.value+=n,s.value&&i())},r=()=>{window.addEventListener("scroll",o,{passive:!0})},i=()=>{window.removeEventListener("scroll",o)};return v(()=>{m(()=>{o()}),r()}),w(()=>{i()}),{currNumberItemsToShow:e,allItemsShowing:s,resetCurrNumberItemsToShow:()=>{e.value=n},addEventListener:r}};export{h as u};