@micromag/viewer-build 0.2.404 → 0.2.405

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/build/static/css/main.c82d5346.css +5 -0
  2. package/build/static/css/main.c82d5346.css.map +1 -0
  3. package/build/static/css/main.f4d95294.chunk.css +2 -0
  4. package/build/static/css/main.f4d95294.chunk.css.map +1 -0
  5. package/build/static/js/0.a8781713.chunk.js +2 -0
  6. package/build/static/js/0.a8781713.chunk.js.map +1 -0
  7. package/build/static/js/1.310fc8fa.chunk.js +2 -0
  8. package/build/static/js/1.310fc8fa.chunk.js.map +1 -0
  9. package/build/static/js/10.1621cab3.chunk.js +2 -0
  10. package/build/static/js/10.1621cab3.chunk.js.map +1 -0
  11. package/build/static/js/11.c52bdfa2.chunk.js +2 -0
  12. package/build/static/js/11.c52bdfa2.chunk.js.map +1 -0
  13. package/build/static/js/12.703b846d.chunk.js +2 -0
  14. package/build/static/js/12.703b846d.chunk.js.map +1 -0
  15. package/build/static/js/13.e2bba628.chunk.js +2 -0
  16. package/build/static/js/13.e2bba628.chunk.js.map +1 -0
  17. package/build/static/js/14.68d2783a.chunk.js +2 -0
  18. package/build/static/js/14.68d2783a.chunk.js.map +1 -0
  19. package/build/static/js/15.f1290dcc.chunk.js +2 -0
  20. package/build/static/js/15.f1290dcc.chunk.js.map +1 -0
  21. package/build/static/js/4.1b97e2f2.chunk.js +3 -0
  22. package/build/static/js/{main.f0bf47ba.js.LICENSE.txt → 4.1b97e2f2.chunk.js.LICENSE.txt} +9 -0
  23. package/build/static/js/4.1b97e2f2.chunk.js.map +1 -0
  24. package/build/static/js/5.02c40704.chunk.js +2 -0
  25. package/build/static/js/5.02c40704.chunk.js.map +1 -0
  26. package/build/static/js/6.9364266f.chunk.js +2 -0
  27. package/build/static/js/6.9364266f.chunk.js.map +1 -0
  28. package/build/static/js/7.7aec7172.chunk.js +2 -0
  29. package/build/static/js/7.7aec7172.chunk.js.map +1 -0
  30. package/build/static/js/8.6cb2151e.chunk.js +2 -0
  31. package/build/static/js/8.6cb2151e.chunk.js.map +1 -0
  32. package/build/static/js/9.54c11089.chunk.js +2 -0
  33. package/build/static/js/9.54c11089.chunk.js.map +1 -0
  34. package/build/static/js/main.be16dbbf.js +2 -0
  35. package/build/static/js/main.be16dbbf.js.map +1 -0
  36. package/build/static/js/main.d8c7f159.chunk.js +2 -0
  37. package/build/static/js/main.d8c7f159.chunk.js.map +1 -0
  38. package/build/static/js/runtime-main.ba9f82db.js +2 -0
  39. package/build/static/js/runtime-main.ba9f82db.js.map +1 -0
  40. package/package.json +7 -7
  41. package/build/static/css/main.bf425f45.css +0 -2
  42. package/build/static/css/main.bf425f45.css.map +0 -1
  43. package/build/static/js/584.712e20c9.js +0 -3
  44. package/build/static/js/584.712e20c9.js.LICENSE.txt +0 -109
  45. package/build/static/js/584.712e20c9.js.map +0 -1
  46. package/build/static/js/596.16611391.chunk.js +0 -2
  47. package/build/static/js/596.16611391.chunk.js.map +0 -1
  48. package/build/static/js/main.1db78e0c.js +0 -2
  49. package/build/static/js/main.1db78e0c.js.map +0 -1
  50. package/build/static/js/main.d207f62a.js +0 -2
  51. package/build/static/js/main.d207f62a.js.map +0 -1
  52. package/build/static/js/main.f0bf47ba.js +0 -3
  53. package/build/static/js/main.f0bf47ba.js.map +0 -1
  54. package/build/static/media/index.06ad11ea3e32fd3e4303.cjs +0 -1
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[596],{8596:function(e,t,n){n.r(t),n.d(t,{ACESFilmicToneMapping:function(){return de},AddEquation:function(){return N},AddOperation:function(){return se},AdditiveAnimationBlendMode:function(){return nn},AdditiveBlending:function(){return P},AlphaFormat:function(){return Ze},AlwaysDepth:function(){return K},AlwaysStencilFunc:function(){return Dn},AmbientLight:function(){return Gh},AmbientLightProbe:function(){return ld},AnimationClip:function(){return qc},AnimationLoader:function(){return th},AnimationMixer:function(){return Hd},AnimationObjectGroup:function(){return Gd},AnimationUtils:function(){return Dc},ArcCurve:function(){return lh},ArrayCamera:function(){return Hs},ArrowHelper:function(){return kp},Audio:function(){return _d},AudioAnalyser:function(){return Ed},AudioContext:function(){return od},AudioListener:function(){return xd},AudioLoader:function(){return sd},AxesHelper:function(){return Ip},AxisHelper:function(){return If},BackSide:function(){return T},BasicDepthPacking:function(){return mn},BasicShadowMap:function(){return _},BinaryTextureLoader:function(){return zf},Bone:function(){return bu},BooleanKeyframeTrack:function(){return Gc},BoundingBoxHelper:function(){return Df},Box2:function(){return Kd},Box3:function(){return hr},Box3Helper:function(){return Rp},BoxBufferGeometry:function(){return Ta},BoxGeometry:function(){return rl},BoxHelper:function(){return Lp},BufferAttribute:function(){return Oi},BufferGeometry:function(){return ia},BufferGeometryLoader:function(){return Xh},ByteType:function(){return Ne},Cache:function(){return Yc},Camera:function(){return Ca},CameraHelper:function(){return Mp},CanvasRenderer:function(){return Ff},CanvasTexture:function(){return Ju},CatmullRomCurve3:function(){return mh},CineonToneMapping:function(){return he},CircleBufferGeometry:function(){return il},CircleGeometry:function(){return al},ClampToEdgeWrapping:function(){return we},Clock:function(){return pd},ClosedSplineCurve3:function(){return Cf},Color:function(){return Ri},ColorKeyframeTrack:function(){return Fc},CompressedTexture:function(){return Yu},CompressedTextureLoader:function(){return nh},ConeBufferGeometry:function(){return ll},ConeGeometry:function(){return ul},CubeCamera:function(){return Ia},CubeGeometry:function(){return rl},CubeReflectionMapping:function(){return me},CubeRefractionMapping:function(){return ve},CubeTexture:function(){return Da},CubeTextureLoader:function(){return ih},CubeUVReflectionMapping:function(){return xe},CubeUVRefractionMapping:function(){return _e},CubicBezierCurve:function(){return xh},CubicBezierCurve3:function(){return _h},CubicInterpolant:function(){return Oc},CullFaceBack:function(){return g},CullFaceFront:function(){return y},CullFaceFrontBack:function(){return x},CullFaceNone:function(){return v},Curve:function(){return sh},CurvePath:function(){return Ah},CustomBlending:function(){return D},CustomToneMapping:function(){return pe},CylinderBufferGeometry:function(){return ol},CylinderGeometry:function(){return sl},Cylindrical:function(){return Jd},DataTexture:function(){return Oa},DataTexture2DArray:function(){return oo},DataTexture3D:function(){return so},DataTextureLoader:function(){return ah},DataUtils:function(){return Op},DecrementStencilOp:function(){return Mn},DecrementWrapStencilOp:function(){return Tn},DefaultLoadingManager:function(){return Qc},DepthFormat:function(){return Ke},DepthStencilFormat:function(){return $e},DepthTexture:function(){return Qu},DirectionalLight:function(){return Uh},DirectionalLightHelper:function(){return _p},DiscreteInterpolant:function(){return zc},DodecahedronBufferGeometry:function(){return hl},DodecahedronGeometry:function(){return dl},DoubleSide:function(){return E},DstAlphaFactor:function(){return Z},DstColorFactor:function(){return X},DynamicBufferAttribute:function(){return _f},DynamicCopyUsage:function(){return Hn},DynamicDrawUsage:function(){return On},DynamicReadUsage:function(){return Un},EdgesGeometry:function(){return gl},EdgesHelper:function(){return Nf},EllipseCurve:function(){return uh},EqualDepth:function(){return te},EqualStencilFunc:function(){return Rn},EquirectangularReflectionMapping:function(){return ge},EquirectangularRefractionMapping:function(){return ye},Euler:function(){return Wr},EventDispatcher:function(){return Zn},ExtrudeBufferGeometry:function(){return Zl},ExtrudeGeometry:function(){return Xl},Face3:function(){return Ci},Face4:function(){return af},FaceColors:function(){return lf},FileLoader:function(){return eh},FlatShading:function(){return A},Float16BufferAttribute:function(){return Wi},Float32Attribute:function(){return Lf},Float32BufferAttribute:function(){return ji},Float64Attribute:function(){return Rf},Float64BufferAttribute:function(){return Zi},FloatType:function(){return Ge},Fog:function(){return Js},FogExp2:function(){return Ys},Font:function(){return nd},FontLoader:function(){return ad},FrontSide:function(){return S},Frustum:function(){return Ua},GLBufferAttribute:function(){return jd},GLSL1:function(){return Wn},GLSL3:function(){return jn},GammaEncoding:function(){return ln},Geometry:function(){return nl},GeometryUtils:function(){return Gf},GreaterDepth:function(){return re},GreaterEqualDepth:function(){return ne},GreaterEqualStencilFunc:function(){return In},GreaterStencilFunc:function(){return Pn},GridHelper:function(){return mp},Group:function(){return Vs},HalfFloatType:function(){return Fe},HemisphereLight:function(){return Ph},HemisphereLightHelper:function(){return fp},HemisphereLightProbe:function(){return ud},IcosahedronBufferGeometry:function(){return Yl},IcosahedronGeometry:function(){return Jl},ImageBitmapLoader:function(){return ed},ImageLoader:function(){return rh},ImageUtils:function(){return er},ImmediateRenderObject:function(){return np},IncrementStencilOp:function(){return wn},IncrementWrapStencilOp:function(){return Sn},InstancedBufferAttribute:function(){return qh},InstancedBufferGeometry:function(){return Zh},InstancedInterleavedBuffer:function(){return Wd},InstancedMesh:function(){return Ru},Int16Attribute:function(){return Sf},Int16BufferAttribute:function(){return Gi},Int32Attribute:function(){return Ef},Int32BufferAttribute:function(){return Hi},Int8Attribute:function(){return bf},Int8BufferAttribute:function(){return Bi},IntType:function(){return ze},InterleavedBuffer:function(){return Ks},InterleavedBufferAttribute:function(){return tu},Interpolant:function(){return Nc},InterpolateDiscrete:function(){return Yt},InterpolateLinear:function(){return Jt},InterpolateSmooth:function(){return Qt},InvertStencilOp:function(){return En},JSONLoader:function(){return Hf},KeepStencilOp:function(){return _n},KeyframeTrack:function(){return Uc},LOD:function(){return xu},LatheBufferGeometry:function(){return Ql},LatheGeometry:function(){return Kl},Layers:function(){return qr},LensFlare:function(){return Wf},LessDepth:function(){return $},LessEqualDepth:function(){return ee},LessEqualStencilFunc:function(){return Cn},LessStencilFunc:function(){return Ln},Light:function(){return Ch},LightProbe:function(){return Vh},Line:function(){return Ou},Line3:function(){return tp},LineBasicMaterial:function(){return Cu},LineCurve:function(){return bh},LineCurve3:function(){return wh},LineDashedMaterial:function(){return kc},LineLoop:function(){return Gu},LinePieces:function(){return sf},LineSegments:function(){return Uu},LineStrip:function(){return of},LinearEncoding:function(){return sn},LinearFilter:function(){return Re},LinearInterpolant:function(){return Bc},LinearMipMapLinearFilter:function(){return Ie},LinearMipMapNearestFilter:function(){return Pe},LinearMipmapLinearFilter:function(){return ke},LinearMipmapNearestFilter:function(){return Ce},LinearToneMapping:function(){return le},Loader:function(){return Kc},LoaderUtils:function(){return jh},LoadingManager:function(){return Jc},LogLuvEncoding:function(){return hn},LoopOnce:function(){return Zt},LoopPingPong:function(){return Xt},LoopRepeat:function(){return qt},LuminanceAlphaFormat:function(){return Je},LuminanceFormat:function(){return Ye},MOUSE:function(){return f},Material:function(){return ki},MaterialLoader:function(){return Wh},Math:function(){return Qn},MathUtils:function(){return Qn},Matrix3:function(){return $n},Matrix4:function(){return Or},MaxEquation:function(){return U},Mesh:function(){return wa},MeshBasicMaterial:function(){return Ii},MeshDepthMaterial:function(){return Os},MeshDistanceMaterial:function(){return Bs},MeshFaceMaterial:function(){return hf},MeshLambertMaterial:function(){return Cc},MeshMatcapMaterial:function(){return Pc},MeshNormalMaterial:function(){return Rc},MeshPhongMaterial:function(){return Ac},MeshPhysicalMaterial:function(){return Ec},MeshStandardMaterial:function(){return Tc},MeshToonMaterial:function(){return Lc},MinEquation:function(){return z},MirroredRepeatWrapping:function(){return Me},MixOperation:function(){return oe},MultiMaterial:function(){return df},MultiplyBlending:function(){return I},MultiplyOperation:function(){return ae},NearestFilter:function(){return Se},NearestMipMapLinearFilter:function(){return Le},NearestMipMapNearestFilter:function(){return Ee},NearestMipmapLinearFilter:function(){return Ae},NearestMipmapNearestFilter:function(){return Te},NeverDepth:function(){return Q},NeverStencilFunc:function(){return An},NoBlending:function(){return R},NoColors:function(){return uf},NoToneMapping:function(){return ue},NormalAnimationBlendMode:function(){return tn},NormalBlending:function(){return C},NotEqualDepth:function(){return ie},NotEqualStencilFunc:function(){return kn},NumberKeyframeTrack:function(){return Hc},Object3D:function(){return si},ObjectLoader:function(){return Jh},ObjectSpaceNormalMap:function(){return yn},OctahedronBufferGeometry:function(){return $l},OctahedronGeometry:function(){return ec},OneFactor:function(){return F},OneMinusDstAlphaFactor:function(){return q},OneMinusDstColorFactor:function(){return Y},OneMinusSrcAlphaFactor:function(){return j},OneMinusSrcColorFactor:function(){return V},OrthographicCamera:function(){return Bh},PCFShadowMap:function(){return b},PCFSoftShadowMap:function(){return w},PMREMGenerator:function(){return Qp},ParametricBufferGeometry:function(){return tc},ParametricGeometry:function(){return nc},Particle:function(){return ff},ParticleBasicMaterial:function(){return gf},ParticleSystem:function(){return mf},ParticleSystemMaterial:function(){return yf},Path:function(){return Lh},PerspectiveCamera:function(){return Pa},Plane:function(){return hi},PlaneBufferGeometry:function(){return Ha},PlaneGeometry:function(){return rc},PlaneHelper:function(){return Cp},PointCloud:function(){return pf},PointCloudMaterial:function(){return vf},PointLight:function(){return Oh},PointLightHelper:function(){return cp},Points:function(){return Zu},PointsMaterial:function(){return Fu},PolarGridHelper:function(){return vp},PolyhedronBufferGeometry:function(){return cl},PolyhedronGeometry:function(){return ic},PositionalAudio:function(){return Td},PropertyBinding:function(){return Ud},PropertyMixer:function(){return Ad},QuadraticBezierCurve:function(){return Mh},QuadraticBezierCurve3:function(){return Sh},Quaternion:function(){return sr},QuaternionKeyframeTrack:function(){return Wc},QuaternionLinearInterpolant:function(){return Vc},REVISION:function(){return p},RGBADepthPacking:function(){return vn},RGBAFormat:function(){return Xe},RGBAIntegerFormat:function(){return at},RGBA_ASTC_10x10_Format:function(){return Lt},RGBA_ASTC_10x5_Format:function(){return Tt},RGBA_ASTC_10x6_Format:function(){return Et},RGBA_ASTC_10x8_Format:function(){return At},RGBA_ASTC_12x10_Format:function(){return Rt},RGBA_ASTC_12x12_Format:function(){return Ct},RGBA_ASTC_4x4_Format:function(){return gt},RGBA_ASTC_5x4_Format:function(){return yt},RGBA_ASTC_5x5_Format:function(){return xt},RGBA_ASTC_6x5_Format:function(){return _t},RGBA_ASTC_6x6_Format:function(){return bt},RGBA_ASTC_8x5_Format:function(){return wt},RGBA_ASTC_8x6_Format:function(){return Mt},RGBA_ASTC_8x8_Format:function(){return St},RGBA_BPTC_Format:function(){return Pt},RGBA_ETC2_EAC_Format:function(){return vt},RGBA_PVRTC_2BPPV1_Format:function(){return pt},RGBA_PVRTC_4BPPV1_Format:function(){return dt},RGBA_S3TC_DXT1_Format:function(){return st},RGBA_S3TC_DXT3_Format:function(){return ut},RGBA_S3TC_DXT5_Format:function(){return lt},RGBDEncoding:function(){return fn},RGBEEncoding:function(){return cn},RGBEFormat:function(){return Qe},RGBFormat:function(){return qe},RGBIntegerFormat:function(){return it},RGBM16Encoding:function(){return pn},RGBM7Encoding:function(){return dn},RGB_ETC1_Format:function(){return ft},RGB_ETC2_Format:function(){return mt},RGB_PVRTC_2BPPV1_Format:function(){return ht},RGB_PVRTC_4BPPV1_Format:function(){return ct},RGB_S3TC_DXT1_Format:function(){return ot},RGFormat:function(){return nt},RGIntegerFormat:function(){return rt},RawShaderMaterial:function(){return Sc},Ray:function(){return Nr},Raycaster:function(){return Zd},RectAreaLight:function(){return Fh},RedFormat:function(){return et},RedIntegerFormat:function(){return tt},ReinhardToneMapping:function(){return ce},RepeatWrapping:function(){return be},ReplaceStencilOp:function(){return bn},ReverseSubtractEquation:function(){return B},RingBufferGeometry:function(){return ac},RingGeometry:function(){return oc},SRGB8_ALPHA8_ASTC_10x10_Format:function(){return Vt},SRGB8_ALPHA8_ASTC_10x5_Format:function(){return Gt},SRGB8_ALPHA8_ASTC_10x6_Format:function(){return Ft},SRGB8_ALPHA8_ASTC_10x8_Format:function(){return Ht},SRGB8_ALPHA8_ASTC_12x10_Format:function(){return Wt},SRGB8_ALPHA8_ASTC_12x12_Format:function(){return jt},SRGB8_ALPHA8_ASTC_4x4_Format:function(){return kt},SRGB8_ALPHA8_ASTC_5x4_Format:function(){return It},SRGB8_ALPHA8_ASTC_5x5_Format:function(){return Dt},SRGB8_ALPHA8_ASTC_6x5_Format:function(){return Nt},SRGB8_ALPHA8_ASTC_6x6_Format:function(){return Ot},SRGB8_ALPHA8_ASTC_8x5_Format:function(){return Bt},SRGB8_ALPHA8_ASTC_8x6_Format:function(){return zt},SRGB8_ALPHA8_ASTC_8x8_Format:function(){return Ut},Scene:function(){return Qs},SceneUtils:function(){return Vf},ShaderChunk:function(){return Va},ShaderLib:function(){return ja},ShaderMaterial:function(){return Ra},ShadowMaterial:function(){return Mc},Shape:function(){return Rh},ShapeBufferGeometry:function(){return sc},ShapeGeometry:function(){return uc},ShapePath:function(){return td},ShapeUtils:function(){return Vl},ShortType:function(){return Oe},Skeleton:function(){return Su},SkeletonHelper:function(){return up},SkinnedMesh:function(){return _u},SmoothShading:function(){return L},Sphere:function(){return Ar},SphereBufferGeometry:function(){return lc},SphereGeometry:function(){return cc},Spherical:function(){return Yd},SphericalHarmonics3:function(){return Hh},Spline:function(){return kf},SplineCurve:function(){return Th},SplineCurve3:function(){return Pf},SpotLight:function(){return Dh},SpotLightHelper:function(){return ip},Sprite:function(){return mu},SpriteMaterial:function(){return nu},SrcAlphaFactor:function(){return W},SrcAlphaSaturateFactor:function(){return J},SrcColorFactor:function(){return H},StaticCopyUsage:function(){return Fn},StaticDrawUsage:function(){return Nn},StaticReadUsage:function(){return zn},StereoCamera:function(){return dd},StreamCopyUsage:function(){return Vn},StreamDrawUsage:function(){return Bn},StreamReadUsage:function(){return Gn},StringKeyframeTrack:function(){return jc},SubtractEquation:function(){return O},SubtractiveBlending:function(){return k},TOUCH:function(){return m},TangentSpaceNormalMap:function(){return gn},TetrahedronBufferGeometry:function(){return hc},TetrahedronGeometry:function(){return dc},TextBufferGeometry:function(){return pc},TextGeometry:function(){return fc},Texture:function(){return nr},TextureLoader:function(){return oh},TorusBufferGeometry:function(){return mc},TorusGeometry:function(){return vc},TorusKnotBufferGeometry:function(){return gc},TorusKnotGeometry:function(){return yc},Triangle:function(){return wi},TriangleFanDrawMode:function(){return on},TriangleStripDrawMode:function(){return an},TrianglesDrawMode:function(){return rn},TubeBufferGeometry:function(){return xc},TubeGeometry:function(){return _c},UVMapping:function(){return fe},Uint16Attribute:function(){return Tf},Uint16BufferAttribute:function(){return Fi},Uint32Attribute:function(){return Af},Uint32BufferAttribute:function(){return Vi},Uint8Attribute:function(){return wf},Uint8BufferAttribute:function(){return zi},Uint8ClampedAttribute:function(){return Mf},Uint8ClampedBufferAttribute:function(){return Ui},Uniform:function(){return Vd},UniformsLib:function(){return Wa},UniformsUtils:function(){return La},UnsignedByteType:function(){return De},UnsignedInt248Type:function(){return je},UnsignedIntType:function(){return Ue},UnsignedShort4444Type:function(){return He},UnsignedShort5551Type:function(){return Ve},UnsignedShort565Type:function(){return We},UnsignedShortType:function(){return Be},VSMShadowMap:function(){return M},Vector2:function(){return Kn},Vector3:function(){return ur},Vector4:function(){return ir},VectorKeyframeTrack:function(){return Zc},Vertex:function(){return xf},VertexColors:function(){return cf},VideoTexture:function(){return Xu},WebGL1Renderer:function(){return Xs},WebGLCubeRenderTarget:function(){return Na},WebGLMultisampleRenderTarget:function(){return or},WebGLRenderTarget:function(){return ar},WebGLRenderTargetCube:function(){return Uf},WebGLRenderer:function(){return qs},WebGLUtils:function(){return Fs},WireframeGeometry:function(){return bc},WireframeHelper:function(){return Of},WrapAroundEnding:function(){return en},XHRLoader:function(){return Bf},ZeroCurvatureEnding:function(){return Kt},ZeroFactor:function(){return G},ZeroSlopeEnding:function(){return $t},ZeroStencilOp:function(){return xn},sRGBEncoding:function(){return un}});var r,i=n(1987),a=n(3069),o=n(5058),s=n(6666),u=n(753),l=n(5754),c=n(6906),h=n(9249),d=n(7371),p="123",f={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},m={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},v=0,g=1,y=2,x=3,_=0,b=1,w=2,M=3,S=0,T=1,E=2,A=1,L=2,R=0,C=1,P=2,k=3,I=4,D=5,N=100,O=101,B=102,z=103,U=104,G=200,F=201,H=202,V=203,W=204,j=205,Z=206,q=207,X=208,Y=209,J=210,Q=0,K=1,$=2,ee=3,te=4,ne=5,re=6,ie=7,ae=0,oe=1,se=2,ue=0,le=1,ce=2,he=3,de=4,pe=5,fe=300,me=301,ve=302,ge=303,ye=304,xe=306,_e=307,be=1e3,we=1001,Me=1002,Se=1003,Te=1004,Ee=1004,Ae=1005,Le=1005,Re=1006,Ce=1007,Pe=1007,ke=1008,Ie=1008,De=1009,Ne=1010,Oe=1011,Be=1012,ze=1013,Ue=1014,Ge=1015,Fe=1016,He=1017,Ve=1018,We=1019,je=1020,Ze=1021,qe=1022,Xe=1023,Ye=1024,Je=1025,Qe=Xe,Ke=1026,$e=1027,et=1028,tt=1029,nt=1030,rt=1031,it=1032,at=1033,ot=33776,st=33777,ut=33778,lt=33779,ct=35840,ht=35841,dt=35842,pt=35843,ft=36196,mt=37492,vt=37496,gt=37808,yt=37809,xt=37810,_t=37811,bt=37812,wt=37813,Mt=37814,St=37815,Tt=37816,Et=37817,At=37818,Lt=37819,Rt=37820,Ct=37821,Pt=36492,kt=37840,It=37841,Dt=37842,Nt=37843,Ot=37844,Bt=37845,zt=37846,Ut=37847,Gt=37848,Ft=37849,Ht=37850,Vt=37851,Wt=37852,jt=37853,Zt=2200,qt=2201,Xt=2202,Yt=2300,Jt=2301,Qt=2302,Kt=2400,$t=2401,en=2402,tn=2500,nn=2501,rn=0,an=1,on=2,sn=3e3,un=3001,ln=3007,cn=3002,hn=3003,dn=3004,pn=3005,fn=3006,mn=3200,vn=3201,gn=0,yn=1,xn=0,_n=7680,bn=7681,wn=7682,Mn=7683,Sn=34055,Tn=34056,En=5386,An=512,Ln=513,Rn=514,Cn=515,Pn=516,kn=517,In=518,Dn=519,Nn=35044,On=35048,Bn=35040,zn=35045,Un=35049,Gn=35041,Fn=35046,Hn=35050,Vn=35042,Wn="100",jn="300 es";function Zn(){}Object.assign(Zn.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});for(var qn=[],Xn=0;Xn<256;Xn++)qn[Xn]=(Xn<16?"0":"")+Xn.toString(16);var Yn,Jn=1234567,Qn={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(qn[255&e]+qn[e>>8&255]+qn[e>>16&255]+qn[e>>24&255]+"-"+qn[255&t]+qn[t>>8&255]+"-"+qn[t>>16&15|64]+qn[t>>24&255]+"-"+qn[63&n|128]+qn[n>>8&255]+"-"+qn[n>>16&255]+qn[n>>24&255]+qn[255&r]+qn[r>>8&255]+qn[r>>16&255]+qn[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(Jn=e%2147483647),((Jn=16807*Jn%2147483647)-1)/2147483646},degToRad:function(e){return e*Qn.DEG2RAD},radToDeg:function(e){return e*Qn.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),u=o(n/2),l=a((t+r)/2),c=o((t+r)/2),h=a((t-r)/2),d=o((t-r)/2),p=a((r-t)/2),f=o((r-t)/2);switch(i){case"XYX":e.set(s*c,u*h,u*d,s*l);break;case"YZY":e.set(u*d,s*c,u*h,s*l);break;case"ZXZ":e.set(u*h,u*d,s*c,s*l);break;case"XZX":e.set(s*c,u*f,u*p,s*l);break;case"YXY":e.set(u*p,s*c,u*f,s*l);break;case"ZYZ":e.set(u*f,u*p,s*c,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}},Kn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,h.Z)(this,e),Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=n}return(0,d.Z)(e,[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value: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}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}}]),e}(),$n=function(){function e(){(0,h.Z)(this,e),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.")}return(0,d.Z)(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,u){var l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],u=n[1],l=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],v=r[6],g=r[1],y=r[4],x=r[7],_=r[2],b=r[5],w=r[8];return i[0]=a*f+o*g+s*_,i[3]=a*m+o*y+s*b,i[6]=a*v+o*x+s*w,i[1]=u*f+l*g+c*_,i[4]=u*m+l*y+c*b,i[7]=u*v+l*x+c*w,i[2]=h*f+d*g+p*_,i[5]=h*m+d*y+p*b,i[8]=h*v+d*x+p*w,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],l=e[8];return t*a*l-t*o*u-n*i*l+n*o*s+r*i*u-r*a*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=l*a-o*u,h=o*s-l*i,d=u*i-a*s,p=t*c+n*h+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);var f=1/p;return e[0]=c*f,e[1]=(r*u-l*n)*f,e[2]=(o*n-r*a)*f,e[3]=h*f,e[4]=(l*t-r*s)*f,e[5]=(r*i-o*t)*f,e[6]=d*f,e[7]=(n*s-u*t)*f,e[8]=(a*t-n*i)*f,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).copy(this).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,n,r,i,a,o){var s=Math.cos(i),u=Math.sin(i);this.set(n*s,n*u,-n*(s*a+u*o)+a+e,-r*u,r*s,-r*(-u*a+s*o)+o+t,0,0,1)}},{key:"scale",value:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],u=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*u,r[6]=t*o+n*l,r[1]=-n*i+t*s,r[4]=-n*a+t*u,r[7]=-n*o+t*l,this}},{key:"translate",value:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}]),e}(),er={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Yn&&(Yn=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Yn.width=e.width,Yn.height=e.height;var n=Yn.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Yn}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},tr=0;function nr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nr.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nr.DEFAULT_MAPPING,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:we,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:we,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Re,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:ke,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Xe,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:De,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:sn;Object.defineProperty(this,"id",{value:tr++}),this.uuid=Qn.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Kn(0,0),this.repeat=new Kn(1,1),this.center=new Kn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $n,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l,this.version=0,this.onUpdate=null}function rr(e){return"undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap?er.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}nr.DEFAULT_IMAGE=void 0,nr.DEFAULT_MAPPING=fe,nr.prototype=Object.assign(Object.create(Zn.prototype),{constructor:nr,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(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.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=Qn.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)r[a].isDataTexture?i.push(rr(r[a].image)):i.push(rr(r[a]))}else i=rr(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==fe)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case be:e.x=e.x-Math.floor(e.x);break;case we:e.x=e.x<0?0:1;break;case Me:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case be:e.y=e.y-Math.floor(e.y);break;case we:e.y=e.y<0?0:1;break;case Me:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(nr.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});var ir=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,h.Z)(this,e),Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=n,this.z=r,this.w=i}return(0,d.Z)(e,[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){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: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,a=.01,o=.1,s=e.elements,u=s[0],l=s[4],c=s[8],h=s[1],d=s[5],p=s[9],f=s[2],m=s[6],v=s[10];if(Math.abs(l-h)<a&&Math.abs(c-f)<a&&Math.abs(p-m)<a){if(Math.abs(l+h)<o&&Math.abs(c+f)<o&&Math.abs(p+m)<o&&Math.abs(u+d+v-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var g=(u+1)/2,y=(d+1)/2,x=(v+1)/2,_=(l+h)/4,b=(c+f)/4,w=(p+m)/4;return g>y&&g>x?g<a?(n=0,r=.707106781,i=.707106781):(r=_/(n=Math.sqrt(g)),i=b/n):y>x?y<a?(n=.707106781,r=0,i=.707106781):(n=_/(r=Math.sqrt(y)),i=w/r):x<a?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(x)),r=w/i),this.set(n,r,i,t),this}var M=Math.sqrt((m-p)*(m-p)+(c-f)*(c-f)+(h-l)*(h-l));return Math.abs(M)<.001&&(M=1),this.x=(m-p)/M,this.y=(c-f)/M,this.z=(h-l)/M,this.w=Math.acos((u+d+v-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value: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}},{key:"ceil",value: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}},{key:"round",value: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}},{key:"roundToZero",value: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}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}]),e}();function ar(e,t,n){this.width=e,this.height=t,this.scissor=new ir(0,0,e,t),this.scissorTest=!1,this.viewport=new ir(0,0,e,t),n=n||{},this.texture=new nr(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Re,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function or(e,t,n){ar.call(this,e,t,n),this.samples=4}ar.prototype=Object.assign(Object.create(Zn.prototype),{constructor:ar,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),or.prototype=Object.assign(Object.create(ar.prototype),{constructor:or,isWebGLMultisampleRenderTarget:!0,copy:function(e){return ar.prototype.copy.call(this,e),this.samples=e.samples,this}});var sr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,h.Z)(this,e),Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=n,this._z=r,this._w=i}return(0,d.Z)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,u=o(n/2),l=o(r/2),c=o(i/2),h=s(n/2),d=s(r/2),p=s(i/2);switch(a){case"XYZ":this._x=h*l*c+u*d*p,this._y=u*d*c-h*l*p,this._z=u*l*p+h*d*c,this._w=u*l*c-h*d*p;break;case"YXZ":this._x=h*l*c+u*d*p,this._y=u*d*c-h*l*p,this._z=u*l*p-h*d*c,this._w=u*l*c+h*d*p;break;case"ZXY":this._x=h*l*c-u*d*p,this._y=u*d*c+h*l*p,this._z=u*l*p+h*d*c,this._w=u*l*c-h*d*p;break;case"ZYX":this._x=h*l*c-u*d*p,this._y=u*d*c+h*l*p,this._z=u*l*p-h*d*c,this._w=u*l*c+h*d*p;break;case"YZX":this._x=h*l*c+u*d*p,this._y=u*d*c+h*l*p,this._z=u*l*p-h*d*c,this._w=u*l*c-h*d*p;break;case"XZY":this._x=h*l*c-u*d*p,this._y=u*d*c-h*l*p,this._z=u*l*p+h*d*c,this._w=u*l*c+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],u=t[2],l=t[6],c=t[10],h=n+o+c;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(l-s)*d,this._y=(i-u)*d,this._z=(a-r)*d}else if(n>o&&n>c){var p=2*Math.sqrt(1+n-o-c);this._w=(l-s)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(i+u)/p}else if(o>c){var f=2*Math.sqrt(1+o-n-c);this._w=(i-u)/f,this._x=(r+a)/f,this._y=.25*f,this._z=(s+l)/f}else{var m=2*Math.sqrt(1+c-n-o);this._w=(a-r)/m,this._x=(i+u)/m,this._y=(s+l)/m,this._z=.25*m}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(Qn.clamp(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,u=t._z,l=t._w;return this._x=n*l+a*o+r*u-i*s,this._y=r*l+a*s+i*o-n*u,this._z=i*l+a*u+n*s-r*o,this._w=a*l-n*o-r*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),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 u=1-t;return this._w=u*a+t*this._w,this._x=u*n+t*this._x,this._y=u*r+t*this._y,this._z=u*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),c=Math.atan2(l,o),h=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=a*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}}],[{key:"slerp",value:function(e,t,n,r){return n.copy(e).slerp(t,r)}},{key:"slerpFlat",value:function(e,t,n,r,i,a,o){var s=n[r+0],u=n[r+1],l=n[r+2],c=n[r+3],h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(c!==f||s!==h||u!==d||l!==p){var m=1-o,v=s*h+u*d+l*p+c*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,v*g);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*g;if(s=s*m+h*b,u=u*m+d*b,l=l*m+p*b,c=c*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+u*u+l*l+c*c);s*=w,u*=w,l*=w,c*=w}}e[t]=s,e[t+1]=u,e[t+2]=l,e[t+3]=c}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,a){var o=n[r],s=n[r+1],u=n[r+2],l=n[r+3],c=i[a],h=i[a+1],d=i[a+2],p=i[a+3];return e[t]=o*p+l*c+s*d-u*h,e[t+1]=s*p+l*h+u*c-o*d,e[t+2]=u*p+l*d+o*h-s*c,e[t+3]=l*p-o*c-s*h-u*d,e}}]),e}(),ur=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(0,h.Z)(this,e),Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=n,this.z=r}return(0,d.Z)(e,[{key:"set",value:function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(cr.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(cr.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}},{key:"applyQuaternion",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,u=s*t+a*r-o*n,l=s*n+o*t-i*r,c=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=u*s+h*-i+l*-o-c*-a,this.y=l*s+h*-a+c*-i-u*-o,this.z=c*s+h*-o+u*-a-l*-i,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value: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}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}},{key:"cross",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(e){return lr.copy(this).projectOnVector(e),this.sub(lr)}},{key:"reflect",value:function(e){return this.sub(lr.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(Qn.clamp(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}]),e}(),lr=new ur,cr=new sr,hr=function(){function e(t,n){(0,h.Z)(this,e),Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new ur(1/0,1/0,1/0),this.max=void 0!==n?n:new ur(-1/0,-1/0,-1/0)}return(0,d.Z)(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,u=e.length;s<u;s+=3){var l=e[s],c=e[s+1],h=e[s+2];l<t&&(t=l),c<n&&(n=c),h<r&&(r=h),l>i&&(i=l),c>a&&(a=c),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,u=e.count;s<u;s++){var l=e.getX(s),c=e.getY(s),h=e.getZ(s);l<t&&(t=l),c<n&&(n=c),h<r&&(r=h),l>i&&(i=l),c>a&&(a=c),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}},{key:"setFromCenterAndSize",value:function(e,t){var n=fr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}},{key:"setFromObject",value:function(e){return this.makeEmpty(),this.expandByObject(e)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value: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}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new ur),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new ur),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"expandByObject",value:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),mr.copy(t.boundingBox),mr.applyMatrix4(e.matrixWorld),this.union(mr));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this}},{key:"containsPoint",value:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new ur),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,fr),fr.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(wr),Mr.subVectors(this.max,wr),vr.subVectors(e.a,wr),gr.subVectors(e.b,wr),yr.subVectors(e.c,wr),xr.subVectors(gr,vr),_r.subVectors(yr,gr),br.subVectors(vr,yr);var t=[0,-xr.z,xr.y,0,-_r.z,_r.y,0,-br.z,br.y,xr.z,0,-xr.x,_r.z,0,-_r.x,br.z,0,-br.x,-xr.y,xr.x,0,-_r.y,_r.x,0,-br.y,br.x,0];return!!dr(t,vr,gr,yr,Mr)&&(!!dr(t=[1,0,0,0,1,0,0,0,1],vr,gr,yr,Mr)&&(Sr.crossVectors(xr,_r),dr(t=[Sr.x,Sr.y,Sr.z],vr,gr,yr,Mr)))}},{key:"clampPoint",value:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new ur),t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return fr.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"getBoundingSphere",value:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(fr).length(),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(pr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),pr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),pr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),pr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),pr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),pr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),pr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),pr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(pr)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}();function dr(e,t,n,r,i){for(var a=0,o=e.length-3;a<=o;a+=3){Tr.fromArray(e,a);var s=i.x*Math.abs(Tr.x)+i.y*Math.abs(Tr.y)+i.z*Math.abs(Tr.z),u=t.dot(Tr),l=n.dot(Tr),c=r.dot(Tr);if(Math.max(-Math.max(u,l,c),Math.min(u,l,c))>s)return!1}return!0}var pr=[new ur,new ur,new ur,new ur,new ur,new ur,new ur,new ur],fr=new ur,mr=new hr,vr=new ur,gr=new ur,yr=new ur,xr=new ur,_r=new ur,br=new ur,wr=new ur,Mr=new ur,Sr=new ur,Tr=new ur,Er=new hr,Ar=function(){function e(t,n){(0,h.Z)(this,e),this.center=void 0!==t?t:new ur,this.radius=void 0!==n?n:-1}return(0,d.Z)(e,[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var n=this.center;void 0!==t?n.copy(t):Er.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.center.copy(e.center),this.radius=e.radius,this}},{key:"isEmpty",value:function(){return this.radius<0}},{key:"makeEmpty",value:function(){return this.center.set(0,0,0),this.radius=-1,this}},{key:"containsPoint",value:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}},{key:"distanceToPoint",value:function(e){return e.distanceTo(this.center)-this.radius}},{key:"intersectsSphere",value:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}},{key:"intersectsBox",value:function(e){return e.intersectsSphere(this)}},{key:"intersectsPlane",value:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}},{key:"clampPoint",value:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new ur),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new hr),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}]),e}(),Lr=new ur,Rr=new ur,Cr=new ur,Pr=new ur,kr=new ur,Ir=new ur,Dr=new ur,Nr=function(){function e(t,n){(0,h.Z)(this,e),this.origin=void 0!==t?t:new ur,this.direction=void 0!==n?n:new ur(0,0,-1)}return(0,d.Z)(e,[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new ur),t.copy(this.direction).multiplyScalar(e).add(this.origin)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,Lr)),this}},{key:"closestPointToPoint",value:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new ur),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=Lr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Lr.copy(this.direction).multiplyScalar(t).add(this.origin),Lr.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,n,r){Rr.copy(e).add(t).multiplyScalar(.5),Cr.copy(t).sub(e).normalize(),Pr.copy(this.origin).sub(Rr);var i,a,o,s,u=.5*e.distanceTo(t),l=-this.direction.dot(Cr),c=Pr.dot(this.direction),h=-Pr.dot(Cr),d=Pr.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(a=l*c-h,s=u*p,(i=l*h-c)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(i*=f)*(i+l*(a*=f)+2*c)+a*(l*i+a+2*h)+d}else a=u,o=-(i=Math.max(0,-(l*a+c)))*i+a*(a+2*h)+d;else a=-u,o=-(i=Math.max(0,-(l*a+c)))*i+a*(a+2*h)+d;else a<=-s?o=-(i=Math.max(0,-(-l*u+c)))*i+(a=i>0?-u:Math.min(Math.max(-u,-h),u))*(a+2*h)+d:a<=s?(i=0,o=(a=Math.min(Math.max(-u,-h),u))*(a+2*h)+d):o=-(i=Math.max(0,-(l*u+c)))*i+(a=i>0?u:Math.min(Math.max(-u,-h),u))*(a+2*h)+d;else a=l>0?-u:u,o=-(i=Math.max(0,-(l*a+c)))*i+a*(a+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Cr).multiplyScalar(a).add(Rr),o}},{key:"intersectSphere",value:function(e,t){Lr.subVectors(e.center,this.origin);var n=Lr.dot(this.direction),r=Lr.dot(Lr)-n*n,i=e.radius*e.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,t):this.at(o,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}},{key:"intersectPlane",value:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var n,r,i,a,o,s,u=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,h=this.origin;return u>=0?(n=(e.min.x-h.x)*u,r=(e.max.x-h.x)*u):(n=(e.max.x-h.x)*u,r=(e.min.x-h.x)*u),l>=0?(i=(e.min.y-h.y)*l,a=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,a=(e.min.y-h.y)*l),n>a||i>r?null:((i>n||n!==n)&&(n=i),(a<r||r!==r)&&(r=a),c>=0?(o=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(o=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),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,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,Lr)}},{key:"intersectTriangle",value:function(e,t,n,r,i){kr.subVectors(t,e),Ir.subVectors(n,e),Dr.crossVectors(kr,Ir);var a,o=this.direction.dot(Dr);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Pr.subVectors(this.origin,e);var s=a*this.direction.dot(Ir.crossVectors(Pr,Ir));if(s<0)return null;var u=a*this.direction.dot(kr.cross(Pr));if(u<0)return null;if(s+u>o)return null;var l=-a*Pr.dot(Dr);return l<0?null:this.at(l/o,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}]),e}(),Or=function(){function e(){(0,h.Z)(this,e),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.")}return(0,d.Z)(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,u,l,c,h,d,p,f,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=u,v[6]=l,v[10]=c,v[14]=h,v[3]=d,v[7]=p,v[11]=f,v[15]=m,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,n=e.elements,r=1/Br.setFromMatrixColumn(e,0).length(),i=1/Br.setFromMatrixColumn(e,1).length(),a=1/Br.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),u=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var h=a*l,d=a*c,p=o*l,f=o*c;t[0]=s*l,t[4]=-s*c,t[8]=u,t[1]=d+p*u,t[5]=h-f*u,t[9]=-o*s,t[2]=f-h*u,t[6]=p+d*u,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,v=s*c,g=u*l,y=u*c;t[0]=m+y*o,t[4]=g*o-v,t[8]=a*u,t[1]=a*c,t[5]=a*l,t[9]=-o,t[2]=v*o-g,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order){var x=s*l,_=s*c,b=u*l,w=u*c;t[0]=x-w*o,t[4]=-a*c,t[8]=b+_*o,t[1]=_+b*o,t[5]=a*l,t[9]=w-x*o,t[2]=-a*u,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var M=a*l,S=a*c,T=o*l,E=o*c;t[0]=s*l,t[4]=T*u-S,t[8]=M*u+E,t[1]=s*c,t[5]=E*u+M,t[9]=S*u-T,t[2]=-u,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var A=a*s,L=a*u,R=o*s,C=o*u;t[0]=s*l,t[4]=C-A*c,t[8]=R*c+L,t[1]=c,t[5]=a*l,t[9]=-o*l,t[2]=-u*l,t[6]=L*c+R,t[10]=A-C*c}else if("XZY"===e.order){var P=a*s,k=a*u,I=o*s,D=o*u;t[0]=s*l,t[4]=-c,t[8]=u*l,t[1]=P*c+D,t[5]=a*l,t[9]=k*c-I,t[2]=I*c-k,t[6]=o*l,t[10]=D*c+P}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Ur,e,Gr)}},{key:"lookAt",value:function(e,t,n){var r=this.elements;return Vr.subVectors(e,t),0===Vr.lengthSq()&&(Vr.z=1),Vr.normalize(),Fr.crossVectors(n,Vr),0===Fr.lengthSq()&&(1===Math.abs(n.z)?Vr.x+=1e-4:Vr.z+=1e-4,Vr.normalize(),Fr.crossVectors(n,Vr)),Fr.normalize(),Hr.crossVectors(Vr,Fr),r[0]=Fr.x,r[4]=Hr.x,r[8]=Vr.x,r[1]=Fr.y,r[5]=Hr.y,r[9]=Vr.y,r[2]=Fr.z,r[6]=Hr.z,r[10]=Vr.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],u=n[12],l=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],_=n[15],b=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],C=r[6],P=r[10],k=r[14],I=r[3],D=r[7],N=r[11],O=r[15];return i[0]=a*b+o*T+s*R+u*I,i[4]=a*w+o*E+s*C+u*D,i[8]=a*M+o*A+s*P+u*N,i[12]=a*S+o*L+s*k+u*O,i[1]=l*b+c*T+h*R+d*I,i[5]=l*w+c*E+h*C+d*D,i[9]=l*M+c*A+h*P+d*N,i[13]=l*S+c*L+h*k+d*O,i[2]=p*b+f*T+m*R+v*I,i[6]=p*w+f*E+m*C+v*D,i[10]=p*M+f*A+m*P+v*N,i[14]=p*S+f*L+m*k+v*O,i[3]=g*b+y*T+x*R+_*I,i[7]=g*w+y*E+x*C+_*D,i[11]=g*M+y*A+x*P+_*N,i[15]=g*S+y*L+x*k+_*O,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],u=e[13],l=e[2],c=e[6],h=e[10],d=e[14];return e[3]*(+i*s*c-r*u*c-i*o*h+n*u*h+r*o*d-n*s*d)+e[7]*(+t*s*d-t*u*h+i*a*h-r*a*d+r*u*l-i*s*l)+e[11]*(+t*u*c-t*o*d-i*a*c+n*a*d+i*o*l-n*u*l)+e[15]*(-r*o*l-t*s*c+t*o*h+r*a*c-n*a*h+n*s*l)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],v=e[15],g=c*m*u-f*h*u+f*s*d-o*m*d-c*s*v+o*h*v,y=p*h*u-l*m*u-p*s*d+a*m*d+l*s*v-a*h*v,x=l*f*u-p*c*u+p*o*d-a*f*d-l*o*v+a*c*v,_=p*c*s-l*f*s-p*o*h+a*f*h+l*o*m-a*c*m,b=t*g+n*y+r*x+i*_;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var w=1/b;return e[0]=g*w,e[1]=(f*h*i-c*m*i-f*r*d+n*m*d+c*r*v-n*h*v)*w,e[2]=(o*m*i-f*s*i+f*r*u-n*m*u-o*r*v+n*s*v)*w,e[3]=(c*s*i-o*h*i-c*r*u+n*h*u+o*r*d-n*s*d)*w,e[4]=y*w,e[5]=(l*m*i-p*h*i+p*r*d-t*m*d-l*r*v+t*h*v)*w,e[6]=(p*s*i-a*m*i-p*r*u+t*m*u+a*r*v-t*s*v)*w,e[7]=(a*h*i-l*s*i+l*r*u-t*h*u-a*r*d+t*s*d)*w,e[8]=x*w,e[9]=(p*c*i-l*f*i-p*n*d+t*f*d+l*n*v-t*c*v)*w,e[10]=(a*f*i-p*o*i+p*n*u-t*f*u-a*n*v+t*o*v)*w,e[11]=(l*o*i-a*c*i-l*n*u+t*c*u+a*n*d-t*o*d)*w,e[12]=_*w,e[13]=(l*f*r-p*c*r+p*n*h-t*f*h-l*n*m+t*c*m)*w,e[14]=(p*o*r-a*f*r-p*n*s+t*f*s+a*n*m-t*o*m)*w,e[15]=(a*c*r-l*o*r+l*n*s-t*c*s-a*n*h+t*o*h)*w,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}},{key:"makeTranslation",value:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,u=i*a,l=i*o;return this.set(u*a+n,u*o-r*s,u*s+r*o,0,u*o+r*s,l*o+n,l*s-r*a,0,u*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,u=i+i,l=a+a,c=o+o,h=i*u,d=i*l,p=i*c,f=a*l,m=a*c,v=o*c,g=s*u,y=s*l,x=s*c,_=n.x,b=n.y,w=n.z;return r[0]=(1-(f+v))*_,r[1]=(d+x)*_,r[2]=(p-y)*_,r[3]=0,r[4]=(d-x)*b,r[5]=(1-(h+v))*b,r[6]=(m+g)*b,r[7]=0,r[8]=(p+y)*w,r[9]=(m-g)*w,r[10]=(1-(h+f))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(e,t,n){var r=this.elements,i=Br.set(r[0],r[1],r[2]).length(),a=Br.set(r[4],r[5],r[6]).length(),o=Br.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],zr.copy(this);var s=1/i,u=1/a,l=1/o;return zr.elements[0]*=s,zr.elements[1]*=s,zr.elements[2]*=s,zr.elements[4]*=u,zr.elements[5]*=u,zr.elements[6]*=u,zr.elements[8]*=l,zr.elements[9]*=l,zr.elements[10]*=l,t.setFromRotationMatrix(zr),n.x=i,n.y=a,n.z=o,this}},{key:"makePerspective",value:function(e,t,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/(t-e),u=2*i/(n-r),l=(t+e)/(t-e),c=(n+r)/(n-r),h=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=u,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),u=1/(n-r),l=1/(a-i),c=(t+e)*s,h=(n+r)*u,d=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}]),e}(),Br=new ur,zr=new Or,Ur=new ur(0,0,0),Gr=new ur(1,1,1),Fr=new ur,Hr=new ur,Vr=new ur,Wr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;(0,h.Z)(this,e),Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=n,this._z=r,this._order=i}return(0,d.Z)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e,t,n){var r=Qn.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],u=i[1],l=i[5],c=i[9],h=i[2],d=i[6],p=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-r(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(u,l)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(u,a));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(r(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,n){return jr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(jr,t,n)}},{key:"setFromVector3",value:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)}},{key:"reorder",value:function(e){return Zr.setFromEuler(this),this.setFromQuaternion(Zr,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"toVector3",value:function(e){return e?e.set(this._x,this._y,this._z):new ur(this._x,this._y,this._z)}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}}]),e}();Wr.DefaultOrder="XYZ",Wr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var jr=new Or,Zr=new sr,qr=function(){function e(){(0,h.Z)(this,e),this.mask=1}return(0,d.Z)(e,[{key:"set",value:function(e){this.mask=1<<e|0}},{key:"enable",value:function(e){this.mask|=1<<e|0}},{key:"enableAll",value:function(){this.mask=-1}},{key:"toggle",value:function(e){this.mask^=1<<e|0}},{key:"disable",value:function(e){this.mask&=~(1<<e|0)}},{key:"disableAll",value:function(){this.mask=0}},{key:"test",value:function(e){return 0!==(this.mask&e.mask)}}]),e}(),Xr=0,Yr=new ur,Jr=new sr,Qr=new Or,Kr=new ur,$r=new ur,ei=new ur,ti=new sr,ni=new ur(1,0,0),ri=new ur(0,1,0),ii=new ur(0,0,1),ai={type:"added"},oi={type:"removed"};function si(){Object.defineProperty(this,"id",{value:Xr++}),this.uuid=Qn.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=si.DefaultUp.clone();var e=new ur,t=new Wr,n=new sr,r=new ur(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Or},normalMatrix:{value:new $n}}),this.matrix=new Or,this.matrixWorld=new Or,this.matrixAutoUpdate=si.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new qr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}si.DefaultUp=new ur(0,1,0),si.DefaultMatrixAutoUpdate=!0,si.prototype=Object.assign(Object.create(Zn.prototype),{constructor:si,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return Jr.setFromAxisAngle(e,t),this.quaternion.multiply(Jr),this},rotateOnWorldAxis:function(e,t){return Jr.setFromAxisAngle(e,t),this.quaternion.premultiply(Jr),this},rotateX:function(e){return this.rotateOnAxis(ni,e)},rotateY:function(e){return this.rotateOnAxis(ri,e)},rotateZ:function(e){return this.rotateOnAxis(ii,e)},translateOnAxis:function(e,t){return Yr.copy(e).applyQuaternion(this.quaternion),this.position.add(Yr.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(ni,e)},translateY:function(e){return this.translateOnAxis(ri,e)},translateZ:function(e){return this.translateOnAxis(ii,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(Qr.copy(this.matrixWorld).invert())},lookAt:function(e,t,n){e.isVector3?Kr.copy(e):Kr.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),$r.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Qr.lookAt($r,Kr,this.up):Qr.lookAt(Kr,$r,this.up),this.quaternion.setFromRotationMatrix(Qr),r&&(Qr.extractRotation(r.matrixWorld),Jr.setFromRotationMatrix(Qr),this.quaternion.premultiply(Jr.invert()))},add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(ai)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(oi)),this},clear:function(){for(var e=0;e<this.children.length;e++){var t=this.children[e];t.parent=null,t.dispatchEvent(oi)}return this.children.length=0,this},attach:function(e){return this.updateWorldMatrix(!0,!1),Qr.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Qr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Qr),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new ur),this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new sr),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose($r,e,ei),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new ur),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose($r,ti,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new ur),this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&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===t)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"===typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,u=o.length;s<u;s++){var l=o[s];i(e.shapes,l)}else i(e.shapes,o)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var c=[],h=0,d=this.material.length;h<d;h++)c.push(i(e.materials,this.material[h]));r.material=c}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(var p=0;p<this.children.length;p++)r.children.push(this.children[p].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(var f=0;f<this.animations.length;f++){var m=this.animations[f];r.animations.push(i(e.animations,m))}}if(t){var v=M(e.geometries),g=M(e.materials),y=M(e.textures),x=M(e.images),_=M(e.shapes),b=M(e.skeletons),w=M(e.animations);v.length>0&&(n.geometries=v),g.length>0&&(n.materials=g),y.length>0&&(n.textures=y),x.length>0&&(n.images=x),_.length>0&&(n.shapes=_),b.length>0&&(n.skeletons=b),w.length>0&&(n.animations=w)}return n.object=r,n;function M(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}});var ui=new ur,li=new ur,ci=new $n,hi=function(){function e(t,n){(0,h.Z)(this,e),Object.defineProperty(this,"isPlane",{value:!0}),this.normal=void 0!==t?t:new ur(1,0,0),this.constant=void 0!==n?n:0}return(0,d.Z)(e,[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,n){var r=ui.subVectors(n,t).cross(li.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new ur),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}},{key:"intersectLine",value:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new ur);var n=e.delta(ui),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?void 0:t.copy(n).multiplyScalar(i).add(e.start)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new ur),e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var n=t||ci.getNormalMatrix(e),r=this.coplanarPoint(ui).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}]),e}(),di=new ur,pi=new ur,fi=new ur,mi=new ur,vi=new ur,gi=new ur,yi=new ur,xi=new ur,_i=new ur,bi=new ur,wi=function(){function e(t,n,r){(0,h.Z)(this,e),this.a=void 0!==t?t:new ur,this.b=void 0!==n?n:new ur,this.c=void 0!==r?r:new ur}return(0,d.Z)(e,[{key:"set",value:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return di.subVectors(this.c,this.b),pi.subVectors(this.a,this.b),.5*di.cross(pi).length()}},{key:"getMidpoint",value:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new ur),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new hi),e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}},{key:"getUV",value:function(t,n,r,i,a){return e.getUV(t,this.a,this.b,this.c,n,r,i,a)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new ur);var n,r,i=this.a,a=this.b,o=this.c;vi.subVectors(a,i),gi.subVectors(o,i),xi.subVectors(e,i);var s=vi.dot(xi),u=gi.dot(xi);if(s<=0&&u<=0)return t.copy(i);_i.subVectors(e,a);var l=vi.dot(_i),c=gi.dot(_i);if(l>=0&&c<=l)return t.copy(a);var h=s*c-l*u;if(h<=0&&s>=0&&l<=0)return n=s/(s-l),t.copy(i).addScaledVector(vi,n);bi.subVectors(e,o);var d=vi.dot(bi),p=gi.dot(bi);if(p>=0&&d<=p)return t.copy(o);var f=d*u-s*p;if(f<=0&&u>=0&&p<=0)return r=u/(u-p),t.copy(i).addScaledVector(gi,r);var m=l*p-d*c;if(m<=0&&c-l>=0&&d-p>=0)return yi.subVectors(o,a),r=(c-l)/(c-l+(d-p)),t.copy(a).addScaledVector(yi,r);var v=1/(m+f+h);return n=f*v,r=h*v,t.copy(i).addScaledVector(vi,n).addScaledVector(gi,r)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new ur),r.subVectors(n,t),di.subVectors(e,t),r.cross(di);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,n,r,i){di.subVectors(r,t),pi.subVectors(n,t),fi.subVectors(e,t);var a=di.dot(di),o=di.dot(pi),s=di.dot(fi),u=pi.dot(pi),l=pi.dot(fi),c=a*u-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new ur),0===c)return i.set(-2,-1,-1);var h=1/c,d=(u*s-o*l)*h,p=(a*l-o*s)*h;return i.set(1-d-p,p,d)}},{key:"containsPoint",value:function(e,t,n,r){return this.getBarycoord(e,t,n,r,mi),mi.x>=0&&mi.y>=0&&mi.x+mi.y<=1}},{key:"getUV",value:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,mi),s.set(0,0),s.addScaledVector(i,mi.x),s.addScaledVector(a,mi.y),s.addScaledVector(o,mi.z),s}},{key:"isFrontFacing",value:function(e,t,n,r){return di.subVectors(n,t),pi.subVectors(e,t),di.cross(pi).dot(r)<0}}]),e}(),Mi={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},Si={h:0,s:0,l:0},Ti={h:0,s:0,l:0};function Ei(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Ai(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Li(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Ri=function(){function e(t,n,r){return(0,h.Z)(this,e),Object.defineProperty(this,"isColor",{value:!0}),void 0===n&&void 0===r?this.set(t):this.setRGB(t,n,r)}return(0,d.Z)(e,[{key:"set",value:function(e){return e&&e.isColor?this.copy(e):"number"===typeof e?this.setHex(e):"string"===typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,n){return this.r=e,this.g=t,this.b=n,this}},{key:"setHSL",value:function(e,t,n){if(e=Qn.euclideanModulo(e,1),t=Qn.clamp(t,0,1),n=Qn.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ei(i,r,e+1/3),this.g=Ei(i,r,e),this.b=Ei(i,r,e-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){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,t(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,t(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,u=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,u)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=n[1],c=l.length;if(3===c)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===c)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 e&&e.length>0?this.setColorName(e):this}},{key:"setColorName",value:function(e){var t=Mi[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(e){return this.r=Ai(e.r),this.g=Ai(e.g),this.b=Ai(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Li(e.r),this.g=Li(e.g),this.b=Li(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),u=(s+o)/2;if(s===o)t=0,n=0;else{var l=o-s;switch(n=u<=.5?l/(o+s):l/(2-o-s),o){case r:t=(i-a)/l+(i<a?6:0);break;case i:t=(a-r)/l+2;break;case a:t=(r-i)/l+4}t/=6}return e.h=t,e.s=n,e.l=u,e}},{key:"getStyle",value:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}},{key:"offsetHSL",value:function(e,t,n){return this.getHSL(Si),Si.h+=e,Si.s+=t,Si.l+=n,this.setHSL(Si.h,Si.s,Si.l),this}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}},{key:"lerpHSL",value:function(e,t){this.getHSL(Si),e.getHSL(Ti);var n=Qn.lerp(Si.h,Ti.h,t),r=Qn.lerp(Si.s,Ti.s,t),i=Qn.lerp(Si.l,Ti.l,t);return this.setHSL(n,r,i),this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),e}();Ri.NAMES=Mi,Ri.prototype.r=1,Ri.prototype.g=1,Ri.prototype.b=1;var Ci=function(){function e(t,n,r,i,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(0,h.Z)(this,e),this.a=t,this.b=n,this.c=r,this.normal=i&&i.isVector3?i:new ur,this.vertexNormals=Array.isArray(i)?i:[],this.color=a&&a.isColor?a:new Ri,this.vertexColors=Array.isArray(a)?a:[],this.materialIndex=o}return(0,d.Z)(e,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(var r=0,i=e.vertexColors.length;r<i;r++)this.vertexColors[r]=e.vertexColors[r].clone();return this}}]),e}(),Pi=0;function ki(){Object.defineProperty(this,"id",{value:Pi++}),this.uuid=Qn.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=C,this.side=S,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=W,this.blendDst=j,this.blendEquation=N,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=ee,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Dn,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=_n,this.stencilZFail=_n,this.stencilZPass=_n,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 Ii(e){ki.call(this),this.type="MeshBasicMaterial",this.color=new Ri(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=ae,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(e)}ki.prototype=Object.assign(Object.create(Zn.prototype),{constructor:ki,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===A;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"===typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==C&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==S&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(ki.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Ii.prototype=Object.create(ki.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isMeshBasicMaterial=!0,Ii.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var Di=new ur,Ni=new Kn;function Oi(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Nn,this.updateRange={offset:0,count:-1},this.version=0}function Bi(e,t,n){Oi.call(this,new Int8Array(e),t,n)}function zi(e,t,n){Oi.call(this,new Uint8Array(e),t,n)}function Ui(e,t,n){Oi.call(this,new Uint8ClampedArray(e),t,n)}function Gi(e,t,n){Oi.call(this,new Int16Array(e),t,n)}function Fi(e,t,n){Oi.call(this,new Uint16Array(e),t,n)}function Hi(e,t,n){Oi.call(this,new Int32Array(e),t,n)}function Vi(e,t,n){Oi.call(this,new Uint32Array(e),t,n)}function Wi(e,t,n){Oi.call(this,new Uint16Array(e),t,n)}function ji(e,t,n){Oi.call(this,new Float32Array(e),t,n)}function Zi(e,t,n){Oi.call(this,new Float64Array(e),t,n)}Object.defineProperty(Oi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Oi.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new Ri),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new Kn),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new ur),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new ir),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},applyMatrix3:function(e){if(2===this.itemSize)for(var t=0,n=this.count;t<n;t++)Ni.fromBufferAttribute(this,t),Ni.applyMatrix3(e),this.setXY(t,Ni.x,Ni.y);else if(3===this.itemSize)for(var r=0,i=this.count;r<i;r++)Di.fromBufferAttribute(this,r),Di.applyMatrix3(e),this.setXYZ(r,Di.x,Di.y,Di.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)Di.x=this.getX(t),Di.y=this.getY(t),Di.z=this.getZ(t),Di.applyMatrix4(e),this.setXYZ(t,Di.x,Di.y,Di.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)Di.x=this.getX(t),Di.y=this.getY(t),Di.z=this.getZ(t),Di.applyNormalMatrix(e),this.setXYZ(t,Di.x,Di.y,Di.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)Di.x=this.getX(t),Di.y=this.getY(t),Di.z=this.getZ(t),Di.transformDirection(e),this.setXYZ(t,Di.x,Di.y,Di.z);return this},set:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,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}}}),Bi.prototype=Object.create(Oi.prototype),Bi.prototype.constructor=Bi,zi.prototype=Object.create(Oi.prototype),zi.prototype.constructor=zi,Ui.prototype=Object.create(Oi.prototype),Ui.prototype.constructor=Ui,Gi.prototype=Object.create(Oi.prototype),Gi.prototype.constructor=Gi,Fi.prototype=Object.create(Oi.prototype),Fi.prototype.constructor=Fi,Hi.prototype=Object.create(Oi.prototype),Hi.prototype.constructor=Hi,Vi.prototype=Object.create(Oi.prototype),Vi.prototype.constructor=Vi,Wi.prototype=Object.create(Oi.prototype),Wi.prototype.constructor=Wi,Wi.prototype.isFloat16BufferAttribute=!0,ji.prototype=Object.create(Oi.prototype),ji.prototype.constructor=ji,Zi.prototype=Object.create(Oi.prototype),Zi.prototype.constructor=Zi;var qi=function(){function e(){(0,h.Z)(this,e),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}return(0,d.Z)(e,[{key:"computeGroups",value:function(e){var t,n,r=[],i=void 0,a=e.faces;for(n=0;n<a.length;n++){var o=a[n];o.materialIndex!==i&&(i=o.materialIndex,void 0!==t&&(t.count=3*n-t.start,r.push(t)),t={start:3*n,materialIndex:i})}void 0!==t&&(t.count=3*n-t.start,r.push(t)),this.groups=r}},{key:"fromGeometry",value:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&i[0].length>0,o=i[1]&&i[1].length>0,s=e.morphTargets,u=s.length;if(u>0){t=[];for(var l=0;l<u;l++)t[l]={name:s[l].name,data:[]};this.morphTargets.position=t}var c,h=e.morphNormals,d=h.length;if(d>0){c=[];for(var p=0;p<d;p++)c[p]={name:h[p].name,data:[]};this.morphTargets.normal=c}var f=e.skinIndices,m=e.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 _=x.vertexNormals;if(3===_.length)this.normals.push(_[0],_[1],_[2]);else{var b=x.normal;this.normals.push(b,b,b)}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 Kn,new Kn,new Kn))}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 Kn,new Kn,new Kn))}for(var E=0;E<u;E++){var A=s[E].vertices;t[E].data.push(A[x.a],A[x.b],A[x.c])}for(var L=0;L<d;L++){var R=h[L].vertexNormals[y];c[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(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}}]),e}();function Xi(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}var Yi={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Ji(e,t){return new Yi[e](t)}var Qi=1,Ki=new Or,$i=new si,ea=new ur,ta=new hr,na=new hr,ra=new ur;function ia(){Object.defineProperty(this,"id",{value:Qi+=2}),this.uuid=Qn.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={}}ia.prototype=Object.assign(Object.create(Zn.prototype),{constructor:ia,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){return Array.isArray(e)?this.index=new(Xi(e)>65535?Vi:Fi)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new $n).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Ki.makeRotationX(e),this.applyMatrix4(Ki),this},rotateY:function(e){return Ki.makeRotationY(e),this.applyMatrix4(Ki),this},rotateZ:function(e){return Ki.makeRotationZ(e),this.applyMatrix4(Ki),this},translate:function(e,t,n){return Ki.makeTranslation(e,t,n),this.applyMatrix4(Ki),this},scale:function(e,t,n){return Ki.makeScale(e,t,n),this.applyMatrix4(Ki),this},lookAt:function(e){return $i.lookAt(e),$i.updateMatrix(),this.applyMatrix4($i.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ea).negate(),this.translate(ea.x,ea.y,ea.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new ji(3*t.vertices.length,3),r=new ji(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new ji(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new ji(t,3)),this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var n=t.__directGeometry;if(!0===t.elementsNeedUpdate&&(n=void 0,t.elementsNeedUpdate=!1),void 0===n)return this.fromGeometry(t);n.verticesNeedUpdate=t.verticesNeedUpdate,n.normalsNeedUpdate=t.normalsNeedUpdate,n.colorsNeedUpdate=t.colorsNeedUpdate,n.uvsNeedUpdate=t.uvsNeedUpdate,n.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=n}if(!0===t.verticesNeedUpdate){var r=this.attributes.position;void 0!==r&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1}if(!0===t.normalsNeedUpdate){var i=this.attributes.normal;void 0!==i&&(i.copyVector3sArray(t.normals),i.needsUpdate=!0),t.normalsNeedUpdate=!1}if(!0===t.colorsNeedUpdate){var a=this.attributes.color;void 0!==a&&(a.copyColorsArray(t.colors),a.needsUpdate=!0),t.colorsNeedUpdate=!1}if(t.uvsNeedUpdate){var o=this.attributes.uv;void 0!==o&&(o.copyVector2sArray(t.uvs),o.needsUpdate=!0),t.uvsNeedUpdate=!1}if(t.lineDistancesNeedUpdate){var s=this.attributes.lineDistance;void 0!==s&&(s.copyArray(t.lineDistances),s.needsUpdate=!0),t.lineDistancesNeedUpdate=!1}return t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new qi).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new Oi(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Oi(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.setAttribute("color",new Oi(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Oi(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Oi(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],u=e.morphTargets[o],l=0,c=u.length;l<c;l++){var h=u[l],d=new ji(3*h.data.length,3);d.name=h.name,s.push(d.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var p=new ji(4*e.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new ji(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new hr);var e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.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 ur(-1/0,-1/0,-1/0),new ur(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];ta.setFromBufferAttribute(i),this.morphTargetsRelative?(ra.addVectors(this.boundingBox.min,ta.min),this.boundingBox.expandByPoint(ra),ra.addVectors(this.boundingBox.max,ta.max),this.boundingBox.expandByPoint(ra)):(this.boundingBox.expandByPoint(ta.min),this.boundingBox.expandByPoint(ta.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 Ar);var e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.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 ur,1/0);if(e){var n=this.boundingSphere.center;if(ta.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];na.setFromBufferAttribute(a),this.morphTargetsRelative?(ra.addVectors(ta.min,na.min),ta.expandByPoint(ra),ra.addVectors(ta.max,na.max),ta.expandByPoint(ra)):(ta.expandByPoint(na.min),ta.expandByPoint(na.max))}ta.getCenter(n);for(var o=0,s=0,u=e.count;s<u;s++)ra.fromBufferAttribute(e,s),o=Math.max(o,n.distanceToSquared(ra));if(t)for(var l=0,c=t.length;l<c;l++)for(var h=t[l],d=this.morphTargetsRelative,p=0,f=h.count;p<f;p++)ra.fromBufferAttribute(h,p),d&&(ea.fromBufferAttribute(e,p),ra.add(ea)),o=Math.max(o,n.distanceToSquared(ra));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 e=this.index,t=this.getAttribute("position");if(void 0!==t){var n=this.getAttribute("normal");if(void 0===n)n=new Oi(new Float32Array(3*t.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 ur,o=new ur,s=new ur,u=new ur,l=new ur,c=new ur,h=new ur,d=new ur;if(e)for(var p=0,f=e.count;p<f;p+=3){var m=e.getX(p+0),v=e.getX(p+1),g=e.getX(p+2);a.fromBufferAttribute(t,m),o.fromBufferAttribute(t,v),s.fromBufferAttribute(t,g),h.subVectors(s,o),d.subVectors(a,o),h.cross(d),u.fromBufferAttribute(n,m),l.fromBufferAttribute(n,v),c.fromBufferAttribute(n,g),u.add(h),l.add(h),c.add(h),n.setXYZ(m,u.x,u.y,u.z),n.setXYZ(v,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(var y=0,x=t.count;y<x;y+=3)a.fromBufferAttribute(t,y+0),o.fromBufferAttribute(t,y+1),s.fromBufferAttribute(t,y+2),h.subVectors(s,o),d.subVectors(a,o),h.cross(d),n.setXYZ(y+0,h.x,h.y,h.z),n.setXYZ(y+1,h.x,h.y,h.z),n.setXYZ(y+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=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!==e.attributes[r])for(var i=n[r].array,a=e.attributes[r],o=a.array,s=a.itemSize*t,u=Math.min(o.length,i.length-s),l=0,c=s;l<u;l++,c++)i[c]=o[l];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)ra.fromBufferAttribute(e,t),ra.normalize(),e.setXYZ(t,ra.x,ra.y,ra.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0,u=0,l=t.length;u<l;u++){o=t[u]*r;for(var c=0;c<r;c++)a[s++]=n[o++]}return new Oi(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new ia,n=this.index.array,r=this.attributes;for(var i in r){var a=e(r[i],n);t.setAttribute(i,a)}var o=this.morphAttributes;for(var s in o){for(var u=[],l=o[s],c=0,h=l.length;c<h;c++){var d=e(l[c],n);u.push(d)}t.morphAttributes[s]=u}t.morphTargetsRelative=this.morphTargetsRelative;for(var p=this.groups,f=0,m=p.length;f<m;f++){var v=p[f];t.addGroup(v.start,v.count,v.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.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(e.data);""!==o.name&&(s.name=o.name),e.data.attributes[a]=s}var u={},l=!1;for(var c in this.morphAttributes){for(var h=this.morphAttributes[c],d=[],p=0,f=h.length;p<f;p++){var m=h[p],v=m.toJSON(e.data);""!==m.name&&(v.name=m.name),d.push(v)}d.length>0&&(u[c]=d,l=!0)}l&&(e.data.morphAttributes=u,e.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(e.data.groups=JSON.parse(JSON.stringify(g)));var y=this.boundingSphere;return null!==y&&(e.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),e},clone:function(){return(new ia).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone(t));var r=e.attributes;for(var i in r){var a=r[i];this.setAttribute(i,a.clone(t))}var o=e.morphAttributes;for(var s in o){for(var u=[],l=o[s],c=0,h=l.length;c<h;c++)u.push(l[c].clone(t));this.morphAttributes[s]=u}this.morphTargetsRelative=e.morphTargetsRelative;for(var d=e.groups,p=0,f=d.length;p<f;p++){var m=d[p];this.addGroup(m.start,m.count,m.materialIndex)}var v=e.boundingBox;null!==v&&(this.boundingBox=v.clone());var g=e.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var aa=new Or,oa=new Nr,sa=new Ar,ua=new ur,la=new ur,ca=new ur,ha=new ur,da=new ur,pa=new ur,fa=new ur,ma=new ur,va=new ur,ga=new Kn,ya=new Kn,xa=new Kn,_a=new ur,ba=new ur;function wa(e,t){si.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new ia,this.material=void 0!==t?t:new Ii,this.updateMorphTargets()}function Ma(e,t,n,r,i,a,o,s){if(null===(t.side===T?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==E,s)))return null;ba.copy(s),ba.applyMatrix4(e.matrixWorld);var u=n.ray.origin.distanceTo(ba);return u<n.near||u>n.far?null:{distance:u,point:ba.clone(),object:e}}function Sa(e,t,n,r,i,a,o,s,u,l,c,h){ua.fromBufferAttribute(i,l),la.fromBufferAttribute(i,c),ca.fromBufferAttribute(i,h);var d=e.morphTargetInfluences;if(t.morphTargets&&a&&d){fa.set(0,0,0),ma.set(0,0,0),va.set(0,0,0);for(var p=0,f=a.length;p<f;p++){var m=d[p],v=a[p];0!==m&&(ha.fromBufferAttribute(v,l),da.fromBufferAttribute(v,c),pa.fromBufferAttribute(v,h),o?(fa.addScaledVector(ha,m),ma.addScaledVector(da,m),va.addScaledVector(pa,m)):(fa.addScaledVector(ha.sub(ua),m),ma.addScaledVector(da.sub(la),m),va.addScaledVector(pa.sub(ca),m)))}ua.add(fa),la.add(ma),ca.add(va)}e.isSkinnedMesh&&(e.boneTransform(l,ua),e.boneTransform(c,la),e.boneTransform(h,ca));var g=Ma(e,t,n,r,ua,la,ca,_a);if(g){s&&(ga.fromBufferAttribute(s,l),ya.fromBufferAttribute(s,c),xa.fromBufferAttribute(s,h),g.uv=wi.getUV(_a,ua,la,ca,ga,ya,xa,new Kn)),u&&(ga.fromBufferAttribute(u,l),ya.fromBufferAttribute(u,c),xa.fromBufferAttribute(u,h),g.uv2=wi.getUV(_a,ua,la,ca,ga,ya,xa,new Kn));var y=new Ci(l,c,h);wi.getNormal(ua,la,ca,y.normal),g.face=y}return g}wa.prototype=Object.assign(Object.create(si.prototype),{constructor:wa,isMesh:!0,copy:function(e){return si.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[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=e.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),sa.copy(r.boundingSphere),sa.applyMatrix4(a),!1!==e.ray.intersectsSphere(sa)&&(aa.copy(a).invert(),oa.copy(e.ray).applyMatrix4(aa),null===r.boundingBox||!1!==oa.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o=r.index,s=r.attributes.position,u=r.morphAttributes.position,l=r.morphTargetsRelative,c=r.attributes.uv,h=r.attributes.uv2,d=r.groups,p=r.drawRange;if(null!==o)if(Array.isArray(i))for(var f=0,m=d.length;f<m;f++)for(var v=d[f],g=i[v.materialIndex],y=Math.max(v.start,p.start),x=Math.min(v.start+v.count,p.start+p.count);y<x;y+=3){var _=o.getX(y),b=o.getX(y+1),w=o.getX(y+2);(n=Sa(this,g,e,oa,s,u,l,c,h,_,b,w))&&(n.faceIndex=Math.floor(y/3),n.face.materialIndex=v.materialIndex,t.push(n))}else for(var M=Math.max(0,p.start),S=Math.min(o.count,p.start+p.count);M<S;M+=3){var T=o.getX(M),E=o.getX(M+1),A=o.getX(M+2);(n=Sa(this,i,e,oa,s,u,l,c,h,T,E,A))&&(n.faceIndex=Math.floor(M/3),t.push(n))}else if(void 0!==s)if(Array.isArray(i))for(var L=0,R=d.length;L<R;L++)for(var C=d[L],P=i[C.materialIndex],k=Math.max(C.start,p.start),I=Math.min(C.start+C.count,p.start+p.count);k<I;k+=3){(n=Sa(this,P,e,oa,s,u,l,c,h,k,k+1,k+2))&&(n.faceIndex=Math.floor(k/3),n.face.materialIndex=C.materialIndex,t.push(n))}else for(var D=Math.max(0,p.start),N=Math.min(s.count,p.start+p.count);D<N;D+=3){(n=Sa(this,i,e,oa,s,u,l,c,h,D,D+1,D+2))&&(n.faceIndex=Math.floor(D/3),t.push(n))}}else if(r.isGeometry){var O,B=Array.isArray(i),z=r.vertices,U=r.faces,G=r.faceVertexUvs[0];G.length>0&&(O=G);for(var F=0,H=U.length;F<H;F++){var V=U[F],W=B?i[V.materialIndex]:i;if(void 0!==W){var j=z[V.a],Z=z[V.b],q=z[V.c];if(n=Ma(this,W,e,oa,j,Z,q,_a)){if(O&&O[F]){var X=O[F];ga.copy(X[0]),ya.copy(X[1]),xa.copy(X[2]),n.uv=wi.getUV(_a,j,Z,q,ga,ya,xa,new Kn)}n.face=V,n.faceIndex=F,t.push(n)}}}}}});var Ta=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;(0,h.Z)(this,n),(e=t.call(this)).type="BoxBufferGeometry",e.parameters={width:r,height:i,depth:a,widthSegments:o,heightSegments:s,depthSegments:l};var c=(0,u.Z)(e);o=Math.floor(o),s=Math.floor(s),l=Math.floor(l);var d=[],p=[],f=[],m=[],v=0,g=0;function y(e,t,n,r,i,a,o,s,u,l,h){for(var y=a/u,x=o/l,_=a/2,b=o/2,w=s/2,M=u+1,S=l+1,T=0,E=0,A=new ur,L=0;L<S;L++)for(var R=L*x-b,C=0;C<M;C++){var P=C*y-_;A[e]=P*r,A[t]=R*i,A[n]=w,p.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=s>0?1:-1,f.push(A.x,A.y,A.z),m.push(C/u),m.push(1-L/l),T+=1}for(var k=0;k<l;k++)for(var I=0;I<u;I++){var D=v+I+M*k,N=v+I+M*(k+1),O=v+(I+1)+M*(k+1),B=v+(I+1)+M*k;d.push(D,N,B),d.push(N,O,B),E+=6}c.addGroup(g,E,h),g+=E,v+=T}return y("z","y","x",-1,-1,a,i,r,l,s,0),y("z","y","x",1,-1,a,i,-r,l,s,1),y("x","z","y",1,1,r,a,i,o,l,2),y("x","z","y",1,-1,r,a,-i,o,l,3),y("x","y","z",1,-1,r,i,a,o,s,4),y("x","y","z",-1,-1,r,i,-a,o,s,5),e.setIndex(d),e.setAttribute("position",new ji(p,3)),e.setAttribute("normal",new ji(f,3)),e.setAttribute("uv",new ji(m,2)),e}return(0,d.Z)(n)}(ia);function Ea(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function Aa(e){for(var t={},n=0;n<e.length;n++){var r=Ea(e[n]);for(var i in r)t[i]=r[i]}return t}var La={clone:Ea,merge:Aa};function Ra(e){ki.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",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!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Ca(){si.call(this),this.type="Camera",this.matrixWorldInverse=new Or,this.projectionMatrix=new Or,this.projectionMatrixInverse=new Or}function Pa(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;Ca.call(this),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Ra.prototype=Object.create(ki.prototype),Ra.prototype.constructor=Ra,Ra.prototype.isShaderMaterial=!0,Ra.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ea(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this},Ra.prototype.toJSON=function(e){var t=ki.prototype.toJSON.call(this,e);for(var n in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},Ca.prototype=Object.assign(Object.create(si.prototype),{constructor:Ca,isCamera:!0,copy:function(e,t){return si.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new ur),this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){si.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){si.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Pa.prototype=Object.assign(Object.create(Ca.prototype),{constructor:Pa,isPerspectiveCamera:!0,copy:function(e,t){return Ca.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Qn.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Qn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Qn.RAD2DEG*Math.atan(Math.tan(.5*Qn.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(e,t,n,r,i,a){this.aspect=e/t,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=e,this.view.fullHeight=t,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 e=this.near,t=e*Math.tan(.5*Qn.DEG2RAD*this.fov)/this.zoom,n=2*t,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,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var u=this.filmOffset;0!==u&&(i+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){var t=si.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var ka=90;function Ia(e,t,n){if(si.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new Pa(ka,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new ur(1,0,0)),this.add(r);var i=new Pa(ka,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new ur(-1,0,0)),this.add(i);var a=new Pa(ka,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new ur(0,1,0)),this.add(a);var o=new Pa(ka,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new ur(0,-1,0)),this.add(o);var s=new Pa(ka,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new ur(0,0,1)),this.add(s);var u=new Pa(ka,1,e,t);u.layers=this.layers,u.up.set(0,-1,0),u.lookAt(new ur(0,0,-1)),this.add(u),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var l=e.xr.enabled,c=e.getRenderTarget();e.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=h,e.setRenderTarget(n,5),e.render(t,u),e.setRenderTarget(c),e.xr.enabled=l}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function Da(e,t,n,r,i,a,o,s,u,l){e=void 0!==e?e:[],t=void 0!==t?t:me,o=void 0!==o?o:qe,nr.call(this,e,t,n,r,i,a,o,s,u,l),this.flipY=!1,this._needsFlipEnvMap=!0}function Na(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),ar.call(this,e,e,t),t=t||{},this.texture=new Da(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture._needsFlipEnvMap=!1}function Oa(e,t,n,r,i,a,o,s,u,l,c,h){nr.call(this,null,a,o,s,u,l,r,i,c,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==u?u:Se,this.minFilter=void 0!==l?l:Se,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Ia.prototype=Object.create(si.prototype),Ia.prototype.constructor=Ia,Da.prototype=Object.create(nr.prototype),Da.prototype.constructor=Da,Da.prototype.isCubeTexture=!0,Object.defineProperty(Da.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),Na.prototype=Object.create(ar.prototype),Na.prototype.constructor=Na,Na.prototype.isWebGLCubeRenderTarget=!0,Na.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=Xe,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var n={tEquirect:{value:null}},r="\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",i="\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",a=new Ta(5,5,5),o=new Ra({name:"CubemapFromEquirect",uniforms:Ea(n),vertexShader:r,fragmentShader:i,side:T,blending:R});o.uniforms.tEquirect.value=t;var s=new wa(a,o),u=t.minFilter;return t.minFilter===ke&&(t.minFilter=Re),new Ia(1,10,this).update(e,s),t.minFilter=u,s.geometry.dispose(),s.material.dispose(),this},Na.prototype.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(i)},Oa.prototype=Object.create(nr.prototype),Oa.prototype.constructor=Oa,Oa.prototype.isDataTexture=!0;var Ba=new Ar,za=new ur,Ua=function(){function e(t,n,r,i,a,o){(0,h.Z)(this,e),this.planes=[void 0!==t?t:new hi,void 0!==n?n:new hi,void 0!==r?r:new hi,void 0!==i?i:new hi,void 0!==a?a:new hi,void 0!==o?o:new hi]}return(0,d.Z)(e,[{key:"set",value:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],l=n[6],c=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return t[0].setComponents(o-r,c-s,f-h,y-m).normalize(),t[1].setComponents(o+r,c+s,f+h,y+m).normalize(),t[2].setComponents(o+i,c+u,f+d,y+v).normalize(),t[3].setComponents(o-i,c-u,f-d,y-v).normalize(),t[4].setComponents(o-a,c-l,f-p,y-g).normalize(),t[5].setComponents(o+a,c+l,f+p,y+g).normalize(),this}},{key:"intersectsObject",value:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Ba.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ba)}},{key:"intersectsSprite",value:function(e){return Ba.center.set(0,0,0),Ba.radius=.7071067811865476,Ba.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ba)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0}},{key:"intersectsBox",value:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(za.x=r.normal.x>0?e.max.x:e.min.x,za.y=r.normal.y>0?e.max.y:e.min.y,za.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(za)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}]),e}();function Ga(){var e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Fa(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var a=r.get(t);(!a||a.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version})}else{t.isInterleavedBufferAttribute&&(t=t.data);var o=r.get(t);void 0===o?r.set(t,function(t,r){var i=t.array,a=t.usage,o=e.createBuffer();e.bindBuffer(r,o),e.bufferData(r,i,a),t.onUploadCallback();var s=5126;return i instanceof Float32Array?s=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?t.isFloat16BufferAttribute?n?s=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):s=5123:i instanceof Int16Array?s=5122:i instanceof Uint32Array?s=5125:i instanceof Int32Array?s=5124:i instanceof Int8Array?s=5120:i instanceof Uint8Array&&(s=5121),{buffer:o,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):o.version<t.version&&(!function(t,r,i){var a=r.array,o=r.updateRange;e.bindBuffer(i,t),-1===o.count?e.bufferSubData(i,0,a):(n?e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1)}(o.buffer,t,i),o.version=t.version)}}}}var Ha=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,h.Z)(this,n),(e=t.call(this)).type="PlaneBufferGeometry",e.parameters={width:r,height:i,widthSegments:a,heightSegments:o};for(var s=r/2,u=i/2,l=Math.floor(a),c=Math.floor(o),d=l+1,p=c+1,f=r/l,m=i/c,v=[],g=[],y=[],x=[],_=0;_<p;_++)for(var b=_*m-u,w=0;w<d;w++){var M=w*f-s;g.push(M,-b,0),y.push(0,0,1),x.push(w/l),x.push(1-_/c)}for(var S=0;S<c;S++)for(var T=0;T<l;T++){var E=T+d*S,A=T+d*(S+1),L=T+1+d*(S+1),R=T+1+d*S;v.push(E,A,R),v.push(A,L,R)}return e.setIndex(v),e.setAttribute("position",new ji(g,3)),e.setAttribute("normal",new ji(y,3)),e.setAttribute("uv",new ji(x,2)),e}return(0,d.Z)(n)}(ia),Va={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 *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\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}"},Wa={common:{diffuse:{value:new Ri(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new $n},uv2Transform:{value:new $n},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 Kn(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 Ri(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 Ri(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new $n}},sprite:{diffuse:{value:new Ri(15658734)},opacity:{value:1},center:{value:new Kn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new $n}}},ja={basic:{uniforms:Aa([Wa.common,Wa.specularmap,Wa.envmap,Wa.aomap,Wa.lightmap,Wa.fog]),vertexShader:Va.meshbasic_vert,fragmentShader:Va.meshbasic_frag},lambert:{uniforms:Aa([Wa.common,Wa.specularmap,Wa.envmap,Wa.aomap,Wa.lightmap,Wa.emissivemap,Wa.fog,Wa.lights,{emissive:{value:new Ri(0)}}]),vertexShader:Va.meshlambert_vert,fragmentShader:Va.meshlambert_frag},phong:{uniforms:Aa([Wa.common,Wa.specularmap,Wa.envmap,Wa.aomap,Wa.lightmap,Wa.emissivemap,Wa.bumpmap,Wa.normalmap,Wa.displacementmap,Wa.fog,Wa.lights,{emissive:{value:new Ri(0)},specular:{value:new Ri(1118481)},shininess:{value:30}}]),vertexShader:Va.meshphong_vert,fragmentShader:Va.meshphong_frag},standard:{uniforms:Aa([Wa.common,Wa.envmap,Wa.aomap,Wa.lightmap,Wa.emissivemap,Wa.bumpmap,Wa.normalmap,Wa.displacementmap,Wa.roughnessmap,Wa.metalnessmap,Wa.fog,Wa.lights,{emissive:{value:new Ri(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Va.meshphysical_vert,fragmentShader:Va.meshphysical_frag},toon:{uniforms:Aa([Wa.common,Wa.aomap,Wa.lightmap,Wa.emissivemap,Wa.bumpmap,Wa.normalmap,Wa.displacementmap,Wa.gradientmap,Wa.fog,Wa.lights,{emissive:{value:new Ri(0)}}]),vertexShader:Va.meshtoon_vert,fragmentShader:Va.meshtoon_frag},matcap:{uniforms:Aa([Wa.common,Wa.bumpmap,Wa.normalmap,Wa.displacementmap,Wa.fog,{matcap:{value:null}}]),vertexShader:Va.meshmatcap_vert,fragmentShader:Va.meshmatcap_frag},points:{uniforms:Aa([Wa.points,Wa.fog]),vertexShader:Va.points_vert,fragmentShader:Va.points_frag},dashed:{uniforms:Aa([Wa.common,Wa.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Va.linedashed_vert,fragmentShader:Va.linedashed_frag},depth:{uniforms:Aa([Wa.common,Wa.displacementmap]),vertexShader:Va.depth_vert,fragmentShader:Va.depth_frag},normal:{uniforms:Aa([Wa.common,Wa.bumpmap,Wa.normalmap,Wa.displacementmap,{opacity:{value:1}}]),vertexShader:Va.normal_vert,fragmentShader:Va.normal_frag},sprite:{uniforms:Aa([Wa.sprite,Wa.fog]),vertexShader:Va.sprite_vert,fragmentShader:Va.sprite_frag},background:{uniforms:{uvTransform:{value:new $n},t2D:{value:null}},vertexShader:Va.background_vert,fragmentShader:Va.background_frag},cube:{uniforms:Aa([Wa.envmap,{opacity:{value:1}}]),vertexShader:Va.cube_vert,fragmentShader:Va.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Va.equirect_vert,fragmentShader:Va.equirect_frag},distanceRGBA:{uniforms:Aa([Wa.common,Wa.displacementmap,{referencePosition:{value:new ur},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Va.distanceRGBA_vert,fragmentShader:Va.distanceRGBA_frag},shadow:{uniforms:Aa([Wa.lights,Wa.fog,{color:{value:new Ri(0)},opacity:{value:1}}]),vertexShader:Va.shadow_vert,fragmentShader:Va.shadow_frag}};function Za(e,t,n,r,i){var a,o,s=new Ri(0),u=0,l=null,c=0,h=null;function d(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;s.set(e),d(s,u=t)},getClearAlpha:function(){return u},setClearAlpha:function(e){d(s,u=e)},render:function(n,i,p,f){var m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=t.get(m));var v=e.xr,g=v.getSession&&v.getSession();g&&"additive"===g.environmentBlendMode&&(m=null),null===m?d(s,u):m&&m.isColor&&(d(m,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.mapping===xe)?(void 0===o&&((o=new wa(new Ta(1,1,1),new Ra({name:"BackgroundCubeMaterial",uniforms:Ea(ja.cube.uniforms),vertexShader:ja.cube.vertexShader,fragmentShader:ja.cube.fragmentShader,side:T,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(o)),m.isWebGLCubeRenderTarget&&(m=m.texture),o.material.uniforms.envMap.value=m,o.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,l===m&&c===m.version&&h===e.toneMapping||(o.material.needsUpdate=!0,l=m,c=m.version,h=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null)):m&&m.isTexture&&(void 0===a&&((a=new wa(new Ha(2,2),new Ra({name:"BackgroundMaterial",uniforms:Ea(ja.background.uniforms),vertexShader:ja.background.vertexShader,fragmentShader:ja.background.fragmentShader,side:S,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(a)),a.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),a.material.uniforms.uvTransform.value.copy(m.matrix),l===m&&c===m.version&&h===e.toneMapping||(a.material.needsUpdate=!0,l=m,c=m.version,h=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function qa(e,t,n,r){var i=e.getParameter(34921),a=r.isWebGL2?null:t.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},u=d(null),l=u;function c(t){return r.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function h(t){return r.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function d(e){for(var t=[],n=[],r=[],a=0;a<i;a++)t[a]=0,n[a]=0,r[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function p(){for(var e=l.newAttributes,t=0,n=e.length;t<n;t++)e[t]=0}function f(e){m(e,0)}function m(n,i){var a=l.newAttributes,o=l.enabledAttributes,s=l.attributeDivisors;(a[n]=1,0===o[n]&&(e.enableVertexAttribArray(n),o[n]=1),s[n]!==i)&&((r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i)}function v(){for(var t=l.newAttributes,n=l.enabledAttributes,r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function g(t,n,i,a,o,s){!0!==r.isWebGL2||5124!==i&&5125!==i?e.vertexAttribPointer(t,n,i,a,o,s):e.vertexAttribIPointer(t,n,i,o,s)}function y(){x(),l!==u&&c((l=u).object)}function x(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:function(i,u,h,y,x){var _=!1;if(o){var b=function(t,n,i){var o=!0===i.wireframe,u=s[t.id];void 0===u&&(u={},s[t.id]=u);var l=u[n.id];void 0===l&&(l={},u[n.id]=l);var c=l[o];void 0===c&&(c=d(r.isWebGL2?e.createVertexArray():a.createVertexArrayOES()),l[o]=c);return c}(y,h,u);l!==b&&c((l=b).object),_=function(e,t){var n=l.attributes,r=e.attributes,i=0;for(var a in r){var o=n[a],s=r[a];if(void 0===o)return!0;if(o.attribute!==s)return!0;if(o.data!==s.data)return!0;i++}return l.attributesNum!==i||l.index!==t}(y,x),_&&function(e,t){var n={},r=e.attributes,i=0;for(var a in r){var o=r[a],s={};s.attribute=o,o.data&&(s.data=o.data),n[a]=s,i++}l.attributes=n,l.attributesNum=i,l.index=t}(y,x)}else{var w=!0===u.wireframe;l.geometry===y.id&&l.program===h.id&&l.wireframe===w||(l.geometry=y.id,l.program=h.id,l.wireframe=w,_=!0)}!0===i.isInstancedMesh&&(_=!0),null!==x&&n.update(x,34963),_&&(!function(i,a,o,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;p();var u=s.attributes,l=o.getAttributes(),c=a.defaultAttributeValues;for(var h in l){var d=l[h];if(d>=0){var y=u[h];if(void 0!==y){var x=y.normalized,_=y.itemSize,b=n.get(y);if(void 0===b)continue;var w=b.buffer,M=b.type,S=b.bytesPerElement;if(y.isInterleavedBufferAttribute){var T=y.data,E=T.stride,A=y.offset;T&&T.isInstancedInterleavedBuffer?(m(d,T.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=T.meshPerAttribute*T.count)):f(d),e.bindBuffer(34962,w),g(d,_,M,x,E*S,A*S)}else y.isInstancedBufferAttribute?(m(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):f(d),e.bindBuffer(34962,w),g(d,_,M,x,0,0)}else if("instanceMatrix"===h){var L=n.get(i.instanceMatrix);if(void 0===L)continue;var R=L.buffer,C=L.type;m(d+0,1),m(d+1,1),m(d+2,1),m(d+3,1),e.bindBuffer(34962,R),e.vertexAttribPointer(d+0,4,C,!1,64,0),e.vertexAttribPointer(d+1,4,C,!1,64,16),e.vertexAttribPointer(d+2,4,C,!1,64,32),e.vertexAttribPointer(d+3,4,C,!1,64,48)}else if("instanceColor"===h){var P=n.get(i.instanceColor);if(void 0===P)continue;var k=P.buffer,I=P.type;m(d,1),e.bindBuffer(34962,k),e.vertexAttribPointer(d,3,I,!1,12,0)}else if(void 0!==c){var D=c[h];if(void 0!==D)switch(D.length){case 2:e.vertexAttrib2fv(d,D);break;case 3:e.vertexAttrib3fv(d,D);break;case 4:e.vertexAttrib4fv(d,D);break;default:e.vertexAttrib1fv(d,D)}}}}v()}(i,u,h,y),null!==x&&e.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){for(var e in y(),s){var t=s[e];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var n=s[t];if(void 0!==n[e.id]){var r=n[e.id];for(var i in r)h(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:v}}function Xa(e,t,n,r){var i,a=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function(r,o,s){if(0!==s){var u,l;if(a)u=e,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[l](i,r,o,s),n.update(o,i,s)}}}function Ya(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!==typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var u=!0===n.logarithmicDepthBuffer,l=e.getParameter(34930),c=e.getParameter(35660),h=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),g=c>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:u,maxTextures:l,maxVertexTextures:c,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:a?e.getParameter(36183):0}}function Ja(e){var t=this,n=null,r=0,i=!1,a=!1,o=new hi,s=new $n,u={value:null,needsUpdate:!1};function l(){u.value!==n&&(u.value=n,u.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function c(e,n,r,i){var a=null!==e?e.length:0,l=null;if(0!==a){if(l=u.value,!0!==i||null===l){var c=r+4*a,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===l||l.length<c)&&(l=new Float32Array(c));for(var d=0,p=r;d!==a;++d,p+=4)o.copy(e[d]).applyMatrix4(h,s),o.normal.toArray(l,p),l[p+3]=o.constant}u.value=l,u.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,l}this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,a){var o=0!==e.length||t||0!==r||i;return i=t,n=c(e,a,0),r=e.length,o},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1,l()},this.setState=function(t,o,s){var h=t.clippingPlanes,d=t.clipIntersection,p=t.clipShadows,f=e.get(t);if(!i||null===h||0===h.length||a&&!p)a?c(null):l();else{var m=a?0:r,v=4*m,g=f.clippingState||null;u.value=g,g=c(h,o,v,s);for(var y=0;y!==v;++y)g[y]=n[y];f.clippingState=g,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=m}}}function Qa(e){var t=new WeakMap;function n(e,t){return t===ge?e.mapping=me:t===ye&&(e.mapping=ve),e}function r(e){var n=e.target;n.removeEventListener("dispose",r);var i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){var a=i.mapping;if(a===ge||a===ye){if(t.has(i))return n(t.get(i).texture,i.mapping);var o=i.image;if(o&&o.height>0){var s=e.getRenderList(),u=e.getRenderTarget(),l=e.getRenderState(),c=new Na(o.height/2);return c.fromEquirectangularTexture(e,i),t.set(i,c),e.setRenderTarget(u),e.setRenderList(s),e.setRenderState(l),i.addEventListener("dispose",r),n(c.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function Ka(e){var t={};return{has:function(n){if(void 0!==t[n])return null!==t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,null!==r},get:function(e){return this.has(e)||console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t[e]}}}function $a(e,t,n,r){var i=new WeakMap,a=new WeakMap;function o(e){var s=e.target,u=i.get(s);for(var l in null!==u.index&&t.remove(u.index),u.attributes)t.remove(u.attributes[l]);s.removeEventListener("dispose",o),i.delete(s);var c=a.get(u);c&&(t.remove(c),a.delete(u)),r.releaseStatesOfGeometry(u),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){var n=[],r=e.index,i=e.attributes.position,o=0;if(null!==r){var s=r.array;o=r.version;for(var u=0,l=s.length;u<l;u+=3){var c=s[u+0],h=s[u+1],d=s[u+2];n.push(c,h,h,d,d,c)}}else{var p=i.array;o=i.version;for(var f=0,m=p.length/3-1;f<m;f+=3){var v=f+0,g=f+1,y=f+2;n.push(v,g,g,y,y,v)}}var x=new(Xi(n)>65535?Vi:Fi)(n,1);x.version=o;var _=a.get(e);_&&t.remove(_),a.set(e,x)}return{get:function(e,t){var r=i.get(t);return r||(t.addEventListener("dispose",o),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new ia).setFromObject(e)),r=t._bufferGeometry),i.set(t,r),n.memory.geometries++,r)},update:function(e){var n=e.attributes;for(var r in n)t.update(n[r],34962);var i=e.morphAttributes;for(var a in i)for(var o=i[a],s=0,u=o.length;s<u;s++)t.update(o[s],34962)},getWireframeAttribute:function(e){var t=a.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return a.get(e)}}}function eo(e,t,n,r){var i,a,o,s=r.isWebGL2;this.setMode=function(e){i=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,r){e.drawElements(i,r,a,t*o),n.update(r,i,1)},this.renderInstances=function(r,u,l){if(0!==l){var c,h;if(s)c=e,h="drawElementsInstanced";else if(h="drawElementsInstancedANGLE",null===(c=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[h](i,u,a,r*o,l),n.update(u,i,l)}}}function to(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,r){switch(t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function no(e,t){return e[0]-t[0]}function ro(e,t){return Math.abs(t[1])-Math.abs(e[1])}function io(e){for(var t={},n=new Float32Array(8),r=[],i=0;i<8;i++)r[i]=[i,0];return{update:function(i,a,o,s){var u=i.morphTargetInfluences,l=void 0===u?0:u.length,c=t[a.id];if(void 0===c){c=[];for(var h=0;h<l;h++)c[h]=[h,0];t[a.id]=c}for(var d=0;d<l;d++){var p=c[d];p[0]=d,p[1]=u[d]}c.sort(ro);for(var f=0;f<8;f++)f<l&&c[f][1]?(r[f][0]=c[f][0],r[f][1]=c[f][1]):(r[f][0]=Number.MAX_SAFE_INTEGER,r[f][1]=0);r.sort(no);for(var m=o.morphTargets&&a.morphAttributes.position,v=o.morphNormals&&a.morphAttributes.normal,g=0,y=0;y<8;y++){var x=r[y],_=x[0],b=x[1];_!==Number.MAX_SAFE_INTEGER&&b?(m&&a.getAttribute("morphTarget"+y)!==m[_]&&a.setAttribute("morphTarget"+y,m[_]),v&&a.getAttribute("morphNormal"+y)!==v[_]&&a.setAttribute("morphNormal"+y,v[_]),n[y]=b,g+=b):(m&&!0===a.hasAttribute("morphTarget"+y)&&a.deleteAttribute("morphTarget"+y),v&&!0===a.hasAttribute("morphNormal"+y)&&a.deleteAttribute("morphNormal"+y),n[y]=0)}var w=a.morphTargetsRelative?1:1-g;s.getUniforms().setValue(e,"morphTargetBaseInfluence",w),s.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function ao(e,t,n,r){var i=new WeakMap;return{update:function(e){var a=r.render.frame,o=e.geometry,s=t.get(e,o);return i.get(s)!==a&&(o.isGeometry&&s.updateFromObject(e),t.update(s),i.set(s,a)),e.isInstancedMesh&&(n.update(e.instanceMatrix,34962),null!==e.instanceColor&&n.update(e.instanceColor,34962)),s},dispose:function(){i=new WeakMap}}}function oo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;nr.call(this,null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Se,this.minFilter=Se,this.wrapR=we,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function so(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;nr.call(this,null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Se,this.minFilter=Se,this.wrapR=we,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}ja.physical={uniforms:Aa([ja.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Kn(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ri(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:Va.meshphysical_vert,fragmentShader:Va.meshphysical_frag},oo.prototype=Object.create(nr.prototype),oo.prototype.constructor=oo,oo.prototype.isDataTexture2DArray=!0,so.prototype=Object.create(nr.prototype),so.prototype.constructor=so,so.prototype.isDataTexture3D=!0;var uo=new nr,lo=new oo,co=new so,ho=new Da,po=[],fo=[],mo=new Float32Array(16),vo=new Float32Array(9),go=new Float32Array(4);function yo(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=po[i];if(void 0===a&&(a=new Float32Array(i),po[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function xo(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function _o(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function bo(e,t){var n=fo[t];void 0===n&&(n=new Int32Array(t),fo[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function wo(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Mo(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(xo(n,t))return;e.uniform2fv(this.addr,t),_o(n,t)}}function So(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(xo(n,t))return;e.uniform3fv(this.addr,t),_o(n,t)}}function To(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(xo(n,t))return;e.uniform4fv(this.addr,t),_o(n,t)}}function Eo(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(xo(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),_o(n,t)}else{if(xo(n,r))return;go.set(r),e.uniformMatrix2fv(this.addr,!1,go),_o(n,r)}}function Ao(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(xo(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),_o(n,t)}else{if(xo(n,r))return;vo.set(r),e.uniformMatrix3fv(this.addr,!1,vo),_o(n,r)}}function Lo(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(xo(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),_o(n,t)}else{if(xo(n,r))return;mo.set(r),e.uniformMatrix4fv(this.addr,!1,mo),_o(n,r)}}function Ro(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||uo,i)}function Co(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||lo,i)}function Po(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||co,i)}function ko(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||ho,i)}function Io(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Do(e,t){var n=this.cache;xo(n,t)||(e.uniform2iv(this.addr,t),_o(n,t))}function No(e,t){var n=this.cache;xo(n,t)||(e.uniform3iv(this.addr,t),_o(n,t))}function Oo(e,t){var n=this.cache;xo(n,t)||(e.uniform4iv(this.addr,t),_o(n,t))}function Bo(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function zo(e,t){e.uniform1fv(this.addr,t)}function Uo(e,t){e.uniform1iv(this.addr,t)}function Go(e,t){e.uniform2iv(this.addr,t)}function Fo(e,t){e.uniform3iv(this.addr,t)}function Ho(e,t){e.uniform4iv(this.addr,t)}function Vo(e,t){var n=yo(t,this.size,2);e.uniform2fv(this.addr,n)}function Wo(e,t){var n=yo(t,this.size,3);e.uniform3fv(this.addr,n)}function jo(e,t){var n=yo(t,this.size,4);e.uniform4fv(this.addr,n)}function Zo(e,t){var n=yo(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function qo(e,t){var n=yo(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Xo(e,t){var n=yo(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Yo(e,t,n){var r=t.length,i=bo(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||uo,i[a])}function Jo(e,t,n){var r=t.length,i=bo(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||ho,i[a])}function Qo(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return wo;case 35664:return Mo;case 35665:return So;case 35666:return To;case 35674:return Eo;case 35675:return Ao;case 35676:return Lo;case 5124:case 35670:return Io;case 35667:case 35671:return Do;case 35668:case 35672:return No;case 35669:case 35673:return Oo;case 5125:return Bo;case 35678:case 36198:case 36298:case 36306:case 35682:return Ro;case 35679:case 36299:case 36307:return Po;case 35680:case 36300:case 36308:case 36293:return ko;case 36289:case 36303:case 36311:case 36292:return Co}}(t.type)}function Ko(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return zo;case 35664:return Vo;case 35665:return Wo;case 35666:return jo;case 35674:return Zo;case 35675:return qo;case 35676:return Xo;case 5124:case 35670:return Uo;case 35667:case 35671:return Go;case 35668:case 35672:return Fo;case 35669:case 35673:return Ho;case 35678:case 36198:case 36298:case 36306:case 35682:return Yo;case 35680:case 36300:case 36308:case 36293:return Jo}}(t.type)}function $o(e){this.id=e,this.seq=[],this.map={}}Ko.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),_o(t,e)},$o.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var es=/([\w\d_]+)(\])?(\[|\.)?/g;function ts(e,t){e.seq.push(t),e.map[t.id]=t}function ns(e,t,n){var r=e.name,i=r.length;for(es.lastIndex=0;;){var a=es.exec(r),o=es.lastIndex,s=a[1],u="]"===a[2],l=a[3];if(u&&(s|=0),void 0===l||"["===l&&o+2===i){ts(n,void 0===l?new Qo(s,e,t):new Ko(s,e,t));break}var c=n.map[s];void 0===c&&ts(n,c=new $o(s)),n=c}}function rs(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r);ns(i,e.getUniformLocation(t,i.name),this)}}function is(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}rs.prototype.setValue=function(e,t,n,r){var i=this.map[t];void 0!==i&&i.setValue(e,n,r)},rs.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},rs.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},rs.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var as=0;function os(e){switch(e){case sn:return["Linear","( value )"];case un:return["sRGB","( value )"];case cn:return["RGBE","( value )"];case dn:return["RGBM","( value, 7.0 )"];case pn:return["RGBM","( value, 16.0 )"];case fn:return["RGBD","( value, 256.0 )"];case ln:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case hn:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function ss(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(e.getShaderSource(t))}function us(e,t){var n=os(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function ls(e,t){var n=os(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function cs(e,t){var n;switch(t){case le:n="Linear";break;case ce:n="Reinhard";break;case he:n="OptimizedCineon";break;case de:n="ACESFilmic";break;case pe:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function hs(e){return""!==e}function ds(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function ps(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var fs=/^[ \t]*#include +<([\w\d./]+)>/gm;function ms(e){return e.replace(fs,vs)}function vs(e,t){var n=Va[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return ms(n)}var gs=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ys=/#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;function xs(e){return e.replace(ys,bs).replace(gs,_s)}function _s(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),bs(e,t,n,r)}function bs(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function ws(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Ms(e,t,n,r){var i,a,o=e.getContext(),s=n.defines,u=n.vertexShader,l=n.fragmentShader,c=function(e){var t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===b?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===w?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===M&&(t="SHADOWMAP_TYPE_VSM"),t}(n),h=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case me:case ve:t="ENVMAP_TYPE_CUBE";break;case xe:case _e:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),d=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case ve:case _e:t="ENVMAP_MODE_REFRACTION"}return t}(n),p=function(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case ae:t="ENVMAP_BLENDING_MULTIPLY";break;case oe:t="ENVMAP_BLENDING_MIX";break;case se:t="ENVMAP_BLENDING_ADD"}return t}(n),f=e.gammaFactor>0?e.gammaFactor:1,m=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(hs).join("\n")}(n),v=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),g=o.createProgram(),y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=[v].filter(hs).join("\n")).length>0&&(i+="\n"),(a=[m,v].filter(hs).join("\n")).length>0&&(a+="\n")):(i=[ws(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 "+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.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 "+c:"",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(hs).join("\n"),a=[m,ws(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 "+h:"",n.envMap?"#define "+d:"",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.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 "+c:"",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!==ue?"#define TONE_MAPPING":"",n.toneMapping!==ue?Va.tonemapping_pars_fragment:"",n.toneMapping!==ue?cs("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Va.encodings_pars_fragment,n.map?us("mapTexelToLinear",n.mapEncoding):"",n.matcap?us("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?us("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?us("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?us("lightMapTexelToLinear",n.lightMapEncoding):"",ls("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(hs).join("\n")),u=ps(u=ds(u=ms(u),n),n),l=ps(l=ds(l=ms(l),n),n),u=xs(u),l=xs(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===jn?"":"out highp vec4 pc_fragColor;",n.glslVersion===jn?"":"#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,_,S=y+a+l,T=is(o,35633,y+i+u),E=is(o,35632,S);if(o.attachShader(g,T),o.attachShader(g,E),void 0!==n.index0AttributeName?o.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&o.bindAttribLocation(g,0,"position"),o.linkProgram(g),e.debug.checkShaderErrors){var A=o.getProgramInfoLog(g).trim(),L=o.getShaderInfoLog(T).trim(),R=o.getShaderInfoLog(E).trim(),C=!0,P=!0;if(!1===o.getProgramParameter(g,35714)){C=!1;var k=ss(o,T,"vertex"),I=ss(o,E,"fragment");console.error("THREE.WebGLProgram: shader error: ",o.getError(),"35715",o.getProgramParameter(g,35715),"gl.getProgramInfoLog",A,k,I)}else""!==A?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",A):""!==L&&""!==R||(P=!1);P&&(this.diagnostics={runnable:C,programLog:A,vertexShader:{log:L,prefix:i},fragmentShader:{log:R,prefix:a}})}return o.deleteShader(T),o.deleteShader(E),this.getUniforms=function(){return void 0===x&&(x=new rs(o,g)),x},this.getAttributes=function(){return void 0===_&&(_=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}(o,g)),_},this.destroy=function(){r.releaseStatesOfProgram(this),o.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=as++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=T,this.fragmentShader=E,this}function Ss(e,t,n,r,i,a){var o=[],s=r.isWebGL2,u=r.logarithmicDepthBuffer,l=r.floatVertexTextures,c=r.maxVertexUniforms,h=r.vertexTextures,d=r.precision,p={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"},f=["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"];function m(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=sn,t}return{getParameters:function(i,o,f,v,g){var y,x,_=v.fog,b=i.isMeshStandardMaterial?v.environment:null,w=t.get(i.envMap||b),M=p[i.type],S=g.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(l)return 1024;var n=c,r=Math.floor((n-20)/4),i=Math.min(r,t.length);return i<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+i+"."),0):i}(g):0;if(null!==i.precision&&(d=r.getMaxPrecision(i.precision))!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",d,"instead."),M){var A=ja[M];y=A.vertexShader,x=A.fragmentShader}else y=i.vertexShader,x=i.fragmentShader;var L=e.getRenderTarget();return{isWebGL2:s,shaderID:M,shaderName:i.type,vertexShader:y,fragmentShader:x,defines:i.defines,isRawShaderMaterial:!0===i.isRawShaderMaterial,glslVersion:i.glslVersion,precision:d,instancing:!0===g.isInstancedMesh,instancingColor:!0===g.isInstancedMesh&&null!==g.instanceColor,supportsVertexTextures:h,outputEncoding:null!==L?m(L.texture):e.outputEncoding,map:!!i.map,mapEncoding:m(i.map),matcap:!!i.matcap,matcapEncoding:m(i.matcap),envMap:!!w,envMapMode:w&&w.mapping,envMapEncoding:m(w),envMapCubeUV:!!w&&(w.mapping===xe||w.mapping===_e),lightMap:!!i.lightMap,lightMapEncoding:m(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:m(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:i.normalMapType===yn,tangentSpaceNormalMap:i.normalMapType===gn,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:!!_,useFog:i.fog,fogExp2:_&&_.isFogExp2,flatShading:i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:u,skinning:i.skinning&&S>0,maxBones:S,useVertexTexture:l,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&f.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:ue,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===E,flipSided:i.side===T,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:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(!1===t.isRawShaderMaterial){for(var i=0;i<f.length;i++)n.push(t[f[i]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){var t,n=p[e.type];if(n){var r=ja[n];t=La.clone(r.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){for(var r,a=0,s=o.length;a<s;a++){var u=o[a];if(u.cacheKey===n){++(r=u).usedTimes;break}}return void 0===r&&(r=new Ms(e,n,t,i),o.push(r)),r},releaseProgram:function(e){if(0===--e.usedTimes){var t=o.indexOf(e);o[t]=o[o.length-1],o.pop(),e.destroy()}},programs:o}}function Ts(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function Es(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function As(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Ls(e){var t=[],n=0,r=[],i=[],a={id:-1};function o(r,i,o,s,u,l){var c=t[n],h=e.get(o);return void 0===c?(c={id:r.id,object:r,geometry:i,material:o,program:h.program||a,groupOrder:s,renderOrder:r.renderOrder,z:u,group:l},t[n]=c):(c.id=r.id,c.object=r,c.geometry=i,c.material=o,c.program=h.program||a,c.groupOrder=s,c.renderOrder=r.renderOrder,c.z=u,c.group=l),n++,c}return{opaque:r,transparent:i,init:function(){n=0,r.length=0,i.length=0},push:function(e,t,n,a,s,u){var l=o(e,t,n,a,s,u);(!0===n.transparent?i:r).push(l)},unshift:function(e,t,n,a,s,u){var l=o(e,t,n,a,s,u);(!0===n.transparent?i:r).unshift(l)},finish:function(){for(var e=n,r=t.length;e<r;e++){var i=t[e];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(e,t){r.length>1&&r.sort(e||Es),i.length>1&&i.sort(t||As)}}}function Rs(e){var t=new WeakMap;return{get:function(n,r){var i,a=t.get(n);return void 0===a?(i=new Ls(e),t.set(n,new WeakMap),t.get(n).set(r,i)):void 0===(i=a.get(r))&&(i=new Ls(e),a.set(r,i)),i},dispose:function(){t=new WeakMap}}}function Cs(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new ur,color:new Ri};break;case"SpotLight":n={position:new ur,direction:new ur,color:new Ri,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ur,color:new Ri,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ur,skyColor:new Ri,groundColor:new Ri};break;case"RectAreaLight":n={color:new Ri,position:new ur,halfWidth:new ur,halfHeight:new ur}}return e[t.id]=n,n}}}var Ps=0;function ks(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Is(e,t){for(var n=new Cs,r=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Kn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={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:[]},a=0;a<9;a++)i.probe.push(new ur);var o=new ur,s=new Or,u=new Or;return{setup:function(a,l,c){for(var h=0,d=0,p=0,f=0;f<9;f++)i.probe[f].set(0,0,0);var m=0,v=0,g=0,y=0,x=0,_=0,b=0,w=0,M=c.matrixWorldInverse;a.sort(ks);for(var S=0,T=a.length;S<T;S++){var E=a[S],A=E.color,L=E.intensity,R=E.distance,C=E.shadow&&E.shadow.map?E.shadow.map.texture:null;if(E.isAmbientLight)h+=A.r*L,d+=A.g*L,p+=A.b*L;else if(E.isLightProbe)for(var P=0;P<9;P++)i.probe[P].addScaledVector(E.sh.coefficients[P],L);else if(E.isDirectionalLight){var k=n.get(E);if(k.color.copy(E.color).multiplyScalar(E.intensity),k.direction.setFromMatrixPosition(E.matrixWorld),o.setFromMatrixPosition(E.target.matrixWorld),k.direction.sub(o),k.direction.transformDirection(M),E.castShadow){var I=E.shadow,D=r.get(E);D.shadowBias=I.bias,D.shadowNormalBias=I.normalBias,D.shadowRadius=I.radius,D.shadowMapSize=I.mapSize,i.directionalShadow[m]=D,i.directionalShadowMap[m]=C,i.directionalShadowMatrix[m]=E.shadow.matrix,_++}i.directional[m]=k,m++}else if(E.isSpotLight){var N=n.get(E);if(N.position.setFromMatrixPosition(E.matrixWorld),N.position.applyMatrix4(M),N.color.copy(A).multiplyScalar(L),N.distance=R,N.direction.setFromMatrixPosition(E.matrixWorld),o.setFromMatrixPosition(E.target.matrixWorld),N.direction.sub(o),N.direction.transformDirection(M),N.coneCos=Math.cos(E.angle),N.penumbraCos=Math.cos(E.angle*(1-E.penumbra)),N.decay=E.decay,E.castShadow){var O=E.shadow,B=r.get(E);B.shadowBias=O.bias,B.shadowNormalBias=O.normalBias,B.shadowRadius=O.radius,B.shadowMapSize=O.mapSize,i.spotShadow[g]=B,i.spotShadowMap[g]=C,i.spotShadowMatrix[g]=E.shadow.matrix,w++}i.spot[g]=N,g++}else if(E.isRectAreaLight){var z=n.get(E);z.color.copy(A).multiplyScalar(L),z.position.setFromMatrixPosition(E.matrixWorld),z.position.applyMatrix4(M),u.identity(),s.copy(E.matrixWorld),s.premultiply(M),u.extractRotation(s),z.halfWidth.set(.5*E.width,0,0),z.halfHeight.set(0,.5*E.height,0),z.halfWidth.applyMatrix4(u),z.halfHeight.applyMatrix4(u),i.rectArea[y]=z,y++}else if(E.isPointLight){var U=n.get(E);if(U.position.setFromMatrixPosition(E.matrixWorld),U.position.applyMatrix4(M),U.color.copy(E.color).multiplyScalar(E.intensity),U.distance=E.distance,U.decay=E.decay,E.castShadow){var G=E.shadow,F=r.get(E);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,i.pointShadow[v]=F,i.pointShadowMap[v]=C,i.pointShadowMatrix[v]=E.shadow.matrix,b++}i.point[v]=U,v++}else if(E.isHemisphereLight){var H=n.get(E);H.direction.setFromMatrixPosition(E.matrixWorld),H.direction.transformDirection(M),H.direction.normalize(),H.skyColor.copy(E.color).multiplyScalar(L),H.groundColor.copy(E.groundColor).multiplyScalar(L),i.hemi[x]=H,x++}}y>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Wa.LTC_FLOAT_1,i.rectAreaLTC2=Wa.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Wa.LTC_HALF_1,i.rectAreaLTC2=Wa.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=p;var V=i.hash;V.directionalLength===m&&V.pointLength===v&&V.spotLength===g&&V.rectAreaLength===y&&V.hemiLength===x&&V.numDirectionalShadows===_&&V.numPointShadows===b&&V.numSpotShadows===w||(i.directional.length=m,i.spot.length=g,i.rectArea.length=y,i.point.length=v,i.hemi.length=x,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,V.directionalLength=m,V.pointLength=v,V.spotLength=g,V.rectAreaLength=y,V.hemiLength=x,V.numDirectionalShadows=_,V.numPointShadows=b,V.numSpotShadows=w,i.version=Ps++)},state:i}}function Ds(e,t){var n=new Is(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,i,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function Ns(e,t){var n=new WeakMap;return{get:function(r,i){var a;return!1===n.has(r)?(a=new Ds(e,t),n.set(r,new WeakMap),n.get(r).set(i,a)):!1===n.get(r).has(i)?(a=new Ds(e,t),n.get(r).set(i,a)):a=n.get(r).get(i),a},dispose:function(){n=new WeakMap}}}function Os(e){ki.call(this),this.type="MeshDepthMaterial",this.depthPacking=mn,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(e)}function Bs(e){ki.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new ur,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(e)}Os.prototype=Object.create(ki.prototype),Os.prototype.constructor=Os,Os.prototype.isMeshDepthMaterial=!0,Os.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Bs.prototype=Object.create(ki.prototype),Bs.prototype.constructor=Bs,Bs.prototype.isMeshDistanceMaterial=!0,Bs.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function zs(e,t,n){var r=new Ua,i=new Kn,a=new Kn,o=new ir,s=[],u=[],l={},c={0:T,1:S,2:E},h=new Ra({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Kn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"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}"}),d=h.clone();d.defines.HORIZONAL_PASS=1;var p=new ia;p.setAttribute("position",new Oi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var f=new wa(p,h),m=this;function v(n,r){var i=t.update(f);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,h,f,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,d,f,null)}function g(e,t,n){var r=e<<0|t<<1|n<<2,i=s[r];return void 0===i&&(i=new Os({depthPacking:vn,morphTargets:e,skinning:t}),s[r]=i),i}function y(e,t,n){var r=e<<0|t<<1|n<<2,i=u[r];return void 0===i&&(i=new Bs({morphTargets:e,skinning:t}),u[r]=i),i}function x(t,n,r,i,a,o,s){var u=null,h=g,d=t.customDepthMaterial;if(!0===i.isPointLight&&(h=y,d=t.customDistanceMaterial),void 0===d){var p=!1;!0===r.morphTargets&&(p=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var f=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),u=h(p,f,!0===t.isInstancedMesh)}else u=d;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=u.uuid,v=r.uuid,x=l[m];void 0===x&&(x={},l[m]=x);var _=x[v];void 0===_&&(_=u.clone(),x[v]=_),u=_}return u.visible=r.visible,u.wireframe=r.wireframe,u.side=s===M?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:c[r.side],u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=a,u.farDistance=o),u}function _(n,i,a,o,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===M)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var u=t.update(n),l=n.material;if(Array.isArray(l))for(var c=u.groups,h=0,d=c.length;h<d;h++){var p=c[h],f=l[p.materialIndex];if(f&&f.visible){var m=x(n,u,f,o,a.near,a.far,s);e.renderBufferDirect(a,null,u,m,n,p)}}else if(l.visible){var v=x(n,u,l,o,a.near,a.far,s);e.renderBufferDirect(a,null,u,v,n,null)}}for(var g=n.children,y=0,b=g.length;y<b;y++)_(g[y],i,a,o,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=b,this.render=function(t,s,u){if(!1!==m.enabled&&(!1!==m.autoUpdate||!1!==m.needsUpdate)&&0!==t.length){var l=e.getRenderTarget(),c=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.state;d.setBlending(R),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var p=0,f=t.length;p<f;p++){var g=t[p],y=g.shadow;if(void 0!==y){if(!1!==y.autoUpdate||!1!==y.needsUpdate){i.copy(y.mapSize);var x=y.getFrameExtents();if(i.multiply(x),a.copy(y.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/x.x),i.x=a.x*x.x,y.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/x.y),i.y=a.y*x.y,y.mapSize.y=a.y)),null===y.map&&!y.isPointLightShadow&&this.type===M){var b={minFilter:Re,magFilter:Re,format:Xe};y.map=new ar(i.x,i.y,b),y.map.texture.name=g.name+".shadowMap",y.mapPass=new ar(i.x,i.y,b),y.camera.updateProjectionMatrix()}if(null===y.map){var w={minFilter:Se,magFilter:Se,format:Xe};y.map=new ar(i.x,i.y,w),y.map.texture.name=g.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var S=y.getViewportCount(),T=0;T<S;T++){var E=y.getViewport(T);o.set(a.x*E.x,a.y*E.y,a.x*E.z,a.y*E.w),d.viewport(o),y.updateMatrices(g,T),r=y.getFrustum(),_(s,u,y.camera,g,this.type)}y.isPointLightShadow||this.type!==M||v(y,u),y.needsUpdate=!1}}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}m.needsUpdate=!1,e.setRenderTarget(l,c,h)}}}function Us(e,t,n){var r,i,a=n.isWebGL2;var o=new function(){var t=!1,n=new ir,r=null,i=new ir(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},u=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){e?ge(2929):ye(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case Q:e.depthFunc(512);break;case K:e.depthFunc(519);break;case $:e.depthFunc(513);break;case ee:e.depthFunc(515);break;case te:e.depthFunc(514);break;case ne:e.depthFunc(518);break;case re:e.depthFunc(516);break;case ie:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},l=new function(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,u=null,l=null;return{setTest:function(e){t||(e?ge(2960):ye(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){o===t&&s===n&&u===r||(e.stencilOp(t,n,r),o=t,s=n,u=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,u=null,l=null}}},c={},h=null,d=null,p=null,f=null,m=null,x=null,_=null,b=null,w=null,M=!1,S=null,A=null,L=null,ae=null,oe=null,se=e.getParameter(35661),ue=!1,le=0,ce=e.getParameter(7938);-1!==ce.indexOf("WebGL")?(le=parseFloat(/^WebGL\ ([0-9])/.exec(ce)[1]),ue=le>=1):-1!==ce.indexOf("OpenGL ES")&&(le=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(ce)[1]),ue=le>=2);var he=null,de={},pe=new ir,fe=new ir;function me(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<r;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,i);return a}var ve={};function ge(t){!0!==c[t]&&(e.enable(t),c[t]=!0)}function ye(t){!1!==c[t]&&(e.disable(t),c[t]=!1)}ve[3553]=me(3553,3553,1),ve[34067]=me(34067,34069,6),o.setClear(0,0,0,1),u.setClear(1),l.setClear(0),ge(2929),u.setFunc(ee),Me(!1),Se(g),ge(2884),we(R);var xe=(r={},(0,s.Z)(r,N,32774),(0,s.Z)(r,O,32778),(0,s.Z)(r,B,32779),r);if(a)xe[z]=32775,xe[U]=32776;else{var _e=t.get("EXT_blend_minmax");null!==_e&&(xe[z]=_e.MIN_EXT,xe[U]=_e.MAX_EXT)}var be=(i={},(0,s.Z)(i,G,0),(0,s.Z)(i,F,1),(0,s.Z)(i,H,768),(0,s.Z)(i,W,770),(0,s.Z)(i,J,776),(0,s.Z)(i,X,774),(0,s.Z)(i,Z,772),(0,s.Z)(i,V,769),(0,s.Z)(i,j,771),(0,s.Z)(i,Y,775),(0,s.Z)(i,q,773),i);function we(t,n,r,i,a,o,s,u){if(t!==R){if(d||(ge(3042),d=!0),t===D)a=a||n,o=o||r,s=s||i,n===f&&a===_||(e.blendEquationSeparate(xe[n],xe[a]),f=n,_=a),r===m&&i===x&&o===b&&s===w||(e.blendFuncSeparate(be[r],be[i],be[o],be[s]),m=r,x=i,b=o,w=s),p=t,M=null;else if(t!==p||u!==M){if(f===N&&_===N||(e.blendEquation(32774),f=N,_=N),u)switch(t){case C:e.blendFuncSeparate(1,771,1,771);break;case P:e.blendFunc(1,1);break;case k:e.blendFuncSeparate(0,0,769,771);break;case I:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case C:e.blendFuncSeparate(770,771,1,771);break;case P:e.blendFunc(770,1);break;case k:e.blendFunc(0,769);break;case I:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}m=null,x=null,b=null,w=null,p=t,M=u}}else d&&(ye(3042),d=!1)}function Me(t){S!==t&&(t?e.frontFace(2304):e.frontFace(2305),S=t)}function Se(t){t!==v?(ge(2884),t!==A&&(t===g?e.cullFace(1029):t===y?e.cullFace(1028):e.cullFace(1032))):ye(2884),A=t}function Te(t,n,r){t?(ge(32823),ae===n&&oe===r||(e.polygonOffset(n,r),ae=n,oe=r)):ye(32823)}function Ee(t){void 0===t&&(t=33984+se-1),he!==t&&(e.activeTexture(t),he=t)}return{buffers:{color:o,depth:u,stencil:l},enable:ge,disable:ye,useProgram:function(t){return h!==t&&(e.useProgram(t),h=t,!0)},setBlending:we,setMaterial:function(e,t){e.side===E?ye(2884):ge(2884);var n=e.side===T;t&&(n=!n),Me(n),e.blending===C&&!1===e.transparent?we(R):we(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),u.setFunc(e.depthFunc),u.setTest(e.depthTest),u.setMask(e.depthWrite),o.setMask(e.colorWrite);var r=e.stencilWrite;l.setTest(r),r&&(l.setMask(e.stencilWriteMask),l.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),l.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),Te(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:Me,setCullFace:Se,setLineWidth:function(t){t!==L&&(ue&&e.lineWidth(t),L=t)},setPolygonOffset:Te,setScissorTest:function(e){e?ge(3089):ye(3089)},activeTexture:Ee,bindTexture:function(t,n){null===he&&Ee();var r=de[he];void 0===r&&(r={type:void 0,texture:void 0},de[he]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||ve[t]),r.type=t,r.texture=n)},unbindTexture:function(){var t=de[he];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===pe.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),pe.copy(t))},viewport:function(t){!1===fe.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),fe.copy(t))},reset:function(){c={},he=null,de={},h=null,d=null,p=null,f=null,m=null,x=null,_=null,b=null,w=null,M=!1,S=null,A=null,L=null,ae=null,oe=null,o.reset(),u.reset(),l.reset()}}}function Gs(e,t,n,r,i,a,o){var u,l,c,h=i.isWebGL2,d=i.maxTextures,p=i.maxCubemapSize,f=i.maxTextureSize,m=i.maxSamples,v=new WeakMap,g=!1;try{g="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(F){}function y(e,t){return g?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function x(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?Qn.floorPowerOfTwo:Math.floor,o=a(i*e.width),s=a(i*e.height);void 0===c&&(c=y(o,s));var u=n?y(o,s):c;return u.width=o,u.height=s,u.getContext("2d").drawImage(e,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),u}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function _(e){return Qn.isPowerOfTwo(e.width)&&Qn.isPowerOfTwo(e.height)}function b(e,t){return e.generateMipmaps&&t&&e.minFilter!==Se&&e.minFilter!==Re}function w(t,n,i,a){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function M(n,r,i){if(!1===h)return r;if(null!==n){if(void 0!==e[n])return e[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||t.get("EXT_color_buffer_float"),a}function S(e){return e===Se||e===Te||e===Ae?9728:9729}function T(t){var n=t.target;n.removeEventListener("dispose",T),function(t){var n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&v.delete(n),o.memory.textures--}function E(t){var n=t.target;n.removeEventListener("dispose",E),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}(n),o.memory.textures--}var A=0;function L(e,t){var i=r.get(e);if(e.isVideoTexture&&function(e){var t=o.render.frame;v.get(e)!==t&&(v.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void D(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function R(t,i){var o=r.get(t);t.version>0&&o.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;I(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY);for(var o=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),s=r.image[0]&&r.image[0].isDataTexture,u=[],l=0;l<6;l++)u[l]=o||s?s?r.image[l].image:r.image[l]:x(r.image[l],!1,!0,p);var c,d=u[0],f=_(d)||h,m=a.convert(r.format),v=a.convert(r.type),g=M(r.internalFormat,m,v);if(k(34067,r,f),o){for(var y=0;y<6;y++){c=u[y].mipmaps;for(var S=0;S<c.length;S++){var T=c[S];r.format!==Xe&&r.format!==qe?null!==m?n.compressedTexImage2D(34069+y,S,g,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+y,S,g,T.width,T.height,0,m,v,T.data)}}t.__maxMipLevel=c.length-1}else{c=r.mipmaps;for(var E=0;E<6;E++)if(s){n.texImage2D(34069+E,0,g,u[E].width,u[E].height,0,m,v,u[E].data);for(var A=0;A<c.length;A++){var L=c[A].image[E].image;n.texImage2D(34069+E,A+1,g,L.width,L.height,0,m,v,L.data)}}else{n.texImage2D(34069+E,0,g,m,v,u[E]);for(var R=0;R<c.length;R++){var C=c[R];n.texImage2D(34069+E,R+1,g,m,v,C.image[E])}}t.__maxMipLevel=c.length}b(r,f)&&w(34067,r,d.width,d.height);t.__version=r.version,r.onUpdate&&r.onUpdate(r)}(o,t,i):(n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture))}var C=(u={},(0,s.Z)(u,be,10497),(0,s.Z)(u,we,33071),(0,s.Z)(u,Me,33648),u),P=(l={},(0,s.Z)(l,Se,9728),(0,s.Z)(l,Te,9984),(0,s.Z)(l,Ae,9986),(0,s.Z)(l,Re,9729),(0,s.Z)(l,Ce,9985),(0,s.Z)(l,ke,9987),l);function k(n,a,o){o?(e.texParameteri(n,10242,C[a.wrapS]),e.texParameteri(n,10243,C[a.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,C[a.wrapR]),e.texParameteri(n,10240,P[a.magFilter]),e.texParameteri(n,10241,P[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),a.wrapS===we&&a.wrapT===we||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,S(a.magFilter)),e.texParameteri(n,10241,S(a.minFilter)),a.minFilter!==Se&&a.minFilter!==Re&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(a.type===Ge&&null===t.get("OES_texture_float_linear"))return;if(a.type===Fe&&null===(h||t.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function I(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",T),t.__webglTexture=e.createTexture(),o.memory.textures++)}function D(t,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),I(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s,u=function(e){return!h&&(e.wrapS!==we||e.wrapT!==we||e.minFilter!==Se&&e.minFilter!==Re)}(r)&&!1===_(r.image),l=x(r.image,u,!1,f),c=_(l)||h,d=a.convert(r.format),p=a.convert(r.type),m=M(r.internalFormat,d,p);k(o,r,c);var v=r.mipmaps;if(r.isDepthTexture)m=6402,h?m=r.type===Ge?36012:r.type===Ue?33190:r.type===je?35056:33189:r.type===Ge&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===Ke&&6402===m&&r.type!==Be&&r.type!==Ue&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Be,p=a.convert(r.type)),r.format===$e&&6402===m&&(m=34041,r.type!==je&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=je,p=a.convert(r.type))),n.texImage2D(3553,0,m,l.width,l.height,0,d,p,null);else if(r.isDataTexture)if(v.length>0&&c){for(var g=0,y=v.length;g<y;g++)s=v[g],n.texImage2D(3553,g,m,s.width,s.height,0,d,p,s.data);r.generateMipmaps=!1,t.__maxMipLevel=v.length-1}else n.texImage2D(3553,0,m,l.width,l.height,0,d,p,l.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(var S=0,T=v.length;S<T;S++)s=v[S],r.format!==Xe&&r.format!==qe?null!==d?n.compressedTexImage2D(3553,S,m,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,S,m,s.width,s.height,0,d,p,s.data);t.__maxMipLevel=v.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,m,l.width,l.height,l.depth,0,d,p,l.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,m,l.width,l.height,l.depth,0,d,p,l.data),t.__maxMipLevel=0;else if(v.length>0&&c){for(var E=0,A=v.length;E<A;E++)s=v[E],n.texImage2D(3553,E,m,d,p,s);r.generateMipmaps=!1,t.__maxMipLevel=v.length-1}else n.texImage2D(3553,0,m,d,p,l),t.__maxMipLevel=0;b(r,c)&&w(o,r,l.width,l.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function N(t,i,o,s){var u=a.convert(i.texture.format),l=a.convert(i.texture.type),c=M(i.texture.internalFormat,u,l);n.texImage2D(s,0,c,i.width,i.height,0,u,l,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function O(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var o=n.depthTexture;o&&o.isDepthTexture&&(o.type===Ge?i=36012:o.type===Ue&&(i=33190));var s=z(n);e.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(r){var u=z(n);e.renderbufferStorageMultisample(36161,u,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{var l=a.convert(n.texture.format),c=a.convert(n.texture.type),h=M(n.texture.internalFormat,l,c);if(r){var d=z(n);e.renderbufferStorageMultisample(36161,d,h,n.width,n.height)}else e.renderbufferStorage(36161,h,n.width,n.height)}e.bindRenderbuffer(36161,null)}function B(t){var n=r.get(t),i=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!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),L(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Ke)e.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==$e)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),O(n.__webglDepthbuffer[a],t,!1)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),O(n.__webglDepthbuffer,t,!1);e.bindFramebuffer(36160,null)}function z(e){return h&&e.isWebGLMultisampleRenderTarget?Math.min(m,e.samples):0}var U=!1,G=!1;this.allocateTextureUnit=function(){var e=A;return e>=d&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+d),A+=1,e},this.resetTextureUnits=function(){A=0},this.setTexture2D=L,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?D(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?D(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=R,this.setupRenderTarget=function(t){var i=r.get(t),s=r.get(t.texture);t.addEventListener("dispose",E),s.__webglTexture=e.createTexture(),o.memory.textures++;var u=!0===t.isWebGLCubeRenderTarget,l=!0===t.isWebGLMultisampleRenderTarget,c=_(t)||h;if(!h||t.texture.format!==qe||t.texture.type!==Ge&&t.texture.type!==Fe||(t.texture.format=Xe,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){i.__webglFramebuffer=[];for(var d=0;d<6;d++)i.__webglFramebuffer[d]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),l)if(h){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var p=a.convert(t.texture.format),f=a.convert(t.texture.type),m=M(t.texture.internalFormat,p,f),v=z(t);e.renderbufferStorageMultisample(36161,v,m,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),O(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){n.bindTexture(34067,s.__webglTexture),k(34067,t.texture,c);for(var g=0;g<6;g++)N(i.__webglFramebuffer[g],t,36064,34069+g);b(t.texture,c)&&w(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),k(3553,t.texture,c),N(i.__webglFramebuffer,t,36064,3553),b(t.texture,c)&&w(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&B(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(b(t,_(e)||h)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),w(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(h){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),L(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===G&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),G=!0),e=e.texture),R(e,t)}}function Fs(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;if(e===De)return 5121;if(e===He)return 32819;if(e===Ve)return 32820;if(e===We)return 33635;if(e===Ne)return 5120;if(e===Oe)return 5122;if(e===Be)return 5123;if(e===ze)return 5124;if(e===Ue)return 5125;if(e===Ge)return 5126;if(e===Fe)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(e===Ze)return 6406;if(e===qe)return 6407;if(e===Xe)return 6408;if(e===Ye)return 6409;if(e===Je)return 6410;if(e===Ke)return 6402;if(e===$e)return 34041;if(e===et)return 6403;if(e===tt)return 36244;if(e===nt)return 33319;if(e===rt)return 33320;if(e===it)return 36248;if(e===at)return 36249;if(e===ot||e===st||e===ut||e===lt){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===ot)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===st)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===ut)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===lt)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===ct||e===ht||e===dt||e===pt){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===ct)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===ht)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===dt)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===pt)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===ft)return null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===mt||e===vt)&&null!==(n=t.get("WEBGL_compressed_texture_etc"))){if(e===mt)return n.COMPRESSED_RGB8_ETC2;if(e===vt)return n.COMPRESSED_RGBA8_ETC2_EAC}return e===gt||e===yt||e===xt||e===_t||e===bt||e===wt||e===Mt||e===St||e===Tt||e===Et||e===At||e===Lt||e===Rt||e===Ct||e===kt||e===It||e===Dt||e===Nt||e===Ot||e===Bt||e===zt||e===Ut||e===Gt||e===Ft||e===Ht||e===Vt||e===Wt||e===jt?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:e===Pt?null!==(n=t.get("EXT_texture_compression_bptc"))?e:null:e===je?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Hs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Pa.call(this),this.cameras=e}function Vs(){si.call(this),this.type="Group"}function Ws(){this._targetRay=null,this._grip=null,this._hand=null}function js(e,t){var n=this,r=null,i=1,a=null,o="local-floor",s=null,u=[],l=new Map,c=new Pa;c.layers.enable(1),c.viewport=new ir;var h=new Pa;h.layers.enable(2),h.viewport=new ir;var d=[c,h],p=new Hs;p.layers.enable(1),p.layers.enable(2);var f=null,m=null;function v(e){var t=l.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function g(){l.forEach((function(e,t){e.disconnect(t)})),l.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(e){a=e,S.setContext(r),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function x(e){for(var t=r.inputSources,n=0;n<u.length;n++)l.set(t[n],u[n]);for(var i=0;i<e.removed.length;i++){var a=e.removed[i],o=l.get(a);o&&(o.dispatchEvent({type:"disconnected",data:a}),l.delete(a))}for(var s=0;s<e.added.length;s++){var c=e.added[s],h=l.get(c);h&&h.dispatchEvent({type:"connected",data:c})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(e){var t=u[e];return void 0===t&&(t=new Ws,u[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){var t=u[e];return void 0===t&&(t=new Ws,u[e]=t),t.getGripSpace()},this.getHand=function(e){var t=u[e];return void 0===t&&(t=new Ws,u[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return r},this.setSession=function(e){if(null!==(r=e)){r.addEventListener("select",v),r.addEventListener("selectstart",v),r.addEventListener("selectend",v),r.addEventListener("squeeze",v),r.addEventListener("squeezestart",v),r.addEventListener("squeezeend",v),r.addEventListener("end",g);var n=t.getContextAttributes();!0!==n.xrCompatible&&t.makeXRCompatible();var a={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:i},s=new XRWebGLLayer(r,t,a);r.updateRenderState({baseLayer:s}),r.requestReferenceSpace(o).then(y),r.addEventListener("inputsourceschange",x)}};var _=new ur,b=new ur;function w(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.getCamera=function(e){p.near=h.near=c.near=e.near,p.far=h.far=c.far=e.far,f===p.near&&m===p.far||(r.updateRenderState({depthNear:p.near,depthFar:p.far}),f=p.near,m=p.far);var t=e.parent,n=p.cameras;w(p,t);for(var i=0;i<n.length;i++)w(n[i],t);e.matrixWorld.copy(p.matrixWorld);for(var a=e.children,o=0,s=a.length;o<s;o++)a[o].updateMatrixWorld(!0);return 2===n.length?function(e,t,n){_.setFromMatrixPosition(t.matrixWorld),b.setFromMatrixPosition(n.matrixWorld);var r=_.distanceTo(b),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),u=(i[9]+1)/i[5],l=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(a[8]+1)/a[0],d=o*c,p=o*h,f=r/(-c+h),m=f*-c;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();var v=o+f,g=s+f,y=d-m,x=p+(r-m),w=u*s/g*v,M=l*s/g*v;e.projectionMatrix.makePerspective(y,x,w,M,v,g)}(p,c,h):p.projectionMatrix.copy(c.projectionMatrix),p};var M=null;var S=new Ga;S.setAnimationLoop((function(t,n){if(null!==(s=n.getViewerPose(a))){var i=s.views,o=r.renderState.baseLayer;e.setFramebuffer(o.framebuffer);var l=!1;i.length!==p.cameras.length&&(p.cameras.length=0,l=!0);for(var c=0;c<i.length;c++){var h=i[c],f=o.getViewport(h),m=d[c];m.matrix.fromArray(h.transform.matrix),m.projectionMatrix.fromArray(h.projectionMatrix),m.viewport.set(f.x,f.y,f.width,f.height),0===c&&p.matrix.copy(m.matrix),!0===l&&p.cameras.push(m)}}for(var v=r.inputSources,g=0;g<u.length;g++){var y=u[g],x=v[g];y.update(x,n,a)}M&&M(t,n)})),this.setAnimationLoop=function(e){M=e},this.dispose=function(){}}function Zs(e){function t(t,n){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var r,i,a=e.get(n).envMap;if(a){t.envMap.value=a,t.flipEnvMap.value=a.isCubeTexture&&a._needsFlipEnvMap?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio;var o=e.get(a).__maxMipLevel;void 0!==o&&(t.maxMipLevel.value=o)}n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?r=n.map:n.specularMap?r=n.specularMap:n.displacementMap?r=n.displacementMap:n.normalMap?r=n.normalMap:n.bumpMap?r=n.bumpMap:n.roughnessMap?r=n.roughnessMap:n.metalnessMap?r=n.metalnessMap:n.alphaMap?r=n.alphaMap:n.emissiveMap?r=n.emissiveMap:n.clearcoatMap?r=n.clearcoatMap:n.clearcoatNormalMap?r=n.clearcoatNormalMap:n.clearcoatRoughnessMap&&(r=n.clearcoatRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix)),n.aoMap?i=n.aoMap:n.lightMap&&(i=n.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uv2Transform.value.copy(i.matrix))}function n(t,n){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===T&&(t.bumpScale.value*=-1)),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===T&&t.normalScale.value.negate()),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias),e.get(n).envMap&&(t.envMapIntensity.value=n.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,r,i,a){r.isMeshBasicMaterial?t(e,r):r.isMeshLambertMaterial?(t(e,r),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,r)):r.isMeshToonMaterial?(t(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap);t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===T&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===T&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshPhongMaterial?(t(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===T&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===T&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshStandardMaterial?(t(e,r),r.isMeshPhysicalMaterial?function(e,t){n(e,t),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen);t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap);t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap);t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===T&&e.clearcoatNormalScale.value.negate());e.transmission.value=t.transmission,t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap)}(e,r):n(e,r)):r.isMeshMatcapMaterial?(t(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===T&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===T&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDepthMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDistanceMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?(t(e,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===T&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===T&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var i;t.map?i=t.map:t.alphaMap&&(i=t.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,a):r.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function qs(e){var t=void 0!==(e=e||{}).canvas?e.canvas:function(){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,u=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,d=null;this.domElement=t,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=sn,this.physicallyCorrectLights=!1,this.toneMapping=ue,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p=this,f=!1,m=null,v=0,g=0,y=null,x=null,_=-1,b=null,w=null,M=new ir,S=new ir,T=null,E=t.width,A=t.height,L=1,R=null,C=null,P=new ir(0,0,E,A),k=new ir(0,0,E,A),I=!1,D=new Ua,N=!1,O=!1,B=new Or,z=new ur,U={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function G(){return null===y?L:1}var F,H,V,W,j,Z,q,X,Y,J,Q,K,$,ee,te,ne,re,ie,ae,oe,se,le=n;function ce(e,n){for(var r=0;r<e.length;r++){var i=e[r],a=t.getContext(i,n);if(null!==a)return a}return null}try{var he={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:u,powerPreference:l,failIfMajorPerformanceCaveat:c};if(t.addEventListener("webglcontextlost",ve,!1),t.addEventListener("webglcontextrestored",ge,!1),null===le){var de=["webgl2","webgl","experimental-webgl"];if(!0===p.isWebGL1Renderer&&de.shift(),null===(le=ce(de,he)))throw ce(de)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===le.getShaderPrecisionFormat&&(le.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Ae){throw console.error("THREE.WebGLRenderer: "+Ae.message),Ae}function pe(){F=new Ka(le),!1===(H=new Ya(le,F,e)).isWebGL2&&(F.get("WEBGL_depth_texture"),F.get("OES_texture_float"),F.get("OES_texture_half_float"),F.get("OES_texture_half_float_linear"),F.get("OES_standard_derivatives"),F.get("OES_element_index_uint"),F.get("OES_vertex_array_object"),F.get("ANGLE_instanced_arrays")),F.get("OES_texture_float_linear"),oe=new Fs(le,F,H),(V=new Us(le,F,H)).scissor(S.copy(k).multiplyScalar(L).floor()),V.viewport(M.copy(P).multiplyScalar(L).floor()),W=new to(le),j=new Ts,Z=new Gs(le,F,V,j,H,oe,W),q=new Qa(p),X=new Fa(le,H),se=new qa(le,F,X,H),Y=new $a(le,X,W,se),J=new ao(le,Y,X,W),re=new io(le),te=new Ja(j),Q=new Ss(p,q,F,H,se,te),K=new Zs(j),$=new Rs(j),ee=new Ns(F,H),ne=new Za(p,q,V,J,s),ie=new Xa(le,F,W,H),ae=new eo(le,F,W,H),W.programs=Q.programs,p.capabilities=H,p.extensions=F,p.properties=j,p.renderLists=$,p.state=V,p.info=W}pe();var fe=new js(p,le);this.xr=fe;var me=new zs(p,J,H.maxTextureSize);function ve(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),f=!0}function ge(){console.log("THREE.WebGLRenderer: Context Restored."),f=!1,pe()}function ye(e){var t=e.target;t.removeEventListener("dispose",ye),function(e){xe(e),j.remove(e)}(t)}function xe(e){var t=j.get(e).program;void 0!==t&&Q.releaseProgram(t)}this.shadowMap=me,this.getContext=function(){return le},this.getContextAttributes=function(){return le.getContextAttributes()},this.forceContextLoss=function(){var e=F.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=F.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(e){void 0!==e&&(L=e,this.setSize(E,A,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new Kn),e.set(E,A)},this.setSize=function(e,n,r){fe.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(E=e,A=n,t.width=Math.floor(e*L),t.height=Math.floor(n*L),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new Kn),e.set(E*L,A*L).floor()},this.setDrawingBufferSize=function(e,n,r){E=e,A=n,L=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new ir),e.copy(M)},this.getViewport=function(e){return e.copy(P)},this.setViewport=function(e,t,n,r){e.isVector4?P.set(e.x,e.y,e.z,e.w):P.set(e,t,n,r),V.viewport(M.copy(P).multiplyScalar(L).floor())},this.getScissor=function(e){return e.copy(k)},this.setScissor=function(e,t,n,r){e.isVector4?k.set(e.x,e.y,e.z,e.w):k.set(e,t,n,r),V.scissor(S.copy(k).multiplyScalar(L).floor())},this.getScissorTest=function(){return I},this.setScissorTest=function(e){V.setScissorTest(I=e)},this.setOpaqueSort=function(e){R=e},this.setTransparentSort=function(e){C=e},this.getClearColor=function(){return ne.getClearColor()},this.setClearColor=function(){ne.setClearColor.apply(ne,arguments)},this.getClearAlpha=function(){return ne.getClearAlpha()},this.setClearAlpha=function(){ne.setClearAlpha.apply(ne,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=16384),(void 0===t||t)&&(r|=256),(void 0===n||n)&&(r|=1024),le.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(){t.removeEventListener("webglcontextlost",ve,!1),t.removeEventListener("webglcontextrestored",ge,!1),$.dispose(),ee.dispose(),j.dispose(),q.dispose(),J.dispose(),se.dispose(),fe.dispose(),be.stop()},this.renderBufferImmediate=function(e,t){se.initAttributes();var n=j.get(e);e.hasPositions&&!n.position&&(n.position=le.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=le.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=le.createBuffer()),e.hasColors&&!n.color&&(n.color=le.createBuffer());var r=t.getAttributes();e.hasPositions&&(le.bindBuffer(34962,n.position),le.bufferData(34962,e.positionArray,35048),se.enableAttribute(r.position),le.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&(le.bindBuffer(34962,n.normal),le.bufferData(34962,e.normalArray,35048),se.enableAttribute(r.normal),le.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(le.bindBuffer(34962,n.uv),le.bufferData(34962,e.uvArray,35048),se.enableAttribute(r.uv),le.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(le.bindBuffer(34962,n.color),le.bufferData(34962,e.colorArray,35048),se.enableAttribute(r.color),le.vertexAttribPointer(r.color,3,5126,!1,0,0)),se.disableUnusedAttributes(),le.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=U);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=Ee(e,t,r,i);V.setMaterial(r,o);var u=n.index,l=n.attributes.position;if(null===u){if(void 0===l||0===l.count)return}else if(0===u.count)return;var c,h=1;!0===r.wireframe&&(u=Y.getWireframeAttribute(n),h=2),(r.morphTargets||r.morphNormals)&&re.update(i,n,r,s),se.setup(i,r,s,n,u);var d=ie;null!==u&&(c=X.get(u),(d=ae).setIndex(c));var p=null!==u?u.count:l.count,f=n.drawRange.start*h,m=n.drawRange.count*h,v=null!==a?a.start*h:0,g=null!==a?a.count*h:1/0,y=Math.max(f,v),x=Math.min(p,f+m,v+g)-1,_=Math.max(0,x-y+1);if(0!==_){if(i.isMesh)!0===r.wireframe?(V.setLineWidth(r.wireframeLinewidth*G()),d.setMode(1)):d.setMode(4);else if(i.isLine){var b=r.linewidth;void 0===b&&(b=1),V.setLineWidth(b*G()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);if(i.isInstancedMesh)d.renderInstances(y,_,i.count);else if(n.isInstancedBufferGeometry){var w=Math.min(n.instanceCount,n._maxInstanceCount);d.renderInstances(y,_,w)}else d.render(y,_)}},this.compile=function(e,t){(d=ee.get(e,t)).init(),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))})),d.setupLights(t);var n=new WeakMap;e.traverse((function(t){var r=t.material;if(r)if(Array.isArray(r))for(var i=0;i<r.length;i++){var a=r[i];!1===n.has(a)&&(Te(a,e,t),n.set(a))}else!1===n.has(r)&&(Te(r,e,t),n.set(r))}))};var _e=null;var be=new Ga;function we(e,t,n,r){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||D.intersectsSprite(e)){r&&z.setFromMatrixPosition(e.matrixWorld).applyMatrix4(B);var i=J.update(e),a=e.material;a.visible&&h.push(e,i,a,n,z.z,null)}}else if(e.isImmediateRenderObject)r&&z.setFromMatrixPosition(e.matrixWorld).applyMatrix4(B),h.push(e,null,e.material,n,z.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==W.render.frame&&(e.skeleton.update(),e.skeleton.frame=W.render.frame),!e.frustumCulled||D.intersectsObject(e))){r&&z.setFromMatrixPosition(e.matrixWorld).applyMatrix4(B);var o=J.update(e),s=e.material;if(Array.isArray(s))for(var u=o.groups,l=0,c=u.length;l<c;l++){var p=u[l],f=s[p.materialIndex];f&&f.visible&&h.push(e,o,f,n,z.z,p)}else s.visible&&h.push(e,o,s,n,z.z,null)}for(var m=e.children,v=0,g=m.length;v<g;v++)we(m[v],t,n,r)}}function Me(e,t,n){for(var r=!0===t.isScene?t.overrideMaterial:null,i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,u=o.geometry,l=null===r?o.material:r,c=o.group;if(n.isArrayCamera){w=n;for(var h=n.cameras,p=0,f=h.length;p<f;p++){var m=h[p];s.layers.test(m.layers)&&(V.viewport(M.copy(m.viewport)),d.setupLights(m),Se(s,t,m,u,l,c))}}else w=null,Se(s,t,n,u,l,c)}}function Se(e,t,n,r,i,a){if(e.onBeforeRender(p,t,n,r,i,a),d=ee.get(t,w||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=Ee(n,t,i,e);V.setMaterial(i),se.reset(),function(e,t){e.render((function(e){p.renderBufferImmediate(e,t)}))}(e,o)}else p.renderBufferDirect(n,t,r,i,e,a);e.onAfterRender(p,t,n,r,i,a),d=ee.get(t,w||n)}function Te(e,t,n){!0!==t.isScene&&(t=U);var r=j.get(e),i=d.state.lights,a=d.state.shadowsArray,o=i.state.version,s=Q.getParameters(e,i.state,a,t,n),u=Q.getProgramCacheKey(s),l=r.program,c=!0;if(void 0===l)e.addEventListener("dispose",ye);else if(l.cacheKey!==u)xe(e);else if(r.lightsStateVersion!==o)c=!1;else{if(void 0!==s.shaderID){var h=e.isMeshStandardMaterial?t.environment:null;return void(r.envMap=q.get(e.envMap||h))}c=!1}c&&(s.uniforms=Q.getUniforms(e),e.onBeforeCompile(s,p),l=Q.acquireProgram(s,u),r.program=l,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding);var f=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=te.numPlanes,r.numIntersection=te.numIntersection,f.clippingPlanes=te.uniform),r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=q.get(e.envMap||r.environment),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=o,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=rs.seqWithValue(m.seq,f);r.uniformsList=v}function Ee(e,t,n,r){!0!==t.isScene&&(t=U),Z.resetTextureUnits();var i=t.fog,a=n.isMeshStandardMaterial?t.environment:null,o=null===y?p.outputEncoding:y.texture.encoding,s=q.get(n.envMap||a),u=j.get(n),l=d.state.lights;if(!0===N&&(!0===O||e!==b)){var c=e===b&&n.id===_;te.setState(n,e,c)}n.version===u.__version?n.fog&&u.fog!==i||u.environment!==a||u.needsLights&&u.lightsStateVersion!==l.state.version?Te(n,t,r):void 0===u.numClippingPlanes||u.numClippingPlanes===te.numPlanes&&u.numIntersection===te.numIntersection?(u.outputEncoding!==o||u.envMap!==s)&&Te(n,t,r):Te(n,t,r):(Te(n,t,r),u.__version=n.version);var h,f,m=!1,v=!1,g=!1,x=u.program,w=x.getUniforms(),M=u.uniforms;if(V.useProgram(x.program)&&(m=!0,v=!0,g=!0),n.id!==_&&(_=n.id,v=!0),m||b!==e){if(w.setValue(le,"projectionMatrix",e.projectionMatrix),H.logarithmicDepthBuffer&&w.setValue(le,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),b!==e&&(b=e,v=!0,g=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var S=w.map.cameraPosition;void 0!==S&&S.setValue(le,z.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&w.setValue(le,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&w.setValue(le,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){w.setOptional(le,r,"bindMatrix"),w.setOptional(le,r,"bindMatrixInverse");var T=r.skeleton;if(T){var E=T.bones;if(H.floatVertexTextures){if(null===T.boneTexture){var R=Math.sqrt(4*E.length);R=Qn.ceilPowerOfTwo(R),R=Math.max(R,4);var C=new Float32Array(R*R*4);C.set(T.boneMatrices);var P=new Oa(C,R,R,Xe,Ge);T.boneMatrices=C,T.boneTexture=P,T.boneTextureSize=R}w.setValue(le,"boneTexture",T.boneTexture,Z),w.setValue(le,"boneTextureSize",T.boneTextureSize)}else w.setOptional(le,T,"boneMatrices")}}return(v||u.receiveShadow!==r.receiveShadow)&&(u.receiveShadow=r.receiveShadow,w.setValue(le,"receiveShadow",r.receiveShadow)),v&&(w.setValue(le,"toneMappingExposure",p.toneMappingExposure),u.needsLights&&(f=g,(h=M).ambientLightColor.needsUpdate=f,h.lightProbe.needsUpdate=f,h.directionalLights.needsUpdate=f,h.directionalLightShadows.needsUpdate=f,h.pointLights.needsUpdate=f,h.pointLightShadows.needsUpdate=f,h.spotLights.needsUpdate=f,h.spotLightShadows.needsUpdate=f,h.rectAreaLights.needsUpdate=f,h.hemisphereLights.needsUpdate=f),i&&n.fog&&K.refreshFogUniforms(M,i),K.refreshMaterialUniforms(M,n,L,A),rs.upload(le,u.uniformsList,M,Z)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(rs.upload(le,u.uniformsList,M,Z),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&w.setValue(le,"center",r.center),w.setValue(le,"modelViewMatrix",r.modelViewMatrix),w.setValue(le,"normalMatrix",r.normalMatrix),w.setValue(le,"modelMatrix",r.matrixWorld),x}be.setAnimationLoop((function(e){fe.isPresenting||_e&&_e(e)})),"undefined"!==typeof window&&be.setContext(window),this.setAnimationLoop=function(e){_e=e,fe.setAnimationLoop(e),null===e?be.stop():be.start()},this.render=function(e,t){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===t||!0===t.isCamera){if(!0!==f){se.resetDefaultState(),_=-1,b=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===fe.enabled&&!0===fe.isPresenting&&(t=fe.getCamera(t)),!0===e.isScene&&e.onBeforeRender(p,e,t,n||y),(d=ee.get(e,t)).init(),B.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),D.setFromProjectionMatrix(B),O=this.localClippingEnabled,N=te.init(this.clippingPlanes,O,t),(h=$.get(e,t)).init(),we(e,t,0,p.sortObjects),h.finish(),!0===p.sortObjects&&h.sort(R,C),!0===N&&te.beginShadows();var i=d.state.shadowsArray;me.render(i,e,t),d.setupLights(t),!0===N&&te.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),ne.render(h,e,t,r);var a=h.opaque,o=h.transparent;a.length>0&&Me(a,e,t),o.length>0&&Me(o,e,t),!0===e.isScene&&e.onAfterRender(p,e,t),null!==y&&(Z.updateRenderTargetMipmap(y),Z.updateMultisampleRenderTarget(y)),V.buffers.depth.setTest(!0),V.buffers.depth.setMask(!0),V.buffers.color.setMask(!0),V.setPolygonOffset(!1),h=null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){m!==e&&null===y&&le.bindFramebuffer(36160,e),m=e},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return g},this.getRenderList=function(){return h},this.setRenderList=function(e){h=e},this.getRenderState=function(){return d},this.setRenderState=function(e){d=e},this.getRenderTarget=function(){return y},this.setRenderTarget=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;y=e,v=t,g=n,e&&void 0===j.get(e).__webglFramebuffer&&Z.setupRenderTarget(e);var r=m,i=!1;if(e){var a=j.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=a[t],i=!0):r=e.isWebGLMultisampleRenderTarget?j.get(e).__webglMultisampledFramebuffer:a,M.copy(e.viewport),S.copy(e.scissor),T=e.scissorTest}else M.copy(P).multiplyScalar(L).floor(),S.copy(k).multiplyScalar(L).floor(),T=I;if(x!==r&&(le.bindFramebuffer(36160,r),x=r),V.viewport(M),V.scissor(S),V.setScissorTest(T),i){var o=j.get(e.texture);le.framebufferTexture2D(36160,36064,34069+t,o.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(e&&e.isWebGLRenderTarget){var s=j.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var u=!1;s!==x&&(le.bindFramebuffer(36160,s),u=!0);try{var l=e.texture,c=l.format,h=l.type;if(c!==Xe&&oe.convert(c)!==le.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(h!==De&&oe.convert(h)!==le.getParameter(35738)&&(h!==Ge||!(H.isWebGL2||F.get("OES_texture_float")||F.get("WEBGL_color_buffer_float")))&&(h!==Fe||!(H.isWebGL2?F.get("EXT_color_buffer_float"):F.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===le.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&le.readPixels(t,n,r,i,oe.convert(c),oe.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{u&&le.bindFramebuffer(36160,x)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=oe.convert(t.format);Z.setTexture2D(t,0),le.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),V.unbindTexture()},this.copyTextureToTexture=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.image.width,a=t.image.height,o=oe.convert(n.format),s=oe.convert(n.type);Z.setTexture2D(n,0),le.pixelStorei(37440,n.flipY),le.pixelStorei(37441,n.premultiplyAlpha),le.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?le.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?le.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):le.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),0===r&&n.generateMipmaps&&le.generateMipmap(3553),V.unbindTexture()},this.initTexture=function(e){Z.setTexture2D(e,0),V.unbindTexture()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Xs(e){qs.call(this,e)}Hs.prototype=Object.assign(Object.create(Pa.prototype),{constructor:Hs,isArrayCamera:!0}),Vs.prototype=Object.assign(Object.create(si.prototype),{constructor:Vs,isGroup:!0}),Object.assign(Ws.prototype,{constructor:Ws,getHandSpace:function(){if(null===this._hand&&(this._hand=new Vs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(var e=0;e<=window.XRHand.LITTLE_PHALANX_TIP;e++){var t=new Vs;t.matrixAutoUpdate=!1,t.visible=!1,this._hand.joints.push(t),this._hand.add(t)}return this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Vs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Vs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){var r=null,i=null,a=null,o=this._targetRay,s=this._grip,u=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(u&&e.hand){a=!0;for(var l=0;l<=window.XRHand.LITTLE_PHALANX_TIP;l++)if(e.hand[l]){var c=t.getJointPose(e.hand[l],n),h=u.joints[l];null!==c&&(h.matrix.fromArray(c.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.jointRadius=c.radius),h.visible=null!==c;var d=u.joints[window.XRHand.INDEX_PHALANX_TIP],p=u.joints[window.XRHand.THUMB_PHALANX_TIP],f=d.position.distanceTo(p.position);u.inputState.pinching&&f>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}}else null!==o&&null!==(r=t.getPose(e.targetRaySpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==s&&e.gripSpace&&null!==(i=t.getPose(e.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!==u&&(u.visible=null!==a),this}}),Object.assign(js.prototype,Zn.prototype),Xs.prototype=Object.assign(Object.create(qs.prototype),{constructor:Xs,isWebGL1Renderer:!0});var Ys=function(){function e(t,n){(0,h.Z)(this,e),Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new Ri(t),this.density=void 0!==n?n:25e-5}return(0,d.Z)(e,[{key:"clone",value:function(){return new e(this.color,this.density)}},{key:"toJSON",value:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}]),e}(),Js=function(){function e(t,n,r){(0,h.Z)(this,e),Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new Ri(t),this.near=void 0!==n?n:1,this.far=void 0!==r?r:1e3}return(0,d.Z)(e,[{key:"clone",value:function(){return new e(this.color,this.near,this.far)}},{key:"toJSON",value:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}]),e}(),Qs=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e;return(0,h.Z)(this,n),e=t.call(this),Object.defineProperty((0,u.Z)(e),"isScene",{value:!0}),e.type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:(0,u.Z)(e)})),e}return(0,d.Z)(n,[{key:"copy",value:function(e,t){return(0,a.Z)((0,o.Z)(n.prototype),"copy",this).call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var t=(0,a.Z)((0,o.Z)(n.prototype),"toJSON",this).call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}]),n}(si);function Ks(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Nn,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Qn.generateUUID()}Object.defineProperty(Ks.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ks.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this},clone:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Qn.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new Ks(new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),this.stride);return t.setUsage(this.usage),t},onUpload:function(e){return this.onUploadCallback=e,this},toJSON:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Qn.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.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 $s,eu=new ur;function tu(e,t,n,r){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function nu(e){ki.call(this),this.type="SpriteMaterial",this.color=new Ri(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.defineProperties(tu.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(e){this.data.needsUpdate=e}}}),Object.assign(tu.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)eu.x=this.getX(t),eu.y=this.getY(t),eu.z=this.getZ(t),eu.applyMatrix4(e),this.setXYZ(t,eu.x,eu.y,eu.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this},clone:function(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)t.push(this.data.array[r+i]);return new Oi(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new tu(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)t.push(this.data.array[r+i]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}),nu.prototype=Object.create(ki.prototype),nu.prototype.constructor=nu,nu.prototype.isSpriteMaterial=!0,nu.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var ru=new ur,iu=new ur,au=new ur,ou=new Kn,su=new Kn,uu=new Or,lu=new ur,cu=new ur,hu=new ur,du=new Kn,pu=new Kn,fu=new Kn;function mu(e){if(si.call(this),this.type="Sprite",void 0===$s){$s=new ia;var t=new Ks(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);$s.setIndex([0,1,2,0,2,3]),$s.setAttribute("position",new tu(t,3,0,!1)),$s.setAttribute("uv",new tu(t,2,3,!1))}this.geometry=$s,this.material=void 0!==e?e:new nu,this.center=new Kn(.5,.5)}function vu(e,t,n,r,i,a){ou.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(su.x=a*ou.x-i*ou.y,su.y=i*ou.x+a*ou.y):su.copy(ou),e.copy(t),e.x+=su.x,e.y+=su.y,e.applyMatrix4(uu)}mu.prototype=Object.assign(Object.create(si.prototype),{constructor:mu,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),iu.setFromMatrixScale(this.matrixWorld),uu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),au.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&iu.multiplyScalar(-au.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;vu(lu.set(-.5,-.5,0),au,a,iu,n,r),vu(cu.set(.5,-.5,0),au,a,iu,n,r),vu(hu.set(.5,.5,0),au,a,iu,n,r),du.set(0,0),pu.set(1,0),fu.set(1,1);var o=e.ray.intersectTriangle(lu,cu,hu,!1,ru);if(null!==o||(vu(cu.set(-.5,.5,0),au,a,iu,n,r),pu.set(0,1),null!==(o=e.ray.intersectTriangle(lu,hu,cu,!1,ru)))){var s=e.ray.origin.distanceTo(ru);s<e.near||s>e.far||t.push({distance:s,point:ru.clone(),uv:wi.getUV(ru,lu,cu,hu,du,pu,fu,new Kn),face:null,object:this})}},copy:function(e){return si.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});var gu=new ur,yu=new ur;function xu(){si.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function _u(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),wa.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Or,this.bindMatrixInverse=new Or}function bu(){si.call(this),this.type="Bone"}xu.prototype=Object.assign(Object.create(si.prototype),{constructor:xu,isLOD:!0,copy:function(e){si.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t=Math.abs(t);var n,r=this.levels;for(n=0;n<r.length&&!(t<r[n].distance);n++);return r.splice(n,0,{distance:t,object:e}),this.add(e),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){var n,r;for(n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(this.levels.length>0){gu.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(gu);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){gu.setFromMatrixPosition(e.matrixWorld),yu.setFromMatrixPosition(this.matrixWorld);var n,r,i=gu.distanceTo(yu)/e.zoom;for(t[0].object.visible=!0,n=1,r=t.length;n<r&&i>=t[n].distance;n++)t[n-1].object.visible=!1,t[n].object.visible=!0;for(this._currentLevel=n-1;n<r;n++)t[n].object.visible=!1}},toJSON:function(e){var t=si.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),_u.prototype=Object.assign(Object.create(wa.prototype),{constructor:_u,isSkinnedMesh:!0,copy:function(e){return wa.prototype.copy.call(this,e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new ir,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){wa.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:function(){var e=new ur,t=new ir,n=new ir,r=new ur,i=new Or;return function(a,o){var s=this.skeleton,u=this.geometry;t.fromBufferAttribute(u.attributes.skinIndex,a),n.fromBufferAttribute(u.attributes.skinWeight,a),e.fromBufferAttribute(u.attributes.position,a).applyMatrix4(this.bindMatrix),o.set(0,0,0);for(var l=0;l<4;l++){var c=n.getComponent(l);if(0!==c){var h=t.getComponent(l);i.multiplyMatrices(s.bones[h].matrixWorld,s.boneInverses[h]),o.addScaledVector(r.copy(e).applyMatrix4(i),c)}}return o.applyMatrix4(this.bindMatrixInverse)}}()}),bu.prototype=Object.assign(Object.create(si.prototype),{constructor:bu,isBone:!0});var wu=new Or,Mu=new Or;function Su(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.uuid=Qn.generateUUID(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}Object.assign(Su.prototype,{init:function(){var e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new Or)}},calculateInverses:function(){this.boneInverses.length=0;for(var e=0,t=this.bones.length;e<t;e++){var n=new Or;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}},pose:function(){for(var e=0,t=this.bones.length;e<t;e++){var n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(var r=0,i=this.bones.length;r<i;r++){var a=this.bones[r];a&&(a.parent&&a.parent.isBone?(a.matrix.copy(a.parent.matrixWorld).invert(),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale))}},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:Mu;wu.multiplyMatrices(o,t[i]),wu.toArray(n,16*i)}null!==r&&(r.needsUpdate=!0)},clone:function(){return new Su(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}},dispose:function(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)},fromJSON:function(e,t){this.uuid=e.uuid;for(var n=0,r=e.bones.length;n<r;n++){var i=e.bones[n],a=t[i];void 0===a&&(console.warn("THREE.Skeleton: No bone found with UUID:",i),a=new bu),this.bones.push(a),this.boneInverses.push((new Or).fromArray(e.boneInverses[n]))}return this.init(),this},toJSON:function(){var e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;for(var t=this.bones,n=this.boneInverses,r=0,i=t.length;r<i;r++){var a=t[r];e.bones.push(a.uuid);var o=n[r];e.boneInverses.push(o.toArray())}return e}});var Tu=new Or,Eu=new Or,Au=[],Lu=new wa;function Ru(e,t,n){wa.call(this,e,t),this.instanceMatrix=new Oi(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}function Cu(e){ki.call(this),this.type="LineBasicMaterial",this.color=new Ri(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}Ru.prototype=Object.assign(Object.create(wa.prototype),{constructor:Ru,isInstancedMesh:!0,copy:function(e){return wa.prototype.copy.call(this,e),this.instanceMatrix.copy(e.instanceMatrix),this.count=e.count,this},getColorAt:function(e,t){t.fromArray(this.instanceColor.array,3*e)},getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(Lu.geometry=this.geometry,Lu.material=this.material,void 0!==Lu.material)for(var i=0;i<r;i++){this.getMatrixAt(i,Tu),Eu.multiplyMatrices(n,Tu),Lu.matrixWorld=Eu,Lu.raycast(e,Au);for(var a=0,o=Au.length;a<o;a++){var s=Au[a];s.instanceId=i,s.object=this,t.push(s)}Au.length=0}},setColorAt:function(e,t){null===this.instanceColor&&(this.instanceColor=new Oi(new Float32Array(3*this.count),3)),t.toArray(this.instanceColor.array,3*e)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),Cu.prototype=Object.create(ki.prototype),Cu.prototype.constructor=Cu,Cu.prototype.isLineBasicMaterial=!0,Cu.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this};var Pu=new ur,ku=new ur,Iu=new Or,Du=new Nr,Nu=new Ar;function Ou(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),si.call(this),this.type="Line",this.geometry=void 0!==e?e:new ia,this.material=void 0!==t?t:new Cu,this.updateMorphTargets()}Ou.prototype=Object.assign(Object.create(si.prototype),{constructor:Ou,isLine:!0,copy:function(e){return si.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)Pu.fromBufferAttribute(t,r-1),ku.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Pu.distanceTo(ku);e.setAttribute("lineDistance",new ji(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices,o=e.lineDistances;o[0]=0;for(var s=1,u=a.length;s<u;s++)o[s]=o[s-1],o[s]+=a[s-1].distanceTo(a[s])}return this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Nu.copy(n.boundingSphere),Nu.applyMatrix4(r),Nu.radius+=i,!1!==e.ray.intersectsSphere(Nu)){Iu.copy(r).invert(),Du.copy(e.ray).applyMatrix4(Iu);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new ur,u=new ur,l=new ur,c=new ur,h=this.isLineSegments?2:1;if(n.isBufferGeometry){var d=n.index,p=n.attributes.position;if(null!==d)for(var f=d.array,m=0,v=f.length-1;m<v;m+=h){var g=f[m],y=f[m+1];if(s.fromBufferAttribute(p,g),u.fromBufferAttribute(p,y),!(Du.distanceSqToSegment(s,u,c,l)>o)){c.applyMatrix4(this.matrixWorld);var x=e.ray.origin.distanceTo(c);x<e.near||x>e.far||t.push({distance:x,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else for(var _=0,b=p.count-1;_<b;_+=h){if(s.fromBufferAttribute(p,_),u.fromBufferAttribute(p,_+1),!(Du.distanceSqToSegment(s,u,c,l)>o)){c.applyMatrix4(this.matrixWorld);var w=e.ray.origin.distanceTo(c);w<e.near||w>e.far||t.push({distance:w,point:l.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}else if(n.isGeometry)for(var M=n.vertices,S=M.length,T=0;T<S-1;T+=h){if(!(Du.distanceSqToSegment(M[T],M[T+1],c,l)>o)){c.applyMatrix4(this.matrixWorld);var E=e.ray.origin.distanceTo(c);E<e.near||E>e.far||t.push({distance:E,point:l.clone().applyMatrix4(this.matrixWorld),index:T,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[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=e.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var Bu=new ur,zu=new ur;function Uu(e,t){Ou.call(this,e,t),this.type="LineSegments"}function Gu(e,t){Ou.call(this,e,t),this.type="LineLoop"}function Fu(e){ki.call(this),this.type="PointsMaterial",this.color=new Ri(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Uu.prototype=Object.assign(Object.create(Ou.prototype),{constructor:Uu,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)Bu.fromBufferAttribute(t,r),zu.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Bu.distanceTo(zu);e.setAttribute("lineDistance",new ji(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(var a=e.vertices,o=e.lineDistances,s=0,u=a.length;s<u;s+=2)Bu.copy(a[s]),zu.copy(a[s+1]),o[s]=0===s?0:o[s-1],o[s+1]=o[s]+Bu.distanceTo(zu);return this}}),Gu.prototype=Object.assign(Object.create(Ou.prototype),{constructor:Gu,isLineLoop:!0}),Fu.prototype=Object.create(ki.prototype),Fu.prototype.constructor=Fu,Fu.prototype.isPointsMaterial=!0,Fu.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var Hu=new Or,Vu=new Nr,Wu=new Ar,ju=new ur;function Zu(e,t){si.call(this),this.type="Points",this.geometry=void 0!==e?e:new ia,this.material=void 0!==t?t:new Fu,this.updateMorphTargets()}function qu(e,t,n,r,i,a,o){var s=Vu.distanceSqToPoint(e);if(s<n){var u=new ur;Vu.closestPointToPoint(e,u),u.applyMatrix4(r);var l=i.ray.origin.distanceTo(u);if(l<i.near||l>i.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:u,index:t,face:null,object:o})}}function Xu(e,t,n,r,i,a,o,s,u){nr.call(this,e,t,n,r,i,a,o,s,u),this.format=void 0!==o?o:qe,this.minFilter=void 0!==a?a:Re,this.magFilter=void 0!==i?i:Re,this.generateMipmaps=!1;var l=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){l.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function Yu(e,t,n,r,i,a,o,s,u,l,c,h){nr.call(this,null,a,o,s,u,l,r,i,c,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Ju(e,t,n,r,i,a,o,s,u){nr.call(this,e,t,n,r,i,a,o,s,u),this.needsUpdate=!0}function Qu(e,t,n,r,i,a,o,s,u,l){if((l=void 0!==l?l:Ke)!==Ke&&l!==$e)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Ke&&(n=Be),void 0===n&&l===$e&&(n=je),nr.call(this,null,r,i,a,o,s,l,n,u),this.image={width:e,height:t},this.magFilter=void 0!==o?o:Se,this.minFilter=void 0!==s?s:Se,this.flipY=!1,this.generateMipmaps=!1}Zu.prototype=Object.assign(Object.create(si.prototype),{constructor:Zu,isPoints:!0,copy:function(e){return si.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Wu.copy(n.boundingSphere),Wu.applyMatrix4(r),Wu.radius+=i,!1!==e.ray.intersectsSphere(Wu)){Hu.copy(r).invert(),Vu.copy(e.ray).applyMatrix4(Hu);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,u=n.attributes.position;if(null!==s)for(var l=s.array,c=0,h=l.length;c<h;c++){var d=l[c];ju.fromBufferAttribute(u,d),qu(ju,d,o,r,e,t,this)}else for(var p=0,f=u.count;p<f;p++)ju.fromBufferAttribute(u,p),qu(ju,p,o,r,e,t,this)}else for(var m=n.vertices,v=0,g=m.length;v<g;v++)qu(m[v],v,o,r,e,t,this)}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[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=e.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),Xu.prototype=Object.assign(Object.create(nr.prototype),{constructor:Xu,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){var e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Yu.prototype=Object.create(nr.prototype),Yu.prototype.constructor=Yu,Yu.prototype.isCompressedTexture=!0,Ju.prototype=Object.create(nr.prototype),Ju.prototype.constructor=Ju,Ju.prototype.isCanvasTexture=!0,Qu.prototype=Object.create(nr.prototype),Qu.prototype.constructor=Qu,Qu.prototype.isDepthTexture=!0;var Ku=0,$u=new Or,el=new si,tl=new ur;function nl(){Object.defineProperty(this,"id",{value:Ku+=2}),this.uuid=Qn.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}nl.prototype=Object.assign(Object.create(Zn.prototype),{constructor:nl,isGeometry:!0,applyMatrix4:function(e){for(var t=(new $n).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(var i=0,a=this.faces.length;i<a;i++){var o=this.faces[i];o.normal.applyMatrix3(t).normalize();for(var s=0,u=o.vertexNormals.length;s<u;s++)o.vertexNormals[s].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return $u.makeRotationX(e),this.applyMatrix4($u),this},rotateY:function(e){return $u.makeRotationY(e),this.applyMatrix4($u),this},rotateZ:function(e){return $u.makeRotationZ(e),this.applyMatrix4($u),this},translate:function(e,t,n){return $u.makeTranslation(e,t,n),this.applyMatrix4($u),this},scale:function(e,t,n){return $u.makeScale(e,t,n),this.applyMatrix4($u),this},lookAt:function(e){return el.lookAt(e),el.updateMatrix(),this.applyMatrix4(el.matrix),this},fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index:void 0,r=e.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position,a=r.normal,o=r.color,s=r.uv,u=r.uv2;void 0!==u&&(this.faceVertexUvs[1]=[]);for(var l=0;l<i.count;l++)t.vertices.push((new ur).fromBufferAttribute(i,l)),void 0!==o&&t.colors.push((new Ri).fromBufferAttribute(o,l));function c(e,n,r,i){var l=void 0===o?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()],c=void 0===a?[]:[(new ur).fromBufferAttribute(a,e),(new ur).fromBufferAttribute(a,n),(new ur).fromBufferAttribute(a,r)],h=new Ci(e,n,r,c,l,i);t.faces.push(h),void 0!==s&&t.faceVertexUvs[0].push([(new Kn).fromBufferAttribute(s,e),(new Kn).fromBufferAttribute(s,n),(new Kn).fromBufferAttribute(s,r)]),void 0!==u&&t.faceVertexUvs[1].push([(new Kn).fromBufferAttribute(u,e),(new Kn).fromBufferAttribute(u,n),(new Kn).fromBufferAttribute(u,r)])}var h=e.groups;if(h.length>0)for(var d=0;d<h.length;d++)for(var p=h[d],f=p.start,m=f,v=f+p.count;m<v;m+=3)void 0!==n?c(n.getX(m),n.getX(m+1),n.getX(m+2),p.materialIndex):c(m,m+1,m+2,p.materialIndex);else if(void 0!==n)for(var g=0;g<n.count;g+=3)c(n.getX(g),n.getX(g+1),n.getX(g+2));else for(var y=0;y<i.count;y+=3)c(y,y+1,y+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(tl).negate(),this.translate(tl.x,tl.y,tl.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new Or;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new ur,t=new ur,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];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new Array(this.vertices.length),n=0,r=this.vertices.length;n<r;n++)t[n]=new ur;if(e)for(var i=new ur,a=new ur,o=0,s=this.faces.length;o<s;o++){var u=this.faces[o],l=this.vertices[u.a],c=this.vertices[u.b],h=this.vertices[u.c];i.subVectors(h,c),a.subVectors(l,c),i.cross(a),t[u.a].add(i),t[u.b].add(i),t[u.c].add(i)}else{this.computeFaceNormals();for(var d=0,p=this.faces.length;d<p;d++){var f=this.faces[d];t[f.a].add(f.normal),t[f.b].add(f.normal),t[f.c].add(f.normal)}}for(var m=0,v=this.vertices.length;m<v;m++)t[m].normalize();for(var g=0,y=this.faces.length;g<y;g++){var x=this.faces[g],_=x.vertexNormals;3===_.length?(_[0].copy(t[x.a]),_[1].copy(t[x.b]),_[2].copy(t[x.c])):(_[0]=t[x.a].clone(),_[1]=t[x.b].clone(),_[2]=t[x.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var e=0,t=this.faces.length;e<t;e++){var n=this.faces[e],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 e=0,t=this.faces.length;e<t;e++){var n=this.faces[e];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 nl;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 u=this.morphNormals[o].faceNormals,l=this.morphNormals[o].vertexNormals,c=0,h=this.faces.length;c<h;c++){var d=new ur,p={a:new ur,b:new ur,c:new ur};u.push(d),l.push(p)}}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 _=0,b=this.faces.length;_<b;_++){var w=this.faces[_];w.normal=w.__originalFaceNormal,w.vertexNormals=w.__originalVertexNormals}},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new hr),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Ar),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e&&e.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,u=e.faces,l=this.colors,c=e.colors;void 0!==t&&(r=(new $n).getNormalMatrix(t));for(var h=0,d=o.length;h<d;h++){var p=o[h],f=p.clone();void 0!==t&&f.applyMatrix4(t),a.push(f)}for(var m=0,v=c.length;m<v;m++)l.push(c[m].clone());for(var g=0,y=u.length;g<y;g++){var x=u[g],_=void 0,b=void 0,w=x.vertexNormals,M=x.vertexColors,S=new Ci(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++)_=w[T].clone(),void 0!==r&&_.applyMatrix3(r).normalize(),S.vertexNormals.push(_);S.color.copy(x.color);for(var A=0,L=M.length;A<L;A++)b=M[A],S.vertexColors.push(b.clone());S.materialIndex=x.materialIndex+n,s.push(S)}for(var R=0,C=e.faceVertexUvs.length;R<C;R++){var P=e.faceVertexUvs[R];void 0===this.faceVertexUvs[R]&&(this.faceVertexUvs[R]=[]);for(var k=0,I=P.length;k<I;k++){for(var D=P[k],N=[],O=0,B=D.length;O<B;O++)N.push(D[O].clone());this.faceVertexUvs[R].push(N)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t={},n=[],r=[],i=Math.pow(10,e),a=0,o=this.vertices.length;a<o;a++){var s=this.vertices[a],u=Math.round(s.x*i)+"_"+Math.round(s.y*i)+"_"+Math.round(s.z*i);void 0===t[u]?(t[u]=a,n.push(this.vertices[a]),r[a]=n.length-1):r[a]=r[t[u]]}for(var l=[],c=0,h=this.faces.length;c<h;c++){var d=this.faces[c];d.a=r[d.a],d.b=r[d.b],d.c=r[d.c];for(var p=[d.a,d.b,d.c],f=0;f<3;f++)if(p[f]===p[(f+1)%3]){l.push(c);break}}for(var m=l.length-1;m>=0;m--){var v=l[m];this.faces.splice(v,1);for(var g=0,y=this.faceVertexUvs.length;g<y;g++)this.faceVertexUvs[g].splice(v,1)}var x=this.vertices.length-n.length;return this.vertices=n,x},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new ur(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===t&&(r=[]),o&&o.length===t&&(i=[]);for(var s=0;s<t;s++){var u=e[s]._id;r&&r.push(a[u]),i&&i.push(o[u])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}for(var o=[],s=[],u={},l=[],c={},h=[],d={},p=0;p<this.faces.length;p++){var f=this.faces[p],m=void 0!==this.faceVertexUvs[0][p],v=f.normal.length()>0,g=f.vertexNormals.length>0,y=1!==f.color.r||1!==f.color.g||1!==f.color.b,x=f.vertexColors.length>0,_=0;if(_=S(_,0,0),_=S(_,1,!0),_=S(_,2,!1),_=S(_,3,m),_=S(_,4,v),_=S(_,5,g),_=S(_,6,y),_=S(_,7,x),o.push(_),o.push(f.a,f.b,f.c),o.push(f.materialIndex),m){var b=this.faceVertexUvs[0][p];o.push(A(b[0]),A(b[1]),A(b[2]))}if(v&&o.push(T(f.normal)),g){var w=f.vertexNormals;o.push(T(w[0]),T(w[1]),T(w[2]))}if(y&&o.push(E(f.color)),x){var M=f.vertexColors;o.push(E(M[0]),E(M[1]),E(M[2]))}}function S(e,t,n){return n?e|1<<t:e&~(1<<t)}function T(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==u[t]||(u[t]=s.length/3,s.push(e.x,e.y,e.z)),u[t]}function E(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==c[t]||(c[t]=l.length,l.push(e.getHex())),c[t]}function A(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=h.length/2,h.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new nl).copy(this)},copy:function(e){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=e.name;for(var t=e.vertices,n=0,r=t.length;n<r;n++)this.vertices.push(t[n].clone());for(var i=e.colors,a=0,o=i.length;a<o;a++)this.colors.push(i[a].clone());for(var s=e.faces,u=0,l=s.length;u<l;u++)this.faces.push(s[u].clone());for(var c=0,h=e.faceVertexUvs.length;c<h;c++){var d=e.faceVertexUvs[c];void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var p=0,f=d.length;p<f;p++){for(var m=d[p],v=[],g=0,y=m.length;g<y;g++){var x=m[g];v.push(x.clone())}this.faceVertexUvs[c].push(v)}}for(var _=e.morphTargets,b=0,w=_.length;b<w;b++){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=e.morphNormals,R=0,C=L.length;R<C;R++){var P={};if(void 0!==L[R].vertexNormals){P.vertexNormals=[];for(var k=0,I=L[R].vertexNormals.length;k<I;k++){var D=L[R].vertexNormals[k],N={};N.a=D.a.clone(),N.b=D.b.clone(),N.c=D.c.clone(),P.vertexNormals.push(N)}}if(void 0!==L[R].faceNormals){P.faceNormals=[];for(var O=0,B=L[R].faceNormals.length;O<B;O++)P.faceNormals.push(L[R].faceNormals[O].clone())}this.morphNormals.push(P)}for(var z=e.skinWeights,U=0,G=z.length;U<G;U++)this.skinWeights.push(z[U].clone());for(var F=e.skinIndices,H=0,V=F.length;H<V;H++)this.skinIndices.push(F[H].clone());for(var W=e.lineDistances,j=0,Z=W.length;j<Z;j++)this.lineDistances.push(W[j]);var q=e.boundingBox;null!==q&&(this.boundingBox=q.clone());var X=e.boundingSphere;return null!==X&&(this.boundingSphere=X.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var rl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o,s){var u;return(0,h.Z)(this,n),(u=t.call(this)).type="BoxGeometry",u.parameters={width:e,height:r,depth:i,widthSegments:a,heightSegments:o,depthSegments:s},u.fromBufferGeometry(new Ta(e,r,i,a,o,s)),u.mergeVertices(),u}return(0,d.Z)(n)}(nl),il=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;(0,h.Z)(this,n),(e=t.call(this)).type="CircleBufferGeometry",e.parameters={radius:r,segments:i,thetaStart:a,thetaLength:o},i=Math.max(3,i);var s=[],u=[],l=[],c=[],d=new ur,p=new Kn;u.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var f=0,m=3;f<=i;f++,m+=3){var v=a+f/i*o;d.x=r*Math.cos(v),d.y=r*Math.sin(v),u.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(u[m]/r+1)/2,p.y=(u[m+1]/r+1)/2,c.push(p.x,p.y)}for(var g=1;g<=i;g++)s.push(g,g+1,0);return e.setIndex(s),e.setAttribute("position",new ji(u,3)),e.setAttribute("normal",new ji(l,3)),e.setAttribute("uv",new ji(c,2)),e}return(0,d.Z)(n)}(ia),al=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a){var o;return(0,h.Z)(this,n),(o=t.call(this)).type="CircleGeometry",o.parameters={radius:e,segments:r,thetaStart:i,thetaLength:a},o.fromBufferGeometry(new il(e,r,i,a)),o.mergeVertices(),o}return(0,d.Z)(n)}(nl),ol=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,l=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;(0,h.Z)(this,n),(e=t.call(this)).type="CylinderBufferGeometry",e.parameters={radiusTop:r,radiusBottom:i,height:a,radialSegments:o,heightSegments:s,openEnded:l,thetaStart:c,thetaLength:d};var p=(0,u.Z)(e);o=Math.floor(o),s=Math.floor(s);var f=[],m=[],v=[],g=[],y=0,x=[],_=a/2,b=0;function w(){for(var e=new ur,t=new ur,n=0,u=(i-r)/a,l=0;l<=s;l++){for(var h=[],w=l/s,M=w*(i-r)+r,S=0;S<=o;S++){var T=S/o,E=T*d+c,A=Math.sin(E),L=Math.cos(E);t.x=M*A,t.y=-w*a+_,t.z=M*L,m.push(t.x,t.y,t.z),e.set(A,u,L).normalize(),v.push(e.x,e.y,e.z),g.push(T,1-w),h.push(y++)}x.push(h)}for(var R=0;R<o;R++)for(var C=0;C<s;C++){var P=x[C][R],k=x[C+1][R],I=x[C+1][R+1],D=x[C][R+1];f.push(P,k,D),f.push(k,I,D),n+=6}p.addGroup(b,n,0),b+=n}function M(e){for(var t=y,n=new Kn,a=new ur,s=0,u=!0===e?r:i,l=!0===e?1:-1,h=1;h<=o;h++)m.push(0,_*l,0),v.push(0,l,0),g.push(.5,.5),y++;for(var x=y,w=0;w<=o;w++){var M=w/o*d+c,S=Math.cos(M),T=Math.sin(M);a.x=u*T,a.y=_*l,a.z=u*S,m.push(a.x,a.y,a.z),v.push(0,l,0),n.x=.5*S+.5,n.y=.5*T*l+.5,g.push(n.x,n.y),y++}for(var E=0;E<o;E++){var A=t+E,L=x+E;!0===e?f.push(L,L+1,A):f.push(L+1,L,A),s+=3}p.addGroup(b,s,!0===e?1:2),b+=s}return w(),!1===l&&(r>0&&M(!0),i>0&&M(!1)),e.setIndex(f),e.setAttribute("position",new ji(m,3)),e.setAttribute("normal",new ji(v,3)),e.setAttribute("uv",new ji(g,2)),e}return(0,d.Z)(n)}(ia),sl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o,s,u,l){var c;return(0,h.Z)(this,n),(c=t.call(this)).type="CylinderGeometry",c.parameters={radiusTop:e,radiusBottom:r,height:i,radialSegments:a,heightSegments:o,openEnded:s,thetaStart:u,thetaLength:l},c.fromBufferGeometry(new ol(e,r,i,a,o,s,u,l)),c.mergeVertices(),c}return(0,d.Z)(n)}(nl),ul=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o,s,u){var l;return(0,h.Z)(this,n),(l=t.call(this,0,e,r,i,a,o,s,u)).type="ConeGeometry",l.parameters={radius:e,height:r,radialSegments:i,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:u},l}return(0,d.Z)(n)}(sl),ll=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return(0,h.Z)(this,n),(e=t.call(this,0,r,i,a,o,s,u,l)).type="ConeBufferGeometry",e.parameters={radius:r,height:i,radialSegments:a,heightSegments:o,openEnded:s,thetaStart:u,thetaLength:l},e}return(0,d.Z)(n)}(ol),cl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;(0,h.Z)(this,n),(i=t.call(this)).type="PolyhedronBufferGeometry",i.parameters={vertices:e,indices:r,radius:a,detail:o};var s=[],u=[];function l(e){for(var t=new ur,n=new ur,i=new ur,a=0;a<r.length;a+=3)v(r[a+0],t),v(r[a+1],n),v(r[a+2],i),c(t,n,i,e)}function c(e,t,n,r){for(var i=r+1,a=[],o=0;o<=i;o++){a[o]=[];for(var s=e.clone().lerp(n,o/i),u=t.clone().lerp(n,o/i),l=i-o,c=0;c<=l;c++)a[o][c]=0===c&&o===i?s:s.clone().lerp(u,c/l)}for(var h=0;h<i;h++)for(var d=0;d<2*(i-h)-1;d++){var p=Math.floor(d/2);d%2===0?(m(a[h][p+1]),m(a[h+1][p]),m(a[h][p])):(m(a[h][p+1]),m(a[h+1][p+1]),m(a[h+1][p]))}}function d(e){for(var t=new ur,n=0;n<s.length;n+=3)t.x=s[n+0],t.y=s[n+1],t.z=s[n+2],t.normalize().multiplyScalar(e),s[n+0]=t.x,s[n+1]=t.y,s[n+2]=t.z}function p(){for(var e=new ur,t=0;t<s.length;t+=3){e.x=s[t+0],e.y=s[t+1],e.z=s[t+2];var n=x(e)/2/Math.PI+.5,r=_(e)/Math.PI+.5;u.push(n,1-r)}g(),f()}function f(){for(var e=0;e<u.length;e+=6){var t=u[e+0],n=u[e+2],r=u[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);i>.9&&a<.1&&(t<.2&&(u[e+0]+=1),n<.2&&(u[e+2]+=1),r<.2&&(u[e+4]+=1))}}function m(e){s.push(e.x,e.y,e.z)}function v(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function g(){for(var e=new ur,t=new ur,n=new ur,r=new ur,i=new Kn,a=new Kn,o=new Kn,l=0,c=0;l<s.length;l+=9,c+=6){e.set(s[l+0],s[l+1],s[l+2]),t.set(s[l+3],s[l+4],s[l+5]),n.set(s[l+6],s[l+7],s[l+8]),i.set(u[c+0],u[c+1]),a.set(u[c+2],u[c+3]),o.set(u[c+4],u[c+5]),r.copy(e).add(t).add(n).divideScalar(3);var h=x(r);y(i,c+0,e,h),y(a,c+2,t,h),y(o,c+4,n,h)}}function y(e,t,n,r){r<0&&1===e.x&&(u[t]=e.x-1),0===n.x&&0===n.z&&(u[t]=r/2/Math.PI+.5)}function x(e){return Math.atan2(e.z,-e.x)}function _(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}return l(o),d(a),p(),i.setAttribute("position",new ji(s,3)),i.setAttribute("normal",new ji(s.slice(),3)),i.setAttribute("uv",new ji(u,2)),0===o?i.computeVertexNormals():i.normalizeNormals(),i}return(0,d.Z)(n)}(ia),hl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,h.Z)(this,n);var a=(1+Math.sqrt(5))/2,o=1/a,s=[-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,-o,-a,0,-o,a,0,o,-a,0,o,a,-o,-a,0,-o,a,0,o,-a,0,o,a,0,-a,0,-o,a,0,-o,-a,0,o,a,0,o],u=[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];return(e=t.call(this,s,u,r,i)).type="DodecahedronBufferGeometry",e.parameters={radius:r,detail:i},e}return(0,d.Z)(n)}(cl),dl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).type="DodecahedronGeometry",i.parameters={radius:e,detail:r},i.fromBufferGeometry(new hl(e,r)),i.mergeVertices(),i}return(0,d.Z)(n)}(nl),pl=new ur,fl=new ur,ml=new ur,vl=new wi,gl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;(0,h.Z)(this,n),(i=t.call(this)).type="EdgesGeometry",i.parameters={thresholdAngle:r},r=void 0!==r?r:1,e.isGeometry&&(e=(new ia).fromGeometry(e));for(var a=Math.pow(10,4),o=Math.cos(Qn.DEG2RAD*r),s=e.getIndex(),u=e.getAttribute("position"),l=s?s.count:u.count,c=[0,0,0],d=["a","b","c"],p=new Array(3),f={},m=[],v=0;v<l;v+=3){s?(c[0]=s.getX(v),c[1]=s.getX(v+1),c[2]=s.getX(v+2)):(c[0]=v,c[1]=v+1,c[2]=v+2);var g=vl.a,y=vl.b,x=vl.c;if(g.fromBufferAttribute(u,c[0]),y.fromBufferAttribute(u,c[1]),x.fromBufferAttribute(u,c[2]),vl.getNormal(ml),p[0]="".concat(Math.round(g.x*a),",").concat(Math.round(g.y*a),",").concat(Math.round(g.z*a)),p[1]="".concat(Math.round(y.x*a),",").concat(Math.round(y.y*a),",").concat(Math.round(y.z*a)),p[2]="".concat(Math.round(x.x*a),",").concat(Math.round(x.y*a),",").concat(Math.round(x.z*a)),p[0]!==p[1]&&p[1]!==p[2]&&p[2]!==p[0])for(var _=0;_<3;_++){var b=(_+1)%3,w=p[_],M=p[b],S=vl[d[_]],T=vl[d[b]],E="".concat(w,"_").concat(M),A="".concat(M,"_").concat(w);A in f&&f[A]?(ml.dot(f[A].normal)<=o&&(m.push(S.x,S.y,S.z),m.push(T.x,T.y,T.z)),f[A]=null):E in f||(f[E]={index0:c[_],index1:c[b],normal:ml.clone()})}}for(var L in f)if(f[L]){var R=f[L],C=R.index0,P=R.index1;pl.fromBufferAttribute(u,C),fl.fromBufferAttribute(u,P),m.push(pl.x,pl.y,pl.z),m.push(fl.x,fl.y,fl.z)}return i.setAttribute("position",new ji(m,3)),i}return(0,d.Z)(n)}(ia),yl=function(e,t,n){n=n||2;var r,i,a,o,s,u,l,c=t&&t.length,h=c?t[0]*n:e.length,d=xl(e,0,h,n,!0),p=[];if(!d||d.next===d.prev)return p;if(c&&(d=function(e,t,n,r){var i,a,o,s=[];for(i=0,a=t.length;i<a;i++)(o=xl(e,t[i]*r,i<a-1?t[i+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(Cl(o));for(s.sort(El),i=0;i<s.length;i++)Al(s[i],n),n=_l(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(u=e[f+1])<i&&(i=u),s>a&&(a=s),u>o&&(o=u);l=0!==(l=Math.max(a-r,o-i))?1/l:0}return bl(d,p,n,r,i,l),p};function xl(e,t,n,r,i){var a,o;if(i===function(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=Gl(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=Gl(a,e[a],e[a+1],o);return o&&Dl(o,o.next)&&(Fl(o),o=o.next),o}function _l(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Dl(r,r.next)&&0!==Il(r.prev,r,r.next))r=r.next;else{if(Fl(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function bl(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=Rl(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,u,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ);t++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(e,r,i,a);for(var s,u,l=e;e.prev!==e.next;)if(s=e.prev,u=e.next,a?Ml(e,r,i,a):wl(e))t.push(s.i/n),t.push(e.i/n),t.push(u.i/n),Fl(e),e=u.next,l=u.next;else if((e=u)===l){o?1===o?bl(e=Sl(_l(e),t,n),t,n,r,i,a,2):2===o&&Tl(e,t,n,r,i,a):bl(_l(e),t,n,r,i,a,1);break}}}function wl(e){var t=e.prev,n=e,r=e.next;if(Il(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Pl(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Il(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ml(e,t,n,r){var i=e.prev,a=e,o=e.next;if(Il(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,u=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,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=Rl(s,u,t,n,r),d=Rl(l,c,t,n,r),p=e.prevZ,f=e.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Pl(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Il(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Pl(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Il(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&Pl(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Il(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Pl(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Il(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Sl(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Dl(i,a)&&Nl(i,r,r.next,a)&&zl(i,a)&&zl(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Fl(r),Fl(r.next),r=e=a),r=r.next}while(r!==e);return _l(r)}function Tl(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&kl(o,s)){var u=Ul(o,s);return o=_l(o,o.next),u=_l(u,u.next),bl(o,t,n,r,i,a),void bl(u,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function El(e,t){return e.x-t.x}function Al(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.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!==t);if(!n)return null;if(i===o)return n;var u,l=n,c=n.x,h=n.y,d=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&Pl(a<h?i:o,a,c,h,a<h?o:i,a,r.x,r.y)&&(u=Math.abs(a-r.y)/(i-r.x),zl(r,e)&&(u<d||u===d&&(r.x>n.x||r.x===n.x&&Ll(n,r)))&&(n=r,d=u)),r=r.next}while(r!==l);return n}(e,t),t){var n=Ul(t,e);_l(t,t.next),_l(n,n.next)}}function Ll(e,t){return Il(e.prev,e,t.prev)<0&&Il(t.next,e,e.next)<0}function Rl(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Cl(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Pl(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function kl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Nl(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(zl(e,t)&&zl(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.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!==e);return r}(e,t)&&(Il(e.prev,e,t.prev)||Il(e,t.prev,t))||Dl(e,t)&&Il(e.prev,e,e.next)>0&&Il(t.prev,t,t.next)>0)}function Il(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Dl(e,t){return e.x===t.x&&e.y===t.y}function Nl(e,t,n,r){var i=Bl(Il(e,t,n)),a=Bl(Il(e,t,r)),o=Bl(Il(n,r,e)),s=Bl(Il(n,r,t));return i!==a&&o!==s||(!(0!==i||!Ol(e,n,t))||(!(0!==a||!Ol(e,r,t))||(!(0!==o||!Ol(n,e,r))||!(0!==s||!Ol(n,t,r)))))}function Ol(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Bl(e){return e>0?1:e<0?-1:0}function zl(e,t){return Il(e.prev,e,e.next)<0?Il(e,t,e.next)>=0&&Il(e,e.prev,t)>=0:Il(e,t,e.prev)<0||Il(e,e.next,t)<0}function Ul(e,t){var n=new Hl(e.i,e.x,e.y),r=new Hl(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Gl(e,t,n,r){var i=new Hl(e,t,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 Fl(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Hl(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Vl={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return Vl.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];Wl(e),jl(n,e);var a=e.length;t.forEach(Wl);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,jl(n,t[o]);for(var s=yl(n,r),u=0;u<s.length;u+=3)i.push(s.slice(u,u+3));return i}};function Wl(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function jl(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}var Zl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;(0,h.Z)(this,n),(i=t.call(this)).type="ExtrudeBufferGeometry",i.parameters={shapes:e,options:r},e=Array.isArray(e)?e:[e];for(var a=(0,u.Z)(i),o=[],s=[],l=0,c=e.length;l<c;l++){d(e[l])}function d(e){var t=[],n=void 0!==r.curveSegments?r.curveSegments:12,i=void 0!==r.steps?r.steps:1,u=void 0!==r.depth?r.depth:100,l=void 0===r.bevelEnabled||r.bevelEnabled,c=void 0!==r.bevelThickness?r.bevelThickness:6,h=void 0!==r.bevelSize?r.bevelSize:c-2,d=void 0!==r.bevelOffset?r.bevelOffset:0,p=void 0!==r.bevelSegments?r.bevelSegments:3,f=r.extrudePath,m=void 0!==r.UVGenerator?r.UVGenerator:ql;void 0!==r.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=r.amount);var v,g,y,x,_,b=!1;f&&(v=f.getSpacedPoints(i),b=!0,l=!1,g=f.computeFrenetFrames(i,!1),y=new ur,x=new ur,_=new ur),l||(p=0,c=0,h=0,d=0);var w=e.extractPoints(n),M=w.shape,S=w.holes;if(!Vl.isClockWise(M)){M=M.reverse();for(var T=0,E=S.length;T<E;T++){var A=S[T];Vl.isClockWise(A)&&(S[T]=A.reverse())}}for(var L=Vl.triangulateShape(M,S),R=M,C=0,P=S.length;C<P;C++){var k=S[C];M=M.concat(k)}function I(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var D=M.length,N=L.length;function O(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,u=n.x-e.x,l=n.y-e.y,c=o*o+s*s,h=o*l-s*u;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(c),p=Math.sqrt(u*u+l*l),f=t.x-s/d,m=t.y+o/d,v=((n.x-l/p-f)*l-(n.y+u/p-m)*u)/(o*l-s*u),g=(r=f+o*v-e.x)*r+(i=m+s*v-e.y)*i;if(g<=2)return new Kn(r,i);a=Math.sqrt(g/2)}else{var y=!1;o>Number.EPSILON?u>Number.EPSILON&&(y=!0):o<-Number.EPSILON?u<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2))}return new Kn(r/a,i/a)}for(var B=[],z=0,U=R.length,G=U-1,F=z+1;z<U;z++,G++,F++)G===U&&(G=0),F===U&&(F=0),B[z]=O(R[z],R[G],R[F]);for(var H,V=[],W=B.concat(),j=0,Z=S.length;j<Z;j++){var q=S[j];H=[];for(var X=0,Y=q.length,J=Y-1,Q=X+1;X<Y;X++,J++,Q++)J===Y&&(J=0),Q===Y&&(Q=0),H[X]=O(q[X],q[J],q[Q]);V.push(H),W=W.concat(H)}for(var K=0;K<p;K++){for(var $=K/p,ee=c*Math.cos($*Math.PI/2),te=h*Math.sin($*Math.PI/2)+d,ne=0,re=R.length;ne<re;ne++){var ie=I(R[ne],B[ne],te);Pe(ie.x,ie.y,-ee)}for(var ae=0,oe=S.length;ae<oe;ae++){var se=S[ae];H=V[ae];for(var ue=0,le=se.length;ue<le;ue++){var ce=I(se[ue],H[ue],te);Pe(ce.x,ce.y,-ee)}}}for(var he=h+d,de=0;de<D;de++){var pe=l?I(M[de],W[de],he):M[de];b?(x.copy(g.normals[0]).multiplyScalar(pe.x),y.copy(g.binormals[0]).multiplyScalar(pe.y),_.copy(v[0]).add(x).add(y),Pe(_.x,_.y,_.z)):Pe(pe.x,pe.y,0)}for(var fe=1;fe<=i;fe++)for(var me=0;me<D;me++){var ve=l?I(M[me],W[me],he):M[me];b?(x.copy(g.normals[fe]).multiplyScalar(ve.x),y.copy(g.binormals[fe]).multiplyScalar(ve.y),_.copy(v[fe]).add(x).add(y),Pe(_.x,_.y,_.z)):Pe(ve.x,ve.y,u/i*fe)}for(var ge=p-1;ge>=0;ge--){for(var ye=ge/p,xe=c*Math.cos(ye*Math.PI/2),_e=h*Math.sin(ye*Math.PI/2)+d,be=0,we=R.length;be<we;be++){var Me=I(R[be],B[be],_e);Pe(Me.x,Me.y,u+xe)}for(var Se=0,Te=S.length;Se<Te;Se++){var Ee=S[Se];H=V[Se];for(var Ae=0,Le=Ee.length;Ae<Le;Ae++){var Re=I(Ee[Ae],H[Ae],_e);b?Pe(Re.x,Re.y+v[i-1].y,v[i-1].x+xe):Pe(Re.x,Re.y,u+xe)}}}function Ce(e,t){for(var n=e.length;--n>=0;){var r=n,a=n-1;a<0&&(a=e.length-1);for(var o=0,s=i+2*p;o<s;o++){var u=D*o,l=D*(o+1);Ie(t+r+u,t+a+u,t+a+l,t+r+l)}}}function Pe(e,n,r){t.push(e),t.push(n),t.push(r)}function ke(e,t,n){De(e),De(t),De(n);var r=o.length/3,i=m.generateTopUV(a,o,r-3,r-2,r-1);Ne(i[0]),Ne(i[1]),Ne(i[2])}function Ie(e,t,n,r){De(e),De(t),De(r),De(t),De(n),De(r);var i=o.length/3,s=m.generateSideWallUV(a,o,i-6,i-3,i-2,i-1);Ne(s[0]),Ne(s[1]),Ne(s[3]),Ne(s[1]),Ne(s[2]),Ne(s[3])}function De(e){o.push(t[3*e+0]),o.push(t[3*e+1]),o.push(t[3*e+2])}function Ne(e){s.push(e.x),s.push(e.y)}!function(){var e=o.length/3;if(l){for(var t=0,n=D*t,r=0;r<N;r++){var s=L[r];ke(s[2]+n,s[1]+n,s[0]+n)}n=D*(t=i+2*p);for(var u=0;u<N;u++){var c=L[u];ke(c[0]+n,c[1]+n,c[2]+n)}}else{for(var h=0;h<N;h++){var d=L[h];ke(d[2],d[1],d[0])}for(var f=0;f<N;f++){var m=L[f];ke(m[0]+D*i,m[1]+D*i,m[2]+D*i)}}a.addGroup(e,o.length/3-e,0)}(),function(){var e=o.length/3,t=0;Ce(R,t),t+=R.length;for(var n=0,r=S.length;n<r;n++){var i=S[n];Ce(i,t),t+=i.length}a.addGroup(e,o.length/3-e,1)}()}return i.setAttribute("position",new ji(o,3)),i.setAttribute("uv",new ji(s,2)),i.computeVertexNormals(),i}return(0,d.Z)(n,[{key:"toJSON",value:function(){var e=ia.prototype.toJSON.call(this);return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}}]),n}(ia),ql={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],u=t[3*r+1],l=t[3*i],c=t[3*i+1];return[new Kn(a,o),new Kn(s,u),new Kn(l,c)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],u=t[3*n+2],l=t[3*r],c=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*a],v=t[3*a+1],g=t[3*a+2];return Math.abs(s-c)<.01?[new Kn(o,1-u),new Kn(l,1-h),new Kn(d,1-f),new Kn(m,1-g)]:[new Kn(s,1-u),new Kn(c,1-h),new Kn(p,1-f),new Kn(v,1-g)]}};var Xl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).type="ExtrudeGeometry",i.parameters={shapes:e,options:r},i.fromBufferGeometry(new Zl(e,r)),i.mergeVertices(),i}return(0,d.Z)(n,[{key:"toJSON",value:function(){var e=(0,a.Z)((0,o.Z)(n.prototype),"toJSON",this).call(this);return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}}]),n}(nl);var Yl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,h.Z)(this,n);var a=(1+Math.sqrt(5))/2,o=[-1,a,0,1,a,0,-1,-a,0,1,-a,0,0,-1,a,0,1,a,0,-1,-a,0,1,-a,a,0,-1,a,0,1,-a,0,-1,-a,0,1],s=[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];return(e=t.call(this,o,s,r,i)).type="IcosahedronBufferGeometry",e.parameters={radius:r,detail:i},e}return(0,d.Z)(n)}(cl),Jl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).type="IcosahedronGeometry",i.parameters={radius:e,detail:r},i.fromBufferGeometry(new Yl(e,r)),i.mergeVertices(),i}return(0,d.Z)(n)}(nl),Ql=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;(0,h.Z)(this,n),(r=t.call(this)).type="LatheBufferGeometry",r.parameters={points:e,segments:i,phiStart:a,phiLength:o},i=Math.floor(i),o=Qn.clamp(o,0,2*Math.PI);for(var s=[],u=[],l=[],c=1/i,d=new ur,p=new Kn,f=0;f<=i;f++)for(var m=a+f*c*o,v=Math.sin(m),g=Math.cos(m),y=0;y<=e.length-1;y++)d.x=e[y].x*v,d.y=e[y].y,d.z=e[y].x*g,u.push(d.x,d.y,d.z),p.x=f/i,p.y=y/(e.length-1),l.push(p.x,p.y);for(var x=0;x<i;x++)for(var _=0;_<e.length-1;_++){var b=_+x*e.length,w=b,M=b+e.length,S=b+e.length+1,T=b+1;s.push(w,M,T),s.push(M,S,T)}if(r.setIndex(s),r.setAttribute("position",new ji(u,3)),r.setAttribute("uv",new ji(l,2)),r.computeVertexNormals(),o===2*Math.PI)for(var E=r.attributes.normal.array,A=new ur,L=new ur,R=new ur,C=i*e.length*3,P=0,k=0;P<e.length;P++,k+=3)A.x=E[k+0],A.y=E[k+1],A.z=E[k+2],L.x=E[C+k+0],L.y=E[C+k+1],L.z=E[C+k+2],R.addVectors(A,L).normalize(),E[k+0]=E[C+k+0]=R.x,E[k+1]=E[C+k+1]=R.y,E[k+2]=E[C+k+2]=R.z;return r}return(0,d.Z)(n)}(ia),Kl=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a){var o;return(0,h.Z)(this,n),(o=t.call(this)).type="LatheGeometry",o.parameters={points:e,segments:r,phiStart:i,phiLength:a},o.fromBufferGeometry(new Ql(e,r,i,a)),o.mergeVertices(),o}return(0,d.Z)(n)}(nl),$l=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,h.Z)(this,n);var a=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],o=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];return(e=t.call(this,a,o,r,i)).type="OctahedronBufferGeometry",e.parameters={radius:r,detail:i},e}return(0,d.Z)(n)}(cl),ec=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).type="OctahedronGeometry",i.parameters={radius:e,detail:r},i.fromBufferGeometry(new $l(e,r)),i.mergeVertices(),i}return(0,d.Z)(n)}(nl);function tc(e,t,n){ia.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r=[],i=[],a=[],o=[],s=1e-5,u=new ur,l=new ur,c=new ur,h=new ur,d=new ur;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var p=t+1,f=0;f<=n;f++)for(var m=f/n,v=0;v<=t;v++){var g=v/t;e(g,m,l),i.push(l.x,l.y,l.z),g-s>=0?(e(g-s,m,c),h.subVectors(l,c)):(e(g+s,m,c),h.subVectors(c,l)),m-s>=0?(e(g,m-s,c),d.subVectors(l,c)):(e(g,m+s,c),d.subVectors(c,l)),u.crossVectors(h,d).normalize(),a.push(u.x,u.y,u.z),o.push(g,m)}for(var y=0;y<n;y++)for(var x=0;x<t;x++){var _=y*p+x,b=y*p+x+1,w=(y+1)*p+x+1,M=(y+1)*p+x;r.push(_,b,M),r.push(b,w,M)}this.setIndex(r),this.setAttribute("position",new ji(i,3)),this.setAttribute("normal",new ji(a,3)),this.setAttribute("uv",new ji(o,2))}function nc(e,t,n){nl.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new tc(e,t,n)),this.mergeVertices()}tc.prototype=Object.create(ia.prototype),tc.prototype.constructor=tc,nc.prototype=Object.create(nl.prototype),nc.prototype.constructor=nc;var rc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a){var o;return(0,h.Z)(this,n),(o=t.call(this)).type="PlaneGeometry",o.parameters={width:e,height:r,widthSegments:i,heightSegments:a},o.fromBufferGeometry(new Ha(e,r,i,a)),o.mergeVertices(),o}return(0,d.Z)(n)}(nl),ic=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a){var o;return(0,h.Z)(this,n),(o=t.call(this)).type="PolyhedronGeometry",o.parameters={vertices:e,indices:r,radius:i,detail:a},o.fromBufferGeometry(new cl(e,r,i,a)),o.mergeVertices(),o}return(0,d.Z)(n)}(nl),ac=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;(0,h.Z)(this,n),(e=t.call(this)).type="RingBufferGeometry",e.parameters={innerRadius:r,outerRadius:i,thetaSegments:a,phiSegments:o,thetaStart:s,thetaLength:u},a=Math.max(3,a);for(var l=[],c=[],d=[],p=[],f=r,m=(i-r)/(o=Math.max(1,o)),v=new ur,g=new Kn,y=0;y<=o;y++){for(var x=0;x<=a;x++){var _=s+x/a*u;v.x=f*Math.cos(_),v.y=f*Math.sin(_),c.push(v.x,v.y,v.z),d.push(0,0,1),g.x=(v.x/i+1)/2,g.y=(v.y/i+1)/2,p.push(g.x,g.y)}f+=m}for(var b=0;b<o;b++)for(var w=b*(a+1),M=0;M<a;M++){var S=M+w,T=S,E=S+a+1,A=S+a+2,L=S+1;l.push(T,E,L),l.push(E,A,L)}return e.setIndex(l),e.setAttribute("position",new ji(c,3)),e.setAttribute("normal",new ji(d,3)),e.setAttribute("uv",new ji(p,2)),e}return(0,d.Z)(n)}(ia),oc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o,s){var u;return(0,h.Z)(this,n),(u=t.call(this)).type="RingGeometry",u.parameters={innerRadius:e,outerRadius:r,thetaSegments:i,phiSegments:a,thetaStart:o,thetaLength:s},u.fromBufferGeometry(new ac(e,r,i,a,o,s)),u.mergeVertices(),u}return(0,d.Z)(n)}(nl),sc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;(0,h.Z)(this,n),(r=t.call(this)).type="ShapeBufferGeometry",r.parameters={shapes:e,curveSegments:i};var a=[],o=[],s=[],u=[],l=0,c=0;if(!1===Array.isArray(e))p(e);else for(var d=0;d<e.length;d++)p(e[d]),r.addGroup(l,c,d),l+=c,c=0;function p(e){var t=o.length/3,n=e.extractPoints(i),r=n.shape,l=n.holes;!1===Vl.isClockWise(r)&&(r=r.reverse());for(var h=0,d=l.length;h<d;h++){var p=l[h];!0===Vl.isClockWise(p)&&(l[h]=p.reverse())}for(var f=Vl.triangulateShape(r,l),m=0,v=l.length;m<v;m++){var g=l[m];r=r.concat(g)}for(var y=0,x=r.length;y<x;y++){var _=r[y];o.push(_.x,_.y,0),s.push(0,0,1),u.push(_.x,_.y)}for(var b=0,w=f.length;b<w;b++){var M=f[b],S=M[0]+t,T=M[1]+t,E=M[2]+t;a.push(S,T,E),c+=3}}return r.setIndex(a),r.setAttribute("position",new ji(o,3)),r.setAttribute("normal",new ji(s,3)),r.setAttribute("uv",new ji(u,2)),r}return(0,d.Z)(n,[{key:"toJSON",value:function(){var e=ia.prototype.toJSON.call(this);return function(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}}]),n}(ia);var uc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).type="ShapeGeometry","object"===typeof r&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),r=r.curveSegments),i.parameters={shapes:e,curveSegments:r},i.fromBufferGeometry(new sc(e,r)),i.mergeVertices(),i}return(0,d.Z)(n,[{key:"toJSON",value:function(){var e=nl.prototype.toJSON.call(this);return function(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}}]),n}(nl);var lc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;(0,h.Z)(this,n),(e=t.call(this)).type="SphereBufferGeometry",e.parameters={radius:r,widthSegments:i,heightSegments:a,phiStart:o,phiLength:s,thetaStart:u,thetaLength:l},i=Math.max(3,Math.floor(i)),a=Math.max(2,Math.floor(a));for(var c=Math.min(u+l,Math.PI),d=0,p=[],f=new ur,m=new ur,v=[],g=[],y=[],x=[],_=0;_<=a;_++){var b=[],w=_/a,M=0;0==_&&0==u?M=.5/i:_==a&&c==Math.PI&&(M=-.5/i);for(var S=0;S<=i;S++){var T=S/i;f.x=-r*Math.cos(o+T*s)*Math.sin(u+w*l),f.y=r*Math.cos(u+w*l),f.z=r*Math.sin(o+T*s)*Math.sin(u+w*l),g.push(f.x,f.y,f.z),m.copy(f).normalize(),y.push(m.x,m.y,m.z),x.push(T+M,1-w),b.push(d++)}p.push(b)}for(var E=0;E<a;E++)for(var A=0;A<i;A++){var L=p[E][A+1],R=p[E][A],C=p[E+1][A],P=p[E+1][A+1];(0!==E||u>0)&&v.push(L,R,P),(E!==a-1||c<Math.PI)&&v.push(R,C,P)}return e.setIndex(v),e.setAttribute("position",new ji(g,3)),e.setAttribute("normal",new ji(y,3)),e.setAttribute("uv",new ji(x,2)),e}return(0,d.Z)(n)}(ia),cc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o,s,u){var l;return(0,h.Z)(this,n),(l=t.call(this)).type="SphereGeometry",l.parameters={radius:e,widthSegments:r,heightSegments:i,phiStart:a,phiLength:o,thetaStart:s,thetaLength:u},l.fromBufferGeometry(new lc(e,r,i,a,o,s,u)),l.mergeVertices(),l}return(0,d.Z)(n)}(nl),hc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,h.Z)(this,n);var a=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],o=[2,1,0,0,3,2,1,3,0,2,3,1];return(e=t.call(this,a,o,r,i)).type="TetrahedronBufferGeometry",e.parameters={radius:r,detail:i},e}return(0,d.Z)(n)}(cl),dc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).type="TetrahedronGeometry",i.parameters={radius:e,detail:r},i.fromBufferGeometry(new hc(e,r)),i.mergeVertices(),i}return(0,d.Z)(n)}(nl),pc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,h.Z)(this,n);var o=a.font;if(!o||!o.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),(0,i.Z)(r,new ia);var s=o.generateShapes(e,a.size);return a.depth=void 0!==a.height?a.height:50,void 0===a.bevelThickness&&(a.bevelThickness=10),void 0===a.bevelSize&&(a.bevelSize=8),void 0===a.bevelEnabled&&(a.bevelEnabled=!1),(r=t.call(this,s,a)).type="TextBufferGeometry",r}return(0,d.Z)(n)}(Zl),fc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).type="TextGeometry",i.parameters={text:e,parameters:r},i.fromBufferGeometry(new pc(e,r)),i.mergeVertices(),i}return(0,d.Z)(n)}(nl),mc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;(0,h.Z)(this,n),(e=t.call(this)).type="TorusBufferGeometry",e.parameters={radius:r,tube:i,radialSegments:a,tubularSegments:o,arc:s},a=Math.floor(a),o=Math.floor(o);for(var u=[],l=[],c=[],d=[],p=new ur,f=new ur,m=new ur,v=0;v<=a;v++)for(var g=0;g<=o;g++){var y=g/o*s,x=v/a*Math.PI*2;f.x=(r+i*Math.cos(x))*Math.cos(y),f.y=(r+i*Math.cos(x))*Math.sin(y),f.z=i*Math.sin(x),l.push(f.x,f.y,f.z),p.x=r*Math.cos(y),p.y=r*Math.sin(y),m.subVectors(f,p).normalize(),c.push(m.x,m.y,m.z),d.push(g/o),d.push(v/a)}for(var _=1;_<=a;_++)for(var b=1;b<=o;b++){var w=(o+1)*_+b-1,M=(o+1)*(_-1)+b-1,S=(o+1)*(_-1)+b,T=(o+1)*_+b;u.push(w,M,T),u.push(M,S,T)}return e.setIndex(u),e.setAttribute("position",new ji(l,3)),e.setAttribute("normal",new ji(c,3)),e.setAttribute("uv",new ji(d,2)),e}return(0,d.Z)(n)}(ia),vc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o){var s;return(0,h.Z)(this,n),(s=t.call(this)).type="TorusGeometry",s.parameters={radius:e,tube:r,radialSegments:i,tubularSegments:a,arc:o},s.fromBufferGeometry(new mc(e,r,i,a,o)),s.mergeVertices(),s}return(0,d.Z)(n)}(nl),gc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;(0,h.Z)(this,n),(e=t.call(this)).type="TorusKnotBufferGeometry",e.parameters={radius:r,tube:i,tubularSegments:a,radialSegments:o,p:s,q:u},a=Math.floor(a),o=Math.floor(o);for(var l=[],c=[],d=[],p=[],f=new ur,m=new ur,v=new ur,g=new ur,y=new ur,x=new ur,_=new ur,b=0;b<=a;++b){var w=b/a*s*Math.PI*2;I(w,s,u,r,v),I(w+.01,s,u,r,g),x.subVectors(g,v),_.addVectors(g,v),y.crossVectors(x,_),_.crossVectors(y,x),y.normalize(),_.normalize();for(var M=0;M<=o;++M){var S=M/o*Math.PI*2,T=-i*Math.cos(S),E=i*Math.sin(S);f.x=v.x+(T*_.x+E*y.x),f.y=v.y+(T*_.y+E*y.y),f.z=v.z+(T*_.z+E*y.z),c.push(f.x,f.y,f.z),m.subVectors(f,v).normalize(),d.push(m.x,m.y,m.z),p.push(b/a),p.push(M/o)}}for(var A=1;A<=a;A++)for(var L=1;L<=o;L++){var R=(o+1)*(A-1)+(L-1),C=(o+1)*A+(L-1),P=(o+1)*A+L,k=(o+1)*(A-1)+L;l.push(R,C,k),l.push(C,P,k)}function I(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,u=Math.cos(s);i.x=r*(2+u)*.5*a,i.y=r*(2+u)*o*.5,i.z=r*Math.sin(s)*.5}return e.setIndex(l),e.setAttribute("position",new ji(c,3)),e.setAttribute("normal",new ji(d,3)),e.setAttribute("uv",new ji(p,2)),e}return(0,d.Z)(n)}(ia),yc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o,s,u){var l;return(0,h.Z)(this,n),(l=t.call(this)).type="TorusKnotGeometry",l.parameters={radius:e,tube:r,tubularSegments:i,radialSegments:a,p:o,q:s},void 0!==u&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),l.fromBufferGeometry(new gc(e,r,i,a,o,s)),l.mergeVertices(),l}return(0,d.Z)(n)}(nl),xc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];(0,h.Z)(this,n),(r=t.call(this)).type="TubeBufferGeometry",r.parameters={path:e,tubularSegments:i,radius:a,radialSegments:o,closed:s};var u=e.computeFrenetFrames(i,s);r.tangents=u.tangents,r.normals=u.normals,r.binormals=u.binormals;var l=new ur,c=new ur,d=new Kn,p=new ur,f=[],m=[],v=[],g=[];function y(){for(var e=0;e<i;e++)x(e);x(!1===s?i:0),b(),_()}function x(t){p=e.getPointAt(t/i,p);for(var n=u.normals[t],r=u.binormals[t],s=0;s<=o;s++){var h=s/o*Math.PI*2,d=Math.sin(h),v=-Math.cos(h);c.x=v*n.x+d*r.x,c.y=v*n.y+d*r.y,c.z=v*n.z+d*r.z,c.normalize(),m.push(c.x,c.y,c.z),l.x=p.x+a*c.x,l.y=p.y+a*c.y,l.z=p.z+a*c.z,f.push(l.x,l.y,l.z)}}function _(){for(var e=1;e<=i;e++)for(var t=1;t<=o;t++){var n=(o+1)*(e-1)+(t-1),r=(o+1)*e+(t-1),a=(o+1)*e+t,s=(o+1)*(e-1)+t;g.push(n,r,s),g.push(r,a,s)}}function b(){for(var e=0;e<=i;e++)for(var t=0;t<=o;t++)d.x=e/i,d.y=t/o,v.push(d.x,d.y)}return y(),r.setIndex(g),r.setAttribute("position",new ji(f,3)),r.setAttribute("normal",new ji(m,3)),r.setAttribute("uv",new ji(v,2)),r}return(0,d.Z)(n,[{key:"toJSON",value:function(){var e=ia.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e}}]),n}(ia),_c=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o,s){var u;(0,h.Z)(this,n),(u=t.call(this)).type="TubeGeometry",u.parameters={path:e,tubularSegments:r,radius:i,radialSegments:a,closed:o},void 0!==s&&console.warn("THREE.TubeGeometry: taper has been removed.");var l=new xc(e,r,i,a,o);return u.tangents=l.tangents,u.normals=l.normals,u.binormals=l.binormals,u.fromBufferGeometry(l),u.mergeVertices(),u}return(0,d.Z)(n)}(nl),bc=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r;(0,h.Z)(this,n),(r=t.call(this)).type="WireframeGeometry";var i=[],a=[0,0],o={},s=["a","b","c"];if(e&&e.isGeometry){for(var u=e.faces,l=0,c=u.length;l<c;l++)for(var d=u[l],p=0;p<3;p++){var f=d[s[p]],m=d[s[(p+1)%3]];a[0]=Math.min(f,m),a[1]=Math.max(f,m);var v=a[0]+","+a[1];void 0===o[v]&&(o[v]={index1:a[0],index2:a[1]})}for(var g in o){var y=o[g],x=e.vertices[y.index1];i.push(x.x,x.y,x.z),x=e.vertices[y.index2],i.push(x.x,x.y,x.z)}}else if(e&&e.isBufferGeometry){var _=new ur;if(null!==e.index){var b=e.attributes.position,w=e.index,M=e.groups;0===M.length&&(M=[{start:0,count:w.count,materialIndex:0}]);for(var S=0,T=M.length;S<T;++S)for(var E=M[S],A=E.start,L=A,R=A+E.count;L<R;L+=3)for(var C=0;C<3;C++){var P=w.getX(L+C),k=w.getX(L+(C+1)%3);a[0]=Math.min(P,k),a[1]=Math.max(P,k);var I=a[0]+","+a[1];void 0===o[I]&&(o[I]={index1:a[0],index2:a[1]})}for(var D in o){var N=o[D];_.fromBufferAttribute(b,N.index1),i.push(_.x,_.y,_.z),_.fromBufferAttribute(b,N.index2),i.push(_.x,_.y,_.z)}}else for(var O=e.attributes.position,B=0,z=O.count/3;B<z;B++)for(var U=0;U<3;U++){var G=3*B+U;_.fromBufferAttribute(O,G),i.push(_.x,_.y,_.z);var F=3*B+(U+1)%3;_.fromBufferAttribute(O,F),i.push(_.x,_.y,_.z)}}return r.setAttribute("position",new ji(i,3)),r}return(0,d.Z)(n)}(ia),wc=Object.freeze({__proto__:null,BoxGeometry:rl,BoxBufferGeometry:Ta,CircleGeometry:al,CircleBufferGeometry:il,ConeGeometry:ul,ConeBufferGeometry:ll,CylinderGeometry:sl,CylinderBufferGeometry:ol,DodecahedronGeometry:dl,DodecahedronBufferGeometry:hl,EdgesGeometry:gl,ExtrudeGeometry:Xl,ExtrudeBufferGeometry:Zl,IcosahedronGeometry:Jl,IcosahedronBufferGeometry:Yl,LatheGeometry:Kl,LatheBufferGeometry:Ql,OctahedronGeometry:ec,OctahedronBufferGeometry:$l,ParametricGeometry:nc,ParametricBufferGeometry:tc,PlaneGeometry:rc,PlaneBufferGeometry:Ha,PolyhedronGeometry:ic,PolyhedronBufferGeometry:cl,RingGeometry:oc,RingBufferGeometry:ac,ShapeGeometry:uc,ShapeBufferGeometry:sc,SphereGeometry:cc,SphereBufferGeometry:lc,TetrahedronGeometry:dc,TetrahedronBufferGeometry:hc,TextGeometry:fc,TextBufferGeometry:pc,TorusGeometry:vc,TorusBufferGeometry:mc,TorusKnotGeometry:yc,TorusKnotBufferGeometry:gc,TubeGeometry:_c,TubeBufferGeometry:xc,WireframeGeometry:bc});function Mc(e){ki.call(this),this.type="ShadowMaterial",this.color=new Ri(0),this.transparent=!0,this.setValues(e)}function Sc(e){Ra.call(this,e),this.type="RawShaderMaterial"}function Tc(e){ki.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ri(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 Ri(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=gn,this.normalScale=new Kn(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(e)}function Ec(e){Tc.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Kn(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(e){this.reflectivity=Qn.clamp(2.5*(e-1)/(e+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(e)}function Ac(e){ki.call(this),this.type="MeshPhongMaterial",this.color=new Ri(16777215),this.specular=new Ri(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ri(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=gn,this.normalScale=new Kn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ae,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(e)}function Lc(e){ki.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ri(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ri(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=gn,this.normalScale=new Kn(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(e)}function Rc(e){ki.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=gn,this.normalScale=new Kn(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(e)}function Cc(e){ki.call(this),this.type="MeshLambertMaterial",this.color=new Ri(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ri(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ae,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(e)}function Pc(e){ki.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ri(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=gn,this.normalScale=new Kn(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(e)}function kc(e){Cu.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Mc.prototype=Object.create(ki.prototype),Mc.prototype.constructor=Mc,Mc.prototype.isShadowMaterial=!0,Mc.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this},Sc.prototype=Object.create(Ra.prototype),Sc.prototype.constructor=Sc,Sc.prototype.isRawShaderMaterial=!0,Tc.prototype=Object.create(ki.prototype),Tc.prototype.constructor=Tc,Tc.prototype.isMeshStandardMaterial=!0,Tc.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.vertexTangents=e.vertexTangents,this},Ec.prototype=Object.create(Tc.prototype),Ec.prototype.constructor=Ec,Ec.prototype.isMeshPhysicalMaterial=!0,Ec.prototype.copy=function(e){return Tc.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Ri).copy(e.sheen):this.sheen=null,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this},Ac.prototype=Object.create(ki.prototype),Ac.prototype.constructor=Ac,Ac.prototype.isMeshPhongMaterial=!0,Ac.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Lc.prototype=Object.create(ki.prototype),Lc.prototype.constructor=Lc,Lc.prototype.isMeshToonMaterial=!0,Lc.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Rc.prototype=Object.create(ki.prototype),Rc.prototype.constructor=Rc,Rc.prototype.isMeshNormalMaterial=!0,Rc.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Cc.prototype=Object.create(ki.prototype),Cc.prototype.constructor=Cc,Cc.prototype.isMeshLambertMaterial=!0,Cc.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Pc.prototype=Object.create(ki.prototype),Pc.prototype.constructor=Pc,Pc.prototype.isMeshMatcapMaterial=!0,Pc.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},kc.prototype=Object.create(Cu.prototype),kc.prototype.constructor=kc,kc.prototype.isLineDashedMaterial=!0,kc.prototype.copy=function(e){return Cu.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Ic=Object.freeze({__proto__:null,ShadowMaterial:Mc,SpriteMaterial:nu,RawShaderMaterial:Sc,ShaderMaterial:Ra,PointsMaterial:Fu,MeshPhysicalMaterial:Ec,MeshStandardMaterial:Tc,MeshPhongMaterial:Ac,MeshToonMaterial:Lc,MeshNormalMaterial:Rc,MeshLambertMaterial:Cc,MeshDepthMaterial:Os,MeshDistanceMaterial:Bs,MeshBasicMaterial:Ii,MeshMatcapMaterial:Pc,LineDashedMaterial:kc,LineBasicMaterial:Cu,Material:ki}),Dc={arraySlice:function(e,t,n){return Dc.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"===typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,u=0;u!==t;++u)i[o++]=e[s+u];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)}},subclip:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30,a=e.clone();a.name=t;for(var o=[],s=0;s<a.tracks.length;++s){for(var u=a.tracks[s],l=u.getValueSize(),c=[],h=[],d=0;d<u.times.length;++d){var p=u.times[d]*i;if(!(p<n||p>=r)){c.push(u.times[d]);for(var f=0;f<l;++f)h.push(u.values[d*l+f])}}0!==c.length&&(u.times=Dc.convertArray(c,u.times.constructor),u.values=Dc.convertArray(h,u.values.constructor),o.push(u))}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(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);for(var i=n.tracks.length,a=t/r,o=function(t){var r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)return"continue";var o=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===o)return"continue";var s=0,u=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=u/3);var l=0,c=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=c/3);var h=r.times.length-1,d=void 0;if(a<=r.times[0]){var p=s,f=u-s;d=Dc.arraySlice(r.values,p,f)}else if(a>=r.times[h]){var m=h*u+s,v=m+u-s;d=Dc.arraySlice(r.values,m,v)}else{var g=r.createInterpolant(),y=s,x=u-s;g.evaluate(a),d=Dc.arraySlice(g.resultBuffer,y,x)}"quaternion"===i&&(new sr).fromArray(d).normalize().conjugate().toArray(d);for(var _=o.times.length,b=0;b<_;++b){var w=b*c+l;if("quaternion"===i)sr.multiplyQuaternionsFlat(o.values,w,d,0,o.values,w);else for(var M=c-2*l,S=0;S<M;++S)o.values[w+S]-=d[S]}},s=0;s<i;++s)o(s);return e.blendMode=nn,e}};function Nc(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Oc(e,t,n,r){Nc.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Bc(e,t,n,r){Nc.call(this,e,t,n,r)}function zc(e,t,n,r){Nc.call(this,e,t,n,r)}function Uc(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Dc.convertArray(t,this.TimeBufferType),this.values=Dc.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Gc(e,t,n){Uc.call(this,e,t,n)}function Fc(e,t,n,r){Uc.call(this,e,t,n,r)}function Hc(e,t,n,r){Uc.call(this,e,t,n,r)}function Vc(e,t,n,r){Nc.call(this,e,t,n,r)}function Wc(e,t,n,r){Uc.call(this,e,t,n,r)}function jc(e,t,n,r){Uc.call(this,e,t,n,r)}function Zc(e,t,n,r){Uc.call(this,e,t,n,r)}function qc(e,t,n,r){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.blendMode=void 0!==r?r:tn,this.uuid=Qn.generateUUID(),this.duration<0&&this.resetDuration()}function Xc(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Hc;case"vector":case"vector2":case"vector3":case"vector4":return Zc;case"color":return Fc;case"quaternion":return Wc;case"bool":case"boolean":return Gc;case"string":return jc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],r=[];Dc.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(Nc.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(var u=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===u)break;if(r=i,e>=(i=t[--n-1]))break t}a=n,n=0}for(;n<a;){var l=n+a>>>1;e<t[l]?a=l:n=l+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Nc.prototype,{beforeStart_:Nc.prototype.copySampleValue_,afterEnd_:Nc.prototype.copySampleValue_}),Oc.prototype=Object.assign(Object.create(Nc.prototype),{constructor:Oc,DefaultSettings_:{endingStart:Kt,endingEnd:Kt},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case $t:i=e,o=2*t-n;break;case en:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case $t:a=e,s=2*n-t;break;case en:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var u=.5*(n-t),l=this.valueSize;this._weightPrev=u/(t-o),this._weightNext=u/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,u=s-o,l=this._offsetPrev,c=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,v=-h*m+2*h*f-h*p,g=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,_=0;_!==o;++_)i[_]=v*a[l+_]+g*a[u+_]+y*a[s+_]+x*a[c+_];return i}}),Bc.prototype=Object.assign(Object.create(Nc.prototype),{constructor:Bc,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,u=s-o,l=(n-t)/(r-t),c=1-l,h=0;h!==o;++h)i[h]=a[u+h]*c+a[s+h]*l;return i}}),zc.prototype=Object.assign(Object.create(Nc.prototype),{constructor:zc,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(Uc,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Dc.convertArray(e.times,Array),values:Dc.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}),Object.assign(Uc.prototype,{constructor:Uc,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Jt,InterpolantFactoryMethodDiscrete:function(e){return new zc(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Bc(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Oc(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case Yt:t=this.InterpolantFactoryMethodDiscrete;break;case Jt:t=this.InterpolantFactoryMethodLinear;break;case Qt:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Yt;case this.InterpolantFactoryMethodLinear:return Jt;case this.InterpolantFactoryMethodSmooth:return Qt}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Dc.arraySlice(n,i,a),this.values=Dc.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!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),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&Dc.isTypedArray(r))for(var u=0,l=r.length;u!==l;++u){var c=r[u];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,c),e=!1;break}}return e},optimize:function(){for(var e=Dc.arraySlice(this.times),t=Dc.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Qt,i=e.length-1,a=1,o=1;o<i;++o){var s=!1,u=e[o];if(u!==e[o+1]&&(1!==o||u!==u[0]))if(r)s=!0;else for(var l=o*n,c=l-n,h=l+n,d=0;d!==n;++d){var p=t[l+d];if(p!==t[c+d]||p!==t[h+d]){s=!0;break}}if(s){if(o!==a){e[a]=e[o];for(var f=o*n,m=a*n,v=0;v!==n;++v)t[m+v]=t[f+v]}++a}}if(i>0){e[a]=e[i];for(var g=i*n,y=a*n,x=0;x!==n;++x)t[y+x]=t[g+x];++a}return a!==e.length?(this.times=Dc.arraySlice(e,0,a),this.values=Dc.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this},clone:function(){var e=Dc.arraySlice(this.times,0),t=Dc.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),Gc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Gc,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Yt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Fc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Fc,ValueTypeName:"color"}),Hc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Hc,ValueTypeName:"number"}),Vc.prototype=Object.assign(Object.create(Nc.prototype),{constructor:Vc,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),u=e*o,l=u+o;u!==l;u+=4)sr.slerpFlat(i,0,a,u-o,a,u,s);return i}}),Wc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Wc,ValueTypeName:"quaternion",DefaultInterpolation:Jt,InterpolantFactoryMethodLinear:function(e){return new Vc(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),jc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:jc,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Yt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Zc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Zc,ValueTypeName:"vector"}),Object.assign(qc,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(Xc(n[i]).scale(r));var o=new qc(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},i=0,a=n.length;i!==a;++i)t.push(Uc.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],u=[];s.push((o+i-1)%i,o,(o+1)%i),u.push(0,1,0);var l=Dc.getKeyframeOrder(s);s=Dc.sortedArray(s,1,l),u=Dc.sortedArray(u,1,l),r||0!==s[0]||(s.push(i),u.push(u[0])),a.push(new Hc(".morphTargetInfluences["+t[o].name+"]",s,u).scale(1/n))}return new qc(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],u=s.name.match(i);if(u&&u.length>1){var l=u[1],c=r[l];c||(r[l]=c=[]),c.push(s)}}var h=[];for(var d in r)h.push(qc.CreateFromMorphTargetSequence(d,r[d],t,n));return h},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];Dc.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode,s=e.length||-1,u=e.hierarchy||[],l=0;l<u.length;l++){var c=u[l].keys;if(c&&0!==c.length)if(c[0].morphTargets){var h={},d=void 0;for(d=0;d<c.length;d++)if(c[d].morphTargets)for(var p=0;p<c[d].morphTargets.length;p++)h[c[d].morphTargets[p]]=-1;for(var f in h){for(var m=[],v=[],g=0;g!==c[d].morphTargets.length;++g){var y=c[d];m.push(y.time),v.push(y.morphTarget===f?1:0)}r.push(new Hc(".morphTargetInfluence["+f+"]",m,v))}s=h.length*(a||1)}else{var x=".bones["+t[l].name+"]";n(Zc,x+".position",c,"pos",r),n(Wc,x+".quaternion",c,"rot",r),n(Zc,x+".scale",c,"scl",r)}}return 0===r.length?null:new qc(i,s,r,o)}}),Object.assign(qc.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new qc(this.name,this.duration,e,this.blendMode)},toJSON:function(){return qc.toJSON(this)}});var Yc={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function Jc(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0,u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return u.push(e,t),this},this.removeHandler=function(e){var t=u.indexOf(e);return-1!==t&&u.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=u.length;t<n;t+=2){var r=u[t],i=u[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}var Qc=new Jc;function Kc(e){this.manager=void 0!==e?e:Qc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(Kc.prototype,{load:function(){},loadAsync:function(e,t){var n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}});var $c={};function eh(e){Kc.call(this,e)}function th(e){Kc.call(this,e)}function nh(e){Kc.call(this,e)}function rh(e){Kc.call(this,e)}function ih(e){Kc.call(this,e)}function ah(e){Kc.call(this,e)}function oh(e){Kc.call(this,e)}function sh(){this.type="Curve",this.arcLengthDivisions=200}function uh(e,t,n,r,i,a,o,s){sh.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||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 lh(e,t,n,r,i,a){uh.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function ch(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var u=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,u*=o,l*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}eh.prototype=Object.assign(Object.create(Kc.prototype),{constructor:eh,load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Yc.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===$c[e]){var o,s=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(s){var u=s[1],l=!!s[2],c=s[3];c=decodeURIComponent(c),l&&(c=atob(c));try{var h,d=(this.responseType||"").toLowerCase();switch(d){case"arraybuffer":case"blob":for(var p=new Uint8Array(c.length),f=0;f<c.length;f++)p[f]=c.charCodeAt(f);h="blob"===d?new Blob([p.buffer],{type:u}):p.buffer;break;case"document":var m=new DOMParser;h=m.parseFromString(c,u);break;case"json":h=JSON.parse(c);break;default:h=c}setTimeout((function(){t&&t(h),i.manager.itemEnd(e)}),0)}catch(g){setTimeout((function(){r&&r(g),i.manager.itemError(e),i.manager.itemEnd(e)}),0)}}else{for(var v in $c[e]=[],$c[e].push({onLoad:t,onProgress:n,onError:r}),(o=new XMLHttpRequest).open("GET",e,!0),o.addEventListener("load",(function(t){var n=this.response,r=$c[e];if(delete $c[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Yc.add(e,n);for(var a=0,o=r.length;a<o;a++){var s=r[a];s.onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(var u=0,l=r.length;u<l;u++){var c=r[u];c.onError&&c.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}}),!1),o.addEventListener("progress",(function(t){for(var n=$c[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}}),!1),o.addEventListener("error",(function(t){var n=$c[e];delete $c[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),o.addEventListener("abort",(function(t){var n=$c[e];delete $c[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!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"),this.requestHeader)o.setRequestHeader(v,this.requestHeader[v]);o.send(null)}return i.manager.itemStart(e),o}$c[e].push({onLoad:t,onProgress:n,onError:r})},setResponseType:function(e){return this.responseType=e,this},setMimeType:function(e){return this.mimeType=e,this}}),th.prototype=Object.assign(Object.create(Kc.prototype),{constructor:th,load:function(e,t,n,r){var i=this,a=new eh(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(a){r?r(a):console.error(a),i.manager.itemError(e)}}),n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=qc.parse(e[n]);t.push(r)}return t}}),nh.prototype=Object.assign(Object.create(Kc.prototype),{constructor:nh,load:function(e,t,n,r){var i=this,a=[],o=new Yu;o.image=a;var s=new eh(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);var u=0;function l(l){s.load(e[l],(function(e){var n=i.parse(e,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(u+=1)&&(1===n.mipmapCount&&(o.minFilter=Re),o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(Array.isArray(e))for(var c=0,h=e.length;c<h;++c)l(c);else s.load(e,(function(e){var n=i.parse(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var u=0;u<n.mipmapCount;u++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+u]),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=Re),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o}}),rh.prototype=Object.assign(Object.create(Kc.prototype),{constructor:rh,load:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Yc.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",u,!1),Yc.add(e,this),t&&t(this),i.manager.itemEnd(e)}function u(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",u,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",u,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}),ih.prototype=Object.assign(Object.create(Kc.prototype),{constructor:ih,load:function(e,t,n,r){var i=new Da,a=new rh(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],(function(e){i.images[n]=e,6===++o&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(var u=0;u<e.length;++u)s(u);return i}}),ah.prototype=Object.assign(Object.create(Kc.prototype),{constructor:ah,load:function(e,t,n,r){var i=this,a=new Oa,o=new eh(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(i.withCredentials),o.load(e,(function(e){var n=i.parse(e);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:we,a.wrapT=void 0!==n.wrapT?n.wrapT:we,a.magFilter=void 0!==n.magFilter?n.magFilter:Re,a.minFilter=void 0!==n.minFilter?n.minFilter:Re,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=ke),1===n.mipmapCount&&(a.minFilter=Re),a.needsUpdate=!0,t&&t(a,n))}),n,r),a}}),oh.prototype=Object.assign(Object.create(Kc.prototype),{constructor:oh,load:function(e,t,n,r){var i=new nr,a=new rh(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(n){i.image=n;var r=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?qe:Xe,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(sh.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n=[],r=this.getPoint(0),i=0;n.push(0);for(var a=1;a<=e;a++)i+=(t=this.getPoint(a/e)).distanceTo(r),n.push(i),r=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,u=a-1;s<=u;)if((o=r[i=Math.floor(s+(u-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){u=i;break}u=i-1}if(r[i=u]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},getTangent:function(e,t){var n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);var a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new Kn:new ur);return s.copy(o).sub(a).normalize(),s},getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){for(var n=new ur,r=[],i=[],a=[],o=new ur,s=new Or,u=0;u<=e;u++){var l=u/e;r[u]=this.getTangentAt(l,new ur),r[u].normalize()}i[0]=new ur,a[0]=new ur;var c=Number.MAX_VALUE,h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=c&&(c=h,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),p<=c&&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<=e;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(Qn.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===t){var v=Math.acos(Qn.clamp(i[0].dot(i[e]),-1,1));v/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(v=-v);for(var g=1;g<=e;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(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),uh.prototype=Object.create(sh.prototype),uh.prototype.constructor=uh,uh.prototype.isEllipseCurve=!0,uh.prototype.getPoint=function(e,t){for(var n=t||new Kn,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+e*i,s=this.aX+this.xRadius*Math.cos(o),u=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var l=Math.cos(this.aRotation),c=Math.sin(this.aRotation),h=s-this.aX,d=u-this.aY;s=h*l-d*c+this.aX,u=h*c+d*l+this.aY}return n.set(s,u)},uh.prototype.copy=function(e){return sh.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},uh.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},uh.prototype.fromJSON=function(e){return sh.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},lh.prototype=Object.create(uh.prototype),lh.prototype.constructor=lh,lh.prototype.isArcCurve=!0;var hh=new ur,dh=new ch,ph=new ch,fh=new ch;function mh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;sh.call(this),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}function vh(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function gh(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function yh(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function xh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Kn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Kn,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Kn,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Kn;sh.call(this),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}function _h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ur,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ur,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ur,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new ur;sh.call(this),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}function bh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Kn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Kn;sh.call(this),this.type="LineCurve",this.v1=e,this.v2=t}function wh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ur,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ur;sh.call(this),this.type="LineCurve3",this.v1=e,this.v2=t}function Mh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Kn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Kn,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Kn;sh.call(this),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}function Sh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ur,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ur,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ur;sh.call(this),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}function Th(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];sh.call(this),this.type="SplineCurve",this.points=e}mh.prototype=Object.create(sh.prototype),mh.prototype.constructor=mh,mh.prototype.isCatmullRomCurve3=!0,mh.prototype.getPoint=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ur,i=r,a=this.points,o=a.length,s=(o-(this.closed?0:1))*e,u=Math.floor(s),l=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/o)+1)*o:0===l&&u===o-1&&(u=o-2,l=1),this.closed||u>0?t=a[(u-1)%o]:(hh.subVectors(a[0],a[1]).add(a[0]),t=hh);var c=a[u%o],h=a[(u+1)%o];if(this.closed||u+2<o?n=a[(u+2)%o]:(hh.subVectors(a[o-1],a[o-2]).add(a[o-1]),n=hh),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(t.distanceToSquared(c),d),f=Math.pow(c.distanceToSquared(h),d),m=Math.pow(h.distanceToSquared(n),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),dh.initNonuniformCatmullRom(t.x,c.x,h.x,n.x,p,f,m),ph.initNonuniformCatmullRom(t.y,c.y,h.y,n.y,p,f,m),fh.initNonuniformCatmullRom(t.z,c.z,h.z,n.z,p,f,m)}else"catmullrom"===this.curveType&&(dh.initCatmullRom(t.x,c.x,h.x,n.x,this.tension),ph.initCatmullRom(t.y,c.y,h.y,n.y,this.tension),fh.initCatmullRom(t.z,c.z,h.z,n.z,this.tension));return i.set(dh.calc(l),ph.calc(l),fh.calc(l)),i},mh.prototype.copy=function(e){sh.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},mh.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},mh.prototype.fromJSON=function(e){sh.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new ur).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},xh.prototype=Object.create(sh.prototype),xh.prototype.constructor=xh,xh.prototype.isCubicBezierCurve=!0,xh.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Kn,n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(yh(e,r.x,i.x,a.x,o.x),yh(e,r.y,i.y,a.y,o.y)),n},xh.prototype.copy=function(e){return sh.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},xh.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},xh.prototype.fromJSON=function(e){return sh.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},_h.prototype=Object.create(sh.prototype),_h.prototype.constructor=_h,_h.prototype.isCubicBezierCurve3=!0,_h.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ur,n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(yh(e,r.x,i.x,a.x,o.x),yh(e,r.y,i.y,a.y,o.y),yh(e,r.z,i.z,a.z,o.z)),n},_h.prototype.copy=function(e){return sh.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},_h.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},_h.prototype.fromJSON=function(e){return sh.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},bh.prototype=Object.create(sh.prototype),bh.prototype.constructor=bh,bh.prototype.isLineCurve=!0,bh.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Kn,n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},bh.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},bh.prototype.getTangent=function(e,t){var n=t||new Kn;return n.copy(this.v2).sub(this.v1).normalize(),n},bh.prototype.copy=function(e){return sh.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},bh.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},bh.prototype.fromJSON=function(e){return sh.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},wh.prototype=Object.create(sh.prototype),wh.prototype.constructor=wh,wh.prototype.isLineCurve3=!0,wh.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ur,n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},wh.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},wh.prototype.copy=function(e){return sh.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},wh.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},wh.prototype.fromJSON=function(e){return sh.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Mh.prototype=Object.create(sh.prototype),Mh.prototype.constructor=Mh,Mh.prototype.isQuadraticBezierCurve=!0,Mh.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Kn,n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(gh(e,r.x,i.x,a.x),gh(e,r.y,i.y,a.y)),n},Mh.prototype.copy=function(e){return sh.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Mh.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Mh.prototype.fromJSON=function(e){return sh.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Sh.prototype=Object.create(sh.prototype),Sh.prototype.constructor=Sh,Sh.prototype.isQuadraticBezierCurve3=!0,Sh.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ur,n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(gh(e,r.x,i.x,a.x),gh(e,r.y,i.y,a.y),gh(e,r.z,i.z,a.z)),n},Sh.prototype.copy=function(e){return sh.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Sh.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Sh.prototype.fromJSON=function(e){return sh.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Th.prototype=Object.create(sh.prototype),Th.prototype.constructor=Th,Th.prototype.isSplineCurve=!0,Th.prototype.getPoint=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Kn,n=t,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],u=r[a],l=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(vh(o,s.x,u.x,l.x,c.x),vh(o,s.y,u.y,l.y,c.y)),n},Th.prototype.copy=function(e){sh.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Th.prototype.toJSON=function(){var e=sh.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Th.prototype.fromJSON=function(e){sh.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Kn).fromArray(r))}return this};var Eh=Object.freeze({__proto__:null,ArcCurve:lh,CatmullRomCurve3:mh,CubicBezierCurve:xh,CubicBezierCurve3:_h,EllipseCurve:uh,LineCurve:bh,LineCurve3:wh,QuadraticBezierCurve:Mh,QuadraticBezierCurve3:Sh,SplineCurve:Th});function Ah(){sh.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Lh(e){Ah.call(this),this.type="Path",this.currentPoint=new Kn,e&&this.setFromPoints(e)}function Rh(e){Lh.call(this,e),this.uuid=Qn.generateUUID(),this.type="Shape",this.holes=[]}function Ch(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;si.call(this),this.type="Light",this.color=new Ri(e),this.intensity=t}function Ph(e,t,n){Ch.call(this,e,n),this.type="HemisphereLight",this.position.copy(si.DefaultUp),this.updateMatrix(),this.groundColor=new Ri(t)}function kh(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Kn(512,512),this.map=null,this.mapPass=null,this.matrix=new Or,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ua,this._frameExtents=new Kn(1,1),this._viewportCount=1,this._viewports=[new ir(0,0,1,1)]}function Ih(){kh.call(this,new Pa(50,1,.5,500)),this.focus=1}function Dh(e,t,n,r,i,a){Ch.call(this,e,t),this.type="SpotLight",this.position.copy(si.DefaultUp),this.updateMatrix(),this.target=new si,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/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 Ih}function Nh(){kh.call(this,new Pa(90,1,.5,500)),this._frameExtents=new Kn(4,2),this._viewportCount=6,this._viewports=[new ir(2,1,1,1),new ir(0,1,1,1),new ir(3,1,1,1),new ir(1,1,1,1),new ir(3,0,1,1),new ir(1,0,1,1)],this._cubeDirections=[new ur(1,0,0),new ur(-1,0,0),new ur(0,0,1),new ur(0,0,-1),new ur(0,1,0),new ur(0,-1,0)],this._cubeUps=[new ur(0,1,0),new ur(0,1,0),new ur(0,1,0),new ur(0,1,0),new ur(0,0,1),new ur(0,0,-1)]}function Oh(e,t,n,r){Ch.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Nh}function Bh(e,t,n,r,i,a){Ca.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t: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 zh(){kh.call(this,new Bh(-5,5,5,-5,.5,500))}function Uh(e,t){Ch.call(this,e,t),this.type="DirectionalLight",this.position.copy(si.DefaultUp),this.updateMatrix(),this.target=new si,this.shadow=new zh}function Gh(e,t){Ch.call(this,e,t),this.type="AmbientLight"}function Fh(e,t,n,r){Ch.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}Ah.prototype=Object.assign(Object.create(sh.prototype),{constructor:Ah,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new bh(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.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 e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,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),u=0;u<s.length;u++){var l=s[u];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(e){sh.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=sh.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){sh.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Eh[r.type]).fromJSON(r))}return this}}),Lh.prototype=Object.assign(Object.create(Ah.prototype),{constructor:Lh,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new bh(this.currentPoint.clone(),new Kn(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new Mh(this.currentPoint.clone(),new Kn(e,t),new Kn(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new xh(this.currentPoint.clone(),new Kn(e,t),new Kn(n,r),new Kn(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t=new Th([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this},absarc:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this},ellipse:function(e,t,n,r,i,a,o,s){var u=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+u,t+l,n,r,i,a,o,s),this},absellipse:function(e,t,n,r,i,a,o,s){var u=new uh(e,t,n,r,i,a,o,s);if(this.curves.length>0){var l=u.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(u);var c=u.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return Ah.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Ah.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Ah.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Rh.prototype=Object.assign(Object.create(Lh.prototype),{constructor:Rh,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Lh.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Lh.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Lh.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Lh).fromJSON(r))}return this}}),Ch.prototype=Object.assign(Object.create(si.prototype),{constructor:Ch,isLight:!0,copy:function(e){return si.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=si.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Ph.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Ph,isHemisphereLight:!0,copy:function(e){return Ch.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(kh.prototype,{_projScreenMatrix:new Or,_lightPositionWorld:new ur,_lookTarget:new ur,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.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(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Ih.prototype=Object.assign(Object.create(kh.prototype),{constructor:Ih,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*Qn.RAD2DEG*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),kh.prototype.updateMatrices.call(this,e)}}),Dh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Dh,isSpotLight:!0,copy:function(e){return Ch.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Nh.prototype=Object.assign(Object.create(kh.prototype),{constructor:Nh,isPointLightShadow:!0,updateMatrices:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),Oh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Oh,isPointLight:!0,copy:function(e){return Ch.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Bh.prototype=Object.assign(Object.create(Ca.prototype),{constructor:Bh,isOrthographicCamera:!0,copy:function(e,t){return Ca.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,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=e,this.view.fullHeight=t,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 e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var u=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=u*this.view.offsetX)+u*this.view.width,s=(o-=l*this.view.offsetY)-l*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){var t=si.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),zh.prototype=Object.assign(Object.create(kh.prototype),{constructor:zh,isDirectionalLightShadow:!0,updateMatrices:function(e){kh.prototype.updateMatrices.call(this,e)}}),Uh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Uh,isDirectionalLight:!0,copy:function(e){return Ch.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Gh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Gh,isAmbientLight:!0}),Fh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Fh,isRectAreaLight:!0,copy:function(e){return Ch.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Ch.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}});var Hh=function(){function e(){(0,h.Z)(this,e),Object.defineProperty(this,"isSphericalHarmonics3",{value:!0}),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new ur)}return(0,d.Z)(e,[{key:"set",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}},{key:"getIrradianceAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}},{key:"add",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}},{key:"addScaledSH",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}},{key:"scale",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}},{key:"lerp",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}},{key:"equals",value:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}],[{key:"getBasisAt",value:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}]),e}();function Vh(e,t){Ch.call(this,void 0,t),this.type="LightProbe",this.sh=void 0!==e?e:new Hh}function Wh(e){Kc.call(this,e),this.textures={}}Vh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Vh,isLightProbe:!0,copy:function(e){return Ch.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){var t=Ch.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}}),Wh.prototype=Object.assign(Object.create(Kc.prototype),{constructor:Wh,load:function(e,t,n,r){var i=this,a=new eh(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(a){r?r(a):console.error(a),i.manager.itemError(e)}}),n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new Ic[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new Ri).setHex(e.sheen)),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.vertexTangents&&(r.vertexTangents=e.vertexTangents),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"===typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new Ri).setHex(a.value);break;case"v2":r.uniforms[i].value=(new Kn).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new ur).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new ir).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new $n).fromArray(a.value);break;case"m4":r.uniforms[i].value=(new Or).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new Kn).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Kn).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});var jh={decodeText:function(e){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(i){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function Zh(){ia.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function qh(e,t,n,r){"number"===typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Oi.call(this,e,t,n),this.meshPerAttribute=r||1}function Xh(e){Kc.call(this,e)}Zh.prototype=Object.assign(Object.create(ia.prototype),{constructor:Zh,isInstancedBufferGeometry:!0,copy:function(e){return ia.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=ia.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}),qh.prototype=Object.assign(Object.create(Oi.prototype),{constructor:qh,isInstancedBufferAttribute:!0,copy:function(e){return Oi.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=Oi.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),Xh.prototype=Object.assign(Object.create(Kc.prototype),{constructor:Xh,load:function(e,t,n,r){var i=this,a=new eh(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(a){r?r(a):console.error(a),i.manager.itemError(e)}}),n,r)},parse:function(e){var t={},n={};function r(e,r){if(void 0!==t[r])return t[r];var i=e.interleavedBuffers[r],a=function(e,t){if(void 0!==n[t])return n[t];var r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),o=new Ks(Ji(i.type,a),i.stride);return o.uuid=i.uuid,t[r]=o,o}var i=e.isInstancedBufferGeometry?new Zh:new ia,a=e.data.index;if(void 0!==a){var o=Ji(a.type,a.array);i.setIndex(new Oi(o,1))}var s=e.data.attributes;for(var u in s){var l=s[u],c=void 0;if(l.isInterleavedBufferAttribute){c=new tu(r(e.data,l.data),l.itemSize,l.offset,l.normalized)}else{var h=Ji(l.type,l.array);c=new(l.isInstancedBufferAttribute?qh:Oi)(h,l.itemSize,l.normalized)}void 0!==l.name&&(c.name=l.name),i.setAttribute(u,c)}var d=e.data.morphAttributes;if(d)for(var p in d){for(var f=d[p],m=[],v=0,g=f.length;v<g;v++){var y=f[v],x=void 0;if(y.isInterleavedBufferAttribute)x=new tu(r(e.data,y.data),y.itemSize,y.offset,y.normalized);else x=new Oi(Ji(y.type,y.array),y.itemSize,y.normalized);void 0!==y.name&&(x.name=y.name),m.push(x)}i.morphAttributes[p]=m}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);var _=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==_)for(var b=0,w=_.length;b!==w;++b){var M=_[b];i.addGroup(M.start,M.count,M.materialIndex)}var S=e.data.boundingSphere;if(void 0!==S){var T=new ur;void 0!==S.center&&T.fromArray(S.center),i.boundingSphere=new Ar(T,S.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}});var Yh,Jh=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){return(0,h.Z)(this,n),t.call(this,e)}return(0,d.Z)(n,[{key:"load",value:function(e,t,n,r){var i=this,a=""===this.path?jh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new eh(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(s){return void 0!==r&&r(s),void console.error("THREE:ObjectLoader: Can't parse "+e+".",s.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,r)}},{key:"parse",value:function(e,t){var n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),a=this.parseImages(e.images,(function(){void 0!==t&&t(u)})),o=this.parseTextures(e.textures,a),s=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,i,s,n),l=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,l),void 0!==t){var c=!1;for(var h in a)if(a[h]instanceof HTMLImageElement){c=!0;break}!1===c&&t(u)}return u}},{key:"parseShapes",value:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Rh).fromJSON(e[n]);t[i.uuid]=i}return t}},{key:"parseSkeletons",value:function(e,t){var n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(var i=0,a=e.length;i<a;i++){var o=(new Su).fromJSON(e[i],r);n[o.uuid]=o}return n}},{key:"parseGeometries",value:function(e,t){var n,r={};if(void 0!==e)for(var i=new Xh,a=0,o=e.length;a<o;a++){var s=void 0,u=e[a];switch(u.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new wc[u.type](u.width,u.height,u.widthSegments,u.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new wc[u.type](u.width,u.height,u.depth,u.widthSegments,u.heightSegments,u.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new wc[u.type](u.radius,u.segments,u.thetaStart,u.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new wc[u.type](u.radiusTop,u.radiusBottom,u.height,u.radialSegments,u.heightSegments,u.openEnded,u.thetaStart,u.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new wc[u.type](u.radius,u.height,u.radialSegments,u.heightSegments,u.openEnded,u.thetaStart,u.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new wc[u.type](u.radius,u.widthSegments,u.heightSegments,u.phiStart,u.phiLength,u.thetaStart,u.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new wc[u.type](u.radius,u.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new wc[u.type](u.innerRadius,u.outerRadius,u.thetaSegments,u.phiSegments,u.thetaStart,u.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new wc[u.type](u.radius,u.tube,u.radialSegments,u.tubularSegments,u.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new wc[u.type](u.radius,u.tube,u.tubularSegments,u.radialSegments,u.p,u.q);break;case"TubeGeometry":case"TubeBufferGeometry":s=new wc[u.type]((new Eh[u.path.type]).fromJSON(u.path),u.tubularSegments,u.radius,u.radialSegments,u.closed);break;case"LatheGeometry":case"LatheBufferGeometry":s=new wc[u.type](u.points,u.segments,u.phiStart,u.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new wc[u.type](u.vertices,u.indices,u.radius,u.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":n=[];for(var l=0,c=u.shapes.length;l<c;l++){var h=t[u.shapes[l]];n.push(h)}s=new wc[u.type](n,u.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":n=[];for(var d=0,p=u.shapes.length;d<p;d++){var f=t[u.shapes[d]];n.push(f)}var m=u.options.extrudePath;void 0!==m&&(u.options.extrudePath=(new Eh[m.type]).fromJSON(m)),s=new wc[u.type](n,u.options);break;case"BufferGeometry":case"InstancedBufferGeometry":s=i.parse(u);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+u.type+'"');continue}s.uuid=u.uuid,void 0!==u.name&&(s.name=u.name),!0===s.isBufferGeometry&&void 0!==u.userData&&(s.userData=u.userData),r[u.uuid]=s}return r}},{key:"parseMaterials",value:function(e,t){var n={},r={};if(void 0!==e){var i=new Wh;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var u=[],l=0;l<s.materials.length;l++){var c=s.materials[l];void 0===n[c.uuid]&&(n[c.uuid]=i.parse(c)),u.push(n[c.uuid])}r[s.uuid]=u}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r}},{key:"parseAnimations",value:function(e){var t={};if(void 0!==e)for(var n=0;n<e.length;n++){var r=e[n],i=qc.parse(r);t[i.uuid]=i}return t}},{key:"parseImages",value:function(e,t){var n,r=this,i={};function a(e){if("string"===typeof e){var t=e;return function(e){return r.manager.itemStart(e),n.load(e,(function(){r.manager.itemEnd(e)}),void 0,(function(){r.manager.itemError(e),r.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t)}return e.data?{data:Ji(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){var o=new Jc(t);(n=new rh(o)).setCrossOrigin(this.crossOrigin);for(var s=0,u=e.length;s<u;s++){var l=e[s],c=l.url;if(Array.isArray(c)){i[l.uuid]=[];for(var h=0,d=c.length;h<d;h++){var p=a(c[h]);null!==p&&(p instanceof HTMLImageElement?i[l.uuid].push(p):i[l.uuid].push(new Oa(p.data,p.width,p.height)))}}else{var f=a(l.url);null!==f&&(i[l.uuid]=f)}}}return i}},{key:"parseTextures",value:function(e,t){function n(e,t){return"number"===typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o=e[i];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===t[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s=void 0,u=t[o.image];Array.isArray(u)?(s=new Da(u),6===u.length&&(s.needsUpdate=!0)):(s=u&&u.data?new Oa(u.data,u.width,u.height):new nr(u),u&&(s.needsUpdate=!0)),s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=n(o.mapping,Qh)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=n(o.wrap[0],Kh),s.wrapT=n(o.wrap[1],Kh)),void 0!==o.format&&(s.format=o.format),void 0!==o.type&&(s.type=o.type),void 0!==o.encoding&&(s.encoding=o.encoding),void 0!==o.minFilter&&(s.minFilter=n(o.minFilter,$h)),void 0!==o.magFilter&&(s.magFilter=n(o.magFilter,$h)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),void 0!==o.premultiplyAlpha&&(s.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(s.unpackAlignment=o.unpackAlignment),r[o.uuid]=s}return r}},{key:"parseObject",value:function(e,t,n,r){var i,a,o;function s(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function u(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":i=new Qs,void 0!==e.background&&Number.isInteger(e.background)&&(i.background=new Ri(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?i.fog=new Js(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(i.fog=new Ys(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":i=new Pa(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(i.focus=e.focus),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.filmGauge&&(i.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(i.filmOffset=e.filmOffset),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"OrthographicCamera":i=new Bh(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"AmbientLight":i=new Gh(e.color,e.intensity);break;case"DirectionalLight":i=new Uh(e.color,e.intensity);break;case"PointLight":i=new Oh(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":i=new Fh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":i=new Dh(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":i=new Ph(e.color,e.groundColor,e.intensity);break;case"LightProbe":i=(new Vh).fromJSON(e);break;case"SkinnedMesh":i=new _u(a=s(e.geometry),o=u(e.material)),void 0!==e.bindMode&&(i.bindMode=e.bindMode),void 0!==e.bindMatrix&&i.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(i.skeleton=e.skeleton);break;case"Mesh":i=new wa(a=s(e.geometry),o=u(e.material));break;case"InstancedMesh":a=s(e.geometry),o=u(e.material);var l=e.count,c=e.instanceMatrix;(i=new Ru(a,o,l)).instanceMatrix=new Oi(new Float32Array(c.array),16);break;case"LOD":i=new xu;break;case"Line":i=new Ou(s(e.geometry),u(e.material),e.mode);break;case"LineLoop":i=new Gu(s(e.geometry),u(e.material));break;case"LineSegments":i=new Uu(s(e.geometry),u(e.material));break;case"PointCloud":case"Points":i=new Zu(s(e.geometry),u(e.material));break;case"Sprite":i=new mu(u(e.material));break;case"Group":i=new Vs;break;case"Bone":i=new bu;break;default:i=new si}if(i.uuid=e.uuid,void 0!==e.name&&(i.name=e.name),void 0!==e.matrix?(i.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(i.matrixAutoUpdate=e.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==e.position&&i.position.fromArray(e.position),void 0!==e.rotation&&i.rotation.fromArray(e.rotation),void 0!==e.quaternion&&i.quaternion.fromArray(e.quaternion),void 0!==e.scale&&i.scale.fromArray(e.scale)),void 0!==e.castShadow&&(i.castShadow=e.castShadow),void 0!==e.receiveShadow&&(i.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(i.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(i.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(i.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&i.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(i.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.frustumCulled&&(i.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(i.renderOrder=e.renderOrder),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.layers&&(i.layers.mask=e.layers),void 0!==e.children)for(var h=e.children,d=0;d<h.length;d++)i.add(this.parseObject(h[d],t,n,r));if(void 0!==e.animations)for(var p=e.animations,f=0;f<p.length;f++){var m=p[f];i.animations.push(r[m])}if("LOD"===e.type){void 0!==e.autoUpdate&&(i.autoUpdate=e.autoUpdate);for(var v=e.levels,g=0;g<v.length;g++){var y=v[g],x=i.getObjectByProperty("uuid",y.object);void 0!==x&&i.addLevel(x,y.distance)}}return i}},{key:"bindSkeletons",value:function(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){var n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}},{key:"setTexturePath",value:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}]),n}(Kc),Qh={UVMapping:fe,CubeReflectionMapping:me,CubeRefractionMapping:ve,EquirectangularReflectionMapping:ge,EquirectangularRefractionMapping:ye,CubeUVReflectionMapping:xe,CubeUVRefractionMapping:_e},Kh={RepeatWrapping:be,ClampToEdgeWrapping:we,MirroredRepeatWrapping:Me},$h={NearestFilter:Se,NearestMipmapNearestFilter:Te,NearestMipmapLinearFilter:Ae,LinearFilter:Re,LinearMipmapNearestFilter:Ce,LinearMipmapLinearFilter:ke};function ed(e){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),Kc.call(this,e),this.options={premultiplyAlpha:"none"}}function td(){this.type="ShapePath",this.color=new Ri,this.subPaths=[],this.currentPath=null}function nd(e){this.type="Font",this.data=e}function rd(e,t,n){for(var r=Array.from?Array.from(e):String(e).split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,u=0,l=0;l<r.length;l++){var c=r[l];if("\n"===c)s=0,u-=a;else{var h=id(c,i,s,u,n);s+=h.offsetX,o.push(h.path)}}return o}function id(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(a){var o,s,u,l,c,h,d,p,f=new td;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),v=0,g=m.length;v<g;){switch(m[v++]){case"m":o=m[v++]*t+n,s=m[v++]*t+r,f.moveTo(o,s);break;case"l":o=m[v++]*t+n,s=m[v++]*t+r,f.lineTo(o,s);break;case"q":u=m[v++]*t+n,l=m[v++]*t+r,c=m[v++]*t+n,h=m[v++]*t+r,f.quadraticCurveTo(c,h,u,l);break;case"b":u=m[v++]*t+n,l=m[v++]*t+r,c=m[v++]*t+n,h=m[v++]*t+r,d=m[v++]*t+n,p=m[v++]*t+r,f.bezierCurveTo(c,h,d,p,u,l)}}return{offsetX:a.ha*t,path:f}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".")}function ad(e){Kc.call(this,e)}ed.prototype=Object.assign(Object.create(Kc.prototype),{constructor:ed,isImageBitmapLoader:!0,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Yc.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;var o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",fetch(e,o).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,i.options)})).then((function(n){Yc.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}),Object.assign(td.prototype,{moveTo:function(e,t){return this.currentPath=new Lh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new Rh;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],u=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],u=-u,s=t[i],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var c=l*(e.x-o.x)-u*(e.y-o.y);if(0===c)return!0;if(c<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i,a,o,s=Vl.isClockWise,u=this.subPaths;if(0===u.length)return[];if(!0===t)return n(u);var l=[];if(1===u.length)return a=u[0],(o=new Rh).curves=a.curves,l.push(o),l;var c=!s(u[0].getPoints());c=e?!c:c;var h,d,p=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=u.length;g<y;g++)i=s(h=(a=u[g]).getPoints()),(i=e?!i:i)?(!c&&f[v]&&v++,f[v]={s:new Rh,p:h},f[v].s.curves=a.curves,c&&v++,m[v]=[]):m[v].push({h:a,p:h[0]});if(!f[0])return n(u);if(f.length>1){for(var x=!1,_=[],b=0,w=f.length;b<w;b++)p[b]=[];for(var M=0,S=f.length;M<S;M++)for(var T=m[M],E=0;E<T.length;E++){for(var A=T[E],L=!0,R=0;R<f.length;R++)r(A.p,f[R].p)&&(M!==R&&_.push({froms:M,tos:R,hole:E}),L?(L=!1,p[R].push(A)):x=!0);L&&p[M].push(A)}_.length>0&&(x||(m=p))}for(var C=0,P=f.length;C<P;C++){o=f[C].s,l.push(o);for(var k=0,I=(d=m[C]).length;k<I;k++)o.holes.push(d[k].h)}return l}}),Object.assign(nd.prototype,{isFont:!0,generateShapes:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=[],r=rd(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),ad.prototype=Object.assign(Object.create(Kc.prototype),{constructor:ad,load:function(e,t,n,r){var i=this,a=new eh(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(a){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)}),n,r)},parse:function(e){return new nd(e)}});var od={getContext:function(){return void 0===Yh&&(Yh=new(window.AudioContext||window.webkitAudioContext)),Yh},setContext:function(e){Yh=e}};function sd(e){Kc.call(this,e)}function ud(e,t,n){Vh.call(this,void 0,n);var r=(new Ri).set(e),i=(new Ri).set(t),a=new ur(r.r,r.g,r.b),o=new ur(i.r,i.g,i.b),s=Math.sqrt(Math.PI),u=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(u)}function ld(e,t){Vh.call(this,void 0,t);var n=(new Ri).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}sd.prototype=Object.assign(Object.create(Kc.prototype),{constructor:sd,load:function(e,t,n,r){var i=this,a=new eh(i.manager);a.setResponseType("arraybuffer"),a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{var a=n.slice(0);od.getContext().decodeAudioData(a,(function(e){t(e)}))}catch(o){r?r(o):console.error(o),i.manager.itemError(e)}}),n,r)}}),ud.prototype=Object.assign(Object.create(Vh.prototype),{constructor:ud,isHemisphereLightProbe:!0,copy:function(e){return Vh.prototype.copy.call(this,e),this},toJSON:function(e){return Vh.prototype.toJSON.call(this,e)}}),ld.prototype=Object.assign(Object.create(Vh.prototype),{constructor:ld,isAmbientLightProbe:!0,copy:function(e){return Vh.prototype.copy.call(this,e),this},toJSON:function(e){return Vh.prototype.toJSON.call(this,e)}});var cd=new Or,hd=new Or;function dd(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Pa,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Pa,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}}Object.assign(dd.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,r,i=e.projectionMatrix.clone(),a=t.eyeSep/2,o=a*t.near/t.focus,s=t.near*Math.tan(Qn.DEG2RAD*t.fov*.5)/t.zoom;hd.elements[12]=-a,cd.elements[12]=a,n=-s*t.aspect+o,r=s*t.aspect+o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*t.aspect-o,r=s*t.aspect-o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(hd),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(cd)}});var pd=function(){function e(t){(0,h.Z)(this,e),this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}return(0,d.Z)(e,[{key:"start",value:function(){this.startTime=fd(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=fd();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}]),e}();function fd(){return("undefined"===typeof performance?Date:performance).now()}var md=new ur,vd=new sr,gd=new ur,yd=new ur,xd=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e;return(0,h.Z)(this,n),(e=t.call(this)).type="AudioListener",e.context=od.getContext(),e.gain=e.context.createGain(),e.gain.connect(e.context.destination),e.filter=null,e.timeDelta=0,e._clock=new pd,e}return(0,d.Z)(n,[{key:"getInput",value:function(){return this.gain}},{key:"removeFilter",value: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}},{key:"getFilter",value:function(){return this.filter}},{key:"setFilter",value:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}},{key:"getMasterVolume",value:function(){return this.gain.gain.value}},{key:"setMasterVolume",value:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}},{key:"updateMatrixWorld",value:function(e){(0,a.Z)((0,o.Z)(n.prototype),"updateMatrixWorld",this).call(this,e);var t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(md,vd,gd),yd.set(0,0,-1).applyQuaternion(vd),t.positionX){var i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(md.x,i),t.positionY.linearRampToValueAtTime(md.y,i),t.positionZ.linearRampToValueAtTime(md.z,i),t.forwardX.linearRampToValueAtTime(yd.x,i),t.forwardY.linearRampToValueAtTime(yd.y,i),t.forwardZ.linearRampToValueAtTime(yd.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(md.x,md.y,md.z),t.setOrientation(yd.x,yd.y,yd.z,r.x,r.y,r.z)}}]),n}(si),_d=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r;return(0,h.Z)(this,n),(r=t.call(this)).type="Audio",r.listener=e,r.context=e.context,r.gain=r.context.createGain(),r.gain.connect(e.getInput()),r.autoplay=!1,r.buffer=null,r.detune=0,r.loop=!1,r.loopStart=0,r.loopEnd=0,r.offset=0,r.duration=void 0,r.playbackRate=1,r.isPlaying=!1,r.hasPlaybackControl=!0,r.source=null,r.sourceType="empty",r._startedAt=0,r._progress=0,r._connected=!1,r.filters=[],r}return(0,d.Z)(n,[{key:"getOutput",value:function(){return this.gain}},{key:"setNodeSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}},{key:"setMediaElementSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}},{key:"setMediaStreamSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}},{key:"setBuffer",value:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")}},{key:"pause",value:function(){if(!1!==this.hasPlaybackControl)return!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;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"stop",value:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"connect",value:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}},{key:"disconnect",value:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}},{key:"getFilters",value:function(){return this.filters}},{key:"setFilters",value:function(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}},{key:"setDetune",value:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}},{key:"getDetune",value:function(){return this.detune}},{key:"getFilter",value:function(){return this.getFilters()[0]}},{key:"setFilter",value:function(e){return this.setFilters(e?[e]:[])}},{key:"setPlaybackRate",value:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"getPlaybackRate",value:function(){return this.playbackRate}},{key:"onEnded",value:function(){this.isPlaying=!1}},{key:"getLoop",value:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}},{key:"setLoop",value:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"setLoopStart",value:function(e){return this.loopStart=e,this}},{key:"setLoopEnd",value:function(e){return this.loopEnd=e,this}},{key:"getVolume",value:function(){return this.gain.gain.value}},{key:"setVolume",value:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}]),n}(si),bd=new ur,wd=new sr,Md=new ur,Sd=new ur,Td=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r;return(0,h.Z)(this,n),(r=t.call(this,e)).panner=r.context.createPanner(),r.panner.panningModel="HRTF",r.panner.connect(r.gain),r}return(0,d.Z)(n,[{key:"getOutput",value:function(){return this.panner}},{key:"getRefDistance",value:function(){return this.panner.refDistance}},{key:"setRefDistance",value:function(e){return this.panner.refDistance=e,this}},{key:"getRolloffFactor",value:function(){return this.panner.rolloffFactor}},{key:"setRolloffFactor",value:function(e){return this.panner.rolloffFactor=e,this}},{key:"getDistanceModel",value:function(){return this.panner.distanceModel}},{key:"setDistanceModel",value:function(e){return this.panner.distanceModel=e,this}},{key:"getMaxDistance",value:function(){return this.panner.maxDistance}},{key:"setMaxDistance",value:function(e){return this.panner.maxDistance=e,this}},{key:"setDirectionalCone",value:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}},{key:"updateMatrixWorld",value:function(e){if((0,a.Z)((0,o.Z)(n.prototype),"updateMatrixWorld",this).call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(bd,wd,Md),Sd.set(0,0,1).applyQuaternion(wd);var t=this.panner;if(t.positionX){var r=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(bd.x,r),t.positionY.linearRampToValueAtTime(bd.y,r),t.positionZ.linearRampToValueAtTime(bd.z,r),t.orientationX.linearRampToValueAtTime(Sd.x,r),t.orientationY.linearRampToValueAtTime(Sd.y,r),t.orientationZ.linearRampToValueAtTime(Sd.z,r)}else t.setPosition(bd.x,bd.y,bd.z),t.setOrientation(Sd.x,Sd.y,Sd.z)}}}]),n}(_d),Ed=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2048;(0,h.Z)(this,e),this.analyser=t.context.createAnalyser(),this.analyser.fftSize=n,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}return(0,d.Z)(e,[{key:"getFrequencyData",value:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},{key:"getAverageFrequency",value:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}]),e}();function Ad(e,t,n){var r,i,a;switch(this.binding=e,this.valueSize=n,t){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}Object.assign(Ad.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},accumulateAdditive:function(e){var t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=t*this._origIndex;this._mixBufferRegion(n,r,s,1-i,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var u=t,l=t+t;u!==l;++u)if(n[u]!==n[u+t]){o.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n<t;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1},_setAdditiveIdentityOther:function(){for(var e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]},_select:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){sr.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var a=this._workIndex*i;sr.multiplyQuaternionsFlat(e,a,e,t,e,n),sr.slerpFlat(e,t,e,t,e,a,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}},_lerpAdditive:function(e,t,n,r,i){for(var a=0;a!==i;++a){var o=t+a;e[o]=e[o]+e[n+a]*r}}});var Ld="\\[\\]\\.:\\/",Rd=new RegExp("[\\[\\]\\.:\\/]","g"),Cd="[^\\[\\]\\.:\\/]",Pd="[^"+Ld.replace("\\.","")+"]",kd=/((?:WC+[\/:])*)/.source.replace("WC",Cd),Id=/(WCOD+)?/.source.replace("WCOD",Pd),Dd=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cd),Nd=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cd),Od=new RegExp("^"+kd+Id+Dd+Nd+"$"),Bd=["material","materials","bones"];function zd(e,t,n){var r=n||Ud.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Ud(e,t,n){this.path=t,this.parsedPath=n||Ud.parseTrackName(t),this.node=Ud.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Gd(){this.uuid=Qn.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;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}}}Object.assign(zd.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Ud,{Composite:zd,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Ud.Composite(e,t,n):new Ud(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Rd,"")},parseTrackName:function(e){var t=Od.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[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: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function e(n){for(var r=0;r<n.length;r++){var i=n[r];if(i.name===t||i.uuid===t)return i;var a=e(i.children);if(a)return a}return null}(e.children);if(r)return r}return null}}),Object.assign(Ud.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(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=Ud.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var u=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?u=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(u=this.Versioning.MatrixWorldNeedsUpdate);var l=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][u]}else{var c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Ud.prototype,{_getValue_unbound:Ud.prototype.getValue,_setValue_unbound:Ud.prototype.setValue}),Object.assign(Gd.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,a=i.length,o=void 0,s=e.length,u=this.nCachedObjects_,l=0,c=arguments.length;l!==c;++l){var h=arguments[l],d=h.uuid,p=t[d];if(void 0===p){p=s++,t[d]=p,e.push(h);for(var f=0,m=a;f!==m;++f)i[f].push(new Ud(h,n[f],r[f]))}else if(p<u){o=e[p];var v=--u,g=e[v];t[g.uuid]=p,e[p]=g,t[d]=v,e[v]=h;for(var y=0,x=a;y!==x;++y){var _=i[y],b=_[v],w=_[p];_[p]=b,void 0===w&&(w=new Ud(h,n[y],r[y])),_[v]=w}}else e[p]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u},remove:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],u=s.uuid,l=t[u];if(void 0!==l&&l>=i){var c=i++,h=e[c];t[h.uuid]=l,e[l]=h,t[u]=c,e[c]=s;for(var d=0,p=r;d!==p;++d){var f=n[d],m=f[c],v=f[l];f[l]=m,f[c]=v}}}this.nCachedObjects_=i},uncache:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length,o=0,s=arguments.length;o!==s;++o){var u=arguments[o],l=u.uuid,c=t[l];if(void 0!==c)if(delete t[l],c<i){var h=--i,d=e[h],p=--a,f=e[p];t[d.uuid]=c,e[c]=d,t[f.uuid]=h,e[h]=f,e.pop();for(var m=0,v=r;m!==v;++m){var g=n[m],y=g[h],x=g[p];g[c]=y,g[h]=x,g.pop()}}else{var _=--a,b=e[_];_>0&&(t[b.uuid]=c),e[c]=b,e.pop();for(var w=0,M=r;w!==M;++w){var S=n[w];S[c]=S[_],S.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,u=s.length,l=this.nCachedObjects_,c=new Array(u);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(c);for(var h=l,d=s.length;h!==d;++h){var p=s[h];c[h]=new Ud(p,e,t)}return c},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}});var Fd=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.blendMode;(0,h.Z)(this,e),this._mixer=t,this._clip=n,this._localRoot=r,this.blendMode=i;for(var a=n.tracks,o=a.length,s=new Array(o),u={endingStart:Kt,endingEnd:Kt},l=0;l!==o;++l){var c=a[l].createInterpolant(null);s[l]=c,c.settings=u}this._interpolantSettings=u,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=qt,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}return(0,d.Z)(e,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,t){return this.loop=e,this.repetitions=t,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this}},{key:"crossFadeTo",value:function(e,t,n){return e.crossFadeFrom(this,t,n)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,t,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,u=o.sampleValues;return s[0]=i,s[1]=i+n,u[0]=e/a,u[1]=t/a,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0){var u=this._interpolants,l=this._propertyBindings;if(this.blendMode===nn)for(var c=0,h=u.length;c!==h;++c)u[c].evaluate(o),l[c].accumulateAdditive(s);else for(var d=0,p=u.length;d!==p;++d)u[d].evaluate(o),l[d].accumulate(r,s)}}else this._updateWeight(e)}},{key:"_updateWeight",value:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}},{key:"_updateTimeScale",value:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t}},{key:"_updateTime",value:function(e){var t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===Xt;if(0===e)return-1===i?r:a&&1===(1&i)?t-r:r;if(n===Zt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){var o=Math.floor(r/t);r-=t*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var u=e<0;this._setEndings(u,!u,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 t-r}return r}},{key:"_setEndings",value:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=$t,r.endingEnd=$t):(r.endingStart=e?this.zeroSlopeAtStart?$t:Kt:en,r.endingEnd=t?this.zeroSlopeAtEnd?$t:Kt:en)}},{key:"_scheduleFading",value:function(e,t,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]=t,o[1]=i+e,s[1]=n,this}}]),e}();function Hd(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Hd.prototype=Object.assign(Object.create(Zn.prototype),{constructor:Hd,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,u=this._bindingsByRootAndName,l=u[s];void 0===l&&(l={},u[s]=l);for(var c=0;c!==i;++c){var h=r[c],d=h.name,p=l[d];if(void 0!==p)a[c]=p;else{if(void 0!==(p=a[c])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[c].binding.parsedPath;++(p=new Ad(Ud.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[c]=p}o[c].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,u=s[s.length-1],l=e._byClipCacheIndex;u._byClipCacheIndex=l,s[l]=u,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0===--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=this._bindings,a=r[t];void 0===a&&(a={},r[t]=a),a[n]=e,e._cacheIndex=i.length,i.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],u=e._cacheIndex;s._cacheIndex=u,t[u]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new Bc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t,n){var r=t||this._root,i=r.uuid,a="string"===typeof e?qc.findByName(r,e):e,o=null!==a?a.uuid:e,s=this._actionsByClip[o],u=null;if(void 0===n&&(n=null!==a?a.blendMode:tn),void 0!==s){var l=s.actionByRoot[i];if(void 0!==l&&l.blendMode===n)return l;u=s.knownActions[0],null===a&&(a=u._clip)}if(null===a)return null;var c=new Fd(this,a,t,n);return this._bindAction(c,u),this._addInactiveAction(c,o,i),c},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"===typeof e?qc.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(r,e,i,a)}for(var s=this._bindings,u=this._nActiveBindings,l=0;l!==u;++l)s[l].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.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 u=a[o];this._deactivateAction(u);var l=u._cacheIndex,c=t[t.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,c._cacheIndex=l,t[l]=c,t.pop(),this._removeInactiveBindingsForAction(u)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}});var Vd=function(){function e(t){(0,h.Z)(this,e),"string"===typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}return(0,d.Z)(e,[{key:"clone",value:function(){return new e(void 0===this.value.clone?this.value:this.value.clone())}}]),e}();function Wd(e,t,n){Ks.call(this,e,t),this.meshPerAttribute=n||1}function jd(e,t,n,r,i){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}function Zd(e,t,n,r){this.ray=new Nr(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new qr,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 qd(e,t){return e.distance-t.distance}function Xd(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r)for(var i=e.children,a=0,o=i.length;a<o;a++)Xd(i[a],t,n,!0)}Wd.prototype=Object.assign(Object.create(Ks.prototype),{constructor:Wd,isInstancedInterleavedBuffer:!0,copy:function(e){return Ks.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},clone:function(e){var t=Ks.prototype.clone.call(this,e);return t.meshPerAttribute=this.meshPerAttribute,t},toJSON:function(e){var t=Ks.prototype.toJSON.call(this,e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}),Object.defineProperty(jd.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(jd.prototype,{isGLBufferAttribute:!0,setBuffer:function(e){return this.buffer=e,this},setType:function(e,t){return this.type=e,this.elementSize=t,this},setItemSize:function(e){return this.itemSize=e,this},setCount:function(e){return this.count=e,this}}),Object.assign(Zd.prototype,{set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return Xd(e,this,r,t),r.sort(qd),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)Xd(e[i],this,r,t);return r.sort(qd),r}});var Yd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,h.Z)(this,e),this.radius=t,this.phi=n,this.theta=r,this}return(0,d.Z)(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}},{key:"makeSafe",value:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Qn.clamp(t/this.radius,-1,1))),this}}]),e}(),Jd=function(){function e(t,n,r){return(0,h.Z)(this,e),this.radius=void 0!==t?t:1,this.theta=void 0!==n?n:0,this.y=void 0!==r?r:0,this}return(0,d.Z)(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}}]),e}(),Qd=new Kn,Kd=function(){function e(t,n){(0,h.Z)(this,e),Object.defineProperty(this,"isBox2",{value:!0}),this.min=void 0!==t?t:new Kn(1/0,1/0),this.max=void 0!==n?n:new Kn(-1/0,-1/0)}return(0,d.Z)(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}},{key:"setFromCenterAndSize",value:function(e,t){var n=Qd.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y}},{key:"getCenter",value:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new Kn),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new Kn),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"containsPoint",value:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}},{key:"getParameter",value:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Kn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}},{key:"intersectsBox",value:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}},{key:"clampPoint",value:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Kn),t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return Qd.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}(),$d=new ur,ep=new ur,tp=function(){function e(t,n){(0,h.Z)(this,e),this.start=void 0!==t?t:new ur,this.end=void 0!==n?n:new ur}return(0,d.Z)(e,[{key:"set",value:function(e,t){return this.start.copy(e),this.end.copy(t),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.start.copy(e.start),this.end.copy(e.end),this}},{key:"getCenter",value:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new ur),e.addVectors(this.start,this.end).multiplyScalar(.5)}},{key:"delta",value:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new ur),e.subVectors(this.end,this.start)}},{key:"distanceSq",value:function(){return this.start.distanceToSquared(this.end)}},{key:"distance",value:function(){return this.start.distanceTo(this.end)}},{key:"at",value:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new ur),this.delta(t).multiplyScalar(e).add(this.start)}},{key:"closestPointToPointParameter",value:function(e,t){$d.subVectors(e,this.start),ep.subVectors(this.end,this.start);var n=ep.dot(ep),r=ep.dot($d)/n;return t&&(r=Qn.clamp(r,0,1)),r}},{key:"closestPointToPoint",value:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new ur),this.delta(n).multiplyScalar(r).add(this.start)}},{key:"applyMatrix4",value:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}},{key:"equals",value:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}]),e}();function np(e){si.call(this),this.material=e,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}np.prototype=Object.create(si.prototype),np.prototype.constructor=np,np.prototype.isImmediateRenderObject=!0;var rp=new ur,ip=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r){var i;(0,h.Z)(this,n),(i=t.call(this)).light=e,i.light.updateMatrixWorld(),i.matrix=e.matrixWorld,i.matrixAutoUpdate=!1,i.color=r;for(var a=new ia,o=[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],s=0,u=1;s<32;s++,u++){var l=s/32*Math.PI*2,c=u/32*Math.PI*2;o.push(Math.cos(l),Math.sin(l),1,Math.cos(c),Math.sin(c),1)}a.setAttribute("position",new ji(o,3));var d=new Cu({fog:!1,toneMapped:!1});return i.cone=new Uu(a,d),i.add(i.cone),i.update(),i}return(0,d.Z)(n,[{key:"dispose",value:function(){this.cone.geometry.dispose(),this.cone.material.dispose()}},{key:"update",value:function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),rp.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(rp),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}]),n}(si),ap=new ur,op=new Or,sp=new Or,up=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r;(0,h.Z)(this,n);for(var i=lp(e),a=new ia,o=[],s=[],u=new Ri(0,0,1),l=new Ri(0,1,0),c=0;c<i.length;c++){var d=i[c];d.parent&&d.parent.isBone&&(o.push(0,0,0),o.push(0,0,0),s.push(u.r,u.g,u.b),s.push(l.r,l.g,l.b))}a.setAttribute("position",new ji(o,3)),a.setAttribute("color",new ji(s,3));var p=new Cu({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});return(r=t.call(this,a,p)).type="SkeletonHelper",r.isSkeletonHelper=!0,r.root=e,r.bones=i,r.matrix=e.matrixWorld,r.matrixAutoUpdate=!1,r}return(0,d.Z)(n,[{key:"updateMatrixWorld",value:function(e){var t=this.bones,r=this.geometry,i=r.getAttribute("position");sp.copy(this.root.matrixWorld).invert();for(var s=0,u=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(op.multiplyMatrices(sp,l.matrixWorld),ap.setFromMatrixPosition(op),i.setXYZ(u,ap.x,ap.y,ap.z),op.multiplyMatrices(sp,l.parent.matrixWorld),ap.setFromMatrixPosition(op),i.setXYZ(u+1,ap.x,ap.y,ap.z),u+=2)}r.getAttribute("position").needsUpdate=!0,(0,a.Z)((0,o.Z)(n.prototype),"updateMatrixWorld",this).call(this,e)}}]),n}(Uu);function lp(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,lp(e.children[n]));return t}var cp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i){var a;(0,h.Z)(this,n);var o=new lc(r,4,2),s=new Ii({wireframe:!0,fog:!1,toneMapped:!1});return(a=t.call(this,o,s)).light=e,a.light.updateMatrixWorld(),a.color=i,a.type="PointLightHelper",a.matrix=a.light.matrixWorld,a.matrixAutoUpdate=!1,a.update(),a}return(0,d.Z)(n,[{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose()}},{key:"update",value:function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}]),n}(wa),hp=new ur,dp=new Ri,pp=new Ri,fp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i){var a;(0,h.Z)(this,n),(a=t.call(this)).light=e,a.light.updateMatrixWorld(),a.matrix=e.matrixWorld,a.matrixAutoUpdate=!1,a.color=i;var o=new $l(r);o.rotateY(.5*Math.PI),a.material=new Ii({wireframe:!0,fog:!1,toneMapped:!1}),void 0===a.color&&(a.material.vertexColors=!0);var s=o.getAttribute("position"),u=new Float32Array(3*s.count);return o.setAttribute("color",new Oi(u,3)),a.add(new wa(o,a.material)),a.update(),a}return(0,d.Z)(n,[{key:"dispose",value:function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}},{key:"update",value:function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");dp.copy(this.light.color),pp.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?dp:pp;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(hp.setFromMatrixPosition(this.light.matrixWorld).negate())}}]),n}(si),mp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;(0,h.Z)(this,n),a=new Ri(a),o=new Ri(o);for(var s=i/2,u=r/i,l=r/2,c=[],d=[],p=0,f=0,m=-l;p<=i;p++,m+=u){c.push(-l,0,m,l,0,m),c.push(m,0,-l,m,0,l);var v=p===s?a:o;v.toArray(d,f),f+=3,v.toArray(d,f),f+=3,v.toArray(d,f),f+=3,v.toArray(d,f),f+=3}var g=new ia;g.setAttribute("position",new ji(c,3)),g.setAttribute("color",new ji(d,3));var y=new Cu({vertexColors:!0,toneMapped:!1});return(e=t.call(this,g,y)).type="GridHelper",e}return(0,d.Z)(n)}(Uu),vp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4473924,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8947848;(0,h.Z)(this,n),s=new Ri(s),u=new Ri(u);for(var l=[],c=[],d=0;d<=i;d++){var p=d/i*(2*Math.PI),f=Math.sin(p)*r,m=Math.cos(p)*r;l.push(0,0,0),l.push(f,0,m);var v=1&d?s:u;c.push(v.r,v.g,v.b),c.push(v.r,v.g,v.b)}for(var g=0;g<=a;g++)for(var y=1&g?s:u,x=r-r/a*g,_=0;_<o;_++){var b=_/o*(2*Math.PI),w=Math.sin(b)*x,M=Math.cos(b)*x;l.push(w,0,M),c.push(y.r,y.g,y.b),b=(_+1)/o*(2*Math.PI),w=Math.sin(b)*x,M=Math.cos(b)*x,l.push(w,0,M),c.push(y.r,y.g,y.b)}var S=new ia;S.setAttribute("position",new ji(l,3)),S.setAttribute("color",new ji(c,3));var T=new Cu({vertexColors:!0,toneMapped:!1});return(e=t.call(this,S,T)).type="PolarGridHelper",e}return(0,d.Z)(n)}(Uu),gp=new ur,yp=new ur,xp=new ur,_p=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i){var a;(0,h.Z)(this,n),(a=t.call(this)).light=e,a.light.updateMatrixWorld(),a.matrix=e.matrixWorld,a.matrixAutoUpdate=!1,a.color=i,void 0===r&&(r=1);var o=new ia;o.setAttribute("position",new ji([-r,r,0,r,r,0,r,-r,0,-r,-r,0,-r,r,0],3));var s=new Cu({fog:!1,toneMapped:!1});return a.lightPlane=new Ou(o,s),a.add(a.lightPlane),(o=new ia).setAttribute("position",new ji([0,0,0,0,0,1],3)),a.targetLine=new Ou(o,s),a.add(a.targetLine),a.update(),a}return(0,d.Z)(n,[{key:"dispose",value:function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}},{key:"update",value:function(){gp.setFromMatrixPosition(this.light.matrixWorld),yp.setFromMatrixPosition(this.light.target.matrixWorld),xp.subVectors(yp,gp),this.lightPlane.lookAt(yp),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(yp),this.targetLine.scale.z=xp.length()}}]),n}(si),bp=new ur,wp=new Ca,Mp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r;(0,h.Z)(this,n);var i=new ia,a=new Cu({color:16777215,vertexColors:!0,toneMapped:!1}),o=[],s=[],u={},l=new Ri(16755200),c=new Ri(16711680),d=new Ri(43775),p=new Ri(16777215),f=new Ri(3355443);function m(e,t,n){v(e,n),v(t,n)}function v(e,t){o.push(0,0,0),s.push(t.r,t.g,t.b),void 0===u[e]&&(u[e]=[]),u[e].push(o.length/3-1)}return m("n1","n2",l),m("n2","n4",l),m("n4","n3",l),m("n3","n1",l),m("f1","f2",l),m("f2","f4",l),m("f4","f3",l),m("f3","f1",l),m("n1","f1",l),m("n2","f2",l),m("n3","f3",l),m("n4","f4",l),m("p","n1",c),m("p","n2",c),m("p","n3",c),m("p","n4",c),m("u1","u2",d),m("u2","u3",d),m("u3","u1",d),m("c","t",p),m("p","c",f),m("cn1","cn2",f),m("cn3","cn4",f),m("cf1","cf2",f),m("cf3","cf4",f),i.setAttribute("position",new ji(o,3)),i.setAttribute("color",new ji(s,3)),(r=t.call(this,i,a)).type="CameraHelper",r.camera=e,r.camera.updateProjectionMatrix&&r.camera.updateProjectionMatrix(),r.matrix=e.matrixWorld,r.matrixAutoUpdate=!1,r.pointMap=u,r.update(),r}return(0,d.Z)(n,[{key:"update",value:function(){var e=this.geometry,t=this.pointMap;wp.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Sp("c",t,e,wp,0,0,-1),Sp("t",t,e,wp,0,0,1),Sp("n1",t,e,wp,-1,-1,-1),Sp("n2",t,e,wp,1,-1,-1),Sp("n3",t,e,wp,-1,1,-1),Sp("n4",t,e,wp,1,1,-1),Sp("f1",t,e,wp,-1,-1,1),Sp("f2",t,e,wp,1,-1,1),Sp("f3",t,e,wp,-1,1,1),Sp("f4",t,e,wp,1,1,1),Sp("u1",t,e,wp,.7,1.1,-1),Sp("u2",t,e,wp,-.7,1.1,-1),Sp("u3",t,e,wp,0,2,-1),Sp("cf1",t,e,wp,-1,0,1),Sp("cf2",t,e,wp,1,0,1),Sp("cf3",t,e,wp,0,-1,1),Sp("cf4",t,e,wp,0,1,1),Sp("cn1",t,e,wp,-1,0,-1),Sp("cn2",t,e,wp,1,0,-1),Sp("cn3",t,e,wp,0,-1,-1),Sp("cn4",t,e,wp,0,1,-1),e.getAttribute("position").needsUpdate=!0}}]),n}(Uu);function Sp(e,t,n,r,i,a,o){bp.set(i,a,o).unproject(r);var s=t[e];if(void 0!==s)for(var u=n.getAttribute("position"),l=0,c=s.length;l<c;l++)u.setXYZ(s[l],bp.x,bp.y,bp.z)}var Tp,Ep,Ap=new hr,Lp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;(0,h.Z)(this,n);var a=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]),o=new Float32Array(24),s=new ia;return s.setIndex(new Oi(a,1)),s.setAttribute("position",new Oi(o,3)),(r=t.call(this,s,new Cu({color:i,toneMapped:!1}))).object=e,r.type="BoxHelper",r.matrixAutoUpdate=!1,r.update(),r}return(0,d.Z)(n,[{key:"update",value:function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Ap.setFromObject(this.object),!Ap.isEmpty()){var t=Ap.min,n=Ap.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}},{key:"setFromObject",value:function(e){return this.object=e,this.update(),this}},{key:"copy",value:function(e){return Uu.prototype.copy.call(this,e),this.object=e.object,this}}]),n}(Uu),Rp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;(0,h.Z)(this,n);var a=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]),o=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new ia;return s.setIndex(new Oi(a,1)),s.setAttribute("position",new ji(o,3)),(r=t.call(this,s,new Cu({color:i,toneMapped:!1}))).box=e,r.type="Box3Helper",r.geometry.computeBoundingSphere(),r}return(0,d.Z)(n,[{key:"updateMatrixWorld",value:function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),(0,a.Z)((0,o.Z)(n.prototype),"updateMatrixWorld",this).call(this,e))}}]),n}(Uu),Cp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16776960;(0,h.Z)(this,n);var o=a,s=[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],u=new ia;u.setAttribute("position",new ji(s,3)),u.computeBoundingSphere(),(r=t.call(this,u,new Cu({color:o,toneMapped:!1}))).type="PlaneHelper",r.plane=e,r.size=i;var l=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],c=new ia;return c.setAttribute("position",new ji(l,3)),c.computeBoundingSphere(),r.add(new wa(c,new Ii({color:o,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1}))),r}return(0,d.Z)(n,[{key:"updateMatrixWorld",value:function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?T:S,this.lookAt(this.plane.normal),(0,a.Z)((0,o.Z)(n.prototype),"updateMatrixWorld",this).call(this,e)}}]),n}(Ou),Pp=new ur,kp=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(e,r,i,a,o,s){var u;return(0,h.Z)(this,n),(u=t.call(this)).type="ArrowHelper",void 0===e&&(e=new ur(0,0,1)),void 0===r&&(r=new ur(0,0,0)),void 0===i&&(i=1),void 0===a&&(a=16776960),void 0===o&&(o=.2*i),void 0===s&&(s=.2*o),void 0===Tp&&((Tp=new ia).setAttribute("position",new ji([0,0,0,0,1,0],3)),(Ep=new ol(0,.5,1,5,1)).translate(0,-.5,0)),u.position.copy(r),u.line=new Ou(Tp,new Cu({color:a,toneMapped:!1})),u.line.matrixAutoUpdate=!1,u.add(u.line),u.cone=new wa(Ep,new Ii({color:a,toneMapped:!1})),u.cone.matrixAutoUpdate=!1,u.add(u.cone),u.setDirection(e),u.setLength(i,o,s),u}return(0,d.Z)(n,[{key:"setDirection",value:function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Pp.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Pp,t)}}},{key:"setLength",value:function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}},{key:"setColor",value:function(e){this.line.material.color.set(e),this.cone.material.color.set(e)}},{key:"copy",value:function(e){return(0,a.Z)((0,o.Z)(n.prototype),"copy",this).call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}]),n}(si),Ip=function(e){(0,l.Z)(n,e);var t=(0,c.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;(0,h.Z)(this,n);var i=[0,0,0,r,0,0,0,0,0,0,r,0,0,0,0,0,0,r],a=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],o=new ia;o.setAttribute("position",new ji(i,3)),o.setAttribute("color",new ji(a,3));var s=new Cu({vertexColors:!0,toneMapped:!1});return(e=t.call(this,o,s)).type="AxesHelper",e}return(0,d.Z)(n)}(Uu),Dp=new Float32Array(1),Np=new Int32Array(Dp.buffer),Op={toHalfFloat:function(e){Dp[0]=e;var t=Np[0],n=t>>16&32768,r=t>>12&2047,i=t>>23&255;return i<103?n:i>142?(n|=31744,n|=(255==i?0:1)&&8388607&t):i<113?n|=((r|=2048)>>114-i)+(r>>113-i&1):(n|=i-112<<10|r>>1,n+=1&r)}},Bp=Math.pow(2,8),zp=[.125,.215,.35,.446,.526,.582],Up=5+zp.length,Gp=20,Fp=(r={},(0,s.Z)(r,sn,0),(0,s.Z)(r,un,1),(0,s.Z)(r,cn,2),(0,s.Z)(r,dn,3),(0,s.Z)(r,pn,4),(0,s.Z)(r,fn,5),(0,s.Z)(r,ln,6),r),Hp=new Bh,Vp=$p(),Wp=Vp._lodPlanes,jp=Vp._sizeLods,Zp=Vp._sigmas,qp=null,Xp=(1+Math.sqrt(5))/2,Yp=1/Xp,Jp=[new ur(1,1,1),new ur(-1,1,1),new ur(1,1,-1),new ur(-1,1,-1),new ur(0,Xp,Yp),new ur(0,Xp,-Yp),new ur(Yp,0,Xp),new ur(-Yp,0,Xp),new ur(Xp,Yp,0),new ur(-Xp,Yp,0)],Qp=function(){function e(t){(0,h.Z)(this,e),this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(e){var t=new Float32Array(e),n=new ur(0,1,0);return new Sc({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:Fp[sn]},outputEncoding:{value:Fp[sn]}},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".concat("\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:R,depthTest:!1,depthWrite:!1})}(Gp),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}return(0,d.Z)(e,[{key:"fromScene",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;qp=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}},{key:"fromEquirectangular",value:function(e){return this._fromTexture(e)}},{key:"fromCubemap",value:function(e){return this._fromTexture(e)}},{key:"compileCubemapShader",value:function(){null===this._cubemapShader&&(this._cubemapShader=rf(),this._compileMaterial(this._cubemapShader))}},{key:"compileEquirectangularShader",value:function(){null===this._equirectShader&&(this._equirectShader=nf(),this._compileMaterial(this._equirectShader))}},{key:"dispose",value:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e<Wp.length;e++)Wp[e].dispose()}},{key:"_cleanup",value:function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(qp),e.scissorTest=!1,tf(e,0,0,e.width,e.height)}},{key:"_fromTexture",value:function(e){qp=this._renderer.getRenderTarget();var t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}},{key:"_allocateTargets",value:function(e){var t={magFilter:Se,minFilter:Se,generateMipmaps:!1,type:De,format:Qe,encoding:Kp(e)?e.encoding:cn,depthBuffer:!1},n=ef(t);return n.depthBuffer=!e,this._pingPongRenderTarget=ef(t),n}},{key:"_compileMaterial",value:function(e){var t=new wa(Wp[0],e);this._renderer.compile(t,Hp)}},{key:"_sceneToCubeUV",value:function(e,t,n,r){var i=new Pa(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,u=s.outputEncoding,l=s.toneMapping,c=s.getClearColor(),h=s.getClearAlpha();s.toneMapping=ue,s.outputEncoding=sn;var d=e.background;if(d&&d.isColor){d.convertSRGBToLinear();var p=Math.max(d.r,d.g,d.b),f=Math.min(Math.max(Math.ceil(Math.log2(p)),-128),127);d=d.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;s.setClearColor(d,m),e.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])),tf(r,g*Bp,v>2?Bp:0,Bp,Bp),s.setRenderTarget(r),s.render(e,i)}s.toneMapping=l,s.outputEncoding=u,s.setClearColor(c,h)}},{key:"_textureToCubeUV",value:function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=rf()):null==this._equirectShader&&(this._equirectShader=nf());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new wa(Wp[0],r),a=r.uniforms;a.envMap.value=e,e.isCubeTexture||a.texelSize.value.set(1/e.image.width,1/e.image.height),a.inputEncoding.value=Fp[e.encoding],a.outputEncoding.value=Fp[t.texture.encoding],tf(t,0,0,3*Bp,2*Bp),n.setRenderTarget(t),n.render(i,Hp)}},{key:"_applyPMREM",value:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r<Up;r++){var i=Math.sqrt(Zp[r]*Zp[r]-Zp[r-1]*Zp[r-1]),a=Jp[(r-1)%Jp.length];this._blur(e,r-1,r,i,a)}t.autoClear=n}},{key:"_blur",value:function(e,t,n,r,i){var a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",i),this._halfBlur(a,e,n,n,r,"longitudinal",i)}},{key:"_halfBlur",value:function(e,t,n,r,i,a,o){var s=this._renderer,u=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var l=new wa(Wp[r],u),c=u.uniforms,h=jp[n]-1,d=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):Gp;f>Gp&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(f," samples when the maximum is set to ").concat(Gp));for(var m=[],v=0,g=0;g<Gp;++g){var y=g/p,x=Math.exp(-y*y/2);m.push(x),0==g?v+=x:g<f&&(v+=2*x)}for(var _=0;_<m.length;_++)m[_]=m[_]/v;c.envMap.value=e.texture,c.samples.value=f,c.weights.value=m,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o),c.dTheta.value=d,c.mipInt.value=8-n,c.inputEncoding.value=Fp[e.texture.encoding],c.outputEncoding.value=Fp[e.texture.encoding];var b=jp[r];tf(t,3*Math.max(0,Bp-2*b),(0===r?0:2*Bp)+2*b*(r>4?r-8+4:0),3*b,2*b),s.setRenderTarget(t),s.render(l,Hp)}}]),e}();function Kp(e){return void 0!==e&&e.type===De&&(e.encoding===sn||e.encoding===un||e.encoding===ln)}function $p(){for(var e=[],t=[],n=[],r=8,i=0;i<Up;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;i>4?o=zp[i-8+4-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),u=-s/2,l=1+s/2,c=[u,u,l,u,l,l,u,u,l,l,u,l],h=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];h.set(g,18*f),d.set(c,12*f);var y=[f,f,f,f,f,f];p.set(y,6*f)}var x=new ia;x.setAttribute("position",new Oi(h,3)),x.setAttribute("uv",new Oi(d,2)),x.setAttribute("faceIndex",new Oi(p,1)),e.push(x),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function ef(e){var t=new ar(3*Bp,3*Bp,e);return t.texture.mapping=xe,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function tf(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function nf(){return new Sc({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new Kn(1,1)},inputEncoding:{value:Fp[sn]},outputEncoding:{value:Fp[sn]}},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".concat("\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:R,depthTest:!1,depthWrite:!1})}function rf(){return new Sc({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Fp[sn]},outputEncoding:{value:Fp[sn]}},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".concat("\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:R,depthTest:!1,depthWrite:!1})}function af(e,t,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Ci(e,t,n,i,a,o)}var of=0,sf=1,uf=0,lf=1,cf=2;function hf(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function df(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function pf(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Zu(e,t)}function ff(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new mu(e)}function mf(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Zu(e,t)}function vf(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Fu(e)}function gf(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Fu(e)}function yf(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Fu(e)}function xf(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new ur(e,t,n)}function _f(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Oi(e,t).setUsage(On)}function bf(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Bi(e,t)}function wf(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new zi(e,t)}function Mf(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Ui(e,t)}function Sf(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Gi(e,t)}function Tf(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Fi(e,t)}function Ef(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Hi(e,t)}function Af(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Vi(e,t)}function Lf(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new ji(e,t)}function Rf(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Zi(e,t)}function Cf(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),mh.call(this,e),this.type="catmullrom",this.closed=!0}function Pf(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),mh.call(this,e),this.type="catmullrom"}function kf(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),mh.call(this,e),this.type="catmullrom"}function If(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ip(e)}function Df(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Lp(e,t)}function Nf(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Uu(new gl(e.geometry),new Cu({color:void 0!==t?t:16777215}))}function Of(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Uu(new bc(e.geometry),new Cu({color:void 0!==t?t:16777215}))}function Bf(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new eh(e)}function zf(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ah(e)}function Uf(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Na(e,n)}sh.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(sh.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Ah.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new nl,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new ur(i.x,i.y,i.z||0))}return t}}),Object.assign(Lh.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Cf.prototype=Object.create(mh.prototype),Pf.prototype=Object.create(mh.prototype),kf.prototype=Object.create(mh.prototype),Object.assign(kf.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.")}}),mp.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},up.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Kc.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),jh.extractUrlBase(e)}}),Kc.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(Kd.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(hr.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Ar.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ua.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},tp.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(Qn,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Qn.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Qn.ceilPowerOfTwo(e)}}),Object.assign($n.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Object.assign(Or.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new ur).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.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(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)},getInverse:function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),hi.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Object.assign(sr.prototype,{multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(Nr.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(wi.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(wi,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),wi.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),wi.getNormal(e,t,n,r)}}),Object.assign(Rh.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Xl(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new uc(this,e)}}),Object.assign(Kn.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ur.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(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ir.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(nl.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(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(si.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(si.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},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(wa.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(wa.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),rn},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(xu.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Su.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),_u.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(sh.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Pa.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Ch.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Oi.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===On},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(On)}}}),Object.assign(Oi.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?On:Nn),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(ia.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Oi(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},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(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(ia.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(Zh.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(Zd.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(Ks.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===On},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(Ks.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?On:Nn),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Zl.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(Qs.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Vd.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(ki.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 Ri}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===A}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Ac.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(Ec.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(Ra.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(qs.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},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(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},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(qs.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},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(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?un:sn}},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(zs.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(ar.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(_d.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new sd).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Ed.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Ia.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Ia.prototype.clear=function(e,t,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,n,r)};var Gf={merge:function(e,t,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};function Ff(){console.error("THREE.CanvasRenderer has been removed")}function Hf(){console.error("THREE.JSONLoader has been removed.")}er.crossOrigin=void 0,er.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new oh;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},er.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new ih;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},er.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},er.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Vf={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")}};function Wf(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:p}}))}}]);
2
- //# sourceMappingURL=596.16611391.chunk.js.map