import"./DsnmJJEf.js";import{p as E,u as c,g as r,j as d,f as S,t as z,a as B,b as I,i as u,c as L,d as O,s as R,r as j}from"./krC2xWPP.js";import{s as H}from"./C4MegWN0.js";import{s as M}from"./j_DJpx8B.js";import{b as h}from"./CpuCZOqP.js";import{p as b}from"./DjsWWzyL.js";var N=L('
',1);function D(p,o){E(o,!0);let g=b(o,"height",15,0),x=b(o,"class",3,""),_=b(o,"noBorder",3,!1),n=u(!1),i=u(void 0),s=u(void 0),f=!0;c(()=>{if(!r(i))return;const e=new IntersectionObserver(([t])=>{f=t.isIntersecting,d(n,!t.isIntersecting)},{threshold:0,rootMargin:"-1px 0px 0px 0px"});return e.observe(r(i)),()=>e.disconnect()}),c(()=>{if(!r(s))return;const e=r(s).parentElement;if(!e)return;function t(w){if(!f)return;const l=w.target;l===document||l===document.documentElement||d(n,l.scrollTop>0)}return e.addEventListener("scroll",t,!0),()=>e.removeEventListener("scroll",t,!0)}),c(()=>{if(!r(s))return;const e=new ResizeObserver(([t])=>{g(t.borderBoxSize?.[0]?.blockSize??t.contentRect.height)});return e.observe(r(s)),()=>e.disconnect()});var m=N(),v=S(m);h(v,e=>d(i,e),()=>r(i));var a=R(v,2),k=O(a);H(k,()=>o.children,()=>({scrolled:r(n)})),j(a),h(a,e=>d(s,e),()=>r(s)),z(()=>M(a,1,`sticky top-0 z-10 bg-background transition-[border-color,box-shadow] duration-200 ${r(n)&&!_()?"border-b border-border shadow-sm":"border-b border-transparent"} ${x()??""}`)),B(p,m),I()}export{D as S};