1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{n as t,t as n}from"./jsx-runtime-D3F0h15I.js";import{c as r,s as i}from"./react-router-D0L-bsDO.js";import{G as a}from"./poll-DEA_tGq7.js";import{t as o}from"./es-CcqpDSRy.js";var s=e(t()),c=(e,t)=>!(t.state?.mastodonModalKey&&t.state.mastodonModalKey!==e?.state?.mastodonModalKey),l=`@@scroll|`,u=class{read(e,t){let n=this.getStateKey(e,t);try{let e=sessionStorage.getItem(n);return e?JSON.parse(e):null}catch{return null}}save(e,t,n){let r=this.getStateKey(e,t),i=JSON.stringify(n);try{sessionStorage.setItem(r,i)}catch{}}getStateKey(e,t){let n=`${l}${e.key}`;return t==null?n:`${n}|${t}`}},d=n(),f=s.createContext(null),p=({children:e,shouldUpdateScroll:t=c})=>{let n=r(),l=i(),p=(0,s.useRef)(n);(0,s.useEffect)(()=>{p.current=n},[n]);let[m]=(0,s.useState)(()=>new o({addNavigationListener:l.listen.bind(l),stateStorage:new u,getCurrentLocation:()=>p.current,shouldUpdateScroll:(e,n)=>t.call(m,e,n)})),h=a(n)??null;(0,s.useEffect)(()=>{m.updateScroll(h,n)},[n,h,m]),(0,s.useEffect)(()=>()=>{m.stop()},[m]);let g=(0,s.useMemo)(()=>({registerElement:(e,t,r)=>{m.registerElement(e,t,r,n)},unregisterElement:e=>{m.unregisterElement(e)},scrollBehavior:m}),[n,m]);return(0,d.jsx)(f.Provider,{value:g,children:s.Children.only(e)})},m=({children:e,scrollKey:t,childRef:n,shouldUpdateScroll:r=c})=>{let i=(0,s.useContext)(f),a=(0,s.useRef)(null);return(0,s.useImperativeHandle)(n,()=>a.current??void 0,[]),(0,s.useEffect)(()=>{if(i&&a.current)return i.registerElement(t,a.current,(e,t)=>r.call(i.scrollBehavior,e,t)),()=>{i.unregisterElement(t)}},[]),s.Children.only((0,s.isValidElement)(e)?s.cloneElement(e,{ref:a}):e)};export{p as n,m as t}; 2//# sourceMappingURL=scroll_container-Z8q4g4UZ.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.