@liveroom-tech/react-immersive 6.2.2 → 6.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +23 -0
  2. package/dist/{SequencesTab-LTMJTB76.mjs → SequencesTab-JZEE5WAM.mjs} +1 -1
  3. package/dist/binding-builder.d.mts +3 -3
  4. package/dist/binding-builder.d.ts +3 -3
  5. package/dist/binding-builder.js +41 -41
  6. package/dist/binding-builder.mjs +1 -1
  7. package/dist/{chunk-NMRTI3NQ.mjs → chunk-3GA7JFNH.mjs} +1 -1
  8. package/dist/chunk-3I7PPFUV.mjs +1 -0
  9. package/dist/{chunk-IT2PUTJS.mjs → chunk-CHMFH4D4.mjs} +1 -1
  10. package/dist/{chunk-RSUXTWM6.mjs → chunk-CUDL77ZY.mjs} +1 -1
  11. package/dist/{chunk-XKJQC3N5.mjs → chunk-IEKGBS46.mjs} +1 -1
  12. package/dist/chunk-LU3BQ7WG.mjs +69 -0
  13. package/dist/chunk-QZNUWZG7.mjs +50 -0
  14. package/dist/{chunk-WU3SQZGD.mjs → chunk-TI2YXAHW.mjs} +2 -2
  15. package/dist/hosted.d.mts +3 -3
  16. package/dist/hosted.d.ts +3 -3
  17. package/dist/hosted.js +40 -40
  18. package/dist/hosted.mjs +1 -1
  19. package/dist/index.d.mts +8 -4
  20. package/dist/index.d.ts +8 -4
  21. package/dist/index.js +36 -36
  22. package/dist/index.mjs +1 -1
  23. package/dist/{modelFileResolver-Bq4pW9vc.d.mts → modelFileResolver-An1aQ0D3.d.mts} +3 -0
  24. package/dist/{modelFileResolver-Bq4pW9vc.d.ts → modelFileResolver-An1aQ0D3.d.ts} +3 -0
  25. package/dist/{modelViewerProps-BnrJO5DK.d.ts → modelViewerProps-BnVflYRA.d.mts} +21 -3
  26. package/dist/{modelViewerProps-wjBT4fks.d.mts → modelViewerProps-H_K454u_.d.ts} +21 -3
  27. package/dist/{publicProps-BZPMIRwj.d.ts → publicProps-AdNUI06n.d.ts} +1 -1
  28. package/dist/{publicProps-CW5X_HFh.d.mts → publicProps-BOQBJBA_.d.mts} +1 -1
  29. package/dist/simple-model-viewer.d.mts +6 -2
  30. package/dist/simple-model-viewer.d.ts +6 -2
  31. package/dist/simple-model-viewer.js +5 -5
  32. package/dist/simple-model-viewer.mjs +1 -1
  33. package/dist/utils.d.mts +4 -4
  34. package/dist/utils.d.ts +4 -4
  35. package/dist/utils.js +15 -15
  36. package/dist/utils.mjs +1 -1
  37. package/package.json +7 -5
  38. package/dist/chunk-2LGQKX6Z.mjs +0 -50
  39. package/dist/chunk-LEOHZ5HM.mjs +0 -69
  40. package/dist/chunk-UAZ6I25Y.mjs +0 -1
