// Version 1.26.4 three-render-objects - https://github.com/vasturiano/three-render-objects !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("three")):"function"==typeof define&&define.amd?define(["three"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).ThreeRenderObjects=t(e.THREE)}(this,(function(e){"use strict";function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var o,r,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw r}}return a}(e,t)||r(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n0&&(o.object.isPerspectiveCamera?E.multiplyScalar(e):o.object.isOrthographicCamera?(o.object.zoom/=e,o.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),o.staticMoving?P.copy(T):P.y+=(T.y-P.y)*this.dynamicDampingFactor)},this.panCamera=function(){const t=new e.Vector2,n=new e.Vector3,r=new e.Vector3;return function(){if(t.copy(C).sub(x),t.lengthSq()){if(o.object.isOrthographicCamera){const e=(o.object.right-o.object.left)/o.object.zoom/o.domElement.clientWidth,n=(o.object.top-o.object.bottom)/o.object.zoom/o.domElement.clientWidth;t.x*=e,t.y*=n}t.multiplyScalar(E.length()*o.panSpeed),r.copy(E).cross(o.object.up).setLength(t.x),r.add(n.copy(o.object.up).setLength(t.y)),o.object.position.add(r),o.target.add(r),o.staticMoving?x.copy(C):x.add(t.subVectors(C,x).multiplyScalar(o.dynamicDampingFactor))}}}(),this.checkDistances=function(){o.noZoom&&o.noPan||(E.lengthSq()>o.maxDistance*o.maxDistance&&(o.object.position.addVectors(o.target,E.setLength(o.maxDistance)),P.copy(T)),E.lengthSq()p&&(o.dispatchEvent(i),f.copy(o.object.position))):o.object.isOrthographicCamera?(o.object.lookAt(o.target),(f.distanceToSquared(o.object.position)>p||m!==o.object.zoom)&&(o.dispatchEvent(i),f.copy(o.object.position),m=o.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")},this.reset=function(){g=r,b=r,o.target.copy(o.target0),o.object.position.copy(o.position0),o.object.up.copy(o.up0),o.object.zoom=o.zoom0,o.object.updateProjectionMatrix(),E.subVectors(o.object.position,o.target),o.object.lookAt(o.target),o.dispatchEvent(i),f.copy(o.object.position),m=o.object.zoom},this.dispose=function(){o.domElement.removeEventListener("contextmenu",U),o.domElement.removeEventListener("pointerdown",R),o.domElement.removeEventListener("wheel",I),o.domElement.removeEventListener("touchstart",V),o.domElement.removeEventListener("touchend",z),o.domElement.removeEventListener("touchmove",F),o.domElement.ownerDocument.removeEventListener("pointermove",L),o.domElement.ownerDocument.removeEventListener("pointerup",M),window.removeEventListener("keydown",D),window.removeEventListener("keyup",A)},this.domElement.addEventListener("contextmenu",U),this.domElement.addEventListener("pointerdown",R),this.domElement.addEventListener("wheel",I,{passive:!1}),this.domElement.addEventListener("touchstart",V,{passive:!1}),this.domElement.addEventListener("touchend",z),this.domElement.addEventListener("touchmove",F,{passive:!1}),this.domElement.ownerDocument.addEventListener("pointermove",L),this.domElement.ownerDocument.addEventListener("pointerup",M),window.addEventListener("keydown",D),window.addEventListener("keyup",A),this.handleResize(),this.update()}}const u={type:"change"},h={type:"start"},d={type:"end"};class p extends e.EventDispatcher{constructor(t,n){super(),void 0===n&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),n===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=n,this.enabled=!0,this.target=new e.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:e.MOUSE.ROTATE,MIDDLE:e.MOUSE.DOLLY,RIGHT:e.MOUSE.PAN},this.touches={ONE:e.TOUCH.ROTATE,TWO:e.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.listenToKeyEvents=function(e){e.addEventListener("keydown",H),this._domElementKeyEvents=e},this.saveState=function(){o.target0.copy(o.target),o.position0.copy(o.object.position),o.zoom0=o.object.zoom},this.reset=function(){o.target.copy(o.target0),o.object.position.copy(o.position0),o.object.zoom=o.zoom0,o.object.updateProjectionMatrix(),o.dispatchEvent(u),o.update(),a=r.NONE},this.update=function(){const n=new e.Vector3,h=(new e.Quaternion).setFromUnitVectors(t.up,new e.Vector3(0,1,0)),d=h.clone().invert(),m=new e.Vector3,g=new e.Quaternion,b=2*Math.PI;return function(){const e=o.object.position;n.copy(e).sub(o.target),n.applyQuaternion(h),s.setFromVector3(n),o.autoRotate&&a===r.NONE&&P(2*Math.PI/60/60*o.autoRotateSpeed),o.enableDamping?(s.theta+=c.theta*o.dampingFactor,s.phi+=c.phi*o.dampingFactor):(s.theta+=c.theta,s.phi+=c.phi);let t=o.minAzimuthAngle,v=o.maxAzimuthAngle;return isFinite(t)&&isFinite(v)&&(t<-Math.PI?t+=b:t>Math.PI&&(t-=b),v<-Math.PI?v+=b:v>Math.PI&&(v-=b),s.theta=t<=v?Math.max(t,Math.min(v,s.theta)):s.theta>(t+v)/2?Math.max(t,s.theta):Math.min(v,s.theta)),s.phi=Math.max(o.minPolarAngle,Math.min(o.maxPolarAngle,s.phi)),s.makeSafe(),s.radius*=l,s.radius=Math.max(o.minDistance,Math.min(o.maxDistance,s.radius)),!0===o.enableDamping?o.target.addScaledVector(p,o.dampingFactor):o.target.add(p),n.setFromSpherical(s),n.applyQuaternion(d),e.copy(o.target).add(n),o.object.lookAt(o.target),!0===o.enableDamping?(c.theta*=1-o.dampingFactor,c.phi*=1-o.dampingFactor,p.multiplyScalar(1-o.dampingFactor)):(c.set(0,0,0),p.set(0,0,0)),l=1,!!(f||m.distanceToSquared(o.object.position)>i||8*(1-g.dot(o.object.quaternion))>i)&&(o.dispatchEvent(u),m.copy(o.object.position),g.copy(o.object.quaternion),f=!1,!0)}}(),this.dispose=function(){o.domElement.removeEventListener("contextmenu",Q),o.domElement.removeEventListener("pointerdown",U),o.domElement.removeEventListener("wheel",B),o.domElement.removeEventListener("touchstart",X),o.domElement.removeEventListener("touchend",K),o.domElement.removeEventListener("touchmove",q),o.domElement.ownerDocument.removeEventListener("pointermove",N),o.domElement.ownerDocument.removeEventListener("pointerup",Y),null!==o._domElementKeyEvents&&o._domElementKeyEvents.removeEventListener("keydown",H)};const o=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let a=r.NONE;const i=1e-6,s=new e.Spherical,c=new e.Spherical;let l=1;const p=new e.Vector3;let f=!1;const m=new e.Vector2,g=new e.Vector2,b=new e.Vector2,v=new e.Vector2,y=new e.Vector2,w=new e.Vector2,E=new e.Vector2,S=new e.Vector2,_=new e.Vector2;function k(){return Math.pow(.95,o.zoomSpeed)}function P(e){c.theta-=e}function T(e){c.phi-=e}const x=function(){const t=new e.Vector3;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),p.add(t)}}(),C=function(){const t=new e.Vector3;return function(e,n){!0===o.screenSpacePanning?t.setFromMatrixColumn(n,1):(t.setFromMatrixColumn(n,0),t.crossVectors(o.object.up,t)),t.multiplyScalar(e),p.add(t)}}(),j=function(){const t=new e.Vector3;return function(e,n){const r=o.domElement;if(o.object.isPerspectiveCamera){const a=o.object.position;t.copy(a).sub(o.target);let i=t.length();i*=Math.tan(o.object.fov/2*Math.PI/180),x(2*e*i/r.clientHeight,o.object.matrix),C(2*n*i/r.clientHeight,o.object.matrix)}else o.object.isOrthographicCamera?(x(e*(o.object.right-o.object.left)/o.object.zoom/r.clientWidth,o.object.matrix),C(n*(o.object.top-o.object.bottom)/o.object.zoom/r.clientHeight,o.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),o.enablePan=!1)}}();function O(e){o.object.isPerspectiveCamera?l/=e:o.object.isOrthographicCamera?(o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom*e)),o.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),o.enableZoom=!1)}function R(e){o.object.isPerspectiveCamera?l*=e:o.object.isOrthographicCamera?(o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom/e)),o.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),o.enableZoom=!1)}function L(e){m.set(e.clientX,e.clientY)}function M(e){v.set(e.clientX,e.clientY)}function D(e){if(1==e.touches.length)m.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);m.set(t,n)}}function A(e){if(1==e.touches.length)v.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);v.set(t,n)}}function I(e){const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,o=Math.sqrt(t*t+n*n);E.set(0,o)}function V(e){if(1==e.touches.length)g.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);g.set(t,n)}b.subVectors(g,m).multiplyScalar(o.rotateSpeed);const t=o.domElement;P(2*Math.PI*b.x/t.clientHeight),T(2*Math.PI*b.y/t.clientHeight),m.copy(g)}function F(e){if(1==e.touches.length)y.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);y.set(t,n)}w.subVectors(y,v).multiplyScalar(o.panSpeed),j(w.x,w.y),v.copy(y)}function z(e){const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);S.set(0,r),_.set(0,Math.pow(S.y/E.y,o.zoomSpeed)),O(_.y),E.copy(S)}function U(t){if(!1!==o.enabled)switch(t.pointerType){case"mouse":case"pen":!function(t){let n;switch(t.preventDefault(),o.domElement.focus?o.domElement.focus():window.focus(),t.button){case 0:n=o.mouseButtons.LEFT;break;case 1:n=o.mouseButtons.MIDDLE;break;case 2:n=o.mouseButtons.RIGHT;break;default:n=-1}switch(n){case e.MOUSE.DOLLY:if(!1===o.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(t),a=r.DOLLY;break;case e.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===o.enablePan)return;M(t),a=r.PAN}else{if(!1===o.enableRotate)return;L(t),a=r.ROTATE}break;case e.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===o.enableRotate)return;L(t),a=r.ROTATE}else{if(!1===o.enablePan)return;M(t),a=r.PAN}break;default:a=r.NONE}a!==r.NONE&&(o.domElement.ownerDocument.addEventListener("pointermove",N),o.domElement.ownerDocument.addEventListener("pointerup",Y),o.dispatchEvent(h))}(t)}}function N(e){if(!1!==o.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){if(!1===o.enabled)return;switch(e.preventDefault(),a){case r.ROTATE:if(!1===o.enableRotate)return;!function(e){g.set(e.clientX,e.clientY),b.subVectors(g,m).multiplyScalar(o.rotateSpeed);const t=o.domElement;P(2*Math.PI*b.x/t.clientHeight),T(2*Math.PI*b.y/t.clientHeight),m.copy(g),o.update()}(e);break;case r.DOLLY:if(!1===o.enableZoom)return;!function(e){S.set(e.clientX,e.clientY),_.subVectors(S,E),_.y>0?O(k()):_.y<0&&R(k()),E.copy(S),o.update()}(e);break;case r.PAN:if(!1===o.enablePan)return;!function(e){y.set(e.clientX,e.clientY),w.subVectors(y,v).multiplyScalar(o.panSpeed),j(w.x,w.y),v.copy(y),o.update()}(e)}}(e)}}function Y(e){switch(e.pointerType){case"mouse":case"pen":!function(e){if(o.domElement.ownerDocument.removeEventListener("pointermove",N),o.domElement.ownerDocument.removeEventListener("pointerup",Y),!1===o.enabled)return;o.dispatchEvent(d),a=r.NONE}()}}function B(e){!1===o.enabled||!1===o.enableZoom||a!==r.NONE&&a!==r.ROTATE||(e.preventDefault(),o.dispatchEvent(h),function(e){e.deltaY<0?R(k()):e.deltaY>0&&O(k()),o.update()}(e),o.dispatchEvent(d))}function H(e){!1!==o.enabled&&!1!==o.enablePan&&function(e){let t=!1;switch(e.code){case o.keys.UP:j(0,o.keyPanSpeed),t=!0;break;case o.keys.BOTTOM:j(0,-o.keyPanSpeed),t=!0;break;case o.keys.LEFT:j(o.keyPanSpeed,0),t=!0;break;case o.keys.RIGHT:j(-o.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),o.update())}(e)}function X(t){if(!1!==o.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(o.touches.ONE){case e.TOUCH.ROTATE:if(!1===o.enableRotate)return;D(t),a=r.TOUCH_ROTATE;break;case e.TOUCH.PAN:if(!1===o.enablePan)return;A(t),a=r.TOUCH_PAN;break;default:a=r.NONE}break;case 2:switch(o.touches.TWO){case e.TOUCH.DOLLY_PAN:if(!1===o.enableZoom&&!1===o.enablePan)return;!function(e){o.enableZoom&&I(e),o.enablePan&&A(e)}(t),a=r.TOUCH_DOLLY_PAN;break;case e.TOUCH.DOLLY_ROTATE:if(!1===o.enableZoom&&!1===o.enableRotate)return;!function(e){o.enableZoom&&I(e),o.enableRotate&&D(e)}(t),a=r.TOUCH_DOLLY_ROTATE;break;default:a=r.NONE}break;default:a=r.NONE}a!==r.NONE&&o.dispatchEvent(h)}}function q(e){if(!1!==o.enabled)switch(e.preventDefault(),a){case r.TOUCH_ROTATE:if(!1===o.enableRotate)return;V(e),o.update();break;case r.TOUCH_PAN:if(!1===o.enablePan)return;F(e),o.update();break;case r.TOUCH_DOLLY_PAN:if(!1===o.enableZoom&&!1===o.enablePan)return;!function(e){o.enableZoom&&z(e),o.enablePan&&F(e)}(e),o.update();break;case r.TOUCH_DOLLY_ROTATE:if(!1===o.enableZoom&&!1===o.enableRotate)return;!function(e){o.enableZoom&&z(e),o.enableRotate&&V(e)}(e),o.update();break;default:a=r.NONE}}function K(e){!1!==o.enabled&&(o.dispatchEvent(d),a=r.NONE)}function Q(e){!1!==o.enabled&&e.preventDefault()}o.domElement.addEventListener("contextmenu",Q),o.domElement.addEventListener("pointerdown",U),o.domElement.addEventListener("wheel",B,{passive:!1}),o.domElement.addEventListener("touchstart",X,{passive:!1}),o.domElement.addEventListener("touchend",K),o.domElement.addEventListener("touchmove",q,{passive:!1}),this.update()}}const f={type:"change"};class m extends e.EventDispatcher{constructor(t,n){super(),void 0===n&&(console.warn('THREE.FlyControls: The second parameter "domElement" is now mandatory.'),n=document),this.object=t,this.domElement=n,this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1;const o=this,r=1e-6,a=new e.Quaternion,i=new e.Vector3;this.tmpQuaternion=new e.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new e.Vector3(0,0,0),this.rotationVector=new e.Vector3(0,0,0),this.keydown=function(e){if(!e.altKey){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){const t=this.getContainerDimensions(),n=t.size[0]/2,o=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-n)/n,this.moveState.pitchDown=(e.pageY-t.offset[1]-o)/o,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){const t=e*o.movementSpeed,n=e*o.rollSpeed;o.object.translateX(o.moveVector.x*t),o.object.translateY(o.moveVector.y*t),o.object.translateZ(o.moveVector.z*t),o.tmpQuaternion.set(o.rotationVector.x*n,o.rotationVector.y*n,o.rotationVector.z*n,1).normalize(),o.object.quaternion.multiply(o.tmpQuaternion),(i.distanceToSquared(o.object.position)>r||8*(1-a.dot(o.object.quaternion))>r)&&(o.dispatchEvent(f),a.copy(o.object.quaternion),i.copy(o.object.position))},this.updateMovementVector=function(){const e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",g),this.domElement.removeEventListener("mousedown",c),this.domElement.removeEventListener("mousemove",s),this.domElement.removeEventListener("mouseup",l),window.removeEventListener("keydown",u),window.removeEventListener("keyup",h)};const s=this.mousemove.bind(this),c=this.mousedown.bind(this),l=this.mouseup.bind(this),u=this.keydown.bind(this),h=this.keyup.bind(this);this.domElement.addEventListener("contextmenu",g),this.domElement.addEventListener("mousemove",s),this.domElement.addEventListener("mousedown",c),this.domElement.addEventListener("mouseup",l),window.addEventListener("keydown",u),window.addEventListener("keyup",h),this.updateMovementVector(),this.updateRotationVector()}}function g(e){e.preventDefault()}var b={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\t\t}"};class v{constructor(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}const y=new e.OrthographicCamera(-1,1,1,-1,0,1),w=new e.BufferGeometry;w.setAttribute("position",new e.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),w.setAttribute("uv",new e.Float32BufferAttribute([0,2,0,0,2,0],2));class E{constructor(t){this._mesh=new e.Mesh(w,t)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,y)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class S extends v{constructor(t,n){super(),this.textureID=void 0!==n?n:"tDiffuse",t instanceof e.ShaderMaterial?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=e.UniformsUtils.clone(t.uniforms),this.material=new e.ShaderMaterial({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new E(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}}class _ extends v{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const o=e.getContext(),r=e.state;let a,i;r.buffers.color.setMask(!1),r.buffers.depth.setMask(!1),r.buffers.color.setLocked(!0),r.buffers.depth.setLocked(!0),this.inverse?(a=0,i=1):(a=1,i=0),r.buffers.stencil.setTest(!0),r.buffers.stencil.setOp(o.REPLACE,o.REPLACE,o.REPLACE),r.buffers.stencil.setFunc(o.ALWAYS,a,4294967295),r.buffers.stencil.setClear(i),r.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),r.buffers.color.setLocked(!1),r.buffers.depth.setLocked(!1),r.buffers.stencil.setLocked(!1),r.buffers.stencil.setFunc(o.EQUAL,1,4294967295),r.buffers.stencil.setOp(o.KEEP,o.KEEP,o.KEEP),r.buffers.stencil.setLocked(!0)}}class k extends v{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class P{constructor(t,n){if(this.renderer=t,void 0===n){const o={minFilter:e.LinearFilter,magFilter:e.LinearFilter,format:e.RGBAFormat},r=t.getSize(new e.Vector2);this._pixelRatio=t.getPixelRatio(),this._width=r.width,this._height=r.height,(n=new e.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,o)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=n.width,this._height=n.height;this.renderTarget1=n,this.renderTarget2=n.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===b&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===S&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new S(b),this.clock=new e.Clock}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t1?o-1:0),a=1;a=0&&r<1?(s=a,c=i):r>=1&&r<2?(s=i,c=a):r>=2&&r<3?(c=a,l=i):r>=3&&r<4?(c=i,l=a):r>=4&&r<5?(s=i,l=a):r>=5&&r<6&&(s=a,l=i);var u=n-a/2;return o(s+u,c+u,l+u)}var N={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var Y=/^#[a-fA-F0-9]{6}$/,B=/^#[a-fA-F0-9]{8}$/,H=/^#[a-fA-F0-9]{3}$/,X=/^#[a-fA-F0-9]{4}$/,q=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,K=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,Q=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Z=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function G(e){if("string"!=typeof e)throw new V(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return N[t]?"#"+N[t]:e}(e);if(t.match(Y))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(B)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(H))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(X)){var o=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:o}}var r=q.exec(t);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var a=K.exec(t.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])};var i=Q.exec(t);if(i){var s="rgb("+U(parseInt(""+i[1],10),parseInt(""+i[2],10)/100,parseInt(""+i[3],10)/100)+")",c=q.exec(s);if(!c)throw new V(4,t,s);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10)}}var l=Z.exec(t.substring(0,50));if(l){var u="rgb("+U(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",h=q.exec(u);if(!h)throw new V(4,t,u);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10),alpha:parseFloat(""+l[4])}}throw new V(5)}var W=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function $(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function J(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return W("#"+$(e)+$(t)+$(n));if("object"==typeof e&&void 0===t&&void 0===n)return W("#"+$(e.red)+$(e.green)+$(e.blue));throw new V(6)}function ee(e,t,n){return function(){var o=n.concat(Array.prototype.slice.call(arguments));return o.length>=t?e.apply(this,o):ee(e,t,o)}}function te(e){return ee(e,e.length,[])}function ne(e,t){if("transparent"===t)return t;var n,o,r,a=G(t),i="number"==typeof a.alpha?a.alpha:1;return function(e,t,n,o){if("string"==typeof e&&"number"==typeof t){var r=G(e);return"rgba("+r.red+","+r.green+","+r.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof o)return o>=1?J(e,t,n):"rgba("+e+","+t+","+n+","+o+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===o)return e.alpha>=1?J(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new V(7)}(C({},a,{alpha:(n=0,o=1,r=(100*i+100*parseFloat(e))/100,Math.max(n,Math.min(o,r)))}))}var oe,re=te(ne),ae={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-ae.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*ae.Bounce.In(2*e):.5*ae.Bounce.Out(2*e-1)+.5}}},ie="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},se=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=ie()),void 0===t&&(t=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?a(e[n],e[n-1],n-o):a(e[r],e[r+1>n?n:r+1],o-r)},Bezier:function(e,t){for(var n=0,o=e.length-1,r=Math.pow,a=ce.Utils.Bernstein,i=0;i<=o;i++)n+=r(1-t,o-i)*r(t,i)*e[i]*a(o,i);return n},CatmullRom:function(e,t){var n=e.length-1,o=n*t,r=Math.floor(o),a=ce.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(o=n*(1+t))),a(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],o-r)):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-o)-e[0]):t>1?e[n]-(a(e[n],e[n],e[n-1],e[n-1],o-n)-e[n]):a(e[r?r-1:0],e[r],e[n1;n--)t*=n;return oe[e]=t,t}),CatmullRom:function(e,t,n,o,r){var a=.5*(n-e),i=.5*(o-t),s=r*r;return(2*t-2*n+a+i)*(r*s)+(-3*t+3*n-2*a-i)*s+a*r+t}}},le=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),ue=new se,he=function(){function e(e,t){void 0===t&&(t=ue),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ae.Linear.None,this._interpolationFunction=ce.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=le.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},e.prototype.duration=function(e){return this._duration=e,this},e.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var t in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(t),this._valuesStart[t]=this._valuesStartRepeat[t];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==e?"string"==typeof e?ie()+parseFloat(e):e:ie(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(e,t,n,o){for(var r in n){var a=e[r],i=Array.isArray(a),s=i?"array":typeof a,c=!i&&Array.isArray(n[r]);if("undefined"!==s&&"function"!==s){if(c){var l=n[r];if(0===l.length)continue;l=l.map(this._handleRelativeValue.bind(this,a)),n[r]=[a].concat(l)}if("object"!==s&&!i||!a||c)void 0===t[r]&&(t[r]=a),i||(t[r]*=1),o[r]=c?n[r].slice().reverse():t[r]||0;else{for(var u in t[r]=i?[]:{},a)t[r][u]=a[u];o[r]=i?[]:{},this._setupProperties(a,t[r],n[r],o[r])}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=ie()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=ie()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;er)return!1;t&&this.start(e)}if(this._goToEnd=!1,e1?1:o;var a=this._easingFunction(o);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,o),1===o){if(this._repeat>0){for(n in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var i=0,s=this._chainedTweens.length;i=0?o=setTimeout(c,t-l):(o=null,n||(s=e.apply(a,r),a=r=null))}null==t&&(t=100);var l=function(){a=this,r=arguments,i=Date.now();var l=n&&!o;return o||(o=setTimeout(c,t)),l&&(s=e.apply(a,r),a=r=null),s};return l.clear=function(){o&&(clearTimeout(o),o=null)},l.flush=function(){o&&(s=e.apply(a,r),a=r=null,clearTimeout(o),o=null)},l}we.debounce=we;var Ee=we;function Se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var o,r,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw r}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _e(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,o=arguments.length,r=new Array(o>3?o-3:0),a=3;a2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=e.camera;if(t){var s=new ze.Vector3(0,0,0),c=2*Math.max.apply(Math,o(Object.entries(t).map((function(e){var t=n(e,2),r=t[0],a=t[1];return Math.max.apply(Math,o(a.map((function(e){return Math.abs(s[r]-e)}))))})))),l=(1-2*a/e.height)*i.fov,u=c/Math.atan(l*Math.PI/180),h=u/i.aspect,d=Math.max(u,h);if(d>0){var p=s.clone().sub(i.position).normalize().multiplyScalar(-d);this.cameraPosition(p,s,r)}}return this},getBbox:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},r=new ze.Box3(new ze.Vector3(0,0,0),new ze.Vector3(0,0,0)),a=e.objects.filter(n);return a.length?(a.forEach((function(e){return r.expandByObject(e)})),Object.assign.apply(Object,o(["x","y","z"].map((function(e){return t({},e,[r.min[e],r.max[e]])}))))):null},getScreenCoords:function(e,t,n,o){var r=new ze.Vector3(t,n,o);return r.project(this.camera()),{x:(r.x+1)*e.width/2,y:-(r.y-1)*e.height/2}},getSceneCoords:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=new ze.Vector2(t/e.width*2-1,-n/e.height*2+1),a=new ze.Raycaster;return a.setFromCamera(r,e.camera),Object.assign({},a.ray.at(o,new ze.Vector3))},intersectingObjects:function(e,t,n){var o=new ze.Vector2(t/e.width*2-1,-n/e.height*2+1),r=new ze.Raycaster;return r.params.Line.threshold=e.lineHoverPrecision,r.setFromCamera(o,e.camera),r.intersectObjects(e.objects,!0)},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},postProcessingComposer:function(e){return e.postProcessingComposer},controls:function(e){return e.controls},tbControls:function(e){return e.controls}},stateInit:function(){return{scene:new ze.Scene,camera:new ze.PerspectiveCamera,clock:new ze.Clock}},init:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,a=void 0===r?"trackball":r,i=n.rendererConfig,s=void 0===i?{}:i,c=n.extraRenderers,u=void 0===c?[]:c,h=n.waitForLoadComplete,d=void 0===h||h;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.className="scene-container",t.container.style.position="relative",t.container.appendChild(t.navInfo=document.createElement("div")),t.navInfo.className="scene-nav-info",t.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[a]||"",t.navInfo.style.display=t.showNavInfo?null:"none",t.toolTipElem=document.createElement("div"),t.toolTipElem.classList.add("scene-tooltip"),t.container.appendChild(t.toolTipElem),t.pointerPos=new ze.Vector2,t.pointerPos.x=-2,t.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(e){return t.container.addEventListener(e,(function(n){if("pointerdown"===e&&(t.isPointerPressed=!0),!t.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||t.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(e){return Math.abs(e)>1})))&&(t.isPointerDragging=!0),t.enablePointerInteraction){var o=(r=t.container,a=r.getBoundingClientRect(),i=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:a.top+s,left:a.left+i});t.pointerPos.x=n.pageX-o.left,t.pointerPos.y=n.pageY-o.top,t.toolTipElem.style.top="".concat(t.pointerPos.y,"px"),t.toolTipElem.style.left="".concat(t.pointerPos.x,"px"),t.toolTipElem.style.transform="translate(-".concat(t.pointerPos.x/t.width*100,"%, 21px)")}var r,a,i,s}),{passive:!0})})),t.container.addEventListener("pointerup",(function(e){t.isPointerPressed=!1,t.isPointerDragging&&(t.isPointerDragging=!1,!t.clickAfterDrag)||requestAnimationFrame((function(){0===e.button&&t.onClick(t.hoverObj||null,e,t.intersectionPoint),2===e.button&&t.onRightClick&&t.onRightClick(t.hoverObj||null,e,t.intersectionPoint)}))}),{passive:!0,capture:!0}),t.container.addEventListener("contextmenu",(function(e){t.onRightClick&&e.preventDefault()})),t.renderer=new ze.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},s)),t.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),t.container.appendChild(t.renderer.domElement),t.extraRenderers=u,t.extraRenderers.forEach((function(e){e.domElement.style.position="absolute",e.domElement.style.top="0px",e.domElement.style.pointerEvents="none",t.container.appendChild(e.domElement)})),t.postProcessingComposer=new P(t.renderer),t.postProcessingComposer.addPass(new x(t.scene,t.camera)),t.controls=new{trackball:l,orbit:p,fly:m}[a](t.camera,t.renderer.domElement),"fly"===a&&(t.controls.movementSpeed=300,t.controls.rollSpeed=Math.PI/6,t.controls.dragToLook=!0),"trackball"!==a&&"orbit"!==a||(t.controls.minDistance=.1,t.controls.maxDistance=t.skyRadius,t.controls.addEventListener("start",(function(){t.controlsEngaged=!0})),t.controls.addEventListener("change",(function(){t.controlsEngaged&&(t.controlsDragging=!0)})),t.controls.addEventListener("end",(function(){t.controlsEngaged=!1,t.controlsDragging=!1}))),[t.renderer,t.postProcessingComposer].concat(o(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix(),t.camera.position.z=1e3,t.scene.add(t.skysphere=new ze.Mesh),t.skysphere.visible=!1,t.loadComplete=t.scene.visible=!d,window.scene=t.scene},update:function(e,t){if(e.width&&e.height&&(t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&(e.container.style.width=e.width,e.container.style.height=e.height,[e.renderer,e.postProcessingComposer].concat(o(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix()),t.hasOwnProperty("skyRadius")&&e.skyRadius&&(e.controls.hasOwnProperty("maxDistance")&&t.skyRadius&&(e.controls.maxDistance=e.skyRadius),e.camera.far=2.5*e.skyRadius,e.camera.updateProjectionMatrix(),e.skysphere.geometry=new ze.SphereGeometry(e.skyRadius)),t.hasOwnProperty("backgroundColor")){var n=G(e.backgroundColor).alpha;void 0===n&&(n=1),e.renderer.setClearColor(new ze.Color(re(1,e.backgroundColor)),n)}function r(){e.loadComplete=e.scene.visible=!0}t.hasOwnProperty("backgroundImageUrl")&&(e.backgroundImageUrl?(new ze.TextureLoader).load(e.backgroundImageUrl,(function(t){e.skysphere.material=new ze.MeshBasicMaterial({map:t,side:ze.BackSide}),e.skysphere.visible=!0,e.onBackgroundImageLoaded&&setTimeout(e.onBackgroundImageLoaded),!e.loadComplete&&r()})):(e.skysphere.visible=!1,e.skysphere.material.map=null,!e.loadComplete&&r())),t.hasOwnProperty("showNavInfo")&&(e.navInfo.style.display=e.showNavInfo?null:"none"),t.hasOwnProperty("objects")&&((t.objects||[]).forEach((function(t){return e.scene.remove(t)})),e.objects.forEach((function(t){return e.scene.add(t)})))}},Te=Pe.stateInit,xe=void 0===Te?function(){return{}}:Te,Ce=Pe.props,je=void 0===Ce?{}:Ce,Oe=Pe.methods,Re=void 0===Oe?{}:Oe,Le=Pe.aliases,Me=void 0===Le?{}:Le,De=Pe.init,Ae=void 0===De?function(){}:De,Ie=Pe.update,Ve=void 0===Ie?function(){}:Ie,Fe=Object.keys(je).map((function(e){return new ke(e,je[e])})),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},xe instanceof Function?xe(e):xe,{initialised:!1}),n={};function o(t){return r(t,e),a(),o}var r=function(e,n){Ae.call(o,e,t,n),t.initialised=!0},a=Ee((function(){t.initialised&&(Ve.call(o,t,n),n={})}),1);return Fe.forEach((function(e){o[e.name]=function(e){var r=e.name,i=e.triggerUpdate,s=void 0!==i&&i,c=e.onChange,l=void 0===c?function(e,t){}:c,u=e.defaultVal,h=void 0===u?null:u;return function(e){var i=t[r];if(!arguments.length)return i;var c=void 0===e?h:e;return t[r]=c,l.call(o,c,t,i),!n.hasOwnProperty(r)&&(n[r]=i),s&&a(),o}}(e)})),Object.keys(Re).forEach((function(e){o[e]=function(){for(var n,r=arguments.length,a=new Array(r),i=0;i