w-threejs-vue 1.0.1 → 1.0.2

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 (103) hide show
  1. package/README.md +1 -1
  2. package/dist/w-threejs-vue.umd.js +2 -2
  3. package/dist/w-threejs-vue.umd.js.map +1 -1
  4. package/docs/examples/app.html +1 -1
  5. package/docs/examples/app.umd.js +3 -3
  6. package/docs/examples/app.umd.js.map +1 -1
  7. package/docs/examples/ex-AppBasicAutoRotateDeg.html +19 -7
  8. package/docs/examples/ex-AppBasicBackgroundColor.html +19 -7
  9. package/docs/examples/ex-AppBasicSize.html +49 -7
  10. package/docs/examples/ex-AppBasicUploadStl.html +19 -7
  11. package/docs/examples/ex-AppBasicUseAutoRotate.html +19 -7
  12. package/docs/examples/ex-AppCmCameraFar.html +19 -7
  13. package/docs/examples/ex-AppCmCameraFov.html +19 -7
  14. package/docs/examples/ex-AppCmCameraNear.html +19 -7
  15. package/docs/examples/ex-AppCmCameraOrthographicRatio.html +19 -7
  16. package/docs/examples/ex-AppCmCameraType.html +19 -7
  17. package/docs/examples/ex-AppCmGetCameraViewAngle.html +19 -7
  18. package/docs/examples/ex-AppCmSetCameraAzimuthAngle.html +19 -7
  19. package/docs/examples/ex-AppCmSetCameraPolarAngle.html +19 -7
  20. package/docs/examples/ex-AppCmSetCameraViewAngle.html +19 -7
  21. package/docs/examples/ex-AppHpHelperAxesLengthRatio.html +19 -7
  22. package/docs/examples/ex-AppHpHelperGridDensity.html +19 -7
  23. package/docs/examples/ex-AppHpHelperGridLengthRatio.html +19 -7
  24. package/docs/examples/ex-AppHpHelperGridPositionRatioZ.html +19 -7
  25. package/docs/examples/ex-AppHpUseHelperAxes.html +19 -7
  26. package/docs/examples/ex-AppHpUseHelperGrid.html +19 -7
  27. package/docs/examples/ex-AppLgLegnedBackgroundColor.html +19 -7
  28. package/docs/examples/ex-AppLgLegnedHeight.html +19 -7
  29. package/docs/examples/ex-AppLgLegnedHeightMax.html +19 -7
  30. package/docs/examples/ex-AppLtLightAmbientColor.html +19 -7
  31. package/docs/examples/ex-AppLtLightDirectionColor.html +19 -7
  32. package/docs/examples/ex-AppLtLightDirectionIntensity.html +19 -7
  33. package/docs/examples/ex-AppLtLightDirectionPos.html +19 -7
  34. package/docs/examples/ex-AppLtLightPointColor.html +19 -7
  35. package/docs/examples/ex-AppLtLightPointDecay.html +19 -7
  36. package/docs/examples/ex-AppLtLightPointDistance.html +19 -7
  37. package/docs/examples/ex-AppLtLightPointIntensity.html +19 -7
  38. package/docs/examples/ex-AppLtLightPointPoss.html +19 -7
  39. package/docs/examples/ex-AppLtUseLightAmbient.html +19 -7
  40. package/docs/examples/ex-AppLtUseLightDirection.html +19 -7
  41. package/docs/examples/ex-AppLtUseLightPoint.html +19 -7
  42. package/docs/examples/ex-AppMhGetMeshsInfor.html +19 -7
  43. package/docs/examples/ex-AppMhSetMeshColor.html +19 -7
  44. package/docs/examples/ex-AppMhSetMeshLabelText.html +19 -7
  45. package/docs/examples/ex-AppMhSetMeshLabelTextColor.html +19 -7
  46. package/docs/examples/ex-AppMhSetMeshLabelTextFontFamily.html +19 -7
  47. package/docs/examples/ex-AppMhSetMeshLabelTextFontSize.html +19 -7
  48. package/docs/examples/ex-AppMhSetMeshLabelVisible.html +19 -7
  49. package/docs/examples/ex-AppMhSetMeshVisible.html +19 -7
  50. package/docs/examples/ex-AppMuMenuIcons.html +19 -7
  51. package/docs/examples/ex-AppMuMenuTooltips.html +19 -7
  52. package/docs/index.html +1 -1
  53. package/docs/module-WThreejsVue.html +1 -1
  54. package/package.json +2 -2
  55. package/src/App.vue +5 -5
  56. package/src/AppBasicAutoRotateDeg.vue +3 -3
  57. package/src/AppBasicBackgroundColor.vue +3 -3
  58. package/src/AppBasicSize.vue +18 -2
  59. package/src/AppBasicUploadStl.vue +3 -3
  60. package/src/AppBasicUseAutoRotate.vue +3 -3
  61. package/src/AppCmCameraFar.vue +3 -3
  62. package/src/AppCmCameraFov.vue +3 -3
  63. package/src/AppCmCameraNear.vue +3 -3
  64. package/src/AppCmCameraOrthographicRatio.vue +3 -3
  65. package/src/AppCmCameraType.vue +3 -3
  66. package/src/AppCmGetCameraViewAngle.vue +3 -3
  67. package/src/AppCmSetCameraAzimuthAngle.vue +3 -3
  68. package/src/AppCmSetCameraPolarAngle.vue +3 -3
  69. package/src/AppCmSetCameraViewAngle.vue +3 -3
  70. package/src/AppHpHelperAxesLengthRatio.vue +3 -3
  71. package/src/AppHpHelperGridDensity.vue +3 -3
  72. package/src/AppHpHelperGridLengthRatio.vue +3 -3
  73. package/src/AppHpHelperGridPositionRatioZ.vue +3 -3
  74. package/src/AppHpUseHelperAxes.vue +3 -3
  75. package/src/AppHpUseHelperGrid.vue +3 -3
  76. package/src/AppLgLegnedBackgroundColor.vue +3 -3
  77. package/src/AppLgLegnedHeight.vue +3 -3
  78. package/src/AppLgLegnedHeightMax.vue +3 -3
  79. package/src/AppLtLightAmbientColor.vue +3 -3
  80. package/src/AppLtLightDirectionColor.vue +3 -3
  81. package/src/AppLtLightDirectionIntensity.vue +3 -3
  82. package/src/AppLtLightDirectionPos.vue +3 -3
  83. package/src/AppLtLightPointColor.vue +3 -3
  84. package/src/AppLtLightPointDecay.vue +3 -3
  85. package/src/AppLtLightPointDistance.vue +3 -3
  86. package/src/AppLtLightPointIntensity.vue +3 -3
  87. package/src/AppLtLightPointPoss.vue +3 -3
  88. package/src/AppLtUseLightAmbient.vue +3 -3
  89. package/src/AppLtUseLightDirection.vue +3 -3
  90. package/src/AppLtUseLightPoint.vue +3 -3
  91. package/src/AppMhGetMeshsInfor.vue +3 -3
  92. package/src/AppMhSetMeshColor.vue +3 -3
  93. package/src/AppMhSetMeshLabelText.vue +3 -3
  94. package/src/AppMhSetMeshLabelTextColor.vue +3 -3
  95. package/src/AppMhSetMeshLabelTextFontFamily.vue +3 -3
  96. package/src/AppMhSetMeshLabelTextFontSize.vue +3 -3
  97. package/src/AppMhSetMeshLabelVisible.vue +3 -3
  98. package/src/AppMhSetMeshVisible.vue +3 -3
  99. package/src/AppMuMenuIcons.vue +3 -3
  100. package/src/AppMuMenuTooltips.vue +3 -3
  101. package/src/components/WThreejsVue.vue +10 -5
  102. package/src/js/plot3d.mjs +2 -2
  103. package/toolg/gExtractHtml.mjs +16 -5
package/README.md CHANGED
@@ -35,5 +35,5 @@ npm i w-threejs-vue
35
35
  ```
36
36
  [Necessary] Add script for w-threejs-vue.
37
37
  ```alias
