const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-6jOCfdig.js","./index-Ds2meNS5.js","./index-W6UN98iO.css"])))=>i.map(i=>d[i]);
import{_ as w}from"./index-Ds2meNS5.js";import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import{onMount as C}from"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";var y=e.from_html("<canvas></canvas>");function q(p,a){e.push(a,!0);let s,_=e.derived(()=>a.value.url),l,o=e.state(void 0),n=e.state(void 0),u=e.state(!1);C(()=>((async()=>{s=await w(()=>import("./index-6jOCfdig.js").then(i=>i.cq),__vite__mapDeps([0,1,2]),import.meta.url),s.CreateViewerForCanvas(l,{clearColor:a.clear_color,useRightHandedSystem:!0,animationAutoPlay:!0,cameraAutoOrbit:{enabled:!1},onInitialized:i=>{e.set(n,i,!0)}}).then(i=>{e.set(o,i,!0),e.set(u,!0)})})(),()=>{e.get(o)?.dispose()})),e.user_effect(()=>{e.get(u)&&g(e.get(_))});function m(t,i){e.get(n)&&(e.get(n).scene.forcePointsCloud=t,e.get(n).scene.forceWireframe=i)}function g(t){e.get(o)&&(t?e.get(o).loadModel(t,{pluginOptions:{obj:{importVertexColors:!0}}}).then(()=>{a.display_mode==="point_cloud"?m(!0,!1):a.display_mode==="wireframe"?m(!1,!0):d(a.camera_position,a.zoom_speed,a.pan_speed)}):e.get(o).resetModel())}function d(t,i,b){if(!e.get(n))return;const r=e.get(n).camera;t[0]!==null&&(r.alpha=t[0]*Math.PI/180),t[1]!==null&&(r.beta=t[1]*Math.PI/180),t[2]!==null&&(r.radius=t[2]),r.lowerRadiusLimit=.1;const c=()=>{r.wheelPrecision=250/(r.radius*i),r.panningSensibility=1e4*b/r.radius};c(),r.onAfterCheckInputsObservable.add(c)}function v(){e.get(n)&&e.get(o)&&e.get(o).resetCamera()}var h={update_camera:d,reset_camera_position:v},f=y();return e.bind_this(f,t=>l=t,()=>l),e.append(p,f),e.pop(h)}export{q as default};
