import{$V as Y,XV as T,YV as X,ZV as I,aW as p,qW as v,rW as Z,sW as D}from"./cli-0.5.3-842pf3t4.mjs";import{NY as P,PY as V}from"./cli-0.5.3-vqmxwet2.mjs";import{QY as H}from"./cli-0.5.3-rch86nhn.mjs";import{gma as F,vja as W}from"./cli-0.5.3-qrvd6cmy.mjs";import{Tma as A,Xma as C}from"./cli-0.5.3-0df3r78b.mjs";function B({children:_,ref:$,stickyScroll:g,...K}){let E=J.useRef(null),[,w]=J.useState(0),L=J.useRef(new Set),N=J.useRef(!1),U=()=>{for(let q of L.current)q()};function O(q){if(W(),T(q),Y(),U(),N.current)return;N.current=!0,queueMicrotask(()=>{N.current=!1,X(q)})}return J.useImperativeHandle($,()=>({scrollTo(q){let z=E.current;if(!z)return;z.stickyScroll=!1,z.pendingScrollDelta=void 0,z.scrollAnchor=void 0,z.scrollTop=Math.max(0,Math.floor(q)),O(z)},scrollToElement(q,z=0){let G=E.current;if(!G)return;G.stickyScroll=!1,G.pendingScrollDelta=void 0,G.scrollAnchor={el:q,offset:z},O(G)},scrollBy(q){let z=E.current;if(!z)return;z.stickyScroll=!1,z.scrollAnchor=void 0,z.pendingScrollDelta=(z.pendingScrollDelta??0)+Math.floor(q),O(z)},scrollToBottom(){let q=E.current;if(!q)return;q.pendingScrollDelta=void 0,q.stickyScroll=!0,T(q),U(),w((z)=>z+1)},getScrollTop(){return E.current?.scrollTop??0},getPendingDelta(){return E.current?.pendingScrollDelta??0},getScrollHeight(){return E.current?.scrollHeight??0},getFreshScrollHeight(){return E.current?.childNodes[0]?.yogaNode?.getComputedHeight()??E.current?.scrollHeight??0},getViewportHeight(){return E.current?.scrollViewportHeight??0},getViewportTop(){return E.current?.scrollViewportTop??0},isSticky(){let q=E.current;if(!q)return!1;return q.stickyScroll??Boolean(q.attributes.stickyScroll)},subscribe(q){return L.current.add(q),()=>L.current.delete(q)},setClampBounds(q,z){let G=E.current;if(!G)return;G.scrollClampMin=q,G.scrollClampMax=z}}),[]),P("ink-box",{ref:(q)=>{if(E.current=q,q)q.scrollTop??=0},style:{flexWrap:"nowrap",flexDirection:K.flexDirection??"row",flexGrow:K.flexGrow??0,flexShrink:K.flexShrink??1,...K,overflowX:"scroll",overflowY:"scroll"},...g?{stickyScroll:!0}:{},children:P(Z,{flexDirection:"column",flexGrow:1,flexShrink:0,width:"100%",children:_})})}var J,u;var M=C(()=>{F();I();p();v();D();V();J=A(H(),1);u=B});
export{u as xg,M as yg};