38
- <script src="https://cdn.jsdelivr.net/npm/w-threejs-vue@1.0.1/dist/w-threejs-vue.umd.js"></script>
38
+ <script src="https://cdn.jsdelivr.net/npm/w-threejs-vue@1.0.2/dist/w-threejs-vue.umd.js"></script>
39
39
  ```
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * w-threejs-vue v1.0.1
2
+ * w-threejs-vue v1.0.2
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -22,5 +22,5 @@ var Xu,$u,Yu=9e15,qu=1e9,Zu="0123456789abcdef",Ju="2.302585092994045684017991454
22
22
  * https://github.com/yomotsu/camera-controls
23
23
  * (c) 2017 @yomotsu
24
24
  * Released under the MIT License.
25
- */const lT=1,cT=2,uT=4,hT=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),dT=0,pT=1,fT=-1;function mT(e){return e.isPerspectiveCamera}function gT(e){return e.isOrthographicCamera}const vT=2*Math.PI,yT=Math.PI/2,_T=1e-5,xT=Math.PI/180;function bT(e,t,n){return Math.max(t,Math.min(n,e))}function ST(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_T;return Math.abs(e)<t}function wT(e,t){return ST(e-t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:_T)}function CT(e,t){return Math.round(e/t)*t}function MT(e){return isFinite(e)?e:e<0?-Number.MAX_VALUE:Number.MAX_VALUE}function TT(e){return Math.abs(e)<Number.MAX_VALUE?e:e*(1/0)}function AT(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,o=arguments.length>5?arguments[5]:void 0;const s=2/(r=Math.max(1e-4,r)),a=s*o,l=1/(1+a+.48*a*a+.235*a*a*a);let c=e-t;const u=t,h=i*r;c=bT(c,-h,h),t=e-c;const d=(n.value+s*c)*o;n.value=(n.value-s*d)*l;let p=t+(c+d)*l;return u-e>0==p>u&&(p=u,n.value=(p-u)/o),p}function ET(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;const a=2/(r=Math.max(1e-4,r)),l=a*o,c=1/(1+l+.48*l*l+.235*l*l*l);let u=t.x,h=t.y,d=t.z,p=e.x-u,f=e.y-h,m=e.z-d;const g=u,v=h,y=d,_=i*r,x=p*p+f*f+m*m;if(x>_*_){const e=Math.sqrt(x);p=p/e*_,f=f/e*_,m=m/e*_}u=e.x-p,h=e.y-f,d=e.z-m;const b=(n.x+a*p)*o,S=(n.y+a*f)*o,w=(n.z+a*m)*o;n.x=(n.x-a*b)*c,n.y=(n.y-a*S)*c,n.z=(n.z-a*w)*c,s.x=u+(p+b)*c,s.y=h+(f+S)*c,s.z=d+(m+w)*c;const C=g-e.x,M=v-e.y,T=y-e.z;return C*(s.x-g)+M*(s.y-v)+T*(s.z-y)>0&&(s.x=g,s.y=v,s.z=y,n.x=(s.x-g)/o,n.y=(s.y-v)/o,n.z=(s.z-y)/o),s}function RT(e,t){t.set(0,0),e.forEach((e=>{t.x+=e.clientX,t.y+=e.clientY})),t.x/=e.length,t.y/=e.length}function LT(e,t){return!!gT(e)&&(console.warn(`${t} is not supported in OrthographicCamera`),!0)}class PT{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}removeAllEventListeners(e){e?Array.isArray(this._listeners[e])&&(this._listeners[e].length=0):this._listeners={}}dispatchEvent(e){const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e)}}}const IT=1/8,OT="undefined"!=typeof window,kT=OT&&/Mac/.test(navigator.platform),BT=!(OT&&"PointerEvent"in window);let DT,NT,UT,FT,zT,HT,WT,VT,GT,jT,XT,$T,YT,qT,ZT,JT,KT,QT,eA,tA,nA,rA,iA;class oA extends PT{static install(e){DT=e.THREE,NT=Object.freeze(new DT.Vector3(0,0,0)),UT=Object.freeze(new DT.Vector3(0,1,0)),FT=Object.freeze(new DT.Vector3(0,0,1)),zT=new DT.Vector2,HT=new DT.Vector3,WT=new DT.Vector3,VT=new DT.Vector3,GT=new DT.Vector3,jT=new DT.Vector3,XT=new DT.Vector3,$T=new DT.Vector3,YT=new DT.Vector3,qT=new DT.Vector3,ZT=new DT.Spherical,JT=new DT.Spherical,KT=new DT.Box3,QT=new DT.Box3,eA=new DT.Sphere,tA=new DT.Quaternion,nA=new DT.Quaternion,rA=new DT.Matrix4,iA=new DT.Raycaster}static get ACTION(){return hT}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=hT.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=dT,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new DT.Vector3,this._focalOffsetVelocity=new DT.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,n)=>{let r,i;if(mT(this._camera)){const n=HT.copy(this._camera.position).sub(this._target),o=this._camera.getEffectiveFOV()*xT,s=n.length()*Math.tan(.5*o);r=this.truckSpeed*e*s/this._elementRect.height,i=this.truckSpeed*t*s/this._elementRect.height}else{if(!gT(this._camera))return;{const n=this._camera;r=e*(n.right-n.left)/n.zoom/this._elementRect.width,i=t*(n.top-n.bottom)/n.zoom/this._elementRect.height}}this.verticalDragToForward?(n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(r,0,!0),this.forward(-i,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y+i,this._focalOffsetEnd.z,!0):this.truck(r,i,!0)},this._rotateInternal=(e,t)=>{const n=vT*this.azimuthRotateSpeed*e/this._elementRect.height,r=vT*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)},this._dollyInternal=(e,t,n)=>{const r=Math.pow(.95,-e*this.dollySpeed),i=this._sphericalEnd.radius,o=this._sphericalEnd.radius*r,s=bT(o,this.minDistance,this.maxDistance),a=s-o;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(o,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(a,!0),this._dollyToNoClamp(s,!0)):this._dollyToNoClamp(s,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?o:s)-i,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)},this._zoomInternal=(e,t,n)=>{const r=Math.pow(.95,e*this.dollySpeed),i=this._zoom,o=this._zoom*r;this.zoomTo(o,!0),this.dollyToCursor&&(this._changedZoom+=o-i,this._dollyControlCoord.set(t,n))},void 0===DT&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=(new DT.Quaternion).setFromUnitVectors(this._camera.up,UT),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=hT.NONE,this._target=new DT.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new DT.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=(new DT.Spherical).setFromVector3(HT.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new DT.Vector3,new DT.Vector3,new DT.Vector3,new DT.Vector3],this._updateNearPlaneCorners(),this._boundary=new DT.Box3(new DT.Vector3(-1/0,-1/0,-1/0),new DT.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new DT.Vector2,this.mouseButtons={left:hT.ROTATE,middle:hT.DOLLY,right:hT.TRUCK,wheel:mT(this._camera)?hT.DOLLY:gT(this._camera)?hT.ZOOM:hT.NONE},this.touches={one:hT.TOUCH_ROTATE,two:mT(this._camera)?hT.TOUCH_DOLLY_TRUCK:gT(this._camera)?hT.TOUCH_ZOOM_TRUCK:hT.NONE,three:hT.TOUCH_TRUCK};const n=new DT.Vector2,r=new DT.Vector2,i=new DT.Vector2,o=e=>{if(!this._enabled||!this._domElement)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}const t="mouse"!==e.pointerType?null:(e.buttons&lT)===lT?lT:(e.buttons&uT)===uT?uT:(e.buttons&cT)===cT?cT:null;if(null!==t){const e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}if((e.buttons&lT)===lT&&this._lockedPointer)return;const n={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",c),this._isDragging=!0,f(e)},s=e=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}const t=(e.buttons&lT)===lT?lT:(e.buttons&uT)===uT?uT:(e.buttons&cT)===cT?cT:null;if(null!==t){const e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}const n={pointerId:1,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:(e.buttons&lT)===lT?lT:(e.buttons&uT)===lT?uT:(e.buttons&cT)===lT?cT:null};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",u),this._isDragging=!0,f(e)},a=e=>{e.cancelable&&e.preventDefault();const t=e.pointerId,n=this._lockedPointer||this._findPointerById(t);if(n){if(n.clientX=e.clientX,n.clientY=e.clientY,n.deltaX=e.movementX,n.deltaY=e.movementY,this._state=0,"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(e.buttons&lT)===lT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right);m()}},l=e=>{const t=this._lockedPointer||this._findPointerById(1);t&&(t.clientX=e.clientX,t.clientY=e.clientY,t.deltaX=e.movementX,t.deltaY=e.movementY,this._state=0,(this._lockedPointer||(e.buttons&lT)===lT)&&(this._state=this._state|this.mouseButtons.left),(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right),m())},c=e=>{const t=this._findPointerById(e.pointerId);if(!t||t!==this._lockedPointer){if(t&&this._disposePointer(t),"touch"===e.pointerType)switch(this._activePointers.length){case 0:this._state=hT.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=hT.NONE;g()}},u=()=>{const e=this._findPointerById(1);e&&e===this._lockedPointer||(e&&this._disposePointer(e),this._state=hT.NONE,g())};let h=-1;const d=e=>{if(!this._domElement)return;if(!this._enabled||this.mouseButtons.wheel===hT.NONE)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===hT.ROTATE||this.mouseButtons.wheel===hT.TRUCK){const e=performance.now();h-e<1e3&&this._getClientRect(this._elementRect),h=e}const t=kT?-1:-3,n=1===e.deltaMode?e.deltaY/t:e.deltaY/(10*t),r=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?(e.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case hT.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case hT.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1),this._isUserControllingTruck=!0;break;case hT.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0),this._isUserControllingOffset=!0;break;case hT.DOLLY:this._dollyInternal(-n,r,i),this._isUserControllingDolly=!0;break;case hT.ZOOM:this._zoomInternal(-n,r,i),this._isUserControllingZoom=!0}this.dispatchEvent({type:"control"})},p=e=>{if(this._domElement&&this._enabled){if(this.mouseButtons.right===oA.ACTION.NONE){const t=e instanceof PointerEvent?e.pointerId:(MouseEvent,0),n=this._findPointerById(t);return n&&this._disposePointer(n),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mousemove",l),void this._domElement.ownerDocument.removeEventListener("mouseup",u)}e.preventDefault()}},f=e=>{if(!this._enabled)return;RT(this._activePointers,zT),this._getClientRect(this._elementRect),n.copy(zT),r.copy(zT);if(this._activePointers.length>=2){const e=zT.x-this._activePointers[1].clientX,t=zT.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t);i.set(0,n);const o=.5*(this._activePointers[0].clientX+this._activePointers[1].clientX),s=.5*(this._activePointers[0].clientY+this._activePointers[1].clientY);r.set(o,s)}if(this._state=0,e)if("pointerType"in e&&"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._lockedPointer||(e.buttons&lT)!==lT||(this._state=this._state|this.mouseButtons.left),(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right);else this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);(this._state&hT.ROTATE)!==hT.ROTATE&&(this._state&hT.TOUCH_ROTATE)!==hT.TOUCH_ROTATE&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),(this._state&hT.TRUCK)!==hT.TRUCK&&(this._state&hT.TOUCH_TRUCK)!==hT.TOUCH_TRUCK&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK||(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),(this._state&hT.DOLLY)!==hT.DOLLY&&(this._state&hT.TOUCH_DOLLY)!==hT.TOUCH_DOLLY&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE||(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),(this._state&hT.ZOOM)!==hT.ZOOM&&(this._state&hT.TOUCH_ZOOM)!==hT.TOUCH_ZOOM&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),(this._state&hT.OFFSET)!==hT.OFFSET&&(this._state&hT.TOUCH_OFFSET)!==hT.TOUCH_OFFSET&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET||(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,RT(this._activePointers,zT);const e=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,t=e?-e.deltaX:r.x-zT.x,o=e?-e.deltaY:r.y-zT.y;if(r.copy(zT),(this._state&hT.ROTATE)!==hT.ROTATE&&(this._state&hT.TOUCH_ROTATE)!==hT.TOUCH_ROTATE&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._rotateInternal(t,o),this._isUserControllingRotate=!0),(this._state&hT.DOLLY)===hT.DOLLY||(this._state&hT.ZOOM)===hT.ZOOM){const e=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,r=this.dollyDragInverted?-1:1;(this._state&hT.DOLLY)===hT.DOLLY?(this._dollyInternal(r*o*IT,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(r*o*IT,e,t),this._isUserControllingZoom=!0)}if((this._state&hT.TOUCH_DOLLY)===hT.TOUCH_DOLLY||(this._state&hT.TOUCH_ZOOM)===hT.TOUCH_ZOOM||(this._state&hT.TOUCH_DOLLY_TRUCK)===hT.TOUCH_DOLLY_TRUCK||(this._state&hT.TOUCH_ZOOM_TRUCK)===hT.TOUCH_ZOOM_TRUCK||(this._state&hT.TOUCH_DOLLY_OFFSET)===hT.TOUCH_DOLLY_OFFSET||(this._state&hT.TOUCH_ZOOM_OFFSET)===hT.TOUCH_ZOOM_OFFSET||(this._state&hT.TOUCH_DOLLY_ROTATE)===hT.TOUCH_DOLLY_ROTATE||(this._state&hT.TOUCH_ZOOM_ROTATE)===hT.TOUCH_ZOOM_ROTATE){const e=zT.x-this._activePointers[1].clientX,t=zT.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t),o=i.y-n;i.set(0,n);const s=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,a=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&hT.TOUCH_DOLLY)===hT.TOUCH_DOLLY||(this._state&hT.TOUCH_DOLLY_ROTATE)===hT.TOUCH_DOLLY_ROTATE||(this._state&hT.TOUCH_DOLLY_TRUCK)===hT.TOUCH_DOLLY_TRUCK||(this._state&hT.TOUCH_DOLLY_OFFSET)===hT.TOUCH_DOLLY_OFFSET?(this._dollyInternal(o*IT,s,a),this._isUserControllingDolly=!0):(this._zoomInternal(o*IT,s,a),this._isUserControllingZoom=!0)}(this._state&hT.TRUCK)!==hT.TRUCK&&(this._state&hT.TOUCH_TRUCK)!==hT.TOUCH_TRUCK&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK||(this._truckInternal(t,o,!1),this._isUserControllingTruck=!0),(this._state&hT.OFFSET)!==hT.OFFSET&&(this._state&hT.TOUCH_OFFSET)!==hT.TOUCH_OFFSET&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET||(this._truckInternal(t,o,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},g=()=>{RT(this._activePointers,zT),r.copy(zT),this._dragNeedsUpdate=!1,(0===this._activePointers.length||1===this._activePointers.length&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),0===this._activePointers.length&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mouseup",u),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{this._enabled&&this._domElement&&(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",v),this._domElement.ownerDocument.addEventListener("pointerlockerror",y),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",c),f())},this.unlockPointer=()=>{null!==this._lockedPointer&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",v),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))};const v=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},y=()=>{this.unlockPointer()};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),BT&&this._domElement.addEventListener("mousedown",s),this._domElement.addEventListener("pointercancel",c),this._domElement.addEventListener("wheel",d,{passive:!1}),this._domElement.addEventListener("contextmenu",p)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",s),this._domElement.removeEventListener("pointercancel",c),this._domElement.removeEventListener("wheel",d,{passive:!1}),this._domElement.removeEventListener("contextmenu",p),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.removeEventListener("pointerlockchange",v),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))},this.cancel=()=>{this._state!==hT.NONE&&(this._state=hT.NONE,this._activePointers.length=0,g())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=bT(e.width,0,1),this._interactiveArea.height=bT(e.height,0,1),this._interactiveArea.x=bT(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=bT(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._isUserControllingRotate=!1;const r=bT(e,this.minAzimuthAngle,this.maxAzimuthAngle),i=bT(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=i,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!n||wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._isUserControllingDolly=!1,this._lastDollyDirection=dT,this._changedDolly=0,this._dollyToNoClamp(bT(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const t=this._collisionTest(),r=wT(t,this._spherical.radius);if(!(n>e)&&r)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,t)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const r=!t||wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._targetEnd.add(this._getCameraDirection(GT).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const n=!t||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._isUserControllingZoom=!1,this._zoomEnd=bT(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const n=!t||wT(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._camera.updateMatrix(),jT.setFromMatrixColumn(this._camera.matrix,0),XT.setFromMatrixColumn(this._camera.matrix,1),jT.multiplyScalar(e),XT.multiplyScalar(-t);const r=HT.copy(jT).add(XT),i=WT.copy(this._targetEnd).add(r);return this.moveTo(i.x,i.y,i.z,n)}forward(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];HT.setFromMatrixColumn(this._camera.matrix,0),HT.crossVectors(this._camera.up,HT),HT.multiplyScalar(e);const n=WT.copy(this._targetEnd).add(HT);return this.moveTo(n.x,n.y,n.z,t)}elevate(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return HT.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+HT.x,this._targetEnd.y+HT.y,this._targetEnd.z+HT.z,t)}moveTo(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._isUserControllingTruck=!1;const i=HT.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,i,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const o=!r||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=HT.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(i.x,i.y,i.z,r)}fitToBox(e,t){let{cover:n=!1,paddingLeft:r=0,paddingRight:i=0,paddingBottom:o=0,paddingTop:s=0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=[],l=e.isBox3?KT.copy(e):KT.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const c=CT(this._sphericalEnd.theta,yT),u=CT(this._sphericalEnd.phi,yT);a.push(this.rotateTo(c,u,t));const h=HT.setFromSpherical(this._sphericalEnd).normalize(),d=tA.setFromUnitVectors(h,FT),p=wT(Math.abs(h.y),1);p&&d.multiply(nA.setFromAxisAngle(UT,c)),d.multiply(this._yAxisUpSpaceInverse);const f=QT.makeEmpty();WT.copy(l.min).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setX(l.max.x).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setY(l.max.y).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setZ(l.min.z).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setZ(l.max.z).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setY(l.min.y).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setX(l.min.x).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).applyQuaternion(d),f.expandByPoint(WT),f.min.x-=r,f.min.y-=o,f.max.x+=i,f.max.y+=s,d.setFromUnitVectors(FT,h),p&&d.premultiply(nA.invert()),d.premultiply(this._yAxisUpSpace);const m=f.getSize(HT),g=f.getCenter(WT).applyQuaternion(d);if(mT(this._camera)){const e=this.getDistanceToFitBox(m.x,m.y,m.z,n);a.push(this.moveTo(g.x,g.y,g.z,t)),a.push(this.dollyTo(e,t)),a.push(this.setFocalOffset(0,0,0,t))}else if(gT(this._camera)){const e=this._camera,r=e.right-e.left,i=e.top-e.bottom,o=n?Math.max(r/m.x,i/m.y):Math.min(r/m.x,i/m.y);a.push(this.moveTo(g.x,g.y,g.z,t)),a.push(this.zoomTo(o,t)),a.push(this.setFocalOffset(0,0,0,t))}return Promise.all(a)}fitToSphere(e,t){const n=[],r=e instanceof DT.Sphere?eA.copy(e):oA.createBoundingSphere(e,eA);if(n.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),mT(this._camera)){const e=this.getDistanceToFitSphere(r.radius);n.push(this.dollyTo(e,t))}else if(gT(this._camera)){const e=this._camera.right-this._camera.left,i=this._camera.top-this._camera.bottom,o=2*r.radius,s=Math.min(e/o,i/o);n.push(this.zoomTo(s,t))}return n.push(this.setFocalOffset(0,0,0,t)),Promise.all(n)}setLookAt(e,t,n,r,i,o){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=dT,this._changedDolly=0;const a=WT.set(r,i,o),l=HT.set(e,t,n);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,s||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const c=!s||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold)&&wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(c)}lerpLookAt(e,t,n,r,i,o,s,a,l,c,u,h,d){let p=arguments.length>13&&void 0!==arguments[13]&&arguments[13];this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=dT,this._changedDolly=0;const f=HT.set(r,i,o),m=WT.set(e,t,n);ZT.setFromVector3(m.sub(f).applyQuaternion(this._yAxisUpSpace));const g=VT.set(c,u,h),v=WT.set(s,a,l);JT.setFromVector3(v.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(f.lerp(g,d));const y=JT.theta-ZT.theta,_=JT.phi-ZT.phi,x=JT.radius-ZT.radius;this._sphericalEnd.set(ZT.radius+x*d,ZT.phi+_*d,ZT.theta+y*d),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const b=!p||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold)&&wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(b)}setPosition(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=this.getPosition(HT),o=this.setLookAt(i.x,i.y,i.z,e,t,n,r);return this._sphericalEnd.phi=bT(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const i=!r||wT(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&wT(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&wT(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),jT.setFromMatrixColumn(this._camera.matrixWorldInverse,0),XT.setFromMatrixColumn(this._camera.matrixWorldInverse,1),$T.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=HT.set(e,t,n),i=r.distanceTo(this._camera.position),o=r.sub(this._camera.position);jT.multiplyScalar(o.x),XT.multiplyScalar(o.y),$T.multiplyScalar(o.z),HT.copy(jT).add(XT).add($T),HT.z=HT.z+i,this.dollyTo(i,!1),this.setFocalOffset(-HT.x,HT.y,-HT.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e)return this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),void(this._needsUpdate=!0);this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){null!==e?(this._viewport=this._viewport||new DT.Vector4,"number"==typeof e?this._viewport.set(e,t,n,r):this._viewport.copy(e)):this._viewport=null}getDistanceToFitBox(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(LT(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const i=e/t,o=this._camera.getEffectiveFOV()*xT,s=this._camera.aspect;return.5*((r?i>s:i<s)?t:e/s)/Math.tan(.5*o)+.5*n}getDistanceToFitSphere(e){if(LT(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*xT,n=2*Math.atan(Math.tan(.5*t)*this._camera.aspect),r=1<this._camera.aspect?t:n;return e/Math.sin(.5*r)}getTarget(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e instanceof DT.Spherical?e:new DT.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%vT,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=vT),this._spherical.theta+=vT*Math.round((this._sphericalEnd.theta-this._spherical.theta)/vT)}reset(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!wT(this._camera.up.x,this._cameraUp0.x)||!wT(this._camera.up.y,this._cameraUp0.y)||!wT(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const e=this.getPosition(HT);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,UT),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=HT.subVectors(this._target,this._camera.position).normalize(),t=WT.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const n=this.getPosition(HT);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,i=YT.subVectors(this._targetEnd,this._target),o=qT.subVectors(this._focalOffsetEnd,this._focalOffset),s=this._zoomEnd-this._zoom;if(ST(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=AT(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,t,1/0,e),this._needsUpdate=!0}if(ST(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=AT(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,t,1/0,e),this._needsUpdate=!0}if(ST(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const t=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=AT(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,t,this.maxSpeed,e),this._needsUpdate=!0}if(ST(i.x)&&ST(i.y)&&ST(i.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const t=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;ET(this._target,this._targetEnd,this._targetVelocity,t,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(ST(o.x)&&ST(o.y)&&ST(o.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const t=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;ET(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,t,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(ST(s))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const t=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=AT(this._zoom,this._zoomEnd,this._zoomVelocity,t,1/0,e)}if(this.dollyToCursor)if(mT(this._camera)&&0!==this._changedDolly){const e=this._spherical.radius-this._lastDistance,t=this._camera,n=this._getCameraDirection(GT),r=HT.copy(n).cross(t.up).normalize();0===r.lengthSq()&&(r.x=1);const i=WT.crossVectors(r,n),o=this._sphericalEnd.radius*Math.tan(t.getEffectiveFOV()*xT*.5),s=(this._sphericalEnd.radius-e-this._sphericalEnd.radius)/this._sphericalEnd.radius,a=VT.copy(this._targetEnd).add(r.multiplyScalar(this._dollyControlCoord.x*o*t.aspect)).add(i.multiplyScalar(this._dollyControlCoord.y*o)),l=HT.copy(this._targetEnd).lerp(a,s),c=this._lastDollyDirection===pT&&this._spherical.radius<=this.minDistance,u=this._lastDollyDirection===fT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(c||u)){this._sphericalEnd.radius-=e,this._spherical.radius-=e;const t=WT.copy(n).multiplyScalar(-e);l.add(t)}this._boundary.clampPoint(l,l);const h=WT.subVectors(l,this._targetEnd);this._targetEnd.copy(l),this._target.add(h),this._changedDolly-=e,ST(this._changedDolly)&&(this._changedDolly=0)}else if(gT(this._camera)&&0!==this._changedZoom){const e=this._zoom-this._lastZoom,t=this._camera,n=HT.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(t.near+t.far)/(t.near-t.far)).unproject(t),r=WT.set(0,0,-1).applyQuaternion(t.quaternion),i=VT.copy(n).add(r.multiplyScalar(-n.dot(t.up))),o=-(this._zoom-e-this._zoom)/this._zoom,s=this._getCameraDirection(GT),a=this._targetEnd.dot(s),l=HT.copy(this._targetEnd).lerp(i,o),c=l.dot(s),u=s.multiplyScalar(c-a);l.sub(u),this._boundary.clampPoint(l,l);const h=WT.subVectors(l,this._targetEnd);this._targetEnd.copy(l),this._target.add(h),this._changedZoom-=e,ST(this._changedZoom)&&(this._changedZoom=0)}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const a=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,a),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target);(!ST(this._focalOffset.x)||!ST(this._focalOffset.y)||!ST(this._focalOffset.z))&&(this._camera.updateMatrixWorld(),jT.setFromMatrixColumn(this._camera.matrix,0),XT.setFromMatrixColumn(this._camera.matrix,1),$T.setFromMatrixColumn(this._camera.matrix,2),jT.multiplyScalar(this._focalOffset.x),XT.multiplyScalar(-this._focalOffset.y),$T.multiplyScalar(this._focalOffset.z),HT.copy(jT).add(XT).add($T),this._camera.position.add(HT)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),HT.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const l=this._needsUpdate;return l&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):l?(this.dispatchEvent({type:"update"}),ST(t,this.restThreshold)&&ST(n,this.restThreshold)&&ST(r,this.restThreshold)&&ST(i.x,this.restThreshold)&&ST(i.y,this.restThreshold)&&ST(i.z,this.restThreshold)&&ST(o.x,this.restThreshold)&&ST(o.y,this.restThreshold)&&ST(o.z,this.restThreshold)&&ST(s,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!l&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=l,this._needsUpdate=!1,l}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:MT(this.maxDistance),minZoom:this.minZoom,maxZoom:MT(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:MT(this.maxPolarAngle),minAzimuthAngle:MT(this.minAzimuthAngle),maxAzimuthAngle:MT(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:HT.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=JSON.parse(e);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=TT(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=TT(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=TT(n.maxPolarAngle),this.minAzimuthAngle=TT(n.minAzimuthAngle),this.maxAzimuthAngle=TT(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this.verticalDragToForward=n.verticalDragToForward,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],t),ZT.setFromVector3(HT.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(ZT.theta,ZT.phi,t),this.dollyTo(ZT.radius,t),this.zoomTo(n.zoom,t),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],t),this._needsUpdate=!0}connect(e){this._domElement?console.warn("camera-controls is already connected."):(e.setAttribute("data-camera-controls-version","2.7.3"),this._addAllEventListeners(e),this._getClientRect(this._elementRect))}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find((t=>t.pointerId===e))}_findPointerByMouseButton(e){return this._activePointers.find((t=>t.mouseButton===e))}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){const r=t.lengthSq();if(0===r)return e;const i=WT.copy(t).add(e),o=this._boundary.clampPoint(i,VT).sub(i),s=o.lengthSq();if(0===s)return e.add(t);if(s===r)return e;if(0===n)return e.add(t).add(o);{const r=1+n*s/t.dot(o);return e.add(WT.copy(t).multiplyScalar(r)).add(o.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(mT(this._camera)){const e=this._camera,t=e.near,n=e.getEffectiveFOV()*xT,r=Math.tan(.5*n)*t,i=r*e.aspect;this._nearPlaneCorners[0].set(-i,-r,0),this._nearPlaneCorners[1].set(i,-r,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(-i,r,0)}else if(gT(this._camera)){const e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,i=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(n,i,0),this._nearPlaneCorners[1].set(r,i,0),this._nearPlaneCorners[2].set(r,o,0),this._nearPlaneCorners[3].set(n,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1))return e;if(LT(this._camera,"_collisionTest"))return e;const t=this._getTargetDirection(GT);rA.lookAt(NT,t,this._camera.up);for(let n=0;n<4;n++){const r=WT.copy(this._nearPlaneCorners[n]);r.applyMatrix4(rA);const i=VT.addVectors(this._target,r);iA.set(i,t),iA.far=this._spherical.radius+1;const o=iA.intersectObjects(this.colliderMeshes);0!==o.length&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise((e=>{const t=()=>{this.removeEventListener("rest",t),e()};this.addEventListener("rest",t)})))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new DT.Sphere,n=t.center;KT.makeEmpty(),e.traverseVisible((e=>{e.isMesh&&KT.expandByObject(e)})),KT.getCenter(n);let r=0;return e.traverseVisible((e=>{if(!e.isMesh)return;const t=e,i=t.geometry.clone();i.applyMatrix4(t.matrixWorld);const o=i.attributes.position;for(let e=0,t=o.count;e<t;e++)HT.fromBufferAttribute(o,e),r=Math.max(r,n.distanceToSquared(HT))})),t.radius=Math.sqrt(r),t}}class sA extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new AC(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){function t(e,t,n){for(let r=0,i=e.length;r<i;r++)if(e[r]!==t.getUint8(n+r))return!1;return!0}const n=function(e){if("string"==typeof e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t.buffer||t}return e}(e);return function(e){const n=new DataView(e);if(84+50*n.getUint32(80,!0)===n.byteLength)return!0;const r=[115,111,108,105,100];for(let e=0;e<5;e++)if(t(r,n,e))return!1;return!0}(n)?function(e){const t=new DataView(e),n=t.getUint32(80,!0);let r,i,o,s,a,l,c,u,h=!1;for(let e=0;e<70;e++)1129270351==t.getUint32(e,!1)&&82==t.getUint8(e+4)&&61==t.getUint8(e+5)&&(h=!0,s=new Float32Array(3*n*3),a=t.getUint8(e+6)/255,l=t.getUint8(e+7)/255,c=t.getUint8(e+8)/255,u=t.getUint8(e+9)/255);const d=new bv,p=new Float32Array(3*n*3),f=new Float32Array(3*n*3),m=new Kg;for(let e=0;e<n;e++){const n=84+50*e,u=t.getFloat32(n,!0),d=t.getFloat32(n+4,!0),g=t.getFloat32(n+8,!0);if(h){const e=t.getUint16(n+48,!0);0==(32768&e)?(r=(31&e)/31,i=(e>>5&31)/31,o=(e>>10&31)/31):(r=a,i=l,o=c)}for(let a=1;a<=3;a++){const l=n+12*a,c=3*e*3+3*(a-1);p[c]=t.getFloat32(l,!0),p[c+1]=t.getFloat32(l+4,!0),p[c+2]=t.getFloat32(l+8,!0),f[c]=u,f[c+1]=d,f[c+2]=g,h&&(m.set(r,i,o).convertSRGBToLinear(),s[c]=m.r,s[c+1]=m.g,s[c+2]=m.b)}}return d.setAttribute("position",new uv(p,3)),d.setAttribute("normal",new uv(f,3)),h&&(d.setAttribute("color",new uv(s,3)),d.hasColors=!0,d.alpha=u),d}(n):function(e){const t=new bv,n=/solid([\s\S]*?)endsolid/g,r=/facet([\s\S]*?)endfacet/g,i=/solid\s(.+)/;let o=0;const s=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,a=new RegExp("vertex"+s+s+s,"g"),l=new RegExp("normal"+s+s+s,"g"),c=[],u=[],h=[],d=new km;let p,f=0,m=0,g=0;for(;null!==(p=n.exec(e));){m=g;const e=p[0],n=null!==(p=i.exec(e))?p[1]:"";for(h.push(n);null!==(p=r.exec(e));){let e=0,t=0;const n=p[0];for(;null!==(p=l.exec(n));)d.x=parseFloat(p[1]),d.y=parseFloat(p[2]),d.z=parseFloat(p[3]),t++;for(;null!==(p=a.exec(n));)c.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),u.push(d.x,d.y,d.z),e++,g++;1!==t&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+o),3!==e&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+o),o++}const s=m,v=g-m;t.userData.groupNames=h,t.addGroup(s,v,f),f++}return t.setAttribute("position",new pv(c,3)),t.setAttribute("normal",new pv(u,3)),t}("string"!=typeof(r=e)?(new TextDecoder).decode(r):r);var r}}let aA=e=>{let t=(e=>{let t=bn(e,((e,t)=>{let n=(e=>{let t=(e=>{let t=e.geometry;return{cs:t.boundingSphere.center,rd:t.boundingSphere.radius}})(e);return{xmin:t.cs.x-t.rd,xmax:t.cs.x+t.rd,ymin:t.cs.y-t.rd,ymax:t.cs.y+t.rd,zmin:t.cs.z-t.rd,zmax:t.cs.z+t.rd}})(e);return n}));return{xmin:Gc(bn(t,"xmin")),xmax:Xc(bn(t,"xmax")),ymin:Gc(bn(t,"ymin")),ymax:Xc(bn(t,"ymax")),zmin:Gc(bn(t,"zmin")),zmax:Xc(bn(t,"zmax"))}})(e),n=t.xmax-t.xmin,r=t.ymax-t.ymin,i=t.zmax-t.zmin;return{cs:{x:(t.xmax+t.xmin)/2,y:(t.ymax+t.ymin)/2,z:(t.zmax+t.zmin)/2},rd:Xc([n,r,i])}};function lA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lA(Object(n),!0).forEach((function(t){Fs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}let uA=Math.PI/180,hA=180/Math.PI,dA=e=>e=Ds.toRgbString(e);async function pA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};il(e)||(e=[]);let n=me(t,"domPanel");Ii(n)||(n=document.body);let r=e=>{let t=0;if(nl(e.innerWidth))t=e.innerWidth;else{if(!nl(e.clientWidth))throw console.log("ele",e),new Error("can not get width from ele");t=e.clientWidth}let n=0;if(nl(e.innerWidth))n=e.innerHeight;else{if(!nl(e.clientWidth))throw console.log("ele",e),new Error("can not get height from ele");n=e.clientHeight}return{w:t,h:n}},i=r(n),o=i.w,s=i.h,a=me(t,"backgroundColor");ui(a)||(a="#222");let l=me(t,"useHelperAxes");el(l)||(l=!0);let c=me(t,"helperAxesLengthRatio");di(c)||(c=1),c=pi(c);let u=me(t,"useHelperGrid");el(u)||(u=!0);let h=me(t,"helperGridLengthRatio");di(h)||(h=5),h=pi(h);let d=me(t,"helperGridDensity");di(d)||(d=50),d=pi(d);let p=me(t,"helperGridPositionRatioZ");di(p)||(p=-1),p=pi(p);let f=me(t,"useLightAmbient");el(f)||(f=!0);let m=me(t,"lightAmbientColor");ui(m)||(m="#999");let g=me(t,"useLightPoint");el(g)||(g=!1);let v=me(t,"lightPointPoss");il(v)||(v=[[5,5,5],[-5,5,5],[5,-5,5]]);let y=me(t,"lightPointColor");ui(y)||(y="#fff");let _=me(t,"lightPointIntensity");di(_)||(_=100),_=pi(_);let x=me(t,"lightPointDistance");di(x)||(x=0),x=pi(x);let b=me(t,"lightPointDecay");di(b)||(b=2),b=pi(b);let S=me(t,"useLightDirection");el(S)||(S=!0);let w=me(t,"lightDirectionColor");ui(w)||(w="#fff");let C=me(t,"lightDirectionIntensity");di(C)||(C=3),C=pi(C);let M=me(t,"lightDirectionPos");il(M)||(M=[10,10,10]);let T=me(t,"cameraType");"perspective"!==T&&"orthographic"!==T&&(T="perspective");let A=me(t,"cameraFov");di(A)||(A=35),A=pi(A);let E=me(t,"cameraNear");di(E)||(E=.1),E=pi(E);let R=me(t,"cameraFar");di(R)||(R=1e3),R=pi(R);let L=me(t,"cameraOrthographicRatio");di(L)||(L=.5),L=pi(L);let P=me(t,"cameraPos");il(P)||(P=[1,1,1]);let I=me(t,"cameraAzimuthAngle");di(I)||(I=130),I=pi(I);let O=me(t,"cameraPolarAngle");di(O)||(O=50),O=pi(O);let k=me(t,"labelTextColor");ui(k)||(k="#fff");let B=me(t,"labelTextFontFamily");ui(B)||(B="Microsoft JhengHei");let D=me(t,"labelTextFontSize");ui(D)||(D="0.8rem");let N=me(t,"useAutoRotate");el(N)||(N=!1);let U=me(t,"autoRotateDeg");di(U)||(U=20),U=pi(U);let F=Vs(),z=new sM,H=new $x;H.background=new Kg(dA(a));let W=null,V=()=>{W=new QM(c),W.visible=l,H.add(W)},G=()=>{H.remove(W),W.dispose(),W=null};V();let j=null,X=()=>{j=new WM(h,d),j.visible=u,j.geometry.rotateX(.5*Math.PI),j.geometry.translate(0,0,p),H.add(j)},$=()=>{H.remove(j),j.dispose(),j=null};X();let Y=null;Y=new GC(dA(m)),Y.visible=f,H.add(Y);let q=null,Z=()=>{q=[],nt(v,(e=>{let t=new HC(dA(y),_,x,b);t.visible=g;let n=me(e,0,0),r=me(e,1,0),i=me(e,2,0);t.position.set(n,r,i),H.add(t),q.push(t)}))},J=()=>{nt(q,(e=>{H.remove(e),e.dispose(),e=null})),q=null};Z();let K=null,Q=()=>{K=new VC(dA(w),C),K.visible=S;let e=me(M,0,0),t=me(M,1,0),n=me(M,2,0);K.position.set(e,t,n),H.add(K)},ee=()=>{H.remove(K),K.dispose(),K=null};Q();let te=(e,t)=>{let n=1;return t>0&&(n=e/t),n},ne=te(o,s),re=null,ie=()=>{(e=>{let t=e*s,n=o,r=s-t,i=-t,a=o,l=s;re.setViewOffset(n,r,0,i,a,l)})(-.08)},oe=()=>{"perspective"===T?re=new Yv(A,ne,E,R):"orthographic"===T&&(re=new _y(-L*ne,L*ne,L,-L,E,R)),(e=>{let t=me(e,0,0),n=me(e,1,0),r=me(e,2,0);re.position.set(t,n,r)})(P),re.up.x=0,re.up.y=0,re.up.z=1,ie()},se=()=>{re=null};oe();let ae=new Vx({antialias:!0});ae.setSize(o,s),n.appendChild(ae.domElement);let le=new aT;le.setSize(o,s),le.domElement.style.position="absolute",le.domElement.style.top="0px",le.domElement.style.left="0px",n.appendChild(le.domElement),oA.install({THREE:eT});let ce=null,ue=()=>{ce=new oA(re,le.domElement),ce.mouseButtons={left:oA.ACTION.ROTATE,middle:oA.ACTION.DOLLY,right:oA.ACTION.OFFSET,wheel:oA.ACTION.ZOOM},ce.touches={one:oA.ACTION.TOUCH_ROTATE,two:oA.ACTION.TOUCH_DOLLY_OFFSET,three:oA.ACTION.TOUCH_OFFSET}},he=()=>{ce=null};ue();let de=()=>{let e=me(ce,"azimuthAngle"),t=me(ce,"polarAngle");return{azimuthAngle:e*hA,polarAngle:t*hA}},pe=(e,t)=>{Fd(ce,"azimuthAngle",e*uA),Fd(ce,"polarAngle",t*uA)};pe(I,O);let fe=null,ge=setInterval((()=>{let e=de();tr(e,fe)||(fe=e,F.emit("change-view-angle",e))}),50),ve=null,ye=()=>{ve=new Nx,H.add(ve)},_e=()=>{ve.traverse((function(e){e.isMesh&&(e.geometry.dispose(),e.material.dispose())})),H.remove(ve),ve=null};ye();let xe=[],be=async e=>{let t=me(e,"type","");if(ui(t)||(t=function(e){if(!ui(e))return"";let t=ka(Wd(e),".");if(xo(t)<=1)return"";let n="";try{n=ll(t)}catch(e){}return n}(e.url)),"stl"!==t)throw new Error("現在僅支援stl檔");let n=me(e,"color",""),r=Ds.toRgba(n),i=Ds.toRgbString(r),o=r.a,s=await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=me(n,"color",null);ui(r)||(r="#fff"),r=Ds.toRgbString(r);let i=me(n,"opacity",null);nl(i)||(i=1);let o=i<1,s=new sA,a=await s.loadAsync(t,(n=>{let r=n.loaded/n.total*100;e.emit("loading",{url:t,prog:r})})),l=new Kw({color:new Kg(r),depthTest:!0,depthWrite:!0,transparent:o,opacity:i,side:2});return new Fv(a,l)}(F,e.url,{color:i,opacity:o});s.name=e.name,s.color=n,xe.push(s),ve.add(s)},Se=async e=>{await zd(e,(async e=>{await be(e)}))};await Se(e);let we={},Ce=()=>{nt(xe,(e=>{let t=e.geometry,n=1/we.r;t.scale(n,n,n),t.translate(we.x,we.y,we.z)}))},Me=[],Te=()=>{nt(Me,(e=>{Za(e)})),Me=[]},Ae=async()=>{Re(),await Oi(1),(()=>{let e=aA(xe),t=e.cs,n=1;e.rd>0&&(n=1/e.rd),we=cA(cA({},t),{},{r:n})})(),nt(xe,(e=>{let t=e.geometry;t.translate(-we.x,-we.y,-we.z),t.scale(we.r,we.r,we.r)})),nt(xe,(e=>{let t=document.createElement("div");t.textContent=e.name,t.style.color=k,t.style.fontSize=D,t.style.fontFamily=B,t.style.visibility="visible";let n=new tT(t),r=e.geometry.boundingSphere.center;n.position.set(r.x,r.y,r.z),Me.push(t),e.add(n)})),Re()},Ee=(e,t)=>{if(!Ii(me(Me,e)))return null;try{let n="hidden";!0===t&&(n="visible"),Me[e].style.visibility=n}catch(e){console.log(e)}},Re=()=>{try{ae.render(H,re),le.render(H,re)}catch(e){console.log(e)}};Ae().then((()=>{F.emit("init")}));let Le=!1,Pe=()=>{if(!Le)try{let e=z.getDelta(),t=ce.update(e);if(N){let t=-U*uA*e;ce.azimuthAngle+=t}requestAnimationFrame(Pe),t&&Re()}catch(e){console.log(e)}};Pe();return F.render=Re,F.resize=()=>{let e=r(n);o=e.w,s=e.h,ne=te(o,s),re.aspect=ne,re.updateProjectionMatrix(),ie(),ae.setSize(o,s),le.setSize(o,s),Re()},F.dispose=()=>{F.emit("dispose"),clearInterval(ge),Le=!0,_e(),G(),$(),H.remove(Y),Y.dispose(),Y=null,J(),ee(),Te(),(()=>{let e=e=>{e.dispose();for(let t of Object.keys(e)){let n=e[t];n&&"object"==typeof n&&"minFilter"in n&&n.dispose()}};H.traverse((t=>{if(t.isLight&&t.dispose(),t.isMesh)if(t.geometry.dispose(),t.material.isMaterial)e(t.material);else for(let n of t.material)e(n)})),H=null})(),Za(ae.domElement),Za(le.domElement),ae.dispose(),ae=null,le=null,z=null,he(),se(),H=null},F.getUseAutoRotate=()=>N,F.setUseAutoRotate=e=>{N=e},F.setAutoRotateDeg=e=>{U=e},F.setCameraViewAngle=pe,F.getCameraViewAngle=de,F.setCameraAzimuthAngle=e=>{I=e,pe(I,O)},F.setCameraPolarAngle=e=>{O=e,pe(I,O)},F.setBackgroundColor=e=>{a=e,H.background=new Kg(dA(e)),Re()},F.getUseHelperAxes=()=>l,F.setUseHelperAxes=e=>{l=e,W.visible=e,Re()},F.setHelperAxesLengthRatio=e=>{c=e,G(),V(),Re()},F.getUseHelperGrid=()=>u,F.setUseHelperGrid=e=>{u=e,j.visible=e,Re()},F.setHelperGridLengthRatio=e=>{h=e,$(),X(),Re()},F.setHelperGridDensity=e=>{d=e,$(),X(),Re()},F.setHelperGridPositionRatioZ=e=>{p=e,$(),X(),Re()},F.setUseLightAmbient=e=>{f=e,Y.visible=e,Re()},F.setLightAmbientColor=e=>{m=e,Y.color=new Kg(dA(e)),Re()},F.setUseLightPoint=e=>{g=e,nt(q,(t=>{t.visible=e})),Re()},F.setLightPointPoss=e=>{v=e,J(),Z(),Re()},F.setLightPointColor=e=>{y=e,J(),Z(),Re()},F.setLightPointIntensity=e=>{_=e,J(),Z(),Re()},F.setLightPointDistance=e=>{x=e,J(),Z(),Re()},F.setLightPointDecay=e=>{b=e,J(),Z(),Re()},F.setUseLightDirection=e=>{S=e,K.visible=e,Re()},F.setLightDirectionColor=e=>{w=e,K.color=new Kg(dA(e)),Re()},F.setLightDirectionIntensity=e=>{C=e,ee(),Q(),Re()},F.setLightDirectionPos=e=>{M=e,ee(),Q(),Re()},F.getCameraType=()=>T,F.setCameraType=e=>{T=e,se(),oe(),he(),ue(),Re()},F.setCameraFov=e=>{A=e,re.fov=e,re.updateProjectionMatrix(),Re()},F.setCameraNear=e=>{E=e,re.near=e,re.updateProjectionMatrix(),Re()},F.setCameraFar=e=>{R=e,re.far=e,re.updateProjectionMatrix(),Re()},F.setCameraOrthographicRatio=e=>{L=e,se(),oe(),he(),ue(),Re()},F.addMesh=async e=>{Ce(),Te(),await be(e),Ae()},F.addMeshs=async e=>{Ce(),Te(),await Se(e),Ae()},F.getMeshsInfor=()=>{let e=bn(xe,((e,t)=>{let n=me(e,"color",""),r=me(Me,t),i=me(r,"textContent",""),o=me(r,"style.color",""),s=me(r,"style.fontSize",""),a=me(r,"style.fontFamily","");return{visible:e.visible,color:n,labelText:i,labelTextColor:o,labelTextFontSize:s,labelTextFontFamily:a}}));return e},F.setMeshVisible=(e,t)=>{((e,t)=>{if(!Ci(me(xe,e)))return null;try{xe[e].visible=t}catch(e){console.log(e)}})(e,t),Ee(e,t),Re()},F.setMeshColor=(e,t)=>{if(!Ci(me(xe,e)))return null;try{let n=Ds.toRgba(t),r=Ds.toRgbString(n),i=n.a;xe[e].material.color=new Kg(r),xe[e].material.opacity=i,xe[e].color=t}catch(e){console.log(e)}Re()},F.setMeshLabelVisible=(e,t)=>{Ee(e,t),Re()},F.setMeshLabelText=(e,t)=>{if(!Ii(me(Me,e)))return null;try{Me[e].textContent=t}catch(e){console.log(e)}Re()},F.setMeshLabelTextColor=(e,t)=>{if(!Ii(me(Me,e)))return null;try{Me[e].style.color=t}catch(e){console.log(e)}Re()},F.setMeshLabelTextFontSize=(e,t)=>{if(!Ii(me(Me,e)))return null;try{Me[e].style.fontSize=t}catch(e){console.log(e)}Re()},F.setMeshLabelTextFontFamily=(e,t)=>{if(!Ii(me(Me,e)))return null;try{Me[e].style.fontFamily=t}catch(e){console.log(e)}Re()},F.cleanMeshs=()=>{nt(xe,(e=>{ve.remove(e)})),_e(),xe=[],ye(),Te(),Re()},F}const fA={directives:{domresize:qs()},components:{WIconLoading:ja,WGroupIconCheck:Uc,WIcon:al,WColorSelect:Ud},props:{opt:{type:Object,default:()=>{}}},data:function(){return{mdiEyeOutline:"M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z",mdiEyeOffOutline:"M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z",loading:!0,timer:null,itemsSelectIds:[],itemsSelects:[],useSetting:!0,useAutoRotate:!1,useHelperAxes:!0,useHelperGrid:!0,usePerspective:!0,useLegend:!0,optTemp:null,meshs:[],ev:null,menuSettingIcon:"",menuSettingTooltip:"",menuAutoRotateIcon:"",menuAutoRotateTooltip:"",menuAxesIcon:"",menuAxesTooltip:"",menuGridIcon:"",menuGridTooltip:"",menuPerspectiveIcon:"",menuPerspectiveTooltip:"",menuLegendIcon:"",menuLegendTooltip:"",useLegnedBackgroundColor:"",useLegnedHeight:""}},mounted:function(){let e,t=this;t.timer=setInterval((()=>{e=t.getParam("useHelperAxes"),t.useHelperAxes!==e&&(t.useHelperAxes=e),e=t.getParam("useAutoRotate"),t.useAutoRotate!==e&&(t.useAutoRotate=e),e=t.getParam("useHelperGrid"),t.useHelperGrid!==e&&(t.useHelperGrid=e),e="perspective"===t.getParam("cameraType"),t.usePerspective!==e&&(t.usePerspective=e),e=t.getMeshs(),tr(t.meshs,e)||(t.meshs=e),t.syncItemsSelectIds(),t.updateItemsSelects(!1)}),50)},beforeDestroy:function(){clearInterval(this.timer),this.dispose()},watch:{opt:{handler(e){let t=this;t.loading?t.init().finally((()=>{t.optTemp=si(t.opt)})):t.modify().finally((()=>{t.optTemp=si(t.opt)}))},immediate:!0,deep:!0}},computed:{widthInp:function(){let e=0,t=me(this,"opt.width","");return di(t)&&(e=pi(t)),e},heightInp:function(){let e=0,t=me(this,"opt.height","");return di(t)&&(e=pi(t)),e},items:function(){let e=this;return[{id:"setting",icon:e.menuSettingIcon,tooltip:e.menuSettingTooltip},{id:"auto_rotate",icon:e.menuAutoRotateIcon,tooltip:e.menuAutoRotateTooltip},{id:"axes",icon:e.menuAxesIcon,tooltip:e.menuAxesTooltip},{id:"grid",icon:e.menuGridIcon,tooltip:e.menuGridTooltip},{id:"perspective",icon:e.menuPerspectiveIcon,tooltip:e.menuPerspectiveTooltip},{id:"legend",icon:e.menuLegendIcon,tooltip:e.menuLegendTooltip}]},useItems:function(){let e=this,t=[];return t=e.useSetting?si(e.items):[si(e.items[0])],t}},methods:{resizePanel:function(e){let t=this;if(null===t.ev)return;let n=me(t,"ev.resize");li(n)&&(n(),t.$emit("resize",e))},syncItemsSelectIds:function(){let e=this,t=[];e.useSetting&&t.push("setting"),e.useAutoRotate&&t.push("auto_rotate"),e.useHelperAxes&&t.push("axes"),e.useHelperGrid&&t.push("grid"),e.usePerspective&&t.push("perspective"),e.useLegend&&t.push("legend"),tr(e.itemsSelectIds,t)||(e.itemsSelectIds=t)},updateItemsSelects:function(e=!1){let t=this,n=bn(t.itemsSelects,"id");if(!e&&tr(t.itemsSelectIds,n))return;let r=[];nt(t.itemsSelectIds,(e=>{let n=Un(t.items,{id:e});Ci(n)?r.push(n):console.log(`invalid id[${e}]`)})),t.itemsSelects=r},updateMenus:function(){let e=this,t=me(e,"opt.menuSettingIcon","");ui(t)||(t="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z");let n=me(e,"opt.menuSettingTooltip","");ui(n)||(n="Settings");let r=me(e,"opt.menuAutoRotateIcon","");ui(r)||(r="M10,12L14,16L10,20V16.9C5.44,16.44 2,14.42 2,12C2,9.58 5.44,7.56 10,7.1V9.09C6.55,9.43 4,10.6 4,12C4,13.4 6.55,14.57 10,14.91V12M20,12C20,10.6 17.45,9.43 14,9.09V7.1C18.56,7.56 22,9.58 22,12C22,14.16 19.26,16 15.42,16.7L16.12,16L14.92,14.79C17.89,14.36 20,13.27 20,12M11,2H13V13L11,11V2M11,22V21L13,19V22H11Z");let i=me(e,"opt.menuAutoRotateTooltip","");ui(i)||(i="Auto rotate");let o=me(e,"opt.menuAxesIcon","");ui(o)||(o="M2.61,21L1.61,19.27L11,13.85V3H13V13.85L22.39,19.27L21.39,21L12,15.58L2.61,21Z");let s=me(e,"opt.menuAxesTooltip","");ui(s)||(s="Axes");let a=me(e,"opt.menuGridIcon","");ui(a)||(a="M10,4V8H14V4H10M16,4V8H20V4H16M16,10V14H20V10H16M16,16V20H20V16H16M14,20V16H10V20H14M8,20V16H4V20H8M8,14V10H4V14H8M8,8V4H4V8H8M10,14H14V10H10V14M4,2H20A2,2 0 0,1 22,4V20A2,2 0 0,1 20,22H4C2.92,22 2,21.1 2,20V4A2,2 0 0,1 4,2Z");let l=me(e,"opt.menuGridTooltip","");ui(l)||(l="Grid");let c=me(e,"opt.menuPerspectiveIcon","");ui(c)||(c="M20 2H4C3.45 2 3 2.45 3 3V4C3 4.55 3.45 5 4 5H5V14H11V16.59L6.79 20.79L8.21 22.21L11 19.41V22H13V19.41L15.79 22.21L17.21 20.79L13 16.59V14H19V5H20C20.55 5 21 4.55 21 4V3C21 2.45 20.55 2 20 2M17 12H7V5H17V12Z");let u=me(e,"opt.menuPerspectiveTooltip","");ui(u)||(u="Perspective");let h=me(e,"opt.menuLegendIcon","");ui(h)||(h="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z");let d=me(e,"opt.menuLegendTooltip","");ui(d)||(d="Legend"),e.menuSettingIcon=t,e.menuSettingTooltip=n,e.menuAutoRotateIcon=r,e.menuAutoRotateTooltip=i,e.menuAxesIcon=o,e.menuAxesTooltip=s,e.menuGridIcon=a,e.menuGridTooltip=l,e.menuPerspectiveIcon=c,e.menuPerspectiveTooltip=u,e.menuLegendIcon=h,e.menuLegendTooltip=d,e.updateItemsSelects(!0)},refreshLegend:function(){let e=this,t=me(e,"opt.legnedBackgroundColor","");ui(t)||(t="rgba(90,90,90,0.5)"),e.useLegnedBackgroundColor=Ds.toRgbaString(t);let n=me(e,"opt.legnedHeight",null),r=me(e,"opt.legnedHeightMax",null),i="";di(n)&&(n=pi(n),i+=`height:${n}px;`),di(r)&&(r=pi(r),i+=`max-height:${r}px;`),(di(n)||di(r))&&(i+="overflow-y:auto;"),e.useLegnedHeight=i},init:async function(){let e=this;await async function(){e.dispose(),await bi((()=>Ii(e.$refs.panel))),e.loading=!0;let t=si(e.opt);t.domPanel=e.$refs.panel;let n=me(t,"items",[]),r=await pA(n,t);r.on("init",(()=>{e.$emit("init"),e.updateMenus(),e.refreshLegend(),e.loading=!1})),r.on("loading",(t=>{e.$emit("loading",t)})),r.on("dispose",(()=>{e.$emit("dispose")})),r.on("change-view-angle",(t=>{e.$emit("change-view-angle",t)})),e.ev=r}().catch((e=>{console.log(e)}))},modify:async function(){let e=this;await async function(){if(null===e.ev)return;await Oi(300);let t=Ke(e.opt),n=Ke(e.optTemp),r=[];nt(t,(t=>{let i=me(e,`opt.${t}`,null),o=me(e,`optTemp.${t}`,null);tr(i,o)||r.push({type:"mod",k:t,vOld:o,vNew:i}),er(n,t)})),nt(n,(t=>{let n=me(e,`optTemp.${t}`,null);r.push({type:"del",k:t,vOld:n,vNew:null})}));let i={backgroundColor:"ev.setBackgroundColor",useAutoRotate:"ev.setUseAutoRotate",autoRotateDeg:"ev.setAutoRotateDeg",useHelperAxes:"ev.setUseHelperAxes",helperAxesLengthRatio:"ev.setHelperAxesLengthRatio",useHelperGrid:"ev.setUseHelperGrid",helperGridLengthRatio:"ev.setHelperGridLengthRatio",helperGridDensity:"ev.setHelperGridDensity",helperGridPositionRatioZ:"ev.setHelperGridPositionRatioZ",useLightAmbient:"ev.setUseLightAmbient",lightAmbientColor:"ev.setLightAmbientColor",useLightPoint:"ev.setUseLightPoint",lightPointPoss:"ev.setLightPointPoss",lightPointColor:"ev.setLightPointColor",lightPointIntensity:"ev.setLightPointIntensity",lightPointDistance:"ev.setLightPointDistance",lightPointDecay:"ev.setLightPointDecay",useLightDirection:"ev.setUseLightDirection",lightDirectionColor:"ev.setLightDirectionColor",lightDirectionIntensity:"ev.setLightDirectionIntensity",lightDirectionPos:"ev.setLightDirectionPos",cameraType:"ev.setCameraType",cameraFov:"ev.setCameraFov",cameraNear:"ev.setCameraNear",cameraFar:"ev.setCameraFar",cameraOrthographicRatio:"ev.setCameraOrthographicRatio",cameraAzimuthAngle:"ev.setCameraAzimuthAngle",cameraPolarAngle:"ev.setCameraPolarAngle",menuSettingIcon:"updateMenus",menuSettingTooltip:"updateMenus",menuAutoRotateIcon:"updateMenus",menuAutoRotateTooltip:"updateMenus",menuAxesIcon:"updateMenus",menuAxesTooltip:"updateMenus",menuGridIcon:"updateMenus",menuGridTooltip:"updateMenus",menuPerspectiveIcon:"updateMenus",menuPerspectiveTooltip:"updateMenus",menuLegendIcon:"updateMenus",menuLegendTooltip:"updateMenus",legnedBackgroundColor:"refreshLegend",legnedHeight:"refreshLegend",legnedHeightMax:"refreshLegend"};nt(r,(t=>{let n=t.k;if(wi(i,n)){let r=me(e,i[n]);try{r(t.vNew)}catch(e){console.log(e)}}else console.log(`尚未建置 ${n} 之 set 函數`)}))}().catch((e=>{console.log(e)}))},dispose:function(){let e=this;setTimeout((()=>{if(null===e.ev)return;li(me(e,"ev.dispose"))&&(e.ev.dispose(),e.ev=null)}),1)},getInst:function(){return me(this,"ev")},getMeshs:function(){let e=me(this,"ev.getMeshsInfor"),t=[];return li(e)&&(t=e()),t},getMeshColor:function(e){let t=me(e,"color","");return t=Ds.toRgbaString(t),t},setMeshColor:function(e,t,n){this.ev.setMeshColor(t,n)},toggleMeshVisible:function(e,t){this.ev.setMeshVisible(t,!e.visible)},strUpperHead:function(e){let t=Bi(e,1);return t=Fn(t),`${t}${Ni(e,1)}`},getParam:function(e){let t=null,n=me(this,`ev.get${e=this.strUpperHead(e)}`);return li(n)&&(t=n()),t},setParam:function(e,t){let n=me(this,`ev.set${e=this.strUpperHead(e)}`);li(n)&&n(t)},toggleParam:function(e){let t=this.getParam(e);t=!t,this.setParam(e,t)},ckItem:function(e){let t=this,n={setting:()=>{t.useSetting=!t.useSetting},axes:()=>{t.toggleParam("useHelperAxes")},auto_rotate:()=>{t.toggleParam("useAutoRotate")},grid:()=>{t.toggleParam("useHelperGrid")},perspective:()=>{t.usePerspective?t.setParam("cameraType","orthographic"):t.setParam("cameraType","perspective")},legend:()=>{t.useLegend=!t.useLegend}},r=me(e,"id",""),i=me(n,r);li(i)?i():(console.log("item",e),console.log("kp",n),console.log(`invalid id[${r}]`))}}};var mA=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; width:"+e.widthInp+"px; min-width:"+e.widthInp+"px; height:"+e.heightInp+"px; overflow-y:hidden;"},[e.loading?n("div",{staticStyle:{position:"relative",width:"0px",height:"0px"}},[n("div",{staticStyle:{position:"absolute",top:"0px",left:"0px"}},[n("WIconLoading")],1)]):e._e(),e._v(" "),n("div",{staticStyle:{position:"relative"}},[n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],ref:"panel",style:"position:relative; width:"+e.widthInp+"px; height:"+e.heightInp+"px; opacity:"+(e.loading?0:1)+";",on:{domresize:e.resizePanel}}),e._v(" "),e.loading?e._e():n("div",{style:"position:absolute; top:0px; left:0px;"},[n("div",{staticStyle:{padding:"10px",display:"flex","align-items":"flex-start"}},[n("WGroupIconCheck",{attrs:{items:e.useItems,dir:"vertical",iconColor:"#aaa",iconColorHover:"#ccc",iconColorFocus:"#ccc",iconColorActive:"#fff",backgroundColor:"#000",backgroundColorHover:"#111",backgroundColorFocus:"#111",backgroundColorActive:"#444",seplineColor:"#333",tooltipTextFontSize:"0.7rem",value:e.itemsSelects,_input:"updateItem"},on:{click:e.ckItem}}),e._v(" "),e.useLegend?[n("div",{style:"padding-left:10px;"}),e._v(" "),n("div",{style:"padding:5px; border-radius:4px; background:"+e.useLegnedBackgroundColor+";"},[n("div",{style:""+e.useLegnedHeight},e._l(e.meshs,(function(t,r){return n("div",{key:"km-"+r,style:""},[n("div",{staticStyle:{display:"flex","align-items":"center",padding:"3px"}},[n("WIcon",{staticStyle:{cursor:"pointer"},attrs:{icon:t.visible?e.mdiEyeOutline:e.mdiEyeOffOutline,color:"#ccc",colorHover:"#ddd",size:20},on:{click:function(n){return e.toggleMeshVisible(t,r)}}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WColorSelect",{attrs:{colorBlockBorderColor:"#888",showColorText:!1,_colorTextColor:"'#ddd'",panelBackgroundColor:"#111",toolBackgroundColor:"#222",menuIconColor:"#666",menuIconColorHover:"#777",menuIconColorActive:"#ddd",borderColor:"#333",borderColorHover:"#333",borderColorActive:"#444",backgroundColor:"#111",menuBackgroundColor:"#111",menuBackgroundColorHover:"#222",menuBackgroundColorActive:"#333",menuTextColor:"#b2b2b2",menuTextColorHover:"#ccc",menuTextColorActive:"#ddd",menuTextFontSize:"0.75rem",inputBorderColor:"#444",inputBorderColorHover:"#555",inputBorderColorActive:"#666",inputBackgroundColor:"#000",inputBackgroundColorHover:"#111",inputBackgroundColorActive:"#222",inputTextColor:"#999",inputLabelColor:"#888",barProgColor:"#888",barProgBackgroundColor:"#222",barSliderBackgroundColor:"#ccc",barSliderBackgroundColorHover:"#ddd",btnTextColor:"#eee",btnTextColorHover:"#fff",btnTextColorActive:"#fff",btnBackgroundColor:"#444",btnBackgroundColorHover:"#555",btnBackgroundColorActive:"#555",value:e.getMeshColor(t)},on:{input:function(n){e.setMeshColor(t,r,n)}}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("div",{style:"color:"+t.labelTextColor+"; font-size:"+t.labelTextFontSize+"; font-family:"+t.labelTextFontFamily+";"},[e._v("\n "+e._s(t.labelText)+"\n ")])],1)])})),0)])]:e._e()],2)])])])};mA._withStripped=!0;return Ua({render:mA,staticRenderFns:[]},(function(e){e&&e("data-v-2b0552f9_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WThreejsVue.vue"},media:void 0})}),fA,"data-v-2b0552f9",false,undefined,!1,za,void 0,void 0)}));
25
+ */const lT=1,cT=2,uT=4,hT=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),dT=0,pT=1,fT=-1;function mT(e){return e.isPerspectiveCamera}function gT(e){return e.isOrthographicCamera}const vT=2*Math.PI,yT=Math.PI/2,_T=1e-5,xT=Math.PI/180;function bT(e,t,n){return Math.max(t,Math.min(n,e))}function ST(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_T;return Math.abs(e)<t}function wT(e,t){return ST(e-t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:_T)}function CT(e,t){return Math.round(e/t)*t}function MT(e){return isFinite(e)?e:e<0?-Number.MAX_VALUE:Number.MAX_VALUE}function TT(e){return Math.abs(e)<Number.MAX_VALUE?e:e*(1/0)}function AT(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,o=arguments.length>5?arguments[5]:void 0;const s=2/(r=Math.max(1e-4,r)),a=s*o,l=1/(1+a+.48*a*a+.235*a*a*a);let c=e-t;const u=t,h=i*r;c=bT(c,-h,h),t=e-c;const d=(n.value+s*c)*o;n.value=(n.value-s*d)*l;let p=t+(c+d)*l;return u-e>0==p>u&&(p=u,n.value=(p-u)/o),p}function ET(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;const a=2/(r=Math.max(1e-4,r)),l=a*o,c=1/(1+l+.48*l*l+.235*l*l*l);let u=t.x,h=t.y,d=t.z,p=e.x-u,f=e.y-h,m=e.z-d;const g=u,v=h,y=d,_=i*r,x=p*p+f*f+m*m;if(x>_*_){const e=Math.sqrt(x);p=p/e*_,f=f/e*_,m=m/e*_}u=e.x-p,h=e.y-f,d=e.z-m;const b=(n.x+a*p)*o,S=(n.y+a*f)*o,w=(n.z+a*m)*o;n.x=(n.x-a*b)*c,n.y=(n.y-a*S)*c,n.z=(n.z-a*w)*c,s.x=u+(p+b)*c,s.y=h+(f+S)*c,s.z=d+(m+w)*c;const C=g-e.x,M=v-e.y,T=y-e.z;return C*(s.x-g)+M*(s.y-v)+T*(s.z-y)>0&&(s.x=g,s.y=v,s.z=y,n.x=(s.x-g)/o,n.y=(s.y-v)/o,n.z=(s.z-y)/o),s}function RT(e,t){t.set(0,0),e.forEach((e=>{t.x+=e.clientX,t.y+=e.clientY})),t.x/=e.length,t.y/=e.length}function LT(e,t){return!!gT(e)&&(console.warn(`${t} is not supported in OrthographicCamera`),!0)}class PT{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}removeAllEventListeners(e){e?Array.isArray(this._listeners[e])&&(this._listeners[e].length=0):this._listeners={}}dispatchEvent(e){const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e)}}}const IT=1/8,OT="undefined"!=typeof window,kT=OT&&/Mac/.test(navigator.platform),BT=!(OT&&"PointerEvent"in window);let DT,NT,UT,FT,zT,HT,WT,VT,GT,jT,XT,$T,YT,qT,ZT,JT,KT,QT,eA,tA,nA,rA,iA;class oA extends PT{static install(e){DT=e.THREE,NT=Object.freeze(new DT.Vector3(0,0,0)),UT=Object.freeze(new DT.Vector3(0,1,0)),FT=Object.freeze(new DT.Vector3(0,0,1)),zT=new DT.Vector2,HT=new DT.Vector3,WT=new DT.Vector3,VT=new DT.Vector3,GT=new DT.Vector3,jT=new DT.Vector3,XT=new DT.Vector3,$T=new DT.Vector3,YT=new DT.Vector3,qT=new DT.Vector3,ZT=new DT.Spherical,JT=new DT.Spherical,KT=new DT.Box3,QT=new DT.Box3,eA=new DT.Sphere,tA=new DT.Quaternion,nA=new DT.Quaternion,rA=new DT.Matrix4,iA=new DT.Raycaster}static get ACTION(){return hT}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=hT.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=dT,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new DT.Vector3,this._focalOffsetVelocity=new DT.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,n)=>{let r,i;if(mT(this._camera)){const n=HT.copy(this._camera.position).sub(this._target),o=this._camera.getEffectiveFOV()*xT,s=n.length()*Math.tan(.5*o);r=this.truckSpeed*e*s/this._elementRect.height,i=this.truckSpeed*t*s/this._elementRect.height}else{if(!gT(this._camera))return;{const n=this._camera;r=e*(n.right-n.left)/n.zoom/this._elementRect.width,i=t*(n.top-n.bottom)/n.zoom/this._elementRect.height}}this.verticalDragToForward?(n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(r,0,!0),this.forward(-i,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y+i,this._focalOffsetEnd.z,!0):this.truck(r,i,!0)},this._rotateInternal=(e,t)=>{const n=vT*this.azimuthRotateSpeed*e/this._elementRect.height,r=vT*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)},this._dollyInternal=(e,t,n)=>{const r=Math.pow(.95,-e*this.dollySpeed),i=this._sphericalEnd.radius,o=this._sphericalEnd.radius*r,s=bT(o,this.minDistance,this.maxDistance),a=s-o;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(o,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(a,!0),this._dollyToNoClamp(s,!0)):this._dollyToNoClamp(s,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?o:s)-i,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)},this._zoomInternal=(e,t,n)=>{const r=Math.pow(.95,e*this.dollySpeed),i=this._zoom,o=this._zoom*r;this.zoomTo(o,!0),this.dollyToCursor&&(this._changedZoom+=o-i,this._dollyControlCoord.set(t,n))},void 0===DT&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=(new DT.Quaternion).setFromUnitVectors(this._camera.up,UT),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=hT.NONE,this._target=new DT.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new DT.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=(new DT.Spherical).setFromVector3(HT.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new DT.Vector3,new DT.Vector3,new DT.Vector3,new DT.Vector3],this._updateNearPlaneCorners(),this._boundary=new DT.Box3(new DT.Vector3(-1/0,-1/0,-1/0),new DT.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new DT.Vector2,this.mouseButtons={left:hT.ROTATE,middle:hT.DOLLY,right:hT.TRUCK,wheel:mT(this._camera)?hT.DOLLY:gT(this._camera)?hT.ZOOM:hT.NONE},this.touches={one:hT.TOUCH_ROTATE,two:mT(this._camera)?hT.TOUCH_DOLLY_TRUCK:gT(this._camera)?hT.TOUCH_ZOOM_TRUCK:hT.NONE,three:hT.TOUCH_TRUCK};const n=new DT.Vector2,r=new DT.Vector2,i=new DT.Vector2,o=e=>{if(!this._enabled||!this._domElement)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}const t="mouse"!==e.pointerType?null:(e.buttons&lT)===lT?lT:(e.buttons&uT)===uT?uT:(e.buttons&cT)===cT?cT:null;if(null!==t){const e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}if((e.buttons&lT)===lT&&this._lockedPointer)return;const n={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",c),this._isDragging=!0,f(e)},s=e=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}const t=(e.buttons&lT)===lT?lT:(e.buttons&uT)===uT?uT:(e.buttons&cT)===cT?cT:null;if(null!==t){const e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}const n={pointerId:1,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:(e.buttons&lT)===lT?lT:(e.buttons&uT)===lT?uT:(e.buttons&cT)===lT?cT:null};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",u),this._isDragging=!0,f(e)},a=e=>{e.cancelable&&e.preventDefault();const t=e.pointerId,n=this._lockedPointer||this._findPointerById(t);if(n){if(n.clientX=e.clientX,n.clientY=e.clientY,n.deltaX=e.movementX,n.deltaY=e.movementY,this._state=0,"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(e.buttons&lT)===lT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right);m()}},l=e=>{const t=this._lockedPointer||this._findPointerById(1);t&&(t.clientX=e.clientX,t.clientY=e.clientY,t.deltaX=e.movementX,t.deltaY=e.movementY,this._state=0,(this._lockedPointer||(e.buttons&lT)===lT)&&(this._state=this._state|this.mouseButtons.left),(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right),m())},c=e=>{const t=this._findPointerById(e.pointerId);if(!t||t!==this._lockedPointer){if(t&&this._disposePointer(t),"touch"===e.pointerType)switch(this._activePointers.length){case 0:this._state=hT.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=hT.NONE;g()}},u=()=>{const e=this._findPointerById(1);e&&e===this._lockedPointer||(e&&this._disposePointer(e),this._state=hT.NONE,g())};let h=-1;const d=e=>{if(!this._domElement)return;if(!this._enabled||this.mouseButtons.wheel===hT.NONE)return;if(0!==this._interactiveArea.left||0!==this._interactiveArea.top||1!==this._interactiveArea.width||1!==this._interactiveArea.height){const t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(n<this._interactiveArea.left||n>this._interactiveArea.right||r<this._interactiveArea.top||r>this._interactiveArea.bottom)return}if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===hT.ROTATE||this.mouseButtons.wheel===hT.TRUCK){const e=performance.now();h-e<1e3&&this._getClientRect(this._elementRect),h=e}const t=kT?-1:-3,n=1===e.deltaMode?e.deltaY/t:e.deltaY/(10*t),r=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?(e.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case hT.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case hT.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1),this._isUserControllingTruck=!0;break;case hT.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0),this._isUserControllingOffset=!0;break;case hT.DOLLY:this._dollyInternal(-n,r,i),this._isUserControllingDolly=!0;break;case hT.ZOOM:this._zoomInternal(-n,r,i),this._isUserControllingZoom=!0}this.dispatchEvent({type:"control"})},p=e=>{if(this._domElement&&this._enabled){if(this.mouseButtons.right===oA.ACTION.NONE){const t=e instanceof PointerEvent?e.pointerId:(MouseEvent,0),n=this._findPointerById(t);return n&&this._disposePointer(n),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mousemove",l),void this._domElement.ownerDocument.removeEventListener("mouseup",u)}e.preventDefault()}},f=e=>{if(!this._enabled)return;RT(this._activePointers,zT),this._getClientRect(this._elementRect),n.copy(zT),r.copy(zT);if(this._activePointers.length>=2){const e=zT.x-this._activePointers[1].clientX,t=zT.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t);i.set(0,n);const o=.5*(this._activePointers[0].clientX+this._activePointers[1].clientX),s=.5*(this._activePointers[0].clientY+this._activePointers[1].clientY);r.set(o,s)}if(this._state=0,e)if("pointerType"in e&&"touch"===e.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._lockedPointer||(e.buttons&lT)!==lT||(this._state=this._state|this.mouseButtons.left),(e.buttons&uT)===uT&&(this._state=this._state|this.mouseButtons.middle),(e.buttons&cT)===cT&&(this._state=this._state|this.mouseButtons.right);else this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);(this._state&hT.ROTATE)!==hT.ROTATE&&(this._state&hT.TOUCH_ROTATE)!==hT.TOUCH_ROTATE&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),(this._state&hT.TRUCK)!==hT.TRUCK&&(this._state&hT.TOUCH_TRUCK)!==hT.TOUCH_TRUCK&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK||(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),(this._state&hT.DOLLY)!==hT.DOLLY&&(this._state&hT.TOUCH_DOLLY)!==hT.TOUCH_DOLLY&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE||(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),(this._state&hT.ZOOM)!==hT.ZOOM&&(this._state&hT.TOUCH_ZOOM)!==hT.TOUCH_ZOOM&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),(this._state&hT.OFFSET)!==hT.OFFSET&&(this._state&hT.TOUCH_OFFSET)!==hT.TOUCH_OFFSET&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET||(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,RT(this._activePointers,zT);const e=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,t=e?-e.deltaX:r.x-zT.x,o=e?-e.deltaY:r.y-zT.y;if(r.copy(zT),(this._state&hT.ROTATE)!==hT.ROTATE&&(this._state&hT.TOUCH_ROTATE)!==hT.TOUCH_ROTATE&&(this._state&hT.TOUCH_DOLLY_ROTATE)!==hT.TOUCH_DOLLY_ROTATE&&(this._state&hT.TOUCH_ZOOM_ROTATE)!==hT.TOUCH_ZOOM_ROTATE||(this._rotateInternal(t,o),this._isUserControllingRotate=!0),(this._state&hT.DOLLY)===hT.DOLLY||(this._state&hT.ZOOM)===hT.ZOOM){const e=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,r=this.dollyDragInverted?-1:1;(this._state&hT.DOLLY)===hT.DOLLY?(this._dollyInternal(r*o*IT,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(r*o*IT,e,t),this._isUserControllingZoom=!0)}if((this._state&hT.TOUCH_DOLLY)===hT.TOUCH_DOLLY||(this._state&hT.TOUCH_ZOOM)===hT.TOUCH_ZOOM||(this._state&hT.TOUCH_DOLLY_TRUCK)===hT.TOUCH_DOLLY_TRUCK||(this._state&hT.TOUCH_ZOOM_TRUCK)===hT.TOUCH_ZOOM_TRUCK||(this._state&hT.TOUCH_DOLLY_OFFSET)===hT.TOUCH_DOLLY_OFFSET||(this._state&hT.TOUCH_ZOOM_OFFSET)===hT.TOUCH_ZOOM_OFFSET||(this._state&hT.TOUCH_DOLLY_ROTATE)===hT.TOUCH_DOLLY_ROTATE||(this._state&hT.TOUCH_ZOOM_ROTATE)===hT.TOUCH_ZOOM_ROTATE){const e=zT.x-this._activePointers[1].clientX,t=zT.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t),o=i.y-n;i.set(0,n);const s=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,a=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&hT.TOUCH_DOLLY)===hT.TOUCH_DOLLY||(this._state&hT.TOUCH_DOLLY_ROTATE)===hT.TOUCH_DOLLY_ROTATE||(this._state&hT.TOUCH_DOLLY_TRUCK)===hT.TOUCH_DOLLY_TRUCK||(this._state&hT.TOUCH_DOLLY_OFFSET)===hT.TOUCH_DOLLY_OFFSET?(this._dollyInternal(o*IT,s,a),this._isUserControllingDolly=!0):(this._zoomInternal(o*IT,s,a),this._isUserControllingZoom=!0)}(this._state&hT.TRUCK)!==hT.TRUCK&&(this._state&hT.TOUCH_TRUCK)!==hT.TOUCH_TRUCK&&(this._state&hT.TOUCH_DOLLY_TRUCK)!==hT.TOUCH_DOLLY_TRUCK&&(this._state&hT.TOUCH_ZOOM_TRUCK)!==hT.TOUCH_ZOOM_TRUCK||(this._truckInternal(t,o,!1),this._isUserControllingTruck=!0),(this._state&hT.OFFSET)!==hT.OFFSET&&(this._state&hT.TOUCH_OFFSET)!==hT.TOUCH_OFFSET&&(this._state&hT.TOUCH_DOLLY_OFFSET)!==hT.TOUCH_DOLLY_OFFSET&&(this._state&hT.TOUCH_ZOOM_OFFSET)!==hT.TOUCH_ZOOM_OFFSET||(this._truckInternal(t,o,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},g=()=>{RT(this._activePointers,zT),r.copy(zT),this._dragNeedsUpdate=!1,(0===this._activePointers.length||1===this._activePointers.length&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),0===this._activePointers.length&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mouseup",u),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{this._enabled&&this._domElement&&(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",v),this._domElement.ownerDocument.addEventListener("pointerlockerror",y),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",c),f())},this.unlockPointer=()=>{null!==this._lockedPointer&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",v),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))};const v=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},y=()=>{this.unlockPointer()};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),BT&&this._domElement.addEventListener("mousedown",s),this._domElement.addEventListener("pointercancel",c),this._domElement.addEventListener("wheel",d,{passive:!1}),this._domElement.addEventListener("contextmenu",p)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",s),this._domElement.removeEventListener("pointercancel",c),this._domElement.removeEventListener("wheel",d,{passive:!1}),this._domElement.removeEventListener("contextmenu",p),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",c),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.removeEventListener("pointerlockchange",v),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))},this.cancel=()=>{this._state!==hT.NONE&&(this._state=hT.NONE,this._activePointers.length=0,g())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=bT(e.width,0,1),this._interactiveArea.height=bT(e.height,0,1),this._interactiveArea.x=bT(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=bT(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._isUserControllingRotate=!1;const r=bT(e,this.minAzimuthAngle,this.maxAzimuthAngle),i=bT(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=i,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!n||wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._isUserControllingDolly=!1,this._lastDollyDirection=dT,this._changedDolly=0,this._dollyToNoClamp(bT(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const t=this._collisionTest(),r=wT(t,this._spherical.radius);if(!(n>e)&&r)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,t)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const r=!t||wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._targetEnd.add(this._getCameraDirection(GT).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const n=!t||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._isUserControllingZoom=!1,this._zoomEnd=bT(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const n=!t||wT(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._camera.updateMatrix(),jT.setFromMatrixColumn(this._camera.matrix,0),XT.setFromMatrixColumn(this._camera.matrix,1),jT.multiplyScalar(e),XT.multiplyScalar(-t);const r=HT.copy(jT).add(XT),i=WT.copy(this._targetEnd).add(r);return this.moveTo(i.x,i.y,i.z,n)}forward(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];HT.setFromMatrixColumn(this._camera.matrix,0),HT.crossVectors(this._camera.up,HT),HT.multiplyScalar(e);const n=WT.copy(this._targetEnd).add(HT);return this.moveTo(n.x,n.y,n.z,t)}elevate(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return HT.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+HT.x,this._targetEnd.y+HT.y,this._targetEnd.z+HT.z,t)}moveTo(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._isUserControllingTruck=!1;const i=HT.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,i,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const o=!r||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=HT.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(i.x,i.y,i.z,r)}fitToBox(e,t){let{cover:n=!1,paddingLeft:r=0,paddingRight:i=0,paddingBottom:o=0,paddingTop:s=0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=[],l=e.isBox3?KT.copy(e):KT.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const c=CT(this._sphericalEnd.theta,yT),u=CT(this._sphericalEnd.phi,yT);a.push(this.rotateTo(c,u,t));const h=HT.setFromSpherical(this._sphericalEnd).normalize(),d=tA.setFromUnitVectors(h,FT),p=wT(Math.abs(h.y),1);p&&d.multiply(nA.setFromAxisAngle(UT,c)),d.multiply(this._yAxisUpSpaceInverse);const f=QT.makeEmpty();WT.copy(l.min).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setX(l.max.x).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setY(l.max.y).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setZ(l.min.z).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.min).setZ(l.max.z).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setY(l.min.y).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).setX(l.min.x).applyQuaternion(d),f.expandByPoint(WT),WT.copy(l.max).applyQuaternion(d),f.expandByPoint(WT),f.min.x-=r,f.min.y-=o,f.max.x+=i,f.max.y+=s,d.setFromUnitVectors(FT,h),p&&d.premultiply(nA.invert()),d.premultiply(this._yAxisUpSpace);const m=f.getSize(HT),g=f.getCenter(WT).applyQuaternion(d);if(mT(this._camera)){const e=this.getDistanceToFitBox(m.x,m.y,m.z,n);a.push(this.moveTo(g.x,g.y,g.z,t)),a.push(this.dollyTo(e,t)),a.push(this.setFocalOffset(0,0,0,t))}else if(gT(this._camera)){const e=this._camera,r=e.right-e.left,i=e.top-e.bottom,o=n?Math.max(r/m.x,i/m.y):Math.min(r/m.x,i/m.y);a.push(this.moveTo(g.x,g.y,g.z,t)),a.push(this.zoomTo(o,t)),a.push(this.setFocalOffset(0,0,0,t))}return Promise.all(a)}fitToSphere(e,t){const n=[],r=e instanceof DT.Sphere?eA.copy(e):oA.createBoundingSphere(e,eA);if(n.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),mT(this._camera)){const e=this.getDistanceToFitSphere(r.radius);n.push(this.dollyTo(e,t))}else if(gT(this._camera)){const e=this._camera.right-this._camera.left,i=this._camera.top-this._camera.bottom,o=2*r.radius,s=Math.min(e/o,i/o);n.push(this.zoomTo(s,t))}return n.push(this.setFocalOffset(0,0,0,t)),Promise.all(n)}setLookAt(e,t,n,r,i,o){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=dT,this._changedDolly=0;const a=WT.set(r,i,o),l=HT.set(e,t,n);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,s||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const c=!s||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold)&&wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(c)}lerpLookAt(e,t,n,r,i,o,s,a,l,c,u,h,d){let p=arguments.length>13&&void 0!==arguments[13]&&arguments[13];this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=dT,this._changedDolly=0;const f=HT.set(r,i,o),m=WT.set(e,t,n);ZT.setFromVector3(m.sub(f).applyQuaternion(this._yAxisUpSpace));const g=VT.set(c,u,h),v=WT.set(s,a,l);JT.setFromVector3(v.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(f.lerp(g,d));const y=JT.theta-ZT.theta,_=JT.phi-ZT.phi,x=JT.radius-ZT.radius;this._sphericalEnd.set(ZT.radius+x*d,ZT.phi+_*d,ZT.theta+y*d),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const b=!p||wT(this._target.x,this._targetEnd.x,this.restThreshold)&&wT(this._target.y,this._targetEnd.y,this.restThreshold)&&wT(this._target.z,this._targetEnd.z,this.restThreshold)&&wT(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&wT(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&wT(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(b)}setPosition(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=this.getPosition(HT),o=this.setLookAt(i.x,i.y,i.z,e,t,n,r);return this._sphericalEnd.phi=bT(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const i=!r||wT(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&wT(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&wT(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),jT.setFromMatrixColumn(this._camera.matrixWorldInverse,0),XT.setFromMatrixColumn(this._camera.matrixWorldInverse,1),$T.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=HT.set(e,t,n),i=r.distanceTo(this._camera.position),o=r.sub(this._camera.position);jT.multiplyScalar(o.x),XT.multiplyScalar(o.y),$T.multiplyScalar(o.z),HT.copy(jT).add(XT).add($T),HT.z=HT.z+i,this.dollyTo(i,!1),this.setFocalOffset(-HT.x,HT.y,-HT.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e)return this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),void(this._needsUpdate=!0);this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){null!==e?(this._viewport=this._viewport||new DT.Vector4,"number"==typeof e?this._viewport.set(e,t,n,r):this._viewport.copy(e)):this._viewport=null}getDistanceToFitBox(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(LT(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const i=e/t,o=this._camera.getEffectiveFOV()*xT,s=this._camera.aspect;return.5*((r?i>s:i<s)?t:e/s)/Math.tan(.5*o)+.5*n}getDistanceToFitSphere(e){if(LT(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*xT,n=2*Math.atan(Math.tan(.5*t)*this._camera.aspect),r=1<this._camera.aspect?t:n;return e/Math.sin(.5*r)}getTarget(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e instanceof DT.Spherical?e:new DT.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(e&&e.isVector3?e:new DT.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%vT,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=vT),this._spherical.theta+=vT*Math.round((this._sphericalEnd.theta-this._spherical.theta)/vT)}reset(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!wT(this._camera.up.x,this._cameraUp0.x)||!wT(this._camera.up.y,this._cameraUp0.y)||!wT(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const e=this.getPosition(HT);this.updateCameraUp(),this.setPosition(e.x,e.y,e.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,UT),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=HT.subVectors(this._target,this._camera.position).normalize(),t=WT.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const n=this.getPosition(HT);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,i=YT.subVectors(this._targetEnd,this._target),o=qT.subVectors(this._focalOffsetEnd,this._focalOffset),s=this._zoomEnd-this._zoom;if(ST(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=AT(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,t,1/0,e),this._needsUpdate=!0}if(ST(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const t=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=AT(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,t,1/0,e),this._needsUpdate=!0}if(ST(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const t=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=AT(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,t,this.maxSpeed,e),this._needsUpdate=!0}if(ST(i.x)&&ST(i.y)&&ST(i.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const t=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;ET(this._target,this._targetEnd,this._targetVelocity,t,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(ST(o.x)&&ST(o.y)&&ST(o.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const t=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;ET(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,t,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(ST(s))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const t=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=AT(this._zoom,this._zoomEnd,this._zoomVelocity,t,1/0,e)}if(this.dollyToCursor)if(mT(this._camera)&&0!==this._changedDolly){const e=this._spherical.radius-this._lastDistance,t=this._camera,n=this._getCameraDirection(GT),r=HT.copy(n).cross(t.up).normalize();0===r.lengthSq()&&(r.x=1);const i=WT.crossVectors(r,n),o=this._sphericalEnd.radius*Math.tan(t.getEffectiveFOV()*xT*.5),s=(this._sphericalEnd.radius-e-this._sphericalEnd.radius)/this._sphericalEnd.radius,a=VT.copy(this._targetEnd).add(r.multiplyScalar(this._dollyControlCoord.x*o*t.aspect)).add(i.multiplyScalar(this._dollyControlCoord.y*o)),l=HT.copy(this._targetEnd).lerp(a,s),c=this._lastDollyDirection===pT&&this._spherical.radius<=this.minDistance,u=this._lastDollyDirection===fT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(c||u)){this._sphericalEnd.radius-=e,this._spherical.radius-=e;const t=WT.copy(n).multiplyScalar(-e);l.add(t)}this._boundary.clampPoint(l,l);const h=WT.subVectors(l,this._targetEnd);this._targetEnd.copy(l),this._target.add(h),this._changedDolly-=e,ST(this._changedDolly)&&(this._changedDolly=0)}else if(gT(this._camera)&&0!==this._changedZoom){const e=this._zoom-this._lastZoom,t=this._camera,n=HT.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(t.near+t.far)/(t.near-t.far)).unproject(t),r=WT.set(0,0,-1).applyQuaternion(t.quaternion),i=VT.copy(n).add(r.multiplyScalar(-n.dot(t.up))),o=-(this._zoom-e-this._zoom)/this._zoom,s=this._getCameraDirection(GT),a=this._targetEnd.dot(s),l=HT.copy(this._targetEnd).lerp(i,o),c=l.dot(s),u=s.multiplyScalar(c-a);l.sub(u),this._boundary.clampPoint(l,l);const h=WT.subVectors(l,this._targetEnd);this._targetEnd.copy(l),this._target.add(h),this._changedZoom-=e,ST(this._changedZoom)&&(this._changedZoom=0)}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const a=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,a),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target);(!ST(this._focalOffset.x)||!ST(this._focalOffset.y)||!ST(this._focalOffset.z))&&(this._camera.updateMatrixWorld(),jT.setFromMatrixColumn(this._camera.matrix,0),XT.setFromMatrixColumn(this._camera.matrix,1),$T.setFromMatrixColumn(this._camera.matrix,2),jT.multiplyScalar(this._focalOffset.x),XT.multiplyScalar(-this._focalOffset.y),$T.multiplyScalar(this._focalOffset.z),HT.copy(jT).add(XT).add($T),this._camera.position.add(HT)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),HT.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const l=this._needsUpdate;return l&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):l?(this.dispatchEvent({type:"update"}),ST(t,this.restThreshold)&&ST(n,this.restThreshold)&&ST(r,this.restThreshold)&&ST(i.x,this.restThreshold)&&ST(i.y,this.restThreshold)&&ST(i.z,this.restThreshold)&&ST(o.x,this.restThreshold)&&ST(o.y,this.restThreshold)&&ST(o.z,this.restThreshold)&&ST(s,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!l&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=l,this._needsUpdate=!1,l}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:MT(this.maxDistance),minZoom:this.minZoom,maxZoom:MT(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:MT(this.maxPolarAngle),minAzimuthAngle:MT(this.minAzimuthAngle),maxAzimuthAngle:MT(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:HT.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=JSON.parse(e);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=TT(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=TT(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=TT(n.maxPolarAngle),this.minAzimuthAngle=TT(n.minAzimuthAngle),this.maxAzimuthAngle=TT(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this.verticalDragToForward=n.verticalDragToForward,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],t),ZT.setFromVector3(HT.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(ZT.theta,ZT.phi,t),this.dollyTo(ZT.radius,t),this.zoomTo(n.zoom,t),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],t),this._needsUpdate=!0}connect(e){this._domElement?console.warn("camera-controls is already connected."):(e.setAttribute("data-camera-controls-version","2.7.3"),this._addAllEventListeners(e),this._getClientRect(this._elementRect))}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find((t=>t.pointerId===e))}_findPointerByMouseButton(e){return this._activePointers.find((t=>t.mouseButton===e))}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){const r=t.lengthSq();if(0===r)return e;const i=WT.copy(t).add(e),o=this._boundary.clampPoint(i,VT).sub(i),s=o.lengthSq();if(0===s)return e.add(t);if(s===r)return e;if(0===n)return e.add(t).add(o);{const r=1+n*s/t.dot(o);return e.add(WT.copy(t).multiplyScalar(r)).add(o.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(mT(this._camera)){const e=this._camera,t=e.near,n=e.getEffectiveFOV()*xT,r=Math.tan(.5*n)*t,i=r*e.aspect;this._nearPlaneCorners[0].set(-i,-r,0),this._nearPlaneCorners[1].set(i,-r,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(-i,r,0)}else if(gT(this._camera)){const e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,i=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(n,i,0),this._nearPlaneCorners[1].set(r,i,0),this._nearPlaneCorners[2].set(r,o,0),this._nearPlaneCorners[3].set(n,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1))return e;if(LT(this._camera,"_collisionTest"))return e;const t=this._getTargetDirection(GT);rA.lookAt(NT,t,this._camera.up);for(let n=0;n<4;n++){const r=WT.copy(this._nearPlaneCorners[n]);r.applyMatrix4(rA);const i=VT.addVectors(this._target,r);iA.set(i,t),iA.far=this._spherical.radius+1;const o=iA.intersectObjects(this.colliderMeshes);0!==o.length&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise((e=>{const t=()=>{this.removeEventListener("rest",t),e()};this.addEventListener("rest",t)})))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new DT.Sphere,n=t.center;KT.makeEmpty(),e.traverseVisible((e=>{e.isMesh&&KT.expandByObject(e)})),KT.getCenter(n);let r=0;return e.traverseVisible((e=>{if(!e.isMesh)return;const t=e,i=t.geometry.clone();i.applyMatrix4(t.matrixWorld);const o=i.attributes.position;for(let e=0,t=o.count;e<t;e++)HT.fromBufferAttribute(o,e),r=Math.max(r,n.distanceToSquared(HT))})),t.radius=Math.sqrt(r),t}}class sA extends CC{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new AC(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){function t(e,t,n){for(let r=0,i=e.length;r<i;r++)if(e[r]!==t.getUint8(n+r))return!1;return!0}const n=function(e){if("string"==typeof e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t.buffer||t}return e}(e);return function(e){const n=new DataView(e);if(84+50*n.getUint32(80,!0)===n.byteLength)return!0;const r=[115,111,108,105,100];for(let e=0;e<5;e++)if(t(r,n,e))return!1;return!0}(n)?function(e){const t=new DataView(e),n=t.getUint32(80,!0);let r,i,o,s,a,l,c,u,h=!1;for(let e=0;e<70;e++)1129270351==t.getUint32(e,!1)&&82==t.getUint8(e+4)&&61==t.getUint8(e+5)&&(h=!0,s=new Float32Array(3*n*3),a=t.getUint8(e+6)/255,l=t.getUint8(e+7)/255,c=t.getUint8(e+8)/255,u=t.getUint8(e+9)/255);const d=new bv,p=new Float32Array(3*n*3),f=new Float32Array(3*n*3),m=new Kg;for(let e=0;e<n;e++){const n=84+50*e,u=t.getFloat32(n,!0),d=t.getFloat32(n+4,!0),g=t.getFloat32(n+8,!0);if(h){const e=t.getUint16(n+48,!0);0==(32768&e)?(r=(31&e)/31,i=(e>>5&31)/31,o=(e>>10&31)/31):(r=a,i=l,o=c)}for(let a=1;a<=3;a++){const l=n+12*a,c=3*e*3+3*(a-1);p[c]=t.getFloat32(l,!0),p[c+1]=t.getFloat32(l+4,!0),p[c+2]=t.getFloat32(l+8,!0),f[c]=u,f[c+1]=d,f[c+2]=g,h&&(m.set(r,i,o).convertSRGBToLinear(),s[c]=m.r,s[c+1]=m.g,s[c+2]=m.b)}}return d.setAttribute("position",new uv(p,3)),d.setAttribute("normal",new uv(f,3)),h&&(d.setAttribute("color",new uv(s,3)),d.hasColors=!0,d.alpha=u),d}(n):function(e){const t=new bv,n=/solid([\s\S]*?)endsolid/g,r=/facet([\s\S]*?)endfacet/g,i=/solid\s(.+)/;let o=0;const s=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,a=new RegExp("vertex"+s+s+s,"g"),l=new RegExp("normal"+s+s+s,"g"),c=[],u=[],h=[],d=new km;let p,f=0,m=0,g=0;for(;null!==(p=n.exec(e));){m=g;const e=p[0],n=null!==(p=i.exec(e))?p[1]:"";for(h.push(n);null!==(p=r.exec(e));){let e=0,t=0;const n=p[0];for(;null!==(p=l.exec(n));)d.x=parseFloat(p[1]),d.y=parseFloat(p[2]),d.z=parseFloat(p[3]),t++;for(;null!==(p=a.exec(n));)c.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),u.push(d.x,d.y,d.z),e++,g++;1!==t&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+o),3!==e&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+o),o++}const s=m,v=g-m;t.userData.groupNames=h,t.addGroup(s,v,f),f++}return t.setAttribute("position",new pv(c,3)),t.setAttribute("normal",new pv(u,3)),t}("string"!=typeof(r=e)?(new TextDecoder).decode(r):r);var r}}let aA=e=>{let t=(e=>{let t=bn(e,((e,t)=>{let n=(e=>{let t=(e=>{let t=e.geometry;return{cs:t.boundingSphere.center,rd:t.boundingSphere.radius}})(e);return{xmin:t.cs.x-t.rd,xmax:t.cs.x+t.rd,ymin:t.cs.y-t.rd,ymax:t.cs.y+t.rd,zmin:t.cs.z-t.rd,zmax:t.cs.z+t.rd}})(e);return n}));return{xmin:Gc(bn(t,"xmin")),xmax:Xc(bn(t,"xmax")),ymin:Gc(bn(t,"ymin")),ymax:Xc(bn(t,"ymax")),zmin:Gc(bn(t,"zmin")),zmax:Xc(bn(t,"zmax"))}})(e),n=t.xmax-t.xmin,r=t.ymax-t.ymin,i=t.zmax-t.zmin;return{cs:{x:(t.xmax+t.xmin)/2,y:(t.ymax+t.ymin)/2,z:(t.zmax+t.zmin)/2},rd:Xc([n,r,i])}};function lA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lA(Object(n),!0).forEach((function(t){Fs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}let uA=Math.PI/180,hA=180/Math.PI,dA=e=>e=Ds.toRgbString(e);async function pA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};il(e)||(e=[]);let n=me(t,"domPanel");Ii(n)||(n=document.body);let r=e=>{let t=0;if(nl(e.innerWidth))t=e.innerWidth;else{if(!nl(e.clientWidth))throw console.log("ele",e),new Error("can not get width from ele");t=e.clientWidth}let n=0;if(nl(e.innerWidth))n=e.innerHeight;else{if(!nl(e.clientWidth))throw console.log("ele",e),new Error("can not get height from ele");n=e.clientHeight}return{w:t,h:n}},i=r(n),o=i.w,s=i.h,a=me(t,"backgroundColor");ui(a)||(a="#222");let l=me(t,"useHelperAxes");el(l)||(l=!0);let c=me(t,"helperAxesLengthRatio");di(c)||(c=1),c=pi(c);let u=me(t,"useHelperGrid");el(u)||(u=!0);let h=me(t,"helperGridLengthRatio");di(h)||(h=5),h=pi(h);let d=me(t,"helperGridDensity");di(d)||(d=50),d=pi(d);let p=me(t,"helperGridPositionRatioZ");di(p)||(p=-1),p=pi(p);let f=me(t,"useLightAmbient");el(f)||(f=!0);let m=me(t,"lightAmbientColor");ui(m)||(m="#999");let g=me(t,"useLightPoint");el(g)||(g=!1);let v=me(t,"lightPointPoss");il(v)||(v=[[5,5,5],[-5,5,5],[5,-5,5]]);let y=me(t,"lightPointColor");ui(y)||(y="#fff");let _=me(t,"lightPointIntensity");di(_)||(_=100),_=pi(_);let x=me(t,"lightPointDistance");di(x)||(x=0),x=pi(x);let b=me(t,"lightPointDecay");di(b)||(b=2),b=pi(b);let S=me(t,"useLightDirection");el(S)||(S=!0);let w=me(t,"lightDirectionColor");ui(w)||(w="#fff");let C=me(t,"lightDirectionIntensity");di(C)||(C=3),C=pi(C);let M=me(t,"lightDirectionPos");il(M)||(M=[10,10,10]);let T=me(t,"cameraType");"perspective"!==T&&"orthographic"!==T&&(T="perspective");let A=me(t,"cameraFov");di(A)||(A=35),A=pi(A);let E=me(t,"cameraNear");di(E)||(E=.1),E=pi(E);let R=me(t,"cameraFar");di(R)||(R=1e3),R=pi(R);let L=me(t,"cameraOrthographicRatio");di(L)||(L=.5),L=pi(L);let P=me(t,"cameraPos");il(P)||(P=[1,1,1]);let I=me(t,"cameraAzimuthAngle");di(I)||(I=130),I=pi(I);let O=me(t,"cameraPolarAngle");di(O)||(O=50),O=pi(O);let k=me(t,"labelTextColor");ui(k)||(k="#fff");let B=me(t,"labelTextFontFamily");ui(B)||(B="Microsoft JhengHei");let D=me(t,"labelTextFontSize");ui(D)||(D="0.8rem");let N=me(t,"useAutoRotate");el(N)||(N=!1);let U=me(t,"autoRotateDeg");di(U)||(U=20),U=pi(U);let F=Vs(),z=new sM,H=new $x;H.background=new Kg(dA(a));let W=null,V=()=>{W=new QM(c),W.visible=l,H.add(W)},G=()=>{H.remove(W),W.dispose(),W=null};V();let j=null,X=()=>{j=new WM(h,d),j.visible=u,j.geometry.rotateX(.5*Math.PI),j.geometry.translate(0,0,p),H.add(j)},$=()=>{H.remove(j),j.dispose(),j=null};X();let Y=null;Y=new GC(dA(m)),Y.visible=f,H.add(Y);let q=null,Z=()=>{q=[],nt(v,(e=>{let t=new HC(dA(y),_,x,b);t.visible=g;let n=me(e,0,0),r=me(e,1,0),i=me(e,2,0);t.position.set(n,r,i),H.add(t),q.push(t)}))},J=()=>{nt(q,(e=>{H.remove(e),e.dispose(),e=null})),q=null};Z();let K=null,Q=()=>{K=new VC(dA(w),C),K.visible=S;let e=me(M,0,0),t=me(M,1,0),n=me(M,2,0);K.position.set(e,t,n),H.add(K)},ee=()=>{H.remove(K),K.dispose(),K=null};Q();let te=(e,t)=>{let n=1;return t>0&&(n=e/t),n},ne=te(o,s),re=null,ie=()=>{(e=>{let t=e*s,n=o,r=s-t,i=-t,a=o,l=s;re.setViewOffset(n,r,0,i,a,l)})(-.08)},oe=()=>{"perspective"===T?re=new Yv(A,ne,E,R):"orthographic"===T&&(re=new _y(-L*ne,L*ne,L,-L,E,R)),(e=>{let t=me(e,0,0),n=me(e,1,0),r=me(e,2,0);re.position.set(t,n,r)})(P),re.up.x=0,re.up.y=0,re.up.z=1,ie()},se=()=>{re=null};oe();let ae=new Vx({antialias:!0});ae.setSize(o,s),n.appendChild(ae.domElement);let le=new aT;le.setSize(o,s),le.domElement.style.position="absolute",le.domElement.style.top="0px",le.domElement.style.left="0px",n.appendChild(le.domElement),oA.install({THREE:eT});let ce=null,ue=()=>{ce=new oA(re,le.domElement),ce.mouseButtons={left:oA.ACTION.ROTATE,middle:oA.ACTION.DOLLY,right:oA.ACTION.OFFSET,wheel:oA.ACTION.ZOOM},ce.touches={one:oA.ACTION.TOUCH_ROTATE,two:oA.ACTION.TOUCH_DOLLY_OFFSET,three:oA.ACTION.TOUCH_OFFSET}},he=()=>{ce=null};ue();let de=()=>{let e=me(ce,"azimuthAngle"),t=me(ce,"polarAngle");return{azimuthAngle:e*hA,polarAngle:t*hA}},pe=(e,t)=>{Fd(ce,"azimuthAngle",e*uA),Fd(ce,"polarAngle",t*uA)};pe(I,O);let fe=null,ge=setInterval((()=>{let e=de();tr(e,fe)||(fe=e,F.emit("change-view-angle",e))}),50),ve=null,ye=()=>{ve=new Nx,H.add(ve)},_e=()=>{ve.traverse((function(e){e.isMesh&&(e.geometry.dispose(),e.material.dispose())})),H.remove(ve),ve=null};ye();let xe=[],be=async e=>{let t=me(e,"type","");if(ui(t)||(t=function(e){if(!ui(e))return"";let t=ka(Wd(e),".");if(xo(t)<=1)return"";let n="";try{n=ll(t)}catch(e){}return n}(e.url)),"stl"!==t)throw new Error("現在僅支援stl檔");let n=me(e,"color",""),r=Ds.toRgba(n),i=Ds.toRgbString(r),o=r.a,s=await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=me(n,"color",null);ui(r)||(r="#fff"),r=Ds.toRgbString(r);let i=me(n,"opacity",null);nl(i)||(i=1);let o=i<1,s=new sA,a=await s.loadAsync(t,(n=>{let r=n.loaded/n.total*100;e.emit("loading",{url:t,prog:r})})),l=new Kw({color:new Kg(r),depthTest:!0,depthWrite:!0,transparent:o,opacity:i,side:2});return new Fv(a,l)}(F,e.url,{color:i,opacity:o});s.name=e.name,s.color=n,xe.push(s),ve.add(s)},Se=async e=>{await zd(e,(async e=>{await be(e)}))};await Se(e);let we={},Ce=()=>{nt(xe,(e=>{let t=e.geometry,n=1/we.r;t.scale(n,n,n),t.translate(we.x,we.y,we.z)}))},Me=[],Te=()=>{nt(Me,(e=>{Za(e)})),Me=[]},Ae=async()=>{Re(),await Oi(1),(()=>{let e=aA(xe),t=e.cs,n=1;e.rd>0&&(n=1/e.rd),we=cA(cA({},t),{},{r:n})})(),nt(xe,(e=>{let t=e.geometry;t.translate(-we.x,-we.y,-we.z),t.scale(we.r,we.r,we.r)})),nt(xe,(e=>{let t=document.createElement("div");t.textContent=e.name,t.style.color=k,t.style.fontSize=D,t.style.fontFamily=B,t.style.visibility="visible";let n=new tT(t),r=e.geometry.boundingSphere.center;n.position.set(r.x,r.y,r.z),Me.push(t),e.add(n)})),Re()},Ee=(e,t)=>{if(!Ii(me(Me,e)))return null;try{let n="hidden";!0===t&&(n="visible"),Me[e].style.visibility=n}catch(e){console.log(e)}},Re=()=>{try{ae.render(H,re),le.render(H,re)}catch(e){console.log(e)}};Ae().then((()=>{F.emit("init")}));let Le=!1,Pe=()=>{if(!Le)try{let e=z.getDelta(),t=ce.update(e);if(N){let t=-U*uA*e;ce.azimuthAngle+=t}requestAnimationFrame(Pe),t&&Re()}catch(e){console.log(e)}};Pe();return F.render=Re,F.resize=()=>{let e=r(n);o=e.w,s=e.h,ne=te(o,s),re.aspect=ne,re.updateProjectionMatrix(),ie(),ae.setSize(o,s),le.setSize(o,s),Re()},F.dispose=()=>{F.emit("dispose"),clearInterval(ge),Le=!0,_e(),G(),$(),H.remove(Y),Y.dispose(),Y=null,J(),ee(),Te(),(()=>{let e=e=>{e.dispose();for(let t of Object.keys(e)){let n=e[t];n&&"object"==typeof n&&"minFilter"in n&&n.dispose()}};H.traverse((t=>{if(t.isLight&&t.dispose(),t.isMesh)if(t.geometry.dispose(),t.material.isMaterial)e(t.material);else for(let n of t.material)e(n)})),H=null})(),Za(ae.domElement),Za(le.domElement),ae.dispose(),ae=null,le=null,z=null,he(),se(),H=null},F.getUseAutoRotate=()=>N,F.setUseAutoRotate=e=>{N=e},F.setAutoRotateDeg=e=>{U=e},F.setCameraViewAngle=pe,F.getCameraViewAngle=de,F.setCameraAzimuthAngle=e=>{I=e,pe(I,O)},F.setCameraPolarAngle=e=>{O=e,pe(I,O)},F.setBackgroundColor=e=>{a=e,H.background=new Kg(dA(e)),Re()},F.getUseHelperAxes=()=>l,F.setUseHelperAxes=e=>{l=e,W.visible=e,Re()},F.setHelperAxesLengthRatio=e=>{c=e,G(),V(),Re()},F.getUseHelperGrid=()=>u,F.setUseHelperGrid=e=>{u=e,j.visible=e,Re()},F.setHelperGridLengthRatio=e=>{h=e,$(),X(),Re()},F.setHelperGridDensity=e=>{d=e,$(),X(),Re()},F.setHelperGridPositionRatioZ=e=>{p=e,$(),X(),Re()},F.setUseLightAmbient=e=>{f=e,Y.visible=e,Re()},F.setLightAmbientColor=e=>{m=e,Y.color=new Kg(dA(e)),Re()},F.setUseLightPoint=e=>{g=e,nt(q,(t=>{t.visible=e})),Re()},F.setLightPointPoss=e=>{v=e,J(),Z(),Re()},F.setLightPointColor=e=>{y=e,J(),Z(),Re()},F.setLightPointIntensity=e=>{_=e,J(),Z(),Re()},F.setLightPointDistance=e=>{x=e,J(),Z(),Re()},F.setLightPointDecay=e=>{b=e,J(),Z(),Re()},F.setUseLightDirection=e=>{S=e,K.visible=e,Re()},F.setLightDirectionColor=e=>{w=e,K.color=new Kg(dA(e)),Re()},F.setLightDirectionIntensity=e=>{C=e,ee(),Q(),Re()},F.setLightDirectionPos=e=>{M=e,ee(),Q(),Re()},F.getCameraType=()=>T,F.setCameraType=e=>{T=e,se(),oe(),he(),ue(),Re()},F.setCameraFov=e=>{A=e,re.fov=e,re.updateProjectionMatrix(),Re()},F.setCameraNear=e=>{E=e,re.near=e,re.updateProjectionMatrix(),Re()},F.setCameraFar=e=>{R=e,re.far=e,re.updateProjectionMatrix(),Re()},F.setCameraOrthographicRatio=e=>{L=e,se(),oe(),he(),ue(),Re()},F.addMesh=async e=>{Ce(),Te(),await be(e),Ae()},F.addMeshs=async e=>{Ce(),Te(),await Se(e),Ae()},F.getMeshsInfor=()=>{let e=bn(xe,((e,t)=>{let n=me(e,"color",""),r=me(Me,t),i=me(r,"textContent",""),o=me(r,"style.color",""),s=me(r,"style.fontSize",""),a=me(r,"style.fontFamily","");return{visible:e.visible,color:n,labelText:i,labelTextColor:o,labelTextFontSize:s,labelTextFontFamily:a}}));return e},F.setMeshVisible=(e,t)=>{((e,t)=>{if(!Ci(me(xe,e)))return null;try{xe[e].visible=t}catch(e){console.log(e)}})(e,t),Ee(e,t),Re()},F.setMeshColor=(e,t)=>{if(!Ci(me(xe,e)))return null;try{let n=Ds.toRgba(t),r=Ds.toRgbString(n),i=n.a;xe[e].material.color=new Kg(r),xe[e].material.opacity=i,xe[e].color=t}catch(e){console.log(e)}Re()},F.setMeshLabelVisible=(e,t)=>{Ee(e,t),Re()},F.setMeshLabelText=(e,t)=>{if(!Ii(me(Me,e)))return null;try{Me[e].textContent=t}catch(e){console.log(e)}Re()},F.setMeshLabelTextColor=(e,t)=>{if(!Ii(me(Me,e)))return null;try{Me[e].style.color=t}catch(e){console.log(e)}Re()},F.setMeshLabelTextFontSize=(e,t)=>{if(!Ii(me(Me,e)))return null;try{Me[e].style.fontSize=t}catch(e){console.log(e)}Re()},F.setMeshLabelTextFontFamily=(e,t)=>{if(!Ii(me(Me,e)))return null;try{Me[e].style.fontFamily=t}catch(e){console.log(e)}Re()},F.cleanMeshs=()=>{nt(xe,(e=>{ve.remove(e)})),_e(),xe=[],ye(),Te(),Re()},F}const fA={directives:{domresize:qs()},components:{WIconLoading:ja,WGroupIconCheck:Uc,WIcon:al,WColorSelect:Ud},props:{opt:{type:Object,default:()=>{}}},data:function(){return{mdiEyeOutline:"M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z",mdiEyeOffOutline:"M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z",loading:!0,timer:null,itemsSelectIds:[],itemsSelects:[],useSetting:!0,useAutoRotate:!1,useHelperAxes:!0,useHelperGrid:!0,usePerspective:!0,useLegend:!0,optTemp:null,meshs:[],ev:null,menuSettingIcon:"",menuSettingTooltip:"",menuAutoRotateIcon:"",menuAutoRotateTooltip:"",menuAxesIcon:"",menuAxesTooltip:"",menuGridIcon:"",menuGridTooltip:"",menuPerspectiveIcon:"",menuPerspectiveTooltip:"",menuLegendIcon:"",menuLegendTooltip:"",useLegnedBackgroundColor:"",useLegnedHeight:""}},mounted:function(){let e,t=this;t.timer=setInterval((()=>{e=t.getParam("useHelperAxes"),t.useHelperAxes!==e&&(t.useHelperAxes=e),e=t.getParam("useAutoRotate"),t.useAutoRotate!==e&&(t.useAutoRotate=e),e=t.getParam("useHelperGrid"),t.useHelperGrid!==e&&(t.useHelperGrid=e),e="perspective"===t.getParam("cameraType"),t.usePerspective!==e&&(t.usePerspective=e),e=t.getMeshs(),tr(t.meshs,e)||(t.meshs=e),t.syncItemsSelectIds(),t.updateItemsSelects(!1)}),50)},beforeDestroy:function(){clearInterval(this.timer),this.dispose()},watch:{opt:{handler(e){let t=this;t.loading?t.init().finally((()=>{t.optTemp=si(t.opt)})):t.modify().finally((()=>{t.optTemp=si(t.opt)}))},immediate:!0,deep:!0}},computed:{widthInp:function(){let e=0,t=me(this,"opt.width","");return di(t)&&(e=pi(t)),e},heightInp:function(){let e=0,t=me(this,"opt.height","");return di(t)&&(e=pi(t)),e},items:function(){let e=this;return[{id:"setting",icon:e.menuSettingIcon,tooltip:e.menuSettingTooltip},{id:"auto_rotate",icon:e.menuAutoRotateIcon,tooltip:e.menuAutoRotateTooltip},{id:"axes",icon:e.menuAxesIcon,tooltip:e.menuAxesTooltip},{id:"grid",icon:e.menuGridIcon,tooltip:e.menuGridTooltip},{id:"perspective",icon:e.menuPerspectiveIcon,tooltip:e.menuPerspectiveTooltip},{id:"legend",icon:e.menuLegendIcon,tooltip:e.menuLegendTooltip}]},useItems:function(){let e=this,t=[];return t=e.useSetting?si(e.items):[si(e.items[0])],t}},methods:{resizePanel:function(e){let t=this;if(null===t.ev)return;let n=me(t,"ev.resize");li(n)&&(n(),t.$emit("resize",e))},syncItemsSelectIds:function(){let e=this,t=[];e.useSetting&&t.push("setting"),e.useAutoRotate&&t.push("auto_rotate"),e.useHelperAxes&&t.push("axes"),e.useHelperGrid&&t.push("grid"),e.usePerspective&&t.push("perspective"),e.useLegend&&t.push("legend"),tr(e.itemsSelectIds,t)||(e.itemsSelectIds=t)},updateItemsSelects:function(e=!1){let t=this,n=bn(t.itemsSelects,"id");if(!e&&tr(t.itemsSelectIds,n))return;let r=[];nt(t.itemsSelectIds,(e=>{let n=Un(t.items,{id:e});Ci(n)?r.push(n):console.log(`invalid id[${e}]`)})),t.itemsSelects=r},updateMenus:function(){let e=this,t=me(e,"opt.menuSettingIcon","");ui(t)||(t="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z");let n=me(e,"opt.menuSettingTooltip","");ui(n)||(n="Settings");let r=me(e,"opt.menuAutoRotateIcon","");ui(r)||(r="M10,12L14,16L10,20V16.9C5.44,16.44 2,14.42 2,12C2,9.58 5.44,7.56 10,7.1V9.09C6.55,9.43 4,10.6 4,12C4,13.4 6.55,14.57 10,14.91V12M20,12C20,10.6 17.45,9.43 14,9.09V7.1C18.56,7.56 22,9.58 22,12C22,14.16 19.26,16 15.42,16.7L16.12,16L14.92,14.79C17.89,14.36 20,13.27 20,12M11,2H13V13L11,11V2M11,22V21L13,19V22H11Z");let i=me(e,"opt.menuAutoRotateTooltip","");ui(i)||(i="Auto rotate");let o=me(e,"opt.menuAxesIcon","");ui(o)||(o="M2.61,21L1.61,19.27L11,13.85V3H13V13.85L22.39,19.27L21.39,21L12,15.58L2.61,21Z");let s=me(e,"opt.menuAxesTooltip","");ui(s)||(s="Axes");let a=me(e,"opt.menuGridIcon","");ui(a)||(a="M10,4V8H14V4H10M16,4V8H20V4H16M16,10V14H20V10H16M16,16V20H20V16H16M14,20V16H10V20H14M8,20V16H4V20H8M8,14V10H4V14H8M8,8V4H4V8H8M10,14H14V10H10V14M4,2H20A2,2 0 0,1 22,4V20A2,2 0 0,1 20,22H4C2.92,22 2,21.1 2,20V4A2,2 0 0,1 4,2Z");let l=me(e,"opt.menuGridTooltip","");ui(l)||(l="Grid");let c=me(e,"opt.menuPerspectiveIcon","");ui(c)||(c="M20 2H4C3.45 2 3 2.45 3 3V4C3 4.55 3.45 5 4 5H5V14H11V16.59L6.79 20.79L8.21 22.21L11 19.41V22H13V19.41L15.79 22.21L17.21 20.79L13 16.59V14H19V5H20C20.55 5 21 4.55 21 4V3C21 2.45 20.55 2 20 2M17 12H7V5H17V12Z");let u=me(e,"opt.menuPerspectiveTooltip","");ui(u)||(u="Perspective");let h=me(e,"opt.menuLegendIcon","");ui(h)||(h="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z");let d=me(e,"opt.menuLegendTooltip","");ui(d)||(d="Legend"),e.menuSettingIcon=t,e.menuSettingTooltip=n,e.menuAutoRotateIcon=r,e.menuAutoRotateTooltip=i,e.menuAxesIcon=o,e.menuAxesTooltip=s,e.menuGridIcon=a,e.menuGridTooltip=l,e.menuPerspectiveIcon=c,e.menuPerspectiveTooltip=u,e.menuLegendIcon=h,e.menuLegendTooltip=d,e.updateItemsSelects(!0)},refreshLegend:function(){let e=this,t=me(e,"opt.legnedBackgroundColor","");ui(t)||(t="rgba(90,90,90,0.5)"),e.useLegnedBackgroundColor=Ds.toRgbaString(t);let n=me(e,"opt.legnedHeight",null),r=me(e,"opt.legnedHeightMax",null),i="";di(n)&&(n=pi(n),i+=`height:${n}px;`),di(r)&&(r=pi(r),i+=`max-height:${r}px;`),(di(n)||di(r))&&(i+="overflow-y:auto;"),e.useLegnedHeight=i},init:async function(){let e=this;await async function(){e.dispose(),await bi((()=>Ii(e.$refs.panel))),e.loading=!0;let t=si(e.opt);t.domPanel=e.$refs.panel;let n=me(t,"items",[]),r=await pA(n,t);r.on("init",(()=>{e.$emit("init"),e.updateMenus(),e.refreshLegend(),e.loading=!1})),r.on("loading",(t=>{e.$emit("loading",t)})),r.on("dispose",(()=>{e.$emit("dispose")})),r.on("change-view-angle",(t=>{e.$emit("change-view-angle",t)})),e.ev=r}().catch((e=>{console.log(e)}))},modify:async function(){let e=this;await async function(){if(null===e.ev)return;await Oi(300);let t=Ke(e.opt),n=Ke(e.optTemp),r=[];nt(t,(t=>{let i=me(e,`opt.${t}`,null),o=me(e,`optTemp.${t}`,null);tr(i,o)||r.push({type:"mod",k:t,vOld:o,vNew:i}),er(n,t)})),nt(n,(t=>{let n=me(e,`optTemp.${t}`,null);r.push({type:"del",k:t,vOld:n,vNew:null})}));let i={width:"",height:"",backgroundColor:"ev.setBackgroundColor",useAutoRotate:"ev.setUseAutoRotate",autoRotateDeg:"ev.setAutoRotateDeg",useHelperAxes:"ev.setUseHelperAxes",helperAxesLengthRatio:"ev.setHelperAxesLengthRatio",useHelperGrid:"ev.setUseHelperGrid",helperGridLengthRatio:"ev.setHelperGridLengthRatio",helperGridDensity:"ev.setHelperGridDensity",helperGridPositionRatioZ:"ev.setHelperGridPositionRatioZ",useLightAmbient:"ev.setUseLightAmbient",lightAmbientColor:"ev.setLightAmbientColor",useLightPoint:"ev.setUseLightPoint",lightPointPoss:"ev.setLightPointPoss",lightPointColor:"ev.setLightPointColor",lightPointIntensity:"ev.setLightPointIntensity",lightPointDistance:"ev.setLightPointDistance",lightPointDecay:"ev.setLightPointDecay",useLightDirection:"ev.setUseLightDirection",lightDirectionColor:"ev.setLightDirectionColor",lightDirectionIntensity:"ev.setLightDirectionIntensity",lightDirectionPos:"ev.setLightDirectionPos",cameraType:"ev.setCameraType",cameraFov:"ev.setCameraFov",cameraNear:"ev.setCameraNear",cameraFar:"ev.setCameraFar",cameraOrthographicRatio:"ev.setCameraOrthographicRatio",cameraAzimuthAngle:"ev.setCameraAzimuthAngle",cameraPolarAngle:"ev.setCameraPolarAngle",menuSettingIcon:"updateMenus",menuSettingTooltip:"updateMenus",menuAutoRotateIcon:"updateMenus",menuAutoRotateTooltip:"updateMenus",menuAxesIcon:"updateMenus",menuAxesTooltip:"updateMenus",menuGridIcon:"updateMenus",menuGridTooltip:"updateMenus",menuPerspectiveIcon:"updateMenus",menuPerspectiveTooltip:"updateMenus",menuLegendIcon:"updateMenus",menuLegendTooltip:"updateMenus",legnedBackgroundColor:"refreshLegend",legnedHeight:"refreshLegend",legnedHeightMax:"refreshLegend"};nt(r,(t=>{let n=t.k;if(wi(i,n)){let r=me(e,i[n]);if(li(r))try{r(t.vNew)}catch(e){console.log(e)}}else console.log(`尚未建置 ${n} 之 set 函數`)}))}().catch((e=>{console.log(e)}))},dispose:function(){let e=this;setTimeout((()=>{if(null===e.ev)return;li(me(e,"ev.dispose"))&&(e.ev.dispose(),e.ev=null)}),1)},getInst:function(){return me(this,"ev")},getMeshs:function(){let e=me(this,"ev.getMeshsInfor"),t=[];return li(e)&&(t=e()),t},getMeshColor:function(e){let t=me(e,"color","");return t=Ds.toRgbaString(t),t},setMeshColor:function(e,t,n){this.ev.setMeshColor(t,n)},toggleMeshVisible:function(e,t){this.ev.setMeshVisible(t,!e.visible)},strUpperHead:function(e){let t=Bi(e,1);return t=Fn(t),`${t}${Ni(e,1)}`},getParam:function(e){let t=null,n=me(this,`ev.get${e=this.strUpperHead(e)}`);return li(n)&&(t=n()),t},setParam:function(e,t){let n=me(this,`ev.set${e=this.strUpperHead(e)}`);li(n)&&n(t)},toggleParam:function(e){let t=this.getParam(e);t=!t,this.setParam(e,t)},ckItem:function(e){let t=this,n={setting:()=>{t.useSetting=!t.useSetting},axes:()=>{t.toggleParam("useHelperAxes")},auto_rotate:()=>{t.toggleParam("useAutoRotate")},grid:()=>{t.toggleParam("useHelperGrid")},perspective:()=>{t.usePerspective?t.setParam("cameraType","orthographic"):t.setParam("cameraType","perspective")},legend:()=>{t.useLegend=!t.useLegend}},r=me(e,"id",""),i=me(n,r);li(i)?i():(console.log("item",e),console.log("kp",n),console.log(`invalid id[${r}]`))}}};var mA=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:"display:inline-block; width:"+e.widthInp+"px; min-width:"+e.widthInp+"px; height:"+e.heightInp+"px; overflow-y:hidden;"},[e.loading?n("div",{staticStyle:{position:"relative",width:"0px",height:"0px"}},[n("div",{staticStyle:{position:"absolute",top:"0px",left:"0px"}},[n("WIconLoading")],1)]):e._e(),e._v(" "),n("div",{staticStyle:{position:"relative"}},[n("div",{directives:[{name:"domresize",rawName:"v-domresize"}],ref:"panel",style:"position:relative; width:"+e.widthInp+"px; height:"+e.heightInp+"px; opacity:"+(e.loading?0:1)+";",on:{domresize:e.resizePanel}}),e._v(" "),e.loading?e._e():n("div",{style:"position:absolute; top:0px; left:0px;"},[n("div",{staticStyle:{padding:"10px",display:"flex","align-items":"flex-start"}},[n("WGroupIconCheck",{attrs:{items:e.useItems,dir:"vertical",iconColor:"#aaa",iconColorHover:"#ccc",iconColorFocus:"#ccc",iconColorActive:"#fff",backgroundColor:"#000",backgroundColorHover:"#111",backgroundColorFocus:"#111",backgroundColorActive:"#444",seplineColor:"#333",tooltipTextFontSize:"0.7rem",value:e.itemsSelects,_input:"updateItem"},on:{click:e.ckItem}}),e._v(" "),e.useLegend?[n("div",{style:"padding-left:10px;"}),e._v(" "),n("div",{style:"padding:5px; border-radius:4px; background:"+e.useLegnedBackgroundColor+";"},[n("div",{style:""+e.useLegnedHeight},e._l(e.meshs,(function(t,r){return n("div",{key:"km-"+r,style:""},[n("div",{staticStyle:{display:"flex","align-items":"center",padding:"3px"}},[n("WIcon",{staticStyle:{cursor:"pointer"},attrs:{icon:t.visible?e.mdiEyeOutline:e.mdiEyeOffOutline,color:"#ccc",colorHover:"#ddd",size:20},on:{click:function(n){return e.toggleMeshVisible(t,r)}}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("WColorSelect",{attrs:{colorBlockBorderColor:"#888",showColorText:!1,_colorTextColor:"'#ddd'",panelBackgroundColor:"#111",toolBackgroundColor:"#222",menuIconColor:"#666",menuIconColorHover:"#777",menuIconColorActive:"#ddd",borderColor:"#333",borderColorHover:"#333",borderColorActive:"#444",backgroundColor:"#111",menuBackgroundColor:"#111",menuBackgroundColorHover:"#222",menuBackgroundColorActive:"#333",menuTextColor:"#b2b2b2",menuTextColorHover:"#ccc",menuTextColorActive:"#ddd",menuTextFontSize:"0.75rem",inputBorderColor:"#444",inputBorderColorHover:"#555",inputBorderColorActive:"#666",inputBackgroundColor:"#000",inputBackgroundColorHover:"#111",inputBackgroundColorActive:"#222",inputTextColor:"#999",inputLabelColor:"#888",barProgColor:"#888",barProgBackgroundColor:"#222",barSliderBackgroundColor:"#ccc",barSliderBackgroundColorHover:"#ddd",btnTextColor:"#eee",btnTextColorHover:"#fff",btnTextColorActive:"#fff",btnBackgroundColor:"#444",btnBackgroundColorHover:"#555",btnBackgroundColorActive:"#555",value:e.getMeshColor(t)},on:{input:function(n){e.setMeshColor(t,r,n)}}}),e._v(" "),n("div",{staticStyle:{"padding-left":"5px"}}),e._v(" "),n("div",{style:"color:"+t.labelTextColor+"; font-size:"+t.labelTextFontSize+"; font-family:"+t.labelTextFontFamily+";"},[e._v("\n "+e._s(t.labelText)+"\n ")])],1)])})),0)])]:e._e()],2)])])])};mA._withStripped=!0;return Ua({render:mA,staticRenderFns:[]},(function(e){e&&e("data-v-8a92447c_0",{source:"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",map:{version:3,sources:[],names:[],mappings:"",file:"WThreejsVue.vue"},media:void 0})}),fA,"data-v-8a92447c",false,undefined,!1,za,void 0,void 0)}));
26
26
  //# sourceMappingURL=w-threejs-vue.umd.js.map