import{t as m,f6 as p}from"./chunk-BPjIPZ-5.js";import{r as u}from"./chunk-CQIL0Xd9.js";import{k as d}from"./chunk-CcVTpo0V.js";import"./chunk-D7HrI6pR.js";function R({_ref:f,_key:a,src:n,...c}){const l=u.useRef(null),t=f||l,s=m(({scene:e})=>e),[r,i]=u.useState(null);return u.useEffect(()=>{if(!n)return;const e=new d({url:n});i(e)},[n]),u.useEffect(()=>{var e;if(t.current&&r)return s.add(r),s.remove(r),(e=t.current)==null||e.add(r),()=>{var o;r&&((o=t.current)==null||o.remove(r),r==null||r.dispose())}},[t.current,r]),p.jsx("group",{ref:t,...c},a)}export{R as default};
//# sourceMappingURL=chunk-CxXHyfhp.js.map
