UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 867 B
import{n as e}from"./rolldown-runtime-8BhlS34s.js";var t;function n(){return(n=e((()=>{t=class{constructor(e,t){this.marginPx=e,this.visibilityChanged=t,this.nearVisible=!1}observe(e){e!==this.target&&(this.disconnect(),this.target=e,this.setNearVisible(this.isNearViewport(e)),typeof IntersectionObserver<`u`&&(this.observer=new IntersectionObserver(e=>{let t=e.at(-1);t&&t.target===this.target&&this.setNearVisible(t.isIntersecting||this.isNearViewport(t.target))},{rootMargin:`${this.marginPx}px 0px`}),this.observer.observe(e)))}disconnect(){this.observer?.disconnect(),this.observer=void 0,this.target=void 0,this.setNearVisible(!1)}setNearVisible(e){e!==this.nearVisible&&(this.nearVisible=e,this.visibilityChanged())}isNearViewport(e){let t=e.getBoundingClientRect();return t.bottom>=-this.marginPx&&t.top<=window.innerHeight+this.marginPx}}})))()}export{n,t};