import{r as a,bp as d,d8 as E}from"./index-C4inJ1rU.js";function x(o,{container:e,accept:r,walk:t}){let n=a.useRef(r),c=a.useRef(t);a.useEffect(()=>{n.current=r,c.current=t},[r,t]),d(()=>{if(!e||!o)return;let u=E(e);if(!u)return;let f=n.current,l=c.current,i=Object.assign(p=>f(p),{acceptNode:f}),s=u.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,i,!1);for(;s.nextNode();)l(s.currentNode)},[e,o,n,c])}export{x as F};