@@ -1 +1 @@
1
- "use client";import{a as qr}from"./chunk-MMO7KCYU.mjs";import{A as Vr,C as Or,E as Ir,F as jr,I as Br,J as Ar,K as Kr,L as Gr,M as Ur,N as Wr,O as Xr,h as br,i as hr,k as xr,o as Mr,p as Sr,q as Cr,r as Rr,s as Er,t as Lr,u as Nr,v as zr,x as Pr,y as Dr,z as Tr}from"./chunk-XKJQC3N5.mjs";import{a as gr,b as be}from"./chunk-NMRTI3NQ.mjs";import{a as $r}from"./chunk-37YITTIK.mjs";import"./chunk-2AJK643D.mjs";import{b as wr,c as yr,d as De,e as _r,g as kr,h as Fr,l as Hr}from"./chunk-5C4H7SRF.mjs";import{b as fr}from"./chunk-3PLML3PO.mjs";import"./chunk-KFLS7GI6.mjs";import{a as Kn}from"./chunk-UAZ6I25Y.mjs";import"./chunk-BNKTI3CY.mjs";import"./chunk-UCD76KQ6.mjs";import"./chunk-RXZ4Q7CY.mjs";import"./chunk-JR557W27.mjs";import{useRef as C,useState as f,useCallback as k,useEffect as M,useMemo as H,Component as Un,Suspense as Te}from"react";import{CameraControls as Wn}from"@react-three/drei";import{useFrame as an,useThree as q}from"@react-three/fiber";import{Canvas as $n}from"@react-three/fiber";import{ACESFilmicToneMapping as Xn,AgXToneMapping as qn,Box3 as _e,Color as Jn,MeshStandardMaterial as Yn,NeutralToneMapping as Zn,NoToneMapping as Qn,PerspectiveCamera as sn,Vector3 as V}from"three";import{SkeletonUtils as et}from"three-stdlib";import{X as Oe,Check as ln,Settings as rt,ChevronDown as nt,Boxes as tt,RotateCcw as ot,Trash2 as at,Upload as Ve,AlertTriangle as it}from"lucide-react";import{Box3 as Jr,Vector3 as oe}from"three";var Yr=.1;function Hn(r,o){if(!o||r.isEmpty())return r.clone();let t=r.getCenter(new oe),l=r.getSize(new oe),a=Math.hypot(l.x,l.z)/2;return new Jr(new oe(t.x-a,r.min.y,t.z-a),new oe(t.x+a,r.max.y,t.z+a))}function Gn(r,o){let t=r.getSize(new oe),l=Math.max(t.x,t.y,t.z),a=Number.isFinite(l)?l*Math.max(0,o):0;return{paddingTop:a,paddingBottom:a,paddingLeft:a,paddingRight:a}}function he(r,o,{fitPadding:t,spinning:l},a){let d=new Jr().setFromObject(o);return r.fitToBox(Hn(d,l),a,Gn(d,t))}import{Fragment as on,jsx as e,jsxs as c}from"react/jsx-runtime";var Zr={color:"#93c5fd",intensity:.05},Qr=["neutral","apartment","city","dawn","forest","lobby","night","park","studio","sunset","warehouse"],dn={aces:Xn,agx:qn,neutral:Zn,none:Qn};function Ie(r){return!!(r&&"isMesh"in r&&r.isMesh)}function en(r,o){Array.isArray(r)?r.forEach(o):o(r)}function rn(r,o,t){if(!o)return;let l=o.camera;if(!(l instanceof sn))return;let a=new _e().setFromObject(r).getSize(new V).length();if(!Number.isFinite(a)||a<=0)return;l.near=a/100,l.far=a*100,l.updateProjectionMatrix();let d=Br(t);o.minDistance=t?.minDistance??a*.05,o.maxDistance=t?.maxDistance??a*10,o.minPolarAngle=d.minPolarAngle,o.maxPolarAngle=d.maxPolarAngle,o.minAzimuthAngle=d.minAzimuthAngle,o.maxAzimuthAngle=d.maxAzimuthAngle,o.boundaryEnclosesCamera=d.boundaryEnclosesCamera,o.boundaryFriction=d.boundaryFriction,o.setBoundary(d.panBoundary?new _e(new V(...d.panBoundary[0]),new V(...d.panBoundary[1])):void 0)}var ke=class extends Un{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){this.props.onLoadError?.(t)}render(){return this.state.hasError?null:this.props.children}};function st({url:r,format:o,dracoDecoderPath:t,ktx2TranscoderPath:l,meshopt:a,hiddenKeys:d,selectedKey:x,panelHoveredKey:b,nodeRefsOut:i,onMeshesReady:s,onModelLoaded:z,onLoadProgress:h,onMeshClick:N,highlightOnHover:y}){let{scene:u}=Kr(r,{dracoDecoderPath:t,ktx2TranscoderPath:l,meshopt:a},o,h),G=q(p=>p.invalidate),{setCanvasCursor:A,restoreCanvasCursor:O}=Ur(),[I,F]=f(null),E=H(()=>et.clone(u),[u]),P=H(()=>{let p={};return E.traverse(m=>{if(!Ie(m))return;let _=m.name||m.uuid;p[_]={key:_,label:m.name||m.type,ref:m}}),p},[E]),U=H(()=>{let p={};for(let[m,{ref:_}]of Object.entries(P)){let $=(Array.isArray(_.material)?_.material:[_.material]).map(w=>{let L=(Hr(w)??new Yn).clone();return L.userData.baseColor=L.color.clone(),L.userData.baseMap=L.map,L.userData.baseEmissive=L.emissive.clone(),L.userData.baseEmissiveMap=L.emissiveMap,L.userData.baseEmissiveIntensity=L.emissiveIntensity,L});p[m]=Array.isArray(_.material)?$:$[0]}return p},[P]);M(()=>()=>{Object.values(U).forEach(p=>en(p,m=>m.dispose()))},[U]);let ie=C(null);M(()=>{ie.current!==r&&(ie.current=r,E.updateWorldMatrix(!0,!0),Gr(E),s(P),z(E))},[r,E,P,s,z]),M(()=>{let p=new AbortController;return _r(E,p.signal),()=>{p.abort(),kr(E)}},[E]);let se=H(()=>!yr(E),[E]);M(()=>{for(let[p,{ref:m}]of Object.entries(P))i.current[p]=m},[P,i]),M(()=>{!y&&I!==null&&(F(null),O())},[y,I,O]),M(()=>{for(let[p,{ref:m}]of Object.entries(P)){m.visible=!d.has(p);let _=U[p];if(!_)continue;m.material=_;let re=y&&I===p,$=y&&b===p;en(_,w=>{if(w.color.copy(w.userData.baseColor),w.map=w.userData.baseMap??null,w.emissive.copy(w.userData.baseEmissive),w.emissiveMap=w.userData.baseEmissiveMap??null,w.emissiveIntensity=w.userData.baseEmissiveIntensity,$||re){let ne=!!w.userData.baseEmissiveMap;w.emissive.set(Zr.color),w.emissiveIntensity=ne?w.userData.baseEmissiveIntensity:Zr.intensity}w.needsUpdate=!0})}G()},[P,U,I,x,b,y,d,G]);let W=p=>{if(!Fr(p))return null;let m=p;for(;m;){let _=m.name||m.uuid;if(P[_])return _;m=m.parent}return null},ee=se?{onClick:p=>{let m=W(p.object);m&&(p.stopPropagation(),N(m))},...y?{onPointerOver:p=>{let m=W(p.object);m&&(p.stopPropagation(),A("pointer"),F(m))},onPointerOut:p=>{p.stopPropagation(),O(),F(null)}}:{}}:{};return e("primitive",{object:E,...ee})}function lt({scene:r,controlsRef:o,refitOnResize:t,onInitialFitComplete:l,resumeViewRef:a,cameraLimits:d,framing:x}){let b=C(x);b.current=x;let i=C(d);i.current=d;let s=JSON.stringify(d??null);M(()=>{r&&rn(r,o.current,i.current)},[r,o,s]);let z=C(!1),h=q(u=>u.invalidate),N=q(u=>u.size),y=C(null);return M(()=>{z.current=!1,h()},[h,r]),an(()=>{if(z.current)return;if(!r||!o.current){h();return}z.current=!0,rn(r,o.current,d);let u=a.current;if(u){a.current=null,o.current.setLookAt(...u.position,...u.target,!1).catch(()=>{}).finally(l),h();return}he(o.current,r,b.current,!1).catch(()=>{}).finally(l),h()}),M(()=>{if(!(!t||!z.current||!r||!o.current))return y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{let u=o.current;u&&he(u,r,b.current,!0).catch(()=>{}),h()},150),()=>{y.current&&clearTimeout(y.current)}},[N.width,N.height,t]),null}function dt({scene:r,exposure:o,toneMapping:t,fov:l,wireframe:a}){let d=q(i=>i.gl),x=q(i=>i.camera),b=q(i=>i.invalidate);return M(()=>{d.toneMappingExposure=o,b()},[d,o,b]),M(()=>{x instanceof sn&&(x.fov=l,x.updateProjectionMatrix(),b())},[x,l,b]),M(()=>{d.toneMapping=dn[t],r?.traverse(i=>{if(Ie(i))for(let s of[i.material].flat())s.wireframe=a,s.needsUpdate=!0}),b()},[d,r,t,a,b]),null}function ct({enabled:r,speed:o,controlsRef:t}){let l=q(a=>a.invalidate);return an((a,d)=>{!r||!t.current||(t.current.rotate(d*.2*o,0,!1),l())}),null}function xe(r){return Array.from(r.types).includes("Files")}function ae({label:r,checked:o,onChange:t}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:e("button",{type:"button",className:"ri-env-checkbox-btn",role:"checkbox","aria-checked":o,"aria-label":r,onClick:()=>t(!o),children:e("span",{className:`ri-env-checkbox${o?" ri-env-checkbox--checked":""}`,children:o&&e(ln,{size:10,strokeWidth:2.5,"aria-hidden":"true"})})})})]})}function we({label:r,value:o,onChange:t}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:c("label",{className:"ri-env-color-swatch",children:[e("span",{className:"ri-env-color-swatch__chip",style:{background:o}}),e("span",{className:"ri-env-color-swatch__hex",children:o}),e("input",{type:"color",className:"ri-env-color-swatch__input","aria-label":r,value:o,onChange:l=>t(l.target.value)})]})})]})}function B({label:r,value:o,min:t,max:l,step:a,format:d=b=>b.toFixed(2),onChange:x}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),c("div",{className:"ri-env-row__value ri-env-row__value--slider",children:[e("input",{type:"range",className:"ri-env-slider","aria-label":r,min:t,max:l,step:a,value:o,onChange:b=>x(Number(b.target.value))}),e("span",{className:"ri-env-slider__value",children:d(o)})]})]})}function nn({label:r,optionLabels:o,value:t,options:l,onChange:a}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:e(fr,{className:"ri-env-select","aria-label":r,value:t,onChange:d=>a(d.target.value),children:l.map(d=>e("option",{value:d,children:o?.[d]??d},d))})})]})}function ye({label:r,value:o}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("span",{className:"ri-env-row__info",children:o})]})}var tn=r=>`${Math.round(r)}\xB0`;function Q({title:r,children:o}){let[t,l]=f(!1);return c("div",{className:"ri-env-section",children:[c("button",{type:"button",className:"ri-env-section__header","aria-expanded":!t,onClick:()=>l(a=>!a),children:[e(nt,{size:12,strokeWidth:2,className:`ri-env-section__chevron${t?" env-section__chevron--collapsed":""}`}),e("span",{children:r})]}),!t&&e("div",{className:"ri-env-section__body",children:o})]})}function pt({isOpen:r,onToggle:o,settings:t,modelInfo:l,onChange:a,onReset:d,environmentEnabled:x,environmentUrl:b}){let i=be();return c("div",{className:`ri-left-panel-wrapper ${r?"ri-left-panel-wrapper--open":"ri-left-panel-wrapper--closed"}`,children:[!r&&e("button",{className:"ri-side-panel__open-btn ri-side-panel__open-btn--left",onClick:()=>o(!0),children:e(rt,{size:20,strokeWidth:1.8})}),c("div",{className:`ri-side-panel ri-side-panel--left ${r?"ri-side-panel--open-left":"ri-side-panel--closed-left"}`,"aria-hidden":!r,children:[e("div",{className:"ri-side-panel__header",children:c("div",{className:"ri-side-panel__header-top",children:[e("span",{className:"ri-side-panel__eyebrow",children:i("sceneSettings")}),e("button",{className:"ri-side-panel__close-btn",onClick:()=>o(!1),title:i("close"),children:e(Oe,{size:12,strokeWidth:1.6})})]})}),c("div",{className:"ri-env-controls",children:[x&&c(Q,{title:i("environment"),children:[!b&&e(nn,{label:i("environmentPreset"),value:t.envPreset,options:Qr,optionLabels:Object.fromEntries(Qr.map(s=>[s,i(`environment${s[0].toUpperCase()}${s.slice(1)}`)])),onChange:s=>a("envPreset",s)}),e(B,{label:i("environmentIntensity"),value:t.envIntensity,min:0,max:3,step:.05,onChange:s=>a("envIntensity",s)}),e(B,{label:i("rotation"),value:t.envRotation,min:0,max:360,step:1,format:tn,onChange:s=>a("envRotation",s)}),e(ae,{label:i("showEnvironmentAsBackground"),checked:t.backgroundEnabled,onChange:s=>a("backgroundEnabled",s)}),t.backgroundEnabled?e(B,{label:i("backgroundBlur"),value:t.backgroundBlur,min:0,max:1,step:.01,onChange:s=>a("backgroundBlur",s)}):e(we,{label:i("backgroundColor"),value:t.backgroundColor,onChange:s=>a("backgroundColor",s)})]}),!x&&e(Q,{title:i("background"),children:e(we,{label:i("backgroundColor"),value:t.backgroundColor,onChange:s=>a("backgroundColor",s)})}),c(Q,{title:i("lighting"),children:[e(B,{label:i("exposure"),value:t.exposure,min:0,max:2,step:.05,onChange:s=>a("exposure",s)}),e(nn,{label:i("toneMapping"),value:t.toneMapping,options:Object.keys(dn),optionLabels:{aces:i("toneMappingAces"),agx:i("toneMappingAgx"),neutral:i("toneMappingNeutral"),none:i("toneMappingNone")},onChange:s=>a("toneMapping",s)}),e(B,{label:i("ambientLightIntensity"),value:t.ambientIntensity,min:0,max:3,step:.05,onChange:s=>a("ambientIntensity",s)}),e(we,{label:i("ambientLightColor"),value:t.ambientColor,onChange:s=>a("ambientColor",s)}),e(B,{label:i("directLightIntensity"),value:t.directionalIntensity,min:0,max:5,step:.05,onChange:s=>a("directionalIntensity",s)}),e(we,{label:i("directLightColor"),value:t.directionalColor,onChange:s=>a("directionalColor",s)})]}),c(Q,{title:i("ground"),children:[e(ae,{label:i("groundShadow"),checked:t.groundShadow,onChange:s=>a("groundShadow",s)}),t.groundShadow&&e(B,{label:i("groundShadowOpacity"),value:t.groundShadowOpacity,min:0,max:1,step:.01,onChange:s=>a("groundShadowOpacity",s)}),e(ae,{label:i("floorGrid"),checked:t.showFloorGrid,onChange:s=>a("showFloorGrid",s)})]}),c(Q,{title:i("display"),children:[e(ae,{label:i("wireframe"),checked:t.wireframe,onChange:s=>a("wireframe",s)}),e(ae,{label:i("autoRotate"),checked:t.autoRotate,onChange:s=>a("autoRotate",s)}),t.autoRotate&&e(B,{label:i("autoRotateSpeed"),value:t.autoRotateSpeed,min:.1,max:5,step:.1,onChange:s=>a("autoRotateSpeed",s)}),e(B,{label:i("fieldOfView"),value:t.fov,min:15,max:90,step:1,format:tn,onChange:s=>a("fov",s)})]}),l&&c(Q,{title:i("modelInfo"),children:[e(ye,{label:i("modelInfoObjects"),value:l.objects.toLocaleString()}),e(ye,{label:i("modelInfoTriangles"),value:l.triangles.toLocaleString()}),e(ye,{label:i("modelInfoMaterials"),value:l.materials.toLocaleString()}),e(ye,{label:i("size"),value:l.size})]}),e("div",{className:"ri-env-footer",children:c("button",{type:"button",className:"ri-env-reset",onClick:d,children:[e(ot,{size:12,"aria-hidden":"true"}),i("resetSettings")]})})]})]})]})}function ut(r){let o=0,t=new Set;r.traverse(a=>{if(Ie(a)){o+=1;for(let d of[a.material].flat())t.add(d.name||d.uuid)}});let l=new _e().setFromObject(r).getSize(new V);return{objects:o,triangles:De(r),materials:t.size,size:[l.x,l.y,l.z].map(a=>Number(a.toPrecision(3))).join(" \xD7 ")}}function mt({meshKeys:r,hiddenKeys:o,selectedKey:t,isOpen:l,onToggle:a,onFocus:d,onHover:x,onToggleVisibility:b}){let i=be(),[s,z]=f(""),[h,N]=f(null),y=Object.values(r).filter(u=>u.label.toLowerCase().includes(s.toLowerCase()));return c("div",{className:`ri-right-panel-wrapper ${l?"ri-right-panel-wrapper--open":"ri-right-panel-wrapper--closed"}`,children:[!l&&e("button",{className:"ri-side-panel__open-btn",onClick:()=>a(!0),children:e(tt,{size:20,strokeWidth:1.8})}),c("div",{className:`ri-side-panel ${l?"ri-side-panel--open":"ri-side-panel--closed"}`,"aria-hidden":!l,children:[e("div",{className:"ri-side-panel__header",children:c("div",{className:"ri-side-panel__header-top",children:[e("span",{className:"ri-side-panel__eyebrow",children:i("sceneObjects")}),e("span",{className:"ri-side-panel__title","aria-label":i("objectCount",{count:y.length}),children:y.length}),e("button",{className:"ri-side-panel__close-btn",onClick:()=>a(!1),title:i("close"),children:e(Oe,{size:12,strokeWidth:1.6})})]})}),e("div",{className:"ri-side-panel__search-wrap",children:e("input",{className:"ri-side-panel__search",type:"text",placeholder:i("searchObjects"),value:s,onChange:u=>z(u.target.value)})}),e("div",{className:"ri-side-panel__list",children:y.map(({key:u,label:G})=>{let A=!o.has(u),O=t===u,I=h===u;return c("div",{onClick:()=>d(u),onMouseEnter:()=>{N(u),x(u)},onMouseLeave:()=>{N(null),x(null)},className:["ri-side-panel__row",I?"ri-side-panel__row--hovered":"",O?"ri-side-panel__row--selected":""].filter(Boolean).join(" "),children:[e("button",{type:"button",className:`ri-side-panel__label ri-side-panel__labelButton${I||O?" ri-side-panel__label--hovered":""}`,"aria-current":O?"true":void 0,onFocus:()=>{N(u),x(u)},onBlur:()=>{N(null),x(null)},children:G}),e("button",{type:"button",className:"ri-side-panel__vis-btn",title:i(A?"hide":"show"),"aria-label":i(A?"hideObject":"showObject",{name:G}),onClick:F=>{F.stopPropagation(),b(u)},children:e("span",{className:`ri-side-panel__checkbox${A?" ri-side-panel__checkbox--checked":""}`,children:A&&e(ln,{size:9,strokeWidth:5,color:"white"})})})]},u)})})]})]})}function cn(r){return e(gr,{labels:r.labels,children:e(vt,{...r})})}function vt({modelUrl:r,poster:o,loading:t,reveal:l,modelFormat:a,dracoDecoderPath:d,ktx2TranscoderPath:x,meshopt:b=!0,backgroundColor:i="#1a1a1a",showSceneObjectsPanel:s=!0,showSceneSettingsPanel:z=!0,enableModelUpload:h=!1,zoomOnSelected:N=!1,highlightOnHover:y=!1,showLoadingOverlay:u=!0,showLoadError:G=!0,refitOnResize:A=!0,cameraLimits:O,showResetButton:I=!0,fitPadding:F=Yr,zoom:E=!0,pageScroll:P=!1,backgroundEnabled:U=!1,autoRotate:ie=!1,envPreset:se=Tr,environmentUrl:W,environmentEnabled:ee=!0,exposure:p=1,ambientIntensity:m=.6,ambientColor:_="#ffffff",directionalIntensity:re=1.2,directionalColor:$="#ffffff",envIntensity:w=1,envRotation:ne=0,backgroundBlur:L=0,toneMapping:je="aces",groundShadow:Be=!1,groundShadowOpacity:Ae=.5,showFloorGrid:Fe=!1,wireframe:Ke=!1,autoRotateSpeed:He=1,fov:Ge=45,onModelLoaded:Ue,onLoadError:le,labels:pn,reducedMotion:un="user"}){let D=be(),de=$r(un),We=ie&&!de;qr("simple-model-viewer","SimpleModelViewer");let j=C(null),ce=C(null),$e=C({}),Xe=C(null),Me=C(null),te=C(0),[R,Se]=f(null),[qe,Je]=f(null),[mn,Ce]=f(!1),[vn,Ye]=f({}),[Ze,Qe]=f(new Set),[er,rr]=f(null),[gn,nr]=f(null),[tr,or]=f(null),[fn,ar]=f(null),[ir,pe]=f(!1),[bn,Re]=f(null),[hn,xn]=f(0),[sr,lr]=f(!1),[ue,Ee]=f(!1),[wn,me]=f(null),yn=Dr(wn),[_n,ve]=f(!1),[kn,Mn]=f(()=>typeof window>"u"?!0:window.innerWidth>900),[Sn,Cn]=f(()=>typeof window>"u"?!0:window.innerWidth>900),ge=H(()=>({backgroundEnabled:U,backgroundColor:i,autoRotate:We,envPreset:se,exposure:p,ambientIntensity:m,ambientColor:_,directionalIntensity:re,directionalColor:$,envIntensity:w,envRotation:ne,backgroundBlur:L,toneMapping:je,groundShadow:Be,groundShadowOpacity:Ae,showFloorGrid:Fe,wireframe:Ke,autoRotateSpeed:He,fov:Ge}),[U,i,We,se,p,m,_,re,$,w,ne,L,je,Be,Ae,Fe,Ke,He,Ge]),[v,fe]=f(ge),dr=H(()=>({fitPadding:F,spinning:v.autoRotate}),[F,v.autoRotate]),S=h?tr:r,cr=C(null),Le=C(null),Ne=C(null),[J,pr]=f(null);M(()=>()=>{J&&URL.revokeObjectURL(J)},[J]);let ur=C(S);ur.current=S;let ze=C(null),K=Lr({loading:t,reveal:l,rootRef:cr,onPark:()=>{ze.current=Le.current?.gl??null;let n=j.current;if(n&&ue){Ne.current={position:n.getPosition(new V).toArray(),target:n.getTarget(new V).toArray()};let g=S;Er(Le.current).then(T=>{T&&(g===ur.current?pr(T):URL.revokeObjectURL(T))})}Se(null),Ee(!1)}});M(()=>{if(K.live)return;let n=ze.current;ze.current=null,n&&Rr(n)},[K.live]);let X=k(()=>{Ne.current=null,ce.current=null,pr(null),Se(null),Je(null),Ce(!1),Ye({}),Qe(new Set),rr(null),nr(null),pe(!1),Re(null),Ee(!1),me(null)},[]),Y=k(()=>{Me.current?.cleanup(),Me.current=null},[]),Rn=k(()=>{Y(),or(null),ar(null),X(),fe(ge)},[ge,X,Y]),mr=k(async n=>{lr(!0);try{let g=await xr(n);Y(),Me.current=g,or(g.url),ar(g.name),X()}catch(g){pe(!0),Re(g),le?.(g)}finally{lr(!1)}},[le,X,Y]),Pe=k(n=>{let g=n?.[0];g&&mr(g)},[mr]);M(()=>()=>{Y()},[Y]);let En=k(()=>R,[R]),Ln=!(ee&&v.backgroundEnabled)&&new Jn(v.backgroundColor).getHSL({h:0,s:0,l:0}).l>.5?"#000000":"#ffffff",Nn=H(()=>R?ut(R):null,[R]),Z=H(()=>{if(!R)return null;let n=new _e().setFromObject(R);if(n.isEmpty())return null;let g=n.getSize(new V);return{y:n.min.y,center:n.getCenter(new V),size:Math.max(g.x,g.y,g.z)}},[R]),zn=k((n,g)=>{fe(T=>({...T,[n]:g}))},[]);M(()=>{fe(n=>({...n,backgroundColor:i}))},[i]),M(()=>{X()},[S,X]);let Pn=k(n=>{Ye(n)},[]),Dn=k(n=>{Se(n),pe(!1);let g=De(n);Je(g>wr?g:null),Ce(!1),me(null),Ue?.(Wr(n))},[Ue]),Tn=k(n=>{pe(!0),Re(n),me(null),le?.(n)},[le]),Vn=k(n=>{n.lengthComputable&&n.total>0&&me(n.loaded/n.total*100)},[]),vr=k(n=>{if(rr(n),!N)return;let g=$e.current[n];!g||!j.current||j.current.fitToBox(g,!0,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5}).catch(()=>{})},[N]),On=k(n=>{Qe(g=>{let T=new Set(g);return T.has(n)?T.delete(n):T.add(n),T})},[]),In=k(n=>{!h||!xe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),te.current+=1,ve(!0))},[h]),jn=k(n=>{!h||!xe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),n.dataTransfer.dropEffect="copy",ve(!0))},[h]),Bn=k(n=>{!h||!xe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),te.current=Math.max(0,te.current-1),te.current===0&&ve(!1))},[h]),An=k(n=>{!h||!xe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),te.current=0,ve(!1),Pe(n.dataTransfer.files))},[h,Pe]),Fn=u&&(sr||!!(S&&K.live&&!ir&&(!R||!ue)));return c("div",{className:"smv-root",ref:cr,"data-reduced-motion":de?"":void 0,style:{background:v.backgroundColor},onDragEnter:In,onDragOver:jn,onDragLeave:Bn,onDrop:An,children:[z&&S&&e(pt,{isOpen:Sn,onToggle:Cn,environmentUrl:W,environmentEnabled:ee,settings:v,modelInfo:Nn,onReset:()=>fe(ge),onChange:zn}),c("div",{className:"smv-canvasArea",children:[G&&ir&&S&&c("div",{className:"smv-load-error",role:"alert",children:[e("strong",{children:D("loadErrorTitle")}),e("p",{children:Pr(bn,S,a,pn).detail}),e("button",{type:"button",onClick:()=>{br(S),X(),xn(n=>n+1)},children:D("retryModelLoad")})]}),I&&R&&ue&&e("button",{type:"button",className:"smv-reset-camera",onClick:()=>{let n=j.current,g=ce.current;!n||!g||n.setLookAt(...g.position,...g.target,!1).then(()=>he(n,R,dr,!de)).catch(()=>{})},children:D("resetCameraView")}),qe!==null&&!mn&&c("div",{className:"smv-largeModelBanner",children:[e(it,{size:14,className:"smv-largeModelBanner__icon"}),e("span",{children:D("simpleLargeModelWarning",{millions:Math.round(qe/1e6)})}),e("button",{type:"button",className:"smv-largeModelBanner__dismiss",onClick:()=>Ce(!0),"aria-label":D("dismiss"),children:e(Oe,{size:12})})]}),h?c(on,{children:[e("input",{ref:Xe,type:"file",accept:hr,className:"smv-upload-input",onChange:n=>{Pe(n.target.files),n.currentTarget.value=""}}),S?e("div",{className:"smv-upload-toolbar",children:c(on,{children:[e("span",{className:"smv-upload-toolbar__name",children:fn??D("uploadedModel")}),c("button",{type:"button",className:"smv-upload-toolbar__button smv-upload-toolbar__button--ghost",onClick:Rn,children:[e(at,{size:14}),D("clear")]})]})}):null]}):null,S&&!K.live?e(zr,{className:"ri-viewerPlaceholder--inset",background:v.backgroundColor,poster:J??o,onReveal:K.awaitingReveal?K.reveal:void 0}):S?c($n,{dpr:[1,2],frameloop:K.visible?"demand":"never",resize:{debounce:0,scroll:!1},raycaster:{firstHitOnly:!0},style:{background:v.backgroundColor},camera:{position:[0,0,5],fov:45,near:.1,far:1e3},children:[e(Sr,{captureRef:Le}),e(Cr,{}),c(Te,{fallback:null,children:[e("ambientLight",{intensity:v.ambientIntensity,color:v.ambientColor}),e("directionalLight",{position:[-4,5,7],intensity:v.directionalIntensity,color:v.directionalColor,castShadow:!0}),e("directionalLight",{position:[-5,5,5],intensity:.5}),ee&&e(ke,{children:c(Te,{fallback:null,children:[e(Vr,{...W?{files:W}:{preset:v.envPreset},background:v.backgroundEnabled,environmentIntensity:v.envIntensity,backgroundIntensity:v.envIntensity,backgroundBlurriness:v.backgroundBlur}),e(Ir,{})]})},W??v.envPreset),e(jr,{rotation:v.envRotation}),e(dt,{scene:R,exposure:v.exposure,toneMapping:v.toneMapping,fov:v.fov,wireframe:v.wireframe}),e(ct,{enabled:v.autoRotate,speed:v.autoRotateSpeed,controlsRef:j}),v.groundShadow&&Z&&e(Or,{position:[Z.center.x,Z.y,Z.center.z],scale:Z.size*2,opacity:v.groundShadowOpacity,blur:2,far:Z.size,resolution:1024,color:"#000000"}),v.showFloorGrid&&e(Mr,{getTarget:En,revision:R,lineColor:Ln}),e(ke,{onLoadError:Tn,children:e(Te,{fallback:null,children:e(st,{url:S,format:tr?void 0:a,dracoDecoderPath:d,ktx2TranscoderPath:x,meshopt:b,hiddenKeys:Ze,selectedKey:er,panelHoveredKey:gn,nodeRefsOut:$e,onMeshesReady:Pn,onModelLoaded:Dn,onLoadProgress:Vn,onMeshClick:vr,highlightOnHover:y})})},`${S}:${hn}`),e(lt,{scene:R,controlsRef:j,refitOnResize:A,onInitialFitComplete:()=>{let n=j.current;n&&!ce.current&&(ce.current={position:n.getPosition(new V).toArray(),target:n.getTarget(new V).toArray()}),Ee(!0)},cameraLimits:O,resumeViewRef:Ne,framing:dr}),e(Wn,{ref:j,makeDefault:!0,smoothTime:de?0:.3}),e(Ar,{controlsRef:j,zoom:E,pageScroll:P})]})]}):e("div",{className:"smv-upload-empty-state",style:{background:v.backgroundColor},children:c("div",{className:"smv-upload-empty-state__card",children:[e("div",{className:"smv-upload-empty-state__icon",children:e(Ve,{size:24})}),e("p",{className:"smv-upload-empty-state__body",children:D("dropModelHint",{formats:".glb, .gltf, .obj, .fbx, .usdz, .stl, .ply, .zip"})}),c("button",{type:"button",className:"smv-upload-empty-state__button",onClick:()=>Xe.current?.click(),children:[e(Ve,{size:15}),D("chooseModel")]})]})}),S&&K.live?e(Nr,{src:J??o,hidden:!!(R&&ue)}):null,e(Xr,{visible:Fn,message:D("loadingModel"),progress:sr?void 0:yn??void 0,background:v.backgroundColor,seeThrough:!!(J??o)}),h&&_n?e("div",{className:"smv-upload-drop-overlay",children:c("div",{className:"smv-upload-drop-overlay__card",children:[e(Ve,{size:20}),e("span",{children:D("releaseToLoadYourModel")})]})}):null]}),s&&S&&e(mt,{meshKeys:vn,hiddenKeys:Ze,selectedKey:er,isOpen:kn,onToggle:Mn,onFocus:vr,onHover:nr,onToggleVisibility:On})]})}export{Kn as DEFAULT_MODEL_VIEWER_LABELS,cn as SimpleModelViewer};
1
+ "use client";import{a as Yr}from"./chunk-MMO7KCYU.mjs";import{A as Ir,C as jr,E as Br,F as Ar,I as Fr,J as Kr,K as Gr,L as Wr,M as $r,N as Xr,O as Jr,h as xr,i as wr,k as yr,o as Cr,p as Rr,q as Er,r as Lr,s as Nr,t as zr,u as Pr,v as Dr,x as Tr,y as Vr,z as Or}from"./chunk-IEKGBS46.mjs";import{a as fr,b as fe}from"./chunk-3GA7JFNH.mjs";import{a as qr}from"./chunk-37YITTIK.mjs";import"./chunk-2AJK643D.mjs";import{b as _r,c as kr,d as De,e as Mr,g as Sr,h as Hr,l as Ur}from"./chunk-5C4H7SRF.mjs";import{b as hr}from"./chunk-3PLML3PO.mjs";import"./chunk-KFLS7GI6.mjs";import{a as Un}from"./chunk-3I7PPFUV.mjs";import"./chunk-BNKTI3CY.mjs";import"./chunk-UCD76KQ6.mjs";import"./chunk-RXZ4Q7CY.mjs";import"./chunk-JR557W27.mjs";import{useRef as R,useState as g,useCallback as k,useEffect as M,useMemo as H,useId as ln,Component as Xn,Suspense as Te}from"react";import{CameraControls as qn}from"@react-three/drei";import{useFrame as dn,useThree as W}from"@react-three/fiber";import{Canvas as Jn}from"@react-three/fiber";import{ACESFilmicToneMapping as Yn,AgXToneMapping as Zn,Box3 as _e,Color as Qn,MeshStandardMaterial as et,NeutralToneMapping as rt,NoToneMapping as nt,PerspectiveCamera as cn,Vector3 as I}from"three";import{SkeletonUtils as tt}from"three-stdlib";import{X as Oe,Check as pn,Settings as ot,ChevronDown as at,Boxes as it,RotateCcw as st,Trash2 as lt,Upload as Ve,AlertTriangle as dt}from"lucide-react";import{Box3 as Zr,Vector3 as ne}from"three";var Qr=.1;function Wn(r,i){if(!i||r.isEmpty())return r.clone();let t=r.getCenter(new ne),l=r.getSize(new ne),a=Math.hypot(l.x,l.z)/2;return new Zr(new ne(t.x-a,r.min.y,t.z-a),new ne(t.x+a,r.max.y,t.z+a))}function $n(r,i){let t=r.getSize(new ne),l=Math.max(t.x,t.y,t.z),a=Number.isFinite(l)?l*Math.max(0,i):0;return{paddingTop:a,paddingBottom:a,paddingLeft:a,paddingRight:a}}function he(r,i,{fitPadding:t,spinning:l},a){let d=new Zr().setFromObject(i);return r.fitToBox(Wn(d,l),a,$n(d,t))}import{Fragment as sn,jsx as e,jsxs as c}from"react/jsx-runtime";var en={color:"#93c5fd",intensity:.05},rn=["neutral","apartment","city","dawn","forest","lobby","night","park","studio","sunset","warehouse"],un={aces:Yn,agx:Zn,neutral:rt,none:nt};function Ie(r){return!!(r&&"isMesh"in r&&r.isMesh)}function nn(r,i){Array.isArray(r)?r.forEach(i):i(r)}function tn(r,i,t){if(!i)return;let l=i.camera;if(!(l instanceof cn))return;let a=new _e().setFromObject(r).getSize(new I).length();if(!Number.isFinite(a)||a<=0)return;l.near=a/100,l.far=a*100,l.updateProjectionMatrix();let d=Fr(t);i.minDistance=t?.minDistance??a*.05,i.maxDistance=t?.maxDistance??a*10,i.minPolarAngle=d.minPolarAngle,i.maxPolarAngle=d.maxPolarAngle,i.minAzimuthAngle=d.minAzimuthAngle,i.maxAzimuthAngle=d.maxAzimuthAngle,i.boundaryEnclosesCamera=d.boundaryEnclosesCamera,i.boundaryFriction=d.boundaryFriction,i.setBoundary(d.panBoundary?new _e(new I(...d.panBoundary[0]),new I(...d.panBoundary[1])):void 0)}var ke=class extends Xn{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){this.props.onLoadError?.(t)}render(){return this.state.hasError?null:this.props.children}};function ct({url:r,format:i,dracoDecoderPath:t,ktx2TranscoderPath:l,meshopt:a,hiddenKeys:d,selectedKey:h,panelHoveredKey:f,nodeRefsOut:o,onMeshesReady:E,onModelLoaded:s,onLoadProgress:z,onMeshClick:A,highlightOnHover:v}){let{scene:x}=Gr(r,{dracoDecoderPath:t,ktx2TranscoderPath:l,meshopt:a},i,z),y=W(p=>p.invalidate),{setCanvasCursor:$,restoreCanvasCursor:T}=$r(),[V,F]=g(null),S=H(()=>tt.clone(x),[x]),P=H(()=>{let p={};return S.traverse(u=>{if(!Ie(u))return;let _=u.name||u.uuid;p[_]={key:_,label:u.name||u.type,ref:u}}),p},[S]),X=H(()=>{let p={};for(let[u,{ref:_}]of Object.entries(P)){let G=(Array.isArray(_.material)?_.material:[_.material]).map(w=>{let N=(Ur(w)??new et).clone();return N.userData.baseColor=N.color.clone(),N.userData.baseMap=N.map,N.userData.baseEmissive=N.emissive.clone(),N.userData.baseEmissiveMap=N.emissiveMap,N.userData.baseEmissiveIntensity=N.emissiveIntensity,N});p[u]=Array.isArray(_.material)?G:G[0]}return p},[P]);M(()=>()=>{Object.values(X).forEach(p=>nn(p,u=>u.dispose()))},[X]);let oe=R(null);M(()=>{oe.current!==r&&(oe.current=r,S.updateWorldMatrix(!0,!0),Wr(S),E(P),s(S))},[r,S,P,E,s]),M(()=>{let p=new AbortController;return Mr(S,p.signal),()=>{p.abort(),Sr(S)}},[S]);let ae=H(()=>!kr(S),[S]);M(()=>{for(let[p,{ref:u}]of Object.entries(P))o.current[p]=u},[P,o]),M(()=>{!v&&V!==null&&(F(null),T())},[v,V,T]),M(()=>{for(let[p,{ref:u}]of Object.entries(P)){u.visible=!d.has(p);let _=X[p];if(!_)continue;u.material=_;let Q=v&&V===p,G=v&&f===p;nn(_,w=>{if(w.color.copy(w.userData.baseColor),w.map=w.userData.baseMap??null,w.emissive.copy(w.userData.baseEmissive),w.emissiveMap=w.userData.baseEmissiveMap??null,w.emissiveIntensity=w.userData.baseEmissiveIntensity,G||Q){let ee=!!w.userData.baseEmissiveMap;w.emissive.set(en.color),w.emissiveIntensity=ee?w.userData.baseEmissiveIntensity:en.intensity}w.needsUpdate=!0})}y()},[P,X,V,h,f,v,d,y]);let ie=p=>{if(!Hr(p))return null;let u=p;for(;u;){let _=u.name||u.uuid;if(P[_])return _;u=u.parent}return null},se=ae?{onClick:p=>{let u=ie(p.object);u&&(p.stopPropagation(),A(u))},...v?{onPointerOver:p=>{let u=ie(p.object);u&&(p.stopPropagation(),$("pointer"),F(u))},onPointerOut:p=>{p.stopPropagation(),T(),F(null)}}:{}}:{};return e("primitive",{object:S,...se})}function pt({scene:r,controlsRef:i,refitOnResize:t,onInitialFitComplete:l,resumeViewRef:a,cameraLimits:d,framing:h}){let f=R(h);f.current=h;let o=R(d);o.current=d;let E=JSON.stringify(d??null);M(()=>{r&&tn(r,i.current,o.current)},[r,i,E]);let s=R(!1),z=W(x=>x.invalidate),A=W(x=>x.size),v=R(null);return M(()=>{s.current=!1,z()},[z,r]),dn(()=>{if(s.current)return;if(!r||!i.current){z();return}s.current=!0,tn(r,i.current,d);let x=a.current;if(x){a.current=null,i.current.setLookAt(...x.position,...x.target,!1).catch(()=>{}).finally(l),z();return}he(i.current,r,f.current,!1).catch(()=>{}).finally(l),z()}),M(()=>{if(!(!t||!s.current||!r||!i.current))return v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{let x=i.current;x&&he(x,r,f.current,!0).catch(()=>{}),z()},150),()=>{v.current&&clearTimeout(v.current)}},[A.width,A.height,t]),null}function ut({scene:r,exposure:i,toneMapping:t,fov:l,wireframe:a}){let d=W(o=>o.gl),h=W(o=>o.camera),f=W(o=>o.invalidate);return M(()=>{d.toneMappingExposure=i,f()},[d,i,f]),M(()=>{h instanceof cn&&(h.fov=l,h.updateProjectionMatrix(),f())},[h,l,f]),M(()=>{d.toneMapping=un[t],r?.traverse(o=>{if(Ie(o))for(let E of[o.material].flat())E.wireframe=a,E.needsUpdate=!0}),f()},[d,r,t,a,f]),null}function mt({enabled:r,speed:i,controlsRef:t}){let l=W(a=>a.invalidate);return dn((a,d)=>{!r||!t.current||(t.current.rotate(d*.2*i,0,!1),l())}),null}function xe(r){return Array.from(r.types).includes("Files")}function te({label:r,checked:i,onChange:t}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:e("button",{type:"button",className:"ri-env-checkbox-btn",role:"checkbox","aria-checked":i,"aria-label":r,onClick:()=>t(!i),children:e("span",{className:`ri-env-checkbox${i?" ri-env-checkbox--checked":""}`,children:i&&e(pn,{size:10,strokeWidth:2.5,"aria-hidden":"true"})})})})]})}function we({label:r,value:i,onChange:t}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:c("label",{className:"ri-env-color-swatch",children:[e("span",{className:"ri-env-color-swatch__chip",style:{background:i}}),e("span",{className:"ri-env-color-swatch__hex",children:i}),e("input",{type:"color",className:"ri-env-color-swatch__input","aria-label":r,value:i,onChange:l=>t(l.target.value)})]})})]})}function B({label:r,value:i,min:t,max:l,step:a,format:d=f=>f.toFixed(2),onChange:h}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),c("div",{className:"ri-env-row__value ri-env-row__value--slider",children:[e("input",{type:"range",className:"ri-env-slider","aria-label":r,min:t,max:l,step:a,value:i,onChange:f=>h(Number(f.target.value))}),e("span",{className:"ri-env-slider__value",children:d(i)})]})]})}function on({label:r,optionLabels:i,value:t,options:l,onChange:a}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("div",{className:"ri-env-row__value",children:e(hr,{className:"ri-env-select","aria-label":r,value:t,onChange:d=>a(d.target.value),children:l.map(d=>e("option",{value:d,children:i?.[d]??d},d))})})]})}function ye({label:r,value:i}){return c("div",{className:"ri-env-row",children:[e("span",{className:"ri-env-row__label",title:r,children:r}),e("span",{className:"ri-env-row__info",children:i})]})}var an=r=>`${Math.round(r)}\xB0`;function Z({title:r,children:i}){let[t,l]=g(!1);return c("div",{className:"ri-env-section",children:[c("button",{type:"button",className:"ri-env-section__header","aria-expanded":!t,onClick:()=>l(a=>!a),children:[e(at,{size:12,strokeWidth:2,className:`ri-env-section__chevron${t?" env-section__chevron--collapsed":""}`}),e("span",{children:r})]}),!t&&e("div",{className:"ri-env-section__body",children:i})]})}function vt({isOpen:r,onToggle:i,settings:t,modelInfo:l,onChange:a,onReset:d,environmentEnabled:h,environmentUrl:f}){let o=fe(),E=ln();return c("div",{className:`ri-left-panel-wrapper ${r?"ri-left-panel-wrapper--open":"ri-left-panel-wrapper--closed"}`,children:[!r&&e("button",{type:"button","aria-label":o("openSceneSettingsPanel"),"aria-controls":E,"aria-expanded":!1,className:"ri-side-panel__open-btn ri-side-panel__open-btn--left",onClick:()=>i(!0),children:e(ot,{size:20,strokeWidth:1.8})}),c("div",{className:`ri-side-panel ri-side-panel--left ${r?"ri-side-panel--open-left":"ri-side-panel--closed-left"}`,id:E,"aria-hidden":!r,children:[e("div",{className:"ri-side-panel__header",children:c("div",{className:"ri-side-panel__header-top",children:[e("span",{className:"ri-side-panel__eyebrow",children:o("sceneSettings")}),e("button",{className:"ri-side-panel__close-btn",onClick:()=>i(!1),type:"button","aria-label":o("closeSceneSettingsPanel"),title:o("close"),children:e(Oe,{size:12,strokeWidth:1.6})})]})}),c("div",{className:"ri-env-controls",children:[h&&c(Z,{title:o("environment"),children:[!f&&e(on,{label:o("environmentPreset"),value:t.envPreset,options:rn,optionLabels:Object.fromEntries(rn.map(s=>[s,o(`environment${s[0].toUpperCase()}${s.slice(1)}`)])),onChange:s=>a("envPreset",s)}),e(B,{label:o("environmentIntensity"),value:t.envIntensity,min:0,max:3,step:.05,onChange:s=>a("envIntensity",s)}),e(B,{label:o("rotation"),value:t.envRotation,min:0,max:360,step:1,format:an,onChange:s=>a("envRotation",s)}),e(te,{label:o("showEnvironmentAsBackground"),checked:t.backgroundEnabled,onChange:s=>a("backgroundEnabled",s)}),t.backgroundEnabled?e(B,{label:o("backgroundBlur"),value:t.backgroundBlur,min:0,max:1,step:.01,onChange:s=>a("backgroundBlur",s)}):e(we,{label:o("backgroundColor"),value:t.backgroundColor,onChange:s=>a("backgroundColor",s)})]}),!h&&e(Z,{title:o("background"),children:e(we,{label:o("backgroundColor"),value:t.backgroundColor,onChange:s=>a("backgroundColor",s)})}),c(Z,{title:o("lighting"),children:[e(B,{label:o("exposure"),value:t.exposure,min:0,max:2,step:.05,onChange:s=>a("exposure",s)}),e(on,{label:o("toneMapping"),value:t.toneMapping,options:Object.keys(un),optionLabels:{aces:o("toneMappingAces"),agx:o("toneMappingAgx"),neutral:o("toneMappingNeutral"),none:o("toneMappingNone")},onChange:s=>a("toneMapping",s)}),e(B,{label:o("ambientLightIntensity"),value:t.ambientIntensity,min:0,max:3,step:.05,onChange:s=>a("ambientIntensity",s)}),e(we,{label:o("ambientLightColor"),value:t.ambientColor,onChange:s=>a("ambientColor",s)}),e(B,{label:o("directLightIntensity"),value:t.directionalIntensity,min:0,max:5,step:.05,onChange:s=>a("directionalIntensity",s)}),e(we,{label:o("directLightColor"),value:t.directionalColor,onChange:s=>a("directionalColor",s)})]}),c(Z,{title:o("ground"),children:[e(te,{label:o("groundShadow"),checked:t.groundShadow,onChange:s=>a("groundShadow",s)}),t.groundShadow&&e(B,{label:o("groundShadowOpacity"),value:t.groundShadowOpacity,min:0,max:1,step:.01,onChange:s=>a("groundShadowOpacity",s)}),e(te,{label:o("floorGrid"),checked:t.showFloorGrid,onChange:s=>a("showFloorGrid",s)})]}),c(Z,{title:o("display"),children:[e(te,{label:o("wireframe"),checked:t.wireframe,onChange:s=>a("wireframe",s)}),e(te,{label:o("autoRotate"),checked:t.autoRotate,onChange:s=>a("autoRotate",s)}),t.autoRotate&&e(B,{label:o("autoRotateSpeed"),value:t.autoRotateSpeed,min:.1,max:5,step:.1,onChange:s=>a("autoRotateSpeed",s)}),e(B,{label:o("fieldOfView"),value:t.fov,min:15,max:90,step:1,format:an,onChange:s=>a("fov",s)})]}),l&&c(Z,{title:o("modelInfo"),children:[e(ye,{label:o("modelInfoObjects"),value:l.objects.toLocaleString()}),e(ye,{label:o("modelInfoTriangles"),value:l.triangles.toLocaleString()}),e(ye,{label:o("modelInfoMaterials"),value:l.materials.toLocaleString()}),e(ye,{label:o("size"),value:l.size})]}),e("div",{className:"ri-env-footer",children:c("button",{type:"button",className:"ri-env-reset",onClick:d,children:[e(st,{size:12,"aria-hidden":"true"}),o("resetSettings")]})})]})]})]})}function bt(r){let i=0,t=new Set;r.traverse(a=>{if(Ie(a)){i+=1;for(let d of[a.material].flat())t.add(d.name||d.uuid)}});let l=new _e().setFromObject(r).getSize(new I);return{objects:i,triangles:De(r),materials:t.size,size:[l.x,l.y,l.z].map(a=>Number(a.toPrecision(3))).join(" \xD7 ")}}function gt({meshKeys:r,hiddenKeys:i,selectedKey:t,isOpen:l,onToggle:a,onFocus:d,onHover:h,onToggleVisibility:f}){let o=fe(),E=ln(),[s,z]=g(""),[A,v]=g(null),x=Object.values(r).filter(y=>y.label.toLowerCase().includes(s.toLowerCase()));return c("div",{className:`ri-right-panel-wrapper ${l?"ri-right-panel-wrapper--open":"ri-right-panel-wrapper--closed"}`,children:[!l&&e("button",{type:"button","aria-label":o("openSceneObjectsPanel"),"aria-controls":E,"aria-expanded":!1,className:"ri-side-panel__open-btn",onClick:()=>a(!0),children:e(it,{size:20,strokeWidth:1.8})}),c("div",{className:`ri-side-panel ${l?"ri-side-panel--open":"ri-side-panel--closed"}`,id:E,"aria-hidden":!l,children:[e("div",{className:"ri-side-panel__header",children:c("div",{className:"ri-side-panel__header-top",children:[e("span",{className:"ri-side-panel__eyebrow",children:o("sceneObjects")}),e("span",{className:"ri-side-panel__title","aria-label":o("objectCount",{count:x.length}),children:x.length}),e("button",{className:"ri-side-panel__close-btn",onClick:()=>a(!1),type:"button","aria-label":o("closeSceneObjectsPanel"),title:o("close"),children:e(Oe,{size:12,strokeWidth:1.6})})]})}),e("div",{className:"ri-side-panel__search-wrap",children:e("input",{className:"ri-side-panel__search",type:"text",placeholder:o("searchObjects"),value:s,onChange:y=>z(y.target.value)})}),e("div",{className:"ri-side-panel__list",children:x.map(({key:y,label:$})=>{let T=!i.has(y),V=t===y,F=A===y;return c("div",{onClick:()=>d(y),onMouseEnter:()=>{v(y),h(y)},onMouseLeave:()=>{v(null),h(null)},className:["ri-side-panel__row",F?"ri-side-panel__row--hovered":"",V?"ri-side-panel__row--selected":""].filter(Boolean).join(" "),children:[e("button",{type:"button",className:`ri-side-panel__label ri-side-panel__labelButton${F||V?" ri-side-panel__label--hovered":""}`,"aria-current":V?"true":void 0,onFocus:()=>{v(y),h(y)},onBlur:()=>{v(null),h(null)},children:$}),e("button",{type:"button",className:"ri-side-panel__vis-btn",title:o(T?"hide":"show"),"aria-label":o(T?"hideObject":"showObject",{name:$}),onClick:S=>{S.stopPropagation(),f(y)},children:e("span",{className:`ri-side-panel__checkbox${T?" ri-side-panel__checkbox--checked":""}`,children:T&&e(pn,{size:9,strokeWidth:5,color:"white"})})})]},y)})})]})]})}function mn(r){return e(fr,{labels:r.labels,children:e(ft,{...r})})}function ft({"aria-label":r,"aria-labelledby":i,modelUrl:t,poster:l,loading:a,reveal:d,modelFormat:h,dracoDecoderPath:f,ktx2TranscoderPath:o,meshopt:E=!0,backgroundColor:s="#1a1a1a",showSceneObjectsPanel:z=!0,showSceneSettingsPanel:A=!0,enableModelUpload:v=!1,zoomOnSelected:x=!1,highlightOnHover:y=!1,showLoadingOverlay:$=!0,showLoadError:T=!0,refitOnResize:V=!0,cameraLimits:F,showResetButton:S=!0,fitPadding:P=Qr,zoom:X=!0,pageScroll:oe=!1,backgroundEnabled:ae=!1,autoRotate:ie=!1,envPreset:se=Or,environmentUrl:p,environmentEnabled:u=!0,exposure:_=1,ambientIntensity:Q=.6,ambientColor:G="#ffffff",directionalIntensity:w=1.2,directionalColor:ee="#ffffff",envIntensity:N=1,envRotation:je=0,backgroundBlur:Be=0,toneMapping:Ae="aces",groundShadow:Fe=!1,groundShadowOpacity:Ke=.5,showFloorGrid:He=!1,wireframe:Ge=!1,autoRotateSpeed:Ue=1,fov:We=45,onModelLoaded:$e,onLoadError:le,labels:vn,reducedMotion:bn="user"}){let D=fe(),de=qr(bn),Xe=ie&&!de;Yr("simple-model-viewer","SimpleModelViewer");let j=R(null),ce=R(null),qe=R({}),Je=R(null),Me=R(null),re=R(0),[L,Se]=g(null),[Ye,Ze]=g(null),[gn,Ce]=g(!1),[fn,Qe]=g({}),[er,rr]=g(new Set),[nr,tr]=g(null),[hn,or]=g(null),[ar,ir]=g(null),[xn,sr]=g(null),[lr,pe]=g(!1),[wn,Re]=g(null),[yn,_n]=g(0),[dr,cr]=g(!1),[ue,Ee]=g(!1),[kn,me]=g(null),Mn=Vr(kn),[Sn,ve]=g(!1),[Cn,Rn]=g(()=>typeof window>"u"?!0:window.innerWidth>900),[En,Ln]=g(()=>typeof window>"u"?!0:window.innerWidth>900),be=H(()=>({backgroundEnabled:ae,backgroundColor:s,autoRotate:Xe,envPreset:se,exposure:_,ambientIntensity:Q,ambientColor:G,directionalIntensity:w,directionalColor:ee,envIntensity:N,envRotation:je,backgroundBlur:Be,toneMapping:Ae,groundShadow:Fe,groundShadowOpacity:Ke,showFloorGrid:He,wireframe:Ge,autoRotateSpeed:Ue,fov:We}),[ae,s,Xe,se,_,Q,G,w,ee,N,je,Be,Ae,Fe,Ke,He,Ge,Ue,We]),[m,ge]=g(be),pr=H(()=>({fitPadding:P,spinning:m.autoRotate}),[P,m.autoRotate]),C=v?ar:t,ur=R(null),Le=R(null),Ne=R(null),[q,mr]=g(null);M(()=>()=>{q&&URL.revokeObjectURL(q)},[q]);let vr=R(C);vr.current=C;let ze=R(null),K=zr({loading:a,reveal:d,rootRef:ur,onPark:()=>{ze.current=Le.current?.gl??null;let n=j.current;if(n&&ue){Ne.current={position:n.getPosition(new I).toArray(),target:n.getTarget(new I).toArray()};let b=C;Nr(Le.current).then(O=>{O&&(b===vr.current?mr(O):URL.revokeObjectURL(O))})}Se(null),Ee(!1)}});M(()=>{if(K.live)return;let n=ze.current;ze.current=null,n&&Lr(n)},[K.live]);let U=k(()=>{Ne.current=null,ce.current=null,mr(null),Se(null),Ze(null),Ce(!1),Qe({}),rr(new Set),tr(null),or(null),pe(!1),Re(null),Ee(!1),me(null)},[]),J=k(()=>{Me.current?.cleanup(),Me.current=null},[]),Nn=k(()=>{J(),ir(null),sr(null),U(),ge(be)},[be,U,J]),br=k(async n=>{cr(!0);try{let b=await yr(n);J(),Me.current=b,ir(b.url),sr(b.name),U()}catch(b){pe(!0),Re(b),le?.(b)}finally{cr(!1)}},[le,U,J]),Pe=k(n=>{let b=n?.[0];b&&br(b)},[br]);M(()=>()=>{J()},[J]);let zn=k(()=>L,[L]),Pn=!(u&&m.backgroundEnabled)&&new Qn(m.backgroundColor).getHSL({h:0,s:0,l:0}).l>.5?"#000000":"#ffffff",Dn=H(()=>L?bt(L):null,[L]),Y=H(()=>{if(!L)return null;let n=new _e().setFromObject(L);if(n.isEmpty())return null;let b=n.getSize(new I);return{y:n.min.y,center:n.getCenter(new I),size:Math.max(b.x,b.y,b.z)}},[L]),Tn=k((n,b)=>{ge(O=>({...O,[n]:b}))},[]);M(()=>{ge(n=>({...n,backgroundColor:s}))},[s]),M(()=>{U()},[C,U]);let Vn=k(n=>{Qe(n)},[]),On=k(n=>{Se(n),pe(!1);let b=De(n);Ze(b>_r?b:null),Ce(!1),me(null),$e?.(Xr(n))},[$e]),In=k(n=>{pe(!0),Re(n),me(null),le?.(n)},[le]),jn=k(n=>{n.lengthComputable&&n.total>0&&me(n.loaded/n.total*100)},[]),gr=k(n=>{if(tr(n),!x)return;let b=qe.current[n];!b||!j.current||j.current.fitToBox(b,!0,{paddingTop:.5,paddingBottom:.5,paddingLeft:.5,paddingRight:.5}).catch(()=>{})},[x]),Bn=k(n=>{rr(b=>{let O=new Set(b);return O.has(n)?O.delete(n):O.add(n),O})},[]),An=k(n=>{!v||!xe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),re.current+=1,ve(!0))},[v]),Fn=k(n=>{!v||!xe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),n.dataTransfer.dropEffect="copy",ve(!0))},[v]),Kn=k(n=>{!v||!xe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),re.current=Math.max(0,re.current-1),re.current===0&&ve(!1))},[v]),Hn=k(n=>{!v||!xe(n.dataTransfer)||(n.preventDefault(),n.stopPropagation(),re.current=0,ve(!1),Pe(n.dataTransfer.files))},[v,Pe]),Gn=$&&(dr||!!(C&&K.live&&!lr&&(!L||!ue)));return c("div",{className:"smv-root",role:"region","aria-label":r??D("modelViewer"),"aria-labelledby":i,ref:ur,"data-reduced-motion":de?"":void 0,style:{background:m.backgroundColor},onDragEnter:An,onDragOver:Fn,onDragLeave:Kn,onDrop:Hn,children:[A&&C&&e(vt,{isOpen:En,onToggle:Ln,environmentUrl:p,environmentEnabled:u,settings:m,modelInfo:Dn,onReset:()=>ge(be),onChange:Tn}),c("div",{className:"smv-canvasArea",children:[T&&lr&&C&&c("div",{className:"smv-load-error",role:"alert",children:[e("strong",{children:D("loadErrorTitle")}),e("p",{children:Tr(wn,C,h,vn).detail}),e("button",{type:"button",onClick:()=>{xr(C),U(),_n(n=>n+1)},children:D("retryModelLoad")})]}),S&&L&&ue&&e("button",{type:"button",className:"smv-reset-camera",onClick:()=>{let n=j.current,b=ce.current;!n||!b||n.setLookAt(...b.position,...b.target,!1).then(()=>he(n,L,pr,!de)).catch(()=>{})},children:D("resetCameraView")}),Ye!==null&&!gn&&c("div",{className:"smv-largeModelBanner",children:[e(dt,{size:14,className:"smv-largeModelBanner__icon"}),e("span",{children:D("simpleLargeModelWarning",{millions:Math.round(Ye/1e6)})}),e("button",{type:"button",className:"smv-largeModelBanner__dismiss",onClick:()=>Ce(!0),"aria-label":D("dismiss"),children:e(Oe,{size:12})})]}),v?c(sn,{children:[e("input",{ref:Je,type:"file",accept:wr,className:"smv-upload-input",onChange:n=>{Pe(n.target.files),n.currentTarget.value=""}}),C?e("div",{className:"smv-upload-toolbar",children:c(sn,{children:[e("span",{className:"smv-upload-toolbar__name",children:xn??D("uploadedModel")}),c("button",{type:"button",className:"smv-upload-toolbar__button smv-upload-toolbar__button--ghost",onClick:Nn,children:[e(lt,{size:14}),D("clear")]})]})}):null]}):null,C&&!K.live?e(Dr,{className:"ri-viewerPlaceholder--inset",background:m.backgroundColor,poster:q??l,onReveal:K.awaitingReveal?K.reveal:void 0}):C?c(Jn,{dpr:[1,2],frameloop:K.visible?"demand":"never",resize:{debounce:0,scroll:!1},raycaster:{firstHitOnly:!0},style:{background:m.backgroundColor},camera:{position:[0,0,5],fov:45,near:.1,far:1e3},children:[e(Rr,{captureRef:Le}),e(Er,{}),c(Te,{fallback:null,children:[e("ambientLight",{intensity:m.ambientIntensity,color:m.ambientColor}),e("directionalLight",{position:[-4,5,7],intensity:m.directionalIntensity,color:m.directionalColor,castShadow:!0}),e("directionalLight",{position:[-5,5,5],intensity:.5}),u&&e(ke,{children:c(Te,{fallback:null,children:[e(Ir,{...p?{files:p}:{preset:m.envPreset},background:m.backgroundEnabled,environmentIntensity:m.envIntensity,backgroundIntensity:m.envIntensity,backgroundBlurriness:m.backgroundBlur}),e(Br,{})]})},p??m.envPreset),e(Ar,{rotation:m.envRotation}),e(ut,{scene:L,exposure:m.exposure,toneMapping:m.toneMapping,fov:m.fov,wireframe:m.wireframe}),e(mt,{enabled:m.autoRotate,speed:m.autoRotateSpeed,controlsRef:j}),m.groundShadow&&Y&&e(jr,{position:[Y.center.x,Y.y,Y.center.z],scale:Y.size*2,opacity:m.groundShadowOpacity,blur:2,far:Y.size,resolution:1024,color:"#000000"}),m.showFloorGrid&&e(Cr,{getTarget:zn,revision:L,lineColor:Pn}),e(ke,{onLoadError:In,children:e(Te,{fallback:null,children:e(ct,{url:C,format:ar?void 0:h,dracoDecoderPath:f,ktx2TranscoderPath:o,meshopt:E,hiddenKeys:er,selectedKey:nr,panelHoveredKey:hn,nodeRefsOut:qe,onMeshesReady:Vn,onModelLoaded:On,onLoadProgress:jn,onMeshClick:gr,highlightOnHover:y})})},`${C}:${yn}`),e(pt,{scene:L,controlsRef:j,refitOnResize:V,onInitialFitComplete:()=>{let n=j.current;n&&!ce.current&&(ce.current={position:n.getPosition(new I).toArray(),target:n.getTarget(new I).toArray()}),Ee(!0)},cameraLimits:F,resumeViewRef:Ne,framing:pr}),e(qn,{ref:j,makeDefault:!0,smoothTime:de?0:.3}),e(Kr,{controlsRef:j,zoom:X,pageScroll:oe})]})]}):e("div",{className:"smv-upload-empty-state",style:{background:m.backgroundColor},children:c("div",{className:"smv-upload-empty-state__card",children:[e("div",{className:"smv-upload-empty-state__icon",children:e(Ve,{size:24})}),e("p",{className:"smv-upload-empty-state__body",children:D("dropModelHint",{formats:".glb, .gltf, .obj, .fbx, .usdz, .stl, .ply, .zip"})}),c("button",{type:"button",className:"smv-upload-empty-state__button",onClick:()=>Je.current?.click(),children:[e(Ve,{size:15}),D("chooseModel")]})]})}),C&&K.live?e(Pr,{src:q??l,hidden:!!(L&&ue)}):null,e(Jr,{visible:Gn,message:D("loadingModel"),progress:dr?void 0:Mn??void 0,background:m.backgroundColor,seeThrough:!!(q??l)}),v&&Sn?e("div",{className:"smv-upload-drop-overlay",children:c("div",{className:"smv-upload-drop-overlay__card",children:[e(Ve,{size:20}),e("span",{children:D("releaseToLoadYourModel")})]})}):null]}),z&&C&&e(gt,{meshKeys:fn,hiddenKeys:er,selectedKey:nr,isOpen:Cn,onToggle:Rn,onFocus:gr,onHover:or,onToggleVisibility:Bn})]})}export{Un as DEFAULT_MODEL_VIEWER_LABELS,mn as SimpleModelViewer};
package/dist/utils.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { aJ as SceneLight, P as ObjectBinding, a2 as ObjectBindingType, z as MeasurementUnit, w as MeasurementSettings, at as SavedMeasurement, t as MeasurementPoint, v as MeasurementResult, y as MeasurementTool, s as MeasurementCollection, Z as ObjectBindingStyle, _ as ObjectBindingTarget, aQ as SceneProductConfig, p as MaterialVariantGroup, af as ProductDefinition, ap as ProductSelections, ad as ProductConfiguration, aq as ProductSku, ag as ProductDefinitionWarning, a7 as ProductAvailability, am as ProductOptionState, an as ProductPrice, b4 as SequenceEasing, aX as SceneSequence, b9 as SequenceTrack, ba as SequenceValue, b5 as SequenceKeyframe, aS as SceneSectionConfig, aV as SceneSectionSettings } from './modelFileResolver-Bq4pW9vc.mjs';
2
- export { f as AnimationLoopMode, B as BindingEdit, D as DEFAULT_MODEL_VIEWER_LABELS, k as DEFAULT_SCENE_CONFIG, l as DEFAULT_SECTION_CONFIG, m as DeepPartial, E as EnvironmentPreset, G as GlitchModeName, I as IsolatedObjectBindings, K as KernelSizeName, M as MATERIAL_BLENDING_MODES, o as MATERIAL_SIDES, q as MaterialVariantOption, r as MeasurementAnchor, u as MeasurementPosition, x as MeasurementStatus, J as ModelViewerLabelKey, L as ModelViewerLabels, N as ObjectActionEvent, Q as ObjectBindingAction, R as ObjectBindingCameraState, S as ObjectBindingDecal, T as ObjectBindingMaterial, U as ObjectBindingMaterialBlendingMode, V as ObjectBindingMaterialSide, W as ObjectBindingPatch, X as ObjectBindingSelector, Y as ObjectBindingStatus, $ as ObjectBindingTextureChannel, a0 as ObjectBindingTextureSlot, a1 as ObjectBindingTransform, a4 as ObjectPointerEvent, a5 as ObjectSurfacePoint, a6 as ProductAppearance, a8 as ProductCheckoutContext, a9 as ProductCheckoutLink, aa as ProductCommerceAdapter, ab as ProductCommerceContext, ac as ProductCommerceResult, ae as ProductConfigurationIssue, ah as ProductGroupDisplay, ai as ProductOption, aj as ProductOptionGroup, ak as ProductOptionRef, al as ProductOptionRule, ao as ProductPricing, ar as RampTypeName, as as ReducedMotionSetting, au as SceneAnimationClipConfig, av as SceneAnimationConfig, aw as SceneAnnotationCameraView, ax as SceneAnnotationImage, ay as SceneAnnotationLink, az as SceneAnnotationMarker, aA as SceneBackgroundConfig, aB as SceneCameraConfig, aC as SceneCinematicConfig, aD as SceneCinematicWaypoint, aE as SceneConfig, aG as SceneConfigPatch, aH as SceneEnvironmentConfig, aI as SceneGroundShadowConfig, aK as SceneLightAttachment, aL as SceneLightType, aM as SceneLightingConfig, aN as SceneModelConfig, aO as SceneModelRenderer, aP as ScenePostProcessingConfig, aR as SceneSectionAxis, aW as SceneSelectionSet, aY as SceneShadowConfig, aZ as SceneStyleColorScale, a_ as SceneStyleCondition, a$ as SceneStylePulse, b0 as SceneStyleRule, b1 as SceneWireframeConfig, b2 as SequenceCameraView, b3 as SequenceControls, b6 as SequenceObjectProperty, b7 as SequencePlaybackState, b8 as SequenceTarget, bb as SequenceVector3, bc as StyledObjectBindings, bd as StyledObjectPulse, bh as ViewerIsolation, bn as applyIsolation, bo as applyStyleRules, bp as chooseMaterialVariant, bq as colorScaleValue, br as isolatedBindingKeys, bs as material, bt as parseSelectionSets, bu as patchBindings, bv as patchSceneConfig, bw as selectBindingKeys, bx as selectBindings } from './modelFileResolver-Bq4pW9vc.mjs';
3
- import { I as InspectAssetOptions, h as AssetDiagnosticsReport, e as ARSnapshotSource, A as ARExportOptions, d as ARSnapshot, Z as ShareableViewerState, a9 as ViewerStateStorage } from './modelViewerProps-wjBT4fks.mjs';
4
- export { a as ARHandoffOptions, b as ARHandoffRequest, c as ARHandoffStatus, g as AssetDiagnosticIssue, i as AssetDiagnosticsSource, j as AssetTextureDiagnostic, k as AssetTransform, p as ComparisonCategory, q as ComparisonChange, r as ComparisonHighlight, s as ComparisonObject, t as ComparisonStatus, u as ConfigurationComparisonInput, v as ConfigurationComparisonReport, M as MAX_VIEWER_STATE_BYTES, W as RendererBackend, Y as SemanticComparisonOptions, _ as StreamingDiagnostics, a3 as ViewerConfiguration, a5 as ViewerObjectInfo, a8 as ViewerRuntimeStats, ab as compareViewerConfigurations, ac as groundAsset, ad as parseAssetTransform, ae as parseViewerState, af as prepareViewerState, ag as serializeViewerState, ah as snapAssetToGrid } from './modelViewerProps-wjBT4fks.mjs';
1
+ import { aJ as SceneLight, P as ObjectBinding, a2 as ObjectBindingType, z as MeasurementUnit, w as MeasurementSettings, at as SavedMeasurement, t as MeasurementPoint, v as MeasurementResult, y as MeasurementTool, s as MeasurementCollection, Z as ObjectBindingStyle, _ as ObjectBindingTarget, aQ as SceneProductConfig, p as MaterialVariantGroup, af as ProductDefinition, ap as ProductSelections, ad as ProductConfiguration, aq as ProductSku, ag as ProductDefinitionWarning, a7 as ProductAvailability, am as ProductOptionState, an as ProductPrice, b4 as SequenceEasing, aX as SceneSequence, b9 as SequenceTrack, ba as SequenceValue, b5 as SequenceKeyframe, aS as SceneSectionConfig, aV as SceneSectionSettings } from './modelFileResolver-An1aQ0D3.mjs';
2
+ export { f as AnimationLoopMode, B as BindingEdit, D as DEFAULT_MODEL_VIEWER_LABELS, k as DEFAULT_SCENE_CONFIG, l as DEFAULT_SECTION_CONFIG, m as DeepPartial, E as EnvironmentPreset, G as GlitchModeName, I as IsolatedObjectBindings, K as KernelSizeName, M as MATERIAL_BLENDING_MODES, o as MATERIAL_SIDES, q as MaterialVariantOption, r as MeasurementAnchor, u as MeasurementPosition, x as MeasurementStatus, J as ModelViewerLabelKey, L as ModelViewerLabels, N as ObjectActionEvent, Q as ObjectBindingAction, R as ObjectBindingCameraState, S as ObjectBindingDecal, T as ObjectBindingMaterial, U as ObjectBindingMaterialBlendingMode, V as ObjectBindingMaterialSide, W as ObjectBindingPatch, X as ObjectBindingSelector, Y as ObjectBindingStatus, $ as ObjectBindingTextureChannel, a0 as ObjectBindingTextureSlot, a1 as ObjectBindingTransform, a4 as ObjectPointerEvent, a5 as ObjectSurfacePoint, a6 as ProductAppearance, a8 as ProductCheckoutContext, a9 as ProductCheckoutLink, aa as ProductCommerceAdapter, ab as ProductCommerceContext, ac as ProductCommerceResult, ae as ProductConfigurationIssue, ah as ProductGroupDisplay, ai as ProductOption, aj as ProductOptionGroup, ak as ProductOptionRef, al as ProductOptionRule, ao as ProductPricing, ar as RampTypeName, as as ReducedMotionSetting, au as SceneAnimationClipConfig, av as SceneAnimationConfig, aw as SceneAnnotationCameraView, ax as SceneAnnotationImage, ay as SceneAnnotationLink, az as SceneAnnotationMarker, aA as SceneBackgroundConfig, aB as SceneCameraConfig, aC as SceneCinematicConfig, aD as SceneCinematicWaypoint, aE as SceneConfig, aG as SceneConfigPatch, aH as SceneEnvironmentConfig, aI as SceneGroundShadowConfig, aK as SceneLightAttachment, aL as SceneLightType, aM as SceneLightingConfig, aN as SceneModelConfig, aO as SceneModelRenderer, aP as ScenePostProcessingConfig, aR as SceneSectionAxis, aW as SceneSelectionSet, aY as SceneShadowConfig, aZ as SceneStyleColorScale, a_ as SceneStyleCondition, a$ as SceneStylePulse, b0 as SceneStyleRule, b1 as SceneWireframeConfig, b2 as SequenceCameraView, b3 as SequenceControls, b6 as SequenceObjectProperty, b7 as SequencePlaybackState, b8 as SequenceTarget, bb as SequenceVector3, bc as StyledObjectBindings, bd as StyledObjectPulse, bh as ViewerIsolation, bn as applyIsolation, bo as applyStyleRules, bp as chooseMaterialVariant, bq as colorScaleValue, br as isolatedBindingKeys, bs as material, bt as parseSelectionSets, bu as patchBindings, bv as patchSceneConfig, bw as selectBindingKeys, bx as selectBindings } from './modelFileResolver-An1aQ0D3.mjs';
3
+ import { I as InspectAssetOptions, h as AssetDiagnosticsReport, e as ARSnapshotSource, A as ARExportOptions, d as ARSnapshot, _ as ShareableViewerState, aa as ViewerStateStorage } from './modelViewerProps-BnVflYRA.mjs';
4
+ export { a as ARHandoffOptions, b as ARHandoffRequest, c as ARHandoffStatus, g as AssetDiagnosticIssue, i as AssetDiagnosticsSource, j as AssetTextureDiagnostic, k as AssetTransform, p as ComparisonCategory, q as ComparisonChange, r as ComparisonHighlight, s as ComparisonObject, t as ComparisonStatus, u as ConfigurationComparisonInput, v as ConfigurationComparisonReport, M as MAX_VIEWER_STATE_BYTES, X as RendererBackend, Z as SemanticComparisonOptions, $ as StreamingDiagnostics, a4 as ViewerConfiguration, a6 as ViewerObjectInfo, a9 as ViewerRuntimeStats, ac as compareViewerConfigurations, ad as groundAsset, ae as parseAssetTransform, af as parseViewerState, ag as prepareViewerState, ah as serializeViewerState, ai as snapAssetToGrid } from './modelViewerProps-BnVflYRA.mjs';
5
5
  import { Object3D } from 'three';
