{"version":3,"file":"ThreeDViewer.C_JaATFi.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/bNZyNpaS4TY3t7gtrWi8/cKzmql75BPQuKBUvyVVd/ThreeDViewer.js"],"sourcesContent":["// 3D Viewer component with model loading, rotation controls, and camera manipulation\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * 3D Viewer with Three.js\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ThreeDViewer(props){const{modelFile=\"\",autoRotate=true,rotationSpeed=1,enableZoom=true,enablePan=true,lightingPreset=\"studio\",ambientLightIntensity=2,directionalLightIntensity=3.5,fillLightIntensity=2,cameraDistance=3,modelScale=1,materialColor=\"#3399ff\",materialRoughness=.5,materialMetalness=.5,autoCorrectFlatAngles=true,flatAngleThreshold=10,enableDragSound=false,dragSoundFile=\"https://framerusercontent.com/assets/8w3IUatLX9a5JVJ6XPCVuHi94.mp3\",dragSoundVolume=50}=props;const containerRef=useRef(null);const[error,setError]=useState(null);const[isDragging,setIsDragging]=useState(false);const threeInstanceRef=useRef(null);const modelRef=useRef(null);const audioRef=useRef(null);const audioInitializedRef=useRef(false);const audioContextRef=useRef(null);const audioBufferRef=useRef(null);const audioSourceRef=useRef(null);const raycasterRef=useRef(null);const mouseRef=useRef(null);const isOverModelRef=useRef(false);const[cursorStyle,setCursorStyle]=useState(\"default\");const boundingBoxMeshRef=useRef(null);const gainNodeRef=useRef(null);const dragMovedRef=useRef(false);const startAzimuthRef=useRef(null);const startPolarRef=useRef(null);const autoCorrectingRef=useRef(false);// Initialize audio with AudioContext for better mobile support\nuseEffect(()=>{if(!enableDragSound||!dragSoundFile||typeof window===\"undefined\")return;const initAudio=async()=>{try{// Create AudioContext\nif(!audioContextRef.current){const AudioContextClass=window.AudioContext||window.webkitAudioContext;audioContextRef.current=new AudioContextClass;// Create a persistent gain node\ngainNodeRef.current=audioContextRef.current.createGain();gainNodeRef.current.gain.value=dragSoundVolume/100;gainNodeRef.current.connect(audioContextRef.current.destination);}// Fetch and decode audio once\nconst response=await fetch(dragSoundFile);const arrayBuffer=await response.arrayBuffer();const audioBuffer=await audioContextRef.current.decodeAudioData(arrayBuffer);audioBufferRef.current=audioBuffer;audioInitializedRef.current=true;}catch(err){console.error(\"Error initializing audio:\",err);audioInitializedRef.current=false;}};initAudio();// Add user interaction listener to resume audio context on mobile\nconst resumeAudio=async()=>{if(audioContextRef.current&&audioContextRef.current.state===\"suspended\"){await audioContextRef.current.resume();}};document.addEventListener(\"touchstart\",resumeAudio,{once:true});document.addEventListener(\"click\",resumeAudio,{once:true});return()=>{document.removeEventListener(\"touchstart\",resumeAudio);document.removeEventListener(\"click\",resumeAudio);if(audioSourceRef.current){try{audioSourceRef.current.stop();}catch(e){}audioSourceRef.current=null;}if(gainNodeRef.current){gainNodeRef.current.disconnect();gainNodeRef.current=null;}if(audioContextRef.current&&audioContextRef.current.state!==\"closed\"){audioContextRef.current.close();audioContextRef.current=null;}audioBufferRef.current=null;audioInitializedRef.current=false;};},[enableDragSound,dragSoundFile]);// Stop audio when dragging ends\nuseEffect(()=>{if(!isDragging&&audioSourceRef.current){try{audioSourceRef.current.stop();audioSourceRef.current.disconnect();audioSourceRef.current=null;}catch(err){console.log(\"Error stopping audio:\",err);}}},[isDragging]);// Update gain node volume when volume changes\nuseEffect(()=>{if(gainNodeRef.current){gainNodeRef.current.gain.value=dragSoundVolume/100;}},[dragSoundVolume]);useEffect(()=>{if(!containerRef.current)return;let THREE;let scene;let camera;let renderer;let controls;let animationId;const init=async()=>{try{// Import Three.js from ESM CDN\n// @ts-ignore\nTHREE=await import(\"https://esm.sh/three@0.160.0\");// @ts-ignore\nconst{OrbitControls}=await import(\"https://esm.sh/three@0.160.0/examples/jsm/controls/OrbitControls.js\");// @ts-ignore\nconst{GLTFLoader}=await import(\"https://esm.sh/three@0.160.0/examples/jsm/loaders/GLTFLoader.js\");if(!containerRef.current)return;// Setup scene\nscene=new THREE.Scene;// Setup camera\ncamera=new THREE.PerspectiveCamera(45,containerRef.current.clientWidth/containerRef.current.clientHeight,.1,1e3);camera.position.z=cameraDistance;// Setup renderer\nrenderer=new THREE.WebGLRenderer({alpha:true,antialias:true});renderer.setSize(containerRef.current.clientWidth,containerRef.current.clientHeight);renderer.setPixelRatio(Math.min(window.devicePixelRatio,2));renderer.setClearColor(0,0);renderer.outputEncoding=THREE.sRGBEncoding;renderer.toneMapping=THREE.ACESFilmicToneMapping;renderer.toneMappingExposure=1.5;// Allow native scroll on mobile by setting touch-action\nrenderer.domElement.style.touchAction=\"auto\";containerRef.current.appendChild(renderer.domElement);// Detect if device is mobile\nconst isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||\"ontouchstart\"in window||navigator.maxTouchPoints>0;// Setup controls\ncontrols=new OrbitControls(camera,renderer.domElement);controls.enableDamping=true;controls.dampingFactor=.05;controls.enableZoom=enableZoom;controls.enablePan=isMobile?false:enablePan// Disable pan on mobile to allow scroll\n;controls.autoRotate=autoRotate;controls.autoRotateSpeed=rotationSpeed;// Always allow full vertical rotation; auto-correction is handled manually on drag end\ncontrols.minPolarAngle=0;controls.maxPolarAngle=Math.PI;// On mobile, allow vertical scrolling but enable rotation\nif(isMobile){renderer.domElement.style.touchAction=\"pan-y\";}// Initialize raycaster and mouse vector\nraycasterRef.current=new THREE.Raycaster;mouseRef.current=new THREE.Vector2;// Track mouse movement to detect if over model\nconst handleMouseMove=event=>{if(!containerRef.current||!boundingBoxMeshRef.current||!raycasterRef.current||!mouseRef.current||isMobile)return;const rect=containerRef.current.getBoundingClientRect();mouseRef.current.x=(event.clientX-rect.left)/rect.width*2-1;mouseRef.current.y=-((event.clientY-rect.top)/rect.height)*2+1;raycasterRef.current.setFromCamera(mouseRef.current,camera);const intersects=raycasterRef.current.intersectObject(boundingBoxMeshRef.current,false);const wasOverModel=isOverModelRef.current;isOverModelRef.current=intersects.length>0;// Enable/disable controls based on whether we're over the model\nif(controls){controls.enabled=isMobile?false:isOverModelRef.current;}// Update cursor based on whether we're over the model and not dragging\nif(isOverModelRef.current!==wasOverModel){startTransition(()=>{if(isDragging){setCursorStyle(\"grabbing\");}else{setCursorStyle(isOverModelRef.current?\"grab\":\"default\");}});}};// Add drag state listeners\nif(controls){// Smooth vertical auto-correction for flat angles on drag end (desktop and mobile)\nconst autoCorrectVerticalAngle=()=>{if(!autoCorrectFlatAngles||autoCorrectingRef.current)return;if(typeof controls.getPolarAngle!==\"function\"||typeof controls.getAzimuthalAngle!==\"function\")return;const polar=controls.getPolarAngle();const azimuth=controls.getAzimuthalAngle();const thresholdRad=flatAngleThreshold*Math.PI/180;let targetPolar=null;if(polar<thresholdRad){targetPolar=thresholdRad;}else if(polar>Math.PI-thresholdRad){targetPolar=Math.PI-thresholdRad;}if(targetPolar===null)return;if(!threeInstanceRef.current||!threeInstanceRef.current.THREE)return;const THREE=threeInstanceRef.current.THREE;const radiusVec=new THREE.Vector3().subVectors(camera.position,controls.target);const radius=radiusVec.length();if(!radius||!isFinite(radius))return;autoCorrectingRef.current=true;const startPolar=polar;const startTime=typeof performance!==\"undefined\"?performance.now():Date.now();const duration=350;const animateCorrection=now=>{const currentTime=now||(typeof performance!==\"undefined\"?performance.now():Date.now());const t=Math.min(Math.max((currentTime-startTime)/duration,0),1);const eased=1-Math.pow(1-t,3);const currentPolar=startPolar+(targetPolar-startPolar)*eased;const sinPhiRadius=Math.sin(currentPolar)*radius;const x=sinPhiRadius*Math.sin(azimuth);const y=Math.cos(currentPolar)*radius;const z=sinPhiRadius*Math.cos(azimuth);camera.position.set(controls.target.x+x,controls.target.y+y,controls.target.z+z);camera.lookAt(controls.target);controls.update();if(t<1){if(typeof requestAnimationFrame!==\"undefined\"){requestAnimationFrame(animateCorrection);}}else{autoCorrectingRef.current=false;}};if(typeof requestAnimationFrame!==\"undefined\"){requestAnimationFrame(animateCorrection);}else{animateCorrection(startTime+duration);}};const playDragSound=async()=>{// Play sound when drag starts - respect component setting and global SFX controller\n// Allow sound both in preview and on the published site, but never in thumbnail/export renderers\nconst currentTarget=RenderTarget.current();const isInteractiveRenderer=currentTarget===RenderTarget.preview||currentTarget===RenderTarget.canvas;if(!isInteractiveRenderer)return;// Check if sound is globally enabled via SFX controller (stored in localStorage)\n// If the key is missing, treat SFX as enabled so the component can work without the controller.\nlet sfxControllerEnabled=true;if(typeof window!==\"undefined\"){const stored=localStorage.getItem(\"sfx-controller-enabled\");if(stored!==null){sfxControllerEnabled=stored===\"true\";}}const shouldPlaySound=enableDragSound&&sfxControllerEnabled&&audioContextRef.current&&gainNodeRef.current&&audioBufferRef.current&&audioInitializedRef.current;if(!shouldPlaySound)return;try{// Stop any currently playing sound\nif(audioSourceRef.current){try{audioSourceRef.current.stop();audioSourceRef.current.disconnect();}catch(e){}audioSourceRef.current=null;}// Resume AudioContext if suspended (required for iOS)\nif(audioContextRef.current.state===\"suspended\"){await audioContextRef.current.resume();}// Create new source from preloaded buffer\nconst source=audioContextRef.current.createBufferSource();source.buffer=audioBufferRef.current;source.loop=false;// Connect to the persistent gain node\nsource.connect(gainNodeRef.current);// Store reference and play\naudioSourceRef.current=source;source.start(0);}catch(err){console.log(\"Error playing audio:\",err);}};const handleDragStart=async event=>{// Check if drag started over the model bounding box\nif(!containerRef.current||!boundingBoxMeshRef.current)return;// Only proceed if we're over the model (already tracked by mousemove) or on mobile\nif(!isOverModelRef.current&&!isMobile)return;startTransition(()=>{setIsDragging(true);setCursorStyle(\"grabbing\");});// Reset drag movement tracker at the start of each drag\ndragMovedRef.current=false;// On mobile, record the starting camera angles so we can detect real movement\nif(isMobile&&controls&&typeof controls.getAzimuthalAngle===\"function\"&&typeof controls.getPolarAngle===\"function\"){startAzimuthRef.current=controls.getAzimuthalAngle();startPolarRef.current=controls.getPolarAngle();}else{startAzimuthRef.current=null;startPolarRef.current=null;}// Desktop: play drag sound immediately on drag start\n// Mobile: sound is handled via pointer movement detection below\nif(!isMobile){await playDragSound();}};const handleDragEnd=()=>{startTransition(()=>{setIsDragging(false);setCursorStyle(isOverModelRef.current?\"grab\":\"default\");});// Reset movement tracker when drag ends\ndragMovedRef.current=false;startAzimuthRef.current=null;startPolarRef.current=null;// Trigger vertical auto-correction when drag finishes\nautoCorrectVerticalAngle();};const handleDragChange=async()=>{// Drag sound on mobile is handled via pointer movement detection, so this is a no-op.\nreturn;};// Pointer-based movement detection on mobile to trigger sound only on real swipe/drag\nlet pointerDown=false;let pointerMoved=false;let pointerStartX=0;let pointerStartY=0;const POINTER_MOVE_THRESHOLD=8// pixels\n;const handlePointerDown=event=>{if(!isMobile)return;pointerDown=true;pointerMoved=false;pointerStartX=event.clientX;pointerStartY=event.clientY;};const handlePointerMove=async event=>{if(!isMobile)return;if(!pointerDown||pointerMoved)return;const dx=event.clientX-pointerStartX;const dy=event.clientY-pointerStartY;const distance=Math.hypot(dx,dy);if(distance<POINTER_MOVE_THRESHOLD)return;pointerMoved=true;await playDragSound();};const handlePointerUp=()=>{if(!isMobile)return;pointerDown=false;pointerMoved=false;};controls.addEventListener(\"start\",handleDragStart);controls.addEventListener(\"end\",handleDragEnd);controls.addEventListener(\"change\",handleDragChange);renderer.domElement.addEventListener(\"pointerdown\",handlePointerDown,{passive:true});renderer.domElement.addEventListener(\"pointermove\",handlePointerMove,{passive:true});renderer.domElement.addEventListener(\"pointerup\",handlePointerUp,{passive:true});renderer.domElement.addEventListener(\"pointercancel\",handlePointerUp,{passive:true});}// Add mouse move listener only on desktop\nif(!isMobile){renderer.domElement.addEventListener(\"mousemove\",handleMouseMove);}// Add lights based on preset or custom values\nconst lightingConfigs={studio:{ambient:.5,hemisphere:.4,directional:.35,fill:.3,left:.3,right:.3,back:.25,point:.25},outdoor:{ambient:.55,hemisphere:.45,directional:.4,fill:.35,left:.35,right:.35,back:.3,point:.3},dramatic:{ambient:.25,hemisphere:.2,directional:.6,fill:.2,left:.2,right:.2,back:.15,point:.15},soft:{ambient:.6,hemisphere:.5,directional:.3,fill:.4,left:.4,right:.4,back:.35,point:.35},custom:{ambient:ambientLightIntensity,hemisphere:ambientLightIntensity*.8,directional:directionalLightIntensity,fill:fillLightIntensity,left:fillLightIntensity,right:fillLightIntensity,back:fillLightIntensity*.5,point:ambientLightIntensity}};const config=lightingConfigs[lightingPreset];// Add lights\nconst ambientLight=new THREE.AmbientLight(16777215,config.ambient);scene.add(ambientLight);// Add hemisphere light for even base illumination\nconst hemisphereLight=new THREE.HemisphereLight(16777215,16777215,config.hemisphere);scene.add(hemisphereLight);const directionalLight=new THREE.DirectionalLight(16777215,config.directional);directionalLight.position.set(1,1,1);scene.add(directionalLight);// Add additional fill light\nconst fillLight=new THREE.DirectionalLight(16777215,config.fill);fillLight.position.set(-1,1,-1);scene.add(fillLight);// Add left side light\nconst leftLight=new THREE.DirectionalLight(16777215,config.fill);leftLight.position.set(-1,1,0);scene.add(leftLight);// Add right side light\nconst rightLight=new THREE.DirectionalLight(16777215,config.fill);rightLight.position.set(1,1,0);scene.add(rightLight);// Add back light\nconst backLight=new THREE.DirectionalLight(16777215,config.fill);backLight.position.set(0,1,-1);scene.add(backLight);// Add front light for balance\nconst frontLight=new THREE.DirectionalLight(16777215,config.fill);frontLight.position.set(0,1,1);scene.add(frontLight);// Add bottom light to reduce shadows\nconst bottomLight=new THREE.DirectionalLight(16777215,config.fill*.5);bottomLight.position.set(0,-1,0);scene.add(bottomLight);// Add point lights for even illumination from all angles\nconst pointLight1=new THREE.PointLight(16777215,config.point,100);pointLight1.position.set(5,5,5);scene.add(pointLight1);const pointLight2=new THREE.PointLight(16777215,config.point,100);pointLight2.position.set(-5,5,-5);scene.add(pointLight2);const pointLight3=new THREE.PointLight(16777215,config.point,100);pointLight3.position.set(5,-5,-5);scene.add(pointLight3);const pointLight4=new THREE.PointLight(16777215,config.point,100);pointLight4.position.set(-5,-5,5);scene.add(pointLight4);const pointLight5=new THREE.PointLight(16777215,config.point,100);pointLight5.position.set(5,5,-5);scene.add(pointLight5);const pointLight6=new THREE.PointLight(16777215,config.point,100);pointLight6.position.set(-5,5,5);scene.add(pointLight6);const pointLight7=new THREE.PointLight(16777215,config.point,100);pointLight7.position.set(5,-5,5);scene.add(pointLight7);const pointLight8=new THREE.PointLight(16777215,config.point,100);pointLight8.position.set(-5,-5,-5);scene.add(pointLight8);// Load model if provided\nif(modelFile){const loader=new GLTFLoader;// @ts-ignore\nconst{DRACOLoader}=await import(\"https://esm.sh/three@0.160.0/examples/jsm/loaders/DRACOLoader.js\");const dracoLoader=new DRACOLoader;dracoLoader.setDecoderPath(\"https://www.gstatic.com/draco/versioned/decoders/1.5.6/\");dracoLoader.setDecoderConfig({type:\"js\"});loader.setDRACOLoader(dracoLoader);loader.load(modelFile,gltf=>{// Add model to scene\nscene.add(gltf.scene);modelRef.current=gltf.scene;// Optimize textures for performance\ngltf.scene.traverse(child=>{if(child.isMesh){// Enable smooth shading for better quality\nif(child.geometry){child.geometry.computeVertexNormals();}// Optimize material\nif(child.material){child.material.needsUpdate=true;// Optimize textures\nif(child.material.map){child.material.map.anisotropy=renderer.capabilities.getMaxAnisotropy();child.material.map.generateMipmaps=true;}if(child.material.normalMap){child.material.normalMap.anisotropy=renderer.capabilities.getMaxAnisotropy();}if(child.material.roughnessMap){child.material.roughnessMap.anisotropy=renderer.capabilities.getMaxAnisotropy();}if(child.material.metalnessMap){child.material.metalnessMap.anisotropy=renderer.capabilities.getMaxAnisotropy();}}}});// Center and scale model\nconst box=new THREE.Box3().setFromObject(gltf.scene);const center=box.getCenter(new THREE.Vector3);const size=box.getSize(new THREE.Vector3);const maxDim=Math.max(size.x,size.y,size.z);const scale=2/maxDim;gltf.scene.scale.set(scale*modelScale,scale*modelScale,scale*modelScale);gltf.scene.userData.baseScale=scale;// Center the model at origin\ngltf.scene.position.set(-center.x*scale*modelScale,-center.y*scale*modelScale,-center.z*scale*modelScale);// Create invisible bounding box mesh for interaction\nconst boundingBoxGeometry=new THREE.BoxGeometry(size.x*scale*modelScale*1.2,size.y*scale*modelScale*1.2,size.z*scale*modelScale*1.2);const boundingBoxMaterial=new THREE.MeshBasicMaterial({transparent:true,opacity:0,side:THREE.DoubleSide});const boundingBoxMesh=new THREE.Mesh(boundingBoxGeometry,boundingBoxMaterial);boundingBoxMesh.position.set(0,0,0);scene.add(boundingBoxMesh);boundingBoxMeshRef.current=boundingBoxMesh;// Fit camera to model - ensure it's centered\nconst fitDistance=cameraDistance;camera.position.set(0,0,fitDistance);camera.lookAt(0,0,0);if(controls){controls.target.set(0,0,0);controls.update();}startTransition(()=>{setError(null);});},progress=>{console.log(\"Loading progress:\",progress.loaded/progress.total*100+\"%\");},err=>{console.error(\"Error loading model:\",err);startTransition(()=>{setError(`Failed to load model: ${err.message||\"Invalid file or URL\"}`);});});}else{// Clear any previous errors when no model is provided\nstartTransition(()=>{setError(null);});}// Animation loop\nconst animate=()=>{animationId=requestAnimationFrame(animate);if(controls){controls.update();}renderer.render(scene,camera);};animate();// Handle resize\nconst handleResize=()=>{if(!containerRef.current)return;camera.aspect=containerRef.current.clientWidth/containerRef.current.clientHeight;camera.updateProjectionMatrix();renderer.setSize(containerRef.current.clientWidth,containerRef.current.clientHeight);renderer.setPixelRatio(Math.min(window.devicePixelRatio,2));};window.addEventListener(\"resize\",handleResize);threeInstanceRef.current={scene,camera,renderer,controls,THREE,cleanup:()=>{window.removeEventListener(\"resize\",handleResize);if(!isMobile){renderer.domElement.removeEventListener(\"mousemove\",handleMouseMove);}if(controls){controls.dispose();}cancelAnimationFrame(animationId);renderer.dispose();if(containerRef.current&&renderer.domElement){containerRef.current.removeChild(renderer.domElement);}}};}catch(err){console.error(\"Error initializing Three.js:\",err);startTransition(()=>setError(\"Failed to initialize 3D viewer\"));}};init();return()=>{if(threeInstanceRef.current){threeInstanceRef.current.cleanup();}};},[modelFile,lightingPreset,ambientLightIntensity,directionalLightIntensity,fillLightIntensity,autoCorrectFlatAngles,flatAngleThreshold]);// Update controls when props change\nuseEffect(()=>{if(threeInstanceRef.current&&threeInstanceRef.current.controls){const controls=threeInstanceRef.current.controls;controls.enableZoom=enableZoom;controls.enablePan=enablePan;controls.autoRotate=autoRotate;controls.autoRotateSpeed=rotationSpeed;// Always allow full vertical rotation; auto-correction is handled manually on drag end\ncontrols.minPolarAngle=0;controls.maxPolarAngle=Math.PI;}},[enableZoom,enablePan,autoRotate,rotationSpeed,autoCorrectFlatAngles,flatAngleThreshold]);// Update camera distance\nuseEffect(()=>{if(threeInstanceRef.current&&threeInstanceRef.current.camera&&threeInstanceRef.current.controls&&threeInstanceRef.current.THREE){const camera=threeInstanceRef.current.camera;const controls=threeInstanceRef.current.controls;const THREE=threeInstanceRef.current.THREE;// Get current direction\nconst direction=new THREE.Vector3;camera.getWorldDirection(direction);direction.negate().normalize();// Set new position maintaining direction\ncamera.position.copy(controls.target).add(direction.multiplyScalar(cameraDistance));camera.updateProjectionMatrix();}},[cameraDistance]);// Update light intensity\nuseEffect(()=>{if(threeInstanceRef.current&&threeInstanceRef.current.scene){const lightingConfigs={studio:{ambient:.5,hemisphere:.4,directional:.35,fill:.3,left:.3,right:.3,back:.25,point:.25},outdoor:{ambient:.55,hemisphere:.45,directional:.4,fill:.35,left:.35,right:.35,back:.3,point:.3},dramatic:{ambient:.25,hemisphere:.2,directional:.6,fill:.2,left:.2,right:.2,back:.15,point:.15},soft:{ambient:.6,hemisphere:.5,directional:.3,fill:.4,left:.4,right:.4,back:.35,point:.35},custom:{ambient:ambientLightIntensity,hemisphere:ambientLightIntensity*.8,directional:directionalLightIntensity,fill:fillLightIntensity,left:fillLightIntensity,right:fillLightIntensity,back:fillLightIntensity*.5,point:ambientLightIntensity}};const config=lightingConfigs[lightingPreset];threeInstanceRef.current.scene.traverse(child=>{if(child.isLight){if(child.isAmbientLight){child.intensity=config.ambient;}else if(child.isHemisphereLight){child.intensity=config.hemisphere;}else if(child.isPointLight){child.intensity=config.point;}else if(child.isDirectionalLight){if(child.position.x===1&&child.position.y===1&&child.position.z===1){child.intensity=config.directional;}else if(child.position.x===-1&&child.position.y===0&&child.position.z===-1){child.intensity=config.fill;}else if(child.position.x===-1&&child.position.y===1&&child.position.z===0){child.intensity=config.left;}else if(child.position.x===1&&child.position.y===1&&child.position.z===0){child.intensity=config.right;}else if(child.position.x===0&&child.position.y===1&&child.position.z===-1){child.intensity=config.back;}}}});}},[ambientLightIntensity,directionalLightIntensity,fillLightIntensity,lightingPreset]);// Update model scale\nuseEffect(()=>{if(modelRef.current&&modelRef.current.userData.baseScale){const baseScale=modelRef.current.userData.baseScale;modelRef.current.scale.set(baseScale*modelScale,baseScale*modelScale,baseScale*modelScale);}},[modelScale]);// Update material properties\nuseEffect(()=>{if(modelRef.current&&threeInstanceRef.current&&threeInstanceRef.current.THREE){const THREE=threeInstanceRef.current.THREE;modelRef.current.traverse(child=>{if(child.isMesh){if(child.material){// Update color\nchild.material.color=new THREE.Color(materialColor);// Update roughness and metalness if material supports it\nif(child.material.roughness!==undefined){child.material.roughness=materialRoughness;}if(child.material.metalness!==undefined){child.material.metalness=materialMetalness;}child.material.needsUpdate=true;}}});}},[materialColor,materialRoughness,materialMetalness]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",cursor:cursorStyle,touchAction:\"auto\"},children:error&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",padding:\"16px 24px\",backgroundColor:\"#FFFFFF\",border:\"1px solid #FF5588\",borderRadius:8,fontSize:14,fontWeight:500,color:\"#FF5588\",zIndex:10},children:error})});}addPropertyControls(ThreeDViewer,{modelFile:{type:ControlType.File,title:\"Model File\",allowedFileTypes:[\"obj\",\"gltf\",\"glb\"]},modelScale:{type:ControlType.Number,title:\"Model Scale\",defaultValue:1,min:.1,max:3,step:.1},materialColor:{type:ControlType.Color,title:\"Material Color\",defaultValue:\"#3399ff\"},materialRoughness:{type:ControlType.Number,title:\"Roughness\",defaultValue:.5,min:0,max:1,step:.01},materialMetalness:{type:ControlType.Number,title:\"Metalness\",defaultValue:1,min:0,max:1,step:.01},lightingPreset:{type:ControlType.Enum,title:\"Lighting Preset\",options:[\"studio\",\"outdoor\",\"dramatic\",\"soft\",\"custom\"],optionTitles:[\"Studio\",\"Outdoor\",\"Dramatic\",\"Soft\",\"Custom\"],defaultValue:\"studio\",displaySegmentedControl:false},ambientLightIntensity:{type:ControlType.Number,title:\"Ambient Light\",defaultValue:.5,min:0,max:10,step:.1,hidden:({lightingPreset})=>lightingPreset!==\"custom\"},directionalLightIntensity:{type:ControlType.Number,title:\"Directional Light\",defaultValue:.35,min:0,max:5,step:.1,hidden:({lightingPreset})=>lightingPreset!==\"custom\"},fillLightIntensity:{type:ControlType.Number,title:\"Fill Light\",defaultValue:.3,min:0,max:5,step:.1,hidden:({lightingPreset})=>lightingPreset!==\"custom\"},autoRotate:{type:ControlType.Boolean,title:\"Auto Rotate\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},rotationSpeed:{type:ControlType.Number,title:\"Rotation Speed\",defaultValue:1,min:.1,max:5,step:.1,hidden:({autoRotate})=>!autoRotate},enableZoom:{type:ControlType.Boolean,title:\"Enable Zoom\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},enablePan:{type:ControlType.Boolean,title:\"Enable Pan\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},cameraDistance:{type:ControlType.Number,title:\"Camera Distance\",defaultValue:3,min:1,max:10,step:.1},autoCorrectFlatAngles:{type:ControlType.Boolean,title:\"Auto-Correct Flat Angles\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},flatAngleThreshold:{type:ControlType.Number,title:\"Correction Threshold\",defaultValue:20,min:5,max:45,step:1,unit:\"\\xb0\",hidden:({autoCorrectFlatAngles})=>!autoCorrectFlatAngles},enableDragSound:{type:ControlType.Boolean,title:\"Enable Drag Sound\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},dragSoundFile:{type:ControlType.File,title:\"Sound File\",allowedFileTypes:[\"mp3\",\"wav\",\"ogg\"],hidden:({enableDragSound})=>!enableDragSound},dragSoundVolume:{type:ControlType.Number,title:\"Sound Volume\",defaultValue:50,min:0,max:100,step:1,unit:\"%\",hidden:({enableDragSound})=>!enableDragSound}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ThreeDViewer\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ThreeDViewer.map"],"mappings":"2NASG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,YAAU,GAAG,aAAW,GAAK,gBAAc,EAAE,aAAW,GAAK,YAAU,GAAK,iBAAe,SAAS,wBAAsB,EAAE,4BAA0B,IAAI,qBAAmB,EAAE,iBAAe,EAAE,aAAW,EAAE,gBAAc,UAAU,oBAAkB,GAAG,oBAAkB,GAAG,wBAAsB,GAAK,qBAAmB,GAAG,kBAAgB,GAAM,gBAAc,qEAAqE,kBAAgB,IAAI,EAAY,EAAaA,EAAO,IAAI,EAAO,CAAC,EAAM,GAAUC,EAAS,IAAI,EAAO,CAAC,EAAW,GAAeA,EAAS,EAAK,EAAQ,EAAiBD,EAAO,IAAI,EAAQ,EAASA,EAAO,IAAI,EAAiB,EAAO,IAAI,EAAE,IAAM,EAAoBA,EAAO,EAAK,EAAQ,EAAgBA,EAAO,IAAI,EAAQ,EAAeA,EAAO,IAAI,EAAQ,EAAeA,EAAO,IAAI,EAAQ,EAAaA,EAAO,IAAI,EAAQ,EAASA,EAAO,IAAI,EAAQ,EAAeA,EAAO,EAAK,EAAO,CAAC,EA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