You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
644 KiB

!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={"exports":{},"id":r,"loaded":!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";var r=n(2),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(r),a=new i.WebGLRenderer;a.setSize(window.innerWidth,window.innerHeight),document.body.appendChild(a.domElement);var o=new i.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,500);o.position.set(0,0,100),o.lookAt(0,0,0);var s=new i.Scene,c=new i.LineBasicMaterial({"color":255}),l=[];l.push(new i.Vector3(-10,0,0)),l.push(new i.Vector3(0,10,0)),l.push(new i.Vector3(10,0,0));var h=(new i.BufferGeometry).setFromPoints(l),u=new i.Line(h,c);s.add(u),a.render(s,o)},function(t,e,n){var r,i,a,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(n,s){"object"===o(e)&&void 0!==t?s(e):(i=[e],r=s,void 0!==(a="function"==typeof r?r.apply(e,i):r)&&(t.exports=a))}(0,function(t){"use strict";function e(){}function n(t,e,r,i,a,o,s,c,l,h){Object.defineProperty(this,"id",{"value":bl++}),this.uuid=fl.generateUUID(),this.name="",this.image=void 0!==t?t:n.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:n.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:As,this.wrapT=void 0!==i?i:As,this.magFilter=void 0!==a?a:Os,this.minFilter=void 0!==o?o:Ds,this.anisotropy=void 0!==l?l:1,this.format=void 0!==s?s:Zs,this.internalFormat=null,this.type=void 0!==c?c:Ns,this.offset=new ml(0,0),this.repeat=new ml(1,1),this.center=new ml(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new gl,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:Yc,this.version=0,this.onUpdate=null}function r(t,e,r){this.width=t,this.height=e,this.scissor=new _l(0,0,t,e),this.scissorTest=!1,this.viewport=new _l(0,0,t,e),r=r||{},this.texture=new n(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,this.texture.minFilter=void 0!==r.minFilter?r.minFilter:Os,this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0!==r.stencilBuffer&&r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function i(t,e,n){r.call(this,t,e,n),this.samples=4}function a(t,e,n,r,i){for(var a=0,o=t.length-3;a<=o;a+=3){Hl.fromArray(t,a);var s=i.x*Math.abs(Hl.x)+i.y*Math.abs(Hl.y)+i.z*Math.abs(Hl.z),c=e.dot(Hl),l=n.dot(Hl),h=r.dot(Hl);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>s)return!1}return!0}function s(){function t(){i.setFromEuler(r,!1)}function e(){r.setFromQuaternion(i,void 0,!1)}Object.defineProperty(this,"id",{"value":uh++}),this.uuid=fl.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=s.DefaultUp.clone();var n=new Tl,r=new oh,i=new Ml,a=new Tl(1,1,1);r._onChange(t),i._onChange(e),Object.defineProperties(this,{"position":{"configurable":!0,"enumerable":!0,"value":n},"rotation":{"configurable":!0,"enumerable":!0,"value":r},"quaternion":{"configurable":!0,"enumerable":!0,"value":i},"scale":{"configurable":!0,"enumerable":!0,"value":a},"modelViewMatrix":{"value":new Kl},"normalMatrix":{"value":new gl}}),this.matrix=new Kl,this.matrixWorld=new Kl,this.matrixAutoUpdate=s.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new hh,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function c(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function l(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function h(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function u(){Object.defineProperty(this,"id",{"value":jh++}),this.uuid=fl.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=Bo,this.side=Oo,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Jo,this.blendDst=Qo,this.blendEquation=Ho,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=os,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=sl,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ol,this.stencilZFail=ol,this.stencilZPass=ol,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function p(t){u.call(this),this.type="MeshBasicMaterial",this.color=new kh(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=us,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}function d(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=cl,this.updateRange={"offset":0,"count":-1},this.version=0}function f(t,e,n){d.call(this,new Int8Array(t),e,n)}function m(t,e,n){d.call(this,new Uint8Array(t),e,n)}function v(t,e,n){d.call(this,new Uint8ClampedArray(t),e,n)}function g(t,e,n){d.call(this,new Int16Array(t),e,n)}function y(t,e,n){d.call(this,new Uint16Array(t),e,n)}function x(t,e,n){d.call(this,new Int32Array(t),e,n)}function b(t,e,n){d.call(this,new Uint32Array(t),e,n)}function _(t,e,n){d.call(this,new Float32Array(t),e,n)}function w(t,e,n){d.call(this,new Float64Array(t),e,n)}function M(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}function S(){Object.defineProperty(this,"id",{"value":Yh+=2}),this.uuid=fl.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={"start":0,"count":1/0},this.userData={}}function T(t,e){s.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new S,this.material=void 0!==e?e:new p,this.updateMorphTargets()}function E(t,e,n,r,i,a,o,s){if(null===(e.side===Io?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,e.side!==Do,s)))return null;gu.copy(s),gu.applyMatrix4(t.matrixWorld);var c=n.ray.origin.distanceTo(gu);return c<n.near||c>n.far?null:{"distance":c,"point":gu.clone(),"object":t}}function A(t,e,n,r,i,a,o,s,c,l,h,u){iu.fromBufferAttribute(i,l),au.fromBufferAttribute(i,h),ou.fromBufferAttribute(i,u);var p=t.morphTargetInfluences;if(e.morphTargets&&a&&p){hu.set(0,0,0),uu.set(0,0,0),pu.set(0,0,0);for(var d=0,f=a.length;d<f;d++){var m=p[d],v=a[d];0!==m&&(su.fromBufferAttribute(v,l),cu.fromBufferAttribute(v,h),lu.fromBufferAttribute(v,u),o?(hu.addScaledVector(su,m),uu.addScaledVector(cu,m),pu.addScaledVector(lu,m)):(hu.addScaledVector(su.sub(iu),m),uu.addScaledVector(cu.sub(au),m),pu.addScaledVector(lu.sub(ou),m)))}iu.add(hu),au.add(uu),ou.add(pu)}t.isSkinnedMesh&&(t.boneTransform(l,iu),t.boneTransform(h,au),t.boneTransform(u,ou));var g=E(t,e,n,r,iu,au,ou,vu);if(g){s&&(du.fromBufferAttribute(s,l),fu.fromBufferAttribute(s,h),mu.fromBufferAttribute(s,u),g.uv=Gh.getUV(vu,iu,au,ou,du,fu,mu,new ml)),c&&(du.fromBufferAttribute(c,l),fu.fromBufferAttribute(c,h),mu.fromBufferAttribute(c,u),g.uv2=Gh.getUV(vu,iu,au,ou,du,fu,mu,new ml));var y=new Vh(l,h,u);Gh.getNormal(iu,au,ou,y.normal),g.face=y}return g}function L(){Object.defineProperty(this,"id",{"value":yu+=2}),this.uuid=fl.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function R(t,e,n,r,i,a){L.call(this),this.type="BoxGeometry",this.parameters={"width":t,"height":e,"depth":n,"widthSegments":r,"heightSegments":i,"depthSegments":a},this.fromBufferGeometry(new P(t,e,n,r,i,a)),this.mergeVertices()}function P(t,e,n,r,i,a){function o(t,e,n,r,i,a,o,f,m,v,g){for(var y=a/m,x=o/v,b=a/2,_=o/2,w=f/2,M=m+1,S=v+1,T=0,E=0,A=new Tl,L=0;L<S;L++)for(var R=L*x-_,P=0;P<M;P++){var C=P*y-b;A[t]=C*r,A[e]=R*i,A[n]=w,l.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=f>0?1:-1,h.push(A.x,A.y,A.z),u.push(P/m),u.push(1-L/v),T+=1}for(var O=0;O<v;O++)for(var I=0;I<m;I++){var D=p+I+M*O,N=p+I+M*(O+1),B=p+(I+1)+M*(O+1),z=p+(I+1)+M*O;c.push(D,N,z),c.push(N,B,z),E+=6}s.addGroup(d,E,g),d+=E,p+=T}void 0===t&&(t=1),void 0===e&&(e=1),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=1),void 0===a&&(a=1),S.call(this),this.type="BoxBufferGeometry",this.parameters={"width":t,"height":e,"depth":n,"widthSegments":r,"heightSegments":i,"depthSegments":a};var s=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);var c=[],l=[],h=[],u=[],p=0,d=0;o("z","y","x",-1,-1,n,e,t,a,i,0),o("z","y","x",1,-1,n,e,-t,a,i,1),o("x","z","y",1,1,t,n,e,r,a,2),o("x","z","y",1,-1,t,n,-e,r,a,3),o("x","y","z",1,-1,t,e,n,r,i,4),o("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(c),this.setAttribute("position",new _(l,3)),this.setAttribute("normal",new _(h,3)),this.setAttribute("uv",new _(u,2))}function C(t){var e={};for(var n in t){e[n]={};for(var r in t[n]){var i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function O(t){for(var e={},n=0;n<t.length;n++){var r=C(t[n]);for(var i in r)e[i]=r[i]}return e}function I(t){u.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Mu,this.fragmentShader=Su,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={"derivatives":!1,"fragDepth":!1,"drawBuffers":!1,"shaderTextureLOD":!1},this.defaultAttributeValues={"color":[1,1,1],"uv":[0,0],"uv2":[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function D(){s.call(this),this.type="Camera",this.matrixWorldInverse=new Kl,this.projectionMatrix=new Kl,this.projectionMatrixInverse=new Kl}function N(t,e,n,r){D.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function B(t,e,n){if(s.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;var r=new N(Tu,Eu,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Tl(1,0,0)),this.add(r);var i=new N(Tu,Eu,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Tl(-1,0,0)),this.add(i);var a=new N(Tu,Eu,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new Tl(0,1,0)),this.add(a);var o=new N(Tu,Eu,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Tl(0,-1,0)),this.add(o);var c=new N(Tu,Eu,t,e);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Tl(0,0,1)),this.add(c);var l=new N(Tu,Eu,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Tl(0,0,-1)),this.add(l),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var s=t.xr.enabled,h=t.getRenderTarget();t.xr.enabled=!1;var u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,r),t.setRenderTarget(n,1),t.render(e,i),t.setRenderTarget(n,2),t.render(e,a),t.setRenderTarget(n,3),t.render(e,o),t.setRenderTarget(n,4),t.render(e,c),n.texture.generateMipmaps=u,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(h),t.xr.enabled=s},this.clear=function(t,e,r,i){for(var a=t.getRenderTarget(),o=0;o<6;o++)t.setRenderTarget(n,o),t.clear(e,r,i);t.setRenderTarget(a)}}function z(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),r.call(this,t,t,e),this.texture.isWebGLCubeRenderTargetTexture=!0}function G(t,e,r,i,a,o,s,c,l,h,u,p){n.call(this,null,o,s,c,l,h,i,a,u,p),this.image={"data":t||null,"width":e||1,"height":r||1},this.magFilter=void 0!==l?l:Rs,this.minFilter=void 0!==h?h:Rs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}function F(){function t(n,a){r(n,a),i=e.requestAnimationFrame(t)}var e=null,n=!1,r=null,i=null;return{"start":function(){!0!==n&&null!==r&&(i=e.requestAnimationFrame(t),n=!0)},"stop":function(){e.cancelAnimationFrame(i),n=!1},"setAnimationLoop":function(t){r=t},"setContext":function(t){e=t}}}function U(t,e){function n(e,n){var r=e.array,i=e.usage,a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,r,i),e.onUploadCallback();var o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{"buffer":a,"type":o,"bytesPerElement":r.BYTES_PER_ELEMENT,"version":e.version}}function r(e,n,r){var i=n.array,a=n.updateRange;t.bindBuffer(r,e),-1===a.count?t.bufferSubData(r,0,i):(s?t.bufferSubData(r,a.offset*i.BYTES_PER_ELEMENT,i,a.offset,a.count):t.bufferSubData(r,a.offset*i.BYTES_PER_ELEMENT,i.subarray(a.offset,a.offset+a.count)),a.count=-1)}function i(t){return t.isInterleavedBufferAttribute&&(t=t.data),c.get(t)}function a(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=c.get(e);n&&(t.deleteBuffer(n.buffer),c.delete(e))}function o(t,e){if(t.isGLBufferAttribute){var i=c.get(t);return void((!i||i.version<t.version)&&c.set(t,{"buffer":t.buffer,"type":t.type,"bytesPerElement":t.elementSize,"version":t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);var a=c.get(t);void 0===a?c.set(t,n(t,e)):a.version<t.version&&(r(a.buffer,t,e),a.version=t.version)}var s=e.isWebGL2,c=new WeakMap;return{"get":i,"remove":a,"update":o}}function H(t,e,n,r){L.call(this),this.type="PlaneGeometry",this.parameters={"width":t,"height":e,"widthSegments":n,"heightSegments":r},this.fromBufferGeometry(new k(t,e,n,r)),this.mergeVertices()}function k(t,e,n,r){S.call(this),this.type="PlaneBufferGeometry",this.parameters={"width":t,"height":e,"widthSegments":n,"heightSegments":r},t=t||1,e=e||1;for(var i=t/2,a=e/2,o=Math.floor(n)||1,s=Math.floor(r)||1,c=o+1,l=s+1,h=t/o,u=e/s,p=[],d=[],f=[],m=[],v=0;v<l;v++)for(var g=v*u-a,y=0;y<c;y++){var x=y*h-i;d.push(x,-g,0),f.push(0,0,1),m.push(y/o),m.push(1-v/s)}for(var b=0;b<s;b++)for(var w=0;w<o;w++){var M=w+c*b,T=w+c*(b+1),E=w+1+c*(b+1),A=w+1+c*b;p.push(M,T,A),p.push(T,E,A)}this.setIndex(p),this.setAttribute("position",new _(d,3)),this.setAttribute("normal",new _(f,3)),this.setAttribute("uv",new _(m,2))}function V(t,e,n,r,i){function a(n,i,a,f){var m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=e.get(m));var v=t.xr,g=v.getSession&&v.getSession();g&&"additive"===g.environmentBlendMode&&(m=null),null===m?o(l,h):m&&m.isColor&&(o(m,1),f=!0),(t.autoClear||f)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.isWebGLCubeRenderTargetTexture||m.mapping===Ss)?(void 0===c&&(c=new T(new P(1,1,1),new I({"name":"BackgroundCubeMaterial","uniforms":C(Ou.cube.uniforms),"vertexShader":Ou.cube.vertexShader,"fragmentShader":Ou.cube.fragmentShader,"side":Io,"depthTest":!1,"depthWrite":!1,"fog":!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{"get":function(){return this.uniforms.envMap.value}}),r.update(c)),m.isWebGLCubeRenderTarget&&(m=m.texture),c.material.uniforms.envMap.value=m,c.material.uniforms.flipEnvMap.value=m.isCubeTexture?-1:1,u===m&&p===m.version&&d===t.toneMapping||(c.material.needsUpdate=!0,u=m,p=m.version,d=t.toneMapping),n.unshift(c,c.geometry,c.material,0,0,null)):m&&m.isTexture&&(void 0===s&&(s=new T(new k(2,2),new I({"name":"BackgroundMaterial","uniforms":C(Ou.background.uniforms),"vertexShader":Ou.background.vertexShader,"fragmentShader":Ou.background.fragmentShader,"side":Oo,"depthTest":!1,"depthWrite":!1,"fog":!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{"get":function(){return this.uniforms.t2D.value}}),r.update(s)),s.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),s.material.uniforms.uvTransform.value.copy(m.matrix),u===m&&p===m.version&&d===t.toneMapping||(s.material.needsUpdate=!0,u=m,p=m.version,d=t.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null))}function o(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,i)}var s,c,l=new kh(0),h=0,u=null,p=0,d=null;return{"getClearColor":function(){return l},"setClearColor":function(t,e){l.set(t),h=void 0!==e?e:1,o(l,h)},"getClearAlpha":function(){return h},"setClearAlpha":function(t){h=t,o(l,h)},"render":a}}function j(t,e,n,r){function i(e,r,i,a,s){var l=!1;if(T){var p=c(a,i,r);L!==p&&(L=p,o(L.object)),l=h(a,s),l&&u(a,s)}else{var d=!0===r.wireframe;L.geometry===a.id&&L.program===i.id&&L.wireframe===d||(L.geometry=a.id,L.program=i.id,L.wireframe=d,l=!0)}!0===e.isInstancedMesh&&(l=!0),null!==s&&n.update(s,34963),l&&(g(e,r,i,a),null!==s&&t.bindBuffer(34963,n.get(s).buffer))}function a(){return r.isWebGL2?t.createVertexArray():S.createVertexArrayOES()}function o(e){return r.isWebGL2?t.bindVertexArray(e):S.bindVertexArrayOES(e)}function s(e){return r.isWebGL2?t.deleteVertexArray(e):S.deleteVertexArrayOES(e)}function c(t,e,n){var r=!0===n.wireframe,i=E[t.id];void 0===i&&(i={},E[t.id]=i);var o=i[e.id];void 0===o&&(o={},i[e.id]=o);var s=o[r];return void 0===s&&(s=l(a()),o[r]=s),s}function l(t){for(var e=[],n=[],r=[],i=0;i<M;i++)e[i]=0,n[i]=0,r[i]=0;return{"geometry":null,"program":null,"wireframe":!1,"newAttributes":e,"enabledAttributes":n,"attributeDivisors":r,"object":t,"attributes":{},"index":null}}function h(t,e){var n=L.attributes,r=t.attributes;if(Object.keys(n).length!==Object.keys(r).length)return!0;for(var i in r){var a=n[i],o=r[i];if(void 0===a)return!0;if(a.attribute!==o)return!0;if(a.data!==o.data)return!0}return L.index!==e}function u(t,e){var n={},r=t.attributes;for(var i in r){var a=r[i],o={};o.attribute=a,a.data&&(o.data=a.data),n[i]=o}L.attributes=n,L.index=e}function p(){for(var t=L.newAttributes,e=0,n=t.length;e<n;e++)t[e]=0}function d(t){f(t,0)}function f(n,i){var a=L.newAttributes,o=L.enabledAttributes,s=L.attributeDivisors;if(a[n]=1,0===o[n]&&(t.enableVertexAttribArray(n),o[n]=1),s[n]!==i){(r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i}}function m(){for(var e=L.newAttributes,n=L.enabledAttributes,r=0,i=n.length;r<i;r++)n[r]!==e[r]&&(t.disableVertexAttribArray(r),n[r]=0)}function v(e,n,i,a,o,s){!0!==r.isWebGL2||5124!==i&&5125!==i?t.vertexAttribPointer(e,n,i,a,o,s):t.vertexAttribIPointer(e,n,i,o,s)}function g(i,a,o,s){if(!1!==r.isWebGL2||!i.isInstancedMesh&&!s.isInstancedBufferGeometry||null!==e.get("ANGLE_instanced_arrays")){p();var c=s.attributes,l=o.getAttributes(),h=a.defaultAttributeValues;for(var u in l){var g=l[u];if(g>=0){var y=c[u];if(void 0!==y){var x=y.normalized,b=y.itemSize,_=n.get(y);if(void 0===_)continue;var w=_.buffer,M=_.type,S=_.bytesPerElement;if(y.isInterleavedBufferAttribute){var T=y.data,E=T.stride,A=y.offset;T&&T.isInstancedInterleavedBuffer?(f(g,T.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=T.meshPerAttribute*T.count)):d(g),t.bindBuffer(34962,w),v(g,b,M,x,E*S,A*S)}else y.isInstancedBufferAttribute?(f(g,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):d(g),t.bindBuffer(34962,w),v(g,b,M,x,0,0)}else if("instanceMatrix"===u){var L=n.get(i.instanceMatrix);if(void 0===L)continue;var R=L.buffer,P=L.type;f(g+0,1),f(g+1,1),f(g+2,1),f(g+3,1),t.bindBuffer(34962,R),t.vertexAttribPointer(g+0,4,P,!1,64,0),t.vertexAttribPointer(g+1,4,P,!1,64,16),t.vertexAttribPointer(g+2,4,P,!1,64,32),t.vertexAttribPointer(g+3,4,P,!1,64,48)}else if("instanceColor"===u){var C=n.get(i.instanceColor);if(void 0===C)continue;var O=C.buffer,I=C.type;f(g,1),t.bindBuffer(34962,O),t.vertexAttribPointer(g,3,I,!1,12,0)}else if(void 0!==h){var D=h[u];if(void 0!==D)switch(D.length){case 2:t.vertexAttrib2fv(g,D);break;case 3:t.vertexAttrib3fv(g,D);break;case 4:t.vertexAttrib4fv(g,D);break;default:t.vertexAttrib1fv(g,D)}}}}m()}}function y(){_();for(var t in E){var e=E[t];for(var n in e){var r=e[n];for(var i in r)s(r[i].object),delete r[i];delete e[n]}delete E[t]}}function x(t){if(void 0!==E[t.id]){var e=E[t.id];for(var n in e){var r=e[n];for(var i in r)s(r[i].object),delete r[i];delete e[n]}delete E[t.id]}}function b(t){for(var e in E){var n=E[e];if(void 0!==n[t.id]){var r=n[t.id];for(var i in r)s(r[i].object),delete r[i];delete n[t.id]}}}function _(){w(),L!==A&&(L=A,o(L.object))}function w(){A.geometry=null,A.program=null,A.wireframe=!1}var M=t.getParameter(34921),S=r.isWebGL2?null:e.get("OES_vertex_array_object"),T=r.isWebGL2||null!==S,E={},A=l(null),L=A;return{"setup":i,"reset":_,"resetDefaultState":w,"dispose":y,"releaseStatesOfGeometry":x,"releaseStatesOfProgram":b,"initAttributes":p,"enableAttribute":d,"disableUnusedAttributes":m}}function W(t,e,n,r){function i(t){s=t}function a(e,r){t.drawArrays(s,e,r),n.update(r,s,1)}function o(r,i,a){if(0!==a){var o,l;if(c)o=t,l="drawArraysInstanced";else if(o=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===o)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");o[l](s,r,i,a),n.update(i,s,a)}}var s,c=r.isWebGL2;this.setMode=i,this.render=a,this.renderInstances=o}function q(t,e,n){function r(){if(void 0!==a)return a;var n=e.get("EXT_texture_filter_anisotropic");return a=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a,o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,s=void 0!==n.precision?n.precision:"highp",c=i(s);c!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",c,"instead."),s=c);var l=!0===n.logarithmicDepthBuffer,h=t.getParameter(34930),u=t.getParameter(35660),p=t.getParameter(3379),d=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),v=t.getParameter(36348),g=t.getParameter(36349),y=u>0,x=o||!!e.get("OES_texture_float");return{"isWebGL2":o,"getMaxAnisotropy":r,"getMaxPrecision":i,"precision":s,"logarithmicDepthBuffer":l,"maxTextures":h,"maxVertexTextures":u,"maxTextureSize":p,"maxCubemapSize":d,"maxAttributes":f,"maxVertexUniforms":m,"maxVaryings":v,"maxFragmentUniforms":g,"vertexTextures":y,"floatFragmentTextures":x,"floatVertexTextures":y&&x,"maxSamples":o?t.getParameter(36183):0}}function X(t){function e(){h.value!==i&&(h.value=i,h.needsUpdate=a>0),r.numPlanes=a,r.numIntersection=0}function n(t,e,n,i){var a=null!==t?t.length:0,o=null;if(0!==a){if(o=h.value,!0!==i||null===o){var s=n+4*a,u=e.matrixWorldInverse;l.getNormalMatrix(u),(null===o||o.length<s)&&(o=new Float32Array(s));for(var p=0,d=n;p!==a;++p,d+=4)c.copy(t[p]).applyMatrix4(u,l),c.normal.toArray(o,d),o[d+3]=c.constant}h.value=o,h.needsUpdate=!0}return r.numPlanes=a,r.numIntersection=0,o}var r=this,i=null,a=0,o=!1,s=!1,c=new Ah,l=new gl,h={"value":null,"needsUpdate":!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,r){var s=0!==t.length||e||0!==a||o;return o=e,i=n(t,r,0),a=t.length,s},this.beginShadows=function(){s=!0,n(null)},this.endShadows=function(){s=!1,e()},this.setState=function(r,c,l){var u=r.clippingPlanes,p=r.clipIntersection,d=r.clipShadows,f=t.get(r);if(!o||null===u||0===u.length||s&&!d)s?n(null):e();else{var m=s?0:a,v=4*m,g=f.clippingState||null;h.value=g,g=n(u,c,v,l);for(var y=0;y!==v;++y)g[y]=i[y];f.clippingState=g,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=m}}}function Y(t){function e(t,e){return e===ws?t.mapping=bs:e===Ms&&(t.mapping=_s),t}function n(n){if(n&&n.isTexture){var r=n.mapping;if(r===ws||r===Ms){if(i.has(n)){return e(i.get(n).texture,n.mapping)}var a=n.image;if(a&&a.height>0){var o=t.getRenderList(),s=t.getRenderTarget(),c=t.getRenderState(),l=new z(a.height/2);return l.fromEquirectangularTexture(t,n),i.set(n,l),t.setRenderTarget(s),t.setRenderList(o),t.setRenderState(c),e(l.texture,n.mapping)}return null}}return n}function r(){i=new WeakMap}var i=new WeakMap;return{"get":n,"dispose":r}}function Z(t){var e={};return{"has":function(n){if(void 0!==e[n])return null!==e[n];var r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,null!==r},"get":function(t){return this.has(t)||console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e[t]}}}function J(t,e,n,r){function i(t){var a=t.target,o=l.get(a);null!==o.index&&e.remove(o.index);for(var s in o.attributes)e.remove(o.attributes[s]);a.removeEventListener("dispose",i),l.delete(a);var c=h.get(o);c&&(e.remove(c),h.delete(o)),r.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(t,e){var r=l.get(e);return r||(e.addEventListener("dispose",i),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new S).setFromObject(t)),r=e._bufferGeometry),l.set(e,r),n.memory.geometries++,r)}function o(t){var n=t.attributes;for(var r in n)e.update(n[r],34962);var i=t.morphAttributes;for(var a in i)for(var o=i[a],s=0,c=o.length;s<c;s++)e.update(o[s],34962)}function s(t){var n=[],r=t.index,i=t.attributes.position,a=0;if(null!==r){var o=r.array;a=r.version;for(var s=0,c=o.length;s<c;s+=3){var l=o[s+0],u=o[s+1],p=o[s+2];n.push(l,u,u,p,p,l)}}else{var d=i.array;a=i.version;for(var f=0,m=d.length/3-1;f<m;f+=3){var v=f+0,g=f+1,x=f+2;n.push(v,g,g,x,x,v)}}var _=new(M(n)>65535?b:y)(n,1);_.version=a;var w=h.get(t);w&&e.remove(w),h.set(t,_)}function c(t){var e=h.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&s(t)}else s(t);return h.get(t)}var l=new WeakMap,h=new WeakMap;return{"get":a,"update":o,"getWireframeAttribute":c}}function Q(t,e,n,r){function i(t){c=t}function a(t){l=t.type,h=t.bytesPerElement}function o(e,r){t.drawElements(c,r,l,e*h),n.update(r,c,1)}function s(r,i,a){if(0!==a){var o,s;if(u)o=t,s="drawElementsInstanced";else if(o=e.get("ANGLE_instanced_arrays"),s="drawElementsInstancedANGLE",null===o)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");o[s](c,i,l,r*h,a),n.update(i,c,a)}}var c,l,h,u=r.isWebGL2;this.setMode=i,this.setIndex=a,this.render=o,this.renderInstances=s}function K(t){function e(t,e,n){switch(i.calls++,e){case 4:i.triangles+=n*(t/3);break;case 1:i.lines+=n*(t/2);break;case 3:i.lines+=n*(t-1);break;case 2:i.lines+=n*t;break;case 0:i.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e)}}function n(){i.frame++,i.calls=0,i.triangles=0,i.points=0,i.lines=0}var r={"geometries":0,"textures":0},i={"frame":0,"calls":0,"triangles":0,"points":0,"lines":0};return{"memory":r,"render":i,"programs":null,"autoReset":!0,"reset":n,"update":e}}function $(t,e){return t[0]-e[0]}function tt(t,e){return Math.abs(e[1])-Math.abs(t[1])}function et(t){function e(e,a,o,s){var c=e.morphTargetInfluences,l=void 0===c?0:c.length,h=n[a.id];if(void 0===h){h=[];for(var u=0;u<l;u++)h[u]=[u,0];n[a.id]=h}for(var p=0;p<l;p++){var d=h[p];d[0]=p,d[1]=c[p]}h.sort(tt);for(var f=0;f<8;f++)f<l&&h[f][1]?(i[f][0]=h[f][0],i[f][1]=h[f][1]):(i[f][0]=Number.MAX_SAFE_INTEGER,i[f][1]=0);i.sort($);for(var m=o.morphTargets&&a.morphAttributes.position,v=o.morphNormals&&a.morphAttributes.normal,g=0,y=0;y<8;y++){var x=i[y],b=x[0],_=x[1];b!==Number.MAX_SAFE_INTEGER&&_?(m&&a.getAttribute("morphTarget"+y)!==m[b]&&a.setAttribute("morphTarget"+y,m[b]),v&&a.getAttribute("morphNormal"+y)!==v[b]&&a.setAttribute("morphNormal"+y,v[b]),r[y]=_,g+=_):(m&&void 0!==a.getAttribute("morphTarget"+y)&&a.deleteAttribute("morphTarget"+y),v&&void 0!==a.getAttribute("morphNormal"+y)&&a.deleteAttribute("morphNormal"+y),r[y]=0)}var w=a.morphTargetsRelative?1:1-g;s.getUniforms().setValue(t,"morphTargetBaseInfluence",w),s.getUniforms().setValue(t,"morphTargetInfluences",r)}for(var n={},r=new Float32Array(8),i=[],a=0;a<8;a++)i[a]=[a,0];return{"update":e}}function nt(t,e,n,r){function i(t){var i=r.render.frame,a=t.geometry,s=e.get(t,a);return o.get(s)!==i&&(a.isGeometry&&s.updateFromObject(t),e.update(s),o.set(s,i)),t.isInstancedMesh&&(n.update(t.instanceMatrix,34962),null!==t.instanceColor&&n.update(t.instanceColor,34962)),s}function a(){o=new WeakMap}var o=new WeakMap;return{"update":i,"dispose":a}}function rt(t,e,r,i,a,o,s,c,l,h){t=void 0!==t?t:[],e=void 0!==e?e:bs,s=void 0!==s?s:Ys,n.call(this,t,e,r,i,a,o,s,c,l,h),this.flipY=!1}function it(t,e,r,i){n.call(this,null),this.image={"data":t||null,"width":e||1,"height":r||1,"depth":i||1},this.magFilter=Rs,this.minFilter=Rs,this.wrapR=As,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function at(t,e,r,i){n.call(this,null),this.image={"data":t||null,"width":e||1,"height":r||1,"depth":i||1},this.magFilter=Rs,this.minFilter=Rs,this.wrapR=As,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function ot(t,e,n){var r=t[0];if(r<=0||r>0)return t;var i=e*n,a=zu[i];if(void 0===a&&(a=new Float32Array(i),zu[i]=a),0!==e){r.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=n,t[o].toArray(a,s)}return a}function st(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function ct(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function lt(t,e){
var n=Gu[e];void 0===n&&(n=new Int32Array(e),Gu[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function ht(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function ut(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(st(n,e))return;t.uniform2fv(this.addr,e),ct(n,e)}}function pt(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(st(n,e))return;t.uniform3fv(this.addr,e),ct(n,e)}}function dt(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(st(n,e))return;t.uniform4fv(this.addr,e),ct(n,e)}}function ft(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(st(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),ct(n,e)}else{if(st(n,r))return;Hu.set(r),t.uniformMatrix2fv(this.addr,!1,Hu),ct(n,r)}}function mt(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(st(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),ct(n,e)}else{if(st(n,r))return;Uu.set(r),t.uniformMatrix3fv(this.addr,!1,Uu),ct(n,r)}}function vt(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(st(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),ct(n,e)}else{if(st(n,r))return;Fu.set(r),t.uniformMatrix4fv(this.addr,!1,Fu),ct(n,r)}}function gt(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||Iu,i)}function yt(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||Du,i)}function xt(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||Nu,i)}function bt(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(e||Bu,i)}function _t(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function wt(t,e){var n=this.cache;st(n,e)||(t.uniform2iv(this.addr,e),ct(n,e))}function Mt(t,e){var n=this.cache;st(n,e)||(t.uniform3iv(this.addr,e),ct(n,e))}function St(t,e){var n=this.cache;st(n,e)||(t.uniform4iv(this.addr,e),ct(n,e))}function Tt(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Et(t){switch(t){case 5126:return ht;case 35664:return ut;case 35665:return pt;case 35666:return dt;case 35674:return ft;case 35675:return mt;case 35676:return vt;case 5124:case 35670:return _t;case 35667:case 35671:return wt;case 35668:case 35672:return Mt;case 35669:case 35673:return St;case 5125:return Tt;case 35678:case 36198:case 36298:case 36306:case 35682:return gt;case 35679:case 36299:case 36307:return xt;case 35680:case 36300:case 36308:case 36293:return bt;case 36289:case 36303:case 36311:case 36292:return yt}}function At(t,e){t.uniform1fv(this.addr,e)}function Lt(t,e){t.uniform1iv(this.addr,e)}function Rt(t,e){t.uniform2iv(this.addr,e)}function Pt(t,e){t.uniform3iv(this.addr,e)}function Ct(t,e){t.uniform4iv(this.addr,e)}function Ot(t,e){var n=ot(e,this.size,2);t.uniform2fv(this.addr,n)}function It(t,e){var n=ot(e,this.size,3);t.uniform3fv(this.addr,n)}function Dt(t,e){var n=ot(e,this.size,4);t.uniform4fv(this.addr,n)}function Nt(t,e){var n=ot(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Bt(t,e){var n=ot(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function zt(t,e){var n=ot(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Gt(t,e,n){var r=e.length,i=lt(n,r);t.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(e[a]||Iu,i[a])}function Ft(t,e,n){var r=e.length,i=lt(n,r);t.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(e[a]||Bu,i[a])}function Ut(t){switch(t){case 5126:return At;case 35664:return Ot;case 35665:return It;case 35666:return Dt;case 35674:return Nt;case 35675:return Bt;case 35676:return zt;case 5124:case 35670:return Lt;case 35667:case 35671:return Rt;case 35668:case 35672:return Pt;case 35669:case 35673:return Ct;case 35678:case 36198:case 36298:case 36306:case 35682:return Gt;case 35680:case 36300:case 36308:case 36293:return Ft}}function Ht(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=Et(e.type)}function kt(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=Ut(e.type)}function Vt(t){this.id=t,this.seq=[],this.map={}}function jt(t,e){t.seq.push(e),t.map[e.id]=e}function Wt(t,e,n){var r=t.name,i=r.length;for(ku.lastIndex=0;;){var a=ku.exec(r),o=ku.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===i){jt(n,void 0===l?new Ht(s,t,e):new kt(s,t,e));break}var h=n.map,u=h[s];void 0===u&&(u=new Vt(s),jt(n,u)),n=u}}function qt(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var i=t.getActiveUniform(e,r);Wt(i,t.getUniformLocation(e,i.name),this)}}function Xt(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}function Yt(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}function Zt(t){switch(t){case Yc:return["Linear","( value )"];case Zc:return["sRGB","( value )"];case Qc:return["RGBE","( value )"];case $c:return["RGBM","( value, 7.0 )"];case tl:return["RGBM","( value, 16.0 )"];case el:return["RGBD","( value, 256.0 )"];case Jc:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Kc:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function Jt(t,e,n){var r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+Yt(t.getShaderSource(e))}function Qt(t,e){var n=Zt(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Kt(t,e){var n=Zt(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function $t(t,e){var n;switch(e){case ms:n="Linear";break;case vs:n="Reinhard";break;case gs:n="OptimizedCineon";break;case ys:n="ACESFilmic";break;case xs:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function te(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(re).join("\n")}function ee(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}function ne(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i<r;i++){var a=t.getActiveAttrib(e,i),o=a.name;n[o]=t.getAttribLocation(e,o)}return n}function re(t){return""!==t}function ie(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function ae(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function oe(t){return t.replace(ju,se)}function se(t,e){var n=Pu[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return oe(n)}function ce(t){return t.replace(qu,he).replace(Wu,le)}function le(t,e,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),he(t,e,n,r)}function he(t,e,n,r){for(var i="",a=parseInt(e);a<parseInt(n);a++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function ue(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function pe(t){var e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===Ro?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===Po?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===Co&&(e="SHADOWMAP_TYPE_VSM"),e}function de(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case bs:case _s:e="ENVMAP_TYPE_CUBE";break;case Ss:case Ts:e="ENVMAP_TYPE_CUBE_UV"}return e}function fe(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case _s:case Ts:e="ENVMAP_MODE_REFRACTION"}return e}function me(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case us:e="ENVMAP_BLENDING_MULTIPLY";break;case ps:e="ENVMAP_BLENDING_MIX";break;case ds:e="ENVMAP_BLENDING_ADD"}return e}function ve(t,e,n,r){var i,a,o=t.getContext(),s=n.defines,c=n.vertexShader,l=n.fragmentShader,h=pe(n),u=de(n),p=fe(n),d=me(n),f=t.gammaFactor>0?t.gammaFactor:1,m=n.isWebGL2?"":te(n),v=ee(s),g=o.createProgram(),y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(i=[v].filter(re).join("\n"),i.length>0&&(i+="\n"),a=[m,v].filter(re).join("\n"),a.length>0&&(a+="\n")):(i=[ue(n),"#define SHADER_NAME "+n.shaderName,v,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+f,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+h:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(re).join("\n"),a=[m,ue(n),"#define SHADER_NAME "+n.shaderName,v,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+p:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+h:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==fs?"#define TONE_MAPPING":"",n.toneMapping!==fs?Pu["tonemapping_pars_fragment"]:"",n.toneMapping!==fs?$t("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Pu["encodings_pars_fragment"],n.map?Qt("mapTexelToLinear",n.mapEncoding):"",n.matcap?Qt("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Qt("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Qt("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Qt("lightMapTexelToLinear",n.lightMapEncoding):"",Kt("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(re).join("\n")),c=oe(c),c=ie(c,n),c=ae(c,n),l=oe(l),l=ie(l,n),l=ae(l,n),c=ce(c),l=ce(l),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,a=["#define varying in",n.glslVersion===hl?"":"out highp vec4 pc_fragColor;",n.glslVersion===hl?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+a);var x=y+i+c,b=y+a+l,_=Xt(o,35633,x),w=Xt(o,35632,b);if(o.attachShader(g,_),o.attachShader(g,w),void 0!==n.index0AttributeName?o.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&o.bindAttribLocation(g,0,"position"),o.linkProgram(g),t.debug.checkShaderErrors){var M=o.getProgramInfoLog(g).trim(),S=o.getShaderInfoLog(_).trim(),T=o.getShaderInfoLog(w).trim(),E=!0,A=!0;if(!1===o.getProgramParameter(g,35714)){E=!1;var L=Jt(o,_,"vertex"),R=Jt(o,w,"fragment");console.error("THREE.WebGLProgram: shader error: ",o.getError(),"35715",o.getProgramParameter(g,35715),"gl.getProgramInfoLog",M,L,R)}else""!==M?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",M):""!==S&&""!==T||(A=!1);A&&(this.diagnostics={"runnable":E,"programLog":M,"vertexShader":{"log":S,"prefix":i},"fragmentShader":{"log":T,"prefix":a}})}o.deleteShader(_),o.deleteShader(w);var P;this.getUniforms=function(){return void 0===P&&(P=new qt(o,g)),P};var C;return this.getAttributes=function(){return void 0===C&&(C=ne(o,g)),C},this.destroy=function(){r.releaseStatesOfProgram(this),o.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=Vu++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=_,this.fragmentShader=w,this}function ge(t,e,n,r,i,a){function o(t){var e=t.skeleton,n=e.bones;if(v)return 1024;var r=g,i=Math.floor((r-20)/4),a=Math.min(i,n.length);return a<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+a+"."),0):a}function s(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=Yc,e}function c(i,c,l,h,u){var p=h.fog,d=i.isMeshStandardMaterial?h.environment:null,g=e.get(i.envMap||d),_=b[i.type],w=u.isSkinnedMesh?o(u):0;null!==i.precision&&(x=r.getMaxPrecision(i.precision))!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",x,"instead.");var M,S;if(_){var T=Ou[_];M=T.vertexShader,S=T.fragmentShader}else M=i.vertexShader,S=i.fragmentShader;var E=t.getRenderTarget();return{"isWebGL2":f,"shaderID":_,"shaderName":i.type,"vertexShader":M,"fragmentShader":S,"defines":i.defines,"isRawShaderMaterial":!0===i.isRawShaderMaterial,"glslVersion":i.glslVersion,"precision":x,"instancing":!0===u.isInstancedMesh,"instancingColor":!0===u.isInstancedMesh&&null!==u.instanceColor,"supportsVertexTextures":y,"outputEncoding":null!==E?s(E.texture):t.outputEncoding,"map":!!i.map,"mapEncoding":s(i.map),"matcap":!!i.matcap,"matcapEncoding":s(i.matcap),"envMap":!!g,"envMapMode":g&&g.mapping,"envMapEncoding":s(g),"envMapCubeUV":!!g&&(g.mapping===Ss||g.mapping===Ts),"lightMap":!!i.lightMap,"lightMapEncoding":s(i.lightMap),"aoMap":!!i.aoMap,"emissiveMap":!!i.emissiveMap,"emissiveMapEncoding":s(i.emissiveMap),"bumpMap":!!i.bumpMap,"normalMap":!!i.normalMap,"objectSpaceNormalMap":i.normalMapType===al,"tangentSpaceNormalMap":i.normalMapType===il,"clearcoatMap":!!i.clearcoatMap,"clearcoatRoughnessMap":!!i.clearcoatRoughnessMap,"clearcoatNormalMap":!!i.clearcoatNormalMap,"displacementMap":!!i.displacementMap,"roughnessMap":!!i.roughnessMap,"metalnessMap":!!i.metalnessMap,"specularMap":!!i.specularMap,"alphaMap":!!i.alphaMap,"gradientMap":!!i.gradientMap,"sheen":!!i.sheen,"transmissionMap":!!i.transmissionMap,"combine":i.combine,"vertexTangents":i.normalMap&&i.vertexTangents,"vertexColors":i.vertexColors,"vertexUvs":!!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatMap||i.clearcoatRoughnessMap||i.clearcoatNormalMap||i.displacementMap||i.transmissionMap),"uvsVertexOnly":!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||i.transmissionMap||!i.displacementMap),"fog":!!p,"useFog":i.fog,"fogExp2":p&&p.isFogExp2,"flatShading":i.flatShading,"sizeAttenuation":i.sizeAttenuation,"logarithmicDepthBuffer":m,"skinning":i.skinning&&w>0,"maxBones":w,"useVertexTexture":v,"morphTargets":i.morphTargets,"morphNormals":i.morphNormals,"maxMorphTargets":t.maxMorphTargets,"maxMorphNormals":t.maxMorphNormals,"numDirLights":c.directional.length,"numPointLights":c.point.length,"numSpotLights":c.spot.length,"numRectAreaLights":c.rectArea.length,"numHemiLights":c.hemi.length,"numDirLightShadows":c.directionalShadowMap.length,"numPointLightShadows":c.pointShadowMap.length,"numSpotLightShadows":c.spotShadowMap.length,"numClippingPlanes":a.numPlanes,"numClipIntersection":a.numIntersection,"dithering":i.dithering,"shadowMapEnabled":t.shadowMap.enabled&&l.length>0,"shadowMapType":t.shadowMap.type,"toneMapping":i.toneMapped?t.toneMapping:fs,"physicallyCorrectLights":t.physicallyCorrectLights,"premultipliedAlpha":i.premultipliedAlpha,"alphaTest":i.alphaTest,"doubleSided":i.side===Do,"flipSided":i.side===Io,"depthPacking":void 0!==i.depthPacking&&i.depthPacking,"index0AttributeName":i.index0AttributeName,"extensionDerivatives":i.extensions&&i.extensions.derivatives,"extensionFragDepth":i.extensions&&i.extensions.fragDepth,"extensionDrawBuffers":i.extensions&&i.extensions.drawBuffers,"extensionShaderTextureLOD":i.extensions&&i.extensions.shaderTextureLOD,"rendererExtensionFragDepth":f||n.has("EXT_frag_depth"),"rendererExtensionDrawBuffers":f||n.has("WEBGL_draw_buffers"),"rendererExtensionShaderTextureLod":f||n.has("EXT_shader_texture_lod"),"customProgramCacheKey":i.customProgramCacheKey()}}function l(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);if(!1===e.isRawShaderMaterial){for(var i=0;i<_.length;i++)n.push(e[_[i]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.customProgramCacheKey),n.join()}function h(t){var e,n=b[t.type];if(n){var r=Ou[n];e=wu.clone(r.uniforms)}else e=t.uniforms;return e}function u(e,n){for(var r,a=0,o=d.length;a<o;a++){var s=d[a];if(s.cacheKey===n){r=s,++r.usedTimes;break}}return void 0===r&&(r=new ve(t,n,e,i),d.push(r)),r}function p(t){if(0==--t.usedTimes){var e=d.indexOf(t);d[e]=d[d.length-1],d.pop(),t.destroy()}}var d=[],f=r.isWebGL2,m=r.logarithmicDepthBuffer,v=r.floatVertexTextures,g=r.maxVertexUniforms,y=r.vertexTextures,x=r.precision,b={"MeshDepthMaterial":"depth","MeshDistanceMaterial":"distanceRGBA","MeshNormalMaterial":"normal","MeshBasicMaterial":"basic","MeshLambertMaterial":"lambert","MeshPhongMaterial":"phong","MeshToonMaterial":"toon","MeshStandardMaterial":"physical","MeshPhysicalMaterial":"physical","MeshMatcapMaterial":"matcap","LineBasicMaterial":"basic","LineDashedMaterial":"dashed","PointsMaterial":"points","ShadowMaterial":"shadow","SpriteMaterial":"sprite"},_=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmissionMap"];return{"getParameters":c,"getProgramCacheKey":l,"getUniforms":h,"acquireProgram":u,"releaseProgram":p,"programs":d}}function ye(){function t(t){var e=i.get(t);return void 0===e&&(e={},i.set(t,e)),e}function e(t){i.delete(t)}function n(t,e,n){i.get(t)[e]=n}function r(){i=new WeakMap}var i=new WeakMap;return{"get":t,"remove":e,"update":n,"dispose":r}}function xe(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function be(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function _e(t){function e(){c=0,l.length=0,h.length=0}function n(e,n,r,i,a,o){var l=s[c],h=t.get(r);return void 0===l?(l={"id":e.id,"object":e,"geometry":n,"material":r,"program":h.program||u,"groupOrder":i,"renderOrder":e.renderOrder,"z":a,"group":o},s[c]=l):(l.id=e.id,l.object=e,l.geometry=n,l.material=r,l.program=h.program||u,l.groupOrder=i,l.renderOrder=e.renderOrder,l.z=a,l.group=o),c++,l}function r(t,e,r,i,a,o){var s=n(t,e,r,i,a,o);(!0===r.transparent?h:l).push(s)}function i(t,e,r,i,a,o){var s=n(t,e,r,i,a,o);(!0===r.transparent?h:l).unshift(s)}function a(t,e){l.length>1&&l.sort(t||xe),h.length>1&&h.sort(e||be)}function o(){for(var t=c,e=s.length;t<e;t++){var n=s[t];if(null===n.id)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.program=null,n.group=null}}var s=[],c=0,l=[],h=[],u={"id":-1};return{"opaque":l,"transparent":h,"init":e,"push":r,"unshift":i,"finish":o,"sort":a}}function we(t){function e(e,n){var i,a=r.get(e);return void 0===a?(i=new _e(t),r.set(e,new WeakMap),r.get(e).set(n,i)):void 0===(i=a.get(n))&&(i=new _e(t),a.set(n,i)),i}function n(){r=new WeakMap}var r=new WeakMap;return{"get":e,"dispose":n}}function Me(){var t={};return{"get":function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={"direction":new Tl,"color":new kh};break;case"SpotLight":n={"position":new Tl,"direction":new Tl,"color":new kh,"distance":0,"coneCos":0,"penumbraCos":0,"decay":0};break;case"PointLight":n={"position":new Tl,"color":new kh,"distance":0,"decay":0};break;case"HemisphereLight":n={"direction":new Tl,"skyColor":new kh,"groundColor":new kh};break;case"RectAreaLight":n={"color":new kh,"position":new Tl,"halfWidth":new Tl,"halfHeight":new Tl}}return t[e.id]=n,n}}}function Se(){var t={};return{"get":function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":case"SpotLight":n={"shadowBias":0,"shadowNormalBias":0,"shadowRadius":1,"shadowMapSize":new ml};break;case"PointLight":n={"shadowBias":0,"shadowNormalBias":0,"shadowRadius":1,"shadowMapSize":new ml,"shadowCameraNear":1,"shadowCameraFar":1e3}}return t[e.id]=n,n}}}function Te(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Ee(){function t(t,i,c){for(var l=0,h=0,u=0,p=0;p<9;p++)r.probe[p].set(0,0,0);var d=0,f=0,m=0,v=0,g=0,y=0,x=0,b=0,_=c.matrixWorldInverse;t.sort(Te);for(var w=0,M=t.length;w<M;w++){var S=t[w],T=S.color,E=S.intensity,A=S.distance,L=S.shadow&&S.shadow.map?S.shadow.map.texture:null;if(S.isAmbientLight)l+=T.r*E,h+=T.g*E,u+=T.b*E;else if(S.isLightProbe)for(var R=0;R<9;R++)r.probe[R].addScaledVector(S.sh.coefficients[R],E);else if(S.isDirectionalLight){var P=e.get(S);if(P.color.copy(S.color).multiplyScalar(S.intensity),P.direction.setFromMatrixPosition(S.matrixWorld),a.setFromMatrixPosition(S.target.matrixWorld),P.direction.sub(a),P.direction.transformDirection(_),S.castShadow){var C=S.shadow,O=n.get(S);O.shadowBias=C.bias,O.shadowNormalBias=C.normalBias,O.shadowRadius=C.radius,O.shadowMapSize=C.mapSize,r.directionalShadow[d]=O,r.directionalShadowMap[d]=L,r.directionalShadowMatrix[d]=S.shadow.matrix,y++}r.directional[d]=P,d++}else if(S.isSpotLight){var I=e.get(S);if(I.position.setFromMatrixPosition(S.matrixWorld),I.position.applyMatrix4(_),I.color.copy(T).multiplyScalar(E),I.distance=A,I.direction.setFromMatrixPosition(S.matrixWorld),a.setFromMatrixPosition(S.target.matrixWorld),I.direction.sub(a),I.direction.transformDirection(_),I.coneCos=Math.cos(S.angle),I.penumbraCos=Math.cos(S.angle*(1-S.penumbra)),I.decay=S.decay,S.castShadow){var D=S.shadow,N=n.get(S);N.shadowBias=D.bias,N.shadowNormalBias=D.normalBias,N.shadowRadius=D.radius,N.shadowMapSize=D.mapSize,r.spotShadow[m]=N,r.spotShadowMap[m]=L,r.spotShadowMatrix[m]=S.shadow.matrix,b++}r.spot[m]=I,m++}else if(S.isRectAreaLight){var B=e.get(S);B.color.copy(T).multiplyScalar(E),B.position.setFromMatrixPosition(S.matrixWorld),B.position.applyMatrix4(_),s.identity(),o.copy(S.matrixWorld),o.premultiply(_),s.extractRotation(o),B.halfWidth.set(.5*S.width,0,0),B.halfHeight.set(0,.5*S.height,0),B.halfWidth.applyMatrix4(s),B.halfHeight.applyMatrix4(s),r.rectArea[v]=B,v++}else if(S.isPointLight){var z=e.get(S);if(z.position.setFromMatrixPosition(S.matrixWorld),z.position.applyMatrix4(_),z.color.copy(S.color).multiplyScalar(S.intensity),z.distance=S.distance,z.decay=S.decay,S.castShadow){var G=S.shadow,F=n.get(S);F.shadowBias=G.bias,F.shadowNormalBias=G.normalBias,F.shadowRadius=G.radius,F.shadowMapSize=G.mapSize,F.shadowCameraNear=G.camera.near,F.shadowCameraFar=G.camera.far,r.pointShadow[f]=F,r.pointShadowMap[f]=L,r.pointShadowMatrix[f]=S.shadow.matrix,x++}r.point[f]=z,f++}else if(S.isHemisphereLight){var U=e.get(S);U.direction.setFromMatrixPosition(S.matrixWorld),U.direction.transformDirection(_),U.direction.normalize(),U.skyColor.copy(S.color).multiplyScalar(E),U.groundColor.copy(S.groundColor).multiplyScalar(E),r.hemi[g]=U,g++}}v>0&&(r.rectAreaLTC1=Cu.LTC_1,r.rectAreaLTC2=Cu.LTC_2),r.ambient[0]=l,r.ambient[1]=h,r.ambient[2]=u;var H=r.hash;H.directionalLength===d&&H.pointLength===f&&H.spotLength===m&&H.rectAreaLength===v&&H.hemiLength===g&&H.numDirectionalShadows===y&&H.numPointShadows===x&&H.numSpotShadows===b||(r.directional.length=d,r.spot.length=m,r.rectArea.length=v,r.point.length=f,r.hemi.length=g,r.directionalShadow.length=y,r.directionalShadowMap.length=y,r.pointShadow.length=x,r.pointShadowMap.length=x,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=y,r.pointShadowMatrix.length=x,r.spotShadowMatrix.length=b,H.directionalLength=d,H.pointLength=f,H.spotLength=m,H.rectAreaLength=v,H.hemiLength=g,H.numDirectionalShadows=y,H.numPointShadows=x,H.numSpotShadows=b,r.version=Xu++)}for(var e=new Me,n=Se(),r={"version":0,"hash":{"directionalLength":-1,"pointLength":-1,"spotLength":-1,"rectAreaLength":-1,"hemiLength":-1,"numDirectionalShadows":-1,"numPointShadows":-1,"numSpotShadows":-1},"ambient":[0,0,0],"probe":[],"directional":[],"directionalShadow":[],"directionalShadowMap":[],"directionalShadowMatrix":[],"spot":[],"spotShadow":[],"spotShadowMap":[],"spotShadowMatrix":[],"rectArea":[],"rectAreaLTC1":null,"rectAreaLTC2":null,"point":[],"pointShadow":[],"pointShadowMap":[],"pointShadowMatrix":[],"hemi":[]},i=0;i<9;i++)r.probe.push(new Tl);var a=new Tl,o=new Kl,s=new Kl;return{"setup":t,"state":r}}function Ae(){function t(){a.length=0,o.length=0}function e(t){a.push(t)}function n(t){o.push(t)}function r(t){i.setup(a,o,t)}var i=new Ee,a=[],o=[];return{"init":t,"state":{"lightsArray":a,"shadowsArray":o,"lights":i},"setupLights":r,"pushLight":e,"pushShadow":n}}function Le(){function t(t,e){var r;return!1===n.has(t)?(r=new Ae,n.set(t,new WeakMap),n.get(t).set(e,r)):!1===n.get(t).has(e)?(r=new Ae,n.get(t).set(e,r)):r=n.get(t).get(e),r}function e(){n=new WeakMap}var n=new WeakMap;return{"get":t,"dispose":e}}function Re(t){u.call(this),this.type="MeshDepthMaterial",this.depthPacking=nl,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,
this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function Pe(t){u.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Tl,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}function Ce(t,e,n){function i(n,r){var i=e.update(_);y.uniforms.shadow_pass.value=n.map.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,y,_,null),x.uniforms.shadow_pass.value=n.mapPass.texture,x.uniforms.resolution.value=n.mapSize,x.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,x,_,null)}function a(t,e,n){var r=t<<0|e<<1|n<<2,i=f[r];return void 0===i&&(i=new Re({"depthPacking":rl,"morphTargets":t,"skinning":e}),f[r]=i),i}function o(t,e,n){var r=t<<0|e<<1|n<<2,i=m[r];return void 0===i&&(i=new Pe({"morphTargets":t,"skinning":e}),m[r]=i),i}function s(e,n,r,i,s,c,l){var h=null,u=a,p=e.customDepthMaterial;if(!0===i.isPointLight&&(u=o,p=e.customDistanceMaterial),void 0===p){var d=!1;!0===r.morphTargets&&(d=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var f=!1;!0===e.isSkinnedMesh&&(!0===r.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));h=u(d,f,!0===e.isInstancedMesh)}else h=p;if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=h.uuid,y=r.uuid,x=v[m];void 0===x&&(x={},v[m]=x);var b=x[y];void 0===b&&(b=h.clone(),x[y]=b),h=b}return h.visible=r.visible,h.wireframe=r.wireframe,h.side=l===Co?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:g[r.side],h.clipShadows=r.clipShadows,h.clippingPlanes=r.clippingPlanes,h.clipIntersection=r.clipIntersection,h.wireframeLinewidth=r.wireframeLinewidth,h.linewidth=r.linewidth,!0===i.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(i.matrixWorld),h.nearDistance=s,h.farDistance=c),h}function c(n,r,i,a,o){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===Co)&&(!n.frustumCulled||l.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld);var h=e.update(n),u=n.material;if(Array.isArray(u))for(var p=h.groups,d=0,f=p.length;d<f;d++){var m=p[d],v=u[m.materialIndex];if(v&&v.visible){var g=s(n,h,v,a,i.near,i.far,o);t.renderBufferDirect(i,null,h,g,n,m)}}else if(u.visible){var y=s(n,h,u,a,i.near,i.far,o);t.renderBufferDirect(i,null,h,y,n,null)}}for(var x=n.children,b=0,_=x.length;b<_;b++)c(x[b],r,i,a,o)}}var l=new Ru,h=new ml,u=new ml,p=new _l,f=[],m=[],v={},g={"0":Io,"1":Oo,"2":Do},y=new I({"defines":{"SAMPLE_RATE":.25,"HALF_SAMPLE_RATE":1/8},"uniforms":{"shadow_pass":{"value":null},"resolution":{"value":new ml},"radius":{"value":4}},"vertexShader":Zu,"fragmentShader":Yu}),x=y.clone();x.defines.HORIZONAL_PASS=1;var b=new S;b.setAttribute("position",new d(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var _=new T(b,y),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ro,this.render=function(e,a,o){if(!1!==w.enabled&&(!1!==w.autoUpdate||!1!==w.needsUpdate)&&0!==e.length){var s=t.getRenderTarget(),d=t.getActiveCubeFace(),f=t.getActiveMipmapLevel(),m=t.state;m.setBlending(No),m.buffers.color.setClear(1,1,1,1),m.buffers.depth.setTest(!0),m.setScissorTest(!1);for(var v=0,g=e.length;v<g;v++){var y=e[v],x=y.shadow;if(!1!==x.autoUpdate||!1!==x.needsUpdate)if(void 0!==x){h.copy(x.mapSize);var b=x.getFrameExtents();if(h.multiply(b),u.copy(x.mapSize),(h.x>n||h.y>n)&&(h.x>n&&(u.x=Math.floor(n/b.x),h.x=u.x*b.x,x.mapSize.x=u.x),h.y>n&&(u.y=Math.floor(n/b.y),h.y=u.y*b.y,x.mapSize.y=u.y)),null===x.map&&!x.isPointLightShadow&&this.type===Co){var _={"minFilter":Os,"magFilter":Os,"format":Zs};x.map=new r(h.x,h.y,_),x.map.texture.name=y.name+".shadowMap",x.mapPass=new r(h.x,h.y,_),x.camera.updateProjectionMatrix()}if(null===x.map){var M={"minFilter":Rs,"magFilter":Rs,"format":Zs};x.map=new r(h.x,h.y,M),x.map.texture.name=y.name+".shadowMap",x.camera.updateProjectionMatrix()}t.setRenderTarget(x.map),t.clear();for(var S=x.getViewportCount(),T=0;T<S;T++){var E=x.getViewport(T);p.set(u.x*E.x,u.y*E.y,u.x*E.z,u.y*E.w),m.viewport(p),x.updateMatrices(y,T),l=x.getFrustum(),c(a,o,x.camera,y,this.type)}x.isPointLightShadow||this.type!==Co||i(x,o),x.needsUpdate=!1}else console.warn("THREE.WebGLShadowMap:",y,"has no shadow.")}w.needsUpdate=!1,t.setRenderTarget(s,d,f)}}}function Oe(t,e,n){function r(){var e=!1,n=new _l,r=null,i=new _l(0,0,0,0);return{"setMask":function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},"setLocked":function(t){e=t},"setClear":function(e,r,a,o,s){!0===s&&(e*=o,r*=o,a*=o),n.set(e,r,a,o),!1===i.equals(n)&&(t.clearColor(e,r,a,o),i.copy(n))},"reset":function(){e=!1,r=null,i.set(-1,0,0,0)}}}function i(){var e=!1,n=null,r=null,i=null;return{"setTest":function(t){t?s(2929):c(2929)},"setMask":function(r){n===r||e||(t.depthMask(r),n=r)},"setFunc":function(e){if(r!==e){if(e)switch(e){case rs:t.depthFunc(512);break;case is:t.depthFunc(519);break;case as:t.depthFunc(513);break;case os:t.depthFunc(515);break;case ss:t.depthFunc(514);break;case cs:t.depthFunc(518);break;case ls:t.depthFunc(516);break;case hs:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);r=e}},"setLocked":function(t){e=t},"setClear":function(e){i!==e&&(t.clearDepth(e),i=e)},"reset":function(){e=!1,n=null,r=null,i=null}}}function a(){var e=!1,n=null,r=null,i=null,a=null,o=null,l=null,h=null,u=null;return{"setTest":function(t){e||(t?s(2960):c(2960))},"setMask":function(r){n===r||e||(t.stencilMask(r),n=r)},"setFunc":function(e,n,o){r===e&&i===n&&a===o||(t.stencilFunc(e,n,o),r=e,i=n,a=o)},"setOp":function(e,n,r){o===e&&l===n&&h===r||(t.stencilOp(e,n,r),o=e,l=n,h=r)},"setLocked":function(t){e=t},"setClear":function(e){u!==e&&(t.clearStencil(e),u=e)},"reset":function(){e=!1,n=null,r=null,i=null,a=null,o=null,l=null,h=null,u=null}}}function o(e,n,r){var i=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var o=0;o<r;o++)t.texImage2D(n+o,0,6408,1,1,0,6408,5121,i);return a}function s(e){!0!==P[e]&&(t.enable(e),P[e]=!0)}function c(e){!1!==P[e]&&(t.disable(e),P[e]=!1)}function l(e){return C!==e&&(t.useProgram(e),C=e,!0)}function h(e,n,r,i,a,o,l,h){if(e===No)return void(O&&(c(3042),O=!1));if(O||(s(3042),O=!0),e===Uo)a=a||n,o=o||r,l=l||i,n===D&&a===z||(t.blendEquationSeparate(et[n],et[a]),D=n,z=a),r===N&&i===B&&o===G&&l===F||(t.blendFuncSeparate(rt[r],rt[i],rt[o],rt[l]),N=r,B=i,G=o,F=l),I=e,U=null;else if(e!==I||h!==U){if(D===Ho&&z===Ho||(t.blendEquation(32774),D=Ho,z=Ho),h)switch(e){case Bo:t.blendFuncSeparate(1,771,1,771);break;case zo:t.blendFunc(1,1);break;case Go:t.blendFuncSeparate(0,0,769,771);break;case Fo:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case Bo:t.blendFuncSeparate(770,771,1,771);break;case zo:t.blendFunc(770,1);break;case Go:t.blendFunc(0,769);break;case Fo:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}N=null,B=null,G=null,F=null,I=e,U=h}}function u(t,e){t.side===Do?c(2884):s(2884);var n=t.side===Io;e&&(n=!n),p(n),t.blending===Bo&&!1===t.transparent?h(No):h(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),L.setFunc(t.depthFunc),L.setTest(t.depthTest),L.setMask(t.depthWrite),A.setMask(t.colorWrite);var r=t.stencilWrite;R.setTest(r),r&&(R.setMask(t.stencilWriteMask),R.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),R.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),m(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function p(e){H!==e&&(e?t.frontFace(2304):t.frontFace(2305),H=e)}function d(e){e!==Eo?(s(2884),e!==k&&(e===Ao?t.cullFace(1029):e===Lo?t.cullFace(1028):t.cullFace(1032))):c(2884),k=e}function f(e){e!==V&&(X&&t.lineWidth(e),V=e)}function m(e,n,r){e?(s(32823),j===n&&W===r||(t.polygonOffset(n,r),j=n,W=r)):c(32823)}function v(t){t?s(3089):c(3089)}function g(e){void 0===e&&(e=33984+q-1),J!==e&&(t.activeTexture(e),J=e)}function y(e,n){null===J&&g();var r=Q[J];void 0===r&&(r={"type":void 0,"texture":void 0},Q[J]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||tt[e]),r.type=e,r.texture=n)}function x(){var e=Q[J];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)}function b(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function _(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function w(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function M(e){!1===K.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),K.copy(e))}function S(e){!1===$.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),$.copy(e))}function T(){P={},J=null,Q={},C=null,I=null,H=null,k=null,A.reset(),L.reset(),R.reset()}var E=n.isWebGL2,A=new r,L=new i,R=new a,P={},C=null,O=null,I=null,D=null,N=null,B=null,z=null,G=null,F=null,U=!1,H=null,k=null,V=null,j=null,W=null,q=t.getParameter(35661),X=!1,Y=0,Z=t.getParameter(7938);-1!==Z.indexOf("WebGL")?(Y=parseFloat(/^WebGL\ ([0-9])/.exec(Z)[1]),X=Y>=1):-1!==Z.indexOf("OpenGL ES")&&(Y=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(Z)[1]),X=Y>=2);var J=null,Q={},K=new _l,$=new _l,tt={};tt[3553]=o(3553,3553,1),tt[34067]=o(34067,34069,6),A.setClear(0,0,0,1),L.setClear(1),R.setClear(0),s(2929),L.setFunc(os),p(!1),d(Ao),s(2884),h(No);var et={};if(et[Ho]=32774,et[ko]=32778,et[Vo]=32779,E)et[jo]=32775,et[Wo]=32776;else{var nt=e.get("EXT_blend_minmax");null!==nt&&(et[jo]=nt.MIN_EXT,et[Wo]=nt.MAX_EXT)}var rt={};return rt[qo]=0,rt[Xo]=1,rt[Yo]=768,rt[Jo]=770,rt[ns]=776,rt[ts]=774,rt[Ko]=772,rt[Zo]=769,rt[Qo]=771,rt[es]=775,rt[$o]=773,{"buffers":{"color":A,"depth":L,"stencil":R},"enable":s,"disable":c,"useProgram":l,"setBlending":h,"setMaterial":u,"setFlipSided":p,"setCullFace":d,"setLineWidth":f,"setPolygonOffset":m,"setScissorTest":v,"activeTexture":g,"bindTexture":y,"unbindTexture":x,"compressedTexImage2D":b,"texImage2D":_,"texImage3D":w,"scissor":M,"viewport":S,"reset":T}}function Ie(t,e,n,r,i,a,o){function s(t,e){return X?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function c(t,e,n,r){var i=1;if((t.width>r||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var a=e?fl.floorPowerOfTwo:Math.floor,o=a(i*t.width),c=a(i*t.height);void 0===U&&(U=s(o,c));var l=n?s(o,c):U;l.width=o,l.height=c;return l.getContext("2d").drawImage(t,0,0,o,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+c+")."),l}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function l(t){return fl.isPowerOfTwo(t.width)&&fl.isPowerOfTwo(t.height)}function h(t){return!H&&(t.wrapS!==As||t.wrapT!==As||t.minFilter!==Rs&&t.minFilter!==Os)}function u(t,e){return t.generateMipmaps&&e&&t.minFilter!==Rs&&t.minFilter!==Os}function p(e,n,i,a){t.generateMipmap(e),r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function d(n,r,i){if(!1===H)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||e.get("EXT_color_buffer_float"),a}function f(t){return t===Rs||t===Ps||t===Cs?9728:9729}function m(t){var e=t.target;e.removeEventListener("dispose",m),g(e),e.isVideoTexture&&q.delete(e),o.memory.textures--}function v(t){var e=t.target;e.removeEventListener("dispose",v),y(e),o.memory.textures--}function g(e){var n=r.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),r.remove(e))}function y(e){var n=r.get(e),i=r.get(e.texture);if(e){if(void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)t.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[a]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(e.texture),r.remove(e)}}function x(){Y=0}function b(){var t=Y;return t>=k&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+k),Y+=1,t}function _(t,e){var i=r.get(t);if(t.isVideoTexture&&z(t),t.version>0&&i.__version!==t.version){var a=t.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void L(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,i.__webglTexture)}function w(t,e){var i=r.get(t);if(t.version>0&&i.__version!==t.version)return void L(i,t,e);n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture)}function M(t,e){var i=r.get(t);if(t.version>0&&i.__version!==t.version)return void L(i,t,e);n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture)}function S(e,i){if(6===e.image.length){var o=r.get(e);if(e.version>0&&o.__version!==e.version){A(o,e),n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),h=e.image[0]&&e.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=s||h?h?e.image[m].image:e.image[m]:c(e.image[m],!1,!0,V);var v=f[0],g=l(v)||H,y=a.convert(e.format),x=a.convert(e.type),b=d(e.internalFormat,y,x);E(34067,e,g);var _;if(s){for(var w=0;w<6;w++){_=f[w].mipmaps;for(var M=0;M<_.length;M++){var S=_[M];e.format!==Zs&&e.format!==Ys?null!==y?n.compressedTexImage2D(34069+w,M,b,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+w,M,b,S.width,S.height,0,y,x,S.data)}}o.__maxMipLevel=_.length-1}else{_=e.mipmaps;for(var T=0;T<6;T++)if(h){n.texImage2D(34069+T,0,b,f[T].width,f[T].height,0,y,x,f[T].data);for(var L=0;L<_.length;L++){var R=_[L],P=R.image[T].image;n.texImage2D(34069+T,L+1,b,P.width,P.height,0,y,x,P.data)}}else{n.texImage2D(34069+T,0,b,y,x,f[T]);for(var C=0;C<_.length;C++){var O=_[C];n.texImage2D(34069+T,C+1,b,y,x,O.image[T])}}o.__maxMipLevel=_.length}u(e,g)&&p(34067,e,v.width,v.height),o.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture)}}function T(t,e){n.activeTexture(33984+e),n.bindTexture(34067,r.get(t).__webglTexture)}function E(n,a,o){o?(t.texParameteri(n,10242,Z[a.wrapS]),t.texParameteri(n,10243,Z[a.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,Z[a.wrapR]),t.texParameteri(n,10240,J[a.magFilter]),t.texParameteri(n,10241,J[a.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),a.wrapS===As&&a.wrapT===As||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,f(a.magFilter)),t.texParameteri(n,10241,f(a.minFilter)),a.minFilter!==Rs&&a.minFilter!==Os&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=e.get("EXT_texture_filter_anisotropic");if(s){if(a.type===Hs&&null===e.get("OES_texture_float_linear"))return;if(a.type===ks&&null===(H||e.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function A(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",m),e.__webglTexture=t.createTexture(),o.memory.textures++)}function L(e,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),A(e,r),n.activeTexture(33984+i),n.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);var s=h(r)&&!1===l(r.image),f=c(r.image,s,!1,j),m=l(f)||H,v=a.convert(r.format),g=a.convert(r.type),y=d(r.internalFormat,v,g);E(o,r,m);var x,b=r.mipmaps;if(r.isDepthTexture)y=6402,H?y=r.type===Hs?36012:r.type===Us?33190:r.type===qs?35056:33189:r.type===Hs&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===$s&&6402===y&&r.type!==Gs&&r.type!==Us&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Gs,g=a.convert(r.type)),r.format===tc&&6402===y&&(y=34041,r.type!==qs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=qs,g=a.convert(r.type))),n.texImage2D(3553,0,y,f.width,f.height,0,v,g,null);else if(r.isDataTexture)if(b.length>0&&m){for(var _=0,w=b.length;_<w;_++)x=b[_],n.texImage2D(3553,_,y,x.width,x.height,0,v,g,x.data);r.generateMipmaps=!1,e.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,y,f.width,f.height,0,v,g,f.data),e.__maxMipLevel=0;else if(r.isCompressedTexture){for(var M=0,S=b.length;M<S;M++)x=b[M],r.format!==Zs&&r.format!==Ys?null!==v?n.compressedTexImage2D(3553,M,y,x.width,x.height,0,x.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,M,y,x.width,x.height,0,v,g,x.data);e.__maxMipLevel=b.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,y,f.width,f.height,f.depth,0,v,g,f.data),e.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,y,f.width,f.height,f.depth,0,v,g,f.data),e.__maxMipLevel=0;else if(b.length>0&&m){for(var T=0,L=b.length;T<L;T++)x=b[T],n.texImage2D(3553,T,y,v,g,x);r.generateMipmaps=!1,e.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,y,v,g,f),e.__maxMipLevel=0;u(r,m)&&p(o,r,f.width,f.height),e.__version=r.version,r.onUpdate&&r.onUpdate(r)}function R(e,i,o,s){var c=a.convert(i.texture.format),l=a.convert(i.texture.type),h=d(i.texture.internalFormat,c,l);n.texImage2D(s,0,h,i.width,i.height,0,c,l,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,o,s,r.get(i.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function P(e,n,r){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var o=n.depthTexture;o&&o.isDepthTexture&&(o.type===Hs?i=36012:o.type===Us&&(i=33190));var s=B(n);t.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else t.renderbufferStorage(36161,i,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){if(r){var c=B(n);t.renderbufferStorageMultisample(36161,c,35056,n.width,n.height)}else t.renderbufferStorage(36161,34041,n.width,n.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{var l=a.convert(n.texture.format),h=a.convert(n.texture.type),u=d(n.texture.internalFormat,l,h);if(r){var p=B(n);t.renderbufferStorageMultisample(36161,p,u,n.width,n.height)}else t.renderbufferStorage(36161,u,n.width,n.height)}t.bindRenderbuffer(36161,null)}function C(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),_(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===$s)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==tc)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}function O(e){var n=r.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");C(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)t.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=t.createRenderbuffer(),P(n.__webglDepthbuffer[a],e,!1)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),P(n.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function I(e){var i=r.get(e),s=r.get(e.texture);e.addEventListener("dispose",v),s.__webglTexture=t.createTexture(),o.memory.textures++;var c=!0===e.isWebGLCubeRenderTarget,h=!0===e.isWebGLMultisampleRenderTarget,f=l(e)||H;if(!H||e.texture.format!==Ys||e.texture.type!==Hs&&e.texture.type!==ks||(e.texture.format=Zs,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(var m=0;m<6;m++)i.__webglFramebuffer[m]=t.createFramebuffer()}else if(i.__webglFramebuffer=t.createFramebuffer(),h)if(H){i.__webglMultisampledFramebuffer=t.createFramebuffer(),i.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var g=a.convert(e.texture.format),y=a.convert(e.texture.type),x=d(e.texture.internalFormat,g,y),b=B(e);t.renderbufferStorageMultisample(36161,b,x,e.width,e.height),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(i.__webglDepthRenderbuffer=t.createRenderbuffer(),P(i.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,s.__webglTexture),E(34067,e.texture,f);for(var _=0;_<6;_++)R(i.__webglFramebuffer[_],e,36064,34069+_);u(e.texture,f)&&p(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),E(3553,e.texture,f),R(i.__webglFramebuffer,e,36064,3553),u(e.texture,f)&&p(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&O(e)}function D(t){var e=t.texture;if(u(e,l(t)||H)){var i=t.isWebGLCubeRenderTarget?34067:3553,a=r.get(e).__webglTexture;n.bindTexture(i,a),p(i,e,t.width,t.height),n.bindTexture(i,null)}}function N(e){if(e.isWebGLMultisampleRenderTarget)if(H){var n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var i=e.width,a=e.height,o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function B(t){return H&&t.isWebGLMultisampleRenderTarget?Math.min(W,t.samples):0}function z(t){var e=o.render.frame;q.get(t)!==e&&(q.set(t,e),t.update())}function G(t,e){t&&t.isWebGLRenderTarget&&(!1===Q&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Q=!0),t=t.texture),_(t,e)}function F(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===K&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),K=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?S(t,e):T(t,e)}var U,H=i.isWebGL2,k=i.maxTextures,V=i.maxCubemapSize,j=i.maxTextureSize,W=i.maxSamples,q=new WeakMap,X=!1;try{X="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}var Y=0,Z={};Z[Es]=10497,Z[As]=33071,Z[Ls]=33648;var J={};J[Rs]=9728,J[Ps]=9984,J[Cs]=9986,J[Os]=9729,J[Is]=9985,J[Ds]=9987;var Q=!1,K=!1;this.allocateTextureUnit=b,this.resetTextureUnits=x,this.setTexture2D=_,this.setTexture2DArray=w,this.setTexture3D=M,this.setTextureCube=S,this.setTextureCubeDynamic=T,this.setupRenderTarget=I,this.updateRenderTargetMipmap=D,this.updateMultisampleRenderTarget=N,this.safeSetTexture2D=G,this.safeSetTextureCube=F}function De(t,e,n){function r(t){var n;if(t===Ns)return 5121;if(t===Vs)return 32819;if(t===js)return 32820;if(t===Ws)return 33635;if(t===Bs)return 5120;if(t===zs)return 5122;if(t===Gs)return 5123;if(t===Fs)return 5124;if(t===Us)return 5125;if(t===Hs)return 5126;if(t===ks)return i?5131:(n=e.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(t===Xs)return 6406;if(t===Ys)return 6407;if(t===Zs)return 6408;if(t===Js)return 6409;if(t===Qs)return 6410;if(t===$s)return 6402;if(t===tc)return 34041;if(t===ec)return 6403;if(t===nc)return 36244;if(t===rc)return 33319;if(t===ic)return 33320;if(t===ac)return 36248;if(t===oc)return 36249;if(t===sc||t===cc||t===lc||t===hc){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(t===sc)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===cc)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===lc)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===hc)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===uc||t===pc||t===dc||t===fc){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===uc)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===pc)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===dc)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===fc)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===mc)return n=e.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===vc||t===gc)&&null!==(n=e.get("WEBGL_compressed_texture_etc"))){if(t===vc)return n.COMPRESSED_RGB8_ETC2;if(t===gc)return n.COMPRESSED_RGBA8_ETC2_EAC}return t===yc||t===xc||t===bc||t===_c||t===wc||t===Mc||t===Sc||t===Tc||t===Ec||t===Ac||t===Lc||t===Rc||t===Pc||t===Cc||t===Ic||t===Dc||t===Nc||t===Bc||t===zc||t===Gc||t===Fc||t===Uc||t===Hc||t===kc||t===Vc||t===jc||t===Wc||t===qc?(n=e.get("WEBGL_compressed_texture_astc"),null!==n?t:null):t===Oc?(n=e.get("EXT_texture_compression_bptc"),null!==n?t:null):t===qs?i?34042:(n=e.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}var i=n.isWebGL2;return{"convert":r}}function Ne(t){N.call(this),this.cameras=t||[]}function Be(){s.call(this),this.type="Group"}function ze(){this._targetRay=null,this._grip=null,this._hand=null}function Ge(t,e){function n(t){var e=v.get(t.inputSource);e&&e.dispatchEvent({"type":t.type})}function r(){v.forEach(function(t,e){t.disconnect(e)}),v.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),E.stop(),l.isPresenting=!1,l.dispatchEvent({"type":"sessionend"})}function i(t){p=t,E.setContext(h),E.start(),l.isPresenting=!0,l.dispatchEvent({"type":"sessionstart"})}function a(t){for(var e=h.inputSources,n=0;n<m.length;n++)v.set(e[n],m[n]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=v.get(i);a&&(a.dispatchEvent({"type":"disconnected","data":i}),v.delete(i))}for(var o=0;o<t.added.length;o++){var s=t.added[o],c=v.get(s);c&&c.dispatchEvent({"type":"connected","data":s})}}function o(t,e,n){M.setFromMatrixPosition(e.matrixWorld),S.setFromMatrixPosition(n.matrixWorld);var r=M.distanceTo(S),i=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],h=(i[8]-1)/i[0],u=(a[8]+1)/a[0],p=o*h,d=o*u,f=r/(-h+u),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=o+f,g=s+f,y=p-m,x=d+(r-m),b=c*s/g*v,_=l*s/g*v;t.projectionMatrix.makePerspective(y,x,b,_,v,g)}function s(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}function c(e,n){if(null!==(f=n.getViewerPose(p))){var r=f.views,i=h.renderState.baseLayer;t.setFramebuffer(i.framebuffer);var a=!1;r.length!==b.cameras.length&&(b.cameras.length=0,a=!0);for(var o=0;o<r.length;o++){var s=r[o],c=i.getViewport(s),l=x[o];l.matrix.fromArray(s.transform.matrix),l.projectionMatrix.fromArray(s.projectionMatrix),l.viewport.set(c.x,c.y,c.width,c.height),0===o&&b.matrix.copy(l.matrix),!0===a&&b.cameras.push(l)}}for(var u=h.inputSources,d=0;d<m.length;d++){var v=m[d],g=u[d];v.update(g,n,p)}T&&T(e,n)}var l=this,h=null,u=1,p=null,d="local-floor",f=null,m=[],v=new Map,g=new N;g.layers.enable(1),g.viewport=new _l;var y=new N;y.layers.enable(2),y.viewport=new _l;var x=[g,y],b=new Ne;b.layers.enable(1),b.layers.enable(2);var _=null,w=null;this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var e=m[t];return void 0===e&&(e=new ze,m[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){var e=m[t];return void 0===e&&(e=new ze,m[t]=e),e.getGripSpace()},this.getHand=function(t){var e=m[t];return void 0===e&&(e=new ze,m[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){u=t,!0===l.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){d=t,!0===l.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p},this.getSession=function(){return h},this.setSession=function(t){if(null!==(h=t)){h.addEventListener("select",n),h.addEventListener("selectstart",n),h.addEventListener("selectend",n),h.addEventListener("squeeze",n),h.addEventListener("squeezestart",n),h.addEventListener("squeezeend",n),h.addEventListener("end",r);var o=e.getContextAttributes();!0!==o.xrCompatible&&e.makeXRCompatible();var s={"antialias":o.antialias,"alpha":o.alpha,"depth":o.depth,"stencil":o.stencil,"framebufferScaleFactor":u},c=new XRWebGLLayer(h,e,s);h.updateRenderState({"baseLayer":c}),h.requestReferenceSpace(d).then(i),h.addEventListener("inputsourceschange",a)}};var M=new Tl,S=new Tl;this.getCamera=function(t){b.near=y.near=g.near=t.near,b.far=y.far=g.far=t.far,_===b.near&&w===b.far||(h.updateRenderState({"depthNear":b.near,"depthFar":b.far}),_=b.near,w=b.far);var e=t.parent,n=b.cameras;s(b,e);for(var r=0;r<n.length;r++)s(n[r],e);t.matrixWorld.copy(b.matrixWorld);for(var i=t.children,a=0,c=i.length;a<c;a++)i[a].updateMatrixWorld(!0);return 2===n.length?o(b,g,y):b.projectionMatrix.copy(g.projectionMatrix),b};var T=null,E=new F;E.setAnimationLoop(c),this.setAnimationLoop=function(t){T=t},this.dispose=function(){}}function Fe(t){function e(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function n(t,e,n,g){e.isMeshBasicMaterial?r(t,e):e.isMeshLambertMaterial?(r(t,e),c(t,e)):e.isMeshToonMaterial?(r(t,e),h(t,e)):e.isMeshPhongMaterial?(r(t,e),l(t,e)):e.isMeshStandardMaterial?(r(t,e),e.isMeshPhysicalMaterial?p(t,e):u(t,e)):e.isMeshMatcapMaterial?(r(t,e),d(t,e)):e.isMeshDepthMaterial?(r(t,e),f(t,e)):e.isMeshDistanceMaterial?(r(t,e),m(t,e)):e.isMeshNormalMaterial?(r(t,e),v(t,e)):e.isLineBasicMaterial?(i(t,e),
e.isLineDashedMaterial&&a(t,e)):e.isPointsMaterial?o(t,e,n,g):e.isSpriteMaterial?s(t,e):e.isShadowMaterial?(t.color.value.copy(e.color),t.opacity.value=e.opacity):e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)}function r(e,n){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.specularMap&&(e.specularMap.value=n.specularMap);var r=t.get(n).envMap;if(r){e.envMap.value=r,e.flipEnvMap.value=r.isCubeTexture?-1:1,e.reflectivity.value=n.reflectivity,e.refractionRatio.value=n.refractionRatio;var i=t.get(r).__maxMipLevel;void 0!==i&&(e.maxMipLevel.value=i)}n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity);var a;n.map?a=n.map:n.specularMap?a=n.specularMap:n.displacementMap?a=n.displacementMap:n.normalMap?a=n.normalMap:n.bumpMap?a=n.bumpMap:n.roughnessMap?a=n.roughnessMap:n.metalnessMap?a=n.metalnessMap:n.alphaMap?a=n.alphaMap:n.emissiveMap?a=n.emissiveMap:n.clearcoatMap?a=n.clearcoatMap:n.clearcoatNormalMap?a=n.clearcoatNormalMap:n.clearcoatRoughnessMap&&(a=n.clearcoatRoughnessMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),e.uvTransform.value.copy(a.matrix));var o;n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uv2Transform.value.copy(o.matrix))}function i(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}function a(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function o(t,e,n,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*r,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap);var i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}function s(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function c(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function l(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Io&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Io&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function h(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Io&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Io&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function u(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,n.side===Io&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),n.side===Io&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias),t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}function p(t,e){u(t,e),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen),e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===Io&&t.clearcoatNormalScale.value.negate()),t.transmission.value=e.transmission,e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap)}function d(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Io&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Io&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function f(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function m(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}function v(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Io&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Io&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}return{"refreshFogUniforms":e,"refreshMaterialUniforms":n}}function Ue(t){function e(){return null===N?ot:1}function n(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=y.getContext(r,e);if(null!==i)return i}return null}function r(){_t=new Z(yt),wt=new q(yt,_t,t),!1===wt.isWebGL2&&(_t.get("WEBGL_depth_texture"),_t.get("OES_texture_float"),_t.get("OES_texture_half_float"),_t.get("OES_texture_half_float_linear"),_t.get("OES_standard_derivatives"),_t.get("OES_element_index_uint"),_t.get("OES_vertex_array_object"),_t.get("ANGLE_instanced_arrays")),_t.get("OES_texture_float_linear"),Ut=new De(yt,_t,wt),Mt=new Oe(yt,_t,wt),Mt.scissor(tt.copy(ht).multiplyScalar(ot).floor()),Mt.viewport($.copy(lt).multiplyScalar(ot).floor()),St=new K(yt),Tt=new ye,Et=new Ie(yt,_t,Mt,Tt,wt,Ut,St),At=new Y(P),Lt=new U(yt,wt),Ht=new j(yt,_t,Lt,wt),Rt=new J(yt,Lt,St,Ht),Pt=new nt(yt,Rt,Lt,St),zt=new et(yt),Nt=new X(Tt),Ct=new ge(P,At,_t,wt,Ht,Nt),Ot=new Fe(Tt),It=new we(Tt),Dt=new Le,Bt=new V(P,At,Mt,Pt,S),Gt=new W(yt,_t,St,wt),Ft=new Q(yt,_t,St,wt),St.programs=Ct.programs,P.capabilities=wt,P.extensions=_t,P.properties=Tt,P.renderLists=It,P.state=Mt,P.info=St}function i(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),C=!0}function a(){console.log("THREE.WebGLRenderer: Context Restored."),C=!1,r()}function o(t){var e=t.target;e.removeEventListener("dispose",o),s(e)}function s(t){c(t),Tt.remove(t)}function c(t){var e=Tt.get(t).program;void 0!==e&&Ct.releaseProgram(e)}function l(t,e){t.render(function(t){P.renderBufferImmediate(t,e)})}function h(t){kt.isPresenting||jt&&jt(t)}function u(t,e,n,r){if(!1!==t.visible){if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)R.pushLight(t),t.castShadow&&R.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||pt.intersectsSprite(t)){r&&vt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(mt);var i=Pt.update(t),a=t.material;a.visible&&L.push(t,i,a,n,vt.z,null)}}else if(t.isImmediateRenderObject)r&&vt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(mt),L.push(t,null,t.material,n,vt.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==St.render.frame&&(t.skeleton.update(),t.skeleton.frame=St.render.frame),!t.frustumCulled||pt.intersectsObject(t))){r&&vt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(mt);var o=Pt.update(t),s=t.material;if(Array.isArray(s))for(var c=o.groups,l=0,h=c.length;l<h;l++){var p=c[l],d=s[p.materialIndex];d&&d.visible&&L.push(t,o,d,n,vt.z,p)}else s.visible&&L.push(t,o,s,n,vt.z,null)}for(var f=t.children,m=0,v=f.length;m<v;m++)u(f[m],e,n,r)}}function p(t,e,n){for(var r=!0===e.isScene?e.overrideMaterial:null,i=0,a=t.length;i<a;i++){var o=t[i],s=o.object,c=o.geometry,l=null===r?o.material:r,h=o.group;if(n.isArrayCamera){k=n;for(var u=n.cameras,p=0,f=u.length;p<f;p++){var m=u[p];s.layers.test(m.layers)&&(Mt.viewport($.copy(m.viewport)),R.setupLights(m),d(s,e,m,c,l,h))}}else k=null,d(s,e,n,c,l,h)}}function d(t,e,n,r,i,a){if(t.onBeforeRender(P,e,n,r,i,a),R=Dt.get(e,k||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var o=m(n,e,i,t);Mt.setMaterial(i),Ht.reset(),l(t,o)}else P.renderBufferDirect(n,e,r,i,t,a);t.onAfterRender(P,e,n,r,i,a),R=Dt.get(e,k||n)}function f(t,e,n){!0!==e.isScene&&(e=gt);var r=Tt.get(t),i=R.state.lights,a=R.state.shadowsArray,s=i.state.version,l=Ct.getParameters(t,i.state,a,e,n),h=Ct.getProgramCacheKey(l),u=r.program,p=!0;if(void 0===u)t.addEventListener("dispose",o);else if(u.cacheKey!==h)c(t);else if(r.lightsStateVersion!==s)p=!1;else{if(void 0!==l.shaderID){var d=t.isMeshStandardMaterial?e.environment:null;return void(r.envMap=At.get(t.envMap||d))}p=!1}p&&(l.uniforms=Ct.getUniforms(t),t.onBeforeCompile(l,P),u=Ct.acquireProgram(l,h),r.program=u,r.uniforms=l.uniforms,r.outputEncoding=l.outputEncoding);var f=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=Nt.numPlanes,r.numIntersection=Nt.numIntersection,f.clippingPlanes=Nt.uniform),r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=At.get(t.envMap||r.environment),r.needsLights=g(t),r.lightsStateVersion=s,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),v=qt.seqWithValue(m.seq,f);r.uniformsList=v}function m(t,e,n,r){!0!==e.isScene&&(e=gt),Et.resetTextureUnits();var i=e.fog,a=n.isMeshStandardMaterial?e.environment:null,o=null===N?P.outputEncoding:N.texture.encoding,s=At.get(n.envMap||a),c=Tt.get(n),l=R.state.lights;if(!0===dt&&(!0===ft||t!==H)){var h=t===H&&n.id===z;Nt.setState(n,t,h)}n.version===c.__version?n.fog&&c.fog!==i?f(n,e,r):c.environment!==a?f(n,e,r):c.needsLights&&c.lightsStateVersion!==l.state.version?f(n,e,r):void 0===c.numClippingPlanes||c.numClippingPlanes===Nt.numPlanes&&c.numIntersection===Nt.numIntersection?c.outputEncoding!==o?f(n,e,r):c.envMap!==s&&f(n,e,r):f(n,e,r):(f(n,e,r),c.__version=n.version);var u=!1,p=!1,d=!1,m=c.program,g=m.getUniforms(),y=c.uniforms;if(Mt.useProgram(m.program)&&(u=!0,p=!0,d=!0),n.id!==z&&(z=n.id,p=!0),u||H!==t){if(g.setValue(yt,"projectionMatrix",t.projectionMatrix),wt.logarithmicDepthBuffer&&g.setValue(yt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),H!==t&&(H=t,p=!0,d=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var x=g.map.cameraPosition;void 0!==x&&x.setValue(yt,vt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&g.setValue(yt,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&g.setValue(yt,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){g.setOptional(yt,r,"bindMatrix"),g.setOptional(yt,r,"bindMatrixInverse");var b=r.skeleton;if(b){var _=b.bones;if(wt.floatVertexTextures){if(void 0===b.boneTexture){var w=Math.sqrt(4*_.length);w=fl.ceilPowerOfTwo(w),w=Math.max(w,4);var M=new Float32Array(w*w*4);M.set(b.boneMatrices);var S=new G(M,w,w,Zs,Hs);b.boneMatrices=M,b.boneTexture=S,b.boneTextureSize=w}g.setValue(yt,"boneTexture",b.boneTexture,Et),g.setValue(yt,"boneTextureSize",b.boneTextureSize)}else g.setOptional(yt,b,"boneMatrices")}}return(p||c.receiveShadow!==r.receiveShadow)&&(c.receiveShadow=r.receiveShadow,g.setValue(yt,"receiveShadow",r.receiveShadow)),p&&(g.setValue(yt,"toneMappingExposure",P.toneMappingExposure),c.needsLights&&v(y,d),i&&n.fog&&Ot.refreshFogUniforms(y,i),Ot.refreshMaterialUniforms(y,n,ot,at),qt.upload(yt,c.uniformsList,y,Et)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(qt.upload(yt,c.uniformsList,y,Et),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&g.setValue(yt,"center",r.center),g.setValue(yt,"modelViewMatrix",r.modelViewMatrix),g.setValue(yt,"normalMatrix",r.normalMatrix),g.setValue(yt,"modelMatrix",r.matrixWorld),m}function v(t,e){t.ambientLightColor.needsUpdate=e,t.lightProbe.needsUpdate=e,t.directionalLights.needsUpdate=e,t.directionalLightShadows.needsUpdate=e,t.pointLights.needsUpdate=e,t.pointLightShadows.needsUpdate=e,t.spotLights.needsUpdate=e,t.spotLightShadows.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function g(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}t=t||{};var y=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),x=void 0!==t.context?t.context:null,b=void 0!==t.alpha&&t.alpha,_=void 0===t.depth||t.depth,w=void 0===t.stencil||t.stencil,M=void 0!==t.antialias&&t.antialias,S=void 0===t.premultipliedAlpha||t.premultipliedAlpha,T=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,E=void 0!==t.powerPreference?t.powerPreference:"default",A=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,L=null,R=null;this.domElement=y,this.debug={"checkShaderErrors":!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Yc,this.physicallyCorrectLights=!1,this.toneMapping=fs,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var P=this,C=!1,O=null,I=0,D=0,N=null,B=null,z=-1,H=null,k=null,$=new _l,tt=new _l,rt=null,it=y.width,at=y.height,ot=1,st=null,ct=null,lt=new _l(0,0,it,at),ht=new _l(0,0,it,at),ut=!1,pt=new Ru,dt=!1,ft=!1,mt=new Kl,vt=new Tl,gt={"background":null,"fog":null,"environment":null,"overrideMaterial":null,"isScene":!0},yt=x;try{var xt={"alpha":b,"depth":_,"stencil":w,"antialias":M,"premultipliedAlpha":S,"preserveDrawingBuffer":T,"powerPreference":E,"failIfMajorPerformanceCaveat":A};if(y.addEventListener("webglcontextlost",i,!1),y.addEventListener("webglcontextrestored",a,!1),null===yt){var bt=["webgl2","webgl","experimental-webgl"];if(!0===P.isWebGL1Renderer&&bt.shift(),null===(yt=n(bt,xt)))throw n(bt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===yt.getShaderPrecisionFormat&&(yt.getShaderPrecisionFormat=function(){return{"rangeMin":1,"rangeMax":1,"precision":1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}var _t,wt,Mt,St,Tt,Et,At,Lt,Rt,Pt,Ct,Ot,It,Dt,Nt,Bt,zt,Gt,Ft,Ut,Ht;r();var kt=new Ge(P,yt);this.xr=kt;var Vt=new Ce(P,Pt,wt.maxTextureSize);this.shadowMap=Vt,this.getContext=function(){return yt},this.getContextAttributes=function(){return yt.getContextAttributes()},this.forceContextLoss=function(){var t=_t.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=_t.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return ot},this.setPixelRatio=function(t){void 0!==t&&(ot=t,this.setSize(it,at,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new ml),t.set(it,at)},this.setSize=function(t,e,n){if(kt.isPresenting)return void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");it=t,at=e,y.width=Math.floor(t*ot),y.height=Math.floor(e*ot),!1!==n&&(y.style.width=t+"px",y.style.height=e+"px"),this.setViewport(0,0,t,e)},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new ml),t.set(it*ot,at*ot).floor()},this.setDrawingBufferSize=function(t,e,n){it=t,at=e,ot=n,y.width=Math.floor(t*n),y.height=Math.floor(e*n),this.setViewport(0,0,t,e)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new _l),t.copy($)},this.getViewport=function(t){return t.copy(lt)},this.setViewport=function(t,e,n,r){t.isVector4?lt.set(t.x,t.y,t.z,t.w):lt.set(t,e,n,r),Mt.viewport($.copy(lt).multiplyScalar(ot).floor())},this.getScissor=function(t){return t.copy(ht)},this.setScissor=function(t,e,n,r){t.isVector4?ht.set(t.x,t.y,t.z,t.w):ht.set(t,e,n,r),Mt.scissor(tt.copy(ht).multiplyScalar(ot).floor())},this.getScissorTest=function(){return ut},this.setScissorTest=function(t){Mt.setScissorTest(ut=t)},this.setOpaqueSort=function(t){st=t},this.setTransparentSort=function(t){ct=t},this.getClearColor=function(){return Bt.getClearColor()},this.setClearColor=function(){Bt.setClearColor.apply(Bt,arguments)},this.getClearAlpha=function(){return Bt.getClearAlpha()},this.setClearAlpha=function(){Bt.setClearAlpha.apply(Bt,arguments)},this.clear=function(t,e,n){var r=0;(void 0===t||t)&&(r|=16384),(void 0===e||e)&&(r|=256),(void 0===n||n)&&(r|=1024),yt.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){y.removeEventListener("webglcontextlost",i,!1),y.removeEventListener("webglcontextrestored",a,!1),It.dispose(),Dt.dispose(),Tt.dispose(),At.dispose(),Pt.dispose(),Ht.dispose(),kt.dispose(),Wt.stop()},this.renderBufferImmediate=function(t,e){Ht.initAttributes();var n=Tt.get(t);t.hasPositions&&!n.position&&(n.position=yt.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=yt.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=yt.createBuffer()),t.hasColors&&!n.color&&(n.color=yt.createBuffer());var r=e.getAttributes();t.hasPositions&&(yt.bindBuffer(34962,n.position),yt.bufferData(34962,t.positionArray,35048),Ht.enableAttribute(r.position),yt.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(yt.bindBuffer(34962,n.normal),yt.bufferData(34962,t.normalArray,35048),Ht.enableAttribute(r.normal),yt.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(yt.bindBuffer(34962,n.uv),yt.bufferData(34962,t.uvArray,35048),Ht.enableAttribute(r.uv),yt.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(yt.bindBuffer(34962,n.color),yt.bufferData(34962,t.colorArray,35048),Ht.enableAttribute(r.color),yt.vertexAttribPointer(r.color,3,5126,!1,0,0)),Ht.disableUnusedAttributes(),yt.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,n,r,i,a,o){null===n&&(n=gt);var s=a.isMesh&&a.matrixWorld.determinant()<0,c=m(t,n,i,a);Mt.setMaterial(i,s);var l=r.index,h=r.attributes.position;if(null===l){if(void 0===h||0===h.count)return}else if(0===l.count)return;var u=1;!0===i.wireframe&&(l=Rt.getWireframeAttribute(r),u=2),(i.morphTargets||i.morphNormals)&&zt.update(a,r,i,c),Ht.setup(a,i,c,r,l);var p,d=Gt;null!==l&&(p=Lt.get(l),d=Ft,d.setIndex(p));var f=null!==l?l.count:h.count,v=r.drawRange.start*u,g=r.drawRange.count*u,y=null!==o?o.start*u:0,x=null!==o?o.count*u:1/0,b=Math.max(v,y),_=Math.min(f,v+g,y+x)-1,w=Math.max(0,_-b+1);if(0!==w){if(a.isMesh)!0===i.wireframe?(Mt.setLineWidth(i.wireframeLinewidth*e()),d.setMode(1)):d.setMode(4);else if(a.isLine){var M=i.linewidth;void 0===M&&(M=1),Mt.setLineWidth(M*e()),a.isLineSegments?d.setMode(1):a.isLineLoop?d.setMode(2):d.setMode(3)}else a.isPoints?d.setMode(0):a.isSprite&&d.setMode(4);if(a.isInstancedMesh)d.renderInstances(b,w,a.count);else if(r.isInstancedBufferGeometry){var S=Math.min(r.instanceCount,r._maxInstanceCount);d.renderInstances(b,w,S)}else d.render(b,w)}},this.compile=function(t,e){R=Dt.get(t,e),R.init(),t.traverse(function(t){t.isLight&&(R.pushLight(t),t.castShadow&&R.pushShadow(t))}),R.setupLights(e);var n=new WeakMap;t.traverse(function(e){var r=e.material;if(r)if(Array.isArray(r))for(var i=0;i<r.length;i++){var a=r[i];!1===n.has(a)&&(f(a,t,e),n.set(a))}else!1===n.has(r)&&(f(r,t,e),n.set(r))})};var jt=null,Wt=new F;Wt.setAnimationLoop(h),"undefined"!=typeof window&&Wt.setContext(window),this.setAnimationLoop=function(t){jt=t,kt.setAnimationLoop(t),null===t?Wt.stop():Wt.start()},this.render=function(t,e){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0!==C){Ht.resetDefaultState(),z=-1,H=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===kt.enabled&&!0===kt.isPresenting&&(e=kt.getCamera(e)),!0===t.isScene&&t.onBeforeRender(P,t,e,n||N),R=Dt.get(t,e),R.init(),mt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),pt.setFromProjectionMatrix(mt),ft=this.localClippingEnabled,dt=Nt.init(this.clippingPlanes,ft,e),L=It.get(t,e),L.init(),u(t,e,0,P.sortObjects),L.finish(),!0===P.sortObjects&&L.sort(st,ct),!0===dt&&Nt.beginShadows();var i=R.state.shadowsArray;Vt.render(i,t,e),R.setupLights(e),!0===dt&&Nt.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),Bt.render(L,t,e,r);var a=L.opaque,o=L.transparent;a.length>0&&p(a,t,e),o.length>0&&p(o,t,e),!0===t.isScene&&t.onAfterRender(P,t,e),null!==N&&(Et.updateRenderTargetMipmap(N),Et.updateMultisampleRenderTarget(N)),Mt.buffers.depth.setTest(!0),Mt.buffers.depth.setMask(!0),Mt.buffers.color.setMask(!0),Mt.setPolygonOffset(!1),L=null,R=null}},this.setFramebuffer=function(t){O!==t&&null===N&&yt.bindFramebuffer(36160,t),O=t},this.getActiveCubeFace=function(){return I},this.getActiveMipmapLevel=function(){return D},this.getRenderList=function(){return L},this.setRenderList=function(t){L=t},this.getRenderState=function(){return R},this.setRenderState=function(t){R=t},this.getRenderTarget=function(){return N},this.setRenderTarget=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0),N=t,I=e,D=n,t&&void 0===Tt.get(t).__webglFramebuffer&&Et.setupRenderTarget(t);var r=O,i=!1;if(t){var a=Tt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=a[e],i=!0):r=t.isWebGLMultisampleRenderTarget?Tt.get(t).__webglMultisampledFramebuffer:a,$.copy(t.viewport),tt.copy(t.scissor),rt=t.scissorTest}else $.copy(lt).multiplyScalar(ot).floor(),tt.copy(ht).multiplyScalar(ot).floor(),rt=ut;if(B!==r&&(yt.bindFramebuffer(36160,r),B=r),Mt.viewport($),Mt.scissor(tt),Mt.setScissorTest(rt),i){var o=Tt.get(t.texture);yt.framebufferTexture2D(36160,36064,34069+e,o.__webglTexture,n)}},this.readRenderTargetPixels=function(t,e,n,r,i,a,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var s=Tt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var c=!1;s!==B&&(yt.bindFramebuffer(36160,s),c=!0);try{var l=t.texture,h=l.format,u=l.type;if(h!==Zs&&Ut.convert(h)!==yt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u===Ns||Ut.convert(u)===yt.getParameter(35738)||u===Hs&&(wt.isWebGL2||_t.get("OES_texture_float")||_t.get("WEBGL_color_buffer_float"))||u===ks&&(wt.isWebGL2?_t.get("EXT_color_buffer_float"):_t.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===yt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&yt.readPixels(e,n,r,i,Ut.convert(h),Ut.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&yt.bindFramebuffer(36160,B)}}},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=Ut.convert(e.format);Et.setTexture2D(e,0),yt.copyTexImage2D(3553,n,o,t.x,t.y,i,a,0),Mt.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r){void 0===r&&(r=0);var i=e.image.width,a=e.image.height,o=Ut.convert(n.format),s=Ut.convert(n.type);Et.setTexture2D(n,0),yt.pixelStorei(37440,n.flipY),yt.pixelStorei(37441,n.premultiplyAlpha),yt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?yt.texSubImage2D(3553,r,t.x,t.y,i,a,o,s,e.image.data):e.isCompressedTexture?yt.compressedTexSubImage2D(3553,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):yt.texSubImage2D(3553,r,t.x,t.y,o,s,e.image),0===r&&n.generateMipmaps&&yt.generateMipmap(3553),Mt.unbindTexture()},this.initTexture=function(t){Et.setTexture2D(t,0),Mt.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{"detail":this}))}function He(t){Ue.call(this,t)}function ke(){s.call(this),Object.defineProperty(this,"isScene",{"value":!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{"detail":this}))}function Ve(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=cl,this.updateRange={"offset":0,"count":-1},this.version=0,this.uuid=fl.generateUUID()}function je(t,e,n,r){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function We(t){u.call(this),this.type="SpriteMaterial",this.color=new kh(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}function qe(t){if(s.call(this),this.type="Sprite",void 0===$u){$u=new S;var e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new Ve(e,5);$u.setIndex([0,1,2,0,2,3]),$u.setAttribute("position",new je(n,3,0,!1)),$u.setAttribute("uv",new je(n,2,3,!1))}this.geometry=$u,this.material=void 0!==t?t:new We,this.center=new ml(.5,.5)}function Xe(t,e,n,r,i,a){rp.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(ip.x=a*rp.x-i*rp.y,ip.y=i*rp.x+a*rp.y):ip.copy(rp),t.copy(e),t.x+=ip.x,t.y+=ip.y,t.applyMatrix4(ap)}function Ye(){s.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{"levels":{"enumerable":!0,"value":[]}}),this.autoUpdate=!0}function Ze(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),T.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Kl,this.bindMatrixInverse=new Kl}function Je(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new Kl)}}function Qe(){s.call(this),this.type="Bone"}function Ke(t,e,n){T.call(this,t,e),this.instanceMatrix=new d(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}function $e(t){u.call(this),this.type="LineBasicMaterial",this.color=new kh(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}function tn(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),s.call(this),this.type="Line",this.geometry=void 0!==t?t:new S,this.material=void 0!==e?e:new $e,this.updateMorphTargets()}function en(t,e){tn.call(this,t,e),this.type="LineSegments"}function nn(t,e){tn.call(this,t,e),this.type="LineLoop"}function rn(t){u.call(this),this.type="PointsMaterial",this.color=new kh(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}function an(t,e){s.call(this),this.type="Points",this.geometry=void 0!==t?t:new S,this.material=void 0!==e?e:new rn,this.updateMorphTargets()}function on(t,e,n,r,i,a,o){var s=Lp.distanceSqToPoint(t);if(s<n){var c=new Tl;Lp.closestPointToPoint(t,c),c.applyMatrix4(r);var l=i.ray.origin.distanceTo(c);if(l<i.near||l>i.far)return;a.push({"distance":l,"distanceToRay":Math.sqrt(s),"point":c,"index":e,"face":null,"object":o})}}function sn(t,e,r,i,a,o,s,c,l){function h(){u.needsUpdate=!0,t.requestVideoFrameCallback(h)}n.call(this,t,e,r,i,a,o,s,c,l),this.format=void 0!==s?s:Ys,this.minFilter=void 0!==o?o:Os,this.magFilter=void 0!==a?a:Os,this.generateMipmaps=!1;var u=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(h)}function cn(t,e,r,i,a,o,s,c,l,h,u,p){n.call(this,null,o,s,c,l,h,i,a,u,p),this.image={"width":e,"height":r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function ln(t,e,r,i,a,o,s,c,l){n.call(this,t,e,r,i,a,o,s,c,l),this.needsUpdate=!0}function hn(t,e,r,i,a,o,s,c,l,h){if((h=void 0!==h?h:$s)!==$s&&h!==tc)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&h===$s&&(r=Gs),void 0===r&&h===tc&&(r=qs),n.call(this,null,i,a,o,s,c,h,r,l),this.image={"width":t,"height":e},this.magFilter=void 0!==s?s:Rs,this.minFilter=void 0!==c?c:Rs,this.flipY=!1,this.generateMipmaps=!1}function un(t){S.call(this),this.type="WireframeGeometry";var e=[],n=[0,0],r={},i=["a","b","c"];if(t&&t.isGeometry){for(var a=t.faces,o=0,s=a.length;o<s;o++)for(var c=a[o],l=0;l<3;l++){var h=c[i[l]],u=c[i[(l+1)%3]];n[0]=Math.min(h,u),n[1]=Math.max(h,u);var p=n[0]+","+n[1];void 0===r[p]&&(r[p]={"index1":n[0],"index2":n[1]})}for(var d in r){var f=r[d],m=t.vertices[f.index1];e.push(m.x,m.y,m.z),m=t.vertices[f.index2],e.push(m.x,m.y,m.z)}}else if(t&&t.isBufferGeometry){var v=new Tl;if(null!==t.index){var g=t.attributes.position,y=t.index,x=t.groups;0===x.length&&(x=[{"start":0,"count":y.count,"materialIndex":0}]);for(var b=0,w=x.length;b<w;++b)for(var M=x[b],T=M.start,E=M.count,A=T,L=T+E;A<L;A+=3)for(var R=0;R<3;R++){var P=y.getX(A+R),C=y.getX(A+(R+1)%3);n[0]=Math.min(P,C),n[1]=Math.max(P,C);var O=n[0]+","+n[1];void 0===r[O]&&(r[O]={"index1":n[0],"index2":n[1]})}for(var I in r){var D=r[I];v.fromBufferAttribute(g,D.index1),
e.push(v.x,v.y,v.z),v.fromBufferAttribute(g,D.index2),e.push(v.x,v.y,v.z)}}else for(var N=t.attributes.position,B=0,z=N.count/3;B<z;B++)for(var G=0;G<3;G++){var F=3*B+G;v.fromBufferAttribute(N,F),e.push(v.x,v.y,v.z);var U=3*B+(G+1)%3;v.fromBufferAttribute(N,U),e.push(v.x,v.y,v.z)}}this.setAttribute("position",new _(e,3))}function pn(t,e,n){L.call(this),this.type="ParametricGeometry",this.parameters={"func":t,"slices":e,"stacks":n},this.fromBufferGeometry(new dn(t,e,n)),this.mergeVertices()}function dn(t,e,n){S.call(this),this.type="ParametricBufferGeometry",this.parameters={"func":t,"slices":e,"stacks":n};var r=[],i=[],a=[],o=[],s=new Tl,c=new Tl,l=new Tl,h=new Tl,u=new Tl;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var p=e+1,d=0;d<=n;d++)for(var f=d/n,m=0;m<=e;m++){var v=m/e;t(v,f,c),i.push(c.x,c.y,c.z),v-1e-5>=0?(t(v-1e-5,f,l),h.subVectors(c,l)):(t(v+1e-5,f,l),h.subVectors(l,c)),f-1e-5>=0?(t(v,f-1e-5,l),u.subVectors(c,l)):(t(v,f+1e-5,l),u.subVectors(l,c)),s.crossVectors(h,u).normalize(),a.push(s.x,s.y,s.z),o.push(v,f)}for(var g=0;g<n;g++)for(var y=0;y<e;y++){var x=g*p+y,b=g*p+y+1,w=(g+1)*p+y+1,M=(g+1)*p+y;r.push(x,b,M),r.push(b,w,M)}this.setIndex(r),this.setAttribute("position",new _(i,3)),this.setAttribute("normal",new _(a,3)),this.setAttribute("uv",new _(o,2))}function fn(t,e,n,r){L.call(this),this.type="PolyhedronGeometry",this.parameters={"vertices":t,"indices":e,"radius":n,"detail":r},this.fromBufferGeometry(new mn(t,e,n,r)),this.mergeVertices()}function mn(t,e,n,r){function i(t,e,n,r){for(var i=Math.pow(2,r),a=[],s=0;s<=i;s++){a[s]=[];for(var c=t.clone().lerp(n,s/i),l=e.clone().lerp(n,s/i),h=i-s,u=0;u<=h;u++)a[s][u]=0===u&&s===i?c:c.clone().lerp(l,u/h)}for(var p=0;p<i;p++)for(var d=0;d<2*(i-p)-1;d++){var f=Math.floor(d/2);d%2==0?(o(a[p][f+1]),o(a[p+1][f]),o(a[p][f])):(o(a[p][f+1]),o(a[p+1][f+1]),o(a[p+1][f]))}}function a(){for(var t=0;t<d.length;t+=6){var e=d[t+0],n=d[t+2],r=d[t+4],i=Math.max(e,n,r),a=Math.min(e,n,r);i>.9&&a<.1&&(e<.2&&(d[t+0]+=1),n<.2&&(d[t+2]+=1),r<.2&&(d[t+4]+=1))}}function o(t){p.push(t.x,t.y,t.z)}function s(e,n){var r=3*e;n.x=t[r+0],n.y=t[r+1],n.z=t[r+2]}function c(){for(var t=new Tl,e=new Tl,n=new Tl,r=new Tl,i=new ml,a=new ml,o=new ml,s=0,c=0;s<p.length;s+=9,c+=6){t.set(p[s+0],p[s+1],p[s+2]),e.set(p[s+3],p[s+4],p[s+5]),n.set(p[s+6],p[s+7],p[s+8]),i.set(d[c+0],d[c+1]),a.set(d[c+2],d[c+3]),o.set(d[c+4],d[c+5]),r.copy(t).add(e).add(n).divideScalar(3);var u=h(r);l(i,c+0,t,u),l(a,c+2,e,u),l(o,c+4,n,u)}}function l(t,e,n,r){r<0&&1===t.x&&(d[e]=t.x-1),0===n.x&&0===n.z&&(d[e]=r/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}function u(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}S.call(this),this.type="PolyhedronBufferGeometry",this.parameters={"vertices":t,"indices":e,"radius":n,"detail":r},n=n||1,r=r||0;var p=[],d=[];!function(t){for(var n=new Tl,r=new Tl,a=new Tl,o=0;o<e.length;o+=3)s(e[o+0],n),s(e[o+1],r),s(e[o+2],a),i(n,r,a,t)}(r),function(t){for(var e=new Tl,n=0;n<p.length;n+=3)e.x=p[n+0],e.y=p[n+1],e.z=p[n+2],e.normalize().multiplyScalar(t),p[n+0]=e.x,p[n+1]=e.y,p[n+2]=e.z}(n),function(){for(var t=new Tl,e=0;e<p.length;e+=3){t.x=p[e+0],t.y=p[e+1],t.z=p[e+2];var n=h(t)/2/Math.PI+.5,r=u(t)/Math.PI+.5;d.push(n,1-r)}c(),a()}(),this.setAttribute("position",new _(p,3)),this.setAttribute("normal",new _(p.slice(),3)),this.setAttribute("uv",new _(d,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function vn(t,e){L.call(this),this.type="TetrahedronGeometry",this.parameters={"radius":t,"detail":e},this.fromBufferGeometry(new gn(t,e)),this.mergeVertices()}function gn(t,e){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];mn.call(this,n,r,t,e),this.type="TetrahedronBufferGeometry",this.parameters={"radius":t,"detail":e}}function yn(t,e){L.call(this),this.type="OctahedronGeometry",this.parameters={"radius":t,"detail":e},this.fromBufferGeometry(new xn(t,e)),this.mergeVertices()}function xn(t,e){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];mn.call(this,n,r,t,e),this.type="OctahedronBufferGeometry",this.parameters={"radius":t,"detail":e}}function bn(t,e){L.call(this),this.type="IcosahedronGeometry",this.parameters={"radius":t,"detail":e},this.fromBufferGeometry(new _n(t,e)),this.mergeVertices()}function _n(t,e){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],i=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];mn.call(this,r,i,t,e),this.type="IcosahedronBufferGeometry",this.parameters={"radius":t,"detail":e}}function wn(t,e){L.call(this),this.type="DodecahedronGeometry",this.parameters={"radius":t,"detail":e},this.fromBufferGeometry(new Mn(t,e)),this.mergeVertices()}function Mn(t,e){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];mn.call(this,i,a,t,e),this.type="DodecahedronBufferGeometry",this.parameters={"radius":t,"detail":e}}function Sn(t,e,n,r,i,a){L.call(this),this.type="TubeGeometry",this.parameters={"path":t,"tubularSegments":e,"radius":n,"radialSegments":r,"closed":i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Tn(t,e,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Tn(t,e,n,r,i){function a(i){p=t.getPointAt(i/e,p);for(var a=c.normals[i],o=c.binormals[i],s=0;s<=r;s++){var u=s/r*Math.PI*2,m=Math.sin(u),v=-Math.cos(u);h.x=v*a.x+m*o.x,h.y=v*a.y+m*o.y,h.z=v*a.z+m*o.z,h.normalize(),f.push(h.x,h.y,h.z),l.x=p.x+n*h.x,l.y=p.y+n*h.y,l.z=p.z+n*h.z,d.push(l.x,l.y,l.z)}}function o(){for(var t=1;t<=e;t++)for(var n=1;n<=r;n++){var i=(r+1)*(t-1)+(n-1),a=(r+1)*t+(n-1),o=(r+1)*t+n,s=(r+1)*(t-1)+n;v.push(i,a,s),v.push(a,o,s)}}function s(){for(var t=0;t<=e;t++)for(var n=0;n<=r;n++)u.x=t/e,u.y=n/r,m.push(u.x,u.y)}S.call(this),this.type="TubeBufferGeometry",this.parameters={"path":t,"tubularSegments":e,"radius":n,"radialSegments":r,"closed":i},e=e||64,n=n||1,r=r||8,i=i||!1;var c=t.computeFrenetFrames(e,i);this.tangents=c.tangents,this.normals=c.normals,this.binormals=c.binormals;var l=new Tl,h=new Tl,u=new ml,p=new Tl,d=[],f=[],m=[],v=[];!function(){for(var t=0;t<e;t++)a(t);a(!1===i?e:0),s(),o()}(),this.setIndex(v),this.setAttribute("position",new _(d,3)),this.setAttribute("normal",new _(f,3)),this.setAttribute("uv",new _(m,2))}function En(t,e,n,r,i,a,o){L.call(this),this.type="TorusKnotGeometry",this.parameters={"radius":t,"tube":e,"tubularSegments":n,"radialSegments":r,"p":i,"q":a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new An(t,e,n,r,i,a)),this.mergeVertices()}function An(t,e,n,r,i,a){function o(t,e,n,r,i){var a=Math.cos(t),o=Math.sin(t),s=n/e*t,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}S.call(this),this.type="TorusKnotBufferGeometry",this.parameters={"radius":t,"tube":e,"tubularSegments":n,"radialSegments":r,"p":i,"q":a},t=t||1,e=e||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;for(var s=[],c=[],l=[],h=[],u=new Tl,p=new Tl,d=new Tl,f=new Tl,m=new Tl,v=new Tl,g=new Tl,y=0;y<=n;++y){var x=y/n*i*Math.PI*2;o(x,i,a,t,d),o(x+.01,i,a,t,f),v.subVectors(f,d),g.addVectors(f,d),m.crossVectors(v,g),g.crossVectors(m,v),m.normalize(),g.normalize();for(var b=0;b<=r;++b){var w=b/r*Math.PI*2,M=-e*Math.cos(w),T=e*Math.sin(w);u.x=d.x+(M*g.x+T*m.x),u.y=d.y+(M*g.y+T*m.y),u.z=d.z+(M*g.z+T*m.z),c.push(u.x,u.y,u.z),p.subVectors(u,d).normalize(),l.push(p.x,p.y,p.z),h.push(y/n),h.push(b/r)}}for(var E=1;E<=n;E++)for(var A=1;A<=r;A++){var L=(r+1)*(E-1)+(A-1),R=(r+1)*E+(A-1),P=(r+1)*E+A,C=(r+1)*(E-1)+A;s.push(L,R,C),s.push(R,P,C)}this.setIndex(s),this.setAttribute("position",new _(c,3)),this.setAttribute("normal",new _(l,3)),this.setAttribute("uv",new _(h,2))}function Ln(t,e,n,r,i){L.call(this),this.type="TorusGeometry",this.parameters={"radius":t,"tube":e,"radialSegments":n,"tubularSegments":r,"arc":i},this.fromBufferGeometry(new Rn(t,e,n,r,i)),this.mergeVertices()}function Rn(t,e,n,r,i){S.call(this),this.type="TorusBufferGeometry",this.parameters={"radius":t,"tube":e,"radialSegments":n,"tubularSegments":r,"arc":i},t=t||1,e=e||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;for(var a=[],o=[],s=[],c=[],l=new Tl,h=new Tl,u=new Tl,p=0;p<=n;p++)for(var d=0;d<=r;d++){var f=d/r*i,m=p/n*Math.PI*2;h.x=(t+e*Math.cos(m))*Math.cos(f),h.y=(t+e*Math.cos(m))*Math.sin(f),h.z=e*Math.sin(m),o.push(h.x,h.y,h.z),l.x=t*Math.cos(f),l.y=t*Math.sin(f),u.subVectors(h,l).normalize(),s.push(u.x,u.y,u.z),c.push(d/r),c.push(p/n)}for(var v=1;v<=n;v++)for(var g=1;g<=r;g++){var y=(r+1)*v+g-1,x=(r+1)*(v-1)+g-1,b=(r+1)*(v-1)+g,w=(r+1)*v+g;a.push(y,x,w),a.push(x,b,w)}this.setIndex(a),this.setAttribute("position",new _(o,3)),this.setAttribute("normal",new _(s,3)),this.setAttribute("uv",new _(c,2))}function Pn(t,e,n,r,i){var a,o;if(i===or(t,e,n,r)>0)for(a=e;a<n;a+=r)o=rr(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=rr(a,t[a],t[a+1],o);return o&&Zn(o,o.next)&&(ir(o),o=o.next),o}function Cn(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Zn(r,r.next)&&0!==Yn(r.prev,r,r.next))r=r.next;else{if(ir(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function On(t,e,n,r,i,a,o){if(t){!o&&a&&kn(t,r,i,a);for(var s,c,l=t;t.prev!==t.next;)if(s=t.prev,c=t.next,a?Dn(t,r,i,a):In(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),ir(t),t=c.next,l=c.next;else if((t=c)===l){o?1===o?(t=Nn(Cn(t),e,n),On(t,e,n,r,i,a,2)):2===o&&Bn(t,e,n,r,i,a):On(Cn(t),e,n,r,i,a,1);break}}}function In(t){var e=t.prev,n=t,r=t.next;if(Yn(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(qn(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Yn(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Dn(t,e,n,r){var i=t.prev,a=t,o=t.next;if(Yn(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,h=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=jn(s,c,e,n,r),p=jn(l,h,e,n,r),d=t.prevZ,f=t.nextZ;d&&d.z>=u&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&qn(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Yn(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&qn(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Yn(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=u;){if(d!==t.prev&&d!==t.next&&qn(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Yn(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&qn(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Yn(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Nn(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!Zn(i,a)&&Jn(i,r,r.next,a)&&tr(i,a)&&tr(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),ir(r),ir(r.next),r=t=a),r=r.next}while(r!==t);return Cn(r)}function Bn(t,e,n,r,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Xn(o,s)){var c=nr(o,s);return o=Cn(o,o.next),c=Cn(c,c.next),On(o,e,n,r,i,a),void On(c,e,n,r,i,a)}s=s.next}o=o.next}while(o!==t)}function zn(t,e,n,r){var i,a,o,s,c,l=[];for(i=0,a=e.length;i<a;i++)o=e[i]*r,s=i<a-1?e[i+1]*r:t.length,c=Pn(t,o,s,r,!1),c===c.next&&(c.steiner=!0),l.push(Wn(c));for(l.sort(Gn),i=0;i<l.length;i++)Fn(l[i],n),n=Cn(n,n.next);return n}function Gn(t,e){return t.x-e.x}function Fn(t,e){if(e=Un(t,e)){var n=nr(e,t);Cn(e,e.next),Cn(n,n.next)}}function Un(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===o)return n;var c,l=n,h=n.x,u=n.y,p=1/0;r=n;do{i>=r.x&&r.x>=h&&i!==r.x&&qn(a<u?i:o,a,h,u,a<u?o:i,a,r.x,r.y)&&(c=Math.abs(a-r.y)/(i-r.x),tr(r,t)&&(c<p||c===p&&(r.x>n.x||r.x===n.x&&Hn(n,r)))&&(n=r,p=c)),r=r.next}while(r!==l);return n}function Hn(t,e){return Yn(t.prev,t,e.prev)<0&&Yn(e.next,t,t.next)<0}function kn(t,e,n,r){var i=t;do{null===i.z&&(i.z=jn(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,Vn(i)}function Vn(t){var e,n,r,i,a,o,s,c,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return t}function jn(t,e,n,r,i){return t=32767*(t-n)*i,e=32767*(e-r)*i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function Wn(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function qn(t,e,n,r,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(r-s)-(n-o)*(e-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function Xn(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!$n(t,e)&&(tr(t,e)&&tr(e,t)&&er(t,e)&&(Yn(t.prev,t,e.prev)||Yn(t,e.prev,e))||Zn(t,e)&&Yn(t.prev,t,t.next)>0&&Yn(e.prev,e,e.next)>0)}function Yn(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Zn(t,e){return t.x===e.x&&t.y===e.y}function Jn(t,e,n,r){var i=Kn(Yn(t,e,n)),a=Kn(Yn(t,e,r)),o=Kn(Yn(n,r,t)),s=Kn(Yn(n,r,e));return i!==a&&o!==s||(!(0!==i||!Qn(t,n,e))||(!(0!==a||!Qn(t,r,e))||(!(0!==o||!Qn(n,t,r))||!(0!==s||!Qn(n,e,r)))))}function Qn(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Kn(t){return t>0?1:t<0?-1:0}function $n(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Jn(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function tr(t,e){return Yn(t.prev,t,t.next)<0?Yn(t,e,t.next)>=0&&Yn(t,t.prev,e)>=0:Yn(t,e,t.prev)<0||Yn(t,t.next,e)<0}function er(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}function nr(t,e){var n=new ar(t.i,t.x,t.y),r=new ar(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function rr(t,e,n,r){var i=new ar(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ir(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ar(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function or(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function sr(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function cr(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function lr(t,e){L.call(this),this.type="ExtrudeGeometry",this.parameters={"shapes":t,"options":e},this.fromBufferGeometry(new hr(t,e)),this.mergeVertices()}function hr(t,e){S.call(this),this.type="ExtrudeBufferGeometry",this.parameters={"shapes":t,"options":e},t=Array.isArray(t)?t:[t];for(var n=this,r=[],i=[],a=0,o=t.length;a<o;a++){var s=t[a];!function(t){function a(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}function o(t,e,n){var r,i,a,o=t.x-e.x,s=t.y-e.y,c=n.x-t.x,l=n.y-t.y,h=o*o+s*s,u=o*l-s*c;if(Math.abs(u)>Number.EPSILON){var p=Math.sqrt(h),d=Math.sqrt(c*c+l*l),f=e.x-s/p,m=e.y+o/p,v=n.x-l/d,g=n.y+c/d,y=((v-f)*l-(g-m)*c)/(o*l-s*c);r=f+o*y-t.x,i=m+s*y-t.y;var x=r*r+i*i;if(x<=2)return new ml(r,i);a=Math.sqrt(x/2)}else{var b=!1;o>Number.EPSILON?c>Number.EPSILON&&(b=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(b=!0):Math.sign(s)===Math.sign(l)&&(b=!0),b?(r=-s,i=o,a=Math.sqrt(h)):(r=o,i=s,a=Math.sqrt(h/2))}return new ml(r/a,i/a)}function s(t,e){for(var n=t.length;--n>=0;){var r=n,i=n-1;i<0&&(i=t.length-1);for(var a=0,o=m+2*_;a<o;a++){var s=H*a,c=H*(a+1);h(e+r+s,e+i+s,e+i+c,e+r+c)}}}function c(t,e,n){d.push(t),d.push(e),d.push(n)}function l(t,e,i){u(t),u(e),u(i);var a=r.length/3,o=M.generateTopUV(n,r,a-3,a-2,a-1);p(o[0]),p(o[1]),p(o[2])}function h(t,e,i,a){u(t),u(e),u(a),u(e),u(i),u(a);var o=r.length/3,s=M.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);p(s[0]),p(s[1]),p(s[3]),p(s[1]),p(s[2]),p(s[3])}function u(t){r.push(d[3*t+0]),r.push(d[3*t+1]),r.push(d[3*t+2])}function p(t){i.push(t.x),i.push(t.y)}var d=[],f=void 0!==e.curveSegments?e.curveSegments:12,m=void 0!==e.steps?e.steps:1,v=void 0!==e.depth?e.depth:100,g=void 0===e.bevelEnabled||e.bevelEnabled,y=void 0!==e.bevelThickness?e.bevelThickness:6,x=void 0!==e.bevelSize?e.bevelSize:y-2,b=void 0!==e.bevelOffset?e.bevelOffset:0,_=void 0!==e.bevelSegments?e.bevelSegments:3,w=e.extrudePath,M=void 0!==e.UVGenerator?e.UVGenerator:Ip;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),v=e.amount);var S,T,E,A,L,R=!1;w&&(S=w.getSpacedPoints(m),R=!0,g=!1,T=w.computeFrenetFrames(m,!1),E=new Tl,A=new Tl,L=new Tl),g||(_=0,y=0,x=0,b=0);var P=t.extractPoints(f),C=P.shape,O=P.holes;if(!Op.isClockWise(C)){C=C.reverse();for(var I=0,D=O.length;I<D;I++){var N=O[I];Op.isClockWise(N)&&(O[I]=N.reverse())}}for(var B=Op.triangulateShape(C,O),z=C,G=0,F=O.length;G<F;G++){var U=O[G];C=C.concat(U)}for(var H=C.length,k=B.length,V=[],j=0,W=z.length,q=W-1,X=j+1;j<W;j++,q++,X++)q===W&&(q=0),X===W&&(X=0),V[j]=o(z[j],z[q],z[X]);for(var Y,Z=[],J=V.concat(),Q=0,K=O.length;Q<K;Q++){var $=O[Q];Y=[];for(var tt=0,et=$.length,nt=et-1,rt=tt+1;tt<et;tt++,nt++,rt++)nt===et&&(nt=0),rt===et&&(rt=0),Y[tt]=o($[tt],$[nt],$[rt]);Z.push(Y),J=J.concat(Y)}for(var it=0;it<_;it++){for(var at=it/_,ot=y*Math.cos(at*Math.PI/2),st=x*Math.sin(at*Math.PI/2)+b,ct=0,lt=z.length;ct<lt;ct++){var ht=a(z[ct],V[ct],st);c(ht.x,ht.y,-ot)}for(var ut=0,pt=O.length;ut<pt;ut++){var dt=O[ut];Y=Z[ut];for(var ft=0,mt=dt.length;ft<mt;ft++){var vt=a(dt[ft],Y[ft],st);c(vt.x,vt.y,-ot)}}}for(var gt=x+b,yt=0;yt<H;yt++){var xt=g?a(C[yt],J[yt],gt):C[yt];R?(A.copy(T.normals[0]).multiplyScalar(xt.x),E.copy(T.binormals[0]).multiplyScalar(xt.y),L.copy(S[0]).add(A).add(E),c(L.x,L.y,L.z)):c(xt.x,xt.y,0)}for(var bt=1;bt<=m;bt++)for(var _t=0;_t<H;_t++){var wt=g?a(C[_t],J[_t],gt):C[_t];R?(A.copy(T.normals[bt]).multiplyScalar(wt.x),E.copy(T.binormals[bt]).multiplyScalar(wt.y),L.copy(S[bt]).add(A).add(E),c(L.x,L.y,L.z)):c(wt.x,wt.y,v/m*bt)}for(var Mt=_-1;Mt>=0;Mt--){for(var St=Mt/_,Tt=y*Math.cos(St*Math.PI/2),Et=x*Math.sin(St*Math.PI/2)+b,At=0,Lt=z.length;At<Lt;At++){var Rt=a(z[At],V[At],Et);c(Rt.x,Rt.y,v+Tt)}for(var Pt=0,Ct=O.length;Pt<Ct;Pt++){var Ot=O[Pt];Y=Z[Pt];for(var It=0,Dt=Ot.length;It<Dt;It++){var Nt=a(Ot[It],Y[It],Et);R?c(Nt.x,Nt.y+S[m-1].y,S[m-1].x+Tt):c(Nt.x,Nt.y,v+Tt)}}}!function(){var t=r.length/3;if(g){for(var e=0,i=H*e,a=0;a<k;a++){var o=B[a];l(o[2]+i,o[1]+i,o[0]+i)}e=m+2*_,i=H*e;for(var s=0;s<k;s++){var c=B[s];l(c[0]+i,c[1]+i,c[2]+i)}}else{for(var h=0;h<k;h++){var u=B[h];l(u[2],u[1],u[0])}for(var p=0;p<k;p++){var d=B[p];l(d[0]+H*m,d[1]+H*m,d[2]+H*m)}}n.addGroup(t,r.length/3-t,0)}(),function(){var t=r.length/3,e=0;s(z,e),e+=z.length;for(var i=0,a=O.length;i<a;i++){var o=O[i];s(o,e),e+=o.length}n.addGroup(t,r.length/3-t,1)}()}(s)}this.setAttribute("position",new _(r,3)),this.setAttribute("uv",new _(i,2)),this.computeVertexNormals()}function ur(t,e,n){if(n.shapes=[],Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var a=t[r];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function pr(t,e){L.call(this),this.type="TextGeometry",this.parameters={"text":t,"parameters":e},this.fromBufferGeometry(new dr(t,e)),this.mergeVertices()}function dr(t,e){e=e||{};var n=e.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new L;var r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),hr.call(this,r,e),this.type="TextBufferGeometry"}function fr(t,e,n,r,i,a,o){L.call(this),this.type="SphereGeometry",this.parameters={"radius":t,"widthSegments":e,"heightSegments":n,"phiStart":r,"phiLength":i,"thetaStart":a,"thetaLength":o},this.fromBufferGeometry(new mr(t,e,n,r,i,a,o)),this.mergeVertices()}function mr(t,e,n,r,i,a,o){S.call(this),this.type="SphereBufferGeometry",this.parameters={"radius":t,"widthSegments":e,"heightSegments":n,"phiStart":r,"phiLength":i,"thetaStart":a,"thetaLength":o},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;for(var s=Math.min(a+o,Math.PI),c=0,l=[],h=new Tl,u=new Tl,p=[],d=[],f=[],m=[],v=0;v<=n;v++){var g=[],y=v/n,x=0;0==v&&0==a?x=.5/e:v==n&&s==Math.PI&&(x=-.5/e);for(var b=0;b<=e;b++){var w=b/e;h.x=-t*Math.cos(r+w*i)*Math.sin(a+y*o),h.y=t*Math.cos(a+y*o),h.z=t*Math.sin(r+w*i)*Math.sin(a+y*o),d.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(w+x,1-y),g.push(c++)}l.push(g)}for(var M=0;M<n;M++)for(var T=0;T<e;T++){var E=l[M][T+1],A=l[M][T],L=l[M+1][T],R=l[M+1][T+1];(0!==M||a>0)&&p.push(E,A,R),(M!==n-1||s<Math.PI)&&p.push(A,L,R)}this.setIndex(p),this.setAttribute("position",new _(d,3)),this.setAttribute("normal",new _(f,3)),this.setAttribute("uv",new _(m,2))}function vr(t,e,n,r,i,a){L.call(this),this.type="RingGeometry",this.parameters={"innerRadius":t,"outerRadius":e,"thetaSegments":n,"phiSegments":r,"thetaStart":i,"thetaLength":a},this.fromBufferGeometry(new gr(t,e,n,r,i,a)),this.mergeVertices()}function gr(t,e,n,r,i,a){S.call(this),this.type="RingBufferGeometry",this.parameters={"innerRadius":t,"outerRadius":e,"thetaSegments":n,"phiSegments":r,"thetaStart":i,"thetaLength":a},t=t||.5,e=e||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?Math.max(1,r):1;for(var o=[],s=[],c=[],l=[],h=t,u=(e-t)/r,p=new Tl,d=new ml,f=0;f<=r;f++){for(var m=0;m<=n;m++){var v=i+m/n*a;p.x=h*Math.cos(v),p.y=h*Math.sin(v),s.push(p.x,p.y,p.z),c.push(0,0,1),d.x=(p.x/e+1)/2,d.y=(p.y/e+1)/2,l.push(d.x,d.y)}h+=u}for(var g=0;g<r;g++)for(var y=g*(n+1),x=0;x<n;x++){var b=x+y,w=b,M=b+n+1,T=b+n+2,E=b+1;o.push(w,M,E),o.push(M,T,E)}this.setIndex(o),this.setAttribute("position",new _(s,3)),this.setAttribute("normal",new _(c,3)),this.setAttribute("uv",new _(l,2))}function yr(t,e,n,r){L.call(this),this.type="LatheGeometry",this.parameters={"points":t,"segments":e,"phiStart":n,"phiLength":r},this.fromBufferGeometry(new xr(t,e,n,r)),this.mergeVertices()}function xr(t,e,n,r){S.call(this),this.type="LatheBufferGeometry",this.parameters={"points":t,"segments":e,"phiStart":n,"phiLength":r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=fl.clamp(r,0,2*Math.PI);for(var i=[],a=[],o=[],s=1/e,c=new Tl,l=new ml,h=0;h<=e;h++)for(var u=n+h*s*r,p=Math.sin(u),d=Math.cos(u),f=0;f<=t.length-1;f++)c.x=t[f].x*p,c.y=t[f].y,c.z=t[f].x*d,a.push(c.x,c.y,c.z),l.x=h/e,l.y=f/(t.length-1),o.push(l.x,l.y);for(var m=0;m<e;m++)for(var v=0;v<t.length-1;v++){var g=v+m*t.length,y=g,x=g+t.length,b=g+t.length+1,w=g+1;i.push(y,x,w),i.push(x,b,w)}if(this.setIndex(i),this.setAttribute("position",new _(a,3)),this.setAttribute("uv",new _(o,2)),this.computeVertexNormals(),r===2*Math.PI)for(var M=this.attributes.normal.array,T=new Tl,E=new Tl,A=new Tl,L=e*t.length*3,R=0,P=0;R<t.length;R++,P+=3)T.x=M[P+0],T.y=M[P+1],T.z=M[P+2],E.x=M[L+P+0],E.y=M[L+P+1],E.z=M[L+P+2],A.addVectors(T,E).normalize(),M[P+0]=M[L+P+0]=A.x,M[P+1]=M[L+P+1]=A.y,M[P+2]=M[L+P+2]=A.z}function br(t,e){L.call(this),this.type="ShapeGeometry","object"===(void 0===e?"undefined":o(e))&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={"shapes":t,"curveSegments":e},this.fromBufferGeometry(new _r(t,e)),this.mergeVertices()}function _r(t,e){function n(t){var n=i.length/3,s=t.extractPoints(e),l=s.shape,h=s.holes;!1===Op.isClockWise(l)&&(l=l.reverse());for(var u=0,p=h.length;u<p;u++){var d=h[u];!0===Op.isClockWise(d)&&(h[u]=d.reverse())}for(var f=Op.triangulateShape(l,h),m=0,v=h.length;m<v;m++){var g=h[m];l=l.concat(g)}for(var y=0,x=l.length;y<x;y++){var b=l[y];i.push(b.x,b.y,0),a.push(0,0,1),o.push(b.x,b.y)}for(var _=0,w=f.length;_<w;_++){var M=f[_],S=M[0]+n,T=M[1]+n,E=M[2]+n;r.push(S,T,E),c+=3}}S.call(this),this.type="ShapeBufferGeometry",this.parameters={"shapes":t,"curveSegments":e},e=e||12;var r=[],i=[],a=[],o=[],s=0,c=0;if(!1===Array.isArray(t))n(t);else for(var l=0;l<t.length;l++)n(t[l]),this.addGroup(s,c,l),s+=c,c=0;this.setIndex(r),this.setAttribute("position",new _(i,3)),this.setAttribute("normal",new _(a,3)),this.setAttribute("uv",new _(o,2))}function wr(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}function Mr(t,e){S.call(this),this.type="EdgesGeometry",this.parameters={"thresholdAngle":e},e=void 0!==e?e:1;var n,r,i,a,o=[],s=Math.cos(fl.DEG2RAD*e),c=[0,0],l={},h=["a","b","c"];t.isBufferGeometry?(a=new L,a.fromBufferGeometry(t)):a=t.clone(),a.mergeVertices(),a.computeFaceNormals();for(var u=a.vertices,p=a.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],v=0;v<3;v++)n=m[h[v]],r=m[h[(v+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),i=c[0]+","+c[1],void 0===l[i]?l[i]={"index1":c[0],"index2":c[1],"face1":d,"face2":void 0}:l[i].face2=d;for(i in l){var g=l[i];if(void 0===g.face2||p[g.face1].normal.dot(p[g.face2].normal)<=s){var y=u[g.index1];o.push(y.x,y.y,y.z),y=u[g.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new _(o,3))}function Sr(t,e,n,r,i,a,o,s){L.call(this),this.type="CylinderGeometry",this.parameters={"radiusTop":t,"radiusBottom":e,"height":n,"radialSegments":r,"heightSegments":i,"openEnded":a,"thetaStart":o,"thetaLength":s},this.fromBufferGeometry(new Tr(t,e,n,r,i,a,o,s)),this.mergeVertices()}function Tr(t,e,n,r,i,a,o,s){function c(n){for(var i=f,a=new ml,c=new Tl,m=0,y=!0===n?t:e,x=!0===n?1:-1,b=1;b<=r;b++)u.push(0,v*x,0),p.push(0,x,0),d.push(.5,.5),f++;for(var _=f,w=0;w<=r;w++){var M=w/r,S=M*s+o,T=Math.cos(S),E=Math.sin(S);c.x=y*E,c.y=v*x,c.z=y*T,u.push(c.x,c.y,c.z),p.push(0,x,0),a.x=.5*T+.5,a.y=.5*E*x+.5,d.push(a.x,a.y),f++}for(var A=0;A<r;A++){var L=i+A,R=_+A;!0===n?h.push(R,R+1,L):h.push(R+1,R,L),m+=3}l.addGroup(g,m,!0===n?1:2),g+=m}S.call(this),this.type="CylinderBufferGeometry",this.parameters={"radiusTop":t,"radiusBottom":e,"height":n,"radialSegments":r,"heightSegments":i,"openEnded":a,"thetaStart":o,"thetaLength":s};var l=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var h=[],u=[],p=[],d=[],f=0,m=[],v=n/2,g=0;!function(){for(var a=new Tl,c=new Tl,y=0,x=(e-t)/n,b=0;b<=i;b++){for(var _=[],w=b/i,M=w*(e-t)+t,S=0;S<=r;S++){var T=S/r,E=T*s+o,A=Math.sin(E),L=Math.cos(E);c.x=M*A,c.y=-w*n+v,c.z=M*L,u.push(c.x,c.y,c.z),a.set(A,x,L).normalize(),p.push(a.x,a.y,a.z),d.push(T,1-w),_.push(f++)}m.push(_)}for(var R=0;R<r;R++)for(var P=0;P<i;P++){var C=m[P][R],O=m[P+1][R],I=m[P+1][R+1],D=m[P][R+1];h.push(C,O,D),h.push(O,I,D),y+=6}l.addGroup(g,y,0),g+=y}(),!1===a&&(t>0&&c(!0),e>0&&c(!1)),this.setIndex(h),this.setAttribute("position",new _(u,3)),this.setAttribute("normal",new _(p,3)),this.setAttribute("uv",new _(d,2))}function Er(t,e,n,r,i,a,o){Sr.call(this,0,t,e,n,r,i,a,o),this.type="ConeGeometry",this.parameters={"radius":t,"height":e,"radialSegments":n,"heightSegments":r,"openEnded":i,"thetaStart":a,"thetaLength":o}}function Ar(t,e,n,r,i,a,o){Tr.call(this,0,t,e,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={"radius":t,"height":e,"radialSegments":n,"heightSegments":r,"openEnded":i,"thetaStart":a,"thetaLength":o}}function Lr(t,e,n,r){L.call(this),this.type="CircleGeometry",this.parameters={"radius":t,"segments":e,"thetaStart":n,"thetaLength":r},this.fromBufferGeometry(new Rr(t,e,n,r)),this.mergeVertices()}function Rr(t,e,n,r){S.call(this),this.type="CircleBufferGeometry",this.parameters={"radius":t,"segments":e,"thetaStart":n,"thetaLength":r},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i=[],a=[],o=[],s=[],c=new Tl,l=new ml;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(var h=0,u=3;h<=e;h++,u+=3){var p=n+h/e*r;c.x=t*Math.cos(p),c.y=t*Math.sin(p),a.push(c.x,c.y,c.z),o.push(0,0,1),l.x=(a[u]/t+1)/2,l.y=(a[u+1]/t+1)/2,s.push(l.x,l.y)}for(var d=1;d<=e;d++)i.push(d,d+1,0);this.setIndex(i),this.setAttribute("position",new _(a,3)),this.setAttribute("normal",new _(o,3)),this.setAttribute("uv",new _(s,2))}function Pr(t){u.call(this),this.type="ShadowMaterial",this.color=new kh(0),this.transparent=!0,this.setValues(t)}function Cr(t){I.call(this,t),this.type="RawShaderMaterial"}function Or(t){u.call(this),this.defines={"STANDARD":""},this.type="MeshStandardMaterial",this.color=new kh(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kh(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=il,this.normalScale=new ml(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function Ir(t){Or.call(this),this.defines={"STANDARD":"","PHYSICAL":""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ml(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(t)}function Dr(t){u.call(this),this.type="MeshPhongMaterial",this.color=new kh(16777215),this.specular=new kh(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kh(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=il,this.normalScale=new ml(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=us,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Nr(t){u.call(this),this.defines={"TOON":""},this.type="MeshToonMaterial",this.color=new kh(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kh(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=il,this.normalScale=new ml(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Br(t){u.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=il,this.normalScale=new ml(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,
this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function zr(t){u.call(this),this.type="MeshLambertMaterial",this.color=new kh(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kh(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=us,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Gr(t){u.call(this),this.defines={"MATCAP":""},this.type="MeshMatcapMaterial",this.color=new kh(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=il,this.normalScale=new ml(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Fr(t){$e.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function Ur(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Hr(t,e,n,r){Ur.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function kr(t,e,n,r){Ur.call(this,t,e,n,r)}function Vr(t,e,n,r){Ur.call(this,t,e,n,r)}function jr(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Bp.convertArray(e,this.TimeBufferType),this.values=Bp.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Wr(t,e,n){jr.call(this,t,e,n)}function qr(t,e,n,r){jr.call(this,t,e,n,r)}function Xr(t,e,n,r){jr.call(this,t,e,n,r)}function Yr(t,e,n,r){Ur.call(this,t,e,n,r)}function Zr(t,e,n,r){jr.call(this,t,e,n,r)}function Jr(t,e,n,r){jr.call(this,t,e,n,r)}function Qr(t,e,n,r){jr.call(this,t,e,n,r)}function Kr(t,e,n,r){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.blendMode=void 0!==r?r:Xc,this.uuid=fl.generateUUID(),this.duration<0&&this.resetDuration()}function $r(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Xr;case"vector":case"vector2":case"vector3":case"vector4":return Qr;case"color":return qr;case"quaternion":return Zr;case"bool":case"boolean":return Wr;case"string":return Jr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function ti(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=$r(t.type);if(void 0===t.times){var n=[],r=[];Bp.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}function ei(t,e,n){var r=this,i=!1,a=0,o=0,s=void 0,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===i&&void 0!==r.onStart&&r.onStart(t,a,o),i=!0},this.itemEnd=function(t){a++,void 0!==r.onProgress&&r.onProgress(t,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){var e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=c.length;e<n;e+=2){var r=c[e],i=c[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null}}function ni(t){this.manager=void 0!==t?t:Gp,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}function ri(t){ni.call(this,t)}function ii(t){ni.call(this,t)}function ai(t){ni.call(this,t)}function oi(t){ni.call(this,t)}function si(t){ni.call(this,t)}function ci(t){ni.call(this,t)}function li(t){ni.call(this,t)}function hi(){this.type="Curve",this.arcLengthDivisions=200}function ui(t,e,n,r,i,a,o,s){hi.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function pi(t,e,n,r,i,a){ui.call(this,t,e,n,n,r,i,a),this.type="ArcCurve"}function di(){function t(t,a,o,s){e=t,n=o,r=-3*t+3*a-2*o-s,i=2*t-2*a+o+s}var e=0,n=0,r=0,i=0;return{"initCatmullRom":function(e,n,r,i,a){t(n,r,a*(r-e),a*(i-n))},"initNonuniformCatmullRom":function(e,n,r,i,a,o,s){var c=(n-e)/a-(r-e)/(a+o)+(r-n)/o,l=(r-n)/o-(i-n)/(o+s)+(i-r)/s;c*=o,l*=o,t(n,r,c,l)},"calc":function(t){var a=t*t;return e+n*t+r*a+i*(a*t)}}}function fi(t,e,n,r){hi.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=void 0!==r?r:.5}function mi(t,e,n,r,i){var a=.5*(r-e),o=.5*(i-n),s=t*t;return(2*n-2*r+a+o)*(t*s)+(-3*n+3*r-2*a-o)*s+a*t+n}function vi(t,e){var n=1-t;return n*n*e}function gi(t,e){return 2*(1-t)*t*e}function yi(t,e){return t*t*e}function xi(t,e,n,r){return vi(t,e)+gi(t,n)+yi(t,r)}function bi(t,e){var n=1-t;return n*n*n*e}function _i(t,e){var n=1-t;return 3*n*n*t*e}function wi(t,e){return 3*(1-t)*t*t*e}function Mi(t,e){return t*t*t*e}function Si(t,e,n,r,i){return bi(t,e)+_i(t,n)+wi(t,r)+Mi(t,i)}function Ti(t,e,n,r){hi.call(this),this.type="CubicBezierCurve",this.v0=t||new ml,this.v1=e||new ml,this.v2=n||new ml,this.v3=r||new ml}function Ei(t,e,n,r){hi.call(this),this.type="CubicBezierCurve3",this.v0=t||new Tl,this.v1=e||new Tl,this.v2=n||new Tl,this.v3=r||new Tl}function Ai(t,e){hi.call(this),this.type="LineCurve",this.v1=t||new ml,this.v2=e||new ml}function Li(t,e){hi.call(this),this.type="LineCurve3",this.v1=t||new Tl,this.v2=e||new Tl}function Ri(t,e,n){hi.call(this),this.type="QuadraticBezierCurve",this.v0=t||new ml,this.v1=e||new ml,this.v2=n||new ml}function Pi(t,e,n){hi.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Tl,this.v1=e||new Tl,this.v2=n||new Tl}function Ci(t){hi.call(this),this.type="SplineCurve",this.points=t||[]}function Oi(){hi.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Ii(t){Oi.call(this),this.type="Path",this.currentPoint=new ml,t&&this.setFromPoints(t)}function Di(t){Ii.call(this,t),this.uuid=fl.generateUUID(),this.type="Shape",this.holes=[]}function Ni(t,e){s.call(this),this.type="Light",this.color=new kh(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Bi(t,e,n){Ni.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(s.DefaultUp),this.updateMatrix(),this.groundColor=new kh(e)}function zi(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new ml(512,512),this.map=null,this.mapPass=null,this.matrix=new Kl,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ru,this._frameExtents=new ml(1,1),this._viewportCount=1,this._viewports=[new _l(0,0,1,1)]}function Gi(){zi.call(this,new N(50,1,.5,500))}function Fi(t,e,n,r,i,a){Ni.call(this,t,e),this.type="SpotLight",this.position.copy(s.DefaultUp),this.updateMatrix(),this.target=new s,Object.defineProperty(this,"power",{"get":function(){return this.intensity*Math.PI},"set":function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Gi}function Ui(){zi.call(this,new N(90,1,.5,500)),this._frameExtents=new ml(4,2),this._viewportCount=6,this._viewports=[new _l(2,1,1,1),new _l(0,1,1,1),new _l(3,1,1,1),new _l(1,1,1,1),new _l(3,0,1,1),new _l(1,0,1,1)],this._cubeDirections=[new Tl(1,0,0),new Tl(-1,0,0),new Tl(0,0,1),new Tl(0,0,-1),new Tl(0,1,0),new Tl(0,-1,0)],this._cubeUps=[new Tl(0,1,0),new Tl(0,1,0),new Tl(0,1,0),new Tl(0,1,0),new Tl(0,0,1),new Tl(0,0,-1)]}function Hi(t,e,n,r){Ni.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{"get":function(){return 4*this.intensity*Math.PI},"set":function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Ui}function ki(t,e,n,r,i,a){D.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Vi(){zi.call(this,new ki(-5,5,5,-5,.5,500))}function ji(t,e){Ni.call(this,t,e),this.type="DirectionalLight",this.position.copy(s.DefaultUp),this.updateMatrix(),this.target=new s,this.shadow=new Vi}function Wi(t,e){Ni.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function qi(t,e,n,r){Ni.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Xi(t,e){Ni.call(this,void 0,e),this.type="LightProbe",this.sh=void 0!==t?t:new Wp}function Yi(t){ni.call(this,t),this.textures={}}function Zi(){S.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function Ji(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),d.call(this,t,e,n),this.meshPerAttribute=r||1}function Qi(t){ni.call(this,t)}function Ki(t){ni.call(this,t)}function $i(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ni.call(this,t),this.options={"premultiplyAlpha":"none"}}function ta(){this.type="ShapePath",this.color=new kh,this.subPaths=[],this.currentPath=null}function ea(t){this.type="Font",this.data=t}function na(t,e,n){for(var r=Array.from?Array.from(t):String(t).split(""),i=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,c=0,l=0;l<r.length;l++){var h=r[l];if("\n"===h)s=0,c-=a;else{var u=ra(h,i,s,c,n);s+=u.offsetX,o.push(u.path)}}return o}function ra(t,e,n,r,i){var a=i.glyphs[t]||i.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".");var o,s,c,l,h,u,p,d,f=new ta;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),v=0,g=m.length;v<g;){var y=m[v++];switch(y){case"m":o=m[v++]*e+n,s=m[v++]*e+r,f.moveTo(o,s);break;case"l":o=m[v++]*e+n,s=m[v++]*e+r,f.lineTo(o,s);break;case"q":c=m[v++]*e+n,l=m[v++]*e+r,h=m[v++]*e+n,u=m[v++]*e+r,f.quadraticCurveTo(h,u,c,l);break;case"b":c=m[v++]*e+n,l=m[v++]*e+r,h=m[v++]*e+n,u=m[v++]*e+r,p=m[v++]*e+n,d=m[v++]*e+r,f.bezierCurveTo(h,u,p,d,c,l)}}return{"offsetX":a.ha*e,"path":f}}function ia(t){ni.call(this,t)}function aa(t){ni.call(this,t)}function oa(t,e,n){Xi.call(this,void 0,n);var r=(new kh).set(t),i=(new kh).set(e),a=new Tl(r.r,r.g,r.b),o=new Tl(i.r,i.g,i.b),s=Math.sqrt(Math.PI),c=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(c)}function sa(t,e){Xi.call(this,void 0,e);var n=(new kh).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function ca(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new N,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new N,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={"focus":null,"fov":null,"aspect":null,"near":null,"far":null,"zoom":null,"eyeSep":null}}function la(){s.call(this),this.type="AudioListener",this.context=Kp.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ed}function ha(t){s.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}function ua(t){ha.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function pa(t,e,n){this.binding=t,this.valueSize=n;var r,i,a;switch(e){case"quaternion":r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}function da(t,e,n){var r=n||fa.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function fa(t,e,n){this.path=e,this.parsedPath=n||fa.parseTrackName(e),this.node=fa.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function ma(){this.uuid=fl.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={"objects":{get"total"(){return r._objects.length},get"inUse"(){return this.total-r.nCachedObjects_}},get"bindingsPerObject"(){return r._bindings.length}}}function va(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function ga(t,e,n){Ve.call(this,t,e),this.meshPerAttribute=n||1}function ya(t,e,n,r,i){this.buffer=t,this.type=e,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}function xa(t,e,n,r){this.ray=new Ql(t,e),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new hh,this.params={"Mesh":{},"Line":{"threshold":1},"LOD":{},"Points":{"threshold":1},"Sprite":{}},Object.defineProperties(this.params,{"PointCloud":{"get":function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function ba(t,e){return t.distance-e.distance}function _a(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r)for(var i=t.children,a=0,o=i.length;a<o;a++)_a(i[a],e,n,!0)}function wa(t){s.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}function Ma(t,e){s.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new S,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,c=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(c),Math.sin(c),1)}n.setAttribute("position",new _(r,3));var l=new $e({"fog":!1,"toneMapped":!1});this.cone=new en(n,l),this.add(this.cone),this.update()}function Sa(t){for(var e=Ta(t),n=new S,r=[],i=[],a=new kh(0,0,1),o=new kh(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new _(r,3)),n.setAttribute("color",new _(i,3));var l=new $e({"vertexColors":!0,"depthTest":!1,"depthWrite":!1,"toneMapped":!1,"transparent":!0});en.call(this,n,l),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Ta(t){var e=[];t&&t.isBone&&e.push(t);for(var n=0;n<t.children.length;n++)e.push.apply(e,Ta(t.children[n]));return e}function Ea(t,e,n){var r=new mr(e,4,2),i=new p({"wireframe":!0,"fog":!1,"toneMapped":!1});T.call(this,r,i),this.light=t,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Aa(t,e,n){s.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new xn(e);r.rotateY(.5*Math.PI),this.material=new p({"wireframe":!0,"fog":!1,"toneMapped":!1}),void 0===this.color&&(this.material.vertexColors=!0);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new d(a,3)),this.add(new T(r,this.material)),this.update()}function La(t,e,n,r){t=t||10,e=e||10,n=new kh(void 0!==n?n:4473924),r=new kh(void 0!==r?r:8947848);for(var i=e/2,a=t/e,o=t/2,s=[],c=[],l=0,h=0,u=-o;l<=e;l++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);var p=l===i?n:r;p.toArray(c,h),h+=3,p.toArray(c,h),h+=3,p.toArray(c,h),h+=3,p.toArray(c,h),h+=3}var d=new S;d.setAttribute("position",new _(s,3)),d.setAttribute("color",new _(c,3));var f=new $e({"vertexColors":!0,"toneMapped":!1});en.call(this,d,f),this.type="GridHelper"}function Ra(t,e,n,r,i,a){t=t||10,e=e||16,n=n||8,r=r||64,i=new kh(void 0!==i?i:4473924),a=new kh(void 0!==a?a:8947848);for(var o=[],s=[],c=0;c<=e;c++){var l=c/e*(2*Math.PI),h=Math.sin(l)*t,u=Math.cos(l)*t;o.push(0,0,0),o.push(h,0,u);var p=1&c?i:a;s.push(p.r,p.g,p.b),s.push(p.r,p.g,p.b)}for(var d=0;d<=n;d++)for(var f=1&d?i:a,m=t-t/n*d,v=0;v<r;v++){var g=v/r*(2*Math.PI),y=Math.sin(g)*m,x=Math.cos(g)*m;o.push(y,0,x),s.push(f.r,f.g,f.b),g=(v+1)/r*(2*Math.PI),y=Math.sin(g)*m,x=Math.cos(g)*m,o.push(y,0,x),s.push(f.r,f.g,f.b)}var b=new S;b.setAttribute("position",new _(o,3)),b.setAttribute("color",new _(s,3));var w=new $e({"vertexColors":!0,"toneMapped":!1});en.call(this,b,w),this.type="PolarGridHelper"}function Pa(t,e,n){s.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var r=new S;r.setAttribute("position",new _([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new $e({"fog":!1,"toneMapped":!1});this.lightPlane=new tn(r,i),this.add(this.lightPlane),r=new S,r.setAttribute("position",new _([0,0,0,0,0,1],3)),this.targetLine=new tn(r,i),this.add(this.targetLine),this.update()}function Ca(t){function e(t,e,r){n(t,r),n(e,r)}function n(t,e){a.push(0,0,0),o.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(a.length/3-1)}var r=new S,i=new $e({"color":16777215,"vertexColors":!0,"toneMapped":!1}),a=[],o=[],s={},c=new kh(16755200),l=new kh(16711680),h=new kh(43775),u=new kh(16777215),p=new kh(3355443);e("n1","n2",c),e("n2","n4",c),e("n4","n3",c),e("n3","n1",c),e("f1","f2",c),e("f2","f4",c),e("f4","f3",c),e("f3","f1",c),e("n1","f1",c),e("n2","f2",c),e("n3","f3",c),e("n4","f4",c),e("p","n1",l),e("p","n2",l),e("p","n3",l),e("p","n4",l),e("u1","u2",h),e("u2","u3",h),e("u3","u1",h),e("c","t",u),e("p","c",p),e("cn1","cn2",p),e("cn3","cn4",p),e("cf1","cf2",p),e("cf3","cf4",p),r.setAttribute("position",new _(a,3)),r.setAttribute("color",new _(o,3)),en.call(this,r,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function Oa(t,e,n,r,i,a,o){Ud.set(i,a,o).unproject(r);var s=e[t];if(void 0!==s)for(var c=n.getAttribute("position"),l=0,h=s.length;l<h;l++)c.setXYZ(s[l],Ud.x,Ud.y,Ud.z)}function Ia(t,e){void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new S;i.setIndex(new d(n,1)),i.setAttribute("position",new d(r,3)),en.call(this,i,new $e({"color":e,"toneMapped":!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}function Da(t,e){void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],i=new S;i.setIndex(new d(n,1)),i.setAttribute("position",new _(r,3)),en.call(this,i,new $e({"color":e,"toneMapped":!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}function Na(t,e,n){var r=void 0!==n?n:16776960,i=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],a=new S;a.setAttribute("position",new _(i,3)),a.computeBoundingSphere(),tn.call(this,a,new $e({"color":r,"toneMapped":!1})),this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new S;s.setAttribute("position",new _(o,3)),s.computeBoundingSphere(),this.add(new T(s,new p({"color":r,"opacity":.2,"transparent":!0,"depthWrite":!1,"toneMapped":!1})))}function Ba(t,e,n,r,i,a){s.call(this),this.type="ArrowHelper",void 0===t&&(t=new Tl(0,0,1)),void 0===e&&(e=new Tl(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===Vd&&(Vd=new S,Vd.setAttribute("position",new _([0,0,0,0,1,0],3)),jd=new Tr(0,.5,1,5,1),jd.translate(0,-.5,0)),this.position.copy(e),this.line=new tn(Vd,new $e({"color":r,"toneMapped":!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new T(jd,new p({"color":r,"toneMapped":!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,i,a)}function za(t){void 0===t&&(t=1);var e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new S;r.setAttribute("position",new _(e,3)),r.setAttribute("color",new _(n,3));var i=new $e({"vertexColors":!0,"toneMapped":!1});en.call(this,r,i),this.type="AxesHelper"}function Ga(t){return void 0!==t&&t.type===Ns&&(t.encoding===Yc||t.encoding===Zc||t.encoding===Jc)}function Fa(t){var e=new r(3*Yd,3*Yd,t);return e.texture.mapping=Ss,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Ua(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Ha(t){return new Cr({"name":"SphericalGaussianBlur","defines":{"n":t},"uniforms":{"envMap":{"value":null},"samples":{"value":1},"weights":{"value":new Float32Array(t)},"latitudinal":{"value":!1},"dTheta":{"value":0},"mipInt":{"value":0},"poleAxis":{"value":new Tl(0,1,0)},"inputEncoding":{"value":Qd[Yc]},"outputEncoding":{"value":Qd[Yc]}},"vertexShader":"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t","fragmentShader":"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t","blending":No,"depthTest":!1,"depthWrite":!1})}function ka(){return new Cr({"name":"EquirectangularToCubeUV","uniforms":{"envMap":{"value":null},"texelSize":{"value":new ml(1,1)},"inputEncoding":{"value":Qd[Yc]},"outputEncoding":{"value":Qd[Yc]}},"vertexShader":"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t","fragmentShader":"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t","blending":No,"depthTest":!1,"depthWrite":!1})}function Va(){return new Cr({"name":"CubemapToCubeUV","uniforms":{"envMap":{"value":null},"inputEncoding":{"value":Qd[Yc]},"outputEncoding":{"value":Qd[Yc]}},
"vertexShader":"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t","fragmentShader":"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t","blending":No,"depthTest":!1,"depthWrite":!1})}function ja(t,e,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Vh(t,e,n,i,a,o)}function Wa(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function qa(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function Xa(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new an(t,e)}function Ya(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new qe(t)}function Za(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new an(t,e)}function Ja(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new rn(t)}function Qa(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new rn(t)}function Ka(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new rn(t)}function $a(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Tl(t,e,n)}function to(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new d(t,e).setUsage(ll)}function eo(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new f(t,e)}function no(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new m(t,e)}function ro(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new v(t,e)}function io(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new g(t,e)}function ao(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new y(t,e)}function oo(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new x(t,e)}function so(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new b(t,e)}function co(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new _(t,e)}function lo(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new w(t,e)}function ho(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),fi.call(this,t),this.type="catmullrom",this.closed=!0}function uo(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),fi.call(this,t),this.type="catmullrom"}function po(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),fi.call(this,t),this.type="catmullrom"}function fo(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new za(t)}function mo(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Ia(t,e)}function vo(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new en(new Mr(t.geometry),new $e({"color":void 0!==e?e:16777215}))}function go(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new en(new un(t.geometry),new $e({"color":void 0!==e?e:16777215}))}function yo(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new ri(t)}function xo(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ci(t)}function bo(t,e,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new z(t,n)}function _o(){console.error("THREE.CanvasRenderer has been removed")}function wo(){console.error("THREE.JSONLoader has been removed.")}function Mo(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{"get":function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e});var So={"LEFT":0,"MIDDLE":1,"RIGHT":2,"ROTATE":0,"DOLLY":1,"PAN":2},To={"ROTATE":0,"PAN":1,"DOLLY_PAN":2,"DOLLY_ROTATE":3},Eo=0,Ao=1,Lo=2,Ro=1,Po=2,Co=3,Oo=0,Io=1,Do=2,No=0,Bo=1,zo=2,Go=3,Fo=4,Uo=5,Ho=100,ko=101,Vo=102,jo=103,Wo=104,qo=200,Xo=201,Yo=202,Zo=203,Jo=204,Qo=205,Ko=206,$o=207,ts=208,es=209,ns=210,rs=0,is=1,as=2,os=3,ss=4,cs=5,ls=6,hs=7,us=0,ps=1,ds=2,fs=0,ms=1,vs=2,gs=3,ys=4,xs=5,bs=301,_s=302,ws=303,Ms=304,Ss=306,Ts=307,Es=1e3,As=1001,Ls=1002,Rs=1003,Ps=1004,Cs=1005,Os=1006,Is=1007,Ds=1008,Ns=1009,Bs=1010,zs=1011,Gs=1012,Fs=1013,Us=1014,Hs=1015,ks=1016,Vs=1017,js=1018,Ws=1019,qs=1020,Xs=1021,Ys=1022,Zs=1023,Js=1024,Qs=1025,Ks=Zs,$s=1026,tc=1027,ec=1028,nc=1029,rc=1030,ic=1031,ac=1032,oc=1033,sc=33776,cc=33777,lc=33778,hc=33779,uc=35840,pc=35841,dc=35842,fc=35843,mc=36196,vc=37492,gc=37496,yc=37808,xc=37809,bc=37810,_c=37811,wc=37812,Mc=37813,Sc=37814,Tc=37815,Ec=37816,Ac=37817,Lc=37818,Rc=37819,Pc=37820,Cc=37821,Oc=36492,Ic=37840,Dc=37841,Nc=37842,Bc=37843,zc=37844,Gc=37845,Fc=37846,Uc=37847,Hc=37848,kc=37849,Vc=37850,jc=37851,Wc=37852,qc=37853,Xc=2500,Yc=3e3,Zc=3001,Jc=3007,Qc=3002,Kc=3003,$c=3004,tl=3005,el=3006,nl=3200,rl=3201,il=0,al=1,ol=7680,sl=519,cl=35044,ll=35048,hl="300 es";Object.assign(e.prototype,{"addEventListener":function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},"hasEventListener":function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},"removeEventListener":function(t,e){if(void 0!==this._listeners){var n=this._listeners,r=n[t];if(void 0!==r){var i=r.indexOf(e);-1!==i&&r.splice(i,1)}}},"dispatchEvent":function(t){if(void 0!==this._listeners){var e=this._listeners,n=e[t.type];if(void 0!==n){t.target=this;for(var r=n.slice(0),i=0,a=r.length;i<a;i++)r[i].call(this,t)}}}});for(var ul=[],pl=0;pl<256;pl++)ul[pl]=(pl<16?"0":"")+pl.toString(16);var dl=1234567,fl={"DEG2RAD":Math.PI/180,"RAD2DEG":180/Math.PI,"generateUUID":function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(ul[255&t]+ul[t>>8&255]+ul[t>>16&255]+ul[t>>24&255]+"-"+ul[255&e]+ul[e>>8&255]+"-"+ul[e>>16&15|64]+ul[e>>24&255]+"-"+ul[63&n|128]+ul[n>>8&255]+"-"+ul[n>>16&255]+ul[n>>24&255]+ul[255&r]+ul[r>>8&255]+ul[r>>16&255]+ul[r>>24&255]).toUpperCase()},"clamp":function(t,e,n){return Math.max(e,Math.min(n,t))},"euclideanModulo":function(t,e){return(t%e+e)%e},"mapLinear":function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},"lerp":function(t,e,n){return(1-n)*t+n*e},"smoothstep":function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},"smootherstep":function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},"randInt":function(t,e){return t+Math.floor(Math.random()*(e-t+1))},"randFloat":function(t,e){return t+Math.random()*(e-t)},"randFloatSpread":function(t){return t*(.5-Math.random())},"seededRandom":function(t){return void 0!==t&&(dl=t%2147483647),((dl=16807*dl%2147483647)-1)/2147483646},"degToRad":function(t){return t*fl.DEG2RAD},"radToDeg":function(t){return t*fl.RAD2DEG},"isPowerOfTwo":function(t){return 0==(t&t-1)&&0!==t},"ceilPowerOfTwo":function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},"floorPowerOfTwo":function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},"setQuaternionFromProperEuler":function(t,e,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((e+r)/2),h=o((e+r)/2),u=a((e-r)/2),p=o((e-r)/2),d=a((r-e)/2),f=o((r-e)/2);switch(i){case"XYX":t.set(s*h,c*u,c*p,s*l);break;case"YZY":t.set(c*p,s*h,c*u,s*l);break;case"ZXZ":t.set(c*u,c*p,s*h,s*l);break;case"XZX":t.set(s*h,c*f,c*d,s*l);break;case"YXY":t.set(c*d,s*h,c*f,s*l);break;case"ZYZ":t.set(c*f,c*d,s*h,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}},ml=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),Object.defineProperty(this,"isVector2",{"value":!0}),this.x=t,this.y=e},vl={"width":{"configurable":!0},"height":{"configurable":!0}};vl.width.get=function(){return this.x},vl.width.set=function(t){this.x=t},vl.height.get=function(){return this.y},vl.height.set=function(t){this.y=t},ml.prototype.set=function(t,e){return this.x=t,this.y=e,this},ml.prototype.setScalar=function(t){return this.x=t,this.y=t,this},ml.prototype.setX=function(t){return this.x=t,this},ml.prototype.setY=function(t){return this.y=t,this},ml.prototype.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},ml.prototype.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},ml.prototype.clone=function(){return new this.constructor(this.x,this.y)},ml.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},ml.prototype.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},ml.prototype.addScalar=function(t){return this.x+=t,this.y+=t,this},ml.prototype.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},ml.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},ml.prototype.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},ml.prototype.subScalar=function(t){return this.x-=t,this.y-=t,this},ml.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},ml.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},ml.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this},ml.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},ml.prototype.divideScalar=function(t){return this.multiplyScalar(1/t)},ml.prototype.applyMatrix3=function(t){var e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this},ml.prototype.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},ml.prototype.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},ml.prototype.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},ml.prototype.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},ml.prototype.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},ml.prototype.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ml.prototype.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},ml.prototype.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},ml.prototype.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},ml.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},ml.prototype.dot=function(t){return this.x*t.x+this.y*t.y},ml.prototype.cross=function(t){return this.x*t.y-this.y*t.x},ml.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y},ml.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},ml.prototype.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)},ml.prototype.normalize=function(){return this.divideScalar(this.length()||1)},ml.prototype.angle=function(){return Math.atan2(-this.y,-this.x)+Math.PI},ml.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},ml.prototype.distanceToSquared=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},ml.prototype.manhattanDistanceTo=function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},ml.prototype.setLength=function(t){return this.normalize().multiplyScalar(t)},ml.prototype.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},ml.prototype.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this},ml.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},ml.prototype.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},ml.prototype.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},ml.prototype.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},ml.prototype.rotateAround=function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*n-a*r+t.x,this.y=i*r+a*n+t.y,this},ml.prototype.random=function(){return this.x=Math.random(),this.y=Math.random(),this},Object.defineProperties(ml.prototype,vl);var gl=function(){Object.defineProperty(this,"isMatrix3",{"value":!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")};gl.prototype.set=function(t,e,n,r,i,a,o,s,c){var l=this.elements;return l[0]=t,l[1]=r,l[2]=o,l[3]=e,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this},gl.prototype.identity=function(){return this.set(1,0,0,0,1,0,0,0,1),this},gl.prototype.clone=function(){return(new this.constructor).fromArray(this.elements)},gl.prototype.copy=function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},gl.prototype.extractBasis=function(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},gl.prototype.setFromMatrix4=function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},gl.prototype.multiply=function(t){return this.multiplyMatrices(this,t)},gl.prototype.premultiply=function(t){return this.multiplyMatrices(t,this)},gl.prototype.multiplyMatrices=function(t,e){var n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],h=n[7],u=n[2],p=n[5],d=n[8],f=r[0],m=r[3],v=r[6],g=r[1],y=r[4],x=r[7],b=r[2],_=r[5],w=r[8];return i[0]=a*f+o*g+s*b,i[3]=a*m+o*y+s*_,i[6]=a*v+o*x+s*w,i[1]=c*f+l*g+h*b,i[4]=c*m+l*y+h*_,i[7]=c*v+l*x+h*w,i[2]=u*f+p*g+d*b,i[5]=u*m+p*y+d*_,i[8]=u*v+p*x+d*w,this},gl.prototype.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},gl.prototype.determinant=function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8];return e*a*l-e*o*c-n*i*l+n*o*s+r*i*c-r*a*s},gl.prototype.getInverse=function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=t.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],h=n[6],u=n[7],p=n[8],d=p*c-l*u,f=l*h-p*s,m=u*s-c*h,v=i*d+a*f+o*m;if(0===v)return this.set(0,0,0,0,0,0,0,0,0);var g=1/v;return r[0]=d*g,r[1]=(o*u-p*a)*g,r[2]=(l*a-o*c)*g,r[3]=f*g,r[4]=(p*i-o*h)*g,r[5]=(o*s-l*i)*g,r[6]=m*g,r[7]=(a*h-u*i)*g,r[8]=(c*i-a*s)*g,this},gl.prototype.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},gl.prototype.getNormalMatrix=function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},gl.prototype.transposeIntoArray=function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},gl.prototype.setUvTransform=function(t,e,n,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+t,-r*c,r*s,-r*(-c*a+s*o)+o+e,0,0,1)},gl.prototype.scale=function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},gl.prototype.rotate=function(t){var e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],l=r[7];return r[0]=e*i+n*s,r[3]=e*a+n*c,r[6]=e*o+n*l,r[1]=-n*i+e*s,r[4]=-n*a+e*c,r[7]=-n*o+e*l,this},gl.prototype.translate=function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},gl.prototype.equals=function(t){for(var e=this.elements,n=t.elements,r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0},gl.prototype.fromArray=function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},gl.prototype.toArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t};var yl,xl={"getDataURL":function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;var e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===yl&&(yl=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),yl.width=t.width,yl.height=t.height;var n=yl.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=yl}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},bl=0;n.DEFAULT_IMAGE=void 0,n.DEFAULT_MAPPING=300,n.prototype=Object.assign(Object.create(e.prototype),{"constructor":n,"isTexture":!0,"updateMatrix":function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},"clone":function(){return(new this.constructor).copy(this)},"copy":function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},"toJSON":function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={"metadata":{"version":4.5,"type":"Texture","generator":"Texture.toJSON"},"uuid":this.uuid,"name":this.name,"mapping":this.mapping,"repeat":[this.repeat.x,this.repeat.y],"offset":[this.offset.x,this.offset.y],"center":[this.center.x,this.center.y],"rotation":this.rotation,"wrap":[this.wrapS,this.wrapT],"format":this.format,"type":this.type,"encoding":this.encoding,"minFilter":this.minFilter,"magFilter":this.magFilter,"anisotropy":this.anisotropy,"flipY":this.flipY,"premultiplyAlpha":this.premultiplyAlpha,"unpackAlignment":this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=fl.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(xl.getDataURL(r[a]))}else i=xl.getDataURL(r);t.images[r.uuid]={"uuid":r.uuid,"url":i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},"dispose":function(){this.dispatchEvent({"type":"dispose"})},"transformUv":function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Es:t.x=t.x-Math.floor(t.x);break;case As:t.x=t.x<0?0:1;break;case Ls:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case Es:t.y=t.y-Math.floor(t.y);break;case As:t.y=t.y<0?0:1;break;case Ls:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(n.prototype,"needsUpdate",{"set":function(t){!0===t&&this.version++}});var _l=function(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),Object.defineProperty(this,"isVector4",{"value":!0}),this.x=t,this.y=e,this.z=n,this.w=r},wl={"width":{"configurable":!0},"height":{"configurable":!0}};wl.width.get=function(){return this.z},wl.width.set=function(t){this.z=t},wl.height.get=function(){return this.w},wl.height.set=function(t){this.w=t},_l.prototype.set=function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this},_l.prototype.setScalar=function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},_l.prototype.setX=function(t){return this.x=t,this},_l.prototype.setY=function(t){return this.y=t,this},_l.prototype.setZ=function(t){return this.z=t,this},_l.prototype.setW=function(t){return this.w=t,this},_l.prototype.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},_l.prototype.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},_l.prototype.clone=function(){return new this.constructor(this.x,this.y,this.z,this.w)},_l.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},_l.prototype.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},_l.prototype.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},_l.prototype.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},_l.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},_l.prototype.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},_l.prototype.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},_l.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},_l.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},_l.prototype.applyMatrix4=function(t){var e=this.x,n=this.y,r=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*i,this},_l.prototype.divideScalar=function(t){return this.multiplyScalar(1/t)},_l.prototype.setAxisAngleFromQuaternion=function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},_l.prototype.setAxisAngleFromRotationMatrix=function(t){var e,n,r,i,a=t.elements,o=a[0],s=a[4],c=a[8],l=a[1],h=a[5],u=a[9],p=a[2],d=a[6],f=a[10];if(Math.abs(s-l)<.01&&Math.abs(c-p)<.01&&Math.abs(u-d)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+p)<.1&&Math.abs(u+d)<.1&&Math.abs(o+h+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(o+1)/2,v=(h+1)/2,g=(f+1)/2,y=(s+l)/4,x=(c+p)/4,b=(u+d)/4;return m>v&&m>g?m<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(m),r=y/n,i=x/n):v>g?v<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(v),n=y/r,i=b/r):g<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(g),n=x/i,r=b/i),this.set(n,r,i,e),this}var _=Math.sqrt((d-u)*(d-u)+(c-p)*(c-p)+(l-s)*(l-s));return Math.abs(_)<.001&&(_=1),this.x=(d-u)/_,this.y=(c-p)/_,this.z=(l-s)/_,this.w=Math.acos((o+h+f-1)/2),this},_l.prototype.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},_l.prototype.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},_l.prototype.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},_l.prototype.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},_l.prototype.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},_l.prototype.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},_l.prototype.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},_l.prototype.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},_l.prototype.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},_l.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},_l.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},_l.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},_l.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},_l.prototype.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},_l.prototype.normalize=function(){return this.divideScalar(this.length()||1)},_l.prototype.setLength=function(t){return this.normalize().multiplyScalar(t)},_l.prototype.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},_l.prototype.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this},_l.prototype.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},_l.prototype.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},_l.prototype.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},_l.prototype.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this},_l.prototype.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this},Object.defineProperties(_l.prototype,wl),r.prototype=Object.assign(Object.create(e.prototype),{"constructor":r,"isWebGLRenderTarget":!0,"setSize":function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},"clone":function(){return(new this.constructor).copy(this)},"copy":function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},"dispose":function(){this.dispatchEvent({"type":"dispose"})}}),i.prototype=Object.assign(Object.create(r.prototype),{"constructor":i,"isWebGLMultisampleRenderTarget":!0,"copy":function(t){return r.prototype.copy.call(this,t),this.samples=t.samples,this}})
;var Ml=function(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),Object.defineProperty(this,"isQuaternion",{"value":!0}),this._x=t,this._y=e,this._z=n,this._w=r},Sl={"x":{"configurable":!0},"y":{"configurable":!0},"z":{"configurable":!0},"w":{"configurable":!0}};Ml.slerp=function(t,e,n,r){return n.copy(t).slerp(e,r)},Ml.slerpFlat=function(t,e,n,r,i,a,o){var s=n[r+0],c=n[r+1],l=n[r+2],h=n[r+3],u=i[a+0],p=i[a+1],d=i[a+2],f=i[a+3];if(h!==f||s!==u||c!==p||l!==d){var m=1-o,v=s*u+c*p+l*d+h*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,v*g);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var _=o*g;if(s=s*m+u*_,c=c*m+p*_,l=l*m+d*_,h=h*m+f*_,m===1-o){var w=1/Math.sqrt(s*s+c*c+l*l+h*h);s*=w,c*=w,l*=w,h*=w}}t[e]=s,t[e+1]=c,t[e+2]=l,t[e+3]=h},Ml.multiplyQuaternionsFlat=function(t,e,n,r,i,a){var o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],h=i[a],u=i[a+1],p=i[a+2],d=i[a+3];return t[e]=o*d+l*h+s*p-c*u,t[e+1]=s*d+l*u+c*h-o*p,t[e+2]=c*d+l*p+o*u-s*h,t[e+3]=l*d-o*h-s*u-c*p,t},Sl.x.get=function(){return this._x},Sl.x.set=function(t){this._x=t,this._onChangeCallback()},Sl.y.get=function(){return this._y},Sl.y.set=function(t){this._y=t,this._onChangeCallback()},Sl.z.get=function(){return this._z},Sl.z.set=function(t){this._z=t,this._onChangeCallback()},Sl.w.get=function(){return this._w},Sl.w.set=function(t){this._w=t,this._onChangeCallback()},Ml.prototype.set=function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this},Ml.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},Ml.prototype.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},Ml.prototype.setFromEuler=function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,a=t._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),h=o(i/2),u=s(n/2),p=s(r/2),d=s(i/2);switch(a){case"XYZ":this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d;break;case"YXZ":this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d;break;case"ZXY":this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d;break;case"ZYX":this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d;break;case"YZX":this._x=u*l*h+c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h-u*p*d;break;case"XZY":this._x=u*l*h-c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h+u*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==e&&this._onChangeCallback(),this},Ml.prototype.setFromAxisAngle=function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},Ml.prototype.setFromRotationMatrix=function(t){var e=t.elements,n=e[0],r=e[4],i=e[8],a=e[1],o=e[5],s=e[9],c=e[2],l=e[6],h=e[10],u=n+o+h;if(u>0){var p=.5/Math.sqrt(u+1);this._w=.25/p,this._x=(l-s)*p,this._y=(i-c)*p,this._z=(a-r)*p}else if(n>o&&n>h){var d=2*Math.sqrt(1+n-o-h);this._w=(l-s)/d,this._x=.25*d,this._y=(r+a)/d,this._z=(i+c)/d}else if(o>h){var f=2*Math.sqrt(1+o-n-h);this._w=(i-c)/f,this._x=(r+a)/f,this._y=.25*f,this._z=(s+l)/f}else{var m=2*Math.sqrt(1+h-n-o);this._w=(a-r)/m,this._x=(i+c)/m,this._y=(s+l)/m,this._z=.25*m}return this._onChangeCallback(),this},Ml.prototype.setFromUnitVectors=function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},Ml.prototype.angleTo=function(t){return 2*Math.acos(Math.abs(fl.clamp(this.dot(t),-1,1)))},Ml.prototype.rotateTowards=function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},Ml.prototype.identity=function(){return this.set(0,0,0,1)},Ml.prototype.inverse=function(){return this.conjugate()},Ml.prototype.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},Ml.prototype.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},Ml.prototype.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},Ml.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},Ml.prototype.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},Ml.prototype.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},Ml.prototype.premultiply=function(t){return this.multiplyQuaternions(t,this)},Ml.prototype.multiplyQuaternions=function(t,e){var n=t._x,r=t._y,i=t._z,a=t._w,o=e._x,s=e._y,c=e._z,l=e._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this},Ml.prototype.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*t._w+n*t._x+r*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-e;return this._w=c*a+e*this._w,this._x=c*n+e*this._x,this._y=c*r+e*this._y,this._z=c*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),h=Math.atan2(l,o),u=Math.sin((1-e)*h)/l,p=Math.sin(e*h)/l;return this._w=a*u+this._w*p,this._x=n*u+this._x*p,this._y=r*u+this._y*p,this._z=i*u+this._z*p,this._onChangeCallback(),this},Ml.prototype.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},Ml.prototype.fromArray=function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},Ml.prototype.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},Ml.prototype.fromBufferAttribute=function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},Ml.prototype._onChange=function(t){return this._onChangeCallback=t,this},Ml.prototype._onChangeCallback=function(){},Object.defineProperties(Ml.prototype,Sl);var Tl=function(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),Object.defineProperty(this,"isVector3",{"value":!0}),this.x=t,this.y=e,this.z=n};Tl.prototype.set=function(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this},Tl.prototype.setScalar=function(t){return this.x=t,this.y=t,this.z=t,this},Tl.prototype.setX=function(t){return this.x=t,this},Tl.prototype.setY=function(t){return this.y=t,this},Tl.prototype.setZ=function(t){return this.z=t,this},Tl.prototype.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},Tl.prototype.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},Tl.prototype.clone=function(){return new this.constructor(this.x,this.y,this.z)},Tl.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},Tl.prototype.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},Tl.prototype.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},Tl.prototype.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},Tl.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},Tl.prototype.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},Tl.prototype.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},Tl.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},Tl.prototype.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},Tl.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},Tl.prototype.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},Tl.prototype.applyEuler=function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Al.setFromEuler(t))},Tl.prototype.applyAxisAngle=function(t,e){return this.applyQuaternion(Al.setFromAxisAngle(t,e))},Tl.prototype.applyMatrix3=function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},Tl.prototype.applyNormalMatrix=function(t){return this.applyMatrix3(t).normalize()},Tl.prototype.applyMatrix4=function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,a=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*a,this},Tl.prototype.applyQuaternion=function(t){var e=this.x,n=this.y,r=this.z,i=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*r-o*n,l=s*n+o*e-i*r,h=s*r+i*n-a*e,u=-i*e-a*n-o*r;return this.x=c*s+u*-i+l*-o-h*-a,this.y=l*s+u*-a+h*-i-c*-o,this.z=h*s+u*-o+c*-a-l*-i,this},Tl.prototype.project=function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},Tl.prototype.unproject=function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},Tl.prototype.transformDirection=function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()},Tl.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},Tl.prototype.divideScalar=function(t){return this.multiplyScalar(1/t)},Tl.prototype.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},Tl.prototype.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},Tl.prototype.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},Tl.prototype.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},Tl.prototype.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},Tl.prototype.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},Tl.prototype.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},Tl.prototype.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},Tl.prototype.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},Tl.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},Tl.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},Tl.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},Tl.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},Tl.prototype.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},Tl.prototype.normalize=function(){return this.divideScalar(this.length()||1)},Tl.prototype.setLength=function(t){return this.normalize().multiplyScalar(t)},Tl.prototype.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},Tl.prototype.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this},Tl.prototype.cross=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},Tl.prototype.crossVectors=function(t,e){var n=t.x,r=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},Tl.prototype.projectOnVector=function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},Tl.prototype.projectOnPlane=function(t){return El.copy(this).projectOnVector(t),this.sub(El)},Tl.prototype.reflect=function(t){return this.sub(El.copy(t).multiplyScalar(2*this.dot(t)))},Tl.prototype.angleTo=function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(fl.clamp(n,-1,1))},Tl.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},Tl.prototype.distanceToSquared=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},Tl.prototype.manhattanDistanceTo=function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},Tl.prototype.setFromSpherical=function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},Tl.prototype.setFromSphericalCoords=function(t,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this},Tl.prototype.setFromCylindrical=function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},Tl.prototype.setFromCylindricalCoords=function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},Tl.prototype.setFromMatrixPosition=function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},Tl.prototype.setFromMatrixScale=function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},Tl.prototype.setFromMatrixColumn=function(t,e){return this.fromArray(t.elements,4*e)},Tl.prototype.setFromMatrix3Column=function(t,e){return this.fromArray(t.elements,3*e)},Tl.prototype.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},Tl.prototype.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},Tl.prototype.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},Tl.prototype.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},Tl.prototype.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this};var El=new Tl,Al=new Ml,Ll=function(t,e){Object.defineProperty(this,"isBox3",{"value":!0}),this.min=void 0!==t?t:new Tl(1/0,1/0,1/0),this.max=void 0!==e?e:new Tl(-1/0,-1/0,-1/0)};Ll.prototype.set=function(t,e){return this.min.copy(t),this.max.copy(e),this},Ll.prototype.setFromArray=function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=t.length;s<c;s+=3){var l=t[s],h=t[s+1],u=t[s+2];l<e&&(e=l),h<n&&(n=h),u<r&&(r=u),l>i&&(i=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(e,n,r),this.max.set(i,a,o),this},Ll.prototype.setFromBufferAttribute=function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=t.count;s<c;s++){var l=t.getX(s),h=t.getY(s),u=t.getZ(s);l<e&&(e=l),h<n&&(n=h),u<r&&(r=u),l>i&&(i=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(e,n,r),this.max.set(i,a,o),this},Ll.prototype.setFromPoints=function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},Ll.prototype.setFromCenterAndSize=function(t,e){var n=Pl.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},Ll.prototype.setFromObject=function(t){return this.makeEmpty(),this.expandByObject(t)},Ll.prototype.clone=function(){return(new this.constructor).copy(this)},Ll.prototype.copy=function(t){return this.min.copy(t.min),this.max.copy(t.max),this},Ll.prototype.makeEmpty=function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},Ll.prototype.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},Ll.prototype.getCenter=function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new Tl),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},Ll.prototype.getSize=function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new Tl),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},Ll.prototype.expandByPoint=function(t){return this.min.min(t),this.max.max(t),this},Ll.prototype.expandByVector=function(t){return this.min.sub(t),this.max.add(t),this},Ll.prototype.expandByScalar=function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},Ll.prototype.expandByObject=function(t){t.updateWorldMatrix(!1,!1);var e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),Cl.copy(e.boundingBox),Cl.applyMatrix4(t.matrixWorld),this.union(Cl));for(var n=t.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this},Ll.prototype.containsPoint=function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},Ll.prototype.containsBox=function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},Ll.prototype.getParameter=function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Tl),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},Ll.prototype.intersectsBox=function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},Ll.prototype.intersectsSphere=function(t){return this.clampPoint(t.center,Pl),Pl.distanceToSquared(t.center)<=t.radius*t.radius},Ll.prototype.intersectsPlane=function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},Ll.prototype.intersectsTriangle=function(t){if(this.isEmpty())return!1;this.getCenter(Gl),Fl.subVectors(this.max,Gl),Ol.subVectors(t.a,Gl),Il.subVectors(t.b,Gl),Dl.subVectors(t.c,Gl),Nl.subVectors(Il,Ol),Bl.subVectors(Dl,Il),zl.subVectors(Ol,Dl);var e=[0,-Nl.z,Nl.y,0,-Bl.z,Bl.y,0,-zl.z,zl.y,Nl.z,0,-Nl.x,Bl.z,0,-Bl.x,zl.z,0,-zl.x,-Nl.y,Nl.x,0,-Bl.y,Bl.x,0,-zl.y,zl.x,0];return!!a(e,Ol,Il,Dl,Fl)&&(e=[1,0,0,0,1,0,0,0,1],!!a(e,Ol,Il,Dl,Fl)&&(Ul.crossVectors(Nl,Bl),e=[Ul.x,Ul.y,Ul.z],a(e,Ol,Il,Dl,Fl)))},Ll.prototype.clampPoint=function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Tl),e.copy(t).clamp(this.min,this.max)},Ll.prototype.distanceToPoint=function(t){return Pl.copy(t).clamp(this.min,this.max).sub(t).length()},Ll.prototype.getBoundingSphere=function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(Pl).length(),t},Ll.prototype.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},Ll.prototype.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},Ll.prototype.applyMatrix4=function(t){return this.isEmpty()?this:(Rl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Rl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Rl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Rl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Rl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Rl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Rl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Rl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Rl),this)},Ll.prototype.translate=function(t){return this.min.add(t),this.max.add(t),this},Ll.prototype.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)};var Rl=[new Tl,new Tl,new Tl,new Tl,new Tl,new Tl,new Tl,new Tl],Pl=new Tl,Cl=new Ll,Ol=new Tl,Il=new Tl,Dl=new Tl,Nl=new Tl,Bl=new Tl,zl=new Tl,Gl=new Tl,Fl=new Tl,Ul=new Tl,Hl=new Tl,kl=new Ll,Vl=function(t,e){this.center=void 0!==t?t:new Tl,this.radius=void 0!==e?e:-1};Vl.prototype.set=function(t,e){return this.center.copy(t),this.radius=e,this},Vl.prototype.setFromPoints=function(t,e){var n=this.center;void 0!==e?n.copy(e):kl.setFromPoints(t).getCenter(n);for(var r=0,i=0,a=t.length;i<a;i++)r=Math.max(r,n.distanceToSquared(t[i]));return this.radius=Math.sqrt(r),this},Vl.prototype.clone=function(){return(new this.constructor).copy(this)},Vl.prototype.copy=function(t){return this.center.copy(t.center),this.radius=t.radius,this},Vl.prototype.isEmpty=function(){return this.radius<0},Vl.prototype.makeEmpty=function(){return this.center.set(0,0,0),this.radius=-1,this},Vl.prototype.containsPoint=function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},Vl.prototype.distanceToPoint=function(t){return t.distanceTo(this.center)-this.radius},Vl.prototype.intersectsSphere=function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},Vl.prototype.intersectsBox=function(t){return t.intersectsSphere(this)},Vl.prototype.intersectsPlane=function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},Vl.prototype.clampPoint=function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new Tl),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},Vl.prototype.getBoundingBox=function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Ll),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},Vl.prototype.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},Vl.prototype.translate=function(t){return this.center.add(t),this},Vl.prototype.equals=function(t){return t.center.equals(this.center)&&t.radius===this.radius};var jl=new Tl,Wl=new Tl,ql=new Tl,Xl=new Tl,Yl=new Tl,Zl=new Tl,Jl=new Tl,Ql=function(t,e){this.origin=void 0!==t?t:new Tl,this.direction=void 0!==e?e:new Tl(0,0,-1)};Ql.prototype.set=function(t,e){return this.origin.copy(t),this.direction.copy(e),this},Ql.prototype.clone=function(){return(new this.constructor).copy(this)},Ql.prototype.copy=function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},Ql.prototype.at=function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Tl),e.copy(this.direction).multiplyScalar(t).add(this.origin)},Ql.prototype.lookAt=function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},Ql.prototype.recast=function(t){return this.origin.copy(this.at(t,jl)),this},Ql.prototype.closestPointToPoint=function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Tl),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},Ql.prototype.distanceToPoint=function(t){return Math.sqrt(this.distanceSqToPoint(t))},Ql.prototype.distanceSqToPoint=function(t){var e=jl.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(jl.copy(this.direction).multiplyScalar(e).add(this.origin),jl.distanceToSquared(t))},Ql.prototype.distanceSqToSegment=function(t,e,n,r){Wl.copy(t).add(e).multiplyScalar(.5),ql.copy(e).sub(t).normalize(),Xl.copy(this.origin).sub(Wl);var i,a,o,s,c=.5*t.distanceTo(e),l=-this.direction.dot(ql),h=Xl.dot(this.direction),u=-Xl.dot(ql),p=Xl.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(i=l*u-h,a=l*h-u,s=c*d,i>=0)if(a>=-s)if(a<=s){var f=1/d;i*=f,a*=f,o=i*(i+l*a+2*h)+a*(l*i+a+2*u)+p}else a=c,i=Math.max(0,-(l*a+h)),o=-i*i+a*(a+2*u)+p;else a=-c,i=Math.max(0,-(l*a+h)),o=-i*i+a*(a+2*u)+p;else a<=-s?(i=Math.max(0,-(-l*c+h)),a=i>0?-c:Math.min(Math.max(-c,-u),c),o=-i*i+a*(a+2*u)+p):a<=s?(i=0,a=Math.min(Math.max(-c,-u),c),o=a*(a+2*u)+p):(i=Math.max(0,-(l*c+h)),a=i>0?c:Math.min(Math.max(-c,-u),c),o=-i*i+a*(a+2*u)+p);else a=l>0?-c:c,i=Math.max(0,-(l*a+h)),o=-i*i+a*(a+2*u)+p;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(ql).multiplyScalar(a).add(Wl),o},Ql.prototype.intersectSphere=function(t,e){jl.subVectors(t.center,this.origin);var n=jl.dot(this.direction),r=jl.dot(jl)-n*n,i=t.radius*t.radius;if(r>i)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)},Ql.prototype.intersectsSphere=function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},Ql.prototype.distanceToPlane=function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},Ql.prototype.intersectPlane=function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},Ql.prototype.intersectsPlane=function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},Ql.prototype.intersectBox=function(t,e){var n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(n=(t.min.x-u.x)*c,r=(t.max.x-u.x)*c):(n=(t.max.x-u.x)*c,r=(t.min.x-u.x)*c),l>=0?(i=(t.min.y-u.y)*l,a=(t.max.y-u.y)*l):(i=(t.max.y-u.y)*l,a=(t.min.y-u.y)*l),n>a||i>r?null:((i>n||n!==n)&&(n=i),(a<r||r!==r)&&(r=a),h>=0?(o=(t.min.z-u.z)*h,s=(t.max.z-u.z)*h):(o=(t.max.z-u.z)*h,s=(t.min.z-u.z)*h),n>s||o>r?null:((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))},Ql.prototype.intersectsBox=function(t){return null!==this.intersectBox(t,jl)},Ql.prototype.intersectTriangle=function(t,e,n,r,i){Yl.subVectors(e,t),Zl.subVectors(n,t),Jl.crossVectors(Yl,Zl);var a,o=this.direction.dot(Jl);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Xl.subVectors(this.origin,t);var s=a*this.direction.dot(Zl.crossVectors(Xl,Zl));if(s<0)return null;var c=a*this.direction.dot(Yl.cross(Xl));if(c<0)return null;if(s+c>o)return null;var l=-a*Xl.dot(Jl);return l<0?null:this.at(l/o,i)},Ql.prototype.applyMatrix4=function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},Ql.prototype.equals=function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)};var Kl=function(){Object.defineProperty(this,"isMatrix4",{"value":!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};Kl.prototype.set=function(t,e,n,r,i,a,o,s,c,l,h,u,p,d,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=r,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=c,v[6]=l,v[10]=h,v[14]=u,v[3]=p,v[7]=d,v[11]=f,v[15]=m,this},Kl.prototype.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},Kl.prototype.clone=function(){return(new Kl).fromArray(this.elements)},Kl.prototype.copy=function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},Kl.prototype.copyPosition=function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},Kl.prototype.extractBasis=function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},Kl.prototype.makeBasis=function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},Kl.prototype.extractRotation=function(t){var e=this.elements,n=t.elements,r=1/$l.setFromMatrixColumn(t,0).length(),i=1/$l.setFromMatrixColumn(t,1).length(),a=1/$l.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},Kl.prototype.makeRotationFromEuler=function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),h=Math.sin(i);if("XYZ"===t.order){var u=a*l,p=a*h,d=o*l,f=o*h;e[0]=s*l,e[4]=-s*h,e[8]=c,e[1]=p+d*c,e[5]=u-f*c,e[9]=-o*s,e[2]=f-u*c,e[6]=d+p*c,e[10]=a*s}else if("YXZ"===t.order){var m=s*l,v=s*h,g=c*l,y=c*h;e[0]=m+y*o,e[4]=g*o-v,e[8]=a*c,e[1]=a*h,e[5]=a*l,e[9]=-o,e[2]=v*o-g,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){var x=s*l,b=s*h,_=c*l,w=c*h;e[0]=x-w*o,e[4]=-a*h,e[8]=_+b*o,e[1]=b+_*o,e[5]=a*l,e[9]=w-x*o,e[2]=-a*c,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){var M=a*l,S=a*h,T=o*l,E=o*h;e[0]=s*l,e[4]=T*c-S,e[8]=M*c+E,e[1]=s*h,e[5]=E*c+M,e[9]=S*c-T,e[2]=-c,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var A=a*s,L=a*c,R=o*s,P=o*c;e[0]=s*l,e[4]=P-A*h,e[8]=R*h+L,e[1]=h,e[5]=a*l,e[9]=-o*l,e[2]=-c*l,e[6]=L*h+R,e[10]=A-P*h}else if("XZY"===t.order){var C=a*s,O=a*c,I=o*s,D=o*c;e[0]=s*l,e[4]=-h,e[8]=c*l,e[1]=C*h+D,e[5]=a*l,e[9]=O*h-I,e[2]=I*h-O,e[6]=o*l,e[10]=D*h+C}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},Kl.prototype.makeRotationFromQuaternion=function(t){return this.compose(eh,t,nh)},Kl.prototype.lookAt=function(t,e,n){var r=this.elements;return ah.subVectors(t,e),0===ah.lengthSq()&&(ah.z=1),ah.normalize(),rh.crossVectors(n,ah),0===rh.lengthSq()&&(1===Math.abs(n.z)?ah.x+=1e-4:ah.z+=1e-4,ah.normalize(),rh.crossVectors(n,ah)),rh.normalize(),ih.crossVectors(ah,rh),r[0]=rh.x,r[4]=ih.x,r[8]=ah.x,r[1]=rh.y,r[5]=ih.y,r[9]=ah.y,r[2]=rh.z,r[6]=ih.z,r[10]=ah.z,this},Kl.prototype.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},Kl.prototype.premultiply=function(t){return this.multiplyMatrices(t,this)},Kl.prototype.multiplyMatrices=function(t,e){var n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],h=n[5],u=n[9],p=n[13],d=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],b=n[15],_=r[0],w=r[4],M=r[8],S=r[12],T=r[1],E=r[5],A=r[9],L=r[13],R=r[2],P=r[6],C=r[10],O=r[14],I=r[3],D=r[7],N=r[11],B=r[15];return i[0]=a*_+o*T+s*R+c*I,i[4]=a*w+o*E+s*P+c*D,i[8]=a*M+o*A+s*C+c*N,i[12]=a*S+o*L+s*O+c*B,i[1]=l*_+h*T+u*R+p*I,i[5]=l*w+h*E+u*P+p*D,i[9]=l*M+h*A+u*C+p*N,i[13]=l*S+h*L+u*O+p*B,i[2]=d*_+f*T+m*R+v*I,i[6]=d*w+f*E+m*P+v*D,i[10]=d*M+f*A+m*C+v*N,i[14]=d*S+f*L+m*O+v*B,i[3]=g*_+y*T+x*R+b*I,i[7]=g*w+y*E+x*P+b*D,i[11]=g*M+y*A+x*C+b*N,i[15]=g*S+y*L+x*O+b*B,this},Kl.prototype.multiplyScalar=function(t){
var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},Kl.prototype.determinant=function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],c=t[13],l=t[2],h=t[6],u=t[10],p=t[14];return t[3]*(+i*s*h-r*c*h-i*o*u+n*c*u+r*o*p-n*s*p)+t[7]*(+e*s*p-e*c*u+i*a*u-r*a*p+r*c*l-i*s*l)+t[11]*(+e*c*h-e*o*p-i*a*h+n*a*p+i*o*l-n*c*l)+t[15]*(-r*o*l-e*s*h+e*o*u+r*a*h-n*a*u+n*s*l)},Kl.prototype.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},Kl.prototype.setPosition=function(t,e,n){var r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this},Kl.prototype.getInverse=function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],h=r[6],u=r[7],p=r[8],d=r[9],f=r[10],m=r[11],v=r[12],g=r[13],y=r[14],x=r[15],b=d*y*u-g*f*u+g*h*m-l*y*m-d*h*x+l*f*x,_=v*f*u-p*y*u-v*h*m+c*y*m+p*h*x-c*f*x,w=p*g*u-v*d*u+v*l*m-c*g*m-p*l*x+c*d*x,M=v*d*h-p*g*h-v*l*f+c*g*f+p*l*y-c*d*y,S=i*b+a*_+o*w+s*M;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/S;return n[0]=b*T,n[1]=(g*f*s-d*y*s-g*o*m+a*y*m+d*o*x-a*f*x)*T,n[2]=(l*y*s-g*h*s+g*o*u-a*y*u-l*o*x+a*h*x)*T,n[3]=(d*h*s-l*f*s-d*o*u+a*f*u+l*o*m-a*h*m)*T,n[4]=_*T,n[5]=(p*y*s-v*f*s+v*o*m-i*y*m-p*o*x+i*f*x)*T,n[6]=(v*h*s-c*y*s-v*o*u+i*y*u+c*o*x-i*h*x)*T,n[7]=(c*f*s-p*h*s+p*o*u-i*f*u-c*o*m+i*h*m)*T,n[8]=w*T,n[9]=(v*d*s-p*g*s-v*a*m+i*g*m+p*a*x-i*d*x)*T,n[10]=(c*g*s-v*l*s+v*a*u-i*g*u-c*a*x+i*l*x)*T,n[11]=(p*l*s-c*d*s-p*a*u+i*d*u+c*a*m-i*l*m)*T,n[12]=M*T,n[13]=(p*g*o-v*d*o+v*a*f-i*g*f-p*a*y+i*d*y)*T,n[14]=(v*l*o-c*g*o-v*a*h+i*g*h+c*a*y-i*l*y)*T,n[15]=(c*d*o-p*l*o+p*a*h-i*d*h-c*a*f+i*l*f)*T,this},Kl.prototype.scale=function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this},Kl.prototype.getMaxScaleOnAxis=function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))},Kl.prototype.makeTranslation=function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},Kl.prototype.makeRotationX=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},Kl.prototype.makeRotationY=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},Kl.prototype.makeRotationZ=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},Kl.prototype.makeRotationAxis=function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this},Kl.prototype.makeScale=function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},Kl.prototype.makeShear=function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},Kl.prototype.compose=function(t,e,n){var r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,c=i+i,l=a+a,h=o+o,u=i*c,p=i*l,d=i*h,f=a*l,m=a*h,v=o*h,g=s*c,y=s*l,x=s*h,b=n.x,_=n.y,w=n.z;return r[0]=(1-(f+v))*b,r[1]=(p+x)*b,r[2]=(d-y)*b,r[3]=0,r[4]=(p-x)*_,r[5]=(1-(u+v))*_,r[6]=(m+g)*_,r[7]=0,r[8]=(d+y)*w,r[9]=(m-g)*w,r[10]=(1-(u+f))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},Kl.prototype.decompose=function(t,e,n){var r=this.elements,i=$l.set(r[0],r[1],r[2]).length(),a=$l.set(r[4],r[5],r[6]).length(),o=$l.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],th.copy(this);var s=1/i,c=1/a,l=1/o;return th.elements[0]*=s,th.elements[1]*=s,th.elements[2]*=s,th.elements[4]*=c,th.elements[5]*=c,th.elements[6]*=c,th.elements[8]*=l,th.elements[9]*=l,th.elements[10]*=l,e.setFromRotationMatrix(th),n.x=i,n.y=a,n.z=o,this},Kl.prototype.makePerspective=function(t,e,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(e-t),c=2*i/(n-r),l=(e+t)/(e-t),h=(n+r)/(n-r),u=-(a+i)/(a-i),p=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},Kl.prototype.makeOrthographic=function(t,e,n,r,i,a){var o=this.elements,s=1/(e-t),c=1/(n-r),l=1/(a-i),h=(e+t)*s,u=(n+r)*c,p=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},Kl.prototype.equals=function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},Kl.prototype.fromArray=function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},Kl.prototype.toArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t};var $l=new Tl,th=new Kl,eh=new Tl(0,0,0),nh=new Tl(1,1,1),rh=new Tl,ih=new Tl,ah=new Tl,oh=function t(e,n,r,i){void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=t.DefaultOrder),Object.defineProperty(this,"isEuler",{"value":!0}),this._x=e,this._y=n,this._z=r,this._order=i},sh={"x":{"configurable":!0},"y":{"configurable":!0},"z":{"configurable":!0},"order":{"configurable":!0}};sh.x.get=function(){return this._x},sh.x.set=function(t){this._x=t,this._onChangeCallback()},sh.y.get=function(){return this._y},sh.y.set=function(t){this._y=t,this._onChangeCallback()},sh.z.get=function(){return this._z},sh.z.set=function(t){this._z=t,this._onChangeCallback()},sh.order.get=function(){return this._order},sh.order.set=function(t){this._order=t,this._onChangeCallback()},oh.prototype.set=function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},oh.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z,this._order)},oh.prototype.copy=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},oh.prototype.setFromRotationMatrix=function(t,e,n){var r=fl.clamp,i=t.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],h=i[9],u=i[2],p=i[6],d=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,l),this._z=0);break;case"YXZ":this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this},oh.prototype.setFromQuaternion=function(t,e,n){return ch.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ch,e,n)},oh.prototype.setFromVector3=function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},oh.prototype.reorder=function(t){return lh.setFromEuler(this),this.setFromQuaternion(lh,t)},oh.prototype.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},oh.prototype.fromArray=function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},oh.prototype.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},oh.prototype.toVector3=function(t){return t?t.set(this._x,this._y,this._z):new Tl(this._x,this._y,this._z)},oh.prototype._onChange=function(t){return this._onChangeCallback=t,this},oh.prototype._onChangeCallback=function(){},Object.defineProperties(oh.prototype,sh),oh.DefaultOrder="XYZ",oh.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var ch=new Kl,lh=new Ml,hh=function(){this.mask=1};hh.prototype.set=function(t){this.mask=1<<t|0},hh.prototype.enable=function(t){this.mask|=1<<t|0},hh.prototype.enableAll=function(){this.mask=-1},hh.prototype.toggle=function(t){this.mask^=1<<t|0},hh.prototype.disable=function(t){this.mask&=~(1<<t|0)},hh.prototype.disableAll=function(){this.mask=0},hh.prototype.test=function(t){return 0!=(this.mask&t.mask)};var uh=0,ph=new Tl,dh=new Ml,fh=new Kl,mh=new Tl,vh=new Tl,gh=new Tl,yh=new Ml,xh=new Tl(1,0,0),bh=new Tl(0,1,0),_h=new Tl(0,0,1),wh={"type":"added"},Mh={"type":"removed"};s.DefaultUp=new Tl(0,1,0),s.DefaultMatrixAutoUpdate=!0,s.prototype=Object.assign(Object.create(e.prototype),{"constructor":s,"isObject3D":!0,"onBeforeRender":function(){},"onAfterRender":function(){},"applyMatrix4":function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},"applyQuaternion":function(t){return this.quaternion.premultiply(t),this},"setRotationFromAxisAngle":function(t,e){this.quaternion.setFromAxisAngle(t,e)},"setRotationFromEuler":function(t){this.quaternion.setFromEuler(t,!0)},"setRotationFromMatrix":function(t){this.quaternion.setFromRotationMatrix(t)},"setRotationFromQuaternion":function(t){this.quaternion.copy(t)},"rotateOnAxis":function(t,e){return dh.setFromAxisAngle(t,e),this.quaternion.multiply(dh),this},"rotateOnWorldAxis":function(t,e){return dh.setFromAxisAngle(t,e),this.quaternion.premultiply(dh),this},"rotateX":function(t){return this.rotateOnAxis(xh,t)},"rotateY":function(t){return this.rotateOnAxis(bh,t)},"rotateZ":function(t){return this.rotateOnAxis(_h,t)},"translateOnAxis":function(t,e){return ph.copy(t).applyQuaternion(this.quaternion),this.position.add(ph.multiplyScalar(e)),this},"translateX":function(t){return this.translateOnAxis(xh,t)},"translateY":function(t){return this.translateOnAxis(bh,t)},"translateZ":function(t){return this.translateOnAxis(_h,t)},"localToWorld":function(t){return t.applyMatrix4(this.matrixWorld)},"worldToLocal":function(t){return t.applyMatrix4(fh.getInverse(this.matrixWorld))},"lookAt":function(t,e,n){t.isVector3?mh.copy(t):mh.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),vh.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?fh.lookAt(vh,mh,this.up):fh.lookAt(mh,vh,this.up),this.quaternion.setFromRotationMatrix(fh),r&&(fh.extractRotation(r.matrixWorld),dh.setFromRotationMatrix(fh),this.quaternion.premultiply(dh.inverse()))},"add":function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(wh)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},"remove":function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(Mh)),this},"attach":function(t){return this.updateWorldMatrix(!0,!1),fh.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),fh.multiply(t.parent.matrixWorld)),t.applyMatrix4(fh),t.updateWorldMatrix(!1,!1),this.add(t),this},"getObjectById":function(t){return this.getObjectByProperty("id",t)},"getObjectByName":function(t){return this.getObjectByProperty("name",t)},"getObjectByProperty":function(t,e){if(this[t]===e)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n],a=i.getObjectByProperty(t,e);if(void 0!==a)return a}},"getWorldPosition":function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Tl),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},"getWorldQuaternion":function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new Ml),this.updateMatrixWorld(!0),this.matrixWorld.decompose(vh,t,gh),t},"getWorldScale":function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new Tl),this.updateMatrixWorld(!0),this.matrixWorld.decompose(vh,yh,t),t},"getWorldDirection":function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Tl),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},"raycast":function(){},"traverse":function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},"traverseVisible":function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}},"traverseAncestors":function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},"updateMatrix":function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},"updateMatrixWorld":function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},"updateWorldMatrix":function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},"toJSON":function(t){function e(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}function n(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}var r=void 0===t||"string"==typeof t,i={};r&&(t={"geometries":{},"materials":{},"textures":{},"images":{},"shapes":{}},i.metadata={"version":4.5,"type":"Object","generator":"Object3D.toJSON"});var a={};if(a.uuid=this.uuid,a.type=this.type,""!==this.name&&(a.name=this.name),!0===this.castShadow&&(a.castShadow=!0),!0===this.receiveShadow&&(a.receiveShadow=!0),!1===this.visible&&(a.visible=!1),!1===this.frustumCulled&&(a.frustumCulled=!1),0!==this.renderOrder&&(a.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){a.geometry=e(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var s=o.shapes;if(Array.isArray(s))for(var c=0,l=s.length;c<l;c++){var h=s[c];e(t.shapes,h)}else e(t.shapes,s)}}if(void 0!==this.material)if(Array.isArray(this.material)){for(var u=[],p=0,d=this.material.length;p<d;p++)u.push(e(t.materials,this.material[p]));a.material=u}else a.material=e(t.materials,this.material);if(this.children.length>0){a.children=[];for(var f=0;f<this.children.length;f++)a.children.push(this.children[f].toJSON(t).object)}if(r){var m=n(t.geometries),v=n(t.materials),g=n(t.textures),y=n(t.images),x=n(t.shapes);m.length>0&&(i.geometries=m),v.length>0&&(i.materials=v),g.length>0&&(i.textures=g),y.length>0&&(i.images=y),x.length>0&&(i.shapes=x)}return i.object=a,i},"clone":function(t){return(new this.constructor).copy(this,t)},"copy":function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var r=t.children[n];this.add(r.clone())}return this}});var Sh=new Tl,Th=new Tl,Eh=new gl,Ah=function(t,e){Object.defineProperty(this,"isPlane",{"value":!0}),this.normal=void 0!==t?t:new Tl(1,0,0),this.constant=void 0!==e?e:0};Ah.prototype.set=function(t,e){return this.normal.copy(t),this.constant=e,this},Ah.prototype.setComponents=function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this},Ah.prototype.setFromNormalAndCoplanarPoint=function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},Ah.prototype.setFromCoplanarPoints=function(t,e,n){var r=Sh.subVectors(n,e).cross(Th.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this},Ah.prototype.clone=function(){return(new this.constructor).copy(this)},Ah.prototype.copy=function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},Ah.prototype.normalize=function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},Ah.prototype.negate=function(){return this.constant*=-1,this.normal.negate(),this},Ah.prototype.distanceToPoint=function(t){return this.normal.dot(t)+this.constant},Ah.prototype.distanceToSphere=function(t){return this.distanceToPoint(t.center)-t.radius},Ah.prototype.projectPoint=function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new Tl),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},Ah.prototype.intersectLine=function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new Tl);var n=t.delta(Sh),r=this.normal.dot(n);if(0!==r){var i=-(t.start.dot(this.normal)+this.constant)/r;if(!(i<0||i>1))return e.copy(n).multiplyScalar(i).add(t.start)}else if(0===this.distanceToPoint(t.start))return e.copy(t.start)},Ah.prototype.intersectsLine=function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},Ah.prototype.intersectsBox=function(t){return t.intersectsPlane(this)},Ah.prototype.intersectsSphere=function(t){return t.intersectsPlane(this)},Ah.prototype.coplanarPoint=function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Tl),t.copy(this.normal).multiplyScalar(-this.constant)},Ah.prototype.applyMatrix4=function(t,e){var n=e||Eh.getNormalMatrix(t),r=this.coplanarPoint(Sh).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},Ah.prototype.translate=function(t){return this.constant-=t.dot(this.normal),this},Ah.prototype.equals=function(t){return t.normal.equals(this.normal)&&t.constant===this.constant};var Lh=new Tl,Rh=new Tl,Ph=new Tl,Ch=new Tl,Oh=new Tl,Ih=new Tl,Dh=new Tl,Nh=new Tl,Bh=new Tl,zh=new Tl,Gh=function(t,e,n){this.a=void 0!==t?t:new Tl,this.b=void 0!==e?e:new Tl,this.c=void 0!==n?n:new Tl};Gh.getNormal=function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Tl),r.subVectors(n,e),Lh.subVectors(t,e),r.cross(Lh);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},Gh.getBarycoord=function(t,e,n,r,i){Lh.subVectors(r,e),Rh.subVectors(n,e),Ph.subVectors(t,e);var a=Lh.dot(Lh),o=Lh.dot(Rh),s=Lh.dot(Ph),c=Rh.dot(Rh),l=Rh.dot(Ph),h=a*c-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Tl),0===h)return i.set(-2,-1,-1);var u=1/h,p=(c*s-o*l)*u,d=(a*l-o*s)*u;return i.set(1-p-d,d,p)},Gh.containsPoint=function(t,e,n,r){return this.getBarycoord(t,e,n,r,Ch),Ch.x>=0&&Ch.y>=0&&Ch.x+Ch.y<=1},Gh.getUV=function(t,e,n,r,i,a,o,s){return this.getBarycoord(t,e,n,r,Ch),s.set(0,0),s.addScaledVector(i,Ch.x),s.addScaledVector(a,Ch.y),s.addScaledVector(o,Ch.z),s},Gh.isFrontFacing=function(t,e,n,r){return Lh.subVectors(n,e),Rh.subVectors(t,e),Lh.cross(Rh).dot(r)<0},Gh.prototype.set=function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},Gh.prototype.setFromPointsAndIndices=function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this},Gh.prototype.clone=function(){return(new this.constructor).copy(this)},Gh.prototype.copy=function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},Gh.prototype.getArea=function(){return Lh.subVectors(this.c,this.b),Rh.subVectors(this.a,this.b),.5*Lh.cross(Rh).length()},Gh.prototype.getMidpoint=function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Tl),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},Gh.prototype.getNormal=function(t){return Gh.getNormal(this.a,this.b,this.c,t)},Gh.prototype.getPlane=function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Ah),t.setFromCoplanarPoints(this.a,this.b,this.c)},Gh.prototype.getBarycoord=function(t,e){return Gh.getBarycoord(t,this.a,this.b,this.c,e)},Gh.prototype.getUV=function(t,e,n,r,i){return Gh.getUV(t,this.a,this.b,this.c,e,n,r,i)},Gh.prototype.containsPoint=function(t){return Gh.containsPoint(t,this.a,this.b,this.c)},Gh.prototype.isFrontFacing=function(t){return Gh.isFrontFacing(this.a,this.b,this.c,t)},Gh.prototype.intersectsBox=function(t){return t.intersectsTriangle(this)},Gh.prototype.closestPointToPoint=function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new Tl);var n,r,i=this.a,a=this.b,o=this.c;Oh.subVectors(a,i),Ih.subVectors(o,i),Nh.subVectors(t,i);var s=Oh.dot(Nh),c=Ih.dot(Nh);if(s<=0&&c<=0)return e.copy(i);Bh.subVectors(t,a);var l=Oh.dot(Bh),h=Ih.dot(Bh);if(l>=0&&h<=l)return e.copy(a);var u=s*h-l*c;if(u<=0&&s>=0&&l<=0)return n=s/(s-l),e.copy(i).addScaledVector(Oh,n);zh.subVectors(t,o);var p=Oh.dot(zh),d=Ih.dot(zh);if(d>=0&&p<=d)return e.copy(o);var f=p*c-s*d;if(f<=0&&c>=0&&d<=0)return r=c/(c-d),e.copy(i).addScaledVector(Ih,r);var m=l*d-p*h;if(m<=0&&h-l>=0&&p-d>=0)return Dh.subVectors(o,a),r=(h-l)/(h-l+(p-d)),e.copy(a).addScaledVector(Dh,r);var v=1/(m+f+u);return n=f*v,r=u*v,e.copy(i).addScaledVector(Oh,n).addScaledVector(Ih,r)},Gh.prototype.equals=function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)};var Fh={"aliceblue":15792383,"antiquewhite":16444375,"aqua":65535,"aquamarine":8388564,"azure":15794175,"beige":16119260,"bisque":16770244,"black":0,"blanchedalmond":16772045,"blue":255,"blueviolet":9055202,"brown":10824234,"burlywood":14596231,"cadetblue":6266528,"chartreuse":8388352,"chocolate":13789470,"coral":16744272,"cornflowerblue":6591981,"cornsilk":16775388,"crimson":14423100,"cyan":65535,"darkblue":139,"darkcyan":35723,"darkgoldenrod":12092939,"darkgray":11119017,"darkgreen":25600,"darkgrey":11119017,"darkkhaki":12433259,"darkmagenta":9109643,"darkolivegreen":5597999,"darkorange":16747520,"darkorchid":10040012,"darkred":9109504,"darksalmon":15308410,"darkseagreen":9419919,"darkslateblue":4734347,"darkslategray":3100495,"darkslategrey":3100495,"darkturquoise":52945,"darkviolet":9699539,"deeppink":16716947,"deepskyblue":49151,"dimgray":6908265,"dimgrey":6908265,"dodgerblue":2003199,"firebrick":11674146,"floralwhite":16775920,"forestgreen":2263842,"fuchsia":16711935,"gainsboro":14474460,"ghostwhite":16316671,"gold":16766720,"goldenrod":14329120,"gray":8421504,"green":32768,"greenyellow":11403055,"grey":8421504,"honeydew":15794160,"hotpink":16738740,"indianred":13458524,"indigo":4915330,"ivory":16777200,"khaki":15787660,"lavender":15132410,"lavenderblush":16773365,"lawngreen":8190976,"lemonchiffon":16775885,"lightblue":11393254,"lightcoral":15761536,"lightcyan":14745599,"lightgoldenrodyellow":16448210,"lightgray":13882323,"lightgreen":9498256,"lightgrey":13882323,"lightpink":16758465,"lightsalmon":16752762,"lightseagreen":2142890,"lightskyblue":8900346,"lightslategray":7833753,"lightslategrey":7833753,"lightsteelblue":11584734,"lightyellow":16777184,"lime":65280,"limegreen":3329330,"linen":16445670,"magenta":16711935,"maroon":8388608,"mediumaquamarine":6737322,"mediumblue":205,"mediumorchid":12211667,"mediumpurple":9662683,"mediumseagreen":3978097,"mediumslateblue":8087790,"mediumspringgreen":64154,"mediumturquoise":4772300,"mediumvioletred":13047173,"midnightblue":1644912,"mintcream":16121850,"mistyrose":16770273,"moccasin":16770229,"navajowhite":16768685,"navy":128,"oldlace":16643558,"olive":8421376,"olivedrab":7048739,"orange":16753920,"orangered":16729344,"orchid":14315734,"palegoldenrod":15657130,"palegreen":10025880,"paleturquoise":11529966,"palevioletred":14381203,"papayawhip":16773077,"peachpuff":16767673,"peru":13468991,"pink":16761035,"plum":14524637,"powderblue":11591910,"purple":8388736,"rebeccapurple":6697881,"red":16711680,"rosybrown":12357519,"royalblue":4286945,"saddlebrown":9127187,"salmon":16416882,"sandybrown":16032864,"seagreen":3050327,"seashell":16774638,"sienna":10506797,"silver":12632256,"skyblue":8900331,"slateblue":6970061,"slategray":7372944,"slategrey":7372944,"snow":16775930,"springgreen":65407,"steelblue":4620980,"tan":13808780,"teal":32896,"thistle":14204888,"tomato":16737095,"turquoise":4251856,"violet":15631086,"wheat":16113331,"white":16777215,"whitesmoke":16119285,"yellow":16776960,"yellowgreen":10145074},Uh={"h":0,"s":0,"l":0},Hh={"h":0,"s":0,"l":0},kh=function(t,e,n){return Object.defineProperty(this,"isColor",{"value":!0}),void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)};kh.prototype.set=function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},kh.prototype.setScalar=function(t){return this.r=t,this.g=t,this.b=t,this},kh.prototype.setHex=function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},kh.prototype.setRGB=function(t,e,n){return this.r=t,this.g=e,this.b=n,this},kh.prototype.setHSL=function(t,e,n){if(t=fl.euclideanModulo(t,1),e=fl.clamp(e,0,1),n=fl.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=c(i,r,t+1/3),this.g=c(i,r,t),this.b=c(i,r,t-1/3)}return this},kh.prototype.setStyle=function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var l=n[1],h=l.length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},kh.prototype.setColorName=function(t){var e=Fh[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},kh.prototype.clone=function(){return new this.constructor(this.r,this.g,this.b)},kh.prototype.copy=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},kh.prototype.copyGammaToLinear=function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},kh.prototype.copyLinearToGamma=function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},kh.prototype.convertGammaToLinear=function(t){return this.copyGammaToLinear(this,t),this},kh.prototype.convertLinearToGamma=function(t){return this.copyLinearToGamma(this,t),this},kh.prototype.copySRGBToLinear=function(t){return this.r=l(t.r),this.g=l(t.g),this.b=l(t.b),this},kh.prototype.copyLinearToSRGB=function(t){return this.r=h(t.r),this.g=h(t.g),this.b=h(t.b),this},kh.prototype.convertSRGBToLinear=function(){return this.copySRGBToLinear(this),this},kh.prototype.convertLinearToSRGB=function(){return this.copyLinearToSRGB(this),this},kh.prototype.getHex=function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},kh.prototype.getHexString=function(){return("000000"+this.getHex().toString(16)).slice(-6)},kh.prototype.getHSL=function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={"h":0,"s":0,"l":0});var e,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),c=(s+o)/2;if(s===o)e=0,n=0;else{var l=o-s;switch(n=c<=.5?l/(o+s):l/(2-o-s),o){case r:e=(i-a)/l+(i<a?6:0);break;case i:e=(a-r)/l+2;break;case a:e=(r-i)/l+4}e/=6}return t.h=e,t.s=n,t.l=c,t},kh.prototype.getStyle=function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},kh.prototype.offsetHSL=function(t,e,n){return this.getHSL(Uh),Uh.h+=t,Uh.s+=e,Uh.l+=n,this.setHSL(Uh.h,Uh.s,Uh.l),this},kh.prototype.add=function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},kh.prototype.addColors=function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},kh.prototype.addScalar=function(t){return this.r+=t,this.g+=t,this.b+=t,this},kh.prototype.sub=function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},kh.prototype.multiply=function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},kh.prototype.multiplyScalar=function(t){return this.r*=t,this.g*=t,this.b*=t,this},kh.prototype.lerp=function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},kh.prototype.lerpHSL=function(t,e){this.getHSL(Uh),t.getHSL(Hh);var n=fl.lerp(Uh.h,Hh.h,e),r=fl.lerp(Uh.s,Hh.s,e),i=fl.lerp(Uh.l,Hh.l,e);return this.setHSL(n,r,i),this},kh.prototype.equals=function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},kh.prototype.fromArray=function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},kh.prototype.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},kh.prototype.fromBufferAttribute=function(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this},kh.prototype.toJSON=function(){return this.getHex()},kh.NAMES=Fh,kh.prototype.r=1,kh.prototype.g=1,kh.prototype.b=1;var Vh=function(t,e,n,r,i,a){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new Tl,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new kh,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0};Vh.prototype.clone=function(){
return(new this.constructor).copy(this)},Vh.prototype.copy=function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(var r=0,i=t.vertexColors.length;r<i;r++)this.vertexColors[r]=t.vertexColors[r].clone();return this};var jh=0;u.prototype=Object.assign(Object.create(e.prototype),{"constructor":u,"isMaterial":!0,"onBeforeCompile":function(){},"customProgramCacheKey":function(){return this.onBeforeCompile.toString()},"setValues":function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},"toJSON":function(t){function e(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}var n=void 0===t||"string"==typeof t;n&&(t={"textures":{},"images":{}});var r={"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(r.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,r.reflectivity=this.reflectivity,r.refractionRatio=this.refractionRatio,void 0!==this.combine&&(r.combine=this.combine),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Bo&&(r.blending=this.blending),!0===this.flatShading&&(r.flatShading=this.flatShading),this.side!==Oo&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(r.morphTargets=!0),!0===this.morphNormals&&(r.morphNormals=!0),!0===this.skinning&&(r.skinning=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),n){var i=e(t.textures),a=e(t.images);i.length>0&&(r.textures=i),a.length>0&&(r.images=a)}return r},"clone":function(){return(new this.constructor).copy(this)},"copy":function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},"dispose":function(){this.dispatchEvent({"type":"dispose"})}}),Object.defineProperty(u.prototype,"needsUpdate",{"set":function(t){!0===t&&this.version++}}),p.prototype=Object.create(u.prototype),p.prototype.constructor=p,p.prototype.isMeshBasicMaterial=!0,p.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var Wh=new Tl,qh=new ml;Object.defineProperty(d.prototype,"needsUpdate",{"set":function(t){!0===t&&this.version++}}),Object.assign(d.prototype,{"isBufferAttribute":!0,"onUploadCallback":function(){},"setUsage":function(t){return this.usage=t,this},"copy":function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},"copyAt":function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this},"copyArray":function(t){return this.array.set(t),this},"copyColorsArray":function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new kh),e[n++]=a.r,e[n++]=a.g,e[n++]=a.b}return this},"copyVector2sArray":function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new ml),e[n++]=a.x,e[n++]=a.y}return this},"copyVector3sArray":function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new Tl),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z}return this},"copyVector4sArray":function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new _l),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n++]=a.w}return this},"applyMatrix3":function(t){if(2===this.itemSize)for(var e=0,n=this.count;e<n;e++)qh.fromBufferAttribute(this,e),qh.applyMatrix3(t),this.setXY(e,qh.x,qh.y);else if(3===this.itemSize)for(var r=0,i=this.count;r<i;r++)Wh.fromBufferAttribute(this,r),Wh.applyMatrix3(t),this.setXYZ(r,Wh.x,Wh.y,Wh.z);return this},"applyMatrix4":function(t){for(var e=0,n=this.count;e<n;e++)Wh.x=this.getX(e),Wh.y=this.getY(e),Wh.z=this.getZ(e),Wh.applyMatrix4(t),this.setXYZ(e,Wh.x,Wh.y,Wh.z);return this},"applyNormalMatrix":function(t){for(var e=0,n=this.count;e<n;e++)Wh.x=this.getX(e),Wh.y=this.getY(e),Wh.z=this.getZ(e),Wh.applyNormalMatrix(t),this.setXYZ(e,Wh.x,Wh.y,Wh.z);return this},"transformDirection":function(t){for(var e=0,n=this.count;e<n;e++)Wh.x=this.getX(e),Wh.y=this.getY(e),Wh.z=this.getZ(e),Wh.transformDirection(t),this.setXYZ(e,Wh.x,Wh.y,Wh.z);return this},"set":function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},"getX":function(t){return this.array[t*this.itemSize]},"setX":function(t,e){return this.array[t*this.itemSize]=e,this},"getY":function(t){return this.array[t*this.itemSize+1]},"setY":function(t,e){return this.array[t*this.itemSize+1]=e,this},"getZ":function(t){return this.array[t*this.itemSize+2]},"setZ":function(t,e){return this.array[t*this.itemSize+2]=e,this},"getW":function(t){return this.array[t*this.itemSize+3]},"setW":function(t,e){return this.array[t*this.itemSize+3]=e,this},"setXY":function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},"setXYZ":function(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this},"setXYZW":function(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this},"onUpload":function(t){return this.onUploadCallback=t,this},"clone":function(){return new this.constructor(this.array,this.itemSize).copy(this)},"toJSON":function(){return{"itemSize":this.itemSize,"type":this.array.constructor.name,"array":Array.prototype.slice.call(this.array),"normalized":this.normalized}}}),f.prototype=Object.create(d.prototype),f.prototype.constructor=f,m.prototype=Object.create(d.prototype),m.prototype.constructor=m,v.prototype=Object.create(d.prototype),v.prototype.constructor=v,g.prototype=Object.create(d.prototype),g.prototype.constructor=g,y.prototype=Object.create(d.prototype),y.prototype.constructor=y,x.prototype=Object.create(d.prototype),x.prototype.constructor=x,b.prototype=Object.create(d.prototype),b.prototype.constructor=b,_.prototype=Object.create(d.prototype),_.prototype.constructor=_,w.prototype=Object.create(d.prototype),w.prototype.constructor=w;var Xh=function(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1};Xh.prototype.computeGroups=function(t){var e,n,r=[],i=void 0,a=t.faces;for(n=0;n<a.length;n++){var o=a[n];o.materialIndex!==i&&(i=o.materialIndex,void 0!==e&&(e.count=3*n-e.start,r.push(e)),e={"start":3*n,"materialIndex":i})}void 0!==e&&(e.count=3*n-e.start,r.push(e)),this.groups=r},Xh.prototype.fromGeometry=function(t){var e,n=t.faces,r=t.vertices,i=t.faceVertexUvs,a=i[0]&&i[0].length>0,o=i[1]&&i[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var l=0;l<c;l++)e[l]={"name":s[l].name,"data":[]};this.morphTargets.position=e}var h,u=t.morphNormals,p=u.length;if(p>0){h=[];for(var d=0;d<p;d++)h[d]={"name":u[d].name,"data":[]};this.morphTargets.normal=h}var f=t.skinIndices,m=t.skinWeights,v=f.length===r.length,g=m.length===r.length;r.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var y=0;y<n.length;y++){var x=n[y];this.vertices.push(r[x.a],r[x.b],r[x.c]);var b=x.vertexNormals;if(3===b.length)this.normals.push(b[0],b[1],b[2]);else{var _=x.normal;this.normals.push(_,_,_)}var w=x.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var M=x.color;this.colors.push(M,M,M)}if(!0===a){var S=i[0][y];void 0!==S?this.uvs.push(S[0],S[1],S[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",y),this.uvs.push(new ml,new ml,new ml))}if(!0===o){var T=i[1][y];void 0!==T?this.uvs2.push(T[0],T[1],T[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",y),this.uvs2.push(new ml,new ml,new ml))}for(var E=0;E<c;E++){var A=s[E].vertices;e[E].data.push(A[x.a],A[x.b],A[x.c])}for(var L=0;L<p;L++){var R=u[L].vertexNormals[y];h[L].data.push(R.a,R.b,R.c)}v&&this.skinIndices.push(f[x.a],f[x.b],f[x.c]),g&&this.skinWeights.push(m[x.a],m[x.b],m[x.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this};var Yh=1,Zh=new Kl,Jh=new s,Qh=new Tl,Kh=new Ll,$h=new Ll,tu=new Tl;S.prototype=Object.assign(Object.create(e.prototype),{"constructor":S,"isBufferGeometry":!0,"getIndex":function(){return this.index},"setIndex":function(t){Array.isArray(t)?this.index=new(M(t)>65535?b:y)(t,1):this.index=t},"getAttribute":function(t){return this.attributes[t]},"setAttribute":function(t,e){return this.attributes[t]=e,this},"deleteAttribute":function(t){return delete this.attributes[t],this},"addGroup":function(t,e,n){this.groups.push({"start":t,"count":e,"materialIndex":void 0!==n?n:0})},"clearGroups":function(){this.groups=[]},"setDrawRange":function(t,e){this.drawRange.start=t,this.drawRange.count=e},"applyMatrix4":function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new gl).getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},"rotateX":function(t){return Zh.makeRotationX(t),this.applyMatrix4(Zh),this},"rotateY":function(t){return Zh.makeRotationY(t),this.applyMatrix4(Zh),this},"rotateZ":function(t){return Zh.makeRotationZ(t),this.applyMatrix4(Zh),this},"translate":function(t,e,n){return Zh.makeTranslation(t,e,n),this.applyMatrix4(Zh),this},"scale":function(t,e,n){return Zh.makeScale(t,e,n),this.applyMatrix4(Zh),this},"lookAt":function(t){return Jh.lookAt(t),Jh.updateMatrix(),this.applyMatrix4(Jh.matrix),this},"center":function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qh).negate(),this.translate(Qh.x,Qh.y,Qh.z),this},"setFromObject":function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new _(3*e.vertices.length,3),r=new _(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new _(e.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},"setFromPoints":function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new _(e,3)),this},"updateFromObject":function(t){var e=t.geometry;if(t.isMesh){var n=e.__directGeometry;if(!0===e.elementsNeedUpdate&&(n=void 0,e.elementsNeedUpdate=!1),void 0===n)return this.fromGeometry(e);n.verticesNeedUpdate=e.verticesNeedUpdate,n.normalsNeedUpdate=e.normalsNeedUpdate,n.colorsNeedUpdate=e.colorsNeedUpdate,n.uvsNeedUpdate=e.uvsNeedUpdate,n.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=n}if(!0===e.verticesNeedUpdate){var r=this.attributes.position;void 0!==r&&(r.copyVector3sArray(e.vertices),r.needsUpdate=!0),e.verticesNeedUpdate=!1}if(!0===e.normalsNeedUpdate){var i=this.attributes.normal;void 0!==i&&(i.copyVector3sArray(e.normals),i.needsUpdate=!0),e.normalsNeedUpdate=!1}if(!0===e.colorsNeedUpdate){var a=this.attributes.color;void 0!==a&&(a.copyColorsArray(e.colors),a.needsUpdate=!0),e.colorsNeedUpdate=!1}if(e.uvsNeedUpdate){var o=this.attributes.uv;void 0!==o&&(o.copyVector2sArray(e.uvs),o.needsUpdate=!0),e.uvsNeedUpdate=!1}if(e.lineDistancesNeedUpdate){var s=this.attributes.lineDistance;void 0!==s&&(s.copyArray(e.lineDistances),s.needsUpdate=!0),e.lineDistancesNeedUpdate=!1}return e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},"fromGeometry":function(t){return t.__directGeometry=(new Xh).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},"fromDirectGeometry":function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new d(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new d(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var r=new Float32Array(3*t.colors.length);this.setAttribute("color",new d(r,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new d(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var a=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new d(a,2).copyVector2sArray(t.uvs2))}this.groups=t.groups;for(var o in t.morphTargets){for(var s=[],c=t.morphTargets[o],l=0,h=c.length;l<h;l++){var u=c[l],p=new _(3*u.data.length,3);p.name=u.name,s.push(p.copyVector3sArray(u.data))}this.morphAttributes[o]=s}if(t.skinIndices.length>0){var f=new _(4*t.skinIndices.length,4);this.setAttribute("skinIndex",f.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var m=new _(4*t.skinWeights.length,4);this.setAttribute("skinWeight",m.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},"computeBoundingBox":function(){null===this.boundingBox&&(this.boundingBox=new Ll);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Tl(-1/0,-1/0,-1/0),new Tl(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,r=e.length;n<r;n++){var i=e[n];Kh.setFromBufferAttribute(i),this.morphTargetsRelative?(tu.addVectors(this.boundingBox.min,Kh.min),this.boundingBox.expandByPoint(tu),tu.addVectors(this.boundingBox.max,Kh.max),this.boundingBox.expandByPoint(tu)):(this.boundingBox.expandByPoint(Kh.min),this.boundingBox.expandByPoint(Kh.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},"computeBoundingSphere":function(){null===this.boundingSphere&&(this.boundingSphere=new Vl);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new Tl,1/0);if(t){var n=this.boundingSphere.center;if(Kh.setFromBufferAttribute(t),e)for(var r=0,i=e.length;r<i;r++){var a=e[r];$h.setFromBufferAttribute(a),this.morphTargetsRelative?(tu.addVectors(Kh.min,$h.min),Kh.expandByPoint(tu),tu.addVectors(Kh.max,$h.max),Kh.expandByPoint(tu)):(Kh.expandByPoint($h.min),Kh.expandByPoint($h.max))}Kh.getCenter(n);for(var o=0,s=0,c=t.count;s<c;s++)tu.fromBufferAttribute(t,s),o=Math.max(o,n.distanceToSquared(tu));if(e)for(var l=0,h=e.length;l<h;l++)for(var u=e[l],p=this.morphTargetsRelative,d=0,f=u.count;d<f;d++)tu.fromBufferAttribute(u,d),p&&(Qh.fromBufferAttribute(t,d),tu.add(Qh)),o=Math.max(o,n.distanceToSquared(tu));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},"computeFaceNormals":function(){},"computeVertexNormals":function(){var t=this.index,e=this.getAttribute("position");if(void 0!==e){var n=this.getAttribute("normal");if(void 0===n)n=new d(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(var r=0,i=n.count;r<i;r++)n.setXYZ(r,0,0,0);var a=new Tl,o=new Tl,s=new Tl,c=new Tl,l=new Tl,h=new Tl,u=new Tl,p=new Tl;if(t)for(var f=0,m=t.count;f<m;f+=3){var v=t.getX(f+0),g=t.getX(f+1),y=t.getX(f+2);a.fromBufferAttribute(e,v),o.fromBufferAttribute(e,g),s.fromBufferAttribute(e,y),u.subVectors(s,o),p.subVectors(a,o),u.cross(p),c.fromBufferAttribute(n,v),l.fromBufferAttribute(n,g),h.fromBufferAttribute(n,y),c.add(u),l.add(u),h.add(u),n.setXYZ(v,c.x,c.y,c.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(y,h.x,h.y,h.z)}else for(var x=0,b=e.count;x<b;x+=3)a.fromBufferAttribute(e,x+0),o.fromBufferAttribute(e,x+1),s.fromBufferAttribute(e,x+2),u.subVectors(s,o),p.subVectors(a,o),u.cross(p),n.setXYZ(x+0,u.x,u.y,u.z),n.setXYZ(x+1,u.x,u.y,u.z),n.setXYZ(x+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}},"merge":function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==t.attributes[r])for(var i=n[r],a=i.array,o=t.attributes[r],s=o.array,c=o.itemSize*e,l=Math.min(s.length,a.length-c),h=0,u=c;h<l;h++,u++)a[u]=s[h];return this},"normalizeNormals":function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)tu.fromBufferAttribute(t,e),tu.normalize(),t.setXYZ(e,tu.x,tu.y,tu.z)},"toNonIndexed":function(){function t(t,e){for(var n=t.array,r=t.itemSize,i=t.normalized,a=new n.constructor(e.length*r),o=0,s=0,c=0,l=e.length;c<l;c++){o=e[c]*r;for(var h=0;h<r;h++)a[s++]=n[o++]}return new d(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new S,n=this.index.array,r=this.attributes;for(var i in r){var a=r[i],o=t(a,n);e.setAttribute(i,o)}var s=this.morphAttributes;for(var c in s){for(var l=[],h=s[c],u=0,p=h.length;u<p;u++){var f=h[u],m=t(f,n);l.push(m)}e.morphAttributes[c]=l}e.morphTargetsRelative=this.morphTargetsRelative;for(var v=this.groups,g=0,y=v.length;g<y;g++){var x=v[g];e.addGroup(x.start,x.count,x.materialIndex)}return e},"toJSON":function(){var t={"metadata":{"version":4.5,"type":"BufferGeometry","generator":"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={"attributes":{}};var r=this.index;null!==r&&(t.data.index={"type":r.array.constructor.name,"array":Array.prototype.slice.call(r.array)});var i=this.attributes;for(var a in i){var o=i[a],s=o.toJSON(t.data);""!==o.name&&(s.name=o.name),t.data.attributes[a]=s}var c={},l=!1;for(var h in this.morphAttributes){for(var u=this.morphAttributes[h],p=[],d=0,f=u.length;d<f;d++){var m=u[d],v=m.toJSON(t.data);""!==m.name&&(v.name=m.name),p.push(v)}p.length>0&&(c[h]=p,l=!0)}l&&(t.data.morphAttributes=c,t.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(t.data.groups=JSON.parse(JSON.stringify(g)));var y=this.boundingSphere;return null!==y&&(t.data.boundingSphere={"center":y.center.toArray(),"radius":y.radius}),t},"clone":function(){return(new S).copy(this)},"copy":function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var e={};this.name=t.name;var n=t.index;null!==n&&this.setIndex(n.clone(e));var r=t.attributes;for(var i in r){var a=r[i];this.setAttribute(i,a.clone(e))}var o=t.morphAttributes;for(var s in o){for(var c=[],l=o[s],h=0,u=l.length;h<u;h++)c.push(l[h].clone(e));this.morphAttributes[s]=c}this.morphTargetsRelative=t.morphTargetsRelative;for(var p=t.groups,d=0,f=p.length;d<f;d++){var m=p[d];this.addGroup(m.start,m.count,m.materialIndex)}var v=t.boundingBox;null!==v&&(this.boundingBox=v.clone());var g=t.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},"dispose":function(){this.dispatchEvent({"type":"dispose"})}});var eu=new Kl,nu=new Ql,ru=new Vl,iu=new Tl,au=new Tl,ou=new Tl,su=new Tl,cu=new Tl,lu=new Tl,hu=new Tl,uu=new Tl,pu=new Tl,du=new ml,fu=new ml,mu=new ml,vu=new Tl,gu=new Tl;T.prototype=Object.assign(Object.create(s.prototype),{"constructor":T,"isMesh":!0,"copy":function(t){return s.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},"updateMorphTargets":function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=r.length;i<a;i++){var o=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}else{var s=t.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},"raycast":function(t,e){var n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r&&(null===n.boundingSphere&&n.computeBoundingSphere(),ru.copy(n.boundingSphere),ru.applyMatrix4(i),!1!==t.ray.intersectsSphere(ru)&&(eu.getInverse(i),nu.copy(t.ray).applyMatrix4(eu),null===n.boundingBox||!1!==nu.intersectsBox(n.boundingBox)))){var a;if(n.isBufferGeometry){var o=n.index,s=n.attributes.position,c=n.morphAttributes.position,l=n.morphTargetsRelative,h=n.attributes.uv,u=n.attributes.uv2,p=n.groups,d=n.drawRange;if(null!==o)if(Array.isArray(r))for(var f=0,m=p.length;f<m;f++)for(var v=p[f],g=r[v.materialIndex],y=Math.max(v.start,d.start),x=Math.min(v.start+v.count,d.start+d.count),b=y,_=x;b<_;b+=3){var w=o.getX(b),M=o.getX(b+1),S=o.getX(b+2);a=A(this,g,t,nu,s,c,l,h,u,w,M,S),a&&(a.faceIndex=Math.floor(b/3),a.face.materialIndex=v.materialIndex,e.push(a))}else for(var T=Math.max(0,d.start),L=Math.min(o.count,d.start+d.count),R=T,P=L;R<P;R+=3){var C=o.getX(R),O=o.getX(R+1),I=o.getX(R+2);a=A(this,r,t,nu,s,c,l,h,u,C,O,I),a&&(a.faceIndex=Math.floor(R/3),e.push(a))}else if(void 0!==s)if(Array.isArray(r))for(var D=0,N=p.length;D<N;D++)for(var B=p[D],z=r[B.materialIndex],G=Math.max(B.start,d.start),F=Math.min(B.start+B.count,d.start+d.count),U=G,H=F;U<H;U+=3){var k=U,V=U+1,j=U+2;a=A(this,z,t,nu,s,c,l,h,u,k,V,j),a&&(a.faceIndex=Math.floor(U/3),a.face.materialIndex=B.materialIndex,e.push(a))}else for(var W=Math.max(0,d.start),q=Math.min(s.count,d.start+d.count),X=W,Y=q;X<Y;X+=3){var Z=X,J=X+1,Q=X+2;a=A(this,r,t,nu,s,c,l,h,u,Z,J,Q),a&&(a.faceIndex=Math.floor(X/3),e.push(a))}}else if(n.isGeometry){var K,$=Array.isArray(r),tt=n.vertices,et=n.faces,nt=n.faceVertexUvs[0];nt.length>0&&(K=nt);for(var rt=0,it=et.length;rt<it;rt++){var at=et[rt],ot=$?r[at.materialIndex]:r;if(void 0!==ot){var st=tt[at.a],ct=tt[at.b],lt=tt[at.c];if(a=E(this,ot,t,nu,st,ct,lt,vu)){if(K&&K[rt]){var ht=K[rt];du.copy(ht[0]),fu.copy(ht[1]),mu.copy(ht[2]),a.uv=Gh.getUV(vu,st,ct,lt,du,fu,mu,new ml)}a.face=at,a.faceIndex=rt,e.push(a)}}}}}}});var yu=0,xu=new Kl,bu=new s,_u=new Tl;L.prototype=Object.assign(Object.create(e.prototype),{"constructor":L,"isGeometry":!0,"applyMatrix4":function(t){for(var e=(new gl).getNormalMatrix(t),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(t)}for(var i=0,a=this.faces.length;i<a;i++){var o=this.faces[i];o.normal.applyMatrix3(e).normalize();for(var s=0,c=o.vertexNormals.length;s<c;s++)o.vertexNormals[s].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},"rotateX":function(t){return xu.makeRotationX(t),this.applyMatrix4(xu),this},"rotateY":function(t){return xu.makeRotationY(t),this.applyMatrix4(xu),this},"rotateZ":function(t){return xu.makeRotationZ(t),this.applyMatrix4(xu),this},"translate":function(t,e,n){return xu.makeTranslation(t,e,n),this.applyMatrix4(xu),this},"scale":function(t,e,n){return xu.makeScale(t,e,n),this.applyMatrix4(xu),this},"lookAt":function(t){return bu.lookAt(t),bu.updateMatrix(),this.applyMatrix4(bu.matrix),this},"fromBufferGeometry":function(t){function e(t,e,r,i){var a=void 0===s?[]:[n.colors[t].clone(),n.colors[e].clone(),n.colors[r].clone()],h=void 0===o?[]:[(new Tl).fromBufferAttribute(o,t),(new Tl).fromBufferAttribute(o,e),(new Tl).fromBufferAttribute(o,r)],u=new Vh(t,e,r,h,a,i);n.faces.push(u),void 0!==c&&n.faceVertexUvs[0].push([(new ml).fromBufferAttribute(c,t),(new ml).fromBufferAttribute(c,e),(new ml).fromBufferAttribute(c,r)]),
void 0!==l&&n.faceVertexUvs[1].push([(new ml).fromBufferAttribute(l,t),(new ml).fromBufferAttribute(l,e),(new ml).fromBufferAttribute(l,r)])}var n=this,r=null!==t.index?t.index:void 0,i=t.attributes;if(void 0===i.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var a=i.position,o=i.normal,s=i.color,c=i.uv,l=i.uv2;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var h=0;h<a.count;h++)n.vertices.push((new Tl).fromBufferAttribute(a,h)),void 0!==s&&n.colors.push((new kh).fromBufferAttribute(s,h));var u=t.groups;if(u.length>0)for(var p=0;p<u.length;p++)for(var d=u[p],f=d.start,m=d.count,v=f,g=f+m;v<g;v+=3)void 0!==r?e(r.getX(v),r.getX(v+1),r.getX(v+2),d.materialIndex):e(v,v+1,v+2,d.materialIndex);else if(void 0!==r)for(var y=0;y<r.count;y+=3)e(r.getX(y),r.getX(y+1),r.getX(y+2));else for(var x=0;x<a.count;x+=3)e(x,x+1,x+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},"center":function(){return this.computeBoundingBox(),this.boundingBox.getCenter(_u).negate(),this.translate(_u.x,_u.y,_u.z),this},"normalize":function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new Kl;return r.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(r),this},"computeFaceNormals":function(){for(var t=new Tl,e=new Tl,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),i.normal.copy(t)}},"computeVertexNormals":function(t){void 0===t&&(t=!0);for(var e=new Array(this.vertices.length),n=0,r=this.vertices.length;n<r;n++)e[n]=new Tl;if(t)for(var i=new Tl,a=new Tl,o=0,s=this.faces.length;o<s;o++){var c=this.faces[o],l=this.vertices[c.a],h=this.vertices[c.b],u=this.vertices[c.c];i.subVectors(u,h),a.subVectors(l,h),i.cross(a),e[c.a].add(i),e[c.b].add(i),e[c.c].add(i)}else{this.computeFaceNormals();for(var p=0,d=this.faces.length;p<d;p++){var f=this.faces[p];e[f.a].add(f.normal),e[f.b].add(f.normal),e[f.c].add(f.normal)}}for(var m=0,v=this.vertices.length;m<v;m++)e[m].normalize();for(var g=0,y=this.faces.length;g<y;g++){var x=this.faces[g],b=x.vertexNormals;3===b.length?(b[0].copy(e[x.a]),b[1].copy(e[x.b]),b[2].copy(e[x.c])):(b[0]=e[x.a].clone(),b[1]=e[x.b].clone(),b[2]=e[x.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},"computeFlatVertexNormals":function(){this.computeFaceNormals();for(var t=0,e=this.faces.length;t<e;t++){var n=this.faces[t],r=n.vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},"computeMorphNormals":function(){for(var t=0,e=this.faces.length;t<e;t++){var n=this.faces[t];n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]);for(var r=0,i=n.vertexNormals.length;r<i;r++)n.__originalVertexNormals[r]?n.__originalVertexNormals[r].copy(n.vertexNormals[r]):n.__originalVertexNormals[r]=n.vertexNormals[r].clone()}var a=new L;a.faces=this.faces;for(var o=0,s=this.morphTargets.length;o<s;o++){if(!this.morphNormals[o]){this.morphNormals[o]={},this.morphNormals[o].faceNormals=[],this.morphNormals[o].vertexNormals=[];for(var c=this.morphNormals[o].faceNormals,l=this.morphNormals[o].vertexNormals,h=0,u=this.faces.length;h<u;h++){var p=new Tl,d={"a":new Tl,"b":new Tl,"c":new Tl};c.push(p),l.push(d)}}var f=this.morphNormals[o];a.vertices=this.morphTargets[o].vertices,a.computeFaceNormals(),a.computeVertexNormals();for(var m=0,v=this.faces.length;m<v;m++){var g=this.faces[m],y=f.faceNormals[m],x=f.vertexNormals[m];y.copy(g.normal),x.a.copy(g.vertexNormals[0]),x.b.copy(g.vertexNormals[1]),x.c.copy(g.vertexNormals[2])}}for(var b=0,_=this.faces.length;b<_;b++){var w=this.faces[b];w.normal=w.__originalFaceNormal,w.vertexNormals=w.__originalVertexNormals}},"computeBoundingBox":function(){null===this.boundingBox&&(this.boundingBox=new Ll),this.boundingBox.setFromPoints(this.vertices)},"computeBoundingSphere":function(){null===this.boundingSphere&&(this.boundingSphere=new Vl),this.boundingSphere.setFromPoints(this.vertices)},"merge":function(t,e,n){if(!t||!t.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);var r,i=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,c=t.faces,l=this.colors,h=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new gl).getNormalMatrix(e));for(var u=0,p=o.length;u<p;u++){var d=o[u],f=d.clone();void 0!==e&&f.applyMatrix4(e),a.push(f)}for(var m=0,v=h.length;m<v;m++)l.push(h[m].clone());for(var g=0,y=c.length;g<y;g++){var x=c[g],b=void 0,_=void 0,w=x.vertexNormals,M=x.vertexColors,S=new Vh(x.a+i,x.b+i,x.c+i);S.normal.copy(x.normal),void 0!==r&&S.normal.applyMatrix3(r).normalize();for(var T=0,E=w.length;T<E;T++)b=w[T].clone(),void 0!==r&&b.applyMatrix3(r).normalize(),S.vertexNormals.push(b);S.color.copy(x.color);for(var A=0,L=M.length;A<L;A++)_=M[A],S.vertexColors.push(_.clone());S.materialIndex=x.materialIndex+n,s.push(S)}for(var R=0,P=t.faceVertexUvs.length;R<P;R++){var C=t.faceVertexUvs[R];void 0===this.faceVertexUvs[R]&&(this.faceVertexUvs[R]=[]);for(var O=0,I=C.length;O<I;O++){for(var D=C[O],N=[],B=0,z=D.length;B<z;B++)N.push(D[B].clone());this.faceVertexUvs[R].push(N)}}},"mergeMesh":function(t){if(!t||!t.isMesh)return void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t);t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)},"mergeVertices":function(){for(var t={},e=[],n=[],r=Math.pow(10,4),i=0,a=this.vertices.length;i<a;i++){var o=this.vertices[i],s=Math.round(o.x*r)+"_"+Math.round(o.y*r)+"_"+Math.round(o.z*r);void 0===t[s]?(t[s]=i,e.push(this.vertices[i]),n[i]=e.length-1):n[i]=n[t[s]]}for(var c=[],l=0,h=this.faces.length;l<h;l++){var u=this.faces[l];u.a=n[u.a],u.b=n[u.b],u.c=n[u.c];for(var p=[u.a,u.b,u.c],d=0;d<3;d++)if(p[d]===p[(d+1)%3]){c.push(l);break}}for(var f=c.length-1;f>=0;f--){var m=c[f];this.faces.splice(m,1);for(var v=0,g=this.faceVertexUvs.length;v<g;v++)this.faceVertexUvs[v].splice(m,1)}var y=this.vertices.length-e.length;return this.vertices=e,y},"setFromPoints":function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var r=t[e];this.vertices.push(new Tl(r.x,r.y,r.z||0))}return this},"sortFacesByMaterialIndex":function(){function t(t,e){return t.materialIndex-e.materialIndex}for(var e=this.faces,n=e.length,r=0;r<n;r++)e[r]._id=r;e.sort(t);var i,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===n&&(i=[]),s&&s.length===n&&(a=[]);for(var c=0;c<n;c++){var l=e[c]._id;i&&i.push(o[l]),a&&a.push(s[l])}i&&(this.faceVertexUvs[0]=i),a&&(this.faceVertexUvs[1]=a)},"toJSON":function(){function t(t,e,n){return n?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==p[e]?p[e]:(p[e]=u.length/3,u.push(t.x,t.y,t.z),p[e])}function n(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==f[e]?f[e]:(f[e]=d.length,d.push(t.getHex()),f[e])}function r(t){var e=t.x.toString()+t.y.toString();return void 0!==v[e]?v[e]:(v[e]=m.length/2,m.push(t.x,t.y),v[e])}var i={"metadata":{"version":4.5,"type":"Geometry","generator":"Geometry.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var o in a)void 0!==a[o]&&(i[o]=a[o]);return i}for(var s=[],c=0;c<this.vertices.length;c++){var l=this.vertices[c];s.push(l.x,l.y,l.z)}for(var h=[],u=[],p={},d=[],f={},m=[],v={},g=0;g<this.faces.length;g++){var y=this.faces[g],x=void 0!==this.faceVertexUvs[0][g],b=y.normal.length()>0,_=y.vertexNormals.length>0,w=1!==y.color.r||1!==y.color.g||1!==y.color.b,M=y.vertexColors.length>0,S=0;if(S=t(S,0,0),S=t(S,1,!0),S=t(S,2,!1),S=t(S,3,x),S=t(S,4,b),S=t(S,5,_),S=t(S,6,w),S=t(S,7,M),h.push(S),h.push(y.a,y.b,y.c),h.push(y.materialIndex),x){var T=this.faceVertexUvs[0][g];h.push(r(T[0]),r(T[1]),r(T[2]))}if(b&&h.push(e(y.normal)),_){var E=y.vertexNormals;h.push(e(E[0]),e(E[1]),e(E[2]))}if(w&&h.push(n(y.color)),M){var A=y.vertexColors;h.push(n(A[0]),n(A[1]),n(A[2]))}}return i.data={},i.data.vertices=s,i.data.normals=u,d.length>0&&(i.data.colors=d),m.length>0&&(i.data.uvs=[m]),i.data.faces=h,i},"clone":function(){return(new L).copy(this)},"copy":function(t){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;for(var e=t.vertices,n=0,r=e.length;n<r;n++)this.vertices.push(e[n].clone());for(var i=t.colors,a=0,o=i.length;a<o;a++)this.colors.push(i[a].clone());for(var s=t.faces,c=0,l=s.length;c<l;c++)this.faces.push(s[c].clone());for(var h=0,u=t.faceVertexUvs.length;h<u;h++){var p=t.faceVertexUvs[h];void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]);for(var d=0,f=p.length;d<f;d++){for(var m=p[d],v=[],g=0,y=m.length;g<y;g++){var x=m[g];v.push(x.clone())}this.faceVertexUvs[h].push(v)}}for(var b=t.morphTargets,_=0,w=b.length;_<w;_++){var M={};if(M.name=b[_].name,void 0!==b[_].vertices){M.vertices=[];for(var S=0,T=b[_].vertices.length;S<T;S++)M.vertices.push(b[_].vertices[S].clone())}if(void 0!==b[_].normals){M.normals=[];for(var E=0,A=b[_].normals.length;E<A;E++)M.normals.push(b[_].normals[E].clone())}this.morphTargets.push(M)}for(var L=t.morphNormals,R=0,P=L.length;R<P;R++){var C={};if(void 0!==L[R].vertexNormals){C.vertexNormals=[];for(var O=0,I=L[R].vertexNormals.length;O<I;O++){var D=L[R].vertexNormals[O],N={};N.a=D.a.clone(),N.b=D.b.clone(),N.c=D.c.clone(),C.vertexNormals.push(N)}}if(void 0!==L[R].faceNormals){C.faceNormals=[];for(var B=0,z=L[R].faceNormals.length;B<z;B++)C.faceNormals.push(L[R].faceNormals[B].clone())}this.morphNormals.push(C)}for(var G=t.skinWeights,F=0,U=G.length;F<U;F++)this.skinWeights.push(G[F].clone());for(var H=t.skinIndices,k=0,V=H.length;k<V;k++)this.skinIndices.push(H[k].clone());for(var j=t.lineDistances,W=0,q=j.length;W<q;W++)this.lineDistances.push(j[W]);var X=t.boundingBox;null!==X&&(this.boundingBox=X.clone());var Y=t.boundingSphere;return null!==Y&&(this.boundingSphere=Y.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},"dispose":function(){this.dispatchEvent({"type":"dispose"})}}),R.prototype=Object.create(L.prototype),R.prototype.constructor=R,P.prototype=Object.create(S.prototype),P.prototype.constructor=P;var wu={"clone":C,"merge":O},Mu="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",Su="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";I.prototype=Object.create(u.prototype),I.prototype.constructor=I,I.prototype.isShaderMaterial=!0,I.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=C(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this},I.prototype.toJSON=function(t){var e=u.prototype.toJSON.call(this,t);e.glslVersion=this.glslVersion,e.uniforms={};for(var n in this.uniforms){var r=this.uniforms[n],i=r.value;i&&i.isTexture?e.uniforms[n]={"type":"t","value":i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={"type":"c","value":i.getHex()}:i&&i.isVector2?e.uniforms[n]={"type":"v2","value":i.toArray()}:i&&i.isVector3?e.uniforms[n]={"type":"v3","value":i.toArray()}:i&&i.isVector4?e.uniforms[n]={"type":"v4","value":i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={"type":"m3","value":i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={"type":"m4","value":i.toArray()}:e.uniforms[n]={"value":i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var a={};for(var o in this.extensions)!0===this.extensions[o]&&(a[o]=!0);return Object.keys(a).length>0&&(e.extensions=a),e},D.prototype=Object.assign(Object.create(s.prototype),{"constructor":D,"isCamera":!0,"copy":function(t,e){return s.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},"getWorldDirection":function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Tl),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},"updateMatrixWorld":function(t){s.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},"updateWorldMatrix":function(t,e){s.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},"clone":function(){return(new this.constructor).copy(this)}}),N.prototype=Object.assign(Object.create(D.prototype),{"constructor":N,"isPerspectiveCamera":!0,"copy":function(t,e){return D.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},"setFocalLength":function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*fl.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},"getFocalLength":function(){var t=Math.tan(.5*fl.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},"getEffectiveFOV":function(){return 2*fl.RAD2DEG*Math.atan(Math.tan(.5*fl.DEG2RAD*this.fov)/this.zoom)},"getFilmWidth":function(){return this.filmGauge*Math.min(this.aspect,1)},"getFilmHeight":function(){return this.filmGauge/Math.max(this.aspect,1)},"setViewOffset":function(t,e,n,r,i,a){this.aspect=t/e,null===this.view&&(this.view={"enabled":!0,"fullWidth":1,"fullHeight":1,"offsetX":0,"offsetY":0,"width":1,"height":1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},"clearViewOffset":function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},"updateProjectionMatrix":function(){var t=this.near,e=t*Math.tan(.5*fl.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,e-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(i+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},"toJSON":function(t){var e=s.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});var Tu=90,Eu=1;B.prototype=Object.create(s.prototype),B.prototype.constructor=B,z.prototype=Object.create(r.prototype),z.prototype.constructor=z,z.prototype.isWebGLCubeRenderTarget=!0,z.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=Zs,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;var n={"uniforms":{"tEquirect":{"value":null}},"vertexShader":"\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include <begin_vertex>\n\t\t\t\t#include <project_vertex>\n\n\t\t\t}\n\t\t","fragmentShader":"\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t"},r=new P(5,5,5),i=new I({"name":"CubemapFromEquirect","uniforms":C(n.uniforms),"vertexShader":n.vertexShader,"fragmentShader":n.fragmentShader,"side":Io,"blending":No});i.uniforms.tEquirect.value=e;var a=new T(r,i),o=e.minFilter;return e.minFilter===Ds&&(e.minFilter=Os),new B(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this},G.prototype=Object.create(n.prototype),G.prototype.constructor=G,G.prototype.isDataTexture=!0;var Au=new Vl,Lu=new Tl,Ru=function(t,e,n,r,i,a){this.planes=[void 0!==t?t:new Ah,void 0!==e?e:new Ah,void 0!==n?n:new Ah,void 0!==r?r:new Ah,void 0!==i?i:new Ah,void 0!==a?a:new Ah]};Ru.prototype.set=function(t,e,n,r,i,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},Ru.prototype.clone=function(){return(new this.constructor).copy(this)},Ru.prototype.copy=function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},Ru.prototype.setFromProjectionMatrix=function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],h=n[7],u=n[8],p=n[9],d=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return e[0].setComponents(o-r,h-s,f-u,y-m).normalize(),e[1].setComponents(o+r,h+s,f+u,y+m).normalize(),e[2].setComponents(o+i,h+c,f+p,y+v).normalize(),e[3].setComponents(o-i,h-c,f-p,y-v).normalize(),e[4].setComponents(o-a,h-l,f-d,y-g).normalize(),e[5].setComponents(o+a,h+l,f+d,y+g).normalize(),this},Ru.prototype.intersectsObject=function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Au.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Au)},Ru.prototype.intersectsSprite=function(t){return Au.center.set(0,0,0),Au.radius=.7071067811865476,Au.applyMatrix4(t.matrixWorld),this.intersectsSphere(Au)},Ru.prototype.intersectsSphere=function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)<r)return!1}return!0},Ru.prototype.intersectsBox=function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if(Lu.x=r.normal.x>0?t.max.x:t.min.x,Lu.y=r.normal.y>0?t.max.y:t.min.y,Lu.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Lu)<0)return!1}return!0},Ru.prototype.containsPoint=function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0},H.prototype=Object.create(L.prototype),H.prototype.constructor=H,k.prototype=Object.create(S.prototype),k.prototype.constructor=k;var Pu={"alphamap_fragment":"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif","alphamap_pars_fragment":"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif","alphatest_fragment":"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif","aomap_fragment":"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif","aomap_pars_fragment":"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif","begin_vertex":"vec3 transformed = vec3( position );","beginnormal_vertex":"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif","bsdfs":"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif","bumpmap_pars_fragment":"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif","clipping_planes_fragment":"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif","clipping_planes_pars_fragment":"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif","clipping_planes_pars_vertex":"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif","clipping_planes_vertex":"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif","color_fragment":"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif","color_pars_fragment":"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif","color_pars_vertex":"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif","color_vertex":"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",
"common":"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}","cube_uv_reflection_fragment":"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif","defaultnormal_vertex":"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif","displacementmap_pars_vertex":"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif","displacementmap_vertex":"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif","emissivemap_fragment":"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif","emissivemap_pars_fragment":"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif","encodings_fragment":"gl_FragColor = linearToOutputTexel( gl_FragColor );","encodings_pars_fragment":"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}","envmap_fragment":"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif","envmap_common_pars_fragment":"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif","envmap_pars_fragment":"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif","envmap_pars_vertex":"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif","envmap_physical_pars_fragment":"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif","envmap_vertex":"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif","fog_vertex":"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif","fog_pars_vertex":"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif","fog_fragment":"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif","fog_pars_fragment":"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif","gradientmap_pars_fragment":"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}","lightmap_fragment":"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif","lightmap_pars_fragment":"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif","lights_lambert_vertex":"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif","lights_pars_begin":"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif","lights_toon_fragment":"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;","lights_toon_pars_fragment":"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)","lights_phong_fragment":"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;","lights_phong_pars_fragment":"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)","lights_physical_fragment":"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",
"lights_physical_pars_fragment":"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}","lights_fragment_begin":"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif","lights_fragment_maps":"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif","lights_fragment_end":"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif","logdepthbuf_fragment":"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif","logdepthbuf_pars_fragment":"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif","logdepthbuf_pars_vertex":"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif","logdepthbuf_vertex":"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif","map_fragment":"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif","map_pars_fragment":"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif","map_particle_fragment":"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif","map_particle_pars_fragment":"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif","metalnessmap_fragment":"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif","metalnessmap_pars_fragment":"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif","morphnormal_vertex":"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif","morphtarget_pars_vertex":"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif","morphtarget_vertex":"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif","normal_fragment_begin":"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;","normal_fragment_maps":"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif","normalmap_pars_fragment":"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif","clearcoat_normal_fragment_begin":"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif","clearcoat_normal_fragment_maps":"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif","clearcoat_pars_fragment":"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif","packing":"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}","premultiplied_alpha_fragment":"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif","project_vertex":"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;","dithering_fragment":"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif","dithering_pars_fragment":"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif","roughnessmap_fragment":"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif","roughnessmap_pars_fragment":"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif","shadowmap_pars_fragment":"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif","shadowmap_pars_vertex":"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",
"shadowmap_vertex":"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif","shadowmask_pars_fragment":"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}","skinbase_vertex":"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif","skinning_pars_vertex":"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif","skinning_vertex":"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif","skinnormal_vertex":"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif","specularmap_fragment":"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif","specularmap_pars_fragment":"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif","tonemapping_fragment":"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif","tonemapping_pars_fragment":"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }","transmissionmap_fragment":"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif","transmissionmap_pars_fragment":"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif","uv_pars_fragment":"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif","uv_pars_vertex":"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif","uv_vertex":"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif","uv2_pars_fragment":"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif","uv2_pars_vertex":"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif","uv2_vertex":"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif","worldpos_vertex":"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif","background_frag":"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}","background_vert":"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}","cube_frag":"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}","cube_vert":"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}","depth_frag":"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}","depth_vert":"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}","distanceRGBA_frag":"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}","distanceRGBA_vert":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}","equirect_frag":"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}","equirect_vert":"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}","linedashed_frag":"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}","linedashed_vert":"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}","meshbasic_frag":"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","meshbasic_vert":"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}","meshlambert_frag":"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","meshlambert_vert":"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}","meshmatcap_frag":"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","meshmatcap_vert":"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}","meshtoon_frag":"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","meshtoon_vert":"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}","meshphong_frag":"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","meshphong_vert":"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",
"meshphysical_frag":"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <transmissionmap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","meshphysical_vert":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}","normal_frag":"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}","normal_vert":"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}","points_frag":"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}","points_vert":"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}","shadow_frag":"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}","shadow_vert":"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}","sprite_frag":"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}","sprite_vert":"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Cu={"common":{"diffuse":{"value":new kh(15658734)},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"value":new gl},"uv2Transform":{"value":new gl},"alphaMap":{"value":null}},"specularmap":{"specularMap":{"value":null}},"envmap":{"envMap":{"value":null},"flipEnvMap":{"value":-1},"reflectivity":{"value":1},"refractionRatio":{"value":.98},"maxMipLevel":{"value":0}},"aomap":{"aoMap":{"value":null},"aoMapIntensity":{"value":1}},"lightmap":{"lightMap":{"value":null},"lightMapIntensity":{"value":1}},"emissivemap":{"emissiveMap":{"value":null}},"bumpmap":{"bumpMap":{"value":null},"bumpScale":{"value":1}},"normalmap":{"normalMap":{"value":null},"normalScale":{"value":new ml(1,1)}},"displacementmap":{"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0}},"roughnessmap":{"roughnessMap":{"value":null}},"metalnessmap":{"metalnessMap":{"value":null}},"gradientmap":{"gradientMap":{"value":null}},"fog":{"fogDensity":{"value":25e-5},"fogNear":{"value":1},"fogFar":{"value":2e3},"fogColor":{"value":new kh(16777215)}},"lights":{"ambientLightColor":{"value":[]},"lightProbe":{"value":[]},"directionalLights":{"value":[],"properties":{"direction":{},"color":{}}},"directionalLightShadows":{"value":[],"properties":{"shadowBias":{},"shadowNormalBias":{},"shadowRadius":{},"shadowMapSize":{}}},"directionalShadowMap":{"value":[]},"directionalShadowMatrix":{"value":[]},"spotLights":{"value":[],"properties":{"color":{},"position":{},"direction":{},"distance":{},"coneCos":{},"penumbraCos":{},"decay":{}}},"spotLightShadows":{"value":[],"properties":{"shadowBias":{},"shadowNormalBias":{},"shadowRadius":{},"shadowMapSize":{}}},"spotShadowMap":{"value":[]},"spotShadowMatrix":{"value":[]},"pointLights":{"value":[],"properties":{"color":{},"position":{},"decay":{},"distance":{}}},"pointLightShadows":{"value":[],"properties":{"shadowBias":{},"shadowNormalBias":{},"shadowRadius":{},"shadowMapSize":{},"shadowCameraNear":{},"shadowCameraFar":{}}},"pointShadowMap":{"value":[]},"pointShadowMatrix":{"value":[]},"hemisphereLights":{"value":[],"properties":{"direction":{},"skyColor":{},"groundColor":{}}},"rectAreaLights":{"value":[],"properties":{"color":{},"position":{},"width":{},"height":{}}},"ltc_1":{"value":null},"ltc_2":{"value":null}},"points":{"diffuse":{"value":new kh(15658734)},"opacity":{"value":1},"size":{"value":1},"scale":{"value":1},"map":{"value":null},"alphaMap":{"value":null},"uvTransform":{"value":new gl}},"sprite":{"diffuse":{"value":new kh(15658734)},"opacity":{"value":1},"center":{"value":new ml(.5,.5)},"rotation":{"value":0},"map":{"value":null},"alphaMap":{"value":null},"uvTransform":{"value":new gl}}},Ou={"basic":{"uniforms":O([Cu.common,Cu.specularmap,Cu.envmap,Cu.aomap,Cu.lightmap,Cu.fog]),"vertexShader":Pu.meshbasic_vert,"fragmentShader":Pu.meshbasic_frag},"lambert":{"uniforms":O([Cu.common,Cu.specularmap,Cu.envmap,Cu.aomap,Cu.lightmap,Cu.emissivemap,Cu.fog,Cu.lights,{"emissive":{"value":new kh(0)}}]),"vertexShader":Pu.meshlambert_vert,"fragmentShader":Pu.meshlambert_frag},"phong":{"uniforms":O([Cu.common,Cu.specularmap,Cu.envmap,Cu.aomap,Cu.lightmap,Cu.emissivemap,Cu.bumpmap,Cu.normalmap,Cu.displacementmap,Cu.fog,Cu.lights,{"emissive":{"value":new kh(0)},"specular":{"value":new kh(1118481)},"shininess":{"value":30}}]),"vertexShader":Pu.meshphong_vert,"fragmentShader":Pu.meshphong_frag},"standard":{"uniforms":O([Cu.common,Cu.envmap,Cu.aomap,Cu.lightmap,Cu.emissivemap,Cu.bumpmap,Cu.normalmap,Cu.displacementmap,Cu.roughnessmap,Cu.metalnessmap,Cu.fog,Cu.lights,{"emissive":{"value":new kh(0)},"roughness":{"value":1},"metalness":{"value":0},"envMapIntensity":{"value":1}}]),"vertexShader":Pu.meshphysical_vert,"fragmentShader":Pu.meshphysical_frag},"toon":{"uniforms":O([Cu.common,Cu.aomap,Cu.lightmap,Cu.emissivemap,Cu.bumpmap,Cu.normalmap,Cu.displacementmap,Cu.gradientmap,Cu.fog,Cu.lights,{"emissive":{"value":new kh(0)}}]),"vertexShader":Pu.meshtoon_vert,"fragmentShader":Pu.meshtoon_frag},"matcap":{"uniforms":O([Cu.common,Cu.bumpmap,Cu.normalmap,Cu.displacementmap,Cu.fog,{"matcap":{"value":null}}]),"vertexShader":Pu.meshmatcap_vert,"fragmentShader":Pu.meshmatcap_frag},"points":{"uniforms":O([Cu.points,Cu.fog]),"vertexShader":Pu.points_vert,"fragmentShader":Pu.points_frag},"dashed":{"uniforms":O([Cu.common,Cu.fog,{"scale":{"value":1},"dashSize":{"value":1},"totalSize":{"value":2}}]),"vertexShader":Pu.linedashed_vert,"fragmentShader":Pu.linedashed_frag},"depth":{"uniforms":O([Cu.common,Cu.displacementmap]),"vertexShader":Pu.depth_vert,"fragmentShader":Pu.depth_frag},"normal":{"uniforms":O([Cu.common,Cu.bumpmap,Cu.normalmap,Cu.displacementmap,{"opacity":{"value":1}}]),"vertexShader":Pu.normal_vert,"fragmentShader":Pu.normal_frag},"sprite":{"uniforms":O([Cu.sprite,Cu.fog]),"vertexShader":Pu.sprite_vert,"fragmentShader":Pu.sprite_frag},"background":{"uniforms":{"uvTransform":{"value":new gl},"t2D":{"value":null}},"vertexShader":Pu.background_vert,"fragmentShader":Pu.background_frag},"cube":{"uniforms":O([Cu.envmap,{"opacity":{"value":1}}]),"vertexShader":Pu.cube_vert,"fragmentShader":Pu.cube_frag},"equirect":{"uniforms":{"tEquirect":{"value":null}},"vertexShader":Pu.equirect_vert,"fragmentShader":Pu.equirect_frag},"distanceRGBA":{"uniforms":O([Cu.common,Cu.displacementmap,{"referencePosition":{"value":new Tl},"nearDistance":{"value":1},"farDistance":{"value":1e3}}]),"vertexShader":Pu.distanceRGBA_vert,"fragmentShader":Pu.distanceRGBA_frag},"shadow":{"uniforms":O([Cu.lights,Cu.fog,{"color":{"value":new kh(0)},"opacity":{"value":1}}]),"vertexShader":Pu.shadow_vert,"fragmentShader":Pu.shadow_frag}};Ou.physical={"uniforms":O([Ou.standard.uniforms,{"clearcoat":{"value":0},"clearcoatMap":{"value":null},"clearcoatRoughness":{"value":0},"clearcoatRoughnessMap":{"value":null},"clearcoatNormalScale":{"value":new ml(1,1)},"clearcoatNormalMap":{"value":null},"sheen":{"value":new kh(0)},"transmission":{"value":0},"transmissionMap":{"value":null}}]),"vertexShader":Pu.meshphysical_vert,"fragmentShader":Pu.meshphysical_frag},rt.prototype=Object.create(n.prototype),rt.prototype.constructor=rt,rt.prototype.isCubeTexture=!0,Object.defineProperty(rt.prototype,"images",{"get":function(){return this.image},"set":function(t){this.image=t}}),it.prototype=Object.create(n.prototype),it.prototype.constructor=it,it.prototype.isDataTexture2DArray=!0,at.prototype=Object.create(n.prototype),at.prototype.constructor=at,at.prototype.isDataTexture3D=!0;var Iu=new n,Du=new it,Nu=new at,Bu=new rt,zu=[],Gu=[],Fu=new Float32Array(16),Uu=new Float32Array(9),Hu=new Float32Array(4);kt.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),ct(e,t)},Vt.prototype.setValue=function(t,e,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(t,e[o.id],n)}};var ku=/([\w\d_]+)(\])?(\[|\.)?/g;qt.prototype.setValue=function(t,e,n,r){var i=this.map[e];void 0!==i&&i.setValue(t,n,r)},qt.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},qt.upload=function(t,e,n,r){for(var i=0,a=e.length;i!==a;++i){var o=e[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,r)}},qt.seqWithValue=function(t,e){for(var n=[],r=0,i=t.length;r!==i;++r){var a=t[r];a.id in e&&n.push(a)}return n};var Vu=0,ju=/^[ \t]*#include +<([\w\d.\/]+)>/gm,Wu=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,qu=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g,Xu=0;Re.prototype=Object.create(u.prototype),Re.prototype.constructor=Re,Re.prototype.isMeshDepthMaterial=!0,Re.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Pe.prototype=Object.create(u.prototype),Pe.prototype.constructor=Pe,Pe.prototype.isMeshDistanceMaterial=!0,Pe.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};var Yu="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",Zu="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";Ne.prototype=Object.assign(Object.create(N.prototype),{"constructor":Ne,"isArrayCamera":!0}),Be.prototype=Object.assign(Object.create(s.prototype),{"constructor":Be,"isGroup":!0}),Object.assign(ze.prototype,{"constructor":ze,"getHandSpace":function(){if(null===this._hand&&(this._hand=new Be,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={"pinching":!1},window.XRHand))for(var t=0;t<=window.XRHand.LITTLE_PHALANX_TIP;t++){var e=new Be;e.matrixAutoUpdate=!1,e.visible=!1,this._hand.joints.push(e),this._hand.add(e)}return this._hand},"getTargetRaySpace":function(){return null===this._targetRay&&(this._targetRay=new Be,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},"getGripSpace":function(){return null===this._grip&&(this._grip=new Be,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},"dispatchEvent":function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},"disconnect":function(t){return this.dispatchEvent({"type":"disconnected","data":t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},"update":function(t,e,n){var r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(t)if(c&&t.hand){a=!0;for(var l=0;l<=window.XRHand.LITTLE_PHALANX_TIP;l++)if(t.hand[l]){var h=e.getJointPose(t.hand[l],n),u=c.joints[l];null!==h&&(u.matrix.fromArray(h.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.jointRadius=h.radius),u.visible=null!==h;var p=c.joints[window.XRHand.INDEX_PHALANX_TIP],d=c.joints[window.XRHand.THUMB_PHALANX_TIP],f=p.position.distanceTo(d.position);c.inputState.pinching&&f>.025?(c.inputState.pinching=!1,this.dispatchEvent({"type":"pinchend","handedness":t.handedness,"target":this})):!c.inputState.pinching&&f<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({"type":"pinchstart","handedness":t.handedness,"target":this}))}}else null!==o&&null!==(r=e.getPose(t.targetRaySpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==s&&t.gripSpace&&null!==(i=e.getPose(t.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale));return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==c&&(c.visible=null!==a),this}}),Object.assign(Ge.prototype,e.prototype),He.prototype=Object.assign(Object.create(Ue.prototype),{"constructor":He,"isWebGL1Renderer":!0});var Ju=function(t,e){Object.defineProperty(this,"isFogExp2",{"value":!0}),this.name="",this.color=new kh(t),this.density=void 0!==e?e:25e-5};Ju.prototype.clone=function(){return new Ju(this.color,this.density)},Ju.prototype.toJSON=function(){return{"type":"FogExp2","color":this.color.getHex(),"density":this.density}};var Qu=function(t,e,n){Object.defineProperty(this,"isFog",{"value":!0}),this.name="",this.color=new kh(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3};Qu.prototype.clone=function(){return new Qu(this.color,this.near,this.far)},Qu.prototype.toJSON=function(){return{"type":"Fog","color":this.color.getHex(),"near":this.near,"far":this.far}},ke.prototype=Object.create(s.prototype),ke.prototype.constructor=ke,ke.prototype.copy=function(t,e){return s.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},ke.prototype.toJSON=function(t){var e=s.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},Object.defineProperty(Ve.prototype,"needsUpdate",{"set":function(t){!0===t&&this.version++}}),Object.assign(Ve.prototype,{"isInterleavedBuffer":!0,"onUploadCallback":function(){},"setUsage":function(t){return this.usage=t,this},"copy":function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},"copyAt":function(t,e,n){t*=this.stride,n*=e.stride;for(var r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this},"set":function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},"clone":function(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=fl.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new Ve(e,this.stride);return n.setUsage(this.usage),n},"onUpload":function(t){return this.onUploadCallback=t,this},"toJSON":function(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=fl.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{"uuid":this.uuid,"buffer":this.array.buffer._uuid,"type":this.array.constructor.name,"stride":this.stride}}});var Ku=new Tl;Object.defineProperties(je.prototype,{"count":{"get":function(){return this.data.count}},"array":{"get":function(){return this.data.array}},"needsUpdate":{"set":function(t){this.data.needsUpdate=t}}}),Object.assign(je.prototype,{"isInterleavedBufferAttribute":!0,"applyMatrix4":function(t){for(var e=0,n=this.data.count;e<n;e++)Ku.x=this.getX(e),Ku.y=this.getY(e),Ku.z=this.getZ(e),Ku.applyMatrix4(t),this.setXYZ(e,Ku.x,Ku.y,Ku.z);return this},"setX":function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},"setY":function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},"setZ":function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},"setW":function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},"getX":function(t){return this.data.array[t*this.data.stride+this.offset]},"getY":function(t){return this.data.array[t*this.data.stride+this.offset+1]},"getZ":function(t){return this.data.array[t*this.data.stride+this.offset+2]},"getW":function(t){return this.data.array[t*this.data.stride+this.offset+3]},"setXY":function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},"setXYZ":function(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this},"setXYZW":function(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this},"clone":function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)e.push(this.data.array[r+i]);return new d(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new je(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},"toJSON":function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)e.push(this.data.array[r+i]);return{"itemSize":this.itemSize,"type":this.array.constructor.name,"array":e,"normalized":this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{"isInterleavedBufferAttribute":!0,"itemSize":this.itemSize,"data":this.data.uuid,"offset":this.offset,"normalized":this.normalized}}}),We.prototype=Object.create(u.prototype),We.prototype.constructor=We,We.prototype.isSpriteMaterial=!0,We.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var $u,tp=new Tl,ep=new Tl,np=new Tl,rp=new ml,ip=new ml,ap=new Kl,op=new Tl,sp=new Tl,cp=new Tl,lp=new ml,hp=new ml,up=new ml;qe.prototype=Object.assign(Object.create(s.prototype),{"constructor":qe,"isSprite":!0,"raycast":function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ep.setFromMatrixScale(this.matrixWorld),ap.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),np.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&ep.multiplyScalar(-np.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;Xe(op.set(-.5,-.5,0),np,a,ep,n,r),Xe(sp.set(.5,-.5,0),np,a,ep,n,r),Xe(cp.set(.5,.5,0),np,a,ep,n,r),lp.set(0,0),hp.set(1,0),up.set(1,1);var o=t.ray.intersectTriangle(op,sp,cp,!1,tp);if(null!==o||(Xe(sp.set(-.5,.5,0),np,a,ep,n,r),hp.set(0,1),null!==(o=t.ray.intersectTriangle(op,cp,sp,!1,tp)))){var s=t.ray.origin.distanceTo(tp);s<t.near||s>t.far||e.push({"distance":s,"point":tp.clone(),"uv":Gh.getUV(tp,op,sp,cp,lp,hp,up,new ml),"face":null,"object":this})}},"copy":function(t){return s.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});var pp=new Tl,dp=new Tl;Ye.prototype=Object.assign(Object.create(s.prototype),{"constructor":Ye,"isLOD":!0,"copy":function(t){s.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n<r;n++){var i=e[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=t.autoUpdate,this},"addLevel":function(t,e){void 0===e&&(e=0),e=Math.abs(e);var n,r=this.levels;for(n=0;n<r.length&&!(e<r[n].distance);n++);return r.splice(n,0,{"distance":e,"object":t}),this.add(t),this},"getCurrentLevel":function(){return this._currentLevel},"getObjectForDistance":function(t){var e=this.levels;if(e.length>0){var n,r;for(n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object}return null},"raycast":function(t,e){if(this.levels.length>0){pp.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(pp);this.getObjectForDistance(n).raycast(t,e)}},"update":function(t){var e=this.levels;if(e.length>1){pp.setFromMatrixPosition(t.matrixWorld),dp.setFromMatrixPosition(this.matrixWorld);var n=pp.distanceTo(dp)/t.zoom;e[0].object.visible=!0;var r,i;for(r=1,i=e.length;r<i&&n>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(this._currentLevel=r-1;r<i;r++)e[r].object.visible=!1}},"toJSON":function(t){var e=s.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];e.object.levels.push({"object":a.object.uuid,
"distance":a.distance})}return e}}),Ze.prototype=Object.assign(Object.create(T.prototype),{"constructor":Ze,"isSkinnedMesh":!0,"copy":function(t){return T.prototype.copy.call(this,t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this},"bind":function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},"pose":function(){this.skeleton.pose()},"normalizeSkinWeights":function(){for(var t=new _l,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},"updateMatrixWorld":function(t){T.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},"boneTransform":function(){var t=new Tl,e=new _l,n=new _l,r=new Tl,i=new Kl;return function(a,o){var s=this.skeleton,c=this.geometry;e.fromBufferAttribute(c.attributes.skinIndex,a),n.fromBufferAttribute(c.attributes.skinWeight,a),t.fromBufferAttribute(c.attributes.position,a).applyMatrix4(this.bindMatrix),o.set(0,0,0);for(var l=0;l<4;l++){var h=n.getComponent(l);if(0!==h){var u=e.getComponent(l);i.multiplyMatrices(s.bones[u].matrixWorld,s.boneInverses[u]),o.addScaledVector(r.copy(t).applyMatrix4(i),h)}}return o.applyMatrix4(this.bindMatrixInverse)}}()});var fp=new Kl,mp=new Kl;Object.assign(Je.prototype,{"calculateInverses":function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new Kl;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},"pose":function(){for(var t=0,e=this.bones.length;t<e;t++){var n=this.bones[t];n&&n.matrixWorld.getInverse(this.boneInverses[t])}for(var r=0,i=this.bones.length;r<i;r++){var a=this.bones[r];a&&(a.parent&&a.parent.isBone?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale))}},"update":function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=t.length;i<a;i++){var o=t[i]?t[i].matrixWorld:mp;fp.multiplyMatrices(o,e[i]),fp.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},"clone":function(){return new Je(this.bones,this.boneInverses)},"getBoneByName":function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}},"dispose":function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Qe.prototype=Object.assign(Object.create(s.prototype),{"constructor":Qe,"isBone":!0});var vp=new Kl,gp=new Kl,yp=[],xp=new T;Ke.prototype=Object.assign(Object.create(T.prototype),{"constructor":Ke,"isInstancedMesh":!0,"copy":function(t){return T.prototype.copy.call(this,t),this.instanceMatrix.copy(t.instanceMatrix),this.count=t.count,this},"setColorAt":function(t,e){null===this.instanceColor&&(this.instanceColor=new d(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)},"getMatrixAt":function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},"raycast":function(t,e){var n=this.matrixWorld,r=this.count;if(xp.geometry=this.geometry,xp.material=this.material,void 0!==xp.material)for(var i=0;i<r;i++){this.getMatrixAt(i,vp),gp.multiplyMatrices(n,vp),xp.matrixWorld=gp,xp.raycast(t,yp);for(var a=0,o=yp.length;a<o;a++){var s=yp[a];s.instanceId=i,s.object=this,e.push(s)}yp.length=0}},"setMatrixAt":function(t,e){e.toArray(this.instanceMatrix.array,16*t)},"updateMorphTargets":function(){}}),$e.prototype=Object.create(u.prototype),$e.prototype.constructor=$e,$e.prototype.isLineBasicMaterial=!0,$e.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this};var bp=new Tl,_p=new Tl,wp=new Kl,Mp=new Ql,Sp=new Vl;tn.prototype=Object.assign(Object.create(s.prototype),{"constructor":tn,"isLine":!0,"copy":function(t){return s.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},"computeLineDistances":function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],r=1,i=e.count;r<i;r++)bp.fromBufferAttribute(e,r-1),_p.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=bp.distanceTo(_p);t.setAttribute("lineDistance",new _(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices,o=t.lineDistances;o[0]=0;for(var s=1,c=a.length;s<c;s++)o[s]=o[s-1],o[s]+=a[s-1].distanceTo(a[s])}return this},"raycast":function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Sp.copy(n.boundingSphere),Sp.applyMatrix4(r),Sp.radius+=i,!1!==t.ray.intersectsSphere(Sp)){wp.getInverse(r),Mp.copy(t.ray).applyMatrix4(wp);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new Tl,c=new Tl,l=new Tl,h=new Tl,u=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var p=n.index,d=n.attributes,f=d.position.array;if(null!==p)for(var m=p.array,v=0,g=m.length-1;v<g;v+=u){var y=m[v],x=m[v+1];s.fromArray(f,3*y),c.fromArray(f,3*x);var b=Mp.distanceSqToSegment(s,c,h,l);if(!(b>o)){h.applyMatrix4(this.matrixWorld);var _=t.ray.origin.distanceTo(h);_<t.near||_>t.far||e.push({"distance":_,"point":l.clone().applyMatrix4(this.matrixWorld),"index":v,"face":null,"faceIndex":null,"object":this})}}else for(var w=0,M=f.length/3-1;w<M;w+=u){s.fromArray(f,3*w),c.fromArray(f,3*w+3);var S=Mp.distanceSqToSegment(s,c,h,l);if(!(S>o)){h.applyMatrix4(this.matrixWorld);var T=t.ray.origin.distanceTo(h);T<t.near||T>t.far||e.push({"distance":T,"point":l.clone().applyMatrix4(this.matrixWorld),"index":w,"face":null,"faceIndex":null,"object":this})}}}else if(n.isGeometry)for(var E=n.vertices,A=E.length,L=0;L<A-1;L+=u){var R=Mp.distanceSqToSegment(E[L],E[L+1],h,l);if(!(R>o)){h.applyMatrix4(this.matrixWorld);var P=t.ray.origin.distanceTo(h);P<t.near||P>t.far||e.push({"distance":P,"point":l.clone().applyMatrix4(this.matrixWorld),"index":L,"face":null,"faceIndex":null,"object":this})}}}},"updateMorphTargets":function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=r.length;i<a;i++){var o=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}else{var s=t.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var Tp=new Tl,Ep=new Tl;en.prototype=Object.assign(Object.create(tn.prototype),{"constructor":en,"isLineSegments":!0,"computeLineDistances":function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],r=0,i=e.count;r<i;r+=2)Tp.fromBufferAttribute(e,r),Ep.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Tp.distanceTo(Ep);t.setAttribute("lineDistance",new _(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry)for(var a=t.vertices,o=t.lineDistances,s=0,c=a.length;s<c;s+=2)Tp.copy(a[s]),Ep.copy(a[s+1]),o[s]=0===s?0:o[s-1],o[s+1]=o[s]+Tp.distanceTo(Ep);return this}}),nn.prototype=Object.assign(Object.create(tn.prototype),{"constructor":nn,"isLineLoop":!0}),rn.prototype=Object.create(u.prototype),rn.prototype.constructor=rn,rn.prototype.isPointsMaterial=!0,rn.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};var Ap=new Kl,Lp=new Ql,Rp=new Vl,Pp=new Tl;an.prototype=Object.assign(Object.create(s.prototype),{"constructor":an,"isPoints":!0,"copy":function(t){return s.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},"raycast":function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Rp.copy(n.boundingSphere),Rp.applyMatrix4(r),Rp.radius+=i,!1!==t.ray.intersectsSphere(Rp)){Ap.getInverse(r),Lp.copy(t.ray).applyMatrix4(Ap);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,c=n.attributes,l=c.position.array;if(null!==s)for(var h=s.array,u=0,p=h.length;u<p;u++){var d=h[u];Pp.fromArray(l,3*d),on(Pp,d,o,r,t,e,this)}else for(var f=0,m=l.length/3;f<m;f++)Pp.fromArray(l,3*f),on(Pp,f,o,r,t,e,this)}else for(var v=n.vertices,g=0,y=v.length;g<y;g++)on(v[g],g,o,r,t,e,this)}},"updateMorphTargets":function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,a=r.length;i<a;i++){var o=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}else{var s=t.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),sn.prototype=Object.assign(Object.create(n.prototype),{"constructor":sn,"isVideoTexture":!0,"update":function(){var t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),cn.prototype=Object.create(n.prototype),cn.prototype.constructor=cn,cn.prototype.isCompressedTexture=!0,ln.prototype=Object.create(n.prototype),ln.prototype.constructor=ln,ln.prototype.isCanvasTexture=!0,hn.prototype=Object.create(n.prototype),hn.prototype.constructor=hn,hn.prototype.isDepthTexture=!0,un.prototype=Object.create(S.prototype),un.prototype.constructor=un,pn.prototype=Object.create(L.prototype),pn.prototype.constructor=pn,dn.prototype=Object.create(S.prototype),dn.prototype.constructor=dn,fn.prototype=Object.create(L.prototype),fn.prototype.constructor=fn,mn.prototype=Object.create(S.prototype),mn.prototype.constructor=mn,vn.prototype=Object.create(L.prototype),vn.prototype.constructor=vn,gn.prototype=Object.create(mn.prototype),gn.prototype.constructor=gn,yn.prototype=Object.create(L.prototype),yn.prototype.constructor=yn,xn.prototype=Object.create(mn.prototype),xn.prototype.constructor=xn,bn.prototype=Object.create(L.prototype),bn.prototype.constructor=bn,_n.prototype=Object.create(mn.prototype),_n.prototype.constructor=_n,wn.prototype=Object.create(L.prototype),wn.prototype.constructor=wn,Mn.prototype=Object.create(mn.prototype),Mn.prototype.constructor=Mn,Sn.prototype=Object.create(L.prototype),Sn.prototype.constructor=Sn,Tn.prototype=Object.create(S.prototype),Tn.prototype.constructor=Tn,Tn.prototype.toJSON=function(){var t=S.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},En.prototype=Object.create(L.prototype),En.prototype.constructor=En,An.prototype=Object.create(S.prototype),An.prototype.constructor=An,Ln.prototype=Object.create(L.prototype),Ln.prototype.constructor=Ln,Rn.prototype=Object.create(S.prototype),Rn.prototype.constructor=Rn;var Cp={"triangulate":function(t,e,n){n=n||2;var r=e&&e.length,i=r?e[0]*n:t.length,a=Pn(t,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;var s,c,l,h,u,p,d;if(r&&(a=zn(t,e,a,n)),t.length>80*n){s=l=t[0],c=h=t[1];for(var f=n;f<i;f+=n)u=t[f],p=t[f+1],u<s&&(s=u),p<c&&(c=p),u>l&&(l=u),p>h&&(h=p);d=Math.max(l-s,h-c),d=0!==d?1/d:0}return On(a,o,n,s,c,d),o}},Op={"area":function(t){for(var e=t.length,n=0,r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},"isClockWise":function(t){return Op.area(t)<0},"triangulateShape":function(t,e){var n=[],r=[],i=[];sr(t),cr(n,t);var a=t.length;e.forEach(sr);for(var o=0;o<e.length;o++)r.push(a),a+=e[o].length,cr(n,e[o]);for(var s=Cp.triangulate(n,r),c=0;c<s.length;c+=3)i.push(s.slice(c,c+3));return i}};lr.prototype=Object.create(L.prototype),lr.prototype.constructor=lr,lr.prototype.toJSON=function(){var t=L.prototype.toJSON.call(this);return ur(this.parameters.shapes,this.parameters.options,t)},hr.prototype=Object.create(S.prototype),hr.prototype.constructor=hr,hr.prototype.toJSON=function(){var t=S.prototype.toJSON.call(this);return ur(this.parameters.shapes,this.parameters.options,t)};var Ip={"generateTopUV":function(t,e,n,r,i){var a=e[3*n],o=e[3*n+1],s=e[3*r],c=e[3*r+1],l=e[3*i],h=e[3*i+1];return[new ml(a,o),new ml(s,c),new ml(l,h)]},"generateSideWallUV":function(t,e,n,r,i,a){var o=e[3*n],s=e[3*n+1],c=e[3*n+2],l=e[3*r],h=e[3*r+1],u=e[3*r+2],p=e[3*i],d=e[3*i+1],f=e[3*i+2],m=e[3*a],v=e[3*a+1],g=e[3*a+2];return Math.abs(s-h)<.01?[new ml(o,1-c),new ml(l,1-u),new ml(p,1-f),new ml(m,1-g)]:[new ml(s,1-c),new ml(h,1-u),new ml(d,1-f),new ml(v,1-g)]}};pr.prototype=Object.create(L.prototype),pr.prototype.constructor=pr,dr.prototype=Object.create(hr.prototype),dr.prototype.constructor=dr,fr.prototype=Object.create(L.prototype),fr.prototype.constructor=fr,mr.prototype=Object.create(S.prototype),mr.prototype.constructor=mr,vr.prototype=Object.create(L.prototype),vr.prototype.constructor=vr,gr.prototype=Object.create(S.prototype),gr.prototype.constructor=gr,yr.prototype=Object.create(L.prototype),yr.prototype.constructor=yr,xr.prototype=Object.create(S.prototype),xr.prototype.constructor=xr,br.prototype=Object.create(L.prototype),br.prototype.constructor=br,br.prototype.toJSON=function(){var t=L.prototype.toJSON.call(this);return wr(this.parameters.shapes,t)},_r.prototype=Object.create(S.prototype),_r.prototype.constructor=_r,_r.prototype.toJSON=function(){var t=S.prototype.toJSON.call(this);return wr(this.parameters.shapes,t)},Mr.prototype=Object.create(S.prototype),Mr.prototype.constructor=Mr,Sr.prototype=Object.create(L.prototype),Sr.prototype.constructor=Sr,Tr.prototype=Object.create(S.prototype),Tr.prototype.constructor=Tr,Er.prototype=Object.create(Sr.prototype),Er.prototype.constructor=Er,Ar.prototype=Object.create(Tr.prototype),Ar.prototype.constructor=Ar,Lr.prototype=Object.create(L.prototype),Lr.prototype.constructor=Lr,Rr.prototype=Object.create(S.prototype),Rr.prototype.constructor=Rr;var Dp=Object.freeze({"__proto__":null,"WireframeGeometry":un,"ParametricGeometry":pn,"ParametricBufferGeometry":dn,"TetrahedronGeometry":vn,"TetrahedronBufferGeometry":gn,"OctahedronGeometry":yn,"OctahedronBufferGeometry":xn,"IcosahedronGeometry":bn,"IcosahedronBufferGeometry":_n,"DodecahedronGeometry":wn,"DodecahedronBufferGeometry":Mn,"PolyhedronGeometry":fn,"PolyhedronBufferGeometry":mn,"TubeGeometry":Sn,"TubeBufferGeometry":Tn,"TorusKnotGeometry":En,"TorusKnotBufferGeometry":An,"TorusGeometry":Ln,"TorusBufferGeometry":Rn,"TextGeometry":pr,"TextBufferGeometry":dr,"SphereGeometry":fr,"SphereBufferGeometry":mr,"RingGeometry":vr,"RingBufferGeometry":gr,"PlaneGeometry":H,"PlaneBufferGeometry":k,"LatheGeometry":yr,"LatheBufferGeometry":xr,"ShapeGeometry":br,"ShapeBufferGeometry":_r,"ExtrudeGeometry":lr,"ExtrudeBufferGeometry":hr,"EdgesGeometry":Mr,"ConeGeometry":Er,"ConeBufferGeometry":Ar,"CylinderGeometry":Sr,"CylinderBufferGeometry":Tr,"CircleGeometry":Lr,"CircleBufferGeometry":Rr,"BoxGeometry":R,"BoxBufferGeometry":P});Pr.prototype=Object.create(u.prototype),Pr.prototype.constructor=Pr,Pr.prototype.isShadowMaterial=!0,Pr.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this},Cr.prototype=Object.create(I.prototype),Cr.prototype.constructor=Cr,Cr.prototype.isRawShaderMaterial=!0,Or.prototype=Object.create(u.prototype),Or.prototype.constructor=Or,Or.prototype.isMeshStandardMaterial=!0,Or.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.defines={"STANDARD":""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},Ir.prototype=Object.create(Or.prototype),Ir.prototype.constructor=Ir,Ir.prototype.isMeshPhysicalMaterial=!0,Ir.prototype.copy=function(t){return Or.prototype.copy.call(this,t),this.defines={"STANDARD":"","PHYSICAL":""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new kh).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this},Dr.prototype=Object.create(u.prototype),Dr.prototype.constructor=Dr,Dr.prototype.isMeshPhongMaterial=!0,Dr.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Nr.prototype=Object.create(u.prototype),Nr.prototype.constructor=Nr,Nr.prototype.isMeshToonMaterial=!0,Nr.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Br.prototype=Object.create(u.prototype),Br.prototype.constructor=Br,Br.prototype.isMeshNormalMaterial=!0,Br.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},zr.prototype=Object.create(u.prototype),zr.prototype.constructor=zr,zr.prototype.isMeshLambertMaterial=!0,zr.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Gr.prototype=Object.create(u.prototype),Gr.prototype.constructor=Gr,Gr.prototype.isMeshMatcapMaterial=!0,Gr.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.defines={"MATCAP":""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Fr.prototype=Object.create($e.prototype),Fr.prototype.constructor=Fr,Fr.prototype.isLineDashedMaterial=!0,Fr.prototype.copy=function(t){return $e.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Np=Object.freeze({"__proto__":null,"ShadowMaterial":Pr,"SpriteMaterial":We,"RawShaderMaterial":Cr,"ShaderMaterial":I,"PointsMaterial":rn,"MeshPhysicalMaterial":Ir,"MeshStandardMaterial":Or,"MeshPhongMaterial":Dr,"MeshToonMaterial":Nr,"MeshNormalMaterial":Br,"MeshLambertMaterial":zr,"MeshDepthMaterial":Re,"MeshDistanceMaterial":Pe,"MeshBasicMaterial":p,"MeshMatcapMaterial":Gr,"LineDashedMaterial":Fr,"LineBasicMaterial":$e,"Material":u}),Bp={"arraySlice":function(t,e,n){return Bp.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},"convertArray":function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},"isTypedArray":function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},"getKeyframeOrder":function(t){function e(e,n){return t[e]-t[n]}for(var n=t.length,r=new Array(n),i=0;i!==n;++i)r[i]=i;return r.sort(e),r},"sortedArray":function(t,e,n){for(var r=t.length,i=new t.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*e,c=0;c!==e;++c)i[o++]=t[s+c];return i},"flattenJSON":function(t,e,n,r){for(var i=1,a=t[0];void 0!==a&&void 0===a[r];)a=t[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))do{o=a[r],void 0!==o&&(e.push(a.time),n.push.apply(n,o)),a=t[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[r],void 0!==o&&(e.push(a.time),o.toArray(n,n.length)),a=t[i++]}while(void 0!==a);else do{o=a[r],void 0!==o&&(e.push(a.time),n.push(o)),a=t[i++]}while(void 0!==a)}},"subclip":function(t,e,n,r,i){i=i||30;var a=t.clone();a.name=e;for(var o=[],s=0;s<a.tracks.length;++s){for(var c=a.tracks[s],l=c.getValueSize(),h=[],u=[],p=0;p<c.times.length;++p){var d=c.times[p]*i;if(!(d<n||d>=r)){h.push(c.times[p]);for(var f=0;f<l;++f)u.push(c.values[p*l+f])}}0!==h.length&&(c.times=Bp.convertArray(h,c.times.constructor),c.values=Bp.convertArray(u,c.values.constructor),o.push(c))}a.tracks=o;for(var m=1/0,v=0;v<a.tracks.length;++v)m>a.tracks[v].times[0]&&(m=a.tracks[v].times[0]);for(var g=0;g<a.tracks.length;++g)a.tracks[g].shift(-1*m);return a.resetDuration(),a},"makeClipAdditive":function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=t),(void 0===r||r<=0)&&(r=30);for(var i=t.tracks.length,a=e/r,o=0;o<i;++o)!function(e){var r=n.tracks[e],i=r.ValueTypeName;if("bool"!==i&&"string"!==i){var o=t.tracks.find(function(t){return t.name===r.name&&t.ValueTypeName===i});if(void 0!==o){var s=0,c=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=c/3);var l=0,h=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=h/3);var u=r.times.length-1,p=void 0;if(a<=r.times[0]){var d=s,f=c-s;p=Bp.arraySlice(r.values,d,f)}else if(a>=r.times[u]){var m=u*c+s,v=m+c-s;p=Bp.arraySlice(r.values,m,v)}else{var g=r.createInterpolant(),y=s,x=c-s;g.evaluate(a),p=Bp.arraySlice(g.resultBuffer,y,x)}if("quaternion"===i){(new Ml).fromArray(p).normalize().conjugate().toArray(p)}for(var b=o.times.length,_=0;_<b;++_){var w=_*h+l;if("quaternion"===i)Ml.multiplyQuaternionsFlat(o.values,w,p,0,o.values,w);else for(var M=h-2*l,S=0;S<M;++S)o.values[w+S]-=p[S]}}}}(o);return t.blendMode=2501,t}};Object.assign(Ur.prototype,{"evaluate":function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var a;n:{r:if(!(t<r)){for(var o=n+2;;){if(void 0===r){if(t<i)break r;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===o)break;if(i=r,r=e[++n],t<r)break e}a=e.length;break n}{if(t>=i)break t;var s=e[1];t<s&&(n=2,i=s);for(var c=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===c)break;if(r=i,i=e[--n-1],t>=i)break e}a=n,n=0}}for(;n<a;){var l=n+a>>>1;t<e[l]?a=l:n=l+1}if(r=e[n],void 0===(i=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)},"settings":null,"DefaultSettings_":{},"getSettings_":function(){return this.settings||this.DefaultSettings_},"copySampleValue_":function(t){for(var e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r,a=0;a!==r;++a)e[a]=n[i+a];return e},"interpolate_":function(){throw new Error("call to abstract method")},"intervalChanged_":function(){}}),Object.assign(Ur.prototype,{"beforeStart_":Ur.prototype.copySampleValue_,"afterEnd_":Ur.prototype.copySampleValue_}),Hr.prototype=Object.assign(Object.create(Ur.prototype),{"constructor":Hr,"DefaultSettings_":{"endingStart":2400,"endingEnd":2400},"intervalChanged_":function(t,e,n){var r=this.parameterPositions,i=t-2,a=t+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:i=t,o=2*e-n;break;case 2402:i=r.length-2,o=e+r[i]-r[i+1];break;default:i=t,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=t,s=2*n-e;break;case 2402:a=1,s=n+r[1]-r[0];break;default:a=t-1,s=e}var c=.5*(n-e),l=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l},"interpolate_":function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,l=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(n-e)/(r-e),f=d*d,m=f*d,v=-u*m+2*u*f-u*d,g=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,b=0;b!==o;++b)i[b]=v*a[l+b]+g*a[c+b]+y*a[s+b]+x*a[h+b];return i}}),kr.prototype=Object.assign(Object.create(Ur.prototype),{"constructor":kr,"interpolate_":function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,l=(n-e)/(r-e),h=1-l,u=0;u!==o;++u)i[u]=a[c+u]*h+a[s+u]*l;return i}}),Vr.prototype=Object.assign(Object.create(Ur.prototype),{"constructor":Vr,"interpolate_":function(t){return this.copySampleValue_(t-1)}}),Object.assign(jr,{"toJSON":function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={"name":t.name,"times":Bp.convertArray(t.times,Array),"values":Bp.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e}}),Object.assign(jr.prototype,{"constructor":jr,"TimeBufferType":Float32Array,"ValueBufferType":Float32Array,"DefaultInterpolation":2301,"InterpolantFactoryMethodDiscrete":function(t){return new Vr(this.times,this.values,this.getValueSize(),t)},"InterpolantFactoryMethodLinear":function(t){return new kr(this.times,this.values,this.getValueSize(),t)},"InterpolantFactoryMethodSmooth":function(t){return new Hr(this.times,this.values,this.getValueSize(),t)},"setInterpolation":function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this},"getInterpolation":function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},"getValueSize":function(){return this.values.length/this.times.length},"shift":function(t){if(0!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]+=t;return this},"scale":function(t){if(1!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]*=t;return this},"trim":function(t,e){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<t;)++i;for(;-1!==a&&n[a]>e;)--a;if(++a,0!==i||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);var o=this.getValueSize();this.times=Bp.arraySlice(n,i,a),this.values=Bp.arraySlice(this.values,i*o,a*o)}return this},"validate":function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==r&&Bp.isTypedArray(r))for(var c=0,l=r.length;c!==l;++c){var h=r[c];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,h),t=!1;break}}return t},"optimize":function(){for(var t=Bp.arraySlice(this.times),e=Bp.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=t.length-1,a=1,o=1;o<i;++o){var s=!1,c=t[o];if(c!==t[o+1]&&(1!==o||c!==c[0]))if(r)s=!0;else for(var l=o*n,h=l-n,u=l+n,p=0;p!==n;++p){var d=e[l+p];if(d!==e[h+p]||d!==e[u+p]){s=!0;break}}if(s){if(o!==a){t[a]=t[o];for(var f=o*n,m=a*n,v=0;v!==n;++v)e[m+v]=e[f+v]}++a}}if(i>0){t[a]=t[i];for(var g=i*n,y=a*n,x=0;x!==n;++x)e[y+x]=e[g+x];++a}return a!==t.length?(this.times=Bp.arraySlice(t,0,a),this.values=Bp.arraySlice(e,0,a*n)):(this.times=t,this.values=e),this},"clone":function(){var t=Bp.arraySlice(this.times,0),e=Bp.arraySlice(this.values,0),n=this.constructor,r=new n(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}),Wr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Wr,"ValueTypeName":"bool","ValueBufferType":Array,"DefaultInterpolation":2300,"InterpolantFactoryMethodLinear":void 0,"InterpolantFactoryMethodSmooth":void 0}),
qr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":qr,"ValueTypeName":"color"}),Xr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Xr,"ValueTypeName":"number"}),Yr.prototype=Object.assign(Object.create(Ur.prototype),{"constructor":Yr,"interpolate_":function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-e)/(r-e),c=t*o,l=c+o;c!==l;c+=4)Ml.slerpFlat(i,0,a,c-o,a,c,s);return i}}),Zr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Zr,"ValueTypeName":"quaternion","DefaultInterpolation":2301,"InterpolantFactoryMethodLinear":function(t){return new Yr(this.times,this.values,this.getValueSize(),t)},"InterpolantFactoryMethodSmooth":void 0}),Jr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Jr,"ValueTypeName":"string","ValueBufferType":Array,"DefaultInterpolation":2300,"InterpolantFactoryMethodLinear":void 0,"InterpolantFactoryMethodSmooth":void 0}),Qr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Qr,"ValueTypeName":"vector"}),Object.assign(Kr,{"parse":function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,a=n.length;i!==a;++i)e.push(ti(n[i]).scale(r));return new Kr(t.name,t.duration,e,t.blendMode)},"toJSON":function(t){for(var e=[],n=t.tracks,r={"name":t.name,"duration":t.duration,"tracks":e,"uuid":t.uuid,"blendMode":t.blendMode},i=0,a=n.length;i!==a;++i)e.push(jr.toJSON(n[i]));return r},"CreateFromMorphTargetSequence":function(t,e,n,r){for(var i=e.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var l=Bp.getKeyframeOrder(s);s=Bp.sortedArray(s,1,l),c=Bp.sortedArray(c,1,l),r||0!==s[0]||(s.push(i),c.push(c[0])),a.push(new Xr(".morphTargetInfluences["+e[o].name+"]",s,c).scale(1/n))}return new Kr(t,-1,a)},"findByName":function(t,e){var n=t;if(!Array.isArray(t)){var r=t;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},"CreateClipsFromMorphTargetSequences":function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(i);if(c&&c.length>1){var l=c[1],h=r[l];h||(r[l]=h=[]),h.push(s)}}var u=[];for(var p in r)u.push(Kr.CreateFromMorphTargetSequence(p,r[p],e,n));return u},"parseAnimation":function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var a=[],o=[];Bp.flattenJSON(n,a,o,r),0!==a.length&&i.push(new t(e,a,o))}},r=[],i=t.name||"default",a=t.fps||30,o=t.blendMode,s=t.length||-1,c=t.hierarchy||[],l=0;l<c.length;l++){var h=c[l].keys;if(h&&0!==h.length)if(h[0].morphTargets){var u={},p=void 0;for(p=0;p<h.length;p++)if(h[p].morphTargets)for(var d=0;d<h[p].morphTargets.length;d++)u[h[p].morphTargets[d]]=-1;for(var f in u){for(var m=[],v=[],g=0;g!==h[p].morphTargets.length;++g){var y=h[p];m.push(y.time),v.push(y.morphTarget===f?1:0)}r.push(new Xr(".morphTargetInfluence["+f+"]",m,v))}s=u.length*(a||1)}else{var x=".bones["+e[l].name+"]";n(Qr,x+".position",h,"pos",r),n(Zr,x+".quaternion",h,"rot",r),n(Qr,x+".scale",h,"scl",r)}}return 0===r.length?null:new Kr(i,s,r,o)}}),Object.assign(Kr.prototype,{"resetDuration":function(){for(var t=this.tracks,e=0,n=0,r=t.length;n!==r;++n){var i=this.tracks[n];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this},"trim":function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},"validate":function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},"optimize":function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},"clone":function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new Kr(this.name,this.duration,t,this.blendMode)}});var zp={"enabled":!1,"files":{},"add":function(t,e){!1!==this.enabled&&(this.files[t]=e)},"get":function(t){if(!1!==this.enabled)return this.files[t]},"remove":function(t){delete this.files[t]},"clear":function(){this.files={}}},Gp=new ei;Object.assign(ni.prototype,{"load":function(){},"loadAsync":function(t,e){var n=this;return new Promise(function(r,i){n.load(t,r,e,i)})},"parse":function(){},"setCrossOrigin":function(t){return this.crossOrigin=t,this},"setPath":function(t){return this.path=t,this},"setResourcePath":function(t){return this.resourcePath=t,this},"setRequestHeader":function(t){return this.requestHeader=t,this}});var Fp={};ri.prototype=Object.assign(Object.create(ni.prototype),{"constructor":ri,"load":function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=zp.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;if(void 0!==Fp[t])return void Fp[t].push({"onLoad":e,"onProgress":n,"onError":r});var o,s=/^data:(.*?)(;base64)?,(.*)$/,c=t.match(s);if(c){var l=c[1],h=!!c[2],u=c[3];u=decodeURIComponent(u),h&&(u=atob(u));try{var p,d=(this.responseType||"").toLowerCase();switch(d){case"arraybuffer":case"blob":for(var f=new Uint8Array(u.length),m=0;m<u.length;m++)f[m]=u.charCodeAt(m);p="blob"===d?new Blob([f.buffer],{"type":l}):f.buffer;break;case"document":var v=new DOMParser;p=v.parseFromString(u,l);break;case"json":p=JSON.parse(u);break;default:p=u}setTimeout(function(){e&&e(p),i.manager.itemEnd(t)},0)}catch(e){setTimeout(function(){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)},0)}}else{Fp[t]=[],Fp[t].push({"onLoad":e,"onProgress":n,"onError":r}),o=new XMLHttpRequest,o.open("GET",t,!0),o.addEventListener("load",function(e){var n=this.response,r=Fp[t];if(delete Fp[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),zp.add(t,n);for(var a=0,o=r.length;a<o;a++){var s=r[a];s.onLoad&&s.onLoad(n)}i.manager.itemEnd(t)}else{for(var c=0,l=r.length;c<l;c++){var h=r[c];h.onError&&h.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}},!1),o.addEventListener("progress",function(e){for(var n=Fp[t],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(e)}},!1),o.addEventListener("error",function(e){var n=Fp[t];delete Fp[t];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)},!1),o.addEventListener("abort",function(e){var n=Fp[t];delete Fp[t];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)},!1),void 0!==this.responseType&&(o.responseType=this.responseType),void 0!==this.withCredentials&&(o.withCredentials=this.withCredentials),o.overrideMimeType&&o.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(var g in this.requestHeader)o.setRequestHeader(g,this.requestHeader[g]);o.send(null)}return i.manager.itemStart(t),o},"setResponseType":function(t){return this.responseType=t,this},"setWithCredentials":function(t){return this.withCredentials=t,this},"setMimeType":function(t){return this.mimeType=t,this}}),ii.prototype=Object.assign(Object.create(ni.prototype),{"constructor":ii,"load":function(t,e,n,r){var i=this,a=new ri(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.load(t,function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}},n,r)},"parse":function(t){for(var e=[],n=0;n<t.length;n++){var r=Kr.parse(t[n]);e.push(r)}return e}}),ai.prototype=Object.assign(Object.create(ni.prototype),{"constructor":ai,"load":function(t,e,n,r){var i=this,a=[],o=new cn;o.image=a;var s=new ri(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader);var c=0;if(Array.isArray(t))for(var l=0,h=t.length;l<h;++l)!function(l){s.load(t[l],function(t){var n=i.parse(t,!0);a[l]={"width":n.width,"height":n.height,"format":n.format,"mipmaps":n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(o.minFilter=Os),o.format=n.format,o.needsUpdate=!0,e&&e(o))},n,r)}(l);else s.load(t,function(t){var n=i.parse(t,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={"mipmaps":[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=Os),o.format=n.format,o.needsUpdate=!0,e&&e(o)},n,r);return o}}),oi.prototype=Object.assign(Object.create(ni.prototype),{"constructor":oi,"load":function(t,e,n,r){function i(){c.removeEventListener("load",i,!1),c.removeEventListener("error",a,!1),zp.add(t,this),e&&e(this),o.manager.itemEnd(t)}function a(e){c.removeEventListener("load",i,!1),c.removeEventListener("error",a,!1),r&&r(e),o.manager.itemError(t),o.manager.itemEnd(t)}void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var o=this,s=zp.get(t);if(void 0!==s)return o.manager.itemStart(t),setTimeout(function(){e&&e(s),o.manager.itemEnd(t)},0),s;var c=document.createElementNS("http://www.w3.org/1999/xhtml","img");return c.addEventListener("load",i,!1),c.addEventListener("error",a,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(c.crossOrigin=this.crossOrigin),o.manager.itemStart(t),c.src=t,c}}),si.prototype=Object.assign(Object.create(ni.prototype),{"constructor":si,"load":function(t,e,n,r){var i=new rt,a=new oi(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);for(var o=0,s=0;s<t.length;++s)!function(n){a.load(t[n],function(t){i.images[n]=t,6==++o&&(i.needsUpdate=!0,e&&e(i))},void 0,r)}(s);return i}}),ci.prototype=Object.assign(Object.create(ni.prototype),{"constructor":ci,"load":function(t,e,n,r){var i=this,a=new G,o=new ri(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.load(t,function(t){var n=i.parse(t);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:As,a.wrapT=void 0!==n.wrapT?n.wrapT:As,a.magFilter=void 0!==n.magFilter?n.magFilter:Os,a.minFilter=void 0!==n.minFilter?n.minFilter:Os,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=Ds),1===n.mipmapCount&&(a.minFilter=Os),a.needsUpdate=!0,e&&e(a,n))},n,r),a}}),li.prototype=Object.assign(Object.create(ni.prototype),{"constructor":li,"load":function(t,e,r,i){var a=new n,o=new oi(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(n){a.image=n;var r=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);a.format=r?Ys:Zs,a.needsUpdate=!0,void 0!==e&&e(a)},r,i),a}}),Object.assign(hi.prototype,{"getPoint":function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},"getPointAt":function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},"getPoints":function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},"getSpacedPoints":function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},"getLength":function(){var t=this.getLengths();return t[t.length-1]},"getLengths":function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n=[],r=this.getPoint(0),i=0;n.push(0);for(var a=1;a<=t;a++)e=this.getPoint(a/t),i+=e.distanceTo(r),n.push(i),r=e;return this.cacheArcLengths=n,n},"updateArcLengths":function(){this.needsUpdate=!0,this.getLengths()},"getUtoTmapping":function(t,e){var n,r=this.getLengths(),i=0,a=r.length;n=e||t*r[a-1];for(var o,s=0,c=a-1;s<=c;)if(i=Math.floor(s+(c-s)/2),(o=r[i]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(i=c,r[i]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},"getTangent":function(t,e){var n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),a=this.getPoint(r),o=e||(i.isVector2?new ml:new Tl);return o.copy(a).sub(i).normalize(),o},"getTangentAt":function(t,e){var n=this.getUtoTmapping(t);return this.getTangent(n,e)},"computeFrenetFrames":function(t,e){for(var n=new Tl,r=[],i=[],a=[],o=new Tl,s=new Kl,c=0;c<=t;c++){var l=c/t;r[c]=this.getTangentAt(l,new Tl),r[c].normalize()}i[0]=new Tl,a[0]=new Tl;var h=Number.MAX_VALUE,u=Math.abs(r[0].x),p=Math.abs(r[0].y),d=Math.abs(r[0].z);u<=h&&(h=u,n.set(1,0,0)),p<=h&&(h=p,n.set(0,1,0)),d<=h&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(var f=1;f<=t;f++){if(i[f]=i[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(r[f-1],r[f]),o.length()>Number.EPSILON){o.normalize();var m=Math.acos(fl.clamp(r[f-1].dot(r[f]),-1,1));i[f].applyMatrix4(s.makeRotationAxis(o,m))}a[f].crossVectors(r[f],i[f])}if(!0===e){var v=Math.acos(fl.clamp(i[0].dot(i[t]),-1,1));v/=t,r[0].dot(o.crossVectors(i[0],i[t]))>0&&(v=-v);for(var g=1;g<=t;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],v*g)),a[g].crossVectors(r[g],i[g])}return{"tangents":r,"normals":i,"binormals":a}},"clone":function(){return(new this.constructor).copy(this)},"copy":function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},"toJSON":function(){var t={"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},"fromJSON":function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),ui.prototype=Object.create(hi.prototype),ui.prototype.constructor=ui,ui.prototype.isEllipseCurve=!0,ui.prototype.getPoint=function(t,e){for(var n=e||new ml,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+t*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var l=Math.cos(this.aRotation),h=Math.sin(this.aRotation),u=s-this.aX,p=c-this.aY;s=u*l-p*h+this.aX,c=u*h+p*l+this.aY}return n.set(s,c)},ui.prototype.copy=function(t){return hi.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ui.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},ui.prototype.fromJSON=function(t){return hi.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},pi.prototype=Object.create(ui.prototype),pi.prototype.constructor=pi,pi.prototype.isArcCurve=!0;var Up=new Tl,Hp=new di,kp=new di,Vp=new di;fi.prototype=Object.create(hi.prototype),fi.prototype.constructor=fi,fi.prototype.isCatmullRomCurve3=!0,fi.prototype.getPoint=function(t,e){var n=e||new Tl,r=this.points,i=r.length,a=(i-(this.closed?0:1))*t,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:0===s&&o===i-1&&(o=i-2,s=1);var c,l;this.closed||o>0?c=r[(o-1)%i]:(Up.subVectors(r[0],r[1]).add(r[0]),c=Up);var h=r[o%i],u=r[(o+1)%i];if(this.closed||o+2<i?l=r[(o+2)%i]:(Up.subVectors(r[i-1],r[i-2]).add(r[i-1]),l=Up),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(c.distanceToSquared(h),p),f=Math.pow(h.distanceToSquared(u),p),m=Math.pow(u.distanceToSquared(l),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),Hp.initNonuniformCatmullRom(c.x,h.x,u.x,l.x,d,f,m),kp.initNonuniformCatmullRom(c.y,h.y,u.y,l.y,d,f,m),Vp.initNonuniformCatmullRom(c.z,h.z,u.z,l.z,d,f,m)}else"catmullrom"===this.curveType&&(Hp.initCatmullRom(c.x,h.x,u.x,l.x,this.tension),kp.initCatmullRom(c.y,h.y,u.y,l.y,this.tension),Vp.initCatmullRom(c.z,h.z,u.z,l.z,this.tension));return n.set(Hp.calc(s),kp.calc(s),Vp.calc(s)),n},fi.prototype.copy=function(t){hi.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},fi.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},fi.prototype.fromJSON=function(t){hi.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new Tl).fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ti.prototype=Object.create(hi.prototype),Ti.prototype.constructor=Ti,Ti.prototype.isCubicBezierCurve=!0,Ti.prototype.getPoint=function(t,e){var n=e||new ml,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Si(t,r.x,i.x,a.x,o.x),Si(t,r.y,i.y,a.y,o.y)),n},Ti.prototype.copy=function(t){return hi.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ti.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ti.prototype.fromJSON=function(t){return hi.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Ei.prototype=Object.create(hi.prototype),Ei.prototype.constructor=Ei,Ei.prototype.isCubicBezierCurve3=!0,Ei.prototype.getPoint=function(t,e){var n=e||new Tl,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Si(t,r.x,i.x,a.x,o.x),Si(t,r.y,i.y,a.y,o.y),Si(t,r.z,i.z,a.z,o.z)),n},Ei.prototype.copy=function(t){return hi.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ei.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ei.prototype.fromJSON=function(t){return hi.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Ai.prototype=Object.create(hi.prototype),Ai.prototype.constructor=Ai,Ai.prototype.isLineCurve=!0,Ai.prototype.getPoint=function(t,e){var n=e||new ml;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Ai.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Ai.prototype.getTangent=function(t,e){var n=e||new ml;return n.copy(this.v2).sub(this.v1).normalize(),n},Ai.prototype.copy=function(t){return hi.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ai.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ai.prototype.fromJSON=function(t){return hi.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Li.prototype=Object.create(hi.prototype),Li.prototype.constructor=Li,Li.prototype.isLineCurve3=!0,Li.prototype.getPoint=function(t,e){var n=e||new Tl;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Li.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Li.prototype.copy=function(t){return hi.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Li.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Li.prototype.fromJSON=function(t){return hi.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ri.prototype=Object.create(hi.prototype),Ri.prototype.constructor=Ri,Ri.prototype.isQuadraticBezierCurve=!0,Ri.prototype.getPoint=function(t,e){var n=e||new ml,r=this.v0,i=this.v1,a=this.v2;return n.set(xi(t,r.x,i.x,a.x),xi(t,r.y,i.y,a.y)),n},Ri.prototype.copy=function(t){return hi.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ri.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ri.prototype.fromJSON=function(t){return hi.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Pi.prototype=Object.create(hi.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isQuadraticBezierCurve3=!0,Pi.prototype.getPoint=function(t,e){var n=e||new Tl,r=this.v0,i=this.v1,a=this.v2;return n.set(xi(t,r.x,i.x,a.x),xi(t,r.y,i.y,a.y),xi(t,r.z,i.z,a.z)),n},Pi.prototype.copy=function(t){return hi.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Pi.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Pi.prototype.fromJSON=function(t){return hi.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ci.prototype=Object.create(hi.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isSplineCurve=!0,Ci.prototype.getPoint=function(t,e){var n=e||new ml,r=this.points,i=(r.length-1)*t,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],c=r[a],l=r[a>r.length-2?r.length-1:a+1],h=r[a>r.length-3?r.length-1:a+2];return n.set(mi(o,s.x,c.x,l.x,h.x),mi(o,s.y,c.y,l.y,h.y)),n},Ci.prototype.copy=function(t){hi.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this},Ci.prototype.toJSON=function(){var t=hi.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t},Ci.prototype.fromJSON=function(t){hi.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new ml).fromArray(r))}return this};var jp=Object.freeze({"__proto__":null,"ArcCurve":pi,"CatmullRomCurve3":fi,"CubicBezierCurve":Ti,"CubicBezierCurve3":Ei,"EllipseCurve":ui,"LineCurve":Ai,"LineCurve3":Li,"QuadraticBezierCurve":Ri,"QuadraticBezierCurve3":Pi,"SplineCurve":Ci});Oi.prototype=Object.assign(Object.create(hi.prototype),{"constructor":Oi,"add":function(t){this.curves.push(t)},"closePath":function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Ai(e,t))},"getPoint":function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=e){var i=n[r]-e,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},"getLength":function(){var t=this.getCurveLengths();return t[t.length-1]},"updateArcLengths":function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},"getCurveLengths":function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},"getSpacedPoints":function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},"getPoints":function(t){t=t||12;for(var e,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*t:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];e&&e.equals(l)||(n.push(l),e=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},"copy":function(t){hi.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this},"toJSON":function(){var t=hi.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var r=this.curves[e];t.curves.push(r.toJSON())}return t},"fromJSON":function(t){hi.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push((new jp[r.type]).fromJSON(r))}return this}}),Ii.prototype=Object.assign(Object.create(Oi.prototype),{"constructor":Ii,"setFromPoints":function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},"moveTo":function(t,e){return this.currentPoint.set(t,e),this},"lineTo":function(t,e){var n=new Ai(this.currentPoint.clone(),new ml(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},"quadraticCurveTo":function(t,e,n,r){var i=new Ri(this.currentPoint.clone(),new ml(t,e),new ml(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},"bezierCurveTo":function(t,e,n,r,i,a){var o=new Ti(this.currentPoint.clone(),new ml(t,e),new ml(n,r),new ml(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},"splineThru":function(t){var e=[this.currentPoint.clone()].concat(t),n=new Ci(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this},"arc":function(t,e,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,r,i,a),this},"absarc":function(t,e,n,r,i,a){return this.absellipse(t,e,n,n,r,i,a),this},"ellipse":function(t,e,n,r,i,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+c,e+l,n,r,i,a,o,s),this},"absellipse":function(t,e,n,r,i,a,o,s){var c=new ui(t,e,n,r,i,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var h=c.getPoint(1);return this.currentPoint.copy(h),this},"copy":function(t){return Oi.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},"toJSON":function(){var t=Oi.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},"fromJSON":function(t){return Oi.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Di.prototype=Object.assign(Object.create(Ii.prototype),{"constructor":Di,"getPointsHoles":function(t){for(var e=[],n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e},"extractPoints":function(t){return{"shape":this.getPoints(t),"holes":this.getPointsHoles(t)}},"copy":function(t){Ii.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push(r.clone())}return this},"toJSON":function(){var t=Ii.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var r=this.holes[e];t.holes.push(r.toJSON())}return t},"fromJSON":function(t){Ii.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push((new Ii).fromJSON(r))}return this}}),Ni.prototype=Object.assign(Object.create(s.prototype),{"constructor":Ni,"isLight":!0,"copy":function(t){return s.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},"toJSON":function(t){var e=s.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Bi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":Bi,"isHemisphereLight":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(zi.prototype,{"_projScreenMatrix":new Kl,"_lightPositionWorld":new Tl,"_lookTarget":new Tl,"getViewportCount":function(){return this._viewportCount},"getFrustum":function(){return this._frustum},"updateMatrices":function(t){var e=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(t.matrixWorld),e.position.copy(a),i.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(i),e.updateMatrixWorld(),r.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},"getViewport":function(t){return this._viewports[t]},"getFrameExtents":function(){return this._frameExtents},"copy":function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},"clone":function(){return(new this.constructor).copy(this)},"toJSON":function(){var t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Gi.prototype=Object.assign(Object.create(zi.prototype),{"constructor":Gi,"isSpotLightShadow":!0,"updateMatrices":function(t){var e=this.camera,n=2*fl.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix()),zi.prototype.updateMatrices.call(this,t)}}),Fi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":Fi,"isSpotLight":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Ui.prototype=Object.assign(Object.create(zi.prototype),{"constructor":Ui,"isPointLightShadow":!0,"updateMatrices":function(t,e){void 0===e&&(e=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(t.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),Hi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":Hi,"isPointLight":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),ki.prototype=Object.assign(Object.create(D.prototype),{"constructor":ki,"isOrthographicCamera":!0,"copy":function(t,e){return D.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},"setViewOffset":function(t,e,n,r,i,a){null===this.view&&(this.view={"enabled":!0,"fullWidth":1,"fullHeight":1,"offsetX":0,"offsetY":0,"width":1,"height":1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},"clearViewOffset":function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},"updateProjectionMatrix":function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-t,a=n+t,o=r+e,s=r-e;if(null!==this.view&&this.view.enabled){var c=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=c*this.view.offsetX,a=i+c*this.view.width,o-=l*this.view.offsetY,s=o-l*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},"toJSON":function(t){
var e=s.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Vi.prototype=Object.assign(Object.create(zi.prototype),{"constructor":Vi,"isDirectionalLightShadow":!0,"updateMatrices":function(t){zi.prototype.updateMatrices.call(this,t)}}),ji.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":ji,"isDirectionalLight":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Wi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":Wi,"isAmbientLight":!0}),qi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":qi,"isRectAreaLight":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},"toJSON":function(t){var e=Ni.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}});var Wp=function(){Object.defineProperty(this,"isSphericalHarmonics3",{"value":!0}),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new Tl)};Wp.prototype.set=function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},Wp.prototype.zero=function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},Wp.prototype.getAt=function(t,e){var n=t.x,r=t.y,i=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.282095),e.addScaledVector(a[1],.488603*r),e.addScaledVector(a[2],.488603*i),e.addScaledVector(a[3],.488603*n),e.addScaledVector(a[4],n*r*1.092548),e.addScaledVector(a[5],r*i*1.092548),e.addScaledVector(a[6],.315392*(3*i*i-1)),e.addScaledVector(a[7],n*i*1.092548),e.addScaledVector(a[8],.546274*(n*n-r*r)),e},Wp.prototype.getIrradianceAt=function(t,e){var n=t.x,r=t.y,i=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.886227),e.addScaledVector(a[1],1.023328*r),e.addScaledVector(a[2],1.023328*i),e.addScaledVector(a[3],1.023328*n),e.addScaledVector(a[4],.858086*n*r),e.addScaledVector(a[5],.858086*r*i),e.addScaledVector(a[6],.743125*i*i-.247708),e.addScaledVector(a[7],.858086*n*i),e.addScaledVector(a[8],.429043*(n*n-r*r)),e},Wp.prototype.add=function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},Wp.prototype.addScaledSH=function(t,e){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this},Wp.prototype.scale=function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},Wp.prototype.lerp=function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},Wp.prototype.equals=function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},Wp.prototype.copy=function(t){return this.set(t.coefficients)},Wp.prototype.clone=function(){return(new this.constructor).copy(this)},Wp.prototype.fromArray=function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this},Wp.prototype.toArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(t,e+3*r);return t},Wp.getBasisAt=function(t,e){var n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)},Xi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":Xi,"isLightProbe":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.sh.copy(t.sh),this},"fromJSON":function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},"toJSON":function(t){var e=Ni.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),Yi.prototype=Object.assign(Object.create(ni.prototype),{"constructor":Yi,"load":function(t,e,n,r){var i=this,a=new ri(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.load(t,function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}},n,r)},"parse":function(t){function e(t){return void 0===n[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),n[t]}var n=this.textures,r=new Np[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=(new kh).setHex(t.sheen)),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.vertexTangents&&(r.vertexTangents=t.vertexTangents),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=t.vertexColors>0:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var i in t.uniforms){var a=t.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=e(a.value);break;case"c":r.uniforms[i].value=(new kh).setHex(a.value);break;case"v2":r.uniforms[i].value=(new ml).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new Tl).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new _l).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new gl).fromArray(a.value);break;case"m4":r.uniforms[i].value=(new Kl).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)r.extensions[o]=t.extensions[o];if(void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=e(t.map)),void 0!==t.matcap&&(r.matcap=e(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=e(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new ml).fromArray(s)}return void 0!==t.displacementMap&&(r.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=e(t.specularMap)),void 0!==t.envMap&&(r.envMap=e(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=e(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=e(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=e(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=e(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new ml).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(r.transmission=t.transmission),void 0!==t.transmissionMap&&(r.transmissionMap=e(t.transmissionMap)),r},"setTextures":function(t){return this.textures=t,this}});var qp={"decodeText":function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}},"extractUrlBase":function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};Zi.prototype=Object.assign(Object.create(S.prototype),{"constructor":Zi,"isInstancedBufferGeometry":!0,"copy":function(t){return S.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},"clone":function(){return(new this.constructor).copy(this)},"toJSON":function(){var t=S.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),Ji.prototype=Object.assign(Object.create(d.prototype),{"constructor":Ji,"isInstancedBufferAttribute":!0,"copy":function(t){return d.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},"toJSON":function(){var t=d.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),Qi.prototype=Object.assign(Object.create(ni.prototype),{"constructor":Qi,"load":function(t,e,n,r){var i=this,a=new ri(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.load(t,function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}},n,r)},"parse":function(t){function e(t,e){if(void 0!==r[e])return r[e];var i=t.interleavedBuffers,a=i[e],o=n(t,a.buffer),s=new Xp[a.type](o),c=new Ve(s,a.stride);return c.uuid=a.uuid,r[e]=c,c}function n(t,e){if(void 0!==i[e])return i[e];var n=t.arrayBuffers,r=n[e],a=new Uint32Array(r).buffer;return i[e]=a,a}var r={},i={},a=t.isInstancedBufferGeometry?new Zi:new S,o=t.data.index;if(void 0!==o){var s=new Xp[o.type](o.array);a.setIndex(new d(s,1))}var c=t.data.attributes;for(var l in c){var h=c[l],u=void 0;if(h.isInterleavedBufferAttribute){u=new je(e(t.data,h.data),h.itemSize,h.offset,h.normalized)}else{var p=new Xp[h.type](h.array);u=new(h.isInstancedBufferAttribute?Ji:d)(p,h.itemSize,h.normalized)}void 0!==h.name&&(u.name=h.name),a.setAttribute(l,u)}var f=t.data.morphAttributes;if(f)for(var m in f){for(var v=f[m],g=[],y=0,x=v.length;y<x;y++){var b=v[y],_=void 0;if(b.isInterleavedBufferAttribute){var w=e(t.data,b.data);_=new je(w,b.itemSize,b.offset,b.normalized)}else{var M=new Xp[b.type](b.array);_=new d(M,b.itemSize,b.normalized)}void 0!==b.name&&(_.name=b.name),g.push(_)}a.morphAttributes[m]=g}t.data.morphTargetsRelative&&(a.morphTargetsRelative=!0);var T=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==T)for(var E=0,A=T.length;E!==A;++E){var L=T[E];a.addGroup(L.start,L.count,L.materialIndex)}var R=t.data.boundingSphere;if(void 0!==R){var P=new Tl;void 0!==R.center&&P.fromArray(R.center),a.boundingSphere=new Vl(P,R.radius)}return t.name&&(a.name=t.name),t.userData&&(a.userData=t.userData),a}});var Xp={"Int8Array":Int8Array,"Uint8Array":Uint8Array,"Uint8ClampedArray":"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,"Int16Array":Int16Array,"Uint16Array":Uint16Array,"Int32Array":Int32Array,"Uint32Array":Uint32Array,"Float32Array":Float32Array,"Float64Array":Float64Array};Ki.prototype=Object.assign(Object.create(ni.prototype),{"constructor":Ki,"load":function(t,e,n,r){var i=this,a=""===this.path?qp.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||a;var o=new ri(i.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.load(t,function(n){var a=null;try{a=JSON.parse(n)}catch(e){return void 0!==r&&r(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var o=a.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())return void console.error("THREE.ObjectLoader: Can't load "+t);i.parse(a,e)},n,r)},"parse":function(t,e){var n=this.parseShape(t.shapes),r=this.parseGeometries(t.geometries,n),i=this.parseImages(t.images,function(){void 0!==e&&e(s)}),a=this.parseTextures(t.textures,i),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,r,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},"parseShape":function(t){var e={};if(void 0!==t)for(var n=0,r=t.length;n<r;n++){var i=(new Di).fromJSON(t[n]);e[i.uuid]=i}return e},"parseGeometries":function(t,e){var n,r={};if(void 0!==t)for(var i=new Qi,a=0,o=t.length;a<o;a++){var s=void 0,c=t[a];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Dp[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Dp[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Dp[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Dp[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Dp[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Dp[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Dp[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Dp[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Dp[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Dp[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"TubeGeometry":case"TubeBufferGeometry":s=new Dp[c.type]((new jp[c.path.type]).fromJSON(c.path),c.tubularSegments,c.radius,c.radialSegments,c.closed);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Dp[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Dp[c.type](c.vertices,c.indices,c.radius,c.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":n=[];for(var l=0,h=c.shapes.length;l<h;l++){var u=e[c.shapes[l]];n.push(u)}s=new Dp[c.type](n,c.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":n=[];for(var p=0,d=c.shapes.length;p<d;p++){var f=e[c.shapes[p]];n.push(f)}var m=c.options.extrudePath;void 0!==m&&(c.options.extrudePath=(new jp[m.type]).fromJSON(m)),s=new Dp[c.type](n,c.options);break;case"BufferGeometry":case"InstancedBufferGeometry":s=i.parse(c);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),!0===s.isBufferGeometry&&void 0!==c.userData&&(s.userData=c.userData),r[c.uuid]=s}return r},"parseMaterials":function(t,e){var n={},r={};if(void 0!==t){var i=new Yi;i.setTextures(e);for(var a=0,o=t.length;a<o;a++){var s=t[a];if("MultiMaterial"===s.type){for(var c=[],l=0;l<s.materials.length;l++){var h=s.materials[l];void 0===n[h.uuid]&&(n[h.uuid]=i.parse(h)),c.push(n[h.uuid])}r[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},"parseAnimations":function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i=Kr.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),e.push(i)}return e},"parseImages":function(t,e){function n(t){return i.manager.itemStart(t),r.load(t,function(){i.manager.itemEnd(t)},void 0,function(){i.manager.itemError(t),i.manager.itemEnd(t)})}var r,i=this,a={};if(void 0!==t&&t.length>0){var o=new ei(e);r=new oi(o),r.setCrossOrigin(this.crossOrigin);for(var s=0,c=t.length;s<c;s++){var l=t[s],h=l.url;if(Array.isArray(h)){a[l.uuid]=[];for(var u=0,p=h.length;u<p;u++){var d=h[u],f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:i.resourcePath+d;a[l.uuid].push(n(f))}}else{var m=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:i.resourcePath+l.url;a[l.uuid]=n(m)}}}return a},"parseTextures":function(t,e){function r(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var i={};if(void 0!==t)for(var a=0,o=t.length;a<o;a++){var s=t[a];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var c=void 0;c=Array.isArray(e[s.image])?new rt(e[s.image]):new n(e[s.image]),c.needsUpdate=!0,c.uuid=s.uuid,void 0!==s.name&&(c.name=s.name),void 0!==s.mapping&&(c.mapping=r(s.mapping,Yp)),void 0!==s.offset&&c.offset.fromArray(s.offset),void 0!==s.repeat&&c.repeat.fromArray(s.repeat),void 0!==s.center&&c.center.fromArray(s.center),void 0!==s.rotation&&(c.rotation=s.rotation),void 0!==s.wrap&&(c.wrapS=r(s.wrap[0],Zp),c.wrapT=r(s.wrap[1],Zp)),void 0!==s.format&&(c.format=s.format),void 0!==s.type&&(c.type=s.type),void 0!==s.encoding&&(c.encoding=s.encoding),void 0!==s.minFilter&&(c.minFilter=r(s.minFilter,Jp)),void 0!==s.magFilter&&(c.magFilter=r(s.magFilter,Jp)),void 0!==s.anisotropy&&(c.anisotropy=s.anisotropy),void 0!==s.flipY&&(c.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(c.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(c.unpackAlignment=s.unpackAlignment),i[s.uuid]=c}return i},"parseObject":function(t,e,n){function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function i(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],r=0,i=t.length;r<i;r++){var a=t[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),e.push(n[a])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}var a,o,c;switch(t.type){case"Scene":a=new ke,void 0!==t.background&&Number.isInteger(t.background)&&(a.background=new kh(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?a.fog=new Qu(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(a.fog=new Ju(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":a=new N(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(a.focus=t.focus),void 0!==t.zoom&&(a.zoom=t.zoom),void 0!==t.filmGauge&&(a.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(a.filmOffset=t.filmOffset),void 0!==t.view&&(a.view=Object.assign({},t.view));break;case"OrthographicCamera":a=new ki(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(a.zoom=t.zoom),void 0!==t.view&&(a.view=Object.assign({},t.view));break;case"AmbientLight":a=new Wi(t.color,t.intensity);break;case"DirectionalLight":a=new ji(t.color,t.intensity);break;case"PointLight":a=new Hi(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":a=new qi(t.color,t.intensity,t.width,t.height);break;case"SpotLight":a=new Fi(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":a=new Bi(t.color,t.groundColor,t.intensity);break;case"LightProbe":a=(new Xi).fromJSON(t);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":o=r(t.geometry),c=i(t.material),a=new T(o,c);break;case"InstancedMesh":o=r(t.geometry),c=i(t.material);var l=t.count,h=t.instanceMatrix;a=new Ke(o,c,l),a.instanceMatrix=new d(new Float32Array(h.array),16);break;case"LOD":a=new Ye;break;case"Line":a=new tn(r(t.geometry),i(t.material),t.mode);break;case"LineLoop":a=new nn(r(t.geometry),i(t.material));break;case"LineSegments":a=new en(r(t.geometry),i(t.material));break;case"PointCloud":case"Points":a=new an(r(t.geometry),i(t.material));break;case"Sprite":a=new qe(i(t.material));break;case"Group":a=new Be;break;default:a=new s}if(a.uuid=t.uuid,void 0!==t.name&&(a.name=t.name),void 0!==t.matrix?(a.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(a.matrixAutoUpdate=t.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==t.position&&a.position.fromArray(t.position),void 0!==t.rotation&&a.rotation.fromArray(t.rotation),void 0!==t.quaternion&&a.quaternion.fromArray(t.quaternion),void 0!==t.scale&&a.scale.fromArray(t.scale)),void 0!==t.castShadow&&(a.castShadow=t.castShadow),void 0!==t.receiveShadow&&(a.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(a.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(a.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(a.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&a.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(a.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(a.visible=t.visible),void 0!==t.frustumCulled&&(a.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(a.renderOrder=t.renderOrder),void 0!==t.userData&&(a.userData=t.userData),void 0!==t.layers&&(a.layers.mask=t.layers),void 0!==t.children)for(var u=t.children,p=0;p<u.length;p++)a.add(this.parseObject(u[p],e,n));if("LOD"===t.type){void 0!==t.autoUpdate&&(a.autoUpdate=t.autoUpdate);for(var f=t.levels,m=0;m<f.length;m++){var v=f[m],g=a.getObjectByProperty("uuid",v.object);void 0!==g&&a.addLevel(g,v.distance)}}return a}});var Yp={"UVMapping":300,"CubeReflectionMapping":bs,"CubeRefractionMapping":_s,"EquirectangularReflectionMapping":ws,"EquirectangularRefractionMapping":Ms,"CubeUVReflectionMapping":Ss,"CubeUVRefractionMapping":Ts},Zp={"RepeatWrapping":Es,"ClampToEdgeWrapping":As,"MirroredRepeatWrapping":Ls},Jp={"NearestFilter":Rs,"NearestMipmapNearestFilter":Ps,"NearestMipmapLinearFilter":Cs,"LinearFilter":Os,"LinearMipmapNearestFilter":Is,"LinearMipmapLinearFilter":Ds};$i.prototype=Object.assign(Object.create(ni.prototype),{"constructor":$i,"isImageBitmapLoader":!0,"setOptions":function(t){return this.options=t,this},"load":function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=zp.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;fetch(t).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,i.options)}).then(function(n){zp.add(t,n),e&&e(n),i.manager.itemEnd(t)}).catch(function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),i.manager.itemStart(t)}}),Object.assign(ta.prototype,{"moveTo":function(t,e){return this.currentPath=new Ii,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},"lineTo":function(t,e){return this.currentPath.lineTo(t,e),this},"quadraticCurveTo":function(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this},"bezierCurveTo":function(t,e,n,r,i,a){return this.currentPath.bezierCurveTo(t,e,n,r,i,a),this},"splineThru":function(t){return this.currentPath.splineThru(t),this},"toShapes":function(t,e){function n(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n],a=new Di;a.curves=i.curves,e.push(a)}return e}var r=Op.isClockWise,i=this.subPaths;if(0===i.length)return[];if(!0===e)return n(i);var a,o,s,c=[];if(1===i.length)return o=i[0],s=new Di,s.curves=o.curves,c.push(s),c;var l=!r(i[0].getPoints());l=t?!l:l;var h,u=[],p=[],d=[],f=0;p[f]=void 0,d[f]=[];for(var m=0,v=i.length;m<v;m++)o=i[m],h=o.getPoints(),a=r(h),a=t?!a:a,a?(!l&&p[f]&&f++,p[f]={"s":new Di,"p":h},p[f].s.curves=o.curves,l&&f++,d[f]=[]):d[f].push({"h":o,"p":h[0]});if(!p[0])return n(i);if(p.length>1){for(var g=!1,y=[],x=0,b=p.length;x<b;x++)u[x]=[];for(var _=0,w=p.length;_<w;_++)for(var M=d[_],S=0;S<M.length;S++){for(var T=M[S],E=!0,A=0;A<p.length;A++)(function(t,e){for(var n=e.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=e[i],s=e[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=e[a],c=-c,s=e[i],l=-l),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var h=l*(t.x-o.x)-c*(t.y-o.y);if(0===h)return!0;if(h<0)continue;r=!r}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return r})(T.p,p[A].p)&&(_!==A&&y.push({"froms":_,"tos":A,"hole":S}),E?(E=!1,u[A].push(T)):g=!0);E&&u[_].push(T)}y.length>0&&(g||(d=u))}for(var L,R=0,P=p.length;R<P;R++){s=p[R].s,c.push(s),L=d[R];for(var C=0,O=L.length;C<O;C++)s.holes.push(L[C].h)}return c}}),Object.assign(ea.prototype,{"isFont":!0,"generateShapes":function(t,e){void 0===e&&(e=100);for(var n=[],r=na(t,e,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),ia.prototype=Object.assign(Object.create(ni.prototype),{"constructor":ia,"load":function(t,e,n,r){var i=this,a=new ri(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.load(t,function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var r=i.parse(n);e&&e(r)},n,r)},"parse":function(t){return new ea(t)}});var Qp,Kp={"getContext":function(){return void 0===Qp&&(Qp=new(window.AudioContext||window.webkitAudioContext)),Qp},"setContext":function(t){Qp=t}};aa.prototype=Object.assign(Object.create(ni.prototype),{"constructor":aa,"load":function(t,e,n,r){var i=this,a=new ri(i.manager);a.setResponseType("arraybuffer"),a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.load(t,function(n){try{var a=n.slice(0);Kp.getContext().decodeAudioData(a,function(t){e(t)})}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}},n,r)}}),oa.prototype=Object.assign(Object.create(Xi.prototype),{"constructor":oa,"isHemisphereLightProbe":!0,"copy":function(t){return Xi.prototype.copy.call(this,t),this},"toJSON":function(t){return Xi.prototype.toJSON.call(this,t)}}),sa.prototype=Object.assign(Object.create(Xi.prototype),{"constructor":sa,"isAmbientLightProbe":!0,"copy":function(t){return Xi.prototype.copy.call(this,t),this},"toJSON":function(t){return Xi.prototype.toJSON.call(this,t)}});var $p=new Kl,td=new Kl;Object.assign(ca.prototype,{"update":function(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var n,r,i=t.projectionMatrix.clone(),a=e.eyeSep/2,o=a*e.near/e.focus,s=e.near*Math.tan(fl.DEG2RAD*e.fov*.5)/e.zoom;td.elements[12]=-a,$p.elements[12]=a,n=-s*e.aspect+o,r=s*e.aspect+o,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*e.aspect-o,r=s*e.aspect-o,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(td),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply($p)}});var ed=function(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1};ed.prototype.start=function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},ed.prototype.stop=function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},ed.prototype.getElapsedTime=function(){return this.getDelta(),this.elapsedTime},ed.prototype.getDelta=function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t};var nd=new Tl,rd=new Ml,id=new Tl,ad=new Tl;la.prototype=Object.create(s.prototype),la.prototype.constructor=la,la.prototype.getInput=function(){return this.gain},la.prototype.removeFilter=function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},la.prototype.getFilter=function(){return this.filter},la.prototype.setFilter=function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},la.prototype.getMasterVolume=function(){return this.gain.gain.value},la.prototype.setMasterVolume=function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},la.prototype.updateMatrixWorld=function(t){s.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(nd,rd,id),ad.set(0,0,-1).applyQuaternion(rd),e.positionX){var r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(nd.x,r),e.positionY.linearRampToValueAtTime(nd.y,r),e.positionZ.linearRampToValueAtTime(nd.z,r),e.forwardX.linearRampToValueAtTime(ad.x,r),e.forwardY.linearRampToValueAtTime(ad.y,r),e.forwardZ.linearRampToValueAtTime(ad.z,r),e.upX.linearRampToValueAtTime(n.x,r),e.upY.linearRampToValueAtTime(n.y,r),e.upZ.linearRampToValueAtTime(n.z,r)}else e.setPosition(nd.x,nd.y,nd.z),e.setOrientation(ad.x,ad.y,ad.z,n.x,n.y,n.z)},ha.prototype=Object.create(s.prototype),ha.prototype.constructor=ha,ha.prototype.getOutput=function(){return this.gain},ha.prototype.setNodeSource=function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},ha.prototype.setMediaElementSource=function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},ha.prototype.setMediaStreamSource=function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},ha.prototype.setBuffer=function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},
ha.prototype.play=function(t){if(void 0===t&&(t=0),!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()},ha.prototype.pause=function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this)},ha.prototype.stop=function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this)},ha.prototype.connect=function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this},ha.prototype.disconnect=function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this},ha.prototype.getFilters=function(){return this.filters},ha.prototype.setFilters=function(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},ha.prototype.setDetune=function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},ha.prototype.getDetune=function(){return this.detune},ha.prototype.getFilter=function(){return this.getFilters()[0]},ha.prototype.setFilter=function(t){return this.setFilters(t?[t]:[])},ha.prototype.setPlaybackRate=function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this)},ha.prototype.getPlaybackRate=function(){return this.playbackRate},ha.prototype.onEnded=function(){this.isPlaying=!1},ha.prototype.getLoop=function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},ha.prototype.setLoop=function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this)},ha.prototype.setLoopStart=function(t){return this.loopStart=t,this},ha.prototype.setLoopEnd=function(t){return this.loopEnd=t,this},ha.prototype.getVolume=function(){return this.gain.gain.value},ha.prototype.setVolume=function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this};var od=new Tl,sd=new Ml,cd=new Tl,ld=new Tl;ua.prototype=Object.create(ha.prototype),ua.prototype.constructor=ua,ua.prototype.getOutput=function(){return this.panner},ua.prototype.getRefDistance=function(){return this.panner.refDistance},ua.prototype.setRefDistance=function(t){return this.panner.refDistance=t,this},ua.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor},ua.prototype.setRolloffFactor=function(t){return this.panner.rolloffFactor=t,this},ua.prototype.getDistanceModel=function(){return this.panner.distanceModel},ua.prototype.setDistanceModel=function(t){return this.panner.distanceModel=t,this},ua.prototype.getMaxDistance=function(){return this.panner.maxDistance},ua.prototype.setMaxDistance=function(t){return this.panner.maxDistance=t,this},ua.prototype.setDirectionalCone=function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},ua.prototype.updateMatrixWorld=function(t){if(ha.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(od,sd,cd),ld.set(0,0,1).applyQuaternion(sd);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(od.x,n),e.positionY.linearRampToValueAtTime(od.y,n),e.positionZ.linearRampToValueAtTime(od.z,n),e.orientationX.linearRampToValueAtTime(ld.x,n),e.orientationY.linearRampToValueAtTime(ld.y,n),e.orientationZ.linearRampToValueAtTime(ld.z,n)}else e.setPosition(od.x,od.y,od.z),e.setOrientation(ld.x,ld.y,ld.z)}};var hd=function(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)};hd.prototype.getFrequencyData=function(){return this.analyser.getByteFrequencyData(this.data),this.data},hd.prototype.getAverageFrequency=function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length},Object.assign(pa.prototype,{"accumulate":function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=e}else{a+=e;var s=e/a;this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},"accumulateAdditive":function(t){var e=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t},"apply":function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=e*this._origIndex;this._mixBufferRegion(n,r,s,1-i,e)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(var c=e,l=e+e;c!==l;++c)if(n[c]!==n[c+e]){o.setValue(n,r);break}},"saveOriginalState":function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(var i=n,a=r;i!==a;++i)e[i]=e[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},"restoreOriginalState":function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},"_setAdditiveIdentityNumeric":function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,n=t;n<e;n++)this.buffer[n]=0},"_setAdditiveIdentityQuaternion":function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1},"_setAdditiveIdentityOther":function(){for(var t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]},"_select":function(t,e,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)t[e+a]=t[n+a]},"_slerp":function(t,e,n,r){Ml.slerpFlat(t,e,t,e,t,n,r)},"_slerpAdditive":function(t,e,n,r,i){var a=this._workIndex*i;Ml.multiplyQuaternionsFlat(t,a,t,e,t,n),Ml.slerpFlat(t,e,t,e,t,a,r)},"_lerp":function(t,e,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=e+o;t[s]=t[s]*a+t[n+o]*r}},"_lerpAdditive":function(t,e,n,r,i){for(var a=0;a!==i;++a){var o=e+a;t[o]=t[o]+t[n+a]*r}}});var ud="\\[\\]\\.:\\/",pd=new RegExp("["+ud+"]","g"),dd="[^"+ud+"]",fd="[^"+ud.replace("\\.","")+"]",md=/((?:WC+[\/:])*)/.source.replace("WC",dd),vd=/(WCOD+)?/.source.replace("WCOD",fd),gd=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",dd),yd=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",dd),xd=new RegExp("^"+md+vd+gd+yd+"$"),bd=["material","materials","bones"];Object.assign(da.prototype,{"getValue":function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},"setValue":function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},"bind":function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},"unbind":function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(fa,{"Composite":da,"create":function(t,e,n){return t&&t.isAnimationObjectGroup?new fa.Composite(t,e,n):new fa(t,e,n)},"sanitizeNodeName":function(t){return t.replace(/\s/g,"_").replace(pd,"")},"parseTrackName":function(t){var e=xd.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={"nodeName":e[2],"objectName":e[3],"objectIndex":e[4],"propertyName":e[5],"propertyIndex":e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==bd.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},"findNode":function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var r=function t(n){for(var r=0;r<n.length;r++){var i=n[r];if(i.name===e||i.uuid===e)return i;var a=t(i.children);if(a)return a}return null}(t.children);if(r)return r}return null}}),Object.assign(fa.prototype,{"_getValue_unavailable":function(){},"_setValue_unavailable":function(){},"BindingType":{"Direct":0,"EntireArray":1,"ArrayElement":2,"HasFromToArray":3},"Versioning":{"None":0,"NeedsUpdate":1,"MatrixWorldNeedsUpdate":2},"GetterByBindingType":[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],"SetterByBindingTypeAndVersioning":[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],"getValue":function(t,e){this.bind(),this.getValue(t,e)},"setValue":function(t,e){this.bind(),this.setValue(t,e)},"bind":function(){var t=this.node,e=this.parsedPath,n=e.objectName,r=e.propertyName,i=e.propertyIndex;if(t||(t=fa.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){var a=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[r];if(void 0===s){var c=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",t)}var l=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var h=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[i]&&(i=t.morphTargetDictionary[i])}h=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(h=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][l]},"unbind":function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(fa.prototype,{"_getValue_unbound":fa.prototype.getValue,"_setValue_unbound":fa.prototype.setValue}),Object.assign(ma.prototype,{"isAnimationObjectGroup":!0,"add":function(){for(var t=this._objects,e=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,a=i.length,o=void 0,s=t.length,c=this.nCachedObjects_,l=0,h=arguments.length;l!==h;++l){var u=arguments[l],p=u.uuid,d=e[p];if(void 0===d){d=s++,e[p]=d,t.push(u);for(var f=0,m=a;f!==m;++f)i[f].push(new fa(u,n[f],r[f]))}else if(d<c){o=t[d];var v=--c,g=t[v];e[g.uuid]=d,t[d]=g,e[p]=v,t[v]=u;for(var y=0,x=a;y!==x;++y){var b=i[y],_=b[v],w=b[d];b[d]=_,void 0===w&&(w=new fa(u,n[y],r[y])),b[v]=w}}else t[d]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c},"remove":function(){for(var t=this._objects,e=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=e[c];if(void 0!==l&&l>=i){var h=i++,u=t[h];e[u.uuid]=l,t[l]=u,e[c]=h,t[h]=s;for(var p=0,d=r;p!==d;++p){var f=n[p],m=f[h],v=f[l];f[l]=m,f[h]=v}}}this.nCachedObjects_=i},"uncache":function(){for(var t=this._objects,e=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=t.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],l=c.uuid,h=e[l];if(void 0!==h)if(delete e[l],h<i){var u=--i,p=t[u],d=--a,f=t[d];e[p.uuid]=h,t[h]=p,e[f.uuid]=u,t[u]=f,t.pop();for(var m=0,v=r;m!==v;++m){var g=n[m],y=g[u],x=g[d];g[h]=y,g[u]=x,g.pop()}}else{var b=--a,_=t[b];e[_.uuid]=h,t[h]=_,t.pop();for(var w=0,M=r;w!==M;++w){var S=n[w];S[h]=S[b],S.pop()}}}this.nCachedObjects_=i},"subscribe_":function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,h=new Array(c);r=i.length,n[t]=r,a.push(t),o.push(e),i.push(h);for(var u=l,p=s.length;u!==p;++u){var d=s[u];h[u]=new fa(d,t,e)}return h},"unsubscribe_":function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];e[t[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}});var _d=function(t,e,n,r){this._mixer=t,this._clip=e,this._localRoot=n||null,this.blendMode=r||e.blendMode;for(var i=e.tracks,a=i.length,o=new Array(a),s={"endingStart":2400,"endingEnd":2400},c=0;c!==a;++c){var l=i[c].createInterpolant(null);o[c]=l,l.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0};_d.prototype.play=function(){return this._mixer._activateAction(this),this},_d.prototype.stop=function(){return this._mixer._deactivateAction(this),this.reset()},_d.prototype.reset=function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},_d.prototype.isRunning=function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},_d.prototype.isScheduled=function(){return this._mixer._isActiveAction(this)},_d.prototype.startAt=function(t){return this._startTime=t,this},_d.prototype.setLoop=function(t,e){return this.loop=t,this.repetitions=e,this},_d.prototype.setEffectiveWeight=function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},_d.prototype.getEffectiveWeight=function(){return this._effectiveWeight},_d.prototype.fadeIn=function(t){return this._scheduleFading(t,0,1)},_d.prototype.fadeOut=function(t){return this._scheduleFading(t,1,0)},_d.prototype.crossFadeFrom=function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var r=this._clip.duration,i=t._clip.duration,a=i/r,o=r/i;t.warp(1,a,e),this.warp(o,1,e)}return this},_d.prototype.crossFadeTo=function(t,e,n){return t.crossFadeFrom(this,e,n)},_d.prototype.stopFading=function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},_d.prototype.setEffectiveTimeScale=function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},_d.prototype.getEffectiveTimeScale=function(){return this._effectiveTimeScale},_d.prototype.setDuration=function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},_d.prototype.syncWith=function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},_d.prototype.halt=function(t){return this.warp(this._effectiveTimeScale,0,t)},_d.prototype.warp=function(t,e,n){var r=this._mixer,i=r.time,a=this.timeScale,o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=t/a,c[1]=e/a,this},_d.prototype.stopWarping=function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},_d.prototype.getMixer=function(){return this._mixer},_d.prototype.getClip=function(){return this._clip},_d.prototype.getRoot=function(){return this._localRoot||this._mixer._root},_d.prototype._update=function(t,e,n,r){if(!this.enabled)return void this._updateWeight(t);var i=this._startTime;if(null!==i){var a=(t-i)*n;if(a<0||0===n)return;this._startTime=null,e=n*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(s>0){var c=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case 2501:for(var h=0,u=c.length;h!==u;++h)c[h].evaluate(o),l[h].accumulateAdditive(s);break;case Xc:default:for(var p=0,d=c.length;p!==d;++p)c[p].evaluate(o),l[p].accumulate(r,s)}}},_d.prototype._updateWeight=function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_d.prototype._updateTimeScale=function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_d.prototype._updateTime=function(t){var e=this._clip.duration,n=this.loop,r=this.time+t,i=this._loopCount,a=2202===n;if(0===t)return-1===i?r:a&&1==(1&i)?e-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({"type":"finished","action":this,"direction":t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=e||r<0){var o=Math.floor(r/e);r-=e*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({"type":"finished","action":this,"direction":t>0?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({"type":"loop","action":this,"loopDelta":o})}}else this.time=r;if(a&&1==(1&i))return e-r}return r},_d.prototype._setEndings=function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)},_d.prototype._scheduleFading=function(t,e,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=e,o[1]=i+t,s[1]=n,this},va.prototype=Object.assign(Object.create(e.prototype),{"constructor":va,"_bindAction":function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,a=t._propertyBindings,o=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var h=0;h!==i;++h){var u=r[h],p=u.name,d=l[p];if(void 0!==d)a[h]=d;else{if(void 0!==(d=a[h])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[h].binding.parsedPath;d=new pa(fa.create(n,p,f),u.ValueTypeName,u.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,p),a[h]=d}o[h].resultBuffer=d.buffer}},"_activateAction":function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},"_deactivateAction":function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},"_initMemoryManager":function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={"actions":{get"total"(){return t._actions.length},get"inUse"(){return t._nActiveActions}},"bindings":{get"total"(){return t._bindings.length},get"inUse"(){return t._nActiveBindings}},"controlInterpolants":{get"total"(){return t._controlInterpolants.length},get"inUse"(){return t._nActiveControlInterpolants}}}},"_isActiveAction":function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},"_addInactiveAction":function(t,e,n){var r=this._actions,i=this._actionsByClip,a=i[e];if(void 0===a)a={"knownActions":[t],"actionByRoot":{}},t._byClipCacheIndex=0,i[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=r.length,r.push(t),a.actionByRoot[n]=t},"_removeInactiveAction":function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;n._cacheIndex=r,e[r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],l=t._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(t)},"_removeInactiveBindingsForAction":function(t){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},"_lendAction":function(t){var e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},"_takeBackAction":function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},"_addInactiveBinding":function(t,e,n){var r=this._bindingsByRootAndName,i=this._bindings,a=r[e];void 0===a&&(a={},r[e]=a),a[n]=t,t._cacheIndex=i.length,i.push(t)},"_removeInactiveBinding":function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]},"_lendBinding":function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},"_takeBackBinding":function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},"_lendControlInterpolant":function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(n=new kr(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=e,t[e]=n),n},"_takeBackControlInterpolant":function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];t.__cacheIndex=r,e[r]=t,i.__cacheIndex=n,e[n]=i},"_controlInterpolantsResultBuffer":new Float32Array(1),"clipAction":function(t,e,n){var r=e||this._root,i=r.uuid,a="string"==typeof t?Kr.findByName(r,t):t,o=null!==a?a.uuid:t,s=this._actionsByClip[o],c=null;if(void 0===n&&(n=null!==a?a.blendMode:Xc),void 0!==s){var l=s.actionByRoot[i];if(void 0!==l&&l.blendMode===n)return l;c=s.knownActions[0],null===a&&(a=c._clip)}if(null===a)return null;var h=new _d(this,a,e,n);return this._bindAction(h,c),this._addInactiveAction(h,o,i),h},"existingAction":function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?Kr.findByName(n,t):t,a=i?i.uuid:t,o=this._actionsByClip[a];return void 0!==o?o.actionByRoot[r]||null:null},"stopAllAction":function(){for(var t=this._actions,e=this._nActiveActions,n=e-1;n>=0;--n)t[n].stop();return this},"update":function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),a=this._accuIndex^=1,o=0;o!==n;++o){e[o]._update(r,t,i,a)}for(var s=this._bindings,c=this._nActiveBindings,l=0;l!==c;++l)s[l].apply(a);return this},"setTime":function(t){this.time=0;for(var e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},"getRoot":function(){return this._root},"uncacheClip":function(t){var e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,h=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=l,e[l]=h,e.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},"uncacheRoot":function(t){var e=t.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot,a=i[e];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[e];if(void 0!==s)for(var c in s){var l=s[c];l.restoreOriginalState(),this._removeInactiveBinding(l)}},"uncacheAction":function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}});var wd=function(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t};wd.prototype.clone=function(){return new wd(void 0===this.value.clone?this.value:this.value.clone())},ga.prototype=Object.assign(Object.create(Ve.prototype),{"constructor":ga,"isInstancedInterleavedBuffer":!0,"copy":function(t){return Ve.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},"clone":function(t){var e=Ve.prototype.clone.call(this,t);return e.meshPerAttribute=this.meshPerAttribute,e},"toJSON":function(t){var e=Ve.prototype.toJSON.call(this,t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}),Object.defineProperty(ya.prototype,"needsUpdate",{"set":function(t){!0===t&&this.version++}}),Object.assign(ya.prototype,{"isGLBufferAttribute":!0,"setBuffer":function(t){return this.buffer=t,this},"setType":function(t,e){return this.type=t,this.elementSize=e,this},"setItemSize":function(t){return this.itemSize=t,this},"setCount":function(t){return this.count=t,this}}),Object.assign(xa.prototype,{"set":function(t,e){this.ray.set(t,e)},"setFromCamera":function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},"intersectObject":function(t,e,n){var r=n||[];return _a(t,this,r,e),r.sort(ba),r},"intersectObjects":function(t,e,n){var r=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=t.length;i<a;i++)_a(t[i],this,r,e);return r.sort(ba),r}});var Md=function(t,e,n){return void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),this.radius=t,this.phi=e,this.theta=n,this};Md.prototype.set=function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},Md.prototype.clone=function(){return(new this.constructor).copy(this)},Md.prototype.copy=function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},Md.prototype.makeSafe=function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},Md.prototype.setFromVector3=function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},Md.prototype.setFromCartesianCoords=function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(fl.clamp(e/this.radius,-1,1))),this};var Sd=function(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this};Sd.prototype.set=function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},Sd.prototype.clone=function(){return(new this.constructor).copy(this)},Sd.prototype.copy=function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},Sd.prototype.setFromVector3=function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},Sd.prototype.setFromCartesianCoords=function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this};var Td=new ml,Ed=function(t,e){Object.defineProperty(this,"isBox2",{"value":!0}),this.min=void 0!==t?t:new ml(1/0,1/0),this.max=void 0!==e?e:new ml(-1/0,-1/0)};Ed.prototype.set=function(t,e){return this.min.copy(t),this.max.copy(e),this},
Ed.prototype.setFromPoints=function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},Ed.prototype.setFromCenterAndSize=function(t,e){var n=Td.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},Ed.prototype.clone=function(){return(new this.constructor).copy(this)},Ed.prototype.copy=function(t){return this.min.copy(t.min),this.max.copy(t.max),this},Ed.prototype.makeEmpty=function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},Ed.prototype.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y},Ed.prototype.getCenter=function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new ml),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},Ed.prototype.getSize=function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new ml),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},Ed.prototype.expandByPoint=function(t){return this.min.min(t),this.max.max(t),this},Ed.prototype.expandByVector=function(t){return this.min.sub(t),this.max.add(t),this},Ed.prototype.expandByScalar=function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},Ed.prototype.containsPoint=function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},Ed.prototype.containsBox=function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},Ed.prototype.getParameter=function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new ml),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},Ed.prototype.intersectsBox=function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},Ed.prototype.clampPoint=function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new ml),e.copy(t).clamp(this.min,this.max)},Ed.prototype.distanceToPoint=function(t){return Td.copy(t).clamp(this.min,this.max).sub(t).length()},Ed.prototype.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this},Ed.prototype.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},Ed.prototype.translate=function(t){return this.min.add(t),this.max.add(t),this},Ed.prototype.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)};var Ad=new Tl,Ld=new Tl,Rd=function(t,e){this.start=void 0!==t?t:new Tl,this.end=void 0!==e?e:new Tl};Rd.prototype.set=function(t,e){return this.start.copy(t),this.end.copy(e),this},Rd.prototype.clone=function(){return(new this.constructor).copy(this)},Rd.prototype.copy=function(t){return this.start.copy(t.start),this.end.copy(t.end),this},Rd.prototype.getCenter=function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Tl),t.addVectors(this.start,this.end).multiplyScalar(.5)},Rd.prototype.delta=function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Tl),t.subVectors(this.end,this.start)},Rd.prototype.distanceSq=function(){return this.start.distanceToSquared(this.end)},Rd.prototype.distance=function(){return this.start.distanceTo(this.end)},Rd.prototype.at=function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Tl),this.delta(e).multiplyScalar(t).add(this.start)},Rd.prototype.closestPointToPointParameter=function(t,e){Ad.subVectors(t,this.start),Ld.subVectors(this.end,this.start);var n=Ld.dot(Ld),r=Ld.dot(Ad),i=r/n;return e&&(i=fl.clamp(i,0,1)),i},Rd.prototype.closestPointToPoint=function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Tl),this.delta(n).multiplyScalar(r).add(this.start)},Rd.prototype.applyMatrix4=function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},Rd.prototype.equals=function(t){return t.start.equals(this.start)&&t.end.equals(this.end)},wa.prototype=Object.create(s.prototype),wa.prototype.constructor=wa,wa.prototype.isImmediateRenderObject=!0;var Pd=new Tl;Ma.prototype=Object.create(s.prototype),Ma.prototype.constructor=Ma,Ma.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Ma.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Pd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Pd),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Cd=new Tl,Od=new Kl,Id=new Kl;Sa.prototype=Object.create(en.prototype),Sa.prototype.constructor=Sa,Sa.prototype.updateMatrixWorld=function(t){var e=this.bones,n=this.geometry,r=n.getAttribute("position");Id.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<e.length;i++){var o=e[i];o.parent&&o.parent.isBone&&(Od.multiplyMatrices(Id,o.matrixWorld),Cd.setFromMatrixPosition(Od),r.setXYZ(a,Cd.x,Cd.y,Cd.z),Od.multiplyMatrices(Id,o.parent.matrixWorld),Cd.setFromMatrixPosition(Od),r.setXYZ(a+1,Cd.x,Cd.y,Cd.z),a+=2)}n.getAttribute("position").needsUpdate=!0,en.prototype.updateMatrixWorld.call(this,t)},Ea.prototype=Object.create(T.prototype),Ea.prototype.constructor=Ea,Ea.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Ea.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var Dd=new Tl,Nd=new kh,Bd=new kh;Aa.prototype=Object.create(s.prototype),Aa.prototype.constructor=Aa,Aa.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Aa.prototype.update=function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");Nd.copy(this.light.color),Bd.copy(this.light.groundColor);for(var n=0,r=e.count;n<r;n++){var i=n<r/2?Nd:Bd;e.setXYZ(n,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt(Dd.setFromMatrixPosition(this.light.matrixWorld).negate())},La.prototype=Object.create(en.prototype),La.prototype.constructor=La,Ra.prototype=Object.create(en.prototype),Ra.prototype.constructor=Ra;var zd=new Tl,Gd=new Tl,Fd=new Tl;Pa.prototype=Object.create(s.prototype),Pa.prototype.constructor=Pa,Pa.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Pa.prototype.update=function(){zd.setFromMatrixPosition(this.light.matrixWorld),Gd.setFromMatrixPosition(this.light.target.matrixWorld),Fd.subVectors(Gd,zd),this.lightPlane.lookAt(Gd),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Gd),this.targetLine.scale.z=Fd.length()};var Ud=new Tl,Hd=new D;Ca.prototype=Object.create(en.prototype),Ca.prototype.constructor=Ca,Ca.prototype.update=function(){var t=this.geometry,e=this.pointMap;Hd.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Oa("c",e,t,Hd,0,0,-1),Oa("t",e,t,Hd,0,0,1),Oa("n1",e,t,Hd,-1,-1,-1),Oa("n2",e,t,Hd,1,-1,-1),Oa("n3",e,t,Hd,-1,1,-1),Oa("n4",e,t,Hd,1,1,-1),Oa("f1",e,t,Hd,-1,-1,1),Oa("f2",e,t,Hd,1,-1,1),Oa("f3",e,t,Hd,-1,1,1),Oa("f4",e,t,Hd,1,1,1),Oa("u1",e,t,Hd,.7,1.1,-1),Oa("u2",e,t,Hd,-.7,1.1,-1),Oa("u3",e,t,Hd,0,2,-1),Oa("cf1",e,t,Hd,-1,0,1),Oa("cf2",e,t,Hd,1,0,1),Oa("cf3",e,t,Hd,0,-1,1),Oa("cf4",e,t,Hd,0,1,1),Oa("cn1",e,t,Hd,-1,0,-1),Oa("cn2",e,t,Hd,1,0,-1),Oa("cn3",e,t,Hd,0,-1,-1),Oa("cn4",e,t,Hd,0,1,-1),t.getAttribute("position").needsUpdate=!0};var kd=new Ll;Ia.prototype=Object.create(en.prototype),Ia.prototype.constructor=Ia,Ia.prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&kd.setFromObject(this.object),!kd.isEmpty()){var e=kd.min,n=kd.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Ia.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Ia.prototype.copy=function(t){return en.prototype.copy.call(this,t),this.object=t.object,this},Da.prototype=Object.create(en.prototype),Da.prototype.constructor=Da,Da.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),en.prototype.updateMatrixWorld.call(this,t))},Na.prototype=Object.create(tn.prototype),Na.prototype.constructor=Na,Na.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?Io:Oo,this.lookAt(this.plane.normal),tn.prototype.updateMatrixWorld.call(this,t)};var Vd,jd,Wd=new Tl;Ba.prototype=Object.create(s.prototype),Ba.prototype.constructor=Ba,Ba.prototype.setDirection=function(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Wd.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Wd,e)}},Ba.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Ba.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Ba.prototype.copy=function(t){return s.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},za.prototype=Object.create(en.prototype),za.prototype.constructor=za;var qd=4,Xd=8,Yd=Math.pow(2,Xd),Zd=[.125,.215,.35,.446,.526,.582],Jd=Xd-qd+1+Zd.length,Qd={};Qd[Yc]=0,Qd[Zc]=1,Qd[Qc]=2,Qd[$c]=3,Qd[tl]=4,Qd[el]=5,Qd[Jc]=6;var Kd=new ki,$d=function(){for(var t=[],e=[],n=[],r=Xd,i=0;i<Jd;i++){var a=Math.pow(2,r);e.push(a);var o=1/a;i>Xd-qd?o=Zd[i-Xd+qd-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),c=-s/2,l=1+s/2,h=[c,c,l,c,l,l,c,c,l,l,c,l],u=new Float32Array(108),p=new Float32Array(72),f=new Float32Array(36),m=0;m<6;m++){var v=m%3*2/3-1,g=m>2?0:-1,y=[v,g,0,v+2/3,g,0,v+2/3,g+1,0,v,g,0,v+2/3,g+1,0,v,g+1,0];u.set(y,18*m),p.set(h,12*m);var x=[m,m,m,m,m,m];f.set(x,6*m)}var b=new S;b.setAttribute("position",new d(u,3)),b.setAttribute("uv",new d(p,2)),b.setAttribute("faceIndex",new d(f,1)),t.push(b),r>qd&&r--}return{"_lodPlanes":t,"_sizeLods":e,"_sigmas":n}}(),tf=$d._lodPlanes,ef=$d._sizeLods,nf=$d._sigmas,rf=null,af=(1+Math.sqrt(5))/2,of=1/af,sf=[new Tl(1,1,1),new Tl(-1,1,1),new Tl(1,1,-1),new Tl(-1,1,-1),new Tl(0,af,of),new Tl(0,af,-of),new Tl(of,0,af),new Tl(-of,0,af),new Tl(af,of,0),new Tl(-af,of,0)],cf=function(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=Ha(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)};cf.prototype.fromScene=function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=.1),void 0===r&&(r=100),rf=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i},cf.prototype.fromEquirectangular=function(t){return this._fromTexture(t)},cf.prototype.fromCubemap=function(t){return this._fromTexture(t)},cf.prototype.compileCubemapShader=function(){null===this._cubemapShader&&(this._cubemapShader=Va(),this._compileMaterial(this._cubemapShader))},cf.prototype.compileEquirectangularShader=function(){null===this._equirectShader&&(this._equirectShader=ka(),this._compileMaterial(this._equirectShader))},cf.prototype.dispose=function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var t=0;t<tf.length;t++)tf[t].dispose()},cf.prototype._cleanup=function(t){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(rf),t.scissorTest=!1,Ua(t,0,0,t.width,t.height)},cf.prototype._fromTexture=function(t){rf=this._renderer.getRenderTarget();var e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e},cf.prototype._allocateTargets=function(t){var e={"magFilter":Rs,"minFilter":Rs,"generateMipmaps":!1,"type":Ns,"format":Ks,"encoding":Ga(t)?t.encoding:Qc,"depthBuffer":!1},n=Fa(e);return n.depthBuffer=!t,this._pingPongRenderTarget=Fa(e),n},cf.prototype._compileMaterial=function(t){var e=new T(tf[0],t);this._renderer.compile(e,Kd)},cf.prototype._sceneToCubeUV=function(t,e,n,r){var i=new N(90,1,e,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,c=s.outputEncoding,l=s.toneMapping,h=s.getClearColor(),u=s.getClearAlpha();s.toneMapping=fs,s.outputEncoding=Yc;var p=t.background;if(p&&p.isColor){p.convertSRGBToLinear();var d=Math.max(p.r,p.g,p.b),f=Math.min(Math.max(Math.ceil(Math.log2(d)),-128),127);p=p.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;s.setClearColor(p,m),t.background=null}for(var v=0;v<6;v++){var g=v%3;0==g?(i.up.set(0,a[v],0),i.lookAt(o[v],0,0)):1==g?(i.up.set(0,0,a[v]),i.lookAt(0,o[v],0)):(i.up.set(0,a[v],0),i.lookAt(0,0,o[v])),Ua(r,g*Yd,v>2?Yd:0,Yd,Yd),s.setRenderTarget(r),s.render(t,i)}s.toneMapping=l,s.outputEncoding=c,s.setClearColor(h,u)},cf.prototype._textureToCubeUV=function(t,e){var n=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Va()):null==this._equirectShader&&(this._equirectShader=ka());var r=t.isCubeTexture?this._cubemapShader:this._equirectShader,i=new T(tf[0],r),a=r.uniforms;a["envMap"].value=t,t.isCubeTexture||a["texelSize"].value.set(1/t.image.width,1/t.image.height),a["inputEncoding"].value=Qd[t.encoding],a["outputEncoding"].value=Qd[e.texture.encoding],Ua(e,0,0,3*Yd,2*Yd),n.setRenderTarget(e),n.render(i,Kd)},cf.prototype._applyPMREM=function(t){var e=this._renderer,n=e.autoClear;e.autoClear=!1;for(var r=1;r<Jd;r++){var i=Math.sqrt(nf[r]*nf[r]-nf[r-1]*nf[r-1]),a=sf[(r-1)%sf.length];this._blur(t,r-1,r,i,a)}e.autoClear=n},cf.prototype._blur=function(t,e,n,r,i){var a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,r,"latitudinal",i),this._halfBlur(a,t,n,n,r,"longitudinal",i)},cf.prototype._halfBlur=function(t,e,n,r,i,a,o){var s=this._renderer,c=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var l=new T(tf[r],c),h=c.uniforms,u=ef[n]-1,p=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,d=i/p,f=isFinite(i)?1+Math.floor(3*d):20;f>20&&console.warn("sigmaRadians, "+i+", is too large and will clip, as it requested "+f+" samples when the maximum is set to 20");for(var m=[],v=0,g=0;g<20;++g){var y=g/d,x=Math.exp(-y*y/2);m.push(x),0==g?v+=x:g<f&&(v+=2*x)}for(var b=0;b<m.length;b++)m[b]=m[b]/v;h["envMap"].value=t.texture,h["samples"].value=f,h["weights"].value=m,h["latitudinal"].value="latitudinal"===a,o&&(h["poleAxis"].value=o),h["dTheta"].value=p,h["mipInt"].value=Xd-n,h["inputEncoding"].value=Qd[t.texture.encoding],h["outputEncoding"].value=Qd[t.texture.encoding];var _=ef[r];Ua(e,3*Math.max(0,Yd-2*_),(0===r?0:2*Yd)+2*_*(r>Xd-qd?r-Xd+qd:0),3*_,2*_),s.setRenderTarget(e),s.render(l,Kd)};hi.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(hi.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Oi.prototype,{"createPointsGeometry":function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},"createSpacedPointsGeometry":function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},"createGeometry":function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new L,n=0,r=t.length;n<r;n++){var i=t[n];e.vertices.push(new Tl(i.x,i.y,i.z||0))}return e}}),Object.assign(Ii.prototype,{"fromPoints":function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),ho.prototype=Object.create(fi.prototype),uo.prototype=Object.create(fi.prototype),po.prototype=Object.create(fi.prototype),Object.assign(po.prototype,{"initFromArray":function(){console.error("THREE.Spline: .initFromArray() has been removed.")},"getControlPointsArray":function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},"reparametrizeByArcLength":function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),La.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Sa.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(ni.prototype,{"extractUrlBase":function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),qp.extractUrlBase(t)}}),ni.Handlers={"add":function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},"get":function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(Ki.prototype,{"setTexturePath":function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Ed.prototype,{"center":function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},"empty":function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},"isIntersectionBox":function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},"size":function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Ll.prototype,{"center":function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},"empty":function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},"isIntersectionBox":function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},"isIntersectionSphere":function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},"size":function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Vl.prototype,{"empty":function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ru.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},Rd.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(fl,{"random16":function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},"nearestPowerOfTwo":function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),fl.floorPowerOfTwo(t)},"nextPowerOfTwo":function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),fl.ceilPowerOfTwo(t)}}),Object.assign(gl.prototype,{"flattenToArrayOffset":function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},"multiplyVector3":function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},"multiplyVector3Array":function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},"applyToBufferAttribute":function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},"applyToVector3Array":function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Kl.prototype,{"extractPosition":function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},"flattenToArrayOffset":function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},"getPosition":function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Tl).setFromMatrixColumn(this,3)},"setRotationFromQuaternion":function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},"multiplyToArray":function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},"multiplyVector3":function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},"multiplyVector4":function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},"multiplyVector3Array":function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},"rotateAxis":function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},"crossVector":function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},"translate":function(){console.error("THREE.Matrix4: .translate() has been removed.")},"rotateX":function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},"rotateY":function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},"rotateZ":function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},"rotateByAxis":function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},"applyToBufferAttribute":function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},"applyToVector3Array":function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},"makeFrustum":function(t,e,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,a)}}),Ah.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Ml.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Ql.prototype,{"isIntersectionBox":function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},"isIntersectionPlane":function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},"isIntersectionSphere":function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Gh.prototype,{"area":function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},"barycoordFromPoint":function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},"midpoint":function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},"normal":function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},"plane":function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(Gh,{"barycoordFromPoint":function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Gh.getBarycoord(t,e,n,r,i)},"normal":function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Gh.getNormal(t,e,n,r)}}),Object.assign(Di.prototype,{"extractAllPoints":function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},"extrude":function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new lr(this,t)},"makeGeometry":function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new br(this,t)}}),Object.assign(ml.prototype,{"fromAttribute":function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},"distanceToManhattan":function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},"lengthManhattan":function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Tl.prototype,{"setEulerFromRotationMatrix":function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},"setEulerFromQuaternion":function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},"getPositionFromMatrix":function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},"getScaleFromMatrix":function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},"getColumnFromMatrix":function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},"applyProjection":function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},"fromAttribute":function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},"distanceToManhattan":function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},"lengthManhattan":function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(_l.prototype,{"fromAttribute":function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},"lengthManhattan":function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(L.prototype,{"computeTangents":function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},"computeLineDistances":function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},"applyMatrix":function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(s.prototype,{"getChildByName":function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},"renderDepth":function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},"translate":function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},"getWorldRotation":function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},"applyMatrix":function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(s.prototype,{"eulerOrder":{"get":function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},"set":function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},"useQuaternion":{"get":function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},"set":function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(T.prototype,{"setDrawMode":function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(T.prototype,{"drawMode":{"get":function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},"set":function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Ye.prototype,{"objects":{"get":function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Je.prototype,"useVertexTexture",{"get":function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},"set":function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Ze.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(hi.prototype,"__arcLengthDivisions",{"get":function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},"set":function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),N.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Ni.prototype,{"onlyShadow":{"set":function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},"shadowCameraFov":{"set":function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},"shadowCameraLeft":{"set":function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},"shadowCameraRight":{"set":function(t){
console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},"shadowCameraTop":{"set":function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},"shadowCameraBottom":{"set":function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},"shadowCameraNear":{"set":function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},"shadowCameraFar":{"set":function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},"shadowCameraVisible":{"set":function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},"shadowBias":{"set":function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},"shadowDarkness":{"set":function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},"shadowMapWidth":{"set":function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},"shadowMapHeight":{"set":function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(d.prototype,{"length":{"get":function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},"dynamic":{"get":function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===ll},"set":function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(ll)}}}),Object.assign(d.prototype,{"setDynamic":function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?ll:cl),this},"copyIndicesArray":function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},"setArray":function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(S.prototype,{"addIndex":function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},"addAttribute":function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new d(arguments[1],arguments[2])))},"addDrawCall":function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},"clearDrawCalls":function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},"computeTangents":function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},"computeOffsets":function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},"removeAttribute":function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},"applyMatrix":function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(S.prototype,{"drawcalls":{"get":function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},"offsets":{"get":function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Zi.prototype,{"maxInstancedCount":{"get":function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},"set":function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(xa.prototype,{"linePrecision":{"get":function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},"set":function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(Ve.prototype,{"dynamic":{"get":function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===ll},"set":function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(Ve.prototype,{"setDynamic":function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?ll:cl),this},"setArray":function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(hr.prototype,{"getArrays":function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},"addShapeList":function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},"addShape":function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.assign(ke.prototype,{"dispose":function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(wd.prototype,{"dynamic":{"set":function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},"onUpdate":{"value":function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(u.prototype,{"wrapAround":{"get":function(){console.warn("THREE.Material: .wrapAround has been removed.")},"set":function(){console.warn("THREE.Material: .wrapAround has been removed.")}},"overdraw":{"get":function(){console.warn("THREE.Material: .overdraw has been removed.")},"set":function(){console.warn("THREE.Material: .overdraw has been removed.")}},"wrapRGB":{"get":function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new kh}},"shading":{"get":function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},"set":function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},"stencilMask":{"get":function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},"set":function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Dr.prototype,{"metal":{"get":function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},"set":function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Ir.prototype,{"transparency":{"get":function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},"set":function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(I.prototype,{"derivatives":{"get":function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},"set":function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Ue.prototype,{"clearTarget":function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},"animate":function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},"getCurrentRenderTarget":function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},"getMaxAnisotropy":function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},"getPrecision":function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},"resetGLState":function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},"supportsFloatTextures":function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},"supportsHalfFloatTextures":function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},"supportsStandardDerivatives":function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},"supportsCompressedTextureS3TC":function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},"supportsCompressedTexturePVRTC":function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},"supportsBlendMinMax":function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},"supportsVertexTextures":function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},"supportsInstancedArrays":function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},"enableScissorTest":function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},"initMaterial":function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},"addPrePlugin":function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},"addPostPlugin":function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},"updateShadowMap":function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},"setFaceCulling":function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},"allocTextureUnit":function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},"setTexture":function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},"setTexture2D":function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},"setTextureCube":function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},"getActiveMipMapLevel":function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Ue.prototype,{"shadowMapEnabled":{"get":function(){return this.shadowMap.enabled},"set":function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},"shadowMapType":{"get":function(){return this.shadowMap.type},"set":function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},"shadowMapCullFace":{"get":function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},"set":function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},"context":{"get":function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},"vr":{"get":function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},"gammaInput":{"get":function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},"set":function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},"gammaOutput":{"get":function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},"set":function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?Zc:Yc}},"toneMappingWhitePoint":{"get":function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},"set":function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Ce.prototype,{"cullFace":{"get":function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},"set":function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},"renderReverseSided":{"get":function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},"set":function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},"renderSingleSided":{"get":function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},"set":function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(r.prototype,{"wrapS":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},"set":function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},"wrapT":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},"set":function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},"magFilter":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},"set":function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},"minFilter":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},"set":function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},"anisotropy":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},"set":function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},"offset":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},"set":function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},"repeat":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},"set":function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},"format":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},"set":function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},"type":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},"set":function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},"generateMipmaps":{"get":function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},"set":function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(ha.prototype,{"load":{"value":function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new aa).load(t,function(t){e.setBuffer(t)}),this}},"startTime":{"set":function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),hd.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},B.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var lf={"merge":function(t,e,n){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var r;e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),r=e.matrix,e=e.geometry),t.merge(e,r,n)},"center":function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};xl.crossOrigin=void 0,xl.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new li;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,n,void 0,r);return e&&(a.mapping=e),a},xl.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new si;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,n,void 0,r);return e&&(a.mapping=e),a},xl.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},xl.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var hf={"createMultiMaterialObject":function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},"detach":function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},"attach":function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{"detail":{"revision":"120"}})),t.ACESFilmicToneMapping=ys,t.AddEquation=Ho,t.AddOperation=ds,t.AdditiveAnimationBlendMode=2501,t.AdditiveBlending=zo,t.AlphaFormat=Xs,t.AlwaysDepth=is,t.AlwaysStencilFunc=sl,t.AmbientLight=Wi,t.AmbientLightProbe=sa,t.AnimationClip=Kr,t.AnimationLoader=ii,t.AnimationMixer=va,t.AnimationObjectGroup=ma,t.AnimationUtils=Bp,t.ArcCurve=pi,t.ArrayCamera=Ne,t.ArrowHelper=Ba,t.Audio=ha,t.AudioAnalyser=hd,t.AudioContext=Kp,t.AudioListener=la,t.AudioLoader=aa,t.AxesHelper=za,t.AxisHelper=fo,t.BackSide=Io,t.BasicDepthPacking=nl,t.BasicShadowMap=0,t.BinaryTextureLoader=xo,t.Bone=Qe,t.BooleanKeyframeTrack=Wr,t.BoundingBoxHelper=mo,t.Box2=Ed,t.Box3=Ll,t.Box3Helper=Da,t.BoxBufferGeometry=P,t.BoxGeometry=R,t.BoxHelper=Ia,t.BufferAttribute=d,t.BufferGeometry=S,t.BufferGeometryLoader=Qi,t.ByteType=Bs,t.Cache=zp,t.Camera=D,t.CameraHelper=Ca,t.CanvasRenderer=_o,t.CanvasTexture=ln,t.CatmullRomCurve3=fi,t.CineonToneMapping=gs,t.CircleBufferGeometry=Rr,t.CircleGeometry=Lr,t.ClampToEdgeWrapping=As,t.Clock=ed,t.ClosedSplineCurve3=ho,t.Color=kh,t.ColorKeyframeTrack=qr,t.CompressedTexture=cn,t.CompressedTextureLoader=ai,t.ConeBufferGeometry=Ar,t.ConeGeometry=Er,t.CubeCamera=B,t.CubeGeometry=R,t.CubeReflectionMapping=bs,t.CubeRefractionMapping=_s,t.CubeTexture=rt,t.CubeTextureLoader=si,t.CubeUVReflectionMapping=Ss,t.CubeUVRefractionMapping=Ts,t.CubicBezierCurve=Ti,t.CubicBezierCurve3=Ei,t.CubicInterpolant=Hr,t.CullFaceBack=Ao,t.CullFaceFront=Lo,t.CullFaceFrontBack=3,t.CullFaceNone=Eo,t.Curve=hi,t.CurvePath=Oi,t.CustomBlending=Uo,t.CustomToneMapping=xs,t.CylinderBufferGeometry=Tr,t.CylinderGeometry=Sr,t.Cylindrical=Sd,t.DataTexture=G,t.DataTexture2DArray=it,t.DataTexture3D=at,t.DataTextureLoader=ci,t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=Gp,t.DepthFormat=$s,t.DepthStencilFormat=tc,t.DepthTexture=hn,t.DirectionalLight=ji,t.DirectionalLightHelper=Pa,t.DiscreteInterpolant=Vr,t.DodecahedronBufferGeometry=Mn,t.DodecahedronGeometry=wn,t.DoubleSide=Do,t.DstAlphaFactor=Ko,t.DstColorFactor=ts,t.DynamicBufferAttribute=to,t.DynamicCopyUsage=35050,t.DynamicDrawUsage=ll,t.DynamicReadUsage=35049,t.EdgesGeometry=Mr,t.EdgesHelper=vo,t.EllipseCurve=ui,t.EqualDepth=ss,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=ws,t.EquirectangularRefractionMapping=Ms,t.Euler=oh,t.EventDispatcher=e,t.ExtrudeBufferGeometry=hr,t.ExtrudeGeometry=lr,t.Face3=Vh,t.Face4=ja,t.FaceColors=1,t.FileLoader=ri,t.FlatShading=1,t.Float32Attribute=co,t.Float32BufferAttribute=_,t.Float64Attribute=lo,t.Float64BufferAttribute=w,t.FloatType=Hs,t.Fog=Qu,t.FogExp2=Ju,t.Font=ea,t.FontLoader=ia,t.FrontSide=Oo,t.Frustum=Ru,t.GLBufferAttribute=ya,t.GLSL1="100",t.GLSL3=hl,t.GammaEncoding=Jc,t.Geometry=L,t.GeometryUtils=lf,t.GreaterDepth=ls,t.GreaterEqualDepth=cs,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=La,t.Group=Be,t.HalfFloatType=ks,t.HemisphereLight=Bi,t.HemisphereLightHelper=Aa,t.HemisphereLightProbe=oa,t.IcosahedronBufferGeometry=_n,t.IcosahedronGeometry=bn,t.ImageBitmapLoader=$i,t.ImageLoader=oi,t.ImageUtils=xl,t.ImmediateRenderObject=wa,t.IncrementStencilOp=7682,t.IncrementWrapStencilOp=34055,t.InstancedBufferAttribute=Ji,t.InstancedBufferGeometry=Zi,t.InstancedInterleavedBuffer=ga,t.InstancedMesh=Ke,t.Int16Attribute=io,t.Int16BufferAttribute=g,t.Int32Attribute=oo,t.Int32BufferAttribute=x,t.Int8Attribute=eo,t.Int8BufferAttribute=f,t.IntType=Fs,t.InterleavedBuffer=Ve,t.InterleavedBufferAttribute=je,t.Interpolant=Ur,t.InterpolateDiscrete=2300,t.InterpolateLinear=2301,t.InterpolateSmooth=2302,t.InvertStencilOp=5386,t.JSONLoader=wo,t.KeepStencilOp=ol,t.KeyframeTrack=jr,t.LOD=Ye,t.LatheBufferGeometry=xr,t.LatheGeometry=yr,t.Layers=hh,t.LensFlare=Mo,t.LessDepth=as,t.LessEqualDepth=os,t.LessEqualStencilFunc=515,t.LessStencilFunc=513,t.Light=Ni,t.LightProbe=Xi,t.LightShadow=zi,t.Line=tn,t.Line3=Rd,t.LineBasicMaterial=$e,t.LineCurve=Ai,t.LineCurve3=Li,t.LineDashedMaterial=Fr,t.LineLoop=nn,t.LinePieces=1,t.LineSegments=en,t.LineStrip=0,t.LinearEncoding=Yc;t.LinearFilter=Os,t.LinearInterpolant=kr,t.LinearMipMapLinearFilter=1008,t.LinearMipMapNearestFilter=1007,t.LinearMipmapLinearFilter=Ds,t.LinearMipmapNearestFilter=Is,t.LinearToneMapping=ms,t.Loader=ni,t.LoaderUtils=qp,t.LoadingManager=ei,t.LogLuvEncoding=Kc,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=2201,t.LuminanceAlphaFormat=Qs,t.LuminanceFormat=Js,t.MOUSE=So,t.Material=u,t.MaterialLoader=Yi,t.Math=fl,t.MathUtils=fl,t.Matrix3=gl,t.Matrix4=Kl,t.MaxEquation=Wo,t.Mesh=T,t.MeshBasicMaterial=p,t.MeshDepthMaterial=Re,t.MeshDistanceMaterial=Pe,t.MeshFaceMaterial=Wa,t.MeshLambertMaterial=zr,t.MeshMatcapMaterial=Gr,t.MeshNormalMaterial=Br,t.MeshPhongMaterial=Dr,t.MeshPhysicalMaterial=Ir,t.MeshStandardMaterial=Or,t.MeshToonMaterial=Nr,t.MinEquation=jo,t.MirroredRepeatWrapping=Ls,t.MixOperation=ps,t.MultiMaterial=qa,t.MultiplyBlending=Fo,t.MultiplyOperation=us,t.NearestFilter=Rs,t.NearestMipMapLinearFilter=1005,t.NearestMipMapNearestFilter=1004,t.NearestMipmapLinearFilter=Cs,t.NearestMipmapNearestFilter=Ps,t.NeverDepth=rs,t.NeverStencilFunc=512,t.NoBlending=No,t.NoColors=0,t.NoToneMapping=fs,t.NormalAnimationBlendMode=Xc,t.NormalBlending=Bo,t.NotEqualDepth=hs,t.NotEqualStencilFunc=517,t.NumberKeyframeTrack=Xr,t.Object3D=s,t.ObjectLoader=Ki,t.ObjectSpaceNormalMap=al,t.OctahedronBufferGeometry=xn,t.OctahedronGeometry=yn,t.OneFactor=Xo,t.OneMinusDstAlphaFactor=$o,t.OneMinusDstColorFactor=es,t.OneMinusSrcAlphaFactor=Qo,t.OneMinusSrcColorFactor=Zo,t.OrthographicCamera=ki,t.PCFShadowMap=Ro,t.PCFSoftShadowMap=Po,t.PMREMGenerator=cf,t.ParametricBufferGeometry=dn,t.ParametricGeometry=pn,t.Particle=Ya,t.ParticleBasicMaterial=Qa,t.ParticleSystem=Za,t.ParticleSystemMaterial=Ka,t.Path=Ii,t.PerspectiveCamera=N,t.Plane=Ah,t.PlaneBufferGeometry=k,t.PlaneGeometry=H,t.PlaneHelper=Na,t.PointCloud=Xa,t.PointCloudMaterial=Ja,t.PointLight=Hi,t.PointLightHelper=Ea,t.Points=an,t.PointsMaterial=rn,t.PolarGridHelper=Ra,t.PolyhedronBufferGeometry=mn,t.PolyhedronGeometry=fn,t.PositionalAudio=ua,t.PropertyBinding=fa,t.PropertyMixer=pa,t.QuadraticBezierCurve=Ri,t.QuadraticBezierCurve3=Pi,t.Quaternion=Ml,t.QuaternionKeyframeTrack=Zr,t.QuaternionLinearInterpolant=Yr,t.REVISION="120",t.RGBADepthPacking=rl,t.RGBAFormat=Zs,t.RGBAIntegerFormat=oc,t.RGBA_ASTC_10x10_Format=Rc,t.RGBA_ASTC_10x5_Format=Ec,t.RGBA_ASTC_10x6_Format=Ac,t.RGBA_ASTC_10x8_Format=Lc,t.RGBA_ASTC_12x10_Format=Pc,t.RGBA_ASTC_12x12_Format=Cc,t.RGBA_ASTC_4x4_Format=yc,t.RGBA_ASTC_5x4_Format=xc,t.RGBA_ASTC_5x5_Format=bc,t.RGBA_ASTC_6x5_Format=_c,t.RGBA_ASTC_6x6_Format=wc,t.RGBA_ASTC_8x5_Format=Mc,t.RGBA_ASTC_8x6_Format=Sc,t.RGBA_ASTC_8x8_Format=Tc,t.RGBA_BPTC_Format=Oc,t.RGBA_ETC2_EAC_Format=gc,t.RGBA_PVRTC_2BPPV1_Format=fc,t.RGBA_PVRTC_4BPPV1_Format=dc,t.RGBA_S3TC_DXT1_Format=cc,t.RGBA_S3TC_DXT3_Format=lc,t.RGBA_S3TC_DXT5_Format=hc,t.RGBDEncoding=el,t.RGBEEncoding=Qc,t.RGBEFormat=Ks,t.RGBFormat=Ys,t.RGBIntegerFormat=ac,t.RGBM16Encoding=tl,t.RGBM7Encoding=$c,t.RGB_ETC1_Format=mc,t.RGB_ETC2_Format=vc,t.RGB_PVRTC_2BPPV1_Format=pc,t.RGB_PVRTC_4BPPV1_Format=uc,t.RGB_S3TC_DXT1_Format=sc,t.RGFormat=rc,t.RGIntegerFormat=ic,t.RawShaderMaterial=Cr,t.Ray=Ql,t.Raycaster=xa,t.RectAreaLight=qi,t.RedFormat=ec,t.RedIntegerFormat=nc,t.ReinhardToneMapping=vs,t.RepeatWrapping=Es,t.ReplaceStencilOp=7681,t.ReverseSubtractEquation=Vo,t.RingBufferGeometry=gr,t.RingGeometry=vr,t.SRGB8_ALPHA8_ASTC_10x10_Format=jc,t.SRGB8_ALPHA8_ASTC_10x5_Format=Hc,t.SRGB8_ALPHA8_ASTC_10x6_Format=kc,t.SRGB8_ALPHA8_ASTC_10x8_Format=Vc,t.SRGB8_ALPHA8_ASTC_12x10_Format=Wc,t.SRGB8_ALPHA8_ASTC_12x12_Format=qc,t.SRGB8_ALPHA8_ASTC_4x4_Format=Ic,t.SRGB8_ALPHA8_ASTC_5x4_Format=Dc,t.SRGB8_ALPHA8_ASTC_5x5_Format=Nc,t.SRGB8_ALPHA8_ASTC_6x5_Format=Bc,t.SRGB8_ALPHA8_ASTC_6x6_Format=zc,t.SRGB8_ALPHA8_ASTC_8x5_Format=Gc,t.SRGB8_ALPHA8_ASTC_8x6_Format=Fc,t.SRGB8_ALPHA8_ASTC_8x8_Format=Uc,t.Scene=ke,t.SceneUtils=hf,t.ShaderChunk=Pu,t.ShaderLib=Ou,t.ShaderMaterial=I,t.ShadowMaterial=Pr,t.Shape=Di,t.ShapeBufferGeometry=_r,t.ShapeGeometry=br,t.ShapePath=ta,t.ShapeUtils=Op,t.ShortType=zs,t.Skeleton=Je,t.SkeletonHelper=Sa,t.SkinnedMesh=Ze,t.SmoothShading=2,t.Sphere=Vl,t.SphereBufferGeometry=mr,t.SphereGeometry=fr,t.Spherical=Md,t.SphericalHarmonics3=Wp,t.Spline=po,t.SplineCurve=Ci,t.SplineCurve3=uo,t.SpotLight=Fi,t.SpotLightHelper=Ma,t.Sprite=qe,t.SpriteMaterial=We,t.SrcAlphaFactor=Jo,t.SrcAlphaSaturateFactor=ns,t.SrcColorFactor=Yo,t.StaticCopyUsage=35046,t.StaticDrawUsage=cl,t.StaticReadUsage=35045,t.StereoCamera=ca;t.StreamCopyUsage=35042,t.StreamDrawUsage=35040,t.StreamReadUsage=35041,t.StringKeyframeTrack=Jr,t.SubtractEquation=ko,t.SubtractiveBlending=Go,t.TOUCH=To,t.TangentSpaceNormalMap=il,t.TetrahedronBufferGeometry=gn,t.TetrahedronGeometry=vn,t.TextBufferGeometry=dr,t.TextGeometry=pr,t.Texture=n,t.TextureLoader=li,t.TorusBufferGeometry=Rn,t.TorusGeometry=Ln,t.TorusKnotBufferGeometry=An,t.TorusKnotGeometry=En,t.Triangle=Gh,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=Tn,t.TubeGeometry=Sn,t.UVMapping=300,t.Uint16Attribute=ao,t.Uint16BufferAttribute=y,t.Uint32Attribute=so,t.Uint32BufferAttribute=b,t.Uint8Attribute=no,t.Uint8BufferAttribute=m,t.Uint8ClampedAttribute=ro,t.Uint8ClampedBufferAttribute=v,t.Uniform=wd,t.UniformsLib=Cu,t.UniformsUtils=wu,t.UnsignedByteType=Ns,t.UnsignedInt248Type=qs,t.UnsignedIntType=Us,t.UnsignedShort4444Type=Vs,t.UnsignedShort5551Type=js,t.UnsignedShort565Type=Ws,t.UnsignedShortType=Gs,t.VSMShadowMap=Co,t.Vector2=ml,t.Vector3=Tl,t.Vector4=_l,t.VectorKeyframeTrack=Qr,t.Vertex=$a,t.VertexColors=2,t.VideoTexture=sn,t.WebGL1Renderer=He,t.WebGLCubeRenderTarget=z,t.WebGLMultisampleRenderTarget=i,t.WebGLRenderTarget=r,t.WebGLRenderTargetCube=bo,t.WebGLRenderer=Ue,t.WebGLUtils=De,t.WireframeGeometry=un,t.WireframeHelper=go,t.WrapAroundEnding=2402,t.XHRLoader=yo,t.ZeroCurvatureEnding=2400,t.ZeroFactor=qo,t.ZeroSlopeEnding=2401,t.ZeroStencilOp=0,t.sRGBEncoding=Zc,Object.defineProperty(t,"__esModule",{"value":!0})})}]);