ThreeJS-Webpack-ES6-Boilerp.../build/js/2.app.js

13 lines
565 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(t,e,n){"use strict";function r(){}n.r(e),n.d(e,"WebGLRenderTargetCube",function(){return Jn}),n.d(e,"WebGLRenderTarget",function(){return Yn}),n.d(e,"WebGLRenderer",function(){return Bs}),n.d(e,"ShaderLib",function(){return yr}),n.d(e,"UniformsLib",function(){return vr}),n.d(e,"UniformsUtils",function(){return ur}),n.d(e,"ShaderChunk",function(){return rr}),n.d(e,"FogExp2",function(){return Ns}),n.d(e,"Fog",function(){return zs}),n.d(e,"Scene",function(){return Us}),n.d(e,"Sprite",function(){return ks}),n.d(e,"LOD",function(){return js}),n.d(e,"SkinnedMesh",function(){return Ws}),n.d(e,"Skeleton",function(){return qs}),n.d(e,"Bone",function(){return Xs}),n.d(e,"Mesh",function(){return ya}),n.d(e,"LineSegments",function(){return Zs}),n.d(e,"LineLoop",function(){return Qs}),n.d(e,"Line",function(){return Js}),n.d(e,"Points",function(){return $s}),n.d(e,"Group",function(){return Ko}),n.d(e,"VideoTexture",function(){return tc}),n.d(e,"DataTexture",function(){return Zn}),n.d(e,"DataTexture3D",function(){return Ia}),n.d(e,"CompressedTexture",function(){return ec}),n.d(e,"CubeTexture",function(){return Oa}),n.d(e,"CanvasTexture",function(){return nc}),n.d(e,"DepthTexture",function(){return rc}),n.d(e,"Texture",function(){return qn}),n.d(e,"AnimationLoader",function(){return Xu}),n.d(e,"CompressedTextureLoader",function(){return Yu}),n.d(e,"DataTextureLoader",function(){return Ju}),n.d(e,"CubeTextureLoader",function(){return Qu}),n.d(e,"TextureLoader",function(){return Ku}),n.d(e,"ObjectLoader",function(){return zh}),n.d(e,"MaterialLoader",function(){return Ih}),n.d(e,"BufferGeometryLoader",function(){return Bh}),n.d(e,"DefaultLoadingManager",function(){return ju}),n.d(e,"LoadingManager",function(){return Vu}),n.d(e,"ImageLoader",function(){return Zu}),n.d(e,"ImageBitmapLoader",function(){return qh}),n.d(e,"FontLoader",function(){return Zh}),n.d(e,"FileLoader",function(){return qu}),n.d(e,"Loader",function(){return Qh}),n.d(e,"LoaderUtils",function(){return Dh}),n.d(e,"Cache",function(){return ku}),n.d(e,"AudioLoader",function(){return yl}),n.d(e,"SpotLightShadow",function(){return Sh}),n.d(e,"SpotLight",function(){return Th}),n.d(e,"PointLight",function(){return Ah}),n.d(e,"RectAreaLight",function(){return Oh}),n.d(e,"HemisphereLight",function(){return Mh}),n.d(e,"DirectionalLightShadow",function(){return Ph}),n.d(e,"DirectionalLight",function(){return Ch}),n.d(e,"AmbientLight",function(){return Rh}),n.d(e,"LightShadow",function(){return Eh}),n.d(e,"Light",function(){return _h}),n.d(e,"StereoCamera",function(){return xl}),n.d(e,"PerspectiveCamera",function(){return ts}),n.d(e,"OrthographicCamera",function(){return Lh}),n.d(e,"CubeCamera",function(){return bl}),n.d(e,"ArrayCamera",function(){return es}),n.d(e,"Camera",function(){return $o}),n.d(e,"AudioListener",function(){return _l}),n.d(e,"PositionalAudio",function(){return El}),n.d(e,"AudioContext",function(){return vl}),n.d(e,"AudioAnalyser",function(){return Sl}),n.d(e,"Audio",function(){return Ml}),n.d(e,"VectorKeyframeTrack",function(){return Gu}),n.d(e,"StringKeyframeTrack",function(){return Uu}),n.d(e,"QuaternionKeyframeTrack",function(){return zu}),n.d(e,"NumberKeyframeTrack",function(){return Bu}),n.d(e,"ColorKeyframeTrack",function(){return Du}),n.d(e,"BooleanKeyframeTrack",function(){return Iu}),n.d(e,"PropertyMixer",function(){return Tl}),n.d(e,"PropertyBinding",function(){return pd}),n.d(e,"KeyframeTrack",function(){return Ou}),n.d(e,"AnimationUtils",function(){return Au}),n.d(e,"AnimationObjectGroup",function(){return fd}),n.d(e,"AnimationMixer",function(){return gd}),n.d(e,"AnimationClip",function(){return Fu}),n.d(e,"Uniform",function(){return vd}),n.d(e,"InstancedBufferGeometry",function(){return yd}),n.d(e,"BufferGeometry",function(){return _i}),n.d(e,"Geometry",function(){return Kr}),n.d(e,"InterleavedBufferAttribute",function(){return Fs}),n.d(e,"InstancedInterleavedBuffer",function(){return xd}),n.d(e,"InterleavedBuffer",function(){return Gs}),n.d(e,"InstancedBufferAttribute",function(){return bd}),n.d(e,"Face3",function(){return wr}),n.d(e,"Object3D",function(){return Vr}),n.d(e,"Raycaster",function(){return wd}),n.d(e,"Layers",function(){return Mr}),n.d(e,"EventDispatcher",function(){return r}),n.d(e,"Clock",function(){return wl}),n.d(e,"QuaternionLinearInterpolant",function(){return Nu}),n.d(e,"LinearInterpolant",function(){return Cu}),n.d(e,"DiscreteInterpolant",function(){return Ru}),n.d(e,"CubicInterpolant",function(){return Pu}),n.d(e,"Interpolant",function(){return Lu}),n.d(e,"Triangle",function(){return ga}),n.d(e,"Math",function(){return cn}),n.d(e,"Spherical",function(){return Ed}),n.d(e,"Cylindrical",function(){return Sd}),n.d(e,"Plane",function(){return er}),n.d(e,"Frustum",function(){return nr}),n.d(e,"Sphere",function(){return tr}),n.d(e,"Ray",function(){return ma}),n.d(e,"Matrix4",function(){return hn}),n.d(e,"Matrix3",function(){return pn}),n.d(e,"Box3",function(){return Qn}),n.d(e,"Box2",function(){return Td}),n.d(e,"Line3",function(){return Ad}),n.d(e,"Euler",function(){return _r}),n.d(e,"Vector4",function(){return Xn}),n.d(e,"Vector3",function(){return dn}),n.d(e,"Vector2",function(){return un}),n.d(e,"Quaternion",function(){return ln}),n.d(e,"Color",function(){return lr}),n.d(e,"ImmediateRenderObject",function(){return Ld}),n.d(e,"VertexNormalsHelper",function(){return Pd}),n.d(e,"SpotLightHelper",function(){return Cd}),n.d(e,"SkeletonHelper",function(){return Rd}),n.d(e,"PointLightHelper",function(){return Od}),n.d(e,"RectAreaLightHelper",function(){return Id}),n.d(e,"HemisphereLightHelper",function(){return Dd}),n.d(e,"GridHelper",function(){return Bd}),n.d(e,"PolarGridHelper",function(){return Nd}),n.d(e,"FaceNormalsHelper",function(){return zd}),n.d(e,"DirectionalLightHelper",function(){return Ud}),n.d(e,"CameraHelper",function(){return Gd}),n.d(e,"BoxHelper",function(){return Hd}),n.d(e,"Box3Helper",function(){return kd}),n.d(e,"PlaneHelper",function(){return Vd}),n.d(e,"ArrowHelper",function(){return jd}),n.d(e,"AxesHelper",function(){return Wd}),n.d(e,"Shape",function(){return wh}),n.d(e,"Path",function(){return bh}),n.d(e,"ShapePath",function(){return Xh}),n.d(e,"Font",function(){return Yh}),n.d(e,"CurvePath",function(){return xh}),n.d(e,"Curve",function(){return $u}),n.d(e,"ImageUtils",function(){return jn}),n.d(e,"ShapeUtils",function(){return jc}),n.d(e,"WebGLUtils",function(){return Qo}),n.d(e,"WireframeGeometry",function(){return ic}),n.d(e,"ParametricGeometry",function(){return ac}),n.d(e,"ParametricBufferGeometry",function(){return oc}),n.d(e,"TetrahedronGeometry",function(){return uc}),n.d(e,"TetrahedronBufferGeometry",function(){return hc}),n.d(e,"OctahedronGeometry",function(){return lc}),n.d(e,"OctahedronBufferGeometry",function(){return dc}),n.d(e,"IcosahedronGeometry",function(){return pc}),n.d(e,"IcosahedronBufferGeometry",function(){return fc}),n.d(e,"DodecahedronGeometry",function(){return mc}),n.d(e,"DodecahedronBufferGeometry",function(){return gc}),n.d(e,"PolyhedronGeometry",function(){return sc}),n.d(e,"PolyhedronBufferGeometry",function(){return cc}),n.d(e,"TubeGeometry",function(){return vc}),n.d(e,"TubeBufferGeometry",function(){return yc}),n.d(e,"TorusKnotGeometry",function(){return xc}),n.d(e,"TorusKnotBufferGeometry",function(){return bc}),n.d(e,"TorusGeometry",function(){return wc}),n.d(e,"TorusBufferGeometry",function(){return _c}),n.d(e,"TextGeometry",function(){return Qc}),n.d(e,"TextBufferGeometry",function(){return Kc}),n.d(e,"SphereGeometry",function(){return $c}),n.d(e,"SphereBufferGeometry",function(){return tu}),n.d(e,"RingGeometry",function(){return eu}),n.d(e,"RingBufferGeometry",function(){return nu}),n.d(e,"PlaneGeometry",function(){return Si}),n.d(e,"PlaneBufferGeometry",function(){return Ti}),n.d(e,"LatheGeometry",function(){return ru}),n.d(e,"LatheBufferGeometry",function(){return iu}),n.d(e,"ShapeGeometry",function(){return au}),n.d(e,"ShapeBufferGeometry",function(){return ou}),n.d(e,"ExtrudeGeometry",function(){return Xc}),n.d(e,"ExtrudeBufferGeometry",function(){return Yc}),n.d(e,"EdgesGeometry",function(){return cu}),n.d(e,"ConeGeometry",function(){return lu}),n.d(e,"ConeBufferGeometry",function(){return du}),n.d(e,"CylinderGeometry",function(){return uu}),n.d(e,"CylinderBufferGeometry",function(){return hu}),n.d(e,"CircleGeometry",function(){return pu}),n.d(e,"CircleBufferGeometry",function(){return fu}),n.d(e,"BoxGeometry",function(){return Mi}),n.d(e,"BoxBufferGeometry",function(){return Ei}),n.d(e,"ShadowMaterial",function(){return gu}),n.d(e,"SpriteMaterial",function(){return Hs}),n.d(e,"RawShaderMaterial",function(){return vu}),n.d(e,"ShaderMaterial",function(){return fa}),n.d(e,"PointsMaterial",function(){return Ks}),n.d(e,"MeshPhysicalMaterial",function(){return xu}),n.d(e,"MeshStandardMaterial",function(){return yu}),n.d(e,"MeshPhongMaterial",function(){return bu}),n.d(e,"MeshToonMaterial",function(){return wu}),n.d(e,"MeshNormalMaterial",function(){return _u}),n.d(e,"MeshLambertMaterial",function(){return Mu}),n.d(e,"MeshDepthMaterial",function(){return qo}),n.d(e,"MeshDistanceMaterial",function(){return Xo}),n.d(e,"MeshBasicMaterial",function(){return va}),n.d(e,"MeshMatcapMaterial",function(){return Eu}),n.d(e,"LineDashedMaterial",function(){return Su}),n.d(e,"LineBasicMaterial",function(){return Ys}),n.d(e,"Material",function(){return pa}),n.d(e,"Float64BufferAttribute",function(){return ci}),n.d(e,"Float32BufferAttribute",function(){return si}),n.d(e,"Uint32BufferAttribute",function(){return oi}),n.d(e,"Int32BufferAttribute",function(){return ai}),n.d(e,"Uint16BufferAttribute",function(){return ii}),n.d(e,"Int16BufferAttribute",function(){return ri}),n.d(e,"Uint8ClampedBufferAttribute",function(){return ni}),n.d(e,"Uint8BufferAttribute",function(){return ei}),n.d(e,"Int8BufferAttribute",function(){return ti}),n.d(e,"BufferAttribute",function(){return $r}),n.d(e,"ArcCurve",function(){return eh}),n.d(e,"CatmullRomCurve3",function(){return sh}),n.d(e,"CubicBezierCurve",function(){return lh}),n.d(e,"CubicBezierCurve3",function(){return dh}),n.d(e,"EllipseCurve",function(){return th}),n.d(e,"LineCurve",function(){return ph}),n.d(e,"LineCurve3",function(){return fh}),n.d(e,"QuadraticBezierCurve",function(){return mh}),n.d(e,"QuadraticBezierCurve3",function(){return gh}),n.d(e,"SplineCurve",function(){return vh}),n.d(e,"REVISION",function(){return _t}),n.d(e,"MOUSE",function(){return T}),n.d(e,"CullFaceNone",function(){return q}),n.d(e,"CullFaceBack",function(){return X}),n.d(e,"CullFaceFront",function(){return Y}),n.d(e,"CullFaceFrontBack",function(){return A}),n.d(e,"FrontFaceDirectionCW",function(){return L}),n.d(e,"FrontFaceDirectionCCW",function(){return P}),n.d(e,"BasicShadowMap",function(){return C}),n.d(e,"PCFShadowMap",function(){return G}),n.d(e,"PCFSoftShadowMap",function(){return F}),n.d(e,"FrontSide",function(){return B}),n.d(e,"BackSide",function(){return Mt}),n.d(e,"DoubleSide",function(){return J}),n.d(e,"FlatShading",function(){return R}),n.d(e,"SmoothShading",function(){return O}),n.d(e,"NoColors",function(){return I}),n.d(e,"FaceColors",function(){return D}),n.d(e,"VertexColors",function(){return N}),n.d(e,"NoBlending",function(){return Z}),n.d(e,"NormalBlending",function(){return Q}),n.d(e,"AdditiveBlending",function(){return K}),n.d(e,"SubtractiveBlending",function(){return $}),n.d(e,"MultiplyBlending",function(){return tt}),n.d(e,"CustomBlending",function(){return et}),n.d(e,"AddEquation",function(){return nt}),n.d(e,"SubtractEquation",function(){return z}),n.d(e,"ReverseSubtractEquation",function(){return U}),n.d(e,"MinEquation",function(){return H}),n.d(e,"MaxEquation",function(){return k}),n.d(e,"ZeroFactor",function(){return V}),n.d(e,"OneFactor",function(){return j}),n.d(e,"SrcColorFactor",function(){return W}),n.d(e,"OneMinusSrcColorFactor",function(){return rt}),n.d(e,"SrcAlphaFactor",function(){return it}),n.d(e,"OneMinusSrcAlphaFactor",function(){return at}),n.d(e,"DstAlphaFactor",function(){return ot}),n.d(e,"OneMinusDstAlphaFactor",function(){return st}),n.d(e,"DstColorFactor",function(){return ct}),n.d(e,"OneMinusDstColorFactor",function(){return ut}),n.d(e,"SrcAlphaSaturateFactor",function(){return ht}),n.d(e,"NeverDepth",function(){return lt}),n.d(e,"AlwaysDepth",function(){return dt}),n.d(e,"LessDepth",function(){return pt}),n.d(e,"LessEqualDepth",function(){return ft}),n.d(e,"EqualDepth",function(){return mt}),n.d(e,"GreaterEqualDepth",function(){return gt}),n.d(e,"GreaterDepth",function(){return vt}),n.d(e,"NotEqualDepth",function(){return yt}),n.d(e,"MultiplyOperation",function(){return xt}),n.d(e,"MixOperation",function(){return bt}),n.d(e,"AddOperation",function(){return wt}),n.d(e,"NoToneMapping",function(){return Et}),n.d(e,"LinearToneMapping",function(){return St}),n.d(e,"ReinhardToneMapping",function(){return Tt}),n.d(e,"Uncharted2ToneMapping",function(){return At}),n.d(e,"CineonToneMapping",function(){return Lt}),n.d(e,"ACESFilmicToneMapping",function(){return Pt}),n.d(e,"UVMapping",function(){return Ct}),n.d(e,"CubeReflectionMapping",function(){return Rt}),n.d(e,"CubeRefractionMapping",function(){return Ot}),n.d(e,"EquirectangularReflectionMapping",function(){return It}),n.d(e,"EquirectangularRefractionMapping",function(){return Dt}),n.d(e,"SphericalReflectionMapping",function(){return Bt}),n.d(e,"CubeUVReflectionMapping",function(){return Nt}),n.d(e,"CubeUVRefractionMapping",function(){return zt}),n.d(e,"RepeatWrapping",function(){return Ut}),n.d(e,"ClampToEdgeWrapping",function(){return Gt}),n.d(e,"MirroredRepeatWrapping",function(){return Ft}),n.d(e,"NearestFilter",function(){return Ht}),n.d(e,"NearestMipMapNearestFilter",function(){return kt}),n.d(e,"NearestMipMapLinearFilter",function(){return Vt}),n.d(e,"LinearFilter",function(){return jt}),n.d(e,"LinearMipMapNearestFilter",function(){return Wt}),n.d(e,"LinearMipMapLinearFilter",function(){return qt}),n.d(e,"UnsignedByteType",function(){return Xt}),n.d(e,"ByteType",function(){return Yt}),n.d(e,"ShortType",function(){return Jt}),n.d(e,"UnsignedShortType",function(){return Zt}),n.d(e,"IntType",function(){return Qt}),n.d(e,"UnsignedIntType",function(){return Kt}),n.d(e,"FloatType",function(){return $t}),n.d(e,"HalfFloatType",function(){return te}),n.d(e,"UnsignedShort4444Type",function(){return ee}),n.d(e,"UnsignedShort5551Type",function(){return ne}),n.d(e,"UnsignedShort565Type",function(){return re}),n.d(e,"UnsignedInt248Type",function(){return ie}),n.d(e,"AlphaFormat",function(){return ae}),n.d(e,"RGBFormat",function(){return oe}),n.d(e,"RGBAFormat",function(){return se}),n.d(e,"LuminanceFormat",function(){return ce}),n.d(e,"LuminanceAlphaFormat",function(){return ue}),n.d(e,"RGBEFormat",function(){return he}),n.d(e,"DepthFormat",function(){return le}),n.d(e,"DepthStencilFormat",function(){return de}),n.d(e,"RedFormat",function(){return pe}),n.d(e,"RGB_S3TC_DXT1_Format",function(){return fe}),n.d(e,"RGBA_S3TC_DXT1_Format",function(){return me}),n.d(e,"RGBA_S3TC_DXT3_Format",function(){return ge}),n.d(e,"RGBA_S3TC_DXT5_Format",function(){return ve}),n.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return ye}),n.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return xe}),n.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return be}),n.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return we}),n.d(e,"RGB_ETC1_Format",function(){return _e}),n.d(e,"RGBA_ASTC_4x4_Format",function(){return Me}),n.d(e,"RGBA_ASTC_5x4_Format",function(){return Ee}),n.d(e,"RGBA_ASTC_5x5_Format",function(){return Se}),n.d(e,"RGBA_ASTC_6x5_Format",function(){return Te}),n.d(e,"RGBA_ASTC_6x6_Format",function(){return Ae}),n.d(e,"RGBA_ASTC_8x5_Format",function(){return Le}),n.d(e,"RGBA_ASTC_8x6_Format",function(){return Pe}),n.d(e,"RGBA_ASTC_8x8_Format",function(){return Ce}),n.d(e,"RGBA_ASTC_10x5_Format",function(){return Re}),n.d(e,"RGBA_ASTC_10x6_Format",function(){return Oe}),n.d(e,"RGBA_ASTC_10x8_Format",function(){return Ie}),n.d(e,"RGBA_ASTC_10x10_Format",function(){return De}),n.d(e,"RGBA_ASTC_12x10_Format",function(){return Be}),n.d(e,"RGBA_ASTC_12x12_Format",function(){return Ne}),n.d(e,"LoopOnce",function(){return ze}),n.d(e,"LoopRepeat",function(){return Ue}),n.d(e,"LoopPingPong",function(){return Ge}),n.d(e,"InterpolateDiscrete",function(){return Fe}),n.d(e,"InterpolateLinear",function(){return He}),n.d(e,"InterpolateSmooth",function(){return ke}),n.d(e,"ZeroCurvatureEnding",function(){return Ve}),n.d(e,"ZeroSlopeEnding",function(){return je}),n.d(e,"WrapAroundEnding",function(){return We}),n.d(e,"TrianglesDrawMode",function(){return qe}),n.d(e,"TriangleStripDrawMode",function(){return Xe}),n.d(e,"TriangleFanDrawMode",function(){return Ye}),n.d(e,"LinearEncoding",function(){return Je}),n.d(e,"sRGBEncoding",function(){return Ze}),n.d(e,"GammaEncoding",function(){return Qe}),n.d(e,"RGBEEncoding",function(){return Ke}),n.d(e,"LogLuvEncoding",function(){return $e}),n.d(e,"RGBM7Encoding",function(){return tn}),n.d(e,"RGBM16Encoding",function(){return en}),n.d(e,"RGBDEncoding",function(){return nn}),n.d(e,"BasicDepthPacking",function(){return rn}),n.d(e,"RGBADepthPacking",function(){return an}),n.d(e,"TangentSpaceNormalMap",function(){return on}),n.d(e,"ObjectSpaceNormalMap",function(){return sn}),n.d(e,"CubeGeometry",function(){return Mi}),n.d(e,"Face4",function(){return qd}),n.d(e,"LineStrip",function(){return Yd}),n.d(e,"LinePieces",function(){return Jd}),n.d(e,"MeshFaceMaterial",function(){return Zd}),n.d(e,"MultiMaterial",function(){return Qd}),n.d(e,"PointCloud",function(){return Kd}),n.d(e,"Particle",function(){return $d}),n.d(e,"ParticleSystem",function(){return tp}),n.d(e,"PointCloudMaterial",function(){return ep}),n.d(e,"ParticleBasicMaterial",function(){return np}),n.d(e,"ParticleSystemMaterial",function(){return rp}),n.d(e,"Vertex",function(){return ip}),n.d(e,"DynamicBufferAttribute",function(){return ap}),n.d(e,"Int8Attribute",function(){return op}),n.d(e,"Uint8Attribute",function(){return sp}),n.d(e,"Uint8ClampedAttribute",function(){return cp}),n.d(e,"Int16Attribute",function(){return up}),n.d(e,"Uint16Attribute",function(){return hp}),n.d(e,"Int32Attribute",function(){return lp}),n.d(e,"Uint32Attribute",function(){return dp}),n.d(e,"Float32Attribute",function(){return pp}),n.d(e,"Float64Attribute",function(){return fp}),n.d(e,"ClosedSplineCurve3",function(){return mp}),n.d(e,"SplineCurve3",function(){return gp}),n.d(e,"Spline",function(){return vp}),n.d(e,"AxisHelper",function(){return yp}),n.d(e,"BoundingBoxHelper",function(){return xp}),n.d(e,"EdgesHelper",function(){return bp}),n.d(e,"WireframeHelper",function(){return wp}),n.d(e,"XHRLoader",function(){return _p}),n.d(e,"BinaryTextureLoader",function(){return Mp}),n.d(e,"GeometryUtils",function(){return Ep}),n.d(e,"Projector",function(){return Sp}),n.d(e,"CanvasRenderer",function(){return Tp}),n.d(e,"JSONLoader",function(){return Ap}),n.d(e,"SceneUtils",function(){return Lp}),n.d(e,"LensFlare",function(){return Pp}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}),Object.assign(r.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,t)}}}});var i,a,h,l,o,s,c,u,d,p,f,m,g,v,y,x,b,w,_,M,E,S,_t="100",T={LEFT:0,MIDDLE:1,RIGHT:2},q=0,X=1,Y=2,A=3,L=0,P=1,C=0,G=1,F=2,B=0,Mt=1,J=2,R=1,O=2,I=0,D=1,N=2,Z=0,Q=1,K=2,$=3,tt=4,et=5,nt=100,z=101,U=102,H=103,k=104,V=200,j=201,W=202,rt=203,it=204,at=205,ot=206,st=207,ct=208,ut=209,ht=210,lt=0,dt=1,pt=2,ft=3,mt=4,gt=5,vt=6,yt=7,xt=0,bt=1,wt=2,Et=0,St=1,Tt=2,At=3,Lt=4,Pt=5,Ct=300,Rt=301,Ot=302,It=303,Dt=304,Bt=305,Nt=306,zt=307,Ut=1e3,Gt=1001,Ft=1002,Ht=1003,kt=1004,Vt=1005,jt=1006,Wt=1007,qt=1008,Xt=1009,Yt=1010,Jt=1011,Zt=1012,Qt=1013,Kt=1014,$t=1015,te=1016,ee=1017,ne=1018,re=1019,ie=1020,ae=1021,oe=1022,se=1023,ce=1024,ue=1025,he=se,le=1026,de=1027,pe=1028,fe=33776,me=33777,ge=33778,ve=33779,ye=35840,xe=35841,be=35842,we=35843,_e=36196,Me=37808,Ee=37809,Se=37810,Te=37811,Ae=37812,Le=37813,Pe=37814,Ce=37815,Re=37816,Oe=37817,Ie=37818,De=37819,Be=37820,Ne=37821,ze=2200,Ue=2201,Ge=2202,Fe=2300,He=2301,ke=2302,Ve=2400,je=2401,We=2402,qe=0,Xe=1,Ye=2,Je=3e3,Ze=3001,Qe=3007,Ke=3002,$e=3003,tn=3004,en=3005,nn=3006,rn=3200,an=3201,on=0,sn=1,cn={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var i=[],t=0;t<256;t++)i[t]=(t<16?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(i[255&t]+i[t>>8&255]+i[t>>16&255]+i[t>>24&255]+"-"+i[255&e]+i[e>>8&255]+"-"+i[e>>16&15|64]+i[e>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&r]+i[r>>8&255]+i[r>>16&255]+i[r>>24&255]).toUpperCase()}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*cn.DEG2RAD},radToDeg:function(t){return t*cn.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function un(t,e){this.x=t||0,this.y=e||0}function hn(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function ln(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}function dn(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function pn(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(un.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(un.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:(i=new un,a=new un,function(t,e){return i.set(t,t),a.set(e,e),this.clamp(i,a)}),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*n-a*r+t.x,this.y=i*r+a*n+t.y,this}}),Object.assign(hn.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,a,o,s,c,u,h,l,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=u,g[10]=h,g[14]=l,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new hn).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:(f=new dn,function(t){var e=this.elements,n=t.elements,r=1/f.setFromMatrixColumn(t,0).length(),i=1/f.setFromMatrixColumn(t,1).length(),a=1/f.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),h=Math.sin(i);if("XYZ"===t.order){var l=a*u,d=a*h,p=o*u,f=o*h;e[0]=s*u,e[4]=-s*h,e[8]=c,e[1]=d+p*c,e[5]=l-f*c,e[9]=-o*s,e[2]=f-l*c,e[6]=p+d*c,e[10]=a*s}else if("YXZ"===t.order){var m=s*u,g=s*h,v=c*u,y=c*h;e[0]=m+y*o,e[4]=v*o-g,e[8]=a*c,e[1]=a*h,e[5]=a*u,e[9]=-o,e[2]=g*o-v,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){m=s*u,g=s*h,v=c*u,y=c*h;e[0]=m-y*o,e[4]=-a*h,e[8]=v+g*o,e[1]=g+v*o,e[5]=a*u,e[9]=y-m*o,e[2]=-a*c,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){l=a*u,d=a*h,p=o*u,f=o*h;e[0]=s*u,e[4]=p*c-d,e[8]=l*c+f,e[1]=s*h,e[5]=f*c+l,e[9]=d*c-p,e[2]=-c,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var x=a*s,b=a*c,w=o*s,_=o*c;e[0]=s*u,e[4]=_-x*h,e[8]=w*h+b,e[1]=h,e[5]=a*u,e[9]=-o*u,e[2]=-c*u,e[6]=b*h+w,e[10]=x-_*h}else if("XZY"===t.order){x=a*s,b=a*c,w=o*s,_=o*c;e[0]=s*u,e[4]=-h,e[8]=c*u,e[1]=x*h+_,e[5]=a*u,e[9]=b*h-w,e[2]=w*h-b,e[6]=o*u,e[10]=_*h+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:(d=new dn(0,0,0),p=new dn(1,1,1),function(t){return this.compose(d,t,p)}),lookAt:(s=new dn,c=new dn,u=new dn,function(t,e,n){var r=this.elements;return u.subVectors(t,e),0===u.lengthSq()&&(u.z=1),u.normalize(),s.crossVectors(n,u),0===s.lengthSq()&&(1===Math.abs(n.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),s.crossVectors(n,u)),s.normalize(),c.crossVectors(u,s),r[0]=s.x,r[4]=c.x,r[8]=u.x,r[1]=s.y,r[5]=c.y,r[9]=u.y,r[2]=s.z,r[6]=c.z,r[10]=u.z,this}),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],u=n[1],h=n[5],l=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],b=n[15],w=r[0],_=r[4],M=r[8],E=r[12],S=r[1],T=r[5],A=r[9],L=r[13],P=r[2],C=r[6],R=r[10],O=r[14],I=r[3],D=r[7],B=r[11],N=r[15];return i[0]=a*w+o*S+s*P+c*I,i[4]=a*_+o*T+s*C+c*D,i[8]=a*M+o*A+s*R+c*B,i[12]=a*E+o*L+s*O+c*N,i[1]=u*w+h*S+l*P+d*I,i[5]=u*_+h*T+l*C+d*D,i[9]=u*M+h*A+l*R+d*B,i[13]=u*E+h*L+l*O+d*N,i[2]=p*w+f*S+m*P+g*I,i[6]=p*_+f*T+m*C+g*D,i[10]=p*M+f*A+m*R+g*B,i[14]=p*E+f*L+m*O+g*N,i[3]=v*w+y*S+x*P+b*I,i[7]=v*_+y*T+x*C+b*D,i[11]=v*M+y*A+x*R+b*B,i[15]=v*E+y*L+x*O+b*N,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:(o=new dn,function(t){for(var e=0,n=t.count;e<n;e++)o.x=t.getX(e),o.y=t.getY(e),o.z=t.getZ(e),o.applyMatrix4(this),t.setXYZ(e,o.x,o.y,o.z);return t}),determinant:function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],c=t[13],u=t[2],h=t[6],l=t[10],d=t[14];return t[3]*(i*s*h-r*c*h-i*o*l+n*c*l+r*o*d-n*s*d)+t[7]*(e*s*d-e*c*l+i*a*l-r*a*d+r*c*u-i*s*u)+t[11]*(e*c*h-e*o*d-i*a*h+n*a*d+i*o*u-n*c*u)+t[15]*(-r*o*u-e*s*h+e*o*l+r*a*h-n*a*l+n*s*u)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var n=this.elements,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],u=r[5],h=r[6],l=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15],b=p*y*l-v*f*l+v*h*m-u*y*m-p*h*x+u*f*x,w=g*f*l-d*y*l-g*h*m+c*y*m+d*h*x-c*f*x,_=d*v*l-g*p*l+g*u*m-c*v*m-d*u*x+c*p*x,M=g*p*h-d*v*h-g*u*f+c*v*f+d*u*y-c*p*y,E=i*b+a*w+o*_+s*M;if(0==E){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(S);return console.warn(S),this.identity()}var T=1/E;return n[0]=b*T,n[1]=(v*f*s-p*y*s-v*o*m+a*y*m+p*o*x-a*f*x)*T,n[2]=(u*y*s-v*h*s+v*o*l-a*y*l-u*o*x+a*h*x)*T,n[3]=(p*h*s-u*f*s-p*o*l+a*f*l+u*o*m-a*h*m)*T,n[4]=w*T,n[5]=(d*y*s-g*f*s+g*o*m-i*y*m-d*o*x+i*f*x)*T,n[6]=(g*h*s-c*y*s-g*o*l+i*y*l+c*o*x-i*h*x)*T,n[7]=(c*f*s-d*h*s+d*o*l-i*f*l-c*o*m+i*h*m)*T,n[8]=_*T,n[9]=(g*p*s-d*v*s-g*a*m+i*v*m+d*a*x-i*p*x)*T,n[10]=(c*v*s-g*u*s+g*a*l-i*v*l-c*a*x+i*u*x)*T,n[11]=(d*u*s-c*p*s-d*a*l+i*p*l+c*a*m-i*u*m)*T,n[12]=M*T,n[13]=(d*v*o-g*p*o+g*a*f-i*v*f-d*a*y+i*p*y)*T,n[14]=(g*u*o-c*v*o-g*a*h+i*v*h+c*a*y-i*u*y)*T,n[15]=(c*p*o-d*u*o+d*a*h-i*p*h-c*a*f+i*u*f)*T,this},scale:function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,c=i*a,u=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,u*o+n,u*s-r*a,0,c*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,c=i+i,u=a+a,h=o+o,l=i*c,d=i*u,p=i*h,f=a*u,m=a*h,g=o*h,v=s*c,y=s*u,x=s*h,b=n.x,w=n.y,_=n.z;return r[0]=(1-(f+g))*b,r[1]=(d+x)*b,r[2]=(p-y)*b,r[3]=0,r[4]=(d-x)*w,r[5]=(1-(l+g))*w,r[6]=(m+v)*w,r[7]=0,r[8]=(p+y)*_,r[9]=(m-v)*_,r[10]=(1-(l+f))*_,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},decompose:(h=new dn,l=new hn,function(t,e,n){var r=this.elements,i=h.set(r[0],r[1],r[2]).length(),a=h.set(r[4],r[5],r[6]).length(),o=h.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],l.copy(this);var s=1/i,c=1/a,u=1/o;return l.elements[0]*=s,l.elements[1]*=s,l.elements[2]*=s,l.elements[4]*=c,l.elements[5]*=c,l.elements[6]*=c,l.elements[8]*=u,l.elements[9]*=u,l.elements[10]*=u,e.setFromRotationMatrix(l),n.x=i,n.y=a,n.z=o,this}),makePerspective:function(t,e,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(e-t),c=2*i/(n-r),u=(e+t)/(e-t),h=(n+r)/(n-r),l=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=c,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=l,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(t,e,n,r,i,a){var o=this.elements,s=1/(e-t),c=1/(n-r),u=1/(a-i),h=(e+t)*s,l=(n+r)*c,d=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-l,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}),Object.assign(ln,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,a,o){var s=n[r+0],c=n[r+1],u=n[r+2],h=n[r+3],l=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(h!==f||s!==l||c!==d||u!==p){var m=1-o,g=s*l+c*d+u*p+h*f,v=0<=g?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var w=o*v;if(s=s*m+l*w,c=c*m+d*w,u=u*m+p*w,h=h*m+f*w,m===1-o){var _=1/Math.sqrt(s*s+c*c+u*u+h*h);s*=_,c*=_,u*=_,h*=_}}t[e]=s,t[e+1]=c,t[e+2]=u,t[e+3]=h}}),Object.defineProperties(ln.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(ln.prototype,{isQuaternion:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,a=t.order,o=Math.cos,s=Math.sin,c=o(n/2),u=o(r/2),h=o(i/2),l=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===a?(this._x=l*u*h+c*d*p,this._y=c*d*h-l*u*p,this._z=c*u*p+l*d*h,this._w=c*u*h-l*d*p):"YXZ"===a?(this._x=l*u*h+c*d*p,this._y=c*d*h-l*u*p,this._z=c*u*p-l*d*h,this._w=c*u*h+l*d*p):"ZXY"===a?(this._x=l*u*h-c*d*p,this._y=c*d*h+l*u*p,this._z=c*u*p+l*d*h,this._w=c*u*h-l*d*p):"ZYX"===a?(this._x=l*u*h-c*d*p,this._y=c*d*h+l*u*p,this._z=c*u*p-l*d*h,this._w=c*u*h+l*d*p):"YZX"===a?(this._x=l*u*h+c*d*p,this._y=c*d*h+l*u*p,this._z=c*u*p-l*d*h,this._w=c*u*h-l*d*p):"XZY"===a&&(this._x=l*u*h-c*d*p,this._y=c*d*h-l*u*p,this._z=c*u*p+l*d*h,this._w=c*u*h+l*d*p),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],c=n[9],u=n[2],h=n[6],l=n[10],d=r+s+l;return 0<d?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(h-c)*e,this._y=(a-u)*e,this._z=(o-i)*e):s<r&&l<r?(e=2*Math.sqrt(1+r-s-l),this._w=(h-c)/e,this._x=.25*e,this._y=(i+o)/e,this._z=(a+u)/e):l<s?(e=2*Math.sqrt(1+s-r-l),this._w=(a-u)/e,this._x=(i+o)/e,this._y=.25*e,this._z=(c+h)/e):(e=2*Math.sqrt(1+l-r-s),this._w=(o-i)/e,this._x=(a+u)/e,this._y=(c+h)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:(g=new dn,function(t,e){return void 0===g&&(g=new dn),(m=t.dot(e)+1)<1e-6?(m=0,Math.abs(t.x)>Math.abs(t.z)?g.set(-t.y,t.x,0):g.set(0,-t.z,t.y)):g.crossVectors(t,e),this._x=g.x,this._y=g.y,this._z=g.z,this._w=m,this.normalize()}),angleTo:function(t){return 2*Math.acos(Math.abs(cn.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,r=t._y,i=t._z,a=t._w,o=e._x,s=e._y,c=e._z,u=e._w;return this._x=n*u+a*o+r*c-i*s,this._y=r*u+a*s+i*o-n*c,this._z=i*u+a*c+n*s-r*o,this._w=a*u-n*o-r*s-i*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*t._w+n*t._x+r*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-e;return this._w=c*a+e*this._w,this._x=c*n+e*this._x,this._y=c*r+e*this._y,this._z=c*i+e*this._z,this.normalize()}var u=Math.sqrt(s),h=Math.atan2(u,o),l=Math.sin((1-e)*h)/u,d=Math.sin(e*h)/u;return this._w=a*l+this._w*d,this._x=n*l+this._x*d,this._y=r*l+this._y*d,this._z=i*l+this._z*d,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(dn.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:(M=new ln,function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(M.setFromEuler(t))}),applyAxisAngle:(_=new ln,function(t,e){return this.applyQuaternion(_.setFromAxisAngle(t,e))}),applyMatrix3:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,a=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*r-o*n,u=s*n+o*e-i*r,h=s*r+i*n-a*e,l=-i*e-a*n-o*r;return this.x=c*s+l*-i+u*-o-h*-a,this.y=u*s+l*-a+h*-i-c*-o,this.z=h*s+l*-o+c*-a-u*-i,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:(w=new hn,function(t){return this.applyMatrix4(w.getInverse(t.projectionMatrix)).applyMatrix4(t.matrixWorld)}),transformDirection:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:(x=new dn,b=new dn,function(t,e){return x.set(t,t,t),b.set(e,e,e),this.clamp(x,b)}),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,r=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:(y=new dn,function(t){return y.copy(this).projectOnVector(t),this.sub(y)}),reflect:(v=new dn,function(t){return this.sub(v.copy(t).multiplyScalar(2*this.dot(t)))}),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(cn.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(pn.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,a,o,s,c){var u=this.elements;return u[0]=t,u[1]=r,u[2]=o,u[3]=e,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:(E=new dn,function(t){for(var e=0,n=t.count;e<n;e++)E.x=t.getX(e),E.y=t.getY(e),E.z=t.getZ(e),E.applyMatrix3(this),t.setXYZ(e,E.x,E.y,E.z);return t}),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],u=n[4],h=n[7],l=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],b=r[2],w=r[5],_=r[8];return i[0]=a*f+o*v+s*b,i[3]=a*m+o*y+s*w,i[6]=a*g+o*x+s*_,i[1]=c*f+u*v+h*b,i[4]=c*m+u*y+h*w,i[7]=c*g+u*x+h*_,i[2]=l*f+d*v+p*b,i[5]=l*m+d*y+p*w,i[8]=l*g+d*x+p*_,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8];return e*a*u-e*o*c-n*i*u+n*o*s+r*i*c-r*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],u=n[5],h=n[6],l=n[7],d=n[8],p=d*c-u*l,f=u*h-d*s,m=l*s-c*h,g=i*p+a*f+o*m;if(0==g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return r[0]=p*y,r[1]=(o*l-d*a)*y,r[2]=(u*a-o*c)*y,r[3]=f*y,r[4]=(d*i-o*h)*y,r[5]=(o*s-u*i)*y,r[6]=m*y,r[7]=(a*h-l*i)*y,r[8]=(c*i-a*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+t,-r*c,r*s,-r*(-c*a+s*o)+o+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],u=r[7];return r[0]=e*i+n*s,r[3]=e*a+n*c,r[6]=e*o+n*u,r[1]=-n*i+e*s,r[4]=-n*a+e*c,r[7]=-n*o+e*u,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var fn,mn,gn,vn,yn,xn,bn,wn,_n,Mn,En,Sn,Tn,An,Ln,Pn,Cn,Rn,On,In,Dn,Bn,Nn,zn,Un,Gn,Fn,Hn,kn,Vn,jn={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===S&&(S=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),S.width=t.width,S.height=t.height;var n=S.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=S}return 2048<e.width||2048<e.height?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},Wn=0;function qn(t,e,n,r,i,a,o,s,c,u){Object.defineProperty(this,"id",{value:Wn++}),this.uuid=cn.generateUUID(),this.name="",this.image=void 0!==t?t:qn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:qn.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:Gt,this.wrapT=void 0!==r?r:Gt,this.magFilter=void 0!==i?i:jt,this.minFilter=void 0!==a?a:qt,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:se,this.type=void 0!==s?s:Xt,this.offset=new un(0,0),this.repeat=new un(1,1),this.center=new un(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:Je,this.version=0,this.onUpdate=null}function Xn(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function Yn(t,e,n){this.width=t,this.height=e,this.scissor=new Xn(0,0,t,e),this.scissorTest=!1,this.viewport=new Xn(0,0,t,e),n=n||{},this.texture=new qn(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:jt,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 Jn(t,e,n){Yn.call(this,t,e,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function Zn(t,e,n,r,i,a,o,s,c,u,h,l){qn.call(this,null,a,o,s,c,u,r,i,h,l),this.image={data:t,width:e,height:n},this.magFilter=void 0!==c?c:Ht,this.minFilter=void 0!==u?u:Ht,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Qn(t,e){this.min=void 0!==t?t:new dn(1/0,1/0,1/0),this.max=void 0!==e?e:new dn(-1/0,-1/0,-1/0)}function Kn(t){var e,n;for(e=0,n=t.length-3;e<=n;e+=3){Sn.fromArray(t,e);var r=An.x*Math.abs(Sn.x)+An.y*Math.abs(Sn.y)+An.z*Math.abs(Sn.z),i=xn.dot(Sn),a=bn.dot(Sn),o=wn.dot(Sn);if(Math.max(-Math.max(i,a,o),Math.min(i,a,o))>r)return!1}return!0}function $n(t){var e=t.geometry;if(void 0!==e)if(e.isGeometry){var n=e.vertices;for(Rn=0,On=n.length;Rn<On;Rn++)In.copy(n[Rn]),In.applyMatrix4(t.matrixWorld),Cn.expandByPoint(In)}else if(e.isBufferGeometry){var r=e.attributes.position;if(void 0!==r)for(Rn=0,On=r.count;Rn<On;Rn++)In.fromBufferAttribute(r,Rn).applyMatrix4(t.matrixWorld),Cn.expandByPoint(In)}}function tr(t,e){this.center=void 0!==t?t:new dn,this.radius=void 0!==e?e:0}function er(t,e){this.normal=void 0!==t?t:new dn(1,0,0),this.constant=void 0!==e?e:0}function nr(t,e,n,r,i,a){this.planes=[void 0!==t?t:new er,void 0!==e?e:new er,void 0!==n?n:new er,void 0!==r?r:new er,void 0!==i?i:new er,void 0!==a?a:new er]}qn.DEFAULT_IMAGE=void 0,qn.DEFAULT_MAPPING=Ct,qn.prototype=Object.assign(Object.create(r.prototype),{constructor:qn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=cn.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(jn.getDataURL(r[a]))}else i=jn.getDataURL(r);t.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==Ct)return t;if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case Ut:t.x=t.x-Math.floor(t.x);break;case Gt:t.x=t.x<0?0:1;break;case Ft:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case Ut:t.y=t.y-Math.floor(t.y);break;case Gt:t.y=t.y<0?0:1;break;case Ft:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(qn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Xn.prototype,{isVector4:!0,set:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,r,i,a=t.elements,o=a[0],s=a[4],c=a[8],u=a[1],h=a[5],l=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-u)<.01&&Math.abs(c-d)<.01&&Math.abs(l-p)<.01){if(Math.abs(s+u)<.1&&Math.abs(c+d)<.1&&Math.abs(l+p)<.1&&Math.abs(o+h+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(o+1)/2,g=(h+1)/2,v=(f+1)/2,y=(s+u)/4,x=(c+d)/4,b=(l+p)/4;return g<m&&v<m?i=m<.01?(n=0,r=.707106781):(r=y/(n=Math.sqrt(m)),x/n):v<g?i=g<.01?(r=0,n=.707106781):(n=y/(r=Math.sqrt(g)),b/r):v<.01?(r=n=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=b/i),this.set(n,r,i,e),this}var w=Math.sqrt((p-l)*(p-l)+(c-d)*(c-d)+(u-s)*(u-s));return Math.abs(w)<.001&&(w=1),this.x=(p-l)/w,this.y=(c-d)/w,this.z=(u-s)/w,this.w=Math.acos((o+h+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return void 0===fn&&(fn=new Xn,mn=new Xn),fn.set(t,t,t,t),mn.set(e,e,e,e),this.clamp(fn,mn)},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),Yn.prototype=Object.assign(Object.create(r.prototype),{constructor:Yn,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((Jn.prototype=Object.create(Yn.prototype)).constructor=Jn).prototype.isWebGLRenderTargetCube=!0,((Zn.prototype=Object.create(qn.prototype)).constructor=Zn).prototype.isDataTexture=!0,Object.assign(Qn.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=t.length;s<c;s+=3){var u=t[s],h=t[s+1],l=t[s+2];u<e&&(e=u),h<n&&(n=h),l<r&&(r=l),i<u&&(i=u),a<h&&(a=h),o<l&&(o=l)}return this.min.set(e,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=t.count;s<c;s++){var u=t.getX(s),h=t.getY(s),l=t.getZ(s);u<e&&(e=u),h<n&&(n=h),l<r&&(r=l),i<u&&(i=u),a<h&&(a=h),o<l&&(o=l)}return this.min.set(e,n,r),this.max.set(i,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(Dn=new dn,function(t,e){var n=Dn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new dn),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new dn),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:(In=new dn,function(t){return Cn=this,t.updateMatrixWorld(!0),t.traverse($n),this}),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new dn),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:(Pn=new dn,function(t){return this.clampPoint(t.center,Pn),Pn.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,n;return n=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:(xn=new dn,bn=new dn,wn=new dn,_n=new dn,Mn=new dn,En=new dn,Sn=new dn,Tn=new dn,An=new dn,Ln=new dn,function(t){if(this.isEmpty())return!1;this.getCenter(Tn),An.subVectors(this.max,Tn),xn.subVectors(t.a,Tn),bn.subVectors(t.b,Tn),wn.subVectors(t.c,Tn),_n.subVectors(bn,xn),Mn.subVectors(wn,bn),En.subVectors(xn,wn);var e=[0,-_n.z,_n.y,0,-Mn.z,Mn.y,0,-En.z,En.y,_n.z,0,-_n.x,Mn.z,0,-Mn.x,En.z,0,-En.x,-_n.y,_n.x,0,-Mn.y,Mn.x,0,-En.y,En.x,0];return!!Kn(e)&&!!Kn(e=[1,0,0,0,1,0,0,0,1])&&(Ln.crossVectors(_n,Mn),Kn(e=[Ln.x,Ln.y,Ln.z]))}),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new dn),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(yn=new dn,function(t){return yn.copy(t).clamp(this.min,this.max).sub(t).length()}),getBoundingSphere:(vn=new dn,function(t){return void 0===t&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),t=new tr),this.getCenter(t.center),t.radius=.5*this.getSize(vn).length(),t}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(gn=[new dn,new dn,new dn,new dn,new dn,new dn,new dn,new dn],function(t){return this.isEmpty()||(gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(gn)),this}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(tr.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(Bn=new Qn,function(t,e){var n=this.center;void 0!==e?n.copy(e):Bn.setFromPoints(t).getCenter(n);for(var r=0,i=0,a=t.length;i<a;i++)r=Math.max(r,n.distanceToSquared(t[i]));return this.radius=Math.sqrt(r),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new dn),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Qn),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(er.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:(Gn=new dn,Fn=new dn,function(t,e,n){var r=Gn.subVectors(n,e).cross(Fn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new dn),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:(Un=new dn,function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new dn);var n=t.delta(Un),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||1<i?void 0:e.copy(n).multiplyScalar(i).add(t.start)}),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&0<n||n<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new dn),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(Nn=new dn,zn=new pn,function(t,e){var n=e||zn.getNormalMatrix(t),r=this.coplanarPoint(Nn).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(nr.prototype,{set:function(t,e,n,r,i,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],u=n[6],h=n[7],l=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(o-r,h-s,f-l,y-m).normalize(),e[1].setComponents(o+r,h+s,f+l,y+m).normalize(),e[2].setComponents(o+i,h+c,f+d,y+g).normalize(),e[3].setComponents(o-i,h-c,f-d,y-g).normalize(),e[4].setComponents(o-a,h-u,f-p,y-v).normalize(),e[5].setComponents(o+a,h+u,f+p,y+v).normalize(),this},intersectsObject:(Vn=new tr,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Vn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Vn)}),intersectsSprite:(kn=new tr,function(t){return kn.center.set(0,0,0),kn.radius=.7071067811865476,kn.applyMatrix4(t.matrixWorld),this.intersectsSphere(kn)}),intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)<r)return!1}return!0},intersectsBox:(Hn=new dn,function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if(Hn.x=0<r.normal.x?t.max.x:t.min.x,Hn.y=0<r.normal.y?t.max.y:t.min.y,Hn.z=0<r.normal.z?t.max.z:t.min.z,r.distanceToPoint(Hn)<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var rr={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( PHYSICAL )\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 );",bsdfs:"float 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}\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 GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, 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_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 GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\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\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\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}",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\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - 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:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(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}\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};\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}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\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, uv ).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 = min( floor( D ) / 255.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 = value.rgb * cLogLuvM;\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 = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, 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_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\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_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\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\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 ) && defined( PHYSICAL )\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\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 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 blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, 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\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\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 = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\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 TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * 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 = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\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#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\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#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\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#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform vec3 ambientLightColor;\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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\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_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\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\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 );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#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#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\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 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\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\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\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 = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\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#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\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\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * 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( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 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, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = 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#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\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#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\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:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\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 += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * 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#endif",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\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\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\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}\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 = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( 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_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\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\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( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, 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( 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 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\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\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\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 )\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_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\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_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\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 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#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 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\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}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\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 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\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#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\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:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\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>\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\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\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>\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}",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;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\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 <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\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 <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_pars_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\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * 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 <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\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_pars_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\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\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;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\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 <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 <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 <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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 <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 <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}",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_pars_fragment>\n#include <gradientmap_pars_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 PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\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 <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_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 <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#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 <emissivemap_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\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 PHYSICAL\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}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\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>\nvoid main() {\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( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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>\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#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#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_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 <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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 = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\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 <fog_fragment>\n}",shadow_vert:"#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 <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 <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 <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 = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\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}"};function ir(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}return e}function ar(t){for(var e={},n=0;n<t.length;n++){var r=ir(t[n]);for(var i in r)e[i]=r[i]}return e}var or,sr,cr,ur={clone:ir,merge:ar},hr={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};function lr(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function dr(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function pr(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function fr(t,e,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}Object.assign(lr.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=cn.euclideanModulo(t,1),e=cn.clamp(e,0,1),n=cn.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=fr(i,r,t+1/3),this.g=fr(i,r,t),this.b=fr(i,r,t-1/3)}return this},setStyle: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,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var u,h=(u=n[1]).length;if(3===h)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}e&&0<e.length&&(void 0!==(u=hr[e])?this.setHex(u):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=0<e?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=pr(t.r),this.g=pr(t.g),this.b=pr(t.b),this},copyLinearToSRGB:function(t){return this.r=dr(t.r),this.g=dr(t.g),this.b=dr(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),c=(s+o)/2;if(s===o)n=e=0;else{var u=o-s;switch(n=c<=.5?u/(o+s):u/(2-o-s),o){case r:e=(i-a)/u+(i<a?6:0);break;case i:e=(a-r)/u+2;break;case a:e=(r-i)/u+4}e/=6}return t.h=e,t.s=n,t.l=c,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(cr={},function(t,e,n){return this.getHSL(cr),cr.h+=t,cr.s+=e,cr.l+=n,this.setHSL(cr.h,cr.s,cr.l),this}),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:(or={h:0,s:0,l:0},sr={h:0,s:0,l:0},function(t,e){this.getHSL(or),t.getHSL(sr);var n=cn.lerp(or.h,sr.h,e),r=cn.lerp(or.s,sr.s,e),i=cn.lerp(or.l,sr.l,e);return this.setHSL(n,r,i),this}),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var mr,gr,vr={common:{diffuse:{value:new lr(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new pn},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 un(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 lr(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new lr(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new pn}},sprite:{diffuse:{value:new lr(15658734)},opacity:{value:1},center:{value:new un(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new pn}}},yr={basic:{uniforms:ar([vr.common,vr.specularmap,vr.envmap,vr.aomap,vr.lightmap,vr.fog]),vertexShader:rr.meshbasic_vert,fragmentShader:rr.meshbasic_frag},lambert:{uniforms:ar([vr.common,vr.specularmap,vr.envmap,vr.aomap,vr.lightmap,vr.emissivemap,vr.fog,vr.lights,{emissive:{value:new lr(0)}}]),vertexShader:rr.meshlambert_vert,fragmentShader:rr.meshlambert_frag},phong:{uniforms:ar([vr.common,vr.specularmap,vr.envmap,vr.aomap,vr.lightmap,vr.emissivemap,vr.bumpmap,vr.normalmap,vr.displacementmap,vr.gradientmap,vr.fog,vr.lights,{emissive:{value:new lr(0)},specular:{value:new lr(1118481)},shininess:{value:30}}]),vertexShader:rr.meshphong_vert,fragmentShader:rr.meshphong_frag},standard:{uniforms:ar([vr.common,vr.envmap,vr.aomap,vr.lightmap,vr.emissivemap,vr.bumpmap,vr.normalmap,vr.displacementmap,vr.roughnessmap,vr.metalnessmap,vr.fog,vr.lights,{emissive:{value:new lr(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:rr.meshphysical_vert,fragmentShader:rr.meshphysical_frag},matcap:{uniforms:ar([vr.common,vr.bumpmap,vr.normalmap,vr.displacementmap,vr.fog,{matcap:{value:null}}]),vertexShader:rr.meshmatcap_vert,fragmentShader:rr.meshmatcap_frag},points:{uniforms:ar([vr.points,vr.fog]),vertexShader:rr.points_vert,fragmentShader:rr.points_frag},dashed:{uniforms:ar([vr.common,vr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:rr.linedashed_vert,fragmentShader:rr.linedashed_frag},depth:{uniforms:ar([vr.common,vr.displacementmap]),vertexShader:rr.depth_vert,fragmentShader:rr.depth_frag},normal:{uniforms:ar([vr.common,vr.bumpmap,vr.normalmap,vr.displacementmap,{opacity:{value:1}}]),vertexShader:rr.normal_vert,fragmentShader:rr.normal_frag},sprite:{uniforms:ar([vr.sprite,vr.fog]),vertexShader:rr.sprite_vert,fragmentShader:rr.sprite_frag},background:{uniforms:{uvTransform:{value:new pn},t2D:{value:null}},vertexShader:rr.background_vert,fragmentShader:rr.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:rr.cube_vert,fragmentShader:rr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:rr.equirect_vert,fragmentShader:rr.equirect_frag},distanceRGBA:{uniforms:ar([vr.common,vr.displacementmap,{referencePosition:{value:new dn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:rr.distanceRGBA_vert,fragmentShader:rr.distanceRGBA_frag},shadow:{uniforms:ar([vr.lights,vr.fog,{color:{value:new lr(0)},opacity:{value:1}}]),vertexShader:rr.shadow_vert,fragmentShader:rr.shadow_frag}};function xr(){var n=null,r=!1,i=null;function a(t,e){!1!==r&&(i(t,e),n.requestAnimationFrame(a))}return{start:function(){!0!==r&&null!==i&&(n.requestAnimationFrame(a),r=!0)},stop:function(){r=!1},setAnimationLoop:function(t){i=t},setContext:function(t){n=t}}}function br(c){var u=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),u.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var e=u.get(t);e&&(c.deleteBuffer(e.buffer),u.delete(t))},update:function(t,e){t.isInterleavedBufferAttribute&&(t=t.data);var n,r,i,a,o,s=u.get(t);void 0===s?u.set(t,function(t,e){var n=t.array,r=t.dynamic?35048:35044,i=c.createBuffer();c.bindBuffer(e,i),c.bufferData(e,n,r),t.onUploadCallback();var a=5126;return n instanceof Float32Array?a=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?a=5123:n instanceof Int16Array?a=5122:n instanceof Uint32Array?a=5125:n instanceof Int32Array?a=5124:n instanceof Int8Array?a=5120:n instanceof Uint8Array&&(a=5121),{buffer:i,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:t.version}}(t,e)):s.version<t.version&&(n=s.buffer,i=e,a=(r=t).array,o=r.updateRange,c.bindBuffer(i,n),!1===r.dynamic?c.bufferData(i,a,35044):-1===o.count?c.bufferSubData(i,0,a):0===o.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(c.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1),s.version=t.version)}}}function wr(t,e,n,r,i,a){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new dn,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new lr,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}function _r(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||_r.DefaultOrder}function Mr(){this.mask=1}yr.physical={uniforms:ar([yr.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:rr.meshphysical_vert,fragmentShader:rr.meshphysical_frag},Object.assign(wr.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}),_r.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],_r.DefaultOrder="XYZ",Object.defineProperties(_r.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(_r.prototype,{isEuler:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var r=cn.clamp,i=t.elements,a=i[0],o=i[4],s=i[8],c=i[1],u=i[5],h=i[9],l=i[2],d=i[6],p=i[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,u),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-l,a),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-l,p),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===e?(this._y=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,u))):"YZX"===e?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-l,a)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===e?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:(gr=new hn,function(t,e,n){return gr.makeRotationFromQuaternion(t),this.setFromRotationMatrix(gr,e,n)}),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(mr=new ln,function(t){return mr.setFromEuler(this),this.setFromQuaternion(mr,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new dn(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Mr.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var Er,Sr,Tr,Ar,Lr,Pr,Cr,Rr,Or,Ir,Dr,Br,Nr,zr,Ur,Gr,Fr,Hr,kr=0;function Vr(){Object.defineProperty(this,"id",{value:kr++}),this.uuid=cn.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Vr.DefaultUp.clone();var t=new dn,e=new _r,n=new ln,r=new dn(1,1,1);e.onChange(function(){n.setFromEuler(e,!1)}),n.onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new hn},normalMatrix:{value:new pn}}),this.matrix=new hn,this.matrixWorld=new hn,this.matrixAutoUpdate=Vr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Mr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}Vr.DefaultUp=new dn(0,1,0),Vr.DefaultMatrixAutoUpdate=!0,Vr.prototype=Object.assign(Object.create(r.prototype),{constructor:Vr,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:(Hr=new ln,function(t,e){return Hr.setFromAxisAngle(t,e),this.quaternion.multiply(Hr),this}),rotateOnWorldAxis:(Fr=new ln,function(t,e){return Fr.setFromAxisAngle(t,e),this.quaternion.premultiply(Fr),this}),rotateX:(Gr=new dn(1,0,0),function(t){return this.rotateOnAxis(Gr,t)}),rotateY:(Ur=new dn(0,1,0),function(t){return this.rotateOnAxis(Ur,t)}),rotateZ:(zr=new dn(0,0,1),function(t){return this.rotateOnAxis(zr,t)}),translateOnAxis:(Nr=new dn,function(t,e){return Nr.copy(t).applyQuaternion(this.quaternion),this.position.add(Nr.multiplyScalar(e)),this}),translateX:(Br=new dn(1,0,0),function(t){return this.translateOnAxis(Br,t)}),translateY:(Dr=new dn(0,1,0),function(t){return this.translateOnAxis(Dr,t)}),translateZ:(Ir=new dn(0,0,1),function(t){return this.translateOnAxis(Ir,t)}),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(Or=new hn,function(t){return t.applyMatrix4(Or.getInverse(this.matrixWorld))}),lookAt:(Lr=new ln,Pr=new hn,Cr=new dn,Rr=new dn,function(t,e,n){t.isVector3?Cr.copy(t):Cr.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),Rr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Pr.lookAt(Rr,Cr,this.up):Pr.lookAt(Cr,Rr,this.up),this.quaternion.setFromRotationMatrix(Pr),r&&(Pr.extractRotation(r.matrixWorld),Lr.setFromRotationMatrix(Pr),this.quaternion.premultiply(Lr.inverse()))}),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new dn),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Tr=new dn,Ar=new dn,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new ln),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Tr,t,Ar),t}),getWorldScale:(Er=new dn,Sr=new ln,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new dn),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Er,Sr,t),t}),getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new dn),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(n){var t=void 0===n||"string"==typeof n,e={};t&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{}},e.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,e){return void 0===t[e.uuid]&&(t[e.uuid]=e.toJSON(n)),e.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.isMesh||this.isLine||this.isPoints){r.geometry=i(n.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,c=o.length;s<c;s++){var u=o[s];i(n.shapes,u)}else i(n.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var h=[];for(s=0,c=this.material.length;s<c;s++)h.push(i(n.materials,this.material[s]));r.material=h}else r.material=i(n.materials,this.material);if(0<this.children.length){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(n).object)}if(t){var l=m(n.geometries),d=m(n.materials),p=m(n.textures),f=m(n.images);o=m(n.shapes);0<l.length&&(e.geometries=l),0<d.length&&(e.materials=d),0<p.length&&(e.textures=p),0<f.length&&(e.images=f),0<o.length&&(e.shapes=o)}return e.object=r,e;function m(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var r=t.children[n];this.add(r.clone())}return this}});var jr,Wr,qr,Xr,Yr,Jr,Zr,Qr=0;function Kr(){Object.defineProperty(this,"id",{value:Qr+=2}),this.uuid=cn.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function $r(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function ti(t,e,n){$r.call(this,new Int8Array(t),e,n)}function ei(t,e,n){$r.call(this,new Uint8Array(t),e,n)}function ni(t,e,n){$r.call(this,new Uint8ClampedArray(t),e,n)}function ri(t,e,n){$r.call(this,new Int16Array(t),e,n)}function ii(t,e,n){$r.call(this,new Uint16Array(t),e,n)}function ai(t,e,n){$r.call(this,new Int32Array(t),e,n)}function oi(t,e,n){$r.call(this,new Uint32Array(t),e,n)}function si(t,e,n){$r.call(this,new Float32Array(t),e,n)}function ci(t,e,n){$r.call(this,new Float64Array(t),e,n)}function ui(){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}function hi(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}Kr.prototype=Object.assign(Object.create(r.prototype),{constructor:Kr,isGeometry:!0,applyMatrix:function(t){for(var e=(new pn).getNormalMatrix(t),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(t)}for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(e).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:(Zr=new hn,function(t){return Zr.makeRotationX(t),this.applyMatrix(Zr),this}),rotateY:(Jr=new hn,function(t){return Jr.makeRotationY(t),this.applyMatrix(Jr),this}),rotateZ:(Yr=new hn,function(t){return Yr.makeRotationZ(t),this.applyMatrix(Yr),this}),translate:(Xr=new hn,function(t,e,n){return Xr.makeTranslation(t,e,n),this.applyMatrix(Xr),this}),scale:(qr=new hn,function(t,e,n){return qr.makeScale(t,e,n),this.applyMatrix(qr),this}),lookAt:(Wr=new Vr,function(t){Wr.lookAt(t),Wr.updateMatrix(),this.applyMatrix(Wr.matrix)}),fromBufferGeometry:function(t){var o=this,e=null!==t.index?t.index.array:void 0,n=t.attributes,r=n.position.array,s=void 0!==n.normal?n.normal.array:void 0,c=void 0!==n.color?n.color.array:void 0,u=void 0!==n.uv?n.uv.array:void 0,h=void 0!==n.uv2?n.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var i=0,a=0;i<r.length;i+=3,a+=2)o.vertices.push((new dn).fromArray(r,i)),void 0!==c&&o.colors.push((new lr).fromArray(c,i));function l(t,e,n,r){var i=void 0===c?[]:[o.colors[t].clone(),o.colors[e].clone(),o.colors[n].clone()],a=new wr(t,e,n,void 0===s?[]:[(new dn).fromArray(s,3*t),(new dn).fromArray(s,3*e),(new dn).fromArray(s,3*n)],i,r);o.faces.push(a),void 0!==u&&o.faceVertexUvs[0].push([(new un).fromArray(u,2*t),(new un).fromArray(u,2*e),(new un).fromArray(u,2*n)]),void 0!==h&&o.faceVertexUvs[1].push([(new un).fromArray(h,2*t),(new un).fromArray(h,2*e),(new un).fromArray(h,2*n)])}var d=t.groups;if(0<d.length)for(i=0;i<d.length;i++)for(var p=d[i],f=p.start,m=(a=f,f+p.count);a<m;a+=3)void 0!==e?l(e[a],e[a+1],e[a+2],p.materialIndex):l(a,a+1,a+2,p.materialIndex);else if(void 0!==e)for(i=0;i<e.length;i+=3)l(e[i],e[i+1],e[i+2]);else for(i=0;i<r.length/3;i+=3)l(i,i+1,i+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:(jr=new dn,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(jr).negate(),this.translate(jr.x,jr.y,jr.z),this}),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new hn;return r.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var t=new dn,e=new dn,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){var e,n,r,i,a,o;for(void 0===t&&(t=!0),o=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)o[e]=new dn;if(t){var s,c,u,h=new dn,l=new dn;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],c=this.vertices[a.b],u=this.vertices[a.c],h.subVectors(u,c),l.subVectors(s,c),h.cross(l),o[a.a].add(h),o[a.b].add(h),o[a.c].add(h)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,n=this.vertices.length;e<n;e++)o[e].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(a=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var r=(n=this.faces[t]).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())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),t=0,e=i.vertexNormals.length;t<e;t++)i.__originalVertexNormals[t]?i.__originalVertexNormals[t].copy(i.vertexNormals[t]):i.__originalVertexNormals[t]=i.vertexNormals[t].clone();var a=new Kr;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new dn,u={a:new dn,b:new dn,c:new dn},o.push(c),s.push(u)}var c,u,h=this.morphNormals[t];for(a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=h.faceNormals[n],u=h.vertexNormals[n],c.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Qn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new tr),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,c=t.faces,u=this.faceVertexUvs[0],h=t.faceVertexUvs[0],l=this.colors,d=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new pn).getNormalMatrix(e));for(var p=0,f=o.length;p<f;p++){var m=o[p].clone();void 0!==e&&m.applyMatrix4(e),a.push(m)}for(p=0,f=d.length;p<f;p++)l.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var g,v,y,x=c[p],b=x.vertexNormals,w=x.vertexColors;(g=new wr(x.a+i,x.b+i,x.c+i)).normal.copy(x.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var _=0,M=b.length;_<M;_++)v=b[_].clone(),void 0!==r&&v.applyMatrix3(r).normalize(),g.vertexNormals.push(v);g.color.copy(x.color);for(_=0,M=w.length;_<M;_++)y=w[_],g.vertexColors.push(y.clone());g.materialIndex=x.materialIndex+n,s.push(g)}for(p=0,f=h.length;p<f;p++){var E=h[p],S=[];if(void 0!==E){for(_=0,M=E.length;_<M;_++)S.push(E[_].clone());u.push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,r,i,a,o,s,c={},u=[],h=[],l=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)t=this.vertices[n],void 0===c[e=Math.round(t.x*l)+"_"+Math.round(t.y*l)+"_"+Math.round(t.z*l)]?(c[e]=n,u.push(this.vertices[n]),h[n]=u.length-1):h[n]=h[c[e]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=h[i.a],i.b=h[i.b],i.c=h[i.c],a=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;0<=n;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-u.length;return this.vertices=u,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var r=t[e];this.vertices.push(new dn(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===e&&(r=[]),o&&o.length===e&&(i=[]);for(n=0;n<e;n++){var s=t[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],c={},u=[],h={},l=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=0<p.normal.length(),g=0<p.vertexNormals.length,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=0<p.vertexColors.length,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,f),x=M(x,4,m),x=M(x,5,g),x=M(x,6,v),x=M(x,7,y),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var b=this.faceVertexUvs[0][i];o.push(T(b[0]),T(b[1]),T(b[2]))}if(m&&o.push(E(p.normal)),g){var w=p.vertexNormals;o.push(E(w[0]),E(w[1]),E(w[2]))}if(v&&o.push(S(p.color)),y){var _=p.vertexColors;o.push(S(_[0]),S(_[1]),S(_[2]))}}function M(t,e,n){return n?t|1<<e:t&~(1<<e)}function E(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==c[e]||(c[e]=s.length/3,s.push(t.x,t.y,t.z)),c[e]}function S(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==h[e]||(h[e]=u.length,u.push(t.getHex())),h[e]}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]||(d[e]=l.length/2,l.push(t.x,t.y)),d[e]}return t.data={},t.data.vertices=r,t.data.normals=s,0<u.length&&(t.data.colors=u),0<l.length&&(t.data.uvs=[l]),t.data.faces=o,t},clone:function(){return(new Kr).copy(this)},copy:function(t){var e,n,r,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,n=c.length;e<n;e++)this.colors.push(c[e].clone());var u=t.faces;for(e=0,n=u.length;e<n;e++)this.faces.push(u[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var h=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),r=0,i=h.length;r<i;r++){var l=h[r],d=[];for(a=0,o=l.length;a<o;a++){var p=l[a];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],r=0,i=f[e].vertices.length;r<i;r++)m.vertices.push(f[e].vertices[r].clone());if(void 0!==f[e].normals)for(m.normals=[],r=0,i=f[e].normals.length;r<i;r++)m.normals.push(f[e].normals[r].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],r=0,i=g[e].vertexNormals.length;r<i;r++){var y=g[e].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],r=0,i=g[e].faceNormals.length;r<i;r++)v.faceNormals.push(g[e].faceNormals[r].clone());this.morphNormals.push(v)}var b=t.skinWeights;for(e=0,n=b.length;e<n;e++)this.skinWeights.push(b[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var _=t.lineDistances;for(e=0,n=_.length;e<n;e++)this.lineDistances.push(_[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var E=t.boundingSphere;return null!==E&&(this.boundingSphere=E.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty($r.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign($r.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new lr),e[n++]=a.r,e[n++]=a.g,e[n++]=a.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new un),e[n++]=a.x,e[n++]=a.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new dn),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new Xn),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n++]=a.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),(ti.prototype=Object.create($r.prototype)).constructor=ti,(ei.prototype=Object.create($r.prototype)).constructor=ei,(ni.prototype=Object.create($r.prototype)).constructor=ni,(ri.prototype=Object.create($r.prototype)).constructor=ri,(ii.prototype=Object.create($r.prototype)).constructor=ii,(ai.prototype=Object.create($r.prototype)).constructor=ai,(oi.prototype=Object.create($r.prototype)).constructor=oi,(si.prototype=Object.create($r.prototype)).constructor=si,(ci.prototype=Object.create($r.prototype)).constructor=ci,Object.assign(ui.prototype,{computeGroups:function(t){for(var e,n=[],r=void 0,i=t.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,n.push(e)),e={start:3*a,materialIndex:r})}void 0!==e&&(e.count=3*a-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,i=t.faceVertexUvs,a=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=t.morphTargets,c=s.length;if(0<c){e=[];for(var u=0;u<c;u++)e[u]={name:s[u].name,data:[]};this.morphTargets.position=e}var h,l=t.morphNormals,d=l.length;if(0<d){h=[];for(u=0;u<d;u++)h[u]={name:l[u].name,data:[]};this.morphTargets.normal=h}var p=t.skinIndices,f=t.skinWeights,m=p.length===r.length,g=f.length===r.length;0<r.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(u=0;u<n.length;u++){var v=n[u];this.vertices.push(r[v.a],r[v.b],r[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=v.normal;this.normals.push(x,x,x)}var b,w=v.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var _=v.color;this.colors.push(_,_,_)}if(!0===a)void 0!==(b=i[0][u])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new un,new un,new un));if(!0===o)void 0!==(b=i[1][u])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new un,new un,new un));for(var M=0;M<c;M++){var E=s[M].vertices;e[M].data.push(E[v.a],E[v.b],E[v.c])}for(M=0;M<d;M++){var S=l[M].vertexNormals[u];h[M].data.push(S.a,S.b,S.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var li,di,pi,fi,mi,gi,vi,yi,xi,bi,wi=1;function _i(){Object.defineProperty(this,"id",{value:wi+=2}),this.uuid=cn.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Mi(t,e,n,r,i,a){Kr.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new Ei(t,e,n,r,i,a)),this.mergeVertices()}function Ei(t,e,n,r,i,a){_i.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var P=this;t=t||1,e=e||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var C=[],R=[],O=[],I=[],D=0,B=0;function o(t,e,n,r,i,a,o,s,c,u,h){var l,d,p=a/c,f=o/u,m=a/2,g=o/2,v=s/2,y=c+1,x=u+1,b=0,w=0,_=new dn;for(d=0;d<x;d++){var M=d*f-g;for(l=0;l<y;l++){var E=l*p-m;_[t]=E*r,_[e]=M*i,_[n]=v,R.push(_.x,_.y,_.z),_[t]=0,_[e]=0,_[n]=0<s?1:-1,O.push(_.x,_.y,_.z),I.push(l/c),I.push(1-d/u),b+=1}}for(d=0;d<u;d++)for(l=0;l<c;l++){var S=D+l+y*d,T=D+l+y*(d+1),A=D+(l+1)+y*(d+1),L=D+(l+1)+y*d;C.push(S,T,L),C.push(T,A,L),w+=6}P.addGroup(B,w,h),B+=w,D+=b}o("z","y","x",-1,-1,n,e,t,a,i,0),o("z","y","x",1,-1,n,e,-t,a,i,1),o("x","z","y",1,1,t,n,e,r,a,2),o("x","z","y",1,-1,t,n,-e,r,a,3),o("x","y","z",1,-1,t,e,n,r,i,4),o("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(C),this.addAttribute("position",new si(R,3)),this.addAttribute("normal",new si(O,3)),this.addAttribute("uv",new si(I,2))}function Si(t,e,n,r){Kr.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Ti(t,e,n,r)),this.mergeVertices()}function Ti(t,e,n,r){_i.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};var i,a,o=(t=t||1)/2,s=(e=e||1)/2,c=Math.floor(n)||1,u=Math.floor(r)||1,h=c+1,l=u+1,d=t/c,p=e/u,f=[],m=[],g=[],v=[];for(a=0;a<l;a++){var y=a*p-s;for(i=0;i<h;i++){var x=i*d-o;m.push(x,-y,0),g.push(0,0,1),v.push(i/c),v.push(1-a/u)}}for(a=0;a<u;a++)for(i=0;i<c;i++){var b=i+h*a,w=i+h*(a+1),_=i+1+h*(a+1),M=i+1+h*a;f.push(b,w,M),f.push(w,_,M)}this.setIndex(f),this.addAttribute("position",new si(m,3)),this.addAttribute("normal",new si(g,3)),this.addAttribute("uv",new si(v,2))}_i.prototype=Object.assign(Object.create(r.prototype),{constructor:_i,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<hi(t)?oi:ii)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?("index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e)):this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new $r(e,arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new pn).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:(bi=new hn,function(t){return bi.makeRotationX(t),this.applyMatrix(bi),this}),rotateY:(xi=new hn,function(t){return xi.makeRotationY(t),this.applyMatrix(xi),this}),rotateZ:(yi=new hn,function(t){return yi.makeRotationZ(t),this.applyMatrix(yi),this}),translate:(vi=new hn,function(t,e,n){return vi.makeTranslation(t,e,n),this.applyMatrix(vi),this}),scale:(gi=new hn,function(t,e,n){return gi.makeScale(t,e,n),this.applyMatrix(gi),this}),lookAt:(mi=new Vr,function(t){mi.lookAt(t),mi.updateMatrix(),this.applyMatrix(mi.matrix)}),center:(fi=new dn,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(fi).negate(),this.translate(fi.x,fi.y,fi.z),this}),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new si(3*e.vertices.length,3),r=new si(3*e.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(e.vertices)),this.addAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new si(e.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];e.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new si(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new ui).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new $r(e,3).copyVector3sArray(t.vertices)),0<t.normals.length){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new $r(n,3).copyVector3sArray(t.normals))}if(0<t.colors.length){var r=new Float32Array(3*t.colors.length);this.addAttribute("color",new $r(r,3).copyColorsArray(t.colors))}if(0<t.uvs.length){var i=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new $r(i,2).copyVector2sArray(t.uvs))}if(0<t.uvs2.length){var a=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new $r(a,2).copyVector2sArray(t.uvs2))}for(var o in this.groups=t.groups,t.morphTargets){for(var s=[],c=t.morphTargets[o],u=0,h=c.length;u<h;u++){var l=c[u],d=new si(3*l.data.length,3);d.name=l.name,s.push(d.copyVector3sArray(l.data))}this.morphAttributes[o]=s}if(0<t.skinIndices.length){var p=new si(4*t.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(0<t.skinWeights.length){var f=new si(4*t.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Qn);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):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:(di=new Qn,pi=new dn,function(){null===this.boundingSphere&&(this.boundingSphere=new tr);var t=this.attributes.position;if(t){var e=this.boundingSphere.center;di.setFromBufferAttribute(t),di.getCenter(e);for(var n=0,r=0,i=t.count;r<i;r++)pi.x=t.getX(r),pi.y=t.getY(r),pi.z=t.getZ(r),n=Math.max(n,e.distanceToSquared(pi));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new $r(new Float32Array(n.length),3));else for(var r=e.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o,s,c,u=e.normal.array,h=new dn,l=new dn,d=new dn,p=new dn,f=new dn;if(t){var m=t.array;for(i=0,a=t.count;i<a;i+=3)o=3*m[i+0],s=3*m[i+1],c=3*m[i+2],h.fromArray(n,o),l.fromArray(n,s),d.fromArray(n,c),p.subVectors(d,l),f.subVectors(h,l),p.cross(f),u[o]+=p.x,u[1+o]+=p.y,u[2+o]+=p.z,u[s]+=p.x,u[1+s]+=p.y,u[2+s]+=p.z,u[c]+=p.x,u[1+c]+=p.y,u[2+c]+=p.z}else for(i=0,a=n.length;i<a;i+=9)h.fromArray(n,i),l.fromArray(n,i+3),d.fromArray(n,i+6),p.subVectors(d,l),f.subVectors(h,l),p.cross(f),u[i]=p.x,u[i+1]=p.y,u[i+2]=p.z,u[i+3]=p.x,u[i+4]=p.y,u[i+5]=p.z,u[i+6]=p.x,u[i+7]=p.y,u[i+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==t.attributes[r])for(var i=n[r].array,a=t.attributes[r],o=a.array,s=0,c=a.itemSize*e;s<o.length;s++,c++)i[c]=o[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:(li=new dn,function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)li.x=t.getX(e),li.y=t.getY(e),li.z=t.getZ(e),li.normalize(),t.setXYZ(e,li.x,li.y,li.z)}),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new _i,e=this.index.array,n=this.attributes;for(var r in n){for(var i=n[r],a=i.array,o=i.itemSize,s=new a.constructor(e.length*o),c=0,u=0,h=0,l=e.length;h<l;h++){c=e[h]*o;for(var d=0;d<o;d++)s[u++]=a[c++]}t.addAttribute(r,new $r(s,o))}var p=this.groups;for(h=0,l=p.length;h<l;h++){var f=p[h];t.addGroup(f.start,f.count,f.materialIndex)}return t},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),0<Object.keys(this.userData).length&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var r=this.index;if(null!==r){var i=Array.prototype.slice.call(r.array);t.data.index={type:r.array.constructor.name,array:i}}var a=this.attributes;for(var n in a){var o=a[n];i=Array.prototype.slice.call(o.array);t.data.attributes[n]={itemSize:o.itemSize,type:o.array.constructor.name,array:i,normalized:o.normalized}}var s=this.groups;0<s.length&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new _i).copy(this)},copy:function(t){var e,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var a=t.attributes;for(e in a){var o=a[e];this.addAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var c=[],u=s[e];for(n=0,r=u.length;n<r;n++)c.push(u[n].clone());this.morphAttributes[e]=c}var h=t.groups;for(n=0,r=h.length;n<r;n++){var l=h[n];this.addGroup(l.start,l.count,l.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(Mi.prototype=Object.create(Kr.prototype)).constructor=Mi,(Ei.prototype=Object.create(_i.prototype)).constructor=Ei,(Si.prototype=Object.create(Kr.prototype)).constructor=Si,(Ti.prototype=Object.create(_i.prototype)).constructor=Ti;var Ai,Li,Pi,Ci,Ri,Oi,Ii,Di,Bi,Ni,zi,Ui,Gi,Fi,Hi,ki,Vi,ji,Wi,qi,Xi,Yi,Ji,Zi,Qi,Ki,$i,ta,ea,na,ra,ia,aa,oa,sa,ca,ua,ha,la,da=0;function pa(){Object.defineProperty(this,"id",{value:da++}),this.uuid=cn.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=Q,this.side=B,this.flatShading=!1,this.vertexColors=I,this.opacity=1,this.transparent=!1,this.blendSrc=it,this.blendDst=at,this.blendEquation=nt,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=ft,this.depthTest=!0,this.depthWrite=!0,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.userData={},this.needsUpdate=!0}function fa(t){pa.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,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function ma(t,e){this.origin=void 0!==t?t:new dn,this.direction=void 0!==e?e:new dn}function ga(t,e,n){this.a=void 0!==t?t:new dn,this.b=void 0!==e?e:new dn,this.c=void 0!==n?n:new dn}function va(t){pa.call(this),this.type="MeshBasicMaterial",this.color=new lr(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=xt,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.lights=!1,this.setValues(t)}function ya(t,e){Vr.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new _i,this.material=void 0!==e?e:new va({color:16777215*Math.random()}),this.drawMode=qe,this.updateMorphTargets()}function xa(t,e,n,r,i,a,o,s){if(null===(e.side===Mt?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,e.side!==J,s)))return null;la.copy(s),la.applyMatrix4(t.matrixWorld);var c=n.ray.origin.distanceTo(la);return c<n.near||c>n.far?null:{distance:c,point:la.clone(),object:t}}function ba(t,e,n,r,i,a,o,s,c){ea.fromBufferAttribute(i,o),na.fromBufferAttribute(i,s),ra.fromBufferAttribute(i,c);var u=xa(t,e,n,r,ea,na,ra,ha);if(u){a&&(sa.fromBufferAttribute(a,o),ca.fromBufferAttribute(a,s),ua.fromBufferAttribute(a,c),u.uv=ga.getUV(ha,ea,na,ra,sa,ca,ua,new un));var h=new wr(o,s,c);ga.getNormal(ea,na,ra,h.normal),u.face=h}return u}function wa(o,n,s,r){var c,u,h=new lr(0),l=0,d=null,p=0;function f(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return h},setClearColor:function(t,e){h.set(t),f(h,l=void 0!==e?e:1)},getClearAlpha:function(){return l},setClearAlpha:function(t){f(h,l=t)},render:function(t,e,n,r){var i=e.background;if(null===i?(f(h,l),d=null,p=0):i&&i.isColor&&(f(i,1),r=!0,d=null,p=0),(o.autoClear||r)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),i&&(i.isCubeTexture||i.isWebGLRenderTargetCube)){void 0===u&&((u=new ya(new Ei(1,1,1),new fa({type:"BackgroundCubeMaterial",uniforms:ir(yr.cube.uniforms),vertexShader:yr.cube.vertexShader,fragmentShader:yr.cube.fragmentShader,side:Mt,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),u.geometry.removeAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.tCube.value}}),s.update(u));var a=i.isWebGLRenderTargetCube?i.texture:i;u.material.uniforms.tCube.value=a,u.material.uniforms.tFlip.value=i.isWebGLRenderTargetCube?1:-1,d===i&&p===a.version||(u.material.needsUpdate=!0,d=i,p=a.version),t.unshift(u,u.geometry,u.material,0,null)}else i&&i.isTexture&&(void 0===c&&((c=new ya(new Ti(2,2),new fa({type:"BackgroundMaterial",uniforms:ir(yr.background.uniforms),vertexShader:yr.background.vertexShader,fragmentShader:yr.background.fragmentShader,side:B,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),!0===(c.material.uniforms.t2D.value=i).matrixAutoUpdate&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),d===i&&p===i.version||(c.material.needsUpdate=!0,p=(d=i).version),t.unshift(c,c.geometry,c.material,0,null))}}}function _a(i,a,o,s){var c;this.setMode=function(t){c=t},this.render=function(t,e){i.drawArrays(c,t,e),o.update(e,c)},this.renderInstances=function(t,e,n){var r;if(s.isWebGL2)r=i;else if(null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[s.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](c,e,n,t.maxInstancedCount),o.update(n,c,t.maxInstancedCount)}}function Ma(e,n,t){var r;function i(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(35633,36338).precision&&0<e.getShaderPrecisionFormat(35632,36338).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(35633,36337).precision&&0<e.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,o=void 0!==t.precision?t.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===t.logarithmicDepthBuffer,u=e.getParameter(34930),h=e.getParameter(35660),l=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=0<h,y=a||!!n.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var t=n.get("EXT_texture_filter_anisotropic");return r=null!==t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:l,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y}}function Ea(){var h=this,l=null,d=0,p=!1,f=!1,m=new er,g=new pn,v={value:null,needsUpdate:!1};function y(){v.value!==l&&(v.value=l,v.needsUpdate=0<d),h.numPlanes=d,h.numIntersection=0}function x(t,e,n,r){var i=null!==t?t.length:0,a=null;if(0!==i){if(a=v.value,!0!==r||null===a){var o=n+4*i,s=e.matrixWorldInverse;g.getNormalMatrix(s),(null===a||a.length<o)&&(a=new Float32Array(o));for(var c=0,u=n;c!==i;++c,u+=4)m.copy(t[c]).applyMatrix4(s,g),m.normal.toArray(a,u),a[u+3]=m.constant}v.value=a,v.needsUpdate=!0}return h.numPlanes=i,a}this.uniform=v,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,n){var r=0!==t.length||e||0!==d||p;return p=e,l=x(t,n,0),d=t.length,r},this.beginShadows=function(){f=!0,x(null)},this.endShadows=function(){f=!1,y()},this.setState=function(t,e,n,r,i,a){if(!p||null===t||0===t.length||f&&!n)f?x(null):y();else{var o=f?0:d,s=4*o,c=i.clippingState||null;v.value=c,c=x(t,r,s,a);for(var u=0;u!==s;++u)c[u]=l[u];i.clippingState=c,this.numIntersection=e?this.numPlanes:0,this.numPlanes+=o}}}function Sa(n){var r={};return{get:function(t){if(void 0!==r[t])return r[t];var e;switch(t){case"WEBGL_depth_texture":e=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":e=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":e=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":e=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:e=n.getExtension(t)}return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),r[t]=e}}}function Ta(t,l,a){var o={},d={};function s(t){var e=t.target,n=o[e.id];for(var r in null!==n.index&&l.remove(n.index),n.attributes)l.remove(n.attributes[r]);e.removeEventListener("dispose",s),delete o[e.id];var i=d[n.id];i&&(l.remove(i),delete d[n.id]),a.memory.geometries--}return{get:function(t,e){var n=o[e.id];return n||(e.addEventListener("dispose",s),e.isBufferGeometry?n=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new _i).setFromObject(t)),n=e._bufferGeometry),o[e.id]=n,a.memory.geometries++,n)},update:function(t){var e=t.index,n=t.attributes;for(var r in null!==e&&l.update(e,34963),n)l.update(n[r],34962);var i=t.morphAttributes;for(var r in i)for(var a=i[r],o=0,s=a.length;o<s;o++)l.update(a[o],34962)},getWireframeAttribute:function(t){var e=d[t.id];if(e)return e;var n,r=[],i=t.index,a=t.attributes;if(null!==i)for(var o=0,s=(n=i.array).length;o<s;o+=3){var c=n[o+0],u=n[o+1],h=n[o+2];r.push(c,u,u,h,h,c)}else for(o=0,s=(n=a.position.array).length/3-1;o<s;o+=3){c=o+0,u=o+1,h=o+2;r.push(c,u,u,h,h,c)}return e=new(65535<hi(r)?oi:ii)(r,1),l.update(e,34963),d[t.id]=e}}}function Aa(i,a,o,s){var c,u,h;this.setMode=function(t){c=t},this.setIndex=function(t){u=t.type,h=t.bytesPerElement},this.render=function(t,e){i.drawElements(c,e,u,t*h),o.update(e,c)},this.renderInstances=function(t,e,n){var r;if(s.isWebGL2)r=i;else if(null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[s.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](c,n,u,e*h,t.maxInstancedCount),o.update(n,c,t.maxInstancedCount)}}function La(t){var r={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:r,programs:null,autoReset:!0,reset:function(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0},update:function(t,e,n){switch(n=n||1,r.calls++,e){case 4:r.triangles+=n*(t/3);break;case 5:case 6:r.triangles+=n*(t-2);break;case 1:r.lines+=n*(t/2);break;case 3:r.lines+=n*(t-1);break;case 2:r.lines+=n*t;break;case 0:r.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e)}}}}function Pa(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Ca(p){var f={},m=new Float32Array(8);return{update:function(t,e,n,r){var i=t.morphTargetInfluences,a=i.length,o=f[e.id];if(void 0===o){o=[];for(var s=0;s<a;s++)o[s]=[s,0];f[e.id]=o}var c=n.morphTargets&&e.morphAttributes.position,u=n.morphNormals&&e.morphAttributes.normal;for(s=0;s<a;s++){0!==(h=o[s])[1]&&(c&&e.removeAttribute("morphTarget"+s),u&&e.removeAttribute("morphNormal"+s))}for(s=0;s<a;s++){(h=o[s])[0]=s,h[1]=i[s]}for(o.sort(Pa),s=0;s<8;s++){var h;if(h=o[s]){var l=h[0],d=h[1];if(d){c&&e.addAttribute("morphTarget"+s,c[l]),u&&e.addAttribute("morphNormal"+s,u[l]),m[s]=d;continue}}m[s]=0}r.getUniforms().setValue(p,"morphTargetInfluences",m)}}}function Ra(i,a){var o={};return{update:function(t){var e=a.render.frame,n=t.geometry,r=i.get(t,n);return o[r.id]!==e&&(n.isGeometry&&r.updateFromObject(t),i.update(r),o[r.id]=e),r},dispose:function(){o={}}}}function Oa(t,e,n,r,i,a,o,s,c,u){qn.call(this,t=void 0!==t?t:[],e=void 0!==e?e:Rt,n,r,i,a,o,s,c,u),this.flipY=!1}function Ia(t,e,n,r){qn.call(this,null),this.image={data:t,width:e,height:n,depth:r},this.magFilter=Ht,this.minFilter=Ht,this.generateMipmaps=!1,this.flipY=!1}pa.prototype=Object.assign(Object.create(r.prototype),{constructor:pa,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===R;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}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.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),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.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,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(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Q&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==B&&(n.side=this.side),this.vertexColors!==I&&(n.vertexColors=this.vertexColors),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,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),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),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(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.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var i=r(t.textures),a=r(t.images);0<i.length&&(n.textures=i),0<a.length&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((fa.prototype=Object.create(pa.prototype)).constructor=fa).prototype.isShaderMaterial=!0,fa.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ir(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},fa.prototype.toJSON=function(t){var e=pa.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}0<Object.keys(this.defines).length&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return 0<Object.keys(i).length&&(e.extensions=i),e},Object.assign(ma.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new dn),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:(zi=new dn,function(t){return this.origin.copy(this.at(t,zi)),this}),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new dn),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:(Ni=new dn,function(t){var e=Ni.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Ni.copy(this.direction).multiplyScalar(e).add(this.origin),Ni.distanceToSquared(t))}),distanceSqToSegment:(Ii=new dn,Di=new dn,Bi=new dn,function(t,e,n,r){Ii.copy(t).add(e).multiplyScalar(.5),Di.copy(e).sub(t).normalize(),Bi.copy(this.origin).sub(Ii);var i,a,o,s,c=.5*t.distanceTo(e),u=-this.direction.dot(Di),h=Bi.dot(this.direction),l=-Bi.dot(Di),d=Bi.lengthSq(),p=Math.abs(1-u*u);if(0<p)if(a=u*h-l,s=c*p,0<=(i=u*l-h))if(-s<=a)if(a<=s){var f=1/p;o=(i*=f)*(i+u*(a*=f)+2*h)+a*(u*i+a+2*l)+d}else a=c,o=-(i=Math.max(0,-(u*a+h)))*i+a*(a+2*l)+d;else a=-c,o=-(i=Math.max(0,-(u*a+h)))*i+a*(a+2*l)+d;else o=a<=-s?-(i=Math.max(0,-(-u*c+h)))*i+(a=0<i?-c:Math.min(Math.max(-c,-l),c))*(a+2*l)+d:a<=s?(i=0,(a=Math.min(Math.max(-c,-l),c))*(a+2*l)+d):-(i=Math.max(0,-(u*c+h)))*i+(a=0<i?c:Math.min(Math.max(-c,-l),c))*(a+2*l)+d;else a=0<u?-c:c,o=-(i=Math.max(0,-(u*a+h)))*i+a*(a+2*l)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Di).multiplyScalar(a).add(Ii),o}),intersectSphere:(Oi=new dn,function(t,e){Oi.subVectors(t.center,this.origin);var n=Oi.dot(this.direction),r=Oi.dot(Oi)-n*n,i=t.radius*t.radius;if(i<r)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)}),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=n?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,r,i,a,o,s,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,l=this.origin;return r=0<=c?(n=(t.min.x-l.x)*c,(t.max.x-l.x)*c):(n=(t.max.x-l.x)*c,(t.min.x-l.x)*c),(a=0<=u?(i=(t.min.y-l.y)*u,(t.max.y-l.y)*u):(i=(t.max.y-l.y)*u,(t.min.y-l.y)*u))<n||r<i?null:((n<i||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),(s=0<=h?(o=(t.min.z-l.z)*h,(t.max.z-l.z)*h):(o=(t.max.z-l.z)*h,(t.min.z-l.z)*h))<n||r<o?null:((n<o||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(0<=n?n:r,e)))},intersectsBox:(Ri=new dn,function(t){return null!==this.intersectBox(t,Ri)}),intersectTriangle:(Ai=new dn,Li=new dn,Pi=new dn,Ci=new dn,function(t,e,n,r,i){Li.subVectors(e,t),Pi.subVectors(n,t),Ci.crossVectors(Li,Pi);var a,o=this.direction.dot(Ci);if(0<o){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Ai.subVectors(this.origin,t);var s=a*this.direction.dot(Pi.crossVectors(Ai,Pi));if(s<0)return null;var c=a*this.direction.dot(Li.cross(Ai));if(c<0)return null;if(o<s+c)return null;var u=-a*Ai.dot(Ci);return u<0?null:this.at(u/o,i)}),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(ga,{getNormal:(Vi=new dn,function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new dn),r.subVectors(n,e),Vi.subVectors(t,e),r.cross(Vi);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}),getBarycoord:(Fi=new dn,Hi=new dn,ki=new dn,function(t,e,n,r,i){Fi.subVectors(r,e),Hi.subVectors(n,e),ki.subVectors(t,e);var a=Fi.dot(Fi),o=Fi.dot(Hi),s=Fi.dot(ki),c=Hi.dot(Hi),u=Hi.dot(ki),h=a*c-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new dn),0==h)return i.set(-2,-1,-1);var l=1/h,d=(c*s-o*u)*l,p=(a*u-o*s)*l;return i.set(1-d-p,p,d)}),containsPoint:(Gi=new dn,function(t,e,n,r){return ga.getBarycoord(t,e,n,r,Gi),0<=Gi.x&&0<=Gi.y&&Gi.x+Gi.y<=1}),getUV:(Ui=new dn,function(t,e,n,r,i,a,o,s){return this.getBarycoord(t,e,n,r,Ui),s.set(0,0),s.addScaledVector(i,Ui.x),s.addScaledVector(a,Ui.y),s.addScaledVector(o,Ui.z),s})}),Object.assign(ga.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:(Zi=new dn,Qi=new dn,function(){return Zi.subVectors(this.c,this.b),Qi.subVectors(this.a,this.b),.5*Zi.cross(Qi).length()}),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new dn),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return ga.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new dn),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return ga.getBarycoord(t,this.a,this.b,this.c,e)},containsPoint:function(t){return ga.containsPoint(t,this.a,this.b,this.c)},getUV:function(t,e,n,r,i){return ga.getUV(t,this.a,this.b,this.c,e,n,r,i)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:(ji=new dn,Wi=new dn,qi=new dn,Xi=new dn,Yi=new dn,Ji=new dn,function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new dn);var n,r,i=this.a,a=this.b,o=this.c;ji.subVectors(a,i),Wi.subVectors(o,i),Xi.subVectors(t,i);var s=ji.dot(Xi),c=Wi.dot(Xi);if(s<=0&&c<=0)return e.copy(i);Yi.subVectors(t,a);var u=ji.dot(Yi),h=Wi.dot(Yi);if(0<=u&&h<=u)return e.copy(a);var l=s*h-u*c;if(l<=0&&0<=s&&u<=0)return n=s/(s-u),e.copy(i).addScaledVector(ji,n);Ji.subVectors(t,o);var d=ji.dot(Ji),p=Wi.dot(Ji);if(0<=p&&d<=p)return e.copy(o);var f=d*c-s*p;if(f<=0&&0<=c&&p<=0)return r=c/(c-p),e.copy(i).addScaledVector(Wi,r);var m=u*p-d*h;if(m<=0&&0<=h-u&&0<=d-p)return qi.subVectors(o,a),r=(h-u)/(h-u+(d-p)),e.copy(a).addScaledVector(qi,r);var g=1/(m+f+l);return n=f*g,r=l*g,e.copy(i).addScaledVector(ji,n).addScaledVector(Wi,r)}),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((va.prototype=Object.create(pa.prototype)).constructor=va).prototype.isMeshBasicMaterial=!0,va.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},ya.prototype=Object.assign(Object.create(Vr.prototype),{constructor:ya,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Vr.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:(Ki=new hn,$i=new ma,ta=new tr,ea=new dn,na=new dn,ra=new dn,ia=new dn,aa=new dn,oa=new dn,sa=new un,ca=new un,ua=new un,ha=new dn,la=new dn,function(t,e){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),ta.copy(r.boundingSphere),ta.applyMatrix4(a),!1!==t.ray.intersectsSphere(ta)&&(Ki.getInverse(a),$i.copy(t.ray).applyMatrix4(Ki),null===r.boundingBox||!1!==$i.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o,s,c,u,h,l,d,p,f,m=r.index,g=r.attributes.position,v=r.attributes.uv,y=r.groups,x=r.drawRange;if(null!==m)if(Array.isArray(i))for(u=0,l=y.length;u<l;u++)for(f=i[(p=y[u]).materialIndex],h=Math.max(p.start,x.start),d=Math.min(p.start+p.count,x.start+x.count);h<d;h+=3)o=m.getX(h),s=m.getX(h+1),c=m.getX(h+2),(n=ba(this,f,t,$i,g,v,o,s,c))&&(n.faceIndex=Math.floor(h/3),e.push(n));else for(u=Math.max(0,x.start),l=Math.min(m.count,x.start+x.count);u<l;u+=3)o=m.getX(u),s=m.getX(u+1),c=m.getX(u+2),(n=ba(this,i,t,$i,g,v,o,s,c))&&(n.faceIndex=Math.floor(u/3),e.push(n));else if(void 0!==g)if(Array.isArray(i))for(u=0,l=y.length;u<l;u++)for(f=i[(p=y[u]).materialIndex],h=Math.max(p.start,x.start),d=Math.min(p.start+p.count,x.start+x.count);h<d;h+=3)(n=ba(this,f,t,$i,g,v,o=h,s=h+1,c=h+2))&&(n.faceIndex=Math.floor(h/3),e.push(n));else for(u=Math.max(0,x.start),l=Math.min(g.count,x.start+x.count);u<l;u+=3)(n=ba(this,i,t,$i,g,v,o=u,s=u+1,c=u+2))&&(n.faceIndex=Math.floor(u/3),e.push(n))}else if(r.isGeometry){var b,w,_,M,E=Array.isArray(i),S=r.vertices,T=r.faces,A=r.faceVertexUvs[0];0<A.length&&(M=A);for(var L=0,P=T.length;L<P;L++){var C=T[L],R=E?i[C.materialIndex]:i;if(void 0!==R){if(b=S[C.a],w=S[C.b],_=S[C.c],!0===R.morphTargets){var O=r.morphTargets,I=this.morphTargetInfluences;ea.set(0,0,0),na.set(0,0,0),ra.set(0,0,0);for(var D=0,B=O.length;D<B;D++){var N=I[D];if(0!==N){var z=O[D].vertices;ea.addScaledVector(ia.subVectors(z[C.a],b),N),na.addScaledVector(aa.subVectors(z[C.b],w),N),ra.addScaledVector(oa.subVectors(z[C.c],_),N)}}ea.add(b),na.add(w),ra.add(_),b=ea,w=na,_=ra}if(n=xa(this,R,t,$i,b,w,_,ha)){if(M&&M[L]){var U=M[L];sa.copy(U[0]),ca.copy(U[1]),ua.copy(U[2]),n.uv=ga.getUV(ha,b,w,_,sa,ca,ua,new un)}n.face=C,n.faceIndex=L,e.push(n)}}}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),((Oa.prototype=Object.create(qn.prototype)).constructor=Oa).prototype.isCubeTexture=!0,Object.defineProperty(Oa.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((Ia.prototype=Object.create(qn.prototype)).constructor=Ia).prototype.isDataTexture3D=!0;var Da=new qn,Ba=new Ia,Na=new Oa;function za(){this.seq=[],this.map={}}var Ua=[],Ga=[],Fa=new Float32Array(16),Ha=new Float32Array(9),ka=new Float32Array(4);function Va(t,e,n){var r=t[0];if(r<=0||0<r)return t;var i=e*n,a=Ua[i];if(void 0===a&&(a=new Float32Array(i),Ua[i]=a),0!==e){r.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=n,t[o].toArray(a,s)}return a}function ja(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Wa(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function qa(t,e){var n=Ga[e];void 0===n&&(n=new Int32Array(e),Ga[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocTextureUnit();return n}function Xa(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Ya(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Ja(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(ja(n,e))return;t.uniform2fv(this.addr,e),Wa(n,e)}}function Za(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(ja(n,e))return;t.uniform3fv(this.addr,e),Wa(n,e)}}function Qa(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(ja(n,e))return;t.uniform4fv(this.addr,e),Wa(n,e)}}function Ka(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(ja(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Wa(n,e)}else{if(ja(n,r))return;ka.set(r),t.uniformMatrix2fv(this.addr,!1,ka),Wa(n,r)}}function $a(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(ja(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Wa(n,e)}else{if(ja(n,r))return;Ha.set(r),t.uniformMatrix3fv(this.addr,!1,Ha),Wa(n,r)}}function to(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(ja(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Wa(n,e)}else{if(ja(n,r))return;Fa.set(r),t.uniformMatrix4fv(this.addr,!1,Fa),Wa(n,r)}}function eo(t,e,n){var r=this.cache,i=n.allocTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(e||Da,i)}function no(t,e,n){var r=this.cache,i=n.allocTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||Ba,i)}function ro(t,e,n){var r=this.cache,i=n.allocTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||Na,i)}function io(t,e){var n=this.cache;ja(n,e)||(t.uniform2iv(this.addr,e),Wa(n,e))}function ao(t,e){var n=this.cache;ja(n,e)||(t.uniform3iv(this.addr,e),Wa(n,e))}function oo(t,e){var n=this.cache;ja(n,e)||(t.uniform4iv(this.addr,e),Wa(n,e))}function so(t,e){var n=this.cache;ja(n,e)||(t.uniform1fv(this.addr,e),Wa(n,e))}function co(t,e){var n=this.cache;ja(n,e)||(t.uniform1iv(this.addr,e),Wa(n,e))}function uo(t,e){var n=this.cache,r=Va(e,this.size,2);ja(n,r)||(t.uniform2fv(this.addr,r),this.updateCache(r))}function ho(t,e){var n=this.cache,r=Va(e,this.size,3);ja(n,r)||(t.uniform3fv(this.addr,r),this.updateCache(r))}function lo(t,e){var n=this.cache,r=Va(e,this.size,4);ja(n,r)||(t.uniform4fv(this.addr,r),this.updateCache(r))}function po(t,e){var n=this.cache,r=Va(e,this.size,4);ja(n,r)||(t.uniformMatrix2fv(this.addr,!1,r),this.updateCache(r))}function fo(t,e){var n=this.cache,r=Va(e,this.size,9);ja(n,r)||(t.uniformMatrix3fv(this.addr,!1,r),this.updateCache(r))}function mo(t,e){var n=this.cache,r=Va(e,this.size,16);ja(n,r)||(t.uniformMatrix4fv(this.addr,!1,r),this.updateCache(r))}function go(t,e,n){var r=this.cache,i=e.length,a=qa(n,i);!1===ja(r,a)&&(t.uniform1iv(this.addr,a),Wa(r,a));for(var o=0;o!==i;++o)n.setTexture2D(e[o]||Da,a[o])}function vo(t,e,n){var r=this.cache,i=e.length,a=qa(n,i);!1===ja(r,a)&&(t.uniform1iv(this.addr,a),Wa(r,a));for(var o=0;o!==i;++o)n.setTextureCube(e[o]||Na,a[o])}function yo(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Xa;case 35664:return Ja;case 35665:return Za;case 35666:return Qa;case 35674:return Ka;case 35675:return $a;case 35676:return to;case 35678:case 36198:return eo;case 35679:return no;case 35680:return ro;case 5124:case 35670:return Ya;case 35667:case 35671:return io;case 35668:case 35672:return ao;case 35669:case 35673:return oo}}(e.type)}function xo(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return so;case 35664:return uo;case 35665:return ho;case 35666:return lo;case 35674:return po;case 35675:return fo;case 35676:return mo;case 35678:return go;case 35680:return vo;case 5124:case 35670:return co;case 35667:case 35671:return io;case 35668:case 35672:return ao;case 35669:case 35673:return oo}}(e.type)}function bo(t){this.id=t,za.call(this)}xo.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Wa(e,t)},bo.prototype.setValue=function(t,e,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(t,e[o.id],n)}};var wo=/([\w\d_]+)(\])?(\[|\.)?/g;function _o(t,e){t.seq.push(e),t.map[e.id]=e}function Mo(t,e,n){var r=t.name,i=r.length;for(wo.lastIndex=0;;){var a=wo.exec(r),o=wo.lastIndex,s=a[1],c="]"===a[2],u=a[3];if(c&&(s|=0),void 0===u||"["===u&&o+2===i){_o(n,new(void 0===u?yo:xo)(s,t,e));break}var h=n.map[s];void 0===h&&_o(n,h=new bo(s)),n=h}}function Eo(t,e,n){za.call(this),this.renderer=n;for(var r=t.getProgramParameter(e,35718),i=0;i<r;++i){var a=t.getActiveUniform(e,i);Mo(a,t.getUniformLocation(e,a.name),this)}}function So(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),!1===t.getShaderParameter(r,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",35633===e?"vertex":"fragment",t.getShaderInfoLog(r),function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(n)),r}Eo.prototype.setValue=function(t,e,n){var r=this.map[e];void 0!==r&&r.setValue(t,n,this.renderer)},Eo.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},Eo.upload=function(t,e,n,r){for(var i=0,a=e.length;i!==a;++i){var o=e[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,r)}},Eo.seqWithValue=function(t,e){for(var n=[],r=0,i=t.length;r!==i;++r){var a=t[r];a.id in e&&n.push(a)}return n};var To=0;function Ao(t){switch(t){case Je:return["Linear","( value )"];case Ze:return["sRGB","( value )"];case Ke:return["RGBE","( value )"];case tn:return["RGBM","( value, 7.0 )"];case en:return["RGBM","( value, 16.0 )"];case nn:return["RGBD","( value, 256.0 )"];case Qe:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function Lo(t,e){var n=Ao(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Po(t){return""!==t}function Co(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function Ro(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function Oo(t){return t.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,function(t,e){var n=rr[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Oo(n)})}function Io(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,n,r){for(var i="",a=parseInt(e);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]");return i})}function Do(t,e,n,r,i,a,o){var s=t.context,c=r.defines,u=i.vertexShader,h=i.fragmentShader,l="SHADOWMAP_TYPE_BASIC";a.shadowMapType===G?l="SHADOWMAP_TYPE_PCF":a.shadowMapType===F&&(l="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(r.envMap.mapping){case Rt:case Ot:d="ENVMAP_TYPE_CUBE";break;case Nt:case zt:d="ENVMAP_TYPE_CUBE_UV";break;case It:case Dt:d="ENVMAP_TYPE_EQUIREC";break;case Bt:d="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case Ot:case Dt:p="ENVMAP_MODE_REFRACTION"}switch(r.combine){case xt:f="ENVMAP_BLENDING_MULTIPLY";break;case bt:f="ENVMAP_BLENDING_MIX";break;case wt:f="ENVMAP_BLENDING_ADD"}}var m,g,v,y,x,b,w,_,M=0<t.gammaFactor?t.gammaFactor:1,E=o.isWebGL2?"":(m=r.extensions,g=a,v=e,[(m=m||{}).derivatives||g.envMapCubeUV||g.bumpMap||g.normalMap&&!g.objectSpaceNormalMap||g.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(m.fragDepth||g.logarithmicDepthBuffer)&&v.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",m.drawBuffers&&v.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(m.shaderTextureLOD||g.envMap)&&v.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Po).join("\n")),S=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(c),T=s.createProgram();if(r.isRawShaderMaterial?(0<(y=[S].filter(Po).join("\n")).length&&(y+="\n"),0<(x=[E,S].filter(Po).join("\n")).length&&(x+="\n")):(y=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,S,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+M,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+p:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+l:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#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(Po).join("\n"),x=[E,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,S,a.alphaTest?"#define ALPHATEST "+a.alphaTest+(a.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+M,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.envMap?"#define "+p:"",a.envMap?"#define "+f:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+l:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&(o.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==Et?"#define TONE_MAPPING":"",a.toneMapping!==Et?rr.tonemapping_pars_fragment:"",a.toneMapping!==Et?function(t,e){var n;switch(e){case St:n="Linear";break;case Tt:n="Reinhard";break;case At:n="Uncharted2";break;case Lt:n="OptimizedCineon";break;case Pt:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.matcapEncoding||a.envMapEncoding||a.emissiveMapEncoding?rr.encodings_pars_fragment:"",a.mapEncoding?Lo("mapTexelToLinear",a.mapEncoding):"",a.matcapEncoding?Lo("matcapTexelToLinear",a.matcapEncoding):"",a.envMapEncoding?Lo("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?Lo("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(b="linearToOutputTexel",w=a.outputEncoding,_=Ao(w),"vec4 "+b+"( vec4 value ) { return LinearTo"+_[0]+_[1]+"; }"):"",a.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Po).join("\n")),u=Ro(u=Co(u=Oo(u),a),a),h=Ro(h=Co(h=Oo(h),a),a),u=Io(u),h=Io(h),o.isWebGL2&&!r.isRawShaderMaterial){var A=!1,L=/^\s*#version\s+300\s+es\s*\n/;r.isShaderMaterial&&null!==u.match(L)&&null!==h.match(L)&&(A=!0,u=u.replace(L,""),h=h.replace(L,"")),y=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,x=["#version 300 es\n","#define varying in",A?"":"out highp vec4 pc_fragColor;",A?"":"#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"+x}var P=x+h,C=So(s,35633,y+u),R=So(s,35632,P);s.attachShader(T,C),s.attachShader(T,R),void 0!==r.index0AttributeName?s.bindAttribLocation(T,0,r.index0AttributeName):!0===a.morphTargets&&s.bindAttribLocation(T,0,"position"),s.linkProgram(T);var O,I,D=s.getProgramInfoLog(T).trim(),B=s.getShaderInfoLog(C).trim(),N=s.getShaderInfoLog(R).trim(),z=!0,U=!0;return!1===s.getProgramParameter(T,35714)?(z=!1,console.error("THREE.WebGLProgram: shader error: ",s.getError(),"35715",s.getProgramParameter(T,35715),"gl.getProgramInfoLog",D,B,N)):""!==D?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",D):""!==B&&""!==N||(U=!1),U&&(this.diagnostics={runnable:z,material:r,programLog:D,vertexShader:{log:B,prefix:y},fragmentShader:{log:N,prefix:x}}),s.deleteShader(C),s.deleteShader(R),this.getUniforms=function(){return void 0===O&&(O=new Eo(s,T,t)),O},this.getAttributes=function(){return void 0===I&&(I=function(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i<r;i++){var a=t.getActiveAttrib(e,i).name;n[a]=t.getAttribLocation(e,a)}return n}(s,T)),I},this.destroy=function(){s.deleteProgram(T),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=i.name,this.id=To++,this.code=n,this.usedTimes=1,this.program=T,this.vertexShader=C,this.fragmentShader=R,this}function Bo(l,c,d){var u=[],p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},a=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function f(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Je,n===Je&&e&&(n=Qe),n}this.getParameters=function(t,e,n,r,i,a,o){var s=p[t.type],c=o.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(d.floatVertexTextures)return 1024;var n=d.maxVertexUniforms,r=Math.floor((n-20)/4),i=Math.min(r,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}(o):0,u=d.precision;null!==t.precision&&(u=d.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",u,"instead.");var h=l.getRenderTarget();return{shaderID:s,precision:u,supportsVertexTextures:d.vertexTextures,outputEncoding:f(h?h.texture:null,l.gammaOutput),map:!!t.map,mapEncoding:f(t.map,l.gammaInput),matcap:!!t.matcap,matcapEncoding:f(t.matcap,l.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:f(t.envMap,l.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===Nt||t.envMap.mapping===zt),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:f(t.emissiveMap,l.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===sn,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!r,useFog:t.fog,fogExp:r&&r.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:d.logarithmicDepthBuffer,skinning:t.skinning&&0<c,maxBones:c,useVertexTexture:d.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:l.maxMorphTargets,maxMorphNormals:l.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:i,numClipIntersection:a,dithering:t.dithering,shadowMapEnabled:l.shadowMap.enabled&&o.receiveShadow&&0<n.length,shadowMapType:l.shadowMap.type,toneMapping:l.toneMapping,physicallyCorrectLights:l.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===J,flipSided:t.side===Mt,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,e){var n=[];if(e.shaderID?n.push(e.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]);for(var i=0;i<a.length;i++)n.push(e[a[i]]);return n.push(t.onBeforeCompile.toString()),n.push(l.gammaOutput),n.push(l.gammaFactor),n.join()},this.acquireProgram=function(t,e,n,r){for(var i,a=0,o=u.length;a<o;a++){var s=u[a];if(s.code===r){++(i=s).usedTimes;break}}return void 0===i&&(i=new Do(l,c,r,t,e,n,d),u.push(i)),i},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=u.indexOf(t);u[e]=u[u.length-1],u.pop(),t.destroy()}},this.programs=u}function No(){var r=new WeakMap;return{get:function(t){var e=r.get(t);return void 0===e&&(e={},r.set(t,e)),e},remove:function(t){r.delete(t)},update:function(t,e,n){r.get(t)[e]=n},dispose:function(){r=new WeakMap}}}function zo(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Uo(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Go(){var o=[],s=0,c=[],u=[];function h(t,e,n,r,i){var a=o[s];return void 0===a?(a={id:t.id,object:t,geometry:e,material:n,program:n.program,renderOrder:t.renderOrder,z:r,group:i},o[s]=a):(a.id=t.id,a.object=t,a.geometry=e,a.material=n,a.program=n.program,a.renderOrder=t.renderOrder,a.z=r,a.group=i),s++,a}return{opaque:c,transparent:u,init:function(){s=0,c.length=0,u.length=0},push:function(t,e,n,r,i){var a=h(t,e,n,r,i);(!0===n.transparent?u:c).push(a)},unshift:function(t,e,n,r,i){var a=h(t,e,n,r,i);(!0===n.transparent?u:c).unshift(a)},sort:function(){1<c.length&&c.sort(zo),1<u.length&&u.sort(Uo)}}}function Fo(){var i={};return{get:function(t,e){var n,r=i[t.id];return void 0===r?(n=new Go,i[t.id]={},i[t.id][e.id]=n):void 0===(n=r[e.id])&&(n=new Go,r[e.id]=n),n},dispose:function(){i={}}}}function Ho(){var n={};return{get:function(t){if(void 0!==n[t.id])return n[t.id];var e;switch(t.type){case"DirectionalLight":e={direction:new dn,color:new lr,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new un};break;case"SpotLight":e={position:new dn,direction:new dn,color:new lr,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new un};break;case"PointLight":e={position:new dn,color:new lr,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new un,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":e={direction:new dn,skyColor:new lr,groundColor:new lr};break;case"RectAreaLight":e={color:new lr,position:new dn,halfWidth:new dn,halfHeight:new dn}}return n[t.id]=e}}}var ko=0;function Vo(){var w=new Ho,_={id:ko++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},M=new dn,E=new hn,S=new hn;return{setup:function(t,e,n){for(var r=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=n.matrixWorldInverse,d=0,p=t.length;d<p;d++){var f=t[d],m=f.color,g=f.intensity,v=f.distance,y=f.shadow&&f.shadow.map?f.shadow.map.texture:null;if(f.isAmbientLight)r+=m.r*g,i+=m.g*g,a+=m.b*g;else if(f.isDirectionalLight){if((b=w.get(f)).color.copy(f.color).multiplyScalar(f.intensity),b.direction.setFromMatrixPosition(f.matrixWorld),M.setFromMatrixPosition(f.target.matrixWorld),b.direction.sub(M),b.direction.transformDirection(l),b.shadow=f.castShadow,f.castShadow){var x=f.shadow;b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize}_.directionalShadowMap[o]=y,_.directionalShadowMatrix[o]=f.shadow.matrix,_.directional[o]=b,o++}else if(f.isSpotLight){if((b=w.get(f)).position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(l),b.color.copy(m).multiplyScalar(g),b.distance=v,b.direction.setFromMatrixPosition(f.matrixWorld),M.setFromMatrixPosition(f.target.matrixWorld),b.direction.sub(M),b.direction.transformDirection(l),b.coneCos=Math.cos(f.angle),b.penumbraCos=Math.cos(f.angle*(1-f.penumbra)),b.decay=f.decay,b.shadow=f.castShadow,f.castShadow){x=f.shadow;b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize}_.spotShadowMap[c]=y,_.spotShadowMatrix[c]=f.shadow.matrix,_.spot[c]=b,c++}else if(f.isRectAreaLight){(b=w.get(f)).color.copy(m).multiplyScalar(g),b.position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(l),S.identity(),E.copy(f.matrixWorld),E.premultiply(l),S.extractRotation(E),b.halfWidth.set(.5*f.width,0,0),b.halfHeight.set(0,.5*f.height,0),b.halfWidth.applyMatrix4(S),b.halfHeight.applyMatrix4(S),_.rectArea[u]=b,u++}else if(f.isPointLight){if((b=w.get(f)).position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(l),b.color.copy(f.color).multiplyScalar(f.intensity),b.distance=f.distance,b.decay=f.decay,b.shadow=f.castShadow,f.castShadow){x=f.shadow;b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,b.shadowCameraNear=x.camera.near,b.shadowCameraFar=x.camera.far}_.pointShadowMap[s]=y,_.pointShadowMatrix[s]=f.shadow.matrix,_.point[s]=b,s++}else if(f.isHemisphereLight){var b;(b=w.get(f)).direction.setFromMatrixPosition(f.matrixWorld),b.direction.transformDirection(l),b.direction.normalize(),b.skyColor.copy(f.color).multiplyScalar(g),b.groundColor.copy(f.groundColor).multiplyScalar(g),_.hemi[h]=b,h++}}_.ambient[0]=r,_.ambient[1]=i,_.ambient[2]=a,_.directional.length=o,_.spot.length=c,_.rectArea.length=u,_.point.length=s,_.hemi.length=h,_.hash.stateID=_.id,_.hash.directionalLength=o,_.hash.pointLength=s,_.hash.spotLength=c,_.hash.rectAreaLength=u,_.hash.hemiLength=h,_.hash.shadowsLength=e.length},state:_}}function jo(){var e=new Vo,n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:e},setupLights:function(t){e.setup(n,r,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){r.push(t)}}}function Wo(){var r={};return{get:function(t,e){var n;return void 0===r[t.id]?(n=new jo,r[t.id]={},r[t.id][e.id]=n):void 0===r[t.id][e.id]?(n=new jo,r[t.id][e.id]=n):n=r[t.id][e.id],n},dispose:function(){r={}}}}function qo(t){pa.call(this),this.type="MeshDepthMaterial",this.depthPacking=rn,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.lights=!1,this.setValues(t)}function Xo(t){pa.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new dn,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.lights=!1,this.setValues(t)}function Yo(y,m,t){for(var x=new nr,b=new hn,w=new un,_=new un(t,t),M=new dn,E=new dn,v=1,S=2,e=1+(v|S),T=new Array(e),A=new Array(e),L={},P={0:Mt,1:B,2:J},C=[new dn(1,0,0),new dn(-1,0,0),new dn(0,0,1),new dn(0,0,-1),new dn(0,1,0),new dn(0,-1,0)],R=[new dn(0,1,0),new dn(0,1,0),new dn(0,1,0),new dn(0,1,0),new dn(0,0,1),new dn(0,0,-1)],O=[new Xn,new Xn,new Xn,new Xn,new Xn,new Xn],n=0;n!==e;++n){var r=0!=(n&v),i=0!=(n&S),a=new qo({depthPacking:an,morphTargets:r,skinning:i});T[n]=a;var o=new Xo({morphTargets:r,skinning:i});A[n]=o}var I=this;function g(t,e,n,r,i,a){var o=t.geometry,s=null,c=T,u=t.customDepthMaterial;if(n&&(c=A,u=t.customDistanceMaterial),u)s=u;else{var h=!1;e.morphTargets&&(o&&o.isBufferGeometry?h=o.morphAttributes&&o.morphAttributes.position&&0<o.morphAttributes.position.length:o&&o.isGeometry&&(h=o.morphTargets&&0<o.morphTargets.length)),t.isSkinnedMesh&&!1===e.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var l=t.isSkinnedMesh&&e.skinning,d=0;h&&(d|=v),l&&(d|=S),s=c[d]}if(y.localClippingEnabled&&!0===e.clipShadows&&0!==e.clippingPlanes.length){var p=s.uuid,f=e.uuid,m=L[p];void 0===m&&(m={},L[p]=m);var g=m[f];void 0===g&&(g=s.clone(),m[f]=g),s=g}return s.visible=e.visible,s.wireframe=e.wireframe,s.side=null!=e.shadowSide?e.shadowSide:P[e.side],s.clipShadows=e.clipShadows,s.clippingPlanes=e.clippingPlanes,s.clipIntersection=e.clipIntersection,s.wireframeLinewidth=e.wireframeLinewidth,s.linewidth=e.linewidth,n&&s.isMeshDistanceMaterial&&(s.referencePosition.copy(r),s.nearDistance=i,s.farDistance=a),s}function D(t,e,n,r){if(!1!==t.visible){if(t.layers.test(e.layers)&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(!t.frustumCulled||x.intersectsObject(t))){t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld);var i=m.update(t),a=t.material;if(Array.isArray(a))for(var o=i.groups,s=0,c=o.length;s<c;s++){var u=o[s],h=a[u.materialIndex];if(h&&h.visible){var l=g(t,h,r,E,n.near,n.far);y.renderBufferDirect(n,null,i,l,t,u)}}else if(a.visible){l=g(t,a,r,E,n.near,n.far);y.renderBufferDirect(n,null,i,l,t,null)}}for(var d=t.children,p=0,f=d.length;p<f;p++)D(d[p],e,n,r)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=G,this.render=function(t,e,n){if(!1!==I.enabled&&(!1!==I.autoUpdate||!1!==I.needsUpdate)&&0!==t.length){y.context;var r,i=y.state;i.disable(3042),i.buffers.color.setClear(1,1,1,1),i.buffers.depth.setTest(!0),i.setScissorTest(!1);for(var a=0,o=t.length;a<o;a++){var s=t[a],c=s.shadow,u=s&&s.isPointLight;if(void 0!==c){var h=c.camera;if(w.copy(c.mapSize),w.min(_),u){var l=w.x,d=w.y;O[0].set(2*l,d,l,d),O[1].set(0,d,l,d),O[2].set(3*l,d,l,d),O[3].set(l,d,l,d),O[4].set(3*l,0,l,d),O[5].set(l,0,l,d),w.x*=4,w.y*=2}if(null===c.map){var p={minFilter:Ht,magFilter:Ht,format:se};c.map=new Yn(w.x,w.y,p),c.map.texture.name=s.name+".shadowMap",h.updateProjectionMatrix()}c.isSpotLightShadow&&c.update(s);var f=c.map,m=c.matrix;E.setFromMatrixPosition(s.matrixWorld),h.position.copy(E),u?(r=6,m.makeTranslation(-E.x,-E.y,-E.z)):(r=1,M.setFromMatrixPosition(s.target.matrixWorld),h.lookAt(M),h.updateMatrixWorld(),m.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),m.multiply(h.projectionMatrix),m.multiply(h.matrixWorldInverse)),y.setRenderTarget(f),y.clear();for(var g=0;g<r;g++){if(u){M.copy(h.position),M.add(C[g]),h.up.copy(R[g]),h.lookAt(M),h.updateMatrixWorld();var v=O[g];i.viewport(v)}b.multiplyMatrices(h.projectionMatrix,h.matrixWorldInverse),x.setFromMatrix(b),D(e,n,h,u)}}else console.warn("THREE.WebGLShadowMap:",s,"has no shadow.")}I.needsUpdate=!1}}}function Jo(h,n,c,r){var i=new function(){var e=!1,a=new Xn,n=null,o=new Xn(0,0,0,0);return{setMask:function(t){n===t||e||(h.colorMask(t,t,t,t),n=t)},setLocked:function(t){e=t},setClear:function(t,e,n,r,i){!0===i&&(t*=r,e*=r,n*=r),a.set(t,e,n,r),!1===o.equals(a)&&(h.clearColor(t,e,n,r),o.copy(a))},reset:function(){e=!1,n=null,o.set(-1,0,0,0)}}},a=new function(){var e=!1,n=null,r=null,i=null;return{setTest:function(t){(t?G:F)(2929)},setMask:function(t){n===t||e||(h.depthMask(t),n=t)},setFunc:function(t){if(r!==t){if(t)switch(t){case lt:h.depthFunc(512);break;case dt:h.depthFunc(519);break;case pt:h.depthFunc(513);break;case ft:h.depthFunc(515);break;case mt:h.depthFunc(514);break;case gt:h.depthFunc(518);break;case vt:h.depthFunc(516);break;case yt:h.depthFunc(517);break;default:h.depthFunc(515)}else h.depthFunc(515);r=t}},setLocked:function(t){e=t},setClear:function(t){i!==t&&(h.clearDepth(t),i=t)},reset:function(){e=!1,i=r=n=null}}},e=new function(){var e=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,u=null;return{setTest:function(t){(t?G:F)(2960)},setMask:function(t){n===t||e||(h.stencilMask(t),n=t)},setFunc:function(t,e,n){r===t&&i===e&&a===n||(h.stencilFunc(t,e,n),r=t,i=e,a=n)},setOp:function(t,e,n){o===t&&s===e&&c===n||(h.stencilOp(t,e,n),o=t,s=e,c=n)},setLocked:function(t){e=t},setClear:function(t){u!==t&&(h.clearStencil(t),u=t)},reset:function(){e=!1,u=c=s=o=a=i=r=n=null}}},t=h.getParameter(34921),o=new Uint8Array(t),s=new Uint8Array(t),u=new Uint8Array(t),l={},d=null,p=null,f=null,m=null,g=null,v=null,y=null,x=null,b=null,w=null,_=!1,M=null,E=null,S=null,T=null,A=null,L=h.getParameter(35661),P=!1,C=0,R=h.getParameter(7938);-1!==R.indexOf("WebGL")?(C=parseFloat(/^WebGL\ ([0-9])/.exec(R)[1]),P=1<=C):-1!==R.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(R)[1]),P=2<=C);var O=null,I={},D=new Xn,B=new Xn;function N(t,e,n){var r=new Uint8Array(4),i=h.createTexture();h.bindTexture(t,i),h.texParameteri(t,10241,9728),h.texParameteri(t,10240,9728);for(var a=0;a<n;a++)h.texImage2D(e+a,0,6408,1,1,0,6408,5121,r);return i}var z={};function U(t,e){o[t]=1,0===s[t]&&(h.enableVertexAttribArray(t),s[t]=1),u[t]!==e&&((r.isWebGL2?h:n.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,e),u[t]=e)}function G(t){!0!==l[t]&&(h.enable(t),l[t]=!0)}function F(t){!1!==l[t]&&(h.disable(t),l[t]=!1)}function H(t,e,n,r,i,a,o,s){if(t!==Z){if(f||(G(3042),f=!0),t===et)i=i||e,a=a||n,o=o||r,e===g&&i===x||(h.blendEquationSeparate(c.convert(e),c.convert(i)),g=e,x=i),n===v&&r===y&&a===b&&o===w||(h.blendFuncSeparate(c.convert(n),c.convert(r),c.convert(a),c.convert(o)),v=n,y=r,b=a,w=o),m=t,_=null;else if(t!==m||s!==_){if(g===nt&&x===nt||(h.blendEquation(32774),x=g=nt),s)switch(t){case Q:h.blendFuncSeparate(1,771,1,771);break;case K:h.blendFunc(1,1);break;case $:h.blendFuncSeparate(0,0,769,771);break;case tt:h.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case Q:h.blendFuncSeparate(770,771,1,771);break;case K:h.blendFunc(770,1);break;case $:h.blendFunc(0,769);break;case tt:h.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}w=b=y=v=null,m=t,_=s}}else f&&(F(3042),f=!1)}function k(t){M!==t&&(t?h.frontFace(2304):h.frontFace(2305),M=t)}function V(t){t!==q?(G(2884),t!==E&&(t===X?h.cullFace(1029):t===Y?h.cullFace(1028):h.cullFace(1032))):F(2884),E=t}function j(t,e,n){t?(G(32823),T===e&&A===n||(h.polygonOffset(e,n),T=e,A=n)):F(32823)}function W(t){void 0===t&&(t=33984+L-1),O!==t&&(h.activeTexture(t),O=t)}return z[3553]=N(3553,3553,1),z[34067]=N(34067,34069,6),i.setClear(0,0,0,1),a.setClear(1),e.setClear(0),G(2929),a.setFunc(ft),k(!1),V(X),G(2884),H(Z),{buffers:{color:i,depth:a,stencil:e},initAttributes:function(){for(var t=0,e=o.length;t<e;t++)o[t]=0},enableAttribute:function(t){U(t,0)},enableAttributeAndDivisor:U,disableUnusedAttributes:function(){for(var t=0,e=s.length;t!==e;++t)s[t]!==o[t]&&(h.disableVertexAttribArray(t),s[t]=0)},enable:G,disable:F,getCompressedTextureFormats:function(){if(null===d&&(d=[],n.get("WEBGL_compressed_texture_pvrtc")||n.get("WEBGL_compressed_texture_s3tc")||n.get("WEBGL_compressed_texture_etc1")||n.get("WEBGL_compressed_texture_astc")))for(var t=h.getParameter(34467),e=0;e<t.length;e++)d.push(t[e]);return d},useProgram:function(t){return p!==t&&(h.useProgram(t),p=t,!0)},setBlending:H,setMaterial:function(t,e){(t.side===J?F:G)(2884);var n=t.side===Mt;e&&(n=!n),k(n),t.blending===Q&&!1===t.transparent?H(Z):H(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),a.setFunc(t.depthFunc),a.setTest(t.depthTest),a.setMask(t.depthWrite),i.setMask(t.colorWrite),j(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:k,setCullFace:V,setLineWidth:function(t){t!==S&&(P&&h.lineWidth(t),S=t)},setPolygonOffset:j,setScissorTest:function(t){(t?G:F)(3089)},activeTexture:W,bindTexture:function(t,e){null===O&&W();var n=I[O];void 0===n&&(n={type:void 0,texture:void 0},I[O]=n),n.type===t&&n.texture===e||(h.bindTexture(t,e||z[t]),n.type=t,n.texture=e)},compressedTexImage2D:function(){try{h.compressedTexImage2D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{h.texImage2D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{h.texImage3D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===D.equals(t)&&(h.scissor(t.x,t.y,t.z,t.w),D.copy(t))},viewport:function(t){!1===B.equals(t)&&(h.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function(){for(var t=0;t<s.length;t++)1===s[t]&&(h.disableVertexAttribArray(t),s[t]=0);l={},I={},E=M=m=p=O=d=null,i.reset(),a.reset(),e.reset()}}}function Zo(g,i,v,y,x,b,w){var m,s={};function _(t,e){if(t.width>e||t.height>e){if("data"in t)return void console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+t.width+"x"+t.height+").");var n=e/Math.max(t.width,t.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.width=Math.floor(t.width*n),r.height=Math.floor(t.height*n),r.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+r.width+"x"+r.height),r}return t}function M(t){return cn.isPowerOfTwo(t.width)&&cn.isPowerOfTwo(t.height)}function E(t,e){return t.generateMipmaps&&e&&t.minFilter!==Ht&&t.minFilter!==jt}function S(t,e,n,r){g.generateMipmap(t),y.get(e).__maxMipLevel=Math.log(Math.max(n,r))*Math.LOG2E}function T(t,e){if(!x.isWebGL2)return t;if(6403===t){if(5126===e)return 33326;if(5131===e)return 33325;if(5121===e)return 33321}if(6407===t){if(5126===e)return 34837;if(5131===e)return 34843;if(5121===e)return 32849}if(6408===t){if(5126===e)return 34836;if(5131===e)return 34842;if(5121===e)return 32856}return t}function a(t){return t===Ht||t===kt||t===Vt?9728:9729}function A(t){var e=t.target;e.removeEventListener("dispose",A),function(t){var e=y.get(t);if(t.image&&e.__image__webglTextureCube)g.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)return;g.deleteTexture(e.__webglTexture)}y.remove(t)}(e),e.isVideoTexture&&delete s[e.id],w.memory.textures--}function o(t){var e=t.target;e.removeEventListener("dispose",o),function(t){var e=y.get(t),n=y.get(t.texture);if(!t)return;void 0!==n.__webglTexture&&g.deleteTexture(n.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var r=0;r<6;r++)g.deleteFramebuffer(e.__webglFramebuffer[r]),e.__webglDepthbuffer&&g.deleteRenderbuffer(e.__webglDepthbuffer[r]);else g.deleteFramebuffer(e.__webglFramebuffer),e.__webglDepthbuffer&&g.deleteRenderbuffer(e.__webglDepthbuffer);y.remove(t.texture),y.remove(t)}(e),w.memory.textures--}function c(t,e){var n,r,i,a=y.get(t);if(t.isVideoTexture&&(r=(n=t).id,i=w.render.frame,s[r]!==i&&(s[r]=i,n.update())),0<t.version&&a.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void u(a,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}v.activeTexture(33984+e),v.bindTexture(3553,a.__webglTexture)}function L(t,e,n){var r;if(n?(g.texParameteri(t,10242,b.convert(e.wrapS)),g.texParameteri(t,10243,b.convert(e.wrapT)),g.texParameteri(t,10240,b.convert(e.magFilter)),g.texParameteri(t,10241,b.convert(e.minFilter))):(g.texParameteri(t,10242,33071),g.texParameteri(t,10243,33071),e.wrapS===Gt&&e.wrapT===Gt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),g.texParameteri(t,10240,a(e.magFilter)),g.texParameteri(t,10241,a(e.minFilter)),e.minFilter!==Ht&&e.minFilter!==jt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),r=i.get("EXT_texture_filter_anisotropic")){if(e.type===$t&&null===i.get("OES_texture_float_linear"))return;if(e.type===te&&null===(x.isWebGL2||i.get("OES_texture_half_float_linear")))return;(1<e.anisotropy||y.get(e).__currentAnisotropy)&&(g.texParameterf(t,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,x.getMaxAnisotropy())),y.get(e).__currentAnisotropy=e.anisotropy)}}function u(t,e,n){var r;r=e.isDataTexture3D?32879:3553,void 0===t.__webglInit&&(t.__webglInit=!0,e.addEventListener("dispose",A),t.__webglTexture=g.createTexture(),w.memory.textures++),v.activeTexture(33984+n),v.bindTexture(r,t.__webglTexture),g.pixelStorei(37440,e.flipY),g.pixelStorei(37441,e.premultiplyAlpha),g.pixelStorei(3317,e.unpackAlignment);var i,a,o=_(e.image,x.maxTextureSize);a=e,x.isWebGL2||a.wrapS===Gt&&a.wrapT===Gt&&(a.minFilter===Ht||a.minFilter===jt)||!1!==M(o)||(o=(i=o)instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof ImageBitmap?(void 0===m&&(m=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),m.width=cn.floorPowerOfTwo(i.width),m.height=cn.floorPowerOfTwo(i.height),m.getContext("2d").drawImage(i,0,0,m.width,m.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+i.width+"x"+i.height+"). Resized to "+m.width+"x"+m.height),m):i);var s=M(o),c=b.convert(e.format),u=b.convert(e.type),h=T(c,u);L(r,e,s);var l,d=e.mipmaps;if(e.isDepthTexture){if(h=6402,e.type===$t){if(!x.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");h=36012}else x.isWebGL2&&(h=33189);e.format===le&&6402===h&&e.type!==Zt&&e.type!==Kt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),e.type=Zt,u=b.convert(e.type)),e.format===de&&(h=34041,e.type!==ie&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),e.type=ie,u=b.convert(e.type))),v.texImage2D(3553,0,h,o.width,o.height,0,c,u,null)}else if(e.isDataTexture)if(0<d.length&&s){for(var p=0,f=d.length;p<f;p++)l=d[p],v.texImage2D(3553,p,h,l.width,l.height,0,c,u,l.data);e.generateMipmaps=!1,t.__maxMipLevel=d.length-1}else v.texImage2D(3553,0,h,o.width,o.height,0,c,u,o.data),t.__maxMipLevel=0;else if(e.isCompressedTexture){for(p=0,f=d.length;p<f;p++)l=d[p],e.format!==se&&e.format!==oe?-1<v.getCompressedTextureFormats().indexOf(c)?v.compressedTexImage2D(3553,p,h,l.width,l.height,0,l.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):v.texImage2D(3553,p,h,l.width,l.height,0,c,u,l.data);t.__maxMipLevel=d.length-1}else if(e.isDataTexture3D)v.texImage3D(32879,0,h,o.width,o.height,o.depth,0,c,u,o.data),t.__maxMipLevel=0;else if(0<d.length&&s){for(p=0,f=d.length;p<f;p++)l=d[p],v.texImage2D(3553,p,h,c,u,l);e.generateMipmaps=!1,t.__maxMipLevel=d.length-1}else v.texImage2D(3553,0,h,c,u,o),t.__maxMipLevel=0;E(e,s)&&S(3553,e,o.width,o.height),t.__version=e.version,e.onUpdate&&e.onUpdate(e)}function h(t,e,n,r){var i=b.convert(e.texture.format),a=b.convert(e.texture.type),o=T(i,a);v.texImage2D(r,0,o,e.width,e.height,0,i,a,null),g.bindFramebuffer(36160,t),g.framebufferTexture2D(36160,n,r,y.get(e.texture).__webglTexture,0),g.bindFramebuffer(36160,null)}function l(t,e){g.bindRenderbuffer(36161,t),e.depthBuffer&&!e.stencilBuffer?(g.renderbufferStorage(36161,33189,e.width,e.height),g.framebufferRenderbuffer(36160,36096,36161,t)):e.depthBuffer&&e.stencilBuffer?(g.renderbufferStorage(36161,34041,e.width,e.height),g.framebufferRenderbuffer(36160,33306,36161,t)):g.renderbufferStorage(36161,32854,e.width,e.height),g.bindRenderbuffer(36161,null)}function d(t){var e=y.get(t),n=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,e){if(e&&e.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(g.bindFramebuffer(36160,t),!e.depthTexture||!e.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");y.get(e.depthTexture).__webglTexture&&e.depthTexture.image.width===e.width&&e.depthTexture.image.height===e.height||(e.depthTexture.image.width=e.width,e.depthTexture.image.height=e.height,e.depthTexture.needsUpdate=!0),c(e.depthTexture,0);var n=y.get(e.depthTexture).__webglTexture;if(e.depthTexture.format===le)g.framebufferTexture2D(36160,36096,3553,n,0);else{if(e.depthTexture.format!==de)throw new Error("Unknown depthTexture format");g.framebufferTexture2D(36160,33306,3553,n,0)}}(e.__webglFramebuffer,t)}else if(n){e.__webglDepthbuffer=[];for(var r=0;r<6;r++)g.bindFramebuffer(36160,e.__webglFramebuffer[r]),e.__webglDepthbuffer[r]=g.createRenderbuffer(),l(e.__webglDepthbuffer[r],t)}else g.bindFramebuffer(36160,e.__webglFramebuffer),e.__webglDepthbuffer=g.createRenderbuffer(),l(e.__webglDepthbuffer,t);g.bindFramebuffer(36160,null)}this.setTexture2D=c,this.setTexture3D=function(t,e){var n=y.get(t);0<t.version&&n.__version!==t.version?u(n,t,e):(v.activeTexture(33984+e),v.bindTexture(32879,n.__webglTexture))},this.setTextureCube=function(t,e){var n=y.get(t);if(6===t.image.length)if(0<t.version&&n.__version!==t.version){n.__image__webglTextureCube||(t.addEventListener("dispose",A),n.__image__webglTextureCube=g.createTexture(),w.memory.textures++),v.activeTexture(33984+e),v.bindTexture(34067,n.__image__webglTextureCube),g.pixelStorei(37440,t.flipY);for(var r=t&&t.isCompressedTexture,i=t.image[0]&&t.image[0].isDataTexture,a=[],o=0;o<6;o++)a[o]=r||i?i?t.image[o].image:t.image[o]:_(t.image[o],x.maxCubemapSize);var s=a[0],c=M(s),u=b.convert(t.format),h=b.convert(t.type),l=T(u,h);L(34067,t,c);for(o=0;o<6;o++)if(r)for(var d,p=a[o].mipmaps,f=0,m=p.length;f<m;f++)d=p[f],t.format!==se&&t.format!==oe?-1<v.getCompressedTextureFormats().indexOf(u)?v.compressedTexImage2D(34069+o,f,l,d.width,d.height,0,d.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):v.texImage2D(34069+o,f,l,d.width,d.height,0,u,h,d.data);else i?v.texImage2D(34069+o,0,l,a[o].width,a[o].height,0,u,h,a[o].data):v.texImage2D(34069+o,0,l,u,h,a[o]);n.__maxMipLevel=r?p.length-1:0,E(t,c)&&S(34067,t,s.width,s.height),n.__version=t.version,t.onUpdate&&t.onUpdate(t)}else v.activeTexture(33984+e),v.bindTexture(34067,n.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,e){v.activeTexture(33984+e),v.bindTexture(34067,y.get(t).__webglTexture)},this.setupRenderTarget=function(t){var e=y.get(t),n=y.get(t.texture);t.addEventListener("dispose",o),n.__webglTexture=g.createTexture(),w.memory.textures++;var r=!0===t.isWebGLRenderTargetCube,i=M(t);if(r){e.__webglFramebuffer=[];for(var a=0;a<6;a++)e.__webglFramebuffer[a]=g.createFramebuffer()}else e.__webglFramebuffer=g.createFramebuffer();if(r){v.bindTexture(34067,n.__webglTexture),L(34067,t.texture,i);for(a=0;a<6;a++)h(e.__webglFramebuffer[a],t,36064,34069+a);E(t.texture,i)&&S(34067,t.texture,t.width,t.height),v.bindTexture(34067,null)}else v.bindTexture(3553,n.__webglTexture),L(3553,t.texture,i),h(e.__webglFramebuffer,t,36064,3553),E(t.texture,i)&&S(3553,t.texture,t.width,t.height),v.bindTexture(3553,null);t.depthBuffer&&d(t)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(E(e,M(t))){var n=t.isWebGLRenderTargetCube?34067:3553,r=y.get(e).__webglTexture;v.bindTexture(n,r),S(n,e,t.width,t.height),v.bindTexture(n,null)}}}function Qo(t,n,r){return{convert:function(t){var e;if(t===Ut)return 10497;if(t===Gt)return 33071;if(t===Ft)return 33648;if(t===Ht)return 9728;if(t===kt)return 9984;if(t===Vt)return 9986;if(t===jt)return 9729;if(t===Wt)return 9985;if(t===qt)return 9987;if(t===Xt)return 5121;if(t===ee)return 32819;if(t===ne)return 32820;if(t===re)return 33635;if(t===Yt)return 5120;if(t===Jt)return 5122;if(t===Zt)return 5123;if(t===Qt)return 5124;if(t===Kt)return 5125;if(t===$t)return 5126;if(t===te){if(r.isWebGL2)return 5131;if(null!==(e=n.get("OES_texture_half_float")))return e.HALF_FLOAT_OES}if(t===ae)return 6406;if(t===oe)return 6407;if(t===se)return 6408;if(t===ce)return 6409;if(t===ue)return 6410;if(t===le)return 6402;if(t===de)return 34041;if(t===pe)return 6403;if(t===nt)return 32774;if(t===z)return 32778;if(t===U)return 32779;if(t===V)return 0;if(t===j)return 1;if(t===W)return 768;if(t===rt)return 769;if(t===it)return 770;if(t===at)return 771;if(t===ot)return 772;if(t===st)return 773;if(t===ct)return 774;if(t===ut)return 775;if(t===ht)return 776;if((t===fe||t===me||t===ge||t===ve)&&null!==(e=n.get("WEBGL_compressed_texture_s3tc"))){if(t===fe)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===me)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===ge)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===ve)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===ye||t===xe||t===be||t===we)&&null!==(e=n.get("WEBGL_compressed_texture_pvrtc"))){if(t===ye)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===xe)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===be)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===we)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===_e&&null!==(e=n.get("WEBGL_compressed_texture_etc1")))return e.COMPRESSED_RGB_ETC1_WEBGL;if((t===Me||t===Ee||t===Se||t===Te||t===Ae||t===Le||t===Pe||t===Ce||t===Re||t===Oe||t===Ie||t===De||t===Be||t===Ne)&&null!==(e=n.get("WEBGL_compressed_texture_astc")))return t;if(t===H||t===k){if(r.isWebGL2){if(t===H)return 32775;if(t===k)return 32776}if(null!==(e=n.get("EXT_blend_minmax"))){if(t===H)return e.MIN_EXT;if(t===k)return e.MAX_EXT}}if(t===ie){if(r.isWebGL2)return 34042;if(null!==(e=n.get("WEBGL_depth_texture")))return e.UNSIGNED_INT_24_8_WEBGL}return 0}}}function Ko(){Vr.call(this),this.type="Group"}function $o(){Vr.call(this),this.type="Camera",this.matrixWorldInverse=new hn,this.projectionMatrix=new hn,this.projectionMatrixInverse=new hn}function ts(t,e,n,r){$o.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function es(t){ts.call(this),this.cameras=t||[]}((qo.prototype=Object.create(pa.prototype)).constructor=qo).prototype.isMeshDepthMaterial=!0,qo.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((Xo.prototype=Object.create(pa.prototype)).constructor=Xo).prototype.isMeshDistanceMaterial=!0,Xo.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Ko.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Ko,isGroup:!0}),$o.prototype=Object.assign(Object.create(Vr.prototype),{constructor:$o,isCamera:!0,copy:function(t,e){return Vr.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new dn),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Vr.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),ts.prototype=Object.assign(Object.create($o.prototype),{constructor:ts,isPerspectiveCamera:!0,copy:function(t,e){return $o.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*cn.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*cn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*cn.RAD2DEG*Math.atan(Math.tan(.5*cn.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,r,i,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*cn.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,e-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(i+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Vr.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),es.prototype=Object.assign(Object.create(ts.prototype),{constructor:es,isArrayCamera:!0});var ns,rs,is,as,os,ss,cs,us,hs,ls,ds,ps,fs,ms,gs,vs,ys,xs,bs,ws,_s,Ms,Es,Ss,Ts,As,Ls,Ps,Cs=new dn,Rs=new dn;function Os(t,e,n){Cs.setFromMatrixPosition(e.matrixWorld),Rs.setFromMatrixPosition(n.matrixWorld);var r=Cs.distanceTo(Rs),i=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],u=(i[9]-1)/i[5],h=(i[8]-1)/i[0],l=(a[8]+1)/a[0],d=o*h,p=o*l,f=r/(l-h),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=o+f,v=s+f,y=d-m,x=r-m+p,b=c*s/v*g,w=u*s/v*g;t.projectionMatrix.makePerspective(y,x,b,w,g,v)}function Is(r){var i=this,c=null,u=null,h=null,l=[],d=new hn,p=new hn,a=1,f="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(u=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",t,!1));var m=new hn,g=new ln,v=new dn,y=new ts;y.bounds=new Xn(0,0,.5,1),y.layers.enable(1);var x=new ts;x.bounds=new Xn(.5,0,.5,1),x.layers.enable(2);var o,s,b=new es([y,x]);function w(){return null!==c&&!0===c.isPresenting}function t(){if(w()){var t=c.getEyeParameters("left"),e=t.renderWidth*a,n=t.renderHeight*a;s=r.getPixelRatio(),o=r.getSize(),r.setDrawingBufferSize(2*e,n,1),E.start()}else i.enabled&&r.setDrawingBufferSize(o.width,o.height,s),E.stop()}b.layers.enable(1),b.layers.enable(2);var _=[];function M(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),n=0,r=0,i=e.length;n<i;n++){var a=e[n];if(a&&("Daydream Controller"===a.id||"Gear VR Controller"===a.id||"Oculus Go Controller"===a.id||"OpenVR Gamepad"===a.id||a.id.startsWith("Oculus Touch")||a.id.startsWith("Spatial Controller"))){if(r===t)return a;r++}}}this.enabled=!1,this.getController=function(t){var e=l[t];return void 0===e&&((e=new Ko).matrixAutoUpdate=!1,e.visible=!1,l[t]=e),e},this.getDevice=function(){return c},this.setDevice=function(t){void 0!==t&&(c=t),E.setContext(t)},this.setFramebufferScaleFactor=function(t){a=t},this.setFrameOfReferenceType=function(t){f=t},this.setPoseTarget=function(t){void 0!==t&&(h=t)},this.getCamera=function(t){var e="stage"===f?1.6:0;if(null===c)return t.position.set(0,e,0),t;if(c.depthNear=t.near,c.depthFar=t.far,c.getFrameData(u),"stage"===f){var n=c.stageParameters;n?d.fromArray(n.sittingToStandingTransform):d.makeTranslation(0,e,0)}var r=u.pose,i=null!==h?h:t;if(i.matrix.copy(d),i.matrix.decompose(i.position,i.quaternion,i.scale),null!==r.orientation&&(g.fromArray(r.orientation),i.quaternion.multiply(g)),null!==r.position&&(g.setFromRotationMatrix(d),v.fromArray(r.position),v.applyQuaternion(g),i.position.add(v)),i.updateMatrixWorld(),!1===c.isPresenting)return t;y.near=t.near,x.near=t.near,y.far=t.far,x.far=t.far,y.matrixWorldInverse.fromArray(u.leftViewMatrix),x.matrixWorldInverse.fromArray(u.rightViewMatrix),p.getInverse(d),"stage"===f&&(y.matrixWorldInverse.multiply(p),x.matrixWorldInverse.multiply(p));var a=i.parent;null!==a&&(m.getInverse(a.matrixWorld),y.matrixWorldInverse.multiply(m),x.matrixWorldInverse.multiply(m)),y.matrixWorld.getInverse(y.matrixWorldInverse),x.matrixWorld.getInverse(x.matrixWorldInverse),y.projectionMatrix.fromArray(u.leftProjectionMatrix),x.projectionMatrix.fromArray(u.rightProjectionMatrix),Os(b,y,x);var o=c.getLayers();if(o.length){var s=o[0];null!==s.leftBounds&&4===s.leftBounds.length&&y.bounds.fromArray(s.leftBounds),null!==s.rightBounds&&4===s.rightBounds.length&&x.bounds.fromArray(s.rightBounds)}return function(){for(var t=0;t<l.length;t++){var e=l[t],n=M(t);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var r=n.pose;!1===r.hasPosition&&e.position.set(.2,-.6,-.05),null!==r.position&&e.position.fromArray(r.position),null!==r.orientation&&e.quaternion.fromArray(r.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(d),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;var i="Daydream Controller"===n.id?0:1;_[t]!==n.buttons[i].pressed&&(_[t]=n.buttons[i].pressed,!0===_[t]?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}(),b},this.getStandingMatrix=function(){return d},this.isPresenting=w;var E=new xr;this.setAnimationLoop=function(t){E.setAnimationLoop(t)},this.submitFrame=function(){w()&&c.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",t)}}function Ds(e){var n=e.context,r=null,d=null,i=1,p=null,a="stage",f=null,m=[],g=[];function o(){return null!==d&&null!==p}var s=new ts;s.layers.enable(1),s.viewport=new Xn;var c=new ts;c.layers.enable(2),c.viewport=new Xn;var v=new es([s,c]);function u(t){var e=m[g.indexOf(t.inputSource)];e&&e.dispatchEvent({type:t.type})}function h(){e.setFramebuffer(null),x.stop()}function l(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}v.layers.enable(1),v.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=m[t];return void 0===e&&((e=new Ko).matrixAutoUpdate=!1,e.visible=!1,m[t]=e),e},this.getDevice=function(){return r},this.setDevice=function(t){void 0!==t&&(r=t),t instanceof XRDevice&&n.setCompatibleXRDevice(t)},this.setFramebufferScaleFactor=function(t){i=t},this.setFrameOfReferenceType=function(t){a=t},this.setSession=function(t){null!==(d=t)&&(d.addEventListener("select",u),d.addEventListener("selectstart",u),d.addEventListener("selectend",u),d.addEventListener("end",h),d.baseLayer=new XRWebGLLayer(d,n,{framebufferScaleFactor:i}),d.requestFrameOfReference(a).then(function(t){p=t,e.setFramebuffer(d.baseLayer.framebuffer),x.setContext(d),x.start()}),g=d.getInputSources(),d.addEventListener("inputsourceschange",function(){g=d.getInputSources(),console.log(g);for(var t=0;t<m.length;t++){m[t].userData.inputSource=g[t]}}))},this.getCamera=function(t){if(o()){var e=t.parent,n=v.cameras;l(v,e);for(var r=0;r<n.length;r++)l(n[r],e);t.matrixWorld.copy(v.matrixWorld);for(var i=t.children,a=(r=0,i.length);r<a;r++)i[r].updateMatrixWorld(!0);return Os(v,s,c),v}return t},this.isPresenting=o;var y=null;var x=new xr;x.setAnimationLoop(function(t,e){if(null!==(f=e.getDevicePose(p)))for(var n=d.baseLayer,r=e.views,i=0;i<r.length;i++){var a=r[i],o=n.getViewport(a),s=f.getViewMatrix(a),c=v.cameras[i];c.matrix.fromArray(s).getInverse(c.matrix),c.projectionMatrix.fromArray(a.projectionMatrix),c.viewport.set(o.x,o.y,o.width,o.height),0===i&&v.matrix.copy(c.matrix)}for(i=0;i<m.length;i++){var u=m[i],h=g[i];if(h){var l=e.getInputPose(h,p);if(null!==l){"targetRay"in l?u.matrix.elements=l.targetRay.transformMatrix:"pointerMatrix"in l&&(u.matrix.elements=l.pointerMatrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.visible=!0;continue}}u.visible=!1}y&&y(t)}),this.setAnimationLoop=function(t){y=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new THREE.Matrix4},this.submitFrame=function(){}}function Bs(t){console.log("THREE.WebGLRenderer",_t);var r=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),e=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,i=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,c=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",p=null,H=null;this.domElement=r,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=St,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var k,M,V,j,h,W,l,E,S,f,y,d,m,g,T,A,L,v,q=this,x=!1,b=null,w=null,_=null,X=-1,P={geometry:null,program:null,wireframe:!1},Y=null,C=null,R=new Xn,O=new Xn,I=null,J=0,D=r.width,Z=r.height,Q=1,B=new Xn(0,0,D,Z),N=new Xn(0,0,D,Z),z=!1,U=new nr,K=new Ea,$=!1,tt=!1,G=new hn,et=new dn;function F(){return null===w?Q:1}try{var nt={alpha:n,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:u};if(r.addEventListener("webglcontextlost",ot,!1),r.addEventListener("webglcontextrestored",st,!1),null===(k=e||r.getContext("webgl",nt)||r.getContext("experimental-webgl",nt)))throw null!==r.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===k.getShaderPrecisionFormat&&(k.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){console.error("THREE.WebGLRenderer: "+t.message)}function rt(){M=new Sa(k),(V=new Ma(k,M,t)).isWebGL2||(M.get("WEBGL_depth_texture"),M.get("OES_texture_float"),M.get("OES_texture_half_float"),M.get("OES_texture_half_float_linear"),M.get("OES_standard_derivatives"),M.get("OES_element_index_uint"),M.get("ANGLE_instanced_arrays")),M.get("OES_texture_float_linear"),v=new Qo(0,M,V),(j=new Jo(k,M,v,V)).scissor(O.copy(N).multiplyScalar(Q)),j.viewport(R.copy(B).multiplyScalar(Q)),h=new La,W=new No,l=new Zo(k,M,j,W,V,v,h),E=new br(k),S=new Ta(0,E,h),f=new Ra(S,h),T=new Ca(k),y=new Bo(q,M,V),d=new Fo,m=new Wo,g=new wa(q,j,f,s),A=new _a(k,M,h,V),L=new Aa(k,M,h,V),h.programs=y.programs,q.context=k,q.capabilities=V,q.extensions=M,q.properties=W,q.renderLists=d,q.state=j,q.info=h}rt();var it=null;"undefined"!=typeof navigator&&(it=new("xr"in navigator?Ds:Is)(q)),this.vr=it;var at=new Yo(q,f,V.maxTextureSize);function ot(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function st(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1,rt()}function ct(t){var e,n=t.target;n.removeEventListener("dispose",ct),ut(e=n),W.remove(e)}function ut(t){var e=W.get(t).program;(t.program=void 0)!==e&&y.releaseProgram(e)}this.shadowMap=at,this.getContext=function(){return k},this.getContextAttributes=function(){return k.getContextAttributes()},this.forceContextLoss=function(){var t=M.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=M.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(t){void 0!==t&&(Q=t,this.setSize(D,Z,!1))},this.getSize=function(){return{width:D,height:Z}},this.setSize=function(t,e,n){it.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(D=t,Z=e,r.width=t*Q,r.height=e*Q,!1!==n&&(r.style.width=t+"px",r.style.height=e+"px"),this.setViewport(0,0,t,e))},this.getDrawingBufferSize=function(){return{width:D*Q,height:Z*Q}},this.setDrawingBufferSize=function(t,e,n){D=t,Z=e,Q=n,r.width=t*n,r.height=e*n,this.setViewport(0,0,t,e)},this.getCurrentViewport=function(){return R},this.setViewport=function(t,e,n,r){B.set(t,Z-e-r,n,r),j.viewport(R.copy(B).multiplyScalar(Q))},this.setScissor=function(t,e,n,r){N.set(t,Z-e-r,n,r),j.scissor(O.copy(N).multiplyScalar(Q))},this.setScissorTest=function(t){j.setScissorTest(z=t)},this.getClearColor=function(){return g.getClearColor()},this.setClearColor=function(){g.setClearColor.apply(g,arguments)},this.getClearAlpha=function(){return g.getClearAlpha()},this.setClearAlpha=function(){g.setClearAlpha.apply(g,arguments)},this.clear=function(t,e,n){var r=0;void 0!==t&&!t||(r|=16384),void 0!==e&&!e||(r|=256),void 0!==n&&!n||(r|=1024),k.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(){r.removeEventListener("webglcontextlost",ot,!1),r.removeEventListener("webglcontextrestored",st,!1),d.dispose(),m.dispose(),W.dispose(),f.dispose(),it.dispose(),ft.stop()},this.renderBufferImmediate=function(t,e){j.initAttributes();var n=W.get(t);t.hasPositions&&!n.position&&(n.position=k.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=k.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=k.createBuffer()),t.hasColors&&!n.color&&(n.color=k.createBuffer());var r=e.getAttributes();t.hasPositions&&(k.bindBuffer(34962,n.position),k.bufferData(34962,t.positionArray,35048),j.enableAttribute(r.position),k.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(k.bindBuffer(34962,n.normal),k.bufferData(34962,t.normalArray,35048),j.enableAttribute(r.normal),k.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(k.bindBuffer(34962,n.uv),k.bufferData(34962,t.uvArray,35048),j.enableAttribute(r.uv),k.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(k.bindBuffer(34962,n.color),k.bufferData(34962,t.colorArray,35048),j.enableAttribute(r.color),k.vertexAttribPointer(r.color,3,5126,!1,0,0)),j.disableUnusedAttributes(),k.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,r,i,a){var o=i.isMesh&&i.normalMatrix.determinant()<0;j.setMaterial(r,o);var s=yt(t,e,r,i),c=!1;P.geometry===n.id&&P.program===s.id&&P.wireframe===(!0===r.wireframe)||(P.geometry=n.id,P.program=s.id,P.wireframe=!0===r.wireframe,c=!0),i.morphTargetInfluences&&(T.update(i,n,r,s),c=!0);var u,h=n.index,l=n.attributes.position,d=1;!0===r.wireframe&&(h=S.getWireframeAttribute(n),d=2);var p=A;null!==h&&(u=E.get(h),(p=L).setIndex(u)),c&&(function(t,e,n){if(n&&n.isInstancedBufferGeometry&!V.isWebGL2&&null===M.get("ANGLE_instanced_arrays"))return console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");j.initAttributes();var r=n.attributes,i=e.getAttributes(),a=t.defaultAttributeValues;for(var o in i){var s=i[o];if(0<=s){var c=r[o];if(void 0!==c){var u=c.normalized,h=c.itemSize,l=E.get(c);if(void 0===l)continue;var d=l.buffer,p=l.type,f=l.bytesPerElement;if(c.isInterleavedBufferAttribute){var m=c.data,g=m.stride,v=c.offset;m&&m.isInstancedInterleavedBuffer?(j.enableAttributeAndDivisor(s,m.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=m.meshPerAttribute*m.count)):j.enableAttribute(s),k.bindBuffer(34962,d),k.vertexAttribPointer(s,h,p,u,g*f,v*f)}else c.isInstancedBufferAttribute?(j.enableAttributeAndDivisor(s,c.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=c.meshPerAttribute*c.count)):j.enableAttribute(s),k.bindBuffer(34962,d),k.vertexAttribPointer(s,h,p,u,0,0)}else if(void 0!==a){var y=a[o];if(void 0!==y)switch(y.length){case 2:k.vertexAttrib2fv(s,y);break;case 3:k.vertexAttrib3fv(s,y);break;case 4:k.vertexAttrib4fv(s,y);break;default:k.vertexAttrib1fv(s,y)}}}}j.disableUnusedAttributes()}(r,s,n),null!==h&&k.bindBuffer(34963,u.buffer));var f=1/0;null!==h?f=h.count:void 0!==l&&(f=l.count);var m=n.drawRange.start*d,g=n.drawRange.count*d,v=null!==a?a.start*d:0,y=null!==a?a.count*d:1/0,x=Math.max(m,v),b=Math.min(f,m+g,v+y)-1,w=Math.max(0,b-x+1);if(0!==w){if(i.isMesh)if(!0===r.wireframe)j.setLineWidth(r.wireframeLinewidth*F()),p.setMode(1);else switch(i.drawMode){case qe:p.setMode(4);break;case Xe:p.setMode(5);break;case Ye:p.setMode(6)}else if(i.isLine){var _=r.linewidth;void 0===_&&(_=1),j.setLineWidth(_*F()),i.isLineSegments?p.setMode(1):i.isLineLoop?p.setMode(2):p.setMode(3)}else i.isPoints?p.setMode(0):i.isSprite&&p.setMode(4);n&&n.isInstancedBufferGeometry?0<n.maxInstancedCount&&p.renderInstances(n,x,w):p.render(x,w)}},this.compile=function(n,t){(H=m.get(n,t)).init(),n.traverse(function(t){t.isLight&&(H.pushLight(t),t.castShadow&&H.pushShadow(t))}),H.setupLights(t),n.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var e=0;e<t.material.length;e++)vt(t.material[e],n.fog,t);else vt(t.material,n.fog,t)})};var ht=null;var lt,dt,pt,ft=new xr;function mt(t,e,n,r){for(var i=0,a=t.length;i<a;i++){var o=t[i],s=o.object,c=o.geometry,u=void 0===r?o.material:r,h=o.group;if(n.isArrayCamera)for(var l=(C=n).cameras,d=0,p=l.length;d<p;d++){var f=l[d];if(s.layers.test(f.layers)){if("viewport"in f)j.viewport(R.copy(f.viewport));else{var m=f.bounds,g=m.x*D,v=m.y*Z,y=m.z*D,x=m.w*Z;j.viewport(R.set(g,v,y,x).multiplyScalar(Q))}H.setupLights(f),gt(s,e,f,c,u,h)}}else C=null,gt(s,e,n,c,u,h)}}function gt(t,e,n,r,i,a){if(t.onBeforeRender(q,e,n,r,i,a),H=m.get(e,C||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){j.setMaterial(i);var o=yt(n,e.fog,i,t);P.geometry=null,P.program=null,P.wireframe=!1,s=o,t.render(function(t){q.renderBufferImmediate(t,s)})}else q.renderBufferDirect(n,e.fog,r,i,t,a);var s;t.onAfterRender(q,e,n,r,i,a),H=m.get(e,C||n)}function vt(t,e,n){var r=W.get(t),i=H.state.lights,a=H.state.shadowsArray,o=r.lightsHash,s=i.state.hash,c=y.getParameters(t,i.state,a,e,K.numPlanes,K.numIntersection,n),u=y.getProgramCode(t,c),h=r.program,l=!0;if(void 0===h)t.addEventListener("dispose",ct);else if(h.code!==u)ut(t);else if(o.stateID!==s.stateID||o.directionalLength!==s.directionalLength||o.pointLength!==s.pointLength||o.spotLength!==s.spotLength||o.rectAreaLength!==s.rectAreaLength||o.hemiLength!==s.hemiLength||o.shadowsLength!==s.shadowsLength)o.stateID=s.stateID,o.directionalLength=s.directionalLength,o.pointLength=s.pointLength,o.spotLength=s.spotLength,o.rectAreaLength=s.rectAreaLength,o.hemiLength=s.hemiLength,o.shadowsLength=s.shadowsLength,l=!1;else{if(void 0!==c.shaderID)return;l=!1}if(l){if(c.shaderID){var d=yr[c.shaderID];r.shader={name:t.type,uniforms:ir(d.uniforms),vertexShader:d.vertexShader,fragmentShader:d.fragmentShader}}else r.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(r.shader,q),u=y.getProgramCode(t,c),h=y.acquireProgram(t,r.shader,c,u),r.program=h,t.program=h}var p=h.getAttributes();if(t.morphTargets)for(var f=t.numSupportedMorphTargets=0;f<q.maxMorphTargets;f++)0<=p["morphTarget"+f]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(f=t.numSupportedMorphNormals=0;f<q.maxMorphNormals;f++)0<=p["morphNormal"+f]&&t.numSupportedMorphNormals++;var m=r.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=K.numPlanes,r.numIntersection=K.numIntersection,m.clippingPlanes=K.uniform),r.fog=e,void 0===o&&(r.lightsHash=o={}),o.stateID=s.stateID,o.directionalLength=s.directionalLength,o.pointLength=s.pointLength,o.spotLength=s.spotLength,o.rectAreaLength=s.rectAreaLength,o.hemiLength=s.hemiLength,o.shadowsLength=s.shadowsLength,t.lights&&(m.ambientLightColor.value=i.state.ambient,m.directionalLights.value=i.state.directional,m.spotLights.value=i.state.spot,m.rectAreaLights.value=i.state.rectArea,m.pointLights.value=i.state.point,m.hemisphereLights.value=i.state.hemi,m.directionalShadowMap.value=i.state.directionalShadowMap,m.directionalShadowMatrix.value=i.state.directionalShadowMatrix,m.spotShadowMap.value=i.state.spotShadowMap,m.spotShadowMatrix.value=i.state.spotShadowMatrix,m.pointShadowMap.value=i.state.pointShadowMap,m.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=r.program.getUniforms(),v=Eo.seqWithValue(g.seq,m);r.uniformsList=v}function yt(t,e,n,r){J=0;var i=W.get(n),a=H.state.lights,o=i.lightsHash,s=a.state.hash;if($&&(tt||t!==Y)){var c=t===Y&&n.id===X;K.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,i,c)}!1===n.needsUpdate&&(void 0===i.program||n.fog&&i.fog!==e||n.lights&&(o.stateID!==s.stateID||o.directionalLength!==s.directionalLength||o.pointLength!==s.pointLength||o.spotLength!==s.spotLength||o.rectAreaLength!==s.rectAreaLength||o.hemiLength!==s.hemiLength||o.shadowsLength!==s.shadowsLength)||void 0!==i.numClippingPlanes&&(i.numClippingPlanes!==K.numPlanes||i.numIntersection!==K.numIntersection))&&(n.needsUpdate=!0),n.needsUpdate&&(vt(n,e,r),n.needsUpdate=!1);var u,h,l,d,p,f,m,g,v,y,x,b,w,_,M,E,S,T,A,L,P=!1,C=!1,R=!1,O=i.program,I=O.getUniforms(),D=i.shader.uniforms;if(j.useProgram(O.program)&&(R=C=P=!0),n.id!==X&&(X=n.id,C=!0),P||Y!==t){if(I.setValue(k,"projectionMatrix",t.projectionMatrix),V.logarithmicDepthBuffer&&I.setValue(k,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),Y!==t&&(Y=t,R=C=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var B=I.map.cameraPosition;void 0!==B&&B.setValue(k,et.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&I.setValue(k,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){I.setOptional(k,r,"bindMatrix"),I.setOptional(k,r,"bindMatrixInverse");var N=r.skeleton;if(N){var z=N.bones;if(V.floatVertexTextures){if(void 0===N.boneTexture){var U=Math.sqrt(4*z.length);U=cn.ceilPowerOfTwo(U),U=Math.max(U,4);var G=new Float32Array(U*U*4);G.set(N.boneMatrices);var F=new Zn(G,U,U,se,$t);F.needsUpdate=!0,N.boneMatrices=G,N.boneTexture=F,N.boneTextureSize=U}I.setValue(k,"boneTexture",N.boneTexture),I.setValue(k,"boneTextureSize",N.boneTextureSize)}else I.setOptional(k,N,"boneMatrices")}}return C&&(I.setValue(k,"toneMappingExposure",q.toneMappingExposure),I.setValue(k,"toneMappingWhitePoint",q.toneMappingWhitePoint),n.lights&&(L=R,(A=D).ambientLightColor.needsUpdate=L,A.directionalLights.needsUpdate=L,A.pointLights.needsUpdate=L,A.spotLights.needsUpdate=L,A.rectAreaLights.needsUpdate=L,A.hemisphereLights.needsUpdate=L),e&&n.fog&&(T=e,(S=D).fogColor.value=T.color,T.isFog?(S.fogNear.value=T.near,S.fogFar.value=T.far):T.isFogExp2&&(S.fogDensity.value=T.density)),n.isMeshBasicMaterial?xt(D,n):n.isMeshLambertMaterial?(xt(D,n),M=D,(E=n).emissiveMap&&(M.emissiveMap.value=E.emissiveMap)):n.isMeshPhongMaterial?(xt(D,n),n.isMeshToonMaterial?(bt(w=D,_=n),_.gradientMap&&(w.gradientMap.value=_.gradientMap)):bt(D,n)):n.isMeshStandardMaterial?(xt(D,n),n.isMeshPhysicalMaterial?(wt(x=D,b=n),x.reflectivity.value=b.reflectivity,x.clearCoat.value=b.clearCoat,x.clearCoatRoughness.value=b.clearCoatRoughness):wt(D,n)):n.isMeshMatcapMaterial?(xt(D,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Mt&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Mt&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(D,n)):n.isMeshDepthMaterial?(xt(D,n),v=D,(y=n).displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias)):n.isMeshDistanceMaterial?(xt(D,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(D,n)):n.isMeshNormalMaterial?(xt(D,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Mt&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Mt&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(D,n)):n.isLineBasicMaterial?(g=n,(m=D).diffuse.value=g.color,m.opacity.value=g.opacity,n.isLineDashedMaterial&&(f=n,(p=D).dashSize.value=f.dashSize,p.totalSize.value=f.dashSize+f.gapSize,p.scale.value=f.scale)):n.isPointsMaterial?(d=n,(l=D).diffuse.value=d.color,l.opacity.value=d.opacity,l.size.value=d.size*Q,l.scale.value=.5*Z,l.map.value=d.map,null!==d.map&&(!0===d.map.matrixAutoUpdate&&d.map.updateMatrix(),l.uvTransform.value.copy(d.map.matrix))):n.isSpriteMaterial?(h=n,(u=D).diffuse.value=h.color,u.opacity.value=h.opacity,u.rotation.value=h.rotation,u.map.value=h.map,null!==h.map&&(!0===h.map.matrixAutoUpdate&&h.map.updateMatrix(),u.uvTransform.value.copy(h.map.matrix))):n.isShadowMaterial&&(D.color.value=n.color,D.opacity.value=n.opacity),void 0!==D.ltc_1&&(D.ltc_1.value=vr.LTC_1),void 0!==D.ltc_2&&(D.ltc_2.value=vr.LTC_2),Eo.upload(k,i.uniformsList,D,q)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Eo.upload(k,i.uniformsList,D,q),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&I.setValue(k,"center",r.center),I.setValue(k,"modelViewMatrix",r.modelViewMatrix),I.setValue(k,"normalMatrix",r.normalMatrix),I.setValue(k,"modelMatrix",r.matrixWorld),O}function xt(t,e){var n;t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=W.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function bt(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Mt&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Mt&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function wt(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Mt&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Mt&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}ft.setAnimationLoop(function(t){it.isPresenting()||ht&&ht(t)}),"undefined"!=typeof window&&ft.setContext(window),this.setAnimationLoop=function(t){ht=t,it.setAnimationLoop(t),ft.start()},this.render=function(t,e,n,r){if(e&&e.isCamera){if(!x){P.geometry=null,P.program=null,P.wireframe=!1,X=-1,!(Y=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),it.enabled&&(e=it.getCamera(e)),(H=m.get(t,e)).init(),t.onBeforeRender(q,t,e,n),G.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),U.setFromMatrix(G),tt=this.localClippingEnabled,$=K.init(this.clippingPlanes,tt,e),(p=d.get(t,e)).init(),function t(e,n,r){if(!1===e.visible)return;var i=e.layers.test(n.layers);if(i)if(e.isLight)H.pushLight(e),e.castShadow&&H.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||U.intersectsSprite(e)){r&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);var a=f.update(e),o=e.material;p.push(e,a,o,et.z,null)}}else if(e.isImmediateRenderObject)r&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G),p.push(e,null,e.material,et.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||U.intersectsObject(e))){r&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);var a=f.update(e),o=e.material;if(Array.isArray(o))for(var s=a.groups,c=0,u=s.length;c<u;c++){var h=s[c],l=o[h.materialIndex];l&&l.visible&&p.push(e,a,l,et.z,h)}else o.visible&&p.push(e,a,o,et.z,null)}var d=e.children;for(var c=0,u=d.length;c<u;c++)t(d[c],n,r)}(t,e,q.sortObjects),!0===q.sortObjects&&p.sort(),$&&K.beginShadows();var i=H.state.shadowsArray;at.render(i,t,e),H.setupLights(e),$&&K.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),g.render(p,t,e,r);var a=p.opaque,o=p.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;a.length&&mt(a,t,e,s),o.length&&mt(o,t,e,s)}else a.length&&mt(a,t,e),o.length&&mt(o,t,e);n&&l.updateRenderTargetMipmap(n),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),t.onAfterRender(q,t,e),it.enabled&&it.submitFrame(),H=p=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var t=J;return t>=V.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+V.maxTextures),J+=1,t},this.setTexture2D=(lt=!1,function(t,e){t&&t.isWebGLRenderTarget&&(lt||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),lt=!0),t=t.texture),l.setTexture2D(t,e)}),this.setTexture3D=function(t,e){l.setTexture3D(t,e)},this.setTexture=(dt=!1,function(t,e){dt||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),dt=!0),l.setTexture2D(t,e)}),this.setTextureCube=(pt=!1,function(t,e){t&&t.isWebGLRenderTargetCube&&(pt||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),pt=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?l.setTextureCube(t,e):l.setTextureCubeDynamic(t,e)}),this.setFramebuffer=function(t){b=t},this.getRenderTarget=function(){return w},this.setRenderTarget=function(t){(w=t)&&void 0===W.get(t).__webglFramebuffer&&l.setupRenderTarget(t);var e=b,n=!1;if(t){var r=W.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=r[t.activeCubeFace],n=!0):e=r,R.copy(t.viewport),O.copy(t.scissor),I=t.scissorTest}else R.copy(B).multiplyScalar(Q),O.copy(N).multiplyScalar(Q),I=z;if(_!==e&&(k.bindFramebuffer(36160,e),_=e),j.viewport(R),j.scissor(O),j.setScissorTest(I),n){var i=W.get(t.texture);k.framebufferTexture2D(36160,36064,34069+t.activeCubeFace,i.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,n,r,i,a){if(t&&t.isWebGLRenderTarget){var o=W.get(t).__webglFramebuffer;if(o){var s=!1;o!==_&&(k.bindFramebuffer(36160,o),s=!0);try{var c=t.texture,u=c.format,h=c.type;if(u!==se&&v.convert(u)!==k.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===Xt||v.convert(h)===k.getParameter(35738)||h===$t&&(V.isWebGL2||M.get("OES_texture_float")||M.get("WEBGL_color_buffer_float"))||h===te&&(V.isWebGL2?M.get("EXT_color_buffer_float"):M.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===k.checkFramebufferStatus(36160)?0<=e&&e<=t.width-r&&0<=n&&n<=t.height-i&&k.readPixels(e,n,r,i,v.convert(u),v.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&k.bindFramebuffer(36160,_)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){var r=e.image.width,i=e.image.height,a=v.convert(e.format);this.setTexture2D(e,0),k.copyTexImage2D(3553,n||0,a,t.x,t.y,r,i,0)},this.copyTextureToTexture=function(t,e,n,r){var i=e.image.width,a=e.image.height,o=v.convert(n.format),s=v.convert(n.type);this.setTexture2D(n,0),e.isDataTexture?k.texSubImage2D(3553,r||0,t.x,t.y,i,a,o,s,e.image.data):k.texSubImage2D(3553,r||0,t.x,t.y,o,s,e.image)}}function Ns(t,e){this.name="",this.color=new lr(t),this.density=void 0!==e?e:25e-5}function zs(t,e,n){this.name="",this.color=new lr(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Us(){Vr.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Gs(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Fs(t,e,n,r){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function Hs(t){pa.call(this),this.type="SpriteMaterial",this.color=new lr(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function ks(t){if(Vr.call(this),this.type="Sprite",void 0===ns){ns=new _i;var e=new Gs(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);ns.setIndex([0,1,2,0,2,3]),ns.addAttribute("position",new Fs(e,3,0,!1)),ns.addAttribute("uv",new Fs(e,2,3,!1))}this.geometry=ns,this.material=void 0!==t?t:new Hs,this.center=new un(.5,.5)}function Vs(t,e,n,r,i,a){os.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(ss.x=a*os.x-i*os.y,ss.y=i*os.x+a*os.y):ss.copy(os),t.copy(e),t.x+=ss.x,t.y+=ss.y,t.applyMatrix4(cs)}function js(){Vr.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Ws(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),ya.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new hn,this.bindMatrixInverse=new hn}function qs(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new hn)}}function Xs(){Vr.call(this),this.type="Bone"}function Ys(t){pa.call(this),this.type="LineBasicMaterial",this.color=new lr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function Js(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Vr.call(this),this.type="Line",this.geometry=void 0!==t?t:new _i,this.material=void 0!==e?e:new Ys({color:16777215*Math.random()})}function Zs(t,e){Js.call(this,t,e),this.type="LineSegments"}function Qs(t,e){Js.call(this,t,e),this.type="LineLoop"}function Ks(t){pa.call(this),this.type="PointsMaterial",this.color=new lr(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function $s(t,e){Vr.call(this),this.type="Points",this.geometry=void 0!==t?t:new _i,this.material=void 0!==e?e:new Ks({color:16777215*Math.random()})}function tc(t,e,n,r,i,a,o,s,c){qn.call(this,t,e,n,r,i,a,o,s,c),this.format=void 0!==o?o:oe,this.minFilter=void 0!==a?a:jt,this.magFilter=void 0!==i?i:jt,this.generateMipmaps=!1}function ec(t,e,n,r,i,a,o,s,c,u,h,l){qn.call(this,null,a,o,s,c,u,r,i,h,l),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function nc(t,e,n,r,i,a,o,s,c){qn.call(this,t,e,n,r,i,a,o,s,c),this.needsUpdate=!0}function rc(t,e,n,r,i,a,o,s,c,u){if((u=void 0!==u?u:le)!==le&&u!==de)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===le&&(n=Zt),void 0===n&&u===de&&(n=ie),qn.call(this,null,r,i,a,o,s,u,n,c),this.image={width:t,height:e},this.magFilter=void 0!==o?o:Ht,this.minFilter=void 0!==s?s:Ht,this.flipY=!1,this.generateMipmaps=!1}function ic(t){_i.call(this),this.type="WireframeGeometry";var e,n,r,i,a,o,s,c,u,h,l=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,r=m.length;e<r;e++){var g=m[e];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[u=d[0]+","+d[1]]&&(p[u]={index1:d[0],index2:d[1]})}for(u in p)o=p[u],h=t.vertices[o.index1],l.push(h.x,h.y,h.z),h=t.vertices[o.index2],l.push(h.x,h.y,h.z)}else if(t&&t.isBufferGeometry){var v,y,x,b,w,_;if(h=new dn,null!==t.index){for(v=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),i=0,a=x.length;i<a;++i)for(r=(e=(b=x[i]).start)+b.count;e<r;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),c=y.getX(e+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[u=d[0]+","+d[1]]&&(p[u]={index1:d[0],index2:d[1]});for(u in p)o=p[u],h.fromBufferAttribute(v,o.index1),l.push(h.x,h.y,h.z),h.fromBufferAttribute(v,o.index2),l.push(h.x,h.y,h.z)}else for(e=0,r=(v=t.attributes.position).count/3;e<r;e++)for(n=0;n<3;n++)w=3*e+n,h.fromBufferAttribute(v,w),l.push(h.x,h.y,h.z),_=3*e+(n+1)%3,h.fromBufferAttribute(v,_),l.push(h.x,h.y,h.z)}this.addAttribute("position",new si(l,3))}function ac(t,e,n){Kr.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new oc(t,e,n)),this.mergeVertices()}function oc(t,e,n){_i.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var r,i,a=[],o=[],s=[],c=[],u=new dn,h=new dn,l=new dn,d=new dn,p=new dn;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=e+1;for(r=0;r<=n;r++){var m=r/n;for(i=0;i<=e;i++){var g=i/e;t(g,m,h),o.push(h.x,h.y,h.z),0<=g-1e-5?(t(g-1e-5,m,l),d.subVectors(h,l)):(t(1e-5+g,m,l),d.subVectors(l,h)),0<=m-1e-5?(t(g,m-1e-5,l),p.subVectors(h,l)):(t(g,1e-5+m,l),p.subVectors(l,h)),u.crossVectors(d,p).normalize(),s.push(u.x,u.y,u.z),c.push(g,m)}}for(r=0;r<n;r++)for(i=0;i<e;i++){var v=r*f+i,y=r*f+i+1,x=(r+1)*f+i+1,b=(r+1)*f+i;a.push(v,y,b),a.push(y,x,b)}this.setIndex(a),this.addAttribute("position",new si(o,3)),this.addAttribute("normal",new si(s,3)),this.addAttribute("uv",new si(c,2))}function sc(t,e,n,r){Kr.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},this.fromBufferGeometry(new cc(t,e,n,r)),this.mergeVertices()}function cc(r,a,t,e){_i.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:a,radius:t,detail:e},t=t||1;var h=[],l=[];function o(t,e,n,r){var i,a,o=Math.pow(2,r),s=[];for(i=0;i<=o;i++){s[i]=[];var c=t.clone().lerp(n,i/o),u=e.clone().lerp(n,i/o),h=o-i;for(a=0;a<=h;a++)s[i][a]=0===a&&i===o?c:c.clone().lerp(u,a/h)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var l=Math.floor(a/2);a%2==0?(d(s[i][l+1]),d(s[i+1][l]),d(s[i][l])):(d(s[i][l+1]),d(s[i+1][l+1]),d(s[i+1][l]))}}function d(t){h.push(t.x,t.y,t.z)}function s(t,e){var n=3*t;e.x=r[0+n],e.y=r[1+n],e.z=r[2+n]}function p(t,e,n,r){r<0&&1===t.x&&(l[e]=t.x-1),0===n.x&&0===n.z&&(l[e]=r/2/Math.PI+.5)}function f(t){return Math.atan2(t.z,-t.x)}!function(t){for(var e=new dn,n=new dn,r=new dn,i=0;i<a.length;i+=3)s(a[i+0],e),s(a[i+1],n),s(a[i+2],r),o(e,n,r,t)}(e=e||0),function(t){for(var e=new dn,n=0;n<h.length;n+=3)e.x=h[n+0],e.y=h[n+1],e.z=h[n+2],e.normalize().multiplyScalar(t),h[n+0]=e.x,h[n+1]=e.y,h[n+2]=e.z}(t),function(){for(var t=new dn,e=0;e<h.length;e+=3){t.x=h[e+0],t.y=h[e+1],t.z=h[e+2];var n=f(t)/2/Math.PI+.5,r=(i=t,Math.atan2(-i.y,Math.sqrt(i.x*i.x+i.z*i.z))/Math.PI+.5);l.push(n,1-r)}var i;(function(){for(var t=new dn,e=new dn,n=new dn,r=new dn,i=new un,a=new un,o=new un,s=0,c=0;s<h.length;s+=9,c+=6){t.set(h[s+0],h[s+1],h[s+2]),e.set(h[s+3],h[s+4],h[s+5]),n.set(h[s+6],h[s+7],h[s+8]),i.set(l[c+0],l[c+1]),a.set(l[c+2],l[c+3]),o.set(l[c+4],l[c+5]),r.copy(t).add(e).add(n).divideScalar(3);var u=f(r);p(i,c+0,t,u),p(a,c+2,e,u),p(o,c+4,n,u)}})(),function(){for(var t=0;t<l.length;t+=6){var e=l[t+0],n=l[t+2],r=l[t+4],i=Math.max(e,n,r),a=Math.min(e,n,r);.9<i&&a<.1&&(e<.2&&(l[t+0]+=1),n<.2&&(l[t+2]+=1),r<.2&&(l[t+4]+=1))}}()}(),this.addAttribute("position",new si(h,3)),this.addAttribute("normal",new si(h.slice(),3)),this.addAttribute("uv",new si(l,2)),0===e?this.computeVertexNormals():this.normalizeNormals()}function uc(t,e){Kr.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new hc(t,e)),this.mergeVertices()}function hc(t,e){cc.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function lc(t,e){Kr.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new dc(t,e)),this.mergeVertices()}function dc(t,e){cc.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function pc(t,e){Kr.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new fc(t,e)),this.mergeVertices()}function fc(t,e){var n=(1+Math.sqrt(5))/2;cc.call(this,[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[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],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function mc(t,e){Kr.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new gc(t,e)),this.mergeVertices()}function gc(t,e){var n=(1+Math.sqrt(5))/2,r=1/n;cc.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[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],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function vc(t,e,n,r,i,a){Kr.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new yc(t,e,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function yc(o,s,c,u,t){_i.call(this),this.type="TubeBufferGeometry",this.parameters={path:o,tubularSegments:s,radius:c,radialSegments:u,closed:t},s=s||64,c=c||1,u=u||8,t=t||!1;var h=o.computeFrenetFrames(s,t);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var i,l,d=new dn,p=new dn,e=new un,f=new dn,m=[],g=[],n=[],a=[];function r(t){f=o.getPointAt(t/s,f);var e=h.normals[t],n=h.binormals[t];for(l=0;l<=u;l++){var r=l/u*Math.PI*2,i=Math.sin(r),a=-Math.cos(r);p.x=a*e.x+i*n.x,p.y=a*e.y+i*n.y,p.z=a*e.z+i*n.z,p.normalize(),g.push(p.x,p.y,p.z),d.x=f.x+c*p.x,d.y=f.y+c*p.y,d.z=f.z+c*p.z,m.push(d.x,d.y,d.z)}}!function(){for(i=0;i<s;i++)r(i);r(!1===t?s:0),function(){for(i=0;i<=s;i++)for(l=0;l<=u;l++)e.x=i/s,e.y=l/u,n.push(e.x,e.y)}(),function(){for(l=1;l<=s;l++)for(i=1;i<=u;i++){var t=(u+1)*(l-1)+(i-1),e=(u+1)*l+(i-1),n=(u+1)*l+i,r=(u+1)*(l-1)+i;a.push(t,e,r),a.push(e,n,r)}}()}(),this.setIndex(a),this.addAttribute("position",new si(m,3)),this.addAttribute("normal",new si(g,3)),this.addAttribute("uv",new si(n,2))}function xc(t,e,n,r,i,a,o){Kr.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new bc(t,e,n,r,i,a)),this.mergeVertices()}function bc(t,e,n,r,i,a){_i.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:a},t=t||1,e=e||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,c=[],u=[],h=[],l=[],d=new dn,p=new dn,f=new dn,m=new dn,g=new dn,v=new dn,y=new dn;for(o=0;o<=n;++o){var x=o/n*i*Math.PI*2;for(A(x,i,a,t,f),A(.01+x,i,a,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=r;++s){var b=s/r*Math.PI*2,w=-e*Math.cos(b),_=e*Math.sin(b);d.x=f.x+(w*y.x+_*g.x),d.y=f.y+(w*y.y+_*g.y),d.z=f.z+(w*y.z+_*g.z),u.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),h.push(p.x,p.y,p.z),l.push(o/n),l.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var M=(r+1)*(s-1)+(o-1),E=(r+1)*s+(o-1),S=(r+1)*s+o,T=(r+1)*(s-1)+o;c.push(M,E,T),c.push(E,S,T)}function A(t,e,n,r,i){var a=Math.cos(t),o=Math.sin(t),s=n/e*t,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new si(u,3)),this.addAttribute("normal",new si(h,3)),this.addAttribute("uv",new si(l,2))}function wc(t,e,n,r,i){Kr.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new _c(t,e,n,r,i)),this.mergeVertices()}function _c(t,e,n,r,i){_i.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||1,e=e||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],c=[],u=[],h=[],l=new dn,d=new dn,p=new dn;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var f=o/r*i,m=a/n*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(f),d.y=(t+e*Math.cos(m))*Math.sin(f),d.z=e*Math.sin(m),c.push(d.x,d.y,d.z),l.x=t*Math.cos(f),l.y=t*Math.sin(f),p.subVectors(d,l).normalize(),u.push(p.x,p.y,p.z),h.push(o/r),h.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,v=(r+1)*(a-1)+o-1,y=(r+1)*(a-1)+o,x=(r+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.addAttribute("position",new si(c,3)),this.addAttribute("normal",new si(u,3)),this.addAttribute("uv",new si(h,2))}Ns.prototype.isFogExp2=!0,Ns.prototype.clone=function(){return new Ns(this.color,this.density)},Ns.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},zs.prototype.isFog=!0,zs.prototype.clone=function(){return new zs(this.color,this.near,this.far)},zs.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Us.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Us,copy:function(t,e){return Vr.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Vr.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}),Object.defineProperty(Gs.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Gs.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(Fs.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Fs.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}}),((Hs.prototype=Object.create(pa.prototype)).constructor=Hs).prototype.isSpriteMaterial=!0,Hs.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},ks.prototype=Object.assign(Object.create(Vr.prototype),{constructor:ks,isSprite:!0,raycast:(rs=new dn,is=new dn,as=new dn,os=new un,ss=new un,cs=new hn,us=new dn,hs=new dn,ls=new dn,ds=new un,ps=new un,fs=new un,function(t,e){is.setFromMatrixScale(this.matrixWorld),cs.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),as.setFromMatrixPosition(this.modelViewMatrix);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;Vs(us.set(-.5,-.5,0),as,a,is,n,r),Vs(hs.set(.5,-.5,0),as,a,is,n,r),Vs(ls.set(.5,.5,0),as,a,is,n,r),ds.set(0,0),ps.set(1,0),fs.set(1,1);var o=t.ray.intersectTriangle(us,hs,ls,!1,rs);if(null!==o||(Vs(hs.set(-.5,.5,0),as,a,is,n,r),ps.set(0,1),null!==(o=t.ray.intersectTriangle(us,ls,hs,!1,rs)))){var s=t.ray.origin.distanceTo(rs);s<t.near||s>t.far||e.push({distance:s,point:rs.clone(),uv:ga.getUV(rs,us,hs,ls,ds,ps,fs,new un),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Vr.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),js.prototype=Object.assign(Object.create(Vr.prototype),{constructor:js,copy:function(t){Vr.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n<r;n++){var i=e[n];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,r=0;r<n.length&&!(e<n[r].distance);r++);n.splice(r,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object},raycast:(vs=new dn,function(t,e){vs.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(vs);this.getObjectForDistance(n).raycast(t,e)}),update:(ms=new dn,gs=new dn,function(t){var e=this.levels;if(1<e.length){ms.setFromMatrixPosition(t.matrixWorld),gs.setFromMatrixPosition(this.matrixWorld);var n=ms.distanceTo(gs);e[0].object.visible=!0;for(var r=1,i=e.length;r<i&&n>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(;r<i;r++)e[r].object.visible=!1}}),toJSON:function(t){var e=Vr.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),Ws.prototype=Object.assign(Object.create(ya.prototype),{constructor:Ws,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new Xn,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!=1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){ya.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Object.assign(qs.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new hn;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:(ys=new hn,xs=new hn,function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=t.length;i<a;i++){var o=t[i]?t[i].matrixWorld:xs;ys.multiplyMatrices(o,e[i]),ys.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new qs(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}}}),Xs.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Xs,isBone:!0}),((Ys.prototype=Object.create(pa.prototype)).constructor=Ys).prototype.isLineBasicMaterial=!0,Ys.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},Js.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Js,isLine:!0,computeLineDistances:(Ms=new dn,Es=new dn,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],r=1,i=e.count;r<i;r++)Ms.fromBufferAttribute(e,r-1),Es.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=Ms.distanceTo(Es);t.addAttribute("lineDistance",new si(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for((n=t.lineDistances)[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this}),raycast:(bs=new hn,ws=new ma,_s=new tr,function(t,e){var n=t.linePrecision,r=this.geometry,i=this.matrixWorld;if(null===r.boundingSphere&&r.computeBoundingSphere(),_s.copy(r.boundingSphere),_s.applyMatrix4(i),_s.radius+=n,!1!==t.ray.intersectsSphere(_s)){bs.getInverse(i),ws.copy(t.ray).applyMatrix4(bs);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new dn,c=new dn,u=new dn,h=new dn,l=this&&this.isLineSegments?2:1;if(r.isBufferGeometry){var d=r.index,p=r.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length-1;m<g;m+=l){var v=f[m],y=f[m+1];s.fromArray(p,3*v),c.fromArray(p,3*y),o<ws.distanceSqToSegment(s,c,h,u)||(h.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(h))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else for(m=0,g=p.length/3-1;m<g;m+=l)s.fromArray(p,3*m),c.fromArray(p,3*m+3),o<ws.distanceSqToSegment(s,c,h,u)||(h.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(h))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else if(r.isGeometry){var x=r.vertices,b=x.length;for(m=0;m<b-1;m+=l){var w;o<ws.distanceSqToSegment(x[m],x[m+1],h,u)||(h.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(h))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}}}}),copy:function(t){return Vr.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),Zs.prototype=Object.assign(Object.create(Js.prototype),{constructor:Zs,isLineSegments:!0,computeLineDistances:(Ss=new dn,Ts=new dn,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],r=0,i=e.count;r<i;r+=2)Ss.fromBufferAttribute(e,r),Ts.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Ss.distanceTo(Ts);t.addAttribute("lineDistance",new si(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for(n=t.lineDistances,r=0,i=a.length;r<i;r+=2)Ss.copy(a[r]),Ts.copy(a[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Ss.distanceTo(Ts)}return this})}),Qs.prototype=Object.assign(Object.create(Js.prototype),{constructor:Qs,isLineLoop:!0}),((Ks.prototype=Object.create(pa.prototype)).constructor=Ks).prototype.isPointsMaterial=!0,Ks.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},$s.prototype=Object.assign(Object.create(Vr.prototype),{constructor:$s,isPoints:!0,raycast:(As=new hn,Ls=new ma,Ps=new tr,function(i,a){var o=this,t=this.geometry,s=this.matrixWorld,e=i.params.Points.threshold;if(null===t.boundingSphere&&t.computeBoundingSphere(),Ps.copy(t.boundingSphere),Ps.applyMatrix4(s),Ps.radius+=e,!1!==i.ray.intersectsSphere(Ps)){As.getInverse(s),Ls.copy(i.ray).applyMatrix4(As);var n=e/((this.scale.x+this.scale.y+this.scale.z)/3),c=n*n,r=new dn,u=new dn;if(t.isBufferGeometry){var h=t.index,l=t.attributes.position.array;if(null!==h)for(var d=h.array,p=0,f=d.length;p<f;p++){var m=d[p];r.fromArray(l,3*m),y(r,m)}else{p=0;for(var g=l.length/3;p<g;p++)r.fromArray(l,3*p),y(r,p)}}else{var v=t.vertices;for(p=0,g=v.length;p<g;p++)y(v[p],p)}}function y(t,e){var n=Ls.distanceSqToPoint(t);if(n<c){Ls.closestPointToPoint(t,u),u.applyMatrix4(s);var r=i.ray.origin.distanceTo(u);if(r<i.near||r>i.far)return;a.push({distance:r,distanceToRay:Math.sqrt(n),point:u.clone(),index:e,face:null,object:o})}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),tc.prototype=Object.assign(Object.create(qn.prototype),{constructor:tc,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((ec.prototype=Object.create(qn.prototype)).constructor=ec).prototype.isCompressedTexture=!0,((nc.prototype=Object.create(qn.prototype)).constructor=nc).prototype.isCanvasTexture=!0,((rc.prototype=Object.create(qn.prototype)).constructor=rc).prototype.isDepthTexture=!0,(ic.prototype=Object.create(_i.prototype)).constructor=ic,(ac.prototype=Object.create(Kr.prototype)).constructor=ac,(oc.prototype=Object.create(_i.prototype)).constructor=oc,(sc.prototype=Object.create(Kr.prototype)).constructor=sc,(cc.prototype=Object.create(_i.prototype)).constructor=cc,(uc.prototype=Object.create(Kr.prototype)).constructor=uc,(hc.prototype=Object.create(cc.prototype)).constructor=hc,(lc.prototype=Object.create(Kr.prototype)).constructor=lc,(dc.prototype=Object.create(cc.prototype)).constructor=dc,(pc.prototype=Object.create(Kr.prototype)).constructor=pc,(fc.prototype=Object.create(cc.prototype)).constructor=fc,(mc.prototype=Object.create(Kr.prototype)).constructor=mc,(gc.prototype=Object.create(cc.prototype)).constructor=gc,(vc.prototype=Object.create(Kr.prototype)).constructor=vc,(yc.prototype=Object.create(_i.prototype)).constructor=yc,(xc.prototype=Object.create(Kr.prototype)).constructor=xc,(bc.prototype=Object.create(_i.prototype)).constructor=bc,(wc.prototype=Object.create(Kr.prototype)).constructor=wc,(_c.prototype=Object.create(_i.prototype)).constructor=_c;var Mc=function(t,e,n){n=n||2;var r,i,a,o,s,c,u,h=e&&e.length,l=h?e[0]*n:t.length,d=Ec(t,0,l,n,!0),p=[];if(!d)return p;if(h&&(d=function(t,e,n,r){var i,a,o,s,c,u=[];for(i=0,a=e.length;i<a;i++)o=e[i]*r,s=i<a-1?e[i+1]*r:t.length,(c=Ec(t,o,s,r,!1))===c.next&&(c.steiner=!0),u.push(Dc(c));for(u.sort(Rc),i=0;i<u.length;i++)Oc(u[i],n),n=Sc(n,n.next);return n}(t,e,d,n)),t.length>80*n){r=a=t[0],i=o=t[1];for(var f=n;f<l;f+=n)(s=t[f])<r&&(r=s),(c=t[f+1])<i&&(i=c),a<s&&(a=s),o<c&&(o=c);u=0!==(u=Math.max(a-r,o-i))?1/u:0}return Tc(d,p,n,r,i,u),p};function Ec(t,e,n,r,i){var a,o;if(i===0<function(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,n,r))for(a=e;a<n;a+=r)o=Hc(a,t[a],t[a+1],o);else for(a=n-r;e<=a;a-=r)o=Hc(a,t[a],t[a+1],o);return o&&zc(o,o.next)&&(kc(o),o=o.next),o}function Sc(t,e){if(!t)return t;e=e||t;var n,r=t;do{if(n=!1,r.steiner||!zc(r,r.next)&&0!==Nc(r.prev,r,r.next))r=r.next;else{if(kc(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function Tc(t,e,n,r,i,a,o){if(t){!o&&a&&function(t,e,n,r){var i=t;for(;null===i.z&&(i.z=Ic(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==t;);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,a,o,s,c,u=1;do{for(n=t,a=t=null,o=0;n;){for(o++,r=n,e=s=0;e<u&&(s++,r=r.nextZ);e++);for(c=u;0<s||0<c&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(n=(i=n).nextZ,s--):(r=(i=r).nextZ,c--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(1<o)}(i)}(t,r,i,a);for(var s,c,u=t;t.prev!==t.next;)if(s=t.prev,c=t.next,a?Lc(t,r,i,a):Ac(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),kc(t),t=c.next,u=c.next;else if((t=c)===u){o?1===o?Tc(t=Pc(t,e,n),e,n,r,i,a,2):2===o&&Cc(t,e,n,r,i,a):Tc(Sc(t),e,n,r,i,a,1);break}}}function Ac(t){var e=t.prev,n=t,r=t.next;if(!(0<=Nc(e,n,r))){for(var i=t.next.next;i!==t.prev;){if(Bc(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=Nc(i.prev,i,i.next))return;i=i.next}return 1}}function Lc(t,e,n,r){var i=t.prev,a=t,o=t.next;if(!(0<=Nc(i,a,o))){for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,h=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,l=Ic(s,c,e,n,r),d=Ic(u,h,e,n,r),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&Bc(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=Nc(p.prev,p,p.next))return;p=p.nextZ}for(p=t.prevZ;p&&p.z>=l;){if(p!==t.prev&&p!==t.next&&Bc(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=Nc(p.prev,p,p.next))return;p=p.prevZ}return 1}}function Pc(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!zc(i,a)&&Uc(i,r,r.next,a)&&Gc(i,a)&&Gc(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),kc(r),kc(r.next),r=t=a),r=r.next}while(r!==t);return r}function Cc(t,e,n,r,i,a){var o,s,c=t;do{for(var u=c.next.next;u!==c.prev;){if(c.i!==u.i&&(s=u,(o=c).next.i!==s.i&&o.prev.i!==s.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Uc(n,n.next,t,e))return 1;n=n.next}while(n!==t);return}(o,s)&&Gc(o,s)&&Gc(s,o)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;for(;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,n!==t;);return r}(o,s))){var h=Fc(c,u);return c=Sc(c,c.next),h=Sc(h,h.next),Tc(c,e,n,r,i,a),void Tc(h,e,n,r,i,a)}u=u.next}c=c.next}while(c!==t)}function Rc(t,e){return t.x-e.x}function Oc(t,e){if(e=function(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&o<s){if((o=s)===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===o)return n.prev;var c,u=n,h=n.x,l=n.y,d=1/0;r=n.next;for(;r!==u;)i>=r.x&&r.x>=h&&i!==r.x&&Bc(a<l?i:o,a,h,l,a<l?o:i,a,r.x,r.y)&&((c=Math.abs(a-r.y)/(i-r.x))<d||c===d&&r.x>n.x)&&Gc(r,t)&&(n=r,d=c),r=r.next;return n}(t,e)){var n=Fc(e,t);Sc(n,n.next)}}function Ic(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Dc(t){for(var e=t,n=t;e.x<n.x&&(n=e),(e=e.next)!==t;);return n}function Bc(t,e,n,r,i,a,o,s){return 0<=(i-o)*(e-s)-(t-o)*(a-s)&&0<=(t-o)*(r-s)-(n-o)*(e-s)&&0<=(n-o)*(a-s)-(i-o)*(r-s)}function Nc(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function zc(t,e){return t.x===e.x&&t.y===e.y}function Uc(t,e,n,r){return zc(t,e)&&zc(n,r)||zc(t,r)&&zc(n,e)||0<Nc(t,e,n)!=0<Nc(t,e,r)&&0<Nc(n,r,t)!=0<Nc(n,r,e)}function Gc(t,e){return Nc(t.prev,t,t.next)<0?0<=Nc(t,e,t.next)&&0<=Nc(t,t.prev,e):Nc(t,e,t.prev)<0||Nc(t,t.next,e)<0}function Fc(t,e){var n=new Vc(t.i,t.x,t.y),r=new Vc(e.i,e.x,e.y),i=t.next,a=e.prev;return(t.next=e).prev=t,(n.next=i).prev=n,(r.next=n).prev=r,(a.next=r).prev=a,r}function Hc(t,e,n,r){var i=new Vc(t,e,n);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function kc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Vc(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var jc={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},isClockWise:function(t){return jc.area(t)<0},triangulateShape:function(t,e){var n=[],r=[],i=[];Wc(t),qc(n,t);var a=t.length;e.forEach(Wc);for(var o=0;o<e.length;o++)r.push(a),a+=e[o].length,qc(n,e[o]);var s=Mc(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function Wc(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function qc(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function Xc(t,e){Kr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new Yc(t,e)),this.mergeVertices()}function Yc(t,Z){_i.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:Z},t=Array.isArray(t)?t:[t];for(var Q=this,K=[],$=[],e=0,n=t.length;e<n;e++){r(t[e])}function r(t){var r=[],e=void 0!==Z.curveSegments?Z.curveSegments:12,c=void 0!==Z.steps?Z.steps:1,n=void 0!==Z.depth?Z.depth:100,i=void 0===Z.bevelEnabled||Z.bevelEnabled,a=void 0!==Z.bevelThickness?Z.bevelThickness:6,o=void 0!==Z.bevelSize?Z.bevelSize:a-2,u=void 0!==Z.bevelSegments?Z.bevelSegments:3,s=Z.extrudePath,h=void 0!==Z.UVGenerator?Z.UVGenerator:Jc;void 0!==Z.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),n=Z.amount);var l,d,p,f,m,g,v,y,x=!1;s&&(l=s.getSpacedPoints(c),i=!(x=!0),d=s.computeFrenetFrames(c,!1),p=new dn,f=new dn,m=new dn),i||(o=a=u=0);var b=t.extractPoints(e),w=b.shape,_=b.holes;if(!jc.isClockWise(w))for(w=w.reverse(),v=0,y=_.length;v<y;v++)g=_[v],jc.isClockWise(g)&&(_[v]=g.reverse());var M=jc.triangulateShape(w,_),E=w;for(v=0,y=_.length;v<y;v++)g=_[v],w=w.concat(g);function S(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var T,A,L,P,C,R,O=w.length,I=M.length;function D(t,e,n){var r,i,a,o=t.x-e.x,s=t.y-e.y,c=n.x-t.x,u=n.y-t.y,h=o*o+s*s,l=o*u-s*c;if(Math.abs(l)>Number.EPSILON){var d=Math.sqrt(h),p=Math.sqrt(c*c+u*u),f=e.x-s/d,m=e.y+o/d,g=((n.x-u/p-f)*u-(n.y+c/p-m)*c)/(o*u-s*c),v=(r=f+o*g-t.x)*r+(i=m+s*g-t.y)*i;if(v<=2)return new un(r,i);a=Math.sqrt(v/2)}else{var y=!1;o>Number.EPSILON?c>Number.EPSILON&&(y=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),a=y?(r=-s,i=o,Math.sqrt(h)):(r=o,i=s,Math.sqrt(h/2))}return new un(r/a,i/a)}for(var B=[],N=0,z=E.length,U=z-1,G=N+1;N<z;N++,U++,G++)U===z&&(U=0),G===z&&(G=0),B[N]=D(E[N],E[U],E[G]);var F,H,k=[],V=B.concat();for(v=0,y=_.length;v<y;v++){for(g=_[v],F=[],N=0,U=(z=g.length)-1,G=N+1;N<z;N++,U++,G++)U===z&&(U=0),G===z&&(G=0),F[N]=D(g[N],g[U],g[G]);k.push(F),V=V.concat(F)}for(T=0;T<u;T++){for(L=T/u,P=a*Math.cos(L*Math.PI/2),A=o*Math.sin(L*Math.PI/2),N=0,z=E.length;N<z;N++)W((C=S(E[N],B[N],A)).x,C.y,-P);for(v=0,y=_.length;v<y;v++)for(g=_[v],F=k[v],N=0,z=g.length;N<z;N++)W((C=S(g[N],F[N],A)).x,C.y,-P)}for(A=o,N=0;N<O;N++)C=i?S(w[N],V[N],A):w[N],x?(f.copy(d.normals[0]).multiplyScalar(C.x),p.copy(d.binormals[0]).multiplyScalar(C.y),m.copy(l[0]).add(f).add(p),W(m.x,m.y,m.z)):W(C.x,C.y,0);for(H=1;H<=c;H++)for(N=0;N<O;N++)C=i?S(w[N],V[N],A):w[N],x?(f.copy(d.normals[H]).multiplyScalar(C.x),p.copy(d.binormals[H]).multiplyScalar(C.y),m.copy(l[H]).add(f).add(p),W(m.x,m.y,m.z)):W(C.x,C.y,n/c*H);for(T=u-1;0<=T;T--){for(L=T/u,P=a*Math.cos(L*Math.PI/2),A=o*Math.sin(L*Math.PI/2),N=0,z=E.length;N<z;N++)W((C=S(E[N],B[N],A)).x,C.y,n+P);for(v=0,y=_.length;v<y;v++)for(g=_[v],F=k[v],N=0,z=g.length;N<z;N++)C=S(g[N],F[N],A),x?W(C.x,C.y+l[c-1].y,l[c-1].x+P):W(C.x,C.y,n+P)}function j(t,e){var n,r;for(N=t.length;0<=--N;){(r=(n=N)-1)<0&&(r=t.length-1);var i=0,a=c+2*u;for(i=0;i<a;i++){var o=O*i,s=O*(i+1);X(e+n+o,e+r+o,e+r+s,e+n+s)}}}function W(t,e,n){r.push(t),r.push(e),r.push(n)}function q(t,e,n){Y(t),Y(e),Y(n);var r=K.length/3,i=h.generateTopUV(Q,K,r-3,r-2,r-1);J(i[0]),J(i[1]),J(i[2])}function X(t,e,n,r){Y(t),Y(e),Y(r),Y(e),Y(n),Y(r);var i=K.length/3,a=h.generateSideWallUV(Q,K,i-6,i-3,i-2,i-1);J(a[0]),J(a[1]),J(a[3]),J(a[1]),J(a[2]),J(a[3])}function Y(t){K.push(r[3*t+0]),K.push(r[3*t+1]),K.push(r[3*t+2])}function J(t){$.push(t.x),$.push(t.y)}!function(){var t=K.length/3;if(i){var e=0,n=O*e;for(N=0;N<I;N++)q((R=M[N])[2]+n,R[1]+n,R[0]+n);for(n=O*(e=c+2*u),N=0;N<I;N++)q((R=M[N])[0]+n,R[1]+n,R[2]+n)}else{for(N=0;N<I;N++)q((R=M[N])[2],R[1],R[0]);for(N=0;N<I;N++)q((R=M[N])[0]+O*c,R[1]+O*c,R[2]+O*c)}Q.addGroup(t,K.length/3-t,0)}(),function(){var t=K.length/3,e=0;for(j(E,e),e+=E.length,v=0,y=_.length;v<y;v++)j(g=_[v],e),e+=g.length;Q.addGroup(t,K.length/3-t,1)}()}this.addAttribute("position",new si(K,3)),this.addAttribute("uv",new si($,2)),this.computeVertexNormals()}((Xc.prototype=Object.create(Kr.prototype)).constructor=Xc).prototype.toJSON=function(){var t=Kr.prototype.toJSON.call(this);return Zc(this.parameters.shapes,this.parameters.options,t)},((Yc.prototype=Object.create(_i.prototype)).constructor=Yc).prototype.toJSON=function(){var t=_i.prototype.toJSON.call(this);return Zc(this.parameters.shapes,this.parameters.options,t)};var Jc={generateTopUV:function(t,e,n,r,i){var a=e[3*n],o=e[3*n+1],s=e[3*r],c=e[3*r+1],u=e[3*i],h=e[3*i+1];return[new un(a,o),new un(s,c),new un(u,h)]},generateSideWallUV:function(t,e,n,r,i,a){var o=e[3*n],s=e[3*n+1],c=e[3*n+2],u=e[3*r],h=e[3*r+1],l=e[3*r+2],d=e[3*i],p=e[3*i+1],f=e[3*i+2],m=e[3*a],g=e[3*a+1],v=e[3*a+2];return Math.abs(s-h)<.01?[new un(o,1-c),new un(u,1-l),new un(d,1-f),new un(m,1-v)]:[new un(s,1-c),new un(h,1-l),new un(p,1-f),new un(g,1-v)]}};function Zc(t,e,n){if(n.shapes=[],Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var a=t[r];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Qc(t,e){Kr.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Kc(t,e)),this.mergeVertices()}function Kc(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Kr;var r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Yc.call(this,r,e),this.type="TextBufferGeometry"}function $c(t,e,n,r,i,a,o){Kr.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new tu(t,e,n,r,i,a,o)),this.mergeVertices()}function tu(t,e,n,r,i,a,o){_i.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var s,c,u=(a=void 0!==a?a:0)+(o=void 0!==o?o:Math.PI),h=0,l=[],d=new dn,p=new dn,f=[],m=[],g=[],v=[];for(c=0;c<=n;c++){var y=[],x=c/n;for(s=0;s<=e;s++){var b=s/e;d.x=-t*Math.cos(r+b*i)*Math.sin(a+x*o),d.y=t*Math.cos(a+x*o),d.z=t*Math.sin(r+b*i)*Math.sin(a+x*o),m.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),g.push(p.x,p.y,p.z),v.push(b,1-x),y.push(h++)}l.push(y)}for(c=0;c<n;c++)for(s=0;s<e;s++){var w=l[c][s+1],_=l[c][s],M=l[c+1][s],E=l[c+1][s+1];(0!==c||0<a)&&f.push(w,_,E),(c!==n-1||u<Math.PI)&&f.push(_,M,E)}this.setIndex(f),this.addAttribute("position",new si(m,3)),this.addAttribute("normal",new si(g,3)),this.addAttribute("uv",new si(v,2))}function eu(t,e,n,r,i,a){Kr.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new nu(t,e,n,r,i,a)),this.mergeVertices()}function nu(t,e,n,r,i,a){_i.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},t=t||.5,e=e||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,c,u=[],h=[],l=[],d=[],p=t,f=(e-t)/(r=void 0!==r?Math.max(1,r):1),m=new dn,g=new un;for(s=0;s<=r;s++){for(c=0;c<=n;c++)o=i+c/n*a,m.x=p*Math.cos(o),m.y=p*Math.sin(o),h.push(m.x,m.y,m.z),l.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,d.push(g.x,g.y);p+=f}for(s=0;s<r;s++){var v=s*(n+1);for(c=0;c<n;c++){var y=o=c+v,x=o+n+1,b=o+n+2,w=o+1;u.push(y,x,w),u.push(x,b,w)}}this.setIndex(u),this.addAttribute("position",new si(h,3)),this.addAttribute("normal",new si(l,3)),this.addAttribute("uv",new si(d,2))}function ru(t,e,n,r){Kr.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},this.fromBufferGeometry(new iu(t,e,n,r)),this.mergeVertices()}function iu(t,e,n,r){_i.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=cn.clamp(r,0,2*Math.PI);var i,a,o,s=[],c=[],u=[],h=1/e,l=new dn,d=new un;for(a=0;a<=e;a++){var p=n+a*h*r,f=Math.sin(p),m=Math.cos(p);for(o=0;o<=t.length-1;o++)l.x=t[o].x*f,l.y=t[o].y,l.z=t[o].x*m,c.push(l.x,l.y,l.z),d.x=a/e,d.y=o/(t.length-1),u.push(d.x,d.y)}for(a=0;a<e;a++)for(o=0;o<t.length-1;o++){var g=i=o+a*t.length,v=i+t.length,y=i+t.length+1,x=i+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.addAttribute("position",new si(c,3)),this.addAttribute("uv",new si(u,2)),this.computeVertexNormals(),r===2*Math.PI){var b=this.attributes.normal.array,w=new dn,_=new dn,M=new dn;for(i=e*t.length*3,o=a=0;a<t.length;a++,o+=3)w.x=b[o+0],w.y=b[o+1],w.z=b[o+2],_.x=b[i+o+0],_.y=b[i+o+1],_.z=b[i+o+2],M.addVectors(w,_).normalize(),b[o+0]=b[i+o+0]=M.x,b[o+1]=b[i+o+1]=M.y,b[o+2]=b[i+o+2]=M.z}}function au(t,e){Kr.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new ou(t,e)),this.mergeVertices()}function ou(t,f){_i.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:f},f=f||12;var m=[],g=[],v=[],y=[],e=0,x=0;if(!1===Array.isArray(t))r(t);else for(var n=0;n<t.length;n++)r(t[n]),this.addGroup(e,x,n),e+=x,x=0;function r(t){var e,n,r,i=g.length/3,a=t.extractPoints(f),o=a.shape,s=a.holes;for(!1===jc.isClockWise(o)&&(o=o.reverse()),e=0,n=s.length;e<n;e++)r=s[e],!0===jc.isClockWise(r)&&(s[e]=r.reverse());var c=jc.triangulateShape(o,s);for(e=0,n=s.length;e<n;e++)r=s[e],o=o.concat(r);for(e=0,n=o.length;e<n;e++){var u=o[e];g.push(u.x,u.y,0),v.push(0,0,1),y.push(u.x,u.y)}for(e=0,n=c.length;e<n;e++){var h=c[e],l=h[0]+i,d=h[1]+i,p=h[2]+i;m.push(l,d,p),x+=3}}this.setIndex(m),this.addAttribute("position",new si(g,3)),this.addAttribute("normal",new si(v,3)),this.addAttribute("uv",new si(y,2))}function su(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}function cu(t,e){_i.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,r,i,a,o=[],s=Math.cos(cn.DEG2RAD*e),c=[0,0],u={},h=["a","b","c"];t.isBufferGeometry?(a=new Kr).fromBufferGeometry(t):a=t.clone(),a.mergeVertices(),a.computeFaceNormals();for(var l=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)n=m[h[g]],r=m[h[(g+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===u[i=c[0]+","+c[1]]?u[i]={index1:c[0],index2:c[1],face1:p,face2:void 0}:u[i].face2=p;for(i in u){var v=u[i];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var y=l[v.index1];o.push(y.x,y.y,y.z),y=l[v.index2],o.push(y.x,y.y,y.z)}}this.addAttribute("position",new si(o,3))}function uu(t,e,n,r,i,a,o,s){Kr.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new hu(t,e,n,r,i,a,o,s)),this.mergeVertices()}function hu(v,y,x,b,w,t,_,M){_i.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:v,radiusBottom:y,height:x,radialSegments:b,heightSegments:w,openEnded:t,thetaStart:_,thetaLength:M};var E=this;v=void 0!==v?v:1,y=void 0!==y?y:1,x=x||1,b=Math.floor(b)||8,w=Math.floor(w)||1,t=void 0!==t&&t,_=void 0!==_?_:0,M=void 0!==M?M:2*Math.PI;var S=[],T=[],A=[],L=[],P=0,C=[],R=x/2,O=0;function e(t){var e,n,r,i=new un,a=new dn,o=0,s=!0===t?v:y,c=!0===t?1:-1;for(n=P,e=1;e<=b;e++)T.push(0,R*c,0),A.push(0,c,0),L.push(.5,.5),P++;for(r=P,e=0;e<=b;e++){var u=e/b*M+_,h=Math.cos(u),l=Math.sin(u);a.x=s*l,a.y=R*c,a.z=s*h,T.push(a.x,a.y,a.z),A.push(0,c,0),i.x=.5*h+.5,i.y=.5*l*c+.5,L.push(i.x,i.y),P++}for(e=0;e<b;e++){var d=n+e,p=r+e;!0===t?S.push(p,p+1,d):S.push(p+1,p,d),o+=3}E.addGroup(O,o,!0===t?1:2),O+=o}!function(){var t,e,n=new dn,r=new dn,i=0,a=(y-v)/x;for(e=0;e<=w;e++){var o=[],s=e/w,c=s*(y-v)+v;for(t=0;t<=b;t++){var u=t/b,h=u*M+_,l=Math.sin(h),d=Math.cos(h);r.x=c*l,r.y=-s*x+R,r.z=c*d,T.push(r.x,r.y,r.z),n.set(l,a,d).normalize(),A.push(n.x,n.y,n.z),L.push(u,1-s),o.push(P++)}C.push(o)}for(t=0;t<b;t++)for(e=0;e<w;e++){var p=C[e][t],f=C[e+1][t],m=C[e+1][t+1],g=C[e][t+1];S.push(p,f,g),S.push(f,m,g),i+=6}E.addGroup(O,i,0),O+=i}(),!1===t&&(0<v&&e(!0),0<y&&e(!1)),this.setIndex(S),this.addAttribute("position",new si(T,3)),this.addAttribute("normal",new si(A,3)),this.addAttribute("uv",new si(L,2))}function lu(t,e,n,r,i,a,o){uu.call(this,0,t,e,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function du(t,e,n,r,i,a,o){hu.call(this,0,t,e,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function pu(t,e,n,r){Kr.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new fu(t,e,n,r)),this.mergeVertices()}function fu(t,e,n,r){_i.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],c=[],u=[],h=new dn,l=new un;for(s.push(0,0,0),c.push(0,0,1),u.push(.5,.5),a=0,i=3;a<=e;a++,i+=3){var d=n+a/e*r;h.x=t*Math.cos(d),h.y=t*Math.sin(d),s.push(h.x,h.y,h.z),c.push(0,0,1),l.x=(s[i]/t+1)/2,l.y=(s[i+1]/t+1)/2,u.push(l.x,l.y)}for(i=1;i<=e;i++)o.push(i,i+1,0);this.setIndex(o),this.addAttribute("position",new si(s,3)),this.addAttribute("normal",new si(c,3)),this.addAttribute("uv",new si(u,2))}(Qc.prototype=Object.create(Kr.prototype)).constructor=Qc,(Kc.prototype=Object.create(Yc.prototype)).constructor=Kc,($c.prototype=Object.create(Kr.prototype)).constructor=$c,(tu.prototype=Object.create(_i.prototype)).constructor=tu,(eu.prototype=Object.create(Kr.prototype)).constructor=eu,(nu.prototype=Object.create(_i.prototype)).constructor=nu,(ru.prototype=Object.create(Kr.prototype)).constructor=ru,(iu.prototype=Object.create(_i.prototype)).constructor=iu,((au.prototype=Object.create(Kr.prototype)).constructor=au).prototype.toJSON=function(){var t=Kr.prototype.toJSON.call(this);return su(this.parameters.shapes,t)},((ou.prototype=Object.create(_i.prototype)).constructor=ou).prototype.toJSON=function(){var t=_i.prototype.toJSON.call(this);return su(this.parameters.shapes,t)},(cu.prototype=Object.create(_i.prototype)).constructor=cu,(uu.prototype=Object.create(Kr.prototype)).constructor=uu,(hu.prototype=Object.create(_i.prototype)).constructor=hu,(lu.prototype=Object.create(uu.prototype)).constructor=lu,(du.prototype=Object.create(hu.prototype)).constructor=du,(pu.prototype=Object.create(Kr.prototype)).constructor=pu,(fu.prototype=Object.create(_i.prototype)).constructor=fu;var mu=Object.freeze({WireframeGeometry:ic,ParametricGeometry:ac,ParametricBufferGeometry:oc,TetrahedronGeometry:uc,TetrahedronBufferGeometry:hc,OctahedronGeometry:lc,OctahedronBufferGeometry:dc,IcosahedronGeometry:pc,IcosahedronBufferGeometry:fc,DodecahedronGeometry:mc,DodecahedronBufferGeometry:gc,PolyhedronGeometry:sc,PolyhedronBufferGeometry:cc,TubeGeometry:vc,TubeBufferGeometry:yc,TorusKnotGeometry:xc,TorusKnotBufferGeometry:bc,TorusGeometry:wc,TorusBufferGeometry:_c,TextGeometry:Qc,TextBufferGeometry:Kc,SphereGeometry:$c,SphereBufferGeometry:tu,RingGeometry:eu,RingBufferGeometry:nu,PlaneGeometry:Si,PlaneBufferGeometry:Ti,LatheGeometry:ru,LatheBufferGeometry:iu,ShapeGeometry:au,ShapeBufferGeometry:ou,ExtrudeGeometry:Xc,ExtrudeBufferGeometry:Yc,EdgesGeometry:cu,ConeGeometry:lu,ConeBufferGeometry:du,CylinderGeometry:uu,CylinderBufferGeometry:hu,CircleGeometry:pu,CircleBufferGeometry:fu,BoxGeometry:Mi,BoxBufferGeometry:Ei});function gu(t){pa.call(this),this.type="ShadowMaterial",this.color=new lr(0),this.transparent=!0,this.setValues(t)}function vu(t){fa.call(this,t),this.type="RawShaderMaterial"}function yu(t){pa.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new lr(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new un(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.setValues(t)}function xu(t){yu.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function bu(t){pa.call(this),this.type="MeshPhongMaterial",this.color=new lr(16777215),this.specular=new lr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new un(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=xt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function wu(t){bu.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function _u(t){pa.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new un(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Mu(t){pa.call(this),this.type="MeshLambertMaterial",this.color=new lr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=xt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Eu(t){pa.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new lr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new un(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t)}function Su(t){Ys.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}((gu.prototype=Object.create(pa.prototype)).constructor=gu).prototype.isShadowMaterial=!0,gu.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.color.copy(t.color),this},((vu.prototype=Object.create(fa.prototype)).constructor=vu).prototype.isRawShaderMaterial=!0,((yu.prototype=Object.create(pa.prototype)).constructor=yu).prototype.isMeshStandardMaterial=!0,yu.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((xu.prototype=Object.create(yu.prototype)).constructor=xu).prototype.isMeshPhysicalMaterial=!0,xu.prototype.copy=function(t){return yu.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},((bu.prototype=Object.create(pa.prototype)).constructor=bu).prototype.isMeshPhongMaterial=!0,bu.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((wu.prototype=Object.create(bu.prototype)).constructor=wu).prototype.isMeshToonMaterial=!0,wu.prototype.copy=function(t){return bu.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},((_u.prototype=Object.create(pa.prototype)).constructor=_u).prototype.isMeshNormalMaterial=!0,_u.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Mu.prototype=Object.create(pa.prototype)).constructor=Mu).prototype.isMeshLambertMaterial=!0,Mu.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Eu.prototype=Object.create(pa.prototype)).constructor=Eu).prototype.isMeshMatcapMaterial=!0,Eu.prototype.copy=function(t){return pa.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Su.prototype=Object.create(Ys.prototype)).constructor=Su).prototype.isLineDashedMaterial=!0,Su.prototype.copy=function(t){return Ys.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Tu=Object.freeze({ShadowMaterial:gu,SpriteMaterial:Hs,RawShaderMaterial:vu,ShaderMaterial:fa,PointsMaterial:Ks,MeshPhysicalMaterial:xu,MeshStandardMaterial:yu,MeshPhongMaterial:bu,MeshToonMaterial:wu,MeshNormalMaterial:_u,MeshLambertMaterial:Mu,MeshDepthMaterial:qo,MeshDistanceMaterial:Xo,MeshBasicMaterial:va,MeshMatcapMaterial:Eu,LineDashedMaterial:Su,LineBasicMaterial:Ys,Material:pa}),Au={arraySlice:function(t,e,n){return Au.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(n){for(var t=n.length,e=new Array(t),r=0;r!==t;++r)e[r]=r;return e.sort(function(t,e){return n[t]-n[e]}),e},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*e,c=0;c!==e;++c)i[o++]=t[s+c];return i},flattenJSON:function(t,e,n,r){for(var i=1,a=t[0];void 0!==a&&void 0===a[r];)a=t[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))for(;void 0!==(o=a[r])&&(e.push(a.time),n.push.apply(n,o)),void 0!==(a=t[i++]););else if(void 0!==o.toArray)for(;void 0!==(o=a[r])&&(e.push(a.time),o.toArray(n,n.length)),void 0!==(a=t[i++]););else for(;void 0!==(o=a[r])&&(e.push(a.time),n.push(o)),void 0!==(a=t[i++]););}}};function Lu(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Pu(t,e,n,r){Lu.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Cu(t,e,n,r){Lu.call(this,t,e,n,r)}function Ru(t,e,n,r){Lu.call(this,t,e,n,r)}function Ou(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Au.convertArray(e,this.TimeBufferType),this.values=Au.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Iu(t,e,n){Ou.call(this,t,e,n)}function Du(t,e,n,r){Ou.call(this,t,e,n,r)}function Bu(t,e,n,r){Ou.call(this,t,e,n,r)}function Nu(t,e,n,r){Lu.call(this,t,e,n,r)}function zu(t,e,n,r){Ou.call(this,t,e,n,r)}function Uu(t,e,n,r){Ou.call(this,t,e,n,r)}function Gu(t,e,n,r){Ou.call(this,t,e,n,r)}function Fu(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=cn.generateUUID(),this.duration<0&&this.resetDuration()}function Hu(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Bu;case"vector":case"vector2":case"vector3":case"vector4":return Gu;case"color":return Du;case"quaternion":return zu;case"bool":case"boolean":return Iu;case"string":return Uu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],r=[];Au.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(Lu.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var a;n:{r:if(!(t<r)){for(var o=n+2;;){if(void 0===r){if(t<i)break r;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===o)break;if(i=r,t<(r=e[++n]))break e}a=e.length;break n}if(i<=t)break t;var s=e[1];t<s&&(n=2,i=s);for(o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===o)break;if(r=i,(i=e[--n-1])<=t)break e}a=n,n=0}for(;n<a;){var c=n+a>>>1;t<e[c]?a=c:n=1+c}if(r=e[n],void 0===(i=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r,a=0;a!==r;++a)e[a]=n[i+a];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),
//!\ DECLARE ALIAS AFTER assign prototype !
Object.assign(Lu.prototype,{beforeStart_:Lu.prototype.copySampleValue_,afterEnd_:Lu.prototype.copySampleValue_}),Pu.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Pu,DefaultSettings_:{endingStart:Ve,endingEnd:Ve},intervalChanged_:function(t,e,n){var r=this.parameterPositions,i=t-2,a=t+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case je:i=t,o=2*e-n;break;case We:o=e+r[i=r.length-2]-r[i+1];break;default:i=t,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case je:a=t,s=2*n-e;break;case We:s=n+r[a=1]-r[0];break;default:a=t-1,s=e}var c=.5*(n-e),u=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u},interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,u=this._offsetPrev,h=this._offsetNext,l=this._weightPrev,d=this._weightNext,p=(n-e)/(r-e),f=p*p,m=f*p,g=-l*m+2*l*f-l*p,v=(1+l)*m+(-1.5-2*l)*f+(-.5+l)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,b=0;b!==o;++b)i[b]=g*a[u+b]+v*a[c+b]+y*a[s+b]+x*a[h+b];return i}}),Cu.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Cu,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,u=(n-e)/(r-e),h=1-u,l=0;l!==o;++l)i[l]=a[c+l]*h+a[s+l]*u;return i}}),Ru.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Ru,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Ou,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:Au.convertArray(t.times,Array),values:Au.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e}}),Object.assign(Ou.prototype,{constructor:Ou,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:He,InterpolantFactoryMethodDiscrete:function(t){return new Ru(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Cu(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Pu(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case Fe:e=this.InterpolantFactoryMethodDiscrete;break;case He:e=this.InterpolantFactoryMethodLinear;break;case ke:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)return this.createInterpolant=e,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Fe;case this.InterpolantFactoryMethodLinear:return He;case this.InterpolantFactoryMethodSmooth:return ke}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<t;)++i;for(;-1!==a&&n[a]>e;)--a;if(++a,0!==i||a!==r){a<=i&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Au.arraySlice(n,i,a),this.values=Au.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==r&&Au.isTypedArray(r)){o=0;for(var c=r.length;o!==c;++o){var u=r[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),r=this.getInterpolation()===ke,i=1,a=t.length-1,o=1;o<a;++o){var s=!1,c=t[o];if(c!==t[o+1]&&(1!==o||c!==c[0]))if(r)s=!0;else for(var u=o*n,h=u-n,l=u+n,d=0;d!==n;++d){var p=e[u+d];if(p!==e[h+d]||p!==e[l+d]){s=!0;break}}if(s){if(o!==i){t[i]=t[o];var f=o*n,m=i*n;for(d=0;d!==n;++d)e[m+d]=e[f+d]}++i}}if(0<a){t[i]=t[a];for(f=a*n,m=i*n,d=0;d!==n;++d)e[m+d]=e[f+d];++i}return i!==t.length&&(this.times=Au.arraySlice(t,0,i),this.values=Au.arraySlice(e,0,i*n)),this}}),Iu.prototype=Object.assign(Object.create(Ou.prototype),{constructor:Iu,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Fe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Du.prototype=Object.assign(Object.create(Ou.prototype),{constructor:Du,ValueTypeName:"color"}),Bu.prototype=Object.assign(Object.create(Ou.prototype),{constructor:Bu,ValueTypeName:"number"}),Nu.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Nu,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=(n-e)/(r-e),u=s+o;s!==u;s+=4)ln.slerpFlat(i,0,a,s-o,a,s,c);return i}}),zu.prototype=Object.assign(Object.create(Ou.prototype),{constructor:zu,ValueTypeName:"quaternion",DefaultInterpolation:He,InterpolantFactoryMethodLinear:function(t){return new Nu(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Uu.prototype=Object.assign(Object.create(Ou.prototype),{constructor:Uu,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Fe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Gu.prototype=Object.assign(Object.create(Ou.prototype),{constructor:Gu,ValueTypeName:"vector"}),Object.assign(Fu,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,a=n.length;i!==a;++i)e.push(Hu(n[i]).scale(r));return new Fu(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},i=0,a=n.length;i!==a;++i)e.push(Ou.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var u=Au.getKeyframeOrder(s);s=Au.sortedArray(s,1,u),c=Au.sortedArray(c,1,u),r||0!==s[0]||(s.push(i),c.push(c[0])),a.push(new Bu(".morphTargetInfluences["+e[o].name+"]",s,c).scale(1/n))}return new Fu(t,-1,a)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){n=t.geometry&&t.geometry.animations||t.animations}for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(i);if(c&&1<c.length){var u=r[l=c[1]];u||(r[l]=u=[]),u.push(s)}}var h=[];for(var l in r)h.push(Fu.CreateFromMorphTargetSequence(l,r[l],e,n));return h},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var a=[],o=[];Au.flattenJSON(n,a,o,r),0!==a.length&&i.push(new t(e,a,o))}},r=[],i=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.hierarchy||[],c=0;c<s.length;c++){var u=s[c].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var h={},l=0;l<u.length;l++)if(u[l].morphTargets)for(var d=0;d<u[l].morphTargets.length;d++)h[u[l].morphTargets[d]]=-1;for(var p in h){var f=[],m=[];for(d=0;d!==u[l].morphTargets.length;++d){var g=u[l];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new Bu(".morphTargetInfluence["+p+"]",f,m))}a=h.length*(o||1)}else{var v=".bones["+e[c].name+"]";n(Gu,v+".position",u,"pos",r),n(zu,v+".quaternion",u,"rot",r),n(Gu,v+".scale",u,"scl",r)}}return 0===r.length?null:new Fu(i,a,r)}}),Object.assign(Fu.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}});var ku={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function Vu(t,e,n){var r=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===i&&void 0!==r.onStart&&r.onStart(t,a,o),i=!0},this.itemEnd=function(t){a++,void 0!==r.onProgress&&r.onProgress(t,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var ju=new Vu,Wu={};function qu(t){this.manager=void 0!==t?t:ju}function Xu(t){this.manager=void 0!==t?t:ju}function Yu(t){this.manager=void 0!==t?t:ju,this._parser=null}function Ju(t){this.manager=void 0!==t?t:ju,this._parser=null}function Zu(t){this.manager=void 0!==t?t:ju}function Qu(t){this.manager=void 0!==t?t:ju}function Ku(t){this.manager=void 0!==t?t:ju}function $u(){this.type="Curve",this.arcLengthDivisions=200}function th(t,e,n,r,i,a,o,s){$u.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function eh(t,e,n,r,i,a){th.call(this,t,e,n,n,r,i,a),this.type="ArcCurve"}function nh(){var i=0,a=0,o=0,s=0;function u(t,e,n,r){o=-3*(i=t)+3*e-2*(a=n)-r,s=2*t-2*e+n+r}return{initCatmullRom:function(t,e,n,r,i){u(e,n,i*(n-t),i*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,i,a,o){var s=(e-t)/i-(n-t)/(i+a)+(n-e)/a,c=(n-e)/a-(r-e)/(a+o)+(r-n)/o;u(e,n,s*=a,c*=a)},calc:function(t){var e=t*t;return i+a*t+o*e+s*(e*t)}}}Object.assign(qu.prototype,{load:function(o,t,e,n){void 0===o&&(o=""),void 0!==this.path&&(o=this.path+o),o=this.manager.resolveURL(o);var s=this,r=ku.get(o);if(void 0!==r)return s.manager.itemStart(o),setTimeout(function(){t&&t(r),s.manager.itemEnd(o)},0),r;if(void 0===Wu[o]){var i=o.match(/^data:(.*?)(;base64)?,(.*)$/);if(i){var a=i[1],c=!!i[2],u=i[3];u=decodeURIComponent(u),c&&(u=atob(u));try{var h,l=(this.responseType||"").toLowerCase();switch(l){case"arraybuffer":case"blob":for(var d=new Uint8Array(u.length),p=0;p<u.length;p++)d[p]=u.charCodeAt(p);h="blob"===l?new Blob([d.buffer],{type:a}):d.buffer;break;case"document":var f=new DOMParser;h=f.parseFromString(u,a);break;case"json":h=JSON.parse(u);break;default:h=u}setTimeout(function(){t&&t(h),s.manager.itemEnd(o)},0)}catch(t){setTimeout(function(){n&&n(t),s.manager.itemError(o),s.manager.itemEnd(o)},0)}}else{Wu[o]=[],Wu[o].push({onLoad:t,onProgress:e,onError:n});var m=new XMLHttpRequest;for(var g in m.open("GET",o,!0),m.addEventListener("load",function(t){var e=this.response;ku.add(o,e);var n=Wu[o];if(delete Wu[o],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var r=0,i=n.length;r<i;r++){(a=n[r]).onLoad&&a.onLoad(e)}s.manager.itemEnd(o)}else{for(r=0,i=n.length;r<i;r++){var a;(a=n[r]).onError&&a.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)}},!1),m.addEventListener("progress",function(t){for(var e=Wu[o],n=0,r=e.length;n<r;n++){var i=e[n];i.onProgress&&i.onProgress(t)}},!1),m.addEventListener("error",function(t){var e=Wu[o];delete Wu[o];for(var n=0,r=e.length;n<r;n++){var i=e[n];i.onError&&i.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),m.addEventListener("abort",function(t){var e=Wu[o];delete Wu[o];for(var n=0,r=e.length;n<r;n++){var i=e[n];i.onError&&i.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return s.manager.itemStart(o),m}Wu[o].push({onLoad:t,onProgress:e,onError:n})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(Xu.prototype,{load:function(t,e,n,r){var i=this,a=new qu(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=Fu.parse(t[r]);n.push(i)}e(n)},setPath:function(t){return this.path=t,this}}),Object.assign(Yu.prototype,{load:function(t,a,e,r){var o=this,s=[],c=new ec;c.image=s;var i=new qu(this.manager);function n(n){i.load(t[n],function(t){var e=o._parser(t,!0);s[n]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},6===(u+=1)&&(1===e.mipmapCount&&(c.minFilter=jt),c.format=e.format,c.needsUpdate=!0,a&&a(c))},e,r)}if(i.setPath(this.path),i.setResponseType("arraybuffer"),Array.isArray(t))for(var u=0,h=0,l=t.length;h<l;++h)n(h);else i.load(t,function(t){var e=o._parser(t,!0);if(e.isCubemap)for(var n=e.mipmaps.length/e.mipmapCount,r=0;r<n;r++){s[r]={mipmaps:[]};for(var i=0;i<e.mipmapCount;i++)s[r].mipmaps.push(e.mipmaps[r*e.mipmapCount+i]),s[r].format=e.format,s[r].width=e.width,s[r].height=e.height}else c.image.width=e.width,c.image.height=e.height,c.mipmaps=e.mipmaps;1===e.mipmapCount&&(c.minFilter=jt),c.format=e.format,c.needsUpdate=!0,a&&a(c)},e,r);return c},setPath:function(t){return this.path=t,this}}),Object.assign(Ju.prototype,{load:function(t,n,e,r){var i=this,a=new Zn,o=new qu(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(t,function(t){var e=i._parser(t);e&&(void 0!==e.image?a.image=e.image:void 0!==e.data&&(a.image.width=e.width,a.image.height=e.height,a.image.data=e.data),a.wrapS=void 0!==e.wrapS?e.wrapS:Gt,a.wrapT=void 0!==e.wrapT?e.wrapT:Gt,a.magFilter=void 0!==e.magFilter?e.magFilter:jt,a.minFilter=void 0!==e.minFilter?e.minFilter:qt,a.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.format&&(a.format=e.format),void 0!==e.type&&(a.type=e.type),void 0!==e.mipmaps&&(a.mipmaps=e.mipmaps),1===e.mipmapCount&&(a.minFilter=jt),a.needsUpdate=!0,n&&n(a,e))},e,r),a},setPath:function(t){return this.path=t,this}}),Object.assign(Zu.prototype,{crossOrigin:"anonymous",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=ku.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",c,!1),ku.add(e,this),t&&t(this),i.manager.itemEnd(e)}function c(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",c,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Qu.prototype,{crossOrigin:"anonymous",load:function(t,n,e,r){var i=new Oa,a=new Zu(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(e){a.load(t[e],function(t){i.images[e]=t,6===++o&&(i.needsUpdate=!0,n&&n(i))},void 0,r)}for(var c=0;c<t.length;++c)s(c);return i},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Ku.prototype,{crossOrigin:"anonymous",load:function(n,r,t,e){var i=new qn,a=new Zu(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(n,function(t){i.image=t;var e=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);i.format=e?oe:se,i.needsUpdate=!0,void 0!==r&&r(i)},t,e),i},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign($u.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=t;n++)a+=(e=this.getPoint(n/t)).distanceTo(i),r.push(a),i=e;return this.cacheArcLengths=r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,r=this.getLengths(),i=0,a=r.length;n=e||t*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(0<o)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(a-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),1<n&&(n=1);var r=this.getPoint(e);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,r,i,a=new dn,o=[],s=[],c=[],u=new dn,h=new hn;for(n=0;n<=t;n++)r=n/t,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new dn,c[0]=new dn;var l=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=l&&(l=d,a.set(1,0,0)),p<=l&&(l=p,a.set(0,1,0)),f<=l&&a.set(0,0,1),u.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],u),c[0].crossVectors(o[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),u.crossVectors(o[n-1],o[n]),u.length()>Number.EPSILON&&(u.normalize(),i=Math.acos(cn.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(h.makeRotationAxis(u,i))),c[n].crossVectors(o[n],s[n]);if(!0===e)for(i=Math.acos(cn.clamp(s[0].dot(s[t]),-1,1)),i/=t,0<o[0].dot(u.crossVectors(s[0],s[t]))&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(h.makeRotationAxis(o[n],i*n)),c[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((th.prototype=Object.create($u.prototype)).constructor=th).prototype.isEllipseCurve=!0,th.prototype.getPoint=function(t,e){for(var n=e||new un,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;r<i;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+t*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),l=s-this.aX,d=c-this.aY;s=l*u-d*h+this.aX,c=l*h+d*u+this.aY}return n.set(s,c)},th.prototype.copy=function(t){return $u.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},th.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},th.prototype.fromJSON=function(t){return $u.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((eh.prototype=Object.create(th.prototype)).constructor=eh).prototype.isArcCurve=!0;var rh=new dn,ih=new nh,ah=new nh,oh=new nh;function sh(t,e,n,r){$u.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=r||.5}function ch(t,e,n,r,i){var a=.5*(r-e),o=.5*(i-n),s=t*t;return(2*n-2*r+a+o)*(t*s)+(-3*n+3*r-2*a-o)*s+a*t+n}function uh(t,e,n,r){return(o=1-t)*o*e+2*(1-(a=t))*a*n+(i=t)*i*r;var i,a,o}function hh(t,e,n,r,i){return(u=1-t)*u*u*e+3*(c=1-(s=t))*c*s*n+3*(1-(o=t))*o*o*r+(a=t)*a*a*i;var a,o,s,c,u}function lh(t,e,n,r){$u.call(this),this.type="CubicBezierCurve",this.v0=t||new un,this.v1=e||new un,this.v2=n||new un,this.v3=r||new un}function dh(t,e,n,r){$u.call(this),this.type="CubicBezierCurve3",this.v0=t||new dn,this.v1=e||new dn,this.v2=n||new dn,this.v3=r||new dn}function ph(t,e){$u.call(this),this.type="LineCurve",this.v1=t||new un,this.v2=e||new un}function fh(t,e){$u.call(this),this.type="LineCurve3",this.v1=t||new dn,this.v2=e||new dn}function mh(t,e,n){$u.call(this),this.type="QuadraticBezierCurve",this.v0=t||new un,this.v1=e||new un,this.v2=n||new un}function gh(t,e,n){$u.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new dn,this.v1=e||new dn,this.v2=n||new dn}function vh(t){$u.call(this),this.type="SplineCurve",this.points=t||[]}((sh.prototype=Object.create($u.prototype)).constructor=sh).prototype.isCatmullRomCurve3=!0,sh.prototype.getPoint=function(t,e){var n,r,i,a,o=e||new dn,s=this.points,c=s.length,u=(c-(this.closed?0:1))*t,h=Math.floor(u),l=u-h;if(this.closed?h+=0<h?0:(Math.floor(Math.abs(h)/c)+1)*c:0===l&&h===c-1&&(h=c-2,l=1),n=this.closed||0<h?s[(h-1)%c]:(rh.subVectors(s[0],s[1]).add(s[0]),rh),r=s[h%c],i=s[(h+1)%c],a=this.closed||h+2<c?s[(h+2)%c]:(rh.subVectors(s[c-1],s[c-2]).add(s[c-1]),rh),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),ih.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,p,f,m),ah.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,p,f,m),oh.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(ih.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),ah.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),oh.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(ih.calc(l),ah.calc(l),oh.calc(l)),o},sh.prototype.copy=function(t){$u.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},sh.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},sh.prototype.fromJSON=function(t){$u.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new dn).fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((lh.prototype=Object.create($u.prototype)).constructor=lh).prototype.isCubicBezierCurve=!0,lh.prototype.getPoint=function(t,e){var n=e||new un,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(hh(t,r.x,i.x,a.x,o.x),hh(t,r.y,i.y,a.y,o.y)),n},lh.prototype.copy=function(t){return $u.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},lh.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},lh.prototype.fromJSON=function(t){return $u.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((dh.prototype=Object.create($u.prototype)).constructor=dh).prototype.isCubicBezierCurve3=!0,dh.prototype.getPoint=function(t,e){var n=e||new dn,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(hh(t,r.x,i.x,a.x,o.x),hh(t,r.y,i.y,a.y,o.y),hh(t,r.z,i.z,a.z,o.z)),n},dh.prototype.copy=function(t){return $u.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},dh.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},dh.prototype.fromJSON=function(t){return $u.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((ph.prototype=Object.create($u.prototype)).constructor=ph).prototype.isLineCurve=!0,ph.prototype.getPoint=function(t,e){var n=e||new un;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},ph.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},ph.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},ph.prototype.copy=function(t){return $u.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},ph.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},ph.prototype.fromJSON=function(t){return $u.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((fh.prototype=Object.create($u.prototype)).constructor=fh).prototype.isLineCurve3=!0,fh.prototype.getPoint=function(t,e){var n=e||new dn;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},fh.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},fh.prototype.copy=function(t){return $u.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},fh.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},fh.prototype.fromJSON=function(t){return $u.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((mh.prototype=Object.create($u.prototype)).constructor=mh).prototype.isQuadraticBezierCurve=!0,mh.prototype.getPoint=function(t,e){var n=e||new un,r=this.v0,i=this.v1,a=this.v2;return n.set(uh(t,r.x,i.x,a.x),uh(t,r.y,i.y,a.y)),n},mh.prototype.copy=function(t){return $u.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},mh.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},mh.prototype.fromJSON=function(t){return $u.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((gh.prototype=Object.create($u.prototype)).constructor=gh).prototype.isQuadraticBezierCurve3=!0,gh.prototype.getPoint=function(t,e){var n=e||new dn,r=this.v0,i=this.v1,a=this.v2;return n.set(uh(t,r.x,i.x,a.x),uh(t,r.y,i.y,a.y),uh(t,r.z,i.z,a.z)),n},gh.prototype.copy=function(t){return $u.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},gh.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},gh.prototype.fromJSON=function(t){return $u.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((vh.prototype=Object.create($u.prototype)).constructor=vh).prototype.isSplineCurve=!0,vh.prototype.getPoint=function(t,e){var n=e||new un,r=this.points,i=(r.length-1)*t,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],c=r[a],u=r[a>r.length-2?r.length-1:a+1],h=r[a>r.length-3?r.length-1:a+2];return n.set(ch(o,s.x,c.x,u.x,h.x),ch(o,s.y,c.y,u.y,h.y)),n},vh.prototype.copy=function(t){$u.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this},vh.prototype.toJSON=function(){var t=$u.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t},vh.prototype.fromJSON=function(t){$u.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new un).fromArray(r))}return this};var yh=Object.freeze({ArcCurve:eh,CatmullRomCurve3:sh,CubicBezierCurve:lh,CubicBezierCurve3:dh,EllipseCurve:th,LineCurve:ph,LineCurve3:fh,QuadraticBezierCurve:mh,QuadraticBezierCurve3:gh,SplineCurve:vh});function xh(){$u.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function bh(t){xh.call(this),this.type="Path",this.currentPoint=new un,t&&this.setFromPoints(t)}function wh(t){bh.call(this,t),this.uuid=cn.generateUUID(),this.type="Shape",this.holes=[]}function _h(t,e){Vr.call(this),this.type="Light",this.color=new lr(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Mh(t,e,n){_h.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Vr.DefaultUp),this.updateMatrix(),this.groundColor=new lr(e)}function Eh(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new un(512,512),this.map=null,this.matrix=new hn}function Sh(){Eh.call(this,new ts(50,1,.5,500))}function Th(t,e,n,r,i,a){_h.call(this,t,e),this.type="SpotLight",this.position.copy(Vr.DefaultUp),this.updateMatrix(),this.target=new Vr,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Sh}function Ah(t,e,n,r){_h.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Eh(new ts(90,1,.5,500))}function Lh(t,e,n,r,i,a){$o.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Ph(){Eh.call(this,new Lh(-5,5,5,-5,.5,500))}function Ch(t,e){_h.call(this,t,e),this.type="DirectionalLight",this.position.copy(Vr.DefaultUp),this.updateMatrix(),this.target=new Vr,this.shadow=new Ph}function Rh(t,e){_h.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Oh(t,e,n,r){_h.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Ih(t){this.manager=void 0!==t?t:ju,this.textures={}}xh.prototype=Object.assign(Object.create($u.prototype),{constructor:xh,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new ph(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=e){var i=n[r]-e,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*t:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),c=0;c<s.length;c++){var u=s[c];e&&e.equals(u)||(n.push(u),e=u)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){$u.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=$u.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var r=this.curves[e];t.curves.push(r.toJSON())}return t},fromJSON:function(t){$u.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push((new yh[r.type]).fromJSON(r))}return this}}),bh.prototype=Object.assign(Object.create(xh.prototype),{constructor:bh,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new ph(this.currentPoint.clone(),new un(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,r){var i=new mh(this.currentPoint.clone(),new un(t,e),new un(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(t,e,n,r,i,a){var o=new lh(this.currentPoint.clone(),new un(t,e),new un(n,r),new un(i,a));this.curves.push(o),this.currentPoint.set(i,a)},splineThru:function(t){var e=new vh([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+o,e+s,n,r,i,a)},absarc:function(t,e,n,r,i,a){this.absellipse(t,e,n,n,r,i,a)},ellipse:function(t,e,n,r,i,a,o,s){var c=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(t+c,e+u,n,r,i,a,o,s)},absellipse:function(t,e,n,r,i,a,o,s){var c=new th(t,e,n,r,i,a,o,s);if(0<this.curves.length){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var h=c.getPoint(1);this.currentPoint.copy(h)},copy:function(t){return xh.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=xh.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return xh.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),wh.prototype=Object.assign(Object.create(bh.prototype),{constructor:wh,getPointsHoles:function(t){for(var e=[],n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){bh.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push(r.clone())}return this},toJSON:function(){var t=bh.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var r=this.holes[e];t.holes.push(r.toJSON())}return t},fromJSON:function(t){bh.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push((new bh).fromJSON(r))}return this}}),_h.prototype=Object.assign(Object.create(Vr.prototype),{constructor:_h,isLight:!0,copy:function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Vr.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Mh.prototype=Object.assign(Object.create(_h.prototype),{constructor:Mh,isHemisphereLight:!0,copy:function(t){return _h.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Eh.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Sh.prototype=Object.assign(Object.create(Eh.prototype),{constructor:Sh,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*cn.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix())}}),Th.prototype=Object.assign(Object.create(_h.prototype),{constructor:Th,isSpotLight:!0,copy:function(t){return _h.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Ah.prototype=Object.assign(Object.create(_h.prototype),{constructor:Ah,isPointLight:!0,copy:function(t){return _h.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Lh.prototype=Object.assign(Object.create($o.prototype),{constructor:Lh,isOrthographicCamera:!0,copy:function(t,e){return $o.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-t,a=n+t,o=r+e,s=r-e;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,l=(this.top-this.bottom)/this.view.height;a=(i+=h*(this.view.offsetX/c))+h*(this.view.width/c),s=(o-=l*(this.view.offsetY/u))-l*(this.view.height/u)}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Vr.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Ph.prototype=Object.assign(Object.create(Eh.prototype),{constructor:Ph}),Ch.prototype=Object.assign(Object.create(_h.prototype),{constructor:Ch,isDirectionalLight:!0,copy:function(t){return _h.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Rh.prototype=Object.assign(Object.create(_h.prototype),{constructor:Rh,isAmbientLight:!0}),Oh.prototype=Object.assign(Object.create(_h.prototype),{constructor:Oh,isRectAreaLight:!0,copy:function(t){return _h.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=_h.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(Ih.prototype,{load:function(t,e,n,r){var i=this,a=new qu(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var r=new Tu[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearCoat&&(r.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(r.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(r.vertexColors=t.vertexColors),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.uniforms)for(var i in t.uniforms){var a=t.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new lr).setHex(a.value);break;case"v2":r.uniforms[i].value=(new un).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new dn).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new Xn).fromArray(a.value);break;case"m4":r.uniforms[i].value=(new hn).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)r.extensions[o]=t.extensions[o];if(void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=n(t.map)),void 0!==t.alphaMap&&(r.alphaMap=n(t.alphaMap),r.transparent=!0),void 0!==t.bumpMap&&(r.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new un).fromArray(s)}return void 0!==t.displacementMap&&(r.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=n(t.specularMap)),void 0!==t.envMap&&(r.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.lightMap&&(r.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=n(t.gradientMap)),r},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var Dh={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);return decodeURIComponent(escape(e))},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function Bh(t){this.manager=void 0!==t?t:ju}Object.assign(Bh.prototype,{load:function(t,e,n,r){var i=this,a=new qu(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=new _i,n=t.data.index;if(void 0!==n){var r=new Nh[n.type](n.array);e.setIndex(new $r(r,1))}var i=t.data.attributes;for(var a in i){var o=i[a];r=new Nh[o.type](o.array);e.addAttribute(a,new $r(r,o.itemSize,o.normalized))}var s=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==s)for(var c=0,u=s.length;c!==u;++c){var h=s[c];e.addGroup(h.start,h.count,h.materialIndex)}var l=t.data.boundingSphere;if(void 0!==l){var d=new dn;void 0!==l.center&&d.fromArray(l.center),e.boundingSphere=new tr(d,l.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e},setPath:function(t){return this.path=t,this}});var Nh={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function zh(t){this.manager=void 0!==t?t:ju,this.resourcePath=""}Object.assign(zh.prototype,{crossOrigin:"anonymous",load:function(r,i,t,a){var o=this,e=void 0===this.path?Dh.extractUrlBase(r):this.path;this.resourcePath=this.resourcePath||e;var n=new qu(o.manager);n.setPath(this.path),n.load(r,function(t){var e=null;try{e=JSON.parse(t)}catch(t){return void 0!==a&&a(t),void console.error("THREE:ObjectLoader: Can't parse "+r+".",t.message)}var n=e.metadata;void 0!==n&&void 0!==n.type&&"geometry"!==n.type.toLowerCase()?o.parse(e,i):console.error("THREE.ObjectLoader: Can't load "+r)},t,a)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var n=this.parseShape(t.shapes),r=this.parseGeometries(t.geometries,n),i=this.parseImages(t.images,function(){void 0!==e&&e(s)}),a=this.parseTextures(t.textures,i),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,r,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,r=t.length;n<r;n++){var i=(new wh).fromJSON(t[n]);e[i.uuid]=i}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var r=new Bh,i=0,a=t.length;i<a;i++){var o,s=t[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new mu[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new mu[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new mu[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new mu[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new mu[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new mu[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new mu[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new mu[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new mu[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new mu[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":o=new mu[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new mu[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],u=0,h=s.shapes.length;u<h;u++){var l=e[s.shapes[u]];c.push(l)}o=new mu[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],u=0,h=s.shapes.length;u<h;u++){l=e[s.shapes[u]];c.push(l)}var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new yh[d.type]).fromJSON(d)),o=new mu[s.type](c,s.options);break;case"BufferGeometry":o=r.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE)o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry;else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(t,e){var n={},r={};if(void 0!==t){var i=new Ih;i.setTextures(e);for(var a=0,o=t.length;a<o;a++){var s=t[a];if("MultiMaterial"===s.type){for(var c=[],u=0;u<s.materials.length;u++){var h=s.materials[u];void 0===n[h.uuid]&&(n[h.uuid]=i.parse(h)),c.push(n[h.uuid])}r[s.uuid]=c}else r[s.uuid]=i.parse(s),n[s.uuid]=r[s.uuid]}}return r},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i=Fu.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),e.push(i)}return e},parseImages:function(t,e){var n=this,r={};function i(t){return n.manager.itemStart(t),a.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}if(void 0!==t&&0<t.length){var a=new Zu(new Vu(e));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var c=t[o],u=c.url;if(Array.isArray(u)){r[c.uuid]=[];for(var h=0,l=u.length;h<l;h++){var d=u[h],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;r[c.uuid].push(i(p))}}else{p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.resourcePath+c.url;r[c.uuid]=i(p)}}}return r},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var r={};if(void 0!==t)for(var i=0,a=t.length;i<a;i++){var o,s=t[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=new(Array.isArray(e[s.image])?Oa:qn)(e[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,Vh)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],jh),o.wrapT=n(s.wrap[1],jh)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,Wh)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,Wh)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(t,e,a){var n;function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function i(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];void 0===a[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),e.push(a[i])}return e}return void 0===a[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),a[t]}}switch(t.type){case"Scene":n=new Us,void 0!==t.background&&Number.isInteger(t.background)&&(n.background=new lr(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new zs(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new Ns(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":n=new ts(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new Lh(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new Rh(t.color,t.intensity);break;case"DirectionalLight":n=new Ch(t.color,t.intensity);break;case"PointLight":n=new Ah(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new Oh(t.color,t.intensity,t.width,t.height);break;case"SpotLight":n=new Th(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":n=new Mh(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=r(t.geometry),s=i(t.material);n=new(o.bones&&0<o.bones.length?Ws:ya)(o,s);break;case"LOD":n=new js;break;case"Line":n=new Js(r(t.geometry),i(t.material),t.mode);break;case"LineLoop":n=new Qs(r(t.geometry),i(t.material));break;case"LineSegments":n=new Zs(r(t.geometry),i(t.material));break;case"PointCloud":case"Points":n=new $s(r(t.geometry),i(t.material));break;case"Sprite":n=new ks(i(t.material));break;case"Group":n=new Ko;break;default:n=new Vr}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children)for(var c=t.children,u=0;u<c.length;u++)n.add(this.parseObject(c[u],e,a));if("LOD"===t.type)for(var h=t.levels,l=0;l<h.length;l++){var d=h[l],p=n.getObjectByProperty("uuid",d.object);void 0!==p&&n.addLevel(p,d.distance)}return n}});var Uh,Gh,Fh,Hh,kh,Vh={UVMapping:Ct,CubeReflectionMapping:Rt,CubeRefractionMapping:Ot,EquirectangularReflectionMapping:It,EquirectangularRefractionMapping:Dt,SphericalReflectionMapping:Bt,CubeUVReflectionMapping:Nt,CubeUVRefractionMapping:zt},jh={RepeatWrapping:Ut,ClampToEdgeWrapping:Gt,MirroredRepeatWrapping:Ft},Wh={NearestFilter:Ht,NearestMipMapNearestFilter:kt,NearestMipMapLinearFilter:Vt,LinearFilter:jt,LinearMipMapNearestFilter:Wt,LinearMipMapLinearFilter:qt};function qh(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==t?t:ju,this.options=void 0}function Xh(){this.type="ShapePath",this.color=new lr,this.subPaths=[],this.currentPath=null}function Yh(t){this.type="Font",this.data=t}function Jh(t,e,n,r,i){var a=i.glyphs[t]||i.glyphs["?"];if(a){var o,s,c,u,h,l,d,p,f=new Xh;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":o=m[g++]*e+n,s=m[g++]*e+r,f.moveTo(o,s);break;case"l":o=m[g++]*e+n,s=m[g++]*e+r,f.lineTo(o,s);break;case"q":c=m[g++]*e+n,u=m[g++]*e+r,h=m[g++]*e+n,l=m[g++]*e+r,f.quadraticCurveTo(h,l,c,u);break;case"b":c=m[g++]*e+n,u=m[g++]*e+r,h=m[g++]*e+n,l=m[g++]*e+r,d=m[g++]*e+n,p=m[g++]*e+r,f.bezierCurveTo(h,l,d,p,c,u)}}return{offsetX:a.ha*e,path:f}}}function Zh(t){this.manager=void 0!==t?t:ju}function Qh(){}qh.prototype={constructor:qh,setOptions:function(t){return this.options=t,this},load:function(e,n,t,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=ku.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){n&&n(a),i.manager.itemEnd(e)},0),a;fetch(e).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,i.options)}).then(function(t){ku.add(e,t),n&&n(t),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign(Xh.prototype,{moveTo:function(t,e){this.currentPath=new bh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,r){this.currentPath.quadraticCurveTo(t,e,n,r)},bezierCurveTo:function(t,e,n,r,i,a){this.currentPath.bezierCurveTo(t,e,n,r,i,a)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function n(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n],a=new wh;a.curves=i.curves,e.push(a)}return e}function r(t,e){for(var n=e.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=e[i],s=e[a],c=s.x-o.x,u=s.y-o.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(o=e[a],c=-c,s=e[i],u=-u),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return 1}else{var h=u*(t.x-o.x)-c*(t.y-o.y);if(0==h)return 1;if(h<0)continue;r=!r}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return 1}}return r}var i=jc.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===e)return n(a);var o,s,c,u=[];if(1===a.length)return s=a[0],(c=new wh).curves=s.curves,u.push(c),u;var h=!i(a[0].getPoints());h=t?!h:h;var l,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=i(l=(s=a[v]).getPoints()),(o=t?!o:o)?(!h&&f[g]&&g++,f[g]={s:new wh,p:l},f[g].s.curves=s.curves,h&&g++,m[g]=[]):m[g].push({h:s,p:l[0]});if(!f[0])return n(a);if(1<f.length){for(var x=!1,b=[],w=0,_=f.length;w<_;w++)p[w]=[];for(w=0,_=f.length;w<_;w++)for(var M=m[w],E=0;E<M.length;E++){for(var S=M[E],T=!0,A=0;A<f.length;A++)r(S.p,f[A].p)&&(w!==A&&b.push({froms:w,tos:A,hole:E}),T?(T=!1,p[A].push(S)):x=!0);T&&p[w].push(S)}0<b.length&&(x||(m=p))}v=0;for(var L=f.length;v<L;v++){c=f[v].s,u.push(c);for(var P=0,C=(d=m[v]).length;P<C;P++)c.holes.push(d[P].h)}return u}}),Object.assign(Yh.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],r=function(t,e,n){for(var r=Array.from?Array.from(t):String(t).split(""),i=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,c=0,u=0;u<r.length;u++){var h=r[u];if("\n"===h)s=0,c-=a;else{var l=Jh(h,i,s,c,n);s+=l.offsetX,o.push(l.path)}}return o}(t,e,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),Object.assign(Zh.prototype,{load:function(t,r,e,n){var i=this,a=new qu(this.manager);a.setPath(this.path),a.load(t,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var t=i.parse(n);r&&r(t)},e,n)},parse:function(t){return new Yh(t)},setPath:function(t){return this.path=t,this}}),Qh.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,n=0,r=e.length;n<r;n+=2){var i=e[n],a=e[n+1];if(i.test(t))return a}return null}},Object.assign(Qh.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var r=[],i=0;i<t.length;++i)r[i]=this.createMaterial(t[i],e,n);return r},createMaterial:(Uh={NoBlending:Z,NormalBlending:Q,AdditiveBlending:K,SubtractiveBlending:$,MultiplyBlending:tt,CustomBlending:et},Gh=new lr,Fh=new Ku,Hh=new Ih,function(t,u,h){var l={};function e(t,e,n,r,i){var a,o=u+t,s=Qh.Handlers.get(o);a=null!==s?s.load(o):(Fh.setCrossOrigin(h),Fh.load(o)),void 0!==e&&(a.repeat.fromArray(e),1!==e[0]&&(a.wrapS=Ut),1!==e[1]&&(a.wrapT=Ut)),void 0!==n&&a.offset.fromArray(n),void 0!==r&&("repeat"===r[0]&&(a.wrapS=Ut),"mirror"===r[0]&&(a.wrapS=Ft),"repeat"===r[1]&&(a.wrapT=Ut),"mirror"===r[1]&&(a.wrapT=Ft)),void 0!==i&&(a.anisotropy=i);var c=cn.generateUUID();return l[c]=a,c}var n={uuid:cn.generateUUID(),type:"MeshLambertMaterial"};for(var r in t){var i=t[r];switch(r){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":n.name=i;break;case"blending":n.blending=Uh[i];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",r,"is no longer supported.");break;case"colorDiffuse":n.color=Gh.fromArray(i).getHex();break;case"colorSpecular":n.specular=Gh.fromArray(i).getHex();break;case"colorEmissive":n.emissive=Gh.fromArray(i).getHex();break;case"specularCoef":n.shininess=i;break;case"shading":"basic"===i.toLowerCase()&&(n.type="MeshBasicMaterial"),"phong"===i.toLowerCase()&&(n.type="MeshPhongMaterial"),"standard"===i.toLowerCase()&&(n.type="MeshStandardMaterial");break;case"mapDiffuse":n.map=e(i,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":n.emissiveMap=e(i,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":n.lightMap=e(i,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":n.aoMap=e(i,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":n.bumpMap=e(i,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":n.bumpScale=i;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":n.normalMap=e(i,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":n.normalScale=i;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":n.specularMap=e(i,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":n.metalnessMap=e(i,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":n.roughnessMap=e(i,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":n.alphaMap=e(i,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":n.side=Mt;break;case"doubleSided":n.side=J;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),n.opacity=i;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":n[r]=i;break;case"vertexColors":!0===i&&(n.vertexColors=N),"face"===i&&(n.vertexColors=D);break;default:console.error("THREE.Loader.createMaterial: Unsupported",r,i)}}return"MeshBasicMaterial"===n.type&&delete n.emissive,"MeshPhongMaterial"!==n.type&&delete n.specular,n.opacity<1&&(n.transparent=!0),Hh.setTextures(l),Hh.parse(n)})});var Kh,$h,tl,el,nl,rl,il,al,ol,sl,cl,ul,hl,ll,dl,pl,fl,ml,gl,vl={getContext:function(){return void 0===kh&&(kh=new(window.AudioContext||window.webkitAudioContext)),kh},setContext:function(t){kh=t}};function yl(t){this.manager=void 0!==t?t:ju}function xl(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ts,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ts,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function bl(t,e,n,r){Vr.call(this),this.type="CubeCamera";var i=new ts(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new dn(1,0,0)),this.add(i);var a=new ts(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new dn(-1,0,0)),this.add(a);var o=new ts(90,1,t,e);o.up.set(0,0,1),o.lookAt(new dn(0,1,0)),this.add(o);var s=new ts(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new dn(0,-1,0)),this.add(s);var c=new ts(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new dn(0,0,1)),this.add(c);var u=new ts(90,1,t,e);u.up.set(0,-1,0),u.lookAt(new dn(0,0,-1)),this.add(u),r=r||{format:oe,magFilter:jt,minFilter:jt},this.renderTarget=new Jn(n,n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,r=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,t.render(e,i,n),n.activeCubeFace=1,t.render(e,a,n),n.activeCubeFace=2,t.render(e,o,n),n.activeCubeFace=3,t.render(e,s,n),n.activeCubeFace=4,t.render(e,c,n),n.texture.generateMipmaps=r,n.activeCubeFace=5,t.render(e,u,n),t.setRenderTarget(null)},this.clear=function(t,e,n,r){for(var i=this.renderTarget,a=0;a<6;a++)i.activeCubeFace=a,t.setRenderTarget(i),t.clear(e,n,r);t.setRenderTarget(null)}}function wl(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function _l(){Vr.call(this),this.type="AudioListener",this.context=vl.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function Ml(t){Vr.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function El(t){Ml.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Sl(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Tl(t,e,n){this.binding=t,this.valueSize=n;var r,i=Float64Array;switch(e){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(yl.prototype,{load:function(t,n,e,r){var i=new qu(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(t,function(t){var e=t.slice(0);vl.getContext().decodeAudioData(e,function(t){n(t)})},e,r)},setPath:function(t){return this.path=t,this}}),Object.assign(xl.prototype,{update:(ol=new hn,sl=new hn,function(t){if(Kh!==this||$h!==t.focus||tl!==t.fov||el!==t.aspect*this.aspect||nl!==t.near||rl!==t.far||il!==t.zoom||al!==this.eyeSep){Kh=this,$h=t.focus,tl=t.fov,el=t.aspect*this.aspect,nl=t.near,rl=t.far,il=t.zoom;var e,n,r=t.projectionMatrix.clone(),i=(al=this.eyeSep/2)*nl/$h,a=nl*Math.tan(cn.DEG2RAD*tl*.5)/il;sl.elements[12]=-al,ol.elements[12]=al,e=-a*el+i,n=a*el+i,r.elements[0]=2*nl/(n-e),r.elements[8]=(n+e)/(n-e),this.cameraL.projectionMatrix.copy(r),e=-a*el-i,n=a*el-i,r.elements[0]=2*nl/(n-e),r.elements[8]=(n+e)/(n-e),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(sl),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(ol)})}),(bl.prototype=Object.create(Vr.prototype)).constructor=bl,Object.assign(wl.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),_l.prototype=Object.assign(Object.create(Vr.prototype),{constructor:_l,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:(cl=new dn,ul=new ln,hl=new dn,ll=new dn,dl=new wl,function(t){Vr.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=dl.getDelta(),this.matrixWorld.decompose(cl,ul,hl),ll.set(0,0,-1).applyQuaternion(ul),e.positionX){var r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(cl.x,r),e.positionY.linearRampToValueAtTime(cl.y,r),e.positionZ.linearRampToValueAtTime(cl.z,r),e.forwardX.linearRampToValueAtTime(ll.x,r),e.forwardY.linearRampToValueAtTime(ll.y,r),e.forwardZ.linearRampToValueAtTime(ll.z,r),e.upX.linearRampToValueAtTime(n.x,r),e.upY.linearRampToValueAtTime(n.y,r),e.upZ.linearRampToValueAtTime(n.z,r)}else e.setPosition(cl.x,cl.y,cl.z),e.setOrientation(ll.x,ll.y,ll.z,n.x,n.y,n.z)})}),Ml.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Ml,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.detune.value=this.detune,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t=t||[],!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){return this.detune=t,!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),El.prototype=Object.assign(Object.create(Ml.prototype),{constructor:El,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:(pl=new dn,fl=new ln,ml=new dn,gl=new dn,function(t){if(Vr.prototype.updateMatrixWorld.call(this,t),!1!==this.isPlaying){this.matrixWorld.decompose(pl,fl,ml),gl.set(0,0,1).applyQuaternion(fl);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(pl.x,n),e.positionY.linearRampToValueAtTime(pl.y,n),e.positionZ.linearRampToValueAtTime(pl.z,n),e.orientationX.linearRampToValueAtTime(gl.x,n),e.orientationY.linearRampToValueAtTime(gl.y,n),e.orientationZ.linearRampToValueAtTime(gl.z,n)}else e.setPosition(pl.x,pl.y,pl.z),e.setOrientation(gl.x,gl.y,gl.z)}})}),Object.assign(Sl.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Tl.prototype,{accumulate:function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=e}else{var s=e/(a+=e);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*e;this._mixBufferRegion(n,r,o,1-i,e)}for(var s=e,c=e+e;s!==c;++s)if(n[s]!==n[s+e]){a.setValue(n,r);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=3*n;t.getValue(e,r);for(var i=n,a=r;i!==a;++i)e[i]=e[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,r,i){if(.5<=r)for(var a=0;a!==i;++a)t[e+a]=t[n+a]},_slerp:function(t,e,n,r){ln.slerpFlat(t,e,t,e,t,n,r)},_lerp:function(t,e,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=e+o;t[s]=t[s]*a+t[n+o]*r}}});var Al,Ll,Pl,Cl,Rl,Ol,Il,Dl,Bl,Nl,zl,Ul,Gl,Fl,Hl,kl,Vl,jl,Wl,ql,Xl,Yl,Jl,Zl,Ql,Kl,$l,td,ed,nd,rd,id,ad,od,sd,cd,ud,hd,ld="\\[\\]\\.:\\/";function dd(t,e,n){var r=n||pd.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function pd(t,e,n){this.path=e,this.parsedPath=n||pd.parseTrackName(e),this.node=pd.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function fd(){this.uuid=cn.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function md(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var r=e.tracks,i=r.length,a=new Array(i),o={endingStart:Ve,endingEnd:Ve},s=0;s!==i;++s){var c=r[s].createInterpolant(null);(a[s]=c).settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ue,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}function gd(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function vd(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function yd(){_i.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function xd(t,e,n){Gs.call(this,t,e),this.meshPerAttribute=n||1}function bd(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),$r.call(this,t,e,n),this.meshPerAttribute=r||1}function wd(t,e,n,r){this.ray=new ma(t,e),this.near=n||0,this.far=r||1/0,this.params={Mesh:{},Line:{},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 _d(t,e){return t.distance-e.distance}function Md(t,e,n,r){if(!1!==t.visible&&(t.raycast(e,n),!0===r))for(var i=t.children,a=0,o=i.length;a<o;a++)Md(i[a],e,n,!0)}function Ed(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function Sd(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}function Td(t,e){this.min=void 0!==t?t:new un(1/0,1/0),this.max=void 0!==e?e:new un(-1/0,-1/0)}function Ad(t,e){this.start=void 0!==t?t:new dn,this.end=void 0!==e?e:new dn}function Ld(t){Vr.call(this),this.material=t,this.render=function(){}}function Pd(t,e,n,r){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==n?n:16711680,a=void 0!==r?r:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var c=new _i,u=new si(2*o*3,3);c.addAttribute("position",u),Zs.call(this,c,new Ys({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Cd(t,e){Vr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new _i,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new si(r,3));var c=new Ys({fog:!1});this.cone=new Zs(n,c),this.add(this.cone),this.update()}function Rd(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var r=0;r<e.children.length;r++)n.push.apply(n,t(e.children[r]));return n}(t),n=new _i,r=[],i=[],a=new lr(0,0,1),o=new lr(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.addAttribute("position",new si(r,3)),n.addAttribute("color",new si(i,3));var u=new Ys({vertexColors:N,depthTest:!1,depthWrite:!1,transparent:!0});Zs.call(this,n,u),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Od(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var r=new tu(e,4,2),i=new va({wireframe:!0,fog:!1});ya.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Id(t,e){this.type="RectAreaLightHelper",this.light=t,this.color=e;var n=new _i;n.addAttribute("position",new si([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere();var r=new Ys({fog:!1});Js.call(this,n,r);var i=new _i;i.addAttribute("position",new si([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),i.computeBoundingSphere(),this.add(new ya(i,new va({side:THREE.BackSide,fog:!1}))),this.update()}function Dd(t,e,n){Vr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new dc(e);r.rotateY(.5*Math.PI),this.material=new va({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=N);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.addAttribute("color",new $r(a,3)),this.add(new ya(r,this.material)),this.update()}function Bd(t,e,n,r){t=t||10,e=e||10,n=new lr(void 0!==n?n:4473924),r=new lr(void 0!==r?r:8947848);for(var i=e/2,a=t/e,o=t/2,s=[],c=[],u=0,h=0,l=-o;u<=e;u++,l+=a){s.push(-o,0,l,o,0,l),s.push(l,0,-o,l,0,o);var d=u===i?n:r;d.toArray(c,h),h+=3,d.toArray(c,h),h+=3,d.toArray(c,h),h+=3,d.toArray(c,h),h+=3}var p=new _i;p.addAttribute("position",new si(s,3)),p.addAttribute("color",new si(c,3));var f=new Ys({vertexColors:N});Zs.call(this,p,f)}function Nd(t,e,n,r,i,a){t=t||10,e=e||16,n=n||8,r=r||64,i=new lr(void 0!==i?i:4473924),a=new lr(void 0!==a?a:8947848);var o,s,c,u,h,l,d,p=[],f=[];for(u=0;u<=e;u++)c=u/e*(2*Math.PI),o=Math.sin(c)*t,s=Math.cos(c)*t,p.push(0,0,0),p.push(o,0,s),d=1&u?i:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(u=0;u<=n;u++)for(d=1&u?i:a,l=t-t/n*u,h=0;h<r;h++)c=h/r*(2*Math.PI),o=Math.sin(c)*l,s=Math.cos(c)*l,p.push(o,0,s),f.push(d.r,d.g,d.b),c=(h+1)/r*(2*Math.PI),o=Math.sin(c)*l,s=Math.cos(c)*l,p.push(o,0,s),f.push(d.r,d.g,d.b);var m=new _i;m.addAttribute("position",new si(p,3)),m.addAttribute("color",new si(f,3));var g=new Ys({vertexColors:N});Zs.call(this,m,g)}function zd(t,e,n,r){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==n?n:16776960,a=void 0!==r?r:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new _i,u=new si(2*o*3,3);c.addAttribute("position",u),Zs.call(this,c,new Ys({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Ud(t,e,n){Vr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var r=new _i;r.addAttribute("position",new si([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new Ys({fog:!1});this.lightPlane=new Js(r,i),this.add(this.lightPlane),(r=new _i).addAttribute("position",new si([0,0,0,0,0,1],3)),this.targetLine=new Js(r,i),this.add(this.targetLine),this.update()}function Gd(t){var e=new _i,n=new Ys({color:16777215,vertexColors:D}),r=[],i=[],a={},o=new lr(16755200),s=new lr(16711680),c=new lr(43775),u=new lr(16777215),h=new lr(3355443);function l(t,e,n){d(t,n),d(e,n)}function d(t,e){r.push(0,0,0),i.push(e.r,e.g,e.b),void 0===a[t]&&(a[t]=[]),a[t].push(r.length/3-1)}l("n1","n2",o),l("n2","n4",o),l("n4","n3",o),l("n3","n1",o),l("f1","f2",o),l("f2","f4",o),l("f4","f3",o),l("f3","f1",o),l("n1","f1",o),l("n2","f2",o),l("n3","f3",o),l("n4","f4",o),l("p","n1",s),l("p","n2",s),l("p","n3",s),l("p","n4",s),l("u1","u2",c),l("u2","u3",c),l("u3","u1",c),l("c","t",u),l("p","c",h),l("cn1","cn2",h),l("cn3","cn4",h),l("cf1","cf2",h),l("cf3","cf4",h),e.addAttribute("position",new si(r,3)),e.addAttribute("color",new si(i,3)),Zs.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Fd(t,e,n,r){id.set(e,n,r).unproject(ad);var i=rd[t];if(void 0!==i)for(var a=nd.getAttribute("position"),o=0,s=i.length;o<s;o++)a.setXYZ(i[o],id.x,id.y,id.z)}function Hd(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new _i;i.setIndex(new $r(n,1)),i.addAttribute("position",new $r(r,3)),Zs.call(this,i,new Ys({color:e})),this.matrixAutoUpdate=!1,this.update()}function kd(t,e){this.type="Box3Helper",this.box=t;var n=void 0!==e?e:16776960,r=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]),i=new _i;i.setIndex(new $r(r,1)),i.addAttribute("position",new si([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Zs.call(this,i,new Ys({color:n})),this.geometry.computeBoundingSphere()}function Vd(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var r=void 0!==n?n:16776960,i=new _i;i.addAttribute("position",new si([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],3)),i.computeBoundingSphere(),Js.call(this,i,new Ys({color:r}));var a=new _i;a.addAttribute("position",new si([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new ya(a,new va({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}function jd(t,e,n,r,i,a){Vr.call(this),void 0===t&&(t=new THREE.Vector3(0,0,1)),void 0===e&&(e=new THREE.Vector3(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===sd&&((sd=new _i).addAttribute("position",new si([0,0,0,0,1,0],3)),(cd=new hu(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new Js(sd,new Ys({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ya(cd,new va({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,i,a)}function Wd(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new _i;n.addAttribute("position",new si(e,3)),n.addAttribute("color",new si([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Ys({vertexColors:N});Zs.call(this,n,r)}function qd(t,e,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new wr(t,e,n,i,a,o)}Object.assign(dd.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(pd,{Composite:dd,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new pd.Composite(t,e,n):new pd(t,e,n)},sanitizeNodeName:(Bl=new RegExp("["+ld+"]","g"),function(t){return t.replace(/\s/g,"_").replace(Bl,"")}),parseTrackName:(Al="[^"+ld+"]",Ll="[^"+ld.replace("\\.","")+"]",Pl=/((?:WC+[\/:])*)/.source.replace("WC",Al),Cl=/(WCOD+)?/.source.replace("WCOD",Ll),Rl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Al),Ol=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Al),Il=new RegExp("^"+Pl+Cl+Rl+Ol+"$"),Dl=["material","materials","bones"],function(t){var e=Il.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==Dl.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}),findNode:function(t,i){if(!i||""===i||"root"===i||"."===i||-1===i||i===t.name||i===t.uuid)return t;if(t.skeleton){var e=t.skeleton.getBoneByName(i);if(void 0!==e)return e}if(t.children){var a=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.name===i||n.uuid===i)return n;var r=a(n.children);if(r)return r}return null},n=a(t.children);if(n)return n}return null}}),Object.assign(pd.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,r=e.propertyName,i=e.propertyIndex;if(t||(t=pd.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[r];if(void 0!==s){var c=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(t.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(t.geometry.morphTargets[o].name===i){i=o;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}else{var h=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+r+" but it wasn't found.",t)}}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}}),
//!\ DECLARE ALIAS AFTER assign prototype !
Object.assign(pd.prototype,{_getValue_unbound:pd.prototype.getValue,_setValue_unbound:pd.prototype.setValue}),Object.assign(fd.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,u=0,h=arguments.length;u!==h;++u){var l=arguments[u],d=l.uuid,p=r[d];if(void 0===p){p=e++,r[d]=p,t.push(l);for(var f=0,m=s;f!==m;++f)o[f].push(new pd(l,i[f],a[f]))}else if(p<n){c=t[p];var g=--n,v=t[g];t[r[v.uuid]=p]=v,t[r[d]=g]=l;for(f=0,m=s;f!==m;++f){var y=o[f],x=y[g],b=y[p];y[p]=x,void 0===b&&(b=new pd(l,i[f],a[f])),y[g]=b}}else t[p]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,u=n[c];if(void 0!==u&&e<=u){var h=e++,l=t[h];t[n[l.uuid]=u]=l,t[n[c]=h]=s;for(var d=0,p=i;d!==p;++d){var f=r[d],m=f[h],g=f[u];f[u]=m,f[h]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o].uuid,u=r[c];if(void 0!==u)if(delete r[c],u<n){var h=--n,l=t[h],d=t[v=--e];t[r[l.uuid]=u]=l,t[r[d.uuid]=h]=d,t.pop();for(var p=0,f=a;p!==f;++p){var m=(y=i[p])[h],g=y[v];y[u]=m,y[h]=g,y.pop()}}else{var v;t[r[(d=t[v=--e]).uuid]=u]=d,t.pop();for(p=0,f=a;p!==f;++p){var y;(y=i[p])[u]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,h=new Array(c);r=i.length,n[t]=r,a.push(t),o.push(e),i.push(h);for(var l=u,d=s.length;l!==d;++l){var p=s[l];h[l]=new pd(p,t,e)}return h},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];a[e[t[o]]=n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(md.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var r=this._clip.duration,i=t._clip.duration,a=i/r,o=r/i;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+n,c[0]=t/o,c[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(t-i)*n;if(a<0||0===n)return;this._startTime=null,e=n*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(0<s)for(var c=this._interpolants,u=this._propertyBindings,h=0,l=c.length;h!==l;++h)c[h].evaluate(o),u[h].accumulate(r,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,r=this.loop,i=this._loopCount,a=r===Ge;if(0===t)return-1!==i&&a&&1==(1&i)?n-e:e;if(r===ze){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n<=e)e=n;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(0<=t?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n<=e||e<0){var o=Math.floor(e/n);e-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=0<t?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});else{if(1==s){var c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1==(1&i))return n-(this.time=e)}return this.time=e},_setEndings:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=je,r.endingEnd=je):(r.endingStart=t?this.zeroSlopeAtStart?je:Ve:We,r.endingEnd=e?this.zeroSlopeAtEnd?je:Ve:We)},_scheduleFading:function(t,e,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=e,o[1]=i+t,s[1]=n,this}}),gd.prototype=Object.assign(Object.create(r.prototype),{constructor:gd,_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,a=t._propertyBindings,o=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var h=0;h!==i;++h){var l=r[h],d=l.name,p=u[d];if(void 0!==p)a[h]=p;else{if(void 0!==(p=a[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[h].binding.parsedPath;++(p=new Tl(pd.create(n,d,f),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[h]=p}o[h].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var r=this._actions,i=this._actionsByClip,a=i[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=r.length,r.push(t),a.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;e[n._cacheIndex=r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],u=t._byClipCacheIndex;s[c._byClipCacheIndex=u]=c,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_addInactiveBinding:function(t,e,n){var r=this._bindingsByRootAndName,i=r[e],a=this._bindings;void 0===i&&(i={},r[e]=i),(i[n]=t)._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=e[e.length-1],c=t._cacheIndex;e[s._cacheIndex=c]=s,e.pop(),delete o[i];t:{for(var u in o)break t;delete a[r]}},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(t[(n=new Cu(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];e[t.__cacheIndex=r]=t,e[i.__cacheIndex=n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?Fu.findByName(n,t):t,a=null!==i?i.uuid:t,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[r];if(void 0!==c)return c;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var u=new md(this,i,e);return this._bindAction(u,s),this._addInactiveAction(u,a,r),u},existingAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?Fu.findByName(n,t):t,a=i?i.uuid:t,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0;for(var i=this._nActiveBindings=0;i!==e;++i)t[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),a=this._accuIndex^=1,o=0;o!==n;++o){e[o]._update(r,t,i,a)}var s=this._bindings,c=this._nActiveBindings;for(o=0;o!==c;++o)s[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var u=c._cacheIndex,h=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,e[h._cacheIndex=u]=h,e.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[e];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),vd.prototype.clone=function(){return new vd(void 0===this.value.clone?this.value:this.value.clone())},yd.prototype=Object.assign(Object.create(_i.prototype),{constructor:yd,isInstancedBufferGeometry:!0,copy:function(t){return _i.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),xd.prototype=Object.assign(Object.create(Gs.prototype),{constructor:xd,isInstancedInterleavedBuffer:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),bd.prototype=Object.assign(Object.create($r.prototype),{constructor:bd,isInstancedBufferAttribute:!0,copy:function(t){return $r.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(wd.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var r=n||[];return Md(t,this,r,e),r.sort(_d),r},intersectObjects:function(t,e,n){var r=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=t.length;i<a;i++)Md(t[i],this,r,e);return r.sort(_d),r}}),Object.assign(Ed.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(cn.clamp(e/this.radius,-1,1))),this}}),Object.assign(Sd.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}}),Object.assign(Td.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(zl=new un,function(t,e){var n=zl.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new un),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new un),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new un),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new un),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(Nl=new un,function(t){return Nl.copy(t).clamp(this.min,this.max).sub(t).length()}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Ad.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new dn),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new dn),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new dn),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(Ul=new dn,Gl=new dn,function(t,e){Ul.subVectors(t,this.start),Gl.subVectors(this.end,this.start);var n=Gl.dot(Gl),r=Gl.dot(Ul)/n;return e&&(r=cn.clamp(r,0,1)),r}),closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new dn),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),((Ld.prototype=Object.create(Vr.prototype)).constructor=Ld).prototype.isImmediateRenderObject=!0,((Pd.prototype=Object.create(Zs.prototype)).constructor=Pd).prototype.update=(Fl=new dn,Hl=new dn,kl=new pn,function(){var t=["a","b","c"];this.object.updateMatrixWorld(!0),kl.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,n=this.geometry.attributes.position,r=this.object.geometry;if(r&&r.isGeometry)for(var i=r.vertices,a=r.faces,o=0,s=0,c=a.length;s<c;s++)for(var u=a[s],h=0,l=u.vertexNormals.length;h<l;h++){var d=i[u[t[h]]],p=u.vertexNormals[h];Fl.copy(d).applyMatrix4(e),Hl.copy(p).applyMatrix3(kl).normalize().multiplyScalar(this.size).add(Fl),n.setXYZ(o,Fl.x,Fl.y,Fl.z),o+=1,n.setXYZ(o,Hl.x,Hl.y,Hl.z),o+=1}else if(r&&r.isBufferGeometry){var f=r.attributes.position,m=r.attributes.normal;for(h=o=0,l=f.count;h<l;h++)Fl.set(f.getX(h),f.getY(h),f.getZ(h)).applyMatrix4(e),Hl.set(m.getX(h),m.getY(h),m.getZ(h)),Hl.applyMatrix3(kl).normalize().multiplyScalar(this.size).add(Fl),n.setXYZ(o,Fl.x,Fl.y,Fl.z),o+=1,n.setXYZ(o,Hl.x,Hl.y,Hl.z),o+=1}n.needsUpdate=!0}),((Cd.prototype=Object.create(Vr.prototype)).constructor=Cd).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Cd.prototype.update=(Vl=new dn,function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Vl.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Vl),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}),((Rd.prototype=Object.create(Zs.prototype)).constructor=Rd).prototype.updateMatrixWorld=(jl=new dn,Wl=new hn,ql=new hn,function(t){var e=this.bones,n=this.geometry,r=n.getAttribute("position");ql.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<e.length;i++){var o=e[i];o.parent&&o.parent.isBone&&(Wl.multiplyMatrices(ql,o.matrixWorld),jl.setFromMatrixPosition(Wl),r.setXYZ(a,jl.x,jl.y,jl.z),Wl.multiplyMatrices(ql,o.parent.matrixWorld),jl.setFromMatrixPosition(Wl),r.setXYZ(a+1,jl.x,jl.y,jl.z),a+=2)}n.getAttribute("position").needsUpdate=!0,Vr.prototype.updateMatrixWorld.call(this,t)}),((Od.prototype=Object.create(ya.prototype)).constructor=Od).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Od.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},((Id.prototype=Object.create(Js.prototype)).constructor=Id).prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var t=this.material.color,e=Math.max(t.r,t.g,t.b);1<e&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}},Id.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},((Dd.prototype=Object.create(Vr.prototype)).constructor=Dd).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Dd.prototype.update=(Xl=new dn,Yl=new lr,Jl=new lr,function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");Yl.copy(this.light.color),Jl.copy(this.light.groundColor);for(var n=0,r=e.count;n<r;n++){var i=n<r/2?Yl:Jl;e.setXYZ(n,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt(Xl.setFromMatrixPosition(this.light.matrixWorld).negate())}),(Bd.prototype=Object.create(Zs.prototype)).constructor=Bd,(Nd.prototype=Object.create(Zs.prototype)).constructor=Nd,((zd.prototype=Object.create(Zs.prototype)).constructor=zd).prototype.update=(Zl=new dn,Ql=new dn,Kl=new pn,function(){this.object.updateMatrixWorld(!0),Kl.getNormalMatrix(this.object.matrixWorld);for(var t=this.object.matrixWorld,e=this.geometry.attributes.position,n=this.object.geometry,r=n.vertices,i=n.faces,a=0,o=0,s=i.length;o<s;o++){var c=i[o],u=c.normal;Zl.copy(r[c.a]).add(r[c.b]).add(r[c.c]).divideScalar(3).applyMatrix4(t),Ql.copy(u).applyMatrix3(Kl).normalize().multiplyScalar(this.size).add(Zl),e.setXYZ(a,Zl.x,Zl.y,Zl.z),a+=1,e.setXYZ(a,Ql.x,Ql.y,Ql.z),a+=1}e.needsUpdate=!0}),((Ud.prototype=Object.create(Vr.prototype)).constructor=Ud).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Ud.prototype.update=($l=new dn,td=new dn,ed=new dn,function(){$l.setFromMatrixPosition(this.light.matrixWorld),td.setFromMatrixPosition(this.light.target.matrixWorld),ed.subVectors(td,$l),this.lightPlane.lookAt(td),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(td),this.targetLine.scale.z=ed.length()}),((Gd.prototype=Object.create(Zs.prototype)).constructor=Gd).prototype.update=(id=new dn,ad=new $o,function(){nd=this.geometry,rd=this.pointMap,ad.projectionMatrix.copy(this.camera.projectionMatrix),Fd("c",0,0,-1),Fd("t",0,0,1),Fd("n1",-1,-1,-1),Fd("n2",1,-1,-1),Fd("n3",-1,1,-1),Fd("n4",1,1,-1),Fd("f1",-1,-1,1),Fd("f2",1,-1,1),Fd("f3",-1,1,1),Fd("f4",1,1,1),Fd("u1",.7,1.1,-1),Fd("u2",-.7,1.1,-1),Fd("u3",0,2,-1),Fd("cf1",-1,0,1),Fd("cf2",1,0,1),Fd("cf3",0,-1,1),Fd("cf4",0,1,1),Fd("cn1",-1,0,-1),Fd("cn2",1,0,-1),Fd("cn3",0,-1,-1),Fd("cn4",0,1,-1),nd.getAttribute("position").needsUpdate=!0}),((Hd.prototype=Object.create(Zs.prototype)).constructor=Hd).prototype.update=(od=new Qn,function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&od.setFromObject(this.object),!od.isEmpty()){var e=od.min,n=od.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}),Hd.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Hd.prototype.copy=function(t){return Zs.prototype.copy.call(this,t),this.object=t.object,this},Hd.prototype.clone=function(){return(new this.constructor).copy(this)},((kd.prototype=Object.create(Zs.prototype)).constructor=kd).prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Vr.prototype.updateMatrixWorld.call(this,t))},((Vd.prototype=Object.create(Js.prototype)).constructor=Vd).prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?Mt:B,this.lookAt(this.plane.normal),Vr.prototype.updateMatrixWorld.call(this,t)},((jd.prototype=Object.create(Vr.prototype)).constructor=jd).prototype.setDirection=(hd=new dn,function(t){.99999<t.y?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(hd.set(t.z,0,-t.x).normalize(),ud=Math.acos(t.y),this.quaternion.setFromAxisAngle(hd,ud))}),jd.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},jd.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},jd.prototype.copy=function(t){return Vr.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},jd.prototype.clone=function(){return(new this.constructor).copy(this)},(Wd.prototype=Object.create(Zs.prototype)).constructor=Wd;var Xd,Yd=0,Jd=1;function Zd(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Qd(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,(t.materials=t).clone=function(){return t.slice()},t}function Kd(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new $s(t,e)}function $d(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new ks(t)}function tp(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new $s(t,e)}function ep(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Ks(t)}function np(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Ks(t)}function rp(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Ks(t)}function ip(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new dn(t,e,n)}function ap(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new $r(t,e).setDynamic(!0)}function op(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new ti(t,e)}function sp(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new ei(t,e)}function cp(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ni(t,e)}function up(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new ri(t,e)}function hp(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new ii(t,e)}function lp(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new ai(t,e)}function dp(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new oi(t,e)}function pp(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new si(t,e)}function fp(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new ci(t,e)}function mp(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),sh.call(this,t),this.type="catmullrom",this.closed=!0}function gp(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),sh.call(this,t),this.type="catmullrom"}function vp(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),sh.call(this,t),this.type="catmullrom"}function yp(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Wd(t)}function xp(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Hd(t,e)}function bp(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Zs(new cu(t.geometry),new Ys({color:void 0!==e?e:16777215}))}function wp(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Zs(new ic(t.geometry),new Ys({color:void 0!==e?e:16777215}))}function _p(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new qu(t)}function Mp(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Ju(t)}$u.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create($u.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},Object.assign(xh.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new Kr,n=0,r=t.length;n<r;n++){var i=t[n];e.vertices.push(new dn(i.x,i.y,i.z||0))}return e}}),Object.assign(bh.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),mp.prototype=Object.create(sh.prototype),gp.prototype=Object.create(sh.prototype),vp.prototype=Object.create(sh.prototype),Object.assign(vp.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.")}}),Bd.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Rd.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Qh.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Dh.extractUrlBase(t)}}),Object.assign(zh.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Td.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Qn.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Ad.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(cn,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),cn.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),cn.ceilPowerOfTwo(t)}}),Object.assign(pn.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(hn.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return void 0===Xd&&(Xd=new dn),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),Xd.setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,a)}}),er.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},ln.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(ma.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(ga.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(ga,{barycoordFromPoint:function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ga.getBarycoord(t,e,n,r,i)},normal:function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ga.getNormal(t,e,n,r)}}),Object.assign(wh.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Xc(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new au(this,t)}}),Object.assign(un.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(dn.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Xn.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Kr.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.")}}),Object.assign(Vr.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(Vr.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(js.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(qs.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Ws.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty($u.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),ts.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(_h.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties($r.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(_i.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(_i.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.assign(Yc.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.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(pa.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 lr}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===R}}}),Object.defineProperties(bu.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(fa.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Bs.prototype,{clearTarget:function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")}}),Object.defineProperties(Bs.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Yo.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(Yn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Is.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),Ml.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new yl).load(t,function(t){e.setBuffer(t)}),this},Sl.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},bl.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var Ep={merge:function(t,e,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),r=e.matrix,e=e.geometry),t.merge(e,r,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};function Sp(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function Tp(){console.error("THREE.CanvasRenderer has been removed")}function Ap(){console.error("THREE.JSONLoader has been removed.")}jn.crossOrigin=void 0,jn.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Ku;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,n,void 0,r);return e&&(a.mapping=e),a},jn.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Qu;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,n,void 0,r);return e&&(a.mapping=e),a},jn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},jn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Lp={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};function Pp(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}},function(n,a,t){(function(e){var t,r,i,s=s||(r=[],{getAll:function(){return r},removeAll:function(){r=[]},add:function(t){r.push(t)},remove:function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,1)},update:function(t,e){if(0===r.length)return!1;var n=0;for(t=void 0!==t?t:s.now();n<r.length;)r[n].update(t)||e?n++:r.splice(n,1);return!0}});"undefined"==typeof window&&void 0!==e?s.now=function(){var t=e.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?s.now=window.performance.now.bind(window.performance):void 0!==Date.now?s.now=Date.now:s.now=function(){return(new Date).getTime()},s.Tween=function(t){var u,h=t,l={},d={},p={},f=1e3,m=0,g=!1,n=!1,v=0,y=null,x=s.Easing.Linear.None,b=s.Interpolation.Linear,w=[],_=null,M=!1,E=null,S=null,e=null;this.to=function(t,e){return d=t,void 0!==e&&(f=e),this},this.start=function(t){for(var e in s.add(this),M=!(n=!0),y=void 0!==t?t:s.now(),y+=v,d){if(d[e]instanceof Array){if(0===d[e].length)continue;d[e]=[h[e]].concat(d[e])}void 0!==h[e]&&(l[e]=h[e],l[e]instanceof Array==!1&&(l[e]*=1),p[e]=l[e]||0)}return this},this.stop=function(){return n&&(s.remove(this),n=!1,null!==e&&e.call(h,h),this.stopChainedTweens()),this},this.end=function(){return this.update(y+f),this},this.stopChainedTweens=function(){for(var t=0,e=w.length;t<e;t++)w[t].stop()},this.delay=function(t){return v=t,this},this.repeat=function(t){return m=t,this},this.repeatDelay=function(t){return u=t,this},this.yoyo=function(t){return g=t,this},this.easing=function(t){return x=t,this},this.interpolation=function(t){return b=t,this},this.chain=function(){return w=arguments,this},this.onStart=function(t){return _=t,this},this.onUpdate=function(t){return E=t,this},this.onComplete=function(t){return S=t,this},this.onStop=function(t){return e=t,this},this.update=function(t){var e,n,r;if(t<y)return!0;for(e in!1===M&&(null!==_&&_.call(h,h),M=!0),r=x(n=1<(n=(t-y)/f)?1:n),d)if(void 0!==l[e]){var i=l[e]||0,a=d[e];a instanceof Array?h[e]=b(a,r):("string"==typeof a&&(a="+"===a.charAt(0)||"-"===a.charAt(0)?i+parseFloat(a):parseFloat(a)),"number"==typeof a&&(h[e]=i+(a-i)*r))}if(null!==E&&E.call(h,r),1!==n)return!0;if(0<m){for(e in isFinite(m)&&m--,p){if("string"==typeof d[e]&&(p[e]=p[e]+parseFloat(d[e])),g){var o=p[e];p[e]=d[e],d[e]=o}l[e]=p[e]}return g&&0,y=void 0!==u?t+u:t+v,!0}null!==S&&S.call(h,h);for(var s=0,c=w.length;s<c;s++)w[s].start(y+f);return!1}},s.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return--t*t*(2.70158*t+1.70158)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)}},Bounce:{In:function(t){return 1-s.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*s.Easing.Bounce.In(2*t):.5*s.Easing.Bounce.Out(2*t-1)+.5}}},s.Interpolation={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=s.Interpolation.Utils.Linear;return e<0?a(t[0],t[1],r):1<e?a(t[n],t[n-1],n-r):a(t[i],t[n<i+1?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,a=s.Interpolation.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-e,r-o)*i(e,o)*t[o]*a(r,o);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=s.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),a(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-r)-t[0]):1<e?t[n]-(a(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):a(t[i?i-1:0],t[i],t[n<i+1?n:i+1],t[n<i+2?n:i+2],r-i)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=s.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(i=[1],function(t){var e=1;if(i[t])return i[t];for(var n=t;1<n;n--)e*=n;return i[t]=e}),CatmullRom:function(t,e,n,r,i){var a=.5*(n-t),o=.5*(r-e),s=i*i;return(2*e-2*n+a+o)*(i*s)+(-3*e+3*n-2*a-o)*s+a*i+e}}},void 0===(t=function(){return s}.apply(a,[]))||(n.exports=t)}).call(this,t(3))},function(t,e,n){(function(rt,it){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/
t.exports=function(){"use strict";function r(t){var e=typeof t;return t!==null&&(e==="object"||e==="function")}function c(t){return typeof t==="function"}var t=void 0;if(Array.isArray){t=Array.isArray}else{t=function(t){return Object.prototype.toString.call(t)==="[object Array]"}}var n=t,i=0,e=void 0,a=void 0,o=function t(e,n){b[i]=e;b[i+1]=n;i+=2;if(i===2){if(a){a(w)}else{M()}}};function s(t){a=t}function u(t){o=t}var h=typeof window!=="undefined"?window:undefined,l=h||{},d=l.MutationObserver||l.WebKitMutationObserver,p=typeof self==="undefined"&&typeof rt!=="undefined"&&{}.toString.call(rt)==="[object process]",f=typeof Uint8ClampedArray!=="undefined"&&typeof importScripts!=="undefined"&&typeof MessageChannel!=="undefined";function m(){return function(){return rt.nextTick(w)}}function g(){if(typeof e!=="undefined"){return function(){e(w)}}return x()}function v(){var t=0;var e=new d(w);var n=document.createTextNode("");e.observe(n,{characterData:true});return function(){n.data=t=++t%2}}function y(){var t=new MessageChannel;t.port1.onmessage=w;return function(){return t.port2.postMessage(0)}}function x(){var t=setTimeout;return function(){return t(w,1)}}var b=new Array(1e3);function w(){for(var t=0;t<i;t+=2){var e=b[t];var n=b[t+1];e(n);b[t]=undefined;b[t+1]=undefined}i=0}function _(){try{var t=Function("return this")().require("vertx");e=t.runOnLoop||t.runOnContext;return g()}catch(t){return x()}}var M=void 0;if(p){M=m()}else if(d){M=v()}else if(f){M=y()}else if(h===undefined&&"function"==="function"){M=_()}else{M=x()}function E(t,e){var n=this;var r=new this.constructor(A);if(r[T]===undefined){X(r)}var i=n._state;if(i){var a=arguments[i-1];o(function(){return V(i,r,a,n._result)})}else{H(n,r,t,e)}return r}function S(t){var e=this;if(t&&typeof t==="object"&&t.constructor===e){return t}var n=new e(A);z(n,t);return n}var T=Math.random().toString(36).substring(2);function A(){}var L=void 0,P=1,C=2;function R(){return new TypeError("You cannot resolve a promise with itself")}function O(){return new TypeError("A promises callback cannot return that same promise.")}function I(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}function D(t,r,i){o(function(e){var n=false;var t=I(i,r,function(t){if(n){return}n=true;if(r!==t){z(e,t)}else{G(e,t)}},function(t){if(n){return}n=true;F(e,t)},"Settle: "+(e._label||" unknown promise"));if(!n&&t){n=true;F(e,t)}},t)}function B(e,t){if(t._state===P){G(e,t._result)}else if(t._state===C){F(e,t._result)}else{H(t,undefined,function(t){return z(e,t)},function(t){return F(e,t)})}}function N(t,e,n){if(e.constructor===t.constructor&&n===E&&e.constructor.resolve===S){B(t,e)}else{if(n===undefined){G(t,e)}else if(c(n)){D(t,e,n)}else{G(t,e)}}}function z(e,t){if(e===t){F(e,R())}else if(r(t)){var n=void 0;try{n=t.then}catch(t){F(e,t);return}N(e,t,n)}else{G(e,t)}}function U(t){if(t._onerror){t._onerror(t._result)}k(t)}function G(t,e){if(t._state!==L){return}t._result=e;t._state=P;if(t._subscribers.length!==0){o(k,t)}}function F(t,e){if(t._state!==L){return}t._state=C;t._result=e;o(U,t)}function H(t,e,n,r){var i=t._subscribers;var a=i.length;t._onerror=null;i[a]=e;i[a+P]=n;i[a+C]=r;if(a===0&&t._state){o(k,t)}}function k(t){var e=t._subscribers;var n=t._state;if(e.length===0){return}var r=void 0,i=void 0,a=t._result;for(var o=0;o<e.length;o+=3){r=e[o];i=e[o+n];if(r){V(n,r,i,a)}else{i(a)}}t._subscribers.length=0}function V(t,e,n,r){var i=c(n),a=void 0,o=void 0,s=true;if(i){try{a=n(r)}catch(t){s=false;o=t}if(e===a){F(e,O());return}}else{a=r}if(e._state!==L){}else if(i&&s){z(e,a)}else if(s===false){F(e,o)}else if(t===P){G(e,a)}else if(t===C){F(e,a)}}function j(n,t){try{t(function t(e){z(n,e)},function t(e){F(n,e)})}catch(t){F(n,t)}}var W=0;function q(){return W++}function X(t){t[T]=W++;t._state=undefined;t._result=undefined;t._subscribers=[]}function Y(){return new Error("Array Methods must be provided an Array")}var J=function(){function t(t,e){this._instanceConstructor=t;this.promise=new t(A);if(!this.promise[T]){X(this.promise)}if(n(e)){this.length=e.length;this._remaining=e.length;this._result=new Array(this.length);if(this.length===0){G(this.promise,this._result)}else{this.length=this.length||0;this._enumerate(e);if(this._remaining===0){G(this.promise,this._result)}}}else{F(this.promise,Y())}}t.prototype._enumerate=function t(e){for(var n=0;this._state===L&&n<e.length;n++){this._eachEntry(e[n],n)}};t.prototype._eachEntry=function t(e,n){var r=this._instanceConstructor;var i=r.resolve;if(i===S){var a=void 0;var o=void 0;var s=false;try{a=e.then}catch(t){s=true;o=t}if(a===E&&e._state!==L){this._settledAt(e._state,n,e._result)}else if(typeof a!=="function"){this._remaining--;this._result[n]=e}else if(r===et){var c=new r(A);if(s){F(c,o)}else{N(c,e,a)}this._willSettleAt(c,n)}else{this._willSettleAt(new r(function(t){return t(e)}),n)}}else{this._willSettleAt(i(e),n)}};t.prototype._settledAt=function t(e,n,r){var i=this.promise;if(i._state===L){this._remaining--;if(e===C){F(i,r)}else{this._result[n]=r}}if(this._remaining===0){G(i,this._result)}};t.prototype._willSettleAt=function t(e,n){var r=this;H(e,undefined,function(t){return r._settledAt(P,n,t)},function(t){return r._settledAt(C,n,t)})};return t}();function Z(t){return new J(this,t).promise}function Q(i){var a=this;if(n(i))return new a(function(t,e){for(var n=i.length,r=0;r<n;r++)a.resolve(i[r]).then(t,e)});else return new a(function(t,e){return e(new TypeError("You must pass an array to race."))})}function K(t){var e=new this(A);return F(e,t),e}function $(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function tt(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var et=function(){function e(t){this[T]=q();this._result=this._state=undefined;this._subscribers=[];if(A!==t){typeof t!=="function"&&$();this instanceof e?j(this,t):tt()}}e.prototype.catch=function t(e){return this.then(null,e)};e.prototype.finally=function t(e){var n=this;var r=n.constructor;if(c(e)){return n.then(function(t){return r.resolve(e()).then(function(){return t})},function(t){return r.resolve(e()).then(function(){throw t})})}return n.then(e,e)};return e}();function nt(){var t=void 0;if(void 0!==it)t=it;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=et}return et.prototype.then=E,et.all=function(t){return new J(this,t).promise},et.race=function(i){var a=this;return n(i)?new a(function(t,e){for(var n=i.length,r=0;r<n;r++)a.resolve(i[r]).then(t,e)}):new a(function(t,e){return e(new TypeError("You must pass an array to race."))})},et.resolve=S,et.reject=function(t){var e=new this(A);return F(e,t),e},et._setScheduler=function(t){a=t},et._setAsap=function(t){o=t},et._asap=o,et.polyfill=function(){var t=void 0;if(void 0!==it)t=it;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=et},et.Promise=et}()}).call(this,n(3),n(6))},function(t,e){var n,r,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var c,u=[],h=!1,l=-1;function d(){h&&c&&(h=!1,c.length?u=c.concat(u):l=-1,u.length&&p())}function p(){if(!h){var t=s(d);h=!0;for(var e=u.length;e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,h=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||h||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},,,function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n}]]);