6
6
  import 'react';
7
7
  import '@react-three/drei';
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { aJ as SceneLight, P as ObjectBinding, a2 as ObjectBindingType, z as MeasurementUnit, w as MeasurementSettings, at as SavedMeasurement, t as MeasurementPoint, v as MeasurementResult, y as MeasurementTool, s as MeasurementCollection, Z as ObjectBindingStyle, _ as ObjectBindingTarget, aQ as SceneProductConfig, p as MaterialVariantGroup, af as ProductDefinition, ap as ProductSelections, ad as ProductConfiguration, aq as ProductSku, ag as ProductDefinitionWarning, a7 as ProductAvailability, am as ProductOptionState, an as ProductPrice, b4 as SequenceEasing, aX as SceneSequence, b9 as SequenceTrack, ba as SequenceValue, b5 as SequenceKeyframe, aS as SceneSectionConfig, aV as SceneSectionSettings } from './modelFileResolver-Bq4pW9vc.js';
2
- export { f as AnimationLoopMode, B as BindingEdit, D as DEFAULT_MODEL_VIEWER_LABELS, k as DEFAULT_SCENE_CONFIG, l as DEFAULT_SECTION_CONFIG, m as DeepPartial, E as EnvironmentPreset, G as GlitchModeName, I as IsolatedObjectBindings, K as KernelSizeName, M as MATERIAL_BLENDING_MODES, o as MATERIAL_SIDES, q as MaterialVariantOption, r as MeasurementAnchor, u as MeasurementPosition, x as MeasurementStatus, J as ModelViewerLabelKey, L as ModelViewerLabels, N as ObjectActionEvent, Q as ObjectBindingAction, R as ObjectBindingCameraState, S as ObjectBindingDecal, T as ObjectBindingMaterial, U as ObjectBindingMaterialBlendingMode, V as ObjectBindingMaterialSide, W as ObjectBindingPatch, X as ObjectBindingSelector, Y as ObjectBindingStatus, $ as ObjectBindingTextureChannel, a0 as ObjectBindingTextureSlot, a1 as ObjectBindingTransform, a4 as ObjectPointerEvent, a5 as ObjectSurfacePoint, a6 as ProductAppearance, a8 as ProductCheckoutContext, a9 as ProductCheckoutLink, aa as ProductCommerceAdapter, ab as ProductCommerceContext, ac as ProductCommerceResult, ae as ProductConfigurationIssue, ah as ProductGroupDisplay, ai as ProductOption, aj as ProductOptionGroup, ak as ProductOptionRef, al as ProductOptionRule, ao as ProductPricing, ar as RampTypeName, as as ReducedMotionSetting, au as SceneAnimationClipConfig, av as SceneAnimationConfig, aw as SceneAnnotationCameraView, ax as SceneAnnotationImage, ay as SceneAnnotationLink, az as SceneAnnotationMarker, aA as SceneBackgroundConfig, aB as SceneCameraConfig, aC as SceneCinematicConfig, aD as SceneCinematicWaypoint, aE as SceneConfig, aG as SceneConfigPatch, aH as SceneEnvironmentConfig, aI as SceneGroundShadowConfig, aK as SceneLightAttachment, aL as SceneLightType, aM as SceneLightingConfig, aN as SceneModelConfig, aO as SceneModelRenderer, aP as ScenePostProcessingConfig, aR as SceneSectionAxis, aW as SceneSelectionSet, aY as SceneShadowConfig, aZ as SceneStyleColorScale, a_ as SceneStyleCondition, a$ as SceneStylePulse, b0 as SceneStyleRule, b1 as SceneWireframeConfig, b2 as SequenceCameraView, b3 as SequenceControls, b6 as SequenceObjectProperty, b7 as SequencePlaybackState, b8 as SequenceTarget, bb as SequenceVector3, bc as StyledObjectBindings, bd as StyledObjectPulse, bh as ViewerIsolation, bn as applyIsolation, bo as applyStyleRules, bp as chooseMaterialVariant, bq as colorScaleValue, br as isolatedBindingKeys, bs as material, bt as parseSelectionSets, bu as patchBindings, bv as patchSceneConfig, bw as selectBindingKeys, bx as selectBindings } from './modelFileResolver-Bq4pW9vc.js';
3
- import { I as InspectAssetOptions, h as AssetDiagnosticsReport, e as ARSnapshotSource, A as ARExportOptions, d as ARSnapshot, Z as ShareableViewerState, a9 as ViewerStateStorage } from './modelViewerProps-BnrJO5DK.js';
4
- export { a as ARHandoffOptions, b as ARHandoffRequest, c as ARHandoffStatus, g as AssetDiagnosticIssue, i as AssetDiagnosticsSource, j as AssetTextureDiagnostic, k as AssetTransform, p as ComparisonCategory, q as ComparisonChange, r as ComparisonHighlight, s as ComparisonObject, t as ComparisonStatus, u as ConfigurationComparisonInput, v as ConfigurationComparisonReport, M as MAX_VIEWER_STATE_BYTES, W as RendererBackend, Y as SemanticComparisonOptions, _ as StreamingDiagnostics, a3 as ViewerConfiguration, a5 as ViewerObjectInfo, a8 as ViewerRuntimeStats, ab as compareViewerConfigurations, ac as groundAsset, ad as parseAssetTransform, ae as parseViewerState, af as prepareViewerState, ag as serializeViewerState, ah as snapAssetToGrid } from './modelViewerProps-BnrJO5DK.js';
1
+ import { aJ as SceneLight, P as ObjectBinding, a2 as ObjectBindingType, z as MeasurementUnit, w as MeasurementSettings, at as SavedMeasurement, t as MeasurementPoint, v as MeasurementResult, y as MeasurementTool, s as MeasurementCollection, Z as ObjectBindingStyle, _ as ObjectBindingTarget, aQ as SceneProductConfig, p as MaterialVariantGroup, af as ProductDefinition, ap as ProductSelections, ad as ProductConfiguration, aq as ProductSku, ag as ProductDefinitionWarning, a7 as ProductAvailability, am as ProductOptionState, an as ProductPrice, b4 as SequenceEasing, aX as SceneSequence, b9 as SequenceTrack, ba as SequenceValue, b5 as SequenceKeyframe, aS as SceneSectionConfig, aV as SceneSectionSettings } from './modelFileResolver-An1aQ0D3.js';
2
+ export { f as AnimationLoopMode, B as BindingEdit, D as DEFAULT_MODEL_VIEWER_LABELS, k as DEFAULT_SCENE_CONFIG, l as DEFAULT_SECTION_CONFIG, m as DeepPartial, E as EnvironmentPreset, G as GlitchModeName, I as IsolatedObjectBindings, K as KernelSizeName, M as MATERIAL_BLENDING_MODES, o as MATERIAL_SIDES, q as MaterialVariantOption, r as MeasurementAnchor, u as MeasurementPosition, x as MeasurementStatus, J as ModelViewerLabelKey, L as ModelViewerLabels, N as ObjectActionEvent, Q as ObjectBindingAction, R as ObjectBindingCameraState, S as ObjectBindingDecal, T as ObjectBindingMaterial, U as ObjectBindingMaterialBlendingMode, V as ObjectBindingMaterialSide, W as ObjectBindingPatch, X as ObjectBindingSelector, Y as ObjectBindingStatus, $ as ObjectBindingTextureChannel, a0 as ObjectBindingTextureSlot, a1 as ObjectBindingTransform, a4 as ObjectPointerEvent, a5 as ObjectSurfacePoint, a6 as ProductAppearance, a8 as ProductCheckoutContext, a9 as ProductCheckoutLink, aa as ProductCommerceAdapter, ab as ProductCommerceContext, ac as ProductCommerceResult, ae as ProductConfigurationIssue, ah as ProductGroupDisplay, ai as ProductOption, aj as ProductOptionGroup, ak as ProductOptionRef, al as ProductOptionRule, ao as ProductPricing, ar as RampTypeName, as as ReducedMotionSetting, au as SceneAnimationClipConfig, av as SceneAnimationConfig, aw as SceneAnnotationCameraView, ax as SceneAnnotationImage, ay as SceneAnnotationLink, az as SceneAnnotationMarker, aA as SceneBackgroundConfig, aB as SceneCameraConfig, aC as SceneCinematicConfig, aD as SceneCinematicWaypoint, aE as SceneConfig, aG as SceneConfigPatch, aH as SceneEnvironmentConfig, aI as SceneGroundShadowConfig, aK as SceneLightAttachment, aL as SceneLightType, aM as SceneLightingConfig, aN as SceneModelConfig, aO as SceneModelRenderer, aP as ScenePostProcessingConfig, aR as SceneSectionAxis, aW as SceneSelectionSet, aY as SceneShadowConfig, aZ as SceneStyleColorScale, a_ as SceneStyleCondition, a$ as SceneStylePulse, b0 as SceneStyleRule, b1 as SceneWireframeConfig, b2 as SequenceCameraView, b3 as SequenceControls, b6 as SequenceObjectProperty, b7 as SequencePlaybackState, b8 as SequenceTarget, bb as SequenceVector3, bc as StyledObjectBindings, bd as StyledObjectPulse, bh as ViewerIsolation, bn as applyIsolation, bo as applyStyleRules, bp as chooseMaterialVariant, bq as colorScaleValue, br as isolatedBindingKeys, bs as material, bt as parseSelectionSets, bu as patchBindings, bv as patchSceneConfig, bw as selectBindingKeys, bx as selectBindings } from './modelFileResolver-An1aQ0D3.js';
3
+ import { I as InspectAssetOptions, h as AssetDiagnosticsReport, e as ARSnapshotSource, A as ARExportOptions, d as ARSnapshot, _ as ShareableViewerState, aa as ViewerStateStorage } from './modelViewerProps-H_K454u_.js';
4
+ export { a as ARHandoffOptions, b as ARHandoffRequest, c as ARHandoffStatus, g as AssetDiagnosticIssue, i as AssetDiagnosticsSource, j as AssetTextureDiagnostic, k as AssetTransform, p as ComparisonCategory, q as ComparisonChange, r as ComparisonHighlight, s as ComparisonObject, t as ComparisonStatus, u as ConfigurationComparisonInput, v as ConfigurationComparisonReport, M as MAX_VIEWER_STATE_BYTES, X as RendererBackend, Z as SemanticComparisonOptions, $ as StreamingDiagnostics, a4 as ViewerConfiguration, a6 as ViewerObjectInfo, a9 as ViewerRuntimeStats, ac as compareViewerConfigurations, ad as groundAsset, ae as parseAssetTransform, af as parseViewerState, ag as prepareViewerState, ah as serializeViewerState, ai as snapAssetToGrid } from './modelViewerProps-H_K454u_.js';
5
5
  import { Object3D } from 'three';
6
6
  import 'react';
7
7
  import '@react-three/drei